"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[7126],{53740:(e,t,n)=>{n.d(t,{A:()=>g});var o=n(7552),r=n(68446),a=n(99546),s=n(68584),l=n(72241),i=n(9502);function c(e,t){const n=t?(0,i.h)(t):void 0;let o=e.get("start"),r=e.get("end");const a=e.get("strand"),s=e.get("mate"),l=e.get("refName");let c,m=0,d=0,u=0,g=0;if(["<TRA","<DEL","<INV","<INS","<DUP","<CNV"].some((e=>t?.startsWith(e)))){const t=e.get("INFO"),n=t?.END?.[0]??r;c=t?.CHR2?.[0]??l,m=n,d=n-1,r=o+1}else if(n?.MatePosition){const e=n.MatePosition.split(":");g="left"===n.MateDirection?1:-1,u="left"===n.Join?-1:1,m=+e[1],d=+e[1]-1,c=e[0]}return{k1:{refName:l,start:o,end:r,strand:a,mateDirection:g},k2:s??{refName:c,end:m,start:d,mateDirection:u}}}function m(e,t){const{k1:n,k2:o}=c(e,t);return[e.get("name"),e.get("id"),(0,a.assembleLocString)(n),(0,a.assembleLocString)(o),e.get("INFO")?.SVTYPE,t].filter((e=>!!e)).join(" - ")}const d=(0,r.observer)((function({model:e,feature:t,alt:n,assembly:r,view:a}){const[i,d]=(0,o.useState)(!1),{height:u}=e,{k1:g,k2:f}=c(t,n),b=(0,o.useRef)(null),h=(0,s.getConf)(e,"color",{feature:t,alt:n}),k=r.getCanonicalRefName(g.refName)||g.refName,p=r.getCanonicalRefName(f.refName)||f.refName,v=g.start,E=f.start,x=a.bpToPx({refName:k,coord:v})?.offsetPx,N=a.bpToPx({refName:p,coord:E})?.offsetPx;if(void 0!==x&&void 0!==N){const r=(N-x)/2,s=Math.abs(r),c=Math.min(u,s),k=x-a.offsetPx,p=N-a.offsetPx,v=i?"black":h,E=3;return s>1?o.createElement(o.Fragment,null,o.createElement("path",{d:`M ${k} 0 C ${k} ${c}, ${p} ${c}, ${p} 0`,ref:b,stroke:v,strokeWidth:E,onMouseOut:()=>d(!1),onMouseOver:()=>d(!0),onClick:()=>e.selectFeature(t),fill:"none",pointerEvents:"stroke"}),void 0!==g.mateDirection?o.createElement("line",{stroke:v,strokeWidth:E,onMouseOut:()=>d(!1),onMouseOver:()=>d(!0),onClick:()=>e.selectFeature(t),x1:k,x2:k+20*g.mateDirection,y1:1.5,y2:1.5}):null,void 0!==f.mateDirection?o.createElement("line",{stroke:v,strokeWidth:E,onMouseOut:()=>d(!1),onMouseOver:()=>d(!0),onClick:()=>e.selectFeature(t),x1:p,x2:p+20*f.mateDirection,y1:1.5,y2:1.5}):null,i?o.createElement(l.A,{contents:m(t,n)}):null):null}return null})),u=(0,r.observer)((function({model:e,exportSVG:t,children:n}){const{height:r}=e,s=(0,a.getContainingView)(e),l=Math.round(s.dynamicBlocks.totalWidthPx);return t?o.createElement(o.Fragment,null,n):o.createElement("svg",{width:l,height:r},n)})),g=(0,r.observer)((function({model:e,exportSVG:t}){const n=(0,a.getContainingView)(e),r=(0,a.getSession)(e),{assemblyManager:s}=r,{features:l}=e,i=s.get(n.assemblyNames[0]);return i?o.createElement(u,{model:e,exportSVG:t},l?.map((t=>{const a=t.get("ALT");return a?.map((a=>o.createElement(d,{key:t.id()+"-"+a,session:r,feature:t,alt:a,view:n,model:e,assembly:i})))??o.createElement(d,{key:t.id(),session:r,feature:t,view:n,model:e,assembly:i})}))):null}))},87126:(e,t,n)=>{n.r(t),n.d(t,{default:()=>g});var o=n(7552),r=n(68446),a=n(48735),s=n(68666);const l=(0,n(75785).n9)()((e=>({loading:{backgroundColor:e.palette.background.default,backgroundImage:`repeating-linear-gradient(45deg, transparent, transparent 5px, ${e.palette.action.disabledBackground} 5px, ${e.palette.action.disabledBackground} 10px)`,position:"absolute",bottom:0,height:50,width:300,right:0,pointerEvents:"none",textAlign:"center"}}))),i=(0,r.observer)((function({model:e,children:t}){const{error:n,regionTooLarge:r}=e;return n?o.createElement(s.LW,{message:`${n}`,severity:"error",buttonText:"Reload",action:e.reload}):r?e.regionCannotBeRendered():o.createElement(c,{model:e},t)})),c=(0,r.observer)((function({model:e,children:t}){const{loading:n}=e;return o.createElement("div",null,t,n?o.createElement(m,{model:e}):null)})),m=(0,r.observer)((function({model:e}){const{classes:t}=l(),{message:n}=e;return o.createElement("div",{className:t.loading},o.createElement(a.LoadingEllipses,{message:n}))})),d=i;var u=n(53740);const g=(0,r.observer)((function({model:e,exportSVG:t}){return o.createElement(d,{model:e},o.createElement(u.A,{model:e,exportSVG:t}))}))}}]);
//# sourceMappingURL=7126.4826ca80.chunk.js.map