"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[2367],{21016:(t,e,l)=>{l.d(e,{K:()=>c});var n=l(87485),s=l(46879);function c(t,e,l,c,f,i,a){e.fillStyle=function(t,e){const l=t.length;let s=0,c=0,f=0,i=0;for(const l of t)l===e?s++:"0"===l?i++:"."===l?c++:f++;if(i===l)return"#ccc";{let t=(0,n.M)(`hsl(200,50%,${80-s/l*50}%)`);return f&&(t=t.mix(`hsla(0,100%,20%,${f/l})`)),c&&(t=t.mix(`hsla(50,50%,50%,${c/l/2})`)),t.toHex()}}(t,a),e.fillRect(l-s.f2,c-s.f2,f+s.f2,i+s.f2)}},22367:(t,e,l)=>{l.d(e,{makeImageData:()=>a});var n=l(99546),s=l(46879),c=l(21016),f=l(40171),i=l(85497);async function a({ctx:t,canvasWidth:e,canvasHeight:l,renderArgs:a}){const{renderingMode:o,minorAlleleFrequencyFilter:r,sources:u,features:h}=a,{statusCallback:g=()=>{}}=a,d=l/u.length,p=(0,i.Cg)(h.values(),r),b=[],m=p.length,k=e/m;return await(0,n.updateStatus)("Drawing variant matrix",g,(()=>{for(let n=0;n<m;n++){const i=[],{feature:a,mostFrequentAlt:r}=p[n];if(a.get("format").includes("PS")){const h=a.get("samples"),g=n/p.length*e,b=u.length;for(let e=0;e<b;e++){const n=e/b*l,{name:a,HP:p}=u[e],m=h[a];if(m){const e=m.GT?.[0];if(e){i.push(e);const l=e.includes("|");if("phased"===o)if(l){const l=m.PS?.[0],s=e.split("|");(0,f.E)(s,t,g,n,k,d,p,l)}else t.fillStyle="black",t.fillRect(g-s.f2,n-s.f2,k+s.f2,d+s.f2);else{const l=e.split(/[/|]/);(0,c.K)(l,t,g,n,k,d,r)}}}}}else{const h=a.get("genotypes"),g=n/p.length*e,b=u.length;for(let e=0;e<b;e++){const n=e/b*l,{name:a,HP:p}=u[e],m=h[a];if(m){i.push(m);const e=m.includes("|");if("phased"===o)if(e){const e=m.split("|");(0,f.E)(e,t,g,n,k,d,p)}else t.fillStyle="black",t.fillRect(g-s.f2,n-s.f2,k+s.f2,d+s.f2);else{const e=m.split(/[/|]/);(0,c.K)(e,t,g,n,k,d,r)}}}}b.push(i)}})),{mafs:p,arr:b}}},40171:(t,e,l)=>{l.d(e,{E:()=>f});var n=l(40898),s=l(46879),c=l(42268);function f(t,e,l,f,i,a,o,r){e.fillStyle=void 0!==r?function(t,e,l){return+t[e]?(0,c.qH)(+l)||"black":"#ccc"}(t,o,r):function(t,e){const l=+t[e];return l?n.set1[l-1]||"black":"#ccc"}(t,o),e.fillRect(l-s.f2,f-s.f2,i+s.f2,a+s.f2)}},42268:(t,e,l)=>{function n(t){let e=0;for(let l=0;l<t.length;l++)e+=t.charCodeAt(l);return s(10*e)}function s(t){return`hsl(${t%255}, 50%, 50%)`}l.d(e,{XL:()=>n,qH:()=>s})},46879:(t,e,l)=>{l.d(e,{f2:()=>n});const n=.3}}]);
//# sourceMappingURL=2367.821bc043.chunk.js.map