jbrowse-plugin-graphgenomeviewer 10.4.2 → 10.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AddTrackWorkflow-P5APNL32.js → AddTrackWorkflow-D4QSDNWI.js} +2 -2
- package/dist/chunks/{GbzBaseSyntenyAdapter-46A4LMVD.js → GbzBaseSyntenyAdapter-RM4CXLLF.js} +2 -2
- package/dist/chunks/{GbzBaseSyntenyAdapter-46A4LMVD.js.map → GbzBaseSyntenyAdapter-RM4CXLLF.js.map} +1 -1
- package/dist/chunks/{GraphGenomeView-MXRAP7QB.js → GraphGenomeView-QQFYOKM5.js} +2 -2
- package/dist/chunks/GraphSettingsDialog-D6WOU4CU.js +2 -0
- package/dist/chunks/{HighlightColorDialog-UKFUS5S4.js → HighlightColorDialog-NNQM2AER.js} +2 -2
- package/dist/chunks/LinearGraphDisplay-OFZQJHYG.js +2 -0
- package/dist/chunks/{MinigraphBubbleAdapter-QSPPG4LG.js → MinigraphBubbleAdapter-JBYQHQRT.js} +2 -2
- package/dist/chunks/{RgfaTabixAdapter-UPCOXYVG.js → RgfaTabixAdapter-6FJWPEHW.js} +2 -2
- package/dist/chunks/{WalkFormsAdapter-LHKGRYC6.js → WalkFormsAdapter-IRGWL2G4.js} +2 -2
- package/dist/chunks/{WalkTabixSyntenyAdapter-ELTYD73I.js → WalkTabixSyntenyAdapter-7RQNFBIG.js} +2 -2
- package/dist/chunks/{chunk-SMZZWPRX.js → chunk-5RK2OJEU.js} +2 -2
- package/dist/chunks/{chunk-SMZZWPRX.js.map → chunk-5RK2OJEU.js.map} +3 -3
- package/dist/chunks/{chunk-43EUXRKZ.js → chunk-5VZ5HRTH.js} +2 -2
- package/dist/chunks/{chunk-43EUXRKZ.js.map → chunk-5VZ5HRTH.js.map} +1 -1
- package/dist/chunks/chunk-6GJELLIC.js +2 -0
- package/dist/chunks/chunk-6GJELLIC.js.map +7 -0
- package/dist/chunks/{chunk-TM22QR6V.js → chunk-6T2VBP7Z.js} +2 -2
- package/dist/chunks/{chunk-TM22QR6V.js.map → chunk-6T2VBP7Z.js.map} +1 -1
- package/dist/chunks/{chunk-5N4B6FEH.js → chunk-7YC64WD6.js} +2 -2
- package/dist/chunks/{chunk-52BUFQHJ.js → chunk-AYJ6SUB5.js} +6 -6
- package/dist/chunks/{chunk-52BUFQHJ.js.map → chunk-AYJ6SUB5.js.map} +2 -2
- package/dist/chunks/{chunk-RUKWE5MB.js → chunk-BPCYXZWU.js} +2 -2
- package/dist/chunks/{chunk-RDTLCMD2.js → chunk-E55FR7S6.js} +1 -1
- package/dist/chunks/{chunk-RDTLCMD2.js.map → chunk-E55FR7S6.js.map} +1 -1
- package/dist/chunks/{chunk-DZXYOIGJ.js → chunk-ESUDWLHY.js} +2 -2
- package/dist/chunks/{chunk-E3GNTGWW.js → chunk-FSBDVHNR.js} +1 -1
- package/dist/chunks/{chunk-E3GNTGWW.js.map → chunk-FSBDVHNR.js.map} +1 -1
- package/dist/chunks/{chunk-4QYWBDUL.js → chunk-G7MXYOW5.js} +2 -2
- package/dist/chunks/{chunk-4QYWBDUL.js.map → chunk-G7MXYOW5.js.map} +1 -1
- package/dist/chunks/{chunk-WBDZVWK4.js → chunk-GZROPRBI.js} +2 -2
- package/dist/chunks/{chunk-WBDZVWK4.js.map → chunk-GZROPRBI.js.map} +1 -1
- package/dist/chunks/{chunk-E5ERNAYL.js → chunk-HHK5MBID.js} +1 -1
- package/dist/chunks/{chunk-E5ERNAYL.js.map → chunk-HHK5MBID.js.map} +1 -1
- package/dist/chunks/{chunk-2TMZO3P5.js → chunk-JFNEV3BY.js} +2 -2
- package/dist/chunks/{chunk-N2TMTGYP.js → chunk-JXMFPTPM.js} +2 -2
- package/dist/chunks/{chunk-VY7G4FSX.js → chunk-LOT3BKM3.js} +2 -2
- package/dist/chunks/{chunk-VY7G4FSX.js.map → chunk-LOT3BKM3.js.map} +2 -2
- package/dist/chunks/{chunk-L7ZSEA4T.js → chunk-MX7R2F3F.js} +2 -2
- package/dist/chunks/{chunk-L7ZSEA4T.js.map → chunk-MX7R2F3F.js.map} +1 -1
- package/dist/chunks/{chunk-YIGESHTA.js → chunk-NSWRDOLS.js} +2 -2
- package/dist/chunks/{chunk-YIGESHTA.js.map → chunk-NSWRDOLS.js.map} +1 -1
- package/dist/chunks/{chunk-AC5KEN36.js → chunk-NZ7YFVK4.js} +2 -2
- package/dist/chunks/{chunk-AC5KEN36.js.map → chunk-NZ7YFVK4.js.map} +1 -1
- package/dist/chunks/chunk-PZGI7L73.js +5 -0
- package/dist/chunks/chunk-PZGI7L73.js.map +7 -0
- package/dist/chunks/{chunk-YLB6GKFG.js → chunk-S4BXLNAH.js} +2 -2
- package/dist/chunks/{chunk-YLB6GKFG.js.map → chunk-S4BXLNAH.js.map} +1 -1
- package/dist/chunks/{chunk-QOMV5OG7.js → chunk-SRA6CKRA.js} +2 -2
- package/dist/chunks/{renderSvg-4AG3PPI5.js → renderSvg-5YYSAMUL.js} +2 -2
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +1 -1
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/version.ts +1 -1
- package/dist/chunks/GraphSettingsDialog-HIOYWTO7.js +0 -2
- package/dist/chunks/LinearGraphDisplay-KPWFPVFK.js +0 -2
- package/dist/chunks/chunk-BLE63OIT.js +0 -2
- package/dist/chunks/chunk-BLE63OIT.js.map +0 -7
- package/dist/chunks/chunk-M5XKM6D2.js +0 -5
- package/dist/chunks/chunk-M5XKM6D2.js.map +0 -7
- /package/dist/chunks/{AddTrackWorkflow-P5APNL32.js.map → AddTrackWorkflow-D4QSDNWI.js.map} +0 -0
- /package/dist/chunks/{GraphGenomeView-MXRAP7QB.js.map → GraphGenomeView-QQFYOKM5.js.map} +0 -0
- /package/dist/chunks/{GraphSettingsDialog-HIOYWTO7.js.map → GraphSettingsDialog-D6WOU4CU.js.map} +0 -0
- /package/dist/chunks/{HighlightColorDialog-UKFUS5S4.js.map → HighlightColorDialog-NNQM2AER.js.map} +0 -0
- /package/dist/chunks/{LinearGraphDisplay-KPWFPVFK.js.map → LinearGraphDisplay-OFZQJHYG.js.map} +0 -0
- /package/dist/chunks/{MinigraphBubbleAdapter-QSPPG4LG.js.map → MinigraphBubbleAdapter-JBYQHQRT.js.map} +0 -0
- /package/dist/chunks/{RgfaTabixAdapter-UPCOXYVG.js.map → RgfaTabixAdapter-6FJWPEHW.js.map} +0 -0
- /package/dist/chunks/{WalkFormsAdapter-LHKGRYC6.js.map → WalkFormsAdapter-IRGWL2G4.js.map} +0 -0
- /package/dist/chunks/{WalkTabixSyntenyAdapter-ELTYD73I.js.map → WalkTabixSyntenyAdapter-7RQNFBIG.js.map} +0 -0
- /package/dist/chunks/{chunk-5N4B6FEH.js.map → chunk-7YC64WD6.js.map} +0 -0
- /package/dist/chunks/{chunk-RUKWE5MB.js.map → chunk-BPCYXZWU.js.map} +0 -0
- /package/dist/chunks/{chunk-DZXYOIGJ.js.map → chunk-ESUDWLHY.js.map} +0 -0
- /package/dist/chunks/{chunk-2TMZO3P5.js.map → chunk-JFNEV3BY.js.map} +0 -0
- /package/dist/chunks/{chunk-N2TMTGYP.js.map → chunk-JXMFPTPM.js.map} +0 -0
- /package/dist/chunks/{chunk-QOMV5OG7.js.map → chunk-SRA6CKRA.js.map} +0 -0
- /package/dist/chunks/{renderSvg-4AG3PPI5.js.map → renderSvg-5YYSAMUL.js.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jbrowse-plugin-graphgenomeviewer",
|
|
3
|
-
"version": "10.4.
|
|
3
|
+
"version": "10.4.4",
|
|
4
4
|
"description": "JBrowse 2 graph genome (pangenome) view: rGFA reference-anchored layouts, the Bandage force-directed engine, and haplotype lanes read from a gbz-base database",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"repository": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@emotion/react": "^11.14.0",
|
|
41
41
|
"@emotion/styled": "^11.14.1",
|
|
42
42
|
"@eslint/js": "^10.0.1",
|
|
43
|
-
"@jbrowse/bandage-core": "^14.3.
|
|
43
|
+
"@jbrowse/bandage-core": "^14.3.3",
|
|
44
44
|
"@jbrowse/cli": "5.0.0-beta.20",
|
|
45
45
|
"@jbrowse/mobx-state-tree": "^6.10.0",
|
|
46
46
|
"@jbrowse/plugin-linear-genome-view": "5.0.0-beta.20",
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '10.4.
|
|
1
|
+
export const version = '10.4.4'
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as a}from"./chunk-YLB6GKFG.js";import"./chunk-AC5KEN36.js";import"./chunk-YIGESHTA.js";import"./chunk-BLE63OIT.js";import"./chunk-43EUXRKZ.js";import"./chunk-D3QZGLZ3.js";import"./chunk-TMM73K4C.js";import"./chunk-EGZZ3ADM.js";import"./chunk-RDTLCMD2.js";import"./chunk-J2PN6CG3.js";import"./chunk-H42TSPVA.js";import"./chunk-DUU6T2I5.js";export{a as default};
|
|
2
|
-
//# sourceMappingURL=GraphSettingsDialog-HIOYWTO7.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a,b as i}from"./chunk-4QYWBDUL.js";import"./chunk-YLB6GKFG.js";import"./chunk-TM22QR6V.js";import"./chunk-SMZZWPRX.js";import"./chunk-QOMV5OG7.js";import"./chunk-AC5KEN36.js";import"./chunk-M5XKM6D2.js";import"./chunk-VY7G4FSX.js";import"./chunk-YIGESHTA.js";import"./chunk-BLE63OIT.js";import"./chunk-E3GNTGWW.js";import"./chunk-ZQOMV674.js";import"./chunk-DZXYOIGJ.js";import"./chunk-WBDZVWK4.js";import"./chunk-YBLNN5FU.js";import"./chunk-L7ZSEA4T.js";import"./chunk-E5ERNAYL.js";import"./chunk-43EUXRKZ.js";import"./chunk-D3QZGLZ3.js";import"./chunk-WKD7ALOU.js";import"./chunk-KGAZZNZC.js";import"./chunk-TMM73K4C.js";import"./chunk-YBLNN5FU.js";import"./chunk-EGZZ3ADM.js";import"./chunk-RDTLCMD2.js";import"./chunk-5L276I7O.js";import"./chunk-J2PN6CG3.js";import"./chunk-H42TSPVA.js";import{b as o,d as t}from"./chunk-DUU6T2I5.js";var e=JBrowseExports["@jbrowse/display-kit/DisplayChrome"];var s=e&&e.__esModule?e.default:e;var p=t(function({model:r}){return o(s,{model:r,factory:a,testid:"linear-graph-display","data-layout":r.chosenLayoutMode,"data-cut-tier":r.cutTier,"data-recuts":r.recuts,"data-node-count":r.hasGraph?r.nodeCount:void 0,"data-loading":r.isLoading?"":void 0,style:{width:r.paneWidth,height:r.height,overflow:"hidden"},children:n=>o(i,{model:r,handle:n})})}),c=p;export{c as default};
|
|
2
|
-
//# sourceMappingURL=LinearGraphDisplay-KPWFPVFK.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{A as at,C as St,E as Jt,J as te,K as J,Q as ee,R as ne,a as $,b as wt,c as K,d as Y,g as W,h as Vt,i as U,ka as oe,m as Z,ma as se,n as st,na as Q,o as jt,p as bt,q as rt,r as G,s as Kt,t as Ut,u as Zt,x as R}from"./chunk-43EUXRKZ.js";import{b as Qt,c as ct}from"./chunk-RDTLCMD2.js";var ss=[{value:"depth",label:"By depth",description:"Thicker the more paths carry a node, on the square root of its depth against the mean. A graph with one depth everywhere draws uniform."},{value:"frequency",label:"By frequency",description:"As wide as the share of haplotypes that pass a node, or its AF tag: full width at 100%, half at 50%, and wider where a haplotype passes it more than once."},{value:"uniform",label:"Uniform",description:"Every node the same thickness."}],sn=.3,kt=3,rn=.05;function re(t){let e=0,n=0;for(let o of t.nodes)e+=o.depth*o.length,n+=o.length;return n>0?e/n:0}function It(t){return t.sample===void 0?ct(t.name)??t.name:`${t.sample}#${t.haplotype??0}`}function At(t){let e=new Map;for(let n of t.paths??[]){let o=It(n);e.has(o)||e.set(o,e.size)}return e}function an(t){return At(t).size}function cn(t,e){return t.frequency??(e>0?t.depth/e:void 0)}function _t(t,e){return e==="depth"?re(t):e==="frequency"?an(t):0}function ae(t){return Math.min(kt,Math.max(rn,t))}function fn(t,e){let n=cn(t,e);return n===void 0?1:ae(n)}function rs(t){return[1,.5,.1].map(e=>({label:`${e*100}%`,widthPx:t*ae(e)}))}function ce(t,e){return!(e>0)||!(t>0)?1:Math.min(kt,Math.max(sn,Math.sqrt(t/e)))}function as(t,e,n){let o=1/0,s=-1/0;for(let{id:a,depth:c}of t.nodes)(!n||n.has(a))&&(o=Math.min(o,c),s=Math.max(s,c));let r=re(t);return(o<s?[s,o]:o===s?[s]:[]).map(a=>({depth:a,widthPx:e*ce(a,r)}))}function Et(t,e,n,o){return e*(n==="depth"?ce(t.depth,o):n==="frequency"?fn(t,o):1)}function ln(t,e){return t*(e==="uniform"?1:kt)}var dn=4;function un(t,e){return Math.max(t/e,dn)}function hn(t,e,n){let o=[...t.from,...t.to].flatMap(s=>{let r=n(s);return r===void 0?[]:[r]});return o.length>0?o.reduce((s,r)=>Math.min(s,r),1/0):e}function cs(t,e,n,o,s=0,r){let a=t?_t(t,o):0,c=f=>s>0?un(f,s)*s/2:f/2,i=f=>{let l=e?.get(f);return l?Et(l,n,o,a):void 0};return{maxHalfWidthPx:c(ln(n,o)),halfWidthPx:f=>{let l=i(f)??n,d=r?.get(f);return c(d?hn(d,l,i):l)}}}function Nt(t){return t==="+"?"-":"+"}function hs(t,e=new Set){let n=t.edges.map(st),o=new Map,s=(u,m,h)=>{$(o,`${u}|${m}`,h)};t.edges.forEach((u,m)=>{s(u.from,n[m].from,m),s(u.to,n[m].to,m)});let r=u=>{let m=o.get(`${u}|end`);if(m?.length!==1)return;let h=m[0],v=t.edges[h];return v.from===u&&v.to!==u&&!e.has(u)&&!e.has(v.to)&&n[h].from==="end"&&n[h].to==="start"&&o.get(`${v.to}|start`)?.length===1?h:void 0},a=new Set,c=new Map,i=new Map;for(let u of t.nodes){let m=o.get(`${u.id}|start`),h=m?.length===1?t.edges[m[0]].from:void 0;if(c.has(u.id)||h!==void 0&&r(h)===m[0])continue;let v=[u.id];for(;;){let y=r(v.at(-1)),M=y===void 0?void 0:t.edges[y].to;if(M===void 0||c.has(M))break;a.add(y),v.push(M)}for(let y of v)c.set(y,u.id);v.length>1&&i.set(u.id,v)}for(let u of t.nodes)c.has(u.id)||c.set(u.id,u.id);let f=new Map(t.nodes.map(u=>[u.id,u])),l=[];for(let u of t.nodes){if(c.get(u.id)!==u.id)continue;let m=i.get(u.id);if(!m){l.push(u);continue}let h=m.map(M=>f.get(M)),v=h.filter(R),y=v.length?v.reduce((M,S)=>M.stable.start<=S.stable.start?M:S):h[0];l.push({id:u.id,name:u.name,length:h.reduce((M,S)=>M+S.length,0),depth:u.depth,stable:y.stable&&Z(y.id)!==Z(u.id)?{...y.stable,strand:Nt(y.stable.strand??"+")}:y.stable})}let d=new Set,p=[];return t.edges.forEach((u,m)=>{let h=c.get(u.from),v=c.get(u.to),y=n[m],M=`${h}|${y.from}>${v}|${y.to}`;a.has(m)||d.has(M)||(d.add(M),p.push({from:h,to:v,...y.from==="start"?{fromStrand:Nt(Z(h))}:{},...y.to==="end"?{toStrand:Nt(Z(v))}:{}}))}),{graph:{...t,nodes:l,edges:p,paths:void 0,pathVisits:void 0},runs:i}}function ps(t,e,n){let o={...t};for(let[s,r]of e){let a=t[s];if(!a?.length)continue;delete o[s];let c=Lt(a),i=c.at(-1),f=r.map(p=>Math.max(n(p),0)),l=f.reduce((p,u)=>p+u,0),d=0;r.forEach((p,u)=>{let m=l?f[u]/l*i:i/r.length,h=u===r.length-1?i:d+m;o[p]=fe(a,c,d,h),d=h})}return o}function ms(t,e,n){if(t.length===0)return[];let o=Lt(t),s=o.at(-1);return fe(t,o,e*s,n*s)}function it(t,e){let n=Lt(t);return t.length===0?{x:Number.NaN,y:Number.NaN}:Ot(t,n,n.at(-1)*e)}function Lt(t){let e=[0];for(let n=1;n<t.length;n++)e.push(e[n-1]+Math.hypot(t[n].x-t[n-1].x,t[n].y-t[n-1].y));return e}var ie=(t,e)=>Y(t.length,n=>t[n]<e);function Ot(t,e,n){if(n<=0)return{...t[0]};let o=ie(e,n);if(o>=e.length)return{...t.at(-1)};let s=e[o]-e[o-1],r=s>0?(n-e[o-1])/s:0,a=t[o-1],c=t[o];return{x:a.x+(c.x-a.x)*r,y:a.y+(c.y-a.y)*r}}function fe(t,e,n,o){let s=[Ot(t,e,n)];for(let r=ie(e,n);r<t.length&&e[r]<o;r++)e[r]>n&&s.push({...t[r]});return s.push(Ot(t,e,o)),s}var le=[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],pn=[.362683783378362,.3137066458778873,.2223810344533745,.1012285362903763],mn=1e-10,yn=40;function gn(t,e,n){let o=3*(t.cx0-t.x0)*e,s=3*(t.cx1-t.cx0)*e,r=3*(t.x1-t.cx1)*e,a=3*(t.cy0-t.y0)*n,c=3*(t.cy1-t.cy0)*n,i=3*(t.y1-t.cy1)*n;return f=>{let l=1-f,d=l*l,p=2*l*f,u=f*f;return Math.hypot(d*o+p*s+u*r,d*a+p*c+u*i)}}function Pt(t,e,n){let o=(n-e)/2,s=(e+n)/2,r=0;for(let a=0;a<le.length;a++){let c=o*le[a];r+=pn[a]*(t(s-c)+t(s+c))}return r*o}function Ct(t,e,n,o,s,r){let a=(e+n)/2,c=Pt(t,e,a),i=Pt(t,a,n);return r>=yn||!(Math.abs(c+i-o)>s)?c+i:Ct(t,e,a,c,s/2,r+1)+Ct(t,a,n,i,s/2,r+1)}function de(t,e,n){let o=(a,c,i,f)=>Math.hypot((i-a)*e,(f-c)*n),s=o(t.x0,t.y0,t.cx0,t.cy0)+o(t.cx0,t.cy0,t.cx1,t.cy1)+o(t.cx1,t.cy1,t.x1,t.y1),r=gn(t,e,n);return Ct(r,0,1,Pt(r,0,1),mn*s,0)}var xn=1e-6,ft=100;function xs(t){return Math.max(xn,Math.min(ft,t))}var V=(t,e)=>{let n=Math.max(0,t),o=Math.min(1,e);return n<=o?[n,o]:void 0};function ue(t,e,n,o){return e===0?t>=n&&t<=o?V(0,1):void 0:V(Math.min((n-t)/e,(o-t)/e),Math.max((n-t)/e,(o-t)/e))}var Mn=(t,e)=>t&&e?V(Math.max(t[0],e[0]),Math.min(t[1],e[1])):void 0;function lt(t,e,n,o){let s=e.x-t.x,r=e.y-t.y,a=t.x-n.x,c=t.y-n.y,i=s*s+r*r,f=2*(a*s+c*r),l=a*a+c*c-o*o,d=f*f-4*i*l;return i===0?l<=0?V(0,1):void 0:d<0?void 0:V((-f-Math.sqrt(d))/(2*i),(-f+Math.sqrt(d))/(2*i))}function vn(t,e,n,o,s){let r=Math.hypot(o.x-n.x,o.y-n.y),a=r>0?(o.x-n.x)/r:0,c=r>0?(o.y-n.y)/r:0,i=t.x-n.x,f=t.y-n.y,l=e.x-t.x,d=e.y-t.y,p=r>0?Mn(ue(i*a+f*c,l*a+d*c,0,r),ue(i*c-f*a,l*c-d*a,-s,s)):void 0,u=[lt(t,e,n,s),lt(t,e,o,s),p].filter(m=>m!==void 0);return u.length>0?V(u.reduce((m,h)=>Math.min(m,h[0]),1),u.reduce((m,h)=>Math.max(m,h[1]),0)):void 0}var he=1e-9;function Xt(t,e,n,o=0){let s=n.halfWidth-o,r=[];for(let c of n.lines){for(let f=1;f<c.length;f++){let l=vn(t,e,c[f-1],c[f],s);l&&r.push(l)}let i=c.length===1?lt(t,e,c[0],s):void 0;i&&r.push(i)}for(let c of n.points){let i=lt(t,e,c,s);i&&r.push(i)}r.sort((c,i)=>c[0]-i[0]);let a=0;for(let[c,i]of r)a=c<=a+he?Math.max(a,i):a;return s>=0&&a>=1-he}var Tt=(t,e)=>Xt(t,t,e);function pe(t,e,n,o){let s={x0:t.x0*e,y0:t.y0*n,cx0:t.cx0*e,cy0:t.cy0*n,cx1:t.cx1*e,cy1:t.cy1*n,x1:t.x1*e,y1:t.y1*n},r=Math.max(Math.hypot(s.x0-2*s.cx0+s.cx1,s.y0-2*s.cy0+s.cy1),Math.hypot(s.cx0-2*s.cx1+s.x1,s.cy0-2*s.cy1+s.y1)),a=Math.max(1,Math.ceil(Math.sqrt(.75*r/o)));return Array.from({length:Number.isFinite(a)?a+1:0},(c,i)=>W(s,i/a))}function H(){let t=new WeakMap;return(e,n,o)=>{let s=t.get(e);if(s?.deps.length===n.length&&s.deps.every((a,c)=>Object.is(a,n[c])))return s.value;let r=o();return t.set(e,{deps:n,value:r}),r}}var q=3,me=.01;function Xs(t){let e=new Set(t.collapsed?.nodes);for(let n of t.laneOnly?.nodes??[])e.add(n);return e}var Ts={sites:[],nodes:new Set,edges:new Set,siteOf:new Map,pxPerBp:0,within:new Map,through:new Map,bridges:new Map,runOf:new Map},z=t=>!!t&&R(t)&&!t.placeholder,dt=(t,e)=>t.stable.start+(at(t,e)?t.length:0),Bt=(t,e)=>t.stable.start+(at(t,e)?0:t.length),ye=(t,e,n)=>n===at(t,e)?"end":"start";function wn(t){let e=At(t),n=new Map,o=new Map;for(let r of t.paths??[]){let a=e.get(It(r))??0;n.set(r.name,a);for(let c of r.nodeIds)wt(o,c,a)}let s=r=>n.get(r)??e.get(ct(r)??r);for(let r of t.nodes)for(let{path:a}of r.departureVisits??[]){let c=s(a);c!==void 0&&wt(o,r.id,c)}return{total:e.size,byNode:o,walkNamed:s}}function bn(t,e,n){let o=new Map(t.nodes.map(g=>[g.id,g])),{total:s,byNode:r,walkNamed:a}=wn(t),c=new Map;for(let g of t.nodes)R(g)||c.set(g.id,g.id);let i=g=>{let x=g,b=c.get(x);for(;b!==void 0&&b!==x;)x=b,b=c.get(x);let k=g;for(;k!==x;){let I=c.get(k)??x;c.set(k,x),k=I}return x},f=g=>c.has(g);for(let{from:g,to:x}of t.edges)f(g)&&f(x)&&c.set(i(g),i(x));let l=new Map,d=g=>{let x=i(g),b=l.get(x),k=b??{nodes:[],edges:[],feet:[],attachments:[],ends:new Set,refNames:new Set,walks:[],bp:0,skip:void 0,tail:!1,tied:!1};return b||l.set(x,k),k};for(let g of t.nodes)if(f(g.id)){let x=d(g.id);x.nodes.push(g.id),x.bp+=g.length}let p=[],u=new Map;t.edges.forEach(({from:g,to:x,fromStrand:b,toStrand:k,pathIds:I},_)=>{let T=f(g)?g:f(x)?x:void 0,X=f(g)?x:g,O=o.get(X),w=o.get(g),L=o.get(x);if(T!==void 0){let A=d(T);A.edges.push(_),f(X)||(z(O)?(A.feet.push({edge:_,atEnd:X===x}),A.refNames.add(O.stable.refName),A.attachments.push(X===g?dt(O,b):Bt(O,k)),A.ends.add(X===g?ye(O,b,!0):ye(O,k,!1))):A.tied=!0)}else if(z(w)&&z(L)&&w.stable.refName===L.stable.refName&&dt(w,b)===Bt(L,k)){let A=u.get(w.stable.refName)??[];A.push({edge:_,at:dt(w,b)}),u.set(w.stable.refName,A)}else if(e?.has(_)&&!n?.has(_)&&z(w)&&z(L)){let A=new Set;for(let B of I??[]){let P=a(B);P!==void 0&&A.add(P)}if(A.size>0){let B=[dt(w,b),Bt(L,k)];p.push({nodes:[],edges:[_],feet:[{edge:_,atEnd:!1},{edge:_,atEnd:!0}],attachments:B,refNames:new Set([w.stable.refName,L.stable.refName]),walks:[...A],bp:ge(B),skip:_,tail:!1})}}});let m=[...p],h=oe(t);for(let{tied:g,ends:x,...b}of l.values()){let k=new Set;for(let _ of b.nodes)for(let T of r.get(_)??[])k.add(T);let I=b.nodes.some(_=>h.has(_));!g&&(x.size===2||b.feet.length===1)&&(!I||b.nodes.every(_=>o.get(_)?.placeholder))&&k.size>0&&m.push({...b,bp:b.bp+ge(b.attachments),walks:[...k],tail:I})}let v=t.nodes.filter(z),y=new Map,M=g=>{let x=y.get(g),b=x??{spans:[],links:[],endingAt:new Map,startingAt:new Map};return x||y.set(g,b),b};for(let g of v){let{refName:x,start:b}=g.stable,k=M(x),I=b+g.length;k.spans.push({id:g.id,start:b,end:I}),$(k.endingAt,I,g.id),$(k.startingAt,b,g.id)}for(let[g,x]of u)M(g).links=x;for(let g of y.values())g.spans.sort((x,b)=>x.start-b.start),g.links.sort((x,b)=>x.at-b.at);let S=g=>g.nodes[0]??`#${g.skip}`;return{units:m.map(g=>({unit:g,start:tt(g.attachments),key:S(g)})).sort((g,x)=>g.start!==x.start?g.start-x.start:g.key<x.key?-1:g.key>x.key?1:0).map(({unit:g})=>g),total:s,backbone:v.map(g=>g.id),backboneBp:v.reduce((g,x)=>g+x.length,0),references:y}}function pt(t,e,n){let o=[];for(let s=Y(t.length,r=>t[r].start<e);s<t.length&&t[s].start<n;s++){let r=t[s];r.end<=n&&r.end>r.start&&o.push(r)}return o}function Sn(t,e){let n=new Map;for(let o of t){let s=e.get(o.refName)?.spans??[];for(let r of pt(s,o.start,o.end))n.set(r.id,o)}return n}function kn(t,e){let n=new Map,o=new Map,s=new Map,r=t.toSorted((c,i)=>c.refName!==i.refName?c.refName<i.refName?-1:1:c.start-i.start),a=0;for(;a<r.length;){let{refName:c}=r[a],{start:i}=r[a],{end:f}=r[a],l=a;for(a++;a<r.length&&r[a].refName===c&&r[a].start<=f;)f=Math.max(f,r[a].end),a++;let d=e.get(c);if(d){let p=pt(d.spans,i,f),u={start:i,end:f,from:d.endingAt.get(i)??[],to:d.startingAt.get(f)??[]};for(let h of p)n.set(h.id,u);for(let h of r.slice(l,a))s.set(h,u);let{links:m}=d;for(let h=Y(m.length,v=>m[v].at<i);h<m.length&&m[h].at<=f;h++)o.set(m[h].edge,{run:u,at:m[h].at})}}return{nodes:n,bridges:o,runOf:s}}var tt=t=>t.reduce((e,n)=>Math.min(e,n),1/0),ht=t=>t.reduce((e,n)=>Math.max(e,n),-1/0),ge=t=>t.length>0?ht(t)-tt(t):0,In=H();function An(t,{edge:e,atEnd:n}){let o=t.get(e),s=o?.[0],r=o?.at(-1);return!s||!r?void 0:n?{x:r.x1,y:r.y1}:{x:s.x0,y:s.y0}}var _n=t=>({x:t.reduce((e,n)=>e+n.x,0)/t.length,y:t.reduce((e,n)=>e+n.y,0)/t.length}),En=(t,e)=>t.reduce((n,o)=>n+de(o,e.scaleX,e.scaleY),0);function Nn(t,e){let n=t[0],o=t.at(-1);return n&&o?Math.hypot((o.x1-n.x0)*e.scaleX,(o.y1-n.y0)*e.scaleY):0}function xe(t,e,n,o){let s=tt(t.attachments),r=ht(t.attachments),a=e?.links??[],c=0;for(let i of t.nodes)c+=n(i);for(let i of t.edges)c+=o(i);for(let i of e?pt(e.spans,s,r):[])c+=n(i.id);for(let i=Y(a.length,f=>a[f].at<s);i<a.length&&a[i].at<=r;i++)c+=o(a[i].edge);return c}function Me(t){let e=new Map;return n=>{let o=e.get(n),s=o??t(n);return o===void 0&&e.set(n,s),s}}function Rt(t,e,n,o){let s=t.reduce((r,a)=>r+G(n[a]??[],o.scaleX,o.scaleY),0);return e>0?s/e:0}var On=H();function Bs(t,e,n,o=0){return On(e,[t,n.scaleX,n.scaleY,o],()=>{let s=t.filter(z);return Rt(s.map(r=>r.id),s.reduce((r,a)=>r+a.length,0),e,n)})}var ut=(t,e)=>({x:t.x*e.scaleX,y:t.y*e.scaleY});function Ln(t,e,n,o,s){let r=t.nodes.map(c=>(n[c]??[]).map(i=>ut(i,s))),a=(c,i)=>c.every((f,l)=>l===0||Xt(c[l-1],f,e,i));return r.every(c=>c.every(i=>Tt(i,e)))&&r.every(c=>a(c,0))&&t.edges.every(c=>(o.get(c)??[]).every(i=>a(pe(i,s.scaleX,s.scaleY,me),me)))}function Pn(t,e,n,o,s,r,a){let{units:c,total:i,backbone:f,backboneBp:l,references:d}=In(t,[s,r],()=>bn(t,s,r)),p=Rt(f,l,e,n),u={...n,scaleX:ft,scaleY:n.pixelRows?n.scaleY:ft},m=Rt(f,l,e,u),h=new Set(t.nodes.flatMap(w=>w.placeholder?[w.id]:[])),v=(w,L)=>({node:Me(A=>G(e[A]??[],w.scaleX,w.scaleY)),edge:Me(A=>L(o.get(A)??[],w))}),y=v(n,En),M=v(u,Nn),S=(w,L)=>{let A=d.get(L),B=xe(w,A,y.node,y.edge),P=xe(w,A,M.node,M.edge),E=w.nodes.some(C=>h.has(C))&&p>0;return w.tail?{shown:w.bp*p,back:w.bp*m}:{shown:E?Math.min(B,w.bp*p):B,back:E?Math.min(P,w.bp*m):P}},N=new Map(t.nodes.map(w=>[w.id,w])),g=_t(t,a.nodeWidth),x=w=>{let L=N.get(w);return L?Et(L,a.contigThickness,a.nodeWidth,g)/2:0},b=(w,L,A,B)=>{let P=L?pt(L.spans,tt(w.attachments),ht(w.attachments)).map(C=>C.id):[],E=w.feet.flatMap(({edge:C,atEnd:j})=>{let vt=t.edges[C];return vt?[j?vt.to:vt.from]:[]});return{lines:P.map(C=>(e[C]??[]).map(j=>ut(j,B))),points:A.map(C=>ut(C,B)),halfWidth:[...P,...E].reduce((C,j)=>Math.min(C,x(j)),1/0)}},k=(w,L,A)=>{let B=()=>{let P=b(w,L,A,u);return w.nodes.some(E=>(e[E]??[]).some(C=>!Tt(ut(C,u),P)))};return w.nodes.length>0&&w.bp*p<q&&w.bp*m>=q&&Ln(w,b(w,L,A,n),e,o,n)&&B()},I=new Set,_=new Set,T=new Map,X=[];for(let w of c){let L=w.feet.flatMap(P=>{let E=An(o,P);return E?[E]:[]}),[A]=w.refNames,B=A!==void 0&&w.refNames.size===1&&w.bp>0&&L.length===w.feet.length&&w.nodes.every(P=>e[P]?.length)?S(w,A):void 0;if(A!==void 0&&B&&B.back>=q&&(B.shown<q||k(w,d.get(A),L))){let P={nodes:w.nodes,edges:w.edges,refName:A,start:tt(w.attachments),end:ht(w.attachments),bp:w.bp,..._n(L),count:w.walks.length,total:i};X.push(P);for(let E of w.nodes)I.add(E),T.set(E,P);for(let E of w.edges)_.add(E)}}let O=kn(X,d);return{sites:X,nodes:I,edges:_,siteOf:T,pxPerBp:p,within:Sn(X,d),through:O.nodes,bridges:O.bridges,runOf:O.runOf}}var Cn=H(),Rs=t=>t.sites.reduce((e,n)=>Math.max(e,n.bp+1),0);function Hs(t,e,n,o,s,r,a){return Cn(o,[t,e,s,r,a.contigThickness,a.nodeWidth],()=>Pn(t,e,n,o,s,r,a))}var ve=11,Xn=6.2,mt=4;function yt(t){return t.length*Xn+mt*2}function Se(t,e){return t.x0<e.x1&&t.x1>e.x0&&t.y0<e.y1&&t.y1>e.y0}function ke(t,e){return t.x1<=0||t.x0>=e.width||t.y1<=0||t.y0>=e.height}function D(t,e){return t.x0>=0&&t.x1<=e.width&&t.y0>=0&&t.y1<=e.height}function Ie(t,e){return{x0:t.x0-e,x1:t.x1+e,y0:t.y0-e,y1:t.y1+e}}function Tn(t,e=[]){let n=[...e];return(o,s)=>{let r=s?[o,s]:[o];if(ke(o,t)||n.some(a=>r.some(c=>Se(a,c))))return!1;for(let a of r)n.push(a);return!0}}var we=8;function be(t){let e=[0];for(let n=we;n<t;n+=we)e.push(-n,n);return t>0&&e.push(-t,t),e}function Ys(t,e,n,o=[],s=0){let r=[],a=0,c=ve+mt*2,i=(h,v,y)=>({x0:h-y/2,x1:h+y/2,y0:v-ve-mt,y1:v+mt}),f=(h,v,y,M)=>{let S=yt(v),N=[];for(let x=0;x<=(h.stack??0);x++){let b=y+M*x*c;if(ke(i(h.x,b,S),e))break;for(let k of be(h.slide??0))N.push({dx:k,y:b,distance:Math.hypot(k,x*c)})}N.sort((x,b)=>x.distance-b.distance);let g=!1;for(let{dx:x,y:b}of N){let k=i(h.x+x,b,S);if(D(k,e)&&(h.fits?.(k)??!0)){if(n(k))return{placed:{...h,x:h.x+x,text:v,y:b,w:S},crowded:g};g||=!o.some(I=>Se(I,k))}}return{placed:void 0,crowded:g}},l=(h,v)=>{let y=f(h,v,h.y,h.y>e.height/2?-1:1);return y.placed||h.flipY===void 0||y.crowded?y:f(h,v,h.flipY,h.flipY<h.y?-1:1)},d=Math.ceil(e.height/c),p=h=>{let v=[];for(let y=-d;y<=d;y++)for(let M of be(h))v.push({dx:M,dy:y*c,distance:Math.hypot(M,y*c)});return v.sort((y,M)=>y.distance-M.distance)},u,m=(h,v,y)=>{let M=yt(v),S=D({x0:y.x,x1:y.x,y0:y.y,y1:y.y},e)?u??=p(e.width):p(h.slide??0),N=x=>{let b;for(let k=0;k<S.length&&!b;k++){let I=y.x+S[k].dx,_=y.y+S[k].dy,T=i(I,_,M);b=D(T,e)&&x(T)?{x:I,y:_}:void 0}return b},g=N(x=>(h.fits?.(x)??!0)&&n(x))??N(n);return g&&{...h,x:g.x,y:g.y,text:v,w:M}};for(let h of t){let v=l(h,h.text),y=v.placed||h.fallback===void 0?void 0:l(h,h.fallback),M=v.placed??y?.placed,S=v.crowded||y?.crowded===!0,N=M||h.nearest===void 0||S&&a>=s?void 0:m(h,h.text,h.nearest);N&&a++;let g=M??N;g&&r.push(g)}return r}function qs(t,e){let n=new Set(t.nodes.filter(i=>R(i)&&St(i,e)).map(i=>i.id)),o=t.paths??[];if(n.size===0||o.length===0)return t;let s=o.map(i=>{let f=-1,l=-1;return i.nodeIds.forEach((d,p)=>{n.has(d)&&(f<0&&(f=p),l=p)}),f<0?void 0:{first:f,last:l}});if(s.every((i,f)=>i?.first===0&&i.last===o[f].nodeIds.length-1))return t;let r=new Set,a=[],c=new Map;return o.forEach((i,f)=>{let l=s[f];if(l){let d=i.nodeIds.slice(l.first,l.last+1);for(let p of d)r.add(p);a.push({...i,nodeIds:d,...i.refStarts?{refStarts:i.refStarts.subarray(l.first,l.last+1)}:{}}),c.set(i.name,{first:l.first,nodeIds:d})}}),{...t,nodes:t.nodes.filter(i=>r.has(i.id)),edges:t.edges.filter(i=>r.has(i.from)&&r.has(i.to)),paths:a,pathVisits:t.pathVisits&&Bn(t.pathVisits,o,s,new Map(t.nodes.map(i=>[i.id,i.name]))),anchorPaths:ee(t,c)}}function Bn(t,e,n,o){let s=t.replay(),r=new te;return e.forEach((a,c)=>{let i=t.pathIndex(J(a.name).name),f=n[c];a.nodeIds.forEach((l,d)=>{let p=o.get(l)??l,u=s(t.slot(p),i);u>=0&&f&&d>=f.first&&d<=f.last&&r.add(p,t.paths[i],t.samples[i],t.start[u],t.reversed[u]===1)})}),r.build()}function Gs(t,e,n){let o=t.nodes.map(s=>{if(!R(s))return s;let r=s.stable.start,a=r+s.length,[c,i]=St(s,e)?[Math.max(r,e.start),Math.min(a,e.end)]:a<=e.start?[Math.max(r,a-n),a]:[r,Math.min(a,r+n)];return c===r&&i===a?s:{...s,length:i-c,stable:{...s.stable,start:c},unclipped:{start:r,length:s.length}}});return o.some((s,r)=>s!==t.nodes[r])?{...t,nodes:o}:t}function Ae(t){return t.nodes.some(e=>e.unclipped)?{...t,nodes:t.nodes.map(({unclipped:e,...n})=>e&&n.stable?{...n,length:e.length,stable:{...n.stable,start:e.start}}:n)}:t}var Rn=1,er=t=>`skips ${t??"the reference"} sequence`,nr="short skip";function Hn(t,e){return e.flatMap(n=>t[n]??[])}function Ht(t,e,n,o,s,r){let a=t[e.from],c=t[e.to];if(!(!a?.length||!c?.length))return s?Zt(a,c,s,r?st(e):void 0):Ut(a,c,Kt(e,r),n,o?Hn(t,o):[])}function $n(t){let e=K(t.nodes.filter(R),n=>n.stable.refName);for(let n of e.values())n.sort((o,s)=>o.stable.start-s.stable.start);return e}function Yn(t,e,n){let o=[];if(t)for(let s=Jt(t,e);s<t.length;s++){let r=t[s];if(r.stable.start>=n)break;r.stable.start+r.length<=n&&o.push(r.id)}return o}function Wn(t,e,n,o){let{fromStrand:s,toStrand:r}=t;if(s===void 0||r===void 0)return!0;let a=s===e.strand,c=r===n.strand;return o?a&&c:!a&&!c}function Dn(t,e,n,o){let s;for(let[r,a]of o){let c=r.start<=a.start,i=c?{start:r.start+e.length,end:a.start}:{start:a.start+n.length,end:r.start};Wn(t,r,a,c)&&(!s||Math.abs(i.end-i.start)<Math.abs(s.end-s.start))&&(s=i)}return s}function Fn(t,e,n){return n(t).flatMap(o=>n(e).map(s=>[o,s]))}function zn(t){let{pathVisits:e}=t;return(n,o)=>{let s;if(e){let r=e.pathIndex(n.stable.refName),a=e.slot(n.name);if(a>=0&&r>=0)for(let c=e.offsets[a];c<e.offsets[a+1]&&!s;c++)e.path[c]===r&&e.start[c]===o&&(s={start:o,strand:e.strand(c)})}return s}}function qn(t,e){let n=new Map;for(let r of e){let{from:a,to:c}=t.edges[r],i=n.get(a);i||(i=new Map,n.set(a,i)),$(i,c,r)}let o=new Map,s=(r,a,c)=>{let i=o.get(r);if(i||(i=[],o.set(r,i)),!Number.isNaN(a)&&!Number.isNaN(c)){let f=!1;for(let l=0;l<i.length&&!f;l+=2)f=i[l]===a&&i[l+1]===c;f||i.push(a,c)}};for(let{nodeIds:r,refStarts:a}of t.paths??[])if(a)for(let c=1;c<r.length;c++){let i=r[c-1],f=r[c];for(let l of n.get(i)?.get(f)??[])s(l,a[c-1],a[c]);for(let l of n.get(f)?.get(i)??[])s(l,a[c],a[c-1])}return o}function Gn(t,e,n,o){let s=[];for(let r=0;r<n.length;r+=2){let a=o(t,n[r]),c=o(e,n[r+1]);a&&c&&s.push([a,c])}return s}var Vn=.01;function jn(t,e){let n=new Map;for(let[o,s]of t){let r=s.flatMap(a=>{let c=e(a).map(i=>i.start);return c.slice(1).map((i,f)=>({at:c[f],copy:i-c[f]}))});r.length&&n.set(o,r.sort((a,c)=>a.at-c.at))}return n}function Kn(t,e,n){if(!t)return!1;let o=Y(t.length,r=>t[r].at<e),s=[t[o-1],t[o]].filter(r=>r!==void 0).sort((r,a)=>Math.abs(r.at-e)-Math.abs(a.at-e))[0];return s!==void 0&&Math.abs(s.at-e)<=s.copy&&Math.abs(n-s.copy)<=s.copy*Vn}function Un(t){let e=Ae(t),n=new Map(e.nodes.map(l=>[l.id,l])),o=$n(e),s=ne(e),r=e.edges.flatMap((l,d)=>{let p=n.get(l.from),u=n.get(l.to);return!l.foldBridge&&p!==void 0&&u!==void 0&&R(p)&&R(u)&&p.stable.refName===u.stable.refName?[{edgeIndex:d,edge:l,from:p,to:u}]:[]}),c=e.paths!==void 0&&e.paths.length>0&&e.paths.every(l=>l.refStarts)?qn(e,r.map(l=>l.edgeIndex)):new Map,i=zn(e);return{links:r.map(({edgeIndex:l,edge:d,from:p,to:u})=>{let m=c.get(l);return{edgeIndex:l,edge:d,refName:p.stable.refName,span:Dn(d,p,u,m?Gn(p,u,m,i):Fn(p,u,s))}}),backbone:o,copies:jn(o,s)}}function Ee(t){let{links:e,backbone:n,copies:o}=Un(t);return e.flatMap(({edgeIndex:s,edge:r,refName:a,span:c})=>{let i=c?c.end-c.start:0;return c&&i>=Rn&&!Kn(o.get(a),c.start,i)?[{edgeIndex:s,from:r.from,to:r.to,...r.fromStrand?{fromStrand:r.fromStrand}:{},...r.toStrand?{toStrand:r.toStrand}:{},refName:a,start:c.start,end:c.end,bp:i,bypassed:Yn(n.get(a),c.start,c.end)}]:[]})}function Zn(t,e){let n=new Map,o=a=>{let c=a;for(;n.has(c);)c=n.get(c);return c!==a&&n.set(a,c),c},s=(a,c)=>{let[i,f]=[o(a),o(c)];return i!==f&&n.set(i,f),i!==f},r=new Set(e);return t.edges.forEach((a,c)=>{r.has(c)||s(a.from,a.to)}),new Set(se(e.map(a=>({...t.edges[a],ei:a}))).filter(a=>!s(a.from,a.to)).map(({ei:a})=>a))}var _e=new WeakMap;function or(t,e,n=!0){let o=_e.get(e);o||(o=new Map,_e.set(e,o));let s=o.get(n);if(!s){let r=n?new Set:Zn(t,e.map(a=>a.edgeIndex));s={shown:e.filter(a=>!r.has(a.edgeIndex)),bypassed:new Map(e.map(a=>[a.edgeIndex,a.bypassed])),hidden:r},o.set(n,s)}return s}var Jn=class extends Map{constructor(){super(...arguments),this.arcs=new Set}},Qn=1,to=11,eo=3*to,no=t=>t>=eo,$t=5,Pe=8,oo=64,Yt=-1,Ce=12,Ne=16,so=Ce+$t;function ro(t,e,n,o){let s=l=>({x:l.x*o.scaleX,y:l.y*o.scaleY}),r=t[0],a=t.at(-1),c=[s({x:r.x0,y:r.y0}),...e.flatMap(l=>(n[l]??[]).map(s)),s({x:a.x1,y:a.y1})],i=0,f=0;for(let l of t)for(let d=0;d<=Ne;d++){let p=s(W(l,d/Ne)),u=!1;for(let m=1;m<c.length&&!u;m++){let h=c[m-1],v=c[m];u=U(p.x,p.y,h.x,h.y,v.x,v.y)<=Ce}f++,i+=u?1:0}return i*2>f}function ao(t,e,n,o){let{ax:s,ay:r,ux:a,uy:c}=gt(t,o),i=0;for(let f of e)for(let l of n[f]??[]){let d=(l.y*o.scaleY-r)*a-(l.x*o.scaleX-s)*c;i=Math.abs(d)>Math.abs(i)?d:i}return Math.abs(i)>=1?-Math.sign(i):Math.sign(Wt(t,o,Pe))||Yt}function Oe(t,e){return gt(t,e).length}var co=H();function Xe(t,e,n,o,s,r,a=!1){return co(t,[e,n.scaleX,n.scaleY,!!n.pixelRows,o,r,a,s],()=>{let c=new Jn;for(let i=0;i<e.edges.length;i++){let f=e.edges[i],l=o?.get(i),d=r?.[i],p=l?Ht(t,f,n,l,d,a):void 0,u=l&&d&&p&&no(Oe(p,n))&&ro(p,l,t,n)?Le(p,n,so*ao(p,l,t,n)):p,m=u!==void 0&&Oe(u,n)>=Qn,h=m?u:Ht(t,f,n,void 0,void 0,a);h&&(c.set(i,h),m&&c.arcs.add(i))}if(o){let i=new Map(e.nodes.map(y=>[y.id,y])),{spans:f,levels:l,alone:d}=io(o,[e],()=>fo(Ee(e).filter(y=>o.has(y.edgeIndex)))),p=y=>l.get(y)??1,u=new Map(Array.from(c.arcs,y=>[y,lo(c.get(y),n)])),m=new Map;for(let y of u.values())m.set(y,(m.get(y)??0)+1);let h=new Map,v=new Map;for(let y of Array.from(c.arcs).sort((M,S)=>p(M)-p(S)||M-S)){let M=u.get(y),S=Math.max(p(y),(h.get(M)??0)+1);h.set(M,S),v.set(y,S*$t)}Te(f.filter(y=>c.arcs.has(y.edgeIndex)),(y,M)=>{let S=y.edgeIndex,N=e.edges[S],g=c.get(S),x=Math.max(v.get(S),M>0?M+$t:0),b=Wt(g,n,Pe),I=(!d.has(S)||m.get(u.get(S))>1)&&Math.abs(b)<x;if(I){let _=i.get(N.from)?.stable?.start??0,T=i.get(N.to)?.stable?.start??0,X=r?.[S]?_<=T?Yt:-Yt:Math.sign(b)||1;c.set(S,Le(g,n,x*X))}return I?x:Math.abs(Wt(g,n,oo))})}return c})}var io=H();function Te(t,e){for(let n of K(t,o=>o.refName).values()){let o=Array.from(new Set(n.map(r=>r.start))).sort((r,a)=>a-r),s=new Array(o.length+1).fill(0);for(let r of n.toSorted((a,c)=>a.end-c.end||c.start-a.start||a.edgeIndex-c.edgeIndex)){let a=Y(o.length,f=>o[f]>r.start)+1,c=0;for(let f=a;f>0;f-=f&-f)c=Math.max(c,s[f]);let i=e(r,c);for(let f=a;f<=o.length;f+=f&-f)s[f]=Math.max(s[f],i)}}}function fo(t){let e=new Map;Te(t,(o,s)=>(e.set(o.edgeIndex,s+1),s+1));let n=new Set;for(let o of K(t,s=>s.refName).values()){let s;for(let r of o.toSorted((a,c)=>a.start-c.start))s&&r.start<s.end&&(n.add(r.edgeIndex),n.add(s.edgeIndex)),s=s&&s.end>=r.end?s:r}return{spans:t,levels:e,alone:new Set(t.flatMap(o=>n.has(o.edgeIndex)?[]:[o.edgeIndex]))}}function lo(t,e){let n=t[0],o=t.at(-1);return[`${Math.round(n.x0*e.scaleX)},${Math.round(n.y0*e.scaleY)}`,`${Math.round(o.x1*e.scaleX)},${Math.round(o.y1*e.scaleY)}`].sort().join(" ")}function gt(t,e){let n=t[0],o=t.at(-1),s=n.x0*e.scaleX,r=n.y0*e.scaleY,a=Math.hypot(o.x1*e.scaleX-s,o.y1*e.scaleY-r);return{ax:s,ay:r,length:a,ux:(o.x1*e.scaleX-s)/a,uy:(o.y1*e.scaleY-r)/a}}function Wt(t,e,n){let{ax:o,ay:s,ux:r,uy:a}=gt(t,e),c=0;for(let i of t)for(let f=1;f<n;f++){let l=W(i,f/n),d=(l.y*e.scaleY-s)*r-(l.x*e.scaleX-o)*a;c=Math.abs(d)>Math.abs(c)?d:c}return c}function Le(t,e,n){let o=t[0],s=t.at(-1),{ux:r,uy:a}=gt(t,e),c=n/jt,i=-a*c/e.scaleX,f=r*c/e.scaleY,l=r*Math.abs(c)/e.scaleX,d=a*Math.abs(c)/e.scaleY;return[{x0:o.x0,y0:o.y0,cx0:o.x0+i-l,cy0:o.y0+f-d,cx1:s.x1+i+l,cy1:s.y1+f+d,x1:s.x1,y1:s.y1}]}var uo=50;function Be(t,e){return e>0?Math.max(1,t/e):uo}function ho(t){let e=new Set,n=1/0,o=-1/0;for(let s of t)e.add(s.minY),n=Math.min(n,s.minY),o=Math.max(o,s.minY);return e.size>1?(o-n)/(e.size-1):void 0}function He(t,e,n){let o=Be(e,t.length);return{x:o,y:n>0?Be(n,t.length):ho(t)??o}}function po(t,e,n,o){return t===void 0?He(e,n,o):typeof t=="number"?{x:t,y:t}:t}function mo(t,e,n){let o=t.get(e);o||(o=new Map,t.set(e,o));let s=o.get(n);return s||(s=[],o.set(n,s)),s}function $e(t,e,n,o,s,r,a){let c=Math.floor(n/e.x),i=Math.floor(s/e.x),f=Math.floor(o/e.y),l=Math.floor(r/e.y);for(let d=c;d<=i;d++)for(let p=f;p<=l;p++)mo(t,d,p).push(a)}function*Re(t,e,n){if(n-e<t.size)for(let o=e;o<=n;o++){let s=t.get(o);s!==void 0&&(yield s)}else{let o=[];for(let s of t)s[0]>=e&&s[0]<=n&&o.push(s);o.sort((s,r)=>s[0]-r[0]);for(let[,s]of o)yield s}}function*Ye(t,e,n,o,s,r){let a=Math.floor((o-r)/e.y),c=Math.floor((o+r)/e.y);for(let i of Re(t,Math.floor((n-s)/e.x),Math.floor((n+s)/e.x)))yield*Re(i,a,c)}function We(t,e,n,o,s,r){let a=[],c=new Set;for(let i of Ye(t,e,n,o,s,r))for(let f of i)c.has(f)||(c.add(f),a.push(f));return a}function yo(t,e,n,o,s,r,a){let c=!1;for(let i of Ye(t,e,n,o,s,r))if(c=i.some(a),c)break;return c}var Dt=class{constructor(t,e,n={x:0,y:0}){this.cells=new Map;let o=[],s=0,r=0;for(let[c,i]of Object.entries(t))for(let f=0;f<i.length-1;f++){let l=i[f],d=i[f+1],p=Math.min(l.x,d.x),u=Math.min(l.y,d.y),m=Math.max(l.x,d.x),h=Math.max(l.y,d.y);s+=m-p,r+=h-u,o.push({entry:{nodeId:c,segmentIdx:f},minX:p,minY:u,maxX:m,maxY:h})}let a=po(e,o,s,r);this.cellSize={x:Math.max(a.x,n.x),y:Math.max(a.y,n.y)};for(let c of o)$e(this.cells,this.cellSize,c.minX,c.minY,c.maxX,c.maxY,c.entry)}query(t,e,n,o=n){return We(this.cells,this.cellSize,t,e,n,o)}some(t,e,n,o,s){return yo(this.cells,this.cellSize,t,e,n,o,s)}},De=class{constructor(t,e,n,o,s,r=0,a,c=!1){this.cells=new Map,this.edgeCurves=Xe(t,e,o,s,r,a,c);let i=[],f=0,l=0;for(let d=0;d<e.edges.length;d++){let p=e.edges[d],u=t[p.from],m=t[p.to],h=this.edgeCurves.get(d);if(u?.length&&m?.length&&h){let{minX:v,minY:y,maxX:M,maxY:S}=Vt(h),N=p.pathIds?.length??0;if(n&&N>0){let g=0,x=0;for(let b of rt(u,m,N,o,h))g=Math.max(g,Math.abs(b.x)),x=Math.max(x,Math.abs(b.y));v-=g,y-=x,M+=g,S+=x}f+=M-v,l+=S-y,i.push({ei:d,minX:v,minY:y,maxX:M,maxY:S})}}this.cellSize=He(i,f,l);for(let d of i)$e(this.cells,this.cellSize,d.minX,d.minY,d.maxX,d.maxY,d.ei)}getCurves(t){return this.edgeCurves.get(t)}query(t,e,n,o=n){return We(this.cells,this.cellSize,t,e,n,o)}};var Fe=20;function go(t,e,n,o=1){let s=1/0,r=W(n,0);for(let a=1;a<=Fe;a++){let c=W(n,a/Fe);s=Math.min(s,U(t,e,r.x,r.y*o,c.x,c.y*o)),r=c}return s}function xo(t,e,n,o){let s=1/0;for(let r of n){let a=go(t,e,r,o);a<s&&(s=a)}return s}var Mo=H();function vo(t,e){return Mo(t,[e],()=>new Dt(t))}var ze=16,wo=H();function bo(t,e,n,o){return wo(t,[e,n,o],()=>new Dt(t,void 0,{x:ze/Math.abs(n),y:ze/Math.abs(o)}))}var So=H();function ko(t,e,n,o,s,r,a,c){return So(t,[e,n,o.scaleX,o.scaleY,!!o.pixelRows,s,r,a,c],()=>new De(t,e,n,o,r,s,a,c))}var Io=5;function vr(t,e,n,o,s,r,a){let c=bt(o),i=vo(t,s),f=m=>Math.max(Io,m)/o.scaleX,l=f(r?.maxHalfWidthPx??0),d=i.query(e,n,l,l/c),p=null,u=1/0;for(let{nodeId:m,segmentIdx:h}of d){let v=t[m],y=a?.nodes.has(m)?1/0:U(e,n*c,v[h].x,v[h].y*c,v[h+1].x,v[h+1].y*c);y<u&&y<f(r?.halfWidthPx(m)??0)&&(u=y,p=m)}return p}function xt(t,e,n){let o=e.x-t.x,s=e.y-t.y,r=0,a=1;for(let[c,i]of[[-o,t.x-n.x0],[o,n.x1-t.x],[-s,t.y-n.y0],[s,n.y1-t.y]])c===0?r=i<0?1/0:r:c<0?r=Math.max(r,i/c):a=Math.min(a,i/c);return r<=a?[r,a]:void 0}function Ao(t,e,n){return Math.max(t.x,e.x)>=n.x0&&Math.min(t.x,e.x)<=n.x1&&Math.max(t.y,e.y)>=n.y0&&Math.min(t.y,e.y)<=n.y1&&xt(t,e,n)!==void 0}function wr(t,e,n=0){let o=r=>({x:r.x*e.scaleX+e.translateX,y:r.y*e.scaleY+e.translateY}),s;return(r,a)=>(s??=bo(t,n,e.scaleX,e.scaleY),s.some(((r.x0+r.x1)/2-e.translateX)/e.scaleX,((r.y0+r.y1)/2-e.translateY)/e.scaleY,Math.abs((r.x1-r.x0)/2/e.scaleX),Math.abs((r.y1-r.y0)/2/e.scaleY),({nodeId:c,segmentIdx:i})=>{let f=t[c],l=f?.[i],d=f?.[i+1];return l!==void 0&&d!==void 0&&!a(c)&&Ao(o(l),o(d),r)}))}var _o={x:0,y:0};function br(t,e,n,o,s,r,a,c,i,f,l,d){let p=bt(s),u=10/s.scaleX,m=ko(t,e,r,s,a,c,f,l),h=m.query(n,o,u,u/p),v=null,y=u;for(let M of h){let S=e.edges[M],N=t[S.from],g=t[S.to],x=m.getCurves(M);if(N?.length&&g?.length&&x&&!i?.has(M)&&!d?.edges.has(M)){let b=S.pathIds?.length??0,k=r&&b>0?rt(N,g,b,s,x):[_o];for(let I of k){let _=xo(n-I.x,(o-I.y)*p,x,p);_<y&&(y=_,v=M)}}}return v}var Eo={nodeLengths:!0};function Cr(t,e=Eo.nodeLengths){let n=new Map;for(let o of t)(e||o.placeholder)&&n.set(o.id,o.length);return n}var No=4e4,Oo=8,Lo=5.7,Po=6,ot=13,et=3,Ft=ot,Co=3,Xo=2;function Gt(t){return(t.length*Lo+Po+et)/2}var F=(ot+et)/2,qe=2*F+2*Ft,Ke=({x:t,y:e},{width:n,height:o})=>t>=0&&t<=n&&e+F>0&&e-F<o;function Mt(t,e,n){return{x0:e-t,x1:e+t,y0:n-F,y1:n+F}}function Xr(t,e){return{x0:6,x1:6+yt(t)+et,y0:e-8-et/2,y1:e+8+et/2}}function Ue(t){return String(t).replace(/\B(?=(\d{3})+$)/g,",")}function zt(t){let[e,n]=t>=999500?[t/1e6,"Mb"]:t>=1e3?[t/1e3,"kb"]:[];return e===void 0?`${t} bp`:`${+e.toFixed(e>=100?0:1)} ${n}`}var To=H();function Bo(t,e,n){return To(t,[e,n],()=>Object.entries(t).filter(([o,s])=>s.length>0&&e.has(o)).map(([o,s])=>({id:o,segments:s,kept:n?.get(o)?.placeholder===!0})).sort((o,s)=>o.kept===s.kept?e.get(s.id)-e.get(o.id)||Q(o.id,s.id):o.kept?-1:1))}var Ze=Array.from({length:15},(t,e)=>(e+1)/16).sort((t,e)=>Math.abs(t-.5)-Math.abs(e-.5)||t-e);function Je(t,e,n,o){let s=[0];for(let r=Ge;r<=e;r+=Ge)s.push(-r,r);return Array.from({length:o},(r,a)=>a+1).flatMap(r=>[1,-1].flatMap(a=>s.map(c=>({x:n.x+c,y:n.y+a*r*qt,distance:Math.hypot(c,r*qt)})))).sort((r,a)=>r.distance-a.distance).map(({x:r,y:a})=>({label:{...t,x:r,y:a,leader:n},box:Mt(e,r,a)}))}var Ge=8,Ro=2*F,Qe=(t,e)=>Math.hypot(t.x-e.x,t.y-e.y)<Ro,qt=2*F,tn=t=>Math.ceil(t/qt);function Tr({x:t,y:e,leader:n}){return n?en({x:t,y:e},n):void 0}function en({x:t,y:e},n){return{x1:t,y1:n.y>e?e+ot/2:e-ot/2,x2:n.x,y2:n.y}}function Ho(t,e){let{x1:n,y1:o}=en(t,e),s=Math.hypot(n-e.x,o-e.y),r=s>0?Math.min(1,F/s):1,a=e.x+(n-e.x)*r,c=e.y+(o-e.y)*r;return{x0:Math.min(n,a)-1,x1:Math.max(n,a)+1,y0:Math.min(o,c),y1:Math.max(o,c)}}function nn(t,e){let n=0,o=1/0,s=-1/0,r=0,a=!1;return t.forEach((c,i)=>{let f=t[i-1],l=f?xt(f,c,e):void 0,d=f?Math.hypot(c.x-f.x,c.y-f.y):0;l&&(o=Math.min(o,n+l[0]*d),s=n+l[1]*d),r+=l&&!a?1:0,a=!!l,n+=d}),r===1&&o>=Ft&&n-s>=Ft}function Br({nodePositions:t,nodeLengths:e,nodeById:n,alleleDeletions:o,pxPerBp:s=0,axis:r,translateX:a,translateY:c,width:i,height:f}){let{scaleX:l,scaleY:d}=r,p=new Set(o?.flatMap(y=>y.nodeIds)),u=[],m=({x:y,y:M})=>({x:y*l+a,y:M*d+c}),h={width:i,height:f},v=y=>m(it(t[y]??[],.5));for(let{id:y,segments:M,kept:S}of Bo(t,e,n)){let N=p.has(y)?[]:Ze.map(I=>m(it(M,I))).filter(I=>Ke(I,h)),g=e.get(y),x=N.length>0?G(M,l,d):0,b=S||g*s>=q,[k]=N;if(k&&(x>=qe||b)){let I={key:`node:${y}`,node:y,text:zt(g)},_=Gt(I.text),T=x>=qe?M.map(m):[],X=N.map(({x:O,y:w})=>({label:{...I,x:O,y:w},box:Mt(_,O,w)})).filter(({box:O})=>D(O,h)&&nn(T,O));(X.length>0||b)&&u.push({id:y,kept:S,middle:k,along:X,own:({node:O})=>O===y||O!==void 0&&(t[O]?.length??0)>0&&Qe(v(O),v(y)),stacked:b?()=>Je(I,_,k,S?tn(f):Co).filter(({box:O})=>D(O,h)):void 0})}}return u}var $o=H();function Rr(t){return $o(t.nodes,[t.paths],()=>{let e=new Map(t.nodes.map(a=>[a.id,a])),n=new Set,o=[];for(let a of t.paths??[]){let c=[],i=0,f=!0,l=!1;for(let d of a.nodeIds){let p=e.get(d);if(p&&R(p)){let u=c.join(" ");l&&f&&c.length>0&&!n.has(u)&&(n.add(u),o.push({nodes:c,bp:i})),l=!0,c=[],i=0,f=!0}else c.push(d),i+=p?.length??0,f&&=!!p&&!p.placeholder}}o.sort((a,c)=>c.bp-a.bp||Q(a.nodes[0]??"",c.nodes[0]??"")||c.nodes.length-a.nodes.length);let s=[],r=new Map;for(let a of o){let c=new Map;for(let l of new Set(a.nodes))for(let d of r.get(l)??[])c.set(d,(c.get(d)??0)+(e.get(l)?.length??0));let i;for(let[l,d]of c)i??=2*d>=s[l].bp?l:void 0;let f=i===void 0?void 0:s[i];if(f){f.least=Math.min(f.least,a.bp);for(let l of a.nodes)f.drawn.add(l)}else{for(let l of new Set(a.nodes))$(r,l,s.length);s.push({...a,least:a.bp,drawn:new Set(a.nodes)})}}return s})}function Yo(t,e){let n=zt(t),o=zt(e),[s,r]=n.split(" ");return n===o?o:r===o.split(" ")[1]?`${s}\u2013${o}`:`${n}\u2013${o}`}var nt=(t,e)=>Math.hypot(t.x-e.x,t.y-e.y),Ve=(t,e)=>Math.min(nt(t,e[0]??t),nt(t,e.at(-1)??t));function Wo(t,e){let n=t.map(a=>e[a]??[]),o=[],s=[],r=0;return n.forEach((a,c)=>{let i=a[0],f=a.at(-1),l=n[c+1]??[],d=o.at(-1),p=i&&f?d?nt(d,f)<nt(d,i):l.length>0&&Ve(i,l)<Ve(f,l):!1;for(let u=0;u<a.length;u++){let m=a[p?a.length-1-u:u],h=o.at(-1);r+=h?nt(h,m):0,o.push(m)}s.push(r)}),n.every(a=>a.length>0)?{line:o,ends:s}:void 0}var Do=H(),je=()=>!1;function Fo(t,e){let n=0,o=!1,s=0;return t.forEach((r,a)=>{let c=t[a-1],i=c?xt(c,r,e):void 0;n+=i&&!o?1:0,o=!!i,s+=i&&c?(i[1]-i[0])*Math.hypot(r.x-c.x,r.y-c.y):0}),n===1&&s<=Math.hypot(e.x1-e.x0,e.y1-e.y0)}function Hr({loops:t,edges:e,nodePositions:n,folded:o,pxPerBp:s,ink:r,axis:a,translateX:c,translateY:i,width:f,height:l}){let{scaleX:d,scaleY:p}=a,u=Do(n,[t],()=>t.flatMap(M=>{let S=Wo(M.nodes,n);return S?[{loop:M,...S}]:[]})),m=({x:M,y:S})=>({x:M*d+c,y:S*p+i}),h={width:f,height:l},v=new Map,y=[];for(let{loop:M,line:S,ends:N}of u){let g=Yo(M.least,M.bp),x=Gt(g);if(M.bp*s>=q&&G(S,d,p)>=x*2/Xo&&!M.nodes.every(b=>o?.has(b))){let b=N.at(-1)??0,k=M.nodes[N.findIndex(E=>E>=b/2)]??M.nodes[0],I=`${M.nodes[0]}>${M.nodes.at(-1)}`,_=v.get(I)??0;v.set(I,_+1);let T={key:`loop:${I}${_?`#${_}`:""}`,node:k,text:g},{drawn:X}=M,O=({node:E,edge:C})=>E!==void 0?X.has(E):C!==void 0&&(X.has(e[C]?.from??"")||X.has(e[C]?.to??"")),w=S.map(m),L=r.widest(M.nodes),A=Ze.map(E=>m(it(S,E))).filter(E=>Ke(E,h)),B=A.map(({x:E,y:C})=>({label:{...T,x:E,y:C},box:Mt(x,E,C)})).filter(({box:E})=>D(E,h)&&nn(w,E)&&Fo(w,Ie(E,L))),[P]=A;P&&y.push({id:T.key,kept:!1,middle:P,along:B,own:O,stacked:()=>Je(T,x,P,tn(l)).filter(({box:E})=>D(E,h))})}}return y}function $r(t,e){return Math.max(Oo,Math.floor(t*e/No))}var zo=(t,e)=>Math.hypot(Math.max(0,t.x0-e.x1,e.x0-t.x1),Math.max(0,t.y0-e.y1,e.y0-t.y1));function Yr(t,e,{budget:n=1/0,placed:o=[],leaders:s=1/0,under:r=je}={}){let a=[],c=o.slice(),i=d=>c.some(({middle:p})=>Qe(p,d)),f=({label:d,box:p})=>c.every(u=>u.label.text!==d.text||zo(p,Mt(Gt(d.text),u.label.x,u.label.y))>=ot),l=0;for(let d of t)if((d.kept||c.length<n)&&!i(d.middle)){let p=m=>d.own(m)||m.exon!==void 0&&d.own({node:m.exon}),u=d.along.find(m=>f(m)&&!r(m.box,d.own)&&e(m.box))??(l<s?d.stacked?.().find(m=>{let h=Ho(m.label,d.middle);return f(m)&&!r(m.box,je)&&!r(h,p)&&e(m.box,h)}):void 0);if(u){let m={label:u.label,middle:d.middle};a.push(m),c.push(m),l+=u.label.leader?1:0}}return a}function Wr(t,e,n){let o=new Set(e.map(c=>c.node)),s=0,r=1/0,a=0;for(let{id:c,kept:i}of t)if(i&&!o.has(c)){let f=n.get(c);s++,r=Math.min(r,f),a=Math.max(a,f)}return s>0?{count:s,smallest:r,largest:a}:void 0}function Vr(t){let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+((e<<5)-e);return Math.abs(e%360)}function qo(t,e){return t*360/e}var Go=.7,Vo=.5,jo=16;function jr(t){return t>0&&t<=jo}function Ko(t,e){return`hsl(${qo(t,e)}, ${Go*100}%, ${Vo*100}%)`}function Kr(t,e){return`hsl(0, 0%, ${e>1?25+45*t/(e-1):45}%)`}function Uo(t){let e=J(t).name.split("#"),n=e.join("#");if(e.length>=3&&Qt(e[0])){let o=e.slice(2).join("#");return[o,o,n]}return[e[0],e.slice(0,2).join("#"),n]}function Zo(t,e){let{start:n}=J(t);return e.map(o=>`${o} @${Ue(n)}`)}function Ur(t,e){let n=new Map;t.forEach((l,d)=>{n.has(l.name)||n.set(l.name,d)});let o=[...n].map(([l,d])=>({name:l,i:d})),s=o.map(l=>Uo(l.name)),r=l=>o.map((d,p)=>s[p][l]),a=l=>o.map((d,p)=>Zo(d.name,s[p])[l]),c=[r(0),r(1),a(0),r(2),a(1),a(2)],f=c.find(l=>new Set(l).size===o.length)??c.at(-1);return o.map(({name:l,i:d},p)=>({name:l,label:f[p],color:e?.[d]??Ko(d,t.length)}))}function Zr(t){let e=new Map;return new Map([...t].sort((n,o)=>Q(n.label,o.label)).map(n=>{let o=(e.get(n.label)??0)+1;return e.set(n.label,o),[n.name,o>1?`${n.label} (${o})`:n.label]}))}var Qr=[{value:"uniform",label:"Uniform",description:"Every link the same thickness."},{value:"walks",label:"By walks",description:"Thicker the more walks take a link, on the square root of its count against the busiest link in the cut. A graph without walks draws uniform."}],on=.5,Jo=4;function ta(t){let e=0;for(let n of t.edges)e=Math.max(e,n.pathIds?.length??0);return e}function ea(t,e,n){return n==="uniform"||e===0?1:on+(Jo-on)*Math.sqrt(t/e)}var Qo=4;function ts(t){let e=new Map;for(let n of t.edges)$(e,n.from,n.to),$(e,n.to,n.from);return e}function es({nodeId:t,nodeById:e,neighbors:n}){let o=new Set([t]),s=[t],r=1/0,a=-1/0;for(let c=0;c<Qo&&s.length>0;c++){let i=[];for(let f of s){let l=n.get(f);if(l){for(let d of l)if(!o.has(d)){o.add(d);let p=e.get(d);p&&R(p)?(r=Math.min(r,p.stable.start+p.length),a=Math.max(a,p.stable.start)):i.push(d)}}}s=i}return r===1/0?void 0:{start:Math.min(r,a),end:Math.max(r,a)}}function ns({nodeId:t,nodeById:e,neighbors:n}){let o=e.get(t);return o===void 0?void 0:R(o)?{start:o.stable.start,end:o.stable.start+o.length}:es({nodeId:t,nodeById:e,neighbors:n})}function ra(t,e=ts(t)){let n=new Map(t.nodes.map(s=>[s.id,s])),o=new Map;for(let s of t.nodes){let r=ns({nodeId:s.id,nodeById:n,neighbors:e});r&&o.set(s.id,(r.start+r.end)/2)}return o}export{ts as a,ns as b,ra as c,qs as d,Gs as e,Rn as f,er as g,nr as h,Ee as i,or as j,hs as k,ps as l,ms as m,xs as n,ss as o,re as p,_t as q,rs as r,as as s,Et as t,dn as u,un as v,hn as w,cs as x,pe as y,H as z,q as A,Xs as B,Ts as C,Bs as D,Rs as E,Hs as F,ve as G,Xn as H,mt as I,yt as J,Ie as K,Tn as L,Ys as M,to as N,no as O,Oe as P,Xe as Q,Dt as R,vr as S,xt as T,Ao as U,wr as V,br as W,Eo as X,Cr as Y,Xr as Z,Ue as _,zt as $,Tr as aa,Br as ba,Rr as ca,Yo as da,Hr as ea,$r as fa,Yr as ga,Wr as ha,Vr as ia,qo as ja,Go as ka,Vo as la,jo as ma,jr as na,Ko as oa,Kr as pa,Ur as qa,Zr as ra,Qr as sa,ta,ea as ua};
|
|
2
|
-
//# sourceMappingURL=chunk-BLE63OIT.js.map
|