@reddb-io/ui 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/build/_app/immutable/assets/0.DQDLkSdR.css +1 -0
  2. package/build/_app/immutable/assets/Workspace.CvP5De7i.css +1 -0
  3. package/build/_app/immutable/chunks/65XjEwaF.js +367 -0
  4. package/build/_app/immutable/chunks/BjFADNkA.js +992 -0
  5. package/build/_app/immutable/chunks/{ALqaDrNQ.js → C278awGv.js} +1 -1
  6. package/build/_app/immutable/chunks/{Ov8N-vxt.js → C9rXzYLu.js} +1 -1
  7. package/build/_app/immutable/chunks/CDKIdLnm.js +187 -0
  8. package/build/_app/immutable/chunks/{DXY_Rxa7.js → CXNPJgv1.js} +7 -7
  9. package/build/_app/immutable/chunks/{Bgso8cDH.js → DqvWKbSc.js} +1 -1
  10. package/build/_app/immutable/chunks/pDJnDxXM.js +1 -0
  11. package/build/_app/immutable/entry/app.DdaMXHAv.js +2 -0
  12. package/build/_app/immutable/entry/start.-MLBtQXB.js +1 -0
  13. package/build/_app/immutable/nodes/{0.CHPiFxDo.js → 0.Ysoz3Y3h.js} +1 -1
  14. package/build/_app/immutable/nodes/{1.BC_4YZ0h.js → 1.C2jbGTOJ.js} +1 -1
  15. package/build/_app/immutable/nodes/11.CAG5_cGP.js +1 -0
  16. package/build/_app/immutable/nodes/{10.B7DMKSNc.js → 12.DQG5zpEx.js} +5 -5
  17. package/build/_app/immutable/nodes/7.CAG5_cGP.js +1 -0
  18. package/build/_app/immutable/nodes/{7.BZX9Iird.js → 8.CrHI4F9p.js} +1 -1
  19. package/build/_app/version.json +1 -1
  20. package/build/index.html +12 -12
  21. package/dist/embed/{RedUiEmbedRoot-BGoLxJf1.js → RedUiEmbedRoot-BwFUA5X-.js} +12715 -10653
  22. package/dist/embed/RedUiEmbedRoot-BwFUA5X-.js.map +1 -0
  23. package/dist/embed/index-DGhgtnaK.js +577 -0
  24. package/dist/embed/{index-B6ZQhCsu.js.map → index-DGhgtnaK.js.map} +1 -1
  25. package/dist/embed/{index-fad77a13.esm-BqPj0saH.js → index-fad77a13.esm-BMULHdcE.js} +22 -20
  26. package/dist/embed/{index-fad77a13.esm-BqPj0saH.js.map → index-fad77a13.esm-BMULHdcE.js.map} +1 -1
  27. package/dist/embed/index.js +1 -1
  28. package/dist/embed/sigma-edge-curve.esm-CAT5Xrom.js +536 -0
  29. package/dist/embed/sigma-edge-curve.esm-CAT5Xrom.js.map +1 -0
  30. package/dist/embed/{sigma-node-border.esm-CGtlgqmo.js → sigma-node-border.esm-Bnk4BRbw.js} +32 -32
  31. package/dist/embed/{sigma-node-border.esm-CGtlgqmo.js.map → sigma-node-border.esm-Bnk4BRbw.js.map} +1 -1
  32. package/dist/embed/{sigma.esm-y0qgY-OC.js → sigma.esm-D5yoExsH.js} +3 -3
  33. package/dist/embed/{sigma.esm-y0qgY-OC.js.map → sigma.esm-D5yoExsH.js.map} +1 -1
  34. package/package.json +5 -3
  35. package/src/lib/Appearance.svelte +90 -0
  36. package/src/lib/CommandPalette.svelte +2 -0
  37. package/src/lib/SettingsView.svelte +376 -0
  38. package/src/lib/Topbar.svelte +15 -1
  39. package/src/lib/Workspace.svelte +14 -1
  40. package/src/lib/index.ts +2 -0
  41. package/src/lib/renderers/GraphRenderer.svelte +448 -44
  42. package/src/lib/renderers/graph-bundle.ts +401 -0
  43. package/src/lib/renderers/graph-communities.ts +193 -0
  44. package/src/lib/renderers/graph-render.ts +48 -5
  45. package/src/lib/renderers/graph-sigma.ts +274 -8
  46. package/src/lib/router.svelte.ts +84 -57
  47. package/src/lib/settings-sections.ts +267 -0
  48. package/src/lib/skins/skins.svelte.ts +64 -0
  49. package/src/lib/skins/skins.ts +178 -0
  50. package/build/_app/immutable/assets/0.C63jY5jX.css +0 -1
  51. package/build/_app/immutable/assets/Workspace.BCzG1DsH.css +0 -1
  52. package/build/_app/immutable/chunks/BMHKbvs8.js +0 -1
  53. package/build/_app/immutable/chunks/BQHbwf54.js +0 -916
  54. package/build/_app/immutable/chunks/Bmgx1mfv.js +0 -310
  55. package/build/_app/immutable/entry/app.D_IVtpdv.js +0 -2
  56. package/build/_app/immutable/entry/start.3oC0UQ_Q.js +0 -1
  57. package/dist/embed/RedUiEmbedRoot-BGoLxJf1.js.map +0 -1
  58. package/dist/embed/index-B6ZQhCsu.js +0 -577
  59. /package/build/_app/immutable/assets/{10.Dblyk0Kr.css → 12.Dblyk0Kr.css} +0 -0
  60. /package/build/_app/immutable/nodes/{8.CAG5_cGP.js → 10.CAG5_cGP.js} +0 -0
@@ -1,310 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ALqaDrNQ.js","./Bgso8cDH.js","./DXY_Rxa7.js"])))=>i.map(i=>d[i]);
2
- var ka=Object.defineProperty;var Ri=n=>{throw TypeError(n)};var Sa=(n,e,t)=>e in n?ka(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Se=(n,e,t)=>Sa(n,typeof e!="symbol"?e+"":e,t),Aa=(n,e,t)=>e.has(n)||Ri("Cannot "+t);var we=(n,e,t)=>(Aa(n,e,"read from private field"),t?t.call(n):e.get(n)),at=(n,e,t)=>e.has(n)?Ri("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t);import"./Bzak7iHL.js";import"./69_IOA4Y.js";import{a5 as sn,Z as ti,h as Rs,ay as je,be as hr,ar as Ns,aw as ln,am as l,a$ as $a,r as Da,bj as Ni,bf as er,ax as Qt,e as La,o as Ca,aD as Ui,a6 as Ot,k as Dt,_ as Nr,ad as Ga,bh as Ia,ab as Ta,aG as Us,X as ri,j as Oa,i as Ra,aP as Na,bk as Pi,E as Ua,D as Pa,b4 as Ps,aV as zs,I as $n,a_ as Ws,c as za,g as Wa,a1 as ja,aO as Ma,ac as dn,as as Ba,m as js,n as Fa,a4 as Ka,w as Ha,Q as qa,bo as Ms,aM as Bs,ae as ni,C as zi,J as Wi,b8 as Va,aF as Ya,aL as ii,ak as Ja,u as Xa,b as Za,N as Qa,at as eu,A as tu,aq as ru,t as Xr,Y as nu,U as iu,F as su,W as ou,bq as au,bs as $t,b2 as Fs,a2 as uu,bx as cu,bw as Ft,b5 as lu,b6 as ji,a7 as dr,aa as du,bl as he,b9 as U,aY as fr,aZ as Ks,aW as Hs,a0 as G,aj as Ie,bi as R,b3 as L,bv as de,br as on,aT as fu,aU as hu,aQ as Wt,bp as fe,b1 as pu}from"./oiO4RLqp.js";import{b as gu,n as vu,m as yu,h as ke,g as qs,f as bu,p as mu,c as wu,a as j,k as br,d as Je,j as ie,s as re,i as Dn,t as Ln}from"./BGcIe2ep.js";import{B as Vs,_ as fn,l as rt,p as ur,s as ht,i as _e,b as _u,c as Eu}from"./D9CTkMjK.js";function an(n,e){return e}function xu(n,e,t){for(var r=[],i=e.length,s,a=e.length,o=0;o<i;o++){let f=e[o];zs(f,()=>{if(s){if(s.pending.delete(f),s.done.add(f),s.pending.size===0){var h=n.outrogroups;Qn(n,ri(s.done)),h.delete(s),h.size===0&&(n.outrogroups=null)}}else a-=1},!1)}if(a===0){var u=r.length===0&&t!==null;if(u){var c=t,d=c.parentNode;ja(d),d.append(c),n.items.clear()}Qn(n,e,!u)}else s={pending:new Set(e),done:new Set},(n.outrogroups??(n.outrogroups=new Set)).add(s)}function Qn(n,e,t=!0){var r;if(n.pending.size>0){r=new Set;for(const a of n.pending.values())for(const o of a)r.add(n.items.get(o).e)}for(var i=0;i<e.length;i++){var s=e[i];if(r!=null&&r.has(s)){s.f|=Dt;const a=document.createDocumentFragment();Ma(s,a)}else dn(e[i],t)}}var Mi;function mt(n,e,t,r,i,s=null){var a=n,o=new Map,u=(e&Rs)!==0;if(u){var c=n;a=je?hr(Ns(c)):c.appendChild(sn())}je&&ln();var d=null,f=Ta(()=>{var _=t();return Us(_)?_:_==null?[]:ri(_)}),h,g=new Map,k=!0;function A(_){(T.effect.f&Pa)===0&&(T.pending.delete(_),T.fallback=d,ku(T,h,a,e,r),d!==null&&(h.length===0?(d.f&Dt)===0?Ps(d):(d.f^=Dt,Or(d,null,a)):zs(d,()=>{d=null})))}function y(_){T.pending.delete(_)}var b=ti(()=>{h=l(f);var _=h.length;let p=!1;if(je){var S=$a(a)===Da;S!==(_===0)&&(a=Ni(),hr(a),er(!1),p=!0)}for(var w=new Set,x=Ot,D=Ia(),C=0;C<_;C+=1){je&&Qt.nodeType===La&&Qt.data===Ca&&(a=Qt,p=!0,er(!1));var I=h[C],te=r(I,C),N=k?null:o.get(te);N?(N.v&&Ui(N.v,I),N.i&&Ui(N.i,C),D&&x.unskip_effect(N.e)):(N=Su(o,k?a:Mi??(Mi=sn()),I,te,C,i,e,t),k||(N.e.f|=Dt),o.set(te,N)),w.add(te)}if(_===0&&s&&!d&&(k?d=Nr(()=>s(a)):(d=Nr(()=>s(Mi??(Mi=sn()))),d.f|=Dt)),_>w.size&&Ga(),je&&_>0&&hr(Ni()),!k)if(g.set(x,w),D){for(const[v,Me]of o)w.has(v)||x.skip_effect(Me.e);x.oncommit(A),x.ondiscard(y)}else A(x);p&&er(!0),l(f)}),T={effect:b,items:o,pending:g,outrogroups:null,fallback:d};k=!1,je&&(a=Qt)}function Ar(n){for(;n!==null&&(n.f&za)===0;)n=n.next;return n}function ku(n,e,t,r,i){var I,te,N,v,Me,Be,O,m,F;var s=(r&Wa)!==0,a=e.length,o=n.items,u=Ar(n.effect.first),c,d=null,f,h=[],g=[],k,A,y,b;if(s)for(b=0;b<a;b+=1)k=e[b],A=i(k,b),y=o.get(A).e,(y.f&Dt)===0&&((te=(I=y.nodes)==null?void 0:I.a)==null||te.measure(),(f??(f=new Set)).add(y));for(b=0;b<a;b+=1){if(k=e[b],A=i(k,b),y=o.get(A).e,n.outrogroups!==null)for(const H of n.outrogroups)H.pending.delete(y),H.done.delete(y);if((y.f&$n)!==0&&(Ps(y),s&&((v=(N=y.nodes)==null?void 0:N.a)==null||v.unfix(),(f??(f=new Set)).delete(y))),(y.f&Dt)!==0)if(y.f^=Dt,y===u)Or(y,null,t);else{var T=d?d.next:u;y===n.effect.last&&(n.effect.last=y.prev),y.prev&&(y.prev.next=y.next),y.next&&(y.next.prev=y.prev),jt(n,d,y),jt(n,y,T),Or(y,T,t),d=y,h=[],g=[],u=Ar(d.next);continue}if(y!==u){if(c!==void 0&&c.has(y)){if(h.length<g.length){var _=g[0],p;d=_.prev;var S=h[0],w=h[h.length-1];for(p=0;p<h.length;p+=1)Or(h[p],_,t);for(p=0;p<g.length;p+=1)c.delete(g[p]);jt(n,S.prev,w.next),jt(n,d,S),jt(n,w,_),u=_,d=w,b-=1,h=[],g=[]}else c.delete(y),Or(y,u,t),jt(n,y.prev,y.next),jt(n,y,d===null?n.effect.first:d.next),jt(n,d,y),d=y;continue}for(h=[],g=[];u!==null&&u!==y;)(c??(c=new Set)).add(u),g.push(u),u=Ar(u.next);if(u===null)continue}(y.f&Dt)===0&&h.push(y),d=y,u=Ar(y.next)}if(n.outrogroups!==null){for(const H of n.outrogroups)H.pending.size===0&&(Qn(n,ri(H.done)),(Me=n.outrogroups)==null||Me.delete(H));n.outrogroups.size===0&&(n.outrogroups=null)}if(u!==null||c!==void 0){var x=[];if(c!==void 0)for(y of c)(y.f&$n)===0&&x.push(y);for(;u!==null;)(u.f&$n)===0&&u!==n.fallback&&x.push(u),u=Ar(u.next);var D=x.length;if(D>0){var C=(r&Rs)!==0&&a===0?t:null;if(s){for(b=0;b<D;b+=1)(O=(Be=x[b].nodes)==null?void 0:Be.a)==null||O.measure();for(b=0;b<D;b+=1)(F=(m=x[b].nodes)==null?void 0:m.a)==null||F.fix()}xu(n,x,C)}}s&&Ws(()=>{var H,ne;if(f!==void 0)for(y of f)(ne=(H=y.nodes)==null?void 0:H.a)==null||ne.apply()})}function Su(n,e,t,r,i,s,a,o){var u=(a&Oa)!==0?(a&Ra)===0?Na(t,!1,!1):Pi(t):null,c=(a&Ua)!==0?Pi(i):null;return{v:u,i:c,e:Nr(()=>(s(e,u??t,c??i,o),()=>{n.delete(r)}))}}function Or(n,e,t){if(n.nodes)for(var r=n.nodes.start,i=n.nodes.end,s=e&&(e.f&Dt)===0?e.nodes.start:t;r!==null;){var a=Ba(r);if(s.before(r),r===i)return;r=a}}function jt(n,e,t){e===null?n.effect.first=t:e.next=t,t===null?n.effect.last=e:t.prev=e}function ct(n,e,t,r,i){var o;je&&ln();var s=(o=e.$$slots)==null?void 0:o[t],a=!1;s===!0&&(s=e.children,a=!0),s===void 0||s(n,a?()=>r:r)}function Au(n,e,...t){var r=new Vs(n);ti(()=>{const i=e()??null;r.ensure(i,i&&(s=>i(s,...t)))},js)}function $u(n,e,t,r,i,s){let a=je;je&&ln();var o=null;je&&Qt.nodeType===Fa&&(o=Qt,ln());var u=je?Qt:n,c=new Vs(u,!1);ti(()=>{const d=e()||null;var f=Ha;if(d===null){c.ensure(null,null);return}return c.ensure(d,h=>{if(d){if(o=je?o:Ka(d,f),gu(o,o),r){je&&vu(d)&&o.append(document.createComment(""));var g=je?Ns(o):o.appendChild(sn());je&&(g===null?er(!1):hr(g)),r(o,g)}qa.nodes.end=o,h.before(o)}je&&hr(h)}),()=>{}},js),Ms(()=>{}),a&&(er(!0),hr(u))}function Du(n,e){var t=void 0,r;Bs(()=>{t!==(t=e())&&(r&&(dn(r),r=null),t&&(r=Nr(()=>{ni(()=>t(n))})))})}function Ys(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=Ys(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function Lu(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=Ys(n))&&(r&&(r+=" "),r+=e);return r}function Xt(n){return typeof n=="object"?Lu(n):n??""}const Bi=[...`
3
- \r\f \v\uFEFF`];function Cu(n,e,t){var r=n==null?"":""+n;if(e&&(r=r?r+" "+e:e),t){for(var i of Object.keys(t))if(t[i])r=r?r+" "+i:i;else if(r.length)for(var s=i.length,a=0;(a=r.indexOf(i,a))>=0;){var o=a+s;(a===0||Bi.includes(r[a-1]))&&(o===r.length||Bi.includes(r[o]))?r=(a===0?"":r.substring(0,a))+r.substring(o+1):a=o}}return r===""?null:r}function Fi(n,e=!1){var t=e?" !important;":";",r="";for(var i of Object.keys(n)){var s=n[i];s!=null&&s!==""&&(r+=" "+i+": "+s+t)}return r}function Cn(n){return n[0]!=="-"||n[1]!=="-"?n.toLowerCase():n}function Gu(n,e){if(e){var t="",r,i;if(Array.isArray(e)?(r=e[0],i=e[1]):r=e,n){n=String(n).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,a=0,o=!1,u=[];r&&u.push(...Object.keys(r).map(Cn)),i&&u.push(...Object.keys(i).map(Cn));var c=0,d=-1;const A=n.length;for(var f=0;f<A;f++){var h=n[f];if(o?h==="/"&&n[f-1]==="*"&&(o=!1):s?s===h&&(s=!1):h==="/"&&n[f+1]==="*"?o=!0:h==='"'||h==="'"?s=h:h==="("?a++:h===")"&&a--,!o&&s===!1&&a===0){if(h===":"&&d===-1)d=f;else if(h===";"||f===A-1){if(d!==-1){var g=Cn(n.substring(c,d).trim());if(!u.includes(g)){h!==";"&&f++;var k=n.substring(c,f).trim();t+=" "+k+";"}}c=f+1,d=-1}}}}return r&&(t+=Fi(r)),i&&(t+=Fi(i,!0)),t=t.trim(),t===""?null:t}return n==null?null:String(n)}function Mt(n,e,t,r,i,s){var a=n[zi];if(je||a!==t||a===void 0){var o=Cu(t,r,s);(!je||o!==n.getAttribute("class"))&&(o==null?n.removeAttribute("class"):e?n.className=o:n.setAttribute("class",o)),n[zi]=t}else if(s&&i!==s)for(var u in s){var c=!!s[u];(i==null||c!==!!i[u])&&n.classList.toggle(u,c)}return s}function Gn(n,e={},t,r){for(var i in t){var s=t[i];e[i]!==s&&(t[i]==null?n.style.removeProperty(i):n.style.setProperty(i,s,r))}}function Js(n,e,t,r){var i=n[Wi];if(je||i!==e){var s=Gu(e,r);(!je||s!==n.getAttribute("style"))&&(s==null?n.removeAttribute("style"):n.style.cssText=s),n[Wi]=e}else r&&(Array.isArray(r)?(Gn(n,t==null?void 0:t[0],r[0]),Gn(n,t==null?void 0:t[1],r[1],"important")):Gn(n,t,r));return r}function Ur(n,e,t=!1){if(n.multiple){if(e==null)return;if(!Us(e))return Va();for(var r of n.options)r.selected=e.includes(Rr(r));return}for(r of n.options){var i=Rr(r);if(Ya(i,e)){r.selected=!0;return}}(!t||e!==void 0)&&(n.selectedIndex=-1)}function si(n){var e=new MutationObserver(()=>{Ur(n,n.__value)});e.observe(n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Ms(()=>{e.disconnect()})}function rh(n,e,t=e){var r=new WeakSet,i=!0;ii(n,"change",s=>{var a=s?"[selected]":":checked",o;if(n.multiple)o=[].map.call(n.querySelectorAll(a),Rr);else{var u=n.querySelector(a)??n.querySelector("option:not([disabled])");o=u&&Rr(u)}t(o),n.__value=o,Ot!==null&&r.add(Ot)}),ni(()=>{var s=e();if(n===document.activeElement){var a=Ot;if(r.has(a))return}if(Ur(n,s,i),i&&s===void 0){var o=n.querySelector(":checked");o!==null&&(s=Rr(o),t(s))}n.__value=s,i=!1}),si(n)}function Rr(n){return"__value"in n?n.__value:n.value}const $r=Symbol("class"),Dr=Symbol("style"),Xs=Symbol("is custom element"),Zs=Symbol("is html"),Iu=Xr?"link":"LINK",Tu=Xr?"input":"INPUT",Ou=Xr?"option":"OPTION",Ru=Xr?"select":"SELECT",Nu=Xr?"progress":"PROGRESS";function un(n){if(je){var e=!1,t=()=>{if(!e){if(e=!0,n.hasAttribute("value")){var r=n.value;Z(n,"value",null),n.value=r}if(n.hasAttribute("checked")){var i=n.checked;Z(n,"checked",null),n.checked=i}}};n[su]=t,Ws(t),ou()}}function nh(n,e){var t=gn(n);t.value===(t.value=e??void 0)||n.value===e&&(e!==0||n.nodeName!==Nu)||(n.value=e??"")}function ih(n,e){var t=gn(n);t.checked!==(t.checked=e??void 0)&&(n.checked=e)}function Uu(n,e){e?n.hasAttribute("selected")||n.setAttribute("selected",""):n.removeAttribute("selected")}function Z(n,e,t,r){var i=gn(n);je&&(i[e]=n.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&n.nodeName===Iu)||i[e]!==(i[e]=t)&&(e==="loading"&&(n[Xa]=t),t==null?n.removeAttribute(e):typeof t!="string"&&Qs(n).includes(e)?n[e]=t:n.setAttribute(e,t))}function Pu(n,e,t,r,i=!1,s=!1){if(je&&i&&n.nodeName===Tu){var a=n,o=a.type==="checkbox"?"defaultChecked":"defaultValue";o in t||un(a)}var u=gn(n),c=u[Xs],d=!u[Zs];let f=je&&c;f&&er(!1);var h=e||{},g=n.nodeName===Ou;for(var k in e)k in t||(t[k]=null);t.class?t.class=Xt(t.class):(r||t[$r])&&(t.class=null),t[Dr]&&(t.style??(t.style=null));var A=Qs(n);for(const w in t){let x=t[w];if(g&&w==="value"&&x==null){n.value=n.__value="",h[w]=x;continue}if(w==="class"){var y=n.namespaceURI==="http://www.w3.org/1999/xhtml";Mt(n,y,x,r,e==null?void 0:e[$r],t[$r]),h[w]=x,h[$r]=t[$r];continue}if(w==="style"){Js(n,x,e==null?void 0:e[Dr],t[Dr]),h[w]=x,h[Dr]=t[Dr];continue}var b=h[w];if(!(x===b&&!(x===void 0&&n.hasAttribute(w)))){h[w]=x;var T=w[0]+w[1];if(T!=="$$")if(T==="on"){const D={},C="$$"+w;let I=w.slice(2);var _=wu(I);if(yu(I)&&(I=I.slice(0,-7),D.capture=!0),!_&&b){if(x!=null)continue;n.removeEventListener(I,h[C],D),h[C]=null}if(_)ke(I,n,x),qs([I]);else if(x!=null){let te=function(N){h[w].call(this,N)};h[C]=bu(I,n,te,D)}}else if(w==="style")Z(n,w,x);else if(w==="autofocus")nu(n,!!x);else if(!c&&(w==="__value"||w==="value"&&x!=null))n.value=n.__value=x;else if(w==="selected"&&g)Uu(n,x);else{var p=w;d||(p=mu(p));var S=p==="defaultValue"||p==="defaultChecked";if(x==null&&!c&&!S)if(u[w]=null,p==="value"||p==="checked"){let D=n;const C=e===void 0;if(p==="value"){let I=D.defaultValue;D.removeAttribute(p),D.defaultValue=I,D.value=D.__value=C?I:null}else{let I=D.defaultChecked;D.removeAttribute(p),D.defaultChecked=I,D.checked=C?I:!1}}else n.removeAttribute(w);else S||A.includes(p)&&(c||typeof x!="string")?(n[p]=x,p in u&&(u[p]=iu)):typeof x!="function"&&Z(n,p,x)}}}return f&&er(!0),h}function Ki(n,e,t=[],r=[],i=[],s,a=!1,o=!1){Ja(i,t,r,u=>{var c=void 0,d={},f=n.nodeName===Ru,h=!1;if(Bs(()=>{var k=e(...u.map(l)),A=Pu(n,c,k,s,a,o);h&&f&&"value"in k&&Ur(n,k.value);for(let b of Object.getOwnPropertySymbols(d))k[b]||dn(d[b]);for(let b of Object.getOwnPropertySymbols(k)){var y=k[b];b.description===tu&&(!c||y!==c[b])&&(d[b]&&dn(d[b]),d[b]=Nr(()=>Du(n,()=>y))),A[b]=y}c=A}),f){var g=n;ni(()=>{Ur(g,c.value,!0),si(g)})}h=!0})}function gn(n){var e;return n[e=Za]??(n[e]={[Xs]:n.nodeName.includes("-"),[Zs]:n.namespaceURI===Qa})}var Hi=new Map;function Qs(n){var e=n.getAttribute("is")||n.nodeName,t=Hi.get(e);if(t)return t;Hi.set(e,t=[]);for(var r,i=n,s=Element.prototype;s!==i;){r=ru(i);for(var a in r)r[a].set&&a!=="innerHTML"&&a!=="textContent"&&a!=="innerText"&&t.push(a);i=eu(i)}return t}function Qr(n,e,t=e){var r=new WeakSet;ii(n,"input",async i=>{var s=i?n.defaultValue:n.value;if(s=In(n)?Tn(s):s,t(s),Ot!==null&&r.add(Ot),await au(),s!==(s=e())){var a=n.selectionStart,o=n.selectionEnd,u=n.value.length;if(n.value=s??"",o!==null){var c=n.value.length;a===o&&o===u&&c>u?(n.selectionStart=c,n.selectionEnd=c):(n.selectionStart=a,n.selectionEnd=Math.min(o,c))}}}),(je&&n.defaultValue!==n.value||$t(e)==null&&n.value)&&(t(In(n)?Tn(n.value):n.value),Ot!==null&&r.add(Ot)),Fs(()=>{var i=e();if(n===document.activeElement){var s=Ot;if(r.has(s))return}In(n)&&i===Tn(n.value)||n.type==="date"&&!i&&!n.value||i!==n.value&&(n.value=i??"")})}function sh(n,e,t=e){ii(n,"change",r=>{var i=r?n.defaultChecked:n.checked;t(i)}),(je&&n.defaultChecked!==n.checked||$t(e)==null)&&t(n.checked),Fs(()=>{var r=e();n.checked=!!r})}function In(n){var e=n.type;return e==="number"||e==="range"}function Tn(n){return n===""?null:+n}function zu(n=!1){const e=uu,t=e.l.u;if(!t)return;let r=()=>dr(e.s);if(n){let i=0,s={};const a=du(()=>{let o=!1;const u=e.s;for(const c in u)u[c]!==s[c]&&(s[c]=u[c],o=!0);return o&&i++,i});r=()=>l(a)}t.b.length&&cu(()=>{qi(e,r),ji(t.b)}),Ft(()=>{const i=$t(()=>t.m.map(lu));return()=>{for(const s of i)typeof s=="function"&&s()}}),t.a.length&&Ft(()=>{qi(e,r),ji(t.a)})}function qi(n,e){if(n.l.s)for(const t of n.l.s)l(t);e()}const pr=Object.freeze({vcs:!1,clusterStatus:!1,collectionMetadata:!1,cdcStream:!1}),Vi={vcs:"vcs",versioning:"vcs",version_control:"vcs",cluster:"clusterStatus",cluster_status:"clusterStatus",collection_metadata:"collectionMetadata",collections_metadata:"collectionMetadata",cdc:"cdcStream",changes_stream:"cdcStream",cdc_stream:"cdcStream"};function Wu(n){var t;const e={...pr};for(const r of n.features??[]){const i=Vi[((t=r==null?void 0:r.toLowerCase)==null?void 0:t.call(r))??""];i&&(e[i]=!0)}for(const[r,i]of Object.entries(n.capabilities??{})){const s=Vi[r.toLowerCase()];s&&(e[s]=i===!0)}return e}const Yi=new Set,On=new Map;function ju(n){return(n instanceof Error?n.message:String(n)).includes("route not found: GET /collections/")}function Mu(n){const e=n instanceof Error?n.message:String(n);return/ → 404\b/.test(e)||e.includes("route not found")}function Ji(n){return new Error(`GET /collections/:name unsupported by this reddb server (${n})`)}async function*Bu(n){const e=n.getReader(),t=new TextDecoder;let r="";try{for(;;){const{done:s,value:a}=await e.read();if(s)break;r+=t.decode(a,{stream:!0});let o;for(;(o=r.indexOf(`
4
- `))!==-1;){const u=r.slice(0,o).trim();r=r.slice(o+1),u&&(yield JSON.parse(u))}}const i=r.trim();i&&(yield JSON.parse(i))}finally{e.releaseLock()}}const Fu=/^\s*select\b/i;async function oh(n,e,t={}){if(!Fu.test(e))return n.query(e);try{const r=await n.queryStreamCollect(e,t);return{ok:!0,query:e,record_count:r.rowCount,result:{columns:r.columns,records:r.rows.map(i=>({values:i}))},streamed:!0,truncated:r.truncated}}catch{return n.query(e)}}class Ku{constructor(e,t={}){Se(this,"baseUrl");Se(this,"headers");Se(this,"fetcher");this.baseUrl=e.replace(/\/$/,""),this.headers=t.headers,this.fetcher=t.fetch??fetch}async json(e,t){const r=`${this.baseUrl}${e}`,i={"Content-Type":"application/json"};Object.assign(i,this.headers),Object.assign(i,t==null?void 0:t.headers);const s=await this.fetcher(r,{...t,headers:i});if(!s.ok){const a=await s.text().catch(()=>"");throw new Error(`${(t==null?void 0:t.method)??"GET"} ${e} → ${s.status} ${a.slice(0,200)}`)}return s.json()}async stats(){return this.json("/stats")}async clusterStatus(){return this.json("/cluster/status")}async ping(){const e=performance.now();try{return await this.json("/stats"),{ok:!0,rtt_ms:Math.round(performance.now()-e)}}catch(t){return{ok:!1,error:t.message}}}async capabilities(){try{const r=await this.json("/capabilities");return Wu(r)}catch(r){if(!Mu(r))return{...pr}}const[e,t]=await Promise.all([this.probeGet("/repo/commits?limit=1"),this.probeGet("/cluster/status")]);return{...pr,vcs:e,clusterStatus:t}}async probeGet(e){try{return await this.json(e),!0}catch{return!1}}async collections(){return(await this.json("/collections")).collections}async collection(e){if(Yi.has(this.baseUrl))throw Ji(this.baseUrl);const t=`/collections/${encodeURIComponent(e)}`,r=On.get(this.baseUrl);if(r){if(!await r)throw Ji(this.baseUrl);return this.json(t)}let i;const s=new Promise(a=>{i=a});On.set(this.baseUrl,s);try{const a=await this.json(t);return i(!0),a}catch(a){throw ju(a)?(Yi.add(this.baseUrl),i(!1)):i(!0),a}finally{On.delete(this.baseUrl)}}async createCollection(e){await this.json("/collections",{method:"POST",body:JSON.stringify({name:e})})}async insertDocument(e,t){return this.json(`/collections/${encodeURIComponent(e)}/documents`,{method:"POST",body:JSON.stringify(t)})}async query(e){return this.json("/query",{method:"POST",body:JSON.stringify({query:e})})}async queryStreamCollect(e,t={}){const r=t.maxRows??1e4,i={"Content-Type":"application/json",Accept:"application/x-ndjson"};Object.assign(i,this.headers);const s=await this.fetcher(`${this.baseUrl}/query/stream`,{method:"POST",headers:i,body:JSON.stringify({query:e}),signal:t.signal});if(!s.ok||!s.body){const o=s.body?await s.text().catch(()=>""):"";throw new Error(`POST /query/stream → ${s.status} ${o.slice(0,200)}`)}const a={columns:[],rows:[],rowCount:0,truncated:!1};for await(const o of Bu(s.body))if("descriptor"in o)a.columns=o.descriptor.columns??[],a.schemaFingerprint=o.descriptor.schema_fingerprint;else if("cursor"in o)a.cursor=o.cursor.token;else if("row"in o){if(a.rows.length>=r){a.truncated=!0;break}a.rows.push(o.row),a.rowCount=a.rows.length}else if("end"in o||"cancelled"in o)break;return a.truncated&&a.cursor&&await this.cancelQueryStream(a.cursor).catch(()=>{}),a}async cancelQueryStream(e){await this.json("/query/stream/cancel",{method:"POST",body:JSON.stringify({cursor:e})}).catch(()=>{})}async collectionVcs(e){return(await this.json(`/collections/${encodeURIComponent(e)}/vcs`)).result}async setCollectionVcs(e,t){return(await this.json(`/collections/${encodeURIComponent(e)}/vcs`,{method:"PUT",body:JSON.stringify({versioned:t})})).result}async commits(e={}){const t=new URLSearchParams;e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),e.branch&&t.set("branch",e.branch),e.limit!==void 0&&t.set("limit",String(e.limit)),e.skip!==void 0&&t.set("skip",String(e.skip)),e.noMerges!==void 0&&t.set("no_merges",String(e.noMerges));const r=t.toString()?`?${t}`:"";return(await this.json(`/repo/commits${r}`)).result}async commitDiff(e,t,r={}){const i=new URLSearchParams;r.collection&&i.set("collection",r.collection),r.summary!==void 0&&i.set("summary",String(r.summary));const s=i.toString()?`?${i}`:"";return(await this.json(`/repo/commits/${encodeURIComponent(e)}/diff/${encodeURIComponent(t)}${s}`)).result}async replication(){return this.json("/replication/status").catch(()=>({ok:!1,role:"standalone"}))}async whoami(){return this.json("/auth/whoami")}async users(){return(await this.json("/auth/users")).users}async tenants(){return(await this.json("/auth/tenants")).tenants??[]}async policies(){return(await this.json("/auth/policies")).policies??[]}async changes(e,t={}){const r=new URLSearchParams;e!==void 0&&r.set("since_lsn",String(e)),t.limit!==void 0&&r.set("limit",String(t.limit));const i=r.toString()?`?${r}`:"",a=(await this.json("/changes"+i)).events??[];return t.collection?a.filter(o=>o.collection===t.collection):a}async rows(e){return(await this.query(e)).result.records.map(r=>r.values)}}class Hu extends Error{constructor(e){super(`Unknown connection: ${e}`),this.id=e,this.name="UnknownConnectionError"}}class qu extends Error{constructor(){super("No active connection — call connect() first"),this.name="NotConnectedError"}}class Vu extends Error{constructor(e,t){super(`Connection ${e} unreachable: ${t}`),this.id=e,this.reason=t,this.name="UnreachableConnectionError"}}const Yu={http:"http",https:"https",red:"http","red+tcp":"http","red+wire":"http",reds:"https","red+tls":"https","red+http":"http","red+https":"https","red+unix":"unix",file:"unix",unix:"unix"};function Ju(n){const e=n.trim();if(!e)return null;const t=e.match(/^([a-z+]+):\/\//i);return t?Yu[t[1].toLowerCase()]??null:"http"}const oi=["http","https"],Xu=["http","https","unix"];function Zu(n,e){const t=Ju(n);return t!==null&&e.includes(t)}const Qu=["endpoint","connection","red_url","red"],ec="view",eo="cs",to="to",tc="token",ro=/(token|secret|password|passwd|auth|credential|api[-_]?key|bearer)/i;class Kt extends Error{constructor(e,t){super(t),this.code=e,this.name="OpenContractError"}}function rc(n,e=""){if(n instanceof URL)return{search:n.search,hash:n.hash};const t=n??"";if(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)){const a=new URL(t);return{search:a.search,hash:a.hash}}const r=t.indexOf("#"),i=r>=0?t.slice(0,r):t,s=r>=0?t.slice(r):e;return{search:i,hash:s}}function nc(n){return/^file:/i.test(n)||/^~(?:\/|\\|$)/.test(n)||/^(?:\.{1,2})(?:\/|\\|$)/.test(n)||/^(?:\/|\\)/.test(n)||/^[a-z]:[\\/]/i.test(n)||n.includes("\\")}function no(n){const e=n.trim().replace(/\/$/,"");if(!e)throw new Kt("EMPTY_CS","Open Contract cs is empty");if(nc(e))throw new Kt("FILESYSTEM_PATH","Open Contract cs must be a browser-reachable URL, not a filesystem path");let t;try{t=new URL(e)}catch{throw new Kt("MALFORMED_URL","Open Contract cs is not a valid URL")}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Kt("UNSUPPORTED_SCHEME","Open Contract cs must use http:// or https://");for(const r of t.searchParams.keys())if(ro.test(r))throw new Kt("SECRET_IN_CS","Open Contract secrets must be carried in the app URL hash, not inside cs");return e}function io(n){const e=n.trim();if(!e)throw new Kt("MALFORMED_ROUTE","Open Contract to is empty");if(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")||e.includes("\\"))throw new Kt("MALFORMED_ROUTE","Open Contract to must be an app route");const t=e.startsWith("/")?e:`/${e}`;if(t==="/query"||t==="/collections"||t==="/cluster"||t==="/security"||t.startsWith("/c/"))return t;throw new Kt("MALFORMED_ROUTE","Open Contract to must target a known red-ui route")}function so(n,e=""){const{search:t,hash:r}=rc(n,e),i=new URLSearchParams(t),s=new URLSearchParams(r.startsWith("#")?r.slice(1):r),a={},o=i.get(eo);o!==null&&(a.cs=no(o));const u=i.get(to);u!==null&&(a.to=io(u));const c=s.get(tc);return c&&(a.token=c),a}function ic(n,e=""){const t=new URLSearchParams(n??""),r={},i=t.get(eo);if(i!==null)try{r.endpoint=no(i)}catch{}const s=t.get(to);if(s!==null)try{r.to=io(s)}catch{}for(const o of Qu){if(r.endpoint)break;const u=t.get(o);if(u&&!ro.test(o)){r.endpoint=u;break}}const a=t.get(ec);a&&(r.view=a);try{so(n,e).token}catch{}return r}function sc(n){return typeof n.endpoint=="string"&&n.endpoint.trim().length>0}function oc(n){return typeof n.to=="string"&&n.to.trim().length>0}const ac=8;function uc(){let n=[];return{load:()=>n.slice(),save:e=>{n=e.slice()}}}class cc{constructor(e={}){Se(this,"presets");Se(this,"history");Se(this,"clientFactory");Se(this,"historyMax");Se(this,"supportedTransports");Se(this,"boot");Se(this,"handoffTokens",new Map);Se(this,"active",null);var t,r;this.presets=((t=e.presets)==null?void 0:t.slice())??[],this.history=e.history??uc(),this.historyMax=e.historyMax??ac,this.clientFactory=e.clientFactory??((i,s)=>new Ku(i,s)),this.supportedTransports=((r=e.transports)==null?void 0:r.slice())??[...oi],this.boot=e.bootParams&&(sc(e.bootParams)||oc(e.bootParams))?{...e.bootParams}:null}transports(){return this.supportedTransports.slice()}bootParams(){return this.boot?{...this.boot}:null}useHandoffToken(e,t){const r=t.trim();r&&this.handoffTokens.set(this.handoffKey(e),r)}async list(){const e=new Set,t=[];for(const r of this.presets)e.has(r.url)||(e.add(r.url),t.push(r));for(const r of this.history.load())e.has(r.url)||(e.add(r.url),t.push({id:r.url,label:r.label,url:r.url,role:"primary"}));return t}async connect(e){const t=this.resolve(e);if(!t)throw new Hu(e);const r=this.consumeHandoffToken(t.url),i=this.clientFactory(t.url,r?{headers:{Authorization:`Bearer ${r}`}}:void 0),s=await i.ping();if(!s.ok)throw new Vu(t.id,s.error);const a={connection:t,client:i,rtt_ms:s.rtt_ms};return this.active=a,this.record(t,s.rtt_ms),a}async whoami(){if(!this.active)throw new qu;const e=await this.active.client.whoami();return{authenticated:e.authenticated,username:e.username,role:e.role}}forget(e){const t=this.history.load().filter(r=>r.url!==e);this.history.save(t)}resolve(e){const t=this.presets.find(i=>i.id===e);if(t)return t;const r=this.history.load().find(i=>i.url===e);if(r)return{id:r.url,label:r.label,url:r.url,role:"primary"};if(/^[a-z+]+:\/\//i.test(e)){let i=e;try{i=new URL(e).host||e}catch{}return{id:e,label:i,url:e,role:"primary",description:"Ad-hoc URL."}}return null}handoffKey(e){return e.replace(/\/$/,"")}consumeHandoffToken(e){const t=this.handoffKey(e),r=this.handoffTokens.get(t)??null;return this.handoffTokens.delete(t),r}record(e,t){const r=this.history.load().filter(s=>s.url!==e.url),i=[{url:e.url,label:e.label,last_used:Date.now(),rtt_ms:t},...r].slice(0,this.historyMax);this.history.save(i)}}const oo="red-ui:connection",lc=["__RED_BOOTSTRAP__","__RED_UI_CONNECTION_BOOTSTRAP__","__RED_UI_BOOTSTRAP__"];function cn(n){return typeof n=="string"&&n.trim()?n.trim():void 0}function dc(n){if(!n||typeof n!="object")return null;const e=cn(n.target),t=cn(n.token),r=cn(n.route);return!e&&!t&&!r?null:{target:e??null,...t?{token:t}:{},...r?{route:r}:{}}}async function fc(n){for(const e of n){let t;try{t=dc(await e())}catch{t=null}if(t)return t}return null}async function hc(){if(typeof window>"u"||!("__TAURI_INTERNALS__"in window||"__TAURI__"in window))return null;try{return(await fn(()=>import("./DhEqZVGG.js"),[],import.meta.url)).invoke}catch{return null}}async function pc(n){const e=n??await hc();if(!e)return null;try{return await e("connection_bootstrap")}catch{return null}}async function gc(n=globalThis){if(!n||typeof n!="object")return null;const e=n;for(const t of lc){const r=e[t];if(r)try{return typeof r=="function"?await r():r}finally{try{delete e[t]}catch{e[t]=void 0}}}return null}function vc(){return{consume:!0,location:typeof location>"u"?void 0:{pathname:location.pathname,search:location.search,hash:location.hash},history:typeof history>"u"?void 0:{state:history.state,replaceState:(n,e,t)=>history.replaceState(n,e,t)}}}function yc(n){if(!n.consume||!n.location||!n.history)return;const e=n.location.hash;if(!e)return;const t=new URLSearchParams(e.startsWith("#")?e.slice(1):e);if(!t.has("token"))return;t.delete("token");const r=t.toString(),i=`${n.location.pathname}${n.location.search}${r?`#${r}`:""}`;try{n.history.replaceState(n.history.state,"",i)}catch{}}function Xi(n=typeof location>"u"?"":location.search,e=typeof location>"u"?"":location.hash,t=vc()){try{const r=so(n,e);return r.token&&yc(t),!r.cs&&!r.to&&!r.token?null:{target:r.cs,token:r.token,route:r.to}}catch{return null}}function bc(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}function mc(n=bc(),e=oo){if(!n)return null;try{const t=n.getItem(e);if(!t)return null;const r=JSON.parse(t),i=cn(r==null?void 0:r.url);return i?{target:i}:null}catch{return null}}async function wc(n={}){const e=n.readUrl??(()=>Xi()),t=await fc([n.readTauri??pc,n.readInjectedGlobal??gc,e,n.readPersisted??(()=>mc())]);if(t&&!n.readUrl)try{Xi()}catch{}return t??{target:null}}class ut extends Error{constructor(t,r){super(r);Se(this,"code");this.name="SecureStoreError",this.code=t}}const _c=2e5,Ec=16,xc=12;function en(n){let e="";for(const t of n)e+=String.fromCharCode(t);return btoa(e)}function Rn(n){const e=atob(n),t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function cr(n){const e=new ArrayBuffer(n.byteLength);return new Uint8Array(e).set(n),e}class kc{constructor(e,t={}){Se(this,"storage");Se(this,"namespace");Se(this,"iterations");Se(this,"subtle");Se(this,"password");Se(this,"keyCache",new Map);var s;if(typeof e!="string"||e.length===0)throw new ut("LOCKED","master password required");const r=t.storage??(typeof globalThis<"u"?globalThis.localStorage:void 0);if(!r)throw new ut("BACKEND_FAILURE","no Storage backend available");const i=t.subtle??(typeof globalThis<"u"?(s=globalThis.crypto)==null?void 0:s.subtle:void 0);if(!i)throw new ut("BACKEND_FAILURE","Web Crypto SubtleCrypto unavailable");this.password=e,this.storage=r,this.namespace=t.namespace??"red-ui:secure",this.iterations=t.iterations??_c,this.subtle=i}storageKey(e){return`${this.namespace}:${e}`}async deriveKey(e){const t=en(e),r=this.keyCache.get(t);if(r)return r;const i=new TextEncoder().encode(this.password),s=await this.subtle.importKey("raw",cr(i),"PBKDF2",!1,["deriveKey"]),a=await this.subtle.deriveKey({name:"PBKDF2",salt:cr(e),iterations:this.iterations,hash:"SHA-256"},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"]);return this.keyCache.set(t,a),a}randomBytes(e){const t=new Uint8Array(e),r=globalThis.crypto;if(!r)throw new ut("BACKEND_FAILURE","crypto.getRandomValues unavailable");return r.getRandomValues(t),t}async put(e,t){const r=this.randomBytes(Ec),i=this.randomBytes(xc),s=await this.deriveKey(r),a=new TextEncoder().encode(t);let o;try{o=await this.subtle.encrypt({name:"AES-GCM",iv:cr(i)},s,cr(a))}catch(c){throw new ut("BACKEND_FAILURE",`encrypt failed: ${c.message}`)}const u={v:1,salt:en(r),nonce:en(i),ciphertext:en(new Uint8Array(o))};try{this.storage.setItem(this.storageKey(e),JSON.stringify(u))}catch(c){throw new ut("BACKEND_FAILURE",`storage write failed: ${c.message}`)}}async get(e){const t=this.storage.getItem(this.storageKey(e));if(!t)return null;let r;try{r=JSON.parse(t)}catch{throw new ut("CORRUPT_ENVELOPE",`key ${e}: not valid JSON`)}if(!r||r.v!==1||typeof r.salt!="string"||typeof r.nonce!="string"||typeof r.ciphertext!="string")throw new ut("CORRUPT_ENVELOPE",`key ${e}: missing envelope fields`);let i,s,a;try{i=Rn(r.salt),s=Rn(r.nonce),a=Rn(r.ciphertext)}catch{throw new ut("CORRUPT_ENVELOPE",`key ${e}: base64 decode failed`)}const o=await this.deriveKey(i);let u;try{u=await this.subtle.decrypt({name:"AES-GCM",iv:cr(s)},o,cr(a))}catch{throw new ut("DECRYPT_FAILED",`key ${e}: decryption failed (wrong password or tampered payload)`)}return new TextDecoder().decode(u)}async delete(e){try{this.storage.removeItem(this.storageKey(e))}catch(t){throw new ut("BACKEND_FAILURE",`storage delete failed: ${t.message}`)}}}class Sc{constructor(e){Se(this,"invoke");Se(this,"service");if(!e.invoke)throw new ut("BACKEND_FAILURE","tauri invoke fn not provided");this.invoke=e.invoke,this.service=e.service??"io.reddb.red-ui"}async put(e,t){try{await this.invoke("keychain_set",{service:this.service,key:e,value:t})}catch(r){throw new ut("BACKEND_FAILURE",`keychain_set failed: ${Nn(r)}`)}}async get(e){try{return await this.invoke("keychain_get",{service:this.service,key:e})??null}catch(t){throw new ut("BACKEND_FAILURE",`keychain_get failed: ${Nn(t)}`)}}async delete(e){try{await this.invoke("keychain_delete",{service:this.service,key:e})}catch(t){throw new ut("BACKEND_FAILURE",`keychain_delete failed: ${Nn(t)}`)}}}function Nn(n){if(n instanceof Error)return n.message;if(typeof n=="string")return n;try{return JSON.stringify(n)}catch{return String(n)}}const Ac="red-ui:history",$c="history:";function ao(n,e=!1){switch(n){case"embedded":return"none";case"standalone":return"vault";case"web":return e?"none":"labels-only"}}function Dc(n){if(n.url)try{const t=new URL(n.url).host;if(t)return t}catch{}const e=(n.label??n.url??"").trim();if(!e)return"";try{const t=new URL(e).host;if(t)return t}catch{}return e.includes("@")?e.slice(e.lastIndexOf("@")+1):e}function Lc(){return typeof localStorage>"u"?void 0:localStorage}function Zi(n){return`label:${encodeURIComponent(n)}`}function Cc(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2)+Date.now().toString(36)}function Lr(n,e){if(!n)return[];try{const t=n.getItem(e);if(!t)return[];const r=JSON.parse(t);return Array.isArray(r)?r.filter(i=>i&&typeof i.id=="string"&&typeof i.label=="string").map(i=>({id:i.id,label:i.label,last_used:i.last_used,rtt_ms:i.rtt_ms})):[]}catch{return[]}}function Qi(n,e,t){if(n)try{n.setItem(e,JSON.stringify(t))}catch{}}class Gc{constructor(e){Se(this,"surface");Se(this,"secureStore");Se(this,"managedWebTarget");Se(this,"storage");Se(this,"historyKey");Se(this,"urlPrefix");Se(this,"idByUrl",new Map);Se(this,"urlById",new Map);Se(this,"onChange");this.surface=e.surface,this.secureStore=e.secureStore,this.managedWebTarget=e.managedWebTarget??(()=>!1),this.storage=e.storage??Lc(),this.historyKey=e.historyKey??Ac,this.urlPrefix=e.urlPrefix??$c}setOnChange(e){this.onChange=e}persistence(){return ao(this.surface(),this.managedWebTarget())}load(){return this.persistence()==="none"?[]:Lr(this.storage,this.historyKey).map(e=>({url:this.urlById.get(e.id)??"",label:e.label,last_used:e.last_used,rtt_ms:e.rtt_ms}))}save(e){var u,c,d;const t=this.persistence();if(t==="none"){(u=this.onChange)==null||u.call(this);return}const r=Lr(this.storage,this.historyKey),i=new Map(r.map(f=>[f.label,f])),s=[],a=new Set,o=new Set;for(const f of e){const h=Dc(f);if(!h)continue;let g;f.url?(g=t==="labels-only"?Zi(h):this.idByUrl.get(f.url)??Cc(),this.idByUrl.set(f.url,g),this.urlById.set(g,f.url)):g=((c=i.get(h))==null?void 0:c.id)??Zi(h),!(a.has(g)||!f.url&&o.has(h))&&(a.add(g),o.add(h),s.push({id:g,label:h,last_used:typeof f.last_used=="number"?f.last_used:Date.now(),rtt_ms:f.rtt_ms}))}if(Qi(this.storage,this.historyKey,s),t==="vault"){const f=this.secureStore();if(f)for(const h of s){const g=this.urlById.get(h.id);g&&f.put(this.urlPrefix+h.id,g).catch(()=>{})}}(d=this.onChange)==null||d.call(this)}uiEntries(){return this.persistence()==="none"?[]:Lr(this.storage,this.historyKey).map(e=>({id:e.id,label:e.label,last_used:e.last_used,rtt_ms:e.rtt_ms,url:this.urlById.get(e.id)}))}async hydrate(){var i;if(this.persistence()!=="vault")return;const e=this.secureStore();if(!e)return;const t=Lr(this.storage,this.historyKey);let r=!1;for(const s of t)if(!this.urlById.has(s.id))try{const a=await e.get(this.urlPrefix+s.id);a&&(this.urlById.set(s.id,a),this.idByUrl.set(a,s.id),r=!0)}catch{}r&&((i=this.onChange)==null||i.call(this))}async forgetById(e){var s,a;if(this.persistence()==="none"){(s=this.onChange)==null||s.call(this);return}const t=Lr(this.storage,this.historyKey).filter(o=>o.id!==e);Qi(this.storage,this.historyKey,t);const r=this.urlById.get(e);r&&(this.urlById.delete(e),this.idByUrl.delete(r));const i=this.persistence()==="vault"?this.secureStore():null;if(i)try{await i.delete(this.urlPrefix+e)}catch{}(a=this.onChange)==null||a.call(this)}async forgetByUrl(e){const t=this.idByUrl.get(e);t&&await this.forgetById(t)}}function Ic({tauri:n,inFrame:e,mcp:t,embedLib:r}){return n?"standalone":e||t||r?"embedded":"web"}function Tc(){if(typeof window>"u")return"web";const n="__TAURI_INTERNALS__"in window||"__TAURI__"in window;let e=!1;try{e=window.self!==window.top}catch{e=!0}const t=typeof location<"u"&&new URLSearchParams(location.search).has("mcp"),r=window.__RED_UI_EMBED_SURFACE__===!0;return Ic({tauri:n,inFrame:e,mcp:t,embedLib:r})}function Un(n,e){switch(n){case"embedded":return!1;case"standalone":return!0;case"web":return!1}}const ei="red-ui:secure",es="__probe__",ts="ok";function rs(){if(typeof localStorage>"u")return!1;for(let n=0;n<localStorage.length;n++){const e=localStorage.key(n);if(e&&e.startsWith(ei+":"))return!0}return!1}var zr,Wr,jr,Mr,Br,Fr;class Oc{constructor(){at(this,zr,he(null));at(this,Wr,he(!0));at(this,jr,he(!1));at(this,Mr,he("unknown"));at(this,Br,he("web"));at(this,Fr,he(null));if(typeof window>"u"){this.backend="unknown";return}if(this.surface=Tc(),this.surface==="standalone"){this.backend="tauri",this.bindTauri();return}this.backend="web",rs(),this.needsSetup=!1,this.locked=Un(this.surface)}get store(){return l(we(this,zr))}set store(e){U(we(this,zr),e,!0)}get locked(){return l(we(this,Wr))}set locked(e){U(we(this,Wr),e,!0)}get needsSetup(){return l(we(this,jr))}set needsSetup(e){U(we(this,jr),e,!0)}get backend(){return l(we(this,Mr))}set backend(e){U(we(this,Mr),e,!0)}get surface(){return l(we(this,Br))}set surface(e){U(we(this,Br),e,!0)}get error(){return l(we(this,Fr))}set error(e){U(we(this,Fr),e,!0)}async bindTauri(){try{const e=await fn(()=>import("./DhEqZVGG.js"),[],import.meta.url);this.store=new Sc({invoke:e.invoke}),this.locked=!1}catch(e){this.error=`Tauri keychain bridge unavailable: ${e.message}`}}async unlock(e){if(this.error=null,this.backend!=="web")return!0;let t;try{t=new kc(e,{namespace:ei})}catch(r){return this.error=r.message,!1}try{const r=await t.get(es);if(r===null)await t.put(es,ts);else if(r!==ts)return this.error="Wrong password",!1}catch(r){return r instanceof ut&&r.code==="DECRYPT_FAILED"?(this.error="Wrong password",!1):(this.error=r.message,!1)}return this.store=t,this.locked=!1,this.needsSetup=!1,!0}lock(){this.store=null,this.backend==="web"&&(this.locked=Un(this.surface,rs()))}wipe(){if(typeof localStorage>"u")return;const e=[];for(let t=0;t<localStorage.length;t++){const r=localStorage.key(t);r&&(r.startsWith(ei+":")||r.startsWith("red-ui:"))&&e.push(r)}for(const t of e)localStorage.removeItem(t);this.store=null,this.backend==="web"&&(this.locked=Un(this.surface),this.needsSetup=!1),this.error=null}}zr=new WeakMap,Wr=new WeakMap,jr=new WeakMap,Mr=new WeakMap,Br=new WeakMap,Fr=new WeakMap;const Pr=new Oc,Rc=20;var Kr,Hr;class Nc{constructor(){at(this,Kr,he(0));at(this,Hr,he(fr([])));Se(this,"nextId",1)}get inflight(){return l(we(this,Kr))}set inflight(e){U(we(this,Kr),e,!0)}get log(){return l(we(this,Hr))}set log(e){U(we(this,Hr),e,!0)}async track(e,t){const r=this.nextId++,i={id:r,label:e,startedAt:Date.now(),durationMs:null,status:"pending"};$t(()=>{this.log=[i,...this.log].slice(0,Rc),this.inflight+=1});try{const s=await t();return $t(()=>this.update(r,{durationMs:Date.now()-i.startedAt,status:"ok"})),s}catch(s){throw $t(()=>this.update(r,{durationMs:Date.now()-i.startedAt,status:"error",error:s.message})),s}finally{$t(()=>{this.inflight=Math.max(0,this.inflight-1)})}}update(e,t){this.log=this.log.map(r=>r.id===e?{...r,...t}:r)}reset(){$t(()=>{this.log=this.log.map(e=>e.status==="pending"?{...e,status:"error",error:"reset by user",durationMs:Date.now()-e.startedAt}:e),this.inflight=0})}}Kr=new WeakMap,Hr=new WeakMap;const Bt=new Nc,uo=[{id:"embedded",label:"Embedded",url:"http://localhost:5055",role:"embedded",description:"Local file via ./scripts/embedded.sh."},{id:"docker-primary",label:"Docker primary",url:"http://localhost:15055",role:"primary",description:"Docker compose primary (./docker/compose.yml)."},{id:"docker-replica",label:"Docker replica",url:"http://localhost:25055",role:"replica",description:"Read-only mirror of docker primary."}],ns=oo;function is(n){if(typeof localStorage>"u")return;if(zc()!=="vault"){try{localStorage.removeItem(ns)}catch{}return}try{localStorage.setItem(ns,JSON.stringify(n))}catch{}}const Uc=/(handoff|token|secret|password|passwd|auth|credential|api[-_]?key|bearer)/i;let ai=!1;function Pc(){Pr.surface==="web"&&(ai=!0)}function co(){if(ai)return!0;if(Pr.surface!=="web"||typeof location>"u")return!1;for(const n of[location.search,location.hash]){const e=new URLSearchParams(n.startsWith("#")?n.slice(1):n);for(const t of e.keys())if(Uc.test(t))return!0}return!1}function zc(){return ao(Pr.surface,co())}const Zt=new Gc({surface:()=>Pr.surface,secureStore:()=>Pr.store,managedWebTarget:co});function Wc(n){let e=n.trim().replace(/\/$/,"");if(!e)return e;/:\/\//.test(e)||(e="http://"+e);const t=e.match(/^([a-z+]+):\/\/(.+)$/i);if(!t)return e;const[,r,i]=t,s=r.toLowerCase();if(s==="red"||s==="red+tcp"||s==="red+wire"){const[a]=i.split("/")[0].split(":");return`http://${a}:5055${i.includes("/")?"/"+i.split("/").slice(1).join("/"):""}`}if(s==="reds"||s==="red+tls"){const[a]=i.split("/")[0].split(":");return`https://${a}:5055`}return e}function ss(n){const e=Wc(n);let t=e;try{t=new URL(e).host}catch{}return{id:e,label:t||e,url:e,role:"primary",description:"User-provided connection string."}}function jc(){return[...typeof window<"u"&&("__TAURI_INTERNALS__"in window||"__TAURI__"in window)?Xu:oi]}function Mc(n){return typeof n.useHandoffToken=="function"}const Bc=new cc({presets:uo,history:Zt,transports:jc(),bootParams:ic(typeof location<"u"?location.search:"",typeof location<"u"?location.hash:"")});let lo=Bc;function Cr(){return lo}function ah(n){lo=n}var qr,Vr,Yr,Jr,gr,vr,yr;class Fc{constructor(){at(this,qr,he(!1));at(this,Vr,he(fr(uo[1])));at(this,Yr,he(fr({reachable:!1})));at(this,Jr,he(fr([])));at(this,gr,he(null));at(this,vr,he(fr({...pr})));at(this,yr,he(!1));this.history=Zt.uiEntries(),Zt.setOnChange(()=>{this.history=Zt.uiEntries()})}get connected(){return l(we(this,qr))}set connected(e){U(we(this,qr),e,!0)}get active(){return l(we(this,Vr))}set active(e){U(we(this,Vr),e,!0)}get probe(){return l(we(this,Yr))}set probe(e){U(we(this,Yr),e,!0)}get history(){return l(we(this,Jr))}set history(e){U(we(this,Jr),e,!0)}get targetResolved(){return l(we(this,yr))}get client(){return l(we(this,gr))}get readOnly(){var e;return this.connected&&((e=this.probe.stats)==null?void 0:e.read_only)===!0}get readOnlyReason(){var e;return(e=this.probe.stats)==null?void 0:e.read_only_reason}get capabilities(){return l(we(this,vr))}get supportedTransports(){var e,t;return((t=(e=Cr()).transports)==null?void 0:t.call(e))??[...oi]}canReach(e){return Zu(e,this.supportedTransports)}async forget(e){await Zt.forgetByUrl(e)}async forgetById(e){await Zt.forgetById(e)}async hydrateUrls(){await Zt.hydrate()}async bootstrap(e=wc){const t=await e(),r=t.route??null;if(!t.target)return r;const i=ss(t.target);if(t.token){Pc();const s=Cr();Mc(s)&&s.useHandoffToken(i.url,t.token)}return await this.tryConnect(i),r}async switch(e){this.active=e,is(e),await this.tryConnect(e)}async tryConnect(e){U(we(this,yr),!0);try{const t=await Bt.track(`connect · ${e.label}`,()=>Cr().connect(e.id));U(we(this,gr),t.client,!0),this.active={...e,...t.connection,description:e.description},is(this.active);const[r,i,s]=await Promise.all([Bt.track(`connect · ${e.label} stats`,()=>t.client.stats()).catch(()=>{}),Bt.track(`connect · ${e.label} replication`,()=>t.client.replication()).catch(()=>{}),Bt.track(`connect · ${e.label} capabilities`,()=>t.client.capabilities()).catch(()=>({...pr}))]);return this.probe={reachable:!0,rtt_ms:t.rtt_ms,stats:r,replication:i},U(we(this,vr),s,!0),this.connected=!0,!0}catch(t){return this.probe={reachable:!1,error:t.message},!1}}async adoptInjected(){const[e]=await Cr().list();if(!e)return!1;const t={...e,description:e.description??"Injected by the embedding host."};return this.tryConnect(t)}async connectFromBootParams(){var r,i;const e=(i=(r=Cr()).bootParams)==null?void 0:i.call(r);if(!e)return null;const t=e.to??e.view??null;return e.endpoint&&await this.tryConnect(ss(e.endpoint)),t}async refresh(){const e=this.client;if(!e){await this.tryConnect(this.active);return}try{const t=await Bt.track(`heartbeat · ${this.active.label}`,()=>e.ping());if(!t.ok){this.probe={reachable:!1,error:t.error};return}const[r,i]=await Promise.all([Bt.track("heartbeat · stats",()=>e.stats()).catch(()=>{}),Bt.track("heartbeat · replication",()=>e.replication()).catch(()=>{})]);this.probe={reachable:!0,rtt_ms:t.rtt_ms,stats:r,replication:i},this.connected=!0}catch(t){this.probe={reachable:!1,error:t.message}}}disconnect(){this.connected=!1,this.probe={reachable:!1},U(we(this,gr),null),U(we(this,vr),{...pr},!0),U(we(this,yr),!1),ai=!1}}qr=new WeakMap,Vr=new WeakMap,Yr=new WeakMap,Jr=new WeakMap,gr=new WeakMap,vr=new WeakMap,yr=new WeakMap;const Kc=new Fc;/**
5
- * @license lucide-svelte v0.475.0 - ISC
6
- *
7
- * ISC License
8
- *
9
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
10
- *
11
- * Permission to use, copy, modify, and/or distribute this software for any
12
- * purpose with or without fee is hereby granted, provided that the above
13
- * copyright notice and this permission notice appear in all copies.
14
- *
15
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
16
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
17
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
18
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
21
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22
- *
23
- */const Hc={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var qc=br("<svg><!><!></svg>");function pt(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]),r=rt(t,["name","color","size","strokeWidth","absoluteStrokeWidth","iconNode"]);Ks(e,!1);let i=ur(e,"name",8,void 0),s=ur(e,"color",8,"currentColor"),a=ur(e,"size",8,24),o=ur(e,"strokeWidth",8,2),u=ur(e,"absoluteStrokeWidth",8,!1),c=ur(e,"iconNode",24,()=>[]);const d=(...k)=>k.filter((A,y,b)=>!!A&&b.indexOf(A)===y).join(" ");zu();var f=qc();Ki(f,(k,A)=>({...Hc,...r,width:a(),height:a(),stroke:s(),"stroke-width":k,class:A}),[()=>(dr(u()),dr(o()),dr(a()),$t(()=>u()?Number(o())*24/Number(a()):o())),()=>(dr(i()),dr(t),$t(()=>d("lucide-icon","lucide",i()?`lucide-${i()}`:"",t.class)))]);var h=G(f);mt(h,1,c,an,(k,A)=>{var y=de(()=>on(l(A),2));let b=()=>l(y)[0],T=()=>l(y)[1];var _=Je(),p=Ie(_);$u(p,b,!0,(S,w)=>{Ki(S,()=>({...T()}))}),j(k,_)});var g=R(h);ct(g,e,"default",{}),L(f),j(n,f),Hs()}function Vc(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]);/**
24
- * @license lucide-svelte v0.475.0 - ISC
25
- *
26
- * ISC License
27
- *
28
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
29
- *
30
- * Permission to use, copy, modify, and/or distribute this software for any
31
- * purpose with or without fee is hereby granted, provided that the above
32
- * copyright notice and this permission notice appear in all copies.
33
- *
34
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
35
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
36
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
37
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
38
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
39
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
40
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
41
- *
42
- */const r=[["path",{d:"m18 16 4-4-4-4"}],["path",{d:"m6 8-4 4 4 4"}],["path",{d:"m14.5 4-5 16"}]];pt(n,ht({name:"code-xml"},()=>t,{get iconNode(){return r},children:(i,s)=>{var a=Je(),o=Ie(a);ct(o,e,"default",{}),j(i,a)},$$slots:{default:!0}}))}function Yc(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]);/**
43
- * @license lucide-svelte v0.475.0 - ISC
44
- *
45
- * ISC License
46
- *
47
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
48
- *
49
- * Permission to use, copy, modify, and/or distribute this software for any
50
- * purpose with or without fee is hereby granted, provided that the above
51
- * copyright notice and this permission notice appear in all copies.
52
- *
53
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
54
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
55
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
56
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
57
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
58
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
59
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
60
- *
61
- */const r=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]];pt(n,ht({name:"info"},()=>t,{get iconNode(){return r},children:(i,s)=>{var a=Je(),o=Ie(a);ct(o,e,"default",{}),j(i,a)},$$slots:{default:!0}}))}function uh(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]);/**
62
- * @license lucide-svelte v0.475.0 - ISC
63
- *
64
- * ISC License
65
- *
66
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
67
- *
68
- * Permission to use, copy, modify, and/or distribute this software for any
69
- * purpose with or without fee is hereby granted, provided that the above
70
- * copyright notice and this permission notice appear in all copies.
71
- *
72
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
73
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
74
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
75
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
76
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
77
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
78
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
79
- *
80
- */const r=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17"}]];pt(n,ht({name:"layers"},()=>t,{get iconNode(){return r},children:(i,s)=>{var a=Je(),o=Ie(a);ct(o,e,"default",{}),j(i,a)},$$slots:{default:!0}}))}function Jc(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]);/**
81
- * @license lucide-svelte v0.475.0 - ISC
82
- *
83
- * ISC License
84
- *
85
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
86
- *
87
- * Permission to use, copy, modify, and/or distribute this software for any
88
- * purpose with or without fee is hereby granted, provided that the above
89
- * copyright notice and this permission notice appear in all copies.
90
- *
91
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
92
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
93
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
94
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
95
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
96
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
97
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
98
- *
99
- */const r=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];pt(n,ht({name:"loader-circle"},()=>t,{get iconNode(){return r},children:(i,s)=>{var a=Je(),o=Ie(a);ct(o,e,"default",{}),j(i,a)},$$slots:{default:!0}}))}function Xc(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]);/**
100
- * @license lucide-svelte v0.475.0 - ISC
101
- *
102
- * ISC License
103
- *
104
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
105
- *
106
- * Permission to use, copy, modify, and/or distribute this software for any
107
- * purpose with or without fee is hereby granted, provided that the above
108
- * copyright notice and this permission notice appear in all copies.
109
- *
110
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
111
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
112
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
113
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
114
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
115
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
116
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
117
- *
118
- */const r=[["polyline",{points:"15 3 21 3 21 9"}],["polyline",{points:"9 21 3 21 3 15"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14"}]];pt(n,ht({name:"maximize-2"},()=>t,{get iconNode(){return r},children:(i,s)=>{var a=Je(),o=Ie(a);ct(o,e,"default",{}),j(i,a)},$$slots:{default:!0}}))}function os(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]);/**
119
- * @license lucide-svelte v0.475.0 - ISC
120
- *
121
- * ISC License
122
- *
123
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
124
- *
125
- * Permission to use, copy, modify, and/or distribute this software for any
126
- * purpose with or without fee is hereby granted, provided that the above
127
- * copyright notice and this permission notice appear in all copies.
128
- *
129
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
130
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
131
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
132
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
133
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
134
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
135
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
136
- *
137
- */const r=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"}],["path",{d:"M12 12V8"}]];pt(n,ht({name:"network"},()=>t,{get iconNode(){return r},children:(i,s)=>{var a=Je(),o=Ie(a);ct(o,e,"default",{}),j(i,a)},$$slots:{default:!0}}))}function Zc(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]);/**
138
- * @license lucide-svelte v0.475.0 - ISC
139
- *
140
- * ISC License
141
- *
142
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
143
- *
144
- * Permission to use, copy, modify, and/or distribute this software for any
145
- * purpose with or without fee is hereby granted, provided that the above
146
- * copyright notice and this permission notice appear in all copies.
147
- *
148
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
149
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
150
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
151
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
152
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
153
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
154
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
155
- *
156
- */const r=[["polygon",{points:"6 3 20 12 6 21 6 3"}]];pt(n,ht({name:"play"},()=>t,{get iconNode(){return r},children:(i,s)=>{var a=Je(),o=Ie(a);ct(o,e,"default",{}),j(i,a)},$$slots:{default:!0}}))}function Qc(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]);/**
157
- * @license lucide-svelte v0.475.0 - ISC
158
- *
159
- * ISC License
160
- *
161
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
162
- *
163
- * Permission to use, copy, modify, and/or distribute this software for any
164
- * purpose with or without fee is hereby granted, provided that the above
165
- * copyright notice and this permission notice appear in all copies.
166
- *
167
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
168
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
169
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
170
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
171
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
172
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
173
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
174
- *
175
- */const r=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}]];pt(n,ht({name:"rotate-cw"},()=>t,{get iconNode(){return r},children:(i,s)=>{var a=Je(),o=Ie(a);ct(o,e,"default",{}),j(i,a)},$$slots:{default:!0}}))}function el(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]);/**
176
- * @license lucide-svelte v0.475.0 - ISC
177
- *
178
- * ISC License
179
- *
180
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
181
- *
182
- * Permission to use, copy, modify, and/or distribute this software for any
183
- * purpose with or without fee is hereby granted, provided that the above
184
- * copyright notice and this permission notice appear in all copies.
185
- *
186
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
187
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
188
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
189
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
190
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
191
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
192
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
193
- *
194
- */const r=[["circle",{cx:"6",cy:"19",r:"3"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"}],["circle",{cx:"18",cy:"5",r:"3"}]];pt(n,ht({name:"route"},()=>t,{get iconNode(){return r},children:(i,s)=>{var a=Je(),o=Ie(a);ct(o,e,"default",{}),j(i,a)},$$slots:{default:!0}}))}function tl(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]);/**
195
- * @license lucide-svelte v0.475.0 - ISC
196
- *
197
- * ISC License
198
- *
199
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
200
- *
201
- * Permission to use, copy, modify, and/or distribute this software for any
202
- * purpose with or without fee is hereby granted, provided that the above
203
- * copyright notice and this permission notice appear in all copies.
204
- *
205
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
206
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
207
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
208
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
209
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
210
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
211
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
212
- *
213
- */const r=[["circle",{cx:"11",cy:"11",r:"8"}],["path",{d:"m21 21-4.3-4.3"}]];pt(n,ht({name:"search"},()=>t,{get iconNode(){return r},children:(i,s)=>{var a=Je(),o=Ie(a);ct(o,e,"default",{}),j(i,a)},$$slots:{default:!0}}))}function rl(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]);/**
214
- * @license lucide-svelte v0.475.0 - ISC
215
- *
216
- * ISC License
217
- *
218
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
219
- *
220
- * Permission to use, copy, modify, and/or distribute this software for any
221
- * purpose with or without fee is hereby granted, provided that the above
222
- * copyright notice and this permission notice appear in all copies.
223
- *
224
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
225
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
226
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
227
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
228
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
229
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
230
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
231
- *
232
- */const r=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18"}]];pt(n,ht({name:"table-2"},()=>t,{get iconNode(){return r},children:(i,s)=>{var a=Je(),o=Ie(a);ct(o,e,"default",{}),j(i,a)},$$slots:{default:!0}}))}function as(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]);/**
233
- * @license lucide-svelte v0.475.0 - ISC
234
- *
235
- * ISC License
236
- *
237
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
238
- *
239
- * Permission to use, copy, modify, and/or distribute this software for any
240
- * purpose with or without fee is hereby granted, provided that the above
241
- * copyright notice and this permission notice appear in all copies.
242
- *
243
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
244
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
245
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
246
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
247
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
248
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
249
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
250
- *
251
- */const r=[["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"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];pt(n,ht({name:"triangle-alert"},()=>t,{get iconNode(){return r},children:(i,s)=>{var a=Je(),o=Ie(a);ct(o,e,"default",{}),j(i,a)},$$slots:{default:!0}}))}function us(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]);/**
252
- * @license lucide-svelte v0.475.0 - ISC
253
- *
254
- * ISC License
255
- *
256
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
257
- *
258
- * Permission to use, copy, modify, and/or distribute this software for any
259
- * purpose with or without fee is hereby granted, provided that the above
260
- * copyright notice and this permission notice appear in all copies.
261
- *
262
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
263
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
264
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
265
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
266
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
267
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
268
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
269
- *
270
- */const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];pt(n,ht({name:"x"},()=>t,{get iconNode(){return r},children:(i,s)=>{var a=Je(),o=Ie(a);ct(o,e,"default",{}),j(i,a)},$$slots:{default:!0}}))}function nl(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]);/**
271
- * @license lucide-svelte v0.475.0 - ISC
272
- *
273
- * ISC License
274
- *
275
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
276
- *
277
- * Permission to use, copy, modify, and/or distribute this software for any
278
- * purpose with or without fee is hereby granted, provided that the above
279
- * copyright notice and this permission notice appear in all copies.
280
- *
281
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
282
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
283
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
284
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
285
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
286
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
287
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
288
- *
289
- */const r=[["circle",{cx:"11",cy:"11",r:"8"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11"}]];pt(n,ht({name:"zoom-in"},()=>t,{get iconNode(){return r},children:(i,s)=>{var a=Je(),o=Ie(a);ct(o,e,"default",{}),j(i,a)},$$slots:{default:!0}}))}function il(n,e){const t=rt(e,["children","$$slots","$$events","$$legacy"]);/**
290
- * @license lucide-svelte v0.475.0 - ISC
291
- *
292
- * ISC License
293
- *
294
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
295
- *
296
- * Permission to use, copy, modify, and/or distribute this software for any
297
- * purpose with or without fee is hereby granted, provided that the above
298
- * copyright notice and this permission notice appear in all copies.
299
- *
300
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
301
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
302
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
303
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
304
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
305
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
306
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
307
- *
308
- */const r=[["circle",{cx:"11",cy:"11",r:"8"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11"}]];pt(n,ht({name:"zoom-out"},()=>t,{get iconNode(){return r},children:(i,s)=>{var a=Je(),o=Ie(a);ct(o,e,"default",{}),j(i,a)},$$slots:{default:!0}}))}function ch(n){return n?n==="graph"?"graph":n:"table"}function lh(n,e){switch(n){case"graph":case"svg":return"graph";case"table":return"table";case"json":return"json";case"hypertable":case"kv":case"vector":case"queue":case"stats":case"diff":case"document":return n;default:return e}}function Pn(n,e){return`/c/${encodeURIComponent(n)}/p/${encodeURIComponent(e)}`}function fo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var tn={exports:{}},cs;function sl(){if(cs)return tn.exports;cs=1;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(S,w,x){return Function.prototype.apply.call(S,w,x)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:t=function(S){return Object.getOwnPropertyNames(S)};function r(p){console&&console.warn&&console.warn(p)}var i=Number.isNaN||function(S){return S!==S};function s(){s.init.call(this)}tn.exports=s,tn.exports.once=b,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(p){if(typeof p!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof p)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(p){if(typeof p!="number"||p<0||i(p))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+p+".");a=p}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||i(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function u(p){return p._maxListeners===void 0?s.defaultMaxListeners:p._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(S){for(var w=[],x=1;x<arguments.length;x++)w.push(arguments[x]);var D=S==="error",C=this._events;if(C!==void 0)D=D&&C.error===void 0;else if(!D)return!1;if(D){var I;if(w.length>0&&(I=w[0]),I instanceof Error)throw I;var te=new Error("Unhandled error."+(I?" ("+I.message+")":""));throw te.context=I,te}var N=C[S];if(N===void 0)return!1;if(typeof N=="function")e(N,this,w);else for(var v=N.length,Me=k(N,v),x=0;x<v;++x)e(Me[x],this,w);return!0};function c(p,S,w,x){var D,C,I;if(o(w),C=p._events,C===void 0?(C=p._events=Object.create(null),p._eventsCount=0):(C.newListener!==void 0&&(p.emit("newListener",S,w.listener?w.listener:w),C=p._events),I=C[S]),I===void 0)I=C[S]=w,++p._eventsCount;else if(typeof I=="function"?I=C[S]=x?[w,I]:[I,w]:x?I.unshift(w):I.push(w),D=u(p),D>0&&I.length>D&&!I.warned){I.warned=!0;var te=new Error("Possible EventEmitter memory leak detected. "+I.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");te.name="MaxListenersExceededWarning",te.emitter=p,te.type=S,te.count=I.length,r(te)}return p}s.prototype.addListener=function(S,w){return c(this,S,w,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(S,w){return c(this,S,w,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(p,S,w){var x={fired:!1,wrapFn:void 0,target:p,type:S,listener:w},D=d.bind(x);return D.listener=w,x.wrapFn=D,D}s.prototype.once=function(S,w){return o(w),this.on(S,f(this,S,w)),this},s.prototype.prependOnceListener=function(S,w){return o(w),this.prependListener(S,f(this,S,w)),this},s.prototype.removeListener=function(S,w){var x,D,C,I,te;if(o(w),D=this._events,D===void 0)return this;if(x=D[S],x===void 0)return this;if(x===w||x.listener===w)--this._eventsCount===0?this._events=Object.create(null):(delete D[S],D.removeListener&&this.emit("removeListener",S,x.listener||w));else if(typeof x!="function"){for(C=-1,I=x.length-1;I>=0;I--)if(x[I]===w||x[I].listener===w){te=x[I].listener,C=I;break}if(C<0)return this;C===0?x.shift():A(x,C),x.length===1&&(D[S]=x[0]),D.removeListener!==void 0&&this.emit("removeListener",S,te||w)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(S){var w,x,D;if(x=this._events,x===void 0)return this;if(x.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):x[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete x[S]),this;if(arguments.length===0){var C=Object.keys(x),I;for(D=0;D<C.length;++D)I=C[D],I!=="removeListener"&&this.removeAllListeners(I);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(w=x[S],typeof w=="function")this.removeListener(S,w);else if(w!==void 0)for(D=w.length-1;D>=0;D--)this.removeListener(S,w[D]);return this};function h(p,S,w){var x=p._events;if(x===void 0)return[];var D=x[S];return D===void 0?[]:typeof D=="function"?w?[D.listener||D]:[D]:w?y(D):k(D,D.length)}s.prototype.listeners=function(S){return h(this,S,!0)},s.prototype.rawListeners=function(S){return h(this,S,!1)},s.listenerCount=function(p,S){return typeof p.listenerCount=="function"?p.listenerCount(S):g.call(p,S)},s.prototype.listenerCount=g;function g(p){var S=this._events;if(S!==void 0){var w=S[p];if(typeof w=="function")return 1;if(w!==void 0)return w.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function k(p,S){for(var w=new Array(S),x=0;x<S;++x)w[x]=p[x];return w}function A(p,S){for(;S+1<p.length;S++)p[S]=p[S+1];p.pop()}function y(p){for(var S=new Array(p.length),w=0;w<S.length;++w)S[w]=p[w].listener||p[w];return S}function b(p,S){return new Promise(function(w,x){function D(I){p.removeListener(S,C),x(I)}function C(){typeof p.removeListener=="function"&&p.removeListener("error",D),w([].slice.call(arguments))}_(p,S,C,{once:!0}),S!=="error"&&T(p,D,{once:!0})})}function T(p,S,w){typeof p.on=="function"&&_(p,"error",S,w)}function _(p,S,w,x){if(typeof p.on=="function")x.once?p.once(S,w):p.on(S,w);else if(typeof p.addEventListener=="function")p.addEventListener(S,function D(C){x.once&&p.removeEventListener(S,D),w(C)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof p)}return tn.exports}var ol=sl();function al(){const n=arguments[0];for(let e=1,t=arguments.length;e<t;e++)if(arguments[e])for(const r in arguments[e])n[r]=arguments[e][r];return n}let Ze=al;typeof Object.assign=="function"&&(Ze=Object.assign);function wt(n,e,t,r){const i=n._nodes.get(e);let s=null;return i&&(r==="mixed"?s=i.out&&i.out[t]||i.undirected&&i.undirected[t]:r==="directed"?s=i.out&&i.out[t]:s=i.undirected&&i.undirected[t]),s}function tt(n){return typeof n=="object"&&n!==null}function ho(n){let e;for(e in n)return!1;return!0}function bt(n,e,t){Object.defineProperty(n,e,{enumerable:!1,configurable:!1,writable:!0,value:t})}function _t(n,e,t){const r={enumerable:!0,configurable:!0};typeof t=="function"?r.get=t:(r.value=t,r.writable=!1),Object.defineProperty(n,e,r)}function ls(n){return!(!tt(n)||n.attributes&&!Array.isArray(n.attributes))}function ul(){let n=Math.floor(Math.random()*256)&255;return()=>n++}function Rt(){const n=arguments;let e=null,t=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(e===null){if(t++,t>=n.length)return{done:!0};e=n[t][Symbol.iterator]()}if(r=e.next(),r.done){e=null;continue}break}while(!0);return r}}}function mr(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class ui extends Error{constructor(e){super(),this.name="GraphError",this.message=e}}class B extends ui{constructor(e){super(e),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,B.prototype.constructor)}}class P extends ui{constructor(e){super(e),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,P.prototype.constructor)}}class X extends ui{constructor(e){super(e),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,X.prototype.constructor)}}function po(n,e){this.key=n,this.attributes=e,this.clear()}po.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function go(n,e){this.key=n,this.attributes=e,this.clear()}go.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function vo(n,e){this.key=n,this.attributes=e,this.clear()}vo.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function wr(n,e,t,r,i){this.key=e,this.attributes=i,this.undirected=n,this.source=t,this.target=r}wr.prototype.attach=function(){let n="out",e="in";this.undirected&&(n=e="undirected");const t=this.source.key,r=this.target.key;this.source[n][r]=this,!(this.undirected&&t===r)&&(this.target[e][t]=this)};wr.prototype.attachMulti=function(){let n="out",e="in";const t=this.source.key,r=this.target.key;this.undirected&&(n=e="undirected");const i=this.source[n],s=i[r];if(typeof s>"u"){i[r]=this,this.undirected&&t===r||(this.target[e][t]=this);return}s.previous=this,this.next=s,i[r]=this,this.target[e][t]=this};wr.prototype.detach=function(){const n=this.source.key,e=this.target.key;let t="out",r="in";this.undirected&&(t=r="undirected"),delete this.source[t][e],delete this.target[r][n]};wr.prototype.detachMulti=function(){const n=this.source.key,e=this.target.key;let t="out",r="in";this.undirected&&(t=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[t][e],delete this.target[r][n]):(this.next.previous=void 0,this.source[t][e]=this.next,this.target[r][n]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const yo=0,bo=1,cl=2,mo=3;function Nt(n,e,t,r,i,s,a){let o,u,c,d;if(r=""+r,t===yo){if(o=n._nodes.get(r),!o)throw new P(`Graph.${e}: could not find the "${r}" node in the graph.`);c=i,d=s}else if(t===mo){if(i=""+i,u=n._edges.get(i),!u)throw new P(`Graph.${e}: could not find the "${i}" edge in the graph.`);const f=u.source.key,h=u.target.key;if(r===f)o=u.target;else if(r===h)o=u.source;else throw new P(`Graph.${e}: the "${r}" node is not attached to the "${i}" edge (${f}, ${h}).`);c=s,d=a}else{if(u=n._edges.get(r),!u)throw new P(`Graph.${e}: could not find the "${r}" edge in the graph.`);t===bo?o=u.source:o=u.target,c=i,d=s}return[o,c,d]}function ll(n,e,t){n.prototype[e]=function(r,i,s){const[a,o]=Nt(this,e,t,r,i,s);return a.attributes[o]}}function dl(n,e,t){n.prototype[e]=function(r,i){const[s]=Nt(this,e,t,r,i);return s.attributes}}function fl(n,e,t){n.prototype[e]=function(r,i,s){const[a,o]=Nt(this,e,t,r,i,s);return a.attributes.hasOwnProperty(o)}}function hl(n,e,t){n.prototype[e]=function(r,i,s,a){const[o,u,c]=Nt(this,e,t,r,i,s,a);return o.attributes[u]=c,this.emit("nodeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:u}),this}}function pl(n,e,t){n.prototype[e]=function(r,i,s,a){const[o,u,c]=Nt(this,e,t,r,i,s,a);if(typeof c!="function")throw new B(`Graph.${e}: updater should be a function.`);const d=o.attributes,f=c(d[u]);return d[u]=f,this.emit("nodeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:u}),this}}function gl(n,e,t){n.prototype[e]=function(r,i,s){const[a,o]=Nt(this,e,t,r,i,s);return delete a.attributes[o],this.emit("nodeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:o}),this}}function vl(n,e,t){n.prototype[e]=function(r,i,s){const[a,o]=Nt(this,e,t,r,i,s);if(!tt(o))throw new B(`Graph.${e}: provided attributes are not a plain object.`);return a.attributes=o,this.emit("nodeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}function yl(n,e,t){n.prototype[e]=function(r,i,s){const[a,o]=Nt(this,e,t,r,i,s);if(!tt(o))throw new B(`Graph.${e}: provided attributes are not a plain object.`);return Ze(a.attributes,o),this.emit("nodeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:o}),this}}function bl(n,e,t){n.prototype[e]=function(r,i,s){const[a,o]=Nt(this,e,t,r,i,s);if(typeof o!="function")throw new B(`Graph.${e}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit("nodeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}const ml=[{name:n=>`get${n}Attribute`,attacher:ll},{name:n=>`get${n}Attributes`,attacher:dl},{name:n=>`has${n}Attribute`,attacher:fl},{name:n=>`set${n}Attribute`,attacher:hl},{name:n=>`update${n}Attribute`,attacher:pl},{name:n=>`remove${n}Attribute`,attacher:gl},{name:n=>`replace${n}Attributes`,attacher:vl},{name:n=>`merge${n}Attributes`,attacher:yl},{name:n=>`update${n}Attributes`,attacher:bl}];function wl(n){ml.forEach(function({name:e,attacher:t}){t(n,e("Node"),yo),t(n,e("Source"),bo),t(n,e("Target"),cl),t(n,e("Opposite"),mo)})}function _l(n,e,t){n.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new X(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new X(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,o=""+i;if(i=arguments[2],s=wt(this,a,o,t),!s)throw new P(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new X(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new P(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return s.attributes[i]}}function El(n,e,t){n.prototype[e]=function(r){let i;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new X(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new X(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,a=""+arguments[1];if(i=wt(this,s,a,t),!i)throw new P(`Graph.${e}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(t!=="mixed")throw new X(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new P(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return i.attributes}}function xl(n,e,t){n.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new X(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new X(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,o=""+i;if(i=arguments[2],s=wt(this,a,o,t),!s)throw new P(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new X(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new P(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return s.attributes.hasOwnProperty(i)}}function kl(n,e,t){n.prototype[e]=function(r,i,s){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new X(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new X(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,u=""+i;if(i=arguments[2],s=arguments[3],a=wt(this,o,u,t),!a)throw new P(`Graph.${e}: could not find an edge for the given path ("${o}" - "${u}").`)}else{if(t!=="mixed")throw new X(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new P(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return a.attributes[i]=s,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:i}),this}}function Sl(n,e,t){n.prototype[e]=function(r,i,s){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new X(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new X(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,u=""+i;if(i=arguments[2],s=arguments[3],a=wt(this,o,u,t),!a)throw new P(`Graph.${e}: could not find an edge for the given path ("${o}" - "${u}").`)}else{if(t!=="mixed")throw new X(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new P(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(typeof s!="function")throw new B(`Graph.${e}: updater should be a function.`);return a.attributes[i]=s(a.attributes[i]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:i}),this}}function Al(n,e,t){n.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new X(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new X(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,o=""+i;if(i=arguments[2],s=wt(this,a,o,t),!s)throw new P(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new X(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new P(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return delete s.attributes[i],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:i}),this}}function $l(n,e,t){n.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new X(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new X(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,o=""+i;if(i=arguments[2],s=wt(this,a,o,t),!s)throw new P(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new X(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new P(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!tt(i))throw new B(`Graph.${e}: provided attributes are not a plain object.`);return s.attributes=i,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function Dl(n,e,t){n.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new X(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new X(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,o=""+i;if(i=arguments[2],s=wt(this,a,o,t),!s)throw new P(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new X(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new P(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!tt(i))throw new B(`Graph.${e}: provided attributes are not a plain object.`);return Ze(s.attributes,i),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:i}),this}}function Ll(n,e,t){n.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new X(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new X(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,o=""+i;if(i=arguments[2],s=wt(this,a,o,t),!s)throw new P(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new X(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new P(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new B(`Graph.${e}: provided updater is not a function.`);return s.attributes=i(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const Cl=[{name:n=>`get${n}Attribute`,attacher:_l},{name:n=>`get${n}Attributes`,attacher:El},{name:n=>`has${n}Attribute`,attacher:xl},{name:n=>`set${n}Attribute`,attacher:kl},{name:n=>`update${n}Attribute`,attacher:Sl},{name:n=>`remove${n}Attribute`,attacher:Al},{name:n=>`replace${n}Attributes`,attacher:$l},{name:n=>`merge${n}Attributes`,attacher:Dl},{name:n=>`update${n}Attributes`,attacher:Ll}];function Gl(n){Cl.forEach(function({name:e,attacher:t}){t(n,e("Edge"),"mixed"),t(n,e("DirectedEdge"),"directed"),t(n,e("UndirectedEdge"),"undirected")})}const Il=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Tl(n,e,t,r){let i=!1;for(const s in e){if(s===r)continue;const a=e[s];if(i=t(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),n&&i)return a.key}}function Ol(n,e,t,r){let i,s,a,o=!1;for(const u in e)if(u!==r){i=e[u];do{if(s=i.source,a=i.target,o=t(i.key,i.attributes,s.key,a.key,s.attributes,a.attributes,i.undirected),n&&o)return i.key;i=i.next}while(i!==void 0)}}function zn(n,e){const t=Object.keys(n),r=t.length;let i,s=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(s>=r)return{done:!0};const a=t[s++];if(a===e){i=void 0;continue}i=n[a]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function Rl(n,e,t,r){const i=e[t];if(!i)return;const s=i.source,a=i.target;if(r(i.key,i.attributes,s.key,a.key,s.attributes,a.attributes,i.undirected)&&n)return i.key}function Nl(n,e,t,r){let i=e[t];if(!i)return;let s=!1;do{if(s=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),n&&s)return i.key;i=i.next}while(i!==void 0)}function Wn(n,e){let t=n[e];if(t.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!t)return{done:!0};const i={edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected};return t=t.next,{done:!1,value:i}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected}})}}}function Ul(n,e){if(n.size===0)return[];if(e==="mixed"||e===n.type)return Array.from(n._edges.keys());const t=e==="undirected"?n.undirectedSize:n.directedSize,r=new Array(t),i=e==="undirected",s=n._edges.values();let a=0,o,u;for(;o=s.next(),o.done!==!0;)u=o.value,u.undirected===i&&(r[a++]=u.key);return r}function wo(n,e,t,r){if(e.size===0)return;const i=t!=="mixed"&&t!==e.type,s=t==="undirected";let a,o,u=!1;const c=e._edges.values();for(;a=c.next(),a.done!==!0;){if(o=a.value,i&&o.undirected!==s)continue;const{key:d,attributes:f,source:h,target:g}=o;if(u=r(d,f,h.key,g.key,h.attributes,g.attributes,o.undirected),n&&u)return d}}function Pl(n,e){if(n.size===0)return mr();const t=e!=="mixed"&&e!==n.type,r=e==="undirected",i=n._edges.values();return{[Symbol.iterator](){return this},next(){let s,a;for(;;){if(s=i.next(),s.done)return s;if(a=s.value,!(t&&a.undirected!==r))break}return{value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected},done:!1}}}}function ci(n,e,t,r,i,s){const a=e?Ol:Tl;let o;if(t!=="undirected"&&(r!=="out"&&(o=a(n,i.in,s),n&&o)||r!=="in"&&(o=a(n,i.out,s,r?void 0:i.key),n&&o))||t!=="directed"&&(o=a(n,i.undirected,s),n&&o))return o}function zl(n,e,t,r){const i=[];return ci(!1,n,e,t,r,function(s){i.push(s)}),i}function Wl(n,e,t){let r=mr();return n!=="undirected"&&(e!=="out"&&typeof t.in<"u"&&(r=Rt(r,zn(t.in))),e!=="in"&&typeof t.out<"u"&&(r=Rt(r,zn(t.out,e?void 0:t.key)))),n!=="directed"&&typeof t.undirected<"u"&&(r=Rt(r,zn(t.undirected))),r}function li(n,e,t,r,i,s,a){const o=t?Nl:Rl;let u;if(e!=="undirected"&&(typeof i.in<"u"&&r!=="out"&&(u=o(n,i.in,s,a),n&&u)||typeof i.out<"u"&&r!=="in"&&(r||i.key!==s)&&(u=o(n,i.out,s,a),n&&u))||e!=="directed"&&typeof i.undirected<"u"&&(u=o(n,i.undirected,s,a),n&&u))return u}function jl(n,e,t,r,i){const s=[];return li(!1,n,e,t,r,i,function(a){s.push(a)}),s}function Ml(n,e,t,r){let i=mr();return n!=="undirected"&&(typeof t.in<"u"&&e!=="out"&&r in t.in&&(i=Rt(i,Wn(t.in,r))),typeof t.out<"u"&&e!=="in"&&r in t.out&&(e||t.key!==r)&&(i=Rt(i,Wn(t.out,r)))),n!=="directed"&&typeof t.undirected<"u"&&r in t.undirected&&(i=Rt(i,Wn(t.undirected,r))),i}function Bl(n,e){const{name:t,type:r,direction:i}=e;n.prototype[t]=function(s,a){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return Ul(this,r);if(arguments.length===1){s=""+s;const o=this._nodes.get(s);if(typeof o>"u")throw new P(`Graph.${t}: could not find the "${s}" node in the graph.`);return zl(this.multi,r==="mixed"?this.type:r,i,o)}if(arguments.length===2){s=""+s,a=""+a;const o=this._nodes.get(s);if(!o)throw new P(`Graph.${t}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(a))throw new P(`Graph.${t}: could not find the "${a}" target node in the graph.`);return jl(r,this.multi,i,o,a)}throw new B(`Graph.${t}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Fl(n,e){const{name:t,type:r,direction:i}=e,s="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[s]=function(c,d,f){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return f=c,wo(!1,this,r,f);if(arguments.length===2){c=""+c,f=d;const h=this._nodes.get(c);if(typeof h>"u")throw new P(`Graph.${s}: could not find the "${c}" node in the graph.`);return ci(!1,this.multi,r==="mixed"?this.type:r,i,h,f)}if(arguments.length===3){c=""+c,d=""+d;const h=this._nodes.get(c);if(!h)throw new P(`Graph.${s}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(d))throw new P(`Graph.${s}: could not find the "${d}" target node in the graph.`);return li(!1,r,this.multi,i,h,d,f)}throw new B(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const a="map"+t[0].toUpperCase()+t.slice(1);n.prototype[a]=function(){const c=Array.prototype.slice.call(arguments),d=c.pop();let f;if(c.length===0){let h=0;r!=="directed"&&(h+=this.undirectedSize),r!=="undirected"&&(h+=this.directedSize),f=new Array(h);let g=0;c.push((k,A,y,b,T,_,p)=>{f[g++]=d(k,A,y,b,T,_,p)})}else f=[],c.push((h,g,k,A,y,b,T)=>{f.push(d(h,g,k,A,y,b,T))});return this[s].apply(this,c),f};const o="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[o]=function(){const c=Array.prototype.slice.call(arguments),d=c.pop(),f=[];return c.push((h,g,k,A,y,b,T)=>{d(h,g,k,A,y,b,T)&&f.push(h)}),this[s].apply(this,c),f};const u="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[u]=function(){let c=Array.prototype.slice.call(arguments);if(c.length<2||c.length>4)throw new B(`Graph.${u}: invalid number of arguments (expecting 2, 3 or 4 and got ${c.length}).`);if(typeof c[c.length-1]=="function"&&typeof c[c.length-2]!="function")throw new B(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let d,f;c.length===2?(d=c[0],f=c[1],c=[]):c.length===3?(d=c[1],f=c[2],c=[c[0]]):c.length===4&&(d=c[2],f=c[3],c=[c[0],c[1]]);let h=f;return c.push((g,k,A,y,b,T,_)=>{h=d(h,g,k,A,y,b,T,_)}),this[s].apply(this,c),h}}function Kl(n,e){const{name:t,type:r,direction:i}=e,s="find"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[s]=function(u,c,d){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return d=u,wo(!0,this,r,d);if(arguments.length===2){u=""+u,d=c;const f=this._nodes.get(u);if(typeof f>"u")throw new P(`Graph.${s}: could not find the "${u}" node in the graph.`);return ci(!0,this.multi,r==="mixed"?this.type:r,i,f,d)}if(arguments.length===3){u=""+u,c=""+c;const f=this._nodes.get(u);if(!f)throw new P(`Graph.${s}: could not find the "${u}" source node in the graph.`);if(!this._nodes.has(c))throw new P(`Graph.${s}: could not find the "${c}" target node in the graph.`);return li(!0,r,this.multi,i,f,c,d)}throw new B(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const a="some"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(){const u=Array.prototype.slice.call(arguments),c=u.pop();return u.push((f,h,g,k,A,y,b)=>c(f,h,g,k,A,y,b)),!!this[s].apply(this,u)};const o="every"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[o]=function(){const u=Array.prototype.slice.call(arguments),c=u.pop();return u.push((f,h,g,k,A,y,b)=>!c(f,h,g,k,A,y,b)),!this[s].apply(this,u)}}function Hl(n,e){const{name:t,type:r,direction:i}=e,s=t.slice(0,-1)+"Entries";n.prototype[s]=function(a,o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return mr();if(!arguments.length)return Pl(this,r);if(arguments.length===1){a=""+a;const u=this._nodes.get(a);if(!u)throw new P(`Graph.${s}: could not find the "${a}" node in the graph.`);return Wl(r,i,u)}if(arguments.length===2){a=""+a,o=""+o;const u=this._nodes.get(a);if(!u)throw new P(`Graph.${s}: could not find the "${a}" source node in the graph.`);if(!this._nodes.has(o))throw new P(`Graph.${s}: could not find the "${o}" target node in the graph.`);return Ml(r,i,u,o)}throw new B(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function ql(n){Il.forEach(e=>{Bl(n,e),Fl(n,e),Kl(n,e),Hl(n,e)})}const Vl=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function vn(){this.A=null,this.B=null}vn.prototype.wrap=function(n){this.A===null?this.A=n:this.B===null&&(this.B=n)};vn.prototype.has=function(n){return this.A!==null&&n in this.A||this.B!==null&&n in this.B};function Gr(n,e,t,r,i){for(const s in r){const a=r[s],o=a.source,u=a.target,c=o===t?u:o;if(e&&e.has(c.key))continue;const d=i(c.key,c.attributes);if(n&&d)return c.key}}function di(n,e,t,r,i){if(e!=="mixed"){if(e==="undirected")return Gr(n,null,r,r.undirected,i);if(typeof t=="string")return Gr(n,null,r,r[t],i)}const s=new vn;let a;if(e!=="undirected"){if(t!=="out"){if(a=Gr(n,null,r,r.in,i),n&&a)return a;s.wrap(r.in)}if(t!=="in"){if(a=Gr(n,s,r,r.out,i),n&&a)return a;s.wrap(r.out)}}if(e!=="directed"&&(a=Gr(n,s,r,r.undirected,i),n&&a))return a}function Yl(n,e,t){if(n!=="mixed"){if(n==="undirected")return Object.keys(t.undirected);if(typeof e=="string")return Object.keys(t[e])}const r=[];return di(!1,n,e,t,function(i){r.push(i)}),r}function Ir(n,e,t){const r=Object.keys(t),i=r.length;let s=0;return{[Symbol.iterator](){return this},next(){let a=null;do{if(s>=i)return n&&n.wrap(t),{done:!0};const o=t[r[s++]],u=o.source,c=o.target;if(a=u===e?c:u,n&&n.has(a.key)){a=null;continue}}while(a===null);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}}}}function Jl(n,e,t){if(n!=="mixed"){if(n==="undirected")return Ir(null,t,t.undirected);if(typeof e=="string")return Ir(null,t,t[e])}let r=mr();const i=new vn;return n!=="undirected"&&(e!=="out"&&(r=Rt(r,Ir(i,t,t.in))),e!=="in"&&(r=Rt(r,Ir(i,t,t.out)))),n!=="directed"&&(r=Rt(r,Ir(i,t,t.undirected))),r}function Xl(n,e){const{name:t,type:r,direction:i}=e;n.prototype[t]=function(s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];s=""+s;const a=this._nodes.get(s);if(typeof a>"u")throw new P(`Graph.${t}: could not find the "${s}" node in the graph.`);return Yl(r==="mixed"?this.type:r,i,a)}}function Zl(n,e){const{name:t,type:r,direction:i}=e,s="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[s]=function(c,d){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;c=""+c;const f=this._nodes.get(c);if(typeof f>"u")throw new P(`Graph.${s}: could not find the "${c}" node in the graph.`);di(!1,r==="mixed"?this.type:r,i,f,d)};const a="map"+t[0].toUpperCase()+t.slice(1);n.prototype[a]=function(c,d){const f=[];return this[s](c,(h,g)=>{f.push(d(h,g))}),f};const o="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[o]=function(c,d){const f=[];return this[s](c,(h,g)=>{d(h,g)&&f.push(h)}),f};const u="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[u]=function(c,d,f){if(arguments.length<3)throw new B(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let h=f;return this[s](c,(g,k)=>{h=d(h,g,k)}),h}}function Ql(n,e){const{name:t,type:r,direction:i}=e,s=t[0].toUpperCase()+t.slice(1,-1),a="find"+s;n.prototype[a]=function(c,d){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;c=""+c;const f=this._nodes.get(c);if(typeof f>"u")throw new P(`Graph.${a}: could not find the "${c}" node in the graph.`);return di(!0,r==="mixed"?this.type:r,i,f,d)};const o="some"+s;n.prototype[o]=function(c,d){return!!this[a](c,d)};const u="every"+s;n.prototype[u]=function(c,d){return!this[a](c,(h,g)=>!d(h,g))}}function ed(n,e){const{name:t,type:r,direction:i}=e,s=t.slice(0,-1)+"Entries";n.prototype[s]=function(a){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return mr();a=""+a;const o=this._nodes.get(a);if(typeof o>"u")throw new P(`Graph.${s}: could not find the "${a}" node in the graph.`);return Jl(r==="mixed"?this.type:r,i,o)}}function td(n){Vl.forEach(e=>{Xl(n,e),Zl(n,e),Ql(n,e),ed(n,e)})}function rn(n,e,t,r,i){const s=r._nodes.values(),a=r.type;let o,u,c,d,f,h;for(;o=s.next(),o.done!==!0;){let g=!1;if(u=o.value,a!=="undirected"){d=u.out;for(c in d){f=d[c];do h=f.target,g=!0,i(u.key,h.key,u.attributes,h.attributes,f.key,f.attributes,f.undirected),f=f.next;while(f)}}if(a!=="directed"){d=u.undirected;for(c in d)if(!(e&&u.key>c)){f=d[c];do h=f.target,h.key!==c&&(h=f.source),g=!0,i(u.key,h.key,u.attributes,h.attributes,f.key,f.attributes,f.undirected),f=f.next;while(f)}}t&&!g&&i(u.key,null,u.attributes,null,null,null,null)}}function rd(n,e){const t={key:n};return ho(e.attributes)||(t.attributes=Ze({},e.attributes)),t}function nd(n,e,t){const r={key:e,source:t.source.key,target:t.target.key};return ho(t.attributes)||(r.attributes=Ze({},t.attributes)),n==="mixed"&&t.undirected&&(r.undirected=!0),r}function id(n){if(!tt(n))throw new B('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in n))throw new B("Graph.import: serialized node is missing its key.");if("attributes"in n&&(!tt(n.attributes)||n.attributes===null))throw new B("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function sd(n){if(!tt(n))throw new B('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in n))throw new B("Graph.import: serialized edge is missing its source.");if(!("target"in n))throw new B("Graph.import: serialized edge is missing its target.");if("attributes"in n&&(!tt(n.attributes)||n.attributes===null))throw new B("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in n&&typeof n.undirected!="boolean")throw new B("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const od=ul(),ad=new Set(["directed","undirected","mixed"]),ds=new Set(["domain","_events","_eventsCount","_maxListeners"]),ud=[{name:n=>`${n}Edge`,generateKey:!0},{name:n=>`${n}DirectedEdge`,generateKey:!0,type:"directed"},{name:n=>`${n}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:n=>`${n}EdgeWithKey`},{name:n=>`${n}DirectedEdgeWithKey`,type:"directed"},{name:n=>`${n}UndirectedEdgeWithKey`,type:"undirected"}],cd={allowSelfLoops:!0,multi:!1,type:"mixed"};function ld(n,e,t){if(t&&!tt(t))throw new B(`Graph.addNode: invalid attributes. Expecting an object but got "${t}"`);if(e=""+e,t=t||{},n._nodes.has(e))throw new X(`Graph.addNode: the "${e}" node already exist in the graph.`);const r=new n.NodeDataClass(e,t);return n._nodes.set(e,r),n.emit("nodeAdded",{key:e,attributes:t}),r}function fs(n,e,t){const r=new n.NodeDataClass(e,t);return n._nodes.set(e,r),n.emit("nodeAdded",{key:e,attributes:t}),r}function _o(n,e,t,r,i,s,a,o){if(!r&&n.type==="undirected")throw new X(`Graph.${e}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&n.type==="directed")throw new X(`Graph.${e}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(o&&!tt(o))throw new B(`Graph.${e}: invalid attributes. Expecting an object but got "${o}"`);if(s=""+s,a=""+a,o=o||{},!n.allowSelfLoops&&s===a)throw new X(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const u=n._nodes.get(s),c=n._nodes.get(a);if(!u)throw new P(`Graph.${e}: source node "${s}" not found.`);if(!c)throw new P(`Graph.${e}: target node "${a}" not found.`);const d={key:null,undirected:r,source:s,target:a,attributes:o};if(t)i=n._edgeKeyGenerator();else if(i=""+i,n._edges.has(i))throw new X(`Graph.${e}: the "${i}" edge already exists in the graph.`);if(!n.multi&&(r?typeof u.undirected[a]<"u":typeof u.out[a]<"u"))throw new X(`Graph.${e}: an edge linking "${s}" to "${a}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const f=new wr(r,i,u,c,o);n._edges.set(i,f);const h=s===a;return r?(u.undirectedDegree++,c.undirectedDegree++,h&&(u.undirectedLoops++,n._undirectedSelfLoopCount++)):(u.outDegree++,c.inDegree++,h&&(u.directedLoops++,n._directedSelfLoopCount++)),n.multi?f.attachMulti():f.attach(),r?n._undirectedSize++:n._directedSize++,d.key=i,n.emit("edgeAdded",d),i}function dd(n,e,t,r,i,s,a,o,u){if(!r&&n.type==="undirected")throw new X(`Graph.${e}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&n.type==="directed")throw new X(`Graph.${e}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(o){if(u){if(typeof o!="function")throw new B(`Graph.${e}: invalid updater function. Expecting a function but got "${o}"`)}else if(!tt(o))throw new B(`Graph.${e}: invalid attributes. Expecting an object but got "${o}"`)}s=""+s,a=""+a;let c;if(u&&(c=o,o=void 0),!n.allowSelfLoops&&s===a)throw new X(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let d=n._nodes.get(s),f=n._nodes.get(a),h,g;if(!t&&(h=n._edges.get(i),h)){if((h.source.key!==s||h.target.key!==a)&&(!r||h.source.key!==a||h.target.key!==s))throw new X(`Graph.${e}: inconsistency detected when attempting to merge the "${i}" edge with "${s}" source & "${a}" target vs. ("${h.source.key}", "${h.target.key}").`);g=h}if(!g&&!n.multi&&d&&(g=r?d.undirected[a]:d.out[a]),g){const T=[g.key,!1,!1,!1];if(u?!c:!o)return T;if(u){const _=g.attributes;g.attributes=c(_),n.emit("edgeAttributesUpdated",{type:"replace",key:g.key,attributes:g.attributes})}else Ze(g.attributes,o),n.emit("edgeAttributesUpdated",{type:"merge",key:g.key,attributes:g.attributes,data:o});return T}o=o||{},u&&c&&(o=c(o));const k={key:null,undirected:r,source:s,target:a,attributes:o};if(t)i=n._edgeKeyGenerator();else if(i=""+i,n._edges.has(i))throw new X(`Graph.${e}: the "${i}" edge already exists in the graph.`);let A=!1,y=!1;d||(d=fs(n,s,{}),A=!0,s===a&&(f=d,y=!0)),f||(f=fs(n,a,{}),y=!0),h=new wr(r,i,d,f,o),n._edges.set(i,h);const b=s===a;return r?(d.undirectedDegree++,f.undirectedDegree++,b&&(d.undirectedLoops++,n._undirectedSelfLoopCount++)):(d.outDegree++,f.inDegree++,b&&(d.directedLoops++,n._directedSelfLoopCount++)),n.multi?h.attachMulti():h.attach(),r?n._undirectedSize++:n._directedSize++,k.key=i,n.emit("edgeAdded",k),[i,!0,A,y]}function lr(n,e){n._edges.delete(e.key);const{source:t,target:r,attributes:i}=e,s=e.undirected,a=t===r;s?(t.undirectedDegree--,r.undirectedDegree--,a&&(t.undirectedLoops--,n._undirectedSelfLoopCount--)):(t.outDegree--,r.inDegree--,a&&(t.directedLoops--,n._directedSelfLoopCount--)),n.multi?e.detachMulti():e.detach(),s?n._undirectedSize--:n._directedSize--,n.emit("edgeDropped",{key:e.key,attributes:i,source:t.key,target:r.key,undirected:s})}class Te extends ol.EventEmitter{constructor(e){if(super(),e=Ze({},cd,e),typeof e.multi!="boolean")throw new B(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!ad.has(e.type))throw new B(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!="boolean")throw new B(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);const t=e.type==="mixed"?po:e.type==="directed"?go:vo;bt(this,"NodeDataClass",t);const r="geid_"+od()+"_";let i=0;const s=()=>{let a;do a=r+i++;while(this._edges.has(a));return a};bt(this,"_attributes",{}),bt(this,"_nodes",new Map),bt(this,"_edges",new Map),bt(this,"_directedSize",0),bt(this,"_undirectedSize",0),bt(this,"_directedSelfLoopCount",0),bt(this,"_undirectedSelfLoopCount",0),bt(this,"_edgeKeyGenerator",s),bt(this,"_options",e),ds.forEach(a=>bt(this,a,this[a])),_t(this,"order",()=>this._nodes.size),_t(this,"size",()=>this._edges.size),_t(this,"directedSize",()=>this._directedSize),_t(this,"undirectedSize",()=>this._undirectedSize),_t(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),_t(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),_t(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),_t(this,"multi",this._options.multi),_t(this,"type",this._options.type),_t(this,"allowSelfLoops",this._options.allowSelfLoops),_t(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(""+e)}hasDirectedEdge(e,t){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+e,i=this._edges.get(r);return!!i&&!i.undirected}else if(arguments.length===2){e=""+e,t=""+t;const r=this._nodes.get(e);return r?r.out.hasOwnProperty(t):!1}throw new B(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+e,i=this._edges.get(r);return!!i&&i.undirected}else if(arguments.length===2){e=""+e,t=""+t;const r=this._nodes.get(e);return r?r.undirected.hasOwnProperty(t):!1}throw new B(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){const r=""+e;return this._edges.has(r)}else if(arguments.length===2){e=""+e,t=""+t;const r=this._nodes.get(e);return r?typeof r.out<"u"&&r.out.hasOwnProperty(t)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(t):!1}throw new B(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type==="undirected")return;if(e=""+e,t=""+t,this.multi)throw new X("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(e);if(!r)throw new P(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new P(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);const i=r.out&&r.out[t]||void 0;if(i)return i.key}undirectedEdge(e,t){if(this.type==="directed")return;if(e=""+e,t=""+t,this.multi)throw new X("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(e);if(!r)throw new P(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new P(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);const i=r.undirected&&r.undirected[t]||void 0;if(i)return i.key}edge(e,t){if(this.multi)throw new X("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new P(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new P(`Graph.edge: could not find the "${t}" target node in the graph.`);const i=r.out&&r.out[t]||r.undirected&&r.undirected[t]||void 0;if(i)return i.key}areDirectedNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new P(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in r.in||t in r.out}areOutNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new P(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in r.out}areInNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new P(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in r.in}areUndirectedNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new P(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="directed"?!1:t in r.undirected}areNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new P(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&(t in r.in||t in r.out)||this.type!=="directed"&&t in r.undirected}areInboundNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new P(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in r.in||this.type!=="directed"&&t in r.undirected}areOutboundNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new P(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in r.out||this.type!=="directed"&&t in r.undirected}inDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new P(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree}outDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new P(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree}directedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new P(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree}undirectedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new P(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree}inboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new P(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=t.undirectedDegree),this.type!=="undirected"&&(r+=t.inDegree),r}outboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new P(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=t.undirectedDegree),this.type!=="undirected"&&(r+=t.outDegree),r}degree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new P(`Graph.degree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=t.undirectedDegree),this.type!=="undirected"&&(r+=t.inDegree+t.outDegree),r}inDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new P(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new P(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new P(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new P(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new P(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(r+=t.inDegree,i+=t.directedLoops),r-i}outboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new P(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(r+=t.outDegree,i+=t.directedLoops),r-i}degreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new P(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(r+=t.inDegree+t.outDegree,i+=t.directedLoops*2),r-i}source(e){e=""+e;const t=this._edges.get(e);if(!t)throw new P(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=""+e;const t=this._edges.get(e);if(!t)throw new P(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=""+e;const t=this._edges.get(e);if(!t)throw new P(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=""+e,t=""+t;const r=this._edges.get(t);if(!r)throw new P(`Graph.opposite: could not find the "${t}" edge in the graph.`);const i=r.source.key,s=r.target.key;if(e===i)return s;if(e===s)return i;throw new P(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${i}, ${s}).`)}hasExtremity(e,t){e=""+e,t=""+t;const r=this._edges.get(e);if(!r)throw new P(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return r.source.key===t||r.target.key===t}isUndirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new P(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new P(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=""+e;const t=this._edges.get(e);if(!t)throw new P(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return ld(this,e,t).key}mergeNode(e,t){if(t&&!tt(t))throw new B(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=""+e,t=t||{};let r=this._nodes.get(e);return r?(t&&(Ze(r.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:r.attributes,data:t})),[e,!1]):(r=new this.NodeDataClass(e,t),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!="function")throw new B(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=""+e;let r=this._nodes.get(e);if(r){if(t){const s=r.attributes;r.attributes=t(s),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:r.attributes})}return[e,!1]}const i=t?t({}):{};return r=new this.NodeDataClass(e,i),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:i}),[e,!0]}dropNode(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new P(`Graph.dropNode: could not find the "${e}" node in the graph.`);let r;if(this.type!=="undirected"){for(const i in t.out){r=t.out[i];do lr(this,r),r=r.next;while(r)}for(const i in t.in){r=t.in[i];do lr(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const i in t.undirected){r=t.undirected[i];do lr(this,r),r=r.next;while(r)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){const r=""+arguments[0],i=""+arguments[1];if(t=wt(this,r,i,this.type),!t)throw new P(`Graph.dropEdge: could not find the "${r}" -> "${i}" edge in the graph.`)}else if(e=""+e,t=this._edges.get(e),!t)throw new P(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return lr(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new X("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new X("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");e=""+e,t=""+t;const r=wt(this,e,t,"directed");if(!r)throw new P(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return lr(this,r),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new X("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new X("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=wt(this,e,t,"undirected");if(!r)throw new P(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return lr(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const e=this._nodes.values();let t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!="function")throw new B("Graph.updateAttribute: updater should be a function.");const r=this._attributes[e];return this._attributes[e]=t(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!tt(e))throw new B("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(e){if(!tt(e))throw new B("Graph.mergeAttributes: provided attributes are not a plain object.");return Ze(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!="function")throw new B("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!="function")throw new B("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!ls(t))throw new B("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let i,s;for(;i=r.next(),i.done!==!0;)s=i.value,s.attributes=e(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!="function")throw new B("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!ls(t))throw new B("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let i,s,a,o;for(;i=r.next(),i.done!==!0;)s=i.value,a=s.source,o=s.target,s.attributes=e(s.key,s.attributes,a.key,o.key,a.attributes,o.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!="function")throw new B("Graph.forEachAdjacencyEntry: expecting a callback.");rn(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new B("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");rn(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!="function")throw new B("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");rn(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new B("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");rn(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!="function")throw new B("Graph.forEachNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)}findNode(e){if(typeof e!="function")throw new B("Graph.findNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return i.key}mapNodes(e){if(typeof e!="function")throw new B("Graph.mapNode: expecting a callback.");const t=this._nodes.values();let r,i;const s=new Array(this.order);let a=0;for(;r=t.next(),r.done!==!0;)i=r.value,s[a++]=e(i.key,i.attributes);return s}someNode(e){if(typeof e!="function")throw new B("Graph.someNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return!0;return!1}everyNode(e){if(typeof e!="function")throw new B("Graph.everyNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)if(i=r.value,!e(i.key,i.attributes))return!1;return!0}filterNodes(e){if(typeof e!="function")throw new B("Graph.filterNodes: expecting a callback.");const t=this._nodes.values();let r,i;const s=[];for(;r=t.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)&&s.push(i.key);return s}reduceNodes(e,t){if(typeof e!="function")throw new B("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new B("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=t;const i=this._nodes.values();let s,a;for(;s=i.next(),s.done!==!0;)a=s.value,r=e(r,a.key,a.attributes);return r}nodeEntries(){const e=this._nodes.values();return{[Symbol.iterator](){return this},next(){const t=e.next();if(t.done)return t;const r=t.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const e=new Array(this._nodes.size);let t=0;this._nodes.forEach((i,s)=>{e[t++]=rd(s,i)});const r=new Array(this._edges.size);return t=0,this._edges.forEach((i,s)=>{r[t++]=nd(this.type,s,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:r}}import(e,t=!1){if(e instanceof Te)return e.forEachNode((u,c)=>{t?this.mergeNode(u,c):this.addNode(u,c)}),e.forEachEdge((u,c,d,f,h,g,k)=>{t?k?this.mergeUndirectedEdgeWithKey(u,d,f,c):this.mergeDirectedEdgeWithKey(u,d,f,c):k?this.addUndirectedEdgeWithKey(u,d,f,c):this.addDirectedEdgeWithKey(u,d,f,c)}),this;if(!tt(e))throw new B("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!tt(e.attributes))throw new B("Graph.import: invalid attributes. Expecting a plain object.");t?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let r,i,s,a,o;if(e.nodes){if(s=e.nodes,!Array.isArray(s))throw new B("Graph.import: invalid nodes. Expecting an array.");for(r=0,i=s.length;r<i;r++){a=s[r],id(a);const{key:u,attributes:c}=a;t?this.mergeNode(u,c):this.addNode(u,c)}}if(e.edges){let u=!1;if(this.type==="undirected"&&(u=!0),s=e.edges,!Array.isArray(s))throw new B("Graph.import: invalid edges. Expecting an array.");for(r=0,i=s.length;r<i;r++){o=s[r],sd(o);const{source:c,target:d,attributes:f,undirected:h=u}=o;let g;"key"in o?(g=t?h?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:h?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,g.call(this,o.key,c,d,f)):(g=t?h?this.mergeUndirectedEdge:this.mergeDirectedEdge:h?this.addUndirectedEdge:this.addDirectedEdge,g.call(this,c,d,f))}}return this}nullCopy(e){const t=new Te(Ze({},this._options,e));return t.replaceAttributes(Ze({},this.getAttributes())),t}emptyCopy(e){const t=this.nullCopy(e);return this._nodes.forEach((r,i)=>{const s=Ze({},r.attributes);r=new t.NodeDataClass(i,s),t._nodes.set(i,r)}),t}copy(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new X(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi=="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new X("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof e.allowSelfLoops=="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new X("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const t=this.emptyCopy(e),r=this._edges.values();let i,s;for(;i=r.next(),i.done!==!0;)s=i.value,_o(t,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,Ze({},s.attributes));return t}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const e={};this._nodes.forEach((s,a)=>{e[a]=s.attributes});const t={},r={};this._edges.forEach((s,a)=>{const o=s.undirected?"--":"->";let u="",c=s.source.key,d=s.target.key,f;s.undirected&&c>d&&(f=c,c=d,d=f);const h=`(${c})${o}(${d})`;a.startsWith("geid_")?this.multi&&(typeof r[h]>"u"?r[h]=0:r[h]++,u+=`${r[h]}. `):u+=`[${a}]: `,u+=h,t[u]=s.attributes});const i={};for(const s in this)this.hasOwnProperty(s)&&!ds.has(s)&&typeof this[s]!="function"&&typeof s!="symbol"&&(i[s]=this[s]);return i.attributes=this._attributes,i.nodes=e,i.edges=t,bt(i,"constructor",this.constructor),i}}typeof Symbol<"u"&&(Te.prototype[Symbol.for("nodejs.util.inspect.custom")]=Te.prototype.inspect);ud.forEach(n=>{["add","merge","update"].forEach(e=>{const t=n.name(e),r=e==="add"?_o:dd;n.generateKey?Te.prototype[t]=function(i,s,a){return r(this,t,!0,(n.type||this.type)==="undirected",null,i,s,a,e==="update")}:Te.prototype[t]=function(i,s,a,o){return r(this,t,!1,(n.type||this.type)==="undirected",i,s,a,o,e==="update")}})});wl(Te);Gl(Te);ql(Te);td(Te);class Eo extends Te{constructor(e){const t=Ze({type:"directed"},e);if("multi"in t&&t.multi!==!1)throw new B("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="directed")throw new B('DirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class xo extends Te{constructor(e){const t=Ze({type:"undirected"},e);if("multi"in t&&t.multi!==!1)throw new B("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="undirected")throw new B('UndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class ko extends Te{constructor(e){const t=Ze({multi:!0},e);if("multi"in t&&t.multi!==!0)throw new B("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(t)}}class So extends Te{constructor(e){const t=Ze({type:"directed",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new B("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="directed")throw new B('MultiDirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Ao extends Te{constructor(e){const t=Ze({type:"undirected",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new B("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="undirected")throw new B('MultiUndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}function _r(n){n.from=function(e,t){const r=Ze({},e.options,t),i=new n(r);return i.import(e),i}}_r(Te);_r(Eo);_r(xo);_r(ko);_r(So);_r(Ao);Te.Graph=Te;Te.DirectedGraph=Eo;Te.UndirectedGraph=xo;Te.MultiGraph=ko;Te.MultiDirectedGraph=So;Te.MultiUndirectedGraph=Ao;Te.InvalidArgumentsGraphError=B;Te.NotFoundGraphError=P;Te.UsageGraphError=X;var jn,hs;function $o(){if(hs)return jn;hs=1;function n(t){return!t||typeof t!="object"||typeof t=="function"||Array.isArray(t)||t instanceof Set||t instanceof Map||t instanceof RegExp||t instanceof Date}function e(t,r){t=t||{};var i={};for(var s in r){var a=t[s],o=r[s];if(!n(o)){i[s]=e(a,o);continue}a===void 0?i[s]=o:i[s]=a}return i}return jn=e,jn}var Mn,ps;function fi(){return ps||(ps=1,Mn=function(e){return e!==null&&typeof e=="object"&&typeof e.addUndirectedEdgeWithKey=="function"&&typeof e.dropNode=="function"&&typeof e.multi=="boolean"}),Mn}var Bn,gs;function fd(){if(gs)return Bn;gs=1;var n=fi();return Bn=function(t){if(!n(t))throw new Error("graphology-utils/infer-type: expecting a valid graphology instance.");var r=t.type;return r!=="mixed"?r:t.directedSize===0&&t.undirectedSize===0||t.directedSize>0&&t.undirectedSize>0?"mixed":t.directedSize>0?"directed":"undirected"},Bn}var Fn,vs;function Do(){if(vs)return Fn;vs=1;function n(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}return typeof Symbol<"u"&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var e=arguments,t=e.length,r=0;return new n(function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}})},n.empty=function(){var e=new n(function(){return{done:!0}});return e},n.fromSequence=function(e){var t=0,r=e.length;return new n(function(){return t>=r?{done:!0}:{done:!1,value:e[t++]}})},n.is=function(e){return e instanceof n?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"},Fn=n,Fn}var Kn={},ys;function hi(){return ys||(ys=1,(function(n){var e=Math.pow(2,8)-1,t=Math.pow(2,16)-1,r=Math.pow(2,32)-1,i=Math.pow(2,7)-1,s=Math.pow(2,15)-1,a=Math.pow(2,31)-1;n.getPointerArray=function(u){var c=u-1;if(c<=e)return Uint8Array;if(c<=t)return Uint16Array;if(c<=r)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},n.getSignedPointerArray=function(u){var c=u-1;return c<=i?Int8Array:c<=s?Int16Array:c<=a?Int32Array:Float64Array},n.getNumberType=function(u){return u===(u|0)?Math.sign(u)===-1?u<=127&&u>=-128?Int8Array:u<=32767&&u>=-32768?Int16Array:Int32Array:u<=255?Uint8Array:u<=65535?Uint16Array:Uint32Array:Float64Array};var o={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};n.getMinimalRepresentation=function(u,c){var d=null,f=0,h,g,k,A,y;for(A=0,y=u.length;A<y;A++)k=c?c(u[A]):u[A],g=n.getNumberType(k),h=o[g.name],h>f&&(f=h,d=g);return d},n.isTypedArray=function(u){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(u)},n.concat=function(){var u=0,c,d,f;for(c=0,f=arguments.length;c<f;c++)u+=arguments[c].length;var h=new arguments[0].constructor(u);for(c=0,d=0;c<f;c++)h.set(arguments[c],d),d+=arguments[c].length;return h},n.indices=function(u){for(var c=n.getPointerArray(u),d=new c(u),f=0;f<u;f++)d[f]=f;return d}})(Kn)),Kn}var Hn,bs;function hd(){if(bs)return Hn;bs=1;var n=Do(),e=hi().getPointerArray;function t(r,i){arguments.length<2&&(i=r,r=Array);var s=e(i);this.size=0,this.length=i,this.dense=new s(i),this.sparse=new s(i),this.vals=new r(i)}return t.prototype.clear=function(){this.size=0},t.prototype.has=function(r){var i=this.sparse[r];return i<this.size&&this.dense[i]===r},t.prototype.get=function(r){var i=this.sparse[r];if(i<this.size&&this.dense[i]===r)return this.vals[i]},t.prototype.set=function(r,i){var s=this.sparse[r];return s<this.size&&this.dense[s]===r?(this.vals[s]=i,this):(this.dense[this.size]=r,this.sparse[r]=this.size,this.vals[this.size]=i,this.size++,this)},t.prototype.delete=function(r){var i=this.sparse[r];return i>=this.size||this.dense[i]!==r?!1:(i=this.dense[this.size-1],this.dense[this.sparse[r]]=i,this.sparse[i]=this.sparse[r],this.size--,!0)},t.prototype.forEach=function(r,i){i=arguments.length>1?i:this;for(var s=0;s<this.size;s++)r.call(i,this.vals[s],this.dense[s])},t.prototype.keys=function(){var r=this.size,i=this.dense,s=0;return new n(function(){if(s<r){var a=i[s];return s++,{value:a}}return{done:!0}})},t.prototype.values=function(){var r=this.size,i=this.vals,s=0;return new n(function(){if(s<r){var a=i[s];return s++,{value:a}}return{done:!0}})},t.prototype.entries=function(){var r=this.size,i=this.dense,s=this.vals,a=0;return new n(function(){if(a<r){var o=[i[a],s[a]];return a++,{value:o}}return{done:!0}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.entries),t.prototype.inspect=function(){for(var r=new Map,i=0;i<this.size;i++)r.set(this.dense[i],this.vals[i]);return Object.defineProperty(r,"constructor",{value:t,enumerable:!1}),r.length=this.length,this.vals.constructor!==Array&&(r.type=this.vals.constructor.name),r},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),Hn=t,Hn}var qn,ms;function pd(){if(ms)return qn;ms=1;var n=Do(),e=hi().getPointerArray;function t(r){var i=e(r);this.start=0,this.size=0,this.capacity=r,this.dense=new i(r),this.sparse=new i(r)}return t.prototype.clear=function(){this.start=0,this.size=0},t.prototype.has=function(r){if(this.size===0)return!1;var i=this.sparse[r],s=i<this.capacity&&i>=this.start&&i<this.start+this.size||i<(this.start+this.size)%this.capacity;return s&&this.dense[i]===r},t.prototype.enqueue=function(r){var i=this.sparse[r];if(this.size!==0){var s=i<this.capacity&&i>=this.start&&i<this.start+this.size||i<(this.start+this.size)%this.capacity;if(s&&this.dense[i]===r)return this}return i=(this.start+this.size)%this.capacity,this.dense[i]=r,this.sparse[r]=i,this.size++,this},t.prototype.dequeue=function(){if(this.size!==0){var r=this.start;this.size--,this.start++,this.start===this.capacity&&(this.start=0);var i=this.dense[r];return this.sparse[i]=this.capacity,i}},t.prototype.forEach=function(r,i){i=arguments.length>1?i:this;for(var s=this.capacity,a=this.size,o=this.start,u=0;u<a;)r.call(i,this.dense[o],u,this),o++,u++,o===s&&(o=0)},t.prototype.values=function(){var r=this.dense,i=this.capacity,s=this.size,a=this.start,o=0;return new n(function(){if(o>=s)return{done:!0};var u=r[a];return a++,o++,a===i&&(a=0),{value:u,done:!1}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.values),t.prototype.inspect=function(){var r=[];return this.forEach(function(i){r.push(i)}),Object.defineProperty(r,"constructor",{value:t,enumerable:!1}),r.capacity=this.capacity,r},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),qn=t,qn}var Vn,ws;function gd(){if(ws)return Vn;ws=1;function n(t){return function(r){return typeof r!="number"&&(r=r.length),Math.floor(t()*r)}}var e=n(Math.random);return e.createRandomIndex=n,Vn=e,Vn}var nn={},Tr={},_s;function Lo(){if(_s)return Tr;_s=1;function n(r){return typeof r!="number"||isNaN(r)?1:r}function e(r,i){var s={},a=function(c){return typeof c>"u"?i:c};typeof i=="function"&&(a=i);var o=function(c){return a(c[r])},u=function(){return a(void 0)};return typeof r=="string"?(s.fromAttributes=o,s.fromGraph=function(c,d){return o(c.getNodeAttributes(d))},s.fromEntry=function(c,d){return o(d)}):typeof r=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},s.fromGraph=function(c,d){return a(r(d,c.getNodeAttributes(d)))},s.fromEntry=function(c,d){return a(r(c,d))}):(s.fromAttributes=u,s.fromGraph=u,s.fromEntry=u),s}function t(r,i){var s={},a=function(c){return typeof c>"u"?i:c};typeof i=="function"&&(a=i);var o=function(c){return a(c[r])},u=function(){return a(void 0)};return typeof r=="string"?(s.fromAttributes=o,s.fromGraph=function(c,d){return o(c.getEdgeAttributes(d))},s.fromEntry=function(c,d){return o(d)},s.fromPartialEntry=s.fromEntry,s.fromMinimalEntry=s.fromEntry):typeof r=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},s.fromGraph=function(c,d){var f=c.extremities(d);return a(r(d,c.getEdgeAttributes(d),f[0],f[1],c.getNodeAttributes(f[0]),c.getNodeAttributes(f[1]),c.isUndirected(d)))},s.fromEntry=function(c,d,f,h,g,k,A){return a(r(c,d,f,h,g,k,A))},s.fromPartialEntry=function(c,d,f,h){return a(r(c,d,f,h))},s.fromMinimalEntry=function(c,d){return a(r(c,d))}):(s.fromAttributes=u,s.fromGraph=u,s.fromEntry=u,s.fromMinimalEntry=u),s}return Tr.createNodeValueGetter=e,Tr.createEdgeValueGetter=t,Tr.createEdgeWeightGetter=function(r){return t(r,n)},Tr}var Es;function vd(){if(Es)return nn;Es=1;var n=hi(),e=$o(),t=Lo().createEdgeWeightGetter,r=Symbol.for("nodejs.util.inspect.custom"),i={getEdgeWeight:"weight",keepDendrogram:!1,resolution:1};function s(o,u){u=e(u,i);var c=u.resolution,d=t(u.getEdgeWeight).fromEntry,f=(o.size-o.selfLoopCount)*2,h=n.getPointerArray(f),g=n.getPointerArray(o.order+1),k=u.getEdgeWeight?Float64Array:n.getPointerArray(o.size*2);this.C=o.order,this.M=0,this.E=f,this.U=0,this.resolution=c,this.level=0,this.graph=o,this.nodes=new Array(o.order),this.keepDendrogram=u.keepDendrogram,this.neighborhood=new g(f),this.weights=new k(f),this.loops=new k(o.order),this.starts=new h(o.order+1),this.belongings=new g(o.order),this.dendrogram=[],this.mapping=null,this.counts=new g(o.order),this.unused=new g(o.order),this.totalWeights=new k(o.order);var A={},y,b=0,T=0,_=this;o.forEachNode(function(p){_.nodes[b]=p,A[p]=b,T+=o.undirectedDegreeWithoutSelfLoops(p),_.starts[b]=T,_.belongings[b]=b,_.counts[b]=1,b++}),o.forEachEdge(function(p,S,w,x,D,C,I){if(y=d(p,S,w,x,D,C,I),w=A[w],x=A[x],_.M+=y,w===x)_.totalWeights[w]+=y*2,_.loops[w]=y*2;else{_.totalWeights[w]+=y,_.totalWeights[x]+=y;var te=--_.starts[w],N=--_.starts[x];_.neighborhood[te]=x,_.neighborhood[N]=w,_.weights[te]=y,_.weights[N]=y}}),this.starts[b]=this.E,this.keepDendrogram?this.dendrogram.push(this.belongings.slice()):this.mapping=this.belongings.slice()}s.prototype.isolate=function(o,u){var c=this.belongings[o];if(this.counts[c]===1)return c;var d=this.unused[--this.U],f=this.loops[o];return this.totalWeights[c]-=u+f,this.totalWeights[d]+=u+f,this.belongings[o]=d,this.counts[c]--,this.counts[d]++,d},s.prototype.move=function(o,u,c){var d=this.belongings[o],f=this.loops[o];this.totalWeights[d]-=u+f,this.totalWeights[c]+=u+f,this.belongings[o]=c;var h=this.counts[d]--===1;this.counts[c]++,h&&(this.unused[this.U++]=d)},s.prototype.computeNodeDegree=function(o){var u,c,d,f=0;for(u=this.starts[o],c=this.starts[o+1];u<c;u++)d=this.weights[u],f+=d;return f},s.prototype.expensiveIsolate=function(o){var u=this.computeNodeDegree(o);return this.isolate(o,u)},s.prototype.expensiveMove=function(o,u){var c=this.computeNodeDegree(o);this.move(o,c,u)},s.prototype.zoomOut=function(){var o=new Array(this.C-this.U),u={},c=this.nodes.length,d=0,f=0,h,g,k,A,y,b,T,_,p;for(h=0,k=this.C;h<k;h++)b=this.belongings[h],b in u||(u[b]=d,o[d]={adj:{},totalWeights:this.totalWeights[b],internalWeights:0},d++),this.belongings[h]=u[b];var S,w;if(this.keepDendrogram){for(S=this.dendrogram[this.level],w=new(n.getPointerArray(d))(c),h=0;h<c;h++)w[h]=this.belongings[S[h]];this.dendrogram.push(w)}else for(h=0;h<c;h++)this.mapping[h]=this.belongings[this.mapping[h]];for(h=0,k=this.C;h<k;h++)for(b=this.belongings[h],_=o[b],p=_.adj,_.internalWeights+=this.loops[h],g=this.starts[h],A=this.starts[h+1];g<A;g++){if(y=this.neighborhood[g],T=this.belongings[y],b===T){_.internalWeights+=this.weights[g];continue}T in p||(p[T]=0),p[T]+=this.weights[g]}for(this.C=d,y=0,b=0;b<d;b++){_=o[b],p=_.adj,b=+b,this.totalWeights[b]=_.totalWeights,this.loops[b]=_.internalWeights,this.counts[b]=1,this.starts[b]=y,this.belongings[b]=b;for(T in p)this.neighborhood[y]=+T,this.weights[y]=p[T],f++,y++}return this.starts[d]=f,this.E=f,this.U=0,this.level++,u},s.prototype.modularity=function(){var o,u,c,d,f,h=0,g=this.M*2,k=new Float64Array(this.C);for(c=0;c<this.C;c++)for(o=this.belongings[c],k[o]+=this.loops[c],d=this.starts[c],f=this.starts[c+1];d<f;d++)u=this.belongings[this.neighborhood[d]],o===u&&(k[o]+=this.weights[d]);for(c=0;c<this.C;c++)h+=k[c]/g-Math.pow(this.totalWeights[c]/g,2)*this.resolution;return h},s.prototype.delta=function(o,u,c,d){var f=this.M,h=this.totalWeights[d];return u+=this.loops[o],c/f-h*u*this.resolution/(2*f*f)},s.prototype.deltaWithOwnCommunity=function(o,u,c,d){var f=this.M,h=this.totalWeights[d];return u+=this.loops[o],c/f-(h-u)*u*this.resolution/(2*f*f)},s.prototype.fastDelta=function(o,u,c,d){var f=this.M,h=this.totalWeights[d];return u+=this.loops[o],c-u*h*this.resolution/(2*f)},s.prototype.fastDeltaWithOwnCommunity=function(o,u,c,d){var f=this.M,h=this.totalWeights[d];return u+=this.loops[o],c-u*(h-u)*this.resolution/(2*f)},s.prototype.bounds=function(o){return[this.starts[o],this.starts[o+1]]},s.prototype.project=function(){var o=this,u={};return o.nodes.slice(0,this.C).forEach(function(c,d){u[c]=Array.from(o.neighborhood.slice(o.starts[d],o.starts[d+1])).map(function(f){return o.nodes[f]})}),u},s.prototype.collect=function(o){arguments.length<1&&(o=this.level);var u={},c=this.keepDendrogram?this.dendrogram[o]:this.mapping,d,f;for(d=0,f=c.length;d<f;d++)u[this.nodes[d]]=c[d];return u},s.prototype.assign=function(o,u){arguments.length<2&&(u=this.level);var c=this.keepDendrogram?this.dendrogram[u]:this.mapping,d,f;for(d=0,f=c.length;d<f;d++)this.graph.setNodeAttribute(this.nodes[d],o,c[d])},s.prototype[r]=function(){var o={};Object.defineProperty(o,"constructor",{value:s,enumerable:!1}),o.C=this.C,o.M=this.M,o.E=this.E,o.U=this.U,o.resolution=this.resolution,o.level=this.level,o.nodes=this.nodes,o.starts=this.starts.slice(0,o.C+1);var u=["neighborhood","weights"],c=["counts","loops","belongings","totalWeights"],d=this;return u.forEach(function(f){o[f]=d[f].slice(0,o.E)}),c.forEach(function(f){o[f]=d[f].slice(0,o.C)}),o.unused=this.unused.slice(0,this.U),this.keepDendrogram?o.dendrogram=this.dendrogram:o.mapping=this.mapping,o};function a(o,u){u=e(u,i);var c=u.resolution,d=t(u.getEdgeWeight).fromEntry,f=(o.size-o.selfLoopCount)*2,h=n.getPointerArray(f),g=n.getPointerArray(o.order+1),k=u.getEdgeWeight?Float64Array:n.getPointerArray(o.size*2);this.C=o.order,this.M=0,this.E=f,this.U=0,this.resolution=c,this.level=0,this.graph=o,this.nodes=new Array(o.order),this.keepDendrogram=u.keepDendrogram,this.neighborhood=new g(f),this.weights=new k(f),this.loops=new k(o.order),this.starts=new h(o.order+1),this.offsets=new h(o.order),this.belongings=new g(o.order),this.dendrogram=[],this.counts=new g(o.order),this.unused=new g(o.order),this.totalInWeights=new k(o.order),this.totalOutWeights=new k(o.order);var A={},y,b=0,T=0,_=this;o.forEachNode(function(p){_.nodes[b]=p,A[p]=b,T+=o.outDegreeWithoutSelfLoops(p),_.starts[b]=T,T+=o.inDegreeWithoutSelfLoops(p),_.offsets[b]=T,_.belongings[b]=b,_.counts[b]=1,b++}),o.forEachEdge(function(p,S,w,x,D,C,I){if(y=d(p,S,w,x,D,C,I),w=A[w],x=A[x],_.M+=y,w===x)_.loops[w]+=y,_.totalInWeights[w]+=y,_.totalOutWeights[w]+=y;else{_.totalOutWeights[w]+=y,_.totalInWeights[x]+=y;var te=--_.starts[w],N=--_.offsets[x];_.neighborhood[te]=x,_.neighborhood[N]=w,_.weights[te]=y,_.weights[N]=y}}),this.starts[b]=this.E,this.keepDendrogram?this.dendrogram.push(this.belongings.slice()):this.mapping=this.belongings.slice()}return a.prototype.bounds=s.prototype.bounds,a.prototype.inBounds=function(o){return[this.offsets[o],this.starts[o+1]]},a.prototype.outBounds=function(o){return[this.starts[o],this.offsets[o]]},a.prototype.project=s.prototype.project,a.prototype.projectIn=function(){var o=this,u={};return o.nodes.slice(0,this.C).forEach(function(c,d){u[c]=Array.from(o.neighborhood.slice(o.offsets[d],o.starts[d+1])).map(function(f){return o.nodes[f]})}),u},a.prototype.projectOut=function(){var o=this,u={};return o.nodes.slice(0,this.C).forEach(function(c,d){u[c]=Array.from(o.neighborhood.slice(o.starts[d],o.offsets[d])).map(function(f){return o.nodes[f]})}),u},a.prototype.isolate=function(o,u,c){var d=this.belongings[o];if(this.counts[d]===1)return d;var f=this.unused[--this.U],h=this.loops[o];return this.totalInWeights[d]-=u+h,this.totalInWeights[f]+=u+h,this.totalOutWeights[d]-=c+h,this.totalOutWeights[f]+=c+h,this.belongings[o]=f,this.counts[d]--,this.counts[f]++,f},a.prototype.move=function(o,u,c,d){var f=this.belongings[o],h=this.loops[o];this.totalInWeights[f]-=u+h,this.totalInWeights[d]+=u+h,this.totalOutWeights[f]-=c+h,this.totalOutWeights[d]+=c+h,this.belongings[o]=d;var g=this.counts[f]--===1;this.counts[d]++,g&&(this.unused[this.U++]=f)},a.prototype.computeNodeInDegree=function(o){var u,c,d,f=0;for(u=this.offsets[o],c=this.starts[o+1];u<c;u++)d=this.weights[u],f+=d;return f},a.prototype.computeNodeOutDegree=function(o){var u,c,d,f=0;for(u=this.starts[o],c=this.offsets[o];u<c;u++)d=this.weights[u],f+=d;return f},a.prototype.expensiveMove=function(o,u){var c=this.computeNodeInDegree(o),d=this.computeNodeOutDegree(o);this.move(o,c,d,u)},a.prototype.zoomOut=function(){var o=new Array(this.C-this.U),u={},c=this.nodes.length,d=0,f=0,h,g,k,A,y,b,T,_,p,S,w,x,D;for(h=0,k=this.C;h<k;h++)b=this.belongings[h],b in u||(u[b]=d,o[d]={inAdj:{},outAdj:{},totalInWeights:this.totalInWeights[b],totalOutWeights:this.totalOutWeights[b],internalWeights:0},d++),this.belongings[h]=u[b];var C,I;if(this.keepDendrogram){for(C=this.dendrogram[this.level],I=new(n.getPointerArray(d))(c),h=0;h<c;h++)I[h]=this.belongings[C[h]];this.dendrogram.push(I)}else for(h=0;h<c;h++)this.mapping[h]=this.belongings[this.mapping[h]];for(h=0,k=this.C;h<k;h++)for(b=this.belongings[h],p=this.offsets[h],_=o[b],x=_.inAdj,D=_.outAdj,_.internalWeights+=this.loops[h],g=this.starts[h],A=this.starts[h+1];g<A;g++){if(y=this.neighborhood[g],T=this.belongings[y],S=g<p,w=S?D:x,b===T){S&&(_.internalWeights+=this.weights[g]);continue}T in w||(w[T]=0),w[T]+=this.weights[g]}for(this.C=d,y=0,b=0;b<d;b++){_=o[b],x=_.inAdj,D=_.outAdj,b=+b,this.totalInWeights[b]=_.totalInWeights,this.totalOutWeights[b]=_.totalOutWeights,this.loops[b]=_.internalWeights,this.counts[b]=1,this.starts[b]=y,this.belongings[b]=b;for(T in D)this.neighborhood[y]=+T,this.weights[y]=D[T],f++,y++;this.offsets[b]=y;for(T in x)this.neighborhood[y]=+T,this.weights[y]=x[T],f++,y++}return this.starts[d]=f,this.E=f,this.U=0,this.level++,u},a.prototype.modularity=function(){var o,u,c,d,f,h=0,g=this.M,k=new Float64Array(this.C);for(c=0;c<this.C;c++)for(o=this.belongings[c],k[o]+=this.loops[c],d=this.starts[c],f=this.offsets[c];d<f;d++)u=this.belongings[this.neighborhood[d]],o===u&&(k[o]+=this.weights[d]);for(c=0;c<this.C;c++)h+=k[c]/g-this.totalInWeights[c]*this.totalOutWeights[c]/Math.pow(g,2)*this.resolution;return h},a.prototype.delta=function(o,u,c,d,f){var h=this.M,g=this.totalInWeights[f],k=this.totalOutWeights[f],A=this.loops[o];return u+=A,c+=A,d/h-(c*g+u*k)*this.resolution/(h*h)},a.prototype.deltaWithOwnCommunity=function(o,u,c,d,f){var h=this.M,g=this.totalInWeights[f],k=this.totalOutWeights[f],A=this.loops[o];return u+=A,c+=A,d/h-(c*(g-u)+u*(k-c))*this.resolution/(h*h)},a.prototype.collect=s.prototype.collect,a.prototype.assign=s.prototype.assign,a.prototype[r]=function(){var o={};Object.defineProperty(o,"constructor",{value:a,enumerable:!1}),o.C=this.C,o.M=this.M,o.E=this.E,o.U=this.U,o.resolution=this.resolution,o.level=this.level,o.nodes=this.nodes,o.starts=this.starts.slice(0,o.C+1);var u=["neighborhood","weights"],c=["counts","offsets","loops","belongings","totalInWeights","totalOutWeights"],d=this;return u.forEach(function(f){o[f]=d[f].slice(0,o.E)}),c.forEach(function(f){o[f]=d[f].slice(0,o.C)}),o.unused=this.unused.slice(0,this.U),this.keepDendrogram?o.dendrogram=this.dendrogram:o.mapping=this.mapping,o},nn.UndirectedLouvainIndex=s,nn.DirectedLouvainIndex=a,nn}var Yn,xs;function yd(){if(xs)return Yn;xs=1;var n=$o(),e=fi(),t=fd(),r=hd(),i=pd(),s=gd().createRandomIndex,a=vd(),o=a.UndirectedLouvainIndex,u=a.DirectedLouvainIndex,c={nodeCommunityAttribute:"community",getEdgeWeight:"weight",fastLocalMoves:!0,randomWalk:!0,resolution:1,rng:Math.random};function d(b,T,_){var p=b.get(T);typeof p>"u"&&(p=0),p+=_,b.set(T,p)}var f=1e-10;function h(b,T,_,p,S){return Math.abs(p-S)<f?b===T?!1:_>b:p>S}function g(b,T,_){var p=new o(T,{getEdgeWeight:_.getEdgeWeight,keepDendrogram:b,resolution:_.resolution}),S=s(_.rng),w=!0,x=!0,D,C,I=new r(Float64Array,p.C),te,N,v,Me,Be,O,m,F,H,ne,pe,Ae,W,Ne,qe,Ue,Pe=0,Fe=0,Xe=[],ge,Q;for(_.fastLocalMoves&&(te=new i(p.C));w;){if(ne=p.C,w=!1,x=!0,_.fastLocalMoves){for(Q=0,O=_.randomWalk?S(ne):0,m=0;m<ne;m++,O++)F=O%ne,te.enqueue(F);for(;te.size!==0;){for(F=te.dequeue(),Fe++,pe=0,I.clear(),D=p.belongings[F],N=p.starts[F],v=p.starts[F+1];N<v;N++)H=p.neighborhood[N],Me=p.weights[N],C=p.belongings[H],pe+=Me,d(I,C,Me);for(Ne=p.fastDeltaWithOwnCommunity(F,pe,I.get(D)||0,D),W=D,Be=0;Be<I.size;Be++)C=I.dense[Be],C!==D&&(Ae=I.vals[Be],Pe++,Ue=p.fastDelta(F,pe,Ae,C),qe=h(W,D,C,Ue,Ne),qe&&(Ne=Ue,W=C));if(Ne<0){if(W=p.isolate(F,pe),W===D)continue}else{if(W===D)continue;p.move(F,pe,W)}for(w=!0,Q++,N=p.starts[F],v=p.starts[F+1];N<v;N++)H=p.neighborhood[N],C=p.belongings[H],C!==W&&te.enqueue(H)}Xe.push(Q)}else for(ge=[],Xe.push(ge);x;){for(x=!1,Q=0,O=_.randomWalk?S(ne):0,m=0;m<ne;m++,O++){for(F=O%ne,Fe++,pe=0,I.clear(),D=p.belongings[F],N=p.starts[F],v=p.starts[F+1];N<v;N++)H=p.neighborhood[N],Me=p.weights[N],C=p.belongings[H],pe+=Me,d(I,C,Me);for(Ne=p.fastDeltaWithOwnCommunity(F,pe,I.get(D)||0,D),W=D,Be=0;Be<I.size;Be++)C=I.dense[Be],C!==D&&(Ae=I.vals[Be],Pe++,Ue=p.fastDelta(F,pe,Ae,C),qe=h(W,D,C,Ue,Ne),qe&&(Ne=Ue,W=C));if(Ne<0){if(W=p.isolate(F,pe),W===D)continue}else{if(W===D)continue;p.move(F,pe,W)}x=!0,Q++}ge.push(Q),w=x||w}w&&p.zoomOut()}var se={index:p,deltaComputations:Pe,nodesVisited:Fe,moves:Xe};return se}function k(b,T,_){var p=new u(T,{getEdgeWeight:_.getEdgeWeight,keepDendrogram:b,resolution:_.resolution}),S=s(_.rng),w=!0,x=!0,D,C,I=new r(Float64Array,p.C),te,N,v,Me,Be,O,m,F,H,ne,pe,Ae,W,Ne,qe,Ue,Pe,Fe,Xe,ge=0,Q=0,se=[],et,q;for(_.fastLocalMoves&&(te=new i(p.C));w;){if(Ae=p.C,w=!1,x=!0,_.fastLocalMoves){for(q=0,F=_.randomWalk?S(Ae):0,H=0;H<Ae;H++,F++)ne=F%Ae,te.enqueue(ne);for(;te.size!==0;){for(ne=te.dequeue(),Q++,W=0,Ne=0,I.clear(),D=p.belongings[ne],N=p.starts[ne],v=p.starts[ne+1],Me=p.offsets[ne];N<v;N++)Be=N<Me,pe=p.neighborhood[N],O=p.weights[N],C=p.belongings[pe],Be?Ne+=O:W+=O,d(I,C,O);for(Pe=p.deltaWithOwnCommunity(ne,W,Ne,I.get(D)||0,D),Ue=D,m=0;m<I.size;m++)C=I.dense[m],C!==D&&(qe=I.vals[m],ge++,Xe=p.delta(ne,W,Ne,qe,C),Fe=h(Ue,D,C,Xe,Pe),Fe&&(Pe=Xe,Ue=C));if(Pe<0){if(Ue=p.isolate(ne,W,Ne),Ue===D)continue}else{if(Ue===D)continue;p.move(ne,W,Ne,Ue)}for(w=!0,q++,N=p.starts[ne],v=p.starts[ne+1];N<v;N++)pe=p.neighborhood[N],C=p.belongings[pe],C!==Ue&&te.enqueue(pe)}se.push(q)}else for(et=[],se.push(et);x;){for(x=!1,q=0,F=_.randomWalk?S(Ae):0,H=0;H<Ae;H++,F++){for(ne=F%Ae,Q++,W=0,Ne=0,I.clear(),D=p.belongings[ne],N=p.starts[ne],v=p.starts[ne+1],Me=p.offsets[ne];N<v;N++)Be=N<Me,pe=p.neighborhood[N],O=p.weights[N],C=p.belongings[pe],Be?Ne+=O:W+=O,d(I,C,O);for(Pe=p.deltaWithOwnCommunity(ne,W,Ne,I.get(D)||0,D),Ue=D,m=0;m<I.size;m++)C=I.dense[m],C!==D&&(qe=I.vals[m],ge++,Xe=p.delta(ne,W,Ne,qe,C),Fe=h(Ue,D,C,Xe,Pe),Fe&&(Pe=Xe,Ue=C));if(Pe<0){if(Ue=p.isolate(ne,W,Ne),Ue===D)continue}else{if(Ue===D)continue;p.move(ne,W,Ne,Ue)}x=!0,q++}et.push(q),w=x||w}w&&p.zoomOut()}var K={index:p,deltaComputations:ge,nodesVisited:Q,moves:se};return K}function A(b,T,_,p){if(!e(_))throw new Error("graphology-communities-louvain: the given graph is not a valid graphology instance.");var S=t(_);if(S==="mixed")throw new Error("graphology-communities-louvain: cannot run the algorithm on a true mixed graph.");p=n(p,c);var w=0;if(_.size===0){if(b){_.forEachNode(function(N){_.setNodeAttribute(N,p.nodeCommunityAttribute,w++)});return}var x={};return _.forEachNode(function(N){x[N]=w++}),T?{communities:x,count:_.order,deltaComputations:0,dendrogram:null,level:0,modularity:NaN,moves:null,nodesVisited:0,resolution:p.resolution}:x}var D=S==="undirected"?g:k,C=D(T,_,p),I=C.index;if(!T){if(b){I.assign(p.nodeCommunityAttribute);return}return I.collect()}var te={count:I.C,deltaComputations:C.deltaComputations,dendrogram:I.dendrogram,level:I.level,modularity:I.modularity(),moves:C.moves,nodesVisited:C.nodesVisited,resolution:p.resolution};return b?(I.assign(p.nodeCommunityAttribute),te):(te.communities=I.collect(),te)}var y=A.bind(null,!1,!1);return y.assign=A.bind(null,!0,!1),y.detailed=A.bind(null,!1,!0),y.defaults=c,Yn=y,Yn}var bd=yd();const md=fo(bd);var Jn,ks;function wd(){if(ks)return Jn;ks=1;var n=0,e=1,t=2,r=3,i=4,s=5,a=6,o=7,u=8,c=9,d=0,f=1,h=2,g=0,k=1,A=2,y=3,b=4,T=5,_=6,p=7,S=8,w=3,x=10,D=3,C=9,I=10;return Jn=function(N,v,Me){var Be,O,m,F,H,ne,pe,Ae,W,Ne,qe=v.length,Ue=Me.length,Pe=N.adjustSizes,Fe=N.barnesHutTheta*N.barnesHutTheta,Xe,ge,Q,se,et,q,K,$=[];for(m=0;m<qe;m+=x)v[m+i]=v[m+t],v[m+s]=v[m+r],v[m+t]=0,v[m+r]=0;if(N.outboundAttractionDistribution){for(Xe=0,m=0;m<qe;m+=x)Xe+=v[m+a];Xe/=qe/x}if(N.barnesHutOptimize){var gt=1/0,Et=-1/0,xt=1/0,Lt=-1/0,nt,kt,Er;for(m=0;m<qe;m+=x)gt=Math.min(gt,v[m+n]),Et=Math.max(Et,v[m+n]),xt=Math.min(xt,v[m+e]),Lt=Math.max(Lt,v[m+e]);var Ht=Et-gt,qt=Lt-xt;for(Ht>qt?(xt-=(Ht-qt)/2,Lt=xt+Ht):(gt-=(qt-Ht)/2,Et=gt+qt),$[0+g]=-1,$[0+k]=(gt+Et)/2,$[0+A]=(xt+Lt)/2,$[0+y]=Math.max(Et-gt,Lt-xt),$[0+b]=-1,$[0+T]=-1,$[0+_]=0,$[0+p]=0,$[0+S]=0,Be=1,m=0;m<qe;m+=x)for(O=0,Er=w;;)if($[O+T]>=0){v[m+n]<$[O+k]?v[m+e]<$[O+A]?nt=$[O+T]:nt=$[O+T]+C:v[m+e]<$[O+A]?nt=$[O+T]+C*2:nt=$[O+T]+C*3,$[O+p]=($[O+p]*$[O+_]+v[m+n]*v[m+a])/($[O+_]+v[m+a]),$[O+S]=($[O+S]*$[O+_]+v[m+e]*v[m+a])/($[O+_]+v[m+a]),$[O+_]+=v[m+a],O=nt;continue}else if($[O+g]<0){$[O+g]=m;break}else{if($[O+T]=Be*C,Ae=$[O+y]/2,W=$[O+T],$[W+g]=-1,$[W+k]=$[O+k]-Ae,$[W+A]=$[O+A]-Ae,$[W+y]=Ae,$[W+b]=W+C,$[W+T]=-1,$[W+_]=0,$[W+p]=0,$[W+S]=0,W+=C,$[W+g]=-1,$[W+k]=$[O+k]-Ae,$[W+A]=$[O+A]+Ae,$[W+y]=Ae,$[W+b]=W+C,$[W+T]=-1,$[W+_]=0,$[W+p]=0,$[W+S]=0,W+=C,$[W+g]=-1,$[W+k]=$[O+k]+Ae,$[W+A]=$[O+A]-Ae,$[W+y]=Ae,$[W+b]=W+C,$[W+T]=-1,$[W+_]=0,$[W+p]=0,$[W+S]=0,W+=C,$[W+g]=-1,$[W+k]=$[O+k]+Ae,$[W+A]=$[O+A]+Ae,$[W+y]=Ae,$[W+b]=$[O+b],$[W+T]=-1,$[W+_]=0,$[W+p]=0,$[W+S]=0,Be+=4,v[$[O+g]+n]<$[O+k]?v[$[O+g]+e]<$[O+A]?nt=$[O+T]:nt=$[O+T]+C:v[$[O+g]+e]<$[O+A]?nt=$[O+T]+C*2:nt=$[O+T]+C*3,$[O+_]=v[$[O+g]+a],$[O+p]=v[$[O+g]+n],$[O+S]=v[$[O+g]+e],$[nt+g]=$[O+g],$[O+g]=-1,v[m+n]<$[O+k]?v[m+e]<$[O+A]?kt=$[O+T]:kt=$[O+T]+C:v[m+e]<$[O+A]?kt=$[O+T]+C*2:kt=$[O+T]+C*3,nt===kt)if(Er--){O=nt;continue}else{Er=w;break}$[kt+g]=m;break}}if(N.barnesHutOptimize)for(ge=N.scalingRatio,m=0;m<qe;m+=x)for(O=0;;)if($[O+T]>=0)if(q=Math.pow(v[m+n]-$[O+p],2)+Math.pow(v[m+e]-$[O+S],2),Ne=$[O+y],4*Ne*Ne/q<Fe){if(Q=v[m+n]-$[O+p],se=v[m+e]-$[O+S],Pe===!0?q>0?(K=ge*v[m+a]*$[O+_]/q,v[m+t]+=Q*K,v[m+r]+=se*K):q<0&&(K=-ge*v[m+a]*$[O+_]/Math.sqrt(q),v[m+t]+=Q*K,v[m+r]+=se*K):q>0&&(K=ge*v[m+a]*$[O+_]/q,v[m+t]+=Q*K,v[m+r]+=se*K),O=$[O+b],O<0)break;continue}else{O=$[O+T];continue}else{if(ne=$[O+g],ne>=0&&ne!==m&&(Q=v[m+n]-v[ne+n],se=v[m+e]-v[ne+e],q=Q*Q+se*se,Pe===!0?q>0?(K=ge*v[m+a]*v[ne+a]/q,v[m+t]+=Q*K,v[m+r]+=se*K):q<0&&(K=-ge*v[m+a]*v[ne+a]/Math.sqrt(q),v[m+t]+=Q*K,v[m+r]+=se*K):q>0&&(K=ge*v[m+a]*v[ne+a]/q,v[m+t]+=Q*K,v[m+r]+=se*K)),O=$[O+b],O<0)break;continue}else for(ge=N.scalingRatio,F=0;F<qe;F+=x)for(H=0;H<F;H+=x)Q=v[F+n]-v[H+n],se=v[F+e]-v[H+e],Pe===!0?(q=Math.sqrt(Q*Q+se*se)-v[F+u]-v[H+u],q>0?(K=ge*v[F+a]*v[H+a]/q/q,v[F+t]+=Q*K,v[F+r]+=se*K,v[H+t]-=Q*K,v[H+r]-=se*K):q<0&&(K=100*ge*v[F+a]*v[H+a],v[F+t]+=Q*K,v[F+r]+=se*K,v[H+t]-=Q*K,v[H+r]-=se*K)):(q=Math.sqrt(Q*Q+se*se),q>0&&(K=ge*v[F+a]*v[H+a]/q/q,v[F+t]+=Q*K,v[F+r]+=se*K,v[H+t]-=Q*K,v[H+r]-=se*K));for(W=N.gravity/N.scalingRatio,ge=N.scalingRatio,m=0;m<qe;m+=x)K=0,Q=v[m+n],se=v[m+e],q=Math.sqrt(Math.pow(Q,2)+Math.pow(se,2)),N.strongGravityMode?q>0&&(K=ge*v[m+a]*W):q>0&&(K=ge*v[m+a]*W/q),v[m+t]-=Q*K,v[m+r]-=se*K;for(ge=1*(N.outboundAttractionDistribution?Xe:1),pe=0;pe<Ue;pe+=D)F=Me[pe+d],H=Me[pe+f],Ae=Me[pe+h],et=Math.pow(Ae,N.edgeWeightInfluence),Q=v[F+n]-v[H+n],se=v[F+e]-v[H+e],Pe===!0?(q=Math.sqrt(Q*Q+se*se)-v[F+u]-v[H+u],N.linLogMode?N.outboundAttractionDistribution?q>0&&(K=-ge*et*Math.log(1+q)/q/v[F+a]):q>0&&(K=-ge*et*Math.log(1+q)/q):N.outboundAttractionDistribution?q>0&&(K=-ge*et/v[F+a]):q>0&&(K=-ge*et)):(q=Math.sqrt(Math.pow(Q,2)+Math.pow(se,2)),N.linLogMode?N.outboundAttractionDistribution?q>0&&(K=-ge*et*Math.log(1+q)/q/v[F+a]):q>0&&(K=-ge*et*Math.log(1+q)/q):N.outboundAttractionDistribution?(q=1,K=-ge*et/v[F+a]):(q=1,K=-ge*et)),q>0&&(v[F+t]+=Q*K,v[F+r]+=se*K,v[H+t]-=Q*K,v[H+r]-=se*K);var tr,Ut,rr,Ct,Vt,Pt;if(Pe===!0)for(m=0;m<qe;m+=x)v[m+c]!==1&&(tr=Math.sqrt(Math.pow(v[m+t],2)+Math.pow(v[m+r],2)),tr>I&&(v[m+t]=v[m+t]*I/tr,v[m+r]=v[m+r]*I/tr),Ut=v[m+a]*Math.sqrt((v[m+i]-v[m+t])*(v[m+i]-v[m+t])+(v[m+s]-v[m+r])*(v[m+s]-v[m+r])),rr=Math.sqrt((v[m+i]+v[m+t])*(v[m+i]+v[m+t])+(v[m+s]+v[m+r])*(v[m+s]+v[m+r]))/2,Ct=.1*Math.log(1+rr)/(1+Math.sqrt(Ut)),Vt=v[m+n]+v[m+t]*(Ct/N.slowDown),v[m+n]=Vt,Pt=v[m+e]+v[m+r]*(Ct/N.slowDown),v[m+e]=Pt);else for(m=0;m<qe;m+=x)v[m+c]!==1&&(Ut=v[m+a]*Math.sqrt((v[m+i]-v[m+t])*(v[m+i]-v[m+t])+(v[m+s]-v[m+r])*(v[m+s]-v[m+r])),rr=Math.sqrt((v[m+i]+v[m+t])*(v[m+i]+v[m+t])+(v[m+s]+v[m+r])*(v[m+s]+v[m+r]))/2,Ct=v[m+o]*Math.log(1+rr)/(1+Math.sqrt(Ut)),v[m+o]=Math.min(1,Math.sqrt(Ct*(Math.pow(v[m+t],2)+Math.pow(v[m+r],2))/(1+Math.sqrt(Ut)))),Vt=v[m+n]+v[m+t]*(Ct/N.slowDown),v[m+n]=Vt,Pt=v[m+e]+v[m+r]*(Ct/N.slowDown),v[m+e]=Pt);return{}},Jn}var Tt={},Ss;function _d(){if(Ss)return Tt;Ss=1;var n=10,e=3;return Tt.assign=function(t){t=t||{};var r=Array.prototype.slice.call(arguments).slice(1),i,s,a;for(i=0,a=r.length;i<a;i++)if(r[i])for(s in r[i])t[s]=r[i][s];return t},Tt.validateSettings=function(t){return"linLogMode"in t&&typeof t.linLogMode!="boolean"?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in t&&typeof t.outboundAttractionDistribution!="boolean"?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in t&&typeof t.adjustSizes!="boolean"?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in t&&typeof t.edgeWeightInfluence!="number"?{message:"the `edgeWeightInfluence` setting should be a number."}:"scalingRatio"in t&&!(typeof t.scalingRatio=="number"&&t.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in t&&typeof t.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in t&&!(typeof t.gravity=="number"&&t.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in t&&!(typeof t.slowDown=="number"||t.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in t&&typeof t.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in t&&!(typeof t.barnesHutTheta=="number"&&t.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},Tt.graphToByteArrays=function(t,r){var i=t.order,s=t.size,a={},o,u=new Float32Array(i*n),c=new Float32Array(s*e);return o=0,t.forEachNode(function(d,f){a[d]=o,u[o]=f.x,u[o+1]=f.y,u[o+2]=0,u[o+3]=0,u[o+4]=0,u[o+5]=0,u[o+6]=1,u[o+7]=1,u[o+8]=f.size||1,u[o+9]=f.fixed?1:0,o+=n}),o=0,t.forEachEdge(function(d,f,h,g,k,A,y){var b=a[h],T=a[g],_=r(d,f,h,g,k,A,y);u[b+6]+=_,u[T+6]+=_,c[o]=b,c[o+1]=T,c[o+2]=_,o+=e}),{nodes:u,edges:c}},Tt.assignLayoutChanges=function(t,r,i){var s=0;t.updateEachNodeAttributes(function(a,o){return o.x=r[s],o.y=r[s+1],s+=n,i?i(a,o):o})},Tt.readGraphPositions=function(t,r){var i=0;t.forEachNode(function(s,a){r[i]=a.x,r[i+1]=a.y,i+=n})},Tt.collectLayoutChanges=function(t,r,i){for(var s=t.nodes(),a={},o=0,u=0,c=r.length;o<c;o+=n){if(i){var d=Object.assign({},t.getNodeAttributes(s[u]));d.x=r[o],d.y=r[o+1],d=i(s[u],d),a[s[u]]={x:d.x,y:d.y}}else a[s[u]]={x:r[o],y:r[o+1]};u++}return a},Tt.createWorker=function(r){var i=window.URL||window.webkitURL,s=r.toString(),a=i.createObjectURL(new Blob(["("+s+").call(this);"],{type:"text/javascript"})),o=new Worker(a);return i.revokeObjectURL(a),o},Tt}var Xn,As;function Ed(){return As||(As=1,Xn={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}),Xn}var Zn,$s;function xd(){if($s)return Zn;$s=1;var n=fi(),e=Lo().createEdgeWeightGetter,t=wd(),r=_d(),i=Ed();function s(u,c,d){if(!n(c))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");typeof d=="number"&&(d={iterations:d});var f=d.iterations;if(typeof f!="number")throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(f<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var h=e("getEdgeWeight"in d?d.getEdgeWeight:"weight").fromEntry,g=typeof d.outputReducer=="function"?d.outputReducer:null,k=r.assign({},i,d.settings),A=r.validateSettings(k);if(A)throw new Error("graphology-layout-forceatlas2: "+A.message);var y=r.graphToByteArrays(c,h),b;for(b=0;b<f;b++)t(k,y.nodes,y.edges);if(u){r.assignLayoutChanges(c,y.nodes,g);return}return r.collectLayoutChanges(c,y.nodes)}function a(u){var c=typeof u=="number"?u:u.order;return{barnesHutOptimize:c>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(c)}}var o=s.bind(null,!1);return o.assign=s.bind(null,!0),o.inferSettings=a,Zn=o,Zn}var kd=xd();const Ds=fo(kd),Sd=["centrality_score","centrality","pagerank","page_rank","betweenness","closeness","eigenvector","degree","score"];function Ad(n){return n==null?"":String(n)}function $d(n){const e=typeof n=="number"?n:typeof n=="string"&&n.trim()?Number(n):NaN;return Number.isFinite(e)?e:null}function Ls(n){for(const e of Sd){const t=$d(n.data[e]);if(t!==null)return t}return null}function Cs(n,e){for(const t of e){const r=n[t];if(typeof r=="string"&&r.trim())return r}return null}function pi(n,e){const t=n[e];return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Gs(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"||typeof e=="number").map(e=>String(e).trim()).filter(Boolean):[]}function Dd(n){const e=pi(n.data,"metadata");return Cs(n.data,["description","summary","content"])??(e?Cs(e,["description","summary","content"]):null)}function Ld(n){const e=Gs(n.data.exports);if(e.length>0)return e;const t=pi(n.data,"metadata");return t?Gs(t.exports):[]}function Is(n,e){for(const t of e){const r=n[t];if(typeof r=="boolean")return r;if(typeof r=="string"){const i=r.trim().toLowerCase();if(["true","yes","1"].includes(i))return!0;if(["false","no","0"].includes(i))return!1}}return null}function Co(n,e){var i;const t=pi(n.data,"metadata"),r=Is(n.data,["orphan","is_orphan","isOrphan","dead_code","deadCode"])??(t?Is(t,["orphan","is_orphan","isOrphan","dead_code","deadCode"]):null);return r!==null?r:(((i=e==null?void 0:e.get(n.id))==null?void 0:i.inDegree)??1)===0}function Cd(n){var r,i;const e=((r=n.data)==null?void 0:r.kind)??((i=n.data)==null?void 0:i.type)??n.label,t=typeof e=="string"?e.toLowerCase():"";return t==="imports"||t==="import"||t==="imports_from"?"imports":t==="defines"||t==="defined_in"||t==="contains"?"defines":"references"}function Gd(n,e){return n==="imports"?e==="incoming"?"imported by":"imports":n==="defines"?e==="incoming"?"defined by":"defines":e==="incoming"?"referenced by":"references"}function Id(n,e,t,r){const i=new Map(e.map(c=>[c.id,c])),s=[];for(const c of t){const d=c.source===n.id?"outgoing":c.target===n.id?"incoming":null;if(!d)continue;const f=d==="outgoing"?c.target:c.source,h=i.get(f),g=Cd(c);s.push({id:c.id,kind:g,direction:d,label:Gd(g,d),edgeLabel:c.label,nodeId:f,nodeLabel:(h==null?void 0:h.label)??f})}const a=(c,d)=>c.kind.localeCompare(d.kind)||c.nodeLabel.localeCompare(d.nodeLabel)||c.nodeId.localeCompare(d.nodeId),o=s.filter(c=>c.direction==="incoming").sort(a),u=s.filter(c=>c.direction==="outgoing").sort(a);return{description:Dd(n),exports:Ld(n),orphan:Co(n,r),incoming:o,outgoing:u,whereUsed:o}}function Td(n,e){const t=new Map;for(const r of n)t.set(r.id,{degree:0,inDegree:0,outDegree:0,score:Ls(r)??0});for(const r of e){const i=t.get(r.source),s=t.get(r.target);i&&(i.outDegree+=1,i.degree+=1),s&&(s.inDegree+=1,s.degree+=1)}for(const r of n){const i=t.get(r.id);i&&(i.score=Ls(r)??i.degree)}return t}function Od(n,e,t){const r=t.get(n.id),i=t.get(e.id),s=((i==null?void 0:i.score)??0)-((r==null?void 0:r.score)??0);if(s!==0)return s;const a=((i==null?void 0:i.degree)??0)-((r==null?void 0:r.degree)??0);if(a!==0)return a;const o=n.label.localeCompare(e.label);return o!==0?o:n.id.localeCompare(e.id)}function Rd(n,e){const t=n.map(s=>{var a;return((a=e.get(s.id))==null?void 0:a.inDegree)??0});return Math.max(0,...t)<=0?new Map(n.map(s=>[s.id,1])):[...new Set(t)].sort((s,a)=>s-a).length===1?new Map(n.map(s=>[s.id,1])):new Map(n.map(s=>{var u;const a=((u=e.get(s.id))==null?void 0:u.inDegree)??0;if(a<=0)return[s.id,1];const o=t.filter(c=>c<=a).length/t.length;return o>.95?[s.id,2]:o>.8?[s.id,1.5]:o>.5?[s.id,1.25]:[s.id,1]}))}function Ts(n){const e=n.id??n.rid??n._id??n.uid;return e==null?null:String(e)}function Os(n,e){const t=n.label??n.name??n.title;return t!=null?String(t):e}function Nd(n){const e=n.source??n.from??n.src??n.start,t=n.target??n.to??n.dst??n.end;return e==null||t===null||t===void 0?null:{source:String(e),target:String(t)}}function Ud(n){const e=new Map,t=new Map;for(const r of n.result.records){if(r.nodes)for(const s of Object.values(r.nodes)){if(!s||typeof s!="object")continue;const a=s,o=Ts(a);o&&(e.has(o)||e.set(o,{id:o,label:Os(a,o),data:a}))}if(r.edges)for(const s of Object.values(r.edges)){if(!s||typeof s!="object")continue;const a=s,o=Nd(a);if(!o)continue;const u=a.label??a.type??a.rel,c=`${o.source}->${o.target}:${Ad(u)}`;t.has(c)||t.set(c,{id:c,source:o.source,target:o.target,label:u!==void 0?String(u):void 0,data:a})}const i=r.values;if(i&&typeof i=="object"){const s=i.kind;if(s==="node"){const a=Ts(i);a&&!e.has(a)&&e.set(a,{id:a,label:Os(i,a),data:i})}else if(s==="edge"){const a=i.from_rid??i.from,o=i.to_rid??i.to;if(a!=null&&o!==void 0&&o!==null){const u=String(a),c=String(o),d=i.label??i.type??i.rel,h=`e:${i.rid??i.id??`${u}->${c}`}`;t.has(h)||t.set(h,{id:h,source:u,target:c,label:d!==void 0?String(d):void 0,data:i})}}}}return{nodes:[...e.values()],edges:[...t.values()]}}function dh(n){var t;const e=(t=n.result)==null?void 0:t.records;return!e||e.length===0?!1:e.some(r=>{if(r.nodes&&Object.keys(r.nodes).length>0||r.edges&&Object.keys(r.edges).length>0)return!0;const i=r.values;return!!(i&&(i.kind==="node"||i.kind==="edge"))})}function Pd(n){let e=n>>>0;return()=>{e=e+1831565813>>>0;let t=e;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function zd(n,e){const t=new Map;if(n.length===0)return t;if(n.length===1)return t.set(n[0].id,{x:50,y:50,community:0}),t;const r=new Te({type:"undirected",multi:!1,allowSelfLoops:!0}),i=Pd(n.length*131+e.length),s=Math.PI*2;n.forEach((A,y)=>{const b=y/n.length*s+i()*.1;r.addNode(A.id,{x:Math.cos(b),y:Math.sin(b)})});for(const A of e)!r.hasNode(A.source)||!r.hasNode(A.target)||A.source!==A.target&&(r.hasEdge(A.source,A.target)||r.addEdge(A.source,A.target));if(r.size===0){const A=Math.ceil(Math.sqrt(n.length));return n.forEach((y,b)=>{const T=Math.floor(b/A),_=b%A;t.set(y.id,{x:10+_/Math.max(1,A-1)*80,y:10+T/Math.max(1,A-1)*80,community:b})}),t}md.assign(r,{nodeCommunityAttribute:"community",rng:i});const a=Ds.inferSettings(r);Ds.assign(r,{iterations:n.length>200?120:200,settings:{...a,strongGravityMode:!0,gravity:1.2,scalingRatio:10,barnesHutOptimize:n.length>500}});let o=1/0,u=-1/0,c=1/0,d=-1/0;r.forEachNode((A,y)=>{y.x<o&&(o=y.x),y.x>u&&(u=y.x),y.y<c&&(c=y.y),y.y>d&&(d=y.y)});const f=u-o||1,h=d-c||1,g=5,k=100-g*2;return r.forEachNode((A,y)=>{t.set(A,{x:g+(y.x-o)/f*k,y:g+(y.y-c)/h*k,community:y.community??0})}),t}function Go(n,e=!0){const t=[200,25,145,290,50,175,320,95,0,260,220,130],r=n<t.length?t[n]:(t[0]+n*137.508)%360,i=e?62:58,s=e?60:48;return`hsl(${r.toFixed(0)} ${i}% ${s}%)`}function hn(n){switch(n){case"tale":return"#ff2056";case"character":return"#7dd3fc";case"location":return"#a3e635";case"object":return"#fbbf24";case"archetype":return"#a78bfa";default:return"#94a3b8"}}function Wd(n){return n==="tale"?8:n==="character"?5:n==="location"||n==="object"?4:3}function Io(n,e){const t=Math.max(.35,Math.min(1.25,Wd(n)*.14));return Math.max(.35,Math.min(2.5,t*e))}const jd=3.4;function Md(n,e){return Io(n,e)*jd}function Bd(n,e,t){const r=e/100,i=t/100,s=(1-Math.abs(2*i-1))*r,a=(n%360+360)%360/60,o=s*(1-Math.abs(a%2-1));let u=0,c=0,d=0;a>=0&&a<1?[u,c,d]=[s,o,0]:a<2?[u,c,d]=[o,s,0]:a<3?[u,c,d]=[0,s,o]:a<4?[u,c,d]=[0,o,s]:a<5?[u,c,d]=[o,0,s]:[u,c,d]=[s,0,o];const f=i-s/2;return{r:Math.round((u+f)*255),g:Math.round((c+f)*255),b:Math.round((d+f)*255)}}function To(n){const e=n.match(/hsl\(\s*([\d.]+)\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%/i);return e?Bd(Number(e[1]),Number(e[2]),Number(e[3])):null}function Fd({r:n,g:e,b:t}){return`rgb(${n}, ${e}, ${t})`}function Kd(n,e=!0){const t=Go(n,e),r=To(t);return r?Fd(r):t}function pn(n,e){const t=Math.max(0,Math.min(1,e)),r=n.startsWith("hsl")?To(n):null;if(r)return`rgba(${r.r}, ${r.g}, ${r.b}, ${t})`;const i=n.match(/rgb\(\s*([\d.]+)[, ]+([\d.]+)[, ]+([\d.]+)/i);if(i)return`rgba(${i[1]}, ${i[2]}, ${i[3]}, ${t})`;const s=n.replace("#","");if(/^[0-9a-f]{6}$/i.test(s)){const a=parseInt(s.slice(0,2),16),o=parseInt(s.slice(2,4),16),u=parseInt(s.slice(4,6),16);return`rgba(${a}, ${o}, ${u}, ${t})`}return n}const Hd="#d6a72c",qd="#f4c84a";function Vd(n){const{nodes:e,edges:t,layout:r,sizeScales:i,orphanIds:s,dark:a=!0,edgeColor:o="#3a424d"}=n,u=new Te({type:"directed",multi:!0,allowSelfLoops:!0});for(const c of e){if(u.hasNode(c.id))continue;const d=String(c.data.node_type??"node"),f=i.get(c.id)??1,h=r.get(c.id),g=Md(d,f),k=h?Kd(h.community,a):hn(d);u.addNode(c.id,{x:(h==null?void 0:h.x)??50,y:-((h==null?void 0:h.y)??50),size:g,baseSize:g,color:k,mutedColor:pn(k,.14),borderColor:hn(d),label:c.label,nodeType:d,community:(h==null?void 0:h.community)??-1,orphan:s.has(c.id),type:"border"})}for(const c of t)!u.hasNode(c.source)||!u.hasNode(c.target)||u.hasEdge(c.id)||u.addEdgeWithKey(c.id,c.source,c.target,{size:1,color:pn(o,.34),edgeLabel:c.label??"",label:"",type:"line"});return u}const Yd=36,Jd=28,Xd=36;function Zd(n,e,t){const{focus:r,focusId:i,selectedNodeId:s,pulse:a,colors:o}=t,u=i!==null,c=i===n,d=r.nodes.has(n),f=!u||d,h=u?c?2.2+a*.38:d?1.58:.9:1,g=c?o.focusNodeStroke:e.orphan?o.warn:s===n?o.selectedNodeStroke:e.borderColor,k=u&&(c||r.nodes.size<=Xd&&d);return{size:e.baseSize*h,color:f?e.color:e.mutedColor,borderColor:g,label:k?e.label.slice(0,Yd):"",forceLabel:k,zIndex:c?3:d?2:1,hidden:!1}}function Qd(n,e,t){const{focus:r,focusId:i,colors:s}=t,a=i!==null,o=r.edges.has(n);return a?o?{size:2.2,color:s.focusEdge,label:e.edgeLabel?e.edgeLabel.slice(0,Jd):"",forceLabel:!!e.edgeLabel,zIndex:2,hidden:!1}:{size:e.size,color:pn(s.edge,.055),label:"",forceLabel:!1,zIndex:0,hidden:!1}:{size:e.size,color:pn(s.edge,.34),label:"",forceLabel:!1,zIndex:0,hidden:!1}}var ef=ie('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6 svelte-gt9p7f">No graph shape in this result.</div>'),tf=ie('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer svelte-gt9p7f" aria-label="Clear filter"><!></button>'),rf=ie('<div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0 svelte-gt9p7f"><!> <input type="text" placeholder="filter by label…" class="bg-transparent text-fg-1 text-[11px] outline-none w-[160px] placeholder:text-fg-3 svelte-gt9p7f"/> <!></div> <label class="inline-flex items-center gap-1.5 text-fg-3 svelte-gt9p7f"><!> <span class="svelte-gt9p7f">limit:</span> <select class="bg-bg-1 text-fg-1 border border-line-1 rounded px-1 py-0.5 svelte-gt9p7f"><option class="svelte-gt9p7f">500</option><option class="svelte-gt9p7f">1k</option><option class="svelte-gt9p7f">2k</option><option class="svelte-gt9p7f">5k</option><option class="svelte-gt9p7f">10k</option><option class="svelte-gt9p7f">25k</option><option class="svelte-gt9p7f">50k</option></select></label>',1),nf=ie('<div class="inline-flex items-center overflow-hidden rounded border border-line-1 bg-bg-0 svelte-gt9p7f"><button type="button" class="inline-flex h-6 w-7 items-center justify-center text-fg-3 hover:bg-bg-1 hover:text-fg-0 disabled:opacity-40 svelte-gt9p7f" title="Zoom out" aria-label="Zoom out"><!></button> <button type="button" class="inline-flex h-6 min-w-12 items-center justify-center border-x border-line-1 px-2 text-[10px] text-fg-3 hover:bg-bg-1 hover:text-fg-0 svelte-gt9p7f" title="Fit graph" aria-label="Fit graph"> </button> <button type="button" class="inline-flex h-6 w-7 items-center justify-center text-fg-3 hover:bg-bg-1 hover:text-fg-0 disabled:opacity-40 svelte-gt9p7f" title="Zoom in" aria-label="Zoom in"><!></button></div>'),sf=ie('<button type="button" class="inline-flex items-center gap-1 h-6 px-2 rounded border border-line-1 text-fg-3 hover:text-fg-1 cursor-pointer svelte-gt9p7f" title="Discard graph query and show the original collection result"><!> reset</button>'),of=ie('<span class="text-accent svelte-gt9p7f"> </span>'),af=ie('<span class="text-warn svelte-gt9p7f" title="More nodes match — raise the limit or narrow the filter to see them"> </span>'),uf=ie('<span class="text-fg-2 svelte-gt9p7f"> </span>'),cf=ie('<div class="mt-1.5 text-warn svelte-gt9p7f"> </div>'),lf=ie('<div class="border-b border-line-1 px-3 py-2 bg-bg-1/20 text-[11px] font-mono svelte-gt9p7f"><div class="flex items-center gap-2 mb-1.5 text-fg-3 svelte-gt9p7f"><span class="svelte-gt9p7f">quick:</span> <button type="button" class="px-1.5 py-0.5 rounded border border-line-1 hover:border-line-2 hover:text-fg-1 cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed svelte-gt9p7f">neighborhood of selected</button> <button type="button" class="px-1.5 py-0.5 rounded border border-line-1 hover:border-line-2 hover:text-fg-1 cursor-pointer svelte-gt9p7f">top centrality</button> <button type="button" class="inline-flex items-center gap-1 px-1.5 py-0.5 rounded border border-line-1 hover:border-line-2 hover:text-fg-1 cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed svelte-gt9p7f" title="Run shortest path in reddb"><!> shortest path</button></div> <div class="mb-1.5 grid grid-cols-[1fr_1fr_auto_auto] gap-2 svelte-gt9p7f"><input type="text" placeholder="from label…" class="h-6 rounded border border-line-1 bg-bg-0 px-2 text-[11px] text-fg-1 outline-none placeholder:text-fg-3 focus:border-accent svelte-gt9p7f"/> <input type="text" placeholder="to label…" class="h-6 rounded border border-line-1 bg-bg-0 px-2 text-[11px] text-fg-1 outline-none placeholder:text-fg-3 focus:border-accent svelte-gt9p7f"/> <button type="button" class="rounded border border-line-1 px-1.5 text-fg-3 hover:border-line-2 hover:text-fg-1 disabled:opacity-40 disabled:cursor-not-allowed svelte-gt9p7f">use as from</button> <button type="button" class="rounded border border-line-1 px-1.5 text-fg-3 hover:border-line-2 hover:text-fg-1 disabled:opacity-40 disabled:cursor-not-allowed svelte-gt9p7f">use as to</button></div> <div class="flex items-stretch gap-2 svelte-gt9p7f"><textarea spellcheck="false" rows="3" class="flex-1 bg-bg-0 text-fg-1 border border-line-1 rounded px-2 py-1 text-[12px] font-mono outline-none focus:border-accent placeholder:text-fg-3 resize-none svelte-gt9p7f"></textarea> <div class="flex flex-col gap-1.5 svelte-gt9p7f"><button type="button" class="inline-flex items-center gap-1.5 h-7 px-3 rounded bg-accent text-white cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[#ff3868] svelte-gt9p7f"><!> run <span class="text-[9px] opacity-70 svelte-gt9p7f">⌘↵</span></button></div></div> <!></div>'),df=ie('<div class="border-b border-line-1 bg-warn/10 px-3 py-2 text-[11px] font-mono text-warn flex items-start gap-2 svelte-gt9p7f"><!> <div class="svelte-gt9p7f"><div class="svelte-gt9p7f">WebGL renderer unavailable. Switch to SVG or Table.</div> <div class="mt-0.5 break-words text-fg-3 svelte-gt9p7f"> </div></div></div>'),ff=ie('<div class="sigma-canvas absolute inset-0 h-full w-full bg-bg-0 svelte-gt9p7f" role="application" tabindex="0"></div>'),hf=br('<text fill="#f6d36b" opacity="0.96" font-size="1" font-weight="700" font-family="JetBrains Mono Variable, monospace" paint-order="stroke" stroke="#020617" stroke-width="0.38" class="pointer-events-none select-none svelte-gt9p7f"> </text>'),pf=br('<line class="text-line-3 cursor-pointer hover:text-accent svelte-gt9p7f" vector-effect="non-scaling-stroke" role="button" tabindex="0"><title class="svelte-gt9p7f"> </title></line><!>',1),gf=br('<circle fill="none" stroke="var(--color-warn)" vector-effect="non-scaling-stroke" class="pointer-events-none svelte-gt9p7f"></circle>'),vf=br('<text font-family="JetBrains Mono Variable, monospace" paint-order="stroke" stroke="#020617" class="pointer-events-none select-none svelte-gt9p7f"> </text>'),yf=br('<!><circle vector-effect="non-scaling-stroke" role="button" tabindex="0"><title class="svelte-gt9p7f"> </title></circle><!>',1),bf=ie('<div class="absolute inset-0 overflow-hidden bg-bg-0 svelte-gt9p7f"><svg class="h-full w-full svelte-gt9p7f" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet" role="button" tabindex="0"><rect x="0" y="0" width="100" height="100" fill="transparent" class="svelte-gt9p7f"></rect><g class="svelte-gt9p7f"><g class="svelte-gt9p7f"></g><g class="svelte-gt9p7f"></g></g></svg></div>'),mf=ie('<span class="ml-2 text-warn svelte-gt9p7f">orphan</span>'),wf=ie('<tr><td class="px-2 py-1 text-fg-3 svelte-gt9p7f">node</td><td class="px-2 py-1 text-accent font-semibold svelte-gt9p7f"> </td><td class="px-2 py-1 text-fg-0 svelte-gt9p7f"> </td><td class="px-2 py-1 text-fg-2 svelte-gt9p7f"> <!></td></tr>'),_f=ie('<tr class="border-b border-line-1/60 hover:bg-bg-1/40 cursor-pointer svelte-gt9p7f"><td class="px-2 py-1 text-fg-3 svelte-gt9p7f">edge</td><td class="px-2 py-1 text-fg-2 svelte-gt9p7f"> </td><td class="px-2 py-1 text-fg-0 svelte-gt9p7f"> </td><td class="px-2 py-1 text-fg-2 svelte-gt9p7f"> </td></tr>'),Ef=ie('<div class="absolute inset-0 overflow-auto svelte-gt9p7f"><table class="w-full border-collapse text-[12px] font-mono svelte-gt9p7f"><thead class="sticky top-0 bg-bg-1 z-10 svelte-gt9p7f"><tr class="border-b border-line-1 text-fg-3 svelte-gt9p7f"><th class="px-2 py-1.5 text-left font-normal whitespace-nowrap svelte-gt9p7f">type</th><th class="px-2 py-1.5 text-left font-normal whitespace-nowrap svelte-gt9p7f">id / rid</th><th class="px-2 py-1.5 text-left font-normal whitespace-nowrap svelte-gt9p7f">label</th><th class="px-2 py-1.5 text-left font-normal whitespace-nowrap svelte-gt9p7f">node_type / endpoints</th></tr></thead><tbody class="svelte-gt9p7f"><!><!></tbody></table></div>'),xf=ie('<span class="inline-flex shrink-0 items-center gap-1 rounded border border-warn/40 bg-warn/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-warn svelte-gt9p7f"><!> orphan</span>'),kf=ie('<span class="max-w-full truncate rounded border border-line-1 bg-bg-0 px-1.5 py-0.5 text-[11px] text-fg-1 svelte-gt9p7f"> </span>'),Sf=ie('<div class="flex flex-wrap gap-1 svelte-gt9p7f"></div>'),Af=ie('<div class="text-fg-3 svelte-gt9p7f">No exports recorded.</div>'),$f=ie('<button type="button" class="grid w-full grid-cols-[82px_1fr] gap-2 rounded border border-line-1 bg-bg-0 px-2 py-1.5 text-left hover:border-line-2 hover:bg-bg-2 svelte-gt9p7f"><span class="text-[10px] uppercase tracking-wider text-fg-3 svelte-gt9p7f"> </span> <span class="min-w-0 svelte-gt9p7f"><span class="block truncate text-fg-0 svelte-gt9p7f"> </span> <span class="block truncate text-[10px] text-fg-3 svelte-gt9p7f"> </span></span></button>'),Df=ie('<div class="space-y-1 svelte-gt9p7f"></div>'),Lf=ie('<div class="text-fg-3 svelte-gt9p7f">No inbound uses.</div>'),Cf=ie('<button type="button" class="w-full rounded border border-line-1 bg-bg-0 px-2 py-1 text-left hover:border-line-2 hover:bg-bg-2 svelte-gt9p7f"><span class="block truncate text-[10px] text-fg-3 svelte-gt9p7f"> </span> <span class="block truncate text-fg-1 svelte-gt9p7f"> </span></button>'),Gf=ie('<div class="rounded border border-line-1 px-2 py-1 text-fg-3 svelte-gt9p7f">none</div>'),If=ie('<button type="button" class="w-full rounded border border-line-1 bg-bg-0 px-2 py-1 text-left hover:border-line-2 hover:bg-bg-2 svelte-gt9p7f"><span class="block truncate text-[10px] text-fg-3 svelte-gt9p7f"> </span> <span class="block truncate text-fg-1 svelte-gt9p7f"> </span></button>'),Tf=ie('<div class="rounded border border-line-1 px-2 py-1 text-fg-3 svelte-gt9p7f">none</div>'),Of=ie('<div class="mb-3 svelte-gt9p7f"><div class="flex items-start gap-2 svelte-gt9p7f"><div class="min-w-0 flex-1 svelte-gt9p7f"><div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">label</div> <div class="break-words text-[13px] font-semibold text-fg-0 svelte-gt9p7f"> </div></div> <!></div> <div class="mt-1 break-all text-accent svelte-gt9p7f"> </div></div> <div class="mb-3 border-t border-line-1 pt-3 svelte-gt9p7f"><div class="mb-1 text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">description</div> <div class="whitespace-pre-wrap break-words text-fg-1 svelte-gt9p7f"> </div></div> <div class="mb-3 border-t border-line-1 pt-3 svelte-gt9p7f"><div class="mb-1.5 flex items-center justify-between gap-2 svelte-gt9p7f"><div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">exports</div> <span class="text-[10px] text-fg-3 svelte-gt9p7f"> </span></div> <!></div> <div class="mb-3 border-t border-line-1 pt-3 svelte-gt9p7f"><div class="mb-1.5 flex items-center justify-between gap-2 svelte-gt9p7f"><div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">where used</div> <span class="text-[10px] text-fg-3 svelte-gt9p7f"> </span></div> <!></div> <div class="mb-3 border-t border-line-1 pt-3 svelte-gt9p7f"><div class="mb-1.5 grid grid-cols-2 gap-2 svelte-gt9p7f"><div class="svelte-gt9p7f"><div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">parents</div> <div class="text-[10px] text-fg-3 svelte-gt9p7f">incoming direction</div></div> <div class="svelte-gt9p7f"><div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">children</div> <div class="text-[10px] text-fg-3 svelte-gt9p7f">outgoing direction</div></div></div> <div class="grid grid-cols-2 gap-2 svelte-gt9p7f"><div class="space-y-1 svelte-gt9p7f"><!></div> <div class="space-y-1 svelte-gt9p7f"><!></div></div></div>',1),Rf=ie('<code class="svelte-gt9p7f"> </code>'),Nf=ie('<code class="svelte-gt9p7f"> </code>'),Uf=ie('<div class="mb-2 svelte-gt9p7f"><div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">label</div> <div class="text-fg-0 font-semibold svelte-gt9p7f"> </div></div> <div class="mb-2 grid grid-cols-[60px_1fr] gap-x-2 gap-y-1 svelte-gt9p7f"><div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">from</div> <div class="text-fg-1 svelte-gt9p7f"><!></div> <div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">to</div> <div class="text-fg-1 svelte-gt9p7f"><!></div></div>',1),Pf=ie('<pre class="whitespace-pre-wrap text-[11px] svelte-gt9p7f"> </pre>'),zf=ie('<dt class="text-fg-3 truncate svelte-gt9p7f"> </dt> <dd class="text-fg-1 break-words svelte-gt9p7f"><!></dd>',1),Wf=ie('<aside class="absolute top-0 right-0 bottom-0 w-[340px] bg-bg-1 border-l border-line-2 shadow-2xl flex flex-col z-20 svelte-gt9p7f"><header class="flex items-center gap-2 px-3 py-2 border-b border-line-1 text-[11px] font-mono svelte-gt9p7f"><!> <span class="type-label svelte-gt9p7f"> </span> <span class="ml-auto svelte-gt9p7f"></span> <button type="button" aria-label="Close panel" class="text-fg-3 hover:text-fg-1 cursor-pointer svelte-gt9p7f"><!></button></header> <div class="flex-1 overflow-auto p-3 text-[12px] font-mono svelte-gt9p7f"><!> <div class="mt-3 mb-1 text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">properties</div> <dl class="grid grid-cols-[110px_1fr] gap-x-2 gap-y-1 svelte-gt9p7f"></dl></div></aside>'),jf=ie('<button type="button"><span class="svelte-gt9p7f">●</span> <span class="svelte-gt9p7f"> </span> <span class="text-fg-3 svelte-gt9p7f"> </span></button>'),Mf=ie('<span class="text-fg-3 svelte-gt9p7f">types:</span> <!>',1),Bf=ie('<span class="svelte-gt9p7f"><span class="text-fg-2 svelte-gt9p7f"> </span> <span class="text-fg-3 svelte-gt9p7f">·</span> </span>'),Ff=ie('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40 svelte-gt9p7f"><div class="inline-flex border border-line-2 rounded overflow-hidden svelte-gt9p7f"><a><!> Canvas</a> <a><!> SVG</a> <a><!> Table</a></div> <!> <!> <button type="button" title="Run a graph query (GRAPH NEIGHBORHOOD / SHORTEST_PATH / MATCH …)"><!> query</button> <!> <div class="ml-auto flex items-center gap-3 text-fg-3 svelte-gt9p7f"><span class="svelte-gt9p7f"> </span> <!> <!> <!></div></div> <!> <!> <div class="flex-1 min-h-0 relative svelte-gt9p7f"><!> <!></div> <div class="border-t border-line-1 px-3 py-1.5 text-[10px] font-mono text-fg-3 flex items-center gap-2 flex-wrap svelte-gt9p7f"><!> <span class="ml-auto svelte-gt9p7f"></span> <!></div>',1),Kf=ie('<div class="flex h-full flex-col text-fg-1 svelte-gt9p7f"><!></div>');function fh(n,e){Ks(e,!0);let t=he(null);const r=de(()=>l(t)??e.result),i=de(()=>Ud(l(r))),s=de(()=>Td(l(i).nodes,l(i).edges)),a=de(()=>Rd(l(i).nodes,l(s))),o=de(()=>new Set(l(i).nodes.filter(E=>Co(E,l(s))).map(E=>E.id)));let u=he("canvas"),c=he(25e3),d=he(""),f=he(null),h=he(null),g=he(null),k=he(350),A=he(1);const y=de(()=>l(f)?Id(l(f),l(i).nodes,l(i).edges,l(s)):null);Ft(()=>{e.subpage==="svg"&&l(u)!=="svg"?U(u,"svg"):e.subpage==="graph"&&l(u)!=="canvas"&&U(u,"canvas")});let b=he(null),T=he(null),_=he(!1),p=he(""),S=he(!1),w=he(null),x=he(""),D=he("");async function C(E){const M=Kc.client;if(!(!M||!E.trim())){U(S,!0),U(w,null);try{const J=await Bt.track(`${e.collection??"graph"} · query (${E.slice(0,40).replace(/\s+/g," ")}…)`,()=>M.query(E));if(!J.ok){U(w,J.error??"query failed",!0);return}U(t,J,!0),U(f,null),U(h,null),$()}catch(J){U(w,J.message,!0)}finally{U(S,!1)}}}function I(){U(t,null),U(p,""),U(w,null),U(f,null),U(h,null),$()}function te(){l(f)&&(U(p,`GRAPH NEIGHBORHOOD '${l(f).label}' DEPTH 1`),U(_,!0),C(l(p)))}function N(){U(p,"GRAPH CENTRALITY LIMIT 50"),U(_,!0),C(l(p))}function v(E){l(f)&&(E==="from"?U(x,l(f).label,!0):U(D,l(f).label,!0),U(_,!0))}function Me(){!l(x).trim()||!l(D).trim()||(U(p,`GRAPH SHORTEST_PATH '${l(x).trim()}' TO '${l(D).trim()}'`),U(_,!0),C(l(p)))}const Be=de(()=>{const E=new Map;for(const M of l(i).nodes){const J=String(M.data.node_type??"node");E.set(J,(E.get(J)??0)+1)}return[...E.entries()].sort((M,J)=>J[1]-M[1])});let O=he(fr(new Set));const m=de(()=>{const E=l(d).trim().toLowerCase();return l(i).nodes.filter(M=>{const J=String(M.data.node_type??"node");return l(O).has(J)?!1:E?M.label.toLowerCase().includes(E)||M.id.toLowerCase().includes(E):!0}).sort((M,J)=>Od(M,J,l(s)))}),F=de(()=>Math.min(l(m).length,l(c))),H=de(()=>l(m).slice(0,Math.min(l(F),l(k)))),ne=de(()=>new Set(l(H).map(E=>E.id))),pe=de(()=>l(i).edges.filter(E=>l(ne).has(E.source)&&l(ne).has(E.target))),Ae=de(()=>l(H).length<l(F)),W=de(()=>l(m).length>l(c));Ft(()=>{const E=l(F),M=l(u)==="canvas"?1e3:350,J=Math.min(E,M);if(U(k,J,!0),J>=E)return;let Le=!1,lt=0,yt=J;const it=()=>{Le||(yt=Math.min(E,yt+M),U(k,yt,!0),yt<E&&(lt=requestAnimationFrame(it)))};return lt=requestAnimationFrame(it),()=>{Le=!0,cancelAnimationFrame(lt)}});function Ne(E){const M=new Set(l(O));M.has(E)?M.delete(E):M.add(E),U(O,M,!0)}const qe=Hd,Ue=qd;let Pe=he(void 0),Fe=null,Xe=null,ge=he(1),Q=he(0),se=0,et=he(0);function q(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}fu(()=>{cancelAnimationFrame(se),Fe&&(Fe.kill(),Fe=null)}),hu(()=>{const E=new MutationObserver(()=>{U(et,l(et)+1)});return E.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>E.disconnect()});function K(){U(f,null),U(h,null)}function $(){U(b,null),U(T,null)}function gt(E){return l(i).nodes.find(M=>M.id===E)??null}function Et(E){const M=gt(E.nodeId);M&&(Lt(M),xt(M))}function xt(E){U(h,null),U(f,E,!0)}function Lt(E){U(T,E.id,!0),U(b,E.id,!0)}function nt(E){if(l(T)){$(),K();return}Lt(E),xt(E)}function kt(E){U(f,null),U(h,E,!0)}function Er(E){return["id","rid","label","name","title","description","summary","content","exports","orphan","is_orphan","isOrphan","dead_code","deadCode"].includes(E)}function Ht(E,M){E.key!=="Enter"&&E.key!==" "||(E.preventDefault(),M())}function qt(E){return Math.max(.5,Math.min(8,E))}const tr=de(()=>l(u)==="canvas"?Math.round(100/(l(ge)||1)):Math.round(l(A)*100));function Ut(E){if(l(u)==="canvas"){const J=Fe==null?void 0:Fe.getCamera();if(!J)return;E==="in"?J.animatedZoom(1.4):J.animatedUnzoom(1.4);return}const M=E==="in"?1.25:.8;U(A,qt(l(A)*M),!0)}function rr(){if(l(u)==="canvas"){Fe==null||Fe.getCamera().animatedReset();return}U(A,1)}function Ct(E){E.preventDefault();const M=E.deltaY<0?1.25:.8;U(A,qt(l(A)*M),!0)}const Vt=de(()=>{const E=new Map;for(const M of l(i).edges)M.label&&E.set(M.label,(E.get(M.label)??0)+1);return[...E.entries()].sort((M,J)=>J[1]-M[1]).slice(0,4)}),Pt=de(()=>zd(l(H),l(pe))),gi=de(()=>l(H).map(E=>{const M=String(E.data.node_type??"node"),J=l(a).get(E.id)??1,Le=l(Pt).get(E.id),lt=Le?Go(Le.community):hn(M);return{...E,x:(Le==null?void 0:Le.x)??50,y:(Le==null?void 0:Le.y)??50,r:Io(M,J),color:lt}})),yn=de(()=>new Map(l(gi).map(E=>[E.id,E]))),bn=de(()=>{const E=[];for(const M of l(pe)){const J=l(yn).get(M.source),Le=l(yn).get(M.target);!J||!Le||E.push({...M,x1:J.x,y1:J.y,x2:Le.x,y2:Le.y})}return E}),De=de(()=>l(T)??l(b)),Zr=de(()=>{const E=new Set;if(!l(De))return E;for(const M of l(bn))(M.source===l(De)||M.target===l(De))&&E.add(M.id);return E}),zt=de(()=>{const E=new Set;if(!l(De))return E;E.add(l(De));for(const M of l(bn))M.source===l(De)&&E.add(M.target),M.target===l(De)&&E.add(M.source);return E});Ft(()=>{const E=l(De);if(!E){U(Q,0);return}if(!l(yn).has(E)){$();return}Oo()});function Oo(){if(cancelAnimationFrame(se),q()){U(Q,0);return}const E=performance.now();U(Q,1);const M=()=>{const J=Math.max(0,1-(performance.now()-E)/170);U(Q,J,!0),J>0&&(se=requestAnimationFrame(M))};se=requestAnimationFrame(M)}const Ro=de(()=>`translate(50 50) scale(${l(A)}) translate(-50 -50)`);function xr(E,M){return getComputedStyle(document.documentElement).getPropertyValue(E).trim()||M}function vi(){const E=document.documentElement.dataset.theme!=="light";return{background:xr("--color-bg-0",E?"#050607":"#ffffff"),edge:xr("--color-line-3",E?"#3a424d":"#c9cbd1"),focusEdge:qe,focusNodeStroke:Ue,selectedNodeStroke:E?"#0a0a0b":"#18181b",nodeStroke:E?"#ffffff":"#27272a",warn:xr("--color-warn",E?"#fbbf24":"#b45309")}}function yi(){var E;return{focusId:l(De),focus:{nodes:l(zt),edges:l(Zr)},selectedNodeId:((E=l(f))==null?void 0:E.id)??null,pulse:l(Q),colors:vi()}}function bi(){return Vd({nodes:l(H),edges:l(pe),layout:l(Pt),sizeScales:l(a),orphanIds:l(o),dark:document.documentElement.dataset.theme!=="light",edgeColor:vi().edge})}function No(E){return l(pe).find(M=>M.id===E)??null}function Uo(E){E.on("clickNode",({node:J})=>{const Le=gt(J);Le&&nt(Le)}),E.on("enterNode",({node:J})=>{l(T)||U(b,J,!0),l(Pe)&&(l(Pe).style.cursor="pointer")}),E.on("leaveNode",()=>{l(T)||U(b,null),l(Pe)&&(l(Pe).style.cursor="")}),E.on("clickEdge",({edge:J})=>{const Le=No(J);Le&&($(),kt(Le))}),E.on("clickStage",()=>{$(),K()});const M=E.getCamera();M.on("updated",()=>{U(ge,M.ratio,!0)})}Ft(()=>{if(l(u)!=="canvas")return;const E=l(Pe);if(!E)return;let M=!1,J=null;return(async()=>{try{if(!Xe){const[yt,it]=await Promise.all([fn(()=>import("./ALqaDrNQ.js"),__vite__mapDeps([0,1]),import.meta.url),fn(()=>import("./DXY_Rxa7.js"),__vite__mapDeps([2,1]),import.meta.url)]);Xe={Sigma:yt.default,NodeBorderProgram:it.NodeBorderProgram}}if(M||!l(Pe))return;const{Sigma:Le,NodeBorderProgram:lt}=Xe;J=new Le(bi(),E,{allowInvalidContainer:!0,defaultNodeType:"border",nodeProgramClasses:{border:lt},defaultEdgeType:"line",renderEdgeLabels:!0,labelFont:'"JetBrains Mono Variable", monospace',edgeLabelFont:'"JetBrains Mono Variable", monospace',labelSize:12,edgeLabelSize:10,labelWeight:"700",labelColor:{color:xr("--color-fg-0","#ffffff")},edgeLabelColor:{color:"#f6d36b"},labelRenderedSizeThreshold:1/0,zIndex:!0,nodeReducer:(yt,it)=>Zd(yt,it,yi()),edgeReducer:(yt,it)=>Qd(yt,it,yi())}),Uo(J),Fe=J,U(ge,J.getCamera().ratio,!0),U(g,null)}catch(Le){U(g,Le.message,!0)}})(),()=>{M=!0,J&&J.kill(),Fe===J&&(Fe=null)}}),Ft(()=>{l(H),l(pe),l(Pt),l(a),l(o),l(et);const E=Fe;!E||l(u)!=="canvas"||(E.setSetting("labelColor",{color:xr("--color-fg-0","#ffffff")}),E.setGraph(bi()),E.refresh())}),Ft(()=>{l(De),l(zt),l(Zr),l(f),l(Q);const E=Fe;!E||l(u)!=="canvas"||E.refresh({skipIndexation:!0})});function Po(E){l(T)||U(b,E.id,!0)}function zo(E){!l(T)&&l(b)===E.id&&U(b,null)}function mn(E){return l(De)?l(De)===E.id?E.r*2.24:l(zt).has(E.id)?E.r*1.6:E.r*.92:E.r*1.14}function Wo(E){return l(De)?l(zt).has(E.id)?1:.12:1}function jo(E){return l(De)?l(De)===E.id?!0:l(zt).size<=36&&l(zt).has(E.id):!1}function Mo(E){return!!(l(De)&&l(Zr).has(E.id)&&E.label)}var wn=Kf(),Bo=G(wn);{var Fo=E=>{var M=ef();j(E,M)},Ko=E=>{var M=Ff(),J=Ie(M),Le=G(J),lt=G(Le),yt=G(lt);os(yt,{class:"size-3"}),Wt(),L(lt);var it=R(lt,2),Ho=G(it);os(Ho,{class:"size-3"}),Wt(),L(it);var nr=R(it,2),qo=G(nr);rl(qo,{class:"size-3"}),Wt(),L(nr),L(Le);var mi=R(Le,2);{var Vo=Y=>{var V=rf(),ee=Ie(V),be=G(ee);tl(be,{class:"size-3 text-fg-3"});var me=R(be,2);un(me);var Ke=R(me,2);{var oe=$e=>{var ce=tf(),Ge=G(ce);us(Ge,{class:"size-3"}),L(ce),ke("click",ce,()=>U(d,"")),j($e,ce)};_e(Ke,$e=>{l(d)&&$e(oe)})}L(ee);var z=R(ee,2),ve=G(z);Xc(ve,{class:"size-3"});var ae=R(ve,4),le=G(ae);le.value=le.__value=500;var He=R(le);He.value=He.__value=1e3;var ue=R(He);ue.value=ue.__value=2e3;var Ee=R(ue);Ee.value=Ee.__value=5e3;var ze=R(Ee);ze.value=ze.__value=1e4;var Oe=R(ze);Oe.value=Oe.__value=25e3;var Ce=R(Oe);Ce.value=Ce.__value=5e4,L(ae);var Re;si(ae),L(z),fe(()=>{Re!==(Re=l(c))&&(ae.value=(ae.__value=l(c))??"",Ur(ae,l(c)))}),Qr(me,()=>l(d),$e=>U(d,$e)),ke("change",ae,$e=>U(c,Number($e.currentTarget.value),!0)),j(Y,V)};_e(mi,Y=>{l(u)!=="table"&&Y(Vo)})}var wi=R(mi,2);{var Yo=Y=>{var V=nf(),ee=G(V),be=G(ee);il(be,{class:"size-3.5"}),L(ee);var me=R(ee,2),Ke=G(me);L(me);var oe=R(me,2),z=G(oe);nl(z,{class:"size-3.5"}),L(oe),L(V),fe(()=>{ee.disabled=l(u)==="svg"&&l(A)<=.5,re(Ke,`${l(tr)??""}%`),oe.disabled=l(u)==="svg"&&l(A)>=8}),ke("click",ee,()=>Ut("out")),ke("click",me,rr),ke("click",oe,()=>Ut("in")),j(Y,V)};_e(wi,Y=>{l(u)!=="table"&&Y(Yo)})}var ir=R(wi,2),Jo=G(ir);Vc(Jo,{class:"size-3"}),Wt(),L(ir);var _i=R(ir,2);{var Xo=Y=>{var V=sf(),ee=G(V);Qc(ee,{class:"size-3"}),Wt(),L(V),ke("click",V,I),j(Y,V)};_e(_i,Y=>{l(t)&&Y(Xo)})}var Ei=R(_i,2),_n=G(Ei),Zo=G(_n);L(_n);var xi=R(_n,2);{var Qo=Y=>{var V=of(),ee=G(V);L(V),fe((be,me)=>re(ee,`rendering ${be??""} / ${me??""}`),[()=>l(H).length.toLocaleString(),()=>l(F).toLocaleString()]),j(Y,V)};_e(xi,Y=>{l(u)!=="table"&&l(Ae)&&Y(Qo)})}var ki=R(xi,2);{var ea=Y=>{var V=af(),ee=G(V);L(V),fe(be=>re(ee,`drawing ${be??""}`),[()=>l(H).length.toLocaleString()]),j(Y,V)};_e(ki,Y=>{l(u)!=="table"&&l(W)&&Y(ea)})}var ta=R(ki,2);{var ra=Y=>{var V=uf(),ee=G(V,!0);L(V),fe(()=>re(ee,e.collection)),j(Y,V)};_e(ta,Y=>{e.collection&&Y(ra)})}L(Ei),L(J);var Si=R(J,2);{var na=Y=>{var V=lf(),ee=G(V),be=R(G(ee),2),me=R(be,2),Ke=R(me,2),oe=G(Ke);el(oe,{class:"size-3"}),Wt(),L(Ke),L(ee);var z=R(ee,2),ve=G(z);un(ve);var ae=R(ve,2);un(ae);var le=R(ae,2),He=R(le,2);L(z);var ue=R(z,2),Ee=G(ue);pu(Ee);var ze=R(Ee,2),Oe=G(ze),Ce=G(Oe);{var Re=ye=>{Jc(ye,{class:"size-3 animate-spin"})},$e=ye=>{Zc(ye,{class:"size-3"})};_e(Ce,ye=>{l(S)?ye(Re):ye($e,-1)})}Wt(2),L(Oe),L(ze),L(ue);var ce=R(ue,2);{var Ge=ye=>{var Ye=cf(),St=G(Ye,!0);L(Ye),fe(()=>re(St,l(w))),j(ye,Ye)};_e(ce,ye=>{l(w)&&ye(Ge)})}L(V),fe((ye,Ye)=>{be.disabled=!l(f),Z(be,"title",l(f)?`neighborhood of ${l(f).label}`:"select a node first"),Ke.disabled=ye,le.disabled=!l(f),Z(le,"title",l(f)?`Use ${l(f).label} as source`:"select a node first"),He.disabled=!l(f),Z(He,"title",l(f)?`Use ${l(f).label} as target`:"select a node first"),Z(Ee,"placeholder",e.collection?`GRAPH NEIGHBORHOOD '<label>' DEPTH 2
309
- GRAPH SHORTEST_PATH '<from>' TO '<to>'
310
- MATCH (n)-[r]->(m) RETURN n, r, m LIMIT 100`:"GRAPH NEIGHBORHOOD … / GRAPH SHORTEST_PATH … / MATCH …"),Oe.disabled=Ye},[()=>!l(x).trim()||!l(D).trim(),()=>l(S)||!l(p).trim()]),ke("click",be,te),ke("click",me,N),ke("click",Ke,Me),Qr(ve,()=>l(x),ye=>U(x,ye)),Qr(ae,()=>l(D),ye=>U(D,ye)),ke("click",le,()=>v("from")),ke("click",He,()=>v("to")),ke("keydown",Ee,ye=>{ye.key==="Enter"&&(ye.metaKey||ye.ctrlKey)&&(ye.preventDefault(),C(l(p)))}),Qr(Ee,()=>l(p),ye=>U(p,ye)),ke("click",Oe,()=>C(l(p))),j(Y,V)};_e(Si,Y=>{l(_)&&Y(na)})}var Ai=R(Si,2);{var ia=Y=>{var V=df(),ee=G(V);as(ee,{class:"mt-0.5 size-3.5 shrink-0"});var be=R(ee,2),me=R(G(be),2),Ke=G(me,!0);L(me),L(be),L(V),fe(()=>re(Ke,l(g))),j(Y,V)};_e(Ai,Y=>{l(g)&&Y(ia)})}var En=R(Ai,2),$i=G(En);{var sa=Y=>{var V=ff();_u(V,ee=>U(Pe,ee),()=>l(Pe)),fe(()=>Z(V,"aria-label",`${l(H).length} graph nodes and ${l(pe).length} graph edges`)),ke("keydown",V,ee=>{ee.key==="Escape"&&($(),K())}),j(Y,V)},oa=Y=>{var V=bf(),ee=G(V),be=R(G(ee)),me=G(be);mt(me,21,()=>l(bn),oe=>oe.id,(oe,z)=>{const ve=de(()=>l(Zr).has(l(z).id));var ae=pf(),le=Ie(ae),He=G(le),ue=G(He);L(He),L(le);var Ee=R(le);{var ze=Ce=>{var Re=hf(),$e=G(Re,!0);L(Re),fe(ce=>{Z(Re,"x",(l(z).x1+l(z).x2)/2+.45),Z(Re,"y",(l(z).y1+l(z).y2)/2-.45),re($e,ce)},[()=>{var ce;return(ce=l(z).label)==null?void 0:ce.slice(0,28)}]),j(Ce,Re)},Oe=de(()=>Mo(l(z)));_e(Ee,Ce=>{l(Oe)&&Ce(ze)})}fe(()=>{Z(le,"x1",l(z).x1),Z(le,"y1",l(z).y1),Z(le,"x2",l(z).x2),Z(le,"y2",l(z).y2),Z(le,"stroke",l(De)&&l(ve)?qe:"currentColor"),Z(le,"stroke-width",l(De)?l(ve)?"0.27":"0.055":"0.105"),Z(le,"opacity",l(De)?l(ve)?"0.98":"0.055":"0.36"),Z(le,"aria-label",`${l(z).label??"edge"} from ${l(z).source} to ${l(z).target}`),re(ue,`${l(z).label??"edge"??""}: ${l(z).source??""} -> ${l(z).target??""}`)}),ke("click",le,Ce=>{Ce.stopPropagation(),$(),kt(l(z))}),ke("keydown",le,Ce=>Ht(Ce,()=>{$(),kt(l(z))})),j(oe,ae)}),L(me);var Ke=R(me);mt(Ke,21,()=>l(gi),oe=>oe.id,(oe,z)=>{const ve=de(()=>l(o).has(l(z).id));var ae=yf(),le=Ie(ae);{var He=ce=>{var Ge=gf();fe((ye,Ye)=>{Z(Ge,"cx",l(z).x),Z(Ge,"cy",l(z).y),Z(Ge,"r",ye),Z(Ge,"stroke-width",l(De)===l(z).id?"0.38":"0.24"),Z(Ge,"opacity",Ye)},[()=>mn(l(z))+.65,()=>l(De)&&!l(zt).has(l(z).id)?"0.16":"0.72"]),j(ce,Ge)};_e(le,ce=>{l(ve)&&ce(He)})}var ue=R(le);let Ee;var ze=G(ue),Oe=G(ze,!0);L(ze),L(ue);var Ce=R(ue);{var Re=ce=>{var Ge=vf(),ye=G(Ge,!0);L(Ge),fe((Ye,St)=>{Z(Ge,"x",Ye),Z(Ge,"y",l(z).y+.15),Z(Ge,"fill",l(De)===l(z).id?"#f8fafc":"#cbd5e1"),Z(Ge,"opacity",l(De)===l(z).id?"1":"0.9"),Z(Ge,"font-size",l(De)===l(z).id?"1.35":"1.15"),Z(Ge,"font-weight",l(De)===l(z).id?"700":"600"),Z(Ge,"stroke-width",l(De)===l(z).id?"0.48":"0.38"),re(ye,St)},[()=>l(z).x+mn(l(z))+.85,()=>l(z).label.slice(0,36)]),j(ce,Ge)},$e=de(()=>jo(l(z)));_e(Ce,ce=>{l($e)&&ce(Re)})}fe((ce,Ge,ye)=>{var Ye;Z(ue,"cx",l(z).x),Z(ue,"cy",l(z).y),Z(ue,"r",ce),Z(ue,"fill",l(z).color),Z(ue,"opacity",Ge),Z(ue,"stroke",l(De)===l(z).id?Ue:((Ye=l(f))==null?void 0:Ye.id)===l(z).id?"#0a0a0b":l(ve)?"var(--color-warn)":"#ffffff"),Z(ue,"stroke-width",ye),Ee=Mt(ue,0,"cursor-pointer graph-node svelte-gt9p7f",null,Ee,{"focus-primary":l(De)===l(z).id}),Z(ue,"aria-label",l(z).label),re(Oe,l(z).label)},[()=>mn(l(z)),()=>Wo(l(z)),()=>{var ce;return l(De)===l(z).id?"0.55":l(zt).has(l(z).id)?"0.22":((ce=l(f))==null?void 0:ce.id)===l(z).id||l(ve)?"0.4":"0.14"}]),Dn("pointerenter",ue,()=>Po(l(z))),Dn("pointerleave",ue,()=>zo(l(z))),ke("click",ue,ce=>{ce.stopPropagation(),nt(l(z))}),ke("keydown",ue,ce=>Ht(ce,()=>nt(l(z)))),j(oe,ae)}),L(Ke),L(be),L(ee),L(V),fe(()=>{Z(ee,"aria-label",`${l(H).length} graph nodes and ${l(pe).length} graph edges`),Z(be,"transform",l(Ro))}),Dn("wheel",ee,Ct),ke("click",ee,()=>{$(),K()}),ke("keydown",ee,oe=>{oe.key==="Escape"&&($(),K())}),j(Y,V)},aa=Y=>{var V=Ef(),ee=G(V),be=R(G(ee)),me=G(be);mt(me,17,()=>l(i).nodes,oe=>oe.id,(oe,z)=>{const ve=de(()=>l(o).has(l(z).id));var ae=wf(),le=R(G(ae)),He=G(le,!0);L(le);var ue=R(le),Ee=G(ue,!0);L(ue);var ze=R(ue),Oe=G(ze),Ce=R(Oe);{var Re=$e=>{var ce=mf();j($e,ce)};_e(Ce,$e=>{l(ve)&&$e(Re)})}L(ze),L(ae),fe(($e,ce)=>{Mt(ae,1,$e,"svelte-gt9p7f"),re(He,l(z).id),re(Ee,l(z).label),re(Oe,`${ce??""} `)},[()=>Xt(["border-b border-line-1/60 hover:bg-bg-1/40 cursor-pointer",l(ve)?"bg-warn/10":""].join(" ")),()=>String(l(z).data.node_type??"")]),ke("click",ae,()=>{U(h,null),U(f,l(z),!0)}),j(oe,ae)});var Ke=R(me);mt(Ke,17,()=>l(i).edges,oe=>oe.id,(oe,z)=>{var ve=_f(),ae=R(G(ve)),le=G(ae,!0);L(ae);var He=R(ae),ue=G(He,!0);L(He);var Ee=R(He),ze=G(Ee);L(Ee),L(ve),fe(()=>{re(le,l(z).id),re(ue,l(z).label??""),re(ze,`${l(z).source??""} → ${l(z).target??""}`)}),ke("click",ve,()=>{U(f,null),U(h,l(z),!0)}),j(oe,ve)}),L(be),L(ee),L(V),j(Y,V)};_e($i,Y=>{l(u)==="canvas"?Y(sa):l(u)==="svg"?Y(oa,1):Y(aa,-1)})}var ua=R($i,2);{var ca=Y=>{var V=Wf(),ee=G(V),be=G(ee);Yc(be,{class:"size-3.5 text-accent"});var me=R(be,2),Ke=G(me,!0);L(me);var oe=R(me,4),z=G(oe);us(z,{class:"size-3.5"}),L(oe),L(ee);var ve=R(ee,2),ae=G(ve);{var le=Ee=>{var ze=Of(),Oe=Ie(ze),Ce=G(Oe),Re=G(Ce),$e=R(G(Re),2),ce=G($e,!0);L($e),L(Re);var Ge=R(Re,2);{var ye=xe=>{var We=xf(),vt=G(We);as(vt,{class:"size-3"}),Wt(),L(We),j(xe,We)};_e(Ge,xe=>{l(y).orphan&&xe(ye)})}L(Ce);var Ye=R(Ce,2),St=G(Ye,!0);L(Ye),L(Oe);var At=R(Oe,2),sr=R(G(At),2),or=G(sr,!0);L(sr),L(At);var Yt=R(At,2),Jt=G(Yt),Qe=R(G(Jt),2),Ve=G(Qe,!0);L(Qe),L(Jt);var st=R(Jt,2);{var kr=xe=>{var We=Sf();mt(We,21,()=>l(y).exports,an,(vt,dt)=>{var ot=kf(),ft=G(ot,!0);L(ot),fe(()=>re(ft,l(dt))),j(vt,ot)}),L(We),j(xe,We)},xn=xe=>{var We=Af();j(xe,We)};_e(st,xe=>{l(y).exports.length>0?xe(kr):xe(xn,-1)})}L(Yt);var kn=R(Yt,2),Sn=G(kn),Ci=R(G(Sn),2),ha=G(Ci);L(Ci),L(Sn);var pa=R(Sn,2);{var ga=xe=>{var We=Df();mt(We,21,()=>l(y).whereUsed,vt=>vt.id,(vt,dt)=>{var ot=$f(),ft=G(ot),Gt=G(ft,!0);L(ft);var ar=R(ft,2),It=G(ar),Sr=G(It,!0);L(It);var Oi=R(It,2),xa=G(Oi,!0);L(Oi),L(ar),L(ot),fe(()=>{re(Gt,l(dt).label),re(Sr,l(dt).nodeLabel),re(xa,l(dt).edgeLabel??l(dt).kind)}),ke("click",ot,()=>Et(l(dt))),j(vt,ot)}),L(We),j(xe,We)},va=xe=>{var We=Lf();j(xe,We)};_e(pa,xe=>{l(y).whereUsed.length>0?xe(ga):xe(va,-1)})}L(kn);var Gi=R(kn,2),Ii=R(G(Gi),2),An=G(Ii),ya=G(An);{var ba=xe=>{var We=Je(),vt=Ie(We);mt(vt,17,()=>l(y).incoming,dt=>dt.id,(dt,ot)=>{var ft=Cf(),Gt=G(ft),ar=G(Gt,!0);L(Gt);var It=R(Gt,2),Sr=G(It,!0);L(It),L(ft),fe(()=>{re(ar,l(ot).label),re(Sr,l(ot).nodeLabel)}),ke("click",ft,()=>Et(l(ot))),j(dt,ft)}),j(xe,We)},ma=xe=>{var We=Gf();j(xe,We)};_e(ya,xe=>{l(y).incoming.length>0?xe(ba):xe(ma,-1)})}L(An);var Ti=R(An,2),wa=G(Ti);{var _a=xe=>{var We=Je(),vt=Ie(We);mt(vt,17,()=>l(y).outgoing,dt=>dt.id,(dt,ot)=>{var ft=If(),Gt=G(ft),ar=G(Gt,!0);L(Gt);var It=R(Gt,2),Sr=G(It,!0);L(It),L(ft),fe(()=>{re(ar,l(ot).label),re(Sr,l(ot).nodeLabel)}),ke("click",ft,()=>Et(l(ot))),j(dt,ft)}),j(xe,We)},Ea=xe=>{var We=Tf();j(xe,We)};_e(wa,xe=>{l(y).outgoing.length>0?xe(_a):xe(Ea,-1)})}L(Ti),L(Ii),L(Gi),fe((xe,We,vt)=>{re(ce,l(f).label),re(St,xe),re(or,l(y).description??"No description in graph contract."),re(Ve,We),re(ha,`${vt??""} inbound`)},[()=>String(l(f).data.rid??l(f).id),()=>l(y).exports.length.toLocaleString(),()=>l(y).whereUsed.length.toLocaleString()]),j(Ee,ze)},He=Ee=>{var ze=Uf(),Oe=Ie(ze),Ce=R(G(Oe),2),Re=G(Ce,!0);L(Ce),L(Oe);var $e=R(Oe,2),ce=R(G($e),2),Ge=G(ce);{var ye=Qe=>{var Ve=Ln();fe(st=>re(Ve,st),[()=>gt(l(h).source).label]),j(Qe,Ve)},Ye=de(()=>gt(l(h).source)),St=Qe=>{var Ve=Rf(),st=G(Ve,!0);L(Ve),fe(()=>re(st,l(h).source)),j(Qe,Ve)};_e(Ge,Qe=>{l(Ye)?Qe(ye):Qe(St,-1)})}L(ce);var At=R(ce,4),sr=G(At);{var or=Qe=>{var Ve=Ln();fe(st=>re(Ve,st),[()=>gt(l(h).target).label]),j(Qe,Ve)},Yt=de(()=>gt(l(h).target)),Jt=Qe=>{var Ve=Nf(),st=G(Ve,!0);L(Ve),fe(()=>re(st,l(h).target)),j(Qe,Ve)};_e(sr,Qe=>{l(Yt)?Qe(or):Qe(Jt,-1)})}L(At),L($e),fe(()=>re(Re,l(h).label??"(unlabelled)")),j(Ee,ze)};_e(ae,Ee=>{l(f)&&l(y)?Ee(le):l(h)&&Ee(He,1)})}var ue=R(ae,4);mt(ue,21,()=>{var Ee;return Object.entries((l(f)?l(f).data:(Ee=l(h))==null?void 0:Ee.data)??{})},an,(Ee,ze)=>{var Oe=de(()=>on(l(ze),2));let Ce=()=>l(Oe)[0],Re=()=>l(Oe)[1];var $e=Je(),ce=Ie($e);{var Ge=Ye=>{var St=zf(),At=Ie(St),sr=G(At,!0);L(At);var or=R(At,2),Yt=G(or);{var Jt=Ve=>{var st=Pf(),kr=G(st,!0);L(st),fe(xn=>re(kr,xn),[()=>JSON.stringify(Re(),null,2)]),j(Ve,st)},Qe=Ve=>{var st=Ln();fe(kr=>re(st,kr),[()=>String(Re())]),j(Ve,st)};_e(Yt,Ve=>{typeof Re()=="object"?Ve(Jt):Ve(Qe,-1)})}L(or),fe(()=>re(sr,Ce())),j(Ye,St)},ye=de(()=>Re()!==null&&Re()!==void 0&&!(l(f)&&Er(Ce()))&&!(l(h)&&Ce()==="label"));_e(ce,Ye=>{l(ye)&&Ye(Ge)})}j(Ee,$e)}),L(ue),L(ve),L(V),fe(()=>re(Ke,l(f)?"Node":"Edge")),ke("click",oe,()=>{$(),K()}),j(Y,V)};_e(ua,Y=>{(l(f)||l(h))&&Y(ca)})}L(En);var Di=R(En,2),Li=G(Di);{var la=Y=>{var V=Mf(),ee=R(Ie(V),2);mt(ee,17,()=>l(Be),([be,me])=>be,(be,me)=>{var Ke=de(()=>on(l(me),2));let oe=()=>l(Ke)[0],z=()=>l(Ke)[1];const ve=de(()=>l(O).has(oe()));var ae=jf(),le=G(ae);let He;var ue=R(le,2),Ee=G(ue,!0);L(ue);var ze=R(ue,2),Oe=G(ze,!0);L(ze),L(ae),fe((Ce,Re,$e)=>{Z(ae,"title",l(ve)?`Show ${oe()}`:`Hide ${oe()}`),Mt(ae,1,Ce,"svelte-gt9p7f"),He=Js(le,"",He,Re),re(Ee,oe()),re(Oe,$e)},[()=>Xt(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded border transition-colors cursor-pointer",l(ve)?"border-line-1 text-fg-3 line-through opacity-60":"border-line-2 text-fg-1 hover:border-accent"].join(" ")),()=>({color:l(ve)?void 0:hn(oe())}),()=>z().toLocaleString()]),ke("click",ae,()=>Ne(oe())),j(be,ae)}),j(Y,V)};_e(Li,Y=>{l(Be).length>1&&Y(la)})}var da=R(Li,4);{var fa=Y=>{var V=Je(),ee=Ie(V);mt(ee,17,()=>l(Vt),an,(be,me)=>{var Ke=de(()=>on(l(me),2));let oe=()=>l(Ke)[0],z=()=>l(Ke)[1];var ve=Bf(),ae=G(ve),le=G(ae,!0);L(ae);var He=R(ae,3);L(ve),fe(ue=>{re(le,oe()),re(He,` ${ue??""}`)},[()=>z().toLocaleString()]),j(be,ve)}),j(Y,V)};_e(da,Y=>{l(Vt).length>0&&Y(fa)})}L(Di),fe((Y,V,ee,be,me,Ke,oe,z,ve)=>{Z(lt,"href",Y),Mt(lt,1,V,"svelte-gt9p7f"),Z(lt,"aria-current",l(u)==="canvas"?"page":void 0),Z(it,"href",ee),Mt(it,1,be,"svelte-gt9p7f"),Z(it,"aria-current",l(u)==="svg"?"page":void 0),Z(nr,"href",me),Mt(nr,1,Ke,"svelte-gt9p7f"),Z(nr,"aria-current",l(u)==="table"?"page":void 0),Mt(ir,1,oe,"svelte-gt9p7f"),Z(ir,"aria-pressed",l(_)),re(Zo,`${z??""} nodes · ${ve??""} edges`)},[()=>e.collection?Pn(e.collection,"graph"):void 0,()=>Xt(["inline-flex items-center gap-1 px-2 py-1 text-[11px] cursor-pointer transition-colors",l(u)==="canvas"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>e.collection?Pn(e.collection,"svg"):void 0,()=>Xt(["inline-flex items-center gap-1 px-2 py-1 text-[11px] cursor-pointer transition-colors border-l border-line-2",l(u)==="svg"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>e.collection?Pn(e.collection,"table"):void 0,()=>Xt(["inline-flex items-center gap-1 px-2 py-1 text-[11px] cursor-pointer transition-colors border-l border-line-2",l(u)==="table"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Xt(["inline-flex items-center gap-1 h-6 px-2 rounded border cursor-pointer transition-colors",l(_)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>l(i).nodes.length.toLocaleString(),()=>l(i).edges.length.toLocaleString()]),ke("click",lt,()=>{e.collection||U(u,"canvas")}),ke("click",it,()=>{e.collection||U(u,"svg")}),ke("click",nr,()=>{e.collection||U(u,"table")}),ke("click",ir,()=>U(_,!l(_))),j(E,M)};_e(Bo,E=>{l(i).nodes.length===0&&l(i).edges.length===0?E(Fo):E(Ko,-1)})}L(wn),j(n,wn),Hs()}qs(["click","change","keydown"]);var Hf=ie('<p class="text-fg-2 text-[13px] m-0 max-w-md leading-relaxed"> </p>'),qf=ie('<code class="font-mono text-[11px] text-fg-3 mt-3 px-2 py-1 bg-bg-2 border border-line-1 rounded"> </code>'),Vf=ie('<div class="flex items-center gap-2 mt-5"><!></div>'),Yf=ie('<div class="flex flex-col items-center justify-center text-center py-16 px-6 min-h-[280px] bg-bg-1 border border-line-1 border-dashed rounded-lg"><!> <h2 class="type-h2 m-0 mb-2"> </h2> <!> <!> <!></div>');function hh(n,e){var t=Yf(),r=G(t);{var i=g=>{var k=Je(),A=Ie(k);Eu(A,()=>e.icon,(y,b)=>{b(y,{class:"size-9 text-fg-3 mb-4",strokeWidth:1.4})}),j(g,k)};_e(r,g=>{e.icon&&g(i)})}var s=R(r,2),a=G(s,!0);L(s);var o=R(s,2);{var u=g=>{var k=Hf(),A=G(k,!0);L(k),fe(()=>re(A,e.message)),j(g,k)};_e(o,g=>{e.message&&g(u)})}var c=R(o,2);{var d=g=>{var k=qf(),A=G(k,!0);L(k),fe(()=>re(A,e.hint)),j(g,k)};_e(c,g=>{e.hint&&g(d)})}var f=R(c,2);{var h=g=>{var k=Vf(),A=G(k);Au(A,()=>e.actions),L(k),j(g,k)};_e(f,g=>{e.actions&&g(h)})}L(t),fe(()=>re(a,e.title)),j(n,t)}export{fi as A,oh as B,$r as C,Pr as D,hh as E,Ur as F,fh as G,ah as H,pt as I,Z as J,ih as K,uh as L,Mt as M,os as N,Js as O,uo as P,nh as Q,Ku as R,Dr as S,rl as T,ct as U,Au as V,lh as W,us as X,Yc as a,Jc as b,Zc as c,Qc as d,tl as e,as as f,Bt as g,Ki as h,sh as i,rh as j,Qr as k,Xt as l,Lu as m,Pn as n,Go as o,Kc as p,ch as q,mt as r,ol as s,fo as t,dh as u,an as v,zu as w,si as x,ss as y,un as z};