"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[9978],{21016:(e,t,n)=>{n.d(t,{K:()=>c});var l=n(87485),o=n(46879);function c(e,t,n,c,f,r,s){t.fillStyle=function(e,t){const n=e.length;let o=0,c=0,f=0,r=0;for(const n of e)n===t?o++:"0"===n?r++:"."===n?c++:f++;if(r===n)return"#ccc";{let e;if(o&&(e=(0,l.M)(`hsl(200,50%,${80-o/n*50}%)`)),f){const t=`hsla(0,100%,20%,${f/n})`;e=e?e.mix(t):(0,l.M)(t)}if(c){const t=`hsl(50,50%,50%,${c/n})`;e=e?e.mix(t):(0,l.M)(t)}return e?.toHex()||"black"}}(e,s),t.fillRect(n-o.f2,c-o.f2,f+o.f2,r+o.f2)}},40171:(e,t,n)=>{n.d(t,{E:()=>f});var l=n(40898),o=n(46879),c=n(42268);function f(e,t,n,f,r,s,i,a){t.fillStyle=void 0!==a?function(e,t,n){return+e[t]?(0,c.qH)(+n)||"black":"#ccc"}(e,i,a):function(e,t){const n=+e[t];return n?l.set1[n-1]||"black":"#ccc"}(e,i),t.fillRect(n-o.f2,f-o.f2,r+o.f2,s+o.f2)}},42268:(e,t,n)=>{function l(e){let t=0;for(let n=0;n<e.length;n++)t+=e.charCodeAt(n);return o(10*t)}function o(e){return`hsl(${e%255}, 50%, 50%)`}n.d(t,{XL:()=>l,qH:()=>o})},46879:(e,t,n)=>{n.d(t,{f2:()=>l});const l=.3},99978:(e,t,n)=>{n.d(t,{makeImageData:()=>a});var l=n(99546),o=n(22593),c=n.n(o),f=n(46879),r=n(21016),s=n(40171),i=n(85497);async function a(e,t){const{scrollTop:n,minorAlleleFrequencyFilter:o,sources:a,rowHeight:u,features:h,regions:b,bpPerPx:g,renderingMode:m}=t,d=b[0],p=(0,i.Cg)(h.values(),o),k=new(c());for(const{mostFrequentAlt:t,feature:o}of p){const[c,i]=(0,l.featureSpanPx)(o,d,g),h=Math.max(Math.round(i-c),2),b=o.get("genotypes");let p=-n;const x=a.length;for(let n=0;n<x;n++){const{name:l,HP:o}=a[n],i=b[l],g=Math.floor(c),d=Math.max(u,1);if(i){k.insert({minX:g-f.f2,maxX:g+h+f.f2,minY:p-f.f2,maxY:p+d+f.f2,genotype:i});const n=i.includes("|");if("phased"===m)if(n){const t=i.split("|");(0,s.E)(t,e,g,p,h,d,o)}else e.fillStyle="black",e.fillRect(g-f.f2,p-f.f2,h+f.f2,d+f.f2);else{const n=i.split(/[/|]/);(0,r.K)(n,e,g,p,h,d,t)}}p+=u}}return{rbush:k.toJSON()}}}}]);
//# sourceMappingURL=9978.6786b196.chunk.js.map