"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[7126],{53740:(e,t,n)=>{n.d(t,{A:()=>f});var o=n(7552),r=n(68584),s=n(99546),i=n(68446),a=n(350);function l(e,t){const n=t?(0,a.h)(t):void 0,o=e.get("start");let r=e.get("end");const s=e.get("strand"),i=e.get("mate"),l=e.get("refName");let c,d=0,u=0,g=0,m=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,d=n,u=n-1,r=o+1}else if(n?.MatePosition){const e=n.MatePosition.split(":");m="left"===n.MateDirection?1:-1,g="left"===n.Join?-1:1,d=+e[1],u=+e[1]-1,c=e[0]}return{k1:{refName:l,start:o,end:r,strand:s,mateDirection:m},k2:i??{refName:c||"unknown",end:d,start:u,mateDirection:g}}}function c(e,t){const{k1:n,k2:o}=l(e,t);return[e.get("name"),e.get("id"),(0,s.assembleLocString)(n),(0,s.assembleLocString)(o),e.get("INFO")?.SVTYPE,t].filter(e=>!!e).join("<br/>")}var d=n(69500);const u=(0,o.lazy)(()=>n.e(2241).then(n.bind(n,72241))),g=(0,i.observer)(function({model:e,feature:t,alt:n,assembly:i,view:a}){const[g,m]=(0,o.useState)(!1),{height:f}=e,{k1:h,k2:x}=l(t,n),b=(0,o.useRef)(null),k=(0,r.getConf)(e,"color",{feature:t,alt:n}),p=i.getCanonicalRefName(h.refName)||h.refName,j=i.getCanonicalRefName(x.refName)||x.refName,v=h.start,N=x.start,C=a.bpToPx({refName:p,coord:v})?.offsetPx,S=a.bpToPx({refName:j,coord:N})?.offsetPx;if(void 0!==C&&void 0!==S){const r=(S-C)/2,i=Math.abs(r),l=Math.min(f,i),p=C-a.offsetPx,j=S-a.offsetPx,v=g?"black":k,N=3;return i>1?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:`M ${p} 0 C ${p} ${l}, ${j} ${l}, ${j} 0`,ref:b,...(0,s.getStrokeProps)(v),strokeWidth:N,onMouseOut:()=>{m(!1)},onMouseOver:()=>{m(!0)},onClick:()=>{e.selectFeature(t)},fill:"none",pointerEvents:"stroke"}),h.mateDirection?(0,d.jsx)("line",{...(0,s.getStrokeProps)(v),strokeWidth:N,onMouseOut:()=>{m(!1)},onMouseOver:()=>{m(!0)},onClick:()=>{e.selectFeature(t)},x1:p,x2:p+20*h.mateDirection,y1:1.5,y2:1.5}):null,x.mateDirection?(0,d.jsx)("line",{...(0,s.getStrokeProps)(v),strokeWidth:N,onMouseOut:()=>{m(!1)},onMouseOver:()=>{m(!0)},onClick:()=>{e.selectFeature(t)},x1:j,x2:j+20*x.mateDirection,y1:1.5,y2:1.5}):null,g?(0,d.jsx)(o.Suspense,{fallback:null,children:(0,d.jsx)(u,{contents:c(t,n)})}):null]}):null}return null}),m=(0,i.observer)(function({model:e,exportSVG:t,children:n}){const{height:o}=e,r=(0,s.getContainingView)(e),i=Math.round(r.dynamicBlocks.totalWidthPx);return t?n:(0,d.jsx)("svg",{width:i,height:o,children:n})}),f=(0,i.observer)(function({model:e,exportSVG:t}){const n=(0,s.getContainingView)(e),o=(0,s.getSession)(e),{assemblyManager:r}=o,{features:i}=e,a=r.get(n.assemblyNames[0]);return a?(0,d.jsx)(m,{model:e,exportSVG:t,children:i?.map(t=>{const r=t.get("ALT");return r?.map(r=>(0,d.jsx)(g,{session:o,feature:t,alt:r,view:n,model:e,assembly:a},`${t.id()}-${r}`))??(0,d.jsx)(g,{session:o,feature:t,view:n,model:e,assembly:a},t.id())})}):null})},87126:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var o=n(68446),r=n(53740),s=n(7552),i=n(67112),a=n(99546),l=n(53179),c=n(98231),d=n(65468),u=n(37962),g=n(89870),m=n(75785),f=n(69500);const h=(0,s.lazy)(()=>Promise.all([n.e(1631),n.e(4630)]).then(n.bind(n,74630))),x=(0,m.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"}})),b=(0,o.observer)(function({model:e,children:t}){const{error:n,regionTooLarge:o}=e;return n?(0,f.jsx)(l.LW,{message:`${n}`,severity:"error",action:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(u.A,{title:"Reload",children:(0,f.jsx)(g.A,{"data-testid":"reload_button",onClick:()=>{e.reload()},children:(0,f.jsx)(c.A,{})})}),(0,f.jsx)(u.A,{title:"Show stack trace",children:(0,f.jsx)(g.A,{onClick:()=>{(0,a.getSession)(e).queueDialog(t=>[h,{onClose:t,error:e.error}])},children:(0,f.jsx)(d.A,{})})})]})}):o?e.regionCannotBeRendered():(0,f.jsx)(k,{model:e,children:t})}),k=(0,o.observer)(function({model:e,children:t}){const{loading:n}=e;return(0,f.jsxs)("div",{children:[t,n?(0,f.jsx)(p,{model:e}):null]})}),p=(0,o.observer)(function({model:e}){const{classes:t}=x(),{message:n}=e;return(0,f.jsx)("div",{className:t.loading,children:(0,f.jsx)(i.LoadingEllipses,{message:n})})}),j=b,v=(0,o.observer)(function({model:e,exportSVG:t}){return(0,f.jsx)(j,{model:e,children:(0,f.jsx)(r.A,{model:e,exportSVG:t})})})}}]);
//# sourceMappingURL=7126.5105f729.chunk.js.map