jbrowse-plugin-graphgenomeviewer 10.4.2 → 10.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/chunks/{AddTrackWorkflow-P5APNL32.js → AddTrackWorkflow-X3FDV4YC.js} +2 -2
  2. package/dist/chunks/{GbzBaseSyntenyAdapter-46A4LMVD.js → GbzBaseSyntenyAdapter-KBJM7TL2.js} +2 -2
  3. package/dist/chunks/{GbzBaseSyntenyAdapter-46A4LMVD.js.map → GbzBaseSyntenyAdapter-KBJM7TL2.js.map} +1 -1
  4. package/dist/chunks/{GraphGenomeView-MXRAP7QB.js → GraphGenomeView-4IRT4GUJ.js} +2 -2
  5. package/dist/chunks/GraphSettingsDialog-MRKEIR65.js +2 -0
  6. package/dist/chunks/{HighlightColorDialog-UKFUS5S4.js → HighlightColorDialog-PRM7R6C5.js} +2 -2
  7. package/dist/chunks/LinearGraphDisplay-BHLFORWW.js +2 -0
  8. package/dist/chunks/{MinigraphBubbleAdapter-QSPPG4LG.js → MinigraphBubbleAdapter-XVYXCC76.js} +2 -2
  9. package/dist/chunks/{RgfaTabixAdapter-UPCOXYVG.js → RgfaTabixAdapter-DTLYU5IT.js} +2 -2
  10. package/dist/chunks/{WalkFormsAdapter-LHKGRYC6.js → WalkFormsAdapter-PT6SRY4G.js} +2 -2
  11. package/dist/chunks/{WalkTabixSyntenyAdapter-ELTYD73I.js → WalkTabixSyntenyAdapter-CGRHEJV4.js} +2 -2
  12. package/dist/chunks/{chunk-YIGESHTA.js → chunk-2LE4HMDX.js} +2 -2
  13. package/dist/chunks/{chunk-YIGESHTA.js.map → chunk-2LE4HMDX.js.map} +1 -1
  14. package/dist/chunks/{chunk-L7ZSEA4T.js → chunk-3PVSP3VV.js} +2 -2
  15. package/dist/chunks/{chunk-L7ZSEA4T.js.map → chunk-3PVSP3VV.js.map} +1 -1
  16. package/dist/chunks/{chunk-N2TMTGYP.js → chunk-3SHFFRNZ.js} +2 -2
  17. package/dist/chunks/{chunk-WBDZVWK4.js → chunk-5FHTS7YG.js} +2 -2
  18. package/dist/chunks/{chunk-WBDZVWK4.js.map → chunk-5FHTS7YG.js.map} +1 -1
  19. package/dist/chunks/{chunk-5N4B6FEH.js → chunk-7OHJQC5U.js} +2 -2
  20. package/dist/chunks/{chunk-TM22QR6V.js → chunk-D7OYDVIT.js} +2 -2
  21. package/dist/chunks/{chunk-TM22QR6V.js.map → chunk-D7OYDVIT.js.map} +1 -1
  22. package/dist/chunks/{chunk-RDTLCMD2.js → chunk-DAIBR3K3.js} +1 -1
  23. package/dist/chunks/{chunk-RDTLCMD2.js.map → chunk-DAIBR3K3.js.map} +1 -1
  24. package/dist/chunks/{chunk-2TMZO3P5.js → chunk-DFFDIHCP.js} +2 -2
  25. package/dist/chunks/{chunk-VY7G4FSX.js → chunk-F3NT4VYA.js} +2 -2
  26. package/dist/chunks/{chunk-VY7G4FSX.js.map → chunk-F3NT4VYA.js.map} +2 -2
  27. package/dist/chunks/chunk-FQ5DWNNX.js +5 -0
  28. package/dist/chunks/chunk-FQ5DWNNX.js.map +7 -0
  29. package/dist/chunks/{chunk-52BUFQHJ.js → chunk-HY5KSOGM.js} +6 -6
  30. package/dist/chunks/{chunk-52BUFQHJ.js.map → chunk-HY5KSOGM.js.map} +2 -2
  31. package/dist/chunks/{chunk-SMZZWPRX.js → chunk-NK76Y6IN.js} +2 -2
  32. package/dist/chunks/{chunk-SMZZWPRX.js.map → chunk-NK76Y6IN.js.map} +3 -3
  33. package/dist/chunks/{chunk-E3GNTGWW.js → chunk-OA3GUDDC.js} +1 -1
  34. package/dist/chunks/{chunk-E3GNTGWW.js.map → chunk-OA3GUDDC.js.map} +1 -1
  35. package/dist/chunks/{chunk-YLB6GKFG.js → chunk-QY7CN2N2.js} +2 -2
  36. package/dist/chunks/{chunk-YLB6GKFG.js.map → chunk-QY7CN2N2.js.map} +1 -1
  37. package/dist/chunks/{chunk-4QYWBDUL.js → chunk-RCTMI22R.js} +2 -2
  38. package/dist/chunks/{chunk-4QYWBDUL.js.map → chunk-RCTMI22R.js.map} +1 -1
  39. package/dist/chunks/{chunk-QOMV5OG7.js → chunk-RTLOZXOH.js} +2 -2
  40. package/dist/chunks/{chunk-DZXYOIGJ.js → chunk-SOOC7T5G.js} +2 -2
  41. package/dist/chunks/{chunk-43EUXRKZ.js → chunk-UBN7IANP.js} +2 -2
  42. package/dist/chunks/{chunk-43EUXRKZ.js.map → chunk-UBN7IANP.js.map} +1 -1
  43. package/dist/chunks/{chunk-AC5KEN36.js → chunk-UFFIQB3D.js} +2 -2
  44. package/dist/chunks/{chunk-AC5KEN36.js.map → chunk-UFFIQB3D.js.map} +1 -1
  45. package/dist/chunks/{chunk-E5ERNAYL.js → chunk-USYII6RS.js} +1 -1
  46. package/dist/chunks/{chunk-E5ERNAYL.js.map → chunk-USYII6RS.js.map} +1 -1
  47. package/dist/chunks/chunk-XO54F7NK.js +2 -0
  48. package/dist/chunks/chunk-XO54F7NK.js.map +7 -0
  49. package/dist/chunks/{chunk-RUKWE5MB.js → chunk-XZ4HLR4N.js} +2 -2
  50. package/dist/chunks/{renderSvg-4AG3PPI5.js → renderSvg-ZXYKGJ7N.js} +2 -2
  51. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +1 -1
  52. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +1 -1
  53. package/package.json +2 -2
  54. package/src/version.ts +1 -1
  55. package/dist/chunks/GraphSettingsDialog-HIOYWTO7.js +0 -2
  56. package/dist/chunks/LinearGraphDisplay-KPWFPVFK.js +0 -2
  57. package/dist/chunks/chunk-BLE63OIT.js +0 -2
  58. package/dist/chunks/chunk-BLE63OIT.js.map +0 -7
  59. package/dist/chunks/chunk-M5XKM6D2.js +0 -5
  60. package/dist/chunks/chunk-M5XKM6D2.js.map +0 -7
  61. /package/dist/chunks/{AddTrackWorkflow-P5APNL32.js.map → AddTrackWorkflow-X3FDV4YC.js.map} +0 -0
  62. /package/dist/chunks/{GraphGenomeView-MXRAP7QB.js.map → GraphGenomeView-4IRT4GUJ.js.map} +0 -0
  63. /package/dist/chunks/{GraphSettingsDialog-HIOYWTO7.js.map → GraphSettingsDialog-MRKEIR65.js.map} +0 -0
  64. /package/dist/chunks/{HighlightColorDialog-UKFUS5S4.js.map → HighlightColorDialog-PRM7R6C5.js.map} +0 -0
  65. /package/dist/chunks/{LinearGraphDisplay-KPWFPVFK.js.map → LinearGraphDisplay-BHLFORWW.js.map} +0 -0
  66. /package/dist/chunks/{MinigraphBubbleAdapter-QSPPG4LG.js.map → MinigraphBubbleAdapter-XVYXCC76.js.map} +0 -0
  67. /package/dist/chunks/{RgfaTabixAdapter-UPCOXYVG.js.map → RgfaTabixAdapter-DTLYU5IT.js.map} +0 -0
  68. /package/dist/chunks/{WalkFormsAdapter-LHKGRYC6.js.map → WalkFormsAdapter-PT6SRY4G.js.map} +0 -0
  69. /package/dist/chunks/{WalkTabixSyntenyAdapter-ELTYD73I.js.map → WalkTabixSyntenyAdapter-CGRHEJV4.js.map} +0 -0
  70. /package/dist/chunks/{chunk-N2TMTGYP.js.map → chunk-3SHFFRNZ.js.map} +0 -0
  71. /package/dist/chunks/{chunk-5N4B6FEH.js.map → chunk-7OHJQC5U.js.map} +0 -0
  72. /package/dist/chunks/{chunk-2TMZO3P5.js.map → chunk-DFFDIHCP.js.map} +0 -0
  73. /package/dist/chunks/{chunk-QOMV5OG7.js.map → chunk-RTLOZXOH.js.map} +0 -0
  74. /package/dist/chunks/{chunk-DZXYOIGJ.js.map → chunk-SOOC7T5G.js.map} +0 -0
  75. /package/dist/chunks/{chunk-RUKWE5MB.js.map → chunk-XZ4HLR4N.js.map} +0 -0
  76. /package/dist/chunks/{renderSvg-4AG3PPI5.js.map → renderSvg-ZXYKGJ7N.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import{a as mt}from"./chunk-JM4W4PKP.js";import{a as ut}from"./chunk-RUKWE5MB.js";import{a as pt,c as lt}from"./chunk-5L276I7O.js";function dt(e){let t=[],r=0,o;for(let i=0,n=e.length;i<n;i++){let s=e.charCodeAt(i);if(s>=48&&s<=57)r=r*10+s-48;else if(s===58)o=r,r=0;else{let a=e[i];a==="M"||a==="="||a==="X"?t.push({own:o===void 0?r:o,mate:r,op:"M"}):a==="I"?t.push({own:0,mate:r,op:a}):(a==="D"||a==="N")&&t.push({own:r,mate:0,op:a}),o=void 0,r=0}}return t}function Pe(e){let t="";for(let{own:r,mate:o,op:i}of dt(e))t+=i==="M"?r===0?`${o}I`:o===0?`${r}D`:`${r}M`:`${i==="I"?o:r}${i}`;return t}var Ne=2**28-1;function Fe(e,t,r){for(let o=t;o>0;o-=Ne)e.push((Math.min(o,Ne)<<4|r)>>>0)}function mr(e,t,r){if(t===r)Fe(e,t,0);else{let o=Math.ceil(Math.max(t,r)/Ne);for(let i=0;i<o;i++){let n=Math.floor(t*(i+1)/o)-Math.floor(t*i/o),s=Math.floor(r*(i+1)/o)-Math.floor(r*i/o);e.push((n<<4|9)>>>0,(s<<4|9)>>>0)}}}function ke(e){let t=[];for(let{own:r,mate:o,op:i}of dt(e))i==="M"?mr(t,r,o):i==="I"?Fe(t,o,1):Fe(t,r,i==="N"?3:2);return Uint32Array.from(t)}function dr(e){return e>=48&&e<=57}function hr(e){return e!==void 0&&/[A-Za-z]/.test(e)}function ht(e,t){let r=t;for(;r<e.length&&hr(e[r]);)r++;return r}function xt(e,t){let r=t,o=0;for(;r<e.length&&dr(e.charCodeAt(r));)o=o*10+(e.charCodeAt(r)-48),r++;return{value:o,next:r}}function vt(e,t){let r=0;for(;r<e.length;){let o=e[r];if(o===":"){let{value:i,next:n}=xt(e,r+1);t(":",i,i,r+1,n),r=n}else if(o==="="){let i=ht(e,r+1),n=i-r-1;t("=",n,n,r+1,i),r=i}else if(o==="*")t("*",1,1,r+1,Math.min(r+3,e.length)),r+=3;else if(o==="+"||o==="-"){let i=ht(e,r+1),n=i-r-1;t(o,o==="-"?n:0,o==="+"?n:0,r+1,i),r=i}else if(o==="~"){let{value:i,next:n}=xt(e,r+3),s=Math.min(n+2,e.length);t("~",i,0,r+1,s),r=s}else r++}}function De(e,t,r,o){let i=r??Number.NEGATIVE_INFINITY,n=o??Number.POSITIVE_INFINITY,s=0;vt(e,(a,c,f,p,l)=>{if(a==="*")s>=i&&s<n&&t(88,s,1,e[p+1]??"",-1,0,0);else if(a==="+"){if(s>=i&&s<=n){let m=e.slice(p,l);t(73,s,f,m,-1,0,f)}}else(a==="-"||a==="~")&&s<n&&s+c>i&&t(a==="-"?68:78,s,c,"",-1,0,0);s+=c})}function At(e,t,r,o){let i=0,n=0,s=[],a=r&&t;for(let c=0,f=e.length;c<f;c++){let p=e[c],l=p>>>4,m=p&15;if(m===0||m===7){if(a)for(let u=0;u<l;u++)(t.charCodeAt(n+u)|32)!==(r.charCodeAt(i+u)|32)&&s.push({start:i+u,type:"mismatch",base:t[n+u],altbase:r[i+u],length:1});n+=l,i+=l}else if(m===1)s.push({start:i,type:"insertion",insertlen:l,insertedBases:t?.slice(n,n+l),length:0}),n+=l;else if(m===2)s.push({start:i,type:"deletion",length:l}),i+=l;else if(m===3)s.push({start:i,type:"skip",length:l}),i+=l;else if(m===8){for(let u=0;u<l;u++)s.push({start:i+u,type:"mismatch",base:t?.[n+u]||"X",qual:o?.[n+u],length:1});n+=l,i+=l}else m===5?s.push({start:i,type:"hardclip",cliplen:l,length:1}):m===4&&(s.push({start:i,type:"softclip",cliplen:l,length:1}),n+=l)}return s}function It(e,t,r,o,i){if(!t)return[];let n=[],s=t.length,a=o.length,c=i!==void 0,f=r.length,p=!1;for(let b=0;b<f;b++)if(r[b].type==="skip"){p=!0;break}let l=0,m=0,u=0,h=0,x=0,y=0,S=e.length;for(;y<S;){let b=e.charCodeAt(y);if(b>=48&&b<=57){let d=0;for(;y<S;){let g=e.charCodeAt(y);if(g>=48&&g<=57)d=d*10+(g-48),y++;else break}l+=d}else if(b===94)for(y++;y<S&&e.charCodeAt(y)>=65;)y++,l++;else if(b>=65){let d=e[y];if(y++,p&&f>0)for(let M=x;M<f;M++){let _=r[M];_.type==="skip"&&l>=_.start&&(l+=_.length,x=M+1)}let g=u,v=h;for(let M=m;M<s&&v<=l;M++,m=M){let _=t[M],P=_>>>4,E=_&15;E===4||E===1?g+=P:E===2||E===6||E===3?v+=P:E!==5&&(g+=P,v+=P)}u=g,h=v;let I=g-(v-l),C=I<a?o[I]:"X";n.push({start:l,base:C,qual:c?i[I]:void 0,altbase:d,length:1,type:"mismatch"}),l++}else y++}return n}var Ct={77:0,73:1,68:2,78:3,83:4,72:5,80:6,61:7,88:8};function _t(e=""){let t=0,r=[];for(let o=0,i=e.length;o<i;o++){let n=e.charCodeAt(o);if(n>=48&&n<=57)t=t*10+(n-48);else{let s=Ct[n];r.push(t<<4|s),t=0}}return r}function Be(e=""){let t=0;for(let n=0,s=e.length;n<s;n++){let a=e.charCodeAt(n);(a<48||a>57)&&t++}let r=new Uint32Array(t),o=0,i=0;for(let n=0,s=e.length;n<s;n++){let a=e.charCodeAt(n);a>=48&&a<=57?o=o*10+(a-48):(r[i++]=o<<4|Ct[a],o=0)}return r}function se(e,t,r,o,i){let n=_t(e),s=e?At(n,r,o,i):[];return t&&r?s.concat(It(t,n,s,r,i)):s}var j=class extends pt{get(t){return t==="mismatches"?se(this.walkableCigar):t==="clipLengthAtStartOfRead"?this.clipLengthAtStartOfRead:t==="name"?super.get("name")??this.mate?.refName:super.get(t)}get mate(){return super.get("mate")}get walkableCigar(){let t=super.get("CIGAR"),r=super.get("coarseCigar");return typeof t=="string"?t:typeof r=="string"?Pe(r):void 0}get clipLengthAtStartOfRead(){return this.mate?.start??0}forEachMismatch(t,r){let o=this.get("start"),i=r?.start===void 0?void 0:r.start-o,n=r?.end===void 0?void 0:r.end-o,s=this.get("cs");if(s)De(s,t,i,n);else{let a=i??Number.NEGATIVE_INFINITY,c=n??Number.POSITIVE_INFINITY;for(let f of se(this.walkableCigar))(f.type==="deletion"||f.type==="skip"?f.start<c&&f.start+f.length>a:f.start>=a&&f.start<=c)&&(f.type==="mismatch"?t(88,f.start,f.length,f.base,f.qual??-1,0,0):f.type==="insertion"?t(73,f.start,f.length,f.insertedBases??"",-1,0,f.insertlen):f.type==="deletion"?t(68,f.start,f.length,"",-1,0,0):f.type==="skip"&&t(78,f.start,f.length,"",-1,0,0))}}};var je=function(e,t){return je=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},je(e,t)};function J(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");je(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Et(e,t,r,o){function i(n){return n instanceof r?n:new r(function(s){s(n)})}return new(r||(r=Promise))(function(n,s){function a(p){try{f(o.next(p))}catch(l){s(l)}}function c(p){try{f(o.throw(p))}catch(l){s(l)}}function f(p){p.done?n(p.value):i(p.value).then(a,c)}f((o=o.apply(e,t||[])).next())})}function ae(e,t){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,i,n,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(f){return function(p){return c([f,p])}}function c(f){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,f[0]&&(r=0)),r;)try{if(o=1,i&&(n=f[0]&2?i.return:f[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,f[1])).done)return n;switch(i=0,n&&(f=[f[0]&2,n.value]),f[0]){case 0:case 1:n=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(n=r.trys,!(n=n.length>0&&n[n.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!n||f[1]>n[0]&&f[1]<n[3])){r.label=f[1];break}if(f[0]===6&&r.label<n[1]){r.label=n[1],n=f;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(f);break}n[2]&&r.ops.pop(),r.trys.pop();continue}f=t.call(e,r)}catch(p){f=[6,p],i=0}finally{o=n=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function U(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Y(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o=r.call(e),i,n=[],s;try{for(;(t===void 0||t-- >0)&&!(i=o.next()).done;)n.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return n}function z(e,t,r){if(r||arguments.length===2)for(var o=0,i=t.length,n;o<i;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function W(e){return this instanceof W?(this.v=e,this):new W(e)}function wt(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=r.apply(e,t||[]),i,n=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(u){return function(h){return Promise.resolve(h).then(u,l)}}function a(u,h){o[u]&&(i[u]=function(x){return new Promise(function(y,S){n.push([u,x,y,S])>1||c(u,x)})},h&&(i[u]=h(i[u])))}function c(u,h){try{f(o[u](h))}catch(x){m(n[0][3],x)}}function f(u){u.value instanceof W?Promise.resolve(u.value.v).then(p,l):m(n[0][2],u)}function p(u){c("next",u)}function l(u){c("throw",u)}function m(u,h){u(h),n.shift(),n.length&&c(n[0][0],n[0][1])}}function Mt(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof U=="function"?U(e):e[Symbol.iterator](),r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r);function o(n){r[n]=e[n]&&function(s){return new Promise(function(a,c){s=e[n](s),i(a,c,s.done,s.value)})}}function i(n,s,a,c){Promise.resolve(c).then(function(f){n({value:f,done:a})},s)}}function A(e){return typeof e=="function"}function Tt(e){var t=function(o){Error.call(o),o.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var fe=Tt(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
1
+ import{a as mt}from"./chunk-JM4W4PKP.js";import{a as ut}from"./chunk-XZ4HLR4N.js";import{a as pt,c as lt}from"./chunk-5L276I7O.js";function dt(e){let t=[],r=0,o;for(let i=0,n=e.length;i<n;i++){let s=e.charCodeAt(i);if(s>=48&&s<=57)r=r*10+s-48;else if(s===58)o=r,r=0;else{let a=e[i];a==="M"||a==="="||a==="X"?t.push({own:o===void 0?r:o,mate:r,op:"M"}):a==="I"?t.push({own:0,mate:r,op:a}):(a==="D"||a==="N")&&t.push({own:r,mate:0,op:a}),o=void 0,r=0}}return t}function Pe(e){let t="";for(let{own:r,mate:o,op:i}of dt(e))t+=i==="M"?r===0?`${o}I`:o===0?`${r}D`:`${r}M`:`${i==="I"?o:r}${i}`;return t}var Ne=2**28-1;function Fe(e,t,r){for(let o=t;o>0;o-=Ne)e.push((Math.min(o,Ne)<<4|r)>>>0)}function mr(e,t,r){if(t===r)Fe(e,t,0);else{let o=Math.ceil(Math.max(t,r)/Ne);for(let i=0;i<o;i++){let n=Math.floor(t*(i+1)/o)-Math.floor(t*i/o),s=Math.floor(r*(i+1)/o)-Math.floor(r*i/o);e.push((n<<4|9)>>>0,(s<<4|9)>>>0)}}}function ke(e){let t=[];for(let{own:r,mate:o,op:i}of dt(e))i==="M"?mr(t,r,o):i==="I"?Fe(t,o,1):Fe(t,r,i==="N"?3:2);return Uint32Array.from(t)}function dr(e){return e>=48&&e<=57}function hr(e){return e!==void 0&&/[A-Za-z]/.test(e)}function ht(e,t){let r=t;for(;r<e.length&&hr(e[r]);)r++;return r}function xt(e,t){let r=t,o=0;for(;r<e.length&&dr(e.charCodeAt(r));)o=o*10+(e.charCodeAt(r)-48),r++;return{value:o,next:r}}function vt(e,t){let r=0;for(;r<e.length;){let o=e[r];if(o===":"){let{value:i,next:n}=xt(e,r+1);t(":",i,i,r+1,n),r=n}else if(o==="="){let i=ht(e,r+1),n=i-r-1;t("=",n,n,r+1,i),r=i}else if(o==="*")t("*",1,1,r+1,Math.min(r+3,e.length)),r+=3;else if(o==="+"||o==="-"){let i=ht(e,r+1),n=i-r-1;t(o,o==="-"?n:0,o==="+"?n:0,r+1,i),r=i}else if(o==="~"){let{value:i,next:n}=xt(e,r+3),s=Math.min(n+2,e.length);t("~",i,0,r+1,s),r=s}else r++}}function De(e,t,r,o){let i=r??Number.NEGATIVE_INFINITY,n=o??Number.POSITIVE_INFINITY,s=0;vt(e,(a,c,f,p,l)=>{if(a==="*")s>=i&&s<n&&t(88,s,1,e[p+1]??"",-1,0,0);else if(a==="+"){if(s>=i&&s<=n){let m=e.slice(p,l);t(73,s,f,m,-1,0,f)}}else(a==="-"||a==="~")&&s<n&&s+c>i&&t(a==="-"?68:78,s,c,"",-1,0,0);s+=c})}function At(e,t,r,o){let i=0,n=0,s=[],a=r&&t;for(let c=0,f=e.length;c<f;c++){let p=e[c],l=p>>>4,m=p&15;if(m===0||m===7){if(a)for(let u=0;u<l;u++)(t.charCodeAt(n+u)|32)!==(r.charCodeAt(i+u)|32)&&s.push({start:i+u,type:"mismatch",base:t[n+u],altbase:r[i+u],length:1});n+=l,i+=l}else if(m===1)s.push({start:i,type:"insertion",insertlen:l,insertedBases:t?.slice(n,n+l),length:0}),n+=l;else if(m===2)s.push({start:i,type:"deletion",length:l}),i+=l;else if(m===3)s.push({start:i,type:"skip",length:l}),i+=l;else if(m===8){for(let u=0;u<l;u++)s.push({start:i+u,type:"mismatch",base:t?.[n+u]||"X",qual:o?.[n+u],length:1});n+=l,i+=l}else m===5?s.push({start:i,type:"hardclip",cliplen:l,length:1}):m===4&&(s.push({start:i,type:"softclip",cliplen:l,length:1}),n+=l)}return s}function It(e,t,r,o,i){if(!t)return[];let n=[],s=t.length,a=o.length,c=i!==void 0,f=r.length,p=!1;for(let b=0;b<f;b++)if(r[b].type==="skip"){p=!0;break}let l=0,m=0,u=0,h=0,x=0,y=0,S=e.length;for(;y<S;){let b=e.charCodeAt(y);if(b>=48&&b<=57){let d=0;for(;y<S;){let g=e.charCodeAt(y);if(g>=48&&g<=57)d=d*10+(g-48),y++;else break}l+=d}else if(b===94)for(y++;y<S&&e.charCodeAt(y)>=65;)y++,l++;else if(b>=65){let d=e[y];if(y++,p&&f>0)for(let M=x;M<f;M++){let _=r[M];_.type==="skip"&&l>=_.start&&(l+=_.length,x=M+1)}let g=u,v=h;for(let M=m;M<s&&v<=l;M++,m=M){let _=t[M],P=_>>>4,E=_&15;E===4||E===1?g+=P:E===2||E===6||E===3?v+=P:E!==5&&(g+=P,v+=P)}u=g,h=v;let I=g-(v-l),C=I<a?o[I]:"X";n.push({start:l,base:C,qual:c?i[I]:void 0,altbase:d,length:1,type:"mismatch"}),l++}else y++}return n}var Ct={77:0,73:1,68:2,78:3,83:4,72:5,80:6,61:7,88:8};function _t(e=""){let t=0,r=[];for(let o=0,i=e.length;o<i;o++){let n=e.charCodeAt(o);if(n>=48&&n<=57)t=t*10+(n-48);else{let s=Ct[n];r.push(t<<4|s),t=0}}return r}function Be(e=""){let t=0;for(let n=0,s=e.length;n<s;n++){let a=e.charCodeAt(n);(a<48||a>57)&&t++}let r=new Uint32Array(t),o=0,i=0;for(let n=0,s=e.length;n<s;n++){let a=e.charCodeAt(n);a>=48&&a<=57?o=o*10+(a-48):(r[i++]=o<<4|Ct[a],o=0)}return r}function se(e,t,r,o,i){let n=_t(e),s=e?At(n,r,o,i):[];return t&&r?s.concat(It(t,n,s,r,i)):s}var j=class extends pt{get(t){return t==="mismatches"?se(this.walkableCigar):t==="clipLengthAtStartOfRead"?this.clipLengthAtStartOfRead:t==="name"?super.get("name")??this.mate?.refName:super.get(t)}get mate(){return super.get("mate")}get walkableCigar(){let t=super.get("CIGAR"),r=super.get("coarseCigar");return typeof t=="string"?t:typeof r=="string"?Pe(r):void 0}get clipLengthAtStartOfRead(){return this.mate?.start??0}forEachMismatch(t,r){let o=this.get("start"),i=r?.start===void 0?void 0:r.start-o,n=r?.end===void 0?void 0:r.end-o,s=this.get("cs");if(s)De(s,t,i,n);else{let a=i??Number.NEGATIVE_INFINITY,c=n??Number.POSITIVE_INFINITY;for(let f of se(this.walkableCigar))(f.type==="deletion"||f.type==="skip"?f.start<c&&f.start+f.length>a:f.start>=a&&f.start<=c)&&(f.type==="mismatch"?t(88,f.start,f.length,f.base,f.qual??-1,0,0):f.type==="insertion"?t(73,f.start,f.length,f.insertedBases??"",-1,0,f.insertlen):f.type==="deletion"?t(68,f.start,f.length,"",-1,0,0):f.type==="skip"&&t(78,f.start,f.length,"",-1,0,0))}}};var je=function(e,t){return je=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},je(e,t)};function J(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");je(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Et(e,t,r,o){function i(n){return n instanceof r?n:new r(function(s){s(n)})}return new(r||(r=Promise))(function(n,s){function a(p){try{f(o.next(p))}catch(l){s(l)}}function c(p){try{f(o.throw(p))}catch(l){s(l)}}function f(p){p.done?n(p.value):i(p.value).then(a,c)}f((o=o.apply(e,t||[])).next())})}function ae(e,t){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,i,n,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(f){return function(p){return c([f,p])}}function c(f){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,f[0]&&(r=0)),r;)try{if(o=1,i&&(n=f[0]&2?i.return:f[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,f[1])).done)return n;switch(i=0,n&&(f=[f[0]&2,n.value]),f[0]){case 0:case 1:n=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(n=r.trys,!(n=n.length>0&&n[n.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!n||f[1]>n[0]&&f[1]<n[3])){r.label=f[1];break}if(f[0]===6&&r.label<n[1]){r.label=n[1],n=f;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(f);break}n[2]&&r.ops.pop(),r.trys.pop();continue}f=t.call(e,r)}catch(p){f=[6,p],i=0}finally{o=n=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function U(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Y(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o=r.call(e),i,n=[],s;try{for(;(t===void 0||t-- >0)&&!(i=o.next()).done;)n.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return n}function z(e,t,r){if(r||arguments.length===2)for(var o=0,i=t.length,n;o<i;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function W(e){return this instanceof W?(this.v=e,this):new W(e)}function wt(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=r.apply(e,t||[]),i,n=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(u){return function(h){return Promise.resolve(h).then(u,l)}}function a(u,h){o[u]&&(i[u]=function(x){return new Promise(function(y,S){n.push([u,x,y,S])>1||c(u,x)})},h&&(i[u]=h(i[u])))}function c(u,h){try{f(o[u](h))}catch(x){m(n[0][3],x)}}function f(u){u.value instanceof W?Promise.resolve(u.value.v).then(p,l):m(n[0][2],u)}function p(u){c("next",u)}function l(u){c("throw",u)}function m(u,h){u(h),n.shift(),n.length&&c(n[0][0],n[0][1])}}function Mt(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof U=="function"?U(e):e[Symbol.iterator](),r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r);function o(n){r[n]=e[n]&&function(s){return new Promise(function(a,c){s=e[n](s),i(a,c,s.done,s.value)})}}function i(n,s,a,c){Promise.resolve(c).then(function(f){n({value:f,done:a})},s)}}function A(e){return typeof e=="function"}function Tt(e){var t=function(o){Error.call(o),o.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var fe=Tt(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
2
2
  `+r.map(function(o,i){return i+1+") "+o.toString()}).join(`
3
3
  `):"",this.name="UnsubscriptionError",this.errors=r}});function Ue(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var ce=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,o,i,n;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=U(s),c=a.next();!c.done;c=a.next()){var f=c.value;f.remove(this)}}catch(x){t={error:x}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}else s.remove(this);var p=this.initialTeardown;if(A(p))try{p()}catch(x){n=x instanceof fe?x.errors:[x]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var m=U(l),u=m.next();!u.done;u=m.next()){var h=u.value;try{Ot(h)}catch(x){n=n??[],x instanceof fe?n=z(z([],Y(n)),Y(x.errors)):n.push(x)}}}catch(x){o={error:x}}finally{try{u&&!u.done&&(i=m.return)&&i.call(m)}finally{if(o)throw o.error}}}if(n)throw new fe(n)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Ot(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Ue(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Ue(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})();var zo=ce.EMPTY;function pe(e){return e instanceof ce||e&&"closed"in e&&A(e.remove)&&A(e.add)&&A(e.unsubscribe)}function Ot(e){A(e)?e():e.unsubscribe()}var N={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var V={setTimeout:function(e,t){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=V.delegate;return i?.setTimeout?i.setTimeout.apply(i,z([e,t],Y(r))):setTimeout.apply(void 0,z([e,t],Y(r)))},clearTimeout:function(e){var t=V.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function le(e){V.setTimeout(function(){var t=N.onUnhandledError;if(t)t(e);else throw e})}function We(){}var Rt=(function(){return $e("C",void 0,void 0)})();function Lt(e){return $e("E",void 0,e)}function Nt(e){return $e("N",e,void 0)}function $e(e,t,r){return{kind:e,value:t,error:r}}var $=null;function Ft(e){if(N.useDeprecatedSynchronousErrorHandling){var t=!$;if(t&&($={errorThrown:!1,error:null}),e(),t){var r=$,o=r.errorThrown,i=r.error;if($=null,o)throw i}}else e()}function Pt(e){N.useDeprecatedSynchronousErrorHandling&&$&&($.errorThrown=!0,$.error=e)}var ee=(function(e){J(t,e);function t(r){var o=e.call(this)||this;return o.isStopped=!1,r?(o.destination=r,pe(r)&&r.add(o)):o.destination=vr,o}return t.create=function(r,o,i){return new me(r,o,i)},t.prototype.next=function(r){this.isStopped?Ye(Nt(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?Ye(Lt(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?Ye(Rt,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(ce);var gr=Function.prototype.bind;function He(e,t){return gr.call(e,t)}var Sr=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(o){ue(o)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(o){ue(o)}else ue(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){ue(r)}},e})(),me=(function(e){J(t,e);function t(r,o,i){var n=e.call(this)||this,s;if(A(r)||!r)s={next:r??void 0,error:o??void 0,complete:i??void 0};else{var a;n&&N.useDeprecatedNextContext?(a=Object.create(r),a.unsubscribe=function(){return n.unsubscribe()},s={next:r.next&&He(r.next,a),error:r.error&&He(r.error,a),complete:r.complete&&He(r.complete,a)}):s=r}return n.destination=new Sr(s),n}return t})(ee);function ue(e){N.useDeprecatedSynchronousErrorHandling?Pt(e):le(e)}function br(e){throw e}function Ye(e,t){var r=N.onStoppedNotification;r&&V.setTimeout(function(){return r(e,t)})}var vr={closed:!0,next:We,error:br,complete:We};var K=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function kt(e){return e}function Dt(e){return e.length===0?kt:e.length===1?e[0]:function(r){return e.reduce(function(o,i){return i(o)},r)}}var T=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,o){var i=this,n=Ir(t)?t:new me(t,r,o);return Ft(function(){var s=i,a=s.operator,c=s.source;n.add(a?a.call(n,c):c?i._subscribe(n):i._trySubscribe(n))}),n},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var o=this;return r=qt(r),new r(function(i,n){var s=new me({next:function(a){try{t(a)}catch(c){n(c),s.unsubscribe()}},error:n,complete:i});o.subscribe(s)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[K]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Dt(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=qt(t),new t(function(o,i){var n;r.subscribe(function(s){return n=s},function(s){return i(s)},function(){return o(n)})})},e.create=function(t){return new e(t)},e})();function qt(e){var t;return(t=e??N.Promise)!==null&&t!==void 0?t:Promise}function Ar(e){return e&&A(e.next)&&A(e.error)&&A(e.complete)}function Ir(e){return e&&e instanceof ee||Ar(e)&&pe(e)}function Cr(e){return A(e?.lift)}function R(e){return function(t){if(Cr(t))return t.lift(function(r){try{return e(r,this)}catch(o){this.error(o)}});throw new TypeError("Unable to lift unknown Observable type")}}function D(e,t,r,o,i){return new _r(e,t,r,o,i)}var _r=(function(e){J(t,e);function t(r,o,i,n,s,a){var c=e.call(this,r)||this;return c.onFinalize=s,c.shouldUnsubscribe=a,c._next=o?function(f){try{o(f)}catch(p){r.error(p)}}:e.prototype._next,c._error=n?function(f){try{n(f)}catch(p){r.error(p)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=i?function(){try{i()}catch(f){r.error(f)}finally{this.unsubscribe()}}:e.prototype._complete,c}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var o=this.closed;e.prototype.unsubscribe.call(this),!o&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(ee);var de=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function he(e){return A(e?.then)}function xe(e){return A(e[K])}function ye(e){return Symbol.asyncIterator&&A(e?.[Symbol.asyncIterator])}function ge(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Er(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Se=Er();function be(e){return A(e?.[Se])}function ve(e){return wt(this,arguments,function(){var r,o,i,n;return ae(this,function(s){switch(s.label){case 0:r=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,W(r.read())];case 3:return o=s.sent(),i=o.value,n=o.done,n?[4,W(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,W(i)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Ae(e){return A(e?.getReader)}function k(e){if(e instanceof T)return e;if(e!=null){if(xe(e))return wr(e);if(de(e))return Mr(e);if(he(e))return Tr(e);if(ye(e))return Gt(e);if(be(e))return Or(e);if(Ae(e))return Rr(e)}throw ge(e)}function wr(e){return new T(function(t){var r=e[K]();if(A(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Mr(e){return new T(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function Tr(e){return new T(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,le)})}function Or(e){return new T(function(t){var r,o;try{for(var i=U(e),n=i.next();!n.done;n=i.next()){var s=n.value;if(t.next(s),t.closed)return}}catch(a){r={error:a}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}t.complete()})}function Gt(e){return new T(function(t){Lr(e,t).catch(function(r){return t.error(r)})})}function Rr(e){return Gt(ve(e))}function Lr(e,t){var r,o,i,n;return Et(this,void 0,void 0,function(){var s,a;return ae(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=Mt(e),c.label=1;case 1:return[4,r.next()];case 2:if(o=c.sent(),!!o.done)return[3,4];if(s=o.value,t.next(s),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),o&&!o.done&&(n=r.return)?[4,n.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function L(e,t,r,o,i){o===void 0&&(o=0),i===void 0&&(i=!1);var n=t.schedule(function(){r(),i?e.add(this.schedule(null,o)):this.unsubscribe()},o);if(e.add(n),!i)return n}function Ie(e,t){return t===void 0&&(t=0),R(function(r,o){r.subscribe(D(o,function(i){return L(o,e,function(){return o.next(i)},t)},function(){return L(o,e,function(){return o.complete()},t)},function(i){return L(o,e,function(){return o.error(i)},t)}))})}function Ce(e,t){return t===void 0&&(t=0),R(function(r,o){o.add(e.schedule(function(){return r.subscribe(o)},t))})}function Bt(e,t){return k(e).pipe(Ce(t),Ie(t))}function jt(e,t){return k(e).pipe(Ce(t),Ie(t))}function Ut(e,t){return new T(function(r){var o=0;return t.schedule(function(){o===e.length?r.complete():(r.next(e[o++]),r.closed||this.schedule())})})}function Wt(e,t){return new T(function(r){var o;return L(r,t,function(){o=e[Se](),L(r,t,function(){var i,n,s;try{i=o.next(),n=i.value,s=i.done}catch(a){r.error(a);return}s?r.complete():r.next(n)},0,!0)}),function(){return A(o?.return)&&o.return()}})}function _e(e,t){if(!e)throw new Error("Iterable cannot be null");return new T(function(r){L(r,t,function(){var o=e[Symbol.asyncIterator]();L(r,t,function(){o.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}function $t(e,t){return _e(ve(e),t)}function Ht(e,t){if(e!=null){if(xe(e))return Bt(e,t);if(de(e))return Ut(e,t);if(he(e))return jt(e,t);if(ye(e))return _e(e,t);if(be(e))return Wt(e,t);if(Ae(e))return $t(e,t)}throw ge(e)}function ze(e,t){return t?Ht(e,t):k(e)}function te(e,t){return R(function(r,o){var i=0;r.subscribe(D(o,function(n){o.next(e.call(t,n,i++))}))})}function Yt(e,t,r,o,i,n,s,a){var c=[],f=0,p=0,l=!1,m=function(){l&&!c.length&&!f&&t.complete()},u=function(x){return f<o?h(x):c.push(x)},h=function(x){n&&t.next(x),f++;var y=!1;k(r(x,p++)).subscribe(D(t,function(S){i?.(S),n?u(S):t.next(S)},function(){y=!0},void 0,function(){if(y)try{f--;for(var S=function(){var b=c.shift();s?L(t,s,function(){return h(b)}):h(b)};c.length&&f<o;)S();m()}catch(b){t.error(b)}}))};return e.subscribe(D(t,u,function(){l=!0,m()})),function(){a?.()}}function X(e,t,r){return r===void 0&&(r=1/0),A(t)?X(function(o,i){return te(function(n,s){return t(o,n,i,s)})(k(e(o,i)))},r):(typeof t=="number"&&(r=t),R(function(o,i){return Yt(o,i,e,r)}))}function zt(e,t,r,o,i){return function(n,s){var a=r,c=t,f=0;n.subscribe(D(s,function(p){var l=f++;c=a?e(c,p,l):(a=!0,p),o&&s.next(c)},i&&(function(){a&&s.next(c),s.complete()})))}}function Vt(e,t){return R(zt(e,t,arguments.length>=2,!1,!0))}var Nr=function(e,t){return e.push(t),e};function Ee(){return R(function(e,t){Vt(Nr,[])(e).subscribe(t)})}var Fr=397,Pr=387,kr=385;function Kt(e){return(1<<e&Fr)!==0}function Xt(e){return(1<<e&Pr)!==0}function Qt(e){return(1<<e&kr)!==0}function Ve(e,t,r,o,i,n,s){let a=i===-1?-1:1,c=t,f=i===-1?o:r,p=[],l=1/0,m=-1/0,u=1/0,h=-1/0,x=(y,S)=>{u=Math.min(u,y,S),h=Math.max(h,y,S)};for(let y=0;y<e.length;y++){let S=e[y],b=S>>>4,d=S&15,g=d===9,v=g||Kt(d)?b:0,I=g?e[++y]>>>4:Xt(d)?b:0,C=c+v,M=f+I*a,_=c,P=C;if(P>=n&&_<=s)if(v>0){let E=Math.max(_,n),B=Math.min(P,s);if(B>E)if(l=Math.min(l,E),m=Math.max(m,B),g){let st=I/b,at=B-E,ft=Math.round(at*st),ct=Math.round(f+(E-c)*st*a);p.push(at<<4|9,ft<<4|9),x(ct,ct+ft*a)}else p.push(B-E<<4|d),Qt(d)?x(f+(E-c)*a,f+(B-c)*a):x(f,f)}else I>0&&(g?p.push(S,e[y]):p.push(S),l=Math.min(l,c),m=Math.max(m,c),x(f,M));if(c=C,f=M,c>s)break}if(p.length!==0)return{start:l,end:m,mateStart:u,mateEnd:h,cigar:Uint32Array.from(p)}}function Dr(e){return e===1||e===2||e===3}function Ke(e,t,r,o,i,n){let s=i===-1?-1:1,a=[],c=t,f=i===-1?o:r,p,l=!1,m=()=>{p!==void 0&&l&&p.qHi>p.qLo&&a.push({start:p.qLo,end:p.qHi,mateStart:p.tLo,mateEnd:p.tHi,cigar:Uint32Array.from(p.ops)}),p=void 0,l=!1};for(let u=0;u<e.length;u++){let h=e[u],x=h>>>4,y=h&15,S=y===9,b=S?e[++u]:void 0,d=S||Kt(y)?x:0,g=b!==void 0?b>>>4:Xt(y)?x:0,v=f+g*s;Dr(y)&&x>=n?m():(d>0||g>0)&&(p===void 0&&(p={qLo:c,qHi:c,tLo:f,tHi:f,ops:[]}),p.qHi=c+d,p.tLo=Math.min(p.tLo,f,v),p.tHi=Math.max(p.tHi,f,v),p.ops.push(h),b!==void 0&&p.ops.push(b),l=l||S||Qt(y)),c+=d,f=v}return m(),a}function Zt(e){let t=e.get("CIGAR");return typeof t=="string"?t:void 0}function Jt(e){let t=e.get("coarseCigar");return typeof t=="string"?t:void 0}function Xe(e){let t=Zt(e),r=t===void 0?Jt(e):void 0;return t!==void 0?Be(t):r!==void 0?ke(r):void 0}var qr=["CIGAR","cs","coarseCigar","cg","cr"];function Gr(e){return typeof e=="object"&&e!==null&&"refName"in e&&"start"in e&&"end"in e&&typeof e.refName=="string"&&typeof e.start=="number"&&typeof e.end=="number"}function Br(e){let t=e.get("mate");return Gr(t)?t:void 0}function jr(e,t,r,o){let i=Math.max(e.start,o.start),n=Math.min(e.end,o.end),s=(t.end-t.start)/Math.max(e.end-e.start,1),a=p=>r===-1?t.end-(p-e.start)*s:t.start+(p-e.start)*s,c=Math.round(a(i)),f=Math.round(a(n));return n>i?{start:i,end:n,mateStart:Math.min(c,f),mateEnd:Math.max(c,f)}:void 0}function Ur(e,t,r,o,i){let n={start:e.get("start"),end:e.get("end")},s=e.get("strand")===-1?-1:1,a=n.start>=r.start&&n.end<=r.end,c=a&&o===void 0&&!i?void 0:Xe(e);if(c===void 0){let f=a?{...n,mateStart:t.start,mateEnd:t.end}:jr(n,t,s,r);return f===void 0?[]:[f]}else return(o===void 0?[{...n,mateStart:t.start,mateEnd:t.end,cigar:c}]:Ke(c,n.start,t.start,t.end,s,o)).flatMap(p=>{let l=Ve(p.cigar,p.start,p.mateStart,p.mateEnd,s,r.start,r.end);return l===void 0?[]:[l]})}function Wr(e,t,r,o,i,n){let s=`:${o.start}-${o.end}${i}`,a=e.toJSON(),c={...a,uniqueId:`${e.id()}${s}`,recordId:a.recordId??e.id(),start:r.start,end:r.end,mate:{...t,start:r.mateStart,end:r.mateEnd}};a.syntenyId!==void 0&&(c.syntenyId=`${String(a.syntenyId)}${s}`);for(let f of qr)delete c[f];return n&&r.cigar&&(c.alignmentOps=r.cigar),new j(c)}function er(e,t,r,o=!1){let i=Br(e);if(i===void 0||e.get("spansWindow"))return[e];{let n=Ur(e,i,t,r,o);return n.map((s,a)=>Wr(e,i,s,t,n.length>1?`/${a}`:"",o))}}var tr=class extends ut{constructor(){super(...arguments);this.recordsAreAlignments=!0}static{this.capabilities=["getFeatures","getRefNames"]}async hasDataForRefName(){return!0}getFeaturesInMultipleRegions(r,o={}){let{clipToRegion:i,splitAtGapBp:n,keepAlignment:s,...a}=o,c=i&&this.recordsAreAlignments,f=lt(a.statusCallback);return ze(r).pipe(X((p,l)=>this.getFeatures(p,{...a,statusCallback:f()}).pipe(X(m=>c?er(m,m.get("assemblyName")===p.assemblyName?p:{start:m.get("start"),end:m.get("end")},n,s):[m]),Ee(),te(m=>({index:l,features:m})))),Ee(),X(p=>p.sort((l,m)=>l.index-m.index).flatMap(l=>l.features)))}};function $r(e,t){let r=Math.max(1,t);return e>=10*r?Math.ceil(e/r):Math.max(11,Math.ceil(10*e/r))/10}function Hs(e,t){if(mt(e)&&e instanceof Error){let{fitsBp:r}=e;e.message=e.message.replace("to see the graph","to see lanes"),typeof r=="number"&&(e.message=e.message.replace(/^Zoom in to about [\d.,]*\d[KM]?bp/,`Zoom in about ${$r(t,r)}\xD7`))}return e}function Vs({target:e,query:t,strand:r,cigar:o,matches:i,columns:n}){let s=`${e.name}:${e.start}-${e.end}|${t.name}:${t.start}-${t.end}`;return new j({uniqueId:s,assemblyName:e.assemblyName,refName:e.refName,start:e.start,end:e.end,type:"match",strand:r==="-"?-1:1,CIGAR:o,syntenyId:s,identity:i/Math.max(n,1),numMatches:i,blockLen:n,mate:{refName:t.refName,start:t.start,end:t.end,assemblyName:t.assemblyName}})}function Xs(e,t){return 2*e+(t==="reverse"?1:0)}function q(e){return Math.floor(e/2)}function Qs(e){return e%2===0?"forward":"reverse"}function F(e){return e%2===1}function Zs(e){return e%2===0?e+1:e-1}function Js(e){return e==="left"?"right":"left"}function ea(e){return e==="forward"?"left":"right"}function ta(e){return e==="forward"?"right":"left"}function ra(e){return e==="left"?"forward":"reverse"}function oa(e){return e==="right"?"forward":"reverse"}function Hr(e,t){let r=q(e),o=q(t);return F(e)?o>r||o===r&&!F(t):o>=r}function na(e){return Yr(e[0],e[e.length-1])}function Yr(e,t){return e===void 0||t===void 0?!0:F(e)===F(t)?!F(e):Hr(e,t)}var zr=["","A","C","G","T","N"];function sa(e){let t=e[e.length-1];if(t===void 0)return 0;let r=t,o=0;for(let i=0;i<3&&r%6!==0;i++)r=Math.floor(r/6),o+=1;return 3*(e.length-1)+o}function aa(e){let t="";for(let r of e){let o=r;for(let i=0;i<3;i++){let n=zr[o%6];if(n==="")return t;o=Math.floor(o/6),t+=n}}return t}var Vr={A:"T",C:"G",G:"C",T:"A",N:"N"};function we(e){let t="";for(let r=e.length-1;r>=0;r--)t+=Vr[e[r]]??"N";return t}function Me(e,t){let r=0,o=e.length;for(;r<o;){let i=r+o>>1;e[i]<t?r=i+1:o=i}return r}var Te=class{ending;tree;constructor(t){this.ending=new Float64Array(t),this.tree=new Int32Array(t+1).fill(-1)}bestBefore(t){let r=-1;for(let o=t;o>0;o-=o&-o){let i=this.tree[o];i!==-1&&(r===-1||this.ending[i]>this.ending[r])&&(r=i)}return r}raise(t,r){this.ending[t]=r;for(let o=t+1;o<this.tree.length;o+=o&-o){let i=this.tree[o];(i===-1||r>this.ending[i])&&(this.tree[o]=t)}}},Qe=class{pairs=[];total=0;a;b;weight;occurrences=new Map;constructor(t,r,o){this.a=t,this.b=r,this.weight=o,r.forEach((i,n)=>{let s=this.occurrences.get(i);s?s.push(n):this.occurrences.set(i,[n])})}solve(t,r,o,i){let n=0;for(;t+n<r&&o+n<i&&this.a[t+n]===this.b[o+n];)this.match(t+n,o+n),n+=1;let s=0;for(;r-s>t+n&&i-s>o+n&&this.a[r-s-1]===this.b[i-s-1];)s+=1;this.solveMiddle(t+n,r-s,o+n,i-s);for(let a=s;a>0;a--)this.match(r-a,i-a)}match(t,r){this.pairs.push([t,r]),this.total+=this.weight(this.a[t])}solveMiddle(t,r,o,i){if(t===r||o===i)return;let n=this.matchCount(t,r,o,i);if(n===0)return;if(n<=r-t+(i-o)){this.chain(t,r,o,i,n);return}let s=t+r>>1,a=this.split(t,s,r,o,i);this.solve(t,s,o,a),this.solve(s,r,a,i)}matchCount(t,r,o,i){let n=0;for(let s=t;s<r;s++){let a=this.occurrences.get(this.a[s]);a&&(n+=Me(a,i)-Me(a,o))}return n}sweep(t,r,o,i,n,s,a){for(let c=t;c!==r;c+=o){let f=this.occurrences.get(this.a[c]);if(!f)continue;let p=this.weight(this.a[c]),l=Me(f,i),m=Me(f,n);for(let u=0;u<m-l;u++){let h=o===1?f[m-1-u]-i:n-1-f[l+u],x=s.bestBefore(h),y=(x===-1?0:s.ending[x])+p;if(y>s.ending[h]&&(s.raise(h,y),a)){let S=a.count++;a.row[S]=c,a.column[S]=h,a.previous[S]=x===-1?-1:a.endingMatch[x],a.endingMatch[h]=S}}}}chain(t,r,o,i,n){let s=new Te(i-o),a={row:new Int32Array(n),column:new Int32Array(n),previous:new Int32Array(n),endingMatch:new Int32Array(i-o),count:0};this.sweep(t,r,1,o,i,s,a);let c=s.bestBefore(i-o);if(c===-1)return;this.total+=s.ending[c];let f=[];for(let p=a.endingMatch[c];p!==-1;p=a.previous[p])f.push([a.row[p],o+a.column[p]]);for(let p=f.length-1;p>=0;p--)this.pairs.push(f[p])}frontier(t,r,o,i,n){let s=new Te(n-i);this.sweep(t,r,o,i,n,s);let a=new Float64Array(n-i+1);for(let c=0;c<n-i;c++)a[c+1]=Math.max(a[c],s.ending[c]);return a}split(t,r,o,i,n){let s=n-i,a=this.frontier(t,r,1,i,n),c=this.frontier(o-1,r-1,-1,i,n),f=0,p=-1;for(let l=0;l<=s;l++){let m=a[l]+c[s-l];m>p&&(p=m,f=l)}return i+f}};function ca(e,t,r){let o=new Qe(e,t,r);return o.solve(0,e.length,0,t.length),[o.pairs,o.total]}var Kr=100,et=4e6,Xr=5e3,O=15,Qr=64,Zr=8,fr=1,tt=-4,w=-6,G=-1,Q=-(2**30),Re=0,Ze=1,cr=2;function H(e,t,r){let o=e.at(-1);r>0&&(o?.[0]===t?o[1]+=r:e.push([t,r]))}function Oe(e,t,r){return e>=r&&e>=t?Re:r>=t?cr:Ze}function pr(e,t,r){let o=e.length,i=t.length,n=i+1,s=new Uint8Array((o+1)*n),a=new Int32Array(n).fill(Q),c=new Int32Array(n).fill(Q),f=new Int32Array(n).fill(Q);a[0]=0;for(let h=1;h<=i;h++)f[h]=w+(h-1)*G,s[h]=(h===1?Re:cr)<<4;for(let h=1;h<=o;h++){let x=new Int32Array(n).fill(Q),y=new Int32Array(n).fill(Q),S=new Int32Array(n).fill(Q);y[0]=w+(h-1)*G,s[h*n]=(h===1?Re:Ze)<<2;let b=e.charCodeAt(h-1);for(let d=1;d<=i;d++){let g=Oe(a[d-1],c[d-1],f[d-1]);x[d]=Math.max(a[d-1],c[d-1],f[d-1])+(b===t.charCodeAt(d-1)?fr:tt);let v=Oe(a[d]+w,c[d]+G,f[d]+w);y[d]=Math.max(a[d]+w,c[d]+G,f[d]+w);let I=Oe(x[d-1]+w,y[d-1]+w,S[d-1]+G);S[d]=Math.max(x[d-1]+w,y[d-1]+w,S[d-1]+G),s[h*n+d]=g|v<<2|I<<4}a=x,c=y,f=S}let p=[],l=o,m=i,u=Oe(a[i],c[i],f[i]);for(;l>0||m>0;){let h=s[l*n+m]>>2*u&3;u===Re?(p.push(e[l-1]===t[m-1]?"=":"X"),l-=1,m-=1):u===Ze?(p.push("I"),l-=1):(p.push("D"),m-=1),u=h}for(let h of p.reverse())H(r,h,1)}function Jr(e,t){let r=Math.abs(e-t);return(r===0?0:Math.min(-w-(r-1)*G,-w+10*Math.log2(r)))+(Math.min(e,t)>0?-tt:0)}function lr(e,t){let r=Math.abs(e-t);return r===0?0:.01*O*r+.5*Math.log2(r)}function rr(e,t,r){return{qs:e.qs+t,qe:e.qs+r,ts:e.flipped?e.te-r:e.ts+t,te:e.flipped?e.te-t:e.ts+r,flipped:e.flipped}}function eo(e,t,r){let o=e.qe-e.qs,i=[];for(let[a,c]of t){let f=Math.max(0,a-e.qs),p=Math.min(o,c-e.qs);f<p&&i.push([f,p])}for(let[a,c]of r){let f=Math.max(0,e.flipped?e.te-c:a-e.ts),p=Math.min(o,e.flipped?e.te-a:c-e.ts);f<p&&i.push([f,p])}if(i.length===0)return[e];i.sort((a,c)=>a[0]-c[0]);let n=[],s=0;for(let[a,c]of i)a-s>=O&&n.push(rr(e,s,a)),s=Math.max(s,c);return o-s>=O&&n.push(rr(e,s,o)),n}function rt(e,t,r,o,i=1/0){let n=[],s={query:[],target:[]},a={forward:{query:[],target:[]},flipped:{query:[],target:[]}},c=[...e].sort((f,p)=>f.qs-p.qs||f.ts-p.ts);for(;c.length>0&&n.length<i;){let f=c.map(d=>d.qe-d.qs),p=new Int32Array(c.length).fill(-1),l=new Int32Array(c.length);for(let d=0;d<c.length;d++){let g=c[d],v=g.qe-g.qs;for(let I=d-1;I>=Math.max(0,d-Xr);I--){if(f[I]+v<=f[d])continue;let C=c[I];if(C.flipped===g.flipped&&C.qs<g.qs&&(g.flipped?g.te<C.te:C.ts<g.ts)){let _=Math.max(0,C.qe-g.qs,g.flipped?g.te-C.ts:C.te-g.ts),P=g.qs+_-C.qe,E=g.flipped?C.ts-(g.te-_):g.ts+_-C.te;if(_<v&&P<=t&&E<=t){let B=f[I]+v-_-o(P,E);B>f[d]&&(f[d]=B,p[d]=I,l[d]=_)}}}}let m=new Int32Array(c.length),u=-1;for(let d=0;d<c.length;d++){let g=c[d];m[d]=(m[p[d]]??0)+g.qe-g.qs-l[d],m[d]>=r&&(u<0||f[d]>f[u])&&(u=d)}if(u<0)break;let h=[];for(let d=u;d>=0;d=p[d])h.push({run:c[d],trim:l[d]});h.reverse(),n.push(h);let x=h[0],y=h.at(-1),{flipped:S}=x.run,b=S?a.flipped:a.forward;b.query.push([x.run.qs+x.trim,y.run.qe]),b.target.push(S?[y.run.ts,x.run.te-x.trim]:[x.run.ts+x.trim,y.run.te]);for(let{run:d,trim:g}of h)s.query.push([d.qs+g,d.qe]),s.target.push(d.flipped?[d.ts,d.te-g]:[d.ts+g,d.te]);c=c.flatMap(d=>{let g=d.flipped?a.flipped:a.forward;return eo(d,[...s.query,...g.query],[...s.target,...g.target])}).sort((d,g)=>d.qs-g.qs||d.ts-g.ts)}return n}function Je(e,t){let r=new Map;for(let n=0;n+O<=t.length;n++){let s=t.slice(n,n+O),a=r.get(s);a?a.push(n):r.set(s,[n])}let o=[],i=new Map;for(let n=0;n+O<=e.length;n++){let s=r.get(e.slice(n,n+O));if(s&&s.length<=Qr)for(let a of s){let c=a-n,f=i.get(c);if(f&&n<=f.qe)f.qe=n+O,f.te=a+O;else{let p={qs:n,qe:n+O,ts:a,te:a+O,flipped:!1};i.set(c,p),o.push(p)}}}return o}function to(e,t){return[...Je(e,t),...Je(e,we(t)).map(r=>({...r,ts:t.length-r.te,te:t.length-r.ts,flipped:!0}))]}function Le(e,t,r,o,i){let n;for(let{run:s,trim:a}of e){let c=s.qs+a;if(n){let f=s.flipped?s.te-a:n.te,p=s.flipped?n.ts:s.ts+a,l=r.slice(f,p);i(t.slice(n.qe,c),s.flipped?we(l):l,o,n.qe,f)}H(o,"=",s.qe-c),n=s}}function ot(e,t,r){H(r,"I",e.length),H(r,"D",t.length)}function ur(e,t,r){e.length*t.length<=et?pr(e,t,r):ot(e,t,r)}function nt(e,t,r,o=0){let[i]=e.length*t.length>et&&o<Zr?rt(Je(e,t),1/0,O,lr,1):[];if(!i){ur(e,t,r);return}let n=(c,f,p)=>{nt(c,f,p,o+1)},s=i[0].run,a=i.at(-1).run;n(e.slice(0,s.qs),t.slice(0,s.ts),r),Le(i,e,t,r,n),n(e.slice(a.qe),t.slice(a.te),r)}function ro(e,t,r){nt(e,t,r)}function oo(e,t,r){let o=[];Le(e,t,r,o,ro);let i=e[0],n=e.at(-1),{flipped:s}=i.run;return{queryStart:i.run.qs+i.trim,queryEnd:n.run.qe,targetStart:s?n.run.ts:i.run.ts+i.trim,targetEnd:s?i.run.te-i.trim:n.run.te,strand:s?"-":"+",edits:s?o.reverse():o,sharedBases:0}}function no(e,t,r,o){let i=[];if(e.length*t.length<=et)pr(e,t,r);else{let n=rt(to(e,t),1/0,Math.max(o,O),lr),s=n.find(a=>!a[0].run.flipped);if(i=n.filter(a=>a[0].run.flipped).map(a=>oo(a,e,t)),s){let a=(p,l,m,u,h)=>{i.some(y=>u<y.queryEnd&&y.queryStart<u+p.length||h<y.targetEnd&&y.targetStart<h+l.length)?ur(p,l,m):nt(p,l,m)},c=s[0].run,f=s.at(-1).run;a(e.slice(0,c.qs),t.slice(0,c.ts),r,0,0),Le(s,e,t,r,a),a(e.slice(f.qe),t.slice(f.te),r,f.qe,f.te)}else ot(e,t,r)}return i}function it(e,t){let r=e.strand==="-",o=0,i=0;for(let[n,s]of e.edits)t(n,s,r?e.queryEnd-1-o:e.queryStart+o,e.targetStart+i),n!=="D"&&(o+=s),n!=="I"&&(i+=s)}function or(e,t,r,o){let i=t==="query"&&e.strand==="-"?-1:1,n=0;return it(e,(s,a,c,f)=>{let p=t==="query"?c:f,l=m=>{let u=p+i*m;return u>=r&&u<o};if(s==="="||s==="X")for(let m=0;m<a;m++)l(m)&&(n+=s==="="?fr:tt);else if(s==="I"==(t==="query"))for(let m=0;m<a;m++)l(m)&&(n+=m===0?w:G);else l(0)&&(n+=w+(a-1)*G)}),n}function nr(e,t){return t==="query"?[e.queryStart,e.queryEnd]:[e.targetStart,e.targetEnd]}function io(e,t){let r=e.strand==="-",o=[],i=0,n=0,s=0,a=0,c=new Uint8Array(e.queryEnd-e.queryStart);for(let[u,h]of e.shared)c.fill(1,u-e.queryStart,h-e.queryStart);let f=u=>c[u-e.queryStart]===1,p=()=>{H(o,"I",i),H(o,"D",n),i=0,n=0};it(e,(u,h,x)=>{if(u==="I")i+=h;else if(u==="D")n+=h;else{for(let y=0;y<h;y++)t[s+y]?(i+=1,n+=1,f(r?x-y:x+y)&&(a+=1)):((i>0||n>0)&&p(),H(o,u,1));s+=h}}),p();let l={I:0,D:0};for(;o[0]?.[0]==="I"||o[0]?.[0]==="D";){let[u,h]=o.shift();l[u]+=h}let m={I:0,D:0};for(;o.at(-1)?.[0]==="I"||o.at(-1)?.[0]==="D";){let[u,h]=o.pop();m[u]+=h}return o.length===0?void 0:{...e,queryStart:e.queryStart+(r?m.I:l.I),queryEnd:e.queryEnd-(r?l.I:m.I),targetStart:e.targetStart+l.D,targetEnd:e.targetEnd-m.D,edits:o,sharedBases:e.sharedBases-a}}function so(e,t,r,o){let i={query:new Uint8Array(t),target:new Uint8Array(r)},n=e.map(f=>{let p=[];it(f,(l,m,u,h)=>{if(l==="="||l==="X")for(let x=0;x<m;x++)p.push([f.strand==="-"?u-x:u+x,h+x])});for(let[l,m]of p)i.query[l]=Math.min(255,i.query[l]+1),i.target[m]=Math.min(255,i.target[m]+1);return p}),s={query:new Map,target:new Map};n.forEach((f,p)=>{for(let[l,m]of f)for(let[u,h]of[["query",l],["target",m]])if(i[u][h]>1){let x=s[u].get(h);x?x.at(-1)!==p&&x.push(p):s[u].set(h,[p])}});let a=new Map,c=(f,p,l)=>{let m=`${l}:${f}:${p}`,u=a.get(m);if(u===void 0){let[h,x]=nr(e[f],l),[y,S]=nr(e[p],l),b=Math.max(h,y),d=Math.min(x,S),[g,v]=[e[f],e[p]];u=[or(v,l,b,d)-or(g,l,b,d),v.sharedBases-g.sharedBases,f-p].find(C=>C!==0)>0,a.set(m,u)}return u};return e.flatMap((f,p)=>{let l=n[p],m=new Uint8Array(l.length);if(l.forEach(([x,y],S)=>{for(let[b,d]of[["query",x],["target",y]])!m[S]&&s[b].get(d)?.some(g=>g!==p&&c(p,g,b))&&(m[S]=1)}),!m.includes(1))return[f];let u=io(f,m),h=u?.edits.reduce((x,[y,S])=>x+(y==="="?S:0),0)??0;return u&&h>=o?[u]:[]})}function ir(e,t){return e.map(r=>{let o=t(q(r));return F(r)?we(o):o}).join("")}function sr(e,t){let r=[0];for(let o of e)r.push(r.at(-1)+t(q(o)).length);return r}function ar(e){let t=new Map,r=new Map;e.forEach((s,a)=>{let c=q(s);t.has(c)?r.set(c,a):t.set(c,a)});let o=new Int32Array(e.length+1);for(let[s,a]of r)o[t.get(s)]+=1,o[a+1]-=1;let i=new Uint8Array(e.length),n=0;for(let s=0;s<e.length;s++)n+=o[s],i[s]=n>0?1:0;return i}function ao(e,t,r,o){let i=ar(e),n=ar(t),s=new Map;t.forEach((l,m)=>{n[m]||s.set(q(l),[m])});let a=2*t.length,c=(l,m,u)=>l*a+2*m+(u?1:0),f=new Set;e.forEach((l,m)=>{for(let u of i[m]?[]:s.get(q(l))??[])f.add(c(m,u,F(l)!==F(t[u])))});let p=[];return e.forEach((l,m)=>{for(let u of i[m]?[]:s.get(q(l))??[]){let h=F(l)!==F(t[u]),x=h?-1:1,y=u-x;if(!(m>0&&y>=0&&y<t.length&&f.has(c(m-1,y,h)))){let b=m,d=u;for(;b<e.length&&d>=0&&d<t.length&&f.has(c(b,d,h));)b+=1,d+=x;let g=d-x;p.push({qs:r[m],qe:r[b],ts:o[Math.min(u,g)],te:o[Math.max(u,g)+1],flipped:h})}}}),p}function ma(e){let{query:t,target:r,sequenceOf:o}=e,i=ir(t,o),n=ir(r,o),s=ao(t,r,sr(t,o),sr(r,o)),a=e.minMatch??Kr,c=e.bases??!0,f=[];for(let p of rt(s,e.maxGap??1/0,a,Jr)){let l=[],m=p[0],u=p.at(-1),{flipped:h}=m.run;Le(p,i,n,l,c?(y,S,b,d,g)=>{for(let v of no(y,S,b,a)){let I=g+S.length;f.push({...v,queryStart:d+v.queryStart,queryEnd:d+v.queryEnd,targetStart:h?I-v.targetEnd:g+v.targetStart,targetEnd:h?I-v.targetStart:g+v.targetEnd,strand:h?"+":"-",edits:h?v.edits.reverse():v.edits,shared:[]})}}:ot),f.push({queryStart:m.run.qs+m.trim,queryEnd:u.run.qe,targetStart:h?u.run.ts:m.run.ts+m.trim,targetEnd:h?m.run.te-m.trim:u.run.te,strand:h?"-":"+",edits:h?l.reverse():l,sharedBases:p.reduce((y,{run:S,trim:b})=>y+S.qe-S.qs-b,0),shared:p.map(({run:y,trim:S})=>[y.qs+S,y.qe])})}return so(f,i.length,n.length,a).map(({shared:p,...l})=>l).sort((p,l)=>p.queryStart-l.queryStart)}function da(e){return e.map(([t,r])=>`${r}${t}`).join("")}export{Xs as a,q as b,Qs as c,F as d,Zs as e,Js as f,ea as g,ta as h,ra as i,oa as j,Hr as k,na as l,Yr as m,sa as n,aa as o,ca as p,ma as q,da as r,j as s,tr as t,Hs as u,Vs as v};
4
- //# sourceMappingURL=chunk-5N4B6FEH.js.map
4
+ //# sourceMappingURL=chunk-7OHJQC5U.js.map
@@ -1,5 +1,5 @@
1
- import{$ as ot,$b as wt,Ac as Et,Cc as Mt,Db as ut,Dc as _e,Eb as bt,Gb as ft,Hc as Se,Ia as lt,Kb as ht,Lb as gt,Ob as mt,P as Je,Pb as kt,Pc as Ee,Q as Qe,R as et,S as Re,Sc as Lt,U as tt,V as nt,W as xe,Za as te,_ as rt,a as He,aa as at,b as j,ba as st,bc as Pe,bd as Me,cd as Le,e as Xe,ea as it,gd as Ct,ic as Rt,jd as At,lc as xt,mc as ye,md as Ot,o as Ue,qb as pt,qc as Pt,r as fe,rc as yt,s as he,sc as _t,tb as T,vb as ct,xb as dt,zc as St}from"./chunk-M5XKM6D2.js";import{D as O,E as qe,M as ee,Z as Ze,a as je,d as Z,l as J,m as me,n as ke,o as we,u as Q,x as K}from"./chunk-VY7G4FSX.js";import{$ as ze,G as X,I as q,J as ge,aa as Ve}from"./chunk-BLE63OIT.js";import{b as G,c as $}from"./chunk-E3GNTGWW.js";import{d as V}from"./chunk-WKD7ALOU.js";import{d as De}from"./chunk-RDTLCMD2.js";import{b as Ke,d as L,e as $e,f as Fe,g as be,h as Ye}from"./chunk-J2PN6CG3.js";import{a as I,b as l,c as y,d as m}from"./chunk-DUU6T2I5.js";var Jt="data-pans-with-drawing";function Tt(e,t){return{position:"absolute",left:0,top:0,pointerEvents:"none",overflow:t,zIndex:e}}var N=m(function({model:t,zIndex:n,overflow:r="hidden",testId:o,pansWithDrawing:a,children:i}){return l("svg",{style:{...Tt(n,r),userSelect:a?"none":void 0,clipPath:t.drawingClip},width:t.paneWidth,height:t.canvasHeight,"data-testid":o,...a?{[Jt]:""}:{},children:i})}),ne=m(function({model:t,children:n}){let{scaleX:r,scaleY:o,translateX:a,translateY:i}=t;return l("g",{transform:`translate(${a} ${i}) scale(${r} ${o})`,children:n})}),Nt=m(function({model:t,drawnAt:n,children:r}){let o=t.translateX-n.translateX,a=t.translateY-n.translateY;return l("g",{transform:`translate(${o} ${a})`,children:r})}),C=m(function({model:t,zIndex:n,shown:r=!0,testId:o,paint:a}){let i=Ye(null);return $e(()=>{if(r)return He(()=>{let s=i.current,c=s?.getContext("2d");if(s&&c){let b=t.paneWidth,h=t.canvasHeight;te(Ct());let f=wt(s,b,h);c.setTransform(f,0,0,f,0,0),c.clearRect(0,0,b,h),a(c,f)}})},[t,r,a]),l("canvas",{ref:i,"data-testid":r?o:void 0,style:{...Tt(n),display:r?"block":"none"}})});var Qt=m(function({model:t}){let{bubbleHalos:n,hoveredBubble:r}=t;if(n.length===0)return null;let o=t.contigThickness*ft;return l(N,{model:t,zIndex:2,testId:"graph-bubble-halos",children:l(ne,{model:t,children:n.filter(a=>!a.whole&&(!a.tick||r&&G(a.bubble,r))).map(a=>l("path",{d:a.path,fill:"none",stroke:T,strokeOpacity:r&&G(a.bubble,r)?.45:t.bubbleFaded(a)?.06:.22,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"},$(a.bubble)))})})}),Gr=Qt;var en="#18181c";function tn(e,t){let n=t.edgeMarks;n&&pt(e,n,{top:t.referenceStripZonePx,bottom:t.canvasHeight},{ink:en,paper:lt})}var nn=m(function({model:t}){let n=L(r=>{tn(r,t)},[t]);return l(C,{model:t,zIndex:5,shown:t.runsPastEdge,testId:"graph-edge-marks",paint:n})}),Fr=nn;function rn(e){return e==="class"?"className":/^(data|aria)-/.test(e)?e:e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function on(e,t){let n={key:t};for(let[r,o]of Object.entries(e.attrs))o!==void 0&&(n[rn(r)]=o);return n}var Ae="pane";function Ce(e,t,n){return typeof e=="string"?e:n&&e.attrs.transform===Ae?l(ne,{model:n,children:e.children.map((r,o)=>Ce(r,o,n))},t):Ke(e.tag,on(e,t),e.children.map((r,o)=>Ce(r,o,n)))}function D(){return Fe().replaceAll(/[^\w-]/g,"")}function F({el:e,pane:t}){return Ce(e,0,t)}var an=m(function({model:t}){let n=`exon-outline-${D()}`,r=dt(t.exonOutlines,{id:n,width:t.paneWidth,height:t.canvasHeight,transform:Ae});return r?l(N,{model:t,zIndex:2,testId:"graph-gene-pins",children:l(F,{el:r,pane:t})}):null}),to=an;var re=.35;function vt(e,t,n){return{x:e-n/2,y:t-X-q+2,width:n,height:X+q*2-2}}function It(e,t,n){let r=vt(e.x,e.y,e.w);return t>=r.x&&t<=r.x+r.width&&n>=r.y&&n<=r.y+r.height}var Y=m(function({x:t,y:n,w:r,text:o,note:a,color:i,edge:s=i,italic:c,bold:b,dimmed:h,title:f,testId:d,onClick:u,onHover:k}){return y("g",{style:{pointerEvents:u||k?"auto":"none",cursor:u?"pointer":void 0,opacity:h?re:1},"data-testid":d,onClick:u,onMouseEnter:()=>{k?.(!0)},onMouseLeave:()=>{k?.(!1)},...u&&{role:"button",tabIndex:0,"aria-label":(f??o).replaceAll(`
1
+ import{$ as ot,$b as wt,Ac as Et,Cc as Mt,Db as ut,Dc as _e,Eb as bt,Gb as ft,Hc as Se,Ia as lt,Kb as ht,Lb as gt,Ob as mt,P as Je,Pb as kt,Pc as Ee,Q as Qe,R as et,S as Re,Sc as Lt,U as tt,V as nt,W as xe,Za as te,_ as rt,a as He,aa as at,b as j,ba as st,bc as Pe,bd as Me,cd as Le,e as Xe,ea as it,gd as Ct,ic as Rt,jd as At,lc as xt,mc as ye,md as Ot,o as Ue,qb as pt,qc as Pt,r as fe,rc as yt,s as he,sc as _t,tb as T,vb as ct,xb as dt,zc as St}from"./chunk-FQ5DWNNX.js";import{D as O,E as qe,M as ee,Z as Ze,a as je,d as Z,l as J,m as me,n as ke,o as we,u as Q,x as K}from"./chunk-F3NT4VYA.js";import{$ as Ve,G as X,I as q,J as ge,_ as ze}from"./chunk-XO54F7NK.js";import{b as G,c as $}from"./chunk-OA3GUDDC.js";import{d as V}from"./chunk-WKD7ALOU.js";import{d as De}from"./chunk-DAIBR3K3.js";import{b as Ke,d as L,e as $e,f as Fe,g as be,h as Ye}from"./chunk-J2PN6CG3.js";import{a as I,b as l,c as y,d as m}from"./chunk-DUU6T2I5.js";var Jt="data-pans-with-drawing";function Tt(e,t){return{position:"absolute",left:0,top:0,pointerEvents:"none",overflow:t,zIndex:e}}var N=m(function({model:t,zIndex:n,overflow:r="hidden",testId:o,pansWithDrawing:a,children:i}){return l("svg",{style:{...Tt(n,r),userSelect:a?"none":void 0,clipPath:t.drawingClip},width:t.paneWidth,height:t.canvasHeight,"data-testid":o,...a?{[Jt]:""}:{},children:i})}),ne=m(function({model:t,children:n}){let{scaleX:r,scaleY:o,translateX:a,translateY:i}=t;return l("g",{transform:`translate(${a} ${i}) scale(${r} ${o})`,children:n})}),Nt=m(function({model:t,drawnAt:n,children:r}){let o=t.translateX-n.translateX,a=t.translateY-n.translateY;return l("g",{transform:`translate(${o} ${a})`,children:r})}),C=m(function({model:t,zIndex:n,shown:r=!0,testId:o,paint:a}){let i=Ye(null);return $e(()=>{if(r)return He(()=>{let s=i.current,c=s?.getContext("2d");if(s&&c){let b=t.paneWidth,h=t.canvasHeight;te(Ct());let f=wt(s,b,h);c.setTransform(f,0,0,f,0,0),c.clearRect(0,0,b,h),a(c,f)}})},[t,r,a]),l("canvas",{ref:i,"data-testid":r?o:void 0,style:{...Tt(n),display:r?"block":"none"}})});var Qt=m(function({model:t}){let{bubbleHalos:n,hoveredBubble:r}=t;if(n.length===0)return null;let o=t.contigThickness*ft;return l(N,{model:t,zIndex:2,testId:"graph-bubble-halos",children:l(ne,{model:t,children:n.filter(a=>!a.whole&&(!a.tick||r&&G(a.bubble,r))).map(a=>l("path",{d:a.path,fill:"none",stroke:T,strokeOpacity:r&&G(a.bubble,r)?.45:t.bubbleFaded(a)?.06:.22,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"},$(a.bubble)))})})}),Gr=Qt;var en="#18181c";function tn(e,t){let n=t.edgeMarks;n&&pt(e,n,{top:t.referenceStripZonePx,bottom:t.canvasHeight},{ink:en,paper:lt})}var nn=m(function({model:t}){let n=L(r=>{tn(r,t)},[t]);return l(C,{model:t,zIndex:5,shown:t.runsPastEdge,testId:"graph-edge-marks",paint:n})}),Fr=nn;function rn(e){return e==="class"?"className":/^(data|aria)-/.test(e)?e:e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function on(e,t){let n={key:t};for(let[r,o]of Object.entries(e.attrs))o!==void 0&&(n[rn(r)]=o);return n}var Ae="pane";function Ce(e,t,n){return typeof e=="string"?e:n&&e.attrs.transform===Ae?l(ne,{model:n,children:e.children.map((r,o)=>Ce(r,o,n))},t):Ke(e.tag,on(e,t),e.children.map((r,o)=>Ce(r,o,n)))}function D(){return Fe().replaceAll(/[^\w-]/g,"")}function F({el:e,pane:t}){return Ce(e,0,t)}var an=m(function({model:t}){let n=`exon-outline-${D()}`,r=dt(t.exonOutlines,{id:n,width:t.paneWidth,height:t.canvasHeight,transform:Ae});return r?l(N,{model:t,zIndex:2,testId:"graph-gene-pins",children:l(F,{el:r,pane:t})}):null}),to=an;var re=.35;function vt(e,t,n){return{x:e-n/2,y:t-X-q+2,width:n,height:X+q*2-2}}function It(e,t,n){let r=vt(e.x,e.y,e.w);return t>=r.x&&t<=r.x+r.width&&n>=r.y&&n<=r.y+r.height}var Y=m(function({x:t,y:n,w:r,text:o,note:a,color:i,edge:s=i,italic:c,bold:b,dimmed:h,title:f,testId:d,onClick:u,onHover:k}){return y("g",{style:{pointerEvents:u||k?"auto":"none",cursor:u?"pointer":void 0,opacity:h?re:1},"data-testid":d,onClick:u,onMouseEnter:()=>{k?.(!0)},onMouseLeave:()=>{k?.(!1)},...u&&{role:"button",tabIndex:0,"aria-label":(f??o).replaceAll(`
2
2
  `,", "),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),u())},onFocus:()=>{k?.(!0)},onBlur:()=>{k?.(!1)}},children:[f?l("title",{children:f}):null,l("rect",{...vt(t,n,r),rx:3,fill:"rgba(255,255,255,0.85)",stroke:s,strokeWidth:1}),y("text",{x:t,y:n,fontSize:X,fontFamily:"sans-serif",fontStyle:c?"italic":void 0,fontWeight:c?600:b?"bold":void 0,fill:i,textAnchor:"middle",children:[o,a?l("tspan",{fontStyle:"normal",fontWeight:"normal",children:a}):null]})]})});var Oe="#1c1c22",Te=9,Ne=3;function yo({genes:e},t,n){let r=e.find(a=>It(a,t,n))?.item,o=r&&ht(r.pin);return r?{label:r.name,readout:`${kt({...r.pin.gene,refName:De(r.pin.gene.refName)})}${o?`, ${o} in the cut`:""}`}:void 0}var sn=m(function({model:t}){let{bubbles:n,genes:r,ticks:o,passes:a,sizes:i}=t.overlayLabels,s=i.flatMap(p=>{let g=Ve(p);return g?[{key:p.key,faded:t.nodeFaded(p.node),...g}]:[]});if(n.length+r.length+o.length+a.length+s.length===0)return null;let{scaleX:c,scaleY:b,translateX:h,translateY:f,contigThickness:d,hoveredBubble:u}=t,k=u?o.find(p=>G(p.item.bubble,u)):void 0,w=p=>{let g=p instanceof Element?p.getAttribute("data-tick"):null;return g===null?void 0:o[Number(g)]},E=p=>t.bubbleFaded(p),x=p=>t.bubbleIsOpen(p.bubble);return y(N,{model:t,zIndex:3,testId:"graph-label-layer",pansWithDrawing:!0,children:[l("g",{"data-testid":"graph-bubble-ticks",onClick:p=>{let g=w(p.target);g&&t.toggleBubble(g.item.bubble)},onMouseOver:p=>{let g=w(p.target);g&&t.setHoveredBubble(g.item.bubble)},onMouseOut:()=>{V(t)&&t.setHoveredBubble(null)},onFocus:p=>{let g=w(p.target);g&&t.setHoveredBubble(g.item.bubble)},onBlur:()=>{V(t)&&t.setHoveredBubble(null)},onKeyDown:p=>{let g=w(p.target);g&&(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),t.toggleBubble(g.item.bubble))},children:o.map(({item:p,x:g,y:P},M)=>l("rect",{"data-tick":M,role:"button",tabIndex:0,"aria-label":`${p.label}, ${x(p)?"close":"open"} bubble`,x:g-Ne/2,y:P-Te,width:Ne,height:Te,rx:Ne/2,fill:T,opacity:E(p)?re:1,style:{pointerEvents:"all",cursor:"pointer"}},$(p.bubble)))}),s.map(({key:p,faded:g,x1:P,y1:M,x2:v,y2:A})=>l("line",{"data-testid":"graph-size-leader",x1:P,x2:v,y1:M,y2:A,stroke:Oe,strokeWidth:.8,strokeOpacity:.6,opacity:g?re:void 0},p)),r.map(({item:{pin:p,name:g},x:P,y:M,w:v,text:A})=>{let{gene:H}=p,{x1:ce,y1:de,x2:ue,y2:Zt}=gt({x:P,y:M},{x:p.at.x*c+h,y:p.at.y*b+f},d);return y("g",{children:[l("line",{x1:ce,x2:ue,y1:de,y2:Zt,stroke:Oe,strokeWidth:.8,strokeOpacity:.6}),l(Y,{x:P,y:M,w:v,text:g,note:A.slice(g.length)||void 0,color:Oe,edge:ct,italic:!0,testId:"graph-gene-pin-label"})]},`${H.name}-${H.refName}-${H.start}`)}),a.map(({item:p,x:g,y:P,w:M,text:v})=>{let A=Z(p.ink),{x1:H,y1:ce,x2:de,y2:ue}=mt({x:g,y:P},p.at);return y("g",{"data-testid":"graph-pass-label",style:{pointerEvents:"none"},children:[l("line",{x1:H,x2:de,y1:ce,y2:ue,stroke:A,strokeWidth:1}),l("circle",{cx:p.at.x,cy:p.at.y,r:2,fill:A}),l(Y,{x:g,y:P,w:M,text:v,color:A,bold:!0})]},`${p.walk}-${p.pass}`)}),n.map(({item:p,x:g,y:P,w:M,text:v})=>l(Y,{x:g,y:P,w:M,text:v,color:T,dimmed:E(p),title:`${p.label}
3
3
  ${p.bubble.segmentCount} segments${p.bubble.covering?"":x(p)?" \xB7 click to close":" \xB7 click to open"}`,testId:"graph-bubble-halo-label",onClick:p.bubble.covering?void 0:()=>{t.toggleBubble(p.bubble)},onHover:A=>{V(t)&&t.setHoveredBubble(A?p.bubble:null)}},$(p.bubble))),k?l(Y,{x:k.x,y:k.y-Te-4,w:ge(k.item.label),text:k.item.label,color:T,testId:"graph-bubble-tick-label"}):null]})}),_o=sn;var Gt=["#d4735e","#d8a94a","#c98aa4"],ln="#e6e6e6",pn="#555",cn="bold 11px sans-serif";var ve=e=>Gt[e]??ln;function oe(e){let t=String.fromCharCode(65+e%26);return e<26?t:oe(Math.floor(e/26)-1)+t}var ae=Gt.length;function Bt(e,t,n){e.font=cn,e.textAlign="center",e.textBaseline="middle";for(let{row:r,start:o,bp:a,block:i}of t){let s=n.x(o),c=n.x(o+a)-s,b=n.rowCentre(r)-n.barPx/2;e.fillStyle=ve(i),e.fillRect(s,b,c,n.barPx),e.strokeStyle=pn,e.lineWidth=1,e.strokeRect(s+.5,b+.5,c-1,n.barPx-1),c>=12&&n.barPx>=9&&(e.fillStyle="#111",e.fillText(oe(i),s+c/2,n.rowCentre(r)))}}var R=18,Wt=32,un=6,Ht=7,bn="#b8b8c0",se=Qe-4,fn=15,ie=10,Dt=8;function le(e){return e.kind==="fill"?e.width??R:R}var Be=e=>e.length>1?3:4;function z(e){switch(e.kind){case"fill":return e.height??8;case"bands":return Be(e.bands)*e.bands.length;case"line":return 3;case"halo":case"overhang":case"overrun":return 10;case"outline":case"tick":return e.height;case"glyph":return 15;case"bracket":return 7;case"threads":return 8;case"heads":return e.haloPx===void 0?e.lanePx:J+e.haloPx;case"blank":return 0}}function qa(e){return e.reduce((t,n)=>n.swatch?Math.max(t,le(n.swatch)):t,0)}function Za(e){return e.reduce((t,n)=>n.swatch?Math.max(t,Math.ceil(z(n.swatch))+3):t,fn)}var _=e=>[{offset:0,color:e}];function hn(e,t,n){return{key:e,label:n,swatch:{kind:"fill",stops:_(t),width:ie,height:ie,edged:!0}}}function Ie(e){return e.flatMap((t,n)=>[{offset:n/e.length,color:t},{offset:(n+1)/e.length,color:t}])}var S=Z,gn=e=>e.map(({offset:t,ink:n})=>({offset:t,color:S(n)}));function mn(e,t){let n=t?J:Dt,r=n*me,o=(t?[r,R]:[R-1]).map(a=>`M${Pe({x:a,y:0,angle:0,length:r,halfWidth:n/2,color:e},{scaleX:1,scaleY:1,translateX:0,translateY:0,dpr:1}).map(s=>`${+s.x.toFixed(1)},${+s.y.toFixed(1)}`).join("L")}Z`).join("");return{kind:"heads",lane:S(e),lanePx:t?K:Dt,heads:o,fill:S(we(e,!t)),...t?{haloPx:2*ke}:{}}}function kn(e){switch(e.kind){case"scale":return{kind:"fill",stops:gn(e.stops),width:Wt};case"swatch":return{kind:"fill",stops:_(S(e.ink)),width:R};case"chip":return{kind:"fill",stops:_(S(e.ink)),width:ie,height:ie,edged:!0};case"width":return{kind:"fill",stops:_(S(e.ink)),width:Wt,height:e.px};case"hollow":return{kind:"fill",stops:_(S(e.ink)),rim:S(e.rim)};case"line":return e.dashed?{kind:"line",color:S(e.ink),dashed:!0}:{kind:"line",color:S(e.ink),short:!0};case"outline":return{kind:"outline",color:S(e.ink),stroke:2,radius:5,height:8};case"halo":return{kind:"halo",color:S(e.ink)};case"threads":return{kind:"threads"};case"overhang":return{kind:"overhang"};case"overrun":return{kind:"overrun"};case"heads":return mn(e.ink,e.haloed)}}function Ge(e){return{key:e.key,label:e.text,...e.swatch?{swatch:kn(e.swatch)}:{},...e.strong===void 0?{}:{strong:e.strong},...e.under===void 0?{}:{under:e.under},...e.hover===void 0?{}:{title:e.hover},...e.walk?{walk:e.walk}:{}}}var Ja=e=>e?`\xB7 ${e}`:"",Xt=e=>e>0?`${e.toLocaleString("en-US")} unlabelled`:"";function wn(e){return Xt((e.drawnGraph?.nodes??[]).filter(t=>t.placeholder).length)}function U(e,t){return e.graphKey.find(n=>n.id===t)?.entries.map(({under:n,...r})=>n===""?{...Ge(r),count:"",sizer:wn(e)}:Ge(n===void 0?r:{...r,under:n}))??[]}function Rn(e){let t=e.openBubble;if(!t)return[];let n=e.bubbleHalos.find(r=>G(r.bubble,t));return[{key:"open",label:`open: ${n?.label??"bubble"}`,swatch:n?{kind:"halo",color:T}:{kind:"blank"},closesBubble:!0}]}function xn(e){let t=e.walkLift;if(t)return t.walks.map(o=>Ze(o.encoding));if(e.effectiveColorScheme==="reference-position")return[Q];let n=e.referenceStripBlocks.map(o=>o.colors[0]).filter((o,a,i)=>o!==i[a-1]),r=Math.min(un,n.length);return[r===0?_(O):Array.from({length:r},(o,a)=>({offset:r>1?a/(r-1):0,color:n[r>1?Math.round(a*(n.length-1)/(r-1)):0]}))]}function Pn(e){let t=e.find(r=>r.colors.includes(O))?.colors.indexOf(O),n=t===void 0?void 0:e.map(r=>r.colors[t]).find(r=>r&&r!==O);return n?Ie([n,O,n]):void 0}function yn(e){if(!e.referenceStripShown)return[];let t=e.walkLift?.walks??[],n=t.length>1,r=t.length>0&&Pn(e.referenceStripBlocks);return[{key:"strip",label:n?"reference each walk passes through":t[0]&&!t[0].reference?`reference ${e.liftedWalksLabel} passes through`:"reference",swatch:{kind:"bands",bands:xn(e)}},...e.referenceStripFaded?[t.length>0?{key:"strip-faded",label:`grey where ${n?"a walk":e.liftedWalksLabel} does not pass through`,swatch:{kind:"bands",bands:[r||_(O)]}}:hn("strip-faded",O,"reference outside the open bubble")]:[],...U(e,"overhang")]}function _n(e){let t=e.layoutResult?.tubeMap?Ot(e.graph,e.abridged):void 0;return t?[{key:"tube-not-shown",label:t}]:[]}function Sn(e){let t=e.foldNote;return t?[{key:"fold",label:t}]:[]}function En(e){return e.pathLegend.map(({name:t,label:n,color:r})=>({key:`path-${t}`,label:n,swatch:{kind:"line",color:r}}))}function B(e,t,n){return{key:e,label:n,swatch:{kind:"fill",stops:t,height:Ht,square:!0}}}function Mn(e){let{roles:t,haplotypeTube:n,bundled:r,values:o,logWidths:a,foldBp:i,forwardReads:s,reverseReads:c,substitution:b,insertion:h,deletion:f}=e.tubeMapKeys,d=e.readsShown,u=[];if(o){u.push(B("value-reference",_(Ee),"reference"));for(let{value:k,color:w}of o)u.push(B(`value-${k}`,_(w),k))}return t&&u.push(B("ref",_(Ee),"reference"),B("hap",_(n),r?"shared route, \xD7n haplotypes":"haplotype")),s&&u.push(B("fwd",Ie(fe),"read on the forward strand")),c&&u.push(B("rev",Ie(he),"read on the reverse strand")),d&&d.shown<d.total&&u.push({key:"sampled",label:`${d.shown.toLocaleString("en-US")} of ${d.total.toLocaleString("en-US")} reads shown`,swatch:{kind:"blank"}}),b&&u.push({key:"sub",label:"read mismatch",swatch:{kind:"glyph",char:"A"}}),h&&u.push({key:"ins",label:"read insertion",swatch:{kind:"glyph",char:"*"}}),f&&u.push(B("del",_("grey"),"read deletion")),i!==void 0&&u.push({key:"tube-fold",label:`haplotype variant < ${ze(i)}`,swatch:{kind:"tick",color:Mt(),height:Ht,backing:bn}}),a&&u.push({key:"log",label:"width grows with log of length",swatch:{kind:"bracket"}}),u}function Ln(e){return e.kind==="gene"?{kind:"outline",color:Je,stroke:1.5,radius:0,height:se}:{kind:"fill",stops:e.kind==="bar"&&e.ramp?Q:_(e.fill),height:e.kind==="gap"?e.px:se,...e.kind==="bar"&&e.rim?{rim:e.rim}:{}}}function Cn(e){let t=new Set(e.sharedBlocks?.map(r=>r.block)),n=r=>({kind:"fill",stops:_(ve(r)),height:se});return[...[...t].filter(r=>r<ae).sort((r,o)=>r-o).map(r=>({key:`block-${r}`,label:`${oe(r)}: off the reference, walked by several rows`,swatch:n(r)})),...[...t].some(r=>r>=ae)?[{key:"block-more",label:"more shared blocks",swatch:n(ae)}]:[]]}function An(e){let t=e.walkRowBars;if(!t)return[];let n=[t.reference,...t.rows].flatMap(o=>o.call??[]),r=(o,a,i)=>({key:o,label:i,swatch:{kind:"tick",color:a,height:se}});return[...rt(t,{ramp:e.referenceRampDomain,genes:e.walkRowGeneKey,annotation:e.walkRowAnnotation,...e.rowVisitsNeeded?{comparing:{fetchLimit:Ue}}:{}}).map(o=>({key:`rows-${o.label}`,label:o.label,swatch:o.note?void 0:Ln(o.swatch)})),...Cn(e),...n.some(o=>o.spanningReads!==0)?[r("call",ot,"allele length called for this walk")]:[],...n.some(o=>o.spanningReads===0)?[r("unbacked",at,"called with no read spanning it")]:[],...n.some(o=>o.agrees===!1)?[r("disagrees",st,`walk and call over ${Math.round(.1*100)}% apart`)]:[]]}function Qa(e,t){return Ge(bt(t,e.walkLabel(t.name),e.walkReference))}function es(e){return e.facetPanels?[...U(e,"walks"),...U(e,"skips"),...U(e,"too-small")]:[]}function On(e){let t=(a,i,s)=>({testid:a,rows:e.facetPanels&&i==="walks"?[]:U(e,i),group:s}),n=[{testid:"graph-open-bubble-legend",rows:Rn(e)},t("graph-ramp-legend","ramp","Color"),t("graph-walk-readout","walks","Walks"),t("graph-width-legend","node-width","Node thickness"),t("graph-link-width-legend","link-width","Link thickness"),t("graph-halo-legend","halo","Marks"),t("graph-deletion-legend","skips","Marks"),t("graph-not-shown-legend","not-shown","Marks"),t("graph-gene-legend","exon","Marks"),{testid:"graph-path-legend",rows:En(e),group:"Paths"},{testid:"graph-tube-map-legend",rows:[...Mn(e),..._n(e)],group:"Tube map"},{testid:"graph-walk-rows-legend",rows:An(e),group:"Walk rows"},{testid:"graph-reference-strip-legend",rows:yn(e),group:"Reference strip"},t("graph-compressed-legend","compressed"),{testid:"graph-fold-legend",rows:Sn(e)},t("graph-too-small-legend","too-small")].filter(a=>a.rows.length>0);if(new Set(n.flatMap(a=>a.group??[])).size<2)return n;let o=new Set;return n.map((a,i)=>{let{group:s}=a;return s?o.has(s)?a:(o.add(s),{...a,heading:s}):i===0?a:{...a,spaced:!0}})}function ts(e){let{unlabelled:t}=e.overlayLabels,n=Xt(t?.count??0),r=ut(t);return On(e).map(o=>({...o,rows:o.rows.map(a=>a.count===void 0?a:{...a,count:n,...r?{title:a.title?`${a.title}
4
4
  ${r}`:r}:{}})}))}var Tn="rgba(0, 0, 0, 0.28)";function Kt({id:e,x:t,y:n,stops:r,width:o,height:a,square:i,edged:s,rim:c}){let b=c?ee:s?1:0,h=b/2,f=d=>l("rect",{x:t+h,y:n+h,width:o-h*2,height:a-h*2,rx:i?0:2,fill:d,stroke:c??(s?Tn:void 0),strokeWidth:c?b:void 0});return r.length>1?y(I,{children:[l("defs",{children:l("linearGradient",{id:e,children:r.map((d,u)=>l("stop",{offset:d.offset,stopColor:d.color},u))})}),f(`url(#${e})`)]}):f(r[0].color)}function Nn({swatch:e,x:t,id:n}){switch(e.kind){case"fill":{let o=z(e);return l(Kt,{id:n,x:t,y:-5-o/2,stops:e.stops,width:le(e),height:o,square:e.square,edged:e.edged,rim:e.rim})}case"bands":{let o=Be(e.bands),a=-5-z(e)/2;return l(I,{children:e.bands.map((i,s)=>l(Kt,{id:`${n}-${s}`,x:t,y:a+s*o,stops:i,width:R,height:o,square:!0},s))})}case"line":return e.short?l("line",{x1:t+5,x2:t+R-5,y1:-5,y2:-5,stroke:e.color,strokeWidth:1.5}):e.dashed?l("line",{x1:t+1,x2:t+R,y1:-5,y2:-5,stroke:e.color,strokeWidth:3,strokeDasharray:"4 3"}):l("rect",{x:t,y:-5-1.5,width:R,height:3,rx:2,fill:e.color});case"halo":return l("line",{x1:t+5,x2:t+13,y1:-5,y2:-5,stroke:e.color,strokeOpacity:.35,strokeWidth:8,strokeLinecap:"round"});case"outline":{let o=e.stroke/2;return l("rect",{x:t+o,y:-5-e.height/2+o,width:R-e.stroke,height:e.height-e.stroke,rx:Math.max(0,e.radius-o),fill:"none",stroke:e.color,strokeWidth:e.stroke})}case"overhang":return l("path",{transform:`translate(${t} -10)`,d:"M0,5 L8,0 L8,10 Z M18,5 L10,0 L10,10 Z",fill:"#18181c"});case"overrun":return l("path",{transform:`translate(${t} -10)`,d:"M4,0 L0,9 L8,9 Z M14,10 L10,1 L18,1 Z",fill:"#18181c"});case"glyph":return l("text",{x:t+R/2,y:-1,textAnchor:"middle",fontFamily:"monospace",fontSize:12,fill:"currentColor",children:e.char});case"tick":{let o=-5-e.height/2;return y(I,{children:[e.backing?l("rect",{x:t,y:o,width:R,height:e.height,fill:e.backing}):null,l("rect",{x:t+R/2-1,y:o,width:2,height:e.height,fill:e.color})]})}case"bracket":return l("path",{transform:`translate(${t} ${-5-3.5})`,d:`M0.5,6 V1.5 H5.5 V6 M8.5,6 V1.5 H${R-.5} V6`,fill:"none",stroke:xt()});case"blank":return null;case"threads":return l(I,{children:[-3,0,3].map(o=>l("line",{x1:t,x2:t+R,y1:-5+o,y2:-5+o,stroke:"#444",strokeWidth:K},o))});case"heads":return y("g",{transform:`translate(${t} -5)`,children:[l("line",{x2:R,stroke:e.lane,strokeWidth:e.lanePx}),e.haloPx===void 0?null:l("path",{d:e.heads,fill:"none",stroke:"#ffffff",strokeWidth:e.haloPx,strokeLinejoin:"round"}),l("path",{d:e.heads,fill:e.fill})]})}}var ps=m(function({swatch:t}){let n=D(),r=z(t);return l("svg",{width:le(t),height:r,overflow:"visible",style:{flex:"none"},children:l("g",{transform:`translate(0 ${r/2+5})`,children:l(Nn,{swatch:t,x:0,id:n})})})});function vn(e,t,{lit:n,dpr:r}){let o=t.hostBpFrame;o&&Rt(e,t.referenceStripBlocks,o,{width:t.paneWidth,lit:n,dpr:r})}var In=m(function({model:t}){let n=L((r,o)=>{vn(r,t,{lit:t.referenceStripLit,dpr:o})},[t]);return l(C,{model:t,zIndex:5,shown:t.referenceStripShown,testId:"graph-reference-strip",paint:n})}),gs=In;var Gn=.45;function Bn(e,t,{highlightNode:n}){let r=t.tubeMapPicture,o=t.tubeMapFrame;if(!r||!o)return;let a=t.paneWidth,i=t.tubeMapPanelViews;if(i){Wn(e,t,i,n);return}let s={...o,width:a,highlightNode:n,tubeColors:t.tubeMapTubeColors,nodeColors:t.tubeMapNodeColors};Se(e,r,s);let c=t.layoutResult?.tubeMap;c&&(Me(e,r,c.graph,s),Le(e,c,s)),_e(e,t.tubeMapDeviations,s),At(e,t.tubeMapConnectors,t.connectorZoneBottom,s);let{bounds:b}=r;Pt(e,t.tubeMapGenes,s,o.y(b.minY)-2);let h=t.tubeMapRulerBoxes;h&&ye(e,h,s,o.y(b.maxY)+4,t.layoutResult?.referenceAxis)}function Wn(e,t,n,r){let o=t.paneWidth;for(let s of n){if(s.bottom<0||s.titleTop>t.canvasHeight)continue;let c={...s.frame,width:o,highlightNode:r,tubeColors:s.tubeColors,nodeColors:s.nodeColors};Se(e,s.picture,c),Me(e,s.picture,s.panel.result.tubeMap.graph,c),Le(e,s.panel.result.tubeMap,c),e.globalAlpha=Gn,_e(e,s.deviations,c),e.globalAlpha=1,e.strokeStyle="rgba(0,0,0,0.15)",e.lineWidth=1,e.beginPath(),e.moveTo(0,Math.round(s.titleTop)+.5),e.lineTo(o,Math.round(s.titleTop)+.5),e.stroke(),e.font=Lt,e.textAlign="left",e.textBaseline="top",e.fillStyle="rgba(0,0,0,0.85)",e.fillText(s.label,6,s.titleTop+4)}let a=n.at(-1),i=t.tubeMapPanelRulerBoxes;a&&i&&ye(e,i,{...a.frame,width:o},a.bottom+4,!0)}var Dn=m(function({model:t}){let n=L(r=>{Bn(r,t,{highlightNode:t.selectedNode})},[t]);return l(C,{model:t,zIndex:1,shown:!!t.tubeMapPicture,testId:"graph-tube-map",paint:n})}),Ls=Dn;var W=JBrowseExports["@jbrowse/render-core/marks"],$t=e=>W!=null&&e in Object(W)?W[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/render-core/marks' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e});var Ft=$t("makeAbgrFill");var We=$t("spanMark");var Os=W&&W.__esModule?W.default:W;var Hn=["bars","hollows","gaps","hairlines"],Yt=e=>(e.match(/-?\d*\.?\d+(?:e[-+]?\d+)?/gi)??[]).map(Number);function Ut(e){if(e.startsWith("#")){let o=Number.parseInt(e.slice(1),16);return[o>>16&255,o>>8&255,o&255]}let[t=0,n=0,r=0]=Yt(e);return e.startsWith("hsl")?qe(t,n/100,r/100).map(o=>o*255):[t,n,r]}var zt=([e,t,n])=>je(Math.round(e),Math.round(t),Math.round(n),255),Vt=e=>zt(Ut(e));function Xn(){let e=new Map;return t=>{let n=e.get(t);return n===void 0&&(n=Vt(t),e.set(t,n)),n}}function Kn(e,t,n,r=!1,o=Vt){let a=e.start+e.bp,i=xe(e,t,r);if("fill"in i)return[[e.start,a,o(i.rim??i.fill)]];let s=i.stops.map(Ut),c=i.stops.map(d=>Yt(d)[0]),b=Math.abs(c.at(-1)-c[0]),h=Math.max(1,Math.min(Math.ceil(e.bp*n),Math.ceil(b),e.bp)),f=[];for(let d=0;d<h;d++){let u=(d+.5)/h*(s.length-1),k=Math.min(Math.floor(u),s.length-2),w=s[k],E=s[k+1],x=u-k;f.push([Math.round(e.start+e.bp*d/h),Math.round(e.start+e.bp*(d+1)/h),zt([0,1,2].map(p=>w[p]+(E[p]-w[p])*x))])}return f}function pe(e){return{x:new Uint32Array(e),x2:new Uint32Array(e),row:new Uint32Array(e),color:new Uint32Array(e),inner:new Uint32Array(e),count:0}}function $n(e,t,n){return{x:e.x.subarray(t,n),x2:e.x2.subarray(t,n),row:e.row.subarray(t,n),color:e.color.subarray(t,n),inner:e.inner.subarray(t,n),count:n-t}}function Fn(e,t,n,r){let o=xe(e,t,n);return"fill"in o&&o.rim!==void 0?r(o.fill):void 0}var Yn=(e,t)=>e.gap?nt(e.cause).px===Re?"hairlines":"gaps":t===void 0?"bars":"hollows";function jt(e,t,n,r=!1){let o=Xn(),a=e.map(h=>it(h.runs,t,r).map(f=>{let d=Fn(f,n,r,o);return{kind:Yn(f,d),inner:d??0,pieces:Kn(f,n,t,r,o)}})),i={bars:0,hollows:0,gaps:0,hairlines:0};for(let h of a)for(let f of h)i[f.kind]+=f.pieces.length;let s={bars:pe(i.bars),hollows:pe(i.hollows),gaps:pe(i.gaps),hairlines:pe(i.hairlines)},c={bars:new Uint32Array(e.length+1),hollows:new Uint32Array(e.length+1),gaps:new Uint32Array(e.length+1),hairlines:new Uint32Array(e.length+1)},b=1;return a.forEach((h,f)=>{for(let d of h){let u=s[d.kind];for(let[k,w,E]of d.pieces){let x=u.count++;u.x[x]=k,u.x2[x]=w,u.row[x]=f,u.color[x]=E,u.inner[x]=d.inner,b=Math.max(b,w)}}for(let d of Hn)c[d][f+1]=s[d].count}),{...s,barRows:c.bars,hollowRows:c.hollows,gapRows:c.gaps,hairlineRows:c.hairlines,longest:b}}function Un(e,t,n){let r=ee,o=Ft(e);for(let a=0;a<t.count;a++){let i=n(a);i&&i.width>2*r&&i.height>2*r&&(o(t.inner[a]),e.fillRect(i.left+r,i.top+r,i.width-2*r,i.height-2*r))}}function qt(e,t,n){let{longest:r}=t,o={start:0,end:r,screenStartPx:n.origin*n.scaleX+n.translateX,screenEndPx:(n.origin+r)*n.scaleX+n.translateX,reversed:!1,displayedRegionIndex:0},a={canvasWidth:n.width,canvasHeight:n.height},i=n.rowPx*n.scaleY;for(let{first:s,count:c,rowY:b}of n.blocks){let h=i/2-n.translateY-(b-s*n.rowPx)*n.scaleY,f=(b-n.rowPx/2)*n.scaleY+n.translateY;if(!(f>n.height||f+c*i<0))for(let[d,u,k]of[[t.bars,t.barRows,n.barPx],[t.hollows,t.hollowRows,n.barPx],[t.gaps,t.gapRows,Math.min(et,n.barPx)],[t.hairlines,t.hairlineRows,Math.min(Re,n.barPx)]]){let w=$n(d,u[s],u[s+c]),E={rowHeight:i,rowProportion:k/i,minWidthPx:1,seamPx:0,scrollTop:h};We.paintBlock(e,w,o,a,E),d===t.hollows&&Un(e,w,x=>We.ink?.(w,o,a,E,x))}}}var zn=m(function({model:t}){let n=be(()=>j(()=>t.walkRowBars?jt(t.walkRowList,t.scaleX,t.referenceRampDomain):void 0),[t]),r=L(o=>{let a=t.walkRowBars,i=t.walkRowPlacement,s=t.walkRowPitch,c=n.get();!a||!i||!s||!c||qt(o,c,{...t.screenTransform,width:t.drawingWidth,height:t.canvasHeight,rowPx:s.rowPx,barPx:s.barPx,origin:a.origin,blocks:i.blocks(a.rows.length+1)})},[t,n]);return l(C,{model:t,zIndex:3,testId:"graph-walk-rows-spans",paint:r})}),Vn="rgba(160, 196, 232, 0.55)",jn="rgba(160, 140, 220, 0.55)",qn=m(function({model:t}){let n=L(r=>{let o=t.walkRowRibbons,a=t.walkRowBars,i=t.walkRowPlacement,s=t.walkRowPitch;if(!o||!a||!i||!s)return;let{scaleX:c,scaleY:b,translateX:h,translateY:f}=t.screenTransform,d=k=>(a.origin+k)*c+h,u=s.barPx/2;for(let{row:k,a0:w,a1:E,b0:x,b1:p}of o){let g=i.rowY(k)*b+f+u,P=i.rowY(k+1)*b+f-u;r.fillStyle=x>p?jn:Vn,r.beginPath(),r.moveTo(d(w),g),r.lineTo(d(E),g),r.lineTo(d(p),P),r.lineTo(d(x),P),r.closePath(),r.fill()}},[t]);return l(C,{model:t,zIndex:2,testId:"graph-walk-rows-ribbons",paint:n})}),Zn=m(function({model:t}){let n=L(r=>{let o=t.sharedBlocks,a=t.walkRowBars,i=t.walkRowPlacement,s=t.walkRowPitch;if(!o||!a||!i||!s)return;let{scaleX:c,scaleY:b,translateX:h,translateY:f}=t.screenTransform;Bt(r,o,{x:d=>(a.origin+d)*c+h,rowCentre:d=>i.rowY(d)*b+f,barPx:s.barPx})},[t]);return l(C,{model:t,zIndex:3,testId:"graph-walk-rows-blocks",paint:n})}),Jn=m(function({model:t}){let n=t.walkRowBars,r=t.walkRowPlacement,o=t.walkRowPitch;if(!n||!r||!o||!t.hoveredWalkRowText)return null;let a=t.walkRowList,i=a.findIndex(b=>b.name===t.hoveredWalkRow),s=a[i];if(!s)return null;let c=t.toScreen({x:n.origin,y:r.rowY(i)});return l("rect",{"data-testid":"graph-walk-row-hovered",x:c.x-2,y:c.y-o.rowPx/2-1,width:tt(s)*t.scaleX+4,height:o.rowPx+2,fill:"none",stroke:"#111",strokeWidth:1})});function Qn(e,t,n){let r=()=>({translateX:e.translateX,translateY:e.translateY}),o=(i,s)=>({scaleX:e.scaleX,scaleY:e.scaleY,translateX:s.translateX,translateY:s.translateY,width:e.drawingWidth,height:e.canvasHeight,...i,bars:n,measure:yt}),a=j(()=>{let i=e.walkRowBars,s=e.walkRowPlacement,c=e.walkRowPitch;return i&&s&&c?Et(i,s.rowY,o(c,r()),{comparing:e.rowVisitsNeeded}):void 0});return j(()=>{let i=e.walkRowBars,s=e.walkRowPlacement,c=e.walkRowPitch;te(a.get());let b=Xe(r);return i&&s&&c?{at:b,trees:St(i,e.walkRowGroups?.sections??[],s.rowY,o(c,b),{ramp:e.referenceRampDomain,rowGenes:e.walkRowGenes,idPrefix:t,comparing:e.rowVisitsNeeded})}:void 0})}var er=m(function({model:t}){return t.walkRowPlacement?.headers.map(n=>l("text",{x:10,y:t.toScreen({x:0,y:n.top}).y+_t-4,fontFamily:"sans-serif",fontSize:11,fontWeight:"bold",fill:"#333","data-testid":"graph-walk-section",children:n.title},n.key))}),tr=m(function({model:t,vector:n=!1}){let r=D(),o=be(()=>Qn(t,r,n),[t,r,n]).get();return o?y(I,{children:[n||!t.walkRowRibbons?null:l(qn,{model:t}),n?null:l(zn,{model:t}),n||!t.sharedBlocks?null:l(Zn,{model:t}),y(N,{model:t,zIndex:3,overflow:"visible",testId:"graph-walk-rows",children:[l(Nt,{model:t,drawnAt:o.at,children:o.trees.map((a,i)=>l(F,{el:a},i))}),l(er,{model:t}),l(Jn,{model:t})]})]}):null}),js=tr;var Js={background:"#fff",padding:"3px 6px",fontSize:11,lineHeight:"15px",whiteSpace:"nowrap"},Qs={display:"flex",alignItems:"center",gap:5},nr=260,ei={color:"#666",maxWidth:nr,whiteSpace:"normal"},rr="#6b7479",ti=4,ni={color:rr,fontSize:9.5,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase"};export{Jt as a,Tt as b,N as c,Gr as d,tn as e,Fr as f,D as g,F as h,to as i,re as j,yo as k,_o as l,le as m,qa as n,Za as o,Ja as p,Ln as q,Qa as r,es as s,On as t,ts as u,Nn as v,ps as w,vn as x,gs as y,Bn as z,Ls as A,js as B,Js as C,Qs as D,ei as E,rr as F,ti as G,ni as H};
5
- //# sourceMappingURL=chunk-TM22QR6V.js.map
5
+ //# sourceMappingURL=chunk-D7OYDVIT.js.map