@reddb-io/ui 0.3.6 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/_app/immutable/chunks/BOm0dWBE.js +1 -0
- package/build/_app/immutable/chunks/{Cznn1SM_.js → BjiIDQc5.js} +1 -1
- package/build/_app/immutable/chunks/{CgeUbXx3.js → CraBVUa8.js} +1 -1
- package/build/_app/immutable/chunks/Dc8lKBnh.js +35 -0
- package/build/_app/immutable/chunks/{bWMB_8ZZ.js → kV8hsQzl.js} +1 -1
- package/build/_app/immutable/chunks/{DXJnbMgi.js → tI1T3IGL.js} +5 -5
- package/build/_app/immutable/entry/{app.CnZytEwL.js → app.CqnCbx3-.js} +2 -2
- package/build/_app/immutable/entry/start.BHO_MY7Q.js +1 -0
- package/build/_app/immutable/nodes/{0.IUeUbFYR.js → 0.B0qC983k.js} +1 -1
- package/build/_app/immutable/nodes/{1.ppCNgQoG.js → 1.BALgKrlb.js} +1 -1
- package/build/_app/immutable/nodes/{10.PFTL9me3.js → 10.Dg8SyeBS.js} +1 -1
- package/build/_app/immutable/nodes/{15.CveXa_3e.js → 15.UGiFEthu.js} +1 -1
- package/build/_app/version.json +1 -1
- package/build/index.html +11 -10
- package/dist/embed/{AnalyticsView-Bwa627Xe.js → AnalyticsView-g7iZKS88.js} +4 -4
- package/dist/embed/{AnalyticsView-Bwa627Xe.js.map → AnalyticsView-g7iZKS88.js.map} +1 -1
- package/dist/embed/{RedUiEmbedRoot-DWA6FS7Q.js → RedUiEmbedRoot-B0chjnkm.js} +7385 -7284
- package/dist/embed/RedUiEmbedRoot-B0chjnkm.js.map +1 -0
- package/dist/embed/{index-client-CXG6tBhB.js → index-client-DqhuzUPo.js} +2 -2
- package/dist/embed/{index-client-CXG6tBhB.js.map → index-client-DqhuzUPo.js.map} +1 -1
- package/dist/embed/{index-W_9pCMZk.js → index-dKxVhrdf.js} +161 -156
- package/dist/embed/{index-W_9pCMZk.js.map → index-dKxVhrdf.js.map} +1 -1
- package/dist/embed/index.js +1 -1
- package/dist/embed/{sigma.esm-BtRwWMN5.js → sigma.esm-BFfaH_Ia.js} +2 -2
- package/dist/embed/{sigma.esm-BtRwWMN5.js.map → sigma.esm-BFfaH_Ia.js.map} +1 -1
- package/package.json +3 -3
- package/src/lib/ConnectDropdown.svelte +4 -4
- package/src/lib/Workspace.svelte +2 -2
- package/src/lib/connections.svelte.ts +72 -38
- package/src/lib/reddb/boot-params.ts +30 -27
- package/src/lib/reddb/client.ts +20 -14
- package/src/lib/reddb/connection-bootstrap.ts +62 -19
- package/src/lib/reddb/connection-string.ts +108 -0
- package/src/lib/reddb/index.ts +2 -0
- package/build/_app/immutable/chunks/1hmJRUuc.js +0 -35
- package/build/_app/immutable/chunks/B1QR04ZE.js +0 -1
- package/build/_app/immutable/entry/start.Br592ucD.js +0 -1
- package/dist/embed/RedUiEmbedRoot-DWA6FS7Q.js.map +0 -1
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./B5euRbKa.js","./DhEqZVGG.js","./C-kqMbRi.js","./bWMB_8ZZ.js","./DqvWKbSc.js","./CXNPJgv1.js","./CDKIdLnm.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var cu=Object.defineProperty;var is=r=>{throw TypeError(r)};var lu=(r,e,t)=>e in r?cu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Te=(r,e,t)=>lu(r,typeof e!="symbol"?e+"":e,t),os=(r,e,t)=>e.has(r)||is("Cannot "+t);var Se=(r,e,t)=>(os(r,e,"read from private field"),t?t.call(r):e.get(r)),nt=(r,e,t)=>e.has(r)?is("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t);var ss=(r,e,t)=>(os(r,e,"access private method"),t);import{_ as fr,p as Gt,r as Ze,s as it,c as uu,b as du}from"./CN4cKZHK.js";import"./Bzak7iHL.js";import{o as fu,a as hu}from"./Btd6PFkC.js";import{a2 as po,aF as St,aD as Qi,at as u,bb as pu,s as gu,bx as as,br as Rr,bs as tn,aE as yr,f as mu,p as vu,aK as cs,ac as yu,ab as Un,l as Vt,a3 as eo,ak as bu,bv as wu,ai as _u,aO as xu,a0 as go,k as ku,j as Eu,b0 as Su,by as ls,E as Cu,D as Au,bh as wa,b5 as _a,I as _i,d as $u,a7 as Du,a$ as Iu,aj as Lu,ay as xa,ba as Tu,az as Gu,i as ka,h as Ru,n as Ea,o as Ou,aa as Mu,x as zu,Y as Nu,bF as Pu,bz as ke,bm as P,b8 as Kt,bK as Qt,av as Uu,b9 as Zn,b6 as Qn,a6 as R,aq as lt,bw as N,b3 as Wu,bg as T,bN as Q,ap as ju,bI as rn,bO as Zt,bG as pe,b2 as Bt,be as Bu}from"./CGFL56WJ.js";import{b as Fu,o as Vu,u as $n,a as V,l as At,e as er,v as fe,k as he,h as Ku,i as Ne,j as xi,x as ki}from"./nuKvOE41.js";import{B as Sa,i as xe}from"./DCJ0QyYH.js";import{a as Vn,e as Dt,j as Et,g as H,r as Ei,i as Hu,s as qu,d as Dn,k as Yu}from"./BRBZjpE2.js";function Wn(r,e){return e}function Xu(r,e,t){for(var n=[],i=e.length,o,a=e.length,s=0;s<i;s++){let f=e[s];_a(f,()=>{if(o){if(o.pending.delete(f),o.done.add(f),o.pending.size===0){var h=r.outrogroups;to(r,go(o.done)),h.delete(o),h.size===0&&(r.outrogroups=null)}}else a-=1},!1)}if(a===0){var c=n.length===0&&t!==null;if(c){var l=t,d=l.parentNode;Du(d),d.append(l),r.items.clear()}to(r,e,!c)}else o={pending:new Set(e),done:new Set},(r.outrogroups??(r.outrogroups=new Set)).add(o)}function to(r,e,t=!0){var n;if(r.pending.size>0){n=new Set;for(const a of r.pending.values())for(const s of a)n.add(r.items.get(s).e)}for(var i=0;i<e.length;i++){var o=e[i];if(n!=null&&n.has(o)){o.f|=Vt;const a=document.createDocumentFragment();Iu(o,a)}else Lu(e[i],t)}}var us;function bt(r,e,t,n,i,o=null){var a=r,s=new Map,c=(e&ka)!==0;if(c){var l=r;a=St?Rr(xa(l)):l.appendChild(Un())}St&&Qi();var d=null,f=_u(()=>{var v=t();return xu(v)?v:v==null?[]:go(v)}),h,g=new Map,y=!0;function C(v){(A.effect.f&Au)===0&&(A.pending.delete(v),A.fallback=d,Ju(A,h,a,e,n),d!==null&&(h.length===0?(d.f&Vt)===0?wa(d):(d.f^=Vt,en(d,null,a)):_a(d,()=>{d=null})))}function b(v){A.pending.delete(v)}var m=po(()=>{h=u(f);var v=h.length;let p=!1;if(St){var E=pu(a)===gu;E!==(v===0)&&(a=as(),Rr(a),tn(!1),p=!0)}for(var S=new Set,$=yu,x=wu(),D=0;D<v;D+=1){St&&yr.nodeType===mu&&yr.data===vu&&(a=yr,p=!0,tn(!1));var I=h[D],j=n(I,D),O=y?null:s.get(j);O?(O.v&&cs(O.v,I),O.i&&cs(O.i,D),x&&$.unskip_effect(O.e)):(O=Zu(s,y?a:us??(us=Un()),I,j,D,i,e,t),y||(O.e.f|=Vt),s.set(j,O)),S.add(j)}if(v===0&&o&&!d&&(y?d=eo(()=>o(a)):(d=eo(()=>o(us??(us=Un()))),d.f|=Vt)),v>S.size&&bu(),St&&v>0&&Rr(as()),!y)if(g.set($,S),x){for(const[w,ge]of s)S.has(w)||$.skip_effect(ge.e);$.oncommit(C),$.ondiscard(b)}else C($);p&&tn(!0),u(f)}),A={effect:m,items:s,pending:g,outrogroups:null,fallback:d};y=!1,St&&(a=yr)}function Hr(r){for(;r!==null&&(r.f&$u)===0;)r=r.next;return r}function Ju(r,e,t,n,i){var I,j,O,w,ge,ce,L,_,K;var o=(n&Ru)!==0,a=e.length,s=r.items,c=Hr(r.effect.first),l,d=null,f,h=[],g=[],y,C,b,m;if(o)for(m=0;m<a;m+=1)y=e[m],C=i(y,m),b=s.get(C).e,(b.f&Vt)===0&&((j=(I=b.nodes)==null?void 0:I.a)==null||j.measure(),(f??(f=new Set)).add(b));for(m=0;m<a;m+=1){if(y=e[m],C=i(y,m),b=s.get(C).e,r.outrogroups!==null)for(const ee of r.outrogroups)ee.pending.delete(b),ee.done.delete(b);if((b.f&_i)!==0&&(wa(b),o&&((w=(O=b.nodes)==null?void 0:O.a)==null||w.unfix(),(f??(f=new Set)).delete(b))),(b.f&Vt)!==0)if(b.f^=Vt,b===c)en(b,null,t);else{var A=d?d.next:c;b===r.effect.last&&(r.effect.last=b.prev),b.prev&&(b.prev.next=b.next),b.next&&(b.next.prev=b.prev),ar(r,d,b),ar(r,b,A),en(b,A,t),d=b,h=[],g=[],c=Hr(d.next);continue}if(b!==c){if(l!==void 0&&l.has(b)){if(h.length<g.length){var v=g[0],p;d=v.prev;var E=h[0],S=h[h.length-1];for(p=0;p<h.length;p+=1)en(h[p],v,t);for(p=0;p<g.length;p+=1)l.delete(g[p]);ar(r,E.prev,S.next),ar(r,d,E),ar(r,S,v),c=v,d=S,m-=1,h=[],g=[]}else l.delete(b),en(b,c,t),ar(r,b.prev,b.next),ar(r,b,d===null?r.effect.first:d.next),ar(r,d,b),d=b;continue}for(h=[],g=[];c!==null&&c!==b;)(l??(l=new Set)).add(c),g.push(c),c=Hr(c.next);if(c===null)continue}(b.f&Vt)===0&&h.push(b),d=b,c=Hr(b.next)}if(r.outrogroups!==null){for(const ee of r.outrogroups)ee.pending.size===0&&(to(r,go(ee.done)),(ge=r.outrogroups)==null||ge.delete(ee));r.outrogroups.size===0&&(r.outrogroups=null)}if(c!==null||l!==void 0){var $=[];if(l!==void 0)for(b of l)(b.f&_i)===0&&$.push(b);for(;c!==null;)(c.f&_i)===0&&c!==r.fallback&&$.push(c),c=Hr(c.next);var x=$.length;if(x>0){var D=(n&ka)!==0&&a===0?t:null;if(o){for(m=0;m<x;m+=1)(L=(ce=$[m].nodes)==null?void 0:ce.a)==null||L.measure();for(m=0;m<x;m+=1)(K=(_=$[m].nodes)==null?void 0:_.a)==null||K.fix()}Xu(r,$,D)}}o&&Tu(()=>{var ee,z;if(f!==void 0)for(b of f)(z=(ee=b.nodes)==null?void 0:ee.a)==null||z.apply()})}function Zu(r,e,t,n,i,o,a,s){var c=(a&ku)!==0?(a&Eu)===0?Su(t,!1,!1):ls(t):null,l=(a&Cu)!==0?ls(i):null;return{v:c,i:l,e:eo(()=>(o(e,c??t,l??i,s),()=>{r.delete(n)}))}}function en(r,e,t){if(r.nodes)for(var n=r.nodes.start,i=r.nodes.end,o=e&&(e.f&Vt)===0?e.nodes.start:t;n!==null;){var a=Gu(n);if(o.before(n),n===i)return;n=a}}function ar(r,e,t){e===null?r.effect.first=t:e.next=t,t===null?r.effect.last=e:t.prev=e}function ro(r,e,...t){var n=new Sa(r);po(()=>{const i=e()??null;n.ensure(i,i&&(o=>i(o,...t)))},Ea)}function Qu(r,e,t,n,i,o){let a=St;St&&Qi();var s=null;St&&yr.nodeType===Ou&&(s=yr,Qi());var c=St?yr:r,l=new Sa(c,!1);po(()=>{const d=e()||null;var f=t||d==="svg"?zu:void 0;if(d===null){l.ensure(null,null),$n(!0);return}return l.ensure(d,h=>{if(d){if(s=St?s:Mu(d,f),Fu(s,s),n){St&&Vu(d)&&s.append(document.createComment(""));var g=St?xa(s):s.appendChild(Un());St&&(g===null?tn(!1):Rr(g)),n(s,g)}Nu.nodes.end=s,h.before(s)}St&&Rr(h)}),$n(!0),()=>{d&&$n(!1)}},Ea),Pu(()=>{$n(!0)}),a&&(tn(!0),Rr(c))}function qv(r){return`${(Math.max(0,r)/1e3).toFixed(1)}s`}var sn,an,cn,Jn,Ca;class ed{constructor(){nt(this,Jn);nt(this,sn,ke(null));nt(this,an,ke(null));nt(this,cn,ke(Kt([])));Te(this,"nextId",1)}get startedAt(){return u(Se(this,sn))}set startedAt(e){P(Se(this,sn),e,!0)}get label(){return u(Se(this,an))}set label(e){P(Se(this,an),e,!0)}get steps(){return u(Se(this,cn))}set steps(e){P(Se(this,cn),e,!0)}get active(){return this.startedAt!==null}get current(){return this.steps.length?this.steps[this.steps.length-1]:null}elapsedMs(e=Date.now()){return this.startedAt===null?0:Math.max(0,e-this.startedAt)}begin(e,t=Date.now()){Qt(()=>{this.startedAt=t,this.label=e,this.steps=[],this.nextId=1})}step(e,t,n=Date.now()){Qt(()=>{if(this.startedAt===null)return;const i=this.steps.map(o=>o.status==="active"?{...o,status:"done",durationMs:n-o.startedAt}:o);this.steps=[...i,{id:this.nextId++,label:e,...t?{detail:t}:{},startedAt:n,durationMs:null,status:"active"}]})}succeed(e=Date.now()){Qt(()=>{ss(this,Jn,Ca).call(this,e),this.startedAt=null})}fail(e,t=Date.now()){Qt(()=>{this.steps=this.steps.map(n=>n.status==="active"?{...n,status:"error",durationMs:t-n.startedAt,...e?{error:e}:{}}:n),this.startedAt=null})}}sn=new WeakMap,an=new WeakMap,cn=new WeakMap,Jn=new WeakSet,Ca=function(e){this.steps=this.steps.map(t=>t.status==="active"?{...t,status:"done",durationMs:e-t.startedAt}:t)};const qr=new ed,Or=Object.freeze({vcs:!1,clusterStatus:!1,collectionMetadata:!1,cdcStream:!1}),ds={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 td(r){var t;const e={...Or};for(const n of r.features??[]){const i=ds[((t=n==null?void 0:n.toLowerCase)==null?void 0:t.call(n))??""];i&&(e[i]=!0)}for(const[n,i]of Object.entries(r.capabilities??{})){const o=ds[n.toLowerCase()];o&&(e[o]=i===!0)}return e}const rd=/pass(word)?|secret|token|api[-_]?key|authorization|auth|credential|cookie|session|bearer|private[-_]?key|mfa/i,nd="«redacted»";function no(r,e=0){if(e>6)return"«…»";if(Array.isArray(r))return r.slice(0,100).map(t=>no(t,e+1));if(r&&typeof r=="object"){const t={};for(const[n,i]of Object.entries(r))t[n]=rd.test(n)?nd:no(i,e+1);return t}return r}function fs(r){if(r==null)return;let e=r;if(typeof r=="string"){if(r.length===0)return;try{e=JSON.parse(r)}catch{return r.length>2e3?`${r.slice(0,2e3)}…`:r}}try{const t=JSON.stringify(no(e),null,2);return t.length>4e3?`${t.slice(0,4e3)}…`:t}catch{return}}class id{constructor(e=500){Te(this,"entries",[]);Te(this,"listeners",new Set);Te(this,"sinks",new Set);Te(this,"nextId",1);this.capacity=e}record(e){const t={...e,id:this.nextId++};this.entries.push(t),this.entries.length>this.capacity&&this.entries.splice(0,this.entries.length-this.capacity),this.emit();for(const n of this.sinks)try{n(t)}catch{}return t}addSink(e){return this.sinks.add(e),()=>{this.sinks.delete(e)}}snapshot(){return this.entries.slice()}get size(){return this.entries.length}clear(){this.entries.length!==0&&(this.entries=[],this.emit())}subscribe(e){return this.listeners.add(e),e(this.snapshot()),()=>{this.listeners.delete(e)}}emit(){const e=this.snapshot();for(const t of this.listeners)t(e)}}const Dr=new id,hs=new Set,Si=new Map;function od(r){return(r instanceof Error?r.message:String(r)).includes("route not found: GET /collections/")}function sd(r){const e=r instanceof Error?r.message:String(r);return/ → 404\b/.test(e)||e.includes("route not found")}function ps(r){return new Error(`GET /collections/:name unsupported by this reddb server (${r})`)}function ad(r){if(!r||typeof r!="object")return!1;const e=r;return typeof e.kind=="string"&&e.kind.length>0&&typeof e.name=="string"&&e.name.length>0&&(e.tenant===void 0||typeof e.tenant=="string")}async function*cd(r){const e=r.getReader(),t=new TextDecoder;let n="";try{for(;;){const{done:o,value:a}=await e.read();if(o)break;n+=t.decode(a,{stream:!0});let s;for(;(s=n.indexOf(`
|
|
3
|
-
`))!==-1;){const c=n.slice(0,s).trim();n=n.slice(s+1),c&&(yield JSON.parse(c))}}const i=n.trim();i&&(yield JSON.parse(i))}finally{e.releaseLock()}}const ld=/^\s*select\b/i;function ud(r){var e;if(Array.isArray(r))return r.length;if(r&&typeof r=="object"){const t=r;if(typeof t.record_count=="number")return t.record_count;if(Array.isArray((e=t.result)==null?void 0:e.records))return t.result.records.length}}function Ci(r){if(r instanceof Error)return r.message||String(r);if(typeof r=="string")return r;if(r&&typeof r=="object"){const e=r.message;if(typeof e=="string"&&e)return e;try{const t=JSON.stringify(r);if(t&&t!=="{}")return t}catch{}}return String(r)}async function Yv(r,e,t={}){var i;const n=t.signal?{signal:t.signal}:void 0;if(!ld.test(e))return n?r.query(e,n):r.query(e);try{const o=await r.queryStreamCollect(e,t);return{ok:!0,query:e,record_count:o.rowCount,result:{columns:o.columns,records:o.rows.map(a=>a.values&&typeof a.values=="object"&&("nodes"in a||"edges"in a||"paths"in a||"vector_results"in a)?a:{values:a})},streamed:!0,truncated:o.truncated}}catch(o){if((i=t.signal)!=null&&i.aborted||o instanceof Error&&o.name==="AbortError")throw o;return n?r.query(e,n):r.query(e)}}class mo{constructor(e,t={}){Te(this,"baseUrl");Te(this,"headers");Te(this,"fetcher");this.baseUrl=e.replace(/\/$/,""),this.headers=t.headers,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis)}async json(e,t){const n=`${this.baseUrl}${e}`,i={"Content-Type":"application/json"};Object.assign(i,this.headers),Object.assign(i,t==null?void 0:t.headers);const o=(t==null?void 0:t.method)??"GET",a=Date.now(),s=performance.now(),c=fs(t==null?void 0:t.body),l=()=>Math.round(performance.now()-s);let d;try{d=await this.fetcher(n,{...t,headers:i})}catch(g){throw Dr.record({kind:"http",verb:o,target:e,startedAt:a,durationMs:l(),ok:!1,payload:c,error:Ci(g)}),g}if(!d.ok){const g=await d.text().catch(()=>""),y=`${o} ${e} → ${d.status} ${g.slice(0,200)}`;throw Dr.record({kind:"http",verb:o,target:e,startedAt:a,durationMs:l(),ok:!1,status:d.status,payload:c,error:y}),new Error(y)}const f=await d.json(),h=ud(f);return Dr.record({kind:h===void 0?"http":"query",verb:o,target:e,startedAt:a,durationMs:l(),ok:!0,status:d.status,...h===void 0?{}:{rowCount:h},payload:c}),f}async login(e,t){const n=new URL(this.baseUrl);if(n.username||n.password||n.search||n.hash||n.protocol!=="https:"&&!(n.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(n.hostname)))throw new Error("Use HTTPS to sign in to a remote database.");const i=await this.fetcher(`${this.baseUrl}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"omit",redirect:"error",body:JSON.stringify({username:e,password:t})});if(!i.ok)throw new Error("Database sign-in failed. Check your credentials and try again.");const o=await i.json();if(o.ok!==!0||typeof o.token!="string"||!o.token)throw new Error("The database did not return a session token.");return o.token}async stats(){return this.json("/stats")}async clusterStatus(){return this.json("/cluster/status")}async metricsCatalog(){return(await this.query("SELECT path, kind, role, unit, supports_prometheus_query, created_at_ms FROM red.metrics")).result.records.map(t=>{const n=t.values;return{path:String(n.path??""),kind:n.kind,role:String(n.role??"metric"),unit:n.unit??null,supports_prometheus_query:n.supports_prometheus_query!==!1,created_at_ms:typeof n.created_at_ms=="number"?n.created_at_ms:void 0}})}async promQuery(e,t){const n=new URLSearchParams({query:e});return t!==void 0&&n.set("time",String(t)),this.json(`/api/v1/query?${n}`)}async promQueryRange(e,t,n,i){const o=new URLSearchParams({query:e,start:String(t),end:String(n),step:String(i)});return this.json(`/api/v1/query_range?${o}`)}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:Ci(t)}}}async capabilities(){try{const n=await this.json("/capabilities");return td(n)}catch(n){if(!sd(n))return{...Or}}const[e,t]=await Promise.all([this.probeGet("/repo/commits?limit=1"),this.probeGet("/cluster/status")]);return{...Or,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(hs.has(this.baseUrl))throw ps(this.baseUrl);const t=`/collections/${encodeURIComponent(e)}`,n=Si.get(this.baseUrl);if(n){if(!await n)throw ps(this.baseUrl);return this.json(t)}let i;const o=new Promise(a=>{i=a});Si.set(this.baseUrl,o);try{const a=await this.json(t);return i(!0),a}catch(a){throw od(a)?(hs.add(this.baseUrl),i(!1)):i(!0),a}finally{Si.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,t={}){return this.json("/query",{method:"POST",body:JSON.stringify({query:e}),signal:t.signal})}async queryStreamCollect(e,t={}){const n=t.maxRows??1e4,i={"Content-Type":"application/json",Accept:"application/x-ndjson"};Object.assign(i,this.headers);const o=Date.now(),a=performance.now(),s=JSON.stringify({query:e}),c=fs(s),l=()=>Math.round(performance.now()-a);let d;try{d=await this.fetcher(`${this.baseUrl}/query/stream`,{method:"POST",headers:i,body:s,signal:t.signal})}catch(h){throw Dr.record({kind:"query",verb:"POST",target:"/query/stream",startedAt:o,durationMs:l(),ok:!1,payload:c,error:Ci(h)}),h}if(!d.ok||!d.body){const h=d.body?await d.text().catch(()=>""):"",g=`POST /query/stream → ${d.status} ${h.slice(0,200)}`;throw Dr.record({kind:"query",verb:"POST",target:"/query/stream",startedAt:o,durationMs:l(),ok:!1,status:d.status,payload:c,error:g}),new Error(g)}const f={columns:[],rows:[],rowCount:0,truncated:!1};for await(const h of cd(d.body))if("descriptor"in h)f.columns=(h.descriptor.columns??[]).map(g=>typeof g=="string"?g:g.name),f.schemaFingerprint=h.descriptor.schema_fingerprint;else if("cursor"in h)f.cursor=h.cursor.token;else if("row"in h){if(f.rows.length>=n){f.truncated=!0;break}f.rows.push(h.row),f.rowCount=f.rows.length}else if("end"in h||"cancelled"in h)break;return Dr.record({kind:"query",verb:"POST",target:"/query/stream",startedAt:o,durationMs:l(),ok:!0,status:d.status,rowCount:f.rowCount,payload:c}),f.truncated&&f.cursor&&await this.cancelQueryStream(f.cursor).catch(()=>{}),f}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 n=t.toString()?`?${t}`:"";return(await this.json(`/repo/commits${n}`)).result}async commitDiff(e,t,n={}){const i=new URLSearchParams;n.collection&&i.set("collection",n.collection),n.summary!==void 0&&i.set("summary",String(n.summary));const o=i.toString()?`?${i}`:"";return(await this.json(`/repo/commits/${encodeURIComponent(e)}/diff/${encodeURIComponent(t)}${o}`)).result}async replication(){return this.json("/replication/status").catch(()=>({ok:!1,role:"standalone"}))}async whoami(){return this.json("/auth/whoami")}async ask(e,t={}){return this.json("/ai/ask",{method:"POST",body:JSON.stringify({question:e,...t})})}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 authCan(e){const t=await this.json("/auth/can",{method:"POST",body:JSON.stringify({checks:e})});if(!Array.isArray(t.results))throw new Error(t.error??"POST /auth/can returned no results");return e.map((n,i)=>{var s;const o=((s=t.results)==null?void 0:s[i])??{},a=ad(o.resource)?o.resource:n.resource;return{action:typeof o.action=="string"?o.action:n.action,resource:a,current_tenant:typeof o.current_tenant=="string"?o.current_tenant:n.current_tenant,allowed:o.allowed===!0,reason:typeof o.reason=="string"?o.reason:void 0}})}async changes(e,t={}){const n=new URLSearchParams;e!==void 0&&n.set("since_lsn",String(e)),t.limit!==void 0&&n.set("limit",String(t.limit));const i=n.toString()?`?${n}`:"",a=(await this.json("/changes"+i)).events??[];return t.collection?a.filter(s=>s.collection===t.collection):a}async rows(e){return(await this.query(e)).result.records.map(n=>n.values)}}class dd extends Error{constructor(e){super(`Unknown connection: ${e}`),this.id=e,this.name="UnknownConnectionError"}}class fd extends Error{constructor(){super("No active connection — call connect() first"),this.name="NotConnectedError"}}class gs extends Error{constructor(e,t){super(`Connection ${e} unreachable: ${t}`),this.id=e,this.reason=t,this.name="UnreachableConnectionError"}}const hd={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 Aa(r){const e=r.trim();if(!e)return null;const t=e.match(/^([a-z+]+):\/\//i);return t?hd[t[1].toLowerCase()]??null:"http"}const vo=["http","https"],pd=["http","https","unix"];function gd(r,e){const t=Aa(r);return t!==null&&e.includes(t)}const md=["endpoint","connection","red_url","red"],vd="view",$a="cs",Da="to",yd="token",Ia=/(token|secret|password|passwd|auth|credential|api[-_]?key|bearer)/i;class ur extends Error{constructor(e,t){super(t),this.code=e,this.name="OpenContractError"}}function bd(r,e=""){if(r instanceof URL)return{search:r.search,hash:r.hash};const t=r??"";if(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)){const a=new URL(t);return{search:a.search,hash:a.hash}}const n=t.indexOf("#"),i=n>=0?t.slice(0,n):t,o=n>=0?t.slice(n):e;return{search:i,hash:o}}function wd(r){return/^file:/i.test(r)||/^~(?:\/|\\|$)/.test(r)||/^(?:\.{1,2})(?:\/|\\|$)/.test(r)||/^(?:\/|\\)/.test(r)||/^[a-z]:[\\/]/i.test(r)||r.includes("\\")}function La(r){const e=r.trim().replace(/\/$/,"");if(!e)throw new ur("EMPTY_CS","Open Contract cs is empty");if(wd(e))throw new ur("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 ur("MALFORMED_URL","Open Contract cs is not a valid URL")}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new ur("UNSUPPORTED_SCHEME","Open Contract cs must use http:// or https://");for(const n of t.searchParams.keys())if(Ia.test(n))throw new ur("SECRET_IN_CS","Open Contract secrets must be carried in the app URL hash, not inside cs");return e}function Ta(r){const e=r.trim();if(!e)throw new ur("MALFORMED_ROUTE","Open Contract to is empty");if(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")||e.includes("\\"))throw new ur("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 ur("MALFORMED_ROUTE","Open Contract to must target a known red-ui route")}function Ga(r,e=""){const{search:t,hash:n}=bd(r,e),i=new URLSearchParams(t),o=new URLSearchParams(n.startsWith("#")?n.slice(1):n),a={},s=i.get($a);s!==null&&(a.cs=La(s));const c=i.get(Da);c!==null&&(a.to=Ta(c));const l=o.get(yd);return l&&(a.token=l),a}function _d(r,e=""){const t=new URLSearchParams(r??""),n={},i=t.get($a);if(i!==null)try{n.endpoint=La(i)}catch{}const o=t.get(Da);if(o!==null)try{n.to=Ta(o)}catch{}for(const s of md){if(n.endpoint)break;const c=t.get(s);if(c&&!Ia.test(s)){n.endpoint=c;break}}const a=t.get(vd);a&&(n.view=a);try{Ga(r,e).token}catch{}return n}function xd(r){return typeof r.endpoint=="string"&&r.endpoint.trim().length>0}function kd(r){return typeof r.to=="string"&&r.to.trim().length>0}const Ed=8;function Sd(){let r=[];return{load:()=>r.slice(),save:e=>{r=e.slice()}}}class Cd{constructor(e={}){Te(this,"presets");Te(this,"history");Te(this,"clientFactory");Te(this,"historyMax");Te(this,"supportedTransports");Te(this,"boot");Te(this,"embeddedResolver");Te(this,"handoffTokens",new Map);Te(this,"active",null);var t,n;this.presets=((t=e.presets)==null?void 0:t.slice())??[],this.history=e.history??Sd(),this.historyMax=e.historyMax??Ed,this.clientFactory=e.clientFactory??((i,o)=>new mo(i,o)),this.supportedTransports=((n=e.transports)==null?void 0:n.slice())??[...vo],this.boot=e.bootParams&&(xd(e.bootParams)||kd(e.bootParams))?{...e.bootParams}:null,this.embeddedResolver=e.embeddedResolver}transports(){return this.supportedTransports.slice()}bootParams(){return this.boot?{...this.boot}:null}useHandoffToken(e,t){const n=t.trim();n&&this.handoffTokens.set(this.handoffKey(e),n)}async list(){const e=new Set,t=[];for(const n of this.presets)e.has(n.url)||(e.add(n.url),t.push(n));for(const n of this.history.load())e.has(n.url)||(e.add(n.url),t.push({id:n.url,label:n.label,url:n.url,role:"primary"}));return t}async connect(e){const t=this.resolve(e);if(!t)throw new dd(e);let n=t.url;if(this.embeddedResolver&&/^file:\/\//i.test(t.url))try{n=await this.embeddedResolver(t.url)}catch(c){const l=c instanceof Error?c.message:String(c);throw new gs(t.id,l)}const i=this.consumeHandoffToken(t.url),o=this.clientFactory(n,i?{headers:{Authorization:`Bearer ${i}`}}:void 0),a=await o.ping();if(!a.ok)throw new gs(t.id,a.error);const s={connection:t,client:o,rtt_ms:a.rtt_ms};return this.active=s,this.record(t,a.rtt_ms),s}async whoami(){if(!this.active)throw new fd;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(n=>n.url!==e);this.history.save(t)}resolve(e){const t=this.presets.find(i=>i.id===e);if(t)return t;const n=this.history.load().find(i=>i.url===e);if(n)return{id:n.url,label:n.label,url:n.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),n=this.handoffTokens.get(t)??null;return this.handoffTokens.delete(t),n}record(e,t){const n=this.history.load().filter(o=>o.url!==e.url),i=[{url:e.url,label:e.label,last_used:Date.now(),rtt_ms:t},...n].slice(0,this.historyMax);this.history.save(i)}}const Ra="red-ui:connection",Ad=["__RED_BOOTSTRAP__","__RED_UI_CONNECTION_BOOTSTRAP__","__RED_UI_BOOTSTRAP__"];function jn(r){return typeof r=="string"&&r.trim()?r.trim():void 0}function $d(r){if(!r||typeof r!="object")return null;const e=jn(r.target),t=jn(r.token),n=jn(r.route);return!e&&!t&&!n?null:{target:e??null,...t?{token:t}:{},...n?{route:n}:{}}}async function Dd(r){for(const e of r){let t;try{t=$d(await e())}catch{t=null}if(t)return t}return null}async function Id(){if(typeof window>"u"||!("__TAURI_INTERNALS__"in window||"__TAURI__"in window))return null;try{return(await fr(()=>import("./DhEqZVGG.js"),[],import.meta.url)).invoke}catch{return null}}async function Ld(r){const e=r??await Id();if(!e)return null;try{return await e("connection_bootstrap")}catch{return null}}async function Td(r=globalThis){if(!r||typeof r!="object")return null;const e=r;for(const t of Ad){const n=e[t];if(n)try{return typeof n=="function"?await n():n}finally{try{delete e[t]}catch{e[t]=void 0}}}return null}function Gd(){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:(r,e,t)=>history.replaceState(r,e,t)}}}function Rd(r){if(!r.consume||!r.location||!r.history)return;const e=r.location.hash;if(!e)return;const t=new URLSearchParams(e.startsWith("#")?e.slice(1):e);if(!t.has("token"))return;t.delete("token");const n=t.toString(),i=`${r.location.pathname}${r.location.search}${n?`#${n}`:""}`;try{r.history.replaceState(r.history.state,"",i)}catch{}}function ms(r=typeof location>"u"?"":location.search,e=typeof location>"u"?"":location.hash,t=Gd()){try{const n=Ga(r,e);return n.token&&Rd(t),!n.cs&&!n.to&&!n.token?null:{target:n.cs,token:n.token,route:n.to}}catch{return null}}function Od(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}function Md(r=Od(),e=Ra){if(!r)return null;try{const t=r.getItem(e);if(!t)return null;const n=JSON.parse(t),i=jn(n==null?void 0:n.url);return i?{target:i}:null}catch{return null}}async function zd(r={}){const e=r.readUrl??(()=>ms()),t=await Dd([r.readTauri??Ld,r.readInjectedGlobal??Td,e,r.readPersisted??(()=>Md())]);if(t&&!r.readUrl)try{ms()}catch{}return t??{target:null}}class wt extends Error{constructor(t,n){super(n);Te(this,"code");this.name="SecureStoreError",this.code=t}}const Nd=2e5,Pd=16,Ud=12;function In(r){let e="";for(const t of r)e+=String.fromCharCode(t);return btoa(e)}function Ai(r){const e=atob(r),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function Ir(r){const e=new ArrayBuffer(r.byteLength);return new Uint8Array(e).set(r),e}class Wd{constructor(e,t={}){Te(this,"storage");Te(this,"namespace");Te(this,"iterations");Te(this,"subtle");Te(this,"password");Te(this,"keyCache",new Map);var o;if(typeof e!="string"||e.length===0)throw new wt("LOCKED","master password required");const n=t.storage??(typeof globalThis<"u"?globalThis.localStorage:void 0);if(!n)throw new wt("BACKEND_FAILURE","no Storage backend available");const i=t.subtle??(typeof globalThis<"u"?(o=globalThis.crypto)==null?void 0:o.subtle:void 0);if(!i)throw new wt("BACKEND_FAILURE","Web Crypto SubtleCrypto unavailable");this.password=e,this.storage=n,this.namespace=t.namespace??"red-ui:secure",this.iterations=t.iterations??Nd,this.subtle=i}storageKey(e){return`${this.namespace}:${e}`}async deriveKey(e){const t=In(e),n=this.keyCache.get(t);if(n)return n;const i=new TextEncoder().encode(this.password),o=await this.subtle.importKey("raw",Ir(i),"PBKDF2",!1,["deriveKey"]),a=await this.subtle.deriveKey({name:"PBKDF2",salt:Ir(e),iterations:this.iterations,hash:"SHA-256"},o,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"]);return this.keyCache.set(t,a),a}randomBytes(e){const t=new Uint8Array(e),n=globalThis.crypto;if(!n)throw new wt("BACKEND_FAILURE","crypto.getRandomValues unavailable");return n.getRandomValues(t),t}async put(e,t){const n=this.randomBytes(Pd),i=this.randomBytes(Ud),o=await this.deriveKey(n),a=new TextEncoder().encode(t);let s;try{s=await this.subtle.encrypt({name:"AES-GCM",iv:Ir(i)},o,Ir(a))}catch(l){throw new wt("BACKEND_FAILURE",`encrypt failed: ${l.message}`)}const c={v:1,salt:In(n),nonce:In(i),ciphertext:In(new Uint8Array(s))};try{this.storage.setItem(this.storageKey(e),JSON.stringify(c))}catch(l){throw new wt("BACKEND_FAILURE",`storage write failed: ${l.message}`)}}async get(e){const t=this.storage.getItem(this.storageKey(e));if(!t)return null;let n;try{n=JSON.parse(t)}catch{throw new wt("CORRUPT_ENVELOPE",`key ${e}: not valid JSON`)}if(!n||n.v!==1||typeof n.salt!="string"||typeof n.nonce!="string"||typeof n.ciphertext!="string")throw new wt("CORRUPT_ENVELOPE",`key ${e}: missing envelope fields`);let i,o,a;try{i=Ai(n.salt),o=Ai(n.nonce),a=Ai(n.ciphertext)}catch{throw new wt("CORRUPT_ENVELOPE",`key ${e}: base64 decode failed`)}const s=await this.deriveKey(i);let c;try{c=await this.subtle.decrypt({name:"AES-GCM",iv:Ir(o)},s,Ir(a))}catch{throw new wt("DECRYPT_FAILED",`key ${e}: decryption failed (wrong password or tampered payload)`)}return new TextDecoder().decode(c)}async delete(e){try{this.storage.removeItem(this.storageKey(e))}catch(t){throw new wt("BACKEND_FAILURE",`storage delete failed: ${t.message}`)}}}const $i="UNKNOWN";function jd(r){return typeof r=="object"&&r!==null&&typeof r.code=="string"&&typeof r.message=="string"}function Oa(r){if(jd(r)){const e=r.detail;return{code:r.code,message:r.message,...typeof e=="string"&&e.length>0?{detail:e}:{}}}return typeof r=="string"?{code:$i,message:r}:r instanceof Error?{code:$i,message:r.message||String(r)}:{code:$i,message:String(r)}}function Di(r){const e=Oa(r);return e.detail?`${e.message}: ${e.detail}`:e.message}class Kn extends Error{constructor(t){super(t.detail?`${t.message}: ${t.detail}`:t.message);Te(this,"code");Te(this,"detail");this.name="DesktopError",this.code=t.code,this.detail=t.detail}static from(t){return t instanceof Kn?t:new Kn(Oa(t))}}class Bd{constructor(e){Te(this,"invoke");Te(this,"service");if(!e.invoke)throw new wt("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(n){throw new wt("BACKEND_FAILURE",`keychain_set failed: ${Di(n)}`)}}async get(e){try{return await this.invoke("keychain_get",{service:this.service,key:e})??null}catch(t){throw new wt("BACKEND_FAILURE",`keychain_get failed: ${Di(t)}`)}}async delete(e){try{await this.invoke("keychain_delete",{service:this.service,key:e})}catch(t){throw new wt("BACKEND_FAILURE",`keychain_delete failed: ${Di(t)}`)}}}/**
|
|
4
|
-
* @file
|
|
5
|
-
* @license @lucide/svelte v1.61.0 - ISC
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the ISC license.
|
|
8
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/const gr={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"};/**
|
|
10
|
-
* @file
|
|
11
|
-
* @license @lucide/svelte v1.61.0 - ISC
|
|
12
|
-
*
|
|
13
|
-
* This source code is licensed under the ISC license.
|
|
14
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
15
|
-
*/const io=(...r)=>r.filter((e,t,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===t).join(" ").trim();/**
|
|
16
|
-
* @file
|
|
17
|
-
* @license @lucide/svelte v1.61.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/function Ii(r){return r!=null}function Fd(r,e={}){var h,g;const t=e.attributeNames??{},n=y=>t[y]??y,i=r.size??r.width??gr.width,o=r.size??r.height??gr.height,a=((h=r.aliases)==null?void 0:h.filter(y=>typeof y=="string"&&y.trim()!=="").map(y=>`lucide-${y}`))??[],s=[...r.name?[`lucide-${r.name}`]:[],...a],c=((g=e.className)==null?void 0:g.split(" ").filter(Boolean))??[],l=e.includeDefaultClasses===!1?io(...c):io("lucide",...s,...c),d=e.absoluteStrokeWidth?Number(e.strokeWidth??gr["stroke-width"])*Number(r.size??r.width??gr.width)/Number(e.size??e.width??gr.width):e.strokeWidth??gr["stroke-width"];return["svg",{...Object.entries(gr).reduce((y,[C,b])=>(y[n(C)]=b,y),{}),..."color"in e&&e.color&&{[n("stroke")]:e.color},..."size"in e&&Ii(e.size)&&{[n("width")]:e.size,[n("height")]:e.size},..."width"in e&&Ii(e.width)&&{[n("width")]:e.width},..."height"in e&&Ii(e.height)&&{[n("height")]:e.height},[n("stroke-width")]:d,...l&&{[n("class")]:l},[n("viewBox")]:`0 0 ${i} ${o}`,...e.hasA11yProp===!1?{[n("aria-hidden")]:"true"}:{},..."attributes"in e&&e.attributes},r.node.map(y=>{const[C,b,m]=y,A=e.nonScalingStroke?{[n("vector-effect")]:"non-scaling-stroke",...b}:b;return m?[C,A,m]:[C,A]})]}/**
|
|
22
|
-
* @file
|
|
23
|
-
* @license @lucide/svelte v1.61.0 - ISC
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the ISC license.
|
|
26
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/const Vd=r=>{for(const e in r)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
|
|
28
|
-
* @file
|
|
29
|
-
* @license @lucide/svelte v1.61.0 - ISC
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the ISC license.
|
|
32
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/const Kd=Symbol("lucide-context"),Hd=()=>Uu(Kd);var qd=At("<svg><!><!></svg>");function at(r,e){Zn(e,!0);const t=Hd()??{},n=Gt(e,"color",19,()=>t.color??"currentColor"),i=Gt(e,"size",19,()=>t.size??24),o=Gt(e,"width",19,i),a=Gt(e,"height",19,i),s=Gt(e,"strokeWidth",19,()=>t.strokeWidth??2),c=Gt(e,"absoluteStrokeWidth",19,()=>t.absoluteStrokeWidth??!1),l=Gt(e,"nonScalingStroke",19,()=>t.nonScalingStroke??!1),d=Gt(e,"iconNode",19,()=>[]),f=Gt(e,"icon",19,()=>({node:d(),aliases:[],size:24})),h=Ze(e,["$$slots","$$events","$$legacy","color","size","width","height","strokeWidth","absoluteStrokeWidth","nonScalingStroke","iconNode","icon","class","children"]),g=Q(()=>!!e.children||Vd(h)),y=Q(()=>Fd(f(),{color:n(),width:o(),height:a(),strokeWidth:s(),absoluteStrokeWidth:c(),nonScalingStroke:l(),className:io("lucide-icon",t.class),hasA11yProp:u(g),attributes:h})),C=Q(()=>rn(u(y),3)),b=Q(()=>u(C)[1]),m=Q(()=>ju(u(C)[2],()=>[],!0)),A=Q(()=>({...u(b),class:[...u(b).class.split(" "),e.class]}));var v=qd();Vn(v,()=>({...u(A)}));var p=R(v);bt(p,17,()=>u(m),Wn,(S,$)=>{var x=Q(()=>rn(u($),2));let D=()=>u(x)[0],I=()=>u(x)[1];var j=er(),O=lt(j);Qu(O,D,!0,(w,ge)=>{Vn(w,()=>({...I()}))}),V(S,j)});var E=N(p);ro(E,()=>e.children??Wu),T(v),V(r,v),Qn()}const Ma={name:"x",size:24,node:[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]]};Ma.node;function vs(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return Ma}}))}const Yd=20;var ln,un,dn;class Xd{constructor(){nt(this,ln,ke(0));nt(this,un,Q(()=>this.inflight>0));nt(this,dn,ke(Kt([])));Te(this,"nextId",1)}get inflight(){return u(Se(this,ln))}set inflight(e){P(Se(this,ln),e,!0)}get active(){return u(Se(this,un))}set active(e){P(Se(this,un),e)}get log(){return u(Se(this,dn))}set log(e){P(Se(this,dn),e,!0)}async track(e,t){const n=this.nextId++,i={id:n,label:e,startedAt:Date.now(),durationMs:null,status:"pending"};Qt(()=>{this.log=[i,...this.log].slice(0,Yd),this.inflight+=1});try{const o=await t();return Qt(()=>this.update(n,{durationMs:Date.now()-i.startedAt,status:"ok"})),o}catch(o){throw Qt(()=>this.update(n,{durationMs:Date.now()-i.startedAt,status:"error",error:o.message})),o}finally{Qt(()=>{this.inflight=Math.max(0,this.inflight-1)})}}update(e,t){this.log=this.log.map(n=>n.id===e?{...n,...t}:n)}reset(){Qt(()=>{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})}}ln=new WeakMap,un=new WeakMap,dn=new WeakMap;const lr=new Xd;var Jd=Array.isArray,ei=r=>{if(!r&&r!==0&&r!==0n)return"";if(typeof r=="string")return r;if(typeof r=="number")return r!==r?"":""+r;if(typeof r=="bigint")return""+r;let e="";if(Jd(r)){const t=r.length;for(let n=0;n<t;n++){const i=r[n];if(!i&&i!==0&&i!==0n)continue;const o=typeof i=="string"?i:ei(i);o&&(e&&(e+=" "),e+=o)}return e}if(typeof r=="object")for(const t in r)r[t]&&(e&&(e+=" "),e+=t);return e},Zd=/\s+/g,oo=Array.isArray,Qd=r=>typeof r!="string"||!r?r:r.replace(Zd," ").trim(),ef=r=>{const e=r.length;if(e===0)return!1;const t=r.charCodeAt(0),n=r.charCodeAt(e-1);if(t===32||n===32||t>=9&&t<=13||t===160||n>=9&&n<=13||n===160)return!0;for(let i=0;i<e;i++){const o=r.charCodeAt(i);if(o>=9&&o<=13||o===160||o===32&&i+1<e&&r.charCodeAt(i+1)===32)return!0}return!1},Bn=(...r)=>{const e=ei(r);if(e)return ef(e)?Qd(e):e},so=r=>r===!1?"false":r===!0?"true":r===0?"0":r,zt=r=>{if(!r||typeof r!="object")return!0;for(const e in r)return!1;return!0},za=(r,e)=>{if(r===e)return!0;if(!r||!e)return!1;const t=r,n=e,i=Object.keys(t),o=Object.keys(n);if(i.length!==o.length)return!1;for(let a=0;a<i.length;a++){const s=i[a];if(!o.includes(s)||t[s]!==n[s])return!1}return!0},tf=(r,e)=>{const t=r;for(const n in e)if(Object.hasOwn(e,n)){const i=e[n];n in t?t[n]=Bn(t[n],i):t[n]=i}return r},Na=(r,e)=>{for(let t=0;t<r.length;t++){const n=r[t];oo(n)?Na(n,e):n&&e.push(n)}},ao=(...r)=>{const e=[];Na(r,e);const t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},yo=(r,e)=>{const t=r,n=e,i={};for(const o in t){const a=t[o];if(o in n){const s=n[o];oo(a)||oo(s)?i[o]=ao(s,a):typeof a=="object"&&typeof s=="object"&&a&&s?i[o]=yo(a,s):i[o]=s+" "+a}else i[o]=a}for(const o in n)o in t||(i[o]=n[o]);return i},rf={twMerge:!0,twMergeConfig:{}},Pa=256,nf=128,br=Symbol("tv-cache-miss"),of=r=>(r==null?void 0:r.class)!=null&&r.class!==""||(r==null?void 0:r.className)!=null&&r.className!=="",ys=r=>{if(r===void 0)return"";if(r===null)return"null";if(typeof r=="string")return r;if(typeof r=="boolean")return r?"true":"false";if(typeof r=="number")return r===0?"0":String(r);if(typeof r=="bigint")return String(r);const e=so(r),t=typeof e;if(t==="string"||t==="number"||t==="boolean"||t==="bigint")return String(e);if(t==="object")try{return JSON.stringify(e)}catch{return null}return null},Lr=(r,e)=>{if(e===void 0)return r;if(e===null)return r+"null";const t=typeof e;if(t==="string"||t==="number"||t==="boolean"||t==="bigint")return r+String(e);if(Array.isArray(e))return r+e.join("\0");try{return r+JSON.stringify(e)}catch{return r+"?"}},Ua=(r,e,t,n)=>{let i="";const o=Object.create(null);for(let s=0;s<r.length;s++){const c=r[s];o[c]=1;let l=e[c];t&&t[c]!==void 0&&(l=t[c]);const d=ys(l);if(d===null)return null;i+=c+":"+d+";"}const a=[];for(const s in e)s==="class"||s==="className"||o[s]||(o[s]=1,a.push(s));if(t)for(const s in t)s==="class"||s==="className"||o[s]||t[s]===void 0||(o[s]=1,a.push(s));a.length>1&&a.sort();for(let s=0;s<a.length;s++){const c=a[s];let l=e[c];t&&t[c]!==void 0&&(l=t[c]);const d=ys(l);if(d===null)return null;i+=c+":"+d+";"}return i},Wa=(r,e)=>{let t="";for(let n=0;n<r.length;n++){const{conditionKeys:i,source:o}=r[n];for(let a=0;a<i.length;a++){const s=i[a];t+=s+"=",t=Lr(t,o[s]),t+=","}t+="c=",t=Lr(t,o.class),t+="|cn=",t=Lr(t,o.className),t+=";"}for(let n=0;n<e.length;n++){const{conditionKeys:i,source:o}=e[n];for(let a=0;a<i.length;a++){const s=i[a];t+=s+"=",t=Lr(t,o[s]),t+=","}Array.isArray(o.slots)&&(t+="slots="+o.slots.join(",")+","),t+="c=",t=Lr(t,o.class),t+="|cn=",t=Lr(t,o.className),t+=";"}return t},ja=(r=Pa)=>{let e=new Map,t=null;return{get(n){if(e.has(n))return e.get(n);if(t!=null&&t.has(n)){const i=t.get(n);return e.set(n,i),i}return br},set(n,i){e.size>=r&&(t=e,e=new Map),e.set(n,i)}}},sf=(r=Pa)=>{const e=ja(r);return{get(t){return e.get(t)},set(t,n){e.set(t,n)}}},af=(r=nf)=>{let e=new Map,t=null,n=0;return{get(i,o){const a=e.get(i);if(a){const s=a.get(o);if(s!==void 0||a.has(o))return s}if(t){const s=t.get(i);if(s){const c=s.get(o);if(c!==void 0||s.has(o)){let l=e.get(i);return l||(l=new Map,e.set(i,l)),l.has(o)||n++,l.set(o,c),c}}}return br},set(i,o,a){n>=r&&(t=e,e=new Map,n=0);let s=e.get(i);s||(s=new Map,e.set(i,s)),s.has(o)||n++,s.set(o,a)}}},bo=(r,e)=>{let t=null;return(n,i)=>{if(!of(i))return n;const o=i.class,a=i.className;if(o!=null&&o!==""&&typeof o!="string"||a!=null&&a!==""&&typeof a!="string")return r(e,n,o,a);t??(t=af());const s=n??"",c=(typeof o=="string"?o:"")+"\0"+(typeof a=="string"?a:""),l=t.get(s,c);if(l!==br)return l;const d=r(e,n,o,a);return t.set(s,c,d),d}};function cf(){let r=null,e={},t=!1;return{get cachedTwMerge(){return r},set cachedTwMerge(n){r=n},get cachedTwMergeConfig(){return e},set cachedTwMergeConfig(n){e=n},get didTwMergeConfigChange(){return t},set didTwMergeConfigChange(n){t=n},reset(){r=null,e={},t=!1}}}var Ct=cf(),lf=r=>{!zt(r.twMergeConfig)&&!za(r.twMergeConfig,Ct.cachedTwMergeConfig)&&(Ct.didTwMergeConfigChange=!0,Ct.cachedTwMergeConfig=r.twMergeConfig)},uf=(r,e)=>{const t=[];for(let n=0;n<e.length;n++){const i=e[n],o=r[i];t.push({key:i,values:o,isEmpty:zt(o)})}return t},df=r=>{if(!Array.isArray(r)||r.length===0)return[];const e=[];for(let t=0;t<r.length;t++){const n=r[t],i=[];for(const o in n)o!=="class"&&o!=="className"&&i.push(o);e.push({conditionKeys:i,source:n})}return e},ff=r=>{if(!Array.isArray(r)||r.length===0)return[];const e=[];for(let t=0;t<r.length;t++){const n=r[t],i=[];for(const o in n)o!=="slots"&&o!=="class"&&o!=="className"&&i.push(o);e.push({conditionKeys:i,source:n})}return e},hf=r=>{const e={};for(let t=0;t<r.length;t++){const n=r[t],i=n.source.slots;if(Array.isArray(i))for(let o=0;o<i.length;o++){const a=i[o];e[a]||(e[a]=[]),e[a].push(n)}}return e},pf=(r,e)=>{const{extend:t=null,slots:n={},variants:i={},compoundVariants:o=[],compoundSlots:a=[],defaultVariants:s={}}=r,c={...rf,...e},l=r.slots!==void 0,d=t!=null&&t.base?Bn(t.base,r==null?void 0:r.base):r==null?void 0:r.base,f=t!=null&&t.variants&&!zt(t.variants)?yo(i,t.variants):i,h=t!=null&&t.defaultVariants&&!zt(t.defaultVariants)?{...t.defaultVariants,...s}:s;lf(c);const g=!(t!=null&&t.slots)||zt(t.slots),y=l?g&&(t!=null&&t.base)?Bn(r==null?void 0:r.base,t.base):typeof(r==null?void 0:r.base)=="string"||(r==null?void 0:r.base)==null?r.base:Bn(r.base):void 0,C=l?{base:y,...n}:{},b=g?C:tf({...t==null?void 0:t.slots},zt(C)?{base:r==null?void 0:r.base}:C),m=!(t!=null&&t.compoundVariants)||zt(t.compoundVariants)?o:ao(t==null?void 0:t.compoundVariants,o),A=!(t!=null&&t.compoundSlots)||zt(t.compoundSlots)?a:ao(t==null?void 0:t.compoundSlots,a),v=Object.keys(f),p=m&&!Array.isArray(m)?new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof m}`):A&&!Array.isArray(A)?new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof A}`):null,E=l||!g?"slots":v.length===0?"plain":"variants";return{config:c,extend:t,base:d,variants:f,defaultVariants:h,slots:b,compoundVariants:m,compoundSlots:A,compiledVariants:null,compiledCompoundVariants:null,compiledCompoundSlots:null,compiledCompoundSlotsBySlot:null,deferredError:p,mode:E,slotKeys:null,variantKeys:v}},Ba=r=>(r.compiledVariants!==null||(r.compiledVariants=uf(r.variants,r.variantKeys),r.compiledCompoundVariants=df(r.compoundVariants),r.compiledCompoundSlots=ff(r.compoundSlots),r.compiledCompoundSlotsBySlot=hf(r.compiledCompoundSlots),r.slotKeys=r.slots&&typeof r.slots=="object"?Object.keys(r.slots):[]),r),co=[],Fa=[],gf=[],mf=[],vf=[],Va=(r,e,t)=>{const n={};for(const i in r)n[i]=r[i];if(e)for(const i in e)e[i]!==void 0&&(n[i]=e[i]);if(t)for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n},Ln=r=>r==null||r===!1,yf=(r,e)=>{if(!Array.isArray(r))return r===e||Ln(r)&&Ln(e);for(let t=0;t<r.length;t++){const n=r[t];if(n===e||Ln(n)&&Ln(e))return!0}return!1},Ka=(r,e,t,n)=>{if(r.isEmpty)return null;const i=(n==null?void 0:n[r.key])??(t==null?void 0:t[r.key]);if(i===null)return null;const o=so(i);if(typeof o=="object")return null;const a=e==null?void 0:e[r.key],s=o??so(a);return r.values[s||"false"]},wo=(r,e)=>{const{conditionKeys:t,source:n}=r;for(let i=0;i<t.length;i++){const o=t[i];if(!yf(n[o],e[o]))return!1}return!0},bs=(r,e,t)=>{typeof t=="string"?e==="base"&&r.push(t):t&&typeof t=="object"&&t[e]&&r.push(t[e])},bf=(r,e,t)=>{const n=Fa;n.length=0;for(let i=0;i<r.length;i++){const o=Ka(r[i],e,t);o&&n.push(o)}return n},wf=(r,e,t,n,i)=>{const o=Fa;o.length=0;for(let a=0;a<e.length;a++){const s=Ka(e[a],t,n,i),c=r==="base"&&typeof s=="string"?s:s&&s[r];c&&o.push(c)}return o},_f=(r,e)=>{const t=gf;t.length=0;for(let n=0;n<r.length;n++){const i=r[n];wo(i,e)&&(i.source.class&&t.push(i.source.class),i.source.className&&t.push(i.source.className))}return t},xf=(r,e,t)=>{const n=mf;n.length=0;for(let i=0;i<e.length;i++){const o=e[i];wo(o,t)&&(bs(n,r,o.source.class),bs(n,r,o.source.className))}return n},kf=(r,e)=>{const t=vf;t.length=0;for(let n=0;n<r.length;n++){const i=r[n];wo(i,e)&&(i.source.class&&t.push(i.source.class),i.source.className&&t.push(i.source.className))}return t},Ef=(r,e)=>{const{base:t,config:n}=r;let i=br;const o=bo(e,n);return(a=>(i===br&&(i=e(n,t)),o(i,a)))},Sf=(r,e)=>{const{base:t,config:n,defaultVariants:i,deferredError:o,variantKeys:a}=r;let s=r.compiledCompoundVariants,c=r.compiledVariants,l=co,d=null;const f=bo(e,n);let h=1;const g=y=>{const C=s.length>0?_f(s,Va(i,y)):void 0;return e(n,t,bf(c,i,y),C)};return(y=>{if(o)throw o;(c===null||s===null)&&(Ba(r),c=r.compiledVariants,s=r.compiledCompoundVariants,l=r.compiledCompoundSlots??co);let C;if(h>0)h--,C=g(y);else{d??(d=sf());const b=Ua(a,i,y);if(b!==null){const m=s.length>0||l.length>0?Wa(s,l):"",A=b+"#"+m,v=d.get(A);v!==br?C=v:(C=g(y),d.set(A,C))}else C=g(y)}return f(C,y)})},Cf=(r,e)=>{const{config:t,defaultVariants:n,deferredError:i,slots:o,variantKeys:a}=r;let s=null,c=null,l=null,d=null,f=!1,h=null,g=null,y=1;const C=()=>{if(l!==null)return;(r.compiledVariants===null||r.compiledCompoundVariants===null||r.compiledCompoundSlots===null||r.compiledCompoundSlotsBySlot===null||r.slotKeys===null)&&Ba(r);const m=r.compiledVariants;s=r.compiledCompoundVariants,c=r.compiledCompoundSlots;const A=r.compiledCompoundSlotsBySlot;l=r.slotKeys,f=s.length>0||c.length>0,h=bo(e,t);const v=new Array(l.length);for(let p=0;p<l.length;p++){const E=l[p],S=A[E]??co;v[p]=($,x)=>{const D=f?Va(n,$,x):void 0,I=D?xf(E,s,D):void 0,j=D?kf(S,D):void 0;return e(t,o[E],wf(E,m,n,$,x),I,j)}}d=v},b=m=>{const A=l,v=d,p=h,E={};for(let S=0;S<A.length;S++){const $=v[S],x=$(m);E[A[S]]=D=>{if(D==null)return x;let I=!1;for(const j in D)if(!(j==="class"||j==="className")&&D[j]!==void 0){I=!0;break}return p(I?$(m,D):x,D)}}return E};return(m=>{if(i)throw i;if(C(),y>0)return y--,b(m);const A=Ua(a,n,m);if(A===null)return b(m);const v=f?Wa(s,c):"",p=A+"#"+v;g??(g=ja());const E=g.get(p);if(E!==br)return E;const S=b(m);return g.set(p,S),S})},Af=(r,e)=>{if(r.mode==="plain")return Ef(r,e);let t;return(n=>(t??(t=r.mode==="slots"?Cf(r,e):Sf(r,e)),t(n)))},$f=(r,e)=>{r.variantKeys=e.variantKeys,r.extend=e.extend,r.base=e.base,r.slots=e.slots,r.variants=e.variants,r.defaultVariants=e.defaultVariants,r.compoundSlots=e.compoundSlots,r.compoundVariants=e.compoundVariants},Df=r=>{const e=(n,i)=>{const o=pf(n,i),a=Af(o,r);return $f(a,o),a};return{tv:e,createTV:n=>(i,o)=>e(i,o?yo(n,o):n)}},If=(r,e)=>{const t=r.length,n=e.length,i=new Array(t+n);for(let o=0;o<t;o++)i[o]=r[o];for(let o=0;o<n;o++)i[t+o]=e[o];return i},Lf=(r,e)=>({classGroupId:r,validator:e}),Ha=(r=new Map,e=null,t)=>({nextPart:r,validators:e,classGroupId:t}),Hn="-",ws=[],Tf="arbitrary..",Gf=r=>{const e=Of(r),{conflictingClassGroups:t,conflictingClassGroupModifiers:n}=r;return{getClassGroupId:a=>{if(a[0]==="["&&a[a.length-1]==="]")return Rf(a);const s=a.split(Hn),c=s[0]===""&&s.length>1?1:0;return qa(s,c,e)},getConflictingClassGroupIds:(a,s)=>{if(s){const c=n[a],l=t[a];return c?l?If(l,c):c:l||ws}return t[a]||ws}}},qa=(r,e,t)=>{if(r.length-e===0)return t.classGroupId;const i=r[e],o=t.nextPart.get(i);if(o){const l=qa(r,e+1,o);if(l)return l}const a=t.validators;if(a===null)return;const s=e===0?r.join(Hn):r.slice(e).join(Hn),c=a.length;for(let l=0;l<c;l++){const d=a[l];if(d.validator(s))return d.classGroupId}},Rf=r=>{const e=r.slice(1,-1),t=e.indexOf(":");if(t===-1)return;const n=e.slice(0,t);return n?Tf+n:void 0},Of=r=>{const{theme:e,classGroups:t}=r;return Mf(t,e)},Mf=(r,e)=>{const t=Ha();for(const n in r){const i=r[n];_o(i,t,n,e)}return t},_o=(r,e,t,n)=>{const i=r.length;for(let o=0;o<i;o++){const a=r[o];zf(a,e,t,n)}},zf=(r,e,t,n)=>{if(typeof r=="string"){Nf(r,e,t);return}if(typeof r=="function"){Pf(r,e,t,n);return}Uf(r,e,t,n)},Nf=(r,e,t)=>{const n=r===""?e:Ya(e,r);n.classGroupId=t},Pf=(r,e,t,n)=>{if(Wf(r)){_o(r(n),e,t,n);return}e.validators===null&&(e.validators=[]),e.validators.push(Lf(t,r))},Uf=(r,e,t,n)=>{const i=Object.entries(r),o=i.length;for(let a=0;a<o;a++){const[s,c]=i[a];_o(c,Ya(e,s),t,n)}},Ya=(r,e)=>{let t=r;const n=e.split(Hn),i=n.length;for(let o=0;o<i;o++){const a=n[o];let s=t.nextPart.get(a);s||(s=Ha(),t.nextPart.set(a,s)),t=s}return t},Wf=r=>"isThemeGetter"in r&&r.isThemeGetter===!0,jf="!",Bf=58,Ff=47,Vf=91,Kf=93,Hf=40,qf=41,_s=33,Yf=(r,e,t,n)=>({modifiers:r,hasImportantModifier:e,baseClassName:t,maybePostfixModifierPosition:n,isExternal:void 0}),xs=r=>{const e=[];let t=0,n=0,i=0,o;const a=r.length;for(let h=0;h<a;h++){const g=r.charCodeAt(h);if(t===0&&n===0){if(g===Bf){e.push(r.slice(i,h)),i=h+1;continue}if(g===Ff){o=h;continue}}g===Vf?t++:g===Kf?t--:g===Hf?n++:g===qf&&n--}const s=e.length===0?r:r.slice(i);let c=s,l=!1;const d=s.length-1;s.charCodeAt(d)===_s?(c=s.slice(0,-1),l=!0):s.charCodeAt(0)===_s&&(c=s.slice(1),l=!0);const f=o&&o>i?o-i:void 0;return Yf(e,l,c,f)},Xf=r=>{const e=new Set(r.orderSensitiveModifiers);return t=>{const n=[];let i=[];for(let o=0;o<t.length;o++){const a=t[o],s=a[0]==="[",c=e.has(a);if(s||c){if(i.length>0){i.sort();for(let l=0;l<i.length;l++)n.push(i[l]);i=[]}n.push(a)}else i.push(a)}if(i.length>0){i.sort();for(let o=0;o<i.length;o++)n.push(i[o])}return n}},Li={isExternal:!0,classId:-1,conflictIds:[]},Jf=4096,Zf=16384,Qf=r=>{const e=Xf(r),t=eh(r),{getClassGroupId:n,getConflictingClassGroupIds:i}=Gf(r);let o=Object.create(null),a=Object.create(null),s=0,c=new Int32Array(256),l=0,d=new Uint8Array(64),f=!1;const h=v=>{const p=[],E=v.length;let S=-1;f=!1;for(let $=0;$<E;$++){const x=v.charCodeAt($);x===32?S!==-1&&(p.push(v.slice(S,$)),S=-1):x>=9&&x<=13?(f=!0,S!==-1&&(p.push(v.slice(S,$)),S=-1)):S===-1&&(S=$)}return S!==-1&&p.push(v.slice(S)),p},g=new Map;let y=0;const C=v=>{let p=g.get(v);if(p===void 0&&(p=y++,g.set(v,p),p>=c.length)){const E=new Int32Array(c.length*2);E.set(c),c=E}return p},b=v=>{const{isExternal:p,modifiers:E,hasImportantModifier:S,baseClassName:$,maybePostfixModifierPosition:x}=xs(v);if(p)return Li;let D=!!x,I;if(D){const ce=$.substring(0,x);I=n(ce);const L=I&&t[I]?n($):void 0;L&&L!==I&&(I=L,D=!1)}else I=n($);if(!I){if(!D||(I=n($),!I))return Li;D=!1}const j=E.length===0?"":E.length===1?E[0]:e(E).join(":"),O=S?j+jf:j,w=i(I,D),ge=[];for(let ce=0;ce<w.length;ce++)ge.push(C(O+w[ce]));return{isExternal:!1,classId:C(O+I),conflictIds:ge}},m=v=>{let p=o[v];return p!==void 0||(p=a[v],p===void 0&&(p=b(v)),o[v]=p,++s>Jf&&(s=0,a=o,o=Object.create(null))),p};return{parseClassName:xs,sortModifiers:e,postfixLookupClassGroupIds:t,getClassGroupId:n,getConflictingClassGroupIds:i,getClassDescriptor:m,mergeClassList:v=>{const p=h(v),E=p.length;if(E===1)return p[0];y>Zf&&(g.clear(),y=0,o=Object.create(null),a=Object.create(null),s=0),l=l+1|0,l===0&&(l=1);const S=l;if(E>d.length){let I=d.length;for(;I<E;)I*=2;d=new Uint8Array(I)}let $=!1,x=0;for(let I=E-1;I>=0;I-=1){const j=p[I];x+=j.length;const O=m(j);if(O.isExternal){d[I]=1;continue}const w=O.classId;if(c[w]===S){d[I]=0,$=!0;continue}c[w]=S;const ge=O.conflictIds;for(let ce=0;ce<ge.length;ce++)c[ge[ce]]=S;d[I]=1}if(!$&&!f&&v.length===x+E-1)return v;let D="";for(let I=0;I<E;I++)d[I]===1&&(D&&(D+=" "),D+=p[I]);return D}}},eh=r=>{const e=Object.create(null),t=r.postfixLookupClassGroups;if(t)for(let n=0;n<t.length;n++)e[t[n]]=!0;return e},th=500,ks=r=>{let e,t,n=Object.create(null),i=Object.create(null),o=0;const a=l=>(e=Qf(r()),t=e.mergeClassList,c.mergeString=s,s(l)),s=l=>{let d=n[l];return d!==void 0||(d=i[l],d===void 0&&(d=t(l)),n[l]=d,++o>th&&(o=0,i=n,n=Object.create(null))),d},c=(...l)=>c.mergeString(ei(l));return c.mergeString=a,c},rh=[],ct=r=>{const e=t=>t[r]||rh;return e.isThemeGetter=!0,e},Xa=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ja=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ih=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oh=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ah=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ch=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Za=Number,lh=Number.isNaN,uh=Number.isInteger,cr=r=>nh.test(r),Ge=r=>!!r&&!lh(Za(r)),Ft=r=>!!r&&uh(Za(r)),Ti=r=>r.endsWith("%")&&Ge(r.slice(0,-1)),Xt=r=>ih.test(r),Qa=()=>!0,dh=r=>oh.test(r)&&!sh.test(r),xo=()=>!1,fh=r=>ah.test(r),hh=r=>ch.test(r),ph=r=>!Y(r)&&!Z(r),gh=r=>r.startsWith("@container")&&(r[10]==="/"&&r[11]!==void 0||r[11]==="s"&&r[16]!==void 0&&r.startsWith("-size/",10)||r[11]==="n"&&r[18]!==void 0&&r.startsWith("-normal/",10)),mh=r=>hr(r,rc,xo),Y=r=>Xa.test(r),mr=r=>hr(r,nc,dh),Es=r=>hr(r,Eh,Ge),vh=r=>hr(r,oc,Qa),yh=r=>hr(r,ic,xo),Ss=r=>hr(r,ec,xo),bh=r=>hr(r,tc,hh),Tn=r=>hr(r,sc,fh),Z=r=>Ja.test(r),Yr=r=>wr(r,nc),wh=r=>wr(r,ic),Cs=r=>wr(r,ec),_h=r=>wr(r,rc),xh=r=>wr(r,tc),Gn=r=>wr(r,sc,!0),kh=r=>wr(r,oc,!0),hr=(r,e,t)=>{const n=Xa.exec(r);return n?n[1]?e(n[1]):t(n[2]):!1},wr=(r,e,t=!1)=>{const n=Ja.exec(r);return n?n[1]?e(n[1]):t:!1},ec=r=>r==="position"||r==="percentage",tc=r=>r==="image"||r==="url",rc=r=>r==="length"||r==="size"||r==="bg-size",nc=r=>r==="length",Eh=r=>r==="number",ic=r=>r==="family-name",oc=r=>r==="number"||r==="weight",sc=r=>r==="shadow",Gi=()=>{const r=ct("color"),e=ct("font"),t=ct("text"),n=ct("font-weight"),i=ct("tracking"),o=ct("leading"),a=ct("breakpoint"),s=ct("container"),c=ct("spacing"),l=ct("radius"),d=ct("shadow"),f=ct("inset-shadow"),h=ct("text-shadow"),g=ct("drop-shadow"),y=ct("blur"),C=ct("perspective"),b=ct("aspect"),m=ct("ease"),A=ct("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],p=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...p(),Z,Y],S=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],x=()=>[Z,Y,c],D=()=>[cr,"full","auto",...x()],I=()=>[Ft,"none","subgrid",Z,Y],j=()=>["auto",{span:["full",Ft,Z,Y]},Ft,Z,Y],O=()=>[Ft,"auto",Z,Y],w=()=>["auto","min","max","fr",Z,Y],ge=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ce=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...x()],_=()=>[cr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],K=()=>[cr,"screen","full","dvw","lvw","svw","min","max","fit",...x()],ee=()=>[cr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...x()],z=()=>[r,Z,Y],Re=()=>[...p(),Cs,Ss,{position:[Z,Y]}],ae=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",_h,mh,{size:[Z,Y]}],Ee=()=>[Ti,Yr,mr],Ce=()=>["","none","full",l,Z,Y],be=()=>["",Ge,Yr,mr],Ye=()=>["solid","dashed","dotted","double"],ot=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ae=()=>[Ge,Ti,Cs,Ss],ve=()=>["","none",y,Z,Y],X=()=>["none",Ge,Z,Y],me=()=>["none",Ge,Z,Y],et=()=>[Ge,Z,Y],J=()=>[cr,"full",...x()];return{theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xt],breakpoint:[Xt],color:[Qa],container:[Xt],"drop-shadow":[Xt],ease:["in","out","in-out"],font:[ph],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xt],shadow:[Xt],spacing:["px",Ge],text:[Xt],"text-shadow":[Xt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cr,Y,Z,b]}],container:["container"],"container-type":[{"@container":["","normal","size",Z,Y]}],"container-named":[gh],columns:[{columns:[Ge,Y,Z,s]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{"inset-s":D(),start:D()}],end:[{"inset-e":D(),end:D()}],"inset-bs":[{"inset-bs":D()}],"inset-be":[{"inset-be":D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[Ft,"auto",Z,Y]}],basis:[{basis:[cr,"full","auto",s,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ge,cr,"auto","initial","none",Y]}],grow:[{grow:["",Ge,Z,Y]}],shrink:[{shrink:["",Ge,Z,Y]}],order:[{order:[Ft,"first","last","none",Z,Y]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":w()}],"auto-rows":[{"auto-rows":w()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:[...ge(),"normal"]}],"justify-items":[{"justify-items":[...ce(),"normal"]}],"justify-self":[{"justify-self":["auto",...ce()]}],"align-content":[{content:["normal",...ge()]}],"align-items":[{items:[...ce(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ce(),{baseline:["","last"]}]}],"place-content":[{"place-content":ge()}],"place-items":[{"place-items":[...ce(),"baseline"]}],"place-self":[{"place-self":["auto",...ce()]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pbs:[{pbs:x()}],pbe:[{pbe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:_()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[s,"screen",..._()]}],"min-w":[{"min-w":[s,"screen","none",..._()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},..._()]}],h:[{h:["screen","lh",..._()]}],"min-h":[{"min-h":["screen","lh","none",..._()]}],"max-h":[{"max-h":["screen","lh",..._()]}],"font-size":[{text:["base",t,Yr,mr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,kh,vh]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ti,Y]}],"font-family":[{font:[wh,yh,e]}],"font-features":[{"font-features":[Y]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Z,Y]}],"line-clamp":[{"line-clamp":[Ge,"none",Z,Es]}],leading:[{leading:[o,...x()]}],"list-image":[{"list-image":["none",Z,Y]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Z,Y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ge,"from-font","auto",Z,mr]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[Ge,"auto",Z,Y]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"tab-size":[{tab:[Ft,Z,Y]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Z,Y]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Z,Y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Re()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ft,Z,Y],radial:["",Z,Y],conic:[Ft,Z,Y]},xh,bh]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:Ee()}],"gradient-via-pos":[{via:Ee()}],"gradient-to-pos":[{to:Ee()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:Ce()}],"rounded-s":[{"rounded-s":Ce()}],"rounded-e":[{"rounded-e":Ce()}],"rounded-t":[{"rounded-t":Ce()}],"rounded-r":[{"rounded-r":Ce()}],"rounded-b":[{"rounded-b":Ce()}],"rounded-l":[{"rounded-l":Ce()}],"rounded-ss":[{"rounded-ss":Ce()}],"rounded-se":[{"rounded-se":Ce()}],"rounded-ee":[{"rounded-ee":Ce()}],"rounded-es":[{"rounded-es":Ce()}],"rounded-tl":[{"rounded-tl":Ce()}],"rounded-tr":[{"rounded-tr":Ce()}],"rounded-br":[{"rounded-br":Ce()}],"rounded-bl":[{"rounded-bl":Ce()}],"border-w":[{border:be()}],"border-w-x":[{"border-x":be()}],"border-w-y":[{"border-y":be()}],"border-w-s":[{"border-s":be()}],"border-w-e":[{"border-e":be()}],"border-w-bs":[{"border-bs":be()}],"border-w-be":[{"border-be":be()}],"border-w-t":[{"border-t":be()}],"border-w-r":[{"border-r":be()}],"border-w-b":[{"border-b":be()}],"border-w-l":[{"border-l":be()}],"divide-x":[{"divide-x":be()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":be()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ye(),"hidden","none"]}],"divide-style":[{divide:[...Ye(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...Ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ge,Z,Y]}],"outline-w":[{outline:["",Ge,Yr,mr]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",d,Gn,Tn]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",f,Gn,Tn]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:be()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[Ge,mr]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":be()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",h,Gn,Tn]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[Ge,Z,Y]}],"mix-blend":[{"mix-blend":[...ot(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ot()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ge]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ae()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":Ae()}],"mask-image-t-to-pos":[{"mask-t-to":Ae()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":Ae()}],"mask-image-r-to-pos":[{"mask-r-to":Ae()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":Ae()}],"mask-image-b-to-pos":[{"mask-b-to":Ae()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":Ae()}],"mask-image-l-to-pos":[{"mask-l-to":Ae()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":Ae()}],"mask-image-x-to-pos":[{"mask-x-to":Ae()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":Ae()}],"mask-image-y-to-pos":[{"mask-y-to":Ae()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[Z,Y]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ae()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":p()}],"mask-image-conic-pos":[{"mask-conic":[Ge]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ae()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Re()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Z,Y]}],filter:[{filter:["","none",Z,Y]}],blur:[{blur:ve()}],brightness:[{brightness:[Ge,Z,Y]}],contrast:[{contrast:[Ge,Z,Y]}],"drop-shadow":[{"drop-shadow":["","none",g,Gn,Tn]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",Ge,Z,Y]}],"hue-rotate":[{"hue-rotate":[Ge,Z,Y]}],invert:[{invert:["",Ge,Z,Y]}],saturate:[{saturate:[Ge,Z,Y]}],sepia:[{sepia:["",Ge,Z,Y]}],"backdrop-filter":[{"backdrop-filter":["","none",Z,Y]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[Ge,Z,Y]}],"backdrop-contrast":[{"backdrop-contrast":[Ge,Z,Y]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ge,Z,Y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ge,Z,Y]}],"backdrop-invert":[{"backdrop-invert":["",Ge,Z,Y]}],"backdrop-opacity":[{"backdrop-opacity":[Ge,Z,Y]}],"backdrop-saturate":[{"backdrop-saturate":[Ge,Z,Y]}],"backdrop-sepia":[{"backdrop-sepia":["",Ge,Z,Y]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Z,Y]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ge,"initial",Z,Y]}],ease:[{ease:["linear","initial",m,Z,Y]}],delay:[{delay:[Ge,Z,Y]}],animate:[{animate:["none",A,Z,Y]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,Z,Y]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:X()}],"rotate-x":[{"rotate-x":X()}],"rotate-y":[{"rotate-y":X()}],"rotate-z":[{"rotate-z":X()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":["scale-3d"],skew:[{skew:et()}],"skew-x":[{"skew-x":et()}],"skew-y":[{"skew-y":et()}],transform:[{transform:[Z,Y,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:J()}],"translate-x":[{"translate-x":J()}],"translate-y":[{"translate-y":J()}],"translate-z":[{"translate-z":J()}],"translate-none":["translate-none"],zoom:[{zoom:[Ft,Z,Y]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Z,Y]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mbs":[{"scroll-mbs":x()}],"scroll-mbe":[{"scroll-mbe":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pbs":[{"scroll-pbs":x()}],"scroll-pbe":[{"scroll-pbe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Z,Y]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[Ge,Yr,mr,Es]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Sh=(r,{extend:e={},override:t={}})=>(Rn(r.theme,t.theme),Rn(r.classGroups,t.classGroups),Rn(r.conflictingClassGroups,t.conflictingClassGroups),Rn(r.conflictingClassGroupModifiers,t.conflictingClassGroupModifiers),lo(r,"postfixLookupClassGroups",t.postfixLookupClassGroups),lo(r,"orderSensitiveModifiers",t.orderSensitiveModifiers),On(r.theme,e.theme),On(r.classGroups,e.classGroups),On(r.conflictingClassGroups,e.conflictingClassGroups),On(r.conflictingClassGroupModifiers,e.conflictingClassGroupModifiers),uo(r,e,"postfixLookupClassGroups"),uo(r,e,"orderSensitiveModifiers"),r),lo=(r,e,t)=>{t!==void 0&&(r[e]=t)},Rn=(r,e)=>{if(e)for(const t in e)lo(r,t,e[t])},On=(r,e)=>{if(e)for(const t in e)uo(r,e,t)},uo=(r,e,t)=>{const n=e[t];n!==void 0&&(r[t]=r[t]?r[t].concat(n):n)},ac=r=>ks(r?typeof r=="function"?()=>r(Gi()):()=>Sh(Gi(),r):Gi),Ch=r=>{if(zt(r))return;const e=r,t={...e.extend??{}};for(const i of["theme","classGroups","conflictingClassGroups","conflictingClassGroupModifiers","postfixLookupClassGroups","orderSensitiveModifiers","cacheSize","prefix","separator","experimentalParseClassName"])e[i]!==void 0&&t[i]===void 0&&(t[i]=e[i]);const n={};if(Object.keys(t).length>0&&(n.extend=t),e.override!=null&&!zt(e.override)&&(n.override=e.override),!(!n.extend&&!n.override))return n},Ah=r=>{const e=Ch(r),t=ac(e);return n=>t.mergeString(n)},Fn,$h=()=>(Fn||(Fn=ac()),Fn),Dh=()=>((!Ct.cachedTwMerge||Ct.didTwMergeConfigChange)&&(Ct.didTwMergeConfigChange=!1,Ct.cachedTwMerge=Ah(Ct.cachedTwMergeConfig)),Ct.cachedTwMerge),Ih=r=>{const e=r==null?void 0:r.twMergeConfig;!e||zt(e)||za(e,Ct.cachedTwMergeConfig)||(Ct.cachedTwMergeConfig=e,Ct.didTwMergeConfigChange=!0)},Lh=r=>ei(r),Th=Ct.reset.bind(Ct);Ct.reset=()=>{Fn=void 0,Th()};var Gh=(r,e)=>{const t=Lh(r);return!t||!((e==null?void 0:e.twMerge)??!0)?t||void 0:t.indexOf(" ")===-1?t:(Ih(e),(!!(e!=null&&e.twMergeConfig&&!zt(e.twMergeConfig))?Dh():$h().mergeString)(t)||void 0)},Rh=(r,...e)=>Gh(e,r),Oh=Df(Rh),Mh=Oh.tv;function zh(r){const e=r==="muted"?"ink-muted":r;return e==="current"?"currentColor":`var(--reddb-color-${e})`}function Nh(r){return`var(--reddb-spatial-icon-size-${r})`}var Ph=At('<svg><path d="M4 5h16"></path><path d="M4 12h16"></path><path d="M4 19h16"></path></svg>');function Uh(r,e){Zn(e,!0);let t=Gt(e,"size",3,"md"),n=Gt(e,"color",3,"foreground"),i=Ze(e,["$$slots","$$events","$$legacy","icon","size","color","class"]);const o=Q(()=>Nh(t())),a=Q(()=>zh(n())),s=Q(()=>e.icon);Zt(()=>{n()});var c=er(),l=lt(c);{var d=h=>{var g=Ph();Vn(g,()=>({...i,"data-icon":!0,width:u(o),height:u(o),viewBox:"0 0 24 24",fill:"none",stroke:u(a),"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:e.class})),V(h,g)},f=h=>{var g=er(),y=lt(g);uu(y,()=>u(s),(C,b)=>{b(C,it(()=>i,{"data-icon":!0,get size(){return u(o)},get color(){return u(a)},strokeWidth:2,get class(){return e.class}}))}),V(h,g)};xe(l,h=>{e.icon==="menu"?h(d):h(f,-1)})}V(r,c),Qn()}const Wh={sm:{root:"gap-[var(--reddb-spatial-gap-md)] px-[var(--reddb-spatial-inset-md)] py-[var(--reddb-spatial-inset-lg)]",title:"text-sm",description:"text-xs",hint:"text-xs"},md:{root:"gap-[var(--reddb-spatial-gap-lg)] px-[var(--reddb-spatial-inset-lg)] py-10",title:"text-base",description:"text-sm",hint:"text-xs"}},jh={true:{root:"border-dashed border-muted"},false:{root:"border-transparent"}},Bh=Mh({slots:{root:"flex flex-col items-center justify-center rounded-lg border text-center",media:"text-ink-muted",title:"font-medium leading-tight text-foreground",description:"max-w-prose text-ink-muted",hint:"max-w-full rounded-md border border-muted px-2 py-1 font-mono text-ink-muted",actions:"flex flex-wrap items-center justify-center gap-[var(--reddb-spatial-gap-md)] pt-1"},variants:{size:Wh,bordered:jh},defaultVariants:{size:"md",bordered:!0}});var Fh=he('<div aria-hidden="true"><!></div>'),Vh=he("<p> </p>"),Kh=he("<code> </code>"),Hh=he("<div><!></div>"),qh=he("<div><!> <p> </p> <!> <!> <!></div>");function Yh(r,e){Zn(e,!0);const t=Gt(e,"size",3,"md"),n=Gt(e,"bordered",3,!0),i=Ze(e,["$$slots","$$events","$$legacy","title","description","hint","size","bordered","media","actions","class"]),o=Q(()=>Bh({size:t(),bordered:n()}));var a=qh();Vn(a,m=>({...i,class:m}),[()=>u(o).root({class:e.class})]);var s=R(a);{var c=m=>{var A=Fh(),v=R(A);ro(v,()=>e.media),T(A),pe(p=>Et(A,1,p),[()=>Dt(u(o).media())]),V(m,A)};xe(s,m=>{e.media&&m(c)})}var l=N(s,2),d=R(l,!0);T(l);var f=N(l,2);{var h=m=>{var A=Vh(),v=R(A,!0);T(A),pe(p=>{Et(A,1,p),fe(v,e.description)},[()=>Dt(u(o).description())]),V(m,A)};xe(f,m=>{e.description&&m(h)})}var g=N(f,2);{var y=m=>{var A=Kh(),v=R(A,!0);T(A),pe(p=>{Et(A,1,p),fe(v,e.hint)},[()=>Dt(u(o).hint())]),V(m,A)};xe(g,m=>{e.hint&&m(y)})}var C=N(g,2);{var b=m=>{var A=Hh(),v=R(A);ro(v,()=>e.actions),T(A),pe(p=>Et(A,1,p),[()=>Dt(u(o).actions())]),V(m,A)};xe(C,m=>{e.actions&&m(b)})}T(a),pe(m=>{Et(l,1,m),fe(d,e.title)},[()=>Dt(u(o).title())]),V(r,a),Qn()}const Xh="red-ui:history",Jh="history:";function cc(r,e=!1){switch(r){case"embedded":return"none";case"standalone":return"vault";case"web":return e?"none":"labels-only"}}function Zh(r){if(r.url)try{const t=new URL(r.url).host;if(t)return t}catch{}const e=(r.label??r.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 Qh(){return typeof localStorage>"u"?void 0:localStorage}function As(r){return`label:${encodeURIComponent(r)}`}function ep(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2)+Date.now().toString(36)}function Xr(r,e){if(!r)return[];try{const t=r.getItem(e);if(!t)return[];const n=JSON.parse(t);return Array.isArray(n)?n.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 $s(r,e,t){if(r)try{r.setItem(e,JSON.stringify(t))}catch{}}class tp{constructor(e){Te(this,"surface");Te(this,"secureStore");Te(this,"managedWebTarget");Te(this,"storage");Te(this,"historyKey");Te(this,"urlPrefix");Te(this,"idByUrl",new Map);Te(this,"urlById",new Map);Te(this,"onChange");this.surface=e.surface,this.secureStore=e.secureStore,this.managedWebTarget=e.managedWebTarget??(()=>!1),this.storage=e.storage??Qh(),this.historyKey=e.historyKey??Xh,this.urlPrefix=e.urlPrefix??Jh}setOnChange(e){this.onChange=e}persistence(){return cc(this.surface(),this.managedWebTarget())}load(){return this.persistence()==="none"?[]:Xr(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 c,l,d;const t=this.persistence();if(t==="none"){(c=this.onChange)==null||c.call(this);return}const n=Xr(this.storage,this.historyKey),i=new Map(n.map(f=>[f.label,f])),o=[],a=new Set,s=new Set;for(const f of e){const h=Zh(f);if(!h)continue;let g;f.url?(g=t==="labels-only"?As(h):this.idByUrl.get(f.url)??ep(),this.idByUrl.set(f.url,g),this.urlById.set(g,f.url)):g=((l=i.get(h))==null?void 0:l.id)??As(h),!(a.has(g)||!f.url&&s.has(h))&&(a.add(g),s.add(h),o.push({id:g,label:h,last_used:typeof f.last_used=="number"?f.last_used:Date.now(),rtt_ms:f.rtt_ms}))}if($s(this.storage,this.historyKey,o),t==="vault"){const f=this.secureStore();if(f)for(const h of o){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"?[]:Xr(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=Xr(this.storage,this.historyKey);let n=!1;for(const o of t)if(!this.urlById.has(o.id))try{const a=await e.get(this.urlPrefix+o.id);a&&(this.urlById.set(o.id,a),this.idByUrl.set(a,o.id),n=!0)}catch{}n&&((i=this.onChange)==null||i.call(this))}async forgetById(e){var o,a;if(this.persistence()==="none"){(o=this.onChange)==null||o.call(this);return}const t=Xr(this.storage,this.historyKey).filter(s=>s.id!==e);$s(this.storage,this.historyKey,t);const n=this.urlById.get(e);n&&(this.urlById.delete(e),this.idByUrl.delete(n));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 rp({tauri:r,inFrame:e,mcp:t,embedLib:n}){return r?"standalone":e||t||n?"embedded":"web"}function np(){if(typeof window>"u")return"web";const r="__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"),n=window.__RED_UI_EMBED_SURFACE__===!0;return rp({tauri:r,inFrame:e,mcp:t,embedLib:n})}function Ri(r,e){switch(r){case"embedded":return!1;case"standalone":return!0;case"web":return!1}}const fo="red-ui:secure",Ds="__probe__",Is="ok";function Ls(){if(typeof localStorage>"u")return!1;for(let r=0;r<localStorage.length;r++){const e=localStorage.key(r);if(e&&e.startsWith(fo+":"))return!0}return!1}var fn,hn,pn,gn,mn,vn;class ip{constructor(){nt(this,fn,ke(null));nt(this,hn,ke(!0));nt(this,pn,ke(!1));nt(this,gn,ke("unknown"));nt(this,mn,ke("web"));nt(this,vn,ke(null));if(typeof window>"u"){this.backend="unknown";return}if(this.surface=np(),this.surface==="standalone"){this.backend="tauri",this.bindTauri();return}this.backend="web",Ls(),this.needsSetup=!1,this.locked=Ri(this.surface)}get store(){return u(Se(this,fn))}set store(e){P(Se(this,fn),e,!0)}get locked(){return u(Se(this,hn))}set locked(e){P(Se(this,hn),e,!0)}get needsSetup(){return u(Se(this,pn))}set needsSetup(e){P(Se(this,pn),e,!0)}get backend(){return u(Se(this,gn))}set backend(e){P(Se(this,gn),e,!0)}get surface(){return u(Se(this,mn))}set surface(e){P(Se(this,mn),e,!0)}get error(){return u(Se(this,vn))}set error(e){P(Se(this,vn),e,!0)}async bindTauri(){try{const e=await fr(()=>import("./DhEqZVGG.js"),[],import.meta.url);this.store=new Bd({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 Wd(e,{namespace:fo})}catch(n){return this.error=n.message,!1}try{const n=await t.get(Ds);if(n===null)await t.put(Ds,Is);else if(n!==Is)return this.error="Wrong password",!1}catch(n){return n instanceof wt&&n.code==="DECRYPT_FAILED"?(this.error="Wrong password",!1):(this.error=n.message,!1)}return this.store=t,this.locked=!1,this.needsSetup=!1,!0}lock(){this.store=null,this.backend==="web"&&(this.locked=Ri(this.surface,Ls()))}wipe(){if(typeof localStorage>"u")return;const e=[];for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);n&&(n.startsWith(fo+":")||n.startsWith("red-ui:"))&&e.push(n)}for(const t of e)localStorage.removeItem(t);this.store=null,this.backend==="web"&&(this.locked=Ri(this.surface),this.needsSetup=!1),this.error=null}}fn=new WeakMap,hn=new WeakMap,pn=new WeakMap,gn=new WeakMap,mn=new WeakMap,vn=new WeakMap;const nn=new ip,lc=[{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."}],Ts=Ra;function Gs(r){if(typeof localStorage>"u")return;if(ap()!=="vault"){try{localStorage.removeItem(Ts)}catch{}return}try{localStorage.setItem(Ts,JSON.stringify(r))}catch{}}const op=/(handoff|token|secret|password|passwd|auth|credential|api[-_]?key|bearer)/i;let ko=!1;function sp(){nn.surface==="web"&&(ko=!0)}function uc(){if(ko)return!0;if(nn.surface!=="web"||typeof location>"u")return!1;for(const r of[location.search,location.hash]){const e=new URLSearchParams(r.startsWith("#")?r.slice(1):r);for(const t of e.keys())if(op.test(t))return!0}return!1}function ap(){return cc(nn.surface,uc())}const vr=new tp({surface:()=>nn.surface,secureStore:()=>nn.store,managedWebTarget:uc});function cp(r){return lp(r).url}function lp(r){let e=r.trim().replace(/\/$/,"");if(!e)return{url:e};/:\/\//.test(e)||(e="http://"+e);const t=e.slice(0,e.indexOf(":")).toLowerCase(),n=["red","red+tcp","red+wire","reds","red+tls"].includes(t);if(!n&&t!=="http"&&t!=="https")return{url:e};try{const i=t==="reds"||t==="red+tls"?"https":"http",o=new URL(n?e.replace(/^[^:]+:/,`${i}:`):e);let a;if(o.username||o.password){if(!o.username||!o.password)throw new Error;a={username:decodeURIComponent(o.username),password:decodeURIComponent(o.password)},o.username="",o.password=""}return n&&(o.port="5055"),{url:o.href.replace(/\/$/,""),...a?{credentials:a}:{}}}catch{throw new Error("Invalid connection string. Check the address and provide both username and password.")}}function ho(r){const e=cp(r);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 ti(){return typeof window<"u"&&("__TAURI_INTERNALS__"in window||"__TAURI__"in window)}function up(){return[...ti()?pd:vo]}async function dp(r){if(!ti())throw new Error("file:// databases can only be opened in the desktop app");const e=r.replace(/^file:\/\//i,""),{invoke:t}=await fr(async()=>{const{invoke:n}=await import("./DhEqZVGG.js");return{invoke:n}},[],import.meta.url);try{return await t("open_embedded",{path:e})}catch(n){throw Kn.from(n)}}const dc=async(r,e)=>{const t=typeof r=="string"?r:r instanceof URL?r.href:r.url,n=/^https?:\/\/(127\.0\.0\.1|localhost|\[::1\])(:\d+)?(\/|$)/i.test(t);if(ti()&&n)try{const{fetch:i}=await fr(async()=>{const{fetch:o}=await import("./B5euRbKa.js");return{fetch:o}},__vite__mapDeps([0,1]),import.meta.url);return await i(r,e)}catch(i){const o=i instanceof Error?i.message:typeof i=="string"?i:String(i);throw new Error(`rust-side fetch failed for ${t}: ${o}`)}return fetch(r,e)};function Rs(r){return typeof r.useHandoffToken=="function"}const fp=new Cd({presets:lc,history:vr,transports:up(),embeddedResolver:dp,clientFactory:(r,e)=>new mo(r,{...e,fetch:dc}),bootParams:_d(typeof location<"u"?location.search:"",typeof location<"u"?location.hash:"")});let fc=fp;function Tr(){return fc}function Xv(r){fc=r}var yn,bn,wn,_n,dr,Mr,zr;class hp{constructor(){nt(this,yn,ke(!1));nt(this,bn,ke(Kt(lc[1])));nt(this,wn,ke(Kt({reachable:!1})));nt(this,_n,ke(Kt([])));nt(this,dr,ke(null));nt(this,Mr,ke(Kt({...Or})));nt(this,zr,ke(!1));this.history=vr.uiEntries(),vr.setOnChange(()=>{this.history=vr.uiEntries()})}get connected(){return u(Se(this,yn))}set connected(e){P(Se(this,yn),e,!0)}get active(){return u(Se(this,bn))}set active(e){P(Se(this,bn),e,!0)}get probe(){return u(Se(this,wn))}set probe(e){P(Se(this,wn),e,!0)}get history(){return u(Se(this,_n))}set history(e){P(Se(this,_n),e,!0)}get targetResolved(){return u(Se(this,zr))}get client(){return u(Se(this,dr))}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 u(Se(this,Mr))}get supportedTransports(){var e,t;return((t=(e=Tr()).transports)==null?void 0:t.call(e))??[...vo]}canReach(e){return gd(e,this.supportedTransports)}async forget(e){await vr.forgetByUrl(e)}async forgetById(e){await vr.forgetById(e)}async hydrateUrls(){await vr.hydrate()}async bootstrap(e=zd){const t=await e(),n=t.route??null;if(!t.target)return n;const i=ho(t.target);if(t.token){sp();const o=Tr();Rs(o)&&o.useHandoffToken(i.url,t.token)}return await this.tryConnect(i),n}async switch(e){this.active=e,Gs(e),await this.tryConnect(e)}async login(e,t,n){this.active=e,P(Se(this,dr),null),this.connected=!1,this.probe={reachable:!1};try{const i=Tr();if(!Rs(i))throw new Error("This connection is managed by its host.");const o=await new mo(e.url,{fetch:dc}).login(t,n);return i.useHandoffToken(e.url,o),await this.tryConnect(e)}catch(i){return this.probe={reachable:!1,error:i instanceof Error?i.message:"Database sign-in failed."},!1}}async tryConnect(e){this.active=e,P(Se(this,dr),null),this.connected=!1,P(Se(this,zr),!0),qr.begin(`Opening ${e.label}`);try{qr.step("Reaching server",e.url);const t=await lr.track(`connect · ${e.label}`,()=>Tr().connect(e.id));P(Se(this,dr),t.client,!0),this.active={...e,...t.connection,description:e.description},Gs(this.active),qr.step("Fetching stats & capabilities");const[n,i,o]=await Promise.all([lr.track(`connect · ${e.label} stats`,()=>t.client.stats()).catch(()=>{}),lr.track(`connect · ${e.label} replication`,()=>t.client.replication()).catch(()=>{}),lr.track(`connect · ${e.label} capabilities`,()=>t.client.capabilities()).catch(()=>({...Or}))]);return this.probe={reachable:!0,rtt_ms:t.rtt_ms,stats:n,replication:i},P(Se(this,Mr),o,!0),this.connected=!0,qr.succeed(),!0}catch(t){return this.probe={reachable:!1,error:t.message},qr.fail(t.message),!1}}async adoptInjected(){const[e]=await Tr().list();if(!e)return!1;const t={...e,description:e.description??"Injected by the embedding host."};return this.tryConnect(t)}async connectFromBootParams(){var n,i;const e=(i=(n=Tr()).bootParams)==null?void 0:i.call(n);if(!e)return null;const t=e.to??e.view??null;return e.endpoint&&await this.tryConnect(ho(e.endpoint)),t}async refresh(){const e=this.client;if(!e){await this.tryConnect(this.active);return}try{const t=await lr.track(`heartbeat · ${this.active.label}`,()=>e.ping());if(!t.ok){this.probe={reachable:!1,error:t.error};return}const[n,i]=await Promise.all([lr.track("heartbeat · stats",()=>e.stats()).catch(()=>{}),lr.track("heartbeat · replication",()=>e.replication()).catch(()=>{})]);this.probe={reachable:!0,rtt_ms:t.rtt_ms,stats:n,replication:i},this.connected=!0}catch(t){this.probe={reachable:!1,error:t.message}}}disconnect(){this.connected=!1,this.probe={reachable:!1},P(Se(this,dr),null),P(Se(this,Mr),{...Or},!0),P(Se(this,zr),!1),ko=!1}}yn=new WeakMap,bn=new WeakMap,wn=new WeakMap,_n=new WeakMap,dr=new WeakMap,Mr=new WeakMap,zr=new WeakMap;const qn=new hp,hc="Local database files (file://) can only be opened in the desktop app — the web version can't reach files on your machine.";function Jv(r){return qn.canReach(r)?null:Aa(r)==="unix"?hc:null}async function Zv(r){if(!ti())return{ok:!1,reason:hc};const e=(await fr(async()=>{const{open:i}=await import("./C-kqMbRi.js");return{open:i}},__vite__mapDeps([2,1]),import.meta.url)).open,t=await e({multiple:!1,directory:!1,title:"Open database file",filters:[{name:"reddb database",extensions:["rdb"]}]});return t?await qn.tryConnect(ho(`file://${t}`))?{ok:!0}:{ok:!1,reason:qn.probe.error??"unreachable"}:{ok:!1,cancelled:!0}}const pc={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]],aliases:["loader-2"]};pc.node;function pp(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return pc}}))}const gc={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]]};gc.node;function gp(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return gc}}))}const mc={name:"network",size:24,node:[["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"}]]};mc.node;function Os(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return mc}}))}function Qv(r){return r?r==="graph"?"graph":r:"table"}function ey(r,e){switch(r){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 r;default:return e}}function Oi(r,e){return`/c/${encodeURIComponent(r)}/p/${encodeURIComponent(e)}`}const vc={name:"triangle-alert",size:24,node:[["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"}]],aliases:["alert-triangle"]};vc.node;function Ms(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return vc}}))}const yc={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"}]]};yc.node;function mp(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return yc}}))}const bc={name:"rotate-cw",size:24,node:[["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"}]]};bc.node;function vp(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return bc}}))}function Eo(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Mn={exports:{}},zs;function yp(){if(zs)return Mn.exports;zs=1;var r=typeof Reflect=="object"?Reflect:null,e=r&&typeof r.apply=="function"?r.apply:function(E,S,$){return Function.prototype.apply.call(E,S,$)},t;r&&typeof r.ownKeys=="function"?t=r.ownKeys:Object.getOwnPropertySymbols?t=function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:t=function(E){return Object.getOwnPropertyNames(E)};function n(p){console&&console.warn&&console.warn(p)}var i=Number.isNaN||function(E){return E!==E};function o(){o.init.call(this)}Mn.exports=o,Mn.exports.once=m,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(p){if(typeof p!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof p)}Object.defineProperty(o,"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}}),o.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},o.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||i(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this};function c(p){return p._maxListeners===void 0?o.defaultMaxListeners:p._maxListeners}o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(E){for(var S=[],$=1;$<arguments.length;$++)S.push(arguments[$]);var x=E==="error",D=this._events;if(D!==void 0)x=x&&D.error===void 0;else if(!x)return!1;if(x){var I;if(S.length>0&&(I=S[0]),I instanceof Error)throw I;var j=new Error("Unhandled error."+(I?" ("+I.message+")":""));throw j.context=I,j}var O=D[E];if(O===void 0)return!1;if(typeof O=="function")e(O,this,S);else for(var w=O.length,ge=y(O,w),$=0;$<w;++$)e(ge[$],this,S);return!0};function l(p,E,S,$){var x,D,I;if(s(S),D=p._events,D===void 0?(D=p._events=Object.create(null),p._eventsCount=0):(D.newListener!==void 0&&(p.emit("newListener",E,S.listener?S.listener:S),D=p._events),I=D[E]),I===void 0)I=D[E]=S,++p._eventsCount;else if(typeof I=="function"?I=D[E]=$?[S,I]:[I,S]:$?I.unshift(S):I.push(S),x=c(p),x>0&&I.length>x&&!I.warned){I.warned=!0;var j=new Error("Possible EventEmitter memory leak detected. "+I.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");j.name="MaxListenersExceededWarning",j.emitter=p,j.type=E,j.count=I.length,n(j)}return p}o.prototype.addListener=function(E,S){return l(this,E,S,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(E,S){return l(this,E,S,!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,E,S){var $={fired:!1,wrapFn:void 0,target:p,type:E,listener:S},x=d.bind($);return x.listener=S,$.wrapFn=x,x}o.prototype.once=function(E,S){return s(S),this.on(E,f(this,E,S)),this},o.prototype.prependOnceListener=function(E,S){return s(S),this.prependListener(E,f(this,E,S)),this},o.prototype.removeListener=function(E,S){var $,x,D,I,j;if(s(S),x=this._events,x===void 0)return this;if($=x[E],$===void 0)return this;if($===S||$.listener===S)--this._eventsCount===0?this._events=Object.create(null):(delete x[E],x.removeListener&&this.emit("removeListener",E,$.listener||S));else if(typeof $!="function"){for(D=-1,I=$.length-1;I>=0;I--)if($[I]===S||$[I].listener===S){j=$[I].listener,D=I;break}if(D<0)return this;D===0?$.shift():C($,D),$.length===1&&(x[E]=$[0]),x.removeListener!==void 0&&this.emit("removeListener",E,j||S)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(E){var S,$,x;if($=this._events,$===void 0)return this;if($.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):$[E]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete $[E]),this;if(arguments.length===0){var D=Object.keys($),I;for(x=0;x<D.length;++x)I=D[x],I!=="removeListener"&&this.removeAllListeners(I);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(S=$[E],typeof S=="function")this.removeListener(E,S);else if(S!==void 0)for(x=S.length-1;x>=0;x--)this.removeListener(E,S[x]);return this};function h(p,E,S){var $=p._events;if($===void 0)return[];var x=$[E];return x===void 0?[]:typeof x=="function"?S?[x.listener||x]:[x]:S?b(x):y(x,x.length)}o.prototype.listeners=function(E){return h(this,E,!0)},o.prototype.rawListeners=function(E){return h(this,E,!1)},o.listenerCount=function(p,E){return typeof p.listenerCount=="function"?p.listenerCount(E):g.call(p,E)},o.prototype.listenerCount=g;function g(p){var E=this._events;if(E!==void 0){var S=E[p];if(typeof S=="function")return 1;if(S!==void 0)return S.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function y(p,E){for(var S=new Array(E),$=0;$<E;++$)S[$]=p[$];return S}function C(p,E){for(;E+1<p.length;E++)p[E]=p[E+1];p.pop()}function b(p){for(var E=new Array(p.length),S=0;S<E.length;++S)E[S]=p[S].listener||p[S];return E}function m(p,E){return new Promise(function(S,$){function x(I){p.removeListener(E,D),$(I)}function D(){typeof p.removeListener=="function"&&p.removeListener("error",x),S([].slice.call(arguments))}v(p,E,D,{once:!0}),E!=="error"&&A(p,x,{once:!0})})}function A(p,E,S){typeof p.on=="function"&&v(p,"error",E,S)}function v(p,E,S,$){if(typeof p.on=="function")$.once?p.once(E,S):p.on(E,S);else if(typeof p.addEventListener=="function")p.addEventListener(E,function x(D){$.once&&p.removeEventListener(E,x),S(D)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof p)}return Mn.exports}var bp=yp();function wp(){const r=arguments[0];for(let e=1,t=arguments.length;e<t;e++)if(arguments[e])for(const n in arguments[e])r[n]=arguments[e][n];return r}let ut=wp;typeof Object.assign=="function"&&(ut=Object.assign);function Nt(r,e,t,n){const i=r._nodes.get(e);let o=null;return i&&(n==="mixed"?o=i.out&&i.out[t]||i.undirected&&i.undirected[t]:n==="directed"?o=i.out&&i.out[t]:o=i.undirected&&i.undirected[t]),o}function mt(r){return typeof r=="object"&&r!==null}function wc(r){let e;for(e in r)return!1;return!0}function Mt(r,e,t){Object.defineProperty(r,e,{enumerable:!1,configurable:!1,writable:!0,value:t})}function Wt(r,e,t){const n={enumerable:!0,configurable:!0};typeof t=="function"?n.get=t:(n.value=t,n.writable=!1),Object.defineProperty(r,e,n)}function Ns(r){return!(!mt(r)||r.attributes&&!Array.isArray(r.attributes))}function _p(){let r=Math.floor(Math.random()*256)&255;return()=>r++}function tr(){const r=arguments;let e=null,t=-1;return{[Symbol.iterator](){return this},next(){let n=null;do{if(e===null){if(t++,t>=r.length)return{done:!0};e=r[t][Symbol.iterator]()}if(n=e.next(),n.done){e=null;continue}break}while(!0);return n}}}function Ur(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class So extends Error{constructor(e){super(),this.name="GraphError",this.message=e}}class q extends So{constructor(e){super(e),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,q.prototype.constructor)}}class B extends So{constructor(e){super(e),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,B.prototype.constructor)}}class ue extends So{constructor(e){super(e),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ue.prototype.constructor)}}function _c(r,e){this.key=r,this.attributes=e,this.clear()}_c.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 xc(r,e){this.key=r,this.attributes=e,this.clear()}xc.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function kc(r,e){this.key=r,this.attributes=e,this.clear()}kc.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Wr(r,e,t,n,i){this.key=e,this.attributes=i,this.undirected=r,this.source=t,this.target=n}Wr.prototype.attach=function(){let r="out",e="in";this.undirected&&(r=e="undirected");const t=this.source.key,n=this.target.key;this.source[r][n]=this,!(this.undirected&&t===n)&&(this.target[e][t]=this)};Wr.prototype.attachMulti=function(){let r="out",e="in";const t=this.source.key,n=this.target.key;this.undirected&&(r=e="undirected");const i=this.source[r],o=i[n];if(typeof o>"u"){i[n]=this,this.undirected&&t===n||(this.target[e][t]=this);return}o.previous=this,this.next=o,i[n]=this,this.target[e][t]=this};Wr.prototype.detach=function(){const r=this.source.key,e=this.target.key;let t="out",n="in";this.undirected&&(t=n="undirected"),delete this.source[t][e],delete this.target[n][r]};Wr.prototype.detachMulti=function(){const r=this.source.key,e=this.target.key;let t="out",n="in";this.undirected&&(t=n="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[t][e],delete this.target[n][r]):(this.next.previous=void 0,this.source[t][e]=this.next,this.target[n][r]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const Ec=0,Sc=1,xp=2,Cc=3;function rr(r,e,t,n,i,o,a){let s,c,l,d;if(n=""+n,t===Ec){if(s=r._nodes.get(n),!s)throw new B(`Graph.${e}: could not find the "${n}" node in the graph.`);l=i,d=o}else if(t===Cc){if(i=""+i,c=r._edges.get(i),!c)throw new B(`Graph.${e}: could not find the "${i}" edge in the graph.`);const f=c.source.key,h=c.target.key;if(n===f)s=c.target;else if(n===h)s=c.source;else throw new B(`Graph.${e}: the "${n}" node is not attached to the "${i}" edge (${f}, ${h}).`);l=o,d=a}else{if(c=r._edges.get(n),!c)throw new B(`Graph.${e}: could not find the "${n}" edge in the graph.`);t===Sc?s=c.source:s=c.target,l=i,d=o}return[s,l,d]}function kp(r,e,t){r.prototype[e]=function(n,i,o){const[a,s]=rr(this,e,t,n,i,o);return a.attributes[s]}}function Ep(r,e,t){r.prototype[e]=function(n,i){const[o]=rr(this,e,t,n,i);return o.attributes}}function Sp(r,e,t){r.prototype[e]=function(n,i,o){const[a,s]=rr(this,e,t,n,i,o);return a.attributes.hasOwnProperty(s)}}function Cp(r,e,t){r.prototype[e]=function(n,i,o,a){const[s,c,l]=rr(this,e,t,n,i,o,a);return s.attributes[c]=l,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:c}),this}}function Ap(r,e,t){r.prototype[e]=function(n,i,o,a){const[s,c,l]=rr(this,e,t,n,i,o,a);if(typeof l!="function")throw new q(`Graph.${e}: updater should be a function.`);const d=s.attributes,f=l(d[c]);return d[c]=f,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:c}),this}}function $p(r,e,t){r.prototype[e]=function(n,i,o){const[a,s]=rr(this,e,t,n,i,o);return delete a.attributes[s],this.emit("nodeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:s}),this}}function Dp(r,e,t){r.prototype[e]=function(n,i,o){const[a,s]=rr(this,e,t,n,i,o);if(!mt(s))throw new q(`Graph.${e}: provided attributes are not a plain object.`);return a.attributes=s,this.emit("nodeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}function Ip(r,e,t){r.prototype[e]=function(n,i,o){const[a,s]=rr(this,e,t,n,i,o);if(!mt(s))throw new q(`Graph.${e}: provided attributes are not a plain object.`);return ut(a.attributes,s),this.emit("nodeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:s}),this}}function Lp(r,e,t){r.prototype[e]=function(n,i,o){const[a,s]=rr(this,e,t,n,i,o);if(typeof s!="function")throw new q(`Graph.${e}: provided updater is not a function.`);return a.attributes=s(a.attributes),this.emit("nodeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}const Tp=[{name:r=>`get${r}Attribute`,attacher:kp},{name:r=>`get${r}Attributes`,attacher:Ep},{name:r=>`has${r}Attribute`,attacher:Sp},{name:r=>`set${r}Attribute`,attacher:Cp},{name:r=>`update${r}Attribute`,attacher:Ap},{name:r=>`remove${r}Attribute`,attacher:$p},{name:r=>`replace${r}Attributes`,attacher:Dp},{name:r=>`merge${r}Attributes`,attacher:Ip},{name:r=>`update${r}Attributes`,attacher:Lp}];function Gp(r){Tp.forEach(function({name:e,attacher:t}){t(r,e("Node"),Ec),t(r,e("Source"),Sc),t(r,e("Target"),xp),t(r,e("Opposite"),Cc)})}function Rp(r,e,t){r.prototype[e]=function(n,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ue(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ue(`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=""+n,s=""+i;if(i=arguments[2],o=Nt(this,a,s,t),!o)throw new B(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new ue(`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(n=""+n,o=this._edges.get(n),!o)throw new B(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return o.attributes[i]}}function Op(r,e,t){r.prototype[e]=function(n){let i;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ue(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new ue(`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=""+n,a=""+arguments[1];if(i=Nt(this,o,a,t),!i)throw new B(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(t!=="mixed")throw new ue(`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(n=""+n,i=this._edges.get(n),!i)throw new B(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return i.attributes}}function Mp(r,e,t){r.prototype[e]=function(n,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ue(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ue(`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=""+n,s=""+i;if(i=arguments[2],o=Nt(this,a,s,t),!o)throw new B(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new ue(`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(n=""+n,o=this._edges.get(n),!o)throw new B(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return o.attributes.hasOwnProperty(i)}}function zp(r,e,t){r.prototype[e]=function(n,i,o){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ue(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new ue(`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=""+n,c=""+i;if(i=arguments[2],o=arguments[3],a=Nt(this,s,c,t),!a)throw new B(`Graph.${e}: could not find an edge for the given path ("${s}" - "${c}").`)}else{if(t!=="mixed")throw new ue(`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(n=""+n,a=this._edges.get(n),!a)throw new B(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return a.attributes[i]=o,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:i}),this}}function Np(r,e,t){r.prototype[e]=function(n,i,o){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ue(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new ue(`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=""+n,c=""+i;if(i=arguments[2],o=arguments[3],a=Nt(this,s,c,t),!a)throw new B(`Graph.${e}: could not find an edge for the given path ("${s}" - "${c}").`)}else{if(t!=="mixed")throw new ue(`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(n=""+n,a=this._edges.get(n),!a)throw new B(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(typeof o!="function")throw new q(`Graph.${e}: updater should be a function.`);return a.attributes[i]=o(a.attributes[i]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:i}),this}}function Pp(r,e,t){r.prototype[e]=function(n,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ue(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ue(`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=""+n,s=""+i;if(i=arguments[2],o=Nt(this,a,s,t),!o)throw new B(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new ue(`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(n=""+n,o=this._edges.get(n),!o)throw new B(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return delete o.attributes[i],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:i}),this}}function Up(r,e,t){r.prototype[e]=function(n,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ue(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ue(`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=""+n,s=""+i;if(i=arguments[2],o=Nt(this,a,s,t),!o)throw new B(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new ue(`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(n=""+n,o=this._edges.get(n),!o)throw new B(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(!mt(i))throw new q(`Graph.${e}: provided attributes are not a plain object.`);return o.attributes=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function Wp(r,e,t){r.prototype[e]=function(n,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ue(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ue(`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=""+n,s=""+i;if(i=arguments[2],o=Nt(this,a,s,t),!o)throw new B(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new ue(`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(n=""+n,o=this._edges.get(n),!o)throw new B(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(!mt(i))throw new q(`Graph.${e}: provided attributes are not a plain object.`);return ut(o.attributes,i),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:i}),this}}function jp(r,e,t){r.prototype[e]=function(n,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ue(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ue(`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=""+n,s=""+i;if(i=arguments[2],o=Nt(this,a,s,t),!o)throw new B(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new ue(`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(n=""+n,o=this._edges.get(n),!o)throw new B(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(typeof i!="function")throw new q(`Graph.${e}: provided updater is not a function.`);return o.attributes=i(o.attributes),this.emit("edgeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}const Bp=[{name:r=>`get${r}Attribute`,attacher:Rp},{name:r=>`get${r}Attributes`,attacher:Op},{name:r=>`has${r}Attribute`,attacher:Mp},{name:r=>`set${r}Attribute`,attacher:zp},{name:r=>`update${r}Attribute`,attacher:Np},{name:r=>`remove${r}Attribute`,attacher:Pp},{name:r=>`replace${r}Attributes`,attacher:Up},{name:r=>`merge${r}Attributes`,attacher:Wp},{name:r=>`update${r}Attributes`,attacher:jp}];function Fp(r){Bp.forEach(function({name:e,attacher:t}){t(r,e("Edge"),"mixed"),t(r,e("DirectedEdge"),"directed"),t(r,e("UndirectedEdge"),"undirected")})}const Vp=[{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 Kp(r,e,t,n){let i=!1;for(const o in e){if(o===n)continue;const a=e[o];if(i=t(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),r&&i)return a.key}}function Hp(r,e,t,n){let i,o,a,s=!1;for(const c in e)if(c!==n){i=e[c];do{if(o=i.source,a=i.target,s=t(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected),r&&s)return i.key;i=i.next}while(i!==void 0)}}function Mi(r,e){const t=Object.keys(r),n=t.length;let i,o=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(o>=n)return{done:!0};const a=t[o++];if(a===e){i=void 0;continue}i=r[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 qp(r,e,t,n){const i=e[t];if(!i)return;const o=i.source,a=i.target;if(n(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected)&&r)return i.key}function Yp(r,e,t,n){let i=e[t];if(!i)return;let o=!1;do{if(o=n(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),r&&o)return i.key;i=i.next}while(i!==void 0)}function zi(r,e){let t=r[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 n=!1;return{[Symbol.iterator](){return this},next(){return n===!0?{done:!0}:(n=!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 Xp(r,e){if(r.size===0)return[];if(e==="mixed"||e===r.type)return Array.from(r._edges.keys());const t=e==="undirected"?r.undirectedSize:r.directedSize,n=new Array(t),i=e==="undirected",o=r._edges.values();let a=0,s,c;for(;s=o.next(),s.done!==!0;)c=s.value,c.undirected===i&&(n[a++]=c.key);return n}function Ac(r,e,t,n){if(e.size===0)return;const i=t!=="mixed"&&t!==e.type,o=t==="undirected";let a,s,c=!1;const l=e._edges.values();for(;a=l.next(),a.done!==!0;){if(s=a.value,i&&s.undirected!==o)continue;const{key:d,attributes:f,source:h,target:g}=s;if(c=n(d,f,h.key,g.key,h.attributes,g.attributes,s.undirected),r&&c)return d}}function Jp(r,e){if(r.size===0)return Ur();const t=e!=="mixed"&&e!==r.type,n=e==="undirected",i=r._edges.values();return{[Symbol.iterator](){return this},next(){let o,a;for(;;){if(o=i.next(),o.done)return o;if(a=o.value,!(t&&a.undirected!==n))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 Co(r,e,t,n,i,o){const a=e?Hp:Kp;let s;if(t!=="undirected"&&(n!=="out"&&(s=a(r,i.in,o),r&&s)||n!=="in"&&(s=a(r,i.out,o,n?void 0:i.key),r&&s))||t!=="directed"&&(s=a(r,i.undirected,o),r&&s))return s}function Zp(r,e,t,n){const i=[];return Co(!1,r,e,t,n,function(o){i.push(o)}),i}function Qp(r,e,t){let n=Ur();return r!=="undirected"&&(e!=="out"&&typeof t.in<"u"&&(n=tr(n,Mi(t.in))),e!=="in"&&typeof t.out<"u"&&(n=tr(n,Mi(t.out,e?void 0:t.key)))),r!=="directed"&&typeof t.undirected<"u"&&(n=tr(n,Mi(t.undirected))),n}function Ao(r,e,t,n,i,o,a){const s=t?Yp:qp;let c;if(e!=="undirected"&&(typeof i.in<"u"&&n!=="out"&&(c=s(r,i.in,o,a),r&&c)||typeof i.out<"u"&&n!=="in"&&(n||i.key!==o)&&(c=s(r,i.out,o,a),r&&c))||e!=="directed"&&typeof i.undirected<"u"&&(c=s(r,i.undirected,o,a),r&&c))return c}function eg(r,e,t,n,i){const o=[];return Ao(!1,r,e,t,n,i,function(a){o.push(a)}),o}function tg(r,e,t,n){let i=Ur();return r!=="undirected"&&(typeof t.in<"u"&&e!=="out"&&n in t.in&&(i=tr(i,zi(t.in,n))),typeof t.out<"u"&&e!=="in"&&n in t.out&&(e||t.key!==n)&&(i=tr(i,zi(t.out,n)))),r!=="directed"&&typeof t.undirected<"u"&&n in t.undirected&&(i=tr(i,zi(t.undirected,n))),i}function rg(r,e){const{name:t,type:n,direction:i}=e;r.prototype[t]=function(o,a){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return[];if(!arguments.length)return Xp(this,n);if(arguments.length===1){o=""+o;const s=this._nodes.get(o);if(typeof s>"u")throw new B(`Graph.${t}: could not find the "${o}" node in the graph.`);return Zp(this.multi,n==="mixed"?this.type:n,i,s)}if(arguments.length===2){o=""+o,a=""+a;const s=this._nodes.get(o);if(!s)throw new B(`Graph.${t}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(a))throw new B(`Graph.${t}: could not find the "${a}" target node in the graph.`);return eg(n,this.multi,i,s,a)}throw new q(`Graph.${t}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function ng(r,e){const{name:t,type:n,direction:i}=e,o="forEach"+t[0].toUpperCase()+t.slice(1,-1);r.prototype[o]=function(l,d,f){if(!(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)){if(arguments.length===1)return f=l,Ac(!1,this,n,f);if(arguments.length===2){l=""+l,f=d;const h=this._nodes.get(l);if(typeof h>"u")throw new B(`Graph.${o}: could not find the "${l}" node in the graph.`);return Co(!1,this.multi,n==="mixed"?this.type:n,i,h,f)}if(arguments.length===3){l=""+l,d=""+d;const h=this._nodes.get(l);if(!h)throw new B(`Graph.${o}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(d))throw new B(`Graph.${o}: could not find the "${d}" target node in the graph.`);return Ao(!1,n,this.multi,i,h,d,f)}throw new q(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const a="map"+t[0].toUpperCase()+t.slice(1);r.prototype[a]=function(){const l=Array.prototype.slice.call(arguments),d=l.pop();let f;if(l.length===0){let h=0;n!=="directed"&&(h+=this.undirectedSize),n!=="undirected"&&(h+=this.directedSize),f=new Array(h);let g=0;l.push((y,C,b,m,A,v,p)=>{f[g++]=d(y,C,b,m,A,v,p)})}else f=[],l.push((h,g,y,C,b,m,A)=>{f.push(d(h,g,y,C,b,m,A))});return this[o].apply(this,l),f};const s="filter"+t[0].toUpperCase()+t.slice(1);r.prototype[s]=function(){const l=Array.prototype.slice.call(arguments),d=l.pop(),f=[];return l.push((h,g,y,C,b,m,A)=>{d(h,g,y,C,b,m,A)&&f.push(h)}),this[o].apply(this,l),f};const c="reduce"+t[0].toUpperCase()+t.slice(1);r.prototype[c]=function(){let l=Array.prototype.slice.call(arguments);if(l.length<2||l.length>4)throw new q(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${l.length}).`);if(typeof l[l.length-1]=="function"&&typeof l[l.length-2]!="function")throw new q(`Graph.${c}: 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;l.length===2?(d=l[0],f=l[1],l=[]):l.length===3?(d=l[1],f=l[2],l=[l[0]]):l.length===4&&(d=l[2],f=l[3],l=[l[0],l[1]]);let h=f;return l.push((g,y,C,b,m,A,v)=>{h=d(h,g,y,C,b,m,A,v)}),this[o].apply(this,l),h}}function ig(r,e){const{name:t,type:n,direction:i}=e,o="find"+t[0].toUpperCase()+t.slice(1,-1);r.prototype[o]=function(c,l,d){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return!1;if(arguments.length===1)return d=c,Ac(!0,this,n,d);if(arguments.length===2){c=""+c,d=l;const f=this._nodes.get(c);if(typeof f>"u")throw new B(`Graph.${o}: could not find the "${c}" node in the graph.`);return Co(!0,this.multi,n==="mixed"?this.type:n,i,f,d)}if(arguments.length===3){c=""+c,l=""+l;const f=this._nodes.get(c);if(!f)throw new B(`Graph.${o}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(l))throw new B(`Graph.${o}: could not find the "${l}" target node in the graph.`);return Ao(!0,n,this.multi,i,f,l,d)}throw new q(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const a="some"+t[0].toUpperCase()+t.slice(1,-1);r.prototype[a]=function(){const c=Array.prototype.slice.call(arguments),l=c.pop();return c.push((f,h,g,y,C,b,m)=>l(f,h,g,y,C,b,m)),!!this[o].apply(this,c)};const s="every"+t[0].toUpperCase()+t.slice(1,-1);r.prototype[s]=function(){const c=Array.prototype.slice.call(arguments),l=c.pop();return c.push((f,h,g,y,C,b,m)=>!l(f,h,g,y,C,b,m)),!this[o].apply(this,c)}}function og(r,e){const{name:t,type:n,direction:i}=e,o=t.slice(0,-1)+"Entries";r.prototype[o]=function(a,s){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return Ur();if(!arguments.length)return Jp(this,n);if(arguments.length===1){a=""+a;const c=this._nodes.get(a);if(!c)throw new B(`Graph.${o}: could not find the "${a}" node in the graph.`);return Qp(n,i,c)}if(arguments.length===2){a=""+a,s=""+s;const c=this._nodes.get(a);if(!c)throw new B(`Graph.${o}: could not find the "${a}" source node in the graph.`);if(!this._nodes.has(s))throw new B(`Graph.${o}: could not find the "${s}" target node in the graph.`);return tg(n,i,c,s)}throw new q(`Graph.${o}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function sg(r){Vp.forEach(e=>{rg(r,e),ng(r,e),ig(r,e),og(r,e)})}const ag=[{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 ri(){this.A=null,this.B=null}ri.prototype.wrap=function(r){this.A===null?this.A=r:this.B===null&&(this.B=r)};ri.prototype.has=function(r){return this.A!==null&&r in this.A||this.B!==null&&r in this.B};function Jr(r,e,t,n,i){for(const o in n){const a=n[o],s=a.source,c=a.target,l=s===t?c:s;if(e&&e.has(l.key))continue;const d=i(l.key,l.attributes);if(r&&d)return l.key}}function $o(r,e,t,n,i){if(e!=="mixed"){if(e==="undirected")return Jr(r,null,n,n.undirected,i);if(typeof t=="string")return Jr(r,null,n,n[t],i)}const o=new ri;let a;if(e!=="undirected"){if(t!=="out"){if(a=Jr(r,null,n,n.in,i),r&&a)return a;o.wrap(n.in)}if(t!=="in"){if(a=Jr(r,o,n,n.out,i),r&&a)return a;o.wrap(n.out)}}if(e!=="directed"&&(a=Jr(r,o,n,n.undirected,i),r&&a))return a}function cg(r,e,t){if(r!=="mixed"){if(r==="undirected")return Object.keys(t.undirected);if(typeof e=="string")return Object.keys(t[e])}const n=[];return $o(!1,r,e,t,function(i){n.push(i)}),n}function Zr(r,e,t){const n=Object.keys(t),i=n.length;let o=0;return{[Symbol.iterator](){return this},next(){let a=null;do{if(o>=i)return r&&r.wrap(t),{done:!0};const s=t[n[o++]],c=s.source,l=s.target;if(a=c===e?l:c,r&&r.has(a.key)){a=null;continue}}while(a===null);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}}}}function lg(r,e,t){if(r!=="mixed"){if(r==="undirected")return Zr(null,t,t.undirected);if(typeof e=="string")return Zr(null,t,t[e])}let n=Ur();const i=new ri;return r!=="undirected"&&(e!=="out"&&(n=tr(n,Zr(i,t,t.in))),e!=="in"&&(n=tr(n,Zr(i,t,t.out)))),r!=="directed"&&(n=tr(n,Zr(i,t,t.undirected))),n}function ug(r,e){const{name:t,type:n,direction:i}=e;r.prototype[t]=function(o){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return[];o=""+o;const a=this._nodes.get(o);if(typeof a>"u")throw new B(`Graph.${t}: could not find the "${o}" node in the graph.`);return cg(n==="mixed"?this.type:n,i,a)}}function dg(r,e){const{name:t,type:n,direction:i}=e,o="forEach"+t[0].toUpperCase()+t.slice(1,-1);r.prototype[o]=function(l,d){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return;l=""+l;const f=this._nodes.get(l);if(typeof f>"u")throw new B(`Graph.${o}: could not find the "${l}" node in the graph.`);$o(!1,n==="mixed"?this.type:n,i,f,d)};const a="map"+t[0].toUpperCase()+t.slice(1);r.prototype[a]=function(l,d){const f=[];return this[o](l,(h,g)=>{f.push(d(h,g))}),f};const s="filter"+t[0].toUpperCase()+t.slice(1);r.prototype[s]=function(l,d){const f=[];return this[o](l,(h,g)=>{d(h,g)&&f.push(h)}),f};const c="reduce"+t[0].toUpperCase()+t.slice(1);r.prototype[c]=function(l,d,f){if(arguments.length<3)throw new q(`Graph.${c}: 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[o](l,(g,y)=>{h=d(h,g,y)}),h}}function fg(r,e){const{name:t,type:n,direction:i}=e,o=t[0].toUpperCase()+t.slice(1,-1),a="find"+o;r.prototype[a]=function(l,d){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return;l=""+l;const f=this._nodes.get(l);if(typeof f>"u")throw new B(`Graph.${a}: could not find the "${l}" node in the graph.`);return $o(!0,n==="mixed"?this.type:n,i,f,d)};const s="some"+o;r.prototype[s]=function(l,d){return!!this[a](l,d)};const c="every"+o;r.prototype[c]=function(l,d){return!this[a](l,(h,g)=>!d(h,g))}}function hg(r,e){const{name:t,type:n,direction:i}=e,o=t.slice(0,-1)+"Entries";r.prototype[o]=function(a){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return Ur();a=""+a;const s=this._nodes.get(a);if(typeof s>"u")throw new B(`Graph.${o}: could not find the "${a}" node in the graph.`);return lg(n==="mixed"?this.type:n,i,s)}}function pg(r){ag.forEach(e=>{ug(r,e),dg(r,e),fg(r,e),hg(r,e)})}function zn(r,e,t,n,i){const o=n._nodes.values(),a=n.type;let s,c,l,d,f,h;for(;s=o.next(),s.done!==!0;){let g=!1;if(c=s.value,a!=="undirected"){d=c.out;for(l in d){f=d[l];do h=f.target,g=!0,i(c.key,h.key,c.attributes,h.attributes,f.key,f.attributes,f.undirected),f=f.next;while(f)}}if(a!=="directed"){d=c.undirected;for(l in d)if(!(e&&c.key>l)){f=d[l];do h=f.target,h.key!==l&&(h=f.source),g=!0,i(c.key,h.key,c.attributes,h.attributes,f.key,f.attributes,f.undirected),f=f.next;while(f)}}t&&!g&&i(c.key,null,c.attributes,null,null,null,null)}}function gg(r,e){const t={key:r};return wc(e.attributes)||(t.attributes=ut({},e.attributes)),t}function mg(r,e,t){const n={key:e,source:t.source.key,target:t.target.key};return wc(t.attributes)||(n.attributes=ut({},t.attributes)),r==="mixed"&&t.undirected&&(n.undirected=!0),n}function vg(r){if(!mt(r))throw new q('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in r))throw new q("Graph.import: serialized node is missing its key.");if("attributes"in r&&(!mt(r.attributes)||r.attributes===null))throw new q("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function yg(r){if(!mt(r))throw new q('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in r))throw new q("Graph.import: serialized edge is missing its source.");if(!("target"in r))throw new q("Graph.import: serialized edge is missing its target.");if("attributes"in r&&(!mt(r.attributes)||r.attributes===null))throw new q("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in r&&typeof r.undirected!="boolean")throw new q("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const bg=_p(),wg=new Set(["directed","undirected","mixed"]),Ps=new Set(["domain","_events","_eventsCount","_maxListeners"]),_g=[{name:r=>`${r}Edge`,generateKey:!0},{name:r=>`${r}DirectedEdge`,generateKey:!0,type:"directed"},{name:r=>`${r}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:r=>`${r}EdgeWithKey`},{name:r=>`${r}DirectedEdgeWithKey`,type:"directed"},{name:r=>`${r}UndirectedEdgeWithKey`,type:"undirected"}],xg={allowSelfLoops:!0,multi:!1,type:"mixed"};function kg(r,e,t){if(t&&!mt(t))throw new q(`Graph.addNode: invalid attributes. Expecting an object but got "${t}"`);if(e=""+e,t=t||{},r._nodes.has(e))throw new ue(`Graph.addNode: the "${e}" node already exist in the graph.`);const n=new r.NodeDataClass(e,t);return r._nodes.set(e,n),r.emit("nodeAdded",{key:e,attributes:t}),n}function Us(r,e,t){const n=new r.NodeDataClass(e,t);return r._nodes.set(e,n),r.emit("nodeAdded",{key:e,attributes:t}),n}function $c(r,e,t,n,i,o,a,s){if(!n&&r.type==="undirected")throw new ue(`Graph.${e}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(n&&r.type==="directed")throw new ue(`Graph.${e}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!mt(s))throw new q(`Graph.${e}: invalid attributes. Expecting an object but got "${s}"`);if(o=""+o,a=""+a,s=s||{},!r.allowSelfLoops&&o===a)throw new ue(`Graph.${e}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const c=r._nodes.get(o),l=r._nodes.get(a);if(!c)throw new B(`Graph.${e}: source node "${o}" not found.`);if(!l)throw new B(`Graph.${e}: target node "${a}" not found.`);const d={key:null,undirected:n,source:o,target:a,attributes:s};if(t)i=r._edgeKeyGenerator();else if(i=""+i,r._edges.has(i))throw new ue(`Graph.${e}: the "${i}" edge already exists in the graph.`);if(!r.multi&&(n?typeof c.undirected[a]<"u":typeof c.out[a]<"u"))throw new ue(`Graph.${e}: an edge linking "${o}" 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(n,i,c,l,s);r._edges.set(i,f);const h=o===a;return n?(c.undirectedDegree++,l.undirectedDegree++,h&&(c.undirectedLoops++,r._undirectedSelfLoopCount++)):(c.outDegree++,l.inDegree++,h&&(c.directedLoops++,r._directedSelfLoopCount++)),r.multi?f.attachMulti():f.attach(),n?r._undirectedSize++:r._directedSize++,d.key=i,r.emit("edgeAdded",d),i}function Eg(r,e,t,n,i,o,a,s,c){if(!n&&r.type==="undirected")throw new ue(`Graph.${e}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(n&&r.type==="directed")throw new ue(`Graph.${e}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(c){if(typeof s!="function")throw new q(`Graph.${e}: invalid updater function. Expecting a function but got "${s}"`)}else if(!mt(s))throw new q(`Graph.${e}: invalid attributes. Expecting an object but got "${s}"`)}o=""+o,a=""+a;let l;if(c&&(l=s,s=void 0),!r.allowSelfLoops&&o===a)throw new ue(`Graph.${e}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let d=r._nodes.get(o),f=r._nodes.get(a),h,g;if(!t&&(h=r._edges.get(i),h)){if((h.source.key!==o||h.target.key!==a)&&(!n||h.source.key!==a||h.target.key!==o))throw new ue(`Graph.${e}: inconsistency detected when attempting to merge the "${i}" edge with "${o}" source & "${a}" target vs. ("${h.source.key}", "${h.target.key}").`);g=h}if(!g&&!r.multi&&d&&(g=n?d.undirected[a]:d.out[a]),g){const A=[g.key,!1,!1,!1];if(c?!l:!s)return A;if(c){const v=g.attributes;g.attributes=l(v),r.emit("edgeAttributesUpdated",{type:"replace",key:g.key,attributes:g.attributes})}else ut(g.attributes,s),r.emit("edgeAttributesUpdated",{type:"merge",key:g.key,attributes:g.attributes,data:s});return A}s=s||{},c&&l&&(s=l(s));const y={key:null,undirected:n,source:o,target:a,attributes:s};if(t)i=r._edgeKeyGenerator();else if(i=""+i,r._edges.has(i))throw new ue(`Graph.${e}: the "${i}" edge already exists in the graph.`);let C=!1,b=!1;d||(d=Us(r,o,{}),C=!0,o===a&&(f=d,b=!0)),f||(f=Us(r,a,{}),b=!0),h=new Wr(n,i,d,f,s),r._edges.set(i,h);const m=o===a;return n?(d.undirectedDegree++,f.undirectedDegree++,m&&(d.undirectedLoops++,r._undirectedSelfLoopCount++)):(d.outDegree++,f.inDegree++,m&&(d.directedLoops++,r._directedSelfLoopCount++)),r.multi?h.attachMulti():h.attach(),n?r._undirectedSize++:r._directedSize++,y.key=i,r.emit("edgeAdded",y),[i,!0,C,b]}function Gr(r,e){r._edges.delete(e.key);const{source:t,target:n,attributes:i}=e,o=e.undirected,a=t===n;o?(t.undirectedDegree--,n.undirectedDegree--,a&&(t.undirectedLoops--,r._undirectedSelfLoopCount--)):(t.outDegree--,n.inDegree--,a&&(t.directedLoops--,r._directedSelfLoopCount--)),r.multi?e.detachMulti():e.detach(),o?r._undirectedSize--:r._directedSize--,r.emit("edgeDropped",{key:e.key,attributes:i,source:t.key,target:n.key,undirected:o})}class qe extends bp.EventEmitter{constructor(e){if(super(),e=ut({},xg,e),typeof e.multi!="boolean")throw new q(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!wg.has(e.type))throw new q(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!="boolean")throw new q(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);const t=e.type==="mixed"?_c:e.type==="directed"?xc:kc;Mt(this,"NodeDataClass",t);const n="geid_"+bg()+"_";let i=0;const o=()=>{let a;do a=n+i++;while(this._edges.has(a));return a};Mt(this,"_attributes",{}),Mt(this,"_nodes",new Map),Mt(this,"_edges",new Map),Mt(this,"_directedSize",0),Mt(this,"_undirectedSize",0),Mt(this,"_directedSelfLoopCount",0),Mt(this,"_undirectedSelfLoopCount",0),Mt(this,"_edgeKeyGenerator",o),Mt(this,"_options",e),Ps.forEach(a=>Mt(this,a,this[a])),Wt(this,"order",()=>this._nodes.size),Wt(this,"size",()=>this._edges.size),Wt(this,"directedSize",()=>this._directedSize),Wt(this,"undirectedSize",()=>this._undirectedSize),Wt(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Wt(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Wt(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Wt(this,"multi",this._options.multi),Wt(this,"type",this._options.type),Wt(this,"allowSelfLoops",this._options.allowSelfLoops),Wt(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 n=""+e,i=this._edges.get(n);return!!i&&!i.undirected}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new q(`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 n=""+e,i=this._edges.get(n);return!!i&&i.undirected}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new q(`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 n=""+e;return this._edges.has(n)}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?typeof n.out<"u"&&n.out.hasOwnProperty(t)||typeof n.undirected<"u"&&n.undirected.hasOwnProperty(t):!1}throw new q(`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 ue("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const n=this._nodes.get(e);if(!n)throw new B(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new B(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);const i=n.out&&n.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 ue("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const n=this._nodes.get(e);if(!n)throw new B(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new B(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);const i=n.undirected&&n.undirected[t]||void 0;if(i)return i.key}edge(e,t){if(this.multi)throw new ue("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 n=this._nodes.get(e);if(!n)throw new B(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new B(`Graph.edge: could not find the "${t}" target node in the graph.`);const i=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(i)return i.key}areDirectedNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new B(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new B(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.out}areInNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new B(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.in}areUndirectedNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new B(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="directed"?!1:t in n.undirected}areNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new B(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&(t in n.in||t in n.out)||this.type!=="directed"&&t in n.undirected}areInboundNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new B(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in n.in||this.type!=="directed"&&t in n.undirected}areOutboundNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new B(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in n.out||this.type!=="directed"&&t in n.undirected}inDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new B(`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 B(`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 B(`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 B(`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 B(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.inDegree),n}outboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new B(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.outDegree),n}degree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new B(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new B(`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 B(`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 B(`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 B(`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 B(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,i=0;return this.type!=="directed"&&(n+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.inDegree,i+=t.directedLoops),n-i}outboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new B(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,i=0;return this.type!=="directed"&&(n+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.outDegree,i+=t.directedLoops),n-i}degreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new B(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,i=0;return this.type!=="directed"&&(n+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.inDegree+t.outDegree,i+=t.directedLoops*2),n-i}source(e){e=""+e;const t=this._edges.get(e);if(!t)throw new B(`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 B(`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 B(`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 n=this._edges.get(t);if(!n)throw new B(`Graph.opposite: could not find the "${t}" edge in the graph.`);const i=n.source.key,o=n.target.key;if(e===i)return o;if(e===o)return i;throw new B(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${i}, ${o}).`)}hasExtremity(e,t){e=""+e,t=""+t;const n=this._edges.get(e);if(!n)throw new B(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new B(`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 B(`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 B(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return kg(this,e,t).key}mergeNode(e,t){if(t&&!mt(t))throw new q(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=""+e,t=t||{};let n=this._nodes.get(e);return n?(t&&(ut(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!="function")throw new q(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=""+e;let n=this._nodes.get(e);if(n){if(t){const o=n.attributes;n.attributes=t(o),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})}return[e,!1]}const i=t?t({}):{};return n=new this.NodeDataClass(e,i),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:i}),[e,!0]}dropNode(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new B(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!=="undirected"){for(const i in t.out){n=t.out[i];do Gr(this,n),n=n.next;while(n)}for(const i in t.in){n=t.in[i];do Gr(this,n),n=n.next;while(n)}}if(this.type!=="directed")for(const i in t.undirected){n=t.undirected[i];do Gr(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){const n=""+arguments[0],i=""+arguments[1];if(t=Nt(this,n,i,this.type),!t)throw new B(`Graph.dropEdge: could not find the "${n}" -> "${i}" edge in the graph.`)}else if(e=""+e,t=this._edges.get(e),!t)throw new B(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return Gr(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new ue("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 ue("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 n=Nt(this,e,t,"directed");if(!n)throw new B(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return Gr(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new ue("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 ue("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 n=Nt(this,e,t,"undirected");if(!n)throw new B(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return Gr(this,n),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 q("Graph.updateAttribute: updater should be a function.");const n=this._attributes[e];return this._attributes[e]=t(n),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(!mt(e))throw new q("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(!mt(e))throw new q("Graph.mergeAttributes: provided attributes are not a plain object.");return ut(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!="function")throw new q("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 q("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!Ns(t))throw new q("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const n=this._nodes.values();let i,o;for(;i=n.next(),i.done!==!0;)o=i.value,o.attributes=e(o.key,o.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!="function")throw new q("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!Ns(t))throw new q("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const n=this._edges.values();let i,o,a,s;for(;i=n.next(),i.done!==!0;)o=i.value,a=o.source,s=o.target,o.attributes=e(o.key,o.attributes,a.key,s.key,a.attributes,s.attributes,o.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!="function")throw new q("Graph.forEachAdjacencyEntry: expecting a callback.");zn(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new q("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");zn(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!="function")throw new q("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");zn(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new q("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");zn(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!="function")throw new q("Graph.forEachNode: expecting a callback.");const t=this._nodes.values();let n,i;for(;n=t.next(),n.done!==!0;)i=n.value,e(i.key,i.attributes)}findNode(e){if(typeof e!="function")throw new q("Graph.findNode: expecting a callback.");const t=this._nodes.values();let n,i;for(;n=t.next(),n.done!==!0;)if(i=n.value,e(i.key,i.attributes))return i.key}mapNodes(e){if(typeof e!="function")throw new q("Graph.mapNode: expecting a callback.");const t=this._nodes.values();let n,i;const o=new Array(this.order);let a=0;for(;n=t.next(),n.done!==!0;)i=n.value,o[a++]=e(i.key,i.attributes);return o}someNode(e){if(typeof e!="function")throw new q("Graph.someNode: expecting a callback.");const t=this._nodes.values();let n,i;for(;n=t.next(),n.done!==!0;)if(i=n.value,e(i.key,i.attributes))return!0;return!1}everyNode(e){if(typeof e!="function")throw new q("Graph.everyNode: expecting a callback.");const t=this._nodes.values();let n,i;for(;n=t.next(),n.done!==!0;)if(i=n.value,!e(i.key,i.attributes))return!1;return!0}filterNodes(e){if(typeof e!="function")throw new q("Graph.filterNodes: expecting a callback.");const t=this._nodes.values();let n,i;const o=[];for(;n=t.next(),n.done!==!0;)i=n.value,e(i.key,i.attributes)&&o.push(i.key);return o}reduceNodes(e,t){if(typeof e!="function")throw new q("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new q("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 n=t;const i=this._nodes.values();let o,a;for(;o=i.next(),o.done!==!0;)a=o.value,n=e(n,a.key,a.attributes);return n}nodeEntries(){const e=this._nodes.values();return{[Symbol.iterator](){return this},next(){const t=e.next();if(t.done)return t;const n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){const e=new Array(this._nodes.size);let t=0;this._nodes.forEach((i,o)=>{e[t++]=gg(o,i)});const n=new Array(this._edges.size);return t=0,this._edges.forEach((i,o)=>{n[t++]=mg(this.type,o,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(e,t=!1){if(e instanceof qe)return e.forEachNode((c,l)=>{t?this.mergeNode(c,l):this.addNode(c,l)}),e.forEachEdge((c,l,d,f,h,g,y)=>{t?y?this.mergeUndirectedEdgeWithKey(c,d,f,l):this.mergeDirectedEdgeWithKey(c,d,f,l):y?this.addUndirectedEdgeWithKey(c,d,f,l):this.addDirectedEdgeWithKey(c,d,f,l)}),this;if(!mt(e))throw new q("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!mt(e.attributes))throw new q("Graph.import: invalid attributes. Expecting a plain object.");t?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let n,i,o,a,s;if(e.nodes){if(o=e.nodes,!Array.isArray(o))throw new q("Graph.import: invalid nodes. Expecting an array.");for(n=0,i=o.length;n<i;n++){a=o[n],vg(a);const{key:c,attributes:l}=a;t?this.mergeNode(c,l):this.addNode(c,l)}}if(e.edges){let c=!1;if(this.type==="undirected"&&(c=!0),o=e.edges,!Array.isArray(o))throw new q("Graph.import: invalid edges. Expecting an array.");for(n=0,i=o.length;n<i;n++){s=o[n],yg(s);const{source:l,target:d,attributes:f,undirected:h=c}=s;let g;"key"in s?(g=t?h?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:h?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,g.call(this,s.key,l,d,f)):(g=t?h?this.mergeUndirectedEdge:this.mergeDirectedEdge:h?this.addUndirectedEdge:this.addDirectedEdge,g.call(this,l,d,f))}}return this}nullCopy(e){const t=new qe(ut({},this._options,e));return t.replaceAttributes(ut({},this.getAttributes())),t}emptyCopy(e){const t=this.nullCopy(e);return this._nodes.forEach((n,i)=>{const o=ut({},n.attributes);n=new t.NodeDataClass(i,o),t._nodes.set(i,n)}),t}copy(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new ue(`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 ue("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 ue("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),n=this._edges.values();let i,o;for(;i=n.next(),i.done!==!0;)o=i.value,$c(t,"copy",!1,o.undirected,o.key,o.source.key,o.target.key,ut({},o.attributes));return t}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const e={};this._nodes.forEach((o,a)=>{e[a]=o.attributes});const t={},n={};this._edges.forEach((o,a)=>{const s=o.undirected?"--":"->";let c="",l=o.source.key,d=o.target.key,f;o.undirected&&l>d&&(f=l,l=d,d=f);const h=`(${l})${s}(${d})`;a.startsWith("geid_")?this.multi&&(typeof n[h]>"u"?n[h]=0:n[h]++,c+=`${n[h]}. `):c+=`[${a}]: `,c+=h,t[c]=o.attributes});const i={};for(const o in this)this.hasOwnProperty(o)&&!Ps.has(o)&&typeof this[o]!="function"&&typeof o!="symbol"&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=e,i.edges=t,Mt(i,"constructor",this.constructor),i}}typeof Symbol<"u"&&(qe.prototype[Symbol.for("nodejs.util.inspect.custom")]=qe.prototype.inspect);_g.forEach(r=>{["add","merge","update"].forEach(e=>{const t=r.name(e),n=e==="add"?$c:Eg;r.generateKey?qe.prototype[t]=function(i,o,a){return n(this,t,!0,(r.type||this.type)==="undirected",null,i,o,a,e==="update")}:qe.prototype[t]=function(i,o,a,s){return n(this,t,!1,(r.type||this.type)==="undirected",i,o,a,s,e==="update")}})});Gp(qe);Fp(qe);sg(qe);pg(qe);class Dc extends qe{constructor(e){const t=ut({type:"directed"},e);if("multi"in t&&t.multi!==!1)throw new q("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="directed")throw new q('DirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Ic extends qe{constructor(e){const t=ut({type:"undirected"},e);if("multi"in t&&t.multi!==!1)throw new q("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="undirected")throw new q('UndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Lc extends qe{constructor(e){const t=ut({multi:!0},e);if("multi"in t&&t.multi!==!0)throw new q("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(t)}}class Tc extends qe{constructor(e){const t=ut({type:"directed",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new q("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="directed")throw new q('MultiDirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Gc extends qe{constructor(e){const t=ut({type:"undirected",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new q("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="undirected")throw new q('MultiUndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}function jr(r){r.from=function(e,t){const n=ut({},e.options,t),i=new r(n);return i.import(e),i}}jr(qe);jr(Dc);jr(Ic);jr(Lc);jr(Tc);jr(Gc);qe.Graph=qe;qe.DirectedGraph=Dc;qe.UndirectedGraph=Ic;qe.MultiGraph=Lc;qe.MultiDirectedGraph=Tc;qe.MultiUndirectedGraph=Gc;qe.InvalidArgumentsGraphError=q;qe.NotFoundGraphError=B;qe.UsageGraphError=ue;var Ni,Ws;function Do(){if(Ws)return Ni;Ws=1;function r(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,n){t=t||{};var i={};for(var o in n){var a=t[o],s=n[o];if(!r(s)){i[o]=e(a,s);continue}a===void 0?i[o]=s:i[o]=a}return i}return Ni=e,Ni}var Pi,js;function ni(){return js||(js=1,Pi=function(e){return e!==null&&typeof e=="object"&&typeof e.addUndirectedEdgeWithKey=="function"&&typeof e.dropNode=="function"&&typeof e.multi=="boolean"}),Pi}var Ui,Bs;function Rc(){if(Bs)return Ui;Bs=1;var r=ni();return Ui=function(t){if(!r(t))throw new Error("graphology-utils/infer-type: expecting a valid graphology instance.");var n=t.type;return n!=="mixed"?n:t.directedSize===0&&t.undirectedSize===0||t.directedSize>0&&t.undirectedSize>0?"mixed":t.directedSize>0?"directed":"undirected"},Ui}var Wi,Fs;function Oc(){if(Fs)return Wi;Fs=1;function r(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}return typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=function(){return this}),r.of=function(){var e=arguments,t=e.length,n=0;return new r(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},r.empty=function(){var e=new r(function(){return{done:!0}});return e},r.fromSequence=function(e){var t=0,n=e.length;return new r(function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}})},r.is=function(e){return e instanceof r?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"},Wi=r,Wi}var ji={},Vs;function Io(){return Vs||(Vs=1,(function(r){var e=Math.pow(2,8)-1,t=Math.pow(2,16)-1,n=Math.pow(2,32)-1,i=Math.pow(2,7)-1,o=Math.pow(2,15)-1,a=Math.pow(2,31)-1;r.getPointerArray=function(c){var l=c-1;if(l<=e)return Uint8Array;if(l<=t)return Uint16Array;if(l<=n)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},r.getSignedPointerArray=function(c){var l=c-1;return l<=i?Int8Array:l<=o?Int16Array:l<=a?Int32Array:Float64Array},r.getNumberType=function(c){return c===(c|0)?Math.sign(c)===-1?c<=127&&c>=-128?Int8Array:c<=32767&&c>=-32768?Int16Array:Int32Array:c<=255?Uint8Array:c<=65535?Uint16Array:Uint32Array:Float64Array};var s={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};r.getMinimalRepresentation=function(c,l){var d=null,f=0,h,g,y,C,b;for(C=0,b=c.length;C<b;C++)y=l?l(c[C]):c[C],g=r.getNumberType(y),h=s[g.name],h>f&&(f=h,d=g);return d},r.isTypedArray=function(c){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(c)},r.concat=function(){var c=0,l,d,f;for(l=0,f=arguments.length;l<f;l++)c+=arguments[l].length;var h=new arguments[0].constructor(c);for(l=0,d=0;l<f;l++)h.set(arguments[l],d),d+=arguments[l].length;return h},r.indices=function(c){for(var l=r.getPointerArray(c),d=new l(c),f=0;f<c;f++)d[f]=f;return d}})(ji)),ji}var Bi,Ks;function Lo(){if(Ks)return Bi;Ks=1;var r=Oc(),e=Io().getPointerArray;function t(n,i){arguments.length<2&&(i=n,n=Array);var o=e(i);this.size=0,this.length=i,this.dense=new o(i),this.sparse=new o(i),this.vals=new n(i)}return t.prototype.clear=function(){this.size=0},t.prototype.has=function(n){var i=this.sparse[n];return i<this.size&&this.dense[i]===n},t.prototype.get=function(n){var i=this.sparse[n];if(i<this.size&&this.dense[i]===n)return this.vals[i]},t.prototype.set=function(n,i){var o=this.sparse[n];return o<this.size&&this.dense[o]===n?(this.vals[o]=i,this):(this.dense[this.size]=n,this.sparse[n]=this.size,this.vals[this.size]=i,this.size++,this)},t.prototype.delete=function(n){var i=this.sparse[n];return i>=this.size||this.dense[i]!==n?!1:(i=this.dense[this.size-1],this.dense[this.sparse[n]]=i,this.sparse[i]=this.sparse[n],this.size--,!0)},t.prototype.forEach=function(n,i){i=arguments.length>1?i:this;for(var o=0;o<this.size;o++)n.call(i,this.vals[o],this.dense[o])},t.prototype.keys=function(){var n=this.size,i=this.dense,o=0;return new r(function(){if(o<n){var a=i[o];return o++,{value:a}}return{done:!0}})},t.prototype.values=function(){var n=this.size,i=this.vals,o=0;return new r(function(){if(o<n){var a=i[o];return o++,{value:a}}return{done:!0}})},t.prototype.entries=function(){var n=this.size,i=this.dense,o=this.vals,a=0;return new r(function(){if(a<n){var s=[i[a],o[a]];return a++,{value:s}}return{done:!0}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.entries),t.prototype.inspect=function(){for(var n=new Map,i=0;i<this.size;i++)n.set(this.dense[i],this.vals[i]);return Object.defineProperty(n,"constructor",{value:t,enumerable:!1}),n.length=this.length,this.vals.constructor!==Array&&(n.type=this.vals.constructor.name),n},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),Bi=t,Bi}var Fi,Hs;function Mc(){if(Hs)return Fi;Hs=1;var r=Oc(),e=Io().getPointerArray;function t(n){var i=e(n);this.start=0,this.size=0,this.capacity=n,this.dense=new i(n),this.sparse=new i(n)}return t.prototype.clear=function(){this.start=0,this.size=0},t.prototype.has=function(n){if(this.size===0)return!1;var i=this.sparse[n],o=i<this.capacity&&i>=this.start&&i<this.start+this.size||i<(this.start+this.size)%this.capacity;return o&&this.dense[i]===n},t.prototype.enqueue=function(n){var i=this.sparse[n];if(this.size!==0){var o=i<this.capacity&&i>=this.start&&i<this.start+this.size||i<(this.start+this.size)%this.capacity;if(o&&this.dense[i]===n)return this}return i=(this.start+this.size)%this.capacity,this.dense[i]=n,this.sparse[n]=i,this.size++,this},t.prototype.dequeue=function(){if(this.size!==0){var n=this.start;this.size--,this.start++,this.start===this.capacity&&(this.start=0);var i=this.dense[n];return this.sparse[i]=this.capacity,i}},t.prototype.forEach=function(n,i){i=arguments.length>1?i:this;for(var o=this.capacity,a=this.size,s=this.start,c=0;c<a;)n.call(i,this.dense[s],c,this),s++,c++,s===o&&(s=0)},t.prototype.values=function(){var n=this.dense,i=this.capacity,o=this.size,a=this.start,s=0;return new r(function(){if(s>=o)return{done:!0};var c=n[a];return a++,s++,a===i&&(a=0),{value:c,done:!1}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.values),t.prototype.inspect=function(){var n=[];return this.forEach(function(i){n.push(i)}),Object.defineProperty(n,"constructor",{value:t,enumerable:!1}),n.capacity=this.capacity,n},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),Fi=t,Fi}var Vi,qs;function zc(){if(qs)return Vi;qs=1;function r(t){return function(n){return typeof n!="number"&&(n=n.length),Math.floor(t()*n)}}var e=r(Math.random);return e.createRandomIndex=r,Vi=e,Vi}var Nn={},Ki,Ys;function Sg(){if(Ys)return Ki;Ys=1;function r(t){return function(n,i){return n+Math.floor(t()*(i-n+1))}}var e=r(Math.random);return e.createRandom=r,Ki=e,Ki}var Xs;function Cg(){if(Xs)return Nn;Xs=1;var r=Lo(),e=Sg().createRandom;function t(i,o,a){var s=i.get(o);typeof s>"u"&&(s=0),s+=a,i.set(o,s)}function n(i,o){o=o||{};var a=o.rng||Math.random,s="randomness"in o?o.randomness:.01;this.index=i,this.random=e(a),this.randomness=s,this.rng=a;var c=i.counts.constructor,l=i.weights.constructor,d=i.C;this.resolution=i.resolution,this.B=i.C,this.C=0,this.communitiesOffsets=new c(d),this.nodesSortedByCommunities=new c(d),this.communitiesBounds=new c(d+1),this.communityWeights=new l(d),this.degrees=new l(d),this.nonSingleton=new Uint8Array(d),this.externalEdgeWeightPerCommunity=new l(d),this.belongings=new c(d),this.neighboringCommunities=new r(l,d),this.cumulativeIncrement=new Float64Array(d),this.macroCommunities=null}return n.prototype.groupByCommunities=function(){var i=this.index,o,a,s,c,l;for(o=0,l=0,a=0;a<i.C;a++)s=i.counts[a],s!==0&&(this.communitiesBounds[l++]=o,o+=s,this.communitiesOffsets[a]=o);for(this.communitiesBounds[l]=o,l=0,a=0;a<i.C;a++)c=i.belongings[a],l=--this.communitiesOffsets[c],this.nodesSortedByCommunities[l]=a;this.B=i.C-i.U,this.C=i.C},n.prototype.communities=function(){var i=new Array(this.B),o,a,s,c,l;for(o=0;o<this.B;o++){for(c=this.communitiesBounds[o],l=this.communitiesBounds[o+1],s=[],a=c;a<l;a++)s.push(a);i[o]=s}return i},n.prototype.mergeNodesSubset=function(i,o){var a=this.index,s=a.belongings[this.nodesSortedByCommunities[i]],c=this.neighboringCommunities,l=0,d,f,h,g,y,C;for(f=i;f<o;f++)for(d=this.nodesSortedByCommunities[f],this.belongings[d]=d,this.nonSingleton[d]=0,this.degrees[d]=0,l+=a.loops[d]/2,this.communityWeights[d]=a.loops[d],this.externalEdgeWeightPerCommunity[d]=0,g=a.starts[d],y=a.starts[d+1];g<y;g++)C=a.neighborhood[g],h=a.weights[g],this.degrees[d]+=h,a.belongings[C]===s&&(l+=h,this.externalEdgeWeightPerCommunity[d]+=h,this.communityWeights[d]+=h);var b=this.externalEdgeWeightPerCommunity.slice(),m,A,v,p=o-i,E,S,$,x,D,I,j,O,w,ge,ce,L,_;for(A=this.random(i,o-1),m=i;m<o;m++,A++)if(f=i+A%p,d=this.nodesSortedByCommunities[f],this.nonSingleton[d]!==1&&!(this.externalEdgeWeightPerCommunity[d]<this.communityWeights[d]*(l/2-this.communityWeights[d])*this.resolution)){for(this.communityWeights[d]=0,this.externalEdgeWeightPerCommunity[d]=0,c.clear(),c.set(d,0),E=0,g=a.starts[d],y=a.starts[d+1];g<y;g++)C=a.neighborhood[g],a.belongings[C]===s&&(h=a.weights[g],E+=h,t(c,this.belongings[C],h));for(S=d,x=0,D=0,v=0;v<c.size;v++)I=c.dense[v],j=c.vals[v],O=this.communityWeights[I],this.externalEdgeWeightPerCommunity[I]>=O*(l/2-O)*this.resolution&&($=j-(E+a.loops[d])*O*this.resolution/l,$>x&&(S=I,x=$),$>=0&&(D+=Math.exp($/this.randomness))),this.cumulativeIncrement[v]=D;if(D<Number.MAX_VALUE&&D<1/0){for(w=D*this.rng(),ge=-1,ce=c.size+1;ge<ce-1;)L=ge+ce>>>1,this.cumulativeIncrement[L]>=w?ce=L:ge=L;_=c.dense[ce]}else _=S;for(this.communityWeights[_]+=E+a.loops[d],g=a.starts[d],y=a.starts[d+1];g<y;g++)C=a.neighborhood[g],a.belongings[C]===s&&(I=this.belongings[C],I===_?this.externalEdgeWeightPerCommunity[_]-=b[C]:this.externalEdgeWeightPerCommunity[_]+=b[C]);_!==d&&(this.belongings[d]=_,this.nonSingleton[_]=1,this.C--)}var K=this.neighboringCommunities;for(K.clear(),f=i;f<o;f++)d=this.nodesSortedByCommunities[f],K.set(this.belongings[d],1);return K.dense.slice(0,K.size)},n.prototype.refinePartition=function(){this.groupByCommunities(),this.macroCommunities=new Array(this.B);var i,o,a,s,c=this.communitiesBounds;for(i=0;i<this.B;i++)o=c[i],a=c[i+1],s=this.mergeNodesSubset(o,a),this.macroCommunities[i]=s},n.prototype.split=function(){var i=this.index,o=this.neighboringCommunities;o.clear();var a,s,c;for(a=0;a<i.C;a++)s=this.belongings[a],a===s&&(c=i.isolate(a,this.degrees[a]),o.set(s,c));for(a=0;a<i.C;a++)s=this.belongings[a],a!==s&&(c=o.get(s),i.move(a,this.degrees[a],c));var l,d;for(a=0;a<this.macroCommunities.length;a++)for(d=this.macroCommunities[a],l=0;l<d.length;l++)d[l]=o.get(d[l])},n.prototype.zoomOut=function(){var i=this.index;this.refinePartition(),this.split();var o=i.zoomOut(),a,s,c,l,d;for(l=0;l<this.macroCommunities.length;l++)for(a=this.macroCommunities[l],s=o[a[0]],d=1;d<a.length;d++)c=o[a[d]],i.expensiveMove(c,s)},n.prototype.onlySingletons=function(){var i=this.index,o;for(o=0;o<i.C;o++)if(i.counts[o]>1)return!1;return!0},Nn.addWeightToCommunity=t,Nn.UndirectedLeidenAddenda=n,Nn}var Pn={},Qr={},Js;function Nc(){if(Js)return Qr;Js=1;function r(n){return typeof n!="number"||isNaN(n)?1:n}function e(n,i){var o={},a=function(l){return typeof l>"u"?i:l};typeof i=="function"&&(a=i);var s=function(l){return a(l[n])},c=function(){return a(void 0)};return typeof n=="string"?(o.fromAttributes=s,o.fromGraph=function(l,d){return s(l.getNodeAttributes(d))},o.fromEntry=function(l,d){return s(d)}):typeof n=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},o.fromGraph=function(l,d){return a(n(d,l.getNodeAttributes(d)))},o.fromEntry=function(l,d){return a(n(l,d))}):(o.fromAttributes=c,o.fromGraph=c,o.fromEntry=c),o}function t(n,i){var o={},a=function(l){return typeof l>"u"?i:l};typeof i=="function"&&(a=i);var s=function(l){return a(l[n])},c=function(){return a(void 0)};return typeof n=="string"?(o.fromAttributes=s,o.fromGraph=function(l,d){return s(l.getEdgeAttributes(d))},o.fromEntry=function(l,d){return s(d)},o.fromPartialEntry=o.fromEntry,o.fromMinimalEntry=o.fromEntry):typeof n=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},o.fromGraph=function(l,d){var f=l.extremities(d);return a(n(d,l.getEdgeAttributes(d),f[0],f[1],l.getNodeAttributes(f[0]),l.getNodeAttributes(f[1]),l.isUndirected(d)))},o.fromEntry=function(l,d,f,h,g,y,C){return a(n(l,d,f,h,g,y,C))},o.fromPartialEntry=function(l,d,f,h){return a(n(l,d,f,h))},o.fromMinimalEntry=function(l,d){return a(n(l,d))}):(o.fromAttributes=c,o.fromGraph=c,o.fromEntry=c,o.fromMinimalEntry=c),o}return Qr.createNodeValueGetter=e,Qr.createEdgeValueGetter=t,Qr.createEdgeWeightGetter=function(n){return t(n,r)},Qr}var Zs;function Pc(){if(Zs)return Pn;Zs=1;var r=Io(),e=Do(),t=Nc().createEdgeWeightGetter,n=Symbol.for("nodejs.util.inspect.custom"),i={getEdgeWeight:"weight",keepDendrogram:!1,resolution:1};function o(s,c){c=e(c,i);var l=c.resolution,d=t(c.getEdgeWeight).fromEntry,f=(s.size-s.selfLoopCount)*2,h=r.getPointerArray(f),g=r.getPointerArray(s.order+1),y=c.getEdgeWeight?Float64Array:r.getPointerArray(s.size*2);this.C=s.order,this.M=0,this.E=f,this.U=0,this.resolution=l,this.level=0,this.graph=s,this.nodes=new Array(s.order),this.keepDendrogram=c.keepDendrogram,this.neighborhood=new g(f),this.weights=new y(f),this.loops=new y(s.order),this.starts=new h(s.order+1),this.belongings=new g(s.order),this.dendrogram=[],this.mapping=null,this.counts=new g(s.order),this.unused=new g(s.order),this.totalWeights=new y(s.order);var C={},b,m=0,A=0,v=this;s.forEachNode(function(p){v.nodes[m]=p,C[p]=m,A+=s.undirectedDegreeWithoutSelfLoops(p),v.starts[m]=A,v.belongings[m]=m,v.counts[m]=1,m++}),s.forEachEdge(function(p,E,S,$,x,D,I){if(b=d(p,E,S,$,x,D,I),S=C[S],$=C[$],v.M+=b,S===$)v.totalWeights[S]+=b*2,v.loops[S]=b*2;else{v.totalWeights[S]+=b,v.totalWeights[$]+=b;var j=--v.starts[S],O=--v.starts[$];v.neighborhood[j]=$,v.neighborhood[O]=S,v.weights[j]=b,v.weights[O]=b}}),this.starts[m]=this.E,this.keepDendrogram?this.dendrogram.push(this.belongings.slice()):this.mapping=this.belongings.slice()}o.prototype.isolate=function(s,c){var l=this.belongings[s];if(this.counts[l]===1)return l;var d=this.unused[--this.U],f=this.loops[s];return this.totalWeights[l]-=c+f,this.totalWeights[d]+=c+f,this.belongings[s]=d,this.counts[l]--,this.counts[d]++,d},o.prototype.move=function(s,c,l){var d=this.belongings[s],f=this.loops[s];this.totalWeights[d]-=c+f,this.totalWeights[l]+=c+f,this.belongings[s]=l;var h=this.counts[d]--===1;this.counts[l]++,h&&(this.unused[this.U++]=d)},o.prototype.computeNodeDegree=function(s){var c,l,d,f=0;for(c=this.starts[s],l=this.starts[s+1];c<l;c++)d=this.weights[c],f+=d;return f},o.prototype.expensiveIsolate=function(s){var c=this.computeNodeDegree(s);return this.isolate(s,c)},o.prototype.expensiveMove=function(s,c){var l=this.computeNodeDegree(s);this.move(s,l,c)},o.prototype.zoomOut=function(){var s=new Array(this.C-this.U),c={},l=this.nodes.length,d=0,f=0,h,g,y,C,b,m,A,v,p;for(h=0,y=this.C;h<y;h++)m=this.belongings[h],m in c||(c[m]=d,s[d]={adj:{},totalWeights:this.totalWeights[m],internalWeights:0},d++),this.belongings[h]=c[m];var E,S;if(this.keepDendrogram){for(E=this.dendrogram[this.level],S=new(r.getPointerArray(d))(l),h=0;h<l;h++)S[h]=this.belongings[E[h]];this.dendrogram.push(S)}else for(h=0;h<l;h++)this.mapping[h]=this.belongings[this.mapping[h]];for(h=0,y=this.C;h<y;h++)for(m=this.belongings[h],v=s[m],p=v.adj,v.internalWeights+=this.loops[h],g=this.starts[h],C=this.starts[h+1];g<C;g++){if(b=this.neighborhood[g],A=this.belongings[b],m===A){v.internalWeights+=this.weights[g];continue}A in p||(p[A]=0),p[A]+=this.weights[g]}for(this.C=d,b=0,m=0;m<d;m++){v=s[m],p=v.adj,m=+m,this.totalWeights[m]=v.totalWeights,this.loops[m]=v.internalWeights,this.counts[m]=1,this.starts[m]=b,this.belongings[m]=m;for(A in p)this.neighborhood[b]=+A,this.weights[b]=p[A],f++,b++}return this.starts[d]=f,this.E=f,this.U=0,this.level++,c},o.prototype.modularity=function(){var s,c,l,d,f,h=0,g=this.M*2,y=new Float64Array(this.C);for(l=0;l<this.C;l++)for(s=this.belongings[l],y[s]+=this.loops[l],d=this.starts[l],f=this.starts[l+1];d<f;d++)c=this.belongings[this.neighborhood[d]],s===c&&(y[s]+=this.weights[d]);for(l=0;l<this.C;l++)h+=y[l]/g-Math.pow(this.totalWeights[l]/g,2)*this.resolution;return h},o.prototype.delta=function(s,c,l,d){var f=this.M,h=this.totalWeights[d];return c+=this.loops[s],l/f-h*c*this.resolution/(2*f*f)},o.prototype.deltaWithOwnCommunity=function(s,c,l,d){var f=this.M,h=this.totalWeights[d];return c+=this.loops[s],l/f-(h-c)*c*this.resolution/(2*f*f)},o.prototype.fastDelta=function(s,c,l,d){var f=this.M,h=this.totalWeights[d];return c+=this.loops[s],l-c*h*this.resolution/(2*f)},o.prototype.fastDeltaWithOwnCommunity=function(s,c,l,d){var f=this.M,h=this.totalWeights[d];return c+=this.loops[s],l-c*(h-c)*this.resolution/(2*f)},o.prototype.bounds=function(s){return[this.starts[s],this.starts[s+1]]},o.prototype.project=function(){var s=this,c={};return s.nodes.slice(0,this.C).forEach(function(l,d){c[l]=Array.from(s.neighborhood.slice(s.starts[d],s.starts[d+1])).map(function(f){return s.nodes[f]})}),c},o.prototype.collect=function(s){arguments.length<1&&(s=this.level);var c={},l=this.keepDendrogram?this.dendrogram[s]:this.mapping,d,f;for(d=0,f=l.length;d<f;d++)c[this.nodes[d]]=l[d];return c},o.prototype.assign=function(s,c){arguments.length<2&&(c=this.level);var l=this.keepDendrogram?this.dendrogram[c]:this.mapping,d,f;for(d=0,f=l.length;d<f;d++)this.graph.setNodeAttribute(this.nodes[d],s,l[d])},o.prototype[n]=function(){var s={};Object.defineProperty(s,"constructor",{value:o,enumerable:!1}),s.C=this.C,s.M=this.M,s.E=this.E,s.U=this.U,s.resolution=this.resolution,s.level=this.level,s.nodes=this.nodes,s.starts=this.starts.slice(0,s.C+1);var c=["neighborhood","weights"],l=["counts","loops","belongings","totalWeights"],d=this;return c.forEach(function(f){s[f]=d[f].slice(0,s.E)}),l.forEach(function(f){s[f]=d[f].slice(0,s.C)}),s.unused=this.unused.slice(0,this.U),this.keepDendrogram?s.dendrogram=this.dendrogram:s.mapping=this.mapping,s};function a(s,c){c=e(c,i);var l=c.resolution,d=t(c.getEdgeWeight).fromEntry,f=(s.size-s.selfLoopCount)*2,h=r.getPointerArray(f),g=r.getPointerArray(s.order+1),y=c.getEdgeWeight?Float64Array:r.getPointerArray(s.size*2);this.C=s.order,this.M=0,this.E=f,this.U=0,this.resolution=l,this.level=0,this.graph=s,this.nodes=new Array(s.order),this.keepDendrogram=c.keepDendrogram,this.neighborhood=new g(f),this.weights=new y(f),this.loops=new y(s.order),this.starts=new h(s.order+1),this.offsets=new h(s.order),this.belongings=new g(s.order),this.dendrogram=[],this.counts=new g(s.order),this.unused=new g(s.order),this.totalInWeights=new y(s.order),this.totalOutWeights=new y(s.order);var C={},b,m=0,A=0,v=this;s.forEachNode(function(p){v.nodes[m]=p,C[p]=m,A+=s.outDegreeWithoutSelfLoops(p),v.starts[m]=A,A+=s.inDegreeWithoutSelfLoops(p),v.offsets[m]=A,v.belongings[m]=m,v.counts[m]=1,m++}),s.forEachEdge(function(p,E,S,$,x,D,I){if(b=d(p,E,S,$,x,D,I),S=C[S],$=C[$],v.M+=b,S===$)v.loops[S]+=b,v.totalInWeights[S]+=b,v.totalOutWeights[S]+=b;else{v.totalOutWeights[S]+=b,v.totalInWeights[$]+=b;var j=--v.starts[S],O=--v.offsets[$];v.neighborhood[j]=$,v.neighborhood[O]=S,v.weights[j]=b,v.weights[O]=b}}),this.starts[m]=this.E,this.keepDendrogram?this.dendrogram.push(this.belongings.slice()):this.mapping=this.belongings.slice()}return a.prototype.bounds=o.prototype.bounds,a.prototype.inBounds=function(s){return[this.offsets[s],this.starts[s+1]]},a.prototype.outBounds=function(s){return[this.starts[s],this.offsets[s]]},a.prototype.project=o.prototype.project,a.prototype.projectIn=function(){var s=this,c={};return s.nodes.slice(0,this.C).forEach(function(l,d){c[l]=Array.from(s.neighborhood.slice(s.offsets[d],s.starts[d+1])).map(function(f){return s.nodes[f]})}),c},a.prototype.projectOut=function(){var s=this,c={};return s.nodes.slice(0,this.C).forEach(function(l,d){c[l]=Array.from(s.neighborhood.slice(s.starts[d],s.offsets[d])).map(function(f){return s.nodes[f]})}),c},a.prototype.isolate=function(s,c,l){var d=this.belongings[s];if(this.counts[d]===1)return d;var f=this.unused[--this.U],h=this.loops[s];return this.totalInWeights[d]-=c+h,this.totalInWeights[f]+=c+h,this.totalOutWeights[d]-=l+h,this.totalOutWeights[f]+=l+h,this.belongings[s]=f,this.counts[d]--,this.counts[f]++,f},a.prototype.move=function(s,c,l,d){var f=this.belongings[s],h=this.loops[s];this.totalInWeights[f]-=c+h,this.totalInWeights[d]+=c+h,this.totalOutWeights[f]-=l+h,this.totalOutWeights[d]+=l+h,this.belongings[s]=d;var g=this.counts[f]--===1;this.counts[d]++,g&&(this.unused[this.U++]=f)},a.prototype.computeNodeInDegree=function(s){var c,l,d,f=0;for(c=this.offsets[s],l=this.starts[s+1];c<l;c++)d=this.weights[c],f+=d;return f},a.prototype.computeNodeOutDegree=function(s){var c,l,d,f=0;for(c=this.starts[s],l=this.offsets[s];c<l;c++)d=this.weights[c],f+=d;return f},a.prototype.expensiveMove=function(s,c){var l=this.computeNodeInDegree(s),d=this.computeNodeOutDegree(s);this.move(s,l,d,c)},a.prototype.zoomOut=function(){var s=new Array(this.C-this.U),c={},l=this.nodes.length,d=0,f=0,h,g,y,C,b,m,A,v,p,E,S,$,x;for(h=0,y=this.C;h<y;h++)m=this.belongings[h],m in c||(c[m]=d,s[d]={inAdj:{},outAdj:{},totalInWeights:this.totalInWeights[m],totalOutWeights:this.totalOutWeights[m],internalWeights:0},d++),this.belongings[h]=c[m];var D,I;if(this.keepDendrogram){for(D=this.dendrogram[this.level],I=new(r.getPointerArray(d))(l),h=0;h<l;h++)I[h]=this.belongings[D[h]];this.dendrogram.push(I)}else for(h=0;h<l;h++)this.mapping[h]=this.belongings[this.mapping[h]];for(h=0,y=this.C;h<y;h++)for(m=this.belongings[h],p=this.offsets[h],v=s[m],$=v.inAdj,x=v.outAdj,v.internalWeights+=this.loops[h],g=this.starts[h],C=this.starts[h+1];g<C;g++){if(b=this.neighborhood[g],A=this.belongings[b],E=g<p,S=E?x:$,m===A){E&&(v.internalWeights+=this.weights[g]);continue}A in S||(S[A]=0),S[A]+=this.weights[g]}for(this.C=d,b=0,m=0;m<d;m++){v=s[m],$=v.inAdj,x=v.outAdj,m=+m,this.totalInWeights[m]=v.totalInWeights,this.totalOutWeights[m]=v.totalOutWeights,this.loops[m]=v.internalWeights,this.counts[m]=1,this.starts[m]=b,this.belongings[m]=m;for(A in x)this.neighborhood[b]=+A,this.weights[b]=x[A],f++,b++;this.offsets[m]=b;for(A in $)this.neighborhood[b]=+A,this.weights[b]=$[A],f++,b++}return this.starts[d]=f,this.E=f,this.U=0,this.level++,c},a.prototype.modularity=function(){var s,c,l,d,f,h=0,g=this.M,y=new Float64Array(this.C);for(l=0;l<this.C;l++)for(s=this.belongings[l],y[s]+=this.loops[l],d=this.starts[l],f=this.offsets[l];d<f;d++)c=this.belongings[this.neighborhood[d]],s===c&&(y[s]+=this.weights[d]);for(l=0;l<this.C;l++)h+=y[l]/g-this.totalInWeights[l]*this.totalOutWeights[l]/Math.pow(g,2)*this.resolution;return h},a.prototype.delta=function(s,c,l,d,f){var h=this.M,g=this.totalInWeights[f],y=this.totalOutWeights[f],C=this.loops[s];return c+=C,l+=C,d/h-(l*g+c*y)*this.resolution/(h*h)},a.prototype.deltaWithOwnCommunity=function(s,c,l,d,f){var h=this.M,g=this.totalInWeights[f],y=this.totalOutWeights[f],C=this.loops[s];return c+=C,l+=C,d/h-(l*(g-c)+c*(y-l))*this.resolution/(h*h)},a.prototype.collect=o.prototype.collect,a.prototype.assign=o.prototype.assign,a.prototype[n]=function(){var s={};Object.defineProperty(s,"constructor",{value:a,enumerable:!1}),s.C=this.C,s.M=this.M,s.E=this.E,s.U=this.U,s.resolution=this.resolution,s.level=this.level,s.nodes=this.nodes,s.starts=this.starts.slice(0,s.C+1);var c=["neighborhood","weights"],l=["counts","offsets","loops","belongings","totalInWeights","totalOutWeights"],d=this;return c.forEach(function(f){s[f]=d[f].slice(0,s.E)}),l.forEach(function(f){s[f]=d[f].slice(0,s.C)}),s.unused=this.unused.slice(0,this.U),this.keepDendrogram?s.dendrogram=this.dendrogram:s.mapping=this.mapping,s},Pn.UndirectedLouvainIndex=o,Pn.DirectedLouvainIndex=a,Pn}var Hi,Qs;function Ag(){if(Qs)return Hi;Qs=1;var r=Do(),e=ni(),t=Rc(),n=Lo(),i=Mc(),o=zc().createRandomIndex,a=Cg(),s=Pc(),c=a.addWeightToCommunity,l=s.UndirectedLouvainIndex,d=a.UndirectedLeidenAddenda,f={attributes:{community:"community",weight:"weight"},randomness:.01,randomWalk:!0,resolution:1,rng:Math.random,weighted:!1,maxIterations:0},h=1e-10;function g(m,A,v,p,E){return Math.abs(p-E)<h?m===A?!1:v>m:p>E}function y(m,A,v){for(var p=new l(A,{attributes:{weight:v.attributes.weight},keepDendrogram:m,resolution:v.resolution,weighted:v.weighted}),E=new d(p,{randomness:v.randomness,rng:v.rng}),S=o(v.rng),$,x,D=new n(Float64Array,p.C),I=new i(p.C),j,O,w,ge,ce,L,_,K,ee,z,Re,ae,W,Ee,Ce,be=0,Ye=0,ot=[],Ae,ve=0;!(v.maxIterations>0&&ve>=v.maxIterations);){for(ve++,ee=p.C,Ae=0,ce=v.randomWalk?S(ee):0,L=0;L<ee;L++,ce++)_=ce%ee,I.enqueue(_);for(;I.size!==0;){for(_=I.dequeue(),Ye++,z=0,D.clear(),$=p.belongings[_],j=p.starts[_],O=p.starts[_+1];j<O;j++)K=p.neighborhood[j],w=p.weights[j],x=p.belongings[K],z+=w,c(D,x,w);W=p.fastDeltaWithOwnCommunity(_,z,D.get($)||0,$),ae=$;var X=[[$,W,"own",p.counts[$]===1]];for(ge=0;ge<D.size;ge++)x=D.dense[ge],x!==$&&(Re=D.vals[ge],be++,Ce=p.fastDelta(_,z,Re,x),X.push([x,Ce,"other"]),Ee=g(ae,$,x,Ce,W),Ee&&(W=Ce,ae=x));if(W<0){if(ae=p.isolate(_,z),ae===$)continue}else{if(ae===$)continue;p.move(_,z,ae)}for(Ae++,j=p.starts[_],O=p.starts[_+1];j<O;j++)K=p.neighborhood[j],x=p.belongings[K],x!==ae&&I.enqueue(K)}if(ot.push(Ae),Ae===0){p.zoomOut();break}if(!E.onlySingletons()){E.zoomOut();continue}break}var me={index:p,deltaComputations:be,nodesVisited:Ye,moves:ot};return me}function C(m,A,v,p){if(!e(v))throw new Error("graphology-communities-leiden: the given graph is not a valid graphology instance.");var E=t(v);if(E==="mixed")throw new Error("graphology-communities-leiden: cannot run the algorithm on a true mixed graph.");if(E==="directed")throw new Error("graphology-communities-leiden: not yet implemented for directed graphs.");p=r(p,f);var S=0;if(v.size===0){if(m){v.forEachNode(function(O){v.setNodeAttribute(O,p.attributes.communities,S++)});return}var $={};return v.forEachNode(function(O){$[O]=S++}),A?{communities:$,count:v.order,deltaComputations:0,dendrogram:null,level:0,modularity:NaN,moves:null,nodesVisited:0,resolution:p.resolution}:$}var x=y,D=x(A,v,p),I=D.index;if(!A){if(m){I.assign(p.attributes.community);return}return I.collect()}var j={count:I.C,deltaComputations:D.deltaComputations,dendrogram:I.dendrogram,level:I.level,modularity:I.modularity(),moves:D.moves,nodesVisited:D.nodesVisited,resolution:p.resolution};return m?(I.assign(p.attributes.community),j):(j.communities=I.collect(),j)}var b=C.bind(null,!1,!1);return b.assign=C.bind(null,!0,!1),b.detailed=C.bind(null,!1,!0),b.defaults=f,Hi=b,Hi}var $g=Ag();const Dg=Eo($g);var qi,ea;function Ig(){if(ea)return qi;ea=1;var r=Do(),e=ni(),t=Rc(),n=Lo(),i=Mc(),o=zc().createRandomIndex,a=Pc(),s=a.UndirectedLouvainIndex,c=a.DirectedLouvainIndex,l={nodeCommunityAttribute:"community",getEdgeWeight:"weight",fastLocalMoves:!0,randomWalk:!0,resolution:1,rng:Math.random};function d(m,A,v){var p=m.get(A);typeof p>"u"&&(p=0),p+=v,m.set(A,p)}var f=1e-10;function h(m,A,v,p,E){return Math.abs(p-E)<f?m===A?!1:v>m:p>E}function g(m,A,v){var p=new s(A,{getEdgeWeight:v.getEdgeWeight,keepDendrogram:m,resolution:v.resolution}),E=o(v.rng),S=!0,$=!0,x,D,I=new n(Float64Array,p.C),j,O,w,ge,ce,L,_,K,ee,z,Re,ae,W,Ee,Ce,be,Ye=0,ot=0,Ae=[],ve,X;for(v.fastLocalMoves&&(j=new i(p.C));S;){if(z=p.C,S=!1,$=!0,v.fastLocalMoves){for(X=0,L=v.randomWalk?E(z):0,_=0;_<z;_++,L++)K=L%z,j.enqueue(K);for(;j.size!==0;){for(K=j.dequeue(),ot++,Re=0,I.clear(),x=p.belongings[K],O=p.starts[K],w=p.starts[K+1];O<w;O++)ee=p.neighborhood[O],ge=p.weights[O],D=p.belongings[ee],Re+=ge,d(I,D,ge);for(Ee=p.fastDeltaWithOwnCommunity(K,Re,I.get(x)||0,x),W=x,ce=0;ce<I.size;ce++)D=I.dense[ce],D!==x&&(ae=I.vals[ce],Ye++,be=p.fastDelta(K,Re,ae,D),Ce=h(W,x,D,be,Ee),Ce&&(Ee=be,W=D));if(Ee<0){if(W=p.isolate(K,Re),W===x)continue}else{if(W===x)continue;p.move(K,Re,W)}for(S=!0,X++,O=p.starts[K],w=p.starts[K+1];O<w;O++)ee=p.neighborhood[O],D=p.belongings[ee],D!==W&&j.enqueue(ee)}Ae.push(X)}else for(ve=[],Ae.push(ve);$;){for($=!1,X=0,L=v.randomWalk?E(z):0,_=0;_<z;_++,L++){for(K=L%z,ot++,Re=0,I.clear(),x=p.belongings[K],O=p.starts[K],w=p.starts[K+1];O<w;O++)ee=p.neighborhood[O],ge=p.weights[O],D=p.belongings[ee],Re+=ge,d(I,D,ge);for(Ee=p.fastDeltaWithOwnCommunity(K,Re,I.get(x)||0,x),W=x,ce=0;ce<I.size;ce++)D=I.dense[ce],D!==x&&(ae=I.vals[ce],Ye++,be=p.fastDelta(K,Re,ae,D),Ce=h(W,x,D,be,Ee),Ce&&(Ee=be,W=D));if(Ee<0){if(W=p.isolate(K,Re),W===x)continue}else{if(W===x)continue;p.move(K,Re,W)}$=!0,X++}ve.push(X),S=$||S}S&&p.zoomOut()}var me={index:p,deltaComputations:Ye,nodesVisited:ot,moves:Ae};return me}function y(m,A,v){var p=new c(A,{getEdgeWeight:v.getEdgeWeight,keepDendrogram:m,resolution:v.resolution}),E=o(v.rng),S=!0,$=!0,x,D,I=new n(Float64Array,p.C),j,O,w,ge,ce,L,_,K,ee,z,Re,ae,W,Ee,Ce,be,Ye,ot,Ae,ve=0,X=0,me=[],et,J;for(v.fastLocalMoves&&(j=new i(p.C));S;){if(ae=p.C,S=!1,$=!0,v.fastLocalMoves){for(J=0,K=v.randomWalk?E(ae):0,ee=0;ee<ae;ee++,K++)z=K%ae,j.enqueue(z);for(;j.size!==0;){for(z=j.dequeue(),X++,W=0,Ee=0,I.clear(),x=p.belongings[z],O=p.starts[z],w=p.starts[z+1],ge=p.offsets[z];O<w;O++)ce=O<ge,Re=p.neighborhood[O],L=p.weights[O],D=p.belongings[Re],ce?Ee+=L:W+=L,d(I,D,L);for(Ye=p.deltaWithOwnCommunity(z,W,Ee,I.get(x)||0,x),be=x,_=0;_<I.size;_++)D=I.dense[_],D!==x&&(Ce=I.vals[_],ve++,Ae=p.delta(z,W,Ee,Ce,D),ot=h(be,x,D,Ae,Ye),ot&&(Ye=Ae,be=D));if(Ye<0){if(be=p.isolate(z,W,Ee),be===x)continue}else{if(be===x)continue;p.move(z,W,Ee,be)}for(S=!0,J++,O=p.starts[z],w=p.starts[z+1];O<w;O++)Re=p.neighborhood[O],D=p.belongings[Re],D!==be&&j.enqueue(Re)}me.push(J)}else for(et=[],me.push(et);$;){for($=!1,J=0,K=v.randomWalk?E(ae):0,ee=0;ee<ae;ee++,K++){for(z=K%ae,X++,W=0,Ee=0,I.clear(),x=p.belongings[z],O=p.starts[z],w=p.starts[z+1],ge=p.offsets[z];O<w;O++)ce=O<ge,Re=p.neighborhood[O],L=p.weights[O],D=p.belongings[Re],ce?Ee+=L:W+=L,d(I,D,L);for(Ye=p.deltaWithOwnCommunity(z,W,Ee,I.get(x)||0,x),be=x,_=0;_<I.size;_++)D=I.dense[_],D!==x&&(Ce=I.vals[_],ve++,Ae=p.delta(z,W,Ee,Ce,D),ot=h(be,x,D,Ae,Ye),ot&&(Ye=Ae,be=D));if(Ye<0){if(be=p.isolate(z,W,Ee),be===x)continue}else{if(be===x)continue;p.move(z,W,Ee,be)}$=!0,J++}et.push(J),S=$||S}S&&p.zoomOut()}var ne={index:p,deltaComputations:ve,nodesVisited:X,moves:me};return ne}function C(m,A,v,p){if(!e(v))throw new Error("graphology-communities-louvain: the given graph is not a valid graphology instance.");var E=t(v);if(E==="mixed")throw new Error("graphology-communities-louvain: cannot run the algorithm on a true mixed graph.");p=r(p,l);var S=0;if(v.size===0){if(m){v.forEachNode(function(O){v.setNodeAttribute(O,p.nodeCommunityAttribute,S++)});return}var $={};return v.forEachNode(function(O){$[O]=S++}),A?{communities:$,count:v.order,deltaComputations:0,dendrogram:null,level:0,modularity:NaN,moves:null,nodesVisited:0,resolution:p.resolution}:$}var x=E==="undirected"?g:y,D=x(A,v,p),I=D.index;if(!A){if(m){I.assign(p.nodeCommunityAttribute);return}return I.collect()}var j={count:I.C,deltaComputations:D.deltaComputations,dendrogram:I.dendrogram,level:I.level,modularity:I.modularity(),moves:D.moves,nodesVisited:D.nodesVisited,resolution:p.resolution};return m?(I.assign(p.nodeCommunityAttribute),j):(j.communities=I.collect(),j)}var b=C.bind(null,!1,!1);return b.assign=C.bind(null,!0,!1),b.detailed=C.bind(null,!1,!0),b.defaults=l,qi=b,qi}var Lg=Ig();const Tg=Eo(Lg);var Yi,ta;function Gg(){if(ta)return Yi;ta=1;var r=0,e=1,t=2,n=3,i=4,o=5,a=6,s=7,c=8,l=9,d=0,f=1,h=2,g=0,y=1,C=2,b=3,m=4,A=5,v=6,p=7,E=8,S=3,$=10,x=3,D=9,I=10;return Yi=function(O,w,ge){var ce,L,_,K,ee,z,Re,ae,W,Ee,Ce=w.length,be=ge.length,Ye=O.adjustSizes,ot=O.barnesHutTheta*O.barnesHutTheta,Ae,ve,X,me,et,J,ne,G=[];for(_=0;_<Ce;_+=$)w[_+i]=w[_+t],w[_+o]=w[_+n],w[_+t]=0,w[_+n]=0;if(O.outboundAttractionDistribution){for(Ae=0,_=0;_<Ce;_+=$)Ae+=w[_+a];Ae/=Ce/$}if(O.barnesHutOptimize){var It=1/0,Rt=-1/0,Ot=1/0,Ht=-1/0,$t,_t,tt;for(_=0;_<Ce;_+=$)It=Math.min(It,w[_+r]),Rt=Math.max(Rt,w[_+r]),Ot=Math.min(Ot,w[_+e]),Ht=Math.max(Ht,w[_+e]);var Pt=Rt-It,nr=Ht-Ot;for(Pt>nr?(Ot-=(Pt-nr)/2,Ht=Ot+Pt):(It-=(nr-Pt)/2,Rt=It+nr),G[0+g]=-1,G[0+y]=(It+Rt)/2,G[0+C]=(Ot+Ht)/2,G[0+b]=Math.max(Rt-It,Ht-Ot),G[0+m]=-1,G[0+A]=-1,G[0+v]=0,G[0+p]=0,G[0+E]=0,ce=1,_=0;_<Ce;_+=$)for(L=0,tt=S;;)if(G[L+A]>=0){w[_+r]<G[L+y]?w[_+e]<G[L+C]?$t=G[L+A]:$t=G[L+A]+D:w[_+e]<G[L+C]?$t=G[L+A]+D*2:$t=G[L+A]+D*3,G[L+p]=(G[L+p]*G[L+v]+w[_+r]*w[_+a])/(G[L+v]+w[_+a]),G[L+E]=(G[L+E]*G[L+v]+w[_+e]*w[_+a])/(G[L+v]+w[_+a]),G[L+v]+=w[_+a],L=$t;continue}else if(G[L+g]<0){G[L+g]=_;break}else{if(G[L+A]=ce*D,ae=G[L+b]/2,W=G[L+A],G[W+g]=-1,G[W+y]=G[L+y]-ae,G[W+C]=G[L+C]-ae,G[W+b]=ae,G[W+m]=W+D,G[W+A]=-1,G[W+v]=0,G[W+p]=0,G[W+E]=0,W+=D,G[W+g]=-1,G[W+y]=G[L+y]-ae,G[W+C]=G[L+C]+ae,G[W+b]=ae,G[W+m]=W+D,G[W+A]=-1,G[W+v]=0,G[W+p]=0,G[W+E]=0,W+=D,G[W+g]=-1,G[W+y]=G[L+y]+ae,G[W+C]=G[L+C]-ae,G[W+b]=ae,G[W+m]=W+D,G[W+A]=-1,G[W+v]=0,G[W+p]=0,G[W+E]=0,W+=D,G[W+g]=-1,G[W+y]=G[L+y]+ae,G[W+C]=G[L+C]+ae,G[W+b]=ae,G[W+m]=G[L+m],G[W+A]=-1,G[W+v]=0,G[W+p]=0,G[W+E]=0,ce+=4,w[G[L+g]+r]<G[L+y]?w[G[L+g]+e]<G[L+C]?$t=G[L+A]:$t=G[L+A]+D:w[G[L+g]+e]<G[L+C]?$t=G[L+A]+D*2:$t=G[L+A]+D*3,G[L+v]=w[G[L+g]+a],G[L+p]=w[G[L+g]+r],G[L+E]=w[G[L+g]+e],G[$t+g]=G[L+g],G[L+g]=-1,w[_+r]<G[L+y]?w[_+e]<G[L+C]?_t=G[L+A]:_t=G[L+A]+D:w[_+e]<G[L+C]?_t=G[L+A]+D*2:_t=G[L+A]+D*3,$t===_t)if(tt--){L=$t;continue}else{tt=S;break}G[_t+g]=_;break}}if(O.barnesHutOptimize)for(ve=O.scalingRatio,_=0;_<Ce;_+=$)for(L=0;;)if(G[L+A]>=0)if(J=Math.pow(w[_+r]-G[L+p],2)+Math.pow(w[_+e]-G[L+E],2),Ee=G[L+b],4*Ee*Ee/J<ot){if(X=w[_+r]-G[L+p],me=w[_+e]-G[L+E],Ye===!0?J>0?(ne=ve*w[_+a]*G[L+v]/J,w[_+t]+=X*ne,w[_+n]+=me*ne):J<0&&(ne=-ve*w[_+a]*G[L+v]/Math.sqrt(J),w[_+t]+=X*ne,w[_+n]+=me*ne):J>0&&(ne=ve*w[_+a]*G[L+v]/J,w[_+t]+=X*ne,w[_+n]+=me*ne),L=G[L+m],L<0)break;continue}else{L=G[L+A];continue}else{if(z=G[L+g],z>=0&&z!==_&&(X=w[_+r]-w[z+r],me=w[_+e]-w[z+e],J=X*X+me*me,Ye===!0?J>0?(ne=ve*w[_+a]*w[z+a]/J,w[_+t]+=X*ne,w[_+n]+=me*ne):J<0&&(ne=-ve*w[_+a]*w[z+a]/Math.sqrt(J),w[_+t]+=X*ne,w[_+n]+=me*ne):J>0&&(ne=ve*w[_+a]*w[z+a]/J,w[_+t]+=X*ne,w[_+n]+=me*ne)),L=G[L+m],L<0)break;continue}else for(ve=O.scalingRatio,K=0;K<Ce;K+=$)for(ee=0;ee<K;ee+=$)X=w[K+r]-w[ee+r],me=w[K+e]-w[ee+e],Ye===!0?(J=Math.sqrt(X*X+me*me)-w[K+c]-w[ee+c],J>0?(ne=ve*w[K+a]*w[ee+a]/J/J,w[K+t]+=X*ne,w[K+n]+=me*ne,w[ee+t]-=X*ne,w[ee+n]-=me*ne):J<0&&(ne=100*ve*w[K+a]*w[ee+a],w[K+t]+=X*ne,w[K+n]+=me*ne,w[ee+t]-=X*ne,w[ee+n]-=me*ne)):(J=Math.sqrt(X*X+me*me),J>0&&(ne=ve*w[K+a]*w[ee+a]/J/J,w[K+t]+=X*ne,w[K+n]+=me*ne,w[ee+t]-=X*ne,w[ee+n]-=me*ne));for(W=O.gravity/O.scalingRatio,ve=O.scalingRatio,_=0;_<Ce;_+=$)ne=0,X=w[_+r],me=w[_+e],J=Math.sqrt(Math.pow(X,2)+Math.pow(me,2)),O.strongGravityMode?J>0&&(ne=ve*w[_+a]*W):J>0&&(ne=ve*w[_+a]*W/J),w[_+t]-=X*ne,w[_+n]-=me*ne;for(ve=1*(O.outboundAttractionDistribution?Ae:1),Re=0;Re<be;Re+=x)K=ge[Re+d],ee=ge[Re+f],ae=ge[Re+h],et=Math.pow(ae,O.edgeWeightInfluence),X=w[K+r]-w[ee+r],me=w[K+e]-w[ee+e],Ye===!0?(J=Math.sqrt(X*X+me*me)-w[K+c]-w[ee+c],O.linLogMode?O.outboundAttractionDistribution?J>0&&(ne=-ve*et*Math.log(1+J)/J/w[K+a]):J>0&&(ne=-ve*et*Math.log(1+J)/J):O.outboundAttractionDistribution?J>0&&(ne=-ve*et/w[K+a]):J>0&&(ne=-ve*et)):(J=Math.sqrt(Math.pow(X,2)+Math.pow(me,2)),O.linLogMode?O.outboundAttractionDistribution?J>0&&(ne=-ve*et*Math.log(1+J)/J/w[K+a]):J>0&&(ne=-ve*et*Math.log(1+J)/J):O.outboundAttractionDistribution?(J=1,ne=-ve*et/w[K+a]):(J=1,ne=-ve*et)),J>0&&(w[K+t]+=X*ne,w[K+n]+=me*ne,w[ee+t]-=X*ne,w[ee+n]-=me*ne);var pr,ir,_r,Lt,xr,or;if(Ye===!0)for(_=0;_<Ce;_+=$)w[_+l]!==1&&(pr=Math.sqrt(Math.pow(w[_+t],2)+Math.pow(w[_+n],2)),pr>I&&(w[_+t]=w[_+t]*I/pr,w[_+n]=w[_+n]*I/pr),ir=w[_+a]*Math.sqrt((w[_+i]-w[_+t])*(w[_+i]-w[_+t])+(w[_+o]-w[_+n])*(w[_+o]-w[_+n])),_r=Math.sqrt((w[_+i]+w[_+t])*(w[_+i]+w[_+t])+(w[_+o]+w[_+n])*(w[_+o]+w[_+n]))/2,Lt=.1*Math.log(1+_r)/(1+Math.sqrt(ir)),xr=w[_+r]+w[_+t]*(Lt/O.slowDown),w[_+r]=xr,or=w[_+e]+w[_+n]*(Lt/O.slowDown),w[_+e]=or);else for(_=0;_<Ce;_+=$)w[_+l]!==1&&(ir=w[_+a]*Math.sqrt((w[_+i]-w[_+t])*(w[_+i]-w[_+t])+(w[_+o]-w[_+n])*(w[_+o]-w[_+n])),_r=Math.sqrt((w[_+i]+w[_+t])*(w[_+i]+w[_+t])+(w[_+o]+w[_+n])*(w[_+o]+w[_+n]))/2,Lt=w[_+s]*Math.log(1+_r)/(1+Math.sqrt(ir)),w[_+s]=Math.min(1,Math.sqrt(Lt*(Math.pow(w[_+t],2)+Math.pow(w[_+n],2))/(1+Math.sqrt(ir)))),xr=w[_+r]+w[_+t]*(Lt/O.slowDown),w[_+r]=xr,or=w[_+e]+w[_+n]*(Lt/O.slowDown),w[_+e]=or);return{}},Yi}var Jt={},ra;function Rg(){if(ra)return Jt;ra=1;var r=10,e=3;return Jt.assign=function(t){t=t||{};var n=Array.prototype.slice.call(arguments).slice(1),i,o,a;for(i=0,a=n.length;i<a;i++)if(n[i])for(o in n[i])t[o]=n[i][o];return t},Jt.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},Jt.graphToByteArrays=function(t,n){var i=t.order,o=t.size,a={},s,c=new Float32Array(i*r),l=new Float32Array(o*e);return s=0,t.forEachNode(function(d,f){a[d]=s,c[s]=f.x,c[s+1]=f.y,c[s+2]=0,c[s+3]=0,c[s+4]=0,c[s+5]=0,c[s+6]=1,c[s+7]=1,c[s+8]=f.size||1,c[s+9]=f.fixed?1:0,s+=r}),s=0,t.forEachEdge(function(d,f,h,g,y,C,b){var m=a[h],A=a[g],v=n(d,f,h,g,y,C,b);c[m+6]+=v,c[A+6]+=v,l[s]=m,l[s+1]=A,l[s+2]=v,s+=e}),{nodes:c,edges:l}},Jt.assignLayoutChanges=function(t,n,i){var o=0;t.updateEachNodeAttributes(function(a,s){return s.x=n[o],s.y=n[o+1],o+=r,i?i(a,s):s})},Jt.readGraphPositions=function(t,n){var i=0;t.forEachNode(function(o,a){n[i]=a.x,n[i+1]=a.y,i+=r})},Jt.collectLayoutChanges=function(t,n,i){for(var o=t.nodes(),a={},s=0,c=0,l=n.length;s<l;s+=r){if(i){var d=Object.assign({},t.getNodeAttributes(o[c]));d.x=n[s],d.y=n[s+1],d=i(o[c],d),a[o[c]]={x:d.x,y:d.y}}else a[o[c]]={x:n[s],y:n[s+1]};c++}return a},Jt.createWorker=function(n){var i=window.URL||window.webkitURL,o=n.toString(),a=i.createObjectURL(new Blob(["("+o+").call(this);"],{type:"text/javascript"})),s=new Worker(a);return i.revokeObjectURL(a),s},Jt}var Xi,na;function Og(){return na||(na=1,Xi={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}),Xi}var Ji,ia;function Mg(){if(ia)return Ji;ia=1;var r=ni(),e=Nc().createEdgeWeightGetter,t=Gg(),n=Rg(),i=Og();function o(c,l,d){if(!r(l))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,y=n.assign({},i,d.settings),C=n.validateSettings(y);if(C)throw new Error("graphology-layout-forceatlas2: "+C.message);var b=n.graphToByteArrays(l,h),m;for(m=0;m<f;m++)t(y,b.nodes,b.edges);if(c){n.assignLayoutChanges(l,b.nodes,g);return}return n.collectLayoutChanges(l,b.nodes)}function a(c){var l=typeof c=="number"?c:c.order;return{barnesHutOptimize:l>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(l)}}var s=o.bind(null,!1);return s.assign=o.bind(null,!0),s.inferSettings=a,Ji=s,Ji}var zg=Mg();const oa=Eo(zg),Ng=["centrality_score","centrality","pagerank","page_rank","betweenness","closeness","eigenvector","degree","score"];function Pg(r){return r==null?"":String(r)}function Ug(r){const e=typeof r=="number"?r:typeof r=="string"&&r.trim()?Number(r):NaN;return Number.isFinite(e)?e:null}function sa(r){for(const e of Ng){const t=Ug(r.data[e]);if(t!==null)return t}return null}function aa(r,e){for(const t of e){const n=r[t];if(typeof n=="string"&&n.trim())return n}return null}function To(r,e){const t=r[e];return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function ca(r){return Array.isArray(r)?r.filter(e=>typeof e=="string"||typeof e=="number").map(e=>String(e).trim()).filter(Boolean):[]}function Wg(r){const e=To(r.data,"metadata");return aa(r.data,["description","summary","content"])??(e?aa(e,["description","summary","content"]):null)}function jg(r){const e=ca(r.data.exports);if(e.length>0)return e;const t=To(r.data,"metadata");return t?ca(t.exports):[]}function la(r,e){for(const t of e){const n=r[t];if(typeof n=="boolean")return n;if(typeof n=="string"){const i=n.trim().toLowerCase();if(["true","yes","1"].includes(i))return!0;if(["false","no","0"].includes(i))return!1}}return null}function Uc(r,e){var i;const t=To(r.data,"metadata"),n=la(r.data,["orphan","is_orphan","isOrphan","dead_code","deadCode"])??(t?la(t,["orphan","is_orphan","isOrphan","dead_code","deadCode"]):null);return n!==null?n:(((i=e==null?void 0:e.get(r.id))==null?void 0:i.inDegree)??1)===0}function Bg(r){var n,i;const e=((n=r.data)==null?void 0:n.kind)??((i=r.data)==null?void 0:i.type)??r.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 Fg(r,e){return r==="imports"?e==="incoming"?"imported by":"imports":r==="defines"?e==="incoming"?"defined by":"defines":e==="incoming"?"referenced by":"references"}function Vg(r,e,t,n){const i=new Map(e.map(l=>[l.id,l])),o=[];for(const l of t){const d=l.source===r.id?"outgoing":l.target===r.id?"incoming":null;if(!d)continue;const f=d==="outgoing"?l.target:l.source,h=i.get(f),g=Bg(l);o.push({id:l.id,kind:g,direction:d,label:Fg(g,d),edgeLabel:l.label,nodeId:f,nodeLabel:(h==null?void 0:h.label)??f})}const a=(l,d)=>l.kind.localeCompare(d.kind)||l.nodeLabel.localeCompare(d.nodeLabel)||l.nodeId.localeCompare(d.nodeId),s=o.filter(l=>l.direction==="incoming").sort(a),c=o.filter(l=>l.direction==="outgoing").sort(a);return{description:Wg(r),exports:jg(r),orphan:Uc(r,n),incoming:s,outgoing:c,whereUsed:s}}function Kg(r,e){const t=new Map;for(const n of r)t.set(n.id,{degree:0,inDegree:0,outDegree:0,score:sa(n)??0});for(const n of e){const i=t.get(n.source),o=t.get(n.target);i&&(i.outDegree+=1,i.degree+=1),o&&(o.inDegree+=1,o.degree+=1)}for(const n of r){const i=t.get(n.id);i&&(i.score=sa(n)??i.degree)}return t}function Hg(r,e,t){const n=t.get(r.id),i=t.get(e.id),o=((i==null?void 0:i.score)??0)-((n==null?void 0:n.score)??0);if(o!==0)return o;const a=((i==null?void 0:i.degree)??0)-((n==null?void 0:n.degree)??0);if(a!==0)return a;const s=r.label.localeCompare(e.label);return s!==0?s:r.id.localeCompare(e.id)}function qg(r,e){const t=r.map(o=>{var a;return((a=e.get(o.id))==null?void 0:a.inDegree)??0});return Math.max(0,...t)<=0?new Map(r.map(o=>[o.id,1])):[...new Set(t)].sort((o,a)=>o-a).length===1?new Map(r.map(o=>[o.id,1])):new Map(r.map(o=>{var c;const a=((c=e.get(o.id))==null?void 0:c.inDegree)??0;if(a<=0)return[o.id,1];const s=t.filter(l=>l<=a).length/t.length;return s>.95?[o.id,2]:s>.8?[o.id,1.5]:s>.5?[o.id,1.25]:[o.id,1]}))}function ua(r){const e=r.id??r.rid??r._id??r.uid;return e==null?null:String(e)}function da(r,e){const t=r.label??r.name??r.title;return t!=null?String(t):e}function Yg(r){const e=r.source??r.from??r.src??r.start,t=r.target??r.to??r.dst??r.end;return e==null||t===null||t===void 0?null:{source:String(e),target:String(t)}}function Xg(r){const e=new Map,t=new Map;for(const n of r.result.records){if(n.nodes)for(const o of Object.values(n.nodes)){if(!o||typeof o!="object")continue;const a=o,s=ua(a);s&&(e.has(s)||e.set(s,{id:s,label:da(a,s),data:a}))}if(n.edges)for(const o of Object.values(n.edges)){if(!o||typeof o!="object")continue;const a=o,s=Yg(a);if(!s)continue;const c=a.label??a.type??a.rel,l=`${s.source}->${s.target}:${Pg(c)}`;t.has(l)||t.set(l,{id:l,source:s.source,target:s.target,label:c!==void 0?String(c):void 0,data:a})}const i=n.values;if(i&&typeof i=="object"){const o=i.kind;if(o==="node"){const a=ua(i);a&&!e.has(a)&&e.set(a,{id:a,label:da(i,a),data:i})}else if(o==="edge"){const a=i.from_rid??i.from,s=i.to_rid??i.to;if(a!=null&&s!==void 0&&s!==null){const c=String(a),l=String(s),d=i.label??i.type??i.rel,h=`e:${i.rid??i.id??`${c}->${l}`}`;t.has(h)||t.set(h,{id:h,source:c,target:l,label:d!==void 0?String(d):void 0,data:i})}}}}return{nodes:[...e.values()],edges:[...t.values()]}}function ty(r){var t;const e=(t=r.result)==null?void 0:t.records;return!e||e.length===0?!1:e.some(n=>{if(n.nodes&&Object.keys(n.nodes).length>0||n.edges&&Object.keys(n.edges).length>0)return!0;const i=n.values;return!!(i&&(i.kind==="node"||i.kind==="edge"))})}function Jg(r){let e=r>>>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 Zg(r,e,t=Dg){try{if(!t||typeof t.assign!="function")throw new Error("Leiden community detection unavailable");return t.assign(r,{attributes:{community:"community"},rng:e}),"leiden"}catch{return Tg.assign(r,{nodeCommunityAttribute:"community",rng:e}),"louvain"}}function Qg(r,e){const t=new Map;if(r.length===0)return t;if(r.length===1)return t.set(r[0].id,{x:50,y:50,community:0}),t;const n=new qe({type:"undirected",multi:!1,allowSelfLoops:!0}),i=Jg(r.length*131+e.length),o=Math.PI*2;r.forEach((C,b)=>{const m=b/r.length*o+i()*.1;n.addNode(C.id,{x:Math.cos(m),y:Math.sin(m)})});for(const C of e)!n.hasNode(C.source)||!n.hasNode(C.target)||C.source!==C.target&&(n.hasEdge(C.source,C.target)||n.addEdge(C.source,C.target));if(n.size===0){const C=Math.ceil(Math.sqrt(r.length));return r.forEach((b,m)=>{const A=Math.floor(m/C),v=m%C;t.set(b.id,{x:10+v/Math.max(1,C-1)*80,y:10+A/Math.max(1,C-1)*80,community:m})}),t}Zg(n,i);const a=oa.inferSettings(n);oa.assign(n,{iterations:r.length>200?120:200,settings:{...a,strongGravityMode:!0,gravity:1.2,scalingRatio:10,barnesHutOptimize:r.length>500}});let s=1/0,c=-1/0,l=1/0,d=-1/0;n.forEachNode((C,b)=>{b.x<s&&(s=b.x),b.x>c&&(c=b.x),b.y<l&&(l=b.y),b.y>d&&(d=b.y)});const f=c-s||1,h=d-l||1,g=5,y=100-g*2;return n.forEachNode((C,b)=>{t.set(C,{x:g+(b.x-s)/f*y,y:g+(b.y-l)/h*y,community:b.community??0})}),t}function Go(r,e=!0){const t=[200,25,145,290,50,175,320,95,0,260,220,130],n=r<t.length?t[r]:(t[0]+r*137.508)%360,i=e?62:58,o=e?60:48;return`hsl(${n.toFixed(0)} ${i}% ${o}%)`}function Yn(r){switch(r){case"tale":return"#ff2056";case"character":return"#7dd3fc";case"location":return"#a3e635";case"object":return"#fbbf24";case"archetype":return"#a78bfa";default:return"#94a3b8"}}function em(r){return r==="tale"?8:r==="character"?5:r==="location"||r==="object"?4:3}function Wc(r,e){const t=Math.max(.35,Math.min(1.25,em(r)*.14));return Math.max(.35,Math.min(2.5,t*e))}const jc=3.4;function tm(r,e){return Wc(r,e)*jc}const rm="#e2e8f0";function Bc(r){return Math.min(7,2.2+Math.sqrt(Math.max(1,r))*.7)}function nm(r){return Bc(r)*jc}function im(r,e,t){const n=e/100,i=t/100,o=(1-Math.abs(2*i-1))*n,a=(r%360+360)%360/60,s=o*(1-Math.abs(a%2-1));let c=0,l=0,d=0;a>=0&&a<1?[c,l,d]=[o,s,0]:a<2?[c,l,d]=[s,o,0]:a<3?[c,l,d]=[0,o,s]:a<4?[c,l,d]=[0,s,o]:a<5?[c,l,d]=[s,0,o]:[c,l,d]=[o,0,s];const f=i-o/2;return{r:Math.round((c+f)*255),g:Math.round((l+f)*255),b:Math.round((d+f)*255)}}function Fc(r){const e=r.match(/hsl\(\s*([\d.]+)\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%/i);return e?im(Number(e[1]),Number(e[2]),Number(e[3])):null}function om({r,g:e,b:t}){return`rgb(${r}, ${e}, ${t})`}function sm(r,e=!0){const t=Go(r,e),n=Fc(t);return n?om(n):t}function Nr(r,e){const t=Math.max(0,Math.min(1,e)),n=r.startsWith("hsl")?Fc(r):null;if(n)return`rgba(${n.r}, ${n.g}, ${n.b}, ${t})`;const i=r.match(/rgb\(\s*([\d.]+)[, ]+([\d.]+)[, ]+([\d.]+)/i);if(i)return`rgba(${i[1]}, ${i[2]}, ${i[3]}, ${t})`;const o=r.replace("#","");if(/^[0-9a-f]{6}$/i.test(o)){const a=parseInt(o.slice(0,2),16),s=parseInt(o.slice(2,4),16),c=parseInt(o.slice(4,6),16);return`rgba(${a}, ${s}, ${c}, ${t})`}return r}const am="#d6a72c",cm="#f4c84a";function lm(r){var d,f,h,g;const{nodes:e,edges:t,layout:n,sizeScales:i,orphanIds:o,dark:a=!0,edgeColor:s="#3a424d",bundledCurvatures:c}=r,l=new qe({type:"directed",multi:!0,allowSelfLoops:!0});for(const y of e){if(l.hasNode(y.id))continue;const C=String(y.data.node_type??"node"),b=i.get(y.id)??1,m=n.get(y.id),A=y.data.__supernode===!0,v=typeof y.data.__memberCount=="number"?y.data.__memberCount:0,p=A?nm(v):tm(C,b),E=m?sm(m.community,a):Yn(C);l.addNode(y.id,{x:(m==null?void 0:m.x)??50,y:-((m==null?void 0:m.y)??50),size:p,baseSize:p,color:E,mutedColor:Nr(E,.14),borderColor:A?rm:Yn(C),label:y.label,nodeType:C,community:(m==null?void 0:m.community)??-1,orphan:o.has(y.id),isSupernode:A,memberCount:v,type:"border"})}for(const y of t){if(!l.hasNode(y.source)||!l.hasNode(y.target)||l.hasEdge(y.id))continue;const C=((d=n.get(y.source))==null?void 0:d.community)??-1,b=((f=n.get(y.target))==null?void 0:f.community)??-1,m=((h=y.data)==null?void 0:h.__aggregated)===!0,A=typeof((g=y.data)==null?void 0:g.weight)=="number"?y.data.weight:1;l.addEdgeWithKey(y.id,y.source,y.target,{size:m?Math.min(6,1+Math.log2(A+1)):1,color:Nr(s,.34),edgeLabel:y.label??"",label:"",crossCommunity:C!==b,curvature:(c==null?void 0:c.get(y.id))??0,type:"line"})}return l}function um(r,e,t={}){const{padding:n=2.5,dark:i=!0}=t,o=new Map;for(const a of r){const s=e.get(a.id);if(!s)continue;const c=o.get(s.community);c?(c.minX=Math.min(c.minX,s.x),c.minY=Math.min(c.minY,s.y),c.maxX=Math.max(c.maxX,s.x),c.maxY=Math.max(c.maxY,s.y),c.count+=1):o.set(s.community,{minX:s.x,minY:s.y,maxX:s.x,maxY:s.y,count:1})}return[...o.entries()].sort((a,s)=>a[0]-s[0]).map(([a,s])=>{const c=Go(a,i);return{community:a,count:s.count,tint:c,fill:Nr(c,.08),stroke:Nr(c,.5),minX:s.minX-n,minY:s.minY-n,maxX:s.maxX+n,maxY:s.maxY+n,cx:(s.minX+s.maxX)/2,cy:(s.minY+s.maxY)/2}})}function fa(r,e,t,n,i){const o=t-r,a=n-e;let s=1;return o>0?s=Math.min(s,(i.maxX-r)/o):o<0&&(s=Math.min(s,(i.minX-r)/o)),a>0?s=Math.min(s,(i.maxY-e)/a):a<0&&(s=Math.min(s,(i.minY-e)/a)),s=Math.max(0,Math.min(1,s)),{x:r+o*s,y:e+a*s}}function dm(r,e,t){const n=new Map(t.map(o=>[o.community,o])),i=[];for(const o of r){const a=e.get(o.source),s=e.get(o.target);if(!a||!s||a.community===s.community)continue;const c=n.get(a.community),l=n.get(s.community);if(!c||!l)continue;const d=fa(a.x,a.y,s.x,s.y,c),f=fa(s.x,s.y,a.x,a.y,l);i.push({id:o.id,source:o.source,target:o.target,label:o.label,sourceCommunity:a.community,targetCommunity:s.community,x1:d.x,y1:d.y,x2:f.x,y2:f.y})}return i}const fm=36,hm=28,pm=36;function gm(r,e,t){const{focus:n,focusId:i,selectedNodeId:o,pulse:a,colors:s}=t,c=i!==null,l=i===r,d=n.nodes.has(r),f=!c||d,h=c?l?2.2+a*.38:d?1.58:.9:1,g=l?s.focusNodeStroke:e.orphan?s.warn:o===r?s.selectedNodeStroke:e.borderColor,y=e.isSupernode||c&&(l||n.nodes.size<=pm&&d);return{size:e.baseSize*h,color:f?e.color:e.mutedColor,borderColor:g,label:y?e.label.slice(0,fm):"",forceLabel:y,zIndex:l?3:e.isSupernode||d?2:1,hidden:!1}}function mm(r,e,t){const{focus:n,focusId:i,colors:o,groupInBox:a,bundle:s}=t,c=i!==null,l=n.edges.has(r),d=e.curvature,f=s&&Math.abs(d)>1e-4?"curved":"line";return a&&e.crossCommunity&&!l?{size:e.size,color:e.color,label:"",forceLabel:!1,zIndex:0,hidden:!0,type:f,curvature:d}:c?l?{size:2.2,color:o.focusEdge,label:e.edgeLabel?e.edgeLabel.slice(0,hm):"",forceLabel:!!e.edgeLabel,zIndex:2,hidden:!1,type:f,curvature:d}:{size:e.size,color:Nr(o.edge,.055),label:"",forceLabel:!1,zIndex:0,hidden:!1,type:f,curvature:d}:{size:e.size,color:Nr(o.edge,.34),label:"",forceLabel:!1,zIndex:0,hidden:!1,type:f,curvature:d}}const vm={stiffness:.1,stepSize:.1,cycles:6,iterations:60,iterationRate:2/3,subdivisionRate:2,compatibilityThreshold:.6},Zi=1500,Pr=1e-6;function on(r,e){return Math.hypot(r.x-e.x,r.y-e.y)}function Xn(r,e){return{x:(r.x+e.x)/2,y:(r.y+e.y)/2}}function ha(r,e){const t=e+2,n=[0];for(let s=1;s<r.length;s++)n.push(n[s-1]+on(r[s],r[s-1]));const i=n[n.length-1];if(i<Pr)return Array.from({length:t},()=>({...r[0]}));const o=[];let a=1;for(let s=0;s<t;s++){const c=i*s/(t-1);for(;a<r.length-1&&n[a]<c;)a++;const l=n[a-1],d=n[a]-l||1,f=Math.max(0,Math.min(1,(c-l)/d));o.push({x:r[a-1].x+f*(r[a].x-r[a-1].x),y:r[a-1].y+f*(r[a].y-r[a-1].y)})}return o}function ym(r,e){const t=(r.t.x-r.s.x)*(e.t.x-e.s.x)+(r.t.y-r.s.y)*(e.t.y-e.s.y);return Math.abs(t/(r.len*e.len))}function bm(r,e){const t=(r.len+e.len)/2;return 2/(t/Math.min(r.len,e.len)+Math.max(r.len,e.len)/t)}function wm(r,e){const t=(r.len+e.len)/2;return t/(t+on(Xn(r.s,r.t),Xn(e.s,e.t)))}function pa(r,e){const t=e.len*e.len,n=((e.s.y-r.y)*(e.s.y-e.t.y)-(e.s.x-r.x)*(e.t.x-e.s.x))/t;return{x:e.s.x+n*(e.t.x-e.s.x),y:e.s.y+n*(e.t.y-e.s.y)}}function ga(r,e){const t=pa(e.s,r),n=pa(e.t,r),i=Xn(t,n),o=on(t,n);return o<Pr?0:Math.max(0,1-2*on(i,Xn(e.s,e.t))/o)}function _m(r,e){return Math.min(ga(r,e),ga(e,r))}function xm(r,e){return ym(r,e)*bm(r,e)*wm(r,e)*_m(r,e)}function km(r,e){const t=r.map(()=>[]);for(let n=0;n<r.length;n++)for(let i=n+1;i<r.length;i++)xm(r[n],r[i])>=e&&(t[n].push(i),t[i].push(n));return t}function Em(r,e,t={}){const n={...vm,...t},i=new Map(r.map(h=>[h.id,{x:h.x,y:h.y}])),o=new Map,a=[];for(const h of e){const g=i.get(h.source),y=i.get(h.target);if(!g||!y||(o.set(h.id,[{...g},{...y}]),h.source===h.target))continue;const C=on(g,y);C<Pr||a.push({id:h.id,s:{...g},t:{...y},len:C})}if(a.length<2)return o;const s=a.map(h=>[{...h.s},{...h.t}]),c=km(a,n.compatibilityThreshold);let l=1,d=n.stepSize,f=n.iterations;for(let h=0;h<s.length;h++)s[h]=ha(s[h],l);for(let h=0;h<n.cycles;h++){const g=Math.max(1,Math.round(f));for(let y=0;y<g;y++){const C=a.map((b,m)=>Sm(m,s,c,a[m].len,l,d,n.stiffness));for(let b=0;b<a.length;b++)for(let m=1;m<=l;m++)s[b][m].x+=C[b][m].x,s[b][m].y+=C[b][m].y}d*=.5,l*=n.subdivisionRate,f*=n.iterationRate;for(let y=0;y<s.length;y++)s[y]=ha(s[y],l)}for(let h=0;h<a.length;h++)o.set(a[h].id,s[h].map(g=>({x:g.x,y:g.y})));return o}function Sm(r,e,t,n,i,o,a){const s=a/(n*(i+1)),c=e[r],l=[{x:0,y:0}];for(let d=1;d<=i;d++){const f=c[d-1],h=c[d],g=c[d+1];let y=s*(f.x-2*h.x+g.x),C=s*(f.y-2*h.y+g.y);for(const b of t[r]){const m=e[b][d],A=m.x-h.x,v=m.y-h.y;if(Math.abs(A)>Pr||Math.abs(v)>Pr){const p=Math.hypot(A,v);y+=A/p,C+=v/p}}l.push({x:o*y,y:o*C})}return l.push({x:0,y:0}),l}function Cm(r){if(r.length<3)return 0;const e=r[0],t=r[r.length-1],n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);if(o<Pr)return 0;let a=0;for(let c=1;c<r.length-1;c++){const l=r[c].x-e.x,d=r[c].y-e.y,f=(l*-i+d*n)/o;Math.abs(f)>Math.abs(a)&&(a=f)}const s=2*a/o;return Math.max(-1,Math.min(1,s))}const Ro="__cluster__:";function ma(r){return`${Ro}${r}`}function Vc(r){return r.startsWith(Ro)}function Am(r){if(!Vc(r))return null;const e=Number(r.slice(Ro.length));return Number.isFinite(e)?e:null}function Kc(r,e){const t=new Map;for(const n of r){const i=e.get(n.id);if(!i)continue;const o=t.get(i.community);o?o.push(n.id):t.set(i.community,[n.id])}return t}const va=(r,e,t)=>({nodes:r,edges:e,layout:t,supernodes:new Map,collapsedMembers:new Map});function $m(r,e,t,n){if(n.size===0)return va(r,e,t);const i=Kc(r,t),o=new Set;for(const g of n){const y=i.get(g);y&&y.length>0&&o.add(g)}if(o.size===0)return va(r,e,t);const a=new Map,s=new Map,c=[],l=new Map;for(const g of r){const y=t.get(g.id);if(y&&o.has(y.community)){a.set(g.id,ma(y.community));continue}c.push(g),y&&l.set(g.id,y)}for(const g of o){const y=i.get(g),C=ma(g);let b=0,m=0,A=0;for(const v of y){const p=t.get(v);p&&(b+=p.x,m+=p.y,A+=1)}s.set(C,{community:g,memberIds:y,size:y.length}),c.push({id:C,label:`cluster ${g} · ${y.length}`,data:{node_type:"cluster",__supernode:!0,__community:g,__memberCount:y.length}}),l.set(C,{x:A?b/A:50,y:A?m/A:50,community:g})}const d=g=>a.get(g)??g,f=[],h=new Map;for(const g of e){const y=d(g.source),C=d(g.target);if(!(y!==g.source||C!==g.target)){f.push(g);continue}if(y===C)continue;const m=`${y} ${C}`,A=h.get(m);A?(A.weight+=1,A.members.push(g.id)):h.set(m,{source:y,target:C,weight:1,members:[g.id]})}for(const[g,y]of h)f.push({id:`__agg__:${g}`,source:y.source,target:y.target,label:y.weight>1?`×${y.weight}`:void 0,data:{__aggregated:!0,weight:y.weight,members:y.members}});return{nodes:c,edges:f,layout:l,supernodes:s,collapsedMembers:a}}const Hc={name:"table-2",size:24,node:[["path",{d:"M3 9h18"}],["path",{d:"M9 3v18"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}]]};Hc.node;function Dm(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return Hc}}))}const qc={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]]};qc.node;function Im(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return qc}}))}const Yc={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]]};Yc.node;function Lm(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return Yc}}))}const Xc={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4"}],["path",{d:"m6 8-4 4 4 4"}],["path",{d:"m14.5 4-5 16"}]],aliases:["code-2"]};Xc.node;function Tm(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return Xc}}))}const Jc={name:"route",size:24,node:[["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"}]]};Jc.node;function Gm(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return Jc}}))}const Zc={name:"zoom-in",size:24,node:[["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"}]]};Zc.node;function Rm(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return Zc}}))}const Qc={name:"zoom-out",size:24,node:[["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"}]]};Qc.node;function Om(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return Qc}}))}const el={name:"group",size:24,node:[["path",{d:"M3 7V5c0-1.1.9-2 2-2h2"}],["path",{d:"M17 3h2c1.1 0 2 .9 2 2v2"}],["path",{d:"M21 17v2c0 1.1-.9 2-2 2h-2"}],["path",{d:"M7 21H5c-1.1 0-2-.9-2-2v-2"}],["rect",{width:"7",height:"5",x:"7",y:"7",rx:"1"}],["rect",{width:"7",height:"5",x:"10",y:"12",rx:"1"}]]};el.node;function ya(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return el}}))}const tl={name:"spline",size:24,node:[["circle",{cx:"19",cy:"5",r:"2"}],["circle",{cx:"5",cy:"19",r:"2"}],["path",{d:"M5 17A12 12 0 0 1 17 5"}]]};tl.node;function Mm(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return tl}}))}const rl={name:"boxes",size:24,node:[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"}],["path",{d:"m7 16.5-4.74-2.85"}],["path",{d:"m7 16.5 5-3"}],["path",{d:"M7 16.5v5.17"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"}],["path",{d:"m17 16.5-5-3"}],["path",{d:"m17 16.5 4.74-2.85"}],["path",{d:"M17 16.5v5.17"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"}],["path",{d:"M12 8 7.26 5.15"}],["path",{d:"m12 8 4.74-2.85"}],["path",{d:"M12 13.5V8"}]]};rl.node;function ba(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return rl}}))}var zm=he('<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>'),Nm=he('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer svelte-gt9p7f" aria-label="Clear filter"><!></button>'),Pm=he('<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),Um=he('<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>'),Wm=he('<span class="text-warn svelte-gt9p7f"> </span>'),jm=he('<button type="button"><!> </button>'),Bm=he('<button type="button" title="Group in a box — draw one tinted box per community and route inter-community edges at the borders"><!> groups</button> <button type="button" title="Force-directed edge bundling — collapse parallel edges onto shared trunks to untangle dense subgraphs"><!> bundle</button> <!> <!>',1),Fm=he('<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>'),Vm=he('<span class="text-primary-text svelte-gt9p7f"> </span>'),Km=he('<span class="text-warn svelte-gt9p7f" title="More nodes match — raise the limit or narrow the filter to see them"> </span>'),Hm=he('<span class="text-fg-2 svelte-gt9p7f"> </span>'),qm=he('<div class="mt-1.5 text-warn svelte-gt9p7f"> </div>'),Ym=he('<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-primary text-on-primary cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed hover:bg-primary-active svelte-gt9p7f"><!> run <span class="text-[9px] opacity-70 svelte-gt9p7f">⌘↵</span></button></div></div> <!></div>'),Xm=he('<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>'),Jm=At('<rect rx="6" stroke-width="1.5" class="svelte-gt9p7f"></rect>'),Zm=At('<line stroke="var(--color-line-3)" stroke-width="1" stroke-dasharray="4 3" opacity="0.7" class="svelte-gt9p7f"></line>'),Qm=At('<svg class="pointer-events-none absolute inset-0 h-full w-full svelte-gt9p7f" aria-hidden="true"><!><!></svg>'),ev=he('<div class="sigma-canvas absolute inset-0 h-full w-full bg-bg-0 svelte-gt9p7f" role="application" tabindex="0"></div> <!>',1),tv=At('<rect rx="1.5" stroke-width="0.18" vector-effect="non-scaling-stroke" class="svelte-gt9p7f"></rect>'),rv=At('<line stroke="currentColor" stroke-width="0.12" stroke-dasharray="0.8 0.6" opacity="0.6" class="text-line-3 svelte-gt9p7f" vector-effect="non-scaling-stroke"></line>'),nv=At('<g class="pointer-events-none svelte-gt9p7f"><!><!></g>'),iv=At('<polyline fill="none" stroke-linejoin="round" class="text-line-3 cursor-pointer hover:text-primary-text svelte-gt9p7f" vector-effect="non-scaling-stroke" role="button" tabindex="0"><title class="svelte-gt9p7f"> </title></polyline>'),ov=At('<line class="text-line-3 cursor-pointer hover:text-primary-text svelte-gt9p7f" vector-effect="non-scaling-stroke" role="button" tabindex="0"><title class="svelte-gt9p7f"> </title></line>'),sv=At('<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>'),av=At("<!><!>",1),cv=At('<circle fill="none" stroke="var(--color-warn)" vector-effect="non-scaling-stroke" class="pointer-events-none svelte-gt9p7f"></circle>'),lv=At('<text font-family="JetBrains Mono Variable, monospace" paint-order="stroke" stroke="#020617" class="pointer-events-none select-none svelte-gt9p7f"> </text>'),uv=At('<!><circle vector-effect="non-scaling-stroke" role="button" tabindex="0"><title class="svelte-gt9p7f"> </title></circle><!>',1),dv=he('<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>'),fv=he('<span class="ml-2 text-warn svelte-gt9p7f">orphan</span>'),hv=he('<tr><td class="px-2 py-1 text-fg-3 svelte-gt9p7f">node</td><td class="px-2 py-1 text-primary-text 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>'),pv=he('<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>'),gv=he('<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>'),mv=he('<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>'),vv=he(`<button type="button" class="mt-2 inline-flex items-center gap-1.5 rounded border border-line-2 bg-bg-0 px-2 py-1 text-[11px] text-fg-2 hover:border-accent hover:text-fg-0 cursor-pointer svelte-gt9p7f" title="Fold this node's community into a single supernode"><!> </button>`),yv=he('<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>'),bv=he('<div class="flex flex-wrap gap-1 svelte-gt9p7f"></div>'),wv=he('<div class="text-fg-3 svelte-gt9p7f">No exports recorded.</div>'),_v=he('<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>'),xv=he('<div class="space-y-1 svelte-gt9p7f"></div>'),kv=he('<div class="text-fg-3 svelte-gt9p7f">No inbound uses.</div>'),Ev=he('<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>'),Sv=he('<div class="rounded border border-line-1 px-2 py-1 text-fg-3 svelte-gt9p7f">none</div>'),Cv=he('<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>'),Av=he('<div class="rounded border border-line-1 px-2 py-1 text-fg-3 svelte-gt9p7f">none</div>'),$v=he('<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-primary-text 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),Dv=he('<code class="svelte-gt9p7f"> </code>'),Iv=he('<code class="svelte-gt9p7f"> </code>'),Lv=he('<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),Tv=he('<pre class="whitespace-pre-wrap text-[11px] svelte-gt9p7f"> </pre>'),Gv=he('<dt class="text-fg-3 truncate svelte-gt9p7f"> </dt> <dd class="text-fg-1 break-words svelte-gt9p7f"><!></dd>',1),Rv=he('<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>'),Ov=he('<button type="button"><span class="svelte-gt9p7f">●</span> <span class="svelte-gt9p7f"> </span> <span class="text-fg-3 svelte-gt9p7f"> </span></button>'),Mv=he('<span class="text-fg-3 svelte-gt9p7f">types:</span> <!>',1),zv=he('<span class="svelte-gt9p7f"><span class="text-fg-2 svelte-gt9p7f"> </span> <span class="text-fg-3 svelte-gt9p7f">·</span> </span>'),Nv=he('<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),Pv=he('<div class="flex h-full flex-col text-fg-1 svelte-gt9p7f"><!></div>');function ry(r,e){Zn(e,!0);let t=ke(null);const n=Q(()=>u(t)??e.result),i=Q(()=>Xg(u(n))),o=Q(()=>Kg(u(i).nodes,u(i).edges)),a=Q(()=>qg(u(i).nodes,u(o))),s=Q(()=>new Set(u(i).nodes.filter(k=>Uc(k,u(o))).map(k=>k.id)));let c=ke("canvas"),l=ke(25e3),d=ke(""),f=ke(null),h=ke(null),g=ke(null),y=ke(350),C=ke(1),b=ke(!1),m=ke(!1),A=ke(Kt(new Set));const v=Q(()=>u(f)?Vg(u(f),u(i).nodes,u(i).edges,u(o)):null);Zt(()=>{e.subpage==="svg"&&u(c)!=="svg"?P(c,"svg"):e.subpage==="graph"&&u(c)!=="canvas"&&P(c,"canvas")});let p=ke(null),E=ke(null),S=ke(!1),$=ke(""),x=ke(!1),D=ke(null),I=ke(""),j=ke("");async function O(k){const U=qn.client;if(!(!U||!k.trim())){P(x,!0),P(D,null);try{const F=await lr.track(`${e.collection??"graph"} · query (${k.slice(0,40).replace(/\s+/g," ")}…)`,()=>U.query(k));if(!F.ok){P(D,F.error??"query failed",!0);return}P(t,F,!0),P(f,null),P(h,null),tt()}catch(F){P(D,F.message,!0)}finally{P(x,!1)}}}function w(){P(t,null),P($,""),P(D,null),P(f,null),P(h,null),tt()}function ge(){u(f)&&(P($,`GRAPH NEIGHBORHOOD '${u(f).label}' DEPTH 1`),P(S,!0),O(u($)))}function ce(){P($,"GRAPH CENTRALITY LIMIT 50"),P(S,!0),O(u($))}function L(k){u(f)&&(k==="from"?P(I,u(f).label,!0):P(j,u(f).label,!0),P(S,!0))}function _(){!u(I).trim()||!u(j).trim()||(P($,`GRAPH SHORTEST_PATH '${u(I).trim()}' TO '${u(j).trim()}'`),P(S,!0),O(u($)))}const K=Q(()=>{const k=new Map;for(const U of u(i).nodes){const F=String(U.data.node_type??"node");k.set(F,(k.get(F)??0)+1)}return[...k.entries()].sort((U,F)=>F[1]-U[1])});let ee=ke(Kt(new Set));const z=Q(()=>{const k=u(d).trim().toLowerCase();return u(i).nodes.filter(U=>{const F=String(U.data.node_type??"node");return u(ee).has(F)?!1:k?U.label.toLowerCase().includes(k)||U.id.toLowerCase().includes(k):!0}).sort((U,F)=>Hg(U,F,u(o)))}),Re=Q(()=>Math.min(u(z).length,u(l))),ae=Q(()=>u(z).slice(0,Math.min(u(Re),u(y)))),W=Q(()=>new Set(u(ae).map(k=>k.id))),Ee=Q(()=>u(i).edges.filter(k=>u(W).has(k.source)&&u(W).has(k.target))),Ce=Q(()=>u(ae).length<u(Re)),be=Q(()=>u(z).length>u(l));Zt(()=>{const k=u(Re),U=u(c)==="canvas"?1e3:350,F=Math.min(k,U);if(P(y,F,!0),F>=k)return;let Oe=!1,Ke=0,vt=F;const rt=()=>{Oe||(vt=Math.min(k,vt+U),P(y,vt,!0),vt<k&&(Ke=requestAnimationFrame(rt)))};return Ke=requestAnimationFrame(rt),()=>{Oe=!0,cancelAnimationFrame(Ke)}});function Ye(k){const U=new Set(u(ee));U.has(k)?U.delete(k):U.add(k),P(ee,U,!0)}const ot=am,Ae=cm;let ve=ke(void 0),X=null,me=null,et=ke(1),J=ke(0),ne=0,G=ke(0),It=ke(Kt([])),Rt=ke(Kt([]));function Ot(k,U){const F=X;return F?F.graphToViewport({x:k,y:-U}):null}function Ht(){if(!u(b)||!X||u(c)!=="canvas"){u(It).length&&P(It,[],!0),u(Rt).length&&P(Rt,[],!0);return}const k=[];for(const F of u(xn)){const Oe=Ot(F.minX,F.minY),Ke=Ot(F.maxX,F.maxY);!Oe||!Ke||k.push({...F,vx:Math.min(Oe.x,Ke.x),vy:Math.min(Oe.y,Ke.y),vw:Math.abs(Ke.x-Oe.x),vh:Math.abs(Ke.y-Oe.y)})}const U=[];for(const F of u(kn)){const Oe=Ot(F.x1,F.y1),Ke=Ot(F.x2,F.y2);!Oe||!Ke||U.push({id:F.id,vx1:Oe.x,vy1:Oe.y,vx2:Ke.x,vy2:Ke.y})}P(It,k,!0),P(Rt,U,!0)}function $t(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}fu(()=>{cancelAnimationFrame(ne),X&&(X.kill(),X=null)}),hu(()=>{const k=new MutationObserver(()=>{P(G,u(G)+1)});return k.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","data-color-scheme"]}),()=>k.disconnect()});function _t(){P(f,null),P(h,null)}function tt(){P(p,null),P(E,null)}function Pt(k){return u(i).nodes.find(U=>U.id===k)??null}function nr(k){const U=Pt(k.nodeId);U&&(ir(U),pr(U))}function pr(k){P(h,null),P(f,k,!0)}function ir(k){P(E,k.id,!0),P(p,k.id,!0)}function _r(k){if(u(E)){tt(),_t();return}ir(k),pr(k)}function Lt(k){P(f,null),P(h,k,!0)}function xr(k){return["id","rid","label","name","title","description","summary","content","exports","orphan","is_orphan","isOrphan","dead_code","deadCode"].includes(k)}function or(k,U){k.key!=="Enter"&&k.key!==" "||(k.preventDefault(),U())}function Oo(k){return Math.max(.5,Math.min(8,k))}const sl=Q(()=>u(c)==="canvas"?Math.round(100/(u(et)||1)):Math.round(u(C)*100));function Mo(k){if(u(c)==="canvas"){const F=X==null?void 0:X.getCamera();if(!F)return;k==="in"?F.animatedZoom(1.4):F.animatedUnzoom(1.4);return}const U=k==="in"?1.25:.8;P(C,Oo(u(C)*U),!0)}function al(){if(u(c)==="canvas"){X==null||X.getCamera().animatedReset();return}P(C,1)}function cl(k){k.preventDefault();const U=k.deltaY<0?1.25:.8;P(C,Oo(u(C)*U),!0)}const zo=Q(()=>{const k=new Map;for(const U of u(i).edges)U.label&&k.set(U.label,(k.get(U.label)??0)+1);return[...k.entries()].sort((U,F)=>F[1]-U[1]).slice(0,4)}),kr=Q(()=>Qg(u(ae),u(Ee))),ll=Q(()=>(u(G),typeof document>"u"?!0:document.documentElement.dataset.colorScheme!=="light")),xn=Q(()=>u(b)?um(u(ae),u(kr),{dark:u(ll)}):[]),kn=Q(()=>u(b)?dm(u(Ee),u(kr),u(xn)):[]),ul=Q(()=>new Set(u(kn).map(k=>k.id))),dl=Q(()=>u(m)&&u(Ee).length>Zi);function fl(k){return k>800?{cycles:4,iterations:45}:k>300?{cycles:5,iterations:55}:{}}const ii=Q(()=>{if(!u(m)||u(c)==="table"||u(Ee).length===0||u(Ee).length>Zi)return null;const k=u(ae).map(U=>{const F=u(kr).get(U.id);return{id:U.id,x:(F==null?void 0:F.x)??50,y:(F==null?void 0:F.y)??50}});return Em(k,u(Ee).map(U=>({id:U.id,source:U.source,target:U.target})),fl(u(Ee).length))}),oi=Q(()=>{if(!u(ii))return null;const k=new Map;for(const[U,F]of u(ii))k.set(U,-Cm(F));return k}),En=Q(()=>$m(u(ae),u(Ee),u(kr),u(A))),si=Q(()=>u(En).nodes),Sn=Q(()=>u(En).edges),ai=Q(()=>u(En).layout),ci=Q(()=>{const k=Kc(u(ae),u(kr));return new Map([...k].map(([U,F])=>[U,F.length]))}),li=Q(()=>[...u(ci)].filter(([,k])=>k>=2).map(([k])=>k)),Er=Q(()=>u(A).size>0);function hl(k){const U=new Set(u(A));U.add(k),P(A,U,!0),tt()}function pl(k){const U=new Set(u(A));U.delete(k),P(A,U,!0),tt()}function gl(){P(A,u(Er)?new Set:new Set(u(li)),!0),tt(),_t()}const Br=Q(()=>{var k;return u(f)?((k=u(kr).get(u(f).id))==null?void 0:k.community)??null:null});Zt(()=>{u(f)&&u(En).collapsedMembers.has(u(f).id)&&_t()});const No=Q(()=>u(si).map(k=>{const U=String(k.data.node_type??"node"),F=u(a).get(k.id)??1,Oe=u(ai).get(k.id),Ke=k.data.__supernode===!0,vt=typeof k.data.__memberCount=="number"?k.data.__memberCount:0,rt=Oe?Go(Oe.community):Yn(U);return{...k,x:(Oe==null?void 0:Oe.x)??50,y:(Oe==null?void 0:Oe.y)??50,r:Ke?Bc(vt):Wc(U,F),color:rt}})),ui=Q(()=>new Map(u(No).map(k=>[k.id,k]))),di=Q(()=>{var U;const k=[];for(const F of u(Sn)){const Oe=u(ui).get(F.source),Ke=u(ui).get(F.target);if(!Oe||!Ke)continue;const vt=(U=u(ii))==null?void 0:U.get(F.id);let rt,jt=(Oe.x+Ke.x)/2,Ut=(Oe.y+Ke.y)/2;if(vt&&vt.length>2){rt=vt.map(Vr=>`${Vr.x},${Vr.y}`).join(" ");const An=vt[Math.floor(vt.length/2)];jt=An.x,Ut=An.y}k.push({...F,x1:Oe.x,y1:Oe.y,x2:Ke.x,y2:Ke.y,points:rt,mx:jt,my:Ut})}return k}),Fe=Q(()=>u(E)??u(p)),Cn=Q(()=>{const k=new Set;if(!u(Fe))return k;for(const U of u(di))(U.source===u(Fe)||U.target===u(Fe))&&k.add(U.id);return k}),sr=Q(()=>{const k=new Set;if(!u(Fe))return k;k.add(u(Fe));for(const U of u(di))U.source===u(Fe)&&k.add(U.target),U.target===u(Fe)&&k.add(U.source);return k});Zt(()=>{const k=u(Fe);if(!k){P(J,0);return}if(!u(ui).has(k)){tt();return}ml()});function ml(){if(cancelAnimationFrame(ne),$t()){P(J,0);return}const k=performance.now();P(J,1);const U=()=>{const F=Math.max(0,1-(performance.now()-k)/170);P(J,F,!0),F>0&&(ne=requestAnimationFrame(U))};ne=requestAnimationFrame(U)}const vl=Q(()=>`translate(50 50) scale(${u(C)}) translate(-50 -50)`);function Fr(k,U){return getComputedStyle(document.documentElement).getPropertyValue(k).trim()||U}function Po(){const k=document.documentElement.dataset.colorScheme!=="light";return{background:Fr("--color-bg-0",k?"#050607":"#ffffff"),edge:Fr("--color-line-3",k?"#3a424d":"#c9cbd1"),focusEdge:ot,focusNodeStroke:Ae,selectedNodeStroke:k?"#0a0a0b":"#18181b",nodeStroke:k?"#ffffff":"#27272a",warn:Fr("--color-warn",k?"#fbbf24":"#b45309")}}function Uo(){var k;return{focusId:u(Fe),focus:{nodes:u(sr),edges:u(Cn)},selectedNodeId:((k=u(f))==null?void 0:k.id)??null,pulse:u(J),colors:Po(),groupInBox:u(b),bundle:u(m)&&u(oi)!==null}}function Wo(){return lm({nodes:u(si),edges:u(Sn),layout:u(ai),sizeScales:u(a),orphanIds:u(s),dark:document.documentElement.dataset.colorScheme!=="light",edgeColor:Po().edge,bundledCurvatures:u(oi)??void 0})}function yl(k){return u(Sn).find(U=>U.id===k)??null}function fi(k){if(Vc(k)){const F=Am(k);F!==null&&pl(F);return}const U=Pt(k);U&&_r(U)}function bl(k){k.on("clickNode",({node:F})=>{fi(F)}),k.on("enterNode",({node:F})=>{u(E)||P(p,F,!0),u(ve)&&(u(ve).style.cursor="pointer")}),k.on("leaveNode",()=>{u(E)||P(p,null),u(ve)&&(u(ve).style.cursor="")}),k.on("clickEdge",({edge:F})=>{const Oe=yl(F);Oe&&(tt(),Lt(Oe))}),k.on("clickStage",()=>{tt(),_t()});const U=k.getCamera();U.on("updated",()=>{P(et,U.ratio,!0)}),k.on("afterRender",()=>Ht())}Zt(()=>{if(u(c)!=="canvas")return;const k=u(ve);if(!k)return;let U=!1,F=null;return(async()=>{try{if(!me){const[rt,jt,Ut]=await Promise.all([fr(()=>import("./bWMB_8ZZ.js"),__vite__mapDeps([3,4]),import.meta.url),fr(()=>import("./CXNPJgv1.js"),__vite__mapDeps([5,4]),import.meta.url),fr(()=>import("./CDKIdLnm.js"),__vite__mapDeps([6,4]),import.meta.url)]);me={Sigma:rt.default,NodeBorderProgram:jt.NodeBorderProgram,EdgeCurveProgram:Ut.default}}if(U||!u(ve))return;const{Sigma:Oe,NodeBorderProgram:Ke,EdgeCurveProgram:vt}=me;F=new Oe(Wo(),k,{allowInvalidContainer:!0,defaultNodeType:"border",nodeProgramClasses:{border:Ke},edgeProgramClasses:{curved:vt},defaultEdgeType:"line",renderEdgeLabels:!0,labelFont:'"JetBrains Mono Variable", monospace',edgeLabelFont:'"JetBrains Mono Variable", monospace',labelSize:12,edgeLabelSize:10,labelWeight:"700",labelColor:{color:Fr("--color-fg-0","#ffffff")},edgeLabelColor:{color:"#f6d36b"},labelRenderedSizeThreshold:1/0,zIndex:!0,nodeReducer:(rt,jt)=>gm(rt,jt,Uo()),edgeReducer:(rt,jt)=>mm(rt,jt,Uo())}),bl(F),X=F,P(et,F.getCamera().ratio,!0),P(g,null)}catch(Oe){P(g,Oe.message,!0)}})(),()=>{U=!0,F&&F.kill(),X===F&&(X=null)}}),Zt(()=>{u(si),u(Sn),u(ai),u(a),u(s),u(G),u(oi),u(m);const k=X;!k||u(c)!=="canvas"||(k.setSetting("labelColor",{color:Fr("--color-fg-0","#ffffff")}),k.setGraph(Wo()),k.refresh())}),Zt(()=>{u(Fe),u(sr),u(Cn),u(f),u(J);const k=X;!k||u(c)!=="canvas"||k.refresh({skipIndexation:!0})}),Zt(()=>{u(b),u(xn),u(kn);const k=X;!k||u(c)!=="canvas"||(k.refresh({skipIndexation:!0}),Ht())});function wl(k){u(E)||P(p,k.id,!0)}function _l(k){!u(E)&&u(p)===k.id&&P(p,null)}function hi(k){return u(Fe)?u(Fe)===k.id?k.r*2.24:u(sr).has(k.id)?k.r*1.6:k.r*.92:k.r*1.14}function xl(k){return u(Fe)?u(sr).has(k.id)?1:.12:1}function kl(k){return k.data.__supernode===!0?!0:u(Fe)?u(Fe)===k.id?!0:u(sr).size<=36&&u(sr).has(k.id):!1}function El(k){return!!(u(Fe)&&u(Cn).has(k.id)&&k.label)}var pi=Pv(),Sl=R(pi);{var Cl=k=>{var U=zm();V(k,U)},Al=k=>{var U=Nv(),F=lt(U),Oe=R(F),Ke=R(Oe),vt=R(Ke);Os(vt,{class:"size-3"}),Bt(),T(Ke);var rt=N(Ke,2),jt=R(rt);Os(jt,{class:"size-3"}),Bt(),T(rt);var Ut=N(rt,2),An=R(Ut);Dm(An,{class:"size-3"}),Bt(),T(Ut),T(Oe);var Vr=N(Oe,2);{var $l=te=>{var ie=Pm(),oe=lt(ie),Me=R(oe);gp(Me,{class:"size-3 text-fg-3"});var $e=N(Me,2);Ei($e);var Ue=N($e,2);{var De=He=>{var Qe=Nm(),Tt=R(Qe);vs(Tt,{class:"size-3"}),T(Qe),Ne("click",Qe,()=>P(d,"")),V(He,Qe)};xe(Ue,He=>{u(d)&&He(De)})}T(oe);var Pe=N(oe,2),we=R(Pe);Lm(we,{class:"size-3"});var M=N(we,4),se=R(M);se.value=se.__value=500;var re=N(se);re.value=re.__value=1e3;var Ie=N(re);Ie.value=Ie.__value=2e3;var le=N(Ie);le.value=le.__value=5e3;var ye=N(le);ye.value=ye.__value=1e4;var de=N(ye);de.value=de.__value=25e3;var We=N(de);We.value=We.__value=5e4,T(M);var Xe;Hu(M),T(Pe),pe(()=>{Xe!==(Xe=u(l))&&(M.value=(M.__value=u(l))??"",qu(M,u(l)))}),Dn($e,()=>u(d),He=>P(d,He)),Ne("change",M,He=>P(l,Number(He.currentTarget.value),!0)),V(te,ie)};xe(Vr,te=>{u(c)!=="table"&&te($l)})}var jo=N(Vr,2);{var Dl=te=>{var ie=Um(),oe=R(ie),Me=R(oe);Om(Me,{class:"size-3.5"}),T(oe);var $e=N(oe,2),Ue=R($e);T($e);var De=N($e,2),Pe=R(De);Rm(Pe,{class:"size-3.5"}),T(De),T(ie),pe(()=>{oe.disabled=u(c)==="svg"&&u(C)<=.5,fe(Ue,`${u(sl)??""}%`),De.disabled=u(c)==="svg"&&u(C)>=8}),Ne("click",oe,()=>Mo("out")),Ne("click",$e,al),Ne("click",De,()=>Mo("in")),V(te,ie)};xe(jo,te=>{u(c)!=="table"&&te(Dl)})}var Bo=N(jo,2);{var Il=te=>{var ie=Bm(),oe=lt(ie),Me=R(oe);ya(Me,{class:"size-3"}),Bt(),T(oe);var $e=N(oe,2),Ue=R($e);Mm(Ue,{class:"size-3"}),Bt(),T($e);var De=N($e,2);{var Pe=se=>{var re=Wm(),Ie=R(re);T(re),pe((le,ye)=>{H(re,"title",le),fe(Ie,`bundling skipped (${ye??""} edges)`)},[()=>`Bundling is skipped above ${Zi.toLocaleString()} drawn edges — narrow the filter or lower the limit`,()=>u(Ee).length.toLocaleString()]),V(se,re)};xe(De,se=>{u(dl)&&se(Pe)})}var we=N(De,2);{var M=se=>{var re=jm(),Ie=R(re);{var le=We=>{ya(We,{class:"size-3"})},ye=We=>{ba(We,{class:"size-3"})};xe(Ie,We=>{u(Er)?We(le):We(ye,-1)})}var de=N(Ie);T(re),pe(We=>{Et(re,1,We,"svelte-gt9p7f"),H(re,"aria-pressed",u(Er)),H(re,"title",u(Er)?"Expand all collapsed clusters back to their members":"Collapse each community into a single supernode"),fe(de,` ${u(Er)?`expand (${u(A).size})`:`collapse ${u(li).length} clusters`}`)},[()=>Dt(["inline-flex items-center gap-1 h-6 px-2 rounded border cursor-pointer transition-colors",u(Er)?"border-accent/40 bg-accent/10 text-primary-text":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),Ne("click",re,gl),V(se,re)};xe(we,se=>{u(li).length>0&&se(M)})}pe((se,re)=>{Et(oe,1,se,"svelte-gt9p7f"),H(oe,"aria-pressed",u(b)),Et($e,1,re,"svelte-gt9p7f"),H($e,"aria-pressed",u(m))},[()=>Dt(["inline-flex items-center gap-1 h-6 px-2 rounded border cursor-pointer transition-colors",u(b)?"border-accent/40 bg-accent/10 text-primary-text":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>Dt(["inline-flex items-center gap-1 h-6 px-2 rounded border cursor-pointer transition-colors",u(m)?"border-accent/40 bg-accent/10 text-primary-text":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),Ne("click",oe,()=>P(b,!u(b))),Ne("click",$e,()=>P(m,!u(m))),V(te,ie)};xe(Bo,te=>{u(c)!=="table"&&te(Il)})}var Sr=N(Bo,2),Ll=R(Sr);Tm(Ll,{class:"size-3"}),Bt(),T(Sr);var Fo=N(Sr,2);{var Tl=te=>{var ie=Fm(),oe=R(ie);vp(oe,{class:"size-3"}),Bt(),T(ie),Ne("click",ie,w),V(te,ie)};xe(Fo,te=>{u(t)&&te(Tl)})}var Vo=N(Fo,2),gi=R(Vo),Gl=R(gi);T(gi);var Ko=N(gi,2);{var Rl=te=>{var ie=Vm(),oe=R(ie);T(ie),pe((Me,$e)=>fe(oe,`rendering ${Me??""} / ${$e??""}`),[()=>u(ae).length.toLocaleString(),()=>u(Re).toLocaleString()]),V(te,ie)};xe(Ko,te=>{u(c)!=="table"&&u(Ce)&&te(Rl)})}var Ho=N(Ko,2);{var Ol=te=>{var ie=Km(),oe=R(ie);T(ie),pe(Me=>fe(oe,`drawing ${Me??""}`),[()=>u(ae).length.toLocaleString()]),V(te,ie)};xe(Ho,te=>{u(c)!=="table"&&u(be)&&te(Ol)})}var Ml=N(Ho,2);{var zl=te=>{var ie=Hm(),oe=R(ie,!0);T(ie),pe(()=>fe(oe,e.collection)),V(te,ie)};xe(Ml,te=>{e.collection&&te(zl)})}T(Vo),T(F);var qo=N(F,2);{var Nl=te=>{var ie=Ym(),oe=R(ie),Me=N(R(oe),2),$e=N(Me,2),Ue=N($e,2),De=R(Ue);Gm(De,{class:"size-3"}),Bt(),T(Ue),T(oe);var Pe=N(oe,2),we=R(Pe);Ei(we);var M=N(we,2);Ei(M);var se=N(M,2),re=N(se,2);T(Pe);var Ie=N(Pe,2),le=R(Ie);Bu(le);var ye=N(le,2),de=R(ye),We=R(de);{var Xe=Be=>{pp(Be,{class:"size-3 animate-spin"})},He=Be=>{mp(Be,{class:"size-3"})};xe(We,Be=>{u(x)?Be(Xe):Be(He,-1)})}Bt(2),T(de),T(ye),T(Ie);var Qe=N(Ie,2);{var Tt=Be=>{var je=qm(),Le=R(je,!0);T(je),pe(()=>fe(Le,u(D))),V(Be,je)};xe(Qe,Be=>{u(D)&&Be(Tt)})}T(ie),pe((Be,je)=>{Me.disabled=!u(f),H(Me,"title",u(f)?`neighborhood of ${u(f).label}`:"select a node first"),Ue.disabled=Be,se.disabled=!u(f),H(se,"title",u(f)?`Use ${u(f).label} as source`:"select a node first"),re.disabled=!u(f),H(re,"title",u(f)?`Use ${u(f).label} as target`:"select a node first"),H(le,"placeholder",e.collection?`GRAPH NEIGHBORHOOD '<label>' DEPTH 2
|
|
34
|
-
GRAPH SHORTEST_PATH '<from>' TO '<to>'
|
|
35
|
-
MATCH (n)-[r]->(m) RETURN n, r, m LIMIT 100`:"GRAPH NEIGHBORHOOD … / GRAPH SHORTEST_PATH … / MATCH …"),de.disabled=je},[()=>!u(I).trim()||!u(j).trim(),()=>u(x)||!u($).trim()]),Ne("click",Me,ge),Ne("click",$e,ce),Ne("click",Ue,_),Dn(we,()=>u(I),Be=>P(I,Be)),Dn(M,()=>u(j),Be=>P(j,Be)),Ne("click",se,()=>L("from")),Ne("click",re,()=>L("to")),Ne("keydown",le,Be=>{Be.key==="Enter"&&(Be.metaKey||Be.ctrlKey)&&(Be.preventDefault(),O(u($)))}),Dn(le,()=>u($),Be=>P($,Be)),Ne("click",de,()=>O(u($))),V(te,ie)};xe(qo,te=>{u(S)&&te(Nl)})}var Yo=N(qo,2);{var Pl=te=>{var ie=Xm(),oe=R(ie);Ms(oe,{class:"mt-0.5 size-3.5 shrink-0"});var Me=N(oe,2),$e=N(R(Me),2),Ue=R($e,!0);T($e),T(Me),T(ie),pe(()=>fe(Ue,u(g))),V(te,ie)};xe(Yo,te=>{u(g)&&te(Pl)})}var mi=N(Yo,2),Xo=R(mi);{var Ul=te=>{var ie=ev(),oe=lt(ie);du(oe,Ue=>P(ve,Ue),()=>u(ve));var Me=N(oe,2);{var $e=Ue=>{var De=Qm(),Pe=R(De);bt(Pe,17,()=>u(It),M=>M.community,(M,se)=>{var re=Jm();pe(()=>{H(re,"x",u(se).vx),H(re,"y",u(se).vy),H(re,"width",u(se).vw),H(re,"height",u(se).vh),H(re,"fill",u(se).fill),H(re,"stroke",u(se).stroke)}),V(M,re)});var we=N(Pe);bt(we,17,()=>u(Rt),M=>M.id,(M,se)=>{var re=Zm();pe(()=>{H(re,"x1",u(se).vx1),H(re,"y1",u(se).vy1),H(re,"x2",u(se).vx2),H(re,"y2",u(se).vy2)}),V(M,re)}),T(De),V(Ue,De)};xe(Me,Ue=>{u(b)&&(u(It).length>0||u(Rt).length>0)&&Ue($e)})}pe(()=>H(oe,"aria-label",`${u(ae).length} graph nodes and ${u(Ee).length} graph edges`)),Ne("keydown",oe,Ue=>{Ue.key==="Escape"&&(tt(),_t())}),V(te,ie)},Wl=te=>{var ie=dv(),oe=R(ie),Me=N(R(oe)),$e=R(Me);{var Ue=we=>{var M=nv(),se=R(M);bt(se,17,()=>u(xn),Ie=>Ie.community,(Ie,le)=>{var ye=tv();pe(()=>{H(ye,"x",u(le).minX),H(ye,"y",u(le).minY),H(ye,"width",u(le).maxX-u(le).minX),H(ye,"height",u(le).maxY-u(le).minY),H(ye,"fill",u(le).fill),H(ye,"stroke",u(le).stroke)}),V(Ie,ye)});var re=N(se);bt(re,17,()=>u(kn),Ie=>Ie.id,(Ie,le)=>{var ye=rv();pe(()=>{H(ye,"x1",u(le).x1),H(ye,"y1",u(le).y1),H(ye,"x2",u(le).x2),H(ye,"y2",u(le).y2)}),V(Ie,ye)}),T(M),V(we,M)};xe($e,we=>{u(b)&&we(Ue)})}var De=N($e);bt(De,21,()=>u(di),we=>we.id,(we,M)=>{var se=er(),re=lt(se);{var Ie=ye=>{const de=Q(()=>u(Cn).has(u(M).id));var We=av(),Xe=lt(We);{var He=Le=>{var _e=iv(),st=R(_e),ht=R(st);T(st),T(_e),pe(()=>{H(_e,"points",u(M).points),H(_e,"stroke",u(Fe)&&u(de)?ot:"currentColor"),H(_e,"stroke-width",u(Fe)?u(de)?"0.27":"0.055":"0.105"),H(_e,"opacity",u(Fe)?u(de)?"0.98":"0.07":"0.4"),H(_e,"aria-label",`${u(M).label??"edge"} from ${u(M).source} to ${u(M).target}`),fe(ht,`${u(M).label??"edge"??""}: ${u(M).source??""} -> ${u(M).target??""}`)}),Ne("click",_e,xt=>{xt.stopPropagation(),tt(),Lt(u(M))}),Ne("keydown",_e,xt=>or(xt,()=>{tt(),Lt(u(M))})),V(Le,_e)},Qe=Le=>{var _e=ov(),st=R(_e),ht=R(st);T(st),T(_e),pe(()=>{H(_e,"x1",u(M).x1),H(_e,"y1",u(M).y1),H(_e,"x2",u(M).x2),H(_e,"y2",u(M).y2),H(_e,"stroke",u(Fe)&&u(de)?ot:"currentColor"),H(_e,"stroke-width",u(Fe)?u(de)?"0.27":"0.055":"0.105"),H(_e,"opacity",u(Fe)?u(de)?"0.98":"0.055":"0.36"),H(_e,"aria-label",`${u(M).label??"edge"} from ${u(M).source} to ${u(M).target}`),fe(ht,`${u(M).label??"edge"??""}: ${u(M).source??""} -> ${u(M).target??""}`)}),Ne("click",_e,xt=>{xt.stopPropagation(),tt(),Lt(u(M))}),Ne("keydown",_e,xt=>or(xt,()=>{tt(),Lt(u(M))})),V(Le,_e)};xe(Xe,Le=>{u(M).points?Le(He):Le(Qe,-1)})}var Tt=N(Xe);{var Be=Le=>{var _e=sv(),st=R(_e,!0);T(_e),pe(ht=>{H(_e,"x",u(M).mx+.45),H(_e,"y",u(M).my-.45),fe(st,ht)},[()=>{var ht;return(ht=u(M).label)==null?void 0:ht.slice(0,28)}]),V(Le,_e)},je=Q(()=>El(u(M)));xe(Tt,Le=>{u(je)&&Le(Be)})}V(ye,We)},le=Q(()=>!(u(b)&&u(ul).has(u(M).id)));xe(re,ye=>{u(le)&&ye(Ie)})}V(we,se)}),T(De);var Pe=N(De);bt(Pe,21,()=>u(No),we=>we.id,(we,M)=>{const se=Q(()=>u(s).has(u(M).id)),re=Q(()=>u(M).data.__supernode===!0);var Ie=uv(),le=lt(Ie);{var ye=je=>{var Le=cv();pe((_e,st)=>{H(Le,"cx",u(M).x),H(Le,"cy",u(M).y),H(Le,"r",_e),H(Le,"stroke-width",u(Fe)===u(M).id?"0.38":"0.24"),H(Le,"opacity",st)},[()=>hi(u(M))+.65,()=>u(Fe)&&!u(sr).has(u(M).id)?"0.16":"0.72"]),V(je,Le)};xe(le,je=>{u(se)&&je(ye)})}var de=N(le);let We;var Xe=R(de),He=R(Xe,!0);T(Xe),T(de);var Qe=N(de);{var Tt=je=>{var Le=lv(),_e=R(Le,!0);T(Le),pe((st,ht)=>{H(Le,"x",st),H(Le,"y",u(M).y+.15),H(Le,"fill",u(Fe)===u(M).id?"#f8fafc":"#cbd5e1"),H(Le,"opacity",u(Fe)===u(M).id?"1":"0.9"),H(Le,"font-size",u(Fe)===u(M).id?"1.35":"1.15"),H(Le,"font-weight",u(Fe)===u(M).id?"700":"600"),H(Le,"stroke-width",u(Fe)===u(M).id?"0.48":"0.38"),fe(_e,ht)},[()=>u(M).x+hi(u(M))+.85,()=>u(M).label.slice(0,36)]),V(je,Le)},Be=Q(()=>kl(u(M)));xe(Qe,je=>{u(Be)&&je(Tt)})}pe((je,Le,_e)=>{var st;H(de,"cx",u(M).x),H(de,"cy",u(M).y),H(de,"r",je),H(de,"fill",u(M).color),H(de,"opacity",Le),H(de,"stroke",u(Fe)===u(M).id?Ae:u(re)?"#e2e8f0":((st=u(f))==null?void 0:st.id)===u(M).id?"#0a0a0b":u(se)?"var(--color-warn)":"#ffffff"),H(de,"stroke-width",_e),We=Et(de,0,"cursor-pointer graph-node svelte-gt9p7f",null,We,{"focus-primary":u(Fe)===u(M).id}),H(de,"aria-label",u(re)?`${u(M).label} — click to expand`:u(M).label),fe(He,u(re)?`${u(M).label} — click to expand`:u(M).label)},[()=>hi(u(M)),()=>xl(u(M)),()=>{var je;return u(Fe)===u(M).id?"0.55":u(re)?"0.5":u(sr).has(u(M).id)?"0.22":((je=u(f))==null?void 0:je.id)===u(M).id||u(se)?"0.4":"0.14"}]),xi("pointerenter",de,()=>wl(u(M))),xi("pointerleave",de,()=>_l(u(M))),Ne("click",de,je=>{je.stopPropagation(),fi(u(M).id)}),Ne("keydown",de,je=>or(je,()=>fi(u(M).id))),V(we,Ie)}),T(Pe),T(Me),T(oe),T(ie),pe(()=>{H(oe,"aria-label",`${u(ae).length} graph nodes and ${u(Ee).length} graph edges`),H(Me,"transform",u(vl))}),xi("wheel",oe,cl),Ne("click",oe,()=>{tt(),_t()}),Ne("keydown",oe,we=>{we.key==="Escape"&&(tt(),_t())}),V(te,ie)},jl=te=>{var ie=gv(),oe=R(ie),Me=N(R(oe)),$e=R(Me);bt($e,17,()=>u(i).nodes,De=>De.id,(De,Pe)=>{const we=Q(()=>u(s).has(u(Pe).id));var M=hv(),se=N(R(M)),re=R(se,!0);T(se);var Ie=N(se),le=R(Ie,!0);T(Ie);var ye=N(Ie),de=R(ye),We=N(de);{var Xe=He=>{var Qe=fv();V(He,Qe)};xe(We,He=>{u(we)&&He(Xe)})}T(ye),T(M),pe((He,Qe)=>{Et(M,1,He,"svelte-gt9p7f"),fe(re,u(Pe).id),fe(le,u(Pe).label),fe(de,`${Qe??""} `)},[()=>Dt(["border-b border-line-1/60 hover:bg-bg-1/40 cursor-pointer",u(we)?"bg-warn/10":""].join(" ")),()=>String(u(Pe).data.node_type??"")]),Ne("click",M,()=>{P(h,null),P(f,u(Pe),!0)}),V(De,M)});var Ue=N($e);bt(Ue,17,()=>u(i).edges,De=>De.id,(De,Pe)=>{var we=pv(),M=N(R(we)),se=R(M,!0);T(M);var re=N(M),Ie=R(re,!0);T(re);var le=N(re),ye=R(le);T(le),T(we),pe(()=>{fe(se,u(Pe).id),fe(Ie,u(Pe).label??""),fe(ye,`${u(Pe).source??""} → ${u(Pe).target??""}`)}),Ne("click",we,()=>{P(f,null),P(h,u(Pe),!0)}),V(De,we)}),T(Me),T(oe),T(ie),V(te,ie)};xe(Xo,te=>{u(c)==="canvas"?te(Ul):u(c)==="svg"?te(Wl,1):te(jl,-1)})}var Bl=N(Xo,2);{var Fl=te=>{var ie=Rv(),oe=R(ie),Me=R(oe);Im(Me,{class:"size-3.5 text-primary-text"});var $e=N(Me,2),Ue=R($e,!0);T($e);var De=N($e,4),Pe=R(De);vs(Pe,{class:"size-3.5"}),T(De),T(oe);var we=N(oe,2),M=R(we);{var se=le=>{var ye=$v(),de=lt(ye),We=R(de),Xe=R(We),He=N(R(Xe),2),Qe=R(He,!0);T(He),T(Xe);var Tt=N(Xe,2);{var Be=ze=>{var Ve=mv(),yt=R(Ve);Ms(yt,{class:"size-3"}),Bt(),T(Ve),V(ze,Ve)};xe(Tt,ze=>{u(v).orphan&&ze(Be)})}T(We);var je=N(We,2),Le=R(je,!0);T(je);var _e=N(je,2);{var st=ze=>{var Ve=vv(),yt=R(Ve);ba(yt,{class:"size-3"});var gt=N(yt);T(Ve),pe(ft=>fe(gt,` collapse cluster ${u(Br)??""} · ${ft??""} nodes`),[()=>u(ci).get(u(Br))]),Ne("click",Ve,()=>hl(u(Br))),V(ze,Ve)},ht=Q(()=>u(Br)!==null&&(u(ci).get(u(Br))??0)>=2);xe(_e,ze=>{u(ht)&&ze(st)})}T(de);var xt=N(de,2),Cr=N(R(xt),2),pt=R(Cr,!0);T(Cr),T(xt);var Je=N(xt,2),dt=R(Je),Ar=N(R(dt),2),vi=R(Ar,!0);T(Ar),T(dt);var ql=N(dt,2);{var Yl=ze=>{var Ve=bv();bt(Ve,21,()=>u(v).exports,Wn,(yt,gt)=>{var ft=yv(),kt=R(ft,!0);T(ft),pe(()=>fe(kt,u(gt))),V(yt,ft)}),T(Ve),V(ze,Ve)},Xl=ze=>{var Ve=wv();V(ze,Ve)};xe(ql,ze=>{u(v).exports.length>0?ze(Yl):ze(Xl,-1)})}T(Je);var yi=N(Je,2),bi=R(yi),Qo=N(R(bi),2),Jl=R(Qo);T(Qo),T(bi);var Zl=N(bi,2);{var Ql=ze=>{var Ve=xv();bt(Ve,21,()=>u(v).whereUsed,yt=>yt.id,(yt,gt)=>{var ft=_v(),kt=R(ft),qt=R(kt,!0);T(kt);var $r=N(kt,2),Yt=R($r),Kr=R(Yt,!0);T(Yt);var ns=N(Yt,2),au=R(ns,!0);T(ns),T($r),T(ft),pe(()=>{fe(qt,u(gt).label),fe(Kr,u(gt).nodeLabel),fe(au,u(gt).edgeLabel??u(gt).kind)}),Ne("click",ft,()=>nr(u(gt))),V(yt,ft)}),T(Ve),V(ze,Ve)},eu=ze=>{var Ve=kv();V(ze,Ve)};xe(Zl,ze=>{u(v).whereUsed.length>0?ze(Ql):ze(eu,-1)})}T(yi);var es=N(yi,2),ts=N(R(es),2),wi=R(ts),tu=R(wi);{var ru=ze=>{var Ve=er(),yt=lt(Ve);bt(yt,17,()=>u(v).incoming,gt=>gt.id,(gt,ft)=>{var kt=Ev(),qt=R(kt),$r=R(qt,!0);T(qt);var Yt=N(qt,2),Kr=R(Yt,!0);T(Yt),T(kt),pe(()=>{fe($r,u(ft).label),fe(Kr,u(ft).nodeLabel)}),Ne("click",kt,()=>nr(u(ft))),V(gt,kt)}),V(ze,Ve)},nu=ze=>{var Ve=Sv();V(ze,Ve)};xe(tu,ze=>{u(v).incoming.length>0?ze(ru):ze(nu,-1)})}T(wi);var rs=N(wi,2),iu=R(rs);{var ou=ze=>{var Ve=er(),yt=lt(Ve);bt(yt,17,()=>u(v).outgoing,gt=>gt.id,(gt,ft)=>{var kt=Cv(),qt=R(kt),$r=R(qt,!0);T(qt);var Yt=N(qt,2),Kr=R(Yt,!0);T(Yt),T(kt),pe(()=>{fe($r,u(ft).label),fe(Kr,u(ft).nodeLabel)}),Ne("click",kt,()=>nr(u(ft))),V(gt,kt)}),V(ze,Ve)},su=ze=>{var Ve=Av();V(ze,Ve)};xe(iu,ze=>{u(v).outgoing.length>0?ze(ou):ze(su,-1)})}T(rs),T(ts),T(es),pe((ze,Ve,yt)=>{fe(Qe,u(f).label),fe(Le,ze),fe(pt,u(v).description??"No description in graph contract."),fe(vi,Ve),fe(Jl,`${yt??""} inbound`)},[()=>String(u(f).data.rid??u(f).id),()=>u(v).exports.length.toLocaleString(),()=>u(v).whereUsed.length.toLocaleString()]),V(le,ye)},re=le=>{var ye=Lv(),de=lt(ye),We=N(R(de),2),Xe=R(We,!0);T(We),T(de);var He=N(de,2),Qe=N(R(He),2),Tt=R(Qe);{var Be=pt=>{var Je=ki();pe(dt=>fe(Je,dt),[()=>Pt(u(h).source).label]),V(pt,Je)},je=Q(()=>Pt(u(h).source)),Le=pt=>{var Je=Dv(),dt=R(Je,!0);T(Je),pe(()=>fe(dt,u(h).source)),V(pt,Je)};xe(Tt,pt=>{u(je)?pt(Be):pt(Le,-1)})}T(Qe);var _e=N(Qe,4),st=R(_e);{var ht=pt=>{var Je=ki();pe(dt=>fe(Je,dt),[()=>Pt(u(h).target).label]),V(pt,Je)},xt=Q(()=>Pt(u(h).target)),Cr=pt=>{var Je=Iv(),dt=R(Je,!0);T(Je),pe(()=>fe(dt,u(h).target)),V(pt,Je)};xe(st,pt=>{u(xt)?pt(ht):pt(Cr,-1)})}T(_e),T(He),pe(()=>fe(Xe,u(h).label??"(unlabelled)")),V(le,ye)};xe(M,le=>{u(f)&&u(v)?le(se):u(h)&&le(re,1)})}var Ie=N(M,4);bt(Ie,21,()=>{var le;return Object.entries((u(f)?u(f).data:(le=u(h))==null?void 0:le.data)??{})},Wn,(le,ye)=>{var de=Q(()=>rn(u(ye),2));let We=()=>u(de)[0],Xe=()=>u(de)[1];var He=er(),Qe=lt(He);{var Tt=je=>{var Le=Gv(),_e=lt(Le),st=R(_e,!0);T(_e);var ht=N(_e,2),xt=R(ht);{var Cr=Je=>{var dt=Tv(),Ar=R(dt,!0);T(dt),pe(vi=>fe(Ar,vi),[()=>JSON.stringify(Xe(),null,2)]),V(Je,dt)},pt=Je=>{var dt=ki();pe(Ar=>fe(dt,Ar),[()=>String(Xe())]),V(Je,dt)};xe(xt,Je=>{typeof Xe()=="object"?Je(Cr):Je(pt,-1)})}T(ht),pe(()=>fe(st,We())),V(je,Le)},Be=Q(()=>Xe()!==null&&Xe()!==void 0&&!(u(f)&&xr(We()))&&!(u(h)&&We()==="label"));xe(Qe,je=>{u(Be)&&je(Tt)})}V(le,He)}),T(Ie),T(we),T(ie),pe(()=>fe(Ue,u(f)?"Node":"Edge")),Ne("click",De,()=>{tt(),_t()}),V(te,ie)};xe(Bl,te=>{(u(f)||u(h))&&te(Fl)})}T(mi);var Jo=N(mi,2),Zo=R(Jo);{var Vl=te=>{var ie=Mv(),oe=N(lt(ie),2);bt(oe,17,()=>u(K),([Me,$e])=>Me,(Me,$e)=>{var Ue=Q(()=>rn(u($e),2));let De=()=>u(Ue)[0],Pe=()=>u(Ue)[1];const we=Q(()=>u(ee).has(De()));var M=Ov(),se=R(M);let re;var Ie=N(se,2),le=R(Ie,!0);T(Ie);var ye=N(Ie,2),de=R(ye,!0);T(ye),T(M),pe((We,Xe,He)=>{H(M,"title",u(we)?`Show ${De()}`:`Hide ${De()}`),Et(M,1,We,"svelte-gt9p7f"),re=Yu(se,"",re,Xe),fe(le,De()),fe(de,He)},[()=>Dt(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded border transition-colors cursor-pointer",u(we)?"border-line-1 text-fg-3 line-through opacity-60":"border-line-2 text-fg-1 hover:border-accent"].join(" ")),()=>({color:u(we)?void 0:Yn(De())}),()=>Pe().toLocaleString()]),Ne("click",M,()=>Ye(De())),V(Me,M)}),V(te,ie)};xe(Zo,te=>{u(K).length>1&&te(Vl)})}var Kl=N(Zo,4);{var Hl=te=>{var ie=er(),oe=lt(ie);bt(oe,17,()=>u(zo),Wn,(Me,$e)=>{var Ue=Q(()=>rn(u($e),2));let De=()=>u(Ue)[0],Pe=()=>u(Ue)[1];var we=zv(),M=R(we),se=R(M,!0);T(M);var re=N(M,3);T(we),pe(Ie=>{fe(se,De()),fe(re,` ${Ie??""}`)},[()=>Pe().toLocaleString()]),V(Me,we)}),V(te,ie)};xe(Kl,te=>{u(zo).length>0&&te(Hl)})}T(Jo),pe((te,ie,oe,Me,$e,Ue,De,Pe,we)=>{H(Ke,"href",te),Et(Ke,1,ie,"svelte-gt9p7f"),H(Ke,"aria-current",u(c)==="canvas"?"page":void 0),H(rt,"href",oe),Et(rt,1,Me,"svelte-gt9p7f"),H(rt,"aria-current",u(c)==="svg"?"page":void 0),H(Ut,"href",$e),Et(Ut,1,Ue,"svelte-gt9p7f"),H(Ut,"aria-current",u(c)==="table"?"page":void 0),Et(Sr,1,De,"svelte-gt9p7f"),H(Sr,"aria-pressed",u(S)),fe(Gl,`${Pe??""} nodes · ${we??""} edges`)},[()=>e.collection?Oi(e.collection,"graph"):void 0,()=>Dt(["inline-flex items-center gap-1 px-2 py-1 text-[11px] cursor-pointer transition-colors",u(c)==="canvas"?"bg-primary text-on-primary":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>e.collection?Oi(e.collection,"svg"):void 0,()=>Dt(["inline-flex items-center gap-1 px-2 py-1 text-[11px] cursor-pointer transition-colors border-l border-line-2",u(c)==="svg"?"bg-primary text-on-primary":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>e.collection?Oi(e.collection,"table"):void 0,()=>Dt(["inline-flex items-center gap-1 px-2 py-1 text-[11px] cursor-pointer transition-colors border-l border-line-2",u(c)==="table"?"bg-primary text-on-primary":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Dt(["inline-flex items-center gap-1 h-6 px-2 rounded border cursor-pointer transition-colors",u(S)?"border-accent/40 bg-accent/10 text-primary-text":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>u(i).nodes.length.toLocaleString(),()=>u(i).edges.length.toLocaleString()]),Ne("click",Ke,()=>{e.collection||P(c,"canvas")}),Ne("click",rt,()=>{e.collection||P(c,"svg")}),Ne("click",Ut,()=>{e.collection||P(c,"table")}),Ne("click",Sr,()=>P(S,!u(S))),V(k,U)};xe(Sl,k=>{u(i).nodes.length===0&&u(i).edges.length===0?k(Cl):k(Al,-1)})}T(pi),V(r,pi),Qn()}Ku(["click","change","keydown"]);const nl={name:"layers",size:24,node:[["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"}]],aliases:["layers-3"]};nl.node;function ny(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return nl}}))}function iy(r,e){Yh(r,{get title(){return e.title},get description(){return e.message},get hint(){return e.hint},get actions(){return e.actions},media:n=>{var i=er(),o=lt(i);{var a=s=>{Uh(s,{get icon(){return e.icon},size:"lg"})};xe(o,s=>{e.icon&&s(a)})}V(n,i)},$$slots:{media:!0}})}const il={name:"file-braces",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"}]],aliases:["file-json"]};il.node;function oy(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return il}}))}const ol={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12"}]]};ol.node;function sy(r,e){let t=Ze(e,["$$slots","$$events","$$legacy"]);at(r,it(()=>t,{get icon(){return ol}}))}export{nn as A,Xv as B,ro as C,ey as D,iy as E,oy as F,ry as G,Mh as H,at as I,Jv as J,ny as L,Os as N,lc as P,mo as R,gp as S,Dm as T,vs as X,Uh as a,Im as b,sy as c,pp as d,mp as e,vp as f,Ms as g,lr as h,Oi as i,Go as j,qn as k,Qv as l,Dr as m,bt as n,Qu as o,bp as p,qv as q,Eo as r,ty as s,Wn as t,qr as u,ho as v,Zv as w,lp as x,ni as y,Yv as z};
|