@thxgg/steward 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{C_NevjZD.js → BSA0RJ-H.js} +1 -1
- package/.output/public/_nuxt/{BubpH_wW.js → BWVTacYj.js} +1 -1
- package/.output/public/_nuxt/{CMu9GKTH.js → Bibm_IDv.js} +2 -2
- package/.output/public/_nuxt/{wbj-mIhK.js → CVJh28bx.js} +1 -1
- package/.output/public/_nuxt/{BDqHART1.js → CxHOXVf6.js} +1 -1
- package/.output/public/_nuxt/CyZuidLG.js +60 -0
- package/.output/public/_nuxt/{qt5OEWHC.js → D0op9E2g.js} +1 -1
- package/.output/public/_nuxt/{CVvrkZkq.js → DX8awZaa.js} +1 -1
- package/.output/public/_nuxt/Detail.z33AHKev.css +1 -0
- package/.output/public/_nuxt/{C2HGkiSP.js → DiTJUZOC.js} +1 -1
- package/.output/public/_nuxt/{nYTZJhvT.js → Dum5qplW.js} +1 -1
- package/.output/public/_nuxt/{BPeTf9dd.js → T_3JE9C-.js} +1 -1
- package/.output/public/_nuxt/WOI2tLsR.js +42 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/029070b0-b8e2-4988-84f4-d0c9ff55c998.json +1 -0
- package/.output/public/_nuxt/{B-5VWizU.js → odRGDGwj.js} +1 -1
- package/.output/public/_nuxt/{qKRNa41x.js → wbjFvimm.js} +1 -1
- package/.output/public/_nuxt/{uTyw4SRK.js → ynmyrfyT.js} +1 -1
- package/.output/server/chunks/build/{Detail-DC-KJQ1f.mjs → Detail-CUfU85GY.mjs} +26 -26
- package/.output/server/chunks/build/Detail-CUfU85GY.mjs.map +1 -0
- package/.output/server/chunks/build/DiffViewer-styles-1.mjs-CS8FTppg.mjs +4 -0
- package/.output/server/chunks/build/DiffViewer-styles-1.mjs-CS8FTppg.mjs.map +1 -0
- package/.output/server/chunks/build/DiffViewer-styles.AUfwwelI.mjs +10 -0
- package/.output/server/chunks/build/DiffViewer-styles.AUfwwelI.mjs.map +1 -0
- package/.output/server/chunks/build/DiffViewer-styles.D_it8zfk.mjs +8 -0
- package/.output/server/chunks/build/DiffViewer-styles.D_it8zfk.mjs.map +1 -0
- package/.output/server/chunks/build/{_prd_-C1C4GAhW.mjs → _prd_-CeVnQzOV.mjs} +3 -3
- package/.output/server/chunks/build/_prd_-CeVnQzOV.mjs.map +1 -0
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/{repo-graph-CTEkxiYd.mjs → repo-graph-CHNl58mY.mjs} +3 -3
- package/.output/server/chunks/build/repo-graph-CHNl58mY.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +2 -2
- package/.output/server/chunks/build/styles.mjs +2 -2
- package/.output/server/chunks/nitro/nitro.mjs +612 -612
- package/.output/server/package.json +1 -1
- package/package.json +1 -1
- package/.output/public/_nuxt/-k8zG74W.js +0 -61
- package/.output/public/_nuxt/BMAq0QVD.js +0 -42
- package/.output/public/_nuxt/Detail.CzXXlavD.css +0 -1
- package/.output/public/_nuxt/builds/meta/c1a7997d-8d53-4718-ad03-a977e05e2523.json +0 -1
- package/.output/server/chunks/build/Detail-DC-KJQ1f.mjs.map +0 -1
- package/.output/server/chunks/build/DiffViewer-styles-1.mjs-D0sb4vsK.mjs +0 -4
- package/.output/server/chunks/build/DiffViewer-styles-1.mjs-D0sb4vsK.mjs.map +0 -1
- package/.output/server/chunks/build/DiffViewer-styles.CkSjCQ0r.mjs +0 -10
- package/.output/server/chunks/build/DiffViewer-styles.CkSjCQ0r.mjs.map +0 -1
- package/.output/server/chunks/build/DiffViewer-styles.FJJuYjYB.mjs +0 -8
- package/.output/server/chunks/build/DiffViewer-styles.FJJuYjYB.mjs.map +0 -1
- package/.output/server/chunks/build/_prd_-C1C4GAhW.mjs.map +0 -1
- package/.output/server/chunks/build/repo-graph-CTEkxiYd.mjs.map +0 -1
- package/.output/server/node_modules/shiki/dist/bundle-web.mjs +0 -366
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DxNHbxmM.js","./CnnebwVN.js","./wDzz0qaB.js","./DPfMkruS.js","./Cl0AqbOI.js","./2EtD6e53.js","./Cn7AkR1O.js","./BGJmEYvX.js","./CylS5w8V.js","./Cp-IABpG.js","./DxSwrfjg.js","./BPQ3VLAy.js","./CXtECtnM.js","./COt5Ahok.js","./5X7smno1.js","./DGP4VlC8.js","./BLtJtn59.js","./CquLrc37.js","./DVxCFoDh.js","./CO1LY3CK.js","./B6aJPvgy.js","./BYV0-3_D.js","./CxbxFI8M.js","./Bp3cYrEr.js","./CDVJQ6XC.js","./DZxFcAj9.js","./BIGW1oBm.js","./fKv21gyL.js","./Yzrsuije.js","./DZu-aV2c.js","./CpOuai2O.js","./CeZK1NFH.js","./CGscLIrv.js","./Bhrxn6JZ.js","./CmIQRyeF.js","./C9oPPf7i.js","./g9-lgVsj.js","./CnsnAmq5.js","./Buea-lGh.js","./CuPHTKiy.js","./Cvjx9yec.js","./B7c-h3xW.js","./BxgE0vQu.js","./BTifaqeh.js","./CenWIFCC.js","./DkwncUOv.js","./C5YyOfLZ.js","./CxGSJlkm.js","./D97Zzqfu.js","./CSXwinHm.js","./YqXBG_HV.js","./BR5kRUq4.js","./CLZrNe3w.js","./m17aaUwq.js","./CufHLc7y.js","./CYsAdtH9.js","./fuZLfV_i.js","./DWrx1Km3.js","./CzTSHFRz.js","./CXZktZb0.js","./Br6cN0cg.js","./W9tJ9s81.js","./Dspwwk_N.js","./DMwsHuHA.js","./CQ8jqdy-.js","./mjskCLCv.js","./83L43bj1.js","./B1dDrJ26.js","./TsXTqZ29.js","./Dph4kLrZ.js","./DhmSosst.js","./BzTr9Aqm.js","./DJjDtW9f.js","./BLmx8bSh.js","./BVQ-GDCI.js","./DsumFeuD.js","./COcwbKMJ.js","./DQwYQDb2.js","./D1j8_8rp.js","./CG8Ifv2g.js","./BqTXFGrv.js","./D3lLCCz7.js","./Cq5zzVJU.js","./Dzze3sRP.js","./BRZ36xJF.js","./BsS91CYL.js","./DM8c43g1.js","./BH7IYjvW.js","./DYoxhk2S.js","./CZhp0h8q.js","./CxLEBnE3.js","./Cm3UrAx6.js","./RNghxpo_.js","./DEthMvLe.js","./DqQDbK_p.js","./CW8IKDeL.js","./BEDo0Tqx.js","./yv6CvBhz.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as De,f as cc,t as dc,g as fc,h as hc,P as ar,i as pc,j as Ha,d as mc,k as us,l as gc,B as Vt,r as Ga,e as ja,b as vc,F as _c}from"./D0op9E2g.js";import{N as Zr,q as fe,z as it,s as oe,g as _e,y as ke,O as qa,o as q,x as be,w as pe,l as C,c as ee,L as tt,k as xe,P as Ni,Q as Bn,R as on,C as Tt,b as ie,E as Xe,S as yc,J as lr,K as ur,v as Wa,d as Pe,t as me,p as wc,I as ot,T as bc,_ as S,U as Ec,A as Ua,i as Cn,V as Ya,H as He,W as xc,a as K,F as Ie,r as rt,B as Nt,D as Xa,X as kc,n as ve,Y as Oe,Z as Tn,$ as vn,a0 as Ae,a1 as Ce,a2 as Sc,m as Oi,a3 as Cc,a4 as Ln,a5 as cn,a6 as Tc,a7 as Ka,a8 as Pc,a9 as Ac,aa as Nc,ab as Oc}from"./Bibm_IDv.js";import{c as cr,b as dt,V as Ic,D as Rc,e as Lc,d as Ii,P as Dc,T as Mc,a as $c,L as Jr,C as Lo,G as Vc,f as Bc,R as cs,K as zc,S as Fc,g as Hc,B as Co,h as Gc,i as jc,j as qc,k as Wc,l as Uc,m as Yc,n as Xc,o as Kc,p as Zc}from"./BSA0RJ-H.js";import{A as ds}from"./Dum5qplW.js";import{_ as Jc}from"./DlAUqK2U.js";import{_ as Qc}from"./CVJh28bx.js";const ed=De("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const td=De("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const Do=De("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const zn=De("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Za=De("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const nd=De("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const od=De("diff",[["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 10h14",key:"elsbfy"}],["path",{d:"M5 21h14",key:"11awu3"}]]);const rd=De("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const id=De("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]);const sd=De("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);const ad=De("file-exclamation-point",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const ld=De("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);const ud=De("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);const cd=De("file-x",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14.5 12.5-5 5",key:"b62r18"}],["path",{d:"m9.5 12.5 5 5",key:"1rk7el"}]]);const dd=De("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);const fd=De("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);const hd=De("link-2-off",[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);const pd=De("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const md=De("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);const gd=De("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]);const vd=De("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const _d=De("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const yd=De("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);const _n=De("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function wd(e,t){const n=cc(!1,300);dc(()=>{n.value=!1});const o=fe(null),r=fc();function i(){o.value=null,n.value=!1}function s(a,l){const u=a.currentTarget,c={x:a.clientX,y:a.clientY},d=bd(c,u.getBoundingClientRect()),h=Ed(c,d,1),f=xd(l.getBoundingClientRect()),p=Sd([...h,...f]);o.value=p,n.value=!0}return Zr(a=>{if(e.value&&t.value){const l=c=>s(c,t.value),u=c=>s(c,e.value);e.value.addEventListener("pointerleave",l),t.value.addEventListener("pointerleave",u),a(()=>{e.value?.removeEventListener("pointerleave",l),t.value?.removeEventListener("pointerleave",u)})}}),Zr(a=>{if(o.value){const l=u=>{if(!o.value||!(u.target instanceof Element))return;const c=u.target,d={x:u.clientX,y:u.clientY},h=e.value?.contains(c)||t.value?.contains(c),f=!kd(d,o.value),p=!!c.closest("[data-grace-area-trigger]");h?i():(f||p)&&(i(),r.trigger())};e.value?.ownerDocument.addEventListener("pointermove",l),a(()=>e.value?.ownerDocument.removeEventListener("pointermove",l))}}),{isPointerInTransit:n,onPointerExit:r.on}}function bd(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Ed(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function xd(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function kd(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,u=t[s].x,c=t[s].y;l>o!=c>o&&n<(u-a)*(o-l)/(c-l)+a&&(r=!r)}return r}function Sd(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),Cd(t)}function Cd(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}function Td(e){const t=fe(),n=oe(()=>t.value?.width??0),o=oe(()=>t.value?.height??0);return it(()=>{const r=hc(e);if(r){t.value={width:r.offsetWidth,height:r.offsetHeight};const i=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let l,u;if("borderBoxSize"in a){const c=a.borderBoxSize,d=Array.isArray(c)?c[0]:c;l=d.inlineSize,u=d.blockSize}else l=r.offsetWidth,u=r.offsetHeight;t.value={width:l,height:u}});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else t.value=void 0}),{width:n,height:o}}const[Ja,Pd]=cr("PopperRoot");var Ad=_e({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=fe();return Pd({anchor:t,onAnchorChange:n=>t.value=n}),(n,o)=>ke(n.$slots,"default")}}),Nd=Ad,Od=_e({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:n,currentElement:o}=dt(),r=Ja();return qa(()=>{r.onAnchorChange(t.reference??o.value)}),(i,s)=>(q(),be(C(ar),{ref:C(n),as:i.as,"as-child":i.asChild},{default:pe(()=>[ke(i.$slots,"default")]),_:3},8,["as","as-child"]))}}),Id=Od;const Rd={key:0,d:"M0 0L6 6L12 0"},Ld={key:1,d:"M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0"};var Dd=_e({__name:"Arrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const t=e;return dt(),(n,o)=>(q(),be(C(ar),tt(t,{width:n.width,height:n.height,viewBox:n.asChild?void 0:"0 0 12 6",preserveAspectRatio:n.asChild?void 0:"none"}),{default:pe(()=>[ke(n.$slots,"default",{},()=>[n.rounded?(q(),ee("path",Ld)):(q(),ee("path",Rd))])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),Md=Dd;function $d(e){return e!==null}function Vd(e){return{name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,s=r.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,c]=Qr(n),d={start:"0%",center:"50%",end:"100%"}[c],h=(r.arrow?.x??0)+a/2,f=(r.arrow?.y??0)+l/2;let p="",v="";return u==="bottom"?(p=s?d:`${h}px`,v=`${-l}px`):u==="top"?(p=s?d:`${h}px`,v=`${o.floating.height+l}px`):u==="right"?(p=`${-l}px`,v=s?d:`${f}px`):u==="left"&&(p=`${o.floating.width+l}px`,v=s?d:`${f}px`),{data:{x:p,y:v}}}}}function Qr(e){const[t,n="center"]=e.split("-");return[t,n]}const Bd=["top","right","bottom","left"],zt=Math.min,Je=Math.max,Mo=Math.round,co=Math.floor,wt=e=>({x:e,y:e}),zd={left:"right",right:"left",bottom:"top",top:"bottom"},Fd={start:"end",end:"start"};function ei(e,t,n){return Je(e,zt(t,n))}function Ot(e,t){return typeof e=="function"?e(t):e}function It(e){return e.split("-")[0]}function Pn(e){return e.split("-")[1]}function Ri(e){return e==="x"?"y":"x"}function Li(e){return e==="y"?"height":"width"}const Hd=new Set(["top","bottom"]);function yt(e){return Hd.has(It(e))?"y":"x"}function Di(e){return Ri(yt(e))}function Gd(e,t,n){n===void 0&&(n=!1);const o=Pn(e),r=Di(e),i=Li(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=$o(s)),[s,$o(s)]}function jd(e){const t=$o(e);return[ti(e),t,ti(t)]}function ti(e){return e.replace(/start|end/g,t=>Fd[t])}const fs=["left","right"],hs=["right","left"],qd=["top","bottom"],Wd=["bottom","top"];function Ud(e,t,n){switch(e){case"top":case"bottom":return n?t?hs:fs:t?fs:hs;case"left":case"right":return t?qd:Wd;default:return[]}}function Yd(e,t,n,o){const r=Pn(e);let i=Ud(It(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(ti)))),i}function $o(e){return e.replace(/left|right|bottom|top/g,t=>zd[t])}function Xd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Qa(e){return typeof e!="number"?Xd(e):{top:e,right:e,bottom:e,left:e}}function Vo(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function ps(e,t,n){let{reference:o,floating:r}=e;const i=yt(t),s=Di(t),a=Li(s),l=It(t),u=i==="y",c=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,h=o[a]/2-r[a]/2;let f;switch(l){case"top":f={x:c,y:o.y-r.height};break;case"bottom":f={x:c,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-r.width,y:d};break;default:f={x:o.x,y:o.y}}switch(Pn(t)){case"start":f[s]-=h*(n&&u?-1:1);break;case"end":f[s]+=h*(n&&u?-1:1);break}return f}async function Kd(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=Ot(t,e),p=Qa(f),y=a[h?d==="floating"?"reference":"floating":d],_=Vo(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),b=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,m=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(m))?await(i.getScale==null?void 0:i.getScale(m))||{x:1,y:1}:{x:1,y:1},A=Vo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:m,strategy:l}):b);return{top:(_.top-A.top+p.top)/w.y,bottom:(A.bottom-_.bottom+p.bottom)/w.y,left:(_.left-A.left+p.left)/w.x,right:(A.right-_.right+p.right)/w.x}}const Zd=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:c,y:d}=ps(u,o,l),h=o,f={},p=0;for(let y=0;y<a.length;y++){var v;const{name:_,fn:b}=a[y],{x:m,y:w,data:A,reset:D}=await b({x:c,y:d,initialPlacement:o,placement:h,strategy:r,middlewareData:f,rects:u,platform:{...s,detectOverflow:(v=s.detectOverflow)!=null?v:Kd},elements:{reference:e,floating:t}});c=m??c,d=w??d,f={...f,[_]:{...f[_],...A}},D&&p<=50&&(p++,typeof D=="object"&&(D.placement&&(h=D.placement),D.rects&&(u=D.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):D.rects),{x:c,y:d}=ps(u,h,l)),y=-1)}return{x:c,y:d,placement:h,strategy:r,middlewareData:f}},Jd=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=Ot(e,t)||{};if(u==null)return{};const d=Qa(c),h={x:n,y:o},f=Di(r),p=Li(f),v=await s.getDimensions(u),y=f==="y",_=y?"top":"left",b=y?"bottom":"right",m=y?"clientHeight":"clientWidth",w=i.reference[p]+i.reference[f]-h[f]-i.floating[p],A=h[f]-i.reference[f],D=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let z=D?D[m]:0;(!z||!await(s.isElement==null?void 0:s.isElement(D)))&&(z=a.floating[m]||i.floating[p]);const G=w/2-A/2,Z=z/2-v[p]/2-1,N=zt(d[_],Z),T=zt(d[b],Z),E=N,P=z-v[p]-T,g=z/2-v[p]/2+G,O=ei(E,g,P),k=!l.arrow&&Pn(r)!=null&&g!==O&&i.reference[p]/2-(g<E?N:T)-v[p]/2<0,R=k?g<E?g-E:g-P:0;return{[f]:h[f]+R,data:{[f]:O,centerOffset:g-O-R,...k&&{alignmentOffset:R}},reset:k}}}),Qd=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...y}=Ot(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const _=It(r),b=yt(a),m=It(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(u.floating)),A=h||(m||!v?[$o(a)]:jd(a)),D=p!=="none";!h&&D&&A.push(...Yd(a,v,p,w));const z=[a,...A],G=await l.detectOverflow(t,y),Z=[];let N=((o=i.flip)==null?void 0:o.overflows)||[];if(c&&Z.push(G[_]),d){const g=Gd(r,s,w);Z.push(G[g[0]],G[g[1]])}if(N=[...N,{placement:r,overflows:Z}],!Z.every(g=>g<=0)){var T,E;const g=(((T=i.flip)==null?void 0:T.index)||0)+1,O=z[g];if(O&&(!(d==="alignment"?b!==yt(O):!1)||N.every(M=>yt(M.placement)===b?M.overflows[0]>0:!0)))return{data:{index:g,overflows:N},reset:{placement:O}};let k=(E=N.filter(R=>R.overflows[0]<=0).sort((R,M)=>R.overflows[1]-M.overflows[1])[0])==null?void 0:E.placement;if(!k)switch(f){case"bestFit":{var P;const R=(P=N.filter(M=>{if(D){const H=yt(M.placement);return H===b||H==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(H=>H>0).reduce((H,j)=>H+j,0)]).sort((M,H)=>M[1]-H[1])[0])==null?void 0:P[0];R&&(k=R);break}case"initialPlacement":k=a;break}if(r!==k)return{reset:{placement:k}}}return{}}}};function ms(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gs(e){return Bd.some(t=>e[t]>=0)}const ef=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...i}=Ot(e,t);switch(r){case"referenceHidden":{const s=await o.detectOverflow(t,{...i,elementContext:"reference"}),a=ms(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:gs(a)}}}case"escaped":{const s=await o.detectOverflow(t,{...i,altBoundary:!0}),a=ms(s,n.floating);return{data:{escapedOffsets:a,escaped:gs(a)}}}default:return{}}}}},el=new Set(["left","top"]);async function tf(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=It(n),a=Pn(n),l=yt(n)==="y",u=el.has(s)?-1:1,c=i&&l?-1:1,d=Ot(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),l?{x:f*c,y:h*u}:{x:h*u,y:f*c}}const nf=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=t,l=await tf(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},of=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:_=>{let{x:b,y:m}=_;return{x:b,y:m}}},...u}=Ot(e,t),c={x:n,y:o},d=await i.detectOverflow(t,u),h=yt(It(r)),f=Ri(h);let p=c[f],v=c[h];if(s){const _=f==="y"?"top":"left",b=f==="y"?"bottom":"right",m=p+d[_],w=p-d[b];p=ei(m,p,w)}if(a){const _=h==="y"?"top":"left",b=h==="y"?"bottom":"right",m=v+d[_],w=v-d[b];v=ei(m,v,w)}const y=l.fn({...t,[f]:p,[h]:v});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[f]:s,[h]:a}}}}}},rf=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Ot(e,t),c={x:n,y:o},d=yt(r),h=Ri(d);let f=c[h],p=c[d];const v=Ot(a,t),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const m=h==="y"?"height":"width",w=i.reference[h]-i.floating[m]+y.mainAxis,A=i.reference[h]+i.reference[m]-y.mainAxis;f<w?f=w:f>A&&(f=A)}if(u){var _,b;const m=h==="y"?"width":"height",w=el.has(It(r)),A=i.reference[d]-i.floating[m]+(w&&((_=s.offset)==null?void 0:_[d])||0)+(w?0:y.crossAxis),D=i.reference[d]+i.reference[m]+(w?0:((b=s.offset)==null?void 0:b[d])||0)-(w?y.crossAxis:0);p<A?p=A:p>D&&(p=D)}return{[h]:f,[d]:p}}}},sf=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=Ot(e,t),c=await s.detectOverflow(t,u),d=It(r),h=Pn(r),f=yt(r)==="y",{width:p,height:v}=i.floating;let y,_;d==="top"||d==="bottom"?(y=d,_=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(_=d,y=h==="end"?"top":"bottom");const b=v-c.top-c.bottom,m=p-c.left-c.right,w=zt(v-c[y],b),A=zt(p-c[_],m),D=!t.middlewareData.shift;let z=w,G=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(G=m),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(z=b),D&&!h){const N=Je(c.left,0),T=Je(c.right,0),E=Je(c.top,0),P=Je(c.bottom,0);f?G=p-2*(N!==0||T!==0?N+T:Je(c.left,c.right)):z=v-2*(E!==0||P!==0?E+P:Je(c.top,c.bottom))}await l({...t,availableWidth:G,availableHeight:z});const Z=await s.getDimensions(a.floating);return p!==Z.width||v!==Z.height?{reset:{rects:!0}}:{}}}};function dr(){return typeof window<"u"}function tn(e){return Mi(e)?(e.nodeName||"").toLowerCase():"#document"}function Qe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xt(e){var t;return(t=(Mi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Mi(e){return dr()?e instanceof Node||e instanceof Qe(e).Node:!1}function lt(e){return dr()?e instanceof Element||e instanceof Qe(e).Element:!1}function Et(e){return dr()?e instanceof HTMLElement||e instanceof Qe(e).HTMLElement:!1}function vs(e){return!dr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qe(e).ShadowRoot}const af=new Set(["inline","contents"]);function ro(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ut(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!af.has(r)}const lf=new Set(["table","td","th"]);function uf(e){return lf.has(tn(e))}const cf=[":popover-open",":modal"];function fr(e){return cf.some(t=>{try{return e.matches(t)}catch{return!1}})}const df=["transform","translate","scale","rotate","perspective"],ff=["transform","translate","scale","rotate","perspective","filter"],hf=["paint","layout","strict","content"];function $i(e){const t=Vi(),n=lt(e)?ut(e):e;return df.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||ff.some(o=>(n.willChange||"").includes(o))||hf.some(o=>(n.contain||"").includes(o))}function pf(e){let t=Ft(e);for(;Et(t)&&!yn(t);){if($i(t))return t;if(fr(t))return null;t=Ft(t)}return null}function Vi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const mf=new Set(["html","body","#document"]);function yn(e){return mf.has(tn(e))}function ut(e){return Qe(e).getComputedStyle(e)}function hr(e){return lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ft(e){if(tn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vs(e)&&e.host||xt(e);return vs(t)?t.host:t}function tl(e){const t=Ft(e);return yn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Et(t)&&ro(t)?t:tl(t)}function qn(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=tl(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=Qe(r);if(i){const a=ni(s);return t.concat(s,s.visualViewport||[],ro(r)?r:[],a&&n?qn(a):[])}return t.concat(r,qn(r,[],n))}function ni(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nl(e){const t=ut(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Et(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=Mo(n)!==i||Mo(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function Bi(e){return lt(e)?e:e.contextElement}function dn(e){const t=Bi(e);if(!Et(t))return wt(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=nl(t);let s=(i?Mo(n.width):n.width)/o,a=(i?Mo(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const gf=wt(0);function ol(e){const t=Qe(e);return!Vi()||!t.visualViewport?gf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Qe(e)?!1:t}function Zt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=Bi(e);let s=wt(1);t&&(o?lt(o)&&(s=dn(o)):s=dn(e));const a=vf(i,n,o)?ol(i):wt(0);let l=(r.left+a.x)/s.x,u=(r.top+a.y)/s.y,c=r.width/s.x,d=r.height/s.y;if(i){const h=Qe(i),f=o&<(o)?Qe(o):o;let p=h,v=ni(p);for(;v&&o&&f!==p;){const y=dn(v),_=v.getBoundingClientRect(),b=ut(v),m=_.left+(v.clientLeft+parseFloat(b.paddingLeft))*y.x,w=_.top+(v.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=m,u+=w,p=Qe(v),v=ni(p)}}return Vo({width:c,height:d,x:l,y:u})}function pr(e,t){const n=hr(e).scrollLeft;return t?t.left+n:Zt(xt(e)).left+n}function rl(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-pr(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function _f(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=xt(o),a=t?fr(t.floating):!1;if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=wt(1);const c=wt(0),d=Et(o);if((d||!d&&!i)&&((tn(o)!=="body"||ro(s))&&(l=hr(o)),Et(o))){const f=Zt(o);u=dn(o),c.x=f.x+o.clientLeft,c.y=f.y+o.clientTop}const h=s&&!d&&!i?rl(s,l):wt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:n.y*u.y-l.scrollTop*u.y+c.y+h.y}}function yf(e){return Array.from(e.getClientRects())}function wf(e){const t=xt(e),n=hr(e),o=e.ownerDocument.body,r=Je(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Je(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+pr(e);const a=-n.scrollTop;return ut(o).direction==="rtl"&&(s+=Je(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const _s=25;function bf(e,t){const n=Qe(e),o=xt(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,l=0;if(r){i=r.width,s=r.height;const c=Vi();(!c||c&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const u=pr(o);if(u<=0){const c=o.ownerDocument,d=c.body,h=getComputedStyle(d),f=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(o.clientWidth-d.clientWidth-f);p<=_s&&(i-=p)}else u<=_s&&(i+=u);return{width:i,height:s,x:a,y:l}}const Ef=new Set(["absolute","fixed"]);function xf(e,t){const n=Zt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Et(e)?dn(e):wt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=r*i.x,u=o*i.y;return{width:s,height:a,x:l,y:u}}function ys(e,t,n){let o;if(t==="viewport")o=bf(e,n);else if(t==="document")o=wf(xt(e));else if(lt(t))o=xf(t,n);else{const r=ol(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Vo(o)}function il(e,t){const n=Ft(e);return n===t||!lt(n)||yn(n)?!1:ut(n).position==="fixed"||il(n,t)}function kf(e,t){const n=t.get(e);if(n)return n;let o=qn(e,[],!1).filter(a=>lt(a)&&tn(a)!=="body"),r=null;const i=ut(e).position==="fixed";let s=i?Ft(e):e;for(;lt(s)&&!yn(s);){const a=ut(s),l=$i(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&Ef.has(r.position)||ro(s)&&!l&&il(e,s))?o=o.filter(c=>c!==s):r=a,s=Ft(s)}return t.set(e,o),o}function Sf(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?fr(t)?[]:kf(t,this._c):[].concat(n),o],a=s[0],l=s.reduce((u,c)=>{const d=ys(t,c,r);return u.top=Je(d.top,u.top),u.right=zt(d.right,u.right),u.bottom=zt(d.bottom,u.bottom),u.left=Je(d.left,u.left),u},ys(t,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Cf(e){const{width:t,height:n}=nl(e);return{width:t,height:n}}function Tf(e,t,n){const o=Et(t),r=xt(t),i=n==="fixed",s=Zt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=wt(0);function u(){l.x=pr(r)}if(o||!o&&!i)if((tn(t)!=="body"||ro(r))&&(a=hr(t)),o){const f=Zt(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else r&&u();i&&!o&&r&&u();const c=r&&!o&&!i?rl(r,a):wt(0),d=s.left+a.scrollLeft-l.x-c.x,h=s.top+a.scrollTop-l.y-c.y;return{x:d,y:h,width:s.width,height:s.height}}function Or(e){return ut(e).position==="static"}function ws(e,t){if(!Et(e)||ut(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xt(e)===n&&(n=n.ownerDocument.body),n}function sl(e,t){const n=Qe(e);if(fr(e))return n;if(!Et(e)){let r=Ft(e);for(;r&&!yn(r);){if(lt(r)&&!Or(r))return r;r=Ft(r)}return n}let o=ws(e,t);for(;o&&uf(o)&&Or(o);)o=ws(o,t);return o&&yn(o)&&Or(o)&&!$i(o)?n:o||pf(e)||n}const Pf=async function(e){const t=this.getOffsetParent||sl,n=this.getDimensions,o=await n(e.floating);return{reference:Tf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Af(e){return ut(e).direction==="rtl"}const Nf={convertOffsetParentRelativeRectToViewportRelativeRect:_f,getDocumentElement:xt,getClippingRect:Sf,getOffsetParent:sl,getElementRects:Pf,getClientRects:yf,getDimensions:Cf,getScale:dn,isElement:lt,isRTL:Af};function al(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Of(e,t){let n=null,o;const r=xt(e);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:c,top:d,width:h,height:f}=u;if(a||t(),!h||!f)return;const p=co(d),v=co(r.clientWidth-(c+h)),y=co(r.clientHeight-(d+f)),_=co(c),m={rootMargin:-p+"px "+-v+"px "+-y+"px "+-_+"px",threshold:Je(0,zt(1,l))||1};let w=!0;function A(D){const z=D[0].intersectionRatio;if(z!==l){if(!w)return s();z?s(!1,z):o=setTimeout(()=>{s(!1,1e-7)},1e3)}z===1&&!al(u,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(A,{...m,root:r.ownerDocument})}catch{n=new IntersectionObserver(A,m)}n.observe(e)}return s(!0),i}function If(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=Bi(e),c=r||i?[...u?qn(u):[],...qn(t)]:[];c.forEach(_=>{r&&_.addEventListener("scroll",n,{passive:!0}),i&&_.addEventListener("resize",n)});const d=u&&a?Of(u,n):null;let h=-1,f=null;s&&(f=new ResizeObserver(_=>{let[b]=_;b&&b.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var m;(m=f)==null||m.observe(t)})),n()}),u&&!l&&f.observe(u),f.observe(t));let p,v=l?Zt(e):null;l&&y();function y(){const _=Zt(e);v&&!al(v,_)&&n(),v=_,p=requestAnimationFrame(y)}return n(),()=>{var _;c.forEach(b=>{r&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(_=f)==null||_.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Rf=nf,Lf=of,bs=Qd,Df=sf,Mf=ef,$f=Jd,Vf=rf,Bf=(e,t,n)=>{const o=new Map,r={platform:Nf,...n},i={...r.platform,_c:o};return Zd(e,t,{...r,platform:i})};function zf(e){return e!=null&&typeof e=="object"&&"$el"in e}function oi(e){if(zf(e)){const t=e.$el;return Mi(t)&&tn(t)==="#comment"?null:t}return e}function ln(e){return typeof e=="function"?e():C(e)}function Ff(e){return{name:"arrow",options:e,fn(t){const n=oi(ln(e.element));return n==null?{}:$f({element:n,padding:e.padding}).fn(t)}}}function ll(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Es(e,t){const n=ll(e);return Math.round(t*n)/n}function Hf(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,r=oe(()=>{var z;return(z=ln(n.open))!=null?z:!0}),i=oe(()=>ln(n.middleware)),s=oe(()=>{var z;return(z=ln(n.placement))!=null?z:"bottom"}),a=oe(()=>{var z;return(z=ln(n.strategy))!=null?z:"absolute"}),l=oe(()=>{var z;return(z=ln(n.transform))!=null?z:!0}),u=oe(()=>oi(e.value)),c=oe(()=>oi(t.value)),d=fe(0),h=fe(0),f=fe(a.value),p=fe(s.value),v=Tt({}),y=fe(!1),_=oe(()=>{const z={position:f.value,left:"0",top:"0"};if(!c.value)return z;const G=Es(c.value,d.value),Z=Es(c.value,h.value);return l.value?{...z,transform:"translate("+G+"px, "+Z+"px)",...ll(c.value)>=1.5&&{willChange:"transform"}}:{position:f.value,left:G+"px",top:Z+"px"}});let b;function m(){if(u.value==null||c.value==null)return;const z=r.value;Bf(u.value,c.value,{middleware:i.value,placement:s.value,strategy:a.value}).then(G=>{d.value=G.x,h.value=G.y,f.value=G.strategy,p.value=G.placement,v.value=G.middlewareData,y.value=z!==!1})}function w(){typeof b=="function"&&(b(),b=void 0)}function A(){if(w(),o===void 0){m();return}if(u.value!=null&&c.value!=null){b=o(u.value,c.value,m);return}}function D(){r.value||(y.value=!1)}return xe([i,s,a,r],m,{flush:"sync"}),xe([u,c],A,{flush:"sync"}),xe(r,D,{flush:"sync"}),Ni()&&Bn(w),{x:on(d),y:on(h),strategy:on(f),placement:on(p),middlewareData:on(v),isPositioned:on(y),floatingStyles:_,update:m}}const Gf={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[jf,qf]=cr("PopperContent");var Wf=_e({inheritAttrs:!1,__name:"PopperContent",props:yc({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...Gf}),emits:["placed"],setup(e,{emit:t}){const n=e,o=t,r=Ja(),{forwardRef:i,currentElement:s}=dt(),a=fe(),l=fe(),{width:u,height:c}=Td(l),d=oe(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),h=oe(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),f=oe(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),p=oe(()=>({padding:h.value,boundary:f.value.filter($d),altBoundary:f.value.length>0})),v=oe(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),y=pc(()=>[Rf({mainAxis:n.sideOffset+c.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&bs({...p.value,...v.value}),n.avoidCollisions&&Lf({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?Vf():void 0,...p.value}),!n.prioritizePosition&&n.avoidCollisions&&bs({...p.value,...v.value}),Df({...p.value,apply:({elements:E,rects:P,availableWidth:g,availableHeight:O})=>{const{width:k,height:R}=P.reference,M=E.floating.style;M.setProperty("--reka-popper-available-width",`${g}px`),M.setProperty("--reka-popper-available-height",`${O}px`),M.setProperty("--reka-popper-anchor-width",`${k}px`),M.setProperty("--reka-popper-anchor-height",`${R}px`)}}),l.value&&Ff({element:l.value,padding:n.arrowPadding}),Vd({arrowWidth:u.value,arrowHeight:c.value}),n.hideWhenDetached&&Mf({strategy:"referenceHidden",...p.value})]),_=oe(()=>n.reference??r.anchor.value),{floatingStyles:b,placement:m,isPositioned:w,middlewareData:A}=Hf(_,a,{strategy:n.positionStrategy,placement:d,whileElementsMounted:(...E)=>If(...E,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:y}),D=oe(()=>Qr(m.value)[0]),z=oe(()=>Qr(m.value)[1]);qa(()=>{w.value&&o("placed")});const G=oe(()=>{const E=A.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&E}),Z=fe("");Zr(()=>{s.value&&(Z.value=window.getComputedStyle(s.value).zIndex)});const N=oe(()=>A.value.arrow?.x??0),T=oe(()=>A.value.arrow?.y??0);return qf({placedSide:D,onArrowChange:E=>l.value=E,arrowX:N,arrowY:T,shouldHideArrow:G}),(E,P)=>(q(),ee("div",{ref_key:"floatingRef",ref:a,"data-reka-popper-content-wrapper":"",style:Xe({...C(b),transform:C(w)?C(b).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z.value,"--reka-popper-transform-origin":[C(A).transformOrigin?.x,C(A).transformOrigin?.y].join(" "),...C(A).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[ie(C(ar),tt({ref:C(i)},E.$attrs,{"as-child":n.asChild,as:E.as,"data-side":D.value,"data-align":z.value,style:{animation:C(w)?void 0:"none"}}),{default:pe(()=>[ke(E.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),Uf=Wf;const Yf={top:"bottom",right:"left",bottom:"top",left:"right"};var Xf=_e({inheritAttrs:!1,__name:"PopperArrow",props:{width:{type:Number,required:!1},height:{type:Number,required:!1},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const{forwardRef:t}=dt(),n=jf(),o=oe(()=>Yf[n.placedSide.value]);return(r,i)=>(q(),ee("span",{ref:s=>{C(n).onArrowChange(s)},style:Xe({position:"absolute",left:C(n).arrowX?.value?`${C(n).arrowX?.value}px`:void 0,top:C(n).arrowY?.value?`${C(n).arrowY?.value}px`:void 0,[o.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[C(n).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[C(n).placedSide.value],visibility:C(n).shouldHideArrow.value?"hidden":void 0})},[ie(Md,tt(r.$attrs,{ref:C(t),style:{display:"block"},as:r.as,"as-child":r.asChild,rounded:r.rounded,width:r.width,height:r.height}),{default:pe(()=>[ke(r.$slots,"default")]),_:3},16,["as","as-child","rounded","width","height"])],4))}}),Kf=Xf,Zf=_e({__name:"TooltipArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const t=e;return dt(),(n,o)=>(q(),be(C(Kf),lr(ur(t)),{default:pe(()=>[ke(n.$slots,"default")]),_:3},16))}}),Jf=Zf;const[zi,Qf]=cr("TooltipProvider");var eh=_e({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1}},setup(e){const t=e,{delayDuration:n,skipDelayDuration:o,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:s,disabled:a}=Wa(t);dt();const l=fe(!0),u=fe(!1),{start:c,stop:d}=Ha(()=>{l.value=!0},o,{immediate:!1});return Qf({isOpenDelayed:l,delayDuration:n,onOpen(){d(),l.value=!1},onClose(){c()},isPointerInTransitRef:u,disableHoverableContent:r,disableClosingTrigger:i,disabled:a,ignoreNonKeyboardFocus:s}),(h,f)=>ke(h.$slots,"default")}}),th=eh;const ul="tooltip.open",[mr,nh]=cr("TooltipRoot");var oh=_e({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(e,{emit:t}){const n=e,o=t;dt();const r=zi(),i=oe(()=>n.disableHoverableContent??r.disableHoverableContent.value),s=oe(()=>n.disableClosingTrigger??r.disableClosingTrigger.value),a=oe(()=>n.disabled??r.disabled.value),l=oe(()=>n.delayDuration??r.delayDuration.value),u=oe(()=>n.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),c=mc(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0});xe(c,m=>{r.onClose&&(m?(r.onOpen(),document.dispatchEvent(new CustomEvent(ul))):r.onClose())});const d=fe(!1),h=fe(),f=oe(()=>c.value?d.value?"delayed-open":"instant-open":"closed"),{start:p,stop:v}=Ha(()=>{d.value=!0,c.value=!0},l,{immediate:!1});function y(){v(),d.value=!1,c.value=!0}function _(){v(),c.value=!1}function b(){p()}return nh({contentId:"",open:c,stateAttribute:f,trigger:h,onTriggerChange(m){h.value=m},onTriggerEnter(){r.isOpenDelayed.value?b():y()},onTriggerLeave(){i.value?_():v()},onOpen:y,onClose:_,disableHoverableContent:i,disableClosingTrigger:s,disabled:a,ignoreNonKeyboardFocus:u}),(m,w)=>(q(),be(C(Nd),null,{default:pe(()=>[ke(m.$slots,"default",{open:C(c)})]),_:3}))}}),rh=oh,ih=_e({__name:"TooltipContentImpl",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1,default:0},align:{type:null,required:!1,default:"center"},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:!0},collisionBoundary:{type:null,required:!1,default:()=>[]},collisionPadding:{type:[Number,Object],required:!1,default:0},arrowPadding:{type:Number,required:!1,default:0},sticky:{type:String,required:!1,default:"partial"},hideWhenDetached:{type:Boolean,required:!1,default:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=mr(),{forwardRef:i,currentElement:s}=dt(),a=oe(()=>n.ariaLabel||s.value?.textContent),l=oe(()=>{const{ariaLabel:u,...c}=n;return c});return it(()=>{us(window,"scroll",u=>{u.target?.contains(r.trigger.value)&&r.onClose()}),us(window,ul,r.onClose)}),(u,c)=>(q(),be(C(Rc),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:c[0]||(c[0]=d=>o("escapeKeyDown",d)),onPointerDownOutside:c[1]||(c[1]=d=>{C(r).disableClosingTrigger.value&&C(r).trigger.value?.contains(d.target)&&d.preventDefault(),o("pointerDownOutside",d)}),onFocusOutside:c[2]||(c[2]=wc(()=>{},["prevent"])),onDismiss:c[3]||(c[3]=d=>C(r).onClose())},{default:pe(()=>[ie(C(Uf),tt({ref:C(i),"data-state":C(r).stateAttribute.value},{...u.$attrs,...l.value},{style:{"--reka-tooltip-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-tooltip-content-available-width":"var(--reka-popper-available-width)","--reka-tooltip-content-available-height":"var(--reka-popper-available-height)","--reka-tooltip-trigger-width":"var(--reka-popper-anchor-width)","--reka-tooltip-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:pe(()=>[ke(u.$slots,"default"),ie(C(Ic),{id:C(r).contentId,role:"tooltip"},{default:pe(()=>[Pe(me(a.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),cl=ih,sh=_e({__name:"TooltipContentHoverable",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){const n=Lc(e),{forwardRef:o,currentElement:r}=dt(),{trigger:i,onClose:s}=mr(),a=zi(),{isPointerInTransit:l,onPointerExit:u}=wd(i,r);return a.isPointerInTransitRef=l,u(()=>{s()}),(c,d)=>(q(),be(cl,tt({ref:C(o)},C(n)),{default:pe(()=>[ke(c.$slots,"default")]),_:3},16))}}),ah=sh,lh=_e({__name:"TooltipContent",props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=mr(),i=Ii(n,o),{forwardRef:s}=dt();return(a,l)=>(q(),be(C(Dc),{present:a.forceMount||C(r).open.value},{default:pe(()=>[(q(),be(ot(C(r).disableHoverableContent.value?cl:ah),tt({ref:C(s)},C(i)),{default:pe(()=>[ke(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),uh=lh,ch=_e({__name:"TooltipPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(n,o)=>(q(),be(C(Mc),lr(ur(t)),{default:pe(()=>[ke(n.$slots,"default")]),_:3},16))}}),dh=ch,fh=_e({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,n=mr(),o=zi();n.contentId||=$c(void 0,"reka-tooltip-content");const{forwardRef:r,currentElement:i}=dt(),s=fe(!1),a=fe(!1),l=oe(()=>n.disabled.value?{}:{click:v,focus:f,pointermove:d,pointerleave:h,pointerdown:c,blur:p});it(()=>{n.onTriggerChange(i.value)});function u(){setTimeout(()=>{s.value=!1},1)}function c(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),s.value=!0,document.addEventListener("pointerup",u,{once:!0})}function d(y){y.pointerType!=="touch"&&!a.value&&!o.isPointerInTransitRef.value&&(n.onTriggerEnter(),a.value=!0)}function h(){n.onTriggerLeave(),a.value=!1}function f(y){s.value||n.ignoreNonKeyboardFocus.value&&!y.target.matches?.(":focus-visible")||n.onOpen()}function p(){n.onClose()}function v(){n.disableClosingTrigger.value||n.onClose()}return(y,_)=>(q(),be(C(Id),{"as-child":"",reference:y.reference},{default:pe(()=>[ie(C(ar),tt({ref:C(r),"aria-describedby":C(n).open.value?C(n).contentId:void 0,"data-state":C(n).stateAttribute.value,as:y.as,"as-child":t.asChild,"data-grace-area-trigger":""},bc(l.value)),{default:pe(()=>[ke(y.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),hh=fh;let Ve=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function ph(e){return Fi(e)}function Fi(e){return Array.isArray(e)?mh(e):e instanceof RegExp?e:typeof e=="object"?gh(e):e}function mh(e){let t=[];for(let n=0,o=e.length;n<o;n++)t[n]=Fi(e[n]);return t}function gh(e){let t={};for(let n in e)t[n]=Fi(e[n]);return t}function dl(e,...t){return t.forEach(n=>{for(let o in n)e[o]=n[o]}),e}function fl(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?fl(e.substring(0,e.length-1)):e.substr(~t+1)}var Ir=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,fo=class{static hasCaptures(e){return e===null?!1:(Ir.lastIndex=0,Ir.test(e))}static replaceCaptures(e,t,n){return e.replace(Ir,(o,r,i,s)=>{let a=n[parseInt(r||i,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(s){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return o})}};function hl(e,t){return e<t?-1:e>t?1:0}function pl(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,o=t.length;if(n===o){for(let r=0;r<n;r++){let i=hl(e[r],t[r]);if(i!==0)return i}return 0}return n-o}function xs(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function ml(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var gl=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Bo=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(yh(e),t)}static createFromParsedTheme(e,t){return bh(e,t)}_cachedMatchRoot=new gl(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,o=this._cachedMatchRoot.get(t).find(r=>vh(e.parent,r.parentScopes));return o?new vl(o.fontStyle,o.foreground,o.background):null}},Rr=class To{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const o of n)t=new To(t,o);return t}static from(...t){let n=null;for(let o=0;o<t.length;o++)n=new To(n,t[o]);return n}push(t){return new To(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let o=this;for(;o&&o!==t;)n.push(o.scopeName),o=o.parent;return o===t?n.reverse():void 0}};function vh(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let o=t[n],r=!1;if(o===">"){if(n===t.length-1)return!1;o=t[++n],r=!0}for(;e&&!_h(e.scopeName,o);){if(r)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function _h(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var vl=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function yh(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],o=0;for(let r=0,i=t.length;r<i;r++){let s=t[r];if(!s.settings)continue;let a;if(typeof s.scope=="string"){let d=s.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),a=d.split(",")}else Array.isArray(s.scope)?a=s.scope:a=[""];let l=-1;if(typeof s.settings.fontStyle=="string"){l=0;let d=s.settings.fontStyle.split(" ");for(let h=0,f=d.length;h<f;h++)switch(d[h]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let u=null;typeof s.settings.foreground=="string"&&xs(s.settings.foreground)&&(u=s.settings.foreground);let c=null;typeof s.settings.background=="string"&&xs(s.settings.background)&&(c=s.settings.background);for(let d=0,h=a.length;d<h;d++){let p=a[d].trim().split(" "),v=p[p.length-1],y=null;p.length>1&&(y=p.slice(0,p.length-1),y.reverse()),n[o++]=new wh(v,y,r,l,u,c)}}return n}var wh=class{constructor(e,t,n,o,r,i){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=o,this.foreground=r,this.background=i}},Ue=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Ue||{});function bh(e,t){e.sort((l,u)=>{let c=hl(l.scope,u.scope);return c!==0||(c=pl(l.parentScopes,u.parentScopes),c!==0)?c:l.index-u.index});let n=0,o="#000000",r="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(o=l.foreground),l.background!==null&&(r=l.background)}let i=new Eh(t),s=new vl(n,i.getId(o),i.getId(r)),a=new kh(new ri(0,null,-1,0,0),[]);for(let l=0,u=e.length;l<u;l++){let c=e[l];a.insert(0,c.scope,c.parentScopes,c.fontStyle,i.getId(c.foreground),i.getId(c.background))}return new Bo(i,s,a)}var Eh=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},xh=Object.freeze([]),ri=class _l{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,o,r,i){this.scopeDepth=t,this.parentScopes=n||xh,this.fontStyle=o,this.foreground=r,this.background=i}clone(){return new _l(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let o=0,r=t.length;o<r;o++)n[o]=t[o].clone();return n}acceptOverwrite(t,n,o,r){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),o!==0&&(this.foreground=o),r!==0&&(this.background=r)}},kh=class ii{constructor(t,n=[],o={}){this._mainRule=t,this._children=o,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let o=0,r=0;for(;t.parentScopes[o]===">"&&o++,n.parentScopes[r]===">"&&r++,!(o>=t.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-t.parentScopes[o].length;if(i!==0)return i;o++,r++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let o=t.indexOf("."),r,i;if(o===-1?(r=t,i=""):(r=t.substring(0,o),i=t.substring(o+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(ii._cmpBySpecificity),n}insert(t,n,o,r,i,s){if(n===""){this._doInsertHere(t,o,r,i,s);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let c;this._children.hasOwnProperty(l)?c=this._children[l]:(c=new ii(this._mainRule.clone(),ri.cloneArr(this._rulesWithParentScopes)),this._children[l]=c),c.insert(t+1,u,o,r,i,s)}_doInsertHere(t,n,o,r,i){if(n===null){this._mainRule.acceptOverwrite(t,o,r,i);return}for(let s=0,a=this._rulesWithParentScopes.length;s<a;s++){let l=this._rulesWithParentScopes[s];if(pl(l.parentScopes,n)===0){l.acceptOverwrite(t,o,r,i);return}}o===-1&&(o=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new ri(t,n,o,r,i))}},wn=class nt{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=nt.getLanguageId(t),o=nt.getTokenType(t),r=nt.getFontStyle(t),i=nt.getForeground(t),s=nt.getBackground(t);console.log({languageId:n,tokenType:o,fontStyle:r,foreground:i,background:s})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,o,r,i,s,a){let l=nt.getLanguageId(t),u=nt.getTokenType(t),c=nt.containsBalancedBrackets(t)?1:0,d=nt.getFontStyle(t),h=nt.getForeground(t),f=nt.getBackground(t);return n!==0&&(l=n),o!==8&&(u=o),r!==null&&(c=r?1:0),i!==-1&&(d=i),s!==0&&(h=s),a!==0&&(f=a),(l<<0|u<<8|c<<10|d<<11|h<<15|f<<24)>>>0}};function zo(e,t){const n=[],o=Sh(e);let r=o.next();for(;r!==null;){let l=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=o.next()}let u=s();if(n.push({matcher:u,priority:l}),r!==",")break;r=o.next()}return n;function i(){if(r==="-"){r=o.next();const l=i();return u=>!!l&&!l(u)}if(r==="("){r=o.next();const l=a();return r===")"&&(r=o.next()),l}if(ks(r)){const l=[];do l.push(r),r=o.next();while(ks(r));return u=>t(l,u)}return null}function s(){const l=[];let u=i();for(;u;)l.push(u),u=i();return c=>l.every(d=>d(c))}function a(){const l=[];let u=s();for(;u&&(l.push(u),r==="|"||r===",");){do r=o.next();while(r==="|"||r===",");u=s()}return c=>l.some(d=>d(c))}}function ks(e){return!!e&&!!e.match(/[\w\.:]+/)}function Sh(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const o=n[0];return n=t.exec(e),o}}}function yl(e){typeof e.dispose=="function"&&e.dispose()}var Wn=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Ch=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Th=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Ph=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Wn(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Th;for(const n of e)Ah(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Wn){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Ah(e,t,n,o){const r=n.lookup(e.scopeName);if(!r){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const i=n.lookup(t);e instanceof Wn?Po({baseGrammar:i,selfGrammar:r},o):si(e.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},o);const s=n.injections(e.scopeName);if(s)for(const a of s)o.add(new Wn(a))}function si(e,t,n){if(t.repository&&t.repository[e]){const o=t.repository[e];Fo([o],t,n)}}function Po(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Fo(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Fo(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Fo(e,t,n){for(const o of e){if(n.visitedRule.has(o))continue;n.visitedRule.add(o);const r=o.repository?dl({},t.repository,o.repository):t.repository;Array.isArray(o.patterns)&&Fo(o.patterns,{...t,repository:r},n);const i=o.include;if(!i)continue;const s=wl(i);switch(s.kind){case 0:Po({...t,selfGrammar:t.baseGrammar},n);break;case 1:Po(t,n);break;case 2:si(s.ruleName,{...t,repository:r},n);break;case 3:case 4:const a=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:r};s.kind===4?si(s.ruleName,l,n):Po(l,n)}else s.kind===4?n.add(new Ch(s.scopeName,s.ruleName)):n.add(new Wn(s.scopeName));break}}}var Nh=class{kind=0},Oh=class{kind=1},Ih=class{constructor(e){this.ruleName=e}kind=2},Rh=class{constructor(e){this.scopeName=e}kind=3},Lh=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function wl(e){if(e==="$base")return new Nh;if(e==="$self")return new Oh;const t=e.indexOf("#");if(t===-1)return new Rh(e);if(t===0)return new Ih(e.substring(1));{const n=e.substring(0,t),o=e.substring(t+1);return new Lh(n,o)}}var Dh=/\\(\d+)/,Ss=/\\(\d+)/g,Mh=-1,bl=-2;var io=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,o){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=fo.hasCaptures(this._name),this._contentName=o||null,this._contentNameIsCapturing=fo.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${fl(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:fo.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:fo.replaceCaptures(this._contentName,e,t)}},$h=class extends io{retokenizeCapturedWithRuleId;constructor(e,t,n,o,r){super(e,t,n,o),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,o){throw new Error("Not supported!")}},Vh=class extends io{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,o,r){super(e,t,n,null),this._match=new Un(o,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,o){return this._getCachedCompiledPatterns(e).compileAG(e,n,o)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Yn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Cs=class extends io{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,o,r){super(e,t,n,o),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,o){return this._getCachedCompiledPatterns(e).compileAG(e,n,o)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Yn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ai=class extends io{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,o,r,i,s,a,l,u){super(e,t,n,o),this._begin=new Un(r,this.id),this.beginCaptures=i,this._end=new Un(s||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,o){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,o)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Yn;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Ho=class extends io{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,o,r,i,s,a,l){super(e,t,n,o),this._begin=new Un(r,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new Un(s,bl),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,o){return this._getCachedCompiledPatterns(e).compileAG(e,n,o)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Yn;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,o){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,o)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Yn,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},El=class We{static createCaptureRule(t,n,o,r,i){return t.registerRule(s=>new $h(n,s,o,r,i))}static getCompiledRuleId(t,n,o){return t.id||n.registerRule(r=>{if(t.id=r,t.match)return new Vh(t.$vscodeTextmateLocation,t.id,t.name,t.match,We._compileCaptures(t.captures,n,o));if(typeof t.begin>"u"){t.repository&&(o=dl({},o,t.repository));let i=t.patterns;return typeof i>"u"&&t.include&&(i=[{include:t.include}]),new Cs(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,We._compilePatterns(i,n,o))}return t.while?new Ho(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,We._compileCaptures(t.beginCaptures||t.captures,n,o),t.while,We._compileCaptures(t.whileCaptures||t.captures,n,o),We._compilePatterns(t.patterns,n,o)):new ai(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,We._compileCaptures(t.beginCaptures||t.captures,n,o),t.end,We._compileCaptures(t.endCaptures||t.captures,n,o),t.applyEndPatternLast,We._compilePatterns(t.patterns,n,o))}),t.id}static _compileCaptures(t,n,o){let r=[];if(t){let i=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);a>i&&(i=a)}for(let s=0;s<=i;s++)r[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);let l=0;t[s].patterns&&(l=We.getCompiledRuleId(t[s],n,o)),r[a]=We.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,l)}}return r}static _compilePatterns(t,n,o){let r=[];if(t)for(let i=0,s=t.length;i<s;i++){const a=t[i];let l=-1;if(a.include){const u=wl(a.include);switch(u.kind){case 0:case 1:l=We.getCompiledRuleId(o[a.include],n,o);break;case 2:let c=o[u.ruleName];c&&(l=We.getCompiledRuleId(c,n,o));break;case 3:case 4:const d=u.scopeName,h=u.kind===4?u.ruleName:null,f=n.getExternalGrammar(d,o);if(f)if(h){let p=f.repository[h];p&&(l=We.getCompiledRuleId(p,n,f.repository))}else l=We.getCompiledRuleId(f.repository.$self,n,f.repository);break}}else l=We.getCompiledRuleId(a,n,o);if(l!==-1){const u=n.getRule(l);let c=!1;if((u instanceof Cs||u instanceof ai||u instanceof Ho)&&u.hasMissingPatterns&&u.patterns.length===0&&(c=!0),c)continue;r.push(l)}}return{patterns:r,hasMissingPatterns:(t?t.length:0)!==r.length}}},Un=class xl{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const o=t.length;let r=0,i=[],s=!1;for(let a=0;a<o;a++)if(t.charAt(a)==="\\"&&a+1<o){const u=t.charAt(a+1);u==="z"?(i.push(t.substring(r,a)),i.push("$(?!\\n)(?<!\\n)"),r=a+2):(u==="A"||u==="G")&&(s=!0),a++}this.hasAnchor=s,r===0?this.source=t:(i.push(t.substring(r,o)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Dh.test(this.source):this.hasBackReferences=!1}clone(){return new xl(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let o=n.map(r=>t.substring(r.start,r.end));return Ss.lastIndex=0,this.source.replace(Ss,(r,i)=>ml(o[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],o=[],r=[],i,s,a,l;for(i=0,s=this.source.length;i<s;i++)a=this.source.charAt(i),t[i]=a,n[i]=a,o[i]=a,r[i]=a,a==="\\"&&i+1<s&&(l=this.source.charAt(i+1),l==="A"?(t[i+1]="",n[i+1]="",o[i+1]="A",r[i+1]="A"):l==="G"?(t[i+1]="",n[i+1]="G",o[i+1]="",r[i+1]="G"):(t[i+1]=l,n[i+1]=l,o[i+1]=l,r[i+1]=l),i++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:o.join(""),A1_G1:r.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Yn=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new Ts(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let o=this._items.map(r=>r.resolveAnchors(t,n));return new Ts(e,o,this._items.map(r=>r.ruleId))}},Ts=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
3
|
+
`)}findNextMatchSync(e,t,n){const o=this.scanner.findNextMatchSync(e,t,n);return o?{ruleId:this.rules[o.index],captureIndices:o.captureIndices}:null}},Lr=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Bh=class li{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Lr(t,8),this._embeddedLanguagesMatcher=new zh(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?li._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Lr(0,0);_getBasicScopeAttributes=new gl(t=>{const n=this._scopeToLanguage(t),o=this._toStandardTokenType(t);return new Lr(n,o)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(li.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},zh=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,o])=>ml(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Ps=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function kl(e,t,n,o,r,i,s,a){const l=t.content.length;let u=!1,c=-1;if(s){const f=Fh(e,t,n,o,r,i);r=f.stack,o=f.linePos,n=f.isFirstLine,c=f.anchorPosition}const d=Date.now();for(;!u;){if(a!==0&&Date.now()-d>a)return new Ps(r,!0);h()}return new Ps(r,!1);function h(){const f=Hh(e,t,n,o,r,c);if(!f){i.produce(r,l),u=!0;return}const p=f.captureIndices,v=f.matchedRuleId,y=p&&p.length>0?p[0].end>o:!1;if(v===Mh){const _=r.getRule(e);i.produce(r,p[0].start),r=r.withContentNameScopesList(r.nameScopesList),Dn(e,t,n,r,i,_.endCaptures,p),i.produce(r,p[0].end);const b=r;if(r=r.parent,c=b.getAnchorPos(),!y&&b.getEnterPos()===o){r=b,i.produce(r,l),u=!0;return}}else{const _=e.getRule(v);i.produce(r,p[0].start);const b=r,m=_.getName(t.content,p),w=r.contentNameScopesList.pushAttributed(m,e);if(r=r.push(v,o,c,p[0].end===l,null,w,w),_ instanceof ai){const A=_;Dn(e,t,n,r,i,A.beginCaptures,p),i.produce(r,p[0].end),c=p[0].end;const D=A.getContentName(t.content,p),z=w.pushAttributed(D,e);if(r=r.withContentNameScopesList(z),A.endHasBackReferences&&(r=r.withEndRule(A.getEndWithResolvedBackReferences(t.content,p))),!y&&b.hasSameRuleAs(r)){r=r.pop(),i.produce(r,l),u=!0;return}}else if(_ instanceof Ho){const A=_;Dn(e,t,n,r,i,A.beginCaptures,p),i.produce(r,p[0].end),c=p[0].end;const D=A.getContentName(t.content,p),z=w.pushAttributed(D,e);if(r=r.withContentNameScopesList(z),A.whileHasBackReferences&&(r=r.withEndRule(A.getWhileWithResolvedBackReferences(t.content,p))),!y&&b.hasSameRuleAs(r)){r=r.pop(),i.produce(r,l),u=!0;return}}else if(Dn(e,t,n,r,i,_.captures,p),i.produce(r,p[0].end),r=r.pop(),!y){r=r.safePop(),i.produce(r,l),u=!0;return}}p[0].end>o&&(o=p[0].end,n=!1)}}function Fh(e,t,n,o,r,i){let s=r.beginRuleCapturedEOL?0:-1;const a=[];for(let l=r;l;l=l.pop()){const u=l.getRule(e);u instanceof Ho&&a.push({rule:u,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:u,findOptions:c}=qh(l.rule,e,l.stack.endRule,n,o===s),d=u.findNextMatchSync(t,o,c);if(d){if(d.ruleId!==bl){r=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(i.produce(l.stack,d.captureIndices[0].start),Dn(e,t,n,l.stack,i,l.rule.whileCaptures,d.captureIndices),i.produce(l.stack,d.captureIndices[0].end),s=d.captureIndices[0].end,d.captureIndices[0].end>o&&(o=d.captureIndices[0].end,n=!1))}else{r=l.stack.pop();break}}return{stack:r,linePos:o,anchorPosition:s,isFirstLine:n}}function Hh(e,t,n,o,r,i){const s=Gh(e,t,n,o,r,i),a=e.getInjections();if(a.length===0)return s;const l=jh(a,e,t,n,o,r,i);if(!l)return s;if(!s)return l;const u=s.captureIndices[0].start,c=l.captureIndices[0].start;return c<u||l.priorityMatch&&c===u?l:s}function Gh(e,t,n,o,r,i){const s=r.getRule(e),{ruleScanner:a,findOptions:l}=Sl(s,e,r.endRule,n,o===i),u=a.findNextMatchSync(t,o,l);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function jh(e,t,n,o,r,i,s){let a=Number.MAX_VALUE,l=null,u,c=0;const d=i.contentNameScopesList.getScopeNames();for(let h=0,f=e.length;h<f;h++){const p=e[h];if(!p.matcher(d))continue;const v=t.getRule(p.ruleId),{ruleScanner:y,findOptions:_}=Sl(v,t,null,o,r===s),b=y.findNextMatchSync(n,r,_);if(!b)continue;const m=b.captureIndices[0].start;if(!(m>=a)&&(a=m,l=b.captureIndices,u=b.ruleId,c=p.priority,a===r))break}return l?{priorityMatch:c===-1,captureIndices:l,matchedRuleId:u}:null}function Sl(e,t,n,o,r){return{ruleScanner:e.compileAG(t,n,o,r),findOptions:0}}function qh(e,t,n,o,r){return{ruleScanner:e.compileWhileAG(t,n,o,r),findOptions:0}}function Dn(e,t,n,o,r,i,s){if(i.length===0)return;const a=t.content,l=Math.min(i.length,s.length),u=[],c=s[0].end;for(let d=0;d<l;d++){const h=i[d];if(h===null)continue;const f=s[d];if(f.length===0)continue;if(f.start>c)break;for(;u.length>0&&u[u.length-1].endPos<=f.start;)r.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?r.produceFromScopes(u[u.length-1].scopes,f.start):r.produce(o,f.start),h.retokenizeCapturedWithRuleId){const v=h.getName(a,s),y=o.contentNameScopesList.pushAttributed(v,e),_=h.getContentName(a,s),b=y.pushAttributed(_,e),m=o.push(h.retokenizeCapturedWithRuleId,f.start,-1,!1,null,y,b),w=e.createOnigString(a.substring(0,f.end));kl(e,w,n&&f.start===0,f.start,m,r,!1,0),yl(w);continue}const p=h.getName(a,s);if(p!==null){const y=(u.length>0?u[u.length-1].scopes:o.contentNameScopesList).pushAttributed(p,e);u.push(new Wh(y,f.end))}}for(;u.length>0;)r.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var Wh=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Uh(e,t,n,o,r,i,s,a){return new Xh(e,t,n,o,r,i,s,a)}function As(e,t,n,o,r){const i=zo(t,Go),s=El.getCompiledRuleId(n,o,r.repository);for(const a of i)e.push({debugSelector:t,matcher:a.matcher,ruleId:s,grammar:r,priority:a.priority})}function Go(e,t){if(t.length<e.length)return!1;let n=0;return e.every(o=>{for(let r=n;r<t.length;r++)if(Yh(t[r],o))return n=r+1,!0;return!1})}function Yh(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var Xh=class{constructor(e,t,n,o,r,i,s,a){if(this._rootScopeName=e,this.balancedBracketSelectors=i,this._onigLib=a,this._basicScopeAttributesProvider=new Bh(n,o),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=Ns(t,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const l of Object.keys(r)){const u=zo(l,Go);for(const c of u)this._tokenTypeMatchers.push({matcher:c.matcher,type:r[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},t=[],n=this._rootScopeName,o=e.lookup(n);if(o){const r=o.injections;if(r)for(let s in r)As(t,s,r[s],this,o);const i=this._grammarRepository.injections(n);i&&i.forEach(s=>{const a=this.getExternalGrammar(s);if(a){const l=a.injectionSelector;l&&As(t,l,a,this,a)}})}return t.sort((r,i)=>r.priority-i.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Ns(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const o=this._tokenize(e,t,!1,n);return{tokens:o.lineTokens.getResult(o.ruleStack,o.lineLength),ruleStack:o.ruleStack,stoppedEarly:o.stoppedEarly}}tokenizeLine2(e,t,n=0){const o=this._tokenize(e,t,!0,n);return{tokens:o.lineTokens.getBinaryResult(o.ruleStack,o.lineLength),ruleStack:o.ruleStack,stoppedEarly:o.stoppedEarly}}_tokenize(e,t,n,o){this._rootId===-1&&(this._rootId=El.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!t||t===ui.NULL){r=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),c=this.themeProvider.getDefaults(),d=wn.set(0,u.languageId,u.tokenType,null,c.fontStyle,c.foregroundId,c.backgroundId),h=this.getRule(this._rootId).getName(null,null);let f;h?f=Fn.createRootAndLookUpScopeName(h,d,this):f=Fn.createRoot("unknown",d),t=new ui(null,this._rootId,-1,-1,!1,null,f,f)}else r=!1,t.reset();e=e+`
|
|
4
|
+
`;const i=this.createOnigString(e),s=i.content.length,a=new Zh(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=kl(this,i,r,0,t,a,!0,o);return yl(i),{lineLength:s,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Ns(e,t){return e=ph(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Fn=class pt{constructor(t,n,o){this.parent=t,this.scopePath=n,this.tokenAttributes=o}static fromExtension(t,n){let o=t,r=t?.scopePath??null;for(const i of n)r=Rr.push(r,i.scopeNames),o=new pt(o,r,i.encodedTokenAttributes);return o}static createRoot(t,n){return new pt(null,new Rr(null,t),n)}static createRootAndLookUpScopeName(t,n,o){const r=o.getMetadataForScope(t),i=new Rr(null,t),s=o.themeProvider.themeMatch(i),a=pt.mergeAttributes(n,r,s);return new pt(null,i,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return pt.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,o){let r=-1,i=0,s=0;return o!==null&&(r=o.fontStyle,i=o.foregroundId,s=o.backgroundId),wn.set(t,n.languageId,n.tokenType,null,r,i,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return pt._pushAttributed(this,t,n);const o=t.split(/ /g);let r=this;for(const i of o)r=pt._pushAttributed(r,i,n);return r}static _pushAttributed(t,n,o){const r=o.getMetadataForScope(n),i=t.scopePath.push(n),s=o.themeProvider.themeMatch(i),a=pt.mergeAttributes(t.tokenAttributes,r,s);return new pt(t,i,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let o=this;for(;o&&o!==t;)n.push({encodedTokenAttributes:o.tokenAttributes,scopeNames:o.scopePath.getExtensionIfDefined(o.parent?.scopePath??null)}),o=o.parent;return o===t?n.reverse():void 0}},ui=class jt{constructor(t,n,o,r,i,s,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=s,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=o,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new jt(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:jt._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Fn.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){jt._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,o,r,i,s,a){return new jt(this,t,n,o,r,i,s,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new jt(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const o=Fn.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new jt(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,o,Fn.fromExtension(o,n.contentNameScopesList))}},Kh=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):zo(n,Go).map(o=>o.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>zo(n,Go).map(o=>o.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Zh=class{constructor(e,t,n,o){this.balancedBracketSelectors=o,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let o=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=e?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(i)&&(o=wn.set(o,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(o=wn.set(o,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===o){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(o),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let o=0,r=this._binaryTokens.length;o<r;o++)n[o]=this._binaryTokens[o];return n}},Jh=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,o,r){if(!this._grammars.has(e)){let i=this._rawGrammars.get(e);if(!i)return null;this._grammars.set(e,Uh(e,i,t,n,o,r,this,this._onigLib))}return this._grammars.get(e)}},Qh=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new Jh(Bo.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Bo.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,o){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:o})}loadGrammarWithConfiguration(t,n,o){return this._loadGrammar(t,n,o.embeddedLanguages,o.tokenTypes,new Kh(o.balancedBracketSelectors||[],o.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,o,r,i){const s=new Ph(this._syncRegistry,t);for(;s.Q.length>0;)s.Q.map(a=>this._loadSingleGrammar(a.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,o,r,i)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const o=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,o)}}addGrammar(t,n=[],o=0,r=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,o,r)}_grammarForScopeName(t,n=0,o=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(t,n,o,r,i)}},ci=ui.NULL;const ep=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class so{constructor(t,n,o){this.normal=n,this.property=t,o&&(this.space=o)}}so.prototype.normal={};so.prototype.property={};so.prototype.space=void 0;function Cl(e,t){const n={},o={};for(const r of e)Object.assign(n,r.property),Object.assign(o,r.normal);return new so(n,o,t)}function di(e){return e.toLowerCase()}class Ke{constructor(t,n){this.attribute=n,this.property=t}}Ke.prototype.attribute="";Ke.prototype.booleanish=!1;Ke.prototype.boolean=!1;Ke.prototype.commaOrSpaceSeparated=!1;Ke.prototype.commaSeparated=!1;Ke.prototype.defined=!1;Ke.prototype.mustUseProperty=!1;Ke.prototype.number=!1;Ke.prototype.overloadedBoolean=!1;Ke.prototype.property="";Ke.prototype.spaceSeparated=!1;Ke.prototype.space=void 0;let tp=0;const Ee=nn(),Me=nn(),fi=nn(),re=nn(),Re=nn(),fn=nn(),Ze=nn();function nn(){return 2**++tp}const hi=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ee,booleanish:Me,commaOrSpaceSeparated:Ze,commaSeparated:fn,number:re,overloadedBoolean:fi,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),Dr=Object.keys(hi);class Hi extends Ke{constructor(t,n,o,r){let i=-1;if(super(t,n),Os(this,"space",r),typeof o=="number")for(;++i<Dr.length;){const s=Dr[i];Os(this,Dr[i],(o&hi[s])===hi[s])}}}Hi.prototype.defined=!0;function Os(e,t,n){n&&(e[t]=n)}function An(e){const t={},n={};for(const[o,r]of Object.entries(e.properties)){const i=new Hi(o,e.transform(e.attributes||{},o),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(o)&&(i.mustUseProperty=!0),t[o]=i,n[di(o)]=o,n[di(i.attribute)]=o}return new so(t,n,e.space)}const Tl=An({properties:{ariaActiveDescendant:null,ariaAtomic:Me,ariaAutoComplete:null,ariaBusy:Me,ariaChecked:Me,ariaColCount:re,ariaColIndex:re,ariaColSpan:re,ariaControls:Re,ariaCurrent:null,ariaDescribedBy:Re,ariaDetails:null,ariaDisabled:Me,ariaDropEffect:Re,ariaErrorMessage:null,ariaExpanded:Me,ariaFlowTo:Re,ariaGrabbed:Me,ariaHasPopup:null,ariaHidden:Me,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Re,ariaLevel:re,ariaLive:null,ariaModal:Me,ariaMultiLine:Me,ariaMultiSelectable:Me,ariaOrientation:null,ariaOwns:Re,ariaPlaceholder:null,ariaPosInSet:re,ariaPressed:Me,ariaReadOnly:Me,ariaRelevant:null,ariaRequired:Me,ariaRoleDescription:Re,ariaRowCount:re,ariaRowIndex:re,ariaRowSpan:re,ariaSelected:Me,ariaSetSize:re,ariaSort:null,ariaValueMax:re,ariaValueMin:re,ariaValueNow:re,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Pl(e,t){return t in e?e[t]:t}function Al(e,t){return Pl(e,t.toLowerCase())}const np=An({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fn,acceptCharset:Re,accessKey:Re,action:null,allow:null,allowFullScreen:Ee,allowPaymentRequest:Ee,allowUserMedia:Ee,alt:null,as:null,async:Ee,autoCapitalize:null,autoComplete:Re,autoFocus:Ee,autoPlay:Ee,blocking:Re,capture:null,charSet:null,checked:Ee,cite:null,className:Re,cols:re,colSpan:null,content:null,contentEditable:Me,controls:Ee,controlsList:Re,coords:re|fn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ee,defer:Ee,dir:null,dirName:null,disabled:Ee,download:fi,draggable:Me,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ee,formTarget:null,headers:Re,height:re,hidden:fi,high:re,href:null,hrefLang:null,htmlFor:Re,httpEquiv:Re,id:null,imageSizes:null,imageSrcSet:null,inert:Ee,inputMode:null,integrity:null,is:null,isMap:Ee,itemId:null,itemProp:Re,itemRef:Re,itemScope:Ee,itemType:Re,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ee,low:re,manifest:null,max:null,maxLength:re,media:null,method:null,min:null,minLength:re,multiple:Ee,muted:Ee,name:null,nonce:null,noModule:Ee,noValidate:Ee,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ee,optimum:re,pattern:null,ping:Re,placeholder:null,playsInline:Ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ee,referrerPolicy:null,rel:Re,required:Ee,reversed:Ee,rows:re,rowSpan:re,sandbox:Re,scope:null,scoped:Ee,seamless:Ee,selected:Ee,shadowRootClonable:Ee,shadowRootDelegatesFocus:Ee,shadowRootMode:null,shape:null,size:re,sizes:null,slot:null,span:re,spellCheck:Me,src:null,srcDoc:null,srcLang:null,srcSet:null,start:re,step:null,style:null,tabIndex:re,target:null,title:null,translate:null,type:null,typeMustMatch:Ee,useMap:null,value:Me,width:re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Re,axis:null,background:null,bgColor:null,border:re,borderColor:null,bottomMargin:re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ee,declare:Ee,event:null,face:null,frame:null,frameBorder:null,hSpace:re,leftMargin:re,link:null,longDesc:null,lowSrc:null,marginHeight:re,marginWidth:re,noResize:Ee,noHref:Ee,noShade:Ee,noWrap:Ee,object:null,profile:null,prompt:null,rev:null,rightMargin:re,rules:null,scheme:null,scrolling:Me,standby:null,summary:null,text:null,topMargin:re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:re,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ee,disableRemotePlayback:Ee,prefix:null,property:null,results:re,security:null,unselectable:null},space:"html",transform:Al}),op=An({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ze,accentHeight:re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:re,amplitude:re,arabicForm:null,ascent:re,attributeName:null,attributeType:null,azimuth:re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:re,by:null,calcMode:null,capHeight:re,className:Re,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:re,diffuseConstant:re,direction:null,display:null,dur:null,divisor:re,dominantBaseline:null,download:Ee,dx:null,dy:null,edgeMode:null,editable:null,elevation:re,enableBackground:null,end:null,event:null,exponent:re,externalResourcesRequired:null,fill:null,fillOpacity:re,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fn,g2:fn,glyphName:fn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:re,horizOriginX:re,horizOriginY:re,id:null,ideographic:re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:re,k:re,k1:re,k2:re,k3:re,k4:re,kernelMatrix:Ze,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:re,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:re,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:re,overlineThickness:re,paintOrder:null,panose1:null,path:null,pathLength:re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Re,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:re,pointsAtY:re,pointsAtZ:re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ze,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ze,rev:Ze,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ze,requiredFeatures:Ze,requiredFonts:Ze,requiredFormats:Ze,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:re,specularExponent:re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:re,strikethroughThickness:re,string:null,stroke:null,strokeDashArray:Ze,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:re,strokeOpacity:re,strokeWidth:null,style:null,surfaceScale:re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ze,tabIndex:re,tableValues:null,target:null,targetX:re,targetY:re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ze,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:re,underlineThickness:re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:re,values:null,vAlphabetic:re,vMathematical:re,vectorEffect:null,vHanging:re,vIdeographic:re,version:null,vertAdvY:re,vertOriginX:re,vertOriginY:re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Pl}),Nl=An({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Ol=An({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Al}),Il=An({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),rp=/[A-Z]/g,Is=/-[a-z]/g,ip=/^data[-\w.:]+$/i;function sp(e,t){const n=di(t);let o=t,r=Ke;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ip.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Is,lp);o="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Is.test(i)){let s=i.replace(rp,ap);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}r=Hi}return new r(o,t)}function ap(e){return"-"+e.toLowerCase()}function lp(e){return e.charAt(1).toUpperCase()}const up=Cl([Tl,np,Nl,Ol,Il],"html"),Rl=Cl([Tl,op,Nl,Ol,Il],"svg"),Rs={}.hasOwnProperty;function cp(e,t){const n=t||{};function o(r,...i){let s=o.invalid;const a=o.handlers;if(r&&Rs.call(r,e)){const l=String(r[e]);s=Rs.call(a,l)?a[l]:o.unknown}if(s)return s.call(this,r,...i)}return o.handlers=n.handlers||{},o.invalid=n.invalid,o.unknown=n.unknown,o}const dp=/["&'<>`]/g,fp=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,hp=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,pp=/[|\\{}()[\]^$+*?.]/g,Ls=new WeakMap;function mp(e,t){if(e=e.replace(t.subset?gp(t.subset):dp,o),t.subset||t.escapeOnly)return e;return e.replace(fp,n).replace(hp,o);function n(r,i,s){return t.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,s.charCodeAt(i+2),t)}function o(r,i,s){return t.format(r.charCodeAt(0),s.charCodeAt(i+1),t)}}function gp(e){let t=Ls.get(e);return t||(t=vp(e),Ls.set(e,t)),t}function vp(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(pp,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const _p=/[\dA-Fa-f]/;function yp(e,t,n){const o="&#x"+e.toString(16).toUpperCase();return n&&t&&!_p.test(String.fromCharCode(t))?o:o+";"}const wp=/\d/;function bp(e,t,n){const o="&#"+String(e);return n&&t&&!wp.test(String.fromCharCode(t))?o:o+";"}const Ep=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Mr={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},xp=["cent","copy","divide","gt","lt","not","para","times"],Ll={}.hasOwnProperty,pi={};let ho;for(ho in Mr)Ll.call(Mr,ho)&&(pi[Mr[ho]]=ho);const kp=/[^\dA-Za-z]/;function Sp(e,t,n,o){const r=String.fromCharCode(e);if(Ll.call(pi,r)){const i=pi[r],s="&"+i;return n&&Ep.includes(i)&&!xp.includes(i)&&(!o||t&&t!==61&&kp.test(String.fromCharCode(t)))?s:s+";"}return""}function Cp(e,t,n){let o=yp(e,t,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=Sp(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=bp(e,t,n.omitOptionalSemicolons);i.length<o.length&&(o=i)}return r&&(!n.useShortestReferences||r.length<o.length)?r:o}function hn(e,t){return mp(e,Object.assign({format:Cp},t))}const Tp=/^>|^->|<!--|-->|--!>|<!-$/g,Pp=[">"],Ap=["<",">"];function Np(e,t,n,o){return o.settings.bogusComments?"<?"+hn(e.value,Object.assign({},o.settings.characterReferences,{subset:Pp}))+">":"<!--"+e.value.replace(Tp,r)+"-->";function r(i){return hn(i,Object.assign({},o.settings.characterReferences,{subset:Ap}))}}function Op(e,t,n,o){return"<!"+(o.settings.upperDoctype?"DOCTYPE":"doctype")+(o.settings.tightDoctype?"":" ")+"html>"}function Ds(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let o=0,r=n.indexOf(t);for(;r!==-1;)o++,r=n.indexOf(t,r+t.length);return o}function Ip(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Rp(e){return e.join(" ").trim()}const Lp=/[ \t\n\f\r]/g;function Gi(e){return typeof e=="object"?e.type==="text"?Ms(e.value):!1:Ms(e)}function Ms(e){return e.replace(Lp,"")===""}const je=Ml(1),Dl=Ml(-1),Dp=[];function Ml(e){return t;function t(n,o,r){const i=n?n.children:Dp;let s=(o||0)+e,a=i[s];if(!r)for(;a&&Gi(a);)s+=e,a=i[s];return a}}const Mp={}.hasOwnProperty;function $l(e){return t;function t(n,o,r){return Mp.call(e,n.tagName)&&e[n.tagName](n,o,r)}}const ji=$l({body:Vp,caption:$r,colgroup:$r,dd:Hp,dt:Fp,head:$r,html:$p,li:zp,optgroup:Gp,option:jp,p:Bp,rp:$s,rt:$s,tbody:Wp,td:Vs,tfoot:Up,th:Vs,thead:qp,tr:Yp});function $r(e,t,n){const o=je(n,t,!0);return!o||o.type!=="comment"&&!(o.type==="text"&&Gi(o.value.charAt(0)))}function $p(e,t,n){const o=je(n,t);return!o||o.type!=="comment"}function Vp(e,t,n){const o=je(n,t);return!o||o.type!=="comment"}function Bp(e,t,n){const o=je(n,t);return o?o.type==="element"&&(o.tagName==="address"||o.tagName==="article"||o.tagName==="aside"||o.tagName==="blockquote"||o.tagName==="details"||o.tagName==="div"||o.tagName==="dl"||o.tagName==="fieldset"||o.tagName==="figcaption"||o.tagName==="figure"||o.tagName==="footer"||o.tagName==="form"||o.tagName==="h1"||o.tagName==="h2"||o.tagName==="h3"||o.tagName==="h4"||o.tagName==="h5"||o.tagName==="h6"||o.tagName==="header"||o.tagName==="hgroup"||o.tagName==="hr"||o.tagName==="main"||o.tagName==="menu"||o.tagName==="nav"||o.tagName==="ol"||o.tagName==="p"||o.tagName==="pre"||o.tagName==="section"||o.tagName==="table"||o.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function zp(e,t,n){const o=je(n,t);return!o||o.type==="element"&&o.tagName==="li"}function Fp(e,t,n){const o=je(n,t);return!!(o&&o.type==="element"&&(o.tagName==="dt"||o.tagName==="dd"))}function Hp(e,t,n){const o=je(n,t);return!o||o.type==="element"&&(o.tagName==="dt"||o.tagName==="dd")}function $s(e,t,n){const o=je(n,t);return!o||o.type==="element"&&(o.tagName==="rp"||o.tagName==="rt")}function Gp(e,t,n){const o=je(n,t);return!o||o.type==="element"&&o.tagName==="optgroup"}function jp(e,t,n){const o=je(n,t);return!o||o.type==="element"&&(o.tagName==="option"||o.tagName==="optgroup")}function qp(e,t,n){const o=je(n,t);return!!(o&&o.type==="element"&&(o.tagName==="tbody"||o.tagName==="tfoot"))}function Wp(e,t,n){const o=je(n,t);return!o||o.type==="element"&&(o.tagName==="tbody"||o.tagName==="tfoot")}function Up(e,t,n){return!je(n,t)}function Yp(e,t,n){const o=je(n,t);return!o||o.type==="element"&&o.tagName==="tr"}function Vs(e,t,n){const o=je(n,t);return!o||o.type==="element"&&(o.tagName==="td"||o.tagName==="th")}const Xp=$l({body:Jp,colgroup:Qp,head:Zp,html:Kp,tbody:em});function Kp(e){const t=je(e,-1);return!t||t.type!=="comment"}function Zp(e){const t=new Set;for(const o of e.children)if(o.type==="element"&&(o.tagName==="base"||o.tagName==="title")){if(t.has(o.tagName))return!1;t.add(o.tagName)}const n=e.children[0];return!n||n.type==="element"}function Jp(e){const t=je(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Gi(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Qp(e,t,n){const o=Dl(n,t),r=je(e,-1,!0);return n&&o&&o.type==="element"&&o.tagName==="colgroup"&&ji(o,n.children.indexOf(o),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function em(e,t,n){const o=Dl(n,t),r=je(e,-1);return n&&o&&o.type==="element"&&(o.tagName==="thead"||o.tagName==="tbody")&&ji(o,n.children.indexOf(o),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const po={name:[[`
|
|
5
|
+
\f\r &/=>`.split(""),`
|
|
6
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
7
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
8
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
9
|
+
\f\r &>`.split(""),`\0
|
|
10
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
11
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
12
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function tm(e,t,n,o){const r=o.schema,i=r.space==="svg"?!1:o.settings.omitOptionalTags;let s=r.space==="svg"?o.settings.closeEmptyElements:o.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;r.space==="html"&&e.tagName==="svg"&&(o.schema=Rl);const u=nm(o,e.properties),c=o.all(r.space==="html"&&e.tagName==="template"?e.content:e);return o.schema=r,c&&(s=!1),(u||!i||!Xp(e,t,n))&&(a.push("<",e.tagName,u?" "+u:""),s&&(r.space==="svg"||o.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!o.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!s&&(!i||!ji(e,t,n))&&a.push("</"+e.tagName+">"),a.join("")}function nm(e,t){const n=[];let o=-1,r;if(t){for(r in t)if(t[r]!==null&&t[r]!==void 0){const i=om(e,r,t[r]);i&&n.push(i)}}for(;++o<n.length;){const i=e.settings.tightAttributes?n[o].charAt(n[o].length-1):void 0;o!==n.length-1&&i!=='"'&&i!=="'"&&(n[o]+=" ")}return n.join("")}function om(e,t,n){const o=sp(e.schema,t),r=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,i=e.settings.allowDangerousCharacters?0:1;let s=e.quote,a;if(o.overloadedBoolean&&(n===o.attribute||n==="")?n=!0:(o.boolean||o.overloadedBoolean)&&(typeof n!="string"||n===o.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=hn(o.attribute,Object.assign({},e.settings.characterReferences,{subset:po.name[r][i]}));return n===!0||(n=Array.isArray(n)?(o.commaSeparated?Ip:Rp)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(a=hn(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:po.unquoted[r][i]}))),a!==n&&(e.settings.quoteSmart&&Ds(n,s)>Ds(n,e.alternative)&&(s=e.alternative),a=s+hn(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?po.single:po.double)[r][i],attribute:!0}))+s),l+(a&&"="+a))}const rm=["<","&"];function Vl(e,t,n,o){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:hn(e.value,Object.assign({},o.settings.characterReferences,{subset:rm}))}function im(e,t,n,o){return o.settings.allowDangerousHtml?e.value:Vl(e,t,n,o)}function sm(e,t,n,o){return o.all(e)}const am=cp("type",{invalid:lm,unknown:um,handlers:{comment:Np,doctype:Op,element:tm,raw:im,root:sm,text:Vl}});function lm(e){throw new Error("Expected node, not `"+e+"`")}function um(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const cm={},dm={},fm=[];function hm(e,t){const n=t||cm,o=n.quote||'"',r=o==='"'?"'":'"';if(o!=='"'&&o!=="'")throw new Error("Invalid quote `"+o+"`, expected `'` or `\"`");return{one:pm,all:mm,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ep,characterReferences:n.characterReferences||dm,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Rl:up,quote:o,alternative:r}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function pm(e,t,n){return am(e,t,n,this)}function mm(e){const t=[],n=e&&e.children||fm;let o=-1;for(;++o<n.length;)t[o]=this.one(n[o],o,e);return t.join("")}function jo(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},o=typeof e=="string"?e:e.name;for(const[r,i]of Object.entries(t?.colorReplacements||{}))typeof i=="string"?n[r]=i:r===o&&Object.assign(n,i);return n}function Bt(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function gm(e){return Array.isArray(e)?e:[e]}async function Bl(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function qi(e){return!e||["plaintext","txt","text","plain"].includes(e)}function zl(e){return e==="ansi"||qi(e)}function Wi(e){return e==="none"}function Fl(e){return Wi(e)}function Hl(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const o of n)o&&!e.properties.class.includes(o)&&e.properties.class.push(o);return e}function gr(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let o=0;const r=[];for(let i=0;i<n.length;i+=2){const s=t?n[i]+(n[i+1]||""):n[i];r.push([s,o]),o+=n[i].length,o+=n[i+1]?.length||0}return r}function vm(e){const t=gr(e,!0).map(([r])=>r);function n(r){if(r===e.length)return{line:t.length-1,character:t[t.length-1].length};let i=r,s=0;for(const a of t){if(i<a.length)break;i-=a.length,s++}return{line:s,character:i}}function o(r,i){let s=0;for(let a=0;a<r;a++)s+=t[a].length;return s+=i,s}return{lines:t,indexToPos:n,posToIndex:o}}function _m(e,t,n){const o=new Set;for(const i of e.matchAll(/:?lang=["']([^"']+)["']/g)){const s=i[1].toLowerCase().trim();s&&o.add(s)}for(const i of e.matchAll(/(?:```|~~~)([\w-]+)/g)){const s=i[1].toLowerCase().trim();s&&o.add(s)}for(const i of e.matchAll(/\\begin\{([\w-]+)\}/g)){const s=i[1].toLowerCase().trim();s&&o.add(s)}for(const i of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){const s=i[1].toLowerCase().trim(),a=s.includes("/")?s.split("/").pop():s;a&&o.add(a)}if(!n)return Array.from(o);const r=n.getBundledLanguages();return Array.from(o).filter(i=>i&&r[i])}const Ui="light-dark()",ym=["color","background-color"];function wm(e,t){let n=0;const o=[];for(const r of t)r>n&&o.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&o.push({...e,content:e.content.slice(n),offset:e.offset+n}),o}function bm(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((o,r)=>o-r);return n.length?e.map(o=>o.flatMap(r=>{const i=n.filter(s=>r.offset<s&&s<r.offset+r.content.length).map(s=>s-r.offset).sort((s,a)=>s-a);return i.length?wm(r,i):r})):e}function Em(e,t,n,o,r="css-vars"){const i={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(c=>qo(e.variants[c])),a=new Set(s.flatMap(c=>Object.keys(c))),l={},u=(c,d)=>{const h=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+t[c]+(d==="color"?"":h)};return s.forEach((c,d)=>{for(const h of a){const f=c[h]||"inherit";if(d===0&&o&&ym.includes(h))if(o===Ui&&s.length>1){const p=t.findIndex(b=>b==="light"),v=t.findIndex(b=>b==="dark");if(p===-1||v===-1)throw new Ve('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const y=s[p][h]||"inherit",_=s[v][h]||"inherit";l[h]=`light-dark(${y}, ${_})`,r==="css-vars"&&(l[u(d,h)]=f)}else l[h]=f;else r==="css-vars"&&(l[u(d,h)]=f)}}),i.htmlStyle=l,i}function qo(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Ue.Italic&&(t["font-style"]="italic"),e.fontStyle&Ue.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Ue.Underline&&n.push("underline"),e.fontStyle&Ue.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function mi(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const Gl=new WeakMap;function vr(e,t){Gl.set(e,t)}function Xn(e){return Gl.get(e)}class Nn{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Nn(Object.fromEntries(gm(n).map(o=>[o,ci])),t)}constructor(...t){if(t.length===2){const[n,o]=t;this.lang=o,this._stacks=n}else{const[n,o,r]=t;this.lang=o,this._stacks={[r]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return xm(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function xm(e){const t=[],n=new Set;function o(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&t.push(i),r.parent&&o(r.parent)}return o(e),t}function km(e,t){if(!(e instanceof Nn))throw new Ve("Invalid grammar state");return e.getInternalStack(t)}function Sm(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let o=function(s){if(typeof s=="number"){if(s<0||s>n.source.length)throw new Ve(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...r.indexToPos(s),offset:s}}else{const a=r.lines[s.line];if(a===void 0)throw new Ve(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${r.lines.length}`);let l=s.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new Ve(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${a.length}`);return{...s,character:l,offset:r.posToIndex(s.line,l)}}};const r=vm(n.source),i=(n.options.decorations||[]).map(s=>({...s,start:o(s.start),end:o(s.end)}));Cm(i),e.set(n.meta,{decorations:i,converter:r,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const r=t(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]);return bm(n,r)},code(n){if(!this.options.decorations?.length)return;const o=t(this),r=Array.from(n.children).filter(c=>c.type==="element"&&c.tagName==="span");if(r.length!==o.converter.lines.length)throw new Ve(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${o.converter.lines.length}). Failed to apply decorations.`);function i(c,d,h,f){const p=r[c];let v="",y=-1,_=-1;if(d===0&&(y=0),h===0&&(_=0),h===Number.POSITIVE_INFINITY&&(_=p.children.length),y===-1||_===-1)for(let m=0;m<p.children.length;m++)v+=jl(p.children[m]),y===-1&&v.length===d&&(y=m+1),_===-1&&v.length===h&&(_=m+1);if(y===-1)throw new Ve(`Failed to find start index for decoration ${JSON.stringify(f.start)}`);if(_===-1)throw new Ve(`Failed to find end index for decoration ${JSON.stringify(f.end)}`);const b=p.children.slice(y,_);if(!f.alwaysWrap&&b.length===p.children.length)a(p,f,"line");else if(!f.alwaysWrap&&b.length===1&&b[0].type==="element")a(b[0],f,"token");else{const m={type:"element",tagName:"span",properties:{},children:b};a(m,f,"wrapper"),p.children.splice(y,b.length,m)}}function s(c,d){r[c]=a(r[c],d,"line")}function a(c,d,h){const f=d.properties||{},p=d.transform||(v=>v);return c.tagName=d.tagName||"span",c.properties={...c.properties,...f,class:c.properties.class},d.properties?.class&&Hl(c,d.properties.class),c=p(c,h)||c,c}const l=[],u=o.decorations.sort((c,d)=>d.start.offset-c.start.offset||c.end.offset-d.end.offset);for(const c of u){const{start:d,end:h}=c;if(d.line===h.line)i(d.line,d.character,h.character,c);else if(d.line<h.line){i(d.line,d.character,Number.POSITIVE_INFINITY,c);for(let f=d.line+1;f<h.line;f++)l.unshift(()=>s(f,c));i(h.line,0,h.character,c)}}l.forEach(c=>c())}}}function Cm(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Ve(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let o=t+1;o<e.length;o++){const r=e[o],i=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,s=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,a=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,l=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(i||s||a||l){if(i&&s||a&&l||a&&n.start.offset===n.end.offset||s&&r.start.offset===r.end.offset)continue;throw new Ve(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function jl(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(jl).join(""):""}const Tm=[Sm()];function Wo(e){const t=Pm(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Tm]}function Pm(e){const t=[],n=[],o=[];for(const r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:o.push(r)}return{pre:t,post:n,normal:o}}var Ut=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Vr={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Am(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const o=e.indexOf("m",n);if(o!==-1)return{sequence:e.substring(n+2,o).split(";"),startPosition:n,position:o+1}}return{position:e.length}}function Bs(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(o=>Number.parseInt(o));return n.length!==3||n.some(o=>Number.isNaN(o))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Nm(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const o=Number.parseInt(n);if(!Number.isNaN(o))if(o===0)t.push({type:"resetAll"});else if(o<=9)Vr[o]&&t.push({type:"setDecoration",value:Vr[o]});else if(o<=29){const r=Vr[o-20];r&&(t.push({type:"resetDecoration",value:r}),r==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(o<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Ut[o-30]}});else if(o===38){const r=Bs(e);r&&t.push({type:"setForegroundColor",value:r})}else if(o===39)t.push({type:"resetForegroundColor"});else if(o<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Ut[o-40]}});else if(o===48){const r=Bs(e);r&&t.push({type:"setBackgroundColor",value:r})}else o===49?t.push({type:"resetBackgroundColor"}):o===53?t.push({type:"setDecoration",value:"overline"}):o===55?t.push({type:"resetDecoration",value:"overline"}):o>=90&&o<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Ut[o-90+8]}}):o>=100&&o<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Ut[o-100+8]}})}return t}function Om(){let e=null,t=null,n=new Set;return{parse(o){const r=[];let i=0;do{const s=Am(o,i),a=s.sequence?o.substring(i,s.startPosition):o.substring(i);if(a.length>0&&r.push({value:a,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const l=Nm(s.sequence);for(const u of l)u.type==="resetAll"?(e=null,t=null,n.clear()):u.type==="resetForegroundColor"?e=null:u.type==="resetBackgroundColor"?t=null:u.type==="resetDecoration"&&n.delete(u.value);for(const u of l)u.type==="setForegroundColor"?e=u.value:u.type==="setBackgroundColor"?t=u.value:u.type==="setDecoration"&&n.add(u.value)}i=s.position}while(i<o.length);return r}}}var Im={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function Rm(e=Im){function t(a){return e[a]}function n(a){return`#${a.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let o;function r(){if(o)return o;o=[];for(let u=0;u<Ut.length;u++)o.push(t(Ut[u]));let a=[0,95,135,175,215,255];for(let u=0;u<6;u++)for(let c=0;c<6;c++)for(let d=0;d<6;d++)o.push(n([a[u],a[c],a[d]]));let l=8;for(let u=0;u<24;u++,l+=10)o.push(n([l,l,l]));return o}function i(a){return r()[a]}function s(a){switch(a.type){case"named":return t(a.name);case"rgb":return n(a.rgb);case"table":return i(a.index)}}return{value:s}}const Lm={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function Dm(e,t,n){const o=jo(e,n),r=gr(t),i=Object.fromEntries(Ut.map(l=>{const u=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`,c=e.colors?.[u];return[l,c||Lm[l]]})),s=Rm(i),a=Om();return r.map(l=>a.parse(l[0]).map(u=>{let c,d;u.decorations.has("reverse")?(c=u.background?s.value(u.background):e.bg,d=u.foreground?s.value(u.foreground):e.fg):(c=u.foreground?s.value(u.foreground):e.fg,d=u.background?s.value(u.background):void 0),c=Bt(c,o),d=Bt(d,o),u.decorations.has("dim")&&(c=Mm(c));let h=Ue.None;return u.decorations.has("bold")&&(h|=Ue.Bold),u.decorations.has("italic")&&(h|=Ue.Italic),u.decorations.has("underline")&&(h|=Ue.Underline),u.decorations.has("strikethrough")&&(h|=Ue.Strikethrough),{content:u.value,offset:l[1],color:c,bgColor:d,fontStyle:h}}))}function Mm(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const o=t[1];if(o.length===8){const r=Math.round(Number.parseInt(o.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${o.slice(0,6)}${r}`}else{if(o.length===6)return`#${o}80`;if(o.length===4){const r=o[0],i=o[1],s=o[2],a=o[3],l=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${r}${r}${i}${i}${s}${s}${l}`}else if(o.length===3){const r=o[0],i=o[1],s=o[2];return`#${r}${r}${i}${i}${s}${s}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Yi(e,t,n={}){const{theme:o=e.getLoadedThemes()[0]}=n,r=e.resolveLangAlias(n.lang||"text");if(qi(r)||Wi(o))return gr(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:i,colorMap:s}=e.setTheme(o);if(r==="ansi")return Dm(i,t,n);const a=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new Ve(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(i.name))throw new Ve(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Vm(t,a,i,s,n)}function $m(...e){if(e.length===2)return Xn(e[1]);const[t,n,o={}]=e,{lang:r="text",theme:i=t.getLoadedThemes()[0]}=o;if(qi(r)||Wi(i))throw new Ve("Plain language does not have grammar state");if(r==="ansi")throw new Ve("ANSI language does not have grammar state");const{theme:s,colorMap:a}=t.setTheme(i),l=t.getLanguage(r);return new Nn(Xi(n,l,s,a,o).stateStack,l.name,s.name)}function Vm(e,t,n,o,r){const i=Xi(e,t,n,o,r),s=new Nn(i.stateStack,t.name,n.name);return vr(i.tokens,s),i.tokens}function Xi(e,t,n,o,r){const i=jo(n,r),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:a=500}=r,l=gr(e);let u=r.grammarState?km(r.grammarState,n.name)??ci:r.grammarContextCode!=null?Xi(r.grammarContextCode,t,n,o,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:ci,c=[];const d=[];for(let h=0,f=l.length;h<f;h++){const[p,v]=l[h];if(p===""){c=[],d.push([]);continue}if(s>0&&p.length>=s){c=[],d.push([{content:p,offset:v,color:"",fontStyle:0}]);continue}let y,_,b;r.includeExplanation&&(y=t.tokenizeLine(p,u,a),_=y.tokens,b=0);const m=t.tokenizeLine2(p,u,a),w=m.tokens.length/2;for(let A=0;A<w;A++){const D=m.tokens[2*A],z=A+1<w?m.tokens[2*A+2]:p.length;if(D===z)continue;const G=m.tokens[2*A+1],Z=Bt(o[wn.getForeground(G)],i),N=wn.getFontStyle(G),T={content:p.substring(D,z),offset:v+D,color:Z,fontStyle:N};if(r.includeExplanation){const E=[];if(r.includeExplanation!=="scopeName")for(const g of n.settings){let O;switch(typeof g.scope){case"string":O=g.scope.split(/,/).map(k=>k.trim());break;case"object":O=g.scope;break;default:continue}E.push({settings:g,selectors:O.map(k=>k.split(/ /))})}T.explanation=[];let P=0;for(;D+P<z;){const g=_[b],O=p.substring(g.startIndex,g.endIndex);P+=O.length,T.explanation.push({content:O,scopes:r.includeExplanation==="scopeName"?Bm(g.scopes):zm(E,g.scopes)}),b+=1}}c.push(T)}d.push(c),c=[],u=m.ruleStack}return{tokens:d,stateStack:u}}function Bm(e){return e.map(t=>({scopeName:t}))}function zm(e,t){const n=[];for(let o=0,r=t.length;o<r;o++){const i=t[o];n[o]={scopeName:i,themeMatches:Hm(e,i,t.slice(0,o))}}return n}function zs(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function Fm(e,t,n){if(!zs(e[e.length-1],t))return!1;let o=e.length-2,r=n.length-1;for(;o>=0&&r>=0;)zs(e[o],n[r])&&(o-=1),r-=1;return o===-1}function Hm(e,t,n){const o=[];for(const{selectors:r,settings:i}of e)for(const s of r)if(Fm(s,t,n)){o.push(i);break}return o}function ql(e,t,n){const o=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),r=o.map(l=>{const u=Yi(e,t,{...n,theme:l.theme}),c=Xn(u),d=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:u,state:c,theme:d}}),i=Gm(...r.map(l=>l.tokens)),s=i[0].map((l,u)=>l.map((c,d)=>{const h={content:c.content,variants:{},offset:c.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=c.explanation),i.forEach((f,p)=>{const{content:v,explanation:y,offset:_,...b}=f[u][d];h.variants[o[p].color]=b}),h})),a=r[0].state?new Nn(Object.fromEntries(r.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),r[0].state.lang):void 0;return a&&vr(s,a),s}function Gm(...e){const t=e.map(()=>[]),n=e.length;for(let o=0;o<e[0].length;o++){const r=e.map(l=>l[o]),i=t.map(()=>[]);t.forEach((l,u)=>l.push(i[u]));const s=r.map(()=>0),a=r.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(u=>u.content.length));for(let u=0;u<n;u++){const c=a[u];c.content.length===l?(i[u].push(c),s[u]+=1,a[u]=r[u][s[u]]):(i[u].push({...c,content:c.content.slice(0,l)}),a[u]={...c,content:c.content.slice(l),offset:c.offset+l})}}}return t}function Uo(e,t,n){let o,r,i,s,a,l;if("themes"in n){const{defaultColor:u="light",cssVariablePrefix:c="--shiki-",colorsRendering:d="css-vars"}=n,h=Object.entries(n.themes).filter(_=>_[1]).map(_=>({color:_[0],theme:_[1]})).sort((_,b)=>_.color===u?-1:b.color===u?1:0);if(h.length===0)throw new Ve("`themes` option must not be empty");const f=ql(e,t,n);if(l=Xn(f),u&&Ui!==u&&!h.find(_=>_.color===u))throw new Ve(`\`themes\` option must contain the defaultColor key \`${u}\``);const p=h.map(_=>e.getTheme(_.theme)),v=h.map(_=>_.color);i=f.map(_=>_.map(b=>Em(b,v,c,u,d))),l&&vr(i,l);const y=h.map(_=>jo(_.theme,n));r=Fs(h,p,y,c,u,"fg",d),o=Fs(h,p,y,c,u,"bg",d),s=`shiki-themes ${p.map(_=>_.name).join(" ")}`,a=u?void 0:[r,o].join(";")}else if("theme"in n){const u=jo(n.theme,n);i=Yi(e,t,n);const c=e.getTheme(n.theme);o=Bt(c.bg,u),r=Bt(c.fg,u),s=c.name,l=Xn(i)}else throw new Ve("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:r,bg:o,themeName:s,rootStyle:a,grammarState:l}}function Fs(e,t,n,o,r,i,s){return e.map((a,l)=>{const u=Bt(t[l][i],n[l])||"inherit",c=`${o+a.color}${i==="bg"?"-bg":""}:${u}`;if(l===0&&r){if(r===Ui&&e.length>1){const d=e.findIndex(v=>v.color==="light"),h=e.findIndex(v=>v.color==="dark");if(d===-1||h===-1)throw new Ve('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const f=Bt(t[d][i],n[d])||"inherit",p=Bt(t[h][i],n[h])||"inherit";return`light-dark(${f}, ${p});${c}`}return u}return s==="css-vars"?c:null}).filter(a=>!!a).join(";")}function Yo(e,t,n,o={meta:{},options:n,codeToHast:(r,i)=>Yo(e,r,i),codeToTokens:(r,i)=>Uo(e,r,i)}){let r=t;for(const p of Wo(n))r=p.preprocess?.call(o,r,n)||r;let{tokens:i,fg:s,bg:a,themeName:l,rootStyle:u,grammarState:c}=Uo(e,r,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:h=!1}=n;d===!0?i=qm(i):d==="never"&&(i=Wm(i)),h&&(i=Um(i));const f={...o,get source(){return r}};for(const p of Wo(n))i=p.tokens?.call(f,i)||i;return jm(i,{...n,fg:s,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??u},f,c)}function jm(e,t,n,o=Xn(e)){const r=Wo(t),i=[],s={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,u={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?u.style=t.rootStyle:u.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(u.tabindex=l.toString());for(const[v,y]of Object.entries(t.meta||{}))v.startsWith("_")||(u[v]=y);let c={type:"element",tagName:"pre",properties:u,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:i};const h=[],f={...n,structure:a,addClassToHast:Hl,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return c},get code(){return d},get lines(){return h}};if(e.forEach((v,y)=>{y&&(a==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&i.push({type:"text",value:`
|
|
13
|
+
`}));let _={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(const m of v){let w={type:"element",tagName:"span",properties:{...m.htmlAttrs},children:[{type:"text",value:m.content}]};const A=mi(m.htmlStyle||qo(m));A&&(w.properties.style=A);for(const D of r)w=D?.span?.call(f,w,y+1,b,_,m)||w;a==="inline"?s.children.push(w):a==="classic"&&_.children.push(w),b+=m.content.length}if(a==="classic"){for(const m of r)_=m?.line?.call(f,_,y+1)||_;h.push(_),i.push(_)}else a==="inline"&&h.push(_)}),a==="classic"){for(const v of r)d=v?.code?.call(f,d)||d;c.children.push(d);for(const v of r)c=v?.pre?.call(f,c)||c;s.children.push(c)}else if(a==="inline"){const v=[];let y={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const m of s.children)m.type==="element"&&m.tagName==="br"?(v.push(y),y={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(m.type==="element"||m.type==="text")&&y.children.push(m);v.push(y);let b={type:"element",tagName:"code",properties:{},children:v};for(const m of r)b=m?.code?.call(f,b)||b;s.children=[];for(let m=0;m<b.children.length;m++){m>0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const w=b.children[m];w.type==="element"&&s.children.push(...w.children)}}let p=s;for(const v of r)p=v?.root?.call(f,p)||p;return o&&vr(p,o),p}function qm(e){return e.map(t=>{const n=[];let o="",r;return t.forEach((i,s)=>{const l=!(i.fontStyle&&(i.fontStyle&Ue.Underline||i.fontStyle&Ue.Strikethrough));l&&i.content.match(/^\s+$/)&&t[s+1]?(r===void 0&&(r=i.offset),o+=i.content):o?(l?n.push({...i,offset:r,content:o+i.content}):n.push({content:o,offset:r},i),r=void 0,o=""):n.push(i)}),n})}function Wm(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const o=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!o)return n;const[,r,i,s]=o;if(!r&&!s)return n;const a=[{...n,offset:n.offset+r.length,content:i}];return r&&a.unshift({content:r,offset:n.offset}),s&&a.push({content:s,offset:n.offset+r.length+i.length}),a}))}function Um(e){return e.map(t=>{const n=[];for(const o of t){if(n.length===0){n.push({...o});continue}const r=n[n.length-1],i=mi(r.htmlStyle||qo(r)),s=mi(o.htmlStyle||qo(o)),a=r.fontStyle&&(r.fontStyle&Ue.Underline||r.fontStyle&Ue.Strikethrough),l=o.fontStyle&&(o.fontStyle&Ue.Underline||o.fontStyle&Ue.Strikethrough);!a&&!l&&i===s?r.content+=o.content:n.push({...o})}return n})}const Ym=hm;function Xm(e,t,n){const o={meta:{},options:n,codeToHast:(i,s)=>Yo(e,i,s),codeToTokens:(i,s)=>Uo(e,i,s)};let r=Ym(Yo(e,t,n,o));for(const i of Wo(n))r=i.postprocess?.call(o,r,n)||r;return r}const Hs={light:"#333333",dark:"#bbbbbb"},Gs={light:"#fffffe",dark:"#1e1e1e"},js="__shiki_resolved";function Ki(e){if(e?.[js])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:o}=t;if(!n||!o){const a=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(o=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!o&&t?.colors?.["editor.foreground"]&&(o=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),o||(o=t.type==="light"?Hs.light:Hs.dark),n||(n=t.type==="light"?Gs.light:Gs.dark),t.fg=o,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let r=0;const i=new Map;function s(a){if(i.has(a))return i.get(a);r+=1;const l=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?s(a):(i.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),u=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!u)return a;const c={...a,settings:{...a.settings}};if(l){const d=s(a.settings.foreground);t.colorReplacements[d]=a.settings.foreground,c.settings.foreground=d}if(u){const d=s(a.settings.background);t.colorReplacements[d]=a.settings.background,c.settings.background=d}return c});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=s(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,js,{enumerable:!1,writable:!1,value:!0}),t}async function Wl(e){return Array.from(new Set((await Promise.all(e.filter(t=>!zl(t)).map(async t=>await Bl(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Ul(e){return(await Promise.all(e.map(async n=>Fl(n)?null:Ki(await Bl(n))))).filter(n=>!!n)}let Km=3;function Zm(e,t=3){t>Km||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let un=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Yl(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new un(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class Jm extends Qh{constructor(t,n,o,r={}){super(t),this._resolver=t,this._themes=n,this._langs=o,this._alias=r,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=Ki(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=Bo.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=Yl(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const o={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const r=this.loadGrammarWithConfiguration(t.scopeName,1,o);if(r.name=t.name,this._resolvedGrammars.set(t.name,r),t.aliases&&t.aliases.forEach(i=>{this._alias[i]=t.name}),this._loadedLanguagesCache=null,n.size)for(const i of n)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const r of t)this.resolveEmbeddedLanguages(r);const n=Array.from(this._langGraph.entries()),o=n.filter(([r,i])=>!i);if(o.length){const r=n.filter(([i,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(l=>o.map(([u])=>u).includes(l)):!1).filter(i=>!o.includes(i));throw new un(`Missing languages ${o.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of n)this._resolver.addLanguage(i);for(const[r,i]of n)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const o of n)this._langGraph.set(o,this._langMap.get(o))}}class Qm{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:o=>t.createScanner(o),createOnigString:o=>t.createString(o)},n.forEach(o=>this.addLanguage(o))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let o=[];for(let r=1;r<=n.length;r++){const i=n.slice(0,r).join(".");o=[...o,...this._injections.get(i)||[]]}return o}}let On=0;function eg(e){On+=1,e.warnings!==!1&&On>=10&&On%10===0&&console.warn(`[Shiki] ${On} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new un("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),o=(e.themes||[]).flat(1).map(Ki),r=new Qm(e.engine,n),i=new Jm(r,o,n,e.langAlias);let s;function a(m){return Yl(m,e.langAlias)}function l(m){_();const w=i.getGrammar(typeof m=="string"?m:m.name);if(!w)throw new un(`Language \`${m}\` not found, you may need to load it first`);return w}function u(m){if(m==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};_();const w=i.getTheme(m);if(!w)throw new un(`Theme \`${m}\` not found, you may need to load it first`);return w}function c(m){_();const w=u(m);s!==m&&(i.setTheme(w),s=m);const A=i.getColorMap();return{theme:w,colorMap:A}}function d(){return _(),i.getLoadedThemes()}function h(){return _(),i.getLoadedLanguages()}function f(...m){_(),i.loadLanguages(m.flat(1))}async function p(...m){return f(await Wl(m))}function v(...m){_();for(const w of m.flat(1))i.loadTheme(w)}async function y(...m){return _(),v(await Ul(m))}function _(){if(t)throw new un("Shiki instance has been disposed")}function b(){t||(t=!0,i.dispose(),On-=1)}return{setTheme:c,getTheme:u,getLanguage:l,getLoadedThemes:d,getLoadedLanguages:h,resolveLangAlias:a,loadLanguage:p,loadLanguageSync:f,loadTheme:y,loadThemeSync:v,dispose:b,[Symbol.dispose]:b}}async function tg(e){e.engine||Zm("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,o]=await Promise.all([Ul(e.themes||[]),Wl(e.langs||[]),e.engine]);return eg({...e,themes:t,langs:n,engine:o})}async function ng(e){const t=await tg(e);return{getLastGrammarState:(...n)=>$m(t,...n),codeToTokensBase:(n,o)=>Yi(t,n,o),codeToTokensWithThemes:(n,o)=>ql(t,n,o),codeToTokens:(n,o)=>Uo(t,n,o),codeToHast:(n,o)=>Yo(t,n,o),codeToHtml:(n,o)=>Xm(t,n,o),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function og(e){const t=e.langs,n=e.themes,o=e.engine;async function r(i){function s(d){if(typeof d=="string"){if(d=i.langAlias?.[d]||d,zl(d))return[];const h=t[d];if(!h)throw new Ve(`Language \`${d}\` is not included in this bundle. You may want to load it from external source.`);return h}return d}function a(d){if(Fl(d))return"none";if(typeof d=="string"){const h=n[d];if(!h)throw new Ve(`Theme \`${d}\` is not included in this bundle. You may want to load it from external source.`);return h}return d}const l=(i.themes??[]).map(d=>a(d)),u=(i.langs??[]).map(d=>s(d)),c=await ng({engine:i.engine??o(),...i,themes:l,langs:u});return{...c,loadLanguage(...d){return c.loadLanguage(...d.map(s))},loadTheme(...d){return c.loadTheme(...d.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return r}function rg(e){let t;async function n(o={}){if(t){const r=await t;return await Promise.all([r.loadTheme(...o.themes||[]),r.loadLanguage(...o.langs||[])]),r}else{t=e({...o,themes:[],langs:[]});const r=await t;return await Promise.all([r.loadTheme(...o.themes||[]),r.loadLanguage(...o.langs||[])]),r}}return n}function ig(e,t){const n=rg(e);async function o(r,i){const s=await n({langs:[i.lang],themes:"theme"in i?[i.theme]:Object.values(i.themes)}),a=await t?.guessEmbeddedLanguages?.(r,i.lang,s);return a&&await s.loadLanguage(...a),s}return{getSingletonHighlighter(r){return n(r)},async codeToHtml(r,i){return(await o(r,i)).codeToHtml(r,i)},async codeToHast(r,i){return(await o(r,i)).codeToHast(r,i)},async codeToTokens(r,i){return(await o(r,i)).codeToTokens(r,i)},async codeToTokensBase(r,i){return(await o(r,i)).codeToTokensBase(r,i)},async codeToTokensWithThemes(r,i){return(await o(r,i)).codeToTokensWithThemes(r,i)},async getLastGrammarState(r,i){return(await n({langs:[i.lang],themes:[i.theme]})).getLastGrammarState(r,i)}}}const Xl=[{id:"abap",name:"ABAP",import:(()=>S(()=>import("./BdImnpbu.js"),[],import.meta.url))},{id:"actionscript-3",name:"ActionScript",import:(()=>S(()=>import("./CoDkCxhg.js"),[],import.meta.url))},{id:"ada",name:"Ada",import:(()=>S(()=>import("./bCR0ucgS.js"),[],import.meta.url))},{id:"angular-html",name:"Angular HTML",import:(()=>S(()=>import("./DxNHbxmM.js").then(e=>e.f),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>S(()=>import("./Cl0AqbOI.js"),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:"apache",name:"Apache Conf",import:(()=>S(()=>import("./Pmp26Uib.js"),[],import.meta.url))},{id:"apex",name:"Apex",import:(()=>S(()=>import("./D8_7TLub.js"),[],import.meta.url))},{id:"apl",name:"APL",import:(()=>S(()=>import("./Cn7AkR1O.js"),__vite__mapDeps([6,1,2,3,7,8,9]),import.meta.url))},{id:"applescript",name:"AppleScript",import:(()=>S(()=>import("./Co6uUVPk.js"),[],import.meta.url))},{id:"ara",name:"Ara",import:(()=>S(()=>import("./BRHolxvo.js"),[],import.meta.url))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>S(()=>import("./Dv7Oe6Be.js"),[],import.meta.url))},{id:"asm",name:"Assembly",import:(()=>S(()=>import("./D_Q5rh1f.js"),[],import.meta.url))},{id:"astro",name:"Astro",import:(()=>S(()=>import("./DxSwrfjg.js"),__vite__mapDeps([10,9,2,11,3,12,13]),import.meta.url))},{id:"awk",name:"AWK",import:(()=>S(()=>import("./DMzUqQB5.js"),[],import.meta.url))},{id:"ballerina",name:"Ballerina",import:(()=>S(()=>import("./BFfxhgS-.js"),[],import.meta.url))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>S(()=>import("./BkioyH1T.js"),[],import.meta.url))},{id:"beancount",name:"Beancount",import:(()=>S(()=>import("./k_qm7-4y.js"),[],import.meta.url))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>S(()=>import("./uYugtg8r.js"),[],import.meta.url))},{id:"bibtex",name:"BibTeX",import:(()=>S(()=>import("./CHM0blh-.js"),[],import.meta.url))},{id:"bicep",name:"Bicep",import:(()=>S(()=>import("./Bmn6On1c.js"),[],import.meta.url))},{id:"blade",name:"Blade",import:(()=>S(()=>import("./5X7smno1.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9]),import.meta.url))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>S(()=>import("./CquLrc37.js"),__vite__mapDeps([17,18]),import.meta.url))},{id:"c",name:"C",import:(()=>S(()=>import("./BIGW1oBm.js"),[],import.meta.url))},{id:"c3",name:"C3",import:(()=>S(()=>import("./VCDPK7BO.js"),[],import.meta.url))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>S(()=>import("./Bv_4Rxtq.js"),[],import.meta.url))},{id:"cairo",name:"Cairo",import:(()=>S(()=>import("./CO1LY3CK.js"),__vite__mapDeps([19,20]),import.meta.url))},{id:"clarity",name:"Clarity",import:(()=>S(()=>import("./D53aC0YG.js"),[],import.meta.url))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>S(()=>import("./P80f7IUj.js"),[],import.meta.url))},{id:"cmake",name:"CMake",import:(()=>S(()=>import("./D1j8_8rp.js"),[],import.meta.url))},{id:"cobol",name:"COBOL",import:(()=>S(()=>import("./BYV0-3_D.js"),__vite__mapDeps([21,1,2,3,8]),import.meta.url))},{id:"codeowners",name:"CODEOWNERS",import:(()=>S(()=>import("./Bp6g37R7.js"),[],import.meta.url))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>S(()=>import("./DsOJ9woJ.js"),[],import.meta.url))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>S(()=>import("./CxbxFI8M.js"),__vite__mapDeps([22,2]),import.meta.url))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>S(()=>import("./Cg-RD9OK.js"),[],import.meta.url))},{id:"coq",name:"Coq",import:(()=>S(()=>import("./DkFqJrB1.js"),[],import.meta.url))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>S(()=>import("./Bp3cYrEr.js"),__vite__mapDeps([23,24,25,26,16]),import.meta.url))},{id:"crystal",name:"Crystal",import:(()=>S(()=>import("./fKv21gyL.js"),__vite__mapDeps([27,1,2,3,16,26,28]),import.meta.url))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>S(()=>import("./COcwbKMJ.js"),[],import.meta.url))},{id:"css",name:"CSS",import:(()=>S(()=>import("./DPfMkruS.js"),[],import.meta.url))},{id:"csv",name:"CSV",import:(()=>S(()=>import("./fuZLfV_i.js"),[],import.meta.url))},{id:"cue",name:"CUE",import:(()=>S(()=>import("./D82EKSYY.js"),[],import.meta.url))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>S(()=>import("./COkxafJQ.js"),[],import.meta.url))},{id:"d",name:"D",import:(()=>S(()=>import("./85-TOEBH.js"),[],import.meta.url))},{id:"dart",name:"Dart",import:(()=>S(()=>import("./CF10PKvl.js"),[],import.meta.url))},{id:"dax",name:"DAX",import:(()=>S(()=>import("./CEL-wOlO.js"),[],import.meta.url))},{id:"desktop",name:"Desktop",import:(()=>S(()=>import("./BmXAJ9_W.js"),[],import.meta.url))},{id:"diff",name:"Diff",import:(()=>S(()=>import("./D97Zzqfu.js"),[],import.meta.url))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>S(()=>import("./BcOcwvcX.js"),[],import.meta.url))},{id:"dotenv",name:"dotEnv",import:(()=>S(()=>import("./Da5cRb03.js"),[],import.meta.url))},{id:"dream-maker",name:"Dream Maker",import:(()=>S(()=>import("./BtqSS_iP.js"),[],import.meta.url))},{id:"edge",name:"Edge",import:(()=>S(()=>import("./DZu-aV2c.js"),__vite__mapDeps([29,11,1,2,3,15]),import.meta.url))},{id:"elixir",name:"Elixir",import:(()=>S(()=>import("./CpOuai2O.js"),__vite__mapDeps([30,1,2,3]),import.meta.url))},{id:"elm",name:"Elm",import:(()=>S(()=>import("./CeZK1NFH.js"),__vite__mapDeps([31,25,26]),import.meta.url))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>S(()=>import("./C9XAeP06.js"),[],import.meta.url))},{id:"erb",name:"ERB",import:(()=>S(()=>import("./CGscLIrv.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38]),import.meta.url))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>S(()=>import("./CuPHTKiy.js"),__vite__mapDeps([39,40]),import.meta.url))},{id:"fennel",name:"Fennel",import:(()=>S(()=>import("./BYunw83y.js"),[],import.meta.url))},{id:"fish",name:"Fish",import:(()=>S(()=>import("./BvzEVeQv.js"),[],import.meta.url))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>S(()=>import("./C4IJs8-o.js"),[],import.meta.url))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>S(()=>import("./B7c-h3xW.js"),__vite__mapDeps([41,42]),import.meta.url))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>S(()=>import("./BxgE0vQu.js"),[],import.meta.url))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>S(()=>import("./BTifaqeh.js"),__vite__mapDeps([43,40]),import.meta.url))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>S(()=>import("./CenWIFCC.js"),__vite__mapDeps([44,45,46]),import.meta.url))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>S(()=>import("./C5YyOfLZ.js"),[],import.meta.url))},{id:"gdshader",name:"GDShader",import:(()=>S(()=>import("./DkwncUOv.js"),[],import.meta.url))},{id:"genie",name:"Genie",import:(()=>S(()=>import("./D0YGMca9.js"),[],import.meta.url))},{id:"gherkin",name:"Gherkin",import:(()=>S(()=>import("./DyxjwDmM.js"),[],import.meta.url))},{id:"git-commit",name:"Git Commit Message",import:(()=>S(()=>import("./CxGSJlkm.js"),__vite__mapDeps([47,48]),import.meta.url))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>S(()=>import("./CSXwinHm.js"),__vite__mapDeps([49,28]),import.meta.url))},{id:"gleam",name:"Gleam",import:(()=>S(()=>import("./BspZqrRM.js"),[],import.meta.url))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>S(()=>import("./YqXBG_HV.js"),__vite__mapDeps([50,2,11,3,1]),import.meta.url))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>S(()=>import("./BR5kRUq4.js"),__vite__mapDeps([51,11,3,2,1]),import.meta.url))},{id:"glsl",name:"GLSL",import:(()=>S(()=>import("./DZxFcAj9.js"),__vite__mapDeps([25,26]),import.meta.url))},{id:"gn",name:"GN",import:(()=>S(()=>import("./n2N0HUVH.js"),[],import.meta.url))},{id:"gnuplot",name:"Gnuplot",import:(()=>S(()=>import("./DdkO51Og.js"),[],import.meta.url))},{id:"go",name:"Go",import:(()=>S(()=>import("./CxLEBnE3.js"),[],import.meta.url))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>S(()=>import("./C9oPPf7i.js"),__vite__mapDeps([35,2,11,36,13]),import.meta.url))},{id:"groovy",name:"Groovy",import:(()=>S(()=>import("./gcz8RCvz.js"),[],import.meta.url))},{id:"hack",name:"Hack",import:(()=>S(()=>import("./CLZrNe3w.js"),__vite__mapDeps([52,1,2,3,16]),import.meta.url))},{id:"haml",name:"Ruby Haml",import:(()=>S(()=>import("./CmIQRyeF.js"),__vite__mapDeps([34,2,3]),import.meta.url))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>S(()=>import("./m17aaUwq.js"),__vite__mapDeps([53,1,2,3,38]),import.meta.url))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>S(()=>import("./Df6bDoY_.js"),[],import.meta.url))},{id:"haxe",name:"Haxe",import:(()=>S(()=>import("./CzTSHFRz.js"),[],import.meta.url))},{id:"hcl",name:"HashiCorp HCL",import:(()=>S(()=>import("./BWvSN4gD.js"),[],import.meta.url))},{id:"hjson",name:"Hjson",import:(()=>S(()=>import("./D5-asLiD.js"),[],import.meta.url))},{id:"hlsl",name:"HLSL",import:(()=>S(()=>import("./D3lLCCz7.js"),[],import.meta.url))},{id:"html",name:"HTML",import:(()=>S(()=>import("./CnnebwVN.js"),__vite__mapDeps([1,2,3]),import.meta.url))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>S(()=>import("./DGP4VlC8.js"),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:"http",name:"HTTP",import:(()=>S(()=>import("./CufHLc7y.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13]),import.meta.url))},{id:"hurl",name:"Hurl",import:(()=>S(()=>import("./CYsAdtH9.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56]),import.meta.url))},{id:"hxml",name:"HXML",import:(()=>S(()=>import("./DWrx1Km3.js"),__vite__mapDeps([57,58]),import.meta.url))},{id:"hy",name:"Hy",import:(()=>S(()=>import("./DFXneXwc.js"),[],import.meta.url))},{id:"imba",name:"Imba",import:(()=>S(()=>import("./DGztddWO.js"),[],import.meta.url))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>S(()=>import("./BEwlwnbL.js"),[],import.meta.url))},{id:"java",name:"Java",import:(()=>S(()=>import("./CylS5w8V.js"),[],import.meta.url))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>S(()=>import("./wDzz0qaB.js"),[],import.meta.url))},{id:"jinja",name:"Jinja",import:(()=>S(()=>import("./CXZktZb0.js"),__vite__mapDeps([59,1,2,3]),import.meta.url))},{id:"jison",name:"Jison",import:(()=>S(()=>import("./Br6cN0cg.js"),__vite__mapDeps([60,2]),import.meta.url))},{id:"json",name:"JSON",import:(()=>S(()=>import("./Cp-IABpG.js"),[],import.meta.url))},{id:"json5",name:"JSON5",import:(()=>S(()=>import("./C9tS-k6U.js"),[],import.meta.url))},{id:"jsonc",name:"JSON with Comments",import:(()=>S(()=>import("./Des-eS-w.js"),[],import.meta.url))},{id:"jsonl",name:"JSON Lines",import:(()=>S(()=>import("./DcaNXYhu.js"),[],import.meta.url))},{id:"jsonnet",name:"Jsonnet",import:(()=>S(()=>import("./DFQXde-d.js"),[],import.meta.url))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>S(()=>import("./C2t-YnRu.js"),[],import.meta.url))},{id:"jsx",name:"JSX",import:(()=>S(()=>import("./g9-lgVsj.js"),[],import.meta.url))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>S(()=>import("./W9tJ9s81.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62]),import.meta.url))},{id:"kdl",name:"KDL",import:(()=>S(()=>import("./DV7GczEv.js"),[],import.meta.url))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>S(()=>import("./BdnUsdx6.js"),[],import.meta.url))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>S(()=>import("./DZf3V79B.js"),[],import.meta.url))},{id:"latex",name:"LaTeX",import:(()=>S(()=>import("./DMwsHuHA.js"),__vite__mapDeps([63,64,62]),import.meta.url))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>S(()=>import("./BZvkOJ9d.js"),[],import.meta.url))},{id:"less",name:"Less",import:(()=>S(()=>import("./B1dDrJ26.js"),[],import.meta.url))},{id:"liquid",name:"Liquid",import:(()=>S(()=>import("./mjskCLCv.js"),__vite__mapDeps([65,1,2,3,9]),import.meta.url))},{id:"llvm",name:"LLVM IR",import:(()=>S(()=>import("./BtvRca6l.js"),[],import.meta.url))},{id:"log",name:"Log file",import:(()=>S(()=>import("./2UxHyX5q.js"),[],import.meta.url))},{id:"logo",name:"Logo",import:(()=>S(()=>import("./BtOb2qkB.js"),[],import.meta.url))},{id:"lua",name:"Lua",import:(()=>S(()=>import("./CnsnAmq5.js"),__vite__mapDeps([37,26]),import.meta.url))},{id:"luau",name:"Luau",import:(()=>S(()=>import("./C-HG3fhB.js"),[],import.meta.url))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>S(()=>import("./CHLpvVh8.js"),[],import.meta.url))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>S(()=>import("./Cvjx9yec.js"),[],import.meta.url))},{id:"marko",name:"Marko",import:(()=>S(()=>import("./83L43bj1.js"),__vite__mapDeps([66,3,67,5,11]),import.meta.url))},{id:"matlab",name:"MATLAB",import:(()=>S(()=>import("./D7o27uSR.js"),[],import.meta.url))},{id:"mdc",name:"MDC",import:(()=>S(()=>import("./TsXTqZ29.js"),__vite__mapDeps([68,40,38,15,1,2,3]),import.meta.url))},{id:"mdx",name:"MDX",import:(()=>S(()=>import("./Cmh6b_Ma.js"),[],import.meta.url))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>S(()=>import("./mWjccvbQ.js"),[],import.meta.url))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>S(()=>import("./CKIfxQSi.js"),[],import.meta.url))},{id:"mojo",name:"Mojo",import:(()=>S(()=>import("./B93PlW-d.js"),[],import.meta.url))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>S(()=>import("./Ba13S78F.js"),[],import.meta.url))},{id:"move",name:"Move",import:(()=>S(()=>import("./IF9eRakj.js"),[],import.meta.url))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>S(()=>import("./DRg8JJMk.js"),[],import.meta.url))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>S(()=>import("./BrzmwbiE.js"),[],import.meta.url))},{id:"nginx",name:"Nginx",import:(()=>S(()=>import("./Dph4kLrZ.js"),__vite__mapDeps([69,37,26]),import.meta.url))},{id:"nim",name:"Nim",import:(()=>S(()=>import("./DhmSosst.js"),__vite__mapDeps([70,26,1,2,3,7,8,25,40]),import.meta.url))},{id:"nix",name:"Nix",import:(()=>S(()=>import("./CwoSXNpI.js"),[],import.meta.url))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>S(()=>import("./C-sUppwS.js"),[],import.meta.url))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>S(()=>import("./DXmwc3jG.js"),[],import.meta.url))},{id:"objective-cpp",name:"Objective-C++",import:(()=>S(()=>import("./CLxacb5B.js"),[],import.meta.url))},{id:"ocaml",name:"OCaml",import:(()=>S(()=>import("./C0hk2d4L.js"),[],import.meta.url))},{id:"odin",name:"Odin",import:(()=>S(()=>import("./BBf5iR-q.js"),[],import.meta.url))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>S(()=>import("./C4EeE6gA.js"),[],import.meta.url))},{id:"pascal",name:"Pascal",import:(()=>S(()=>import("./D93ZcfNL.js"),[],import.meta.url))},{id:"perl",name:"Perl",import:(()=>S(()=>import("./BzTr9Aqm.js"),__vite__mapDeps([71,1,2,3,7,8,16]),import.meta.url))},{id:"php",name:"PHP",import:(()=>S(()=>import("./DJjDtW9f.js"),__vite__mapDeps([72,1,2,3,7,8,16,9]),import.meta.url))},{id:"pkl",name:"Pkl",import:(()=>S(()=>import("./u5AG7uiY.js"),[],import.meta.url))},{id:"plsql",name:"PL/SQL",import:(()=>S(()=>import("./ChMvpjG-.js"),[],import.meta.url))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>S(()=>import("./BTJTHyun.js"),[],import.meta.url))},{id:"polar",name:"Polar",import:(()=>S(()=>import("./C0HS_06l.js"),[],import.meta.url))},{id:"postcss",name:"PostCSS",import:(()=>S(()=>import("./CXtECtnM.js"),[],import.meta.url))},{id:"powerquery",name:"PowerQuery",import:(()=>S(()=>import("./CEu0bR-o.js"),[],import.meta.url))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>S(()=>import("./Dpen1YoG.js"),[],import.meta.url))},{id:"prisma",name:"Prisma",import:(()=>S(()=>import("./Dd19v3D-.js"),[],import.meta.url))},{id:"prolog",name:"Prolog",import:(()=>S(()=>import("./CbFg5uaA.js"),[],import.meta.url))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>S(()=>import("./C7zT0LnQ.js"),[],import.meta.url))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>S(()=>import("./BLmx8bSh.js"),__vite__mapDeps([73,2,3,1]),import.meta.url))},{id:"puppet",name:"Puppet",import:(()=>S(()=>import("./BMWR74SV.js"),[],import.meta.url))},{id:"purescript",name:"PureScript",import:(()=>S(()=>import("./CklMAg4u.js"),[],import.meta.url))},{id:"python",name:"Python",aliases:["py"],import:(()=>S(()=>import("./B6aJPvgy.js"),[],import.meta.url))},{id:"qml",name:"QML",import:(()=>S(()=>import("./BVQ-GDCI.js"),__vite__mapDeps([74,2]),import.meta.url))},{id:"qmldir",name:"QML Directory",import:(()=>S(()=>import("./C8lEn-DE.js"),[],import.meta.url))},{id:"qss",name:"Qt Style Sheets",import:(()=>S(()=>import("./IeuSbFQv.js"),[],import.meta.url))},{id:"r",name:"R",import:(()=>S(()=>import("./Dspwwk_N.js"),[],import.meta.url))},{id:"racket",name:"Racket",import:(()=>S(()=>import("./BqYA7rlc.js"),[],import.meta.url))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>S(()=>import("./DXvB9xmW.js"),[],import.meta.url))},{id:"razor",name:"ASP.NET Razor",import:(()=>S(()=>import("./DsumFeuD.js"),__vite__mapDeps([75,1,2,3,76]),import.meta.url))},{id:"reg",name:"Windows Registry Script",import:(()=>S(()=>import("./C-SQnVFl.js"),[],import.meta.url))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>S(()=>import("./CDVJQ6XC.js"),[],import.meta.url))},{id:"rel",name:"Rel",import:(()=>S(()=>import("./C3B-1QV4.js"),[],import.meta.url))},{id:"riscv",name:"RISC-V",import:(()=>S(()=>import("./BM1_JUlF.js"),[],import.meta.url))},{id:"ron",name:"RON",import:(()=>S(()=>import("./BhRPY-oY.js"),[],import.meta.url))},{id:"rosmsg",name:"ROS Interface",import:(()=>S(()=>import("./BJDFO7_C.js"),[],import.meta.url))},{id:"rst",name:"reStructuredText",import:(()=>S(()=>import("./DQwYQDb2.js"),__vite__mapDeps([77,15,1,2,3,23,24,25,26,16,20,28,38,78,33,34,7,8,35,11,36,13,37]),import.meta.url))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>S(()=>import("./Bhrxn6JZ.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38]),import.meta.url))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>S(()=>import("./B1yitclQ.js"),[],import.meta.url))},{id:"sas",name:"SAS",import:(()=>S(()=>import("./CG8Ifv2g.js"),__vite__mapDeps([79,16]),import.meta.url))},{id:"sass",name:"Sass",import:(()=>S(()=>import("./Cj5Yp3dK.js"),[],import.meta.url))},{id:"scala",name:"Scala",import:(()=>S(()=>import("./C151Ov-r.js"),[],import.meta.url))},{id:"scheme",name:"Scheme",import:(()=>S(()=>import("./C98Dy4si.js"),[],import.meta.url))},{id:"scss",name:"SCSS",import:(()=>S(()=>import("./2EtD6e53.js"),__vite__mapDeps([5,3]),import.meta.url))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>S(()=>import("./DVxCFoDh.js"),[],import.meta.url))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>S(()=>import("./BqTXFGrv.js"),__vite__mapDeps([80,81]),import.meta.url))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>S(()=>import("./Yzrsuije.js"),[],import.meta.url))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>S(()=>import("./Cq5zzVJU.js"),__vite__mapDeps([82,28]),import.meta.url))},{id:"smalltalk",name:"Smalltalk",import:(()=>S(()=>import("./BERRCDM3.js"),[],import.meta.url))},{id:"solidity",name:"Solidity",import:(()=>S(()=>import("./rGO070M0.js"),[],import.meta.url))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>S(()=>import("./Dzze3sRP.js"),__vite__mapDeps([83,1,2,3]),import.meta.url))},{id:"sparql",name:"SPARQL",import:(()=>S(()=>import("./BRZ36xJF.js"),__vite__mapDeps([84,85]),import.meta.url))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>S(()=>import("./BtCnVYZw.js"),[],import.meta.url))},{id:"sql",name:"SQL",import:(()=>S(()=>import("./BLtJtn59.js"),[],import.meta.url))},{id:"ssh-config",name:"SSH Config",import:(()=>S(()=>import("./_ykCGR6B.js"),[],import.meta.url))},{id:"stata",name:"Stata",import:(()=>S(()=>import("./DM8c43g1.js"),__vite__mapDeps([86,16]),import.meta.url))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>S(()=>import("./BEDo0Tqx.js"),[],import.meta.url))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>S(()=>import("./BH7IYjvW.js"),__vite__mapDeps([87,2]),import.meta.url))},{id:"svelte",name:"Svelte",import:(()=>S(()=>import("./DYoxhk2S.js"),__vite__mapDeps([88,2,11,3,12]),import.meta.url))},{id:"swift",name:"Swift",import:(()=>S(()=>import("./Dg5xB15N.js"),[],import.meta.url))},{id:"system-verilog",name:"SystemVerilog",import:(()=>S(()=>import("./CnnmHF94.js"),[],import.meta.url))},{id:"systemd",name:"Systemd Units",import:(()=>S(()=>import("./4A_iFExJ.js"),[],import.meta.url))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>S(()=>import("./CkByrt1z.js"),[],import.meta.url))},{id:"tasl",name:"Tasl",import:(()=>S(()=>import("./QIJgUcNo.js"),[],import.meta.url))},{id:"tcl",name:"Tcl",import:(()=>S(()=>import("./dwOrl1Do.js"),[],import.meta.url))},{id:"templ",name:"Templ",import:(()=>S(()=>import("./CZhp0h8q.js"),__vite__mapDeps([89,90,2,3]),import.meta.url))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>S(()=>import("./BETggiCN.js"),[],import.meta.url))},{id:"tex",name:"TeX",import:(()=>S(()=>import("./CQ8jqdy-.js"),__vite__mapDeps([64,62]),import.meta.url))},{id:"toml",name:"TOML",import:(()=>S(()=>import("./vGWfd6FD.js"),[],import.meta.url))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>S(()=>import("./Cm3UrAx6.js"),__vite__mapDeps([91,11,3,2,25,26,1,16,7,8]),import.meta.url))},{id:"tsv",name:"TSV",import:(()=>S(()=>import("./B_m7g4N7.js"),[],import.meta.url))},{id:"tsx",name:"TSX",import:(()=>S(()=>import("./COt5Ahok.js"),[],import.meta.url))},{id:"turtle",name:"Turtle",import:(()=>S(()=>import("./BsS91CYL.js"),[],import.meta.url))},{id:"twig",name:"Twig",import:(()=>S(()=>import("./RNghxpo_.js"),__vite__mapDeps([92,3,2,5,72,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38]),import.meta.url))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>S(()=>import("./BPQ3VLAy.js"),[],import.meta.url))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>S(()=>import("./BGHnOYBU.js"),[],import.meta.url))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>S(()=>import("./DHCkPAjA.js"),[],import.meta.url))},{id:"v",name:"V",import:(()=>S(()=>import("./BcVCzyr7.js"),[],import.meta.url))},{id:"vala",name:"Vala",import:(()=>S(()=>import("./CsfeWuGM.js"),[],import.meta.url))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>S(()=>import("./D17OF-Vu.js"),[],import.meta.url))},{id:"verilog",name:"Verilog",import:(()=>S(()=>import("./BQ8w6xss.js"),[],import.meta.url))},{id:"vhdl",name:"VHDL",import:(()=>S(()=>import("./CeAyd5Ju.js"),[],import.meta.url))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>S(()=>import("./CJc9bBzg.js"),[],import.meta.url))},{id:"vue",name:"Vue",import:(()=>S(()=>import("./DEthMvLe.js"),__vite__mapDeps([93,3,2,11,9,1,15]),import.meta.url))},{id:"vue-html",name:"Vue HTML",import:(()=>S(()=>import("./DqQDbK_p.js"),__vite__mapDeps([94,2]),import.meta.url))},{id:"vue-vine",name:"Vue Vine",import:(()=>S(()=>import("./CW8IKDeL.js"),__vite__mapDeps([95,3,5,67,96,12,2]),import.meta.url))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>S(()=>import("./CDx5xZoG.js"),[],import.meta.url))},{id:"wasm",name:"WebAssembly",import:(()=>S(()=>import("./MzD3tlZU.js"),[],import.meta.url))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>S(()=>import("./BV7otONQ.js"),[],import.meta.url))},{id:"wgsl",name:"WGSL",import:(()=>S(()=>import("./Dx-B1_4e.js"),[],import.meta.url))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>S(()=>import("./BhOHFoWU.js"),[],import.meta.url))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>S(()=>import("./5i3qLPDT.js"),[],import.meta.url))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>S(()=>import("./lXgVvXCa.js"),[],import.meta.url))},{id:"xml",name:"XML",import:(()=>S(()=>import("./BGJmEYvX.js"),__vite__mapDeps([7,8]),import.meta.url))},{id:"xsl",name:"XSL",import:(()=>S(()=>import("./yv6CvBhz.js"),__vite__mapDeps([97,7,8]),import.meta.url))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>S(()=>import("./Buea-lGh.js"),[],import.meta.url))},{id:"zenscript",name:"ZenScript",import:(()=>S(()=>import("./DVFEvuxE.js"),[],import.meta.url))},{id:"zig",name:"Zig",import:(()=>S(()=>import("./VOosw3JB.js"),[],import.meta.url))}],sg=Object.fromEntries(Xl.map(e=>[e.id,e.import])),ag=Object.fromEntries(Xl.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),lg={...sg,...ag},ug=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>S(()=>import("./C4gqWexZ.js"),[],import.meta.url))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>S(()=>import("./D-2ljcwZ.js"),[],import.meta.url))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>S(()=>import("./CMjwMIkn.js"),[],import.meta.url))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>S(()=>import("./C47S-Tmv.js"),[],import.meta.url))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>S(()=>import("./CjoLj4QM.js"),[],import.meta.url))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>S(()=>import("./DFWUc33u.js"),[],import.meta.url))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>S(()=>import("./C9dUb6Cb.js"),[],import.meta.url))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>S(()=>import("./DQyhUUbL.js"),[],import.meta.url))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>S(()=>import("./D87Tk5Gz.js"),[],import.meta.url))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>S(()=>import("./C3mMm8J8.js"),[],import.meta.url))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>S(()=>import("./BzJJZx-M.js"),[],import.meta.url))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>S(()=>import("./BXkSAIEj.js"),[],import.meta.url))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>S(()=>import("./BgDCqdQA.js"),[],import.meta.url))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>S(()=>import("./C8M2exoo.js"),[],import.meta.url))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>S(()=>import("./DHJKELXO.js"),[],import.meta.url))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>S(()=>import("./Cuk6v7N8.js"),[],import.meta.url))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>S(()=>import("./DH5Ifo-i.js"),[],import.meta.url))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>S(()=>import("./E3gJ1_iC.js"),[],import.meta.url))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>S(()=>import("./DAi9KRSo.js"),[],import.meta.url))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>S(()=>import("./D7oLnXFd.js"),[],import.meta.url))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>S(()=>import("./BfjtVDDH.js"),[],import.meta.url))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>S(()=>import("./CFHQjOhq.js"),[],import.meta.url))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>S(()=>import("./GsRaNv29.js"),[],import.meta.url))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>S(()=>import("./CVdnzihN.js"),[],import.meta.url))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>S(()=>import("./CH1njM8p.js"),[],import.meta.url))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>S(()=>import("./DRw_LuNl.js"),[],import.meta.url))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>S(()=>import("./hJgmCMqR.js"),[],import.meta.url))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>S(()=>import("./BUw7H-hv.js"),[],import.meta.url))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>S(()=>import("./DnULxvSX.js"),[],import.meta.url))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>S(()=>import("./CkXjmgJE.js"),[],import.meta.url))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>S(()=>import("./CfQXZHmo.js"),[],import.meta.url))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>S(()=>import("./DWedfzmr.js"),[],import.meta.url))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>S(()=>import("./DUszq2jm.js"),[],import.meta.url))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>S(()=>import("./B7mTdjB0.js"),[],import.meta.url))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>S(()=>import("./D5KoaKCx.js"),[],import.meta.url))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>S(()=>import("./BfHTSMKl.js"),[],import.meta.url))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>S(()=>import("./B0m2ddpp.js"),[],import.meta.url))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>S(()=>import("./CyktbL80.js"),[],import.meta.url))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>S(()=>import("./Csfq5Kiy.js"),[],import.meta.url))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>S(()=>import("./CafNBF8u.js"),[],import.meta.url))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>S(()=>import("./CTRr51gU.js"),[],import.meta.url))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>S(()=>import("./D4h5O-jR.js"),[],import.meta.url))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>S(()=>import("./C39BiMTA.js"),[],import.meta.url))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>S(()=>import("./CMTm3GFP.js"),[],import.meta.url))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>S(()=>import("./Ddv68eIx.js"),[],import.meta.url))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>S(()=>import("./DVMEJ2y_.js"),[],import.meta.url))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>S(()=>import("./C3Wv6jpd.js"),[],import.meta.url))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>S(()=>import("./3e1v2bzS.js"),[],import.meta.url))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>S(()=>import("./CS3Unz2-.js"),[],import.meta.url))},{id:"red",displayName:"Red",type:"dark",import:(()=>S(()=>import("./bN70gL4F.js"),[],import.meta.url))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>S(()=>import("./qdsjHGoJ.js"),[],import.meta.url))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>S(()=>import("./DHQR4-dF.js"),[],import.meta.url))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>S(()=>import("./D4_iv3hh.js"),[],import.meta.url))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>S(()=>import("./BthQWCQV.js"),[],import.meta.url))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>S(()=>import("./DqwNpetd.js"),[],import.meta.url))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>S(()=>import("./Bw305WKR.js"),[],import.meta.url))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>S(()=>import("./DXbdFlpD.js"),[],import.meta.url))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>S(()=>import("./L9t79GZl.js"),[],import.meta.url))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>S(()=>import("./CbfX1IO0.js"),[],import.meta.url))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>S(()=>import("./hegEt444.js"),[],import.meta.url))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>S(()=>import("./DU1UobuO.js"),[],import.meta.url))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>S(()=>import("./Bkuqu6BP.js"),[],import.meta.url))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>S(()=>import("./D0r3Knsf.js"),[],import.meta.url))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>S(()=>import("./CVO1_9PV.js"),[],import.meta.url))}],cg=Object.fromEntries(ug.map(e=>[e.id,e.import]));class Zi extends Error{constructor(t){super(t),this.name="ShikiError"}}function dg(){return 2147483648}function fg(){return typeof performance<"u"?performance.now():Date.now()}const hg=(e,t)=>e+(t-e%t)%t;async function pg(e){let t,n;const o={};function r(f){n=f,o.HEAPU8=new Uint8Array(f),o.HEAPU32=new Uint32Array(f)}function i(f,p,v){o.HEAPU8.copyWithin(f,p,p+v)}function s(f){try{return t.grow(f-n.byteLength+65535>>>16),r(t.buffer),1}catch{}}function a(f){const p=o.HEAPU8.length;f=f>>>0;const v=dg();if(f>v)return!1;for(let y=1;y<=4;y*=2){let _=p*(1+.2/y);_=Math.min(_,f+100663296);const b=Math.min(v,hg(Math.max(f,_),65536));if(s(b))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(f,p,v=1024){const y=p+v;let _=p;for(;f[_]&&!(_>=y);)++_;if(_-p>16&&f.buffer&&l)return l.decode(f.subarray(p,_));let b="";for(;p<_;){let m=f[p++];if(!(m&128)){b+=String.fromCharCode(m);continue}const w=f[p++]&63;if((m&224)===192){b+=String.fromCharCode((m&31)<<6|w);continue}const A=f[p++]&63;if((m&240)===224?m=(m&15)<<12|w<<6|A:m=(m&7)<<18|w<<12|A<<6|f[p++]&63,m<65536)b+=String.fromCharCode(m);else{const D=m-65536;b+=String.fromCharCode(55296|D>>10,56320|D&1023)}}return b}function c(f,p){return f?u(o.HEAPU8,f,p):""}const d={emscripten_get_now:fg,emscripten_memcpy_big:i,emscripten_resize_heap:a,fd_write:()=>0};async function h(){const p=await e({env:d,wasi_snapshot_preview1:d});t=p.memory,r(t.buffer),Object.assign(o,p),o.UTF8ToString=c}return await h(),o}var mg=Object.defineProperty,gg=(e,t,n)=>t in e?mg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fe=(e,t,n)=>gg(e,typeof t!="symbol"?t+"":t,n);let qe=null;function vg(e){throw new Zi(e.UTF8ToString(e.getLastOnigError()))}class _r{constructor(t){Fe(this,"utf16Length"),Fe(this,"utf8Length"),Fe(this,"utf16Value"),Fe(this,"utf8Value"),Fe(this,"utf16OffsetToUtf8"),Fe(this,"utf8OffsetToUtf16");const n=t.length,o=_r._utf8ByteLength(t),r=o!==n,i=r?new Uint32Array(n+1):null;r&&(i[n]=o);const s=r?new Uint32Array(o+1):null;r&&(s[o]=n);const a=new Uint8Array(o);let l=0;for(let u=0;u<n;u++){const c=t.charCodeAt(u);let d=c,h=!1;if(c>=55296&&c<=56319&&u+1<n){const f=t.charCodeAt(u+1);f>=56320&&f<=57343&&(d=(c-55296<<10)+65536|f-56320,h=!0)}r&&(i[u]=l,h&&(i[u+1]=l),d<=127?s[l+0]=u:d<=2047?(s[l+0]=u,s[l+1]=u):d<=65535?(s[l+0]=u,s[l+1]=u,s[l+2]=u):(s[l+0]=u,s[l+1]=u,s[l+2]=u,s[l+3]=u)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),h&&u++}this.utf16Length=n,this.utf8Length=o,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let o=0,r=t.length;o<r;o++){const i=t.charCodeAt(o);let s=i,a=!1;if(i>=55296&&i<=56319&&o+1<r){const l=t.charCodeAt(o+1);l>=56320&&l<=57343&&(s=(i-55296<<10)+65536|l-56320,a=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,a&&o++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const yr=class mt{constructor(t){if(Fe(this,"id",++mt.LAST_ID),Fe(this,"_onigBinding"),Fe(this,"content"),Fe(this,"utf16Length"),Fe(this,"utf8Length"),Fe(this,"utf16OffsetToUtf8"),Fe(this,"utf8OffsetToUtf16"),Fe(this,"ptr"),!qe)throw new Zi("Must invoke loadWasm first.");this._onigBinding=qe,this.content=t;const n=new _r(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!mt._sharedPtrInUse?(mt._sharedPtr||(mt._sharedPtr=qe.omalloc(1e4)),mt._sharedPtrInUse=!0,qe.HEAPU8.set(n.utf8Value,mt._sharedPtr),this.ptr=mt._sharedPtr):this.ptr=n.createString(qe)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===mt._sharedPtr?mt._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Fe(yr,"LAST_ID",0);Fe(yr,"_sharedPtr",0);Fe(yr,"_sharedPtrInUse",!1);let Kl=yr;class _g{constructor(t){if(Fe(this,"_onigBinding"),Fe(this,"_ptr"),!qe)throw new Zi("Must invoke loadWasm first.");const n=[],o=[];for(let a=0,l=t.length;a<l;a++){const u=new _r(t[a]);n[a]=u.createString(qe),o[a]=u.utf8Length}const r=qe.omalloc(4*t.length);qe.HEAPU32.set(n,r/4);const i=qe.omalloc(4*t.length);qe.HEAPU32.set(o,i/4);const s=qe.createOnigScanner(r,i,t.length);for(let a=0,l=t.length;a<l;a++)qe.ofree(n[a]);qe.ofree(i),qe.ofree(r),s===0&&vg(qe),this._onigBinding=qe,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,o){let r=0;if(typeof o=="number"&&(r=o),typeof t=="string"){t=new Kl(t);const i=this._findNextMatchSync(t,n,!1,r);return t.dispose(),i}return this._findNextMatchSync(t,n,!1,r)}_findNextMatchSync(t,n,o,r){const i=this._onigBinding,s=i.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),r);if(s===0)return null;const a=i.HEAPU32;let l=s/4;const u=a[l++],c=a[l++],d=[];for(let h=0;h<c;h++){const f=t.convertUtf8OffsetToUtf16(a[l++]),p=t.convertUtf8OffsetToUtf16(a[l++]);d[h]={start:f,end:p,length:p-f}}return{index:u,captureIndices:d}}}function yg(e){return typeof e.instantiator=="function"}function wg(e){return typeof e.default=="function"}function bg(e){return typeof e.data<"u"}function Eg(e){return typeof Response<"u"&&e instanceof Response}function xg(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let mo;function kg(e){if(mo)return mo;async function t(){qe=await pg(async n=>{let o=e;return o=await o,typeof o=="function"&&(o=await o(n)),typeof o=="function"&&(o=await o(n)),yg(o)?o=await o.instantiator(n):wg(o)?o=await o.default(n):(bg(o)&&(o=o.data),Eg(o)?typeof WebAssembly.instantiateStreaming=="function"?o=await Sg(o)(n):o=await Cg(o)(n):xg(o)?o=await Br(o)(n):o instanceof WebAssembly.Module?o=await Br(o)(n):"default"in o&&o.default instanceof WebAssembly.Module&&(o=await Br(o.default)(n))),"instance"in o&&(o=o.instance),"exports"in o&&(o=o.exports),o})}return mo=t(),mo}function Br(e){return t=>WebAssembly.instantiate(e,t)}function Sg(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Cg(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function Tg(e){return e&&await kg(e),{createScanner(t){return new _g(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Kl(t)}}}const Pg=og({langs:lg,themes:cg,engine:()=>Tg(S(()=>import("./CG6Dc4jp.js"),[],import.meta.url))}),{codeToHtml:qs}=ig(Pg,{guessEmbeddedLanguages:_m});var Ne=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ct=Ne((e,t)=>{var n=Object.defineProperty,o=(P,g,O)=>g in P?n(P,g,{enumerable:!0,configurable:!0,writable:!0,value:O}):P[g]=O,r=(P,g)=>()=>(g||P((g={exports:{}}).exports,g),g.exports),i=(P,g,O)=>o(P,typeof g!="symbol"?g+"":g,O),s=r((P,g)=>{var O="\0",k="\0",R="",M=class{constructor($){i(this,"_isDirected",!0),i(this,"_isMultigraph",!1),i(this,"_isCompound",!1),i(this,"_label"),i(this,"_defaultNodeLabelFn",()=>{}),i(this,"_defaultEdgeLabelFn",()=>{}),i(this,"_nodes",{}),i(this,"_in",{}),i(this,"_preds",{}),i(this,"_out",{}),i(this,"_sucs",{}),i(this,"_edgeObjs",{}),i(this,"_edgeLabels",{}),i(this,"_nodeCount",0),i(this,"_edgeCount",0),i(this,"_parent"),i(this,"_children"),$&&(this._isDirected=Object.hasOwn($,"directed")?$.directed:!0,this._isMultigraph=Object.hasOwn($,"multigraph")?$.multigraph:!1,this._isCompound=Object.hasOwn($,"compound")?$.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[k]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph($){return this._label=$,this}graph(){return this._label}setDefaultNodeLabel($){return this._defaultNodeLabelFn=$,typeof $!="function"&&(this._defaultNodeLabelFn=()=>$),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var $=this;return this.nodes().filter(x=>Object.keys($._in[x]).length===0)}sinks(){var $=this;return this.nodes().filter(x=>Object.keys($._out[x]).length===0)}setNodes($,x){var L=arguments,B=this;return $.forEach(function(Y){L.length>1?B.setNode(Y,x):B.setNode(Y)}),this}setNode($,x){return Object.hasOwn(this._nodes,$)?(arguments.length>1&&(this._nodes[$]=x),this):(this._nodes[$]=arguments.length>1?x:this._defaultNodeLabelFn($),this._isCompound&&(this._parent[$]=k,this._children[$]={},this._children[k][$]=!0),this._in[$]={},this._preds[$]={},this._out[$]={},this._sucs[$]={},++this._nodeCount,this)}node($){return this._nodes[$]}hasNode($){return Object.hasOwn(this._nodes,$)}removeNode($){var x=this;if(Object.hasOwn(this._nodes,$)){var L=B=>x.removeEdge(x._edgeObjs[B]);delete this._nodes[$],this._isCompound&&(this._removeFromParentsChildList($),delete this._parent[$],this.children($).forEach(function(B){x.setParent(B)}),delete this._children[$]),Object.keys(this._in[$]).forEach(L),delete this._in[$],delete this._preds[$],Object.keys(this._out[$]).forEach(L),delete this._out[$],delete this._sucs[$],--this._nodeCount}return this}setParent($,x){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(x===void 0)x=k;else{x+="";for(var L=x;L!==void 0;L=this.parent(L))if(L===$)throw new Error("Setting "+x+" as parent of "+$+" would create a cycle");this.setNode(x)}return this.setNode($),this._removeFromParentsChildList($),this._parent[$]=x,this._children[x][$]=!0,this}_removeFromParentsChildList($){delete this._children[this._parent[$]][$]}parent($){if(this._isCompound){var x=this._parent[$];if(x!==k)return x}}children($=k){if(this._isCompound){var x=this._children[$];if(x)return Object.keys(x)}else{if($===k)return this.nodes();if(this.hasNode($))return[]}}predecessors($){var x=this._preds[$];if(x)return Object.keys(x)}successors($){var x=this._sucs[$];if(x)return Object.keys(x)}neighbors($){var x=this.predecessors($);if(x){let B=new Set(x);for(var L of this.successors($))B.add(L);return Array.from(B.values())}}isLeaf($){var x;return this.isDirected()?x=this.successors($):x=this.neighbors($),x.length===0}filterNodes($){var x=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});x.setGraph(this.graph());var L=this;Object.entries(this._nodes).forEach(function([Q,ne]){$(Q)&&x.setNode(Q,ne)}),Object.values(this._edgeObjs).forEach(function(Q){x.hasNode(Q.v)&&x.hasNode(Q.w)&&x.setEdge(Q,L.edge(Q))});var B={};function Y(Q){var ne=L.parent(Q);return ne===void 0||x.hasNode(ne)?(B[Q]=ne,ne):ne in B?B[ne]:Y(ne)}return this._isCompound&&x.nodes().forEach(Q=>x.setParent(Q,Y(Q))),x}setDefaultEdgeLabel($){return this._defaultEdgeLabelFn=$,typeof $!="function"&&(this._defaultEdgeLabelFn=()=>$),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath($,x){var L=this,B=arguments;return $.reduce(function(Y,Q){return B.length>1?L.setEdge(Y,Q,x):L.setEdge(Y,Q),Q}),this}setEdge(){var $,x,L,B,Y=!1,Q=arguments[0];typeof Q=="object"&&Q!==null&&"v"in Q?($=Q.v,x=Q.w,L=Q.name,arguments.length===2&&(B=arguments[1],Y=!0)):($=Q,x=arguments[1],L=arguments[3],arguments.length>2&&(B=arguments[2],Y=!0)),$=""+$,x=""+x,L!==void 0&&(L=""+L);var ne=U(this._isDirected,$,x,L);if(Object.hasOwn(this._edgeLabels,ne))return Y&&(this._edgeLabels[ne]=B),this;if(L!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode($),this.setNode(x),this._edgeLabels[ne]=Y?B:this._defaultEdgeLabelFn($,x,L);var se=J(this._isDirected,$,x,L);return $=se.v,x=se.w,Object.freeze(se),this._edgeObjs[ne]=se,H(this._preds[x],$),H(this._sucs[$],x),this._in[x][ne]=se,this._out[$][ne]=se,this._edgeCount++,this}edge($,x,L){var B=arguments.length===1?te(this._isDirected,arguments[0]):U(this._isDirected,$,x,L);return this._edgeLabels[B]}edgeAsObj(){let $=this.edge(...arguments);return typeof $!="object"?{label:$}:$}hasEdge($,x,L){var B=arguments.length===1?te(this._isDirected,arguments[0]):U(this._isDirected,$,x,L);return Object.hasOwn(this._edgeLabels,B)}removeEdge($,x,L){var B=arguments.length===1?te(this._isDirected,arguments[0]):U(this._isDirected,$,x,L),Y=this._edgeObjs[B];return Y&&($=Y.v,x=Y.w,delete this._edgeLabels[B],delete this._edgeObjs[B],j(this._preds[x],$),j(this._sucs[$],x),delete this._in[x][B],delete this._out[$][B],this._edgeCount--),this}inEdges($,x){return this.isDirected()?this.filterEdges(this._in[$],$,x):this.nodeEdges($,x)}outEdges($,x){return this.isDirected()?this.filterEdges(this._out[$],$,x):this.nodeEdges($,x)}nodeEdges($,x){if($ in this._nodes)return this.filterEdges({...this._in[$],...this._out[$]},$,x)}filterEdges($,x,L){if($){var B=Object.values($);return L?B.filter(function(Y){return Y.v===x&&Y.w===L||Y.v===L&&Y.w===x}):B}}};function H($,x){$[x]?$[x]++:$[x]=1}function j($,x){--$[x]||delete $[x]}function U($,x,L,B){var Y=""+x,Q=""+L;if(!$&&Y>Q){var ne=Y;Y=Q,Q=ne}return Y+R+Q+R+(B===void 0?O:B)}function J($,x,L,B){var Y=""+x,Q=""+L;if(!$&&Y>Q){var ne=Y;Y=Q,Q=ne}var se={v:Y,w:Q};return B&&(se.name=B),se}function te($,x){return U($,x.v,x.w,x.name)}g.exports=M}),a=r((P,g)=>{g.exports="3.0.2"}),l=r((P,g)=>{g.exports={Graph:s(),version:a()}}),u=r((P,g)=>{var O=s();g.exports={write:k,read:H};function k(j){var U={options:{directed:j.isDirected(),multigraph:j.isMultigraph(),compound:j.isCompound()},nodes:R(j),edges:M(j)};return j.graph()!==void 0&&(U.value=structuredClone(j.graph())),U}function R(j){return j.nodes().map(function(U){var J=j.node(U),te=j.parent(U),$={v:U};return J!==void 0&&($.value=J),te!==void 0&&($.parent=te),$})}function M(j){return j.edges().map(function(U){var J=j.edge(U),te={v:U.v,w:U.w};return U.name!==void 0&&(te.name=U.name),J!==void 0&&(te.value=J),te})}function H(j){var U=new O(j.options).setGraph(j.value);return j.nodes.forEach(function(J){U.setNode(J.v,J.value),J.parent&&U.setParent(J.v,J.parent)}),j.edges.forEach(function(J){U.setEdge({v:J.v,w:J.w,name:J.name},J.value)}),U}}),c=r((P,g)=>{g.exports=k;var O=()=>1;function k(M,H,j,U){return R(M,String(H),j||O,U||function(J){return M.outEdges(J)})}function R(M,H,j,U){var J={},te=!0,$=0,x=M.nodes(),L=function(ne){var se=j(ne);J[ne.v].distance+se<J[ne.w].distance&&(J[ne.w]={distance:J[ne.v].distance+se,predecessor:ne.v},te=!0)},B=function(){x.forEach(function(ne){U(ne).forEach(function(se){var ue=se.v===ne?se.v:se.w,ye=ue===se.v?se.w:se.v;L({v:ue,w:ye})})})};x.forEach(function(ne){var se=ne===H?0:Number.POSITIVE_INFINITY;J[ne]={distance:se}});for(var Y=x.length,Q=1;Q<Y&&(te=!1,$++,B(),!!te);Q++);if($===Y-1&&(te=!1,B(),te))throw new Error("The graph contains a negative weight cycle");return J}}),d=r((P,g)=>{g.exports=O;function O(k){var R={},M=[],H;function j(U){Object.hasOwn(R,U)||(R[U]=!0,H.push(U),k.successors(U).forEach(j),k.predecessors(U).forEach(j))}return k.nodes().forEach(function(U){H=[],j(U),H.length&&M.push(H)}),M}}),h=r((P,g)=>{var O=class{constructor(){i(this,"_arr",[]),i(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(k){return k.key})}has(k){return Object.hasOwn(this._keyIndices,k)}priority(k){var R=this._keyIndices[k];if(R!==void 0)return this._arr[R].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(k,R){var M=this._keyIndices;if(k=String(k),!Object.hasOwn(M,k)){var H=this._arr,j=H.length;return M[k]=j,H.push({key:k,priority:R}),this._decrease(j),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var k=this._arr.pop();return delete this._keyIndices[k.key],this._heapify(0),k.key}decrease(k,R){var M=this._keyIndices[k];if(R>this._arr[M].priority)throw new Error("New priority is greater than current priority. Key: "+k+" Old: "+this._arr[M].priority+" New: "+R);this._arr[M].priority=R,this._decrease(M)}_heapify(k){var R=this._arr,M=2*k,H=M+1,j=k;M<R.length&&(j=R[M].priority<R[j].priority?M:j,H<R.length&&(j=R[H].priority<R[j].priority?H:j),j!==k&&(this._swap(k,j),this._heapify(j)))}_decrease(k){for(var R=this._arr,M=R[k].priority,H;k!==0&&(H=k>>1,!(R[H].priority<M));)this._swap(k,H),k=H}_swap(k,R){var M=this._arr,H=this._keyIndices,j=M[k],U=M[R];M[k]=U,M[R]=j,H[U.key]=k,H[j.key]=R}};g.exports=O}),f=r((P,g)=>{var O=h();g.exports=R;var k=()=>1;function R(H,j,U,J){var te=function($){return H.outEdges($)};return M(H,String(j),U||k,J||te)}function M(H,j,U,J){var te={},$=new O,x,L,B=function(Y){var Q=Y.v!==x?Y.v:Y.w,ne=te[Q],se=U(Y),ue=L.distance+se;if(se<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+Y+" Weight: "+se);ue<ne.distance&&(ne.distance=ue,ne.predecessor=x,$.decrease(Q,ue))};for(H.nodes().forEach(function(Y){var Q=Y===j?0:Number.POSITIVE_INFINITY;te[Y]={distance:Q},$.add(Y,Q)});$.size()>0&&(x=$.removeMin(),L=te[x],L.distance!==Number.POSITIVE_INFINITY);)J(x).forEach(B);return te}}),p=r((P,g)=>{var O=f();g.exports=k;function k(R,M,H){return R.nodes().reduce(function(j,U){return j[U]=O(R,U,M,H),j},{})}}),v=r((P,g)=>{g.exports=O;function O(R,M,H){if(R[M].predecessor!==void 0)throw new Error("Invalid source vertex");if(R[H].predecessor===void 0&&H!==M)throw new Error("Invalid destination vertex");return{weight:R[H].distance,path:k(R,M,H)}}function k(R,M,H){for(var j=[],U=H;U!==M;)j.push(U),U=R[U].predecessor;return j.push(M),j.reverse()}}),y=r((P,g)=>{g.exports=O;function O(k){var R=0,M=[],H={},j=[];function U(J){var te=H[J]={onStack:!0,lowlink:R,index:R++};if(M.push(J),k.successors(J).forEach(function(L){Object.hasOwn(H,L)?H[L].onStack&&(te.lowlink=Math.min(te.lowlink,H[L].index)):(U(L),te.lowlink=Math.min(te.lowlink,H[L].lowlink))}),te.lowlink===te.index){var $=[],x;do x=M.pop(),H[x].onStack=!1,$.push(x);while(J!==x);j.push($)}}return k.nodes().forEach(function(J){Object.hasOwn(H,J)||U(J)}),j}}),_=r((P,g)=>{var O=y();g.exports=k;function k(R){return O(R).filter(function(M){return M.length>1||M.length===1&&R.hasEdge(M[0],M[0])})}}),b=r((P,g)=>{g.exports=k;var O=()=>1;function k(M,H,j){return R(M,H||O,j||function(U){return M.outEdges(U)})}function R(M,H,j){var U={},J=M.nodes();return J.forEach(function(te){U[te]={},U[te][te]={distance:0},J.forEach(function($){te!==$&&(U[te][$]={distance:Number.POSITIVE_INFINITY})}),j(te).forEach(function($){var x=$.v===te?$.w:$.v,L=H($);U[te][x]={distance:L,predecessor:te}})}),J.forEach(function(te){var $=U[te];J.forEach(function(x){var L=U[x];J.forEach(function(B){var Y=L[te],Q=$[B],ne=L[B],se=Y.distance+Q.distance;se<ne.distance&&(ne.distance=se,ne.predecessor=Q.predecessor)})})}),U}}),m=r((P,g)=>{function O(R){var M={},H={},j=[];function U(J){if(Object.hasOwn(H,J))throw new k;Object.hasOwn(M,J)||(H[J]=!0,M[J]=!0,R.predecessors(J).forEach(U),delete H[J],j.push(J))}if(R.sinks().forEach(U),Object.keys(M).length!==R.nodeCount())throw new k;return j}var k=class extends Error{constructor(){super(...arguments)}};g.exports=O,O.CycleException=k}),w=r((P,g)=>{var O=m();g.exports=k;function k(R){try{O(R)}catch(M){if(M instanceof O.CycleException)return!1;throw M}return!0}}),A=r((P,g)=>{g.exports=O;function O(R,M,H,j,U){Array.isArray(M)||(M=[M]);var J=(R.isDirected()?R.successors:R.neighbors).bind(R),te={};return M.forEach(function($){if(!R.hasNode($))throw new Error("Graph does not have node: "+$);U=k(R,$,H==="post",te,J,j,U)}),U}function k(R,M,H,j,U,J,te){return Object.hasOwn(j,M)||(j[M]=!0,H||(te=J(te,M)),U(M).forEach(function($){te=k(R,$,H,j,U,J,te)}),H&&(te=J(te,M))),te}}),D=r((P,g)=>{var O=A();g.exports=k;function k(R,M,H){return O(R,M,H,function(j,U){return j.push(U),j},[])}}),z=r((P,g)=>{var O=D();g.exports=k;function k(R,M){return O(R,M,"post")}}),G=r((P,g)=>{var O=D();g.exports=k;function k(R,M){return O(R,M,"pre")}}),Z=r((P,g)=>{var O=s(),k=h();g.exports=R;function R(M,H){var j=new O,U={},J=new k,te;function $(L){var B=L.v===te?L.w:L.v,Y=J.priority(B);if(Y!==void 0){var Q=H(L);Q<Y&&(U[B]=te,J.decrease(B,Q))}}if(M.nodeCount()===0)return j;M.nodes().forEach(function(L){J.add(L,Number.POSITIVE_INFINITY),j.setNode(L)}),J.decrease(M.nodes()[0],0);for(var x=!1;J.size()>0;){if(te=J.removeMin(),Object.hasOwn(U,te))j.setEdge(te,U[te]);else{if(x)throw new Error("Input graph is not connected: "+M);x=!0}M.nodeEdges(te).forEach($)}return j}}),N=r((P,g)=>{var O=f(),k=c();g.exports=R;function R(H,j,U,J){return M(H,j,U,J||function(te){return H.outEdges(te)})}function M(H,j,U,J){if(U===void 0)return O(H,j,U,J);for(var te=!1,$=H.nodes(),x=0;x<$.length;x++){for(var L=J($[x]),B=0;B<L.length;B++){var Y=L[B],Q=Y.v===$[x]?Y.v:Y.w,ne=Q===Y.v?Y.w:Y.v;U({v:Q,w:ne})<0&&(te=!0)}if(te)return k(H,j,U,J)}return O(H,j,U,J)}}),T=r((P,g)=>{g.exports={bellmanFord:c(),components:d(),dijkstra:f(),dijkstraAll:p(),extractPath:v(),findCycles:_(),floydWarshall:b(),isAcyclic:w(),postorder:z(),preorder:G(),prim:Z(),shortestPaths:N(),reduce:A(),tarjan:y(),topsort:m()}}),E=l();t.exports={Graph:E.Graph,json:u(),alg:T(),version:E.version}}),Ag=Ne((e,t)=>{var n=class{constructor(){let i={};i._next=i._prev=i,this._sentinel=i}dequeue(){let i=this._sentinel,s=i._prev;if(s!==i)return o(s),s}enqueue(i){let s=this._sentinel;i._prev&&i._next&&o(i),i._next=s._next,s._next._prev=i,s._next=i,i._prev=s}toString(){let i=[],s=this._sentinel,a=s._prev;for(;a!==s;)i.push(JSON.stringify(a,r)),a=a._prev;return"["+i.join(", ")+"]"}};function o(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function r(i,s){if(i!=="_next"&&i!=="_prev")return s}t.exports=n}),Ng=Ne((e,t)=>{var n=ct().Graph,o=Ag();t.exports=i;var r=()=>1;function i(d,h){if(d.nodeCount()<=1)return[];let f=l(d,h||r);return s(f.graph,f.buckets,f.zeroIdx).flatMap(p=>d.outEdges(p.v,p.w))}function s(d,h,f){let p=[],v=h[h.length-1],y=h[0],_;for(;d.nodeCount();){for(;_=y.dequeue();)a(d,h,f,_);for(;_=v.dequeue();)a(d,h,f,_);if(d.nodeCount()){for(let b=h.length-2;b>0;--b)if(_=h[b].dequeue(),_){p=p.concat(a(d,h,f,_,!0));break}}}return p}function a(d,h,f,p,v){let y=v?[]:void 0;return d.inEdges(p.v).forEach(_=>{let b=d.edge(_),m=d.node(_.v);v&&y.push({v:_.v,w:_.w}),m.out-=b,u(h,f,m)}),d.outEdges(p.v).forEach(_=>{let b=d.edge(_),m=_.w,w=d.node(m);w.in-=b,u(h,f,w)}),d.removeNode(p.v),y}function l(d,h){let f=new n,p=0,v=0;d.nodes().forEach(b=>{f.setNode(b,{v:b,in:0,out:0})}),d.edges().forEach(b=>{let m=f.edge(b.v,b.w)||0,w=h(b),A=m+w;f.setEdge(b.v,b.w,A),v=Math.max(v,f.node(b.v).out+=w),p=Math.max(p,f.node(b.w).in+=w)});let y=c(v+p+3).map(()=>new o),_=p+1;return f.nodes().forEach(b=>{u(y,_,f.node(b))}),{graph:f,buckets:y,zeroIdx:_}}function u(d,h,f){f.out?f.in?d[f.out-f.in+h].enqueue(f):d[d.length-1].enqueue(f):d[0].enqueue(f)}function c(d){let h=[];for(let f=0;f<d;f++)h.push(f);return h}}),ze=Ne((e,t)=>{var n=ct().Graph;t.exports={addBorderNode:h,addDummyNode:o,applyWithChunking:v,asNonCompoundGraph:i,buildLayerMatrix:u,intersectRect:l,mapValues:G,maxRank:y,normalizeRanks:c,notime:m,partition:_,pick:z,predecessorWeights:a,range:D,removeEmptyRanks:d,simplify:r,successorWeights:s,time:b,uniqueId:A,zipObject:Z};function o(N,T,E,P){for(var g=P;N.hasNode(g);)g=A(P);return E.dummy=T,N.setNode(g,E),g}function r(N){let T=new n().setGraph(N.graph());return N.nodes().forEach(E=>T.setNode(E,N.node(E))),N.edges().forEach(E=>{let P=T.edge(E.v,E.w)||{weight:0,minlen:1},g=N.edge(E);T.setEdge(E.v,E.w,{weight:P.weight+g.weight,minlen:Math.max(P.minlen,g.minlen)})}),T}function i(N){let T=new n({multigraph:N.isMultigraph()}).setGraph(N.graph());return N.nodes().forEach(E=>{N.children(E).length||T.setNode(E,N.node(E))}),N.edges().forEach(E=>{T.setEdge(E,N.edge(E))}),T}function s(N){let T=N.nodes().map(E=>{let P={};return N.outEdges(E).forEach(g=>{P[g.w]=(P[g.w]||0)+N.edge(g).weight}),P});return Z(N.nodes(),T)}function a(N){let T=N.nodes().map(E=>{let P={};return N.inEdges(E).forEach(g=>{P[g.v]=(P[g.v]||0)+N.edge(g).weight}),P});return Z(N.nodes(),T)}function l(N,T){let E=N.x,P=N.y,g=T.x-E,O=T.y-P,k=N.width/2,R=N.height/2;if(!g&&!O)throw new Error("Not possible to find intersection inside of the rectangle");let M,H;return Math.abs(O)*k>Math.abs(g)*R?(O<0&&(R=-R),M=R*g/O,H=R):(g<0&&(k=-k),M=k,H=k*O/g),{x:E+M,y:P+H}}function u(N){let T=D(y(N)+1).map(()=>[]);return N.nodes().forEach(E=>{let P=N.node(E),g=P.rank;g!==void 0&&(T[g][P.order]=E)}),T}function c(N){let T=N.nodes().map(P=>{let g=N.node(P).rank;return g===void 0?Number.MAX_VALUE:g}),E=v(Math.min,T);N.nodes().forEach(P=>{let g=N.node(P);Object.hasOwn(g,"rank")&&(g.rank-=E)})}function d(N){let T=N.nodes().map(k=>N.node(k).rank).filter(k=>k!==void 0),E=v(Math.min,T),P=[];N.nodes().forEach(k=>{let R=N.node(k).rank-E;P[R]||(P[R]=[]),P[R].push(k)});let g=0,O=N.graph().nodeRankFactor;Array.from(P).forEach((k,R)=>{k===void 0&&R%O!==0?--g:k!==void 0&&g&&k.forEach(M=>N.node(M).rank+=g)})}function h(N,T,E,P){let g={width:0,height:0};return arguments.length>=4&&(g.rank=E,g.order=P),o(N,"border",g,T)}function f(N,T=p){let E=[];for(let P=0;P<N.length;P+=T){let g=N.slice(P,P+T);E.push(g)}return E}var p=65535;function v(N,T){if(T.length>p){let E=f(T);return N.apply(null,E.map(P=>N.apply(null,P)))}else return N.apply(null,T)}function y(N){let T=N.nodes().map(E=>{let P=N.node(E).rank;return P===void 0?Number.MIN_VALUE:P});return v(Math.max,T)}function _(N,T){let E={lhs:[],rhs:[]};return N.forEach(P=>{T(P)?E.lhs.push(P):E.rhs.push(P)}),E}function b(N,T){let E=Date.now();try{return T()}finally{console.log(N+" time: "+(Date.now()-E)+"ms")}}function m(N,T){return T()}var w=0;function A(N){var T=++w;return N+(""+T)}function D(N,T,E=1){T==null&&(T=N,N=0);let P=O=>O<T;E<0&&(P=O=>T<O);let g=[];for(let O=N;P(O);O+=E)g.push(O);return g}function z(N,T){let E={};for(let P of T)N[P]!==void 0&&(E[P]=N[P]);return E}function G(N,T){let E=T;return typeof T=="string"&&(E=P=>P[T]),Object.entries(N).reduce((P,[g,O])=>(P[g]=E(O,g),P),{})}function Z(N,T){return N.reduce((E,P,g)=>(E[P]=T[g],E),{})}}),Og=Ne((e,t)=>{var n=Ng(),o=ze().uniqueId;t.exports={run:r,undo:s};function r(a){(a.graph().acyclicer==="greedy"?n(a,l(a)):i(a)).forEach(u=>{let c=a.edge(u);a.removeEdge(u),c.forwardName=u.name,c.reversed=!0,a.setEdge(u.w,u.v,c,o("rev"))});function l(u){return c=>u.edge(c).weight}}function i(a){let l=[],u={},c={};function d(h){Object.hasOwn(c,h)||(c[h]=!0,u[h]=!0,a.outEdges(h).forEach(f=>{Object.hasOwn(u,f.w)?l.push(f):d(f.w)}),delete u[h])}return a.nodes().forEach(d),l}function s(a){a.edges().forEach(l=>{let u=a.edge(l);if(u.reversed){a.removeEdge(l);let c=u.forwardName;delete u.reversed,delete u.forwardName,a.setEdge(l.w,l.v,u,c)}})}}),Ig=Ne((e,t)=>{var n=ze();t.exports={run:o,undo:i};function o(s){s.graph().dummyChains=[],s.edges().forEach(a=>r(s,a))}function r(s,a){let l=a.v,u=s.node(l).rank,c=a.w,d=s.node(c).rank,h=a.name,f=s.edge(a),p=f.labelRank;if(d===u+1)return;s.removeEdge(a);let v,y,_;for(_=0,++u;u<d;++_,++u)f.points=[],y={width:0,height:0,edgeLabel:f,edgeObj:a,rank:u},v=n.addDummyNode(s,"edge",y,"_d"),u===p&&(y.width=f.width,y.height=f.height,y.dummy="edge-label",y.labelpos=f.labelpos),s.setEdge(l,v,{weight:f.weight},h),_===0&&s.graph().dummyChains.push(v),l=v;s.setEdge(l,c,{weight:f.weight},h)}function i(s){s.graph().dummyChains.forEach(a=>{let l=s.node(a),u=l.edgeLabel,c;for(s.setEdge(l.edgeObj,u);l.dummy;)c=s.successors(a)[0],s.removeNode(a),u.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(u.x=l.x,u.y=l.y,u.width=l.width,u.height=l.height),a=c,l=s.node(a)})}}),Xo=Ne((e,t)=>{var{applyWithChunking:n}=ze();t.exports={longestPath:o,slack:r};function o(i){var s={};function a(l){var u=i.node(l);if(Object.hasOwn(s,l))return u.rank;s[l]=!0;let c=i.outEdges(l).map(h=>h==null?Number.POSITIVE_INFINITY:a(h.w)-i.edge(h).minlen);var d=n(Math.min,c);return d===Number.POSITIVE_INFINITY&&(d=0),u.rank=d}i.sources().forEach(a)}function r(i,s){return i.node(s.w).rank-i.node(s.v).rank-i.edge(s).minlen}}),Zl=Ne((e,t)=>{var n=ct().Graph,o=Xo().slack;t.exports=r;function r(l){var u=new n({directed:!1}),c=l.nodes()[0],d=l.nodeCount();u.setNode(c,{});for(var h,f;i(u,l)<d;)h=s(u,l),f=u.hasNode(h.v)?o(l,h):-o(l,h),a(u,l,f);return u}function i(l,u){function c(d){u.nodeEdges(d).forEach(h=>{var f=h.v,p=d===f?h.w:f;!l.hasNode(p)&&!o(u,h)&&(l.setNode(p,{}),l.setEdge(d,p,{}),c(p))})}return l.nodes().forEach(c),l.nodeCount()}function s(l,u){return u.edges().reduce((c,d)=>{let h=Number.POSITIVE_INFINITY;return l.hasNode(d.v)!==l.hasNode(d.w)&&(h=o(u,d)),h<c[0]?[h,d]:c},[Number.POSITIVE_INFINITY,null])[1]}function a(l,u,c){l.nodes().forEach(d=>u.node(d).rank+=c)}}),Rg=Ne((e,t)=>{var n=Zl(),o=Xo().slack,r=Xo().longestPath,i=ct().alg.preorder,s=ct().alg.postorder,a=ze().simplify;t.exports=l,l.initLowLimValues=h,l.initCutValues=u,l.calcCutValue=d,l.leaveEdge=p,l.enterEdge=v,l.exchangeEdges=y;function l(w){w=a(w),r(w);var A=n(w);h(A),u(A,w);for(var D,z;D=p(A);)z=v(A,w,D),y(A,w,D,z)}function u(w,A){var D=s(w,w.nodes());D=D.slice(0,D.length-1),D.forEach(z=>c(w,A,z))}function c(w,A,D){var z=w.node(D),G=z.parent;w.edge(D,G).cutvalue=d(w,A,D)}function d(w,A,D){var z=w.node(D),G=z.parent,Z=!0,N=A.edge(D,G),T=0;return N||(Z=!1,N=A.edge(G,D)),T=N.weight,A.nodeEdges(D).forEach(E=>{var P=E.v===D,g=P?E.w:E.v;if(g!==G){var O=P===Z,k=A.edge(E).weight;if(T+=O?k:-k,b(w,D,g)){var R=w.edge(D,g).cutvalue;T+=O?-R:R}}}),T}function h(w,A){arguments.length<2&&(A=w.nodes()[0]),f(w,{},1,A)}function f(w,A,D,z,G){var Z=D,N=w.node(z);return A[z]=!0,w.neighbors(z).forEach(T=>{Object.hasOwn(A,T)||(D=f(w,A,D,T,z))}),N.low=Z,N.lim=D++,G?N.parent=G:delete N.parent,D}function p(w){return w.edges().find(A=>w.edge(A).cutvalue<0)}function v(w,A,D){var z=D.v,G=D.w;A.hasEdge(z,G)||(z=D.w,G=D.v);var Z=w.node(z),N=w.node(G),T=Z,E=!1;Z.lim>N.lim&&(T=N,E=!0);var P=A.edges().filter(g=>E===m(w,w.node(g.v),T)&&E!==m(w,w.node(g.w),T));return P.reduce((g,O)=>o(A,O)<o(A,g)?O:g)}function y(w,A,D,z){var G=D.v,Z=D.w;w.removeEdge(G,Z),w.setEdge(z.v,z.w,{}),h(w),u(w,A),_(w,A)}function _(w,A){var D=w.nodes().find(G=>!A.node(G).parent),z=i(w,D);z=z.slice(1),z.forEach(G=>{var Z=w.node(G).parent,N=A.edge(G,Z),T=!1;N||(N=A.edge(Z,G),T=!0),A.node(G).rank=A.node(Z).rank+(T?N.minlen:-N.minlen)})}function b(w,A,D){return w.hasEdge(A,D)}function m(w,A,D){return D.low<=A.lim&&A.lim<=D.lim}}),Lg=Ne((e,t)=>{var n=Xo(),o=n.longestPath,r=Zl(),i=Rg();t.exports=s;function s(c){var d=c.graph().ranker;if(d instanceof Function)return d(c);switch(c.graph().ranker){case"network-simplex":u(c);break;case"tight-tree":l(c);break;case"longest-path":a(c);break;case"none":break;default:u(c)}}var a=o;function l(c){o(c),r(c)}function u(c){i(c)}}),Dg=Ne((e,t)=>{t.exports=n;function n(i){let s=r(i);i.graph().dummyChains.forEach(a=>{let l=i.node(a),u=l.edgeObj,c=o(i,s,u.v,u.w),d=c.path,h=c.lca,f=0,p=d[f],v=!0;for(;a!==u.w;){if(l=i.node(a),v){for(;(p=d[f])!==h&&i.node(p).maxRank<l.rank;)f++;p===h&&(v=!1)}if(!v){for(;f<d.length-1&&i.node(p=d[f+1]).minRank<=l.rank;)f++;p=d[f]}i.setParent(a,p),a=i.successors(a)[0]}})}function o(i,s,a,l){let u=[],c=[],d=Math.min(s[a].low,s[l].low),h=Math.max(s[a].lim,s[l].lim),f,p;f=a;do f=i.parent(f),u.push(f);while(f&&(s[f].low>d||h>s[f].lim));for(p=f,f=l;(f=i.parent(f))!==p;)c.push(f);return{path:u.concat(c.reverse()),lca:p}}function r(i){let s={},a=0;function l(u){let c=a;i.children(u).forEach(l),s[u]={low:c,lim:a++}}return i.children().forEach(l),s}}),Mg=Ne((e,t)=>{var n=ze();t.exports={run:o,cleanup:a};function o(l){let u=n.addDummyNode(l,"root",{},"_root"),c=i(l),d=Object.values(c),h=n.applyWithChunking(Math.max,d)-1,f=2*h+1;l.graph().nestingRoot=u,l.edges().forEach(v=>l.edge(v).minlen*=f);let p=s(l)+1;l.children().forEach(v=>r(l,u,f,p,h,c,v)),l.graph().nodeRankFactor=f}function r(l,u,c,d,h,f,p){let v=l.children(p);if(!v.length){p!==u&&l.setEdge(u,p,{weight:0,minlen:c});return}let y=n.addBorderNode(l,"_bt"),_=n.addBorderNode(l,"_bb"),b=l.node(p);l.setParent(y,p),b.borderTop=y,l.setParent(_,p),b.borderBottom=_,v.forEach(m=>{r(l,u,c,d,h,f,m);let w=l.node(m),A=w.borderTop?w.borderTop:m,D=w.borderBottom?w.borderBottom:m,z=w.borderTop?d:2*d,G=A!==D?1:h-f[p]+1;l.setEdge(y,A,{weight:z,minlen:G,nestingEdge:!0}),l.setEdge(D,_,{weight:z,minlen:G,nestingEdge:!0})}),l.parent(p)||l.setEdge(u,y,{weight:0,minlen:h+f[p]})}function i(l){var u={};function c(d,h){var f=l.children(d);f&&f.length&&f.forEach(p=>c(p,h+1)),u[d]=h}return l.children().forEach(d=>c(d,1)),u}function s(l){return l.edges().reduce((u,c)=>u+l.edge(c).weight,0)}function a(l){var u=l.graph();l.removeNode(u.nestingRoot),delete u.nestingRoot,l.edges().forEach(c=>{var d=l.edge(c);d.nestingEdge&&l.removeEdge(c)})}}),$g=Ne((e,t)=>{var n=ze();t.exports=o;function o(i){function s(a){let l=i.children(a),u=i.node(a);if(l.length&&l.forEach(s),Object.hasOwn(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(let c=u.minRank,d=u.maxRank+1;c<d;++c)r(i,"borderLeft","_bl",a,u,c),r(i,"borderRight","_br",a,u,c)}}i.children().forEach(s)}function r(i,s,a,l,u,c){let d={width:0,height:0,rank:c,borderType:s},h=u[s][c-1],f=n.addDummyNode(i,"border",d,a);u[s][c]=f,i.setParent(f,l),h&&i.setEdge(h,f,{weight:1})}}),Vg=Ne((e,t)=>{t.exports={adjust:n,undo:o};function n(c){let d=c.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&r(c)}function o(c){let d=c.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&s(c),(d==="lr"||d==="rl")&&(l(c),r(c))}function r(c){c.nodes().forEach(d=>i(c.node(d))),c.edges().forEach(d=>i(c.edge(d)))}function i(c){let d=c.width;c.width=c.height,c.height=d}function s(c){c.nodes().forEach(d=>a(c.node(d))),c.edges().forEach(d=>{let h=c.edge(d);h.points.forEach(a),Object.hasOwn(h,"y")&&a(h)})}function a(c){c.y=-c.y}function l(c){c.nodes().forEach(d=>u(c.node(d))),c.edges().forEach(d=>{let h=c.edge(d);h.points.forEach(u),Object.hasOwn(h,"x")&&u(h)})}function u(c){let d=c.x;c.x=c.y,c.y=d}}),Bg=Ne((e,t)=>{var n=ze();t.exports=o;function o(r){let i={},s=r.nodes().filter(d=>!r.children(d).length),a=s.map(d=>r.node(d).rank),l=n.applyWithChunking(Math.max,a),u=n.range(l+1).map(()=>[]);function c(d){if(i[d])return;i[d]=!0;let h=r.node(d);u[h.rank].push(d),r.successors(d).forEach(c)}return s.sort((d,h)=>r.node(d).rank-r.node(h).rank).forEach(c),u}}),zg=Ne((e,t)=>{var n=ze().zipObject;t.exports=o;function o(i,s){let a=0;for(let l=1;l<s.length;++l)a+=r(i,s[l-1],s[l]);return a}function r(i,s,a){let l=n(a,a.map((p,v)=>v)),u=s.flatMap(p=>i.outEdges(p).map(v=>({pos:l[v.w],weight:i.edge(v).weight})).sort((v,y)=>v.pos-y.pos)),c=1;for(;c<a.length;)c<<=1;let d=2*c-1;c-=1;let h=new Array(d).fill(0),f=0;return u.forEach(p=>{let v=p.pos+c;h[v]+=p.weight;let y=0;for(;v>0;)v%2&&(y+=h[v+1]),v=v-1>>1,h[v]+=p.weight;f+=p.weight*y}),f}}),Fg=Ne((e,t)=>{t.exports=n;function n(o,r=[]){return r.map(i=>{let s=o.inEdges(i);if(s.length){let a=s.reduce((l,u)=>{let c=o.edge(u),d=o.node(u.v);return{sum:l.sum+c.weight*d.order,weight:l.weight+c.weight}},{sum:0,weight:0});return{v:i,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:i}})}}),Hg=Ne((e,t)=>{var n=ze();t.exports=o;function o(s,a){let l={};s.forEach((c,d)=>{let h=l[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:d};c.barycenter!==void 0&&(h.barycenter=c.barycenter,h.weight=c.weight)}),a.edges().forEach(c=>{let d=l[c.v],h=l[c.w];d!==void 0&&h!==void 0&&(h.indegree++,d.out.push(l[c.w]))});let u=Object.values(l).filter(c=>!c.indegree);return r(u)}function r(s){let a=[];function l(c){return d=>{d.merged||(d.barycenter===void 0||c.barycenter===void 0||d.barycenter>=c.barycenter)&&i(c,d)}}function u(c){return d=>{d.in.push(c),--d.indegree===0&&s.push(d)}}for(;s.length;){let c=s.pop();a.push(c),c.in.reverse().forEach(l(c)),c.out.forEach(u(c))}return a.filter(c=>!c.merged).map(c=>n.pick(c,["vs","i","barycenter","weight"]))}function i(s,a){let l=0,u=0;s.weight&&(l+=s.barycenter*s.weight,u+=s.weight),a.weight&&(l+=a.barycenter*a.weight,u+=a.weight),s.vs=a.vs.concat(s.vs),s.barycenter=l/u,s.weight=u,s.i=Math.min(a.i,s.i),a.merged=!0}}),Gg=Ne((e,t)=>{var n=ze();t.exports=o;function o(s,a){let l=n.partition(s,y=>Object.hasOwn(y,"barycenter")),u=l.lhs,c=l.rhs.sort((y,_)=>_.i-y.i),d=[],h=0,f=0,p=0;u.sort(i(!!a)),p=r(d,c,p),u.forEach(y=>{p+=y.vs.length,d.push(y.vs),h+=y.barycenter*y.weight,f+=y.weight,p=r(d,c,p)});let v={vs:d.flat(!0)};return f&&(v.barycenter=h/f,v.weight=f),v}function r(s,a,l){let u;for(;a.length&&(u=a[a.length-1]).i<=l;)a.pop(),s.push(u.vs),l++;return l}function i(s){return(a,l)=>a.barycenter<l.barycenter?-1:a.barycenter>l.barycenter?1:s?l.i-a.i:a.i-l.i}}),jg=Ne((e,t)=>{var n=Fg(),o=Hg(),r=Gg();t.exports=i;function i(l,u,c,d){let h=l.children(u),f=l.node(u),p=f?f.borderLeft:void 0,v=f?f.borderRight:void 0,y={};p&&(h=h.filter(w=>w!==p&&w!==v));let _=n(l,h);_.forEach(w=>{if(l.children(w.v).length){let A=i(l,w.v,c,d);y[w.v]=A,Object.hasOwn(A,"barycenter")&&a(w,A)}});let b=o(_,c);s(b,y);let m=r(b,d);if(p&&(m.vs=[p,m.vs,v].flat(!0),l.predecessors(p).length)){let w=l.node(l.predecessors(p)[0]),A=l.node(l.predecessors(v)[0]);Object.hasOwn(m,"barycenter")||(m.barycenter=0,m.weight=0),m.barycenter=(m.barycenter*m.weight+w.order+A.order)/(m.weight+2),m.weight+=2}return m}function s(l,u){l.forEach(c=>{c.vs=c.vs.flatMap(d=>u[d]?u[d].vs:d)})}function a(l,u){l.barycenter!==void 0?(l.barycenter=(l.barycenter*l.weight+u.barycenter*u.weight)/(l.weight+u.weight),l.weight+=u.weight):(l.barycenter=u.barycenter,l.weight=u.weight)}}),qg=Ne((e,t)=>{var n=ct().Graph,o=ze();t.exports=r;function r(s,a,l,u){u||(u=s.nodes());let c=i(s),d=new n({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(h=>s.node(h));return u.forEach(h=>{let f=s.node(h),p=s.parent(h);(f.rank===a||f.minRank<=a&&a<=f.maxRank)&&(d.setNode(h),d.setParent(h,p||c),s[l](h).forEach(v=>{let y=v.v===h?v.w:v.v,_=d.edge(y,h),b=_!==void 0?_.weight:0;d.setEdge(y,h,{weight:s.edge(v).weight+b})}),Object.hasOwn(f,"minRank")&&d.setNode(h,{borderLeft:f.borderLeft[a],borderRight:f.borderRight[a]}))}),d}function i(s){for(var a;s.hasNode(a=o.uniqueId("_root")););return a}}),Wg=Ne((e,t)=>{t.exports=n;function n(o,r,i){let s={},a;i.forEach(l=>{let u=o.parent(l),c,d;for(;u;){if(c=o.parent(u),c?(d=s[c],s[c]=u):(d=a,a=u),d&&d!==u){r.setEdge(d,u);return}u=c}})}}),Ug=Ne((e,t)=>{var n=Bg(),o=zg(),r=jg(),i=qg(),s=Wg(),a=ct().Graph,l=ze();t.exports=u;function u(f,p={}){if(typeof p.customOrder=="function"){p.customOrder(f,u);return}let v=l.maxRank(f),y=c(f,l.range(1,v+1),"inEdges"),_=c(f,l.range(v-1,-1,-1),"outEdges"),b=n(f);if(h(f,b),p.disableOptimalOrderHeuristic)return;let m=Number.POSITIVE_INFINITY,w,A=p.constraints||[];for(let D=0,z=0;z<4;++D,++z){d(D%2?y:_,D%4>=2,A),b=l.buildLayerMatrix(f);let G=o(f,b);G<m?(z=0,w=Object.assign({},b),m=G):G===m&&(w=structuredClone(b))}h(f,w)}function c(f,p,v){let y=new Map,_=(b,m)=>{y.has(b)||y.set(b,[]),y.get(b).push(m)};for(let b of f.nodes()){let m=f.node(b);if(typeof m.rank=="number"&&_(m.rank,b),typeof m.minRank=="number"&&typeof m.maxRank=="number")for(let w=m.minRank;w<=m.maxRank;w++)w!==m.rank&&_(w,b)}return p.map(function(b){return i(f,b,v,y.get(b)||[])})}function d(f,p,v){let y=new a;f.forEach(function(_){v.forEach(w=>y.setEdge(w.left,w.right));let b=_.graph().root,m=r(_,b,y,p);m.vs.forEach((w,A)=>_.node(w).order=A),s(_,y,m.vs)})}function h(f,p){Object.values(p).forEach(v=>v.forEach((y,_)=>f.node(y).order=_))}}),Yg=Ne((e,t)=>{var n=ct().Graph,o=ze();t.exports={positionX:v,findType1Conflicts:r,findType2Conflicts:i,addConflict:a,hasConflict:l,verticalAlignment:u,horizontalCompaction:c,alignCoordinates:f,findSmallestWidthAlignment:h,balance:p};function r(b,m){let w={};function A(D,z){let G=0,Z=0,N=D.length,T=z[z.length-1];return z.forEach((E,P)=>{let g=s(b,E),O=g?b.node(g).order:N;(g||E===T)&&(z.slice(Z,P+1).forEach(k=>{b.predecessors(k).forEach(R=>{let M=b.node(R),H=M.order;(H<G||O<H)&&!(M.dummy&&b.node(k).dummy)&&a(w,R,k)})}),Z=P+1,G=O)}),z}return m.length&&m.reduce(A),w}function i(b,m){let w={};function A(z,G,Z,N,T){let E;o.range(G,Z).forEach(P=>{E=z[P],b.node(E).dummy&&b.predecessors(E).forEach(g=>{let O=b.node(g);O.dummy&&(O.order<N||O.order>T)&&a(w,g,E)})})}function D(z,G){let Z=-1,N,T=0;return G.forEach((E,P)=>{if(b.node(E).dummy==="border"){let g=b.predecessors(E);g.length&&(N=b.node(g[0]).order,A(G,T,P,Z,N),T=P,Z=N)}A(G,T,G.length,N,z.length)}),G}return m.length&&m.reduce(D),w}function s(b,m){if(b.node(m).dummy)return b.predecessors(m).find(w=>b.node(w).dummy)}function a(b,m,w){if(m>w){let D=m;m=w,w=D}let A=b[m];A||(b[m]=A={}),A[w]=!0}function l(b,m,w){if(m>w){let A=m;m=w,w=A}return!!b[m]&&Object.hasOwn(b[m],w)}function u(b,m,w,A){let D={},z={},G={};return m.forEach(Z=>{Z.forEach((N,T)=>{D[N]=N,z[N]=N,G[N]=T})}),m.forEach(Z=>{let N=-1;Z.forEach(T=>{let E=A(T);if(E.length){E=E.sort((g,O)=>G[g]-G[O]);let P=(E.length-1)/2;for(let g=Math.floor(P),O=Math.ceil(P);g<=O;++g){let k=E[g];z[T]===T&&N<G[k]&&!l(w,T,k)&&(z[k]=T,z[T]=D[T]=D[k],N=G[k])}}})}),{root:D,align:z}}function c(b,m,w,A,D){let z={},G=d(b,m,w,D),Z=D?"borderLeft":"borderRight";function N(P,g){let O=G.nodes().slice(),k={},R=O.pop();for(;R;){if(k[R])P(R);else{k[R]=!0,O.push(R);for(let M of g(R))O.push(M)}R=O.pop()}}function T(P){z[P]=G.inEdges(P).reduce((g,O)=>Math.max(g,z[O.v]+G.edge(O)),0)}function E(P){let g=G.outEdges(P).reduce((k,R)=>Math.min(k,z[R.w]-G.edge(R)),Number.POSITIVE_INFINITY),O=b.node(P);g!==Number.POSITIVE_INFINITY&&O.borderType!==Z&&(z[P]=Math.max(z[P],g))}return N(T,G.predecessors.bind(G)),N(E,G.successors.bind(G)),Object.keys(A).forEach(P=>z[P]=z[w[P]]),z}function d(b,m,w,A){let D=new n,z=b.graph(),G=y(z.nodesep,z.edgesep,A);return m.forEach(Z=>{let N;Z.forEach(T=>{let E=w[T];if(D.setNode(E),N){var P=w[N],g=D.edge(P,E);D.setEdge(P,E,Math.max(G(b,T,N),g||0))}N=T})}),D}function h(b,m){return Object.values(m).reduce((w,A)=>{let D=Number.NEGATIVE_INFINITY,z=Number.POSITIVE_INFINITY;Object.entries(A).forEach(([Z,N])=>{let T=_(b,Z)/2;D=Math.max(N+T,D),z=Math.min(N-T,z)});let G=D-z;return G<w[0]&&(w=[G,A]),w},[Number.POSITIVE_INFINITY,null])[1]}function f(b,m){let w=Object.values(m),A=o.applyWithChunking(Math.min,w),D=o.applyWithChunking(Math.max,w);["u","d"].forEach(z=>{["l","r"].forEach(G=>{let Z=z+G,N=b[Z];if(N===m)return;let T=Object.values(N),E=A-o.applyWithChunking(Math.min,T);G!=="l"&&(E=D-o.applyWithChunking(Math.max,T)),E&&(b[Z]=o.mapValues(N,P=>P+E))})})}function p(b,m){return o.mapValues(b.ul,(w,A)=>{if(m)return b[m.toLowerCase()][A];{let D=Object.values(b).map(z=>z[A]).sort((z,G)=>z-G);return(D[1]+D[2])/2}})}function v(b){let m=o.buildLayerMatrix(b),w=Object.assign(r(b,m),i(b,m)),A={},D;["u","d"].forEach(G=>{D=G==="u"?m:Object.values(m).reverse(),["l","r"].forEach(Z=>{Z==="r"&&(D=D.map(P=>Object.values(P).reverse()));let N=(G==="u"?b.predecessors:b.successors).bind(b),T=u(b,D,w,N),E=c(b,D,T.root,T.align,Z==="r");Z==="r"&&(E=o.mapValues(E,P=>-P)),A[G+Z]=E})});let z=h(b,A);return f(A,z),p(A,b.graph().align)}function y(b,m,w){return(A,D,z)=>{let G=A.node(D),Z=A.node(z),N=0,T;if(N+=G.width/2,Object.hasOwn(G,"labelpos"))switch(G.labelpos.toLowerCase()){case"l":T=-G.width/2;break;case"r":T=G.width/2;break}if(T&&(N+=w?T:-T),T=0,N+=(G.dummy?m:b)/2,N+=(Z.dummy?m:b)/2,N+=Z.width/2,Object.hasOwn(Z,"labelpos"))switch(Z.labelpos.toLowerCase()){case"l":T=Z.width/2;break;case"r":T=-Z.width/2;break}return T&&(N+=w?T:-T),T=0,N}}function _(b,m){return b.node(m).width}}),Xg=Ne((e,t)=>{var n=ze(),o=Yg().positionX;t.exports=r;function r(s){s=n.asNonCompoundGraph(s),i(s),Object.entries(o(s)).forEach(([a,l])=>s.node(a).x=l)}function i(s){let a=n.buildLayerMatrix(s),l=s.graph().ranksep,u=s.graph().rankalign,c=0;a.forEach(d=>{let h=d.reduce((f,p)=>{let v=s.node(p).height;return f>v?f:v},0);d.forEach(f=>{let p=s.node(f);u==="top"?p.y=c+p.height/2:u==="bottom"?p.y=c+h-p.height/2:p.y=c+h/2}),c+=h+l})}}),Kg=Ne((e,t)=>{var n=Og(),o=Ig(),r=Lg(),i=ze().normalizeRanks,s=Dg(),a=ze().removeEmptyRanks,l=Mg(),u=$g(),c=Vg(),d=Ug(),h=Xg(),f=ze(),p=ct().Graph;t.exports=v;function v(x,L={}){let B=L.debugTiming?f.time:f.notime;return B("layout",()=>{let Y=B(" buildLayoutGraph",()=>N(x));return B(" runLayout",()=>y(Y,B,L)),B(" updateInputGraph",()=>_(x,Y)),Y})}function y(x,L,B){L(" makeSpaceForEdgeLabels",()=>T(x)),L(" removeSelfEdges",()=>j(x)),L(" acyclic",()=>n.run(x)),L(" nestingGraph.run",()=>l.run(x)),L(" rank",()=>r(f.asNonCompoundGraph(x))),L(" injectEdgeLabelProxies",()=>E(x)),L(" removeEmptyRanks",()=>a(x)),L(" nestingGraph.cleanup",()=>l.cleanup(x)),L(" normalizeRanks",()=>i(x)),L(" assignRankMinMax",()=>P(x)),L(" removeEdgeLabelProxies",()=>g(x)),L(" normalize.run",()=>o.run(x)),L(" parentDummyChains",()=>s(x)),L(" addBorderSegments",()=>u(x)),L(" order",()=>d(x,B)),L(" insertSelfEdges",()=>U(x)),L(" adjustCoordinateSystem",()=>c.adjust(x)),L(" position",()=>h(x)),L(" positionSelfEdges",()=>J(x)),L(" removeBorderNodes",()=>H(x)),L(" normalize.undo",()=>o.undo(x)),L(" fixupEdgeLabelCoords",()=>R(x)),L(" undoCoordinateSystem",()=>c.undo(x)),L(" translateGraph",()=>O(x)),L(" assignNodeIntersects",()=>k(x)),L(" reversePoints",()=>M(x)),L(" acyclic.undo",()=>n.undo(x))}function _(x,L){x.nodes().forEach(B=>{let Y=x.node(B),Q=L.node(B);Y&&(Y.x=Q.x,Y.y=Q.y,Y.order=Q.order,Y.rank=Q.rank,L.children(B).length&&(Y.width=Q.width,Y.height=Q.height))}),x.edges().forEach(B=>{let Y=x.edge(B),Q=L.edge(B);Y.points=Q.points,Object.hasOwn(Q,"x")&&(Y.x=Q.x,Y.y=Q.y)}),x.graph().width=L.graph().width,x.graph().height=L.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},w=["acyclicer","ranker","rankdir","align","rankalign"],A=["width","height","rank"],D={width:0,height:0},z=["minlen","weight","width","height","labeloffset"],G={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Z=["labelpos"];function N(x){let L=new p({multigraph:!0,compound:!0}),B=$(x.graph());return L.setGraph(Object.assign({},m,te(B,b),f.pick(B,w))),x.nodes().forEach(Y=>{let Q=$(x.node(Y)),ne=te(Q,A);Object.keys(D).forEach(se=>{ne[se]===void 0&&(ne[se]=D[se])}),L.setNode(Y,ne),L.setParent(Y,x.parent(Y))}),x.edges().forEach(Y=>{let Q=$(x.edge(Y));L.setEdge(Y,Object.assign({},G,te(Q,z),f.pick(Q,Z)))}),L}function T(x){let L=x.graph();L.ranksep/=2,x.edges().forEach(B=>{let Y=x.edge(B);Y.minlen*=2,Y.labelpos.toLowerCase()!=="c"&&(L.rankdir==="TB"||L.rankdir==="BT"?Y.width+=Y.labeloffset:Y.height+=Y.labeloffset)})}function E(x){x.edges().forEach(L=>{let B=x.edge(L);if(B.width&&B.height){let Y=x.node(L.v),Q={rank:(x.node(L.w).rank-Y.rank)/2+Y.rank,e:L};f.addDummyNode(x,"edge-proxy",Q,"_ep")}})}function P(x){let L=0;x.nodes().forEach(B=>{let Y=x.node(B);Y.borderTop&&(Y.minRank=x.node(Y.borderTop).rank,Y.maxRank=x.node(Y.borderBottom).rank,L=Math.max(L,Y.maxRank))}),x.graph().maxRank=L}function g(x){x.nodes().forEach(L=>{let B=x.node(L);B.dummy==="edge-proxy"&&(x.edge(B.e).labelRank=B.rank,x.removeNode(L))})}function O(x){let L=Number.POSITIVE_INFINITY,B=0,Y=Number.POSITIVE_INFINITY,Q=0,ne=x.graph(),se=ne.marginx||0,ue=ne.marginy||0;function ye(V){let I=V.x,F=V.y,X=V.width,W=V.height;L=Math.min(L,I-X/2),B=Math.max(B,I+X/2),Y=Math.min(Y,F-W/2),Q=Math.max(Q,F+W/2)}x.nodes().forEach(V=>ye(x.node(V))),x.edges().forEach(V=>{let I=x.edge(V);Object.hasOwn(I,"x")&&ye(I)}),L-=se,Y-=ue,x.nodes().forEach(V=>{let I=x.node(V);I.x-=L,I.y-=Y}),x.edges().forEach(V=>{let I=x.edge(V);I.points.forEach(F=>{F.x-=L,F.y-=Y}),Object.hasOwn(I,"x")&&(I.x-=L),Object.hasOwn(I,"y")&&(I.y-=Y)}),ne.width=B-L+se,ne.height=Q-Y+ue}function k(x){x.edges().forEach(L=>{let B=x.edge(L),Y=x.node(L.v),Q=x.node(L.w),ne,se;B.points?(ne=B.points[0],se=B.points[B.points.length-1]):(B.points=[],ne=Q,se=Y),B.points.unshift(f.intersectRect(Y,ne)),B.points.push(f.intersectRect(Q,se))})}function R(x){x.edges().forEach(L=>{let B=x.edge(L);if(Object.hasOwn(B,"x"))switch((B.labelpos==="l"||B.labelpos==="r")&&(B.width-=B.labeloffset),B.labelpos){case"l":B.x-=B.width/2+B.labeloffset;break;case"r":B.x+=B.width/2+B.labeloffset;break}})}function M(x){x.edges().forEach(L=>{let B=x.edge(L);B.reversed&&B.points.reverse()})}function H(x){x.nodes().forEach(L=>{if(x.children(L).length){let B=x.node(L),Y=x.node(B.borderTop),Q=x.node(B.borderBottom),ne=x.node(B.borderLeft[B.borderLeft.length-1]),se=x.node(B.borderRight[B.borderRight.length-1]);B.width=Math.abs(se.x-ne.x),B.height=Math.abs(Q.y-Y.y),B.x=ne.x+B.width/2,B.y=Y.y+B.height/2}}),x.nodes().forEach(L=>{x.node(L).dummy==="border"&&x.removeNode(L)})}function j(x){x.edges().forEach(L=>{if(L.v===L.w){var B=x.node(L.v);B.selfEdges||(B.selfEdges=[]),B.selfEdges.push({e:L,label:x.edge(L)}),x.removeEdge(L)}})}function U(x){var L=f.buildLayerMatrix(x);L.forEach(B=>{var Y=0;B.forEach((Q,ne)=>{var se=x.node(Q);se.order=ne+Y,(se.selfEdges||[]).forEach(ue=>{f.addDummyNode(x,"selfedge",{width:ue.label.width,height:ue.label.height,rank:se.rank,order:ne+ ++Y,e:ue.e,label:ue.label},"_se")}),delete se.selfEdges})})}function J(x){x.nodes().forEach(L=>{var B=x.node(L);if(B.dummy==="selfedge"){var Y=x.node(B.e.v),Q=Y.x+Y.width/2,ne=Y.y,se=B.x-Q,ue=Y.height/2;x.setEdge(B.e,B.label),x.removeNode(L),B.label.points=[{x:Q+2*se/3,y:ne-ue},{x:Q+5*se/6,y:ne-ue},{x:Q+se,y:ne},{x:Q+5*se/6,y:ne+ue},{x:Q+2*se/3,y:ne+ue}],B.label.x=B.x,B.label.y=B.y}})}function te(x,L){return f.mapValues(f.pick(x,L),Number)}function $(x){var L={};return x&&Object.entries(x).forEach(([B,Y])=>{typeof B=="string"&&(B=B.toLowerCase()),L[B]=Y}),L}}),Zg=Ne((e,t)=>{var n=ze(),o=ct().Graph;t.exports={debugOrdering:r};function r(i){let s=n.buildLayerMatrix(i),a=new o({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(l=>{a.setNode(l,{label:l}),a.setParent(l,"layer"+i.node(l).rank)}),i.edges().forEach(l=>a.setEdge(l.v,l.w,{},l.name)),s.forEach((l,u)=>{let c="layer"+u;a.setNode(c,{rank:"same"}),l.reduce((d,h)=>(a.setEdge(d,h,{style:"invis"}),h))}),a}}),Jg=Ne((e,t)=>{t.exports="2.0.4"}),Qg=Ne((e,t)=>{t.exports={graphlib:ct(),layout:Kg(),debug:Zg(),util:{time:ze().time,notime:ze().notime},version:Jg()}});const Ws=Qg();function Kn(e){return Ni()?(Bn(e),!0):!1}function Ct(e){return typeof e=="function"?e():C(e)}const ev=typeof window<"u"&&typeof document<"u",tv=e=>typeof e<"u",nv=Object.prototype.toString,ov=e=>nv.call(e)==="[object Object]",rv=()=>{};function iv(e,t){function n(...o){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(r).catch(i)})}return n}const Jl=e=>e();function sv(e=Jl){const t=fe(!0);function n(){t.value=!1}function o(){t.value=!0}const r=(...i)=>{t.value&&e(...i)};return{isActive:Ln(t),pause:n,resume:o,eventFilter:r}}function Us(e,t=!1,n="Timeout"){return new Promise((o,r)=>{setTimeout(t?()=>r(n):o,e)})}function av(e,t,n={}){const{eventFilter:o=Jl,...r}=n;return xe(e,iv(o,t),r)}function rn(e,t,n={}){const{eventFilter:o,...r}=n,{eventFilter:i,pause:s,resume:a,isActive:l}=sv(o);return{stop:av(e,t,{...r,eventFilter:i}),pause:s,resume:a,isActive:l}}function lv(e,t={}){if(!Oi(e))return Wa(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=Cc(()=>({get(){return e.value[o]},set(r){var i;if((i=Ct(t.replaceRef))!=null?i:!0)if(Array.isArray(e.value)){const a=[...e.value];a[o]=r,e.value=a}else{const a={...e.value,[o]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[o]=r}}));return n}function gi(e,t=!1){function n(d,{flush:h="sync",deep:f=!1,timeout:p,throwOnTimeout:v}={}){let y=null;const b=[new Promise(m=>{y=xe(e,w=>{d(w)!==t&&(y?.(),m(w))},{flush:h,deep:f,immediate:!0})})];return p!=null&&b.push(Us(p,v).then(()=>Ct(e)).finally(()=>y?.())),Promise.race(b)}function o(d,h){if(!Oi(d))return n(w=>w===d,h);const{flush:f="sync",deep:p=!1,timeout:v,throwOnTimeout:y}=h??{};let _=null;const m=[new Promise(w=>{_=xe([e,d],([A,D])=>{t!==(A===D)&&(_?.(),w(A))},{flush:f,deep:p,immediate:!0})})];return v!=null&&m.push(Us(v,y).then(()=>Ct(e)).finally(()=>(_?.(),Ct(e)))),Promise.race(m)}function r(d){return n(h=>!!h,d)}function i(d){return o(null,d)}function s(d){return o(void 0,d)}function a(d){return n(Number.isNaN,d)}function l(d,h){return n(f=>{const p=Array.from(f);return p.includes(d)||p.includes(Ct(d))},h)}function u(d){return c(1,d)}function c(d=1,h){let f=-1;return n(()=>(f+=1,f>=d),h)}return Array.isArray(Ct(e))?{toMatch:n,toContains:l,changed:u,changedTimes:c,get not(){return gi(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:r,toBeNull:i,toBeNaN:a,toBeUndefined:s,changed:u,changedTimes:c,get not(){return gi(e,!t)}}}function vi(e){return gi(e)}function uv(e){var t;const n=Ct(e);return(t=n?.$el)!=null?t:n}const Ql=ev?window:void 0;function eu(...e){let t,n,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,r]=e,t=Ql):[t,n,o,r]=e,!t)return rv;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],s=()=>{i.forEach(c=>c()),i.length=0},a=(c,d,h,f)=>(c.addEventListener(d,h,f),()=>c.removeEventListener(d,h,f)),l=xe(()=>[uv(t),Ct(r)],([c,d])=>{if(s(),!c)return;const h=ov(d)?{...d}:d;i.push(...n.flatMap(f=>o.map(p=>a(c,f,p,h))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return Kn(u),u}function cv(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Ys(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:r=Ql,eventName:i="keydown",passive:s=!1,dedupe:a=!1}=o,l=cv(t);return eu(r,i,c=>{c.repeat&&Ct(a)||l(c)&&n(c)},s)}function dv(e){return JSON.parse(JSON.stringify(e))}function zr(e,t,n,o={}){var r,i,s;const{clone:a=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d,shouldEmit:h}=o,f=Tn(),p=n||f?.emit||((r=f?.$emit)==null?void 0:r.bind(f))||((s=(i=f?.proxy)==null?void 0:i.$emit)==null?void 0:s.bind(f?.proxy));let v=u;t||(t="modelValue"),v=v||`update:${t.toString()}`;const y=m=>a?typeof a=="function"?a(m):dv(m):m,_=()=>tv(e[t])?y(e[t]):d,b=m=>{h?h(m)&&p(v,m):p(v,m)};if(l){const m=_(),w=fe(m);let A=!1;return xe(()=>e[t],D=>{A||(A=!0,w.value=y(D),Nt(()=>A=!1))}),xe(w,D=>{!A&&(D!==e[t]||c)&&b(D)},{deep:c}),w}else return oe({get(){return _()},set(m){b(m)}})}var fv={value:()=>{}};function wr(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Ao(n)}function Ao(e){this._=e}function hv(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Ao.prototype=wr.prototype={constructor:Ao,on:function(e,t){var n=this._,o=hv(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=pv(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=Xs(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Xs(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ao(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function pv(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function Xs(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=fv,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var _i="http://www.w3.org/1999/xhtml";const Ks={svg:"http://www.w3.org/2000/svg",xhtml:_i,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function br(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Ks.hasOwnProperty(t)?{space:Ks[t],local:e}:e}function mv(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===_i&&t.documentElement.namespaceURI===_i?t.createElement(e):t.createElementNS(n,e)}}function gv(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function tu(e){var t=br(e);return(t.local?gv:mv)(t)}function vv(){}function Ji(e){return e==null?vv:function(){return this.querySelector(e)}}function _v(e){typeof e!="function"&&(e=Ji(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=new Array(s),l,u,c=0;c<s;++c)(l=i[c])&&(u=e.call(l,l.__data__,c,i))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new et(o,this._parents)}function yv(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function wv(){return[]}function nu(e){return e==null?wv:function(){return this.querySelectorAll(e)}}function bv(e){return function(){return yv(e.apply(this,arguments))}}function Ev(e){typeof e=="function"?e=bv(e):e=nu(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(o.push(e.call(l,l.__data__,u,s)),r.push(l));return new et(o,r)}function ou(e){return function(){return this.matches(e)}}function ru(e){return function(t){return t.matches(e)}}var xv=Array.prototype.find;function kv(e){return function(){return xv.call(this.children,e)}}function Sv(){return this.firstElementChild}function Cv(e){return this.select(e==null?Sv:kv(typeof e=="function"?e:ru(e)))}var Tv=Array.prototype.filter;function Pv(){return Array.from(this.children)}function Av(e){return function(){return Tv.call(this.children,e)}}function Nv(e){return this.selectAll(e==null?Pv:Av(typeof e=="function"?e:ru(e)))}function Ov(e){typeof e!="function"&&(e=ou(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new et(o,this._parents)}function iu(e){return new Array(e.length)}function Iv(){return new et(this._enter||this._groups.map(iu),this._parents)}function Ko(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ko.prototype={constructor:Ko,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Rv(e){return function(){return e}}function Lv(e,t,n,o,r,i){for(var s=0,a,l=t.length,u=i.length;s<u;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Ko(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function Dv(e,t,n,o,r,i,s){var a,l,u=new Map,c=t.length,d=i.length,h=new Array(c),f;for(a=0;a<c;++a)(l=t[a])&&(h[a]=f=s.call(l,l.__data__,a,t)+"",u.has(f)?r[a]=l:u.set(f,l));for(a=0;a<d;++a)f=s.call(e,i[a],a,i)+"",(l=u.get(f))?(o[a]=l,l.__data__=i[a],u.delete(f)):n[a]=new Ko(e,i[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(h[a])===l&&(r[a]=l)}function Mv(e){return e.__data__}function $v(e,t){if(!arguments.length)return Array.from(this,Mv);var n=t?Dv:Lv,o=this._parents,r=this._groups;typeof e!="function"&&(e=Rv(e));for(var i=r.length,s=new Array(i),a=new Array(i),l=new Array(i),u=0;u<i;++u){var c=o[u],d=r[u],h=d.length,f=Vv(e.call(c,c&&c.__data__,u,o)),p=f.length,v=a[u]=new Array(p),y=s[u]=new Array(p),_=l[u]=new Array(h);n(c,d,v,y,_,f,t);for(var b=0,m=0,w,A;b<p;++b)if(w=v[b]){for(b>=m&&(m=b+1);!(A=y[m])&&++m<p;);w._next=A||null}}return s=new et(s,o),s._enter=a,s._exit=l,s}function Vv(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Bv(){return new et(this._exit||this._groups.map(iu),this._parents)}function zv(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function Fv(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var u=n[l],c=o[l],d=u.length,h=a[l]=new Array(d),f,p=0;p<d;++p)(f=u[p]||c[p])&&(h[p]=f);for(;l<r;++l)a[l]=n[l];return new et(a,this._parents)}function Hv(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Gv(e){e||(e=jv);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,l=r[i]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new et(r,this._parents).order()}function jv(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function qv(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Wv(){return Array.from(this)}function Uv(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function Yv(){let e=0;for(const t of this)++e;return e}function Xv(){return!this.node()}function Kv(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function Zv(e){return function(){this.removeAttribute(e)}}function Jv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Qv(e,t){return function(){this.setAttribute(e,t)}}function e_(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function t_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function n_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function o_(e,t){var n=br(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Jv:Zv:typeof t=="function"?n.local?n_:t_:n.local?e_:Qv)(n,t))}function su(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function r_(e){return function(){this.style.removeProperty(e)}}function i_(e,t,n){return function(){this.style.setProperty(e,t,n)}}function s_(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function a_(e,t,n){return arguments.length>1?this.each((t==null?r_:typeof t=="function"?s_:i_)(e,t,n??"")):bn(this.node(),e)}function bn(e,t){return e.style.getPropertyValue(t)||su(e).getComputedStyle(e,null).getPropertyValue(t)}function l_(e){return function(){delete this[e]}}function u_(e,t){return function(){this[e]=t}}function c_(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function d_(e,t){return arguments.length>1?this.each((t==null?l_:typeof t=="function"?c_:u_)(e,t)):this.node()[e]}function au(e){return e.trim().split(/^|\s+/)}function Qi(e){return e.classList||new lu(e)}function lu(e){this._node=e,this._names=au(e.getAttribute("class")||"")}lu.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function uu(e,t){for(var n=Qi(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function cu(e,t){for(var n=Qi(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function f_(e){return function(){uu(this,e)}}function h_(e){return function(){cu(this,e)}}function p_(e,t){return function(){(t.apply(this,arguments)?uu:cu)(this,e)}}function m_(e,t){var n=au(e+"");if(arguments.length<2){for(var o=Qi(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?p_:t?f_:h_)(n,t))}function g_(){this.textContent=""}function v_(e){return function(){this.textContent=e}}function __(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function y_(e){return arguments.length?this.each(e==null?g_:(typeof e=="function"?__:v_)(e)):this.node().textContent}function w_(){this.innerHTML=""}function b_(e){return function(){this.innerHTML=e}}function E_(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function x_(e){return arguments.length?this.each(e==null?w_:(typeof e=="function"?E_:b_)(e)):this.node().innerHTML}function k_(){this.nextSibling&&this.parentNode.appendChild(this)}function S_(){return this.each(k_)}function C_(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function T_(){return this.each(C_)}function P_(e){var t=typeof e=="function"?e:tu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function A_(){return null}function N_(e,t){var n=typeof e=="function"?e:tu(e),o=t==null?A_:typeof t=="function"?t:Ji(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function O_(){var e=this.parentNode;e&&e.removeChild(this)}function I_(){return this.each(O_)}function R_(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function L_(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function D_(e){return this.select(e?L_:R_)}function M_(e){return arguments.length?this.property("__data__",e):this.node().__data__}function $_(e){return function(t){e.call(this,t,this.__data__)}}function V_(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function B_(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++o]=i;++o?t.length=o:delete this.__on}}}function z_(e,t,n){return function(){var o=this.__on,r,i=$_(t);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function F_(e,t,n){var o=V_(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(r=0,c=a[l];r<i;++r)if((s=o[r]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?z_:B_,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function du(e,t,n){var o=su(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function H_(e,t){return function(){return du(this,e,t)}}function G_(e,t){return function(){return du(this,e,t.apply(this,arguments))}}function j_(e,t){return this.each((typeof t=="function"?G_:H_)(e,t))}function*q_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var fu=[null];function et(e,t){this._groups=e,this._parents=t}function ao(){return new et([[document.documentElement]],fu)}function W_(){return this}et.prototype=ao.prototype={constructor:et,select:_v,selectAll:Ev,selectChild:Cv,selectChildren:Nv,filter:Ov,data:$v,enter:Iv,exit:Bv,join:zv,merge:Fv,selection:W_,order:Hv,sort:Gv,call:qv,nodes:Wv,node:Uv,size:Yv,empty:Xv,each:Kv,attr:o_,style:a_,property:d_,classed:m_,text:y_,html:x_,raise:S_,lower:T_,append:P_,insert:N_,remove:I_,clone:D_,datum:M_,on:F_,dispatch:j_,[Symbol.iterator]:q_};function st(e){return typeof e=="string"?new et([[document.querySelector(e)]],[document.documentElement]):new et([[e]],fu)}function U_(e){let t;for(;t=e.sourceEvent;)e=t;return e}function gt(e,t){if(e=U_(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Y_={passive:!1},Zn={capture:!0,passive:!1};function Fr(e){e.stopImmediatePropagation()}function pn(e){e.preventDefault(),e.stopImmediatePropagation()}function hu(e){var t=e.document.documentElement,n=st(e).on("dragstart.drag",pn,Zn);"onselectstart"in t?n.on("selectstart.drag",pn,Zn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function pu(e,t){var n=e.document.documentElement,o=st(e).on("dragstart.drag",null);t&&(o.on("click.drag",pn,Zn),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const go=e=>()=>e;function yi(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}yi.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function X_(e){return!e.ctrlKey&&!e.button}function K_(){return this.parentNode}function Z_(e,t){return t??{x:e.x,y:e.y}}function J_(){return navigator.maxTouchPoints||"ontouchstart"in this}function Q_(){var e=X_,t=K_,n=Z_,o=J_,r={},i=wr("start","drag","end"),s=0,a,l,u,c,d=0;function h(w){w.on("mousedown.drag",f).filter(o).on("touchstart.drag",y).on("touchmove.drag",_,Y_).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(w,A){if(!(c||!e.call(this,w,A))){var D=m(this,t.call(this,w,A),w,A,"mouse");D&&(st(w.view).on("mousemove.drag",p,Zn).on("mouseup.drag",v,Zn),hu(w.view),Fr(w),u=!1,a=w.clientX,l=w.clientY,D("start",w))}}function p(w){if(pn(w),!u){var A=w.clientX-a,D=w.clientY-l;u=A*A+D*D>d}r.mouse("drag",w)}function v(w){st(w.view).on("mousemove.drag mouseup.drag",null),pu(w.view,u),pn(w),r.mouse("end",w)}function y(w,A){if(e.call(this,w,A)){var D=w.changedTouches,z=t.call(this,w,A),G=D.length,Z,N;for(Z=0;Z<G;++Z)(N=m(this,z,w,A,D[Z].identifier,D[Z]))&&(Fr(w),N("start",w,D[Z]))}}function _(w){var A=w.changedTouches,D=A.length,z,G;for(z=0;z<D;++z)(G=r[A[z].identifier])&&(pn(w),G("drag",w,A[z]))}function b(w){var A=w.changedTouches,D=A.length,z,G;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),z=0;z<D;++z)(G=r[A[z].identifier])&&(Fr(w),G("end",w,A[z]))}function m(w,A,D,z,G,Z){var N=i.copy(),T=gt(Z||D,A),E,P,g;if((g=n.call(w,new yi("beforestart",{sourceEvent:D,target:h,identifier:G,active:s,x:T[0],y:T[1],dx:0,dy:0,dispatch:N}),z))!=null)return E=g.x-T[0]||0,P=g.y-T[1]||0,function O(k,R,M){var H=T,j;switch(k){case"start":r[G]=O,j=s++;break;case"end":delete r[G],--s;case"drag":T=gt(M||R,A),j=s;break}N.call(k,w,new yi(k,{sourceEvent:R,subject:g,target:h,identifier:G,active:j,x:T[0]+E,y:T[1]+P,dx:T[0]-H[0],dy:T[1]-H[1],dispatch:N}),z)}}return h.filter=function(w){return arguments.length?(e=typeof w=="function"?w:go(!!w),h):e},h.container=function(w){return arguments.length?(t=typeof w=="function"?w:go(w),h):t},h.subject=function(w){return arguments.length?(n=typeof w=="function"?w:go(w),h):n},h.touchable=function(w){return arguments.length?(o=typeof w=="function"?w:go(!!w),h):o},h.on=function(){var w=i.on.apply(i,arguments);return w===i?h:w},h.clickDistance=function(w){return arguments.length?(d=(w=+w)*w,h):Math.sqrt(d)},h}function es(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function mu(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function lo(){}var Jn=.7,Zo=1/Jn,mn="\\s*([+-]?\\d+)\\s*",Qn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ey=/^#([0-9a-f]{3,8})$/,ty=new RegExp(`^rgb\\(${mn},${mn},${mn}\\)$`),ny=new RegExp(`^rgb\\(${bt},${bt},${bt}\\)$`),oy=new RegExp(`^rgba\\(${mn},${mn},${mn},${Qn}\\)$`),ry=new RegExp(`^rgba\\(${bt},${bt},${bt},${Qn}\\)$`),iy=new RegExp(`^hsl\\(${Qn},${bt},${bt}\\)$`),sy=new RegExp(`^hsla\\(${Qn},${bt},${bt},${Qn}\\)$`),Zs={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};es(lo,Jt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Js,formatHex:Js,formatHex8:ay,formatHsl:ly,formatRgb:Qs,toString:Qs});function Js(){return this.rgb().formatHex()}function ay(){return this.rgb().formatHex8()}function ly(){return gu(this).formatHsl()}function Qs(){return this.rgb().formatRgb()}function Jt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ey.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ea(t):n===3?new Ye(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vo(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ty.exec(e))?new Ye(t[1],t[2],t[3],1):(t=ny.exec(e))?new Ye(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=oy.exec(e))?vo(t[1],t[2],t[3],t[4]):(t=ry.exec(e))?vo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=iy.exec(e))?oa(t[1],t[2]/100,t[3]/100,1):(t=sy.exec(e))?oa(t[1],t[2]/100,t[3]/100,t[4]):Zs.hasOwnProperty(e)?ea(Zs[e]):e==="transparent"?new Ye(NaN,NaN,NaN,0):null}function ea(e){return new Ye(e>>16&255,e>>8&255,e&255,1)}function vo(e,t,n,o){return o<=0&&(e=t=n=NaN),new Ye(e,t,n,o)}function uy(e){return e instanceof lo||(e=Jt(e)),e?(e=e.rgb(),new Ye(e.r,e.g,e.b,e.opacity)):new Ye}function wi(e,t,n,o){return arguments.length===1?uy(e):new Ye(e,t,n,o??1)}function Ye(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}es(Ye,wi,mu(lo,{brighter(e){return e=e==null?Zo:Math.pow(Zo,e),new Ye(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Jn:Math.pow(Jn,e),new Ye(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ye(Xt(this.r),Xt(this.g),Xt(this.b),Jo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ta,formatHex:ta,formatHex8:cy,formatRgb:na,toString:na}));function ta(){return`#${Yt(this.r)}${Yt(this.g)}${Yt(this.b)}`}function cy(){return`#${Yt(this.r)}${Yt(this.g)}${Yt(this.b)}${Yt((isNaN(this.opacity)?1:this.opacity)*255)}`}function na(){const e=Jo(this.opacity);return`${e===1?"rgb(":"rgba("}${Xt(this.r)}, ${Xt(this.g)}, ${Xt(this.b)}${e===1?")":`, ${e})`}`}function Jo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yt(e){return e=Xt(e),(e<16?"0":"")+e.toString(16)}function oa(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new at(e,t,n,o)}function gu(e){if(e instanceof at)return new at(e.h,e.s,e.l,e.opacity);if(e instanceof lo||(e=Jt(e)),!e)return new at;if(e instanceof at)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,a=i-r,l=(i+r)/2;return a?(t===i?s=(n-o)/a+(n<o)*6:n===i?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+r:2-i-r,s*=60):a=l>0&&l<1?0:s,new at(s,a,l,e.opacity)}function dy(e,t,n,o){return arguments.length===1?gu(e):new at(e,t,n,o??1)}function at(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}es(at,dy,mu(lo,{brighter(e){return e=e==null?Zo:Math.pow(Zo,e),new at(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Jn:Math.pow(Jn,e),new at(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new Ye(Hr(e>=240?e-240:e+120,r,o),Hr(e,r,o),Hr(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new at(ra(this.h),_o(this.s),_o(this.l),Jo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Jo(this.opacity);return`${e===1?"hsl(":"hsla("}${ra(this.h)}, ${_o(this.s)*100}%, ${_o(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ra(e){return e=(e||0)%360,e<0?e+360:e}function _o(e){return Math.max(0,Math.min(1,e||0))}function Hr(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const ts=e=>()=>e;function fy(e,t){return function(n){return e+n*t}}function hy(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function py(e){return(e=+e)==1?vu:function(t,n){return n-t?hy(t,n,e):ts(isNaN(t)?n:t)}}function vu(e,t){var n=t-e;return n?fy(e,n):ts(isNaN(e)?t:e)}const Qo=(function e(t){var n=py(t);function o(r,i){var s=n((r=wi(r)).r,(i=wi(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),u=vu(r.opacity,i.opacity);return function(c){return r.r=s(c),r.g=a(c),r.b=l(c),r.opacity=u(c),r+""}}return o.gamma=e,o})(1);function my(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function gy(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function vy(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),i=new Array(n),s;for(s=0;s<o;++s)r[s]=Hn(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<o;++s)i[s]=r[s](a);return i}}function _y(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function vt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function yy(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=Hn(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var bi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gr=new RegExp(bi.source,"g");function wy(e){return function(){return e}}function by(e){return function(t){return e(t)+""}}function _u(e,t){var n=bi.lastIndex=Gr.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=bi.exec(e))&&(r=Gr.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:vt(o,r)})),n=Gr.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?by(l[0].x):wy(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}function Hn(e,t){var n=typeof t,o;return t==null||n==="boolean"?ts(t):(n==="number"?vt:n==="string"?(o=Jt(t))?(t=o,Qo):_u:t instanceof Jt?Qo:t instanceof Date?_y:gy(t)?my:Array.isArray(t)?vy:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?yy:vt)(e,t)}var ia=180/Math.PI,Ei={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function yu(e,t,n,o,r,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*ia,skewX:Math.atan(l)*ia,scaleX:s,scaleY:a}}var yo;function Ey(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ei:yu(t.a,t.b,t.c,t.d,t.e,t.f)}function xy(e){return e==null||(yo||(yo=document.createElementNS("http://www.w3.org/2000/svg","g")),yo.setAttribute("transform",e),!(e=yo.transform.baseVal.consolidate()))?Ei:(e=e.matrix,yu(e.a,e.b,e.c,e.d,e.e,e.f))}function wu(e,t,n,o){function r(u){return u.length?u.pop()+" ":""}function i(u,c,d,h,f,p){if(u!==d||c!==h){var v=f.push("translate(",null,t,null,n);p.push({i:v-4,x:vt(u,d)},{i:v-2,x:vt(c,h)})}else(d||h)&&f.push("translate("+d+t+h+n)}function s(u,c,d,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:d.push(r(d)+"rotate(",null,o)-2,x:vt(u,c)})):c&&d.push(r(d)+"rotate("+c+o)}function a(u,c,d,h){u!==c?h.push({i:d.push(r(d)+"skewX(",null,o)-2,x:vt(u,c)}):c&&d.push(r(d)+"skewX("+c+o)}function l(u,c,d,h,f,p){if(u!==d||c!==h){var v=f.push(r(f)+"scale(",null,",",null,")");p.push({i:v-4,x:vt(u,d)},{i:v-2,x:vt(c,h)})}else(d!==1||h!==1)&&f.push(r(f)+"scale("+d+","+h+")")}return function(u,c){var d=[],h=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,d,h),s(u.rotate,c.rotate,d,h),a(u.skewX,c.skewX,d,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,h),u=c=null,function(f){for(var p=-1,v=h.length,y;++p<v;)d[(y=h[p]).i]=y.x(f);return d.join("")}}}var ky=wu(Ey,"px, ","px)","deg)"),Sy=wu(xy,", ",")",")"),Cy=1e-12;function sa(e){return((e=Math.exp(e))+1/e)/2}function Ty(e){return((e=Math.exp(e))-1/e)/2}function Py(e){return((e=Math.exp(2*e))-1)/(e+1)}const No=(function e(t,n,o){function r(i,s){var a=i[0],l=i[1],u=i[2],c=s[0],d=s[1],h=s[2],f=c-a,p=d-l,v=f*f+p*p,y,_;if(v<Cy)_=Math.log(h/u)/t,y=function(z){return[a+z*f,l+z*p,u*Math.exp(t*z*_)]};else{var b=Math.sqrt(v),m=(h*h-u*u+o*v)/(2*u*n*b),w=(h*h-u*u-o*v)/(2*h*n*b),A=Math.log(Math.sqrt(m*m+1)-m),D=Math.log(Math.sqrt(w*w+1)-w);_=(D-A)/t,y=function(z){var G=z*_,Z=sa(A),N=u/(n*b)*(Z*Py(t*G+A)-Ty(A));return[a+N*f,l+N*p,u*Z/sa(t*G+A)]}}return y.duration=_*1e3*t/Math.SQRT2,y}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},r})(Math.SQRT2,2,4);var En=0,Mn=0,In=0,bu=1e3,er,$n,tr=0,Qt=0,Er=0,eo=typeof performance=="object"&&performance.now?performance:Date,Eu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ns(){return Qt||(Eu(Ay),Qt=eo.now()+Er)}function Ay(){Qt=0}function nr(){this._call=this._time=this._next=null}nr.prototype=xu.prototype={constructor:nr,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ns():+n)+(t==null?0:+t),!this._next&&$n!==this&&($n?$n._next=this:er=this,$n=this),this._call=e,this._time=n,xi()},stop:function(){this._call&&(this._call=null,this._time=1/0,xi())}};function xu(e,t,n){var o=new nr;return o.restart(e,t,n),o}function Ny(){ns(),++En;for(var e=er,t;e;)(t=Qt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--En}function aa(){Qt=(tr=eo.now())+Er,En=Mn=0;try{Ny()}finally{En=0,Iy(),Qt=0}}function Oy(){var e=eo.now(),t=e-tr;t>bu&&(Er-=t,tr=e)}function Iy(){for(var e,t=er,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:er=n);$n=e,xi(o)}function xi(e){if(!En){Mn&&(Mn=clearTimeout(Mn));var t=e-Qt;t>24?(e<1/0&&(Mn=setTimeout(aa,e-eo.now()-Er)),In&&(In=clearInterval(In))):(In||(tr=eo.now(),In=setInterval(Oy,bu)),En=1,Eu(aa))}}function la(e,t,n){var o=new nr;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Ry=wr("start","end","cancel","interrupt"),Ly=[],ku=0,ua=1,ki=2,Oo=3,ca=4,Si=5,Io=6;function xr(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Dy(e,n,{name:t,index:o,group:r,on:Ry,tween:Ly,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:ku})}function os(e,t){var n=ft(e,t);if(n.state>ku)throw new Error("too late; already scheduled");return n}function kt(e,t){var n=ft(e,t);if(n.state>Oo)throw new Error("too late; already running");return n}function ft(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Dy(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=xu(i,0,n.time);function i(u){n.state=ua,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,h,f;if(n.state!==ua)return l();for(c in o)if(f=o[c],f.name===n.name){if(f.state===Oo)return la(s);f.state===ca?(f.state=Io,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[c]):+c<t&&(f.state=Io,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[c])}if(la(function(){n.state===Oo&&(n.state=ca,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=ki,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ki){for(n.state=Oo,r=new Array(h=n.tween.length),c=0,d=-1;c<h;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=f);r.length=d+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Si,1),d=-1,h=r.length;++d<h;)r[d].call(e,c);n.state===Si&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Io,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function Ro(e,t){var n=e.__transition,o,r,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){i=!1;continue}r=o.state>ki&&o.state<Si,o.state=Io,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function My(e){return this.each(function(){Ro(this,e)})}function $y(e,t){var n,o;return function(){var r=kt(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function Vy(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=kt(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},l=0,u=r.length;l<u;++l)if(r[l].name===t){r[l]=a;break}l===u&&r.push(a)}i.tween=r}}function By(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=ft(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===e)return s.value;return null}return this.each((t==null?$y:Vy)(n,e,t))}function rs(e,t,n){var o=e._id;return e.each(function(){var r=kt(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return ft(r,o).value[t]}}function Su(e,t){var n;return(typeof t=="number"?vt:t instanceof Jt?Qo:(n=Jt(t))?(t=n,Qo):_u)(e,t)}function zy(e){return function(){this.removeAttribute(e)}}function Fy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Hy(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttribute(e);return s===r?null:s===o?i:i=t(o=s,n)}}function Gy(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===o?i:i=t(o=s,n)}}function jy(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function qy(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function Wy(e,t){var n=br(e),o=n==="transform"?Sy:Su;return this.attrTween(e,typeof t=="function"?(n.local?qy:jy)(n,o,rs(this,"attr."+e,t)):t==null?(n.local?Fy:zy)(n):(n.local?Gy:Hy)(n,o,t))}function Uy(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Yy(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Xy(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Yy(e,i)),n}return r._value=t,r}function Ky(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Uy(e,i)),n}return r._value=t,r}function Zy(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=br(e);return this.tween(n,(o.local?Xy:Ky)(o,t))}function Jy(e,t){return function(){os(this,e).delay=+t.apply(this,arguments)}}function Qy(e,t){return t=+t,function(){os(this,e).delay=t}}function e0(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Jy:Qy)(t,e)):ft(this.node(),t).delay}function t0(e,t){return function(){kt(this,e).duration=+t.apply(this,arguments)}}function n0(e,t){return t=+t,function(){kt(this,e).duration=t}}function o0(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?t0:n0)(t,e)):ft(this.node(),t).duration}function r0(e,t){if(typeof t!="function")throw new Error;return function(){kt(this,e).ease=t}}function i0(e){var t=this._id;return arguments.length?this.each(r0(t,e)):ft(this.node(),t).ease}function s0(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;kt(this,e).ease=n}}function a0(e){if(typeof e!="function")throw new Error;return this.each(s0(this._id,e))}function l0(e){typeof e!="function"&&(e=ou(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new Rt(o,this._parents,this._name,this._id)}function u0(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var l=t[a],u=n[a],c=l.length,d=s[a]=new Array(c),h,f=0;f<c;++f)(h=l[f]||u[f])&&(d[f]=h);for(;a<o;++a)s[a]=t[a];return new Rt(s,this._parents,this._name,this._id)}function c0(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function d0(e,t,n){var o,r,i=c0(t)?os:kt;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function f0(e,t){var n=this._id;return arguments.length<2?ft(this.node(),n).on.on(e):this.each(d0(n,e,t))}function h0(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function p0(){return this.on("end.remove",h0(this._id))}function m0(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ji(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],l=a.length,u=i[s]=new Array(l),c,d,h=0;h<l;++h)(c=a[h])&&(d=e.call(c,c.__data__,h,a))&&("__data__"in c&&(d.__data__=c.__data__),u[h]=d,xr(u[h],t,n,h,u,ft(c,n)));return new Rt(i,this._parents,t,n)}function g0(e){var t=this._name,n=this._id;typeof e!="function"&&(e=nu(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var l=o[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var h=e.call(c,c.__data__,d,l),f,p=ft(c,n),v=0,y=h.length;v<y;++v)(f=h[v])&&xr(f,t,n,v,h,p);i.push(h),s.push(c)}return new Rt(i,s,t,n)}var v0=ao.prototype.constructor;function _0(){return new v0(this._groups,this._parents)}function y0(e,t){var n,o,r;return function(){var i=bn(this,e),s=(this.style.removeProperty(e),bn(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function Cu(e){return function(){this.style.removeProperty(e)}}function w0(e,t,n){var o,r=n+"",i;return function(){var s=bn(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function b0(e,t,n){var o,r,i;return function(){var s=bn(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),bn(this,e))),s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a))}}function E0(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var l=kt(this,e),u=l.on,c=l.value[i]==null?a||(a=Cu(t)):void 0;(u!==n||r!==c)&&(o=(n=u).copy()).on(s,r=c),l.on=o}}function x0(e,t,n){var o=(e+="")=="transform"?ky:Su;return t==null?this.styleTween(e,y0(e,o)).on("end.style."+e,Cu(e)):typeof t=="function"?this.styleTween(e,b0(e,o,rs(this,"style."+e,t))).each(E0(this._id,e)):this.styleTween(e,w0(e,o,t),n).on("end.style."+e,null)}function k0(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function S0(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&k0(e,s,n)),o}return i._value=t,i}function C0(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,S0(e,t,n??""))}function T0(e){return function(){this.textContent=e}}function P0(e){return function(){var t=e(this);this.textContent=t??""}}function A0(e){return this.tween("text",typeof e=="function"?P0(rs(this,"text",e)):T0(e==null?"":e+""))}function N0(e){return function(t){this.textContent=e.call(this,t)}}function O0(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&N0(r)),t}return o._value=e,o}function I0(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,O0(e))}function R0(){for(var e=this._name,t=this._id,n=Tu(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=ft(l,t);xr(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Rt(o,this._parents,e,n)}function L0(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--r===0&&i()}};n.each(function(){var u=kt(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),r===0&&i()})}var D0=0;function Rt(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Tu(){return++D0}var St=ao.prototype;Rt.prototype={constructor:Rt,select:m0,selectAll:g0,selectChild:St.selectChild,selectChildren:St.selectChildren,filter:l0,merge:u0,selection:_0,transition:R0,call:St.call,nodes:St.nodes,node:St.node,size:St.size,empty:St.empty,each:St.each,on:f0,attr:Wy,attrTween:Zy,style:x0,styleTween:C0,text:A0,textTween:I0,remove:p0,tween:By,delay:e0,duration:o0,ease:i0,easeVarying:a0,end:L0,[Symbol.iterator]:St[Symbol.iterator]};function M0(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $0={time:null,delay:0,duration:250,ease:M0};function V0(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function B0(e){var t,n;e instanceof Rt?(t=e._id,e=e._name):(t=Tu(),(n=$0).time=ns(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&xr(l,e,t,u,s,n||V0(l,t));return new Rt(o,this._parents,e,t)}ao.prototype.interrupt=My;ao.prototype.transition=B0;const wo=e=>()=>e;function z0(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function Pt(e,t,n){this.k=e,this.x=t,this.y=n}Pt.prototype={constructor:Pt,scale:function(e){return e===1?this:new Pt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Pt(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var xn=new Pt(1,0,0);Pt.prototype;function jr(e){e.stopImmediatePropagation()}function Rn(e){e.preventDefault(),e.stopImmediatePropagation()}function F0(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function H0(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function da(){return this.__zoom||xn}function G0(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function j0(){return navigator.maxTouchPoints||"ontouchstart"in this}function q0(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function W0(){var e=F0,t=H0,n=q0,o=G0,r=j0,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=No,u=wr("start","zoom","end"),c,d,h,f=500,p=150,v=0,y=10;function _(g){g.property("__zoom",da).on("wheel.zoom",G,{passive:!1}).on("mousedown.zoom",Z).on("dblclick.zoom",N).filter(r).on("touchstart.zoom",T).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",P).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(g,O,k,R){var M=g.selection?g.selection():g;M.property("__zoom",da),g!==M?A(g,O,k,R):M.interrupt().each(function(){D(this,arguments).event(R).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},_.scaleBy=function(g,O,k,R){_.scaleTo(g,function(){var M=this.__zoom.k,H=typeof O=="function"?O.apply(this,arguments):O;return M*H},k,R)},_.scaleTo=function(g,O,k,R){_.transform(g,function(){var M=t.apply(this,arguments),H=this.__zoom,j=k==null?w(M):typeof k=="function"?k.apply(this,arguments):k,U=H.invert(j),J=typeof O=="function"?O.apply(this,arguments):O;return n(m(b(H,J),j,U),M,s)},k,R)},_.translateBy=function(g,O,k,R){_.transform(g,function(){return n(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),s)},null,R)},_.translateTo=function(g,O,k,R,M){_.transform(g,function(){var H=t.apply(this,arguments),j=this.__zoom,U=R==null?w(H):typeof R=="function"?R.apply(this,arguments):R;return n(xn.translate(U[0],U[1]).scale(j.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof k=="function"?-k.apply(this,arguments):-k),H,s)},R,M)};function b(g,O){return O=Math.max(i[0],Math.min(i[1],O)),O===g.k?g:new Pt(O,g.x,g.y)}function m(g,O,k){var R=O[0]-k[0]*g.k,M=O[1]-k[1]*g.k;return R===g.x&&M===g.y?g:new Pt(g.k,R,M)}function w(g){return[(+g[0][0]+ +g[1][0])/2,(+g[0][1]+ +g[1][1])/2]}function A(g,O,k,R){g.on("start.zoom",function(){D(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).event(R).end()}).tween("zoom",function(){var M=this,H=arguments,j=D(M,H).event(R),U=t.apply(M,H),J=k==null?w(U):typeof k=="function"?k.apply(M,H):k,te=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),$=M.__zoom,x=typeof O=="function"?O.apply(M,H):O,L=l($.invert(J).concat(te/$.k),x.invert(J).concat(te/x.k));return function(B){if(B===1)B=x;else{var Y=L(B),Q=te/Y[2];B=new Pt(Q,J[0]-Y[0]*Q,J[1]-Y[1]*Q)}j.zoom(null,B)}})}function D(g,O,k){return!k&&g.__zooming||new z(g,O)}function z(g,O){this.that=g,this.args=O,this.active=0,this.sourceEvent=null,this.extent=t.apply(g,O),this.taps=0}z.prototype={event:function(g){return g&&(this.sourceEvent=g),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(g,O){return this.mouse&&g!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&g!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&g!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(g){var O=st(this.that).datum();u.call(g,this.that,new z0(g,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:u}),O)}};function G(g,...O){if(!e.apply(this,arguments))return;var k=D(this,O).event(g),R=this.__zoom,M=Math.max(i[0],Math.min(i[1],R.k*Math.pow(2,o.apply(this,arguments)))),H=gt(g);if(k.wheel)(k.mouse[0][0]!==H[0]||k.mouse[0][1]!==H[1])&&(k.mouse[1]=R.invert(k.mouse[0]=H)),clearTimeout(k.wheel);else{if(R.k===M)return;k.mouse=[H,R.invert(H)],Ro(this),k.start()}Rn(g),k.wheel=setTimeout(j,p),k.zoom("mouse",n(m(b(R,M),k.mouse[0],k.mouse[1]),k.extent,s));function j(){k.wheel=null,k.end()}}function Z(g,...O){if(h||!e.apply(this,arguments))return;var k=g.currentTarget,R=D(this,O,!0).event(g),M=st(g.view).on("mousemove.zoom",J,!0).on("mouseup.zoom",te,!0),H=gt(g,k),j=g.clientX,U=g.clientY;hu(g.view),jr(g),R.mouse=[H,this.__zoom.invert(H)],Ro(this),R.start();function J($){if(Rn($),!R.moved){var x=$.clientX-j,L=$.clientY-U;R.moved=x*x+L*L>v}R.event($).zoom("mouse",n(m(R.that.__zoom,R.mouse[0]=gt($,k),R.mouse[1]),R.extent,s))}function te($){M.on("mousemove.zoom mouseup.zoom",null),pu($.view,R.moved),Rn($),R.event($).end()}}function N(g,...O){if(e.apply(this,arguments)){var k=this.__zoom,R=gt(g.changedTouches?g.changedTouches[0]:g,this),M=k.invert(R),H=k.k*(g.shiftKey?.5:2),j=n(m(b(k,H),R,M),t.apply(this,O),s);Rn(g),a>0?st(this).transition().duration(a).call(A,j,R,g):st(this).call(_.transform,j,R,g)}}function T(g,...O){if(e.apply(this,arguments)){var k=g.touches,R=k.length,M=D(this,O,g.changedTouches.length===R).event(g),H,j,U,J;for(jr(g),j=0;j<R;++j)U=k[j],J=gt(U,this),J=[J,this.__zoom.invert(J),U.identifier],M.touch0?!M.touch1&&M.touch0[2]!==J[2]&&(M.touch1=J,M.taps=0):(M.touch0=J,H=!0,M.taps=1+!!c);c&&(c=clearTimeout(c)),H&&(M.taps<2&&(d=J[0],c=setTimeout(function(){c=null},f)),Ro(this),M.start())}}function E(g,...O){if(this.__zooming){var k=D(this,O).event(g),R=g.changedTouches,M=R.length,H,j,U,J;for(Rn(g),H=0;H<M;++H)j=R[H],U=gt(j,this),k.touch0&&k.touch0[2]===j.identifier?k.touch0[0]=U:k.touch1&&k.touch1[2]===j.identifier&&(k.touch1[0]=U);if(j=k.that.__zoom,k.touch1){var te=k.touch0[0],$=k.touch0[1],x=k.touch1[0],L=k.touch1[1],B=(B=x[0]-te[0])*B+(B=x[1]-te[1])*B,Y=(Y=L[0]-$[0])*Y+(Y=L[1]-$[1])*Y;j=b(j,Math.sqrt(B/Y)),U=[(te[0]+x[0])/2,(te[1]+x[1])/2],J=[($[0]+L[0])/2,($[1]+L[1])/2]}else if(k.touch0)U=k.touch0[0],J=k.touch0[1];else return;k.zoom("touch",n(m(j,U,J),k.extent,s))}}function P(g,...O){if(this.__zooming){var k=D(this,O).event(g),R=g.changedTouches,M=R.length,H,j;for(jr(g),h&&clearTimeout(h),h=setTimeout(function(){h=null},f),H=0;H<M;++H)j=R[H],k.touch0&&k.touch0[2]===j.identifier?delete k.touch0:k.touch1&&k.touch1[2]===j.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(j=gt(j,this),Math.hypot(d[0]-j[0],d[1]-j[1])<y)){var U=st(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return _.wheelDelta=function(g){return arguments.length?(o=typeof g=="function"?g:wo(+g),_):o},_.filter=function(g){return arguments.length?(e=typeof g=="function"?g:wo(!!g),_):e},_.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:wo(!!g),_):r},_.extent=function(g){return arguments.length?(t=typeof g=="function"?g:wo([[+g[0][0],+g[0][1]],[+g[1][0],+g[1][1]]]),_):t},_.scaleExtent=function(g){return arguments.length?(i[0]=+g[0],i[1]=+g[1],_):[i[0],i[1]]},_.translateExtent=function(g){return arguments.length?(s[0][0]=+g[0][0],s[1][0]=+g[1][0],s[0][1]=+g[0][1],s[1][1]=+g[1][1],_):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},_.constrain=function(g){return arguments.length?(n=g,_):n},_.duration=function(g){return arguments.length?(a=+g,_):a},_.interpolate=function(g){return arguments.length?(l=g,_):l},_.on=function(){var g=u.on.apply(u,arguments);return g===u?_:g},_.clickDistance=function(g){return arguments.length?(v=(g=+g)*g,_):Math.sqrt(v)},_.tapDistance=function(g){return arguments.length?(y=+g,_):y},_}var de=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(de||{}),is=(e=>(e.Partial="partial",e.Full="full",e))(is||{}),qt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(qt||{}),Ht=(e=>(e.Strict="strict",e.Loose="loose",e))(Ht||{}),or=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(or||{}),Gn=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(Gn||{}),Pu=(e=>(e.TopLeft="top-left",e.TopCenter="top-center",e.TopRight="top-right",e.BottomLeft="bottom-left",e.BottomCenter="bottom-center",e.BottomRight="bottom-right",e))(Pu||{});const U0=["INPUT","SELECT","TEXTAREA"],Y0=typeof document<"u"?document:null;function Ci(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,r=typeof o?.hasAttribute=="function"?o.hasAttribute("contenteditable"):!1,i=typeof o?.closest=="function"?o.closest(".nokey"):null;return U0.includes(o?.nodeName)||r||!!i}function X0(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function fa(e,t,n,o){const r=t.replace("+",`
|
|
14
|
+
`).replace(`
|
|
15
|
+
|
|
16
|
+
`,`
|
|
17
|
+
+`).split(`
|
|
18
|
+
`).map(s=>s.trim().toLowerCase());if(r.length===1)return e.toLowerCase()===t.toLowerCase();o||n.add(e.toLowerCase());const i=r.every((s,a)=>n.has(s)&&Array.from(n.values())[a]===r[a]);return o&&n.delete(e.toLowerCase()),i}function K0(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=Z0(n.code,e);return Array.isArray(e)?e.some(r=>fa(n[o],r,t,n.type==="keyup")):fa(n[o],e,t,n.type==="keyup")}}function Z0(e,t){return t.includes(e)?"code":"key"}function jn(e,t){const n=oe(()=>Ce(t?.target)??Y0),o=Tt(Ce(e)===!0);let r=!1;const i=new Set;let s=l(Ce(e));xe(()=>Ce(e),(u,c)=>{typeof c=="boolean"&&typeof u!="boolean"&&a(),s=l(u)},{immediate:!0}),eu(["blur","contextmenu"],a),Ys((...u)=>s(...u),u=>{var c,d;const h=Ce(t?.actInsideInputWithModifier)??!0,f=Ce(t?.preventDefault)??!1;if(r=X0(u),(!r||r&&!h)&&Ci(u))return;const v=((d=(c=u.composedPath)==null?void 0:c.call(u))==null?void 0:d[0])||u.target,y=v?.nodeName==="BUTTON"||v?.nodeName==="A";!f&&(r||!y)&&u.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),Ys((...u)=>s(...u),u=>{const c=Ce(t?.actInsideInputWithModifier)??!0;if(o.value){if((!r||r&&!c)&&Ci(u))return;r=!1,o.value=!1}},{eventName:"keyup",target:n});function a(){r=!1,i.clear(),o.value=Ce(e)===!0}function l(u){return u===null?(a(),()=>!1):typeof u=="boolean"?(a(),o.value=u,()=>!1):Array.isArray(u)||typeof u=="string"?K0(u,i):u}return o}const Au="vue-flow__node-desc",Nu="vue-flow__edge-desc",J0="vue-flow__aria-live",Ou=["Enter"," ","Escape"],gn={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function rr(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function ir(e,t){const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)}function kr(e){return{width:e.offsetWidth,height:e.offsetHeight}}function en(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function Iu(e,t){return{x:en(e.x,t[0][0],t[1][0]),y:en(e.y,t[0][1],t[1][1])}}function ha(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function Gt(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function Kt(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!Gt(e)}function Vn(e){return Kt(e)&&"computedPosition"in e}function bo(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Q0(e){return bo(e.width)&&bo(e.height)&&bo(e.x)&&bo(e.y)}function ew(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:cn({width:0,height:0}),computedPosition:cn({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:$e(e.data)?e.data:{},events:cn($e(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function Ru(e,t,n){var o,r;const i={id:e.id.toString(),type:e.type??t?.type??"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(o=e.sourceHandle)==null?void 0:o.toString(),targetHandle:(r=e.targetHandle)==null?void 0:r.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:$e(e.data)?e.data:{},events:cn($e(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??i,e,{id:e.id.toString()})}function Lu(e,t,n,o){const r=typeof e=="string"?e:e.id,i=new Set,s=o==="source"?"target":"source";for(const a of n)a[s]===r&&i.add(a[o]);return t.filter(a=>i.has(a.id))}function tw(...e){if(e.length===3){const[i,s,a]=e;return Lu(i,s,a,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(i=>Gt(i)&&i.source===o).map(i=>n.find(s=>Kt(s)&&s.id===i.target))}function nw(...e){if(e.length===3){const[i,s,a]=e;return Lu(i,s,a,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(i=>Gt(i)&&i.target===o).map(i=>n.find(s=>Kt(s)&&s.id===i.source))}function Du({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function ow(e,t){return t.some(n=>Gt(n)&&n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle))}function to({x:e,y:t},{x:n,y:o,zoom:r}){return{x:e*r+n,y:t*r+o}}function no({x:e,y:t},{x:n,y:o,zoom:r},i=!1,s=[1,1]){const a={x:(e-n)/r,y:(t-o)/r};return i?Sr(a,s):a}function rw(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function Mu({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function iw({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function $u(e){let t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<e.length;n++){const o=e[n];t=rw(t,Mu({...o.computedPosition,...o.dimensions}))}return iw(t)}function Vu(e,t,n={x:0,y:0,zoom:1},o=!1,r=!1){const i={...no(t,n),width:t.width/n.zoom,height:t.height/n.zoom},s=[];for(const a of e){const{dimensions:l,selectable:u=!0,hidden:c=!1}=a,d=l.width??a.width??null,h=l.height??a.height??null;if(r&&!u||c)continue;const f=ir(i,rr(a)),p=d===null||h===null,v=o&&f>0,y=(d??0)*(h??0);(p||v||f>=y||a.dragging)&&s.push(a)}return s}function Bu(e,t){const n=new Set;if(typeof e=="string")n.add(e);else if(e.length>=1)for(const o of e)n.add(o.id);return t.filter(o=>n.has(o.source)||n.has(o.target))}function sn(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return uo(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function sw(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=sn(e,n),r=sn(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=sn(e.top??e.y??0,n),r=sn(e.bottom??e.y??0,n),i=sn(e.left??e.x??0,t),s=sn(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function aw(e,t,n,o,r,i){const{x:s,y:a}=to(e,{x:t,y:n,zoom:o}),{x:l,y:u}=to({x:e.x+e.width,y:e.y+e.height},{x:t,y:n,zoom:o}),c=r-l,d=i-u;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(c),bottom:Math.floor(d)}}function pa(e,t,n,o,r,i=.1){const s=sw(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,u=Math.min(a,l),c=en(u,o,r),d=e.x+e.width/2,h=e.y+e.height/2,f=t/2-d*c,p=n/2-h*c,v=aw(e,f,p,c,t,n),y={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:f-y.left+y.right,y:p-y.top+y.bottom,zoom:c}}function lw(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function zu(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:zu(n,t):!1}function oo(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function ma(e){const t=e.ctrlKey&&sr()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function ga(e,t,n){return e<t?en(Math.abs(e-t),1,t)/t:e>n?-en(Math.abs(e-n),1,t)/t:0}function Fu(e,t,n=15,o=40){const r=ga(e.x,o,t.width-o)*n,i=ga(e.y,o,t.height-o)*n;return[r,i]}function qr(e,t){if(t){const n=e.position.x+e.dimensions.width-t.dimensions.width,o=e.position.y+e.dimensions.height-t.dimensions.height;if(n>0||o>0||e.position.x<0||e.position.y<0){let r={};if(typeof t.style=="function"?r={...t.style(t)}:t.style&&(r={...t.style}),r.width=r.width??`${t.dimensions.width}px`,r.height=r.height??`${t.dimensions.height}px`,n>0)if(typeof r.width=="string"){const i=Number(r.width.replace("px",""));r.width=`${i+n}px`}else r.width+=n;if(o>0)if(typeof r.height=="string"){const i=Number(r.height.replace("px",""));r.height=`${i+o}px`}else r.height+=o;if(e.position.x<0){const i=Math.abs(e.position.x);if(t.position.x=t.position.x-i,typeof r.width=="string"){const s=Number(r.width.replace("px",""));r.width=`${s+i}px`}else r.width+=i;e.position.x=0}if(e.position.y<0){const i=Math.abs(e.position.y);if(t.position.y=t.position.y-i,typeof r.height=="string"){const s=Number(r.height.replace("px",""));r.height=`${s+i}px`}else r.height+=i;e.position.y=0}t.dimensions.width=Number(r.width.toString().replace("px","")),t.dimensions.height=Number(r.height.toString().replace("px","")),typeof t.style=="function"?t.style=i=>{const s=t.style;return{...s(i),...r}}:t.style={...t.style,...r}}}}function va(e,t){var n,o;const r=e.filter(s=>s.type==="add"||s.type==="remove");for(const s of r)if(s.type==="add")t.findIndex(l=>l.id===s.item.id)===-1&&t.push(s.item);else if(s.type==="remove"){const a=t.findIndex(l=>l.id===s.id);a!==-1&&t.splice(a,1)}const i=t.map(s=>s.id);for(const s of t)for(const a of e)if(a.id===s.id)switch(a.type){case"select":s.selected=a.selected;break;case"position":if(Vn(s)&&(typeof a.position<"u"&&(s.position=a.position),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&s.parentNode)){const l=t[i.indexOf(s.parentNode)];l&&Vn(l)&&qr(s,l)}break;case"dimensions":if(Vn(s)&&(typeof a.dimensions<"u"&&(s.dimensions=a.dimensions),typeof a.updateStyle<"u"&&a.updateStyle&&(s.style={...s.style||{},width:`${(n=a.dimensions)==null?void 0:n.width}px`,height:`${(o=a.dimensions)==null?void 0:o.height}px`}),typeof a.resizing<"u"&&(s.resizing=a.resizing),s.expandParent&&s.parentNode)){const l=t[i.indexOf(s.parentNode)];l&&Vn(l)&&(!!l.dimensions.width&&!!l.dimensions.height?qr(s,l):Nt(()=>{qr(s,l)}))}break}return t}function Mt(e,t){return{id:e,type:"select",selected:t}}function _a(e){return{item:e,type:"add"}}function ya(e){return{id:e,type:"remove"}}function wa(e,t,n,o,r){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:r||null,type:"remove"}}function $t(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const s=t.has(r);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),o.push(Mt(i.id,s)))}return o}const ba=()=>{};function ae(e){const t=new Set;let n=ba,o=()=>!1;const r=()=>t.size>0||o(),i=h=>{n=h},s=()=>{n=ba},a=h=>{o=h},l=()=>{o=()=>!1},u=h=>{t.delete(h)};return{on:h=>{t.add(h);const f=()=>u(h);return Kn(f),{off:f}},off:u,trigger:h=>{const f=[n];return r()?f.push(...t):e&&f.push(e),Promise.allSettled(f.map(p=>p(h)))},hasListeners:r,listeners:t,setEmitter:i,removeEmitter:s,setHasEmitListeners:a,removeHasEmitListeners:l}}function Ea(e,t,n){let o=e;do{if(o&&o.matches(t))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function uw(e,t,n,o){var r,i;const s=new Map;for(const[a,l]of e)(l.selected||l.id===o)&&(!l.parentNode||!zu(l,e))&&(l.draggable||t&&typeof l.draggable>"u")&&e.get(a)&&s.set(a,{id:l.id,position:l.position||{x:0,y:0},distance:{x:n.x-((r=l.computedPosition)==null?void 0:r.x)||0,y:n.y-((i=l.computedPosition)==null?void 0:i.y)||0},from:{x:l.computedPosition.x,y:l.computedPosition.y},extent:l.extent,parentNode:l.parentNode,dimensions:{...l.dimensions},expandParent:l.expandParent});return Array.from(s.values())}function Wr({id:e,dragItems:t,findNode:n}){const o=[];for(const r of t){const i=n(r.id);i&&o.push(i)}return[e?o.find(r=>r.id===e):o[0],o]}function Hu(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function cw(e,t,n){const[o,r,i,s]=typeof e!="string"?Hu(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+s,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-r,n.computedPosition.y+n.dimensions.height-i]]:!1}function dw(e,t,n,o){let r=e.extent||n;if((r==="parent"||!Array.isArray(r)&&r?.range==="parent")&&!e.expandParent)if(e.parentNode&&o&&e.dimensions.width&&e.dimensions.height){const i=cw(r,e,o);i&&(r=i)}else t(new Ge(Be.NODE_EXTENT_INVALID,e.id)),r=n;else if(Array.isArray(r)){const i=o?.computedPosition.x||0,s=o?.computedPosition.y||0;r=[[r[0][0]+i,r[0][1]+s],[r[1][0]+i,r[1][1]+s]]}else if(r!=="parent"&&r?.range&&Array.isArray(r.range)){const[i,s,a,l]=Hu(r.padding),u=o?.computedPosition.x||0,c=o?.computedPosition.y||0;r=[[r.range[0][0]+u+l,r.range[0][1]+c+i],[r.range[1][0]+u-s,r.range[1][1]+c-a]]}return r==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:r}function fw({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function ss(e,t,n,o,r){const i=fw(e.dimensions,dw(e,n,o,r)),s=Iu(t,i);return{position:{x:s.x-(r?.computedPosition.x||0),y:s.y-(r?.computedPosition.y||0)},computedPosition:s}}function kn(e,t,n=de.Left,o=!1){const r=(t?.x??0)+e.computedPosition.x,i=(t?.y??0)+e.computedPosition.y,{width:s,height:a}=t??gw(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case de.Top:return{x:r+s/2,y:i};case de.Right:return{x:r+s,y:i+a/2};case de.Bottom:return{x:r+s/2,y:i+a};case de.Left:return{x:r,y:i+a/2}}}function xa(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function hw({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:r,targetHeight:i,width:s,height:a,viewport:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+r),y2:Math.max(e.y+o,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=Mu({x:(0-l.x)/l.zoom,y:(0-l.y)/l.zoom,width:s/l.zoom,height:a/l.zoom}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),h=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*h)>0}function pw(e,t,n=!1){const o=typeof e.zIndex=="number";let r=o?e.zIndex:0;const i=t(e.source),s=t(e.target);return!i||!s?0:(n&&(r=o?e.zIndex:Math.max(i.computedPosition.z||0,s.computedPosition.z||0)),r)}var Be=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(Be||{});const ka={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:e=>`Node is invalid
|
|
19
|
+
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
|
|
20
|
+
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
|
|
21
|
+
Node: ${e}
|
|
22
|
+
Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
|
|
23
|
+
Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
|
|
24
|
+
Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
|
|
25
|
+
Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
|
|
26
|
+
Edge: ${e}
|
|
27
|
+
Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
|
|
28
|
+
Edge: ${e}
|
|
29
|
+
Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
|
|
30
|
+
Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
|
|
31
|
+
Edge: ${e}
|
|
32
|
+
Source: ${t}
|
|
33
|
+
Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
|
|
34
|
+
Edge: ${e}
|
|
35
|
+
Source: ${t}
|
|
36
|
+
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
|
37
|
+
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
|
|
38
|
+
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Ge extends Error{constructor(t,...n){var o;super((o=ka[t])==null?void 0:o.call(ka,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function as(e){return"clientX"in e}function mw(e){return"sourceEvent"in e}function _t(e,t){const n=as(e);let o,r;return n?(o=e.clientX,r=e.clientY):"touches"in e&&e.touches.length>0?(o=e.touches[0].clientX,r=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(o=e.changedTouches[0].clientX,r=e.changedTouches[0].clientY):(o=0,r=0),{x:o-(t?.left??0),y:r-(t?.top??0)}}const sr=()=>{var e;return typeof navigator<"u"&&((e=navigator?.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function gw(e){var t,n;return{width:((t=e.dimensions)==null?void 0:t.width)??e.width??0,height:((n=e.dimensions)==null?void 0:n.height)??e.height??0}}function Sr(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const vw=()=>!0;function Ur(e){e?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function _w(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())ir(r,rr(i))>0&&o.push(i);return o}const yw=250;function ww(e,t,n,o){var r,i;let s=[],a=Number.POSITIVE_INFINITY;const l=_w(e,n,t+yw);for(const u of l){const c=[...((r=u.handleBounds)==null?void 0:r.source)??[],...((i=u.handleBounds)==null?void 0:i.target)??[]];for(const d of c){if(o.nodeId===d.nodeId&&o.type===d.type&&o.id===d.id)continue;const{x:h,y:f}=kn(u,d,d.position,!0),p=Math.sqrt((h-e.x)**2+(f-e.y)**2);p>t||(p<a?(s=[{...d,x:h,y:f}],a=p):p===a&&s.push({...d,x:h,y:f}))}}if(!s.length)return null;if(s.length>1){const u=o.type==="source"?"target":"source";return s.find(c=>c.type===u)??s[0]}return s[0]}function Sa(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:u=vw},c,d,h,f){const p=i==="target",v=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:y,y:_}=_t(e),b=s.elementFromPoint(y,_),m=b?.classList.contains(`${a}-flow__handle`)?b:v,w={handleDomNode:m,isValid:!1,connection:null,toHandle:null};if(m){const A=Gu(void 0,m),D=m.getAttribute("data-nodeid"),z=m.getAttribute("data-handleid"),G=m.classList.contains("connectable"),Z=m.classList.contains("connectableend");if(!D||!A)return w;const N={source:p?D:o,sourceHandle:p?z:r,target:p?o:D,targetHandle:p?r:z};w.connection=N;const E=G&&Z&&(n===Ht.Strict?p&&A==="source"||!p&&A==="target":D!==o||z!==r);w.isValid=E&&u(N,{nodes:d,edges:c,sourceNode:h(N.source),targetNode:h(N.target)}),w.toHandle=ju(D,A,z,f,n,!0)}return w}function Gu(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function bw(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Ew(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function ju(e,t,n,o,r,i=!1){var s,a,l;const u=o.get(e);if(!u)return null;const c=r===Ht.Strict?(s=u.handleBounds)==null?void 0:s[t]:[...((a=u.handleBounds)==null?void 0:a.source)??[],...((l=u.handleBounds)==null?void 0:l.target)??[]],d=(n?c?.find(h=>h.id===n):c?.[0])??null;return d&&i?{...d,...kn(u,d,d.position,!0)}:d}const Ti={[de.Left]:de.Right,[de.Right]:de.Left,[de.Top]:de.Bottom,[de.Bottom]:de.Top},xw=["production","prod"];function uo(e,...t){qu()&&console.warn(`[Vue Flow]: ${e}`,...t)}function qu(){return!xw.includes("production")}function Ca(e,t,n,o,r){const i=t.querySelectorAll(`.vue-flow__handle.${e}`);return i?.length?Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...kr(s)}}):null}function Pi(e,t,n,o,r,i=!1,s){r.value=!1,e.selected?(i||e.selected&&t)&&(o([e]),Nt(()=>{s.blur()})):n([e])}function $e(e){return typeof C(e)<"u"}function kw(e,t,n,o){if(!e||!e.source||!e.target)return n(new Ge(Be.EDGE_INVALID,e?.id??"[ID UNKNOWN]")),!1;let r;return Gt(e)?r=e:r={...e,id:Du(e)},r=Ru(r,void 0,o),ow(r,t)?!1:r}function Sw(e,t,n,o,r){if(!t.source||!t.target)return r(new Ge(Be.EDGE_INVALID,e.id)),!1;if(!n)return r(new Ge(Be.EDGE_NOT_FOUND,e.id)),!1;const{id:i,...s}=e;return{...s,id:o?Du(t):i,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function Ta(e,t,n){const o={},r=[];for(let i=0;i<e.length;++i){const s=e[i];if(!Kt(s)){n(new Ge(Be.NODE_INVALID,s?.id)||`[ID UNKNOWN|INDEX ${i}]`);continue}const a=ew(s,t(s.id),s.parentNode);s.parentNode&&(o[s.parentNode]=!0),r[i]=a}for(const i of r){const s=t(i.parentNode)||r.find(a=>a.id===i.parentNode);i.parentNode&&!s&&n(new Ge(Be.NODE_MISSING_PARENT,i.id,i.parentNode)),(i.parentNode||o[i.id])&&(o[i.id]&&(i.isParent=!0),s&&(s.isParent=!0))}return r}function Pa(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),i){s=`${r}-${e}-${i}`;const u=o.get(s)||new Map;o.set(s,u.set(n,t))}}function Yr(e,t,n){e.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},u=`${r}-${s}--${i}-${a}`,c=`${i}-${a}--${r}-${s}`;Pa("source",l,c,e,r,s),Pa("target",l,u,e,i,a)}}function Aa(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Xr(e,t,n,o,r,i,s,a){const l=[];for(const u of e){const c=Gt(u)?u:kw(u,a,r,i);if(!c)continue;const d=n(c.source),h=n(c.target);if(!d||!h){r(new Ge(Be.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!d){r(new Ge(Be.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!h){r(new Ge(Be.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:a,nodes:s,sourceNode:d,targetNode:h})){r(new Ge(Be.EDGE_INVALID,c.id));continue}const f=o(c.id);l.push({...Ru(c,f,i),sourceNode:d,targetNode:h})}return l}const Na=Symbol("vueFlow"),Wu=Symbol("nodeId"),Uu=Symbol("nodeRef"),Cw=Symbol("edgeId"),Tw=Symbol("edgeRef"),Cr=Symbol("slots");function Yu(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:r,nodeLookup:i,nodeExtent:s,nodeDragThreshold:a,viewport:l,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:d,panBy:h,findNode:f,multiSelectionActive:p,nodesSelectionActive:v,selectNodesOnDrag:y,removeSelectedElements:_,addSelectedNodes:b,updateNodePositions:m,emits:w}=Le(),{onStart:A,onDrag:D,onStop:z,onClick:G,el:Z,disabled:N,id:T,selectable:E,dragHandle:P}=e,g=Tt(!1);let O=[],k,R=null,M={x:void 0,y:void 0},H={x:0,y:0},j=null,U=!1,J=!1,te=0,$=!1;const x=Nw(),L=({x:ue,y:ye})=>{M={x:ue,y:ye};let V=!1;if(O=O.map(I=>{const F={x:ue-I.distance.x,y:ye-I.distance.y},{computedPosition:X}=ss(I,n.value?Sr(F,o.value):F,w.error,s.value,I.parentNode?f(I.parentNode):void 0);return V=V||I.position.x!==X.x||I.position.y!==X.y,I.position=X,I}),J=J||V,!!V&&(m(O,!0,!0),g.value=!0,j)){const[I,F]=Wr({id:T,dragItems:O,findNode:f});D({event:j,node:I,nodes:F})}},B=()=>{if(!R)return;const[ue,ye]=Fu(H,R,c.value);if(ue!==0||ye!==0){const V={x:(M.x??0)-ue/l.value.zoom,y:(M.y??0)-ye/l.value.zoom};h({x:ue,y:ye})&&L(V)}te=requestAnimationFrame(B)},Y=(ue,ye)=>{U=!0;const V=f(T);!y.value&&!p.value&&V&&(V.selected||_()),V&&Ce(E)&&y.value&&Pi(V,p.value,b,_,v,!1,ye);const I=x(ue.sourceEvent);if(M=I,O=uw(i.value,d.value,I,T),O.length){const[F,X]=Wr({id:T,dragItems:O,findNode:f});A({event:ue.sourceEvent,node:F,nodes:X})}},Q=(ue,ye)=>{var V;ue.sourceEvent.type==="touchmove"&&ue.sourceEvent.touches.length>1||(J=!1,a.value===0&&Y(ue,ye),M=x(ue.sourceEvent),R=((V=t.value)==null?void 0:V.getBoundingClientRect())||null,H=_t(ue.sourceEvent,R))},ne=(ue,ye)=>{const V=x(ue.sourceEvent);if(!$&&U&&u.value&&($=!0,B()),!U){const I=V.xSnapped-(M.x??0),F=V.ySnapped-(M.y??0);Math.sqrt(I*I+F*F)>a.value&&Y(ue,ye)}(M.x!==V.xSnapped||M.y!==V.ySnapped)&&O.length&&U&&(j=ue.sourceEvent,H=_t(ue.sourceEvent,R),L(V))},se=ue=>{let ye=!1;if(!U&&!g.value&&!p.value){const V=ue.sourceEvent,I=x(V),F=I.xSnapped-(M.x??0),X=I.ySnapped-(M.y??0),W=Math.sqrt(F*F+X*X);W!==0&&W<=a.value&&(G?.(V),ye=!0)}if(O.length&&!ye){J&&(m(O,!1,!1),J=!1);const[V,I]=Wr({id:T,dragItems:O,findNode:f});z({event:ue.sourceEvent,node:V,nodes:I})}O=[],g.value=!1,$=!1,U=!1,M={x:void 0,y:void 0},cancelAnimationFrame(te)};return xe([()=>Ce(N),Z],([ue,ye],V,I)=>{if(ye){const F=st(ye);ue||(k=Q_().on("start",X=>Q(X,ye)).on("drag",X=>ne(X,ye)).on("end",X=>se(X)).filter(X=>{const W=X.target,le=Ce(P);return!X.button&&(!r.value||!Ea(W,`.${r.value}`,ye)&&(!le||Ea(W,le,ye)))}),F.call(k)),I(()=>{F.on(".drag",null),k&&(k.on("start",null),k.on("drag",null),k.on("end",null))})}}),g}function Pw(){return{doubleClick:ae(),click:ae(),mouseEnter:ae(),mouseMove:ae(),mouseLeave:ae(),contextMenu:ae(),updateStart:ae(),update:ae(),updateEnd:ae()}}function Aw(e,t){const n=Pw();return n.doubleClick.on(o=>{var r,i;t.edgeDoubleClick(o),(i=(r=e.events)==null?void 0:r.doubleClick)==null||i.call(r,o)}),n.click.on(o=>{var r,i;t.edgeClick(o),(i=(r=e.events)==null?void 0:r.click)==null||i.call(r,o)}),n.mouseEnter.on(o=>{var r,i;t.edgeMouseEnter(o),(i=(r=e.events)==null?void 0:r.mouseEnter)==null||i.call(r,o)}),n.mouseMove.on(o=>{var r,i;t.edgeMouseMove(o),(i=(r=e.events)==null?void 0:r.mouseMove)==null||i.call(r,o)}),n.mouseLeave.on(o=>{var r,i;t.edgeMouseLeave(o),(i=(r=e.events)==null?void 0:r.mouseLeave)==null||i.call(r,o)}),n.contextMenu.on(o=>{var r,i;t.edgeContextMenu(o),(i=(r=e.events)==null?void 0:r.contextMenu)==null||i.call(r,o)}),n.updateStart.on(o=>{var r,i;t.edgeUpdateStart(o),(i=(r=e.events)==null?void 0:r.updateStart)==null||i.call(r,o)}),n.update.on(o=>{var r,i;t.edgeUpdate(o),(i=(r=e.events)==null?void 0:r.update)==null||i.call(r,o)}),n.updateEnd.on(o=>{var r,i;t.edgeUpdateEnd(o),(i=(r=e.events)==null?void 0:r.updateEnd)==null||i.call(r,o)}),Object.entries(n).reduce((o,[r,i])=>(o.emit[r]=i.trigger,o.on[r]=i.on,o),{emit:{},on:{}})}function Nw(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=Le();return r=>{var i;const s=((i=o.value)==null?void 0:i.getBoundingClientRect())??{left:0,top:0},a=mw(r)?r.sourceEvent:r,{x:l,y:u}=_t(a,s),c=no({x:l,y:u},e.value),{x:d,y:h}=n.value?Sr(c,t.value):c;return{xSnapped:d,ySnapped:h,...c}}}function Eo(){return!0}function Xu({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:r,onEdgeUpdate:i,onEdgeUpdateEnd:s}){const{id:a,vueFlowRef:l,connectionMode:u,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:h,nodesConnectable:f,autoPanOnConnect:p,autoPanSpeed:v,findNode:y,panBy:_,startConnection:b,updateConnection:m,endConnection:w,emits:A,viewport:D,edges:z,nodes:G,isValidConnection:Z,nodeLookup:N}=Le();let T=null,E=!1,P=null;function g(k){var R;const M=Ce(n)==="target",H=as(k),j=ha(k.target),U=k.currentTarget;if(U&&(H&&k.button===0||!H)){let J=function(he){V=_t(he,se),L=ww(no(V,D.value,!1,[1,1]),c.value,N.value,X),I||(F(),I=!0);const we=Sa(he,{handle:L,connectionMode:u.value,fromNodeId:Ce(t),fromHandleId:Ce(e),fromType:M?"target":"source",isValidConnection:x,doc:j,lib:"vue",flowId:a,nodeLookup:N.value},z.value,G.value,y,N.value);P=we.handleDomNode,T=we.connection,E=Ew(!!L,we.isValid);const Se={...ge,isValid:E,to:we.toHandle&&E?to({x:we.toHandle.x,y:we.toHandle.y},D.value):V,toHandle:we.toHandle,toPosition:E&&we.toHandle?we.toHandle.position:Ti[X.position],toNode:we.toHandle?N.value.get(we.toHandle.nodeId):null};if(E&&L&&ge?.toHandle&&Se.toHandle&&ge.toHandle.type===Se.toHandle.type&&ge.toHandle.nodeId===Se.toHandle.nodeId&&ge.toHandle.id===Se.toHandle.id&&ge.to.x===Se.to.x&&ge.to.y===Se.to.y)return;const Te=L??we.toHandle;if(m(Te&&E?to({x:Te.x,y:Te.y},D.value):V,Te,bw(!!Te,E)),ge=Se,!L&&!E&&!P)return Ur(ye);T&&T.source!==T.target&&P&&(Ur(ye),ye=P,P.classList.add("connecting","vue-flow__handle-connecting"),P.classList.toggle("valid",!!E),P.classList.toggle("vue-flow__handle-valid",!!E))},te=function(he){"touches"in he&&he.touches.length>0||((L||P)&&T&&E&&(i?i(he,T):A.connect(T)),A.connectEnd(he),r&&s?.(he),Ur(ye),cancelAnimationFrame(B),w(he),I=!1,E=!1,T=null,P=null,j.removeEventListener("mousemove",J),j.removeEventListener("mouseup",te),j.removeEventListener("touchmove",J),j.removeEventListener("touchend",te))};const $=y(Ce(t));let x=Ce(o)||Z.value||Eo;!x&&$&&(x=(M?$.isValidSourcePos:$.isValidTargetPos)||Eo);let L,B=0;const{x:Y,y:Q}=_t(k),ne=Gu(Ce(r),U),se=(R=l.value)==null?void 0:R.getBoundingClientRect();if(!se||!ne)return;const ue=ju(Ce(t),ne,Ce(e),N.value,u.value);if(!ue)return;let ye,V=_t(k,se),I=!1;const F=()=>{if(!p.value)return;const[he,we]=Fu(V,se,v.value);_({x:he,y:we}),B=requestAnimationFrame(F)},X={...ue,nodeId:Ce(t),type:ne,position:ue.position},W=N.value.get(Ce(t)),ce={inProgress:!0,isValid:null,from:kn(W,X,de.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:W,to:V,toHandle:null,toPosition:Ti[X.position],toNode:null};b({nodeId:Ce(t),id:Ce(e),type:ne,position:U?.getAttribute("data-handlepos")||de.Top,...V},{x:Y-se.left,y:Q-se.top}),A.connectStart({event:k,nodeId:Ce(t),handleId:Ce(e),handleType:ne});let ge=ce;j.addEventListener("mousemove",J),j.addEventListener("mouseup",te),j.addEventListener("touchmove",J),j.addEventListener("touchend",te)}}function O(k){var R,M;if(!d.value)return;const H=Ce(n)==="target";if(!h.value){A.clickConnectStart({event:k,nodeId:Ce(t),handleId:Ce(e)}),b({nodeId:Ce(t),type:Ce(n),id:Ce(e),position:de.Top,..._t(k)},void 0,!0);return}let j=Ce(o)||Z.value||Eo;const U=y(Ce(t));if(!j&&U&&(j=(H?U.isValidSourcePos:U.isValidTargetPos)||Eo),U&&(typeof U.connectable>"u"?f.value:U.connectable)===!1)return;const J=ha(k.target),te=Sa(k,{handle:{nodeId:Ce(t),id:Ce(e),type:Ce(n),position:de.Top,..._t(k)},connectionMode:u.value,fromNodeId:h.value.nodeId,fromHandleId:h.value.id??null,fromType:h.value.type,isValidConnection:j,doc:J,lib:"vue",flowId:a,nodeLookup:N.value},z.value,G.value,y,N.value),$=((R=te.connection)==null?void 0:R.source)===((M=te.connection)==null?void 0:M.target);te.isValid&&te.connection&&!$&&A.connect(te.connection),A.clickConnectEnd(k),w(k,!0)}return{handlePointerDown:g,handleClick:O}}function Ow(){return Cn(Wu,"")}function Ku(e){const t=e??Ow()??"",n=Cn(Uu,fe(null)),{findNode:o,edges:r,emits:i}=Le(),s=o(t);return s||i.error(new Ge(Be.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:oe(()=>o(s.parentNode)),connectedEdges:oe(()=>Bu([s],r.value))}}function Iw(){return{doubleClick:ae(),click:ae(),mouseEnter:ae(),mouseMove:ae(),mouseLeave:ae(),contextMenu:ae(),dragStart:ae(),drag:ae(),dragStop:ae()}}function Rw(e,t){const n=Iw();return n.doubleClick.on(o=>{var r,i;t.nodeDoubleClick(o),(i=(r=e.events)==null?void 0:r.doubleClick)==null||i.call(r,o)}),n.click.on(o=>{var r,i;t.nodeClick(o),(i=(r=e.events)==null?void 0:r.click)==null||i.call(r,o)}),n.mouseEnter.on(o=>{var r,i;t.nodeMouseEnter(o),(i=(r=e.events)==null?void 0:r.mouseEnter)==null||i.call(r,o)}),n.mouseMove.on(o=>{var r,i;t.nodeMouseMove(o),(i=(r=e.events)==null?void 0:r.mouseMove)==null||i.call(r,o)}),n.mouseLeave.on(o=>{var r,i;t.nodeMouseLeave(o),(i=(r=e.events)==null?void 0:r.mouseLeave)==null||i.call(r,o)}),n.contextMenu.on(o=>{var r,i;t.nodeContextMenu(o),(i=(r=e.events)==null?void 0:r.contextMenu)==null||i.call(r,o)}),n.dragStart.on(o=>{var r,i;t.nodeDragStart(o),(i=(r=e.events)==null?void 0:r.dragStart)==null||i.call(r,o)}),n.drag.on(o=>{var r,i;t.nodeDrag(o),(i=(r=e.events)==null?void 0:r.drag)==null||i.call(r,o)}),n.dragStop.on(o=>{var r,i;t.nodeDragStop(o),(i=(r=e.events)==null?void 0:r.dragStop)==null||i.call(r,o)}),Object.entries(n).reduce((o,[r,i])=>(o.emit[r]=i.trigger,o.on[r]=i.on,o),{emit:{},on:{}})}function Zu(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:r,snapToGrid:i,nodesDraggable:s,emits:a}=Le();return(l,u=!1)=>{const c=i.value?r.value[0]:5,d=i.value?r.value[1]:5,h=u?4:1,f=l.x*c*h,p=l.y*d*h,v=[];for(const y of e.value)if(y.draggable||s&&typeof y.draggable>"u"){const _={x:y.computedPosition.x+f,y:y.computedPosition.y+p},{position:b}=ss(y,_,a.error,t.value,y.parentNode?o(y.parentNode):void 0);v.push({id:y.id,position:b,from:y.position,distance:{x:l.x,y:l.y},dimensions:y.dimensions})}n(v,!0,!1)}}const xo=.1,Lw=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function Dt(){return uo("Viewport not initialized yet."),Promise.resolve(!1)}const Dw={zoomIn:Dt,zoomOut:Dt,zoomTo:Dt,fitView:Dt,setCenter:Dt,fitBounds:Dt,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:Dt,setTransform:Dt,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Mw(e){function t(o,r){return new Promise(i=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(r?.interpolate==="linear"?Hn:No).scaleBy(Kr(e.d3Selection,r?.duration,r?.ease,()=>{i(!0)}),o):i(!1)})}function n(o,r,i,s){return new Promise(a=>{var l;const{x:u,y:c}=Iu({x:-o,y:-r},e.translateExtent),d=xn.translate(-u,-c).scale(i);e.d3Selection&&e.d3Zoom?(l=e.d3Zoom)==null||l.interpolate(s?.interpolate==="linear"?Hn:No).transform(Kr(e.d3Selection,s?.duration,s?.ease,()=>{a(!0)}),d):a(!1)})}return oe(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:r=>t(1.2,r),zoomOut:r=>t(1/1.2,r),zoomTo:(r,i)=>new Promise(s=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(i?.interpolate==="linear"?Hn:No).scaleTo(Kr(e.d3Selection,i?.duration,i?.ease,()=>{s(!0)}),r):s(!1)}),setViewport:(r,i)=>n(r.x,r.y,r.zoom,i),setTransform:(r,i)=>n(r.x,r.y,r.zoom,i),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(r={padding:xo,includeHiddenNodes:!1,duration:0})=>{var i,s;const a=[];for(const h of e.nodes)h.dimensions.width&&h.dimensions.height&&(r?.includeHiddenNodes||!h.hidden)&&(!((i=r.nodes)!=null&&i.length)||(s=r.nodes)!=null&&s.length&&r.nodes.includes(h.id))&&a.push(h);if(!a.length)return Promise.resolve(!1);const l=$u(a),{x:u,y:c,zoom:d}=pa(l,e.dimensions.width,e.dimensions.height,r.minZoom??e.minZoom,r.maxZoom??e.maxZoom,r.padding??xo);return n(u,c,d,r)},setCenter:(r,i,s)=>{const a=typeof s?.zoom<"u"?s.zoom:e.maxZoom,l=e.dimensions.width/2-r*a,u=e.dimensions.height/2-i*a;return n(l,u,a,s)},fitBounds:(r,i={padding:xo})=>{const{x:s,y:a,zoom:l}=pa(r,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,i.padding??xo);return n(s,a,l,i)},project:r=>no(r,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:r=>{if(e.vueFlowRef){const{x:i,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:r.x-i,y:r.y-s};return no(a,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:r=>{if(e.vueFlowRef){const{x:i,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:r.x+i,y:r.y+s};return to(a,e.viewport)}return{x:0,y:0}}}:Dw)}function Kr(e,t=0,n=Lw,o=()=>{}){const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e}function $w(e,t,n){const o=Ya(!0);return o.run(()=>{const r=()=>{o.run(()=>{let v,y,_=!!(n.nodes.value.length||n.edges.value.length);v=rn([e.modelValue,()=>{var b,m;return(m=(b=e.modelValue)==null?void 0:b.value)==null?void 0:m.length}],([b])=>{b&&Array.isArray(b)&&(y?.pause(),n.setElements(b),!y&&!_&&b.length?_=!0:y?.resume())}),y=rn([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([b,m])=>{var w;(w=e.modelValue)!=null&&w.value&&Array.isArray(e.modelValue.value)&&(v?.pause(),e.modelValue.value=[...b,...m],Nt(()=>{v?.resume()}))},{immediate:_}),Bn(()=>{v?.stop(),y?.stop()})})},i=()=>{o.run(()=>{let v,y,_=!!n.nodes.value.length;v=rn([e.nodes,()=>{var b,m;return(m=(b=e.nodes)==null?void 0:b.value)==null?void 0:m.length}],([b])=>{b&&Array.isArray(b)&&(y?.pause(),n.setNodes(b),!y&&!_&&b.length?_=!0:y?.resume())}),y=rn([n.nodes,()=>n.nodes.value.length],([b])=>{var m;(m=e.nodes)!=null&&m.value&&Array.isArray(e.nodes.value)&&(v?.pause(),e.nodes.value=[...b],Nt(()=>{v?.resume()}))},{immediate:_}),Bn(()=>{v?.stop(),y?.stop()})})},s=()=>{o.run(()=>{let v,y,_=!!n.edges.value.length;v=rn([e.edges,()=>{var b,m;return(m=(b=e.edges)==null?void 0:b.value)==null?void 0:m.length}],([b])=>{b&&Array.isArray(b)&&(y?.pause(),n.setEdges(b),!y&&!_&&b.length?_=!0:y?.resume())}),y=rn([n.edges,()=>n.edges.value.length],([b])=>{var m;(m=e.edges)!=null&&m.value&&Array.isArray(e.edges.value)&&(v?.pause(),e.edges.value=[...b],Nt(()=>{v?.resume()}))},{immediate:_}),Bn(()=>{v?.stop(),y?.stop()})})},a=()=>{o.run(()=>{xe(()=>t.maxZoom,()=>{t.maxZoom&&$e(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{xe(()=>t.minZoom,()=>{t.minZoom&&$e(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{xe(()=>t.translateExtent,()=>{t.translateExtent&&$e(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{xe(()=>t.nodeExtent,()=>{t.nodeExtent&&$e(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{xe(()=>t.applyDefault,()=>{$e(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const v=async y=>{let _=y;typeof t.autoConnect=="function"&&(_=await t.autoConnect(y)),_!==!1&&n.addEdges([_])};xe(()=>t.autoConnect,()=>{$e(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),xe(n.autoConnect,(y,_,b)=>{y?n.onConnect(v):n.hooks.value.connect.off(v),b(()=>{n.hooks.value.connect.off(v)})},{immediate:!0})})},f=()=>{const v=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const y of Object.keys(t)){const _=y;if(!v.includes(_)){const b=Oe(()=>t[_]),m=n[_];Oi(m)&&o.run(()=>{xe(b,w=>{$e(w)&&(m.value=w)},{immediate:!0})})}}};r(),i(),s(),l(),a(),u(),c(),d(),h(),f()}),()=>o.stop()}function Vw(){return{edgesChange:ae(),nodesChange:ae(),nodeDoubleClick:ae(),nodeClick:ae(),nodeMouseEnter:ae(),nodeMouseMove:ae(),nodeMouseLeave:ae(),nodeContextMenu:ae(),nodeDragStart:ae(),nodeDrag:ae(),nodeDragStop:ae(),nodesInitialized:ae(),miniMapNodeClick:ae(),miniMapNodeDoubleClick:ae(),miniMapNodeMouseEnter:ae(),miniMapNodeMouseMove:ae(),miniMapNodeMouseLeave:ae(),connect:ae(),connectStart:ae(),connectEnd:ae(),clickConnectStart:ae(),clickConnectEnd:ae(),paneReady:ae(),init:ae(),move:ae(),moveStart:ae(),moveEnd:ae(),selectionDragStart:ae(),selectionDrag:ae(),selectionDragStop:ae(),selectionContextMenu:ae(),selectionStart:ae(),selectionEnd:ae(),viewportChangeStart:ae(),viewportChange:ae(),viewportChangeEnd:ae(),paneScroll:ae(),paneClick:ae(),paneContextMenu:ae(),paneMouseEnter:ae(),paneMouseMove:ae(),paneMouseLeave:ae(),edgeContextMenu:ae(),edgeMouseEnter:ae(),edgeMouseMove:ae(),edgeMouseLeave:ae(),edgeDoubleClick:ae(),edgeClick:ae(),edgeUpdateStart:ae(),edgeUpdate:ae(),edgeUpdateEnd:ae(),updateNodeInternals:ae(),error:ae(e=>uo(e.message))}}function Bw(e,t){const n=Tn();xc(()=>{for(const[r,i]of Object.entries(t.value)){const s=a=>{e(r,a)};i.setEmitter(s),Kn(i.removeEmitter),i.setHasEmitListeners(()=>o(r)),Kn(i.removeHasEmitListeners)}});function o(r){var i;const s=zw(r);return!!((i=n?.vnode.props)==null?void 0:i[s])}}function zw(e){const[t,...n]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(r,i)=>i.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function Ju(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:is.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Gn.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:qt.Bezier,style:{}},connectionMode:Ht.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:sr()?"Meta":"Control",zoomActivationKeyCode:sr()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Vw(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const Fw=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function Hw(e,t,n){const o=Mw(e),r=V=>{const I=V??[];e.hooks.updateNodeInternals.trigger(I)},i=V=>nw(V,e.nodes,e.edges),s=V=>tw(V,e.nodes,e.edges),a=V=>Bu(V,e.edges),l=({id:V,type:I,nodeId:F})=>{var X;const W=V?`-${I}-${V}`:`-${I}`;return Array.from(((X=e.connectionLookup.get(`${F}${W}`))==null?void 0:X.values())??[])},u=V=>{if(V)return t.value.get(V)},c=V=>{if(V)return n.value.get(V)},d=(V,I,F)=>{var X,W;const le=[];for(const ce of V){const ge={id:ce.id,type:"position",dragging:F,from:ce.from};if(I&&(ge.position=ce.position,ce.parentNode)){const he=u(ce.parentNode);ge.position={x:ge.position.x-(((X=he?.computedPosition)==null?void 0:X.x)??0),y:ge.position.y-(((W=he?.computedPosition)==null?void 0:W.y)??0)}}le.push(ge)}le?.length&&e.hooks.nodesChange.trigger(le)},h=V=>{if(!e.vueFlowRef)return;const I=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!I)return;const F=window.getComputedStyle(I),{m22:X}=new window.DOMMatrixReadOnly(F.transform),W=[];for(const le of V){const ce=le,ge=u(ce.id);if(ge){const he=kr(ce.nodeElement);if(!!(he.width&&he.height&&(ge.dimensions.width!==he.width||ge.dimensions.height!==he.height||ce.forceUpdate))){const Se=ce.nodeElement.getBoundingClientRect();ge.dimensions=he,ge.handleBounds.source=Ca("source",ce.nodeElement,Se,X,ge.id),ge.handleBounds.target=Ca("target",ce.nodeElement,Se,X,ge.id),W.push({id:ge.id,type:"dimensions",dimensions:he})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),W.length&&e.hooks.nodesChange.trigger(W)},f=(V,I)=>{const F=new Set,X=new Set;for(const ce of V)Kt(ce)?F.add(ce.id):Gt(ce)&&X.add(ce.id);const W=$t(t.value,F,!0),le=$t(n.value,X);if(e.multiSelectionActive){for(const ce of F)W.push(Mt(ce,I));for(const ce of X)le.push(Mt(ce,I))}W.length&&e.hooks.nodesChange.trigger(W),le.length&&e.hooks.edgesChange.trigger(le)},p=V=>{if(e.multiSelectionActive){const I=V.map(F=>Mt(F.id,!0));e.hooks.nodesChange.trigger(I);return}e.hooks.nodesChange.trigger($t(t.value,new Set(V.map(I=>I.id)),!0)),e.hooks.edgesChange.trigger($t(n.value))},v=V=>{if(e.multiSelectionActive){const I=V.map(F=>Mt(F.id,!0));e.hooks.edgesChange.trigger(I);return}e.hooks.edgesChange.trigger($t(n.value,new Set(V.map(I=>I.id)))),e.hooks.nodesChange.trigger($t(t.value,new Set,!0))},y=V=>{f(V,!0)},_=V=>{const F=(V||e.nodes).map(X=>(X.selected=!1,Mt(X.id,!1)));e.hooks.nodesChange.trigger(F)},b=V=>{const F=(V||e.edges).map(X=>(X.selected=!1,Mt(X.id,!1)));e.hooks.edgesChange.trigger(F)},m=V=>{if(!V||!V.length)return f([],!1);const I=V.reduce((F,X)=>{const W=Mt(X.id,!1);return Kt(X)?F.nodes.push(W):F.edges.push(W),F},{nodes:[],edges:[]});I.nodes.length&&e.hooks.nodesChange.trigger(I.nodes),I.edges.length&&e.hooks.edgesChange.trigger(I.edges)},w=V=>{var I;(I=e.d3Zoom)==null||I.scaleExtent([V,e.maxZoom]),e.minZoom=V},A=V=>{var I;(I=e.d3Zoom)==null||I.scaleExtent([e.minZoom,V]),e.maxZoom=V},D=V=>{var I;(I=e.d3Zoom)==null||I.translateExtent(V),e.translateExtent=V},z=V=>{e.nodeExtent=V,r()},G=V=>{var I;(I=e.d3Zoom)==null||I.clickDistance(V)},Z=V=>{e.nodesDraggable=V,e.nodesConnectable=V,e.elementsSelectable=V},N=V=>{const I=V instanceof Function?V(e.nodes):V;!e.initialized&&!I.length||(e.nodes=Ta(I,u,e.hooks.error.trigger))},T=V=>{const I=V instanceof Function?V(e.edges):V;if(!e.initialized&&!I.length)return;const F=Xr(I,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Yr(e.connectionLookup,n.value,F),e.edges=F},E=V=>{const I=V instanceof Function?V([...e.nodes,...e.edges]):V;!e.initialized&&!I.length||(N(I.filter(Kt)),T(I.filter(Gt)))},P=V=>{let I=V instanceof Function?V(e.nodes):V;I=Array.isArray(I)?I:[I];const F=Ta(I,u,e.hooks.error.trigger),X=[];for(const W of F)X.push(_a(W));X.length&&e.hooks.nodesChange.trigger(X)},g=V=>{let I=V instanceof Function?V(e.edges):V;I=Array.isArray(I)?I:[I];const F=Xr(I,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),X=[];for(const W of F)X.push(_a(W));X.length&&e.hooks.edgesChange.trigger(X)},O=(V,I=!0,F=!1)=>{const X=V instanceof Function?V(e.nodes):V,W=Array.isArray(X)?X:[X],le=[],ce=[];function ge(we){const Se=a(we);for(const Te of Se)(!$e(Te.deletable)||Te.deletable)&&ce.push(wa(Te.id,Te.source,Te.target,Te.sourceHandle,Te.targetHandle))}function he(we){const Se=[];for(const Te of e.nodes)Te.parentNode===we&&Se.push(Te);if(Se.length){for(const Te of Se)le.push(ya(Te.id));I&&ge(Se);for(const Te of Se)he(Te.id)}}for(const we of W){const Se=typeof we=="string"?u(we):we;Se&&($e(Se.deletable)&&!Se.deletable||(le.push(ya(Se.id)),I&&ge([Se]),F&&he(Se.id)))}ce.length&&e.hooks.edgesChange.trigger(ce),le.length&&e.hooks.nodesChange.trigger(le)},k=V=>{const I=V instanceof Function?V(e.edges):V,F=Array.isArray(I)?I:[I],X=[];for(const W of F){const le=typeof W=="string"?c(W):W;le&&($e(le.deletable)&&!le.deletable||X.push(wa(typeof W=="string"?W:W.id,le.source,le.target,le.sourceHandle,le.targetHandle)))}e.hooks.edgesChange.trigger(X)},R=(V,I,F=!0)=>{const X=c(V.id);if(!X)return!1;const W=e.edges.indexOf(X),le=Sw(V,I,X,F,e.hooks.error.trigger);if(le){const[ce]=Xr([le],e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((ge,he)=>he===W?ce:ge),Yr(e.connectionLookup,n.value,[ce]),ce}return!1},M=(V,I,F={replace:!1})=>{const X=c(V);if(!X)return;const W=typeof I=="function"?I(X):I;X.data=F.replace?W:{...X.data,...W}},H=V=>va(V,e.nodes),j=V=>{const I=va(V,e.edges);return Yr(e.connectionLookup,n.value,I),I},U=(V,I,F={replace:!1})=>{const X=u(V);if(!X)return;const W=typeof I=="function"?I(X):I;F.replace?e.nodes.splice(e.nodes.indexOf(X),1,W):Object.assign(X,W)},J=(V,I,F={replace:!1})=>{const X=u(V);if(!X)return;const W=typeof I=="function"?I(X):I;X.data=F.replace?W:{...X.data,...W}},te=(V,I,F=!1)=>{F?e.connectionClickStartHandle=V:e.connectionStartHandle=V,e.connectionEndHandle=null,e.connectionStatus=null,I&&(e.connectionPosition=I)},$=(V,I=null,F=null)=>{e.connectionStartHandle&&(e.connectionPosition=V,e.connectionEndHandle=I,e.connectionStatus=F)},x=(V,I)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,I?e.connectionClickStartHandle=null:e.connectionStartHandle=null},L=V=>{const I=Q0(V),F=I?null:Vn(V)?V:u(V.id);return!I&&!F?[null,null,I]:[I?V:rr(F),F,I]},B=(V,I=!0,F=e.nodes)=>{const[X,W,le]=L(V);if(!X)return[];const ce=[];for(const ge of F||e.nodes){if(!le&&(ge.id===W.id||!ge.computedPosition))continue;const he=rr(ge),we=ir(he,X);(I&&we>0||we>=he.width*he.height||we>=Number(X.width)*Number(X.height))&&ce.push(ge)}return ce},Y=(V,I,F=!0)=>{const[X]=L(V);if(!X)return!1;const W=ir(X,I);return F&&W>0||W>=Number(X.width)*Number(X.height)},Q=V=>{const{viewport:I,dimensions:F,d3Zoom:X,d3Selection:W,translateExtent:le}=e;if(!X||!W||!V.x&&!V.y)return!1;const ce=xn.translate(I.x+V.x,I.y+V.y).scale(I.zoom),ge=[[0,0],[F.width,F.height]],he=X.constrain()(ce,ge,le),we=e.viewport.x!==he.x||e.viewport.y!==he.y||e.viewport.zoom!==he.k;return X.transform(W,he),we},ne=V=>{const I=V instanceof Function?V(e):V,F=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];$e(I.defaultEdgeOptions)&&(e.defaultEdgeOptions=I.defaultEdgeOptions);const X=I.modelValue||I.nodes||I.edges?[]:void 0;X&&(I.modelValue&&X.push(...I.modelValue),I.nodes&&X.push(...I.nodes),I.edges&&X.push(...I.edges),E(X));const W=()=>{$e(I.maxZoom)&&A(I.maxZoom),$e(I.minZoom)&&w(I.minZoom),$e(I.translateExtent)&&D(I.translateExtent)};for(const le of Object.keys(I)){const ce=le,ge=I[ce];![...Fw,...F].includes(ce)&&$e(ge)&&(e[ce]=ge)}vi(()=>e.d3Zoom).not.toBeNull().then(W),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:h,setElements:E,setNodes:N,setEdges:T,addNodes:P,addEdges:g,removeNodes:O,removeEdges:k,findNode:u,findEdge:c,updateEdge:R,updateEdgeData:M,updateNode:U,updateNodeData:J,applyEdgeChanges:j,applyNodeChanges:H,addSelectedElements:y,addSelectedNodes:p,addSelectedEdges:v,setMinZoom:w,setMaxZoom:A,setTranslateExtent:D,setNodeExtent:z,setPaneClickDistance:G,removeSelectedElements:m,removeSelectedNodes:_,removeSelectedEdges:b,startConnection:te,updateConnection:$,endConnection:x,setInteractive:Z,setState:ne,getIntersectingNodes:B,getIncomers:i,getOutgoers:s,getConnectedEdges:a,getHandleConnections:l,isNodeIntersecting:Y,panBy:Q,fitView:V=>o.value.fitView(V),zoomIn:V=>o.value.zoomIn(V),zoomOut:V=>o.value.zoomOut(V),zoomTo:(V,I)=>o.value.zoomTo(V,I),setViewport:(V,I)=>o.value.setViewport(V,I),setTransform:(V,I)=>o.value.setTransform(V,I),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(V,I,F)=>o.value.setCenter(V,I,F),fitBounds:(V,I)=>o.value.fitBounds(V,I),project:V=>o.value.project(V),screenToFlowCoordinate:V=>o.value.screenToFlowCoordinate(V),flowToScreenCoordinate:V=>o.value.flowToScreenCoordinate(V),toObject:()=>{const V=[],I=[];for(const F of e.nodes){const{computedPosition:X,handleBounds:W,selected:le,dimensions:ce,isParent:ge,resizing:he,dragging:we,events:Se,...Te}=F;V.push(Te)}for(const F of e.edges){const{selected:X,sourceNode:W,targetNode:le,events:ce,...ge}=F;I.push(ge)}return JSON.parse(JSON.stringify({nodes:V,edges:I,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:V=>new Promise(I=>{const{nodes:F,edges:X,position:W,zoom:le,viewport:ce}=V;F&&N(F),X&&T(X);const[ge,he]=ce?.x&&ce?.y?[ce.x,ce.y]:W??[null,null];if(ge&&he){const we=ce?.zoom||le||e.viewport.zoom;return vi(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:ge,y:he,zoom:we}).then(()=>{I(!0)})})}else I(!0)}),updateNodeInternals:r,viewportHelper:o,$reset:()=>{const V=Ju();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const I=xn.translate(V.defaultViewport.x??0,V.defaultViewport.y??0).scale(en(V.defaultViewport.zoom??1,V.minZoom,V.maxZoom)),F=e.viewportRef.getBoundingClientRect(),X=[[0,0],[F.width,F.height]],W=e.d3Zoom.constrain()(I,X,V.translateExtent);e.d3Zoom.transform(e.d3Selection,W)}ne(V)},$destroy:()=>{}}}const Gw=["data-id","data-handleid","data-nodeid","data-handlepos"],jw={name:"Handle",compatConfig:{MODE:3}},Sn=_e({...jw,props:{id:{default:null},type:{},position:{default:()=>de.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:t}){const n=Tc(e,["position","connectable","connectableStart","connectableEnd","id"]),o=Oe(()=>n.type??"source"),r=Oe(()=>n.isValidConnection??null),{id:i,connectionStartHandle:s,connectionClickStartHandle:a,connectionEndHandle:l,vueFlowRef:u,nodesConnectable:c,noDragClassName:d,noPanClassName:h}=Le(),{id:f,node:p,nodeEl:v,connectedEdges:y}=Ku(),_=fe(),b=Oe(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),m=Oe(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),w=Oe(()=>{var T,E,P,g,O,k;return((T=s.value)==null?void 0:T.nodeId)===f&&((E=s.value)==null?void 0:E.id)===e.id&&((P=s.value)==null?void 0:P.type)===o.value||((g=l.value)==null?void 0:g.nodeId)===f&&((O=l.value)==null?void 0:O.id)===e.id&&((k=l.value)==null?void 0:k.type)===o.value}),A=Oe(()=>{var T,E,P;return((T=a.value)==null?void 0:T.nodeId)===f&&((E=a.value)==null?void 0:E.id)===e.id&&((P=a.value)==null?void 0:P.type)===o.value}),{handlePointerDown:D,handleClick:z}=Xu({nodeId:f,handleId:e.id,isValidConnection:r,type:o}),G=oe(()=>typeof e.connectable=="string"&&e.connectable==="single"?!y.value.some(T=>{const E=T[`${o.value}Handle`];return T[o.value]!==f?!1:E?E===e.id:!0}):typeof e.connectable=="number"?y.value.filter(T=>{const E=T[`${o.value}Handle`];return T[o.value]!==f?!1:E?E===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(p,y.value):$e(e.connectable)?e.connectable:c.value);it(()=>{var T;if(!p.dimensions.width||!p.dimensions.height)return;const E=(T=p.handleBounds[o.value])==null?void 0:T.find(H=>H.id===e.id);if(!u.value||E)return;const P=u.value.querySelector(".vue-flow__transformationpane");if(!v.value||!_.value||!P||!e.id)return;const g=v.value.getBoundingClientRect(),O=_.value.getBoundingClientRect(),k=window.getComputedStyle(P),{m22:R}=new window.DOMMatrixReadOnly(k.transform),M={id:e.id,position:e.position,x:(O.left-g.left)/R,y:(O.top-g.top)/R,type:o.value,nodeId:f,...kr(_.value)};p.handleBounds[o.value]=[...p.handleBounds[o.value]??[],M]});function Z(T){const E=as(T);G.value&&b.value&&(E&&T.button===0||!E)&&D(T)}function N(T){!f||!a.value&&!b.value||G.value&&z(T)}return t({handleClick:z,handlePointerDown:D,onClick:N,onPointerDown:Z}),(T,E)=>(q(),ee("div",{ref_key:"handle",ref:_,"data-id":`${C(i)}-${C(f)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":C(f),"data-handlepos":T.position,class:He(["vue-flow__handle",[`vue-flow__handle-${T.position}`,`vue-flow__handle-${e.id}`,C(d),C(h),o.value,{connectable:G.value,connecting:A.value,connectablestart:b.value,connectableend:m.value,connectionindicator:G.value&&(b.value&&!w.value||m.value&&w.value)}]]),onMousedown:Z,onTouchstartPassive:Z,onClick:N},[ke(T.$slots,"default",{id:T.id})],42,Gw))}}),Tr=function({sourcePosition:e=de.Bottom,targetPosition:t=de.Top,label:n,connectable:o=!0,isValidTargetPos:r,isValidSourcePos:i,data:s}){const a=s.label??n;return[Ae(Sn,{type:"target",position:t,connectable:o,isValidConnection:r}),typeof a!="string"&&a?Ae(a):Ae(Ie,[a]),Ae(Sn,{type:"source",position:e,connectable:o,isValidConnection:i})]};Tr.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Tr.inheritAttrs=!1;Tr.compatConfig={MODE:3};const qw=Tr,Pr=function({targetPosition:e=de.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:r}){const i=r.label??t;return[Ae(Sn,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof i!="string"&&i?Ae(i):Ae(Ie,[i])]};Pr.props=["targetPosition","label","isValidTargetPos","connectable","data"];Pr.inheritAttrs=!1;Pr.compatConfig={MODE:3};const Ww=Pr,Ar=function({sourcePosition:e=de.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:r}){const i=r.label??t;return[typeof i!="string"&&i?Ae(i):Ae(Ie,[i]),Ae(Sn,{type:"source",position:e,connectable:n,isValidConnection:o})]};Ar.props=["sourcePosition","label","isValidSourcePos","connectable","data"];Ar.inheritAttrs=!1;Ar.compatConfig={MODE:3};const Uw=Ar,Yw=["transform"],Xw=["width","height","x","y","rx","ry"],Kw=["y"],Zw={name:"EdgeText",compatConfig:{MODE:3}},Jw=_e({...Zw,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=fe({x:0,y:0,width:0,height:0}),n=fe(null),o=oe(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);it(r),xe([()=>e.x,()=>e.y,n,()=>e.label],r);function r(){if(!n.value)return;const i=n.value.getBBox();(i.width!==t.value.width||i.height!==t.value.height)&&(t.value=i)}return(i,s)=>(q(),ee("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[i.labelShowBg?(q(),ee("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*i.labelBgPadding[0]}px`,height:`${t.value.height+2*i.labelBgPadding[1]}px`,x:-i.labelBgPadding[0],y:-i.labelBgPadding[1],style:Xe(i.labelBgStyle),rx:i.labelBgBorderRadius,ry:i.labelBgBorderRadius},null,12,Xw)):ve("",!0),K("text",tt(i.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:i.labelStyle}),[ke(i.$slots,"default",{},()=>[typeof i.label!="string"?(q(),be(ot(i.label),{key:0})):(q(),ee(Ie,{key:1},[Pe(me(i.label),1)],64))])],16,Kw)],8,Yw))}}),Qw=["id","d","marker-end","marker-start"],eb=["d","stroke-width"],tb={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Nr=_e({...tb,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=fe(null),o=fe(null),r=fe(null),i=Pc();return t({pathEl:n,interactionEl:o,labelEl:r}),(s,a)=>(q(),ee(Ie,null,[K("path",tt(C(i),{id:s.id,ref_key:"pathEl",ref:n,d:s.path,class:"vue-flow__edge-path","marker-end":s.markerEnd,"marker-start":s.markerStart}),null,16,Qw),s.interactionWidth?(q(),ee("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:s.path,"stroke-width":s.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,eb)):ve("",!0),s.label&&s.labelX&&s.labelY?(q(),be(Jw,{key:1,ref_key:"labelEl",ref:r,x:s.labelX,y:s.labelY,label:s.label,"label-show-bg":s.labelShowBg,"label-bg-style":s.labelBgStyle,"label-bg-padding":s.labelBgPadding,"label-bg-border-radius":s.labelBgBorderRadius,"label-style":s.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):ve("",!0)],64))}});function Qu({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[i,a,r,s]}function ec({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+r*.375+s*.375+n*.125,u=t*.125+i*.375+a*.375+o*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}function ko(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Oa({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){let s,a;switch(e){case de.Left:s=t-ko(t-o,i),a=n;break;case de.Right:s=t+ko(o-t,i),a=n;break;case de.Top:s=t,a=n-ko(n-r,i);break;case de.Bottom:s=t,a=n+ko(r-n,i);break}return[s,a]}function tc(e){const{sourceX:t,sourceY:n,sourcePosition:o=de.Bottom,targetX:r,targetY:i,targetPosition:s=de.Top,curvature:a=.25}=e,[l,u]=Oa({pos:o,x1:t,y1:n,x2:r,y2:i,c:a}),[c,d]=Oa({pos:s,x1:r,y1:i,x2:t,y2:n,c:a}),[h,f,p,v]=ec({sourceX:t,sourceY:n,targetX:r,targetY:i,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${t},${n} C${l},${u} ${c},${d} ${r},${i}`,h,f,p,v]}function Ia({pos:e,x1:t,y1:n,x2:o,y2:r}){let i,s;switch(e){case de.Left:case de.Right:i=.5*(t+o),s=n;break;case de.Top:case de.Bottom:i=t,s=.5*(n+r);break}return[i,s]}function nc(e){const{sourceX:t,sourceY:n,sourcePosition:o=de.Bottom,targetX:r,targetY:i,targetPosition:s=de.Top}=e,[a,l]=Ia({pos:o,x1:t,y1:n,x2:r,y2:i}),[u,c]=Ia({pos:s,x1:r,y1:i,x2:t,y2:n}),[d,h,f,p]=ec({sourceX:t,sourceY:n,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${t},${n} C${a},${l} ${u},${c} ${r},${i}`,d,h,f,p]}const Ra={[de.Left]:{x:-1,y:0},[de.Right]:{x:1,y:0},[de.Top]:{x:0,y:-1},[de.Bottom]:{x:0,y:1}};function nb({source:e,sourcePosition:t=de.Bottom,target:n}){return t===de.Left||t===de.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1}}function La(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function ob({source:e,sourcePosition:t=de.Bottom,target:n,targetPosition:o=de.Top,center:r,offset:i}){const s=Ra[t],a=Ra[o],l={x:e.x+s.x*i,y:e.y+s.y*i},u={x:n.x+a.x*i,y:n.y+a.y*i},c=nb({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",h=c[d];let f,p,v;const y={x:0,y:0},_={x:0,y:0},[b,m,w,A]=Qu({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){p=r.x??b,v=r.y??m;const z=[{x:p,y:l.y},{x:p,y:u.y}],G=[{x:l.x,y:v},{x:u.x,y:v}];s[d]===h?f=d==="x"?z:G:f=d==="x"?G:z}else{const z=[{x:l.x,y:u.y}],G=[{x:u.x,y:l.y}];if(d==="x"?f=s.x===h?G:z:f=s.y===h?z:G,t===o){const P=Math.abs(e[d]-n[d]);if(P<=i){const g=Math.min(i-1,i-P);s[d]===h?y[d]=(l[d]>e[d]?-1:1)*g:_[d]=(u[d]>n[d]?-1:1)*g}}if(t!==o){const P=d==="x"?"y":"x",g=s[d]===a[P],O=l[P]>u[P],k=l[P]<u[P];(s[d]===1&&(!g&&O||g&&k)||s[d]!==1&&(!g&&k||g&&O))&&(f=d==="x"?z:G)}const Z={x:l.x+y.x,y:l.y+y.y},N={x:u.x+_.x,y:u.y+_.y},T=Math.max(Math.abs(Z.x-f[0].x),Math.abs(N.x-f[0].x)),E=Math.max(Math.abs(Z.y-f[0].y),Math.abs(N.y-f[0].y));T>=E?(p=(Z.x+N.x)/2,v=f[0].y):(p=f[0].x,v=(Z.y+N.y)/2)}return[[e,{x:l.x+y.x,y:l.y+y.y},...f,{x:u.x+_.x,y:u.y+_.y},n],p,v,w,A]}function rb(e,t,n,o){const r=Math.min(La(e,t)/2,La(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+r*u},${s}Q ${i},${s} ${i},${s+r*c}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+r*l}Q ${i},${s} ${i+r*a},${s}`}function Ai(e){const{sourceX:t,sourceY:n,sourcePosition:o=de.Bottom,targetX:r,targetY:i,targetPosition:s=de.Top,borderRadius:a=5,centerX:l,centerY:u,offset:c=20}=e,[d,h,f,p,v]=ob({source:{x:t,y:n},sourcePosition:o,target:{x:r,y:i},targetPosition:s,center:{x:l,y:u},offset:c});return[d.reduce((_,b,m)=>{let w;return m>0&&m<d.length-1?w=rb(d[m-1],b,d[m+1],a):w=`${m===0?"M":"L"}${b.x} ${b.y}`,_+=w,_},""),h,f,p,v]}function ib(e){const{sourceX:t,sourceY:n,targetX:o,targetY:r}=e,[i,s,a,l]=Qu({sourceX:t,sourceY:n,targetX:o,targetY:r});return[`M ${t},${n}L ${o},${r}`,i,s,a,l]}const sb=_e({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=ib(e);return Ae(Nr,{path:n,labelX:o,labelY:r,...t,...e})}}}),ab=sb,lb=_e({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=Ai({...e,sourcePosition:e.sourcePosition??de.Bottom,targetPosition:e.targetPosition??de.Top});return Ae(Nr,{path:n,labelX:o,labelY:r,...t,...e})}}}),oc=lb,ub=_e({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>Ae(oc,{...e,...t,borderRadius:0})}}),cb=ub,db=_e({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=tc({...e,sourcePosition:e.sourcePosition??de.Bottom,targetPosition:e.targetPosition??de.Top});return Ae(Nr,{path:n,labelX:o,labelY:r,...t,...e})}}}),fb=db,hb=_e({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=nc({...e,sourcePosition:e.sourcePosition??de.Bottom,targetPosition:e.targetPosition??de.Top});return Ae(Nr,{path:n,labelX:o,labelY:r,...t,...e})}}}),pb=hb,mb={input:Uw,default:qw,output:Ww},gb={default:fb,straight:ab,step:cb,smoothstep:oc,simplebezier:pb};function vb(e,t,n){const o=oe(()=>v=>t.value.get(v)),r=oe(()=>v=>n.value.get(v)),i=oe(()=>{const v={...gb,...e.edgeTypes},y=Object.keys(v);for(const _ of e.edges)_.type&&!y.includes(_.type)&&(v[_.type]=_.type);return v}),s=oe(()=>{const v={...mb,...e.nodeTypes},y=Object.keys(v);for(const _ of e.nodes)_.type&&!y.includes(_.type)&&(v[_.type]=_.type);return v}),a=oe(()=>e.onlyRenderVisibleElements?Vu(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),l=oe(()=>{if(e.onlyRenderVisibleElements){const v=[];for(const y of e.edges){const _=t.value.get(y.source),b=t.value.get(y.target);hw({sourcePos:_.computedPosition||{x:0,y:0},targetPos:b.computedPosition||{x:0,y:0},sourceWidth:_.dimensions.width,sourceHeight:_.dimensions.height,targetWidth:b.dimensions.width,targetHeight:b.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&v.push(y)}return v}return e.edges}),u=oe(()=>[...a.value,...l.value]),c=oe(()=>{const v=[];for(const y of e.nodes)y.selected&&v.push(y);return v}),d=oe(()=>{const v=[];for(const y of e.edges)y.selected&&v.push(y);return v}),h=oe(()=>[...c.value,...d.value]),f=oe(()=>{const v=[];for(const y of e.nodes)y.dimensions.width&&y.dimensions.height&&y.handleBounds!==void 0&&v.push(y);return v}),p=oe(()=>a.value.length>0&&f.value.length===a.value.length);return{getNode:o,getEdge:r,getElements:u,getEdgeTypes:i,getNodeTypes:s,getEdges:l,getNodes:a,getSelectedElements:h,getSelectedNodes:c,getSelectedEdges:d,getNodesInitialized:f,areNodesInitialized:p}}class Wt{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const n=(t=Tn())==null?void 0:t.appContext.app,o=n?.config.globalProperties.$vueFlowStorage??Wt.instance;return Wt.instance=o??new Wt,n&&(n.config.globalProperties.$vueFlowStorage=Wt.instance),Wt.instance}set(t,n){return this.flows.set(t,n)}get(t){return this.flows.get(t)}remove(t){return this.flows.delete(t)}create(t,n){const o=Ju(),r=Sc(o),i={};for(const[h,f]of Object.entries(r.hooks)){const p=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;i[p]=f.on}const s={};for(const[h,f]of Object.entries(r.hooks))s[h]=f.trigger;const a=oe(()=>{const h=new Map;for(const f of r.nodes)h.set(f.id,f);return h}),l=oe(()=>{const h=new Map;for(const f of r.edges)h.set(f.id,f);return h}),u=vb(r,a,l),c=Hw(r,a,l);c.setState({...r,...n});const d={...i,...u,...c,...lv(r),nodeLookup:a,edgeLookup:l,emits:s,id:t,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(t)}};return this.set(t,d),d}getId(){return`vue-flow-${this.currentId++}`}}function Le(e){const t=Wt.getInstance(),n=Ni(),o=typeof e=="object",r=o?e:{id:e},i=r.id,s=i??n?.vueFlowId;let a;if(n){const l=Cn(Na,null);typeof l<"u"&&l!==null&&(!s||l.id===s)&&(a=l)}if(a||s&&(a=t.get(s)),!a||s&&a.id!==s){const l=i??t.getId(),u=t.create(l,r);a=u,(n??Ya(!0)).run(()=>{xe(u.applyDefault,(d,h,f)=>{const p=y=>{u.applyNodeChanges(y)},v=y=>{u.applyEdgeChanges(y)};d?(u.onNodesChange(p),u.onEdgesChange(v)):(u.hooks.value.nodesChange.off(p),u.hooks.value.edgesChange.off(v)),f(()=>{u.hooks.value.nodesChange.off(p),u.hooks.value.edgesChange.off(v)})},{immediate:!0}),Kn(()=>{if(a){const d=t.get(a.id);d?d.$destroy():uo(`No store instance found for id ${a.id} in storage.`)}})})}else o&&a.setState(r);if(n&&(vn(Na,a),n.vueFlowId=a.id),o){const l=Tn();l?.type.name!=="VueFlow"&&a.emits.error(new Ge(Be.USEVUEFLOW_OPTIONS))}return a}function _b(e){const{emits:t,dimensions:n}=Le();let o;it(()=>{const r=()=>{var i,s;if(!e.value||!(((s=(i=e.value).checkVisibility)==null?void 0:s.call(i))??!0))return;const a=kr(e.value);(a.width===0||a.height===0)&&t.error(new Ge(Be.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:a.width||500,height:a.height||500}};r(),window.addEventListener("resize",r),e.value&&(o=new ResizeObserver(()=>r()),o.observe(e.value)),Xa(()=>{window.removeEventListener("resize",r),o&&e.value&&o.unobserve(e.value)})})}const yb={name:"UserSelection",compatConfig:{MODE:3}},wb=_e({...yb,props:{userSelectionRect:{}},setup(e){return(t,n)=>(q(),ee("div",{class:"vue-flow__selection vue-flow__container",style:Xe({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),bb=["tabIndex"],Eb={name:"NodesSelection",compatConfig:{MODE:3}},xb=_e({...Eb,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:r,disableKeyboardA11y:i,userSelectionActive:s}=Le(),a=Zu(),l=fe(null),u=Yu({el:l,onStart(p){t.selectionDragStart(p),t.nodeDragStart(p)},onDrag(p){t.selectionDrag(p),t.nodeDrag(p)},onStop(p){t.selectionDragStop(p),t.nodeDragStop(p)}});it(()=>{var p;i.value||(p=l.value)==null||p.focus({preventScroll:!0})});const c=oe(()=>$u(o.value)),d=oe(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function h(p){t.selectionContextMenu({event:p,nodes:o.value})}function f(p){i.value||gn[p.key]&&(p.preventDefault(),a({x:gn[p.key].x,y:gn[p.key].y},p.shiftKey))}return(p,v)=>!C(s)&&c.value.width&&c.value.height?(q(),ee("div",{key:0,class:He(["vue-flow__nodesselection vue-flow__container",C(r)]),style:Xe({transform:`translate(${C(n).x}px,${C(n).y}px) scale(${C(n).zoom})`})},[K("div",{ref_key:"el",ref:l,class:He([{dragging:C(u)},"vue-flow__nodesselection-rect"]),style:Xe(d.value),tabIndex:C(i)?void 0:-1,onContextmenu:h,onKeydown:f},null,46,bb)],6)):ve("",!0)}});function kb(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const Sb={name:"Pane",compatConfig:{MODE:3}},Cb=_e({...Sb,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:r,userSelectionActive:i,removeSelectedElements:s,userSelectionRect:a,elementsSelectable:l,nodesSelectionActive:u,getSelectedEdges:c,getSelectedNodes:d,removeNodes:h,removeEdges:f,selectionMode:p,deleteKeyCode:v,multiSelectionKeyCode:y,multiSelectionActive:_,edgeLookup:b,nodeLookup:m,connectionLookup:w,defaultEdgeOptions:A,connectionStartHandle:D,panOnDrag:z}=Le(),G=Tt(null),Z=Tt(new Set),N=Tt(new Set),T=Tt(null),E=Oe(()=>l.value&&(e.isSelecting||i.value)),P=Oe(()=>D.value!==null);let g=!1,O=!1;const k=jn(v,{actInsideInputWithModifier:!1}),R=jn(y);xe(k,x=>{x&&(h(d.value),f(c.value),u.value=!1)}),xe(R,x=>{_.value=x});function M(x,L){return B=>{B.target===L&&x?.(B)}}function H(x){if(g||P.value){g=!1;return}r.paneClick(x),s(),u.value=!1}function j(x){var L;if(Array.isArray(z.value)&&((L=z.value)!=null&&L.includes(2))){x.preventDefault();return}r.paneContextMenu(x)}function U(x){r.paneScroll(x)}function J(x){var L,B,Y;if(T.value=((L=t.value)==null?void 0:L.getBoundingClientRect())??null,!l.value||!e.isSelecting||x.button!==0||x.target!==G.value||!T.value)return;(Y=(B=x.target)==null?void 0:B.setPointerCapture)==null||Y.call(B,x.pointerId);const{x:Q,y:ne}=kb(x,T.value);O=!0,g=!1,s(),a.value={width:0,height:0,startX:Q,startY:ne,x:Q,y:ne},r.selectionStart(x)}function te(x){var L;if(!T.value||!a.value)return;g=!0;const{x:B,y:Y}=_t(x,T.value),{startX:Q=0,startY:ne=0}=a.value,se={startX:Q,startY:ne,x:B<Q?B:Q,y:Y<ne?Y:ne,width:Math.abs(B-Q),height:Math.abs(Y-ne)},ue=Z.value,ye=N.value;Z.value=new Set(Vu(n.value,se,o.value,p.value===is.Partial,!0).map(I=>I.id)),N.value=new Set;const V=((L=A.value)==null?void 0:L.selectable)??!0;for(const I of Z.value){const F=w.value.get(I);if(F)for(const{edgeId:X}of F.values()){const W=b.value.get(X);W&&(W.selectable??V)&&N.value.add(X)}}if(!Aa(ue,Z.value)){const I=$t(m.value,Z.value,!0);r.nodesChange(I)}if(!Aa(ye,N.value)){const I=$t(b.value,N.value);r.edgesChange(I)}a.value=se,i.value=!0,u.value=!1}function $(x){var L;x.button!==0||!O||((L=x.target)==null||L.releasePointerCapture(x.pointerId),!i.value&&a.value&&x.target===G.value&&H(x),i.value=!1,a.value=null,u.value=Z.value.size>0,r.selectionEnd(x),e.selectionKeyPressed&&(g=!1),O=!1)}return(x,L)=>(q(),ee("div",{ref_key:"container",ref:G,class:He(["vue-flow__pane vue-flow__container",{selection:x.isSelecting}]),onClick:L[0]||(L[0]=B=>E.value?void 0:M(H,G.value)(B)),onContextmenu:L[1]||(L[1]=B=>M(j,G.value)(B)),onWheelPassive:L[2]||(L[2]=B=>M(U,G.value)(B)),onPointerenter:L[3]||(L[3]=B=>E.value?void 0:C(r).paneMouseEnter(B)),onPointerdown:L[4]||(L[4]=B=>E.value?J(B):C(r).paneMouseMove(B)),onPointermove:L[5]||(L[5]=B=>E.value?te(B):C(r).paneMouseMove(B)),onPointerup:L[6]||(L[6]=B=>E.value?$(B):void 0),onPointerleave:L[7]||(L[7]=B=>C(r).paneMouseLeave(B))},[ke(x.$slots,"default"),C(i)&&C(a)?(q(),be(wb,{key:0,"user-selection-rect":C(a)},null,8,["user-selection-rect"])):ve("",!0),C(u)&&C(d).length?(q(),be(xb,{key:1})):ve("",!0)],34))}}),Tb={name:"Transform",compatConfig:{MODE:3}},Pb=_e({...Tb,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=Le(),r=oe(()=>n.value?!o.value:!1),i=oe(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(s,a)=>(q(),ee("div",{class:"vue-flow__transformationpane vue-flow__container",style:Xe({transform:i.value,opacity:r.value?0:void 0})},[ke(s.$slots,"default")],4))}}),Ab={name:"Viewport",compatConfig:{MODE:3}},Nb=_e({...Ab,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:r,zoomActivationKeyCode:i,selectionKeyCode:s,panActivationKeyCode:a,panOnScroll:l,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:d,zoomOnDoubleClick:h,zoomOnPinch:f,zoomOnScroll:p,preventScrolling:v,noWheelClassName:y,noPanClassName:_,emits:b,connectionStartHandle:m,userSelectionActive:w,paneDragging:A,d3Zoom:D,d3Selection:z,d3ZoomHandler:G,viewport:Z,viewportRef:N,paneClickDistance:T}=Le();_b(N);const E=Tt(!1),P=Tt(!1);let g=null,O=!1,k=0,R={x:0,y:0,zoom:0};const M=jn(a),H=jn(s),j=jn(i),U=Oe(()=>(!H.value||H.value&&s.value===!0)&&(M.value||d.value)),J=Oe(()=>M.value||l.value),te=Oe(()=>s.value===!0&&U.value!==!0),$=Oe(()=>H.value&&s.value!==!0||w.value||te.value),x=Oe(()=>m.value!==null);it(()=>{if(!N.value){uo("Viewport element is missing");return}const ne=N.value,se=ne.getBoundingClientRect(),ue=W0().clickDistance(T.value).scaleExtent([t.value,n.value]).translateExtent(r.value),ye=st(ne).call(ue),V=ye.on("wheel.zoom"),I=xn.translate(o.value.x??0,o.value.y??0).scale(en(o.value.zoom??1,t.value,n.value)),F=[[0,0],[se.width,se.height]],X=ue.constrain()(I,F,r.value);ue.transform(ye,X),ue.wheelDelta(ma),D.value=ue,z.value=ye,G.value=V,Z.value={x:X.x,y:X.y,zoom:X.k},ue.on("start",W=>{var le;if(!W.sourceEvent)return null;k=W.sourceEvent.button,E.value=!0;const ce=Y(W.transform);((le=W.sourceEvent)==null?void 0:le.type)==="mousedown"&&(A.value=!0),R=ce,b.viewportChangeStart(ce),b.moveStart({event:W,flowTransform:ce})}),ue.on("end",W=>{if(!W.sourceEvent)return null;if(E.value=!1,A.value=!1,L(U.value,k??0)&&!O&&b.paneContextMenu(W.sourceEvent),O=!1,B(R,W.transform)){const le=Y(W.transform);R=le,b.viewportChangeEnd(le),b.moveEnd({event:W,flowTransform:le})}}),ue.filter(W=>{var le;const ce=j.value||p.value,ge=f.value&&W.ctrlKey,he=W.button,we=W.type==="wheel";if(he===1&&W.type==="mousedown"&&(Q(W,"vue-flow__node")||Q(W,"vue-flow__edge")))return!0;if(!U.value&&!ce&&!J.value&&!h.value&&!f.value||w.value||x.value&&!we||!h.value&&W.type==="dblclick"||Q(W,y.value)&&we||Q(W,_.value)&&(!we||J.value&&we&&!j.value)||!f.value&&W.ctrlKey&&we||!ce&&!J.value&&!ge&&we)return!1;if(!f&&W.type==="touchstart"&&((le=W.touches)==null?void 0:le.length)>1)return W.preventDefault(),!1;if(!U.value&&(W.type==="mousedown"||W.type==="touchstart")||te.value&&Array.isArray(d.value)&&d.value.includes(0)&&he===0||Array.isArray(d.value)&&!d.value.includes(he)&&(W.type==="mousedown"||W.type==="touchstart"))return!1;const Se=Array.isArray(d.value)&&d.value.includes(he)||s.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!he||he<=1;return(!W.ctrlKey||M.value||we)&&Se}),xe([w,U],()=>{w.value&&!E.value?ue.on("zoom",null):w.value||ue.on("zoom",W=>{Z.value={x:W.transform.x,y:W.transform.y,zoom:W.transform.k};const le=Y(W.transform);O=L(U.value,k??0),b.viewportChange(le),b.move({event:W,flowTransform:le})})},{immediate:!0}),xe([w,J,u,j,f,v,y],()=>{J.value&&!j.value&&!w.value?ye.on("wheel.zoom",W=>{if(Q(W,y.value))return!1;const le=j.value||p.value,ce=f.value&&W.ctrlKey;if(!(!v.value||J.value||le||ce))return!1;W.preventDefault(),W.stopImmediatePropagation();const he=ye.property("__zoom").k||1,we=sr();if(!M.value&&W.ctrlKey&&f.value&&we){const ac=gt(W),lc=ma(W),uc=he*2**lc;ue.scaleTo(ye,uc,ac,W);return}const Se=W.deltaMode===1?20:1;let Te=u.value===Gn.Vertical?0:W.deltaX*Se,Lt=u.value===Gn.Horizontal?0:W.deltaY*Se;!we&&W.shiftKey&&u.value!==Gn.Vertical&&!Te&&Lt&&(Te=Lt,Lt=0),ue.translateBy(ye,-(Te/he)*c.value,-(Lt/he)*c.value);const ht=Y(ye.property("__zoom"));g&&clearTimeout(g),P.value?(b.move({event:W,flowTransform:ht}),b.viewportChange(ht),g=setTimeout(()=>{b.moveEnd({event:W,flowTransform:ht}),b.viewportChangeEnd(ht),P.value=!1},150)):(P.value=!0,b.moveStart({event:W,flowTransform:ht}),b.viewportChangeStart(ht))},{passive:!1}):typeof V<"u"&&ye.on("wheel.zoom",function(W,le){const ce=!v.value&&W.type==="wheel"&&!W.ctrlKey,ge=j.value||p.value,he=f.value&&W.ctrlKey;if(!ge&&!l.value&&!he&&W.type==="wheel"||ce||Q(W,y.value))return null;W.preventDefault(),V.call(this,W,le)},{passive:!1})},{immediate:!0})});function L(ne,se){return se===2&&Array.isArray(ne)&&ne.includes(2)}function B(ne,se){return ne.x!==se.x&&!Number.isNaN(se.x)||ne.y!==se.y&&!Number.isNaN(se.y)||ne.zoom!==se.k&&!Number.isNaN(se.k)}function Y(ne){return{x:ne.x,y:ne.y,zoom:ne.k}}function Q(ne,se){return ne.target.closest(`.${se}`)}return(ne,se)=>(q(),ee("div",{ref_key:"viewportRef",ref:N,class:"vue-flow__viewport vue-flow__container"},[ie(Cb,{"is-selecting":$.value,"selection-key-pressed":C(H),class:He({connecting:x.value,dragging:C(A),draggable:C(d)===!0||Array.isArray(C(d))&&C(d).includes(0)})},{default:pe(()=>[ie(Pb,null,{default:pe(()=>[ke(ne.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),Ob=["id"],Ib=["id"],Rb=["id"],Lb={name:"A11yDescriptions",compatConfig:{MODE:3}},Db=_e({...Lb,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=Le();return(r,i)=>(q(),ee(Ie,null,[K("div",{id:`${C(Au)}-${C(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+me(C(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,Ob),K("div",{id:`${C(Nu)}-${C(t)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,Ib),C(n)?ve("",!0):(q(),ee("div",{key:0,id:`${C(J0)}-${C(t)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},me(C(o)),9,Rb))],64))}});function Mb(){const e=Le();xe(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function $b(e,t,n){return n===de.Left?e-t:n===de.Right?e+t:e}function Vb(e,t,n){return n===de.Top?e-t:n===de.Bottom?e+t:e}const ls=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=de.Top,type:r}){return Ae("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${r}`,cx:$b(t,e,o),cy:Vb(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};ls.props=["radius","centerX","centerY","position","type"];ls.compatConfig={MODE:3};const Da=ls,Bb=_e({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:r,emits:i,nodesSelectionActive:s,noPanClassName:a,getEdgeTypes:l,removeSelectedEdges:u,findEdge:c,findNode:d,isValidConnection:h,multiSelectionActive:f,disableKeyboardA11y:p,elementsSelectable:v,edgesUpdatable:y,edgesFocusable:_,hooks:b}=Le(),m=oe(()=>c(e.id)),{emit:w,on:A}=Aw(m.value,i),D=Cn(Cr),z=Tn(),G=fe(!1),Z=fe(!1),N=fe(""),T=fe(null),E=fe("source"),P=fe(null),g=Oe(()=>typeof m.value.selectable>"u"?v.value:m.value.selectable),O=Oe(()=>typeof m.value.updatable>"u"?y.value:m.value.updatable),k=Oe(()=>typeof m.value.focusable>"u"?_.value:m.value.focusable);vn(Cw,e.id),vn(Tw,P);const R=oe(()=>m.value.class instanceof Function?m.value.class(m.value):m.value.class),M=oe(()=>m.value.style instanceof Function?m.value.style(m.value):m.value.style),H=oe(()=>{const I=m.value.type||"default",F=D?.[`edge-${I}`];if(F)return F;let X=m.value.template??l.value[I];if(typeof X=="string"&&z){const W=Object.keys(z.appContext.components);W&&W.includes(I)&&(X=Ka(I,!1))}return X&&typeof X!="string"?X:(i.error(new Ge(Be.EDGE_TYPE_MISSING,X)),!1)}),{handlePointerDown:j}=Xu({nodeId:N,handleId:T,type:E,isValidConnection:h,edgeUpdaterType:E,onEdgeUpdate:te,onEdgeUpdateEnd:$});return()=>{const I=d(m.value.source),F=d(m.value.target),X="pathOptions"in m.value?m.value.pathOptions:{};if(!I&&!F)return i.error(new Ge(Be.EDGE_SOURCE_TARGET_MISSING,m.value.id,m.value.source,m.value.target)),null;if(!I)return i.error(new Ge(Be.EDGE_SOURCE_MISSING,m.value.id,m.value.source)),null;if(!F)return i.error(new Ge(Be.EDGE_TARGET_MISSING,m.value.id,m.value.target)),null;if(!m.value||m.value.hidden||I.hidden||F.hidden)return null;let W;o.value===Ht.Strict?W=I.handleBounds.source:W=[...I.handleBounds.source||[],...I.handleBounds.target||[]];const le=xa(W,m.value.sourceHandle);let ce;o.value===Ht.Strict?ce=F.handleBounds.target:ce=[...F.handleBounds.target||[],...F.handleBounds.source||[]];const ge=xa(ce,m.value.targetHandle),he=le?.position||de.Bottom,we=ge?.position||de.Top,{x:Se,y:Te}=kn(I,le,he),{x:Lt,y:ht}=kn(F,ge,we);return m.value.sourceX=Se,m.value.sourceY=Te,m.value.targetX=Lt,m.value.targetY=ht,Ae("g",{ref:P,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${H.value===!1?"default":m.value.type||"default"}`,a.value,R.value,{updating:G.value,selected:m.value.selected,animated:m.value.animated,inactive:!g.value&&!b.value.edgeClick.hasListeners()}],tabIndex:k.value?0:void 0,"aria-label":m.value.ariaLabel===null?void 0:m.value.ariaLabel??`Edge from ${m.value.source} to ${m.value.target}`,"aria-describedby":k.value?`${Nu}-${t}`:void 0,"aria-roledescription":"edge",role:k.value?"group":"img",...m.value.domAttributes,onClick:L,onContextmenu:B,onDblclick:Y,onMouseenter:Q,onMousemove:ne,onMouseleave:se,onKeyDown:k.value?V:void 0},[Z.value?null:Ae(H.value===!1?l.value.default:H.value,{id:e.id,sourceNode:I,targetNode:F,source:m.value.source,target:m.value.target,type:m.value.type,updatable:O.value,selected:m.value.selected,animated:m.value.animated,label:m.value.label,labelStyle:m.value.labelStyle,labelShowBg:m.value.labelShowBg,labelBgStyle:m.value.labelBgStyle,labelBgPadding:m.value.labelBgPadding,labelBgBorderRadius:m.value.labelBgBorderRadius,data:m.value.data,events:{...m.value.events,...A},style:M.value,markerStart:`url('#${oo(m.value.markerStart,t)}')`,markerEnd:`url('#${oo(m.value.markerEnd,t)}')`,sourcePosition:he,targetPosition:we,sourceX:Se,sourceY:Te,targetX:Lt,targetY:ht,sourceHandleId:m.value.sourceHandle,targetHandleId:m.value.targetHandle,interactionWidth:m.value.interactionWidth,...X}),[O.value==="source"||O.value===!0?[Ae("g",{onMousedown:ue,onMouseenter:U,onMouseout:J},Ae(Da,{position:he,centerX:Se,centerY:Te,radius:r.value,type:"source","data-type":"source"}))]:null,O.value==="target"||O.value===!0?[Ae("g",{onMousedown:ye,onMouseenter:U,onMouseout:J},Ae(Da,{position:we,centerX:Lt,centerY:ht,radius:r.value,type:"target","data-type":"target"}))]:null]])};function U(){G.value=!0}function J(){G.value=!1}function te(I,F){w.update({event:I,edge:m.value,connection:F})}function $(I){w.updateEnd({event:I,edge:m.value}),Z.value=!1}function x(I,F){I.button===0&&(Z.value=!0,N.value=F?m.value.target:m.value.source,T.value=(F?m.value.targetHandle:m.value.sourceHandle)??null,E.value=F?"target":"source",w.updateStart({event:I,edge:m.value}),j(I))}function L(I){var F;const X={event:I,edge:m.value};g.value&&(s.value=!1,m.value.selected&&f.value?(u([m.value]),(F=P.value)==null||F.blur()):n([m.value])),w.click(X)}function B(I){w.contextMenu({event:I,edge:m.value})}function Y(I){w.doubleClick({event:I,edge:m.value})}function Q(I){w.mouseEnter({event:I,edge:m.value})}function ne(I){w.mouseMove({event:I,edge:m.value})}function se(I){w.mouseLeave({event:I,edge:m.value})}function ue(I){x(I,!0)}function ye(I){x(I,!1)}function V(I){var F;!p.value&&Ou.includes(I.key)&&g.value&&(I.key==="Escape"?((F=P.value)==null||F.blur(),u([c(e.id)])):n([c(e.id)]))}}}),zb=Bb,Fb=_e({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:r,connectionPosition:i,connectionLineType:s,connectionLineStyle:a,connectionLineOptions:l,connectionStatus:u,viewport:c,findNode:d}=Le(),h=(e=Cn(Cr))==null?void 0:e["connection-line"],f=oe(()=>{var b;return d((b=o.value)==null?void 0:b.nodeId)}),p=oe(()=>{var b;return d((b=r.value)==null?void 0:b.nodeId)??null}),v=oe(()=>({x:(i.value.x-c.value.x)/c.value.zoom,y:(i.value.y-c.value.y)/c.value.zoom})),y=oe(()=>l.value.markerStart?`url(#${oo(l.value.markerStart,t)})`:""),_=oe(()=>l.value.markerEnd?`url(#${oo(l.value.markerEnd,t)})`:"");return()=>{var b,m,w;if(!f.value||!o.value)return null;const A=o.value.id,D=o.value.type,z=f.value.handleBounds;let G=z?.[D]??[];if(n.value===Ht.Loose){const M=z?.[D==="source"?"target":"source"]??[];G=[...G,...M]}if(!G)return null;const Z=(A?G.find(M=>M.id===A):G[0])??null,N=Z?.position??de.Top,{x:T,y:E}=kn(f.value,Z,N);let P=null;p.value&&(n.value===Ht.Strict?P=((b=p.value.handleBounds[D==="source"?"target":"source"])==null?void 0:b.find(M=>{var H;return M.id===((H=r.value)==null?void 0:H.id)}))||null:P=((m=[...p.value.handleBounds.source??[],...p.value.handleBounds.target??[]])==null?void 0:m.find(M=>{var H;return M.id===((H=r.value)==null?void 0:H.id)}))||null);const g=((w=r.value)==null?void 0:w.position)??(N?Ti[N]:null);if(!N||!g)return null;const O=s.value??l.value.type??qt.Bezier;let k="";const R={sourceX:T,sourceY:E,sourcePosition:N,targetX:v.value.x,targetY:v.value.y,targetPosition:g};return O===qt.Bezier?[k]=tc(R):O===qt.Step?[k]=Ai({...R,borderRadius:0}):O===qt.SmoothStep?[k]=Ai(R):O===qt.SimpleBezier?[k]=nc(R):k=`M${T},${E} ${v.value.x},${v.value.y}`,Ae("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},Ae("g",{class:"vue-flow__connection"},h?Ae(h,{sourceX:T,sourceY:E,sourcePosition:N,targetX:v.value.x,targetY:v.value.y,targetPosition:g,sourceNode:f.value,sourceHandle:Z,targetNode:p.value,targetHandle:P,markerEnd:_.value,markerStart:y.value,connectionStatus:u.value}):Ae("path",{d:k,class:[l.value.class,u.value,"vue-flow__connection-path"],style:{...a.value,...l.value.style},"marker-end":_.value,"marker-start":y.value})))}}}),Hb=Fb,Gb=["id","markerWidth","markerHeight","markerUnits","orient"],jb={name:"MarkerType",compatConfig:{MODE:3}},qb=_e({...jb,props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(e){return(t,n)=>(q(),ee("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===C(or).ArrowClosed?(q(),ee("polyline",{key:0,style:Xe({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):ve("",!0),t.type===C(or).Arrow?(q(),ee("polyline",{key:1,style:Xe({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):ve("",!0)],8,Gb))}}),Wb={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Ub={name:"MarkerDefinitions",compatConfig:{MODE:3}},Yb=_e({...Ub,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:r}=Le(),i=oe(()=>{const s=new Set,a=[],l=u=>{if(u){const c=oo(u,t);s.has(c)||(typeof u=="object"?a.push({...u,id:c,color:u.color||r.value}):a.push({id:c,color:r.value,type:u}),s.add(c))}};for(const u of[o.value.markerEnd,o.value.markerStart])l(u);for(const u of n.value)for(const c of[u.markerStart,u.markerEnd])l(c);return a.sort((u,c)=>u.id.localeCompare(c.id))});return(s,a)=>(q(),ee("svg",Wb,[K("defs",null,[(q(!0),ee(Ie,null,rt(i.value,l=>(q(),be(qb,{id:l.id,key:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,"stroke-width":l.strokeWidth,orient:l.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),Xb={name:"Edges",compatConfig:{MODE:3}},Kb=_e({...Xb,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=Le();return(r,i)=>(q(),ee(Ie,null,[ie(Yb),(q(!0),ee(Ie,null,rt(C(n),s=>(q(),ee("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Xe({zIndex:C(pw)(s,C(t),C(o))})},[ie(C(zb),{id:s.id},null,8,["id"])],4))),128)),ie(C(Hb))],64))}}),Zb=_e({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:r,multiSelectionActive:i,emits:s,removeSelectedNodes:a,addSelectedNodes:l,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:d,nodeExtent:h,elevateNodesOnSelect:f,disableKeyboardA11y:p,ariaLiveMessage:v,snapToGrid:y,snapGrid:_,nodeDragThreshold:b,nodesDraggable:m,elementsSelectable:w,nodesConnectable:A,nodesFocusable:D,hooks:z}=Le(),G=fe(null);vn(Uu,G),vn(Wu,e.id);const Z=Cn(Cr),N=Tn(),T=Zu(),{node:E,parentNode:P}=Ku(e.id),{emit:g,on:O}=Rw(E,s),k=Oe(()=>typeof E.draggable>"u"?m.value:E.draggable),R=Oe(()=>typeof E.selectable>"u"?w.value:E.selectable),M=Oe(()=>typeof E.connectable>"u"?A.value:E.connectable),H=Oe(()=>typeof E.focusable>"u"?D.value:E.focusable),j=oe(()=>R.value||k.value||z.value.nodeClick.hasListeners()||z.value.nodeDoubleClick.hasListeners()||z.value.nodeMouseEnter.hasListeners()||z.value.nodeMouseMove.hasListeners()||z.value.nodeMouseLeave.hasListeners()),U=Oe(()=>!!E.dimensions.width&&!!E.dimensions.height),J=oe(()=>{const F=E.type||"default",X=Z?.[`node-${F}`];if(X)return X;let W=E.template||d.value[F];if(typeof W=="string"&&N){const le=Object.keys(N.appContext.components);le&&le.includes(F)&&(W=Ka(F,!1))}return W&&typeof W!="string"?W:(s.error(new Ge(Be.NODE_TYPE_MISSING,W)),!1)}),te=Yu({id:e.id,el:G,disabled:()=>!k.value,selectable:R,dragHandle:()=>E.dragHandle,onStart(F){g.dragStart(F)},onDrag(F){g.drag(F)},onStop(F){g.dragStop(F)},onClick(F){V(F)}}),$=oe(()=>E.class instanceof Function?E.class(E):E.class),x=oe(()=>{const F=(E.style instanceof Function?E.style(E):E.style)||{},X=E.width instanceof Function?E.width(E):E.width,W=E.height instanceof Function?E.height(E):E.height;return!F.width&&X&&(F.width=typeof X=="string"?X:`${X}px`),!F.height&&W&&(F.height=typeof W=="string"?W:`${W}px`),F}),L=Oe(()=>Number(E.zIndex??x.value.zIndex??0));return c(F=>{(F.includes(e.id)||!F.length)&&Y()}),it(()=>{xe(()=>E.hidden,(F=!1,X,W)=>{!F&&G.value&&(e.resizeObserver.observe(G.value),W(()=>{G.value&&e.resizeObserver.unobserve(G.value)}))},{immediate:!0,flush:"post"})}),xe([()=>E.type,()=>E.sourcePosition,()=>E.targetPosition],()=>{Nt(()=>{u([{id:e.id,nodeElement:G.value,forceUpdate:!0}])})}),xe([()=>E.position.x,()=>E.position.y,()=>{var F;return(F=P.value)==null?void 0:F.computedPosition.x},()=>{var F;return(F=P.value)==null?void 0:F.computedPosition.y},()=>{var F;return(F=P.value)==null?void 0:F.computedPosition.z},L,()=>E.selected,()=>E.dimensions.height,()=>E.dimensions.width,()=>{var F;return(F=P.value)==null?void 0:F.dimensions.height},()=>{var F;return(F=P.value)==null?void 0:F.dimensions.width}],([F,X,W,le,ce,ge])=>{const he={x:F,y:X,z:ge+(f.value&&E.selected?1e3:0)};typeof W<"u"&&typeof le<"u"?E.computedPosition=lw({x:W,y:le,z:ce},he):E.computedPosition=he},{flush:"post",immediate:!0}),xe([()=>E.extent,h],([F,X],[W,le])=>{(F!==W||X!==le)&&B()}),E.extent==="parent"||typeof E.extent=="object"&&"range"in E.extent&&E.extent.range==="parent"?vi(()=>U).toBe(!0).then(B):B(),()=>E.hidden?null:Ae("div",{ref:G,"data-id":E.id,class:["vue-flow__node",`vue-flow__node-${J.value===!1?"default":E.type||"default"}`,{[n.value]:k.value,dragging:te?.value,draggable:k.value,selected:E.selected,selectable:R.value,parent:E.isParent},$.value],style:{visibility:U.value?"visible":"hidden",zIndex:E.computedPosition.z??L.value,transform:`translate(${E.computedPosition.x}px,${E.computedPosition.y}px)`,pointerEvents:j.value?"all":"none",...x.value},tabIndex:H.value?0:void 0,role:H.value?"group":void 0,"aria-describedby":p.value?void 0:`${Au}-${t}`,"aria-label":E.ariaLabel,"aria-roledescription":"node",...E.domAttributes,onMouseenter:Q,onMousemove:ne,onMouseleave:se,onContextmenu:ue,onClick:V,onDblclick:ye,onKeydown:I},[Ae(J.value===!1?d.value.default:J.value,{id:E.id,type:E.type,data:E.data,events:{...E.events,...O},selected:E.selected,resizing:E.resizing,dragging:te.value,connectable:M.value,position:E.computedPosition,dimensions:E.dimensions,isValidTargetPos:E.isValidTargetPos,isValidSourcePos:E.isValidSourcePos,parent:E.parentNode,parentNodeId:E.parentNode,zIndex:E.computedPosition.z??L.value,targetPosition:E.targetPosition,sourcePosition:E.sourcePosition,label:E.label,dragHandle:E.dragHandle,onUpdateNodeInternals:Y})]);function B(){const F=E.computedPosition,{computedPosition:X,position:W}=ss(E,y.value?Sr(F,_.value):F,s.error,h.value,P.value);(E.computedPosition.x!==X.x||E.computedPosition.y!==X.y)&&(E.computedPosition={...E.computedPosition,...X}),(E.position.x!==W.x||E.position.y!==W.y)&&(E.position=W)}function Y(){G.value&&u([{id:e.id,nodeElement:G.value,forceUpdate:!0}])}function Q(F){te?.value||g.mouseEnter({event:F,node:E})}function ne(F){te?.value||g.mouseMove({event:F,node:E})}function se(F){te?.value||g.mouseLeave({event:F,node:E})}function ue(F){return g.contextMenu({event:F,node:E})}function ye(F){return g.doubleClick({event:F,node:E})}function V(F){R.value&&(!o.value||!k.value||b.value>0)&&Pi(E,i.value,l,a,r,!1,G.value),g.click({event:F,node:E})}function I(F){if(!(Ci(F)||p.value))if(Ou.includes(F.key)&&R.value){const X=F.key==="Escape";Pi(E,i.value,l,a,r,X,G.value)}else k.value&&E.selected&&gn[F.key]&&(F.preventDefault(),v.value=`Moved selected node ${F.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~E.position.x}, y: ${~~E.position.y}`,T({x:gn[F.key].x,y:gn[F.key].y},F.shiftKey))}}}),Jb=Zb;function Qb(e={includeHiddenNodes:!1}){const{nodes:t}=Le();return oe(()=>{if(t.value.length===0)return!1;for(const n of t.value)if((e.includeHiddenNodes||!n.hidden)&&(n?.handleBounds===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const e1={class:"vue-flow__nodes vue-flow__container"},t1={name:"Nodes",compatConfig:{MODE:3}},n1=_e({...t1,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=Le(),r=Qb(),i=fe();return xe(r,s=>{s&&Nt(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),it(()=>{i.value=new ResizeObserver(s=>{const a=s.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));Nt(()=>n(a))})}),Xa(()=>{var s;return(s=i.value)==null?void 0:s.disconnect()}),(s,a)=>(q(),ee("div",e1,[i.value?(q(!0),ee(Ie,{key:0},rt(C(t),(l,u,c,d)=>{const h=[l.id];if(d&&d.key===l.id&&kc(d,h))return d;const f=(q(),be(C(Jb),{id:l.id,key:l.id,"resize-observer":i.value},null,8,["id","resize-observer"]));return f.memo=h,f},a,0),128)):ve("",!0)]))}});function o1(){const{emits:e}=Le();it(()=>{if(qu()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Ge(Be.MISSING_STYLES))}})}const r1=K("div",{class:"vue-flow__edge-labels"},null,-1),i1={name:"VueFlow",compatConfig:{MODE:3}},s1=_e({...i1,props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:t,emit:n}){const o=e,r=Ec(),i=zr(o,"modelValue",n),s=zr(o,"nodes",n),a=zr(o,"edges",n),l=Le(o),u=$w({modelValue:i,nodes:s,edges:a},o,l);return Bw(n,l.hooks),Mb(),o1(),vn(Cr,r),Ua(u),t(l),(c,d)=>(q(),ee("div",{ref:C(l).vueFlowRef,class:"vue-flow"},[ie(Nb,null,{default:pe(()=>[ie(Kb),r1,ie(n1),ke(c.$slots,"zoom-pane")]),_:3}),ke(c.$slots,"default"),ie(Db)],512))}}),a1={name:"Panel",compatConfig:{MODE:3}},l1=_e({...a1,props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=Le(),o=oe(()=>`${t.position}`.split("-"));return(r,i)=>(q(),ee("div",{class:He(["vue-flow__panel",o.value]),style:Xe({pointerEvents:C(n)?"none":"all"})},[ke(r.$slots,"default")],6))}});var At=(e=>(e.Lines="lines",e.Dots="dots",e))(At||{});const rc=function({dimensions:e,size:t,color:n}){return Ae("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},ic=function({radius:e,color:t}){return Ae("circle",{cx:e,cy:e,r:e,fill:t})};At.Lines+"",At.Dots+"";const u1={[At.Dots]:"#81818a",[At.Lines]:"#eee"},c1=["id","x","y","width","height","patternTransform"],d1={key:2,height:"100",width:"100"},f1=["fill"],h1=["x","y","fill"],p1={name:"Background",compatConfig:{MODE:3}},m1=_e({...p1,props:{id:{},variant:{default:()=>At.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:t,viewport:n}=Le(),o=oe(()=>{const s=n.value.zoom,[a,l]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],u=[a*s||1,l*s||1],c=e.size*s,[d,h]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],f=[d*s||1+u[0]/2,h*s||1+u[1]/2];return{scaledGap:u,offset:f,size:c}}),r=Oe(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),i=Oe(()=>e.color||e.patternColor||u1[e.variant||At.Dots]);return(s,a)=>(q(),ee("svg",{class:"vue-flow__background vue-flow__container",style:Xe({height:`${s.height>100?100:s.height}%`,width:`${s.width>100?100:s.width}%`})},[ke(s.$slots,"pattern-container",{id:r.value},()=>[K("pattern",{id:r.value,x:C(n).x%o.value.scaledGap[0],y:C(n).y%o.value.scaledGap[1],width:o.value.scaledGap[0],height:o.value.scaledGap[1],patternTransform:`translate(-${o.value.offset[0]},-${o.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[ke(s.$slots,"pattern",{},()=>[s.variant===C(At).Lines?(q(),be(C(rc),{key:0,size:s.lineWidth,color:i.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):s.variant===C(At).Dots?(q(),be(C(ic),{key:1,color:i.value,radius:o.value.size/2},null,8,["color","radius"])):ve("",!0),s.bgColor?(q(),ee("svg",d1,[K("rect",{width:"100%",height:"100%",fill:s.bgColor},null,8,f1)])):ve("",!0)])],8,c1)]),K("rect",{x:s.x,y:s.y,width:"100%",height:"100%",fill:`url(#${r.value})`},null,8,h1),ke(s.$slots,"default",{id:r.value})],4))}}),g1={name:"ControlButton",compatConfig:{MODE:3}},v1=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},_1={type:"button",class:"vue-flow__controls-button"};function y1(e,t,n,o,r,i){return q(),ee("button",_1,[ke(e.$slots,"default")])}const So=v1(g1,[["render",y1]]),w1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},b1=K("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1),E1=[b1];function x1(e,t){return q(),ee("svg",w1,E1)}const k1={render:x1},S1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},C1=K("path",{d:"M0 0h32v4.2H0z"},null,-1),T1=[C1];function P1(e,t){return q(),ee("svg",S1,T1)}const A1={render:P1},N1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},O1=K("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1),I1=[O1];function R1(e,t){return q(),ee("svg",N1,I1)}const L1={render:R1},D1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},M1=K("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"},null,-1),$1=[M1];function V1(e,t){return q(),ee("svg",D1,$1)}const B1={render:V1},z1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},F1=K("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1),H1=[F1];function G1(e,t){return q(),ee("svg",z1,H1)}const j1={render:G1},q1={name:"Controls",compatConfig:{MODE:3}},W1=_e({...q1,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>Pu.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:t}){const{nodesDraggable:n,nodesConnectable:o,elementsSelectable:r,setInteractive:i,zoomIn:s,zoomOut:a,fitView:l,viewport:u,minZoom:c,maxZoom:d}=Le(),h=Oe(()=>n.value||o.value||r.value),f=Oe(()=>u.value.zoom<=c.value),p=Oe(()=>u.value.zoom>=d.value);function v(){s(),t("zoomIn")}function y(){a(),t("zoomOut")}function _(){l(e.fitViewParams),t("fitView")}function b(){i(!h.value),t("interactionChange",!h.value)}return(m,w)=>(q(),be(C(l1),{class:"vue-flow__controls",position:m.position},{default:pe(()=>[ke(m.$slots,"top"),m.showZoom?(q(),ee(Ie,{key:0},[ke(m.$slots,"control-zoom-in",{},()=>[ie(So,{class:"vue-flow__controls-zoomin",disabled:p.value,onClick:v},{default:pe(()=>[ke(m.$slots,"icon-zoom-in",{},()=>[(q(),be(ot(C(k1))))])]),_:3},8,["disabled"])]),ke(m.$slots,"control-zoom-out",{},()=>[ie(So,{class:"vue-flow__controls-zoomout",disabled:f.value,onClick:y},{default:pe(()=>[ke(m.$slots,"icon-zoom-out",{},()=>[(q(),be(ot(C(A1))))])]),_:3},8,["disabled"])])],64)):ve("",!0),m.showFitView?ke(m.$slots,"control-fit-view",{key:1},()=>[ie(So,{class:"vue-flow__controls-fitview",onClick:_},{default:pe(()=>[ke(m.$slots,"icon-fit-view",{},()=>[(q(),be(ot(C(L1))))])]),_:3})]):ve("",!0),m.showInteractive?ke(m.$slots,"control-interactive",{key:2},()=>[m.showInteractive?(q(),be(So,{key:0,class:"vue-flow__controls-interactive",onClick:b},{default:pe(()=>[h.value?ke(m.$slots,"icon-unlock",{key:0},()=>[(q(),be(ot(C(j1))))]):ve("",!0),h.value?ve("",!0):ke(m.$slots,"icon-lock",{key:1},()=>[(q(),be(ot(C(B1))))])]),_:3})):ve("",!0)]):ve("",!0),ke(m.$slots,"default")]),_:3},8,["position"]))}}),U1={key:0,class:"space-y-2"},Y1={class:"flex items-center justify-between gap-2 text-[11px] text-muted-foreground"},X1={class:"shrink-0 font-mono"},K1=["title"],Z1={class:"line-clamp-2 text-sm font-medium leading-snug"},J1={class:"flex items-center justify-between gap-2 text-[11px] text-muted-foreground"},Q1={class:"flex items-center gap-1.5 text-[10px] uppercase tracking-wide"},eE={class:"rounded bg-background/60 px-1.5 py-0.5"},tE={class:"rounded bg-background/60 px-1.5 py-0.5"},nE={key:1,class:"space-y-1.5"},oE={class:"flex items-center gap-2 text-sm font-medium"},rE={class:"font-mono text-[11px] text-muted-foreground"},iE=_e({__name:"Node",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{}},setup(e){const t=e,n=oe(()=>t.data),o=oe(()=>n.value.kind==="task"?n.value:null),r=oe(()=>n.value.kind==="external"?n.value:null),i=oe(()=>{if(n.value.kind!=="task")return{label:"Missing dependency",icon:_n,class:"text-amber-600 dark:text-amber-400"};switch(n.value.status){case"completed":return{label:"Completed",icon:Do,class:"text-emerald-600 dark:text-emerald-400"};case"in_progress":return{label:"In Progress",icon:Za,class:"text-blue-600 dark:text-blue-400"};default:return{label:"Pending",icon:zn,class:"text-muted-foreground"}}}),s=oe(()=>n.value.kind!=="task"?null:n.value.priority.replace("_"," ")),a=oe(()=>n.value.kind!=="task"?null:n.value.category),l=oe(()=>n.value.kind==="external"?["border-amber-500/60 bg-amber-50/70 text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-100","border-dashed"]:n.value.status==="completed"?["border-emerald-500/40 bg-emerald-50/70 text-emerald-950 dark:border-emerald-500/40 dark:bg-emerald-500/10 dark:text-emerald-100","border-solid"]:n.value.status==="in_progress"?["border-blue-500/40 bg-blue-50/80 text-blue-950 dark:border-blue-500/40 dark:bg-blue-500/10 dark:text-blue-100","border-solid"]:["border-border bg-card text-card-foreground","border-solid"]),u=oe(()=>n.value.kind!=="task"||!n.value.showPrdLabel?null:n.value.prdName?.trim()||n.value.prdSlug);return(c,d)=>(q(),ee("div",{class:He(["w-[17rem] rounded-xl border px-3 py-2 shadow-sm transition-[transform,box-shadow,border-color] duration-150 ease-[var(--ease-out-cubic)] motion-reduce:transition-none",[C(l),e.selected?"ring-2 ring-primary/30 shadow-md":"hover:shadow-md hover:border-primary/40"]])},[ie(C(Sn),{type:"target",position:C(de).Top,class:"!h-2 !w-2 !border-0 !bg-transparent !opacity-0 !pointer-events-none"},null,8,["position"]),C(o)?(q(),ee("div",U1,[K("div",Y1,[K("span",X1,me(C(o).taskId),1),C(u)?(q(),ee("span",{key:0,title:`${C(o).prdName} (${C(o).prdSlug})`,class:"max-w-[11rem] truncate rounded border border-border bg-background/60 px-1.5 py-0.5 text-[10px]"},me(C(u)),9,K1)):ve("",!0)]),K("p",Z1,me(C(o).title),1),K("div",J1,[K("div",{class:He(["flex items-center gap-1.5",C(i).class])},[(q(),be(ot(C(i).icon),{class:"size-3.5"})),K("span",null,me(C(i).label),1)],2),K("div",Q1,[K("span",eE,me(C(a)),1),K("span",tE,me(C(s)),1)])])])):C(r)?(q(),ee("div",nE,[K("div",oE,[ie(C(_n),{class:"size-4"}),K("span",null,me(C(r).title),1)]),K("p",rE,me(C(r).dependencyRef),1)])):ve("",!0),ie(C(Sn),{type:"source",position:C(de).Bottom,class:"!h-2 !w-2 !border-0 !bg-transparent !opacity-0 !pointer-events-none"},null,8,["position"])],2))}}),Ma=Object.assign(iE,{__name:"GraphNode"}),sE={class:"relative h-full overflow-hidden rounded-lg border border-border bg-card"},aE={key:0,class:"flex h-full items-center justify-center"},lE={class:"flex flex-col items-center gap-2 text-sm text-muted-foreground"},uE={key:1,class:"flex h-full items-center justify-center p-6"},cE={class:"max-w-sm text-center"},dE={class:"mt-1 text-sm text-muted-foreground"},fE={key:2,class:"flex h-full items-center justify-center p-6"},hE={class:"max-w-sm text-center"},pE={class:"mt-1 text-sm text-muted-foreground"},mE={key:4,class:"pointer-events-none absolute top-3 left-3 z-10 rounded-md border border-border bg-background/95 p-2.5 shadow-sm"},gE={class:"space-y-1 text-xs"},vE={class:"flex items-center gap-1.5 text-muted-foreground"},_E={class:"flex items-center gap-1.5 text-blue-600 dark:text-blue-400"},yE={class:"flex items-center gap-1.5 text-emerald-600 dark:text-emerald-400"},wE={class:"flex items-center gap-1.5 text-amber-600 dark:text-amber-400"},bE={key:5,class:"pointer-events-none absolute top-3 right-3 z-10 rounded-md border border-border bg-background/95 p-2.5 shadow-sm"},EE={class:"flex flex-wrap items-center gap-1.5 text-[11px] text-muted-foreground"},xE={class:"rounded bg-muted px-1.5 py-0.5"},kE={class:"rounded bg-blue-500/10 px-1.5 py-0.5 text-blue-700 dark:text-blue-300"},SE={class:"rounded bg-emerald-500/10 px-1.5 py-0.5 text-emerald-700 dark:text-emerald-300"},CE={class:"rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-700 dark:text-amber-300"},TE=_e({__name:"Explorer",props:{payload:{},scope:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["taskClick"],setup(e,{emit:t}){const n=e,o=t,r={task:cn(Ma),external:cn(Ma)},i=gc("(prefers-reduced-motion: reduce)"),s=fe(0);xe(()=>[n.scope,n.payload?.scope,n.payload?.nodes.length,n.payload?.edges.length],()=>{s.value+=1},{deep:!1});const a=oe(()=>`${n.scope}-${s.value}`),l=oe(()=>n.payload?n.payload.nodes.some(y=>y.kind==="task"):!1),u=oe(()=>n.payload?.stats);function c(y,_){return y.kind==="external"?{width:272,height:80}:_==="repo"?{width:272,height:116}:{width:272,height:96}}function d(y){return y==="repo"?{ranksep:136,nodesep:88,edgesep:34,marginx:36,marginy:28}:{ranksep:102,nodesep:56,edgesep:20,marginx:24,marginy:22}}function h(y,_){const b=new Ws.graphlib.Graph,m=d(n.scope);b.setDefaultEdgeLabel(()=>({})),b.setGraph({rankdir:"TB",ranker:"network-simplex",...m});for(const w of y){const A=c(w.data,n.scope);b.setNode(w.id,A)}for(const w of _)b.setEdge(w.source,w.target);return Ws.layout(b),y.map(w=>{const A=c(w.data,n.scope),D=b.node(w.id);return D?{...w,targetPosition:de.Top,sourcePosition:de.Bottom,position:{x:D.x-A.width/2,y:D.y-A.height/2}}:w})}const f=oe(()=>n.payload?n.payload.edges.map(y=>({id:y.id,source:y.source,target:y.target,type:"step",animated:y.unresolved&&!i.value,markerEnd:{type:or.ArrowClosed,width:16,height:16},style:{strokeWidth:y.unresolved?1.4:1.7,stroke:y.unresolved?"var(--muted-foreground)":"var(--border)",strokeOpacity:y.unresolved?.62:.95,strokeDasharray:y.unresolved?"5 4":void 0}})):[]),p=oe(()=>{if(!n.payload)return[];const y=n.payload.nodes.map(_=>({id:_.id,type:_.kind,data:{..._,showPrdLabel:_.kind==="task"?n.scope==="repo":void 0},draggable:!1,selectable:_.kind==="task",connectable:!1,position:{x:0,y:0}}));return h(y,f.value)});function v(y){const b=y.node.data;!b||b.kind!=="task"||o("taskClick",{prdSlug:b.prdSlug,taskId:b.taskId})}return(y,_)=>(q(),ee("div",sE,[e.loading?(q(),ee("div",aE,[K("div",lE,[ie(C(Jr),{class:"size-5 animate-spin"}),_[0]||(_[0]=K("span",null,"Building graph...",-1))])])):e.error?(q(),ee("div",uE,[K("div",cE,[ie(C(Lo),{class:"mx-auto mb-3 size-8 text-destructive"}),_[1]||(_[1]=K("p",{class:"text-sm font-medium"},"Graph unavailable",-1)),K("p",dE,me(e.error),1)])])):!e.payload||!C(l)?(q(),ee("div",fE,[K("div",hE,[ie(C(Vc),{class:"mx-auto mb-3 size-8 text-muted-foreground/60"}),_[2]||(_[2]=K("p",{class:"text-sm font-medium"},"No graphable tasks yet",-1)),K("p",pE,me(e.scope==="repo"?"No PRDs with task state were found in this repository.":"This PRD does not have generated tasks yet."),1)])])):(q(),be(C(s1),{key:C(a),nodes:C(p),edges:C(f),"node-types":r,"fit-view-on-init":!0,"fit-view-on-init-options":{padding:.2},"nodes-draggable":!1,"nodes-connectable":!1,"elements-selectable":!0,"zoom-on-scroll":!0,"pan-on-drag":!0,"min-zoom":.2,"max-zoom":1.8,class:"h-full",onNodeClick:v},{default:pe(()=>[ie(C(m1),{gap:20,size:1.2,variant:"dots",color:"var(--border)"}),ie(C(W1),{position:"bottom-left","show-interactive":!1})]),_:1},8,["nodes","edges"])),e.payload&&C(l)?(q(),ee("div",mE,[_[7]||(_[7]=K("p",{class:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground"},"Legend",-1)),K("div",gE,[K("div",vE,[ie(C(zn),{class:"size-3.5"}),_[3]||(_[3]=Pe(" Pending ",-1))]),K("div",_E,[ie(C(Za),{class:"size-3.5"}),_[4]||(_[4]=Pe(" In Progress ",-1))]),K("div",yE,[ie(C(Do),{class:"size-3.5"}),_[5]||(_[5]=Pe(" Completed ",-1))]),K("div",wE,[ie(C(_n),{class:"size-3.5"}),_[6]||(_[6]=Pe(" Missing dependency ",-1))])])])):ve("",!0),C(u)&&C(l)?(q(),ee("div",bE,[K("div",EE,[K("span",xE,"Total "+me(C(u).total),1),K("span",kE,"WIP "+me(C(u).inProgress),1),K("span",SE,"Done "+me(C(u).completed),1),K("span",CE,"Missing "+me(C(u).unresolved),1)])])):ve("",!0)]))}}),Gk=Object.assign(TE,{__name:"GraphExplorer"}),PE={class:"space-y-0.5 p-2"},AE=["onClick"],NE={class:"min-w-0 flex-1"},OE=["title"],IE={class:"text-muted-foreground"},RE={class:"mt-1 flex h-1.5 w-full overflow-hidden rounded-full bg-muted"},LE={class:"flex shrink-0 items-center gap-1 text-xs"},DE={key:0,class:"text-green-600 dark:text-green-400"},ME={key:1,class:"text-red-600 dark:text-red-400"},$E={key:0,class:"py-4 text-center text-sm text-muted-foreground"},VE=_e({__name:"ChangesMinimap",props:{files:{},selectedFile:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,r=oe(()=>n.files.length===0?1:Math.max(...n.files.map(c=>c.additions+c.deletions),1));function i(c){switch(c){case"added":return{icon:ud,class:"text-green-600 dark:text-green-400"};case"deleted":return{icon:cd,class:"text-red-600 dark:text-red-400"};case"renamed":return{icon:ds,class:"text-blue-600 dark:text-blue-400"};default:return{icon:ld,class:"text-yellow-600 dark:text-yellow-400"}}}function s(c){const d=c.additions+c.deletions;if(d===0)return{additions:0,deletions:0,total:0};const h=d/r.value*100,f=c.additions/d*h,p=c.deletions/d*h;return{additions:f,deletions:p,total:h}}function a(c){return c.status==="renamed"&&c.oldPath?`${c.oldPath} → ${c.path}`:c.path}function l(c){return c.split("/").pop()||c}function u(c){o("select",c)}return(c,d)=>(q(),ee("div",PE,[(q(!0),ee(Ie,null,rt(e.files,h=>(q(),ee("button",{key:h.path,class:He(["group flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm transition-colors hover:bg-muted/50",{"bg-muted":e.selectedFile===h.path}]),onClick:f=>u(h.path)},[(q(),be(ot(i(h.status).icon),{class:He(["size-4 shrink-0",i(h.status).class])},null,8,["class"])),K("div",NE,[K("div",{class:He(["truncate text-xs",{"font-medium":e.selectedFile===h.path}]),title:a(h)},[h.status==="renamed"&&h.oldPath?(q(),ee(Ie,{key:0},[K("span",IE,me(l(h.oldPath)),1),ie(C(ds),{class:"mx-1 inline size-3 text-muted-foreground"}),K("span",null,me(l(h.path)),1)],64)):(q(),ee(Ie,{key:1},[Pe(me(h.path),1)],64))],10,OE),K("div",RE,[s(h).additions>0?(q(),ee("div",{key:0,class:"bg-green-500 dark:bg-green-400",style:Xe({width:`${s(h).additions}%`})},null,4)):ve("",!0),s(h).deletions>0?(q(),ee("div",{key:1,class:"bg-red-500 dark:bg-red-400",style:Xe({width:`${s(h).deletions}%`})},null,4)):ve("",!0)])]),K("div",LE,[h.additions>0?(q(),ee("span",DE," +"+me(h.additions),1)):ve("",!0),h.deletions>0?(q(),ee("span",ME," -"+me(h.deletions),1)):ve("",!0)])],10,AE))),128)),e.files.length===0?(q(),ee("div",$E," No files changed ")):ve("",!0)]))}}),BE=Object.assign(VE,{__name:"GitChangesMinimap"}),zE={class:"diff-viewer"},FE={key:0,class:"flex items-center justify-center py-8"},HE={key:1,class:"flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground"},GE={key:2,class:"flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground"},jE={key:3,class:"diff-container"},qE={class:"flex flex-col items-center justify-center gap-3 border-b border-border bg-muted/30 py-6"},WE={class:"text-center"},UE={class:"text-sm text-muted-foreground"},YE={key:4,class:"diff-container"},XE={class:"full-file-view"},KE={class:"diff-gutter"},ZE={class:"line-number"},JE={class:"diff-content"},QE=["innerHTML"],ex={key:5,class:"diff-container"},tx={class:"diff-toolbar"},nx={class:"diff-split"},ox={class:"diff-column-content"},rx={key:0,class:"diff-separator-half"},ix={class:"diff-gutter"},sx={key:0,class:"line-number"},ax={class:"diff-content"},lx=["innerHTML"],ux={class:"diff-column-content"},cx={key:0,class:"diff-separator-half"},dx={class:"diff-gutter"},fx={key:0,class:"line-number"},hx={class:"diff-content"},px=["innerHTML"],$a=1e4,mx=_e({__name:"DiffViewer",props:{hunks:{},filePath:{},binary:{type:Boolean},oldPath:{},fileContent:{},showFullFile:{type:Boolean},isLoadingContent:{type:Boolean}},setup(e){const t=e,n=fe(!1),o=fe(!0),r=fe(null),i=fe(null),s=fe(!1);function a(N){if(!o.value||s.value)return;const T=N.target;i.value&&(s.value=!0,i.value.scrollLeft=T.scrollLeft,requestAnimationFrame(()=>{s.value=!1}))}function l(N){if(!o.value||s.value)return;const T=N.target;r.value&&(s.value=!0,r.value.scrollLeft=T.scrollLeft,requestAnimationFrame(()=>{s.value=!1}))}const u=oe(()=>{let N=0;for(const T of t.hunks)N+=T.lines.length;return N}),c=oe(()=>u.value>$a),d=oe(()=>t.hunks.length===0&&!t.binary),h=oe(()=>{const N=new Set,T=new Set;for(const E of t.hunks)for(const P of E.lines)P.type==="add"&&P.newNumber!==void 0&&N.add(P.newNumber),P.type==="remove"&&P.oldNumber!==void 0&&T.add(P.oldNumber);return{added:N,removed:T}}),f=oe(()=>t.fileContent?t.fileContent.split(`
|
|
39
|
+
`):[]);function p(N){const T=N.split(".").pop()?.toLowerCase()||"";return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",vue:"vue",svelte:"svelte",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",kt:"kotlin",swift:"swift",dart:"dart",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",php:"php",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",xml:"xml",md:"markdown",mdx:"mdx",sh:"bash",bash:"bash",zsh:"bash",fish:"fish",ps1:"powershell",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"dockerfile",makefile:"makefile"}[T]||"text"}const v=oe(()=>p(t.filePath)),y=fe(new Map),_=fe(!0),b=oe(()=>{const N=[];for(let T=0;T<t.hunks.length;T++){const E=t.hunks[T];T>0&&N.push({type:"separator",hunkIndex:T});const P=E.lines;let g=0;for(;g<P.length;){const O=P[g];if(O.type==="context")N.push({type:"line",pair:{id:`${T}-${g}`,left:{lineNum:O.oldNumber,content:O.content,type:"context"},right:{lineNum:O.newNumber,content:O.content,type:"context"}}}),g++;else if(O.type==="remove"){const k=[],R=[];for(;g<P.length&&P[g].type==="remove";)k.push(P[g]),g++;for(;g<P.length&&P[g].type==="add";)R.push(P[g]),g++;const M=Math.max(k.length,R.length);for(let H=0;H<M;H++){const j=k[H],U=R[H];N.push({type:"line",pair:{id:`${T}-${g-M+H}`,left:j?{lineNum:j.oldNumber,content:j.content,type:"remove"}:{content:"",type:"empty"},right:U?{lineNum:U.newNumber,content:U.content,type:"add"}:{content:"",type:"empty"}}})}}else O.type==="add"&&N.push({type:"line",pair:{id:`${T}-${g}`,left:{content:"",type:"empty"},right:{lineNum:O.newNumber,content:O.content,type:"add"}}}),g++}}return N});async function m(N,T){if(!N.trim())return"";try{const P=(await qs(N,{lang:T,themes:{light:"catppuccin-latte",dark:"catppuccin-mocha"}})).match(/<code[^>]*>([\s\S]*?)<\/code>/);return P?P[1]||"":A(N)}catch{return A(N)}}async function w(N,T){if(!N)return[];try{const P=(await qs(N,{lang:T,themes:{light:"catppuccin-latte",dark:"catppuccin-mocha"}})).match(/<code[^>]*>([\s\S]*?)<\/code>/);return!P||!P[1]?N.split(`
|
|
40
|
+
`).map(A):P[1].split(`
|
|
41
|
+
`)}catch{return N.split(`
|
|
42
|
+
`).map(A)}}function A(N){return N.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const D=fe([]),z=fe(!1);xe(()=>[t.fileContent,t.filePath],async([N])=>{if(!N){D.value=[];return}z.value=!0;const T=v.value;D.value=await w(N,T),z.value=!1},{immediate:!0}),xe(()=>[t.hunks,t.filePath,D.value],async()=>{_.value=!0;const N=v.value,T=new Map,E=D.value,P=[];for(const O of b.value)if(O.type==="line"&&O.pair){if(O.pair.left.content&&O.pair.left.type!=="empty"){const k=`${O.pair.id}-old`;if(O.pair.left.type==="context"&&O.pair.left.lineNum&&E.length>0){const R=O.pair.right.lineNum?O.pair.right.lineNum-1:-1;R>=0&&R<E.length?T.set(k,E[R]||""):P.push({key:k,content:O.pair.left.content})}else P.push({key:k,content:O.pair.left.content})}if(O.pair.right.content&&O.pair.right.type!=="empty"){const k=`${O.pair.id}-new`,R=O.pair.right.lineNum;R&&E.length>0&&R<=E.length?T.set(k,E[R-1]||""):P.push({key:k,content:O.pair.right.content})}}const g=50;for(let O=0;O<P.length;O+=g){const k=P.slice(O,O+g),R=await Promise.all(k.map(async({key:M,content:H})=>{const j=await m(H,N);return{key:M,result:j}}));for(const{key:M,result:H}of R)T.set(M,H)}y.value=T,_.value=!1},{immediate:!0});function G(N,T){return y.value.get(`${N}-${T}`)||""}function Z(N){return h.value.added.has(N)?"add":"context"}return(N,T)=>(q(),ee("div",zE,[(C(_)||e.isLoadingContent||C(z))&&!e.binary?(q(),ee("div",FE,[...T[2]||(T[2]=[K("div",{class:"size-6 animate-spin rounded-full border-2 border-primary border-t-transparent"},null,-1)])])):e.binary?(q(),ee("div",HE,[ie(C(ad),{class:"size-10 opacity-50"}),T[3]||(T[3]=K("div",{class:"text-center"},[K("p",{class:"font-medium"},"Binary file"),K("p",{class:"text-sm"},"This file cannot be displayed as a diff")],-1))])):C(d)&&!e.showFullFile?(q(),ee("div",GE,[ie(C(_n),{class:"size-10 opacity-50"}),T[4]||(T[4]=K("div",{class:"text-center"},[K("p",{class:"font-medium"},"No changes"),K("p",{class:"text-sm"},"This file was touched but has no content changes")],-1))])):C(c)&&!C(n)&&!e.showFullFile?(q(),ee("div",jE,[K("div",qE,[ie(C(_n),{class:"size-8 text-yellow-500"}),K("div",WE,[T[5]||(T[5]=K("p",{class:"font-medium"},"Large file",-1)),K("p",UE," This file has "+me(C(u).toLocaleString())+" lines (threshold: "+me($a.toLocaleString())+") ",1)]),ie(C(Vt),{variant:"outline",size:"sm",onClick:T[0]||(T[0]=E=>n.value=!0)},{default:pe(()=>[ie(C(Bc),{class:"mr-2 size-4"}),T[6]||(T[6]=Pe(" Show full diff ",-1))]),_:1})])])):e.showFullFile&&e.fileContent?(q(),ee("div",YE,[K("div",XE,[(q(!0),ee(Ie,null,rt(C(f),(E,P)=>(q(),ee("div",{key:P,class:He(["full-file-line",{"diff-add":Z(P+1)==="add"}])},[K("div",KE,[K("span",ZE,me(P+1),1)]),K("div",JE,[K("span",{class:"diff-code",innerHTML:C(D)[P]||A(E)},null,8,QE)])],2))),128))])])):(q(),ee("div",ex,[K("div",tx,[ie(C(Vt),{variant:"ghost",size:"sm",class:He(["h-7 gap-1.5 text-xs",{"text-primary":C(o)}]),onClick:T[1]||(T[1]=E=>o.value=!C(o))},{default:pe(()=>[(q(),be(ot(C(o)?C(md):C(hd)),{class:"size-3.5"})),Pe(" "+me(C(o)?"Sync scroll":"Scroll unlocked"),1)]),_:1},8,["class"])]),K("div",nx,[K("div",{ref_key:"leftScrollRef",ref:r,class:"diff-column diff-column-left",onScroll:a},[K("div",ox,[(q(!0),ee(Ie,null,rt(C(b),E=>(q(),ee(Ie,{key:E.type==="line"?`left-${E.pair?.id}`:`left-sep-${E.hunkIndex}`},[E.type==="separator"?(q(),ee("div",rx,[...T[7]||(T[7]=[K("div",{class:"separator-line"},null,-1),K("span",{class:"separator-text"},"···",-1)])])):E.pair?(q(),ee("div",{key:1,class:He(["diff-line",{"diff-remove":E.pair.left.type==="remove","diff-empty":E.pair.left.type==="empty","diff-context":E.pair.left.type==="context"}])},[K("div",ix,[E.pair.left.lineNum?(q(),ee("span",sx,me(E.pair.left.lineNum),1)):ve("",!0)]),K("div",ax,[E.pair.left.type!=="empty"?(q(),ee("span",{key:0,class:"diff-code",innerHTML:G(E.pair.id,"old")||A(E.pair.left.content)},null,8,lx)):ve("",!0)])],2)):ve("",!0)],64))),128))])],544),K("div",{ref_key:"rightScrollRef",ref:i,class:"diff-column diff-column-right",onScroll:l},[K("div",ux,[(q(!0),ee(Ie,null,rt(C(b),E=>(q(),ee(Ie,{key:E.type==="line"?`right-${E.pair?.id}`:`right-sep-${E.hunkIndex}`},[E.type==="separator"?(q(),ee("div",cx,[...T[8]||(T[8]=[K("span",{class:"separator-text"},"···",-1),K("div",{class:"separator-line"},null,-1)])])):E.pair?(q(),ee("div",{key:1,class:He(["diff-line",{"diff-add":E.pair.right.type==="add","diff-empty":E.pair.right.type==="empty","diff-context":E.pair.right.type==="context"}])},[K("div",dx,[E.pair.right.lineNum?(q(),ee("span",fx,me(E.pair.right.lineNum),1)):ve("",!0)]),K("div",hx,[E.pair.right.type!=="empty"?(q(),ee("span",{key:0,class:"diff-code",innerHTML:G(E.pair.id,"new")||A(E.pair.right.content)},null,8,px)):ve("",!0)])],2)):ve("",!0)],64))),128))])],544)])]))]))}}),gx=Object.assign(Jc(mx,[["__scopeId","data-v-8fd455b9"]]),{__name:"GitDiffViewer"}),vx=_e({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const r=Ii(e,t);return(i,s)=>(q(),be(C(rh),tt({"data-slot":"tooltip"},C(r)),{default:pe(a=>[ke(i.$slots,"default",lr(ur(a)))]),_:3},16))}}),Va=Object.assign(vx,{__name:"UiTooltip"}),_x=_e({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=Ga(n,"class"),i=Ii(r,o);return(s,a)=>(q(),be(C(dh),null,{default:pe(()=>[ie(C(uh),tt({"data-slot":"tooltip-content"},{...C(i),...s.$attrs},{class:C(ja)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance",n.class)}),{default:pe(()=>[ke(s.$slots,"default"),ie(C(Jf),{class:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]),_:3},16,["class"])]),_:3}))}}),Ba=Object.assign(_x,{__name:"UiTooltipContent"}),yx=_e({__name:"TooltipProvider",props:{delayDuration:{default:0},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},setup(e){const t=e;return(n,o)=>(q(),be(C(th),lr(ur(t)),{default:pe(()=>[ke(n.$slots,"default")]),_:3},16))}}),za=Object.assign(yx,{__name:"UiTooltipProvider"}),wx=_e({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(n,o)=>(q(),be(C(hh),tt({"data-slot":"tooltip-trigger"},t),{default:pe(()=>[ke(n.$slots,"default")]),_:3},16))}}),Fa=Object.assign(wx,{__name:"UiTooltipTrigger"});function sc(){const{showError:e}=vc();function t(c){if(c&&typeof c=="object"){const d=c;return d.data?.message||d.data?.statusMessage||d.message||"Unknown error"}return"Unknown error"}const n=fe(!1),o=fe(!1),r=fe(!1),i=fe(!1);async function s(c,d,h){if(!c||d.length===0)return{commits:[],failedShas:[]};n.value=!0;try{const f={shas:d.join(",")};h&&(f.repo=h);const p=await $fetch(`/api/repos/${c}/git/commits`,{query:f}),v=p.map(_=>_.shortSha),y=d.filter(_=>!v.some(b=>b.startsWith(_)||_.startsWith(b)));return{commits:p,failedShas:y}}catch(f){return e("Failed to fetch commits",t(f)),{commits:[],failedShas:d}}finally{n.value=!1}}async function a(c,d,h){if(!c||!d)return[];o.value=!0;try{const f={commit:d};return h&&(f.repo=h),await $fetch(`/api/repos/${c}/git/diff`,{query:f})}catch(f){return e("Failed to fetch diff",t(f)),[]}finally{o.value=!1}}async function l(c,d,h,f){if(!c||!d||!h)return[];r.value=!0;try{const p={commit:d,file:h};return f&&(p.repo=f),await $fetch(`/api/repos/${c}/git/file-diff`,{query:p})}catch(p){return e("Failed to fetch file diff",t(p)),[]}finally{r.value=!1}}async function u(c,d,h,f){if(!c||!d||!h)return null;i.value=!0;try{const p={commit:d,file:h};return f&&(p.repo=f),(await $fetch(`/api/repos/${c}/git/file-content`,{query:p})).content}catch(p){return e("Failed to fetch file content",t(p)),null}finally{i.value=!1}}return{fetchCommits:s,fetchDiff:a,fetchFileDiff:l,fetchFileContent:u,isLoadingCommits:Ln(n),isLoadingDiff:Ln(o),isLoadingFileDiff:Ln(r),isLoadingFileContent:Ln(i)}}const bx={key:0,class:"flex flex-1 flex-col items-center justify-center gap-4 p-8"},Ex={class:"text-center"},xx={class:"text-sm text-muted-foreground"},kx={key:1,class:"flex flex-1 items-center justify-center"},Sx={key:2,class:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center text-muted-foreground"},Cx={key:3,class:"flex min-h-0 flex-1 overflow-hidden"},Tx={class:"flex w-56 shrink-0 flex-col border-r border-border"},Px={class:"flex items-center justify-between border-b border-border px-3 py-2"},Ax={class:"text-xs font-medium text-muted-foreground"},Nx={class:"text-muted-foreground/50 transition-colors hover:text-muted-foreground"},Ox={class:"min-h-0 flex-1 overflow-y-auto"},Ix={class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Rx={key:0,class:"flex items-center gap-2 border-b border-border px-4 py-2"},Lx={key:0,class:"min-w-0 flex-1 truncate font-mono text-sm"},Dx={class:"text-muted-foreground"},Mx={key:1,class:"min-w-0 flex-1 truncate font-mono text-sm"},$x={key:2,class:"rounded bg-yellow-500/10 px-1.5 py-0.5 text-xs text-yellow-600 dark:text-yellow-400"},Vx={key:1,class:"flex flex-1 items-center justify-center"},Bx={key:2,class:"flex flex-1 flex-col items-center justify-center gap-4 p-8"},zx={class:"text-center"},Fx={class:"text-xs text-muted-foreground"},Hx={key:4,class:"flex flex-1 items-center justify-center text-sm text-muted-foreground"},Gx=_e({__name:"DiffPanel",props:{repoId:{},commitSha:{},repoPath:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{fetchDiff:r,fetchFileDiff:i,fetchFileContent:s,isLoadingDiff:a,isLoadingFileDiff:l,isLoadingFileContent:u}=sc(),c=fe([]),d=fe(),h=fe([]),f=fe(null),p=fe(null),v=fe(null),y=fe("changes"),_=oe(()=>c.value.find(P=>P.path===d.value));async function b(){p.value=null,c.value=[],d.value=void 0,h.value=[];const P=await r(n.repoId,n.commitSha,n.repoPath);P.length===0&&!a.value&&(p.value=null),c.value=P,P.length>0&&(d.value=P[0].path)}async function m(){if(!d.value){h.value=[],f.value=null;return}v.value=null;const P=await i(n.repoId,n.commitSha,d.value,n.repoPath);if(h.value=P,y.value==="full"){const g=await s(n.repoId,n.commitSha,d.value,n.repoPath);f.value=g}}function w(){y.value=y.value==="changes"?"full":"changes"}xe(y,async P=>{if(P==="full"&&d.value&&!f.value){const g=await s(n.repoId,n.commitSha,d.value,n.repoPath);f.value=g}});function A(P){d.value=P}function D(){b()}function z(){m()}xe(d,()=>{m()}),xe(()=>[n.repoId,n.commitSha,n.repoPath],()=>{b()},{immediate:!0});const G=fe(null),Z=fe(null);function N(P){if(c.value.length===0)return;const g=d.value?c.value.findIndex(R=>R.path===d.value):-1;let O;P==="next"?O=g<c.value.length-1?g+1:0:O=g>0?g-1:c.value.length-1;const k=c.value[O];k&&(d.value=k.path)}function T(P){if(!Z.value)return;const g=Z.value.querySelectorAll(".diff-separator");if(g.length===0)return;const O=Z.value.closest(".overflow-y-auto, [data-radix-scroll-area-viewport]");if(!O)return;const k=O.scrollTop,R=O.getBoundingClientRect();let M=null;if(P==="next"){for(const H of g)if(H.getBoundingClientRect().top-R.top+k>k+50){M=H;break}!M&&g.length>0&&(M=g[0])}else{for(let H=g.length-1;H>=0;H--){const j=g[H];if(j.getBoundingClientRect().top-R.top+k<k-10){M=j;break}}!M&&g.length>0&&(M=g[g.length-1])}M&&M.scrollIntoView({behavior:"smooth",block:"start"})}function E(P){if(!(P.target instanceof HTMLInputElement||P.target instanceof HTMLTextAreaElement))switch(P.key){case"j":case"ArrowDown":!P.ctrlKey&&!P.metaKey&&(P.preventDefault(),N("next"));break;case"k":case"ArrowUp":!P.ctrlKey&&!P.metaKey&&(P.preventDefault(),N("prev"));break;case"[":P.preventDefault(),T("prev");break;case"]":P.preventDefault(),T("next");break;case"Escape":P.preventDefault(),o("close");break}}return it(()=>{document.addEventListener("keydown",E)}),Ua(()=>{document.removeEventListener("keydown",E)}),(P,g)=>{const O=BE,k=gx;return q(),ee("div",{ref_key:"panelRef",ref:G,class:"flex h-full flex-col overflow-hidden",tabindex:"-1"},[C(p)?(q(),ee("div",bx,[ie(C(Lo),{class:"size-12 text-destructive"}),K("div",Ex,[g[0]||(g[0]=K("p",{class:"font-medium"},"Failed to load diff",-1)),K("p",xx,me(C(p)),1)]),ie(C(Vt),{variant:"outline",size:"sm",onClick:D},{default:pe(()=>[ie(C(cs),{class:"mr-2 size-4"}),g[1]||(g[1]=Pe(" Retry ",-1))]),_:1})])):C(a)&&C(c).length===0?(q(),ee("div",kx,[ie(C(Jr),{class:"size-8 animate-spin text-muted-foreground"})])):C(c).length===0?(q(),ee("div",Sx,[...g[2]||(g[2]=[K("p",null,"No files changed in this commit",-1)])])):(q(),ee("div",Cx,[K("div",Tx,[K("div",Px,[K("span",Ax,me(C(c).length)+" file"+me(C(c).length!==1?"s":"")+" changed ",1),ie(C(za),null,{default:pe(()=>[ie(C(Va),null,{default:pe(()=>[ie(C(Fa),{"as-child":""},{default:pe(()=>[K("button",Nx,[ie(C(zc),{class:"size-3.5"})])]),_:1}),ie(C(Ba),{side:"bottom",align:"end",class:"max-w-xs"},{default:pe(()=>[...g[3]||(g[3]=[K("div",{class:"space-y-1 text-xs"},[K("div",{class:"flex justify-between gap-4"},[K("span",{class:"text-muted-foreground"},"Navigate files"),K("span",{class:"font-mono"},"j/k or ↑/↓")]),K("div",{class:"flex justify-between gap-4"},[K("span",{class:"text-muted-foreground"},"Jump to hunk"),K("span",{class:"font-mono"},"[ / ]")]),K("div",{class:"flex justify-between gap-4"},[K("span",{class:"text-muted-foreground"},"Close"),K("span",{class:"font-mono"},"Esc")])],-1)])]),_:1})]),_:1})]),_:1})]),K("div",Ox,[ie(O,{files:C(c),"selected-file":C(d),onSelect:A},null,8,["files","selected-file"])])]),K("div",Ix,[C(d)?(q(),ee("div",Rx,[C(_)?.oldPath?(q(),ee("span",Lx,[K("span",Dx,me(C(_).oldPath),1),g[4]||(g[4]=K("span",{class:"mx-2 text-muted-foreground"},"→",-1)),K("span",null,me(C(d)),1)])):(q(),ee("span",Mx,me(C(d)),1)),C(_)?.binary?(q(),ee("span",$x," binary ")):ve("",!0),C(_)?.binary?ve("",!0):(q(),be(C(za),{key:3},{default:pe(()=>[ie(C(Va),null,{default:pe(()=>[ie(C(Fa),{"as-child":""},{default:pe(()=>[ie(C(Vt),{variant:"ghost",size:"sm",class:"h-7 shrink-0 gap-1.5 text-xs",onClick:w},{default:pe(()=>[(q(),be(ot(C(y)==="changes"?C(sd):C(id)),{class:"size-3.5"})),Pe(" "+me(C(y)==="changes"?"Changes":"Full file"),1)]),_:1})]),_:1}),ie(C(Ba),null,{default:pe(()=>[Pe(me(C(y)==="changes"?"Show full file with changes":"Show changes only"),1)]),_:1})]),_:1})]),_:1}))])):ve("",!0),C(l)?(q(),ee("div",Vx,[ie(C(Jr),{class:"size-6 animate-spin text-muted-foreground"})])):C(v)?(q(),ee("div",Bx,[ie(C(Lo),{class:"size-8 text-destructive"}),K("div",zx,[g[5]||(g[5]=K("p",{class:"text-sm font-medium"},"Failed to load file diff",-1)),K("p",Fx,me(C(v)),1)]),ie(C(Vt),{variant:"outline",size:"sm",onClick:z},{default:pe(()=>[ie(C(cs),{class:"mr-2 size-4"}),g[6]||(g[6]=Pe(" Retry ",-1))]),_:1})])):C(d)?(q(),be(C(Fc),{key:3,class:"h-0 flex-1 overflow-hidden"},{default:pe(()=>[K("div",{ref_key:"diffViewerRef",ref:Z},[ie(k,{hunks:C(h),"file-path":C(d),binary:C(_)?.binary,"old-path":C(_)?.oldPath,"file-content":C(f),"show-full-file":C(y)==="full","is-loading-content":C(u)},null,8,["hunks","file-path","binary","old-path","file-content","show-full-file","is-loading-content"])],512)]),_:1})):(q(),ee("div",Hx," Select a file to view changes "))])]))],512)}}}),jx=Object.assign(Gx,{__name:"GitDiffPanel"}),qx={class:"space-y-2"},Wx={key:1,class:"rounded-lg border border-dashed p-4 text-center text-sm text-muted-foreground"},Ux=["onClick"],Yx={class:"flex items-start gap-3"},Xx={class:"min-w-0 flex-1"},Kx={class:"flex flex-wrap items-center gap-2"},Zx={class:"font-mono text-xs font-medium text-primary"},Jx={class:"flex items-center gap-1 text-xs text-muted-foreground"},Qx={class:"flex items-center gap-0.5 text-xs text-green-600 dark:text-green-400"},ek={class:"flex items-center gap-0.5 text-xs text-red-600 dark:text-red-400"},tk={class:"mt-1 truncate text-sm"},nk={key:1,class:"flex items-center gap-1 text-muted-foreground"},ok={key:2,class:"text-muted-foreground"},rk={key:0,class:"mt-1 text-xs text-muted-foreground"},ik=_e({__name:"CommitList",props:{commits:{},repoId:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{fetchCommits:r,isLoadingCommits:i}=sc(),s=fe(new Map),a=fe(new Set),l=oe(()=>new Set(n.commits.map(p=>p.repo).filter(Boolean)).size>1);xe(()=>({commits:n.commits,repoId:n.repoId}),async({commits:f,repoId:p})=>{if(f.length===0||!p){s.value=new Map,a.value=new Set;return}const v=new Map;for(const m of f){const w=m.repo||"";v.has(w)||v.set(w,[]),v.get(w).push(m.sha)}const y=await Promise.all(Array.from(v.entries()).map(async([m,w])=>{const A=await r(p,w,m||void 0);return{commits:A.commits.map(D=>({...D,repoPath:m})),failedShas:A.failedShas}})),_=new Map,b=new Set;for(const{commits:m,failedShas:w}of y){for(const A of m)_.set(A.shortSha,A);for(const A of w)b.add(A)}s.value=_,a.value=b},{immediate:!0});function u(f){const p=new Date(f),y=new Date().getTime()-p.getTime(),_=Math.floor(y/1e3),b=Math.floor(_/60),m=Math.floor(b/60),w=Math.floor(m/24);return _<60?"just now":b<60?`${b} minute${b===1?"":"s"} ago`:m<24?`${m} hour${m===1?"":"s"} ago`:w<7?`${w} day${w===1?"":"s"} ago`:p.toLocaleDateString()}function c(f){o("select",f.sha,f.repo)}function d(f){const p=s.value.get(f);if(p)return p;for(const[v,y]of s.value)if(v.startsWith(f)||f.startsWith(v))return y}function h(f){if(a.value.has(f))return!0;for(const p of a.value)if(p.startsWith(f)||f.startsWith(p))return!0;return!1}return(f,p)=>(q(),ee("div",qx,[C(i)?(q(!0),ee(Ie,{key:0},rt(Math.min(e.commits.length,3),v=>(q(),ee("div",{key:v,class:"animate-pulse rounded-lg border bg-muted/50 p-3"},[...p[0]||(p[0]=[Ac('<div class="flex items-start gap-3"><div class="h-5 w-5 rounded bg-muted"></div><div class="flex-1 space-y-2"><div class="h-4 w-20 rounded bg-muted"></div><div class="h-4 w-3/4 rounded bg-muted"></div><div class="h-3 w-1/2 rounded bg-muted"></div></div></div>',1)])]))),128)):e.commits.length===0?(q(),ee("div",Wx," No commits recorded for this task ")):(q(!0),ee(Ie,{key:2},rt(e.commits,v=>(q(),ee("button",{key:v.sha,class:"w-full rounded-lg border bg-card p-3 text-left transition-colors hover:bg-muted/50 focus:outline-none focus:ring-2 focus:ring-ring",onClick:y=>c(v)},[K("div",Yx,[ie(C(fd),{class:"mt-0.5 size-5 shrink-0 text-muted-foreground"}),K("div",Xx,[K("div",Kx,[K("code",Zx,me(d(v.sha)?.shortSha||v.sha.substring(0,7)),1),d(v.sha)?(q(),ee(Ie,{key:0},[K("span",Jx,[ie(C(_c),{class:"size-3"}),Pe(" "+me(d(v.sha).filesChanged),1)]),K("span",Qx,[ie(C(Hc),{class:"size-3"}),Pe(me(d(v.sha).additions),1)]),K("span",ek,[ie(C(vd),{class:"size-3"}),Pe(me(d(v.sha).deletions),1)])],64)):ve("",!0),v.repo&&C(l)?(q(),be(C(Co),{key:1,variant:"secondary",class:"gap-1 text-xs"},{default:pe(()=>[ie(C(dd),{class:"size-3"}),Pe(" "+me(v.repo),1)]),_:2},1024)):ve("",!0)]),K("p",tk,[d(v.sha)?(q(),ee(Ie,{key:0},[Pe(me(d(v.sha).message),1)],64)):h(v.sha)?(q(),ee("span",nk,[ie(C(Lo),{class:"size-3"}),p[1]||(p[1]=Pe(" Commit unavailable ",-1))])):(q(),ee("span",ok,"Loading..."))]),d(v.sha)?(q(),ee("p",rk,me(d(v.sha).author)+" · "+me(u(d(v.sha).date)),1)):ve("",!0)])])],8,Ux))),128))]))}}),sk=Object.assign(ik,{__name:"GitCommitList"}),ak=_e({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,n=Ga(t,"class");return(o,r)=>(q(),be(C(Gc),tt({"data-slot":"separator"},C(n),{class:C(ja)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t.class)}),null,16,["class"]))}}),an=Object.assign(ak,{__name:"UiSeparator"}),lk={class:"flex items-center gap-2"},uk={key:1,class:"min-h-0 flex-1 overflow-hidden"},ck={key:2,class:"min-h-0 flex-1 space-y-4 overflow-y-auto px-6"},dk={class:"flex flex-wrap items-center gap-2"},fk={class:"space-y-2"},hk={class:"text-sm text-muted-foreground leading-relaxed"},pk={key:0,class:"space-y-2"},mk={class:"flex items-center gap-2 text-sm font-medium"},gk={class:"ml-4 list-decimal space-y-1 text-sm text-muted-foreground"},vk={key:2,class:"space-y-2"},_k={class:"flex items-center gap-2 text-sm font-medium"},yk={class:"space-y-1.5 text-sm text-muted-foreground"},wk={key:4,class:"space-y-2"},bk={class:"flex items-center gap-2 text-sm font-medium"},Ek={class:"space-y-1 text-sm text-muted-foreground"},xk={class:"font-mono text-xs"},kk={class:"space-y-2"},Sk={class:"flex items-center gap-2 text-sm font-medium"},Ck={key:6,class:"space-y-2"},Tk={class:"flex flex-col gap-1 text-xs text-muted-foreground"},Pk={key:0,class:"flex items-center gap-2"},Ak={key:1,class:"flex items-center gap-2"},Nk={key:7,class:"space-y-2"},Ok={class:"flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-sm"},Ik={class:"text-muted-foreground"},Rk=_e({__name:"Detail",props:Oc({task:{},taskTitles:{},commits:{},repoId:{},taskPrdSlug:{},currentPrdSlug:{}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(e){const t=e,n=Nc(e,"open"),o=oe(()=>{if(!t.task)return{label:"",variant:"secondary"};switch(t.task.category){case"setup":return{label:"Setup",variant:"secondary"};case"feature":return{label:"Feature",variant:"default"};case"integration":return{label:"Integration",variant:"outline"};case"testing":return{label:"Testing",variant:"secondary"};case"documentation":return{label:"Docs",variant:"secondary"};default:return{label:t.task.category,variant:"secondary"}}}),r=oe(()=>{if(!t.task)return{label:"",class:""};switch(t.task.priority){case"critical":return{label:"Critical",class:"text-destructive"};case"high":return{label:"High",class:"text-orange-500"};case"medium":return{label:"Medium",class:"text-muted-foreground"};case"low":return{label:"Low",class:"text-muted-foreground"};default:return{label:t.task.priority,class:"text-muted-foreground"}}}),i=oe(()=>{if(!t.task)return{label:"",icon:zn,class:""};switch(t.task.status){case"pending":return{label:"Pending",icon:zn,class:"text-muted-foreground"};case"in_progress":return{label:"In Progress",icon:nd,class:"text-blue-500"};case"completed":return{label:"Completed",icon:Do,class:"text-green-500"};default:return{label:t.task.status,icon:zn,class:"text-muted-foreground"}}});function s(y){if(!y)return"";try{return new Date(y).toLocaleString()}catch{return y}}function a(y){return t.taskTitles?.get(y)??y}const l=oe(()=>t.commits&&t.commits.length>0&&t.repoId),u=oe(()=>!t.repoId||!t.taskPrdSlug?!1:t.currentPrdSlug?t.taskPrdSlug!==t.currentPrdSlug:!0),c=oe(()=>{if(!u.value||!t.repoId||!t.taskPrdSlug||!t.task)return"";const y=new URLSearchParams({task:t.task.id,taskPrd:t.taskPrdSlug});return`/${t.repoId}/${t.taskPrdSlug}?${y.toString()}`}),d=fe("details"),h=fe(null),f=fe(null);function p(y,_){h.value=y,f.value=_||null,d.value="diff"}function v(){d.value="details",h.value=null,f.value=null}return xe(()=>t.task,()=>{d.value="details",h.value=null,f.value=null}),xe(n,y=>{y||(d.value="details",h.value=null,f.value=null)}),(y,_)=>{const b=jx,m=sk,w=Qc;return q(),be(C(Kc),{open:n.value,"onUpdate:open":_[0]||(_[0]=A=>n.value=A)},{default:pe(()=>[ie(C(Xc),{class:He(["flex h-full w-full flex-col overflow-hidden sm:max-w-lg",C(d)==="diff"?"sm:!max-w-[94vw] xl:!max-w-[88vw]":""])},{default:pe(()=>[e.task?(q(),be(C(jc),{key:0,class:"px-6 pr-12"},{default:pe(()=>[K("div",lk,[C(d)==="diff"?(q(),be(C(Vt),{key:0,variant:"ghost",size:"icon",class:"size-8 shrink-0",onClick:v},{default:pe(()=>[ie(C(ed),{class:"size-4"})]),_:1})):ve("",!0),ie(C(qc),{class:"text-left text-lg"},{default:pe(()=>[Pe(me(C(d)==="diff"?"Commit Changes":e.task.title),1)]),_:1})]),ie(C(Wc),{class:"sr-only"},{default:pe(()=>[..._[1]||(_[1]=[Pe("Task details",-1)])]),_:1})]),_:1})):ve("",!0),e.task&&C(d)==="diff"&&C(h)&&e.repoId?(q(),ee("div",uk,[ie(b,{"repo-id":e.repoId,"commit-sha":C(h),"repo-path":C(f)||void 0,class:"h-full",onClose:v},null,8,["repo-id","commit-sha","repo-path"])])):e.task?(q(),ee("div",ck,[K("div",dk,[ie(C(Co),{variant:C(o).variant},{default:pe(()=>[ie(C(yd),{class:"mr-1 size-3"}),Pe(" "+me(C(o).label),1)]),_:1},8,["variant"]),ie(C(Co),{variant:"outline",class:He(C(r).class)},{default:pe(()=>[ie(C(_n),{class:"mr-1 size-3"}),Pe(" "+me(C(r).label),1)]),_:1},8,["class"]),ie(C(Co),{variant:"outline",class:He(C(i).class)},{default:pe(()=>[(q(),be(ot(C(i).icon),{class:"mr-1 size-3"})),Pe(" "+me(C(i).label),1)]),_:1},8,["class"])]),K("div",fk,[_[2]||(_[2]=K("h4",{class:"text-sm font-medium"},"Description",-1)),K("p",hk,me(e.task.description),1)]),ie(C(an)),e.task.steps.length>0?(q(),ee("div",pk,[K("h4",mk,[ie(C(gd),{class:"size-4"}),_[3]||(_[3]=Pe(" Steps ",-1))]),K("ol",gk,[(q(!0),ee(Ie,null,rt(e.task.steps,(A,D)=>(q(),ee("li",{key:D,class:"pl-1"},me(A),1))),128))])])):ve("",!0),e.task.steps.length>0&&e.task.passes.length>0?(q(),be(C(an),{key:1})):ve("",!0),e.task.passes.length>0?(q(),ee("div",vk,[K("h4",_k,[ie(C(_d),{class:"size-4"}),_[4]||(_[4]=Pe(" Pass Criteria ",-1))]),K("ul",yk,[(q(!0),ee(Ie,null,rt(e.task.passes,(A,D)=>(q(),ee("li",{key:D,class:"flex items-start gap-2"},[K("div",{class:He(["mt-0.5 flex size-4 shrink-0 items-center justify-center rounded border",e.task.status==="completed"?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/50"])},[e.task.status==="completed"?(q(),be(C(Zc),{key:0,class:"size-3"})):ve("",!0)],2),K("span",null,me(A),1)]))),128))])])):ve("",!0),e.task.dependencies.length>0?(q(),be(C(an),{key:3})):ve("",!0),e.task.dependencies.length>0?(q(),ee("div",wk,[K("h4",bk,[ie(C(pd),{class:"size-4"}),_[5]||(_[5]=Pe(" Dependencies ",-1))]),K("ul",Ek,[(q(!0),ee(Ie,null,rt(e.task.dependencies,A=>(q(),ee("li",{key:A,class:"flex items-center gap-2"},[K("span",xk,me(A),1),K("span",null,me(a(A)),1)]))),128))])])):ve("",!0),C(l)?(q(),ee(Ie,{key:5},[ie(C(an)),K("div",kk,[K("h4",Sk,[ie(C(od),{class:"size-4"}),_[6]||(_[6]=Pe(" Changes ",-1))]),ie(m,{commits:e.commits,"repo-id":e.repoId,onSelect:p},null,8,["commits","repo-id"])])],64)):ve("",!0),e.task.startedAt||e.task.completedAt?(q(),ee("div",Ck,[ie(C(an)),K("div",Tk,[e.task.startedAt?(q(),ee("div",Pk,[ie(C(td),{class:"size-3"}),K("span",null,"Started: "+me(s(e.task.startedAt)),1)])):ve("",!0),e.task.completedAt?(q(),ee("div",Ak,[ie(C(Do),{class:"size-3"}),K("span",null,"Completed: "+me(s(e.task.completedAt)),1)])):ve("",!0)])])):ve("",!0),C(u)?(q(),ee("div",Nk,[ie(C(an)),K("div",Ok,[K("span",Ik,"This task belongs to "+me(e.taskPrdSlug)+".",1),ie(w,{to:C(c)},{default:pe(()=>[ie(C(Vt),{variant:"outline",size:"sm",class:"h-8"},{default:pe(()=>[ie(C(rd),{class:"mr-1.5 size-3.5"}),_[7]||(_[7]=Pe(" Open PRD ",-1))]),_:1})]),_:1},8,["to"])])])):ve("",!0)])):ve("",!0),ie(C(Uc),{class:"px-6 pb-6"},{default:pe(()=>[ie(C(Yc),{"as-child":""},{default:pe(()=>[ie(C(Vt),{variant:"outline",class:"w-full"},{default:pe(()=>[..._[8]||(_[8]=[Pe("Close",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["class"])]),_:1},8,["open"])}}}),jk=Object.assign(Rk,{__name:"TasksDetail"});export{td as C,rd as E,vd as M,jk as _,zn as a,Do as b,qs as c,Gk as d};
|