"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[9141],{2363:(e,t,n)=>{n.d(t,{Z:()=>v});var o=n(41867),r=n(3762),l=n(90872),s=n(43800),a=n(98303),i=n(11233),d=n(80838);function c(e,t){const n=t?(0,a.I)(t):void 0;let o=e.get("start"),r=e.get("end");const l=e.get("strand"),s=e.get("mate"),i=e.get("refName");let d,c=0,u=0;if(["<TRA","<DEL","<INV","<INS","<DUP","<CNV"].some((e=>null===t||void 0===t?void 0:t.startsWith(e)))){var g,f,m,v,x;const t=(null===(g=e.get("INFO"))||void 0===g||null===(f=g.END)||void 0===f?void 0:f[0])||e.get("end");c=t,u=t-1,d=null!==(m=null===(v=e.get("INFO"))||void 0===v||null===(x=v.CHR2)||void 0===x?void 0:x[0])&&void 0!==m?m:i,o=e.get("start"),r=e.get("start")+1}else if(null!==n&&void 0!==n&&n.MatePosition){const e=n.MatePosition.split(":");c=+e[1],u=+e[1]-1,d=e[0]}return{k1:{refName:i,start:o,end:r,strand:l},k2:null!==s&&void 0!==s?s:{refName:d,end:c,start:u}}}const u=o.forwardRef((function(e,t){let{feature:n,alt:o}=e;const r=function(e,t){var n;const{k1:o,k2:r}=c(e,t);return[e.get("name"),e.get("id"),(0,l.assembleLocString)(o),(0,l.assembleLocString)(r),null===(n=e.get("INFO"))||void 0===n?void 0:n.SVTYPE,t].filter((e=>!!e)).join(" - ")}(n,o),s=20+(0,l.measureText)(r);return null!==t?(0,d.jsxs)(i.u,{triggerRef:t,children:[(0,d.jsx)("rect",{x:12,y:0,width:s,height:20,rx:5,ry:5,fill:"black",fillOpacity:"50%"}),(0,d.jsx)("text",{x:22,y:14,fontSize:10,fill:"white",textLength:s-20,children:r})]}):null})),g=(0,r.observer)((function(e){var t,n;let{model:r,feature:l,alt:a,assembly:i,view:g}=e;const[f,m]=(0,o.useState)(!1),{height:v}=r,{k1:x,k2:h}=c(l,a),b=(0,o.useRef)(null),p=(0,s.getConf)(r,"color",{feature:l,alt:a}),j=i.getCanonicalRefName(x.refName)||x.refName,k=i.getCanonicalRefName(h.refName)||h.refName,N=x.start,w=h.start,C=null===(t=g.bpToPx({refName:j,coord:N}))||void 0===t?void 0:t.offsetPx,S=null===(n=g.bpToPx({refName:k,coord:w}))||void 0===n?void 0:n.offsetPx;if(void 0!==C&&void 0!==S){const e=(S-C)/2,t=Math.abs(e),n=Math.min(v,t),o=C-g.offsetPx,s=S-g.offsetPx;return t>1?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M ".concat(o," 0 C ").concat(o," ").concat(n,", ").concat(s," ").concat(n,", ").concat(s," 0"),ref:b,stroke:f?"black":p,strokeWidth:3,onMouseOut:()=>m(!1),onMouseOver:()=>m(!0),onClick:()=>r.selectFeature(l),fill:"none",pointerEvents:"stroke"}),f?(0,d.jsx)(u,{feature:l,alt:a,ref:b}):null]}):null}return null})),f=(0,r.observer)((function(e){let{model:t,exportSVG:n,children:o}=e;const{height:r}=t,s=(0,l.getContainingView)(t),a=Math.round(s.dynamicBlocks.totalWidthPx);return n?(0,d.jsx)(d.Fragment,{children:o}):(0,d.jsx)("svg",{width:a,height:r,children:o})})),m=(0,r.observer)((function(e){let{model:t,exportSVG:n}=e;const o=(0,l.getContainingView)(t),r=(0,l.getSession)(t),{assemblyManager:s}=r,{features:a}=t,i=s.get(o.assemblyNames[0]);return i?(0,d.jsx)(f,{model:t,exportSVG:n,children:null===a||void 0===a?void 0:a.map((e=>{var n;const l=e.get("ALT");return null!==(n=null===l||void 0===l?void 0:l.map((n=>(0,d.jsx)(g,{session:r,feature:e,alt:n,view:o,model:t,assembly:i},e.id()+"-"+n))))&&void 0!==n?n:(0,d.jsx)(g,{session:r,feature:e,view:o,model:t,assembly:i},e.id())}))}):null})),v=m},59141:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});n(41867);var o=n(3762),r=n(35421),l=n(4592),s=n(47192),a=n(80838);const i=(0,s.ZL)()((e=>({loading:{backgroundColor:e.palette.background.default,backgroundImage:"repeating-linear-gradient(45deg, transparent, transparent 5px, ".concat(e.palette.action.disabledBackground," 5px, ").concat(e.palette.action.disabledBackground," 10px)"),position:"absolute",bottom:0,height:50,width:300,right:0,pointerEvents:"none",textAlign:"center"}}))),d=(0,o.observer)((function(e){let{model:t,children:n}=e;const{error:o,regionTooLarge:r}=t;return o?(0,a.jsx)(l.rK,{message:"".concat(o),severity:"error",buttonText:"Reload",action:t.reload}):r?t.regionCannotBeRendered():(0,a.jsx)(c,{model:t,children:n})})),c=(0,o.observer)((function(e){let{model:t,children:n}=e;const{loading:o}=t;return(0,a.jsxs)("div",{children:[n,o?(0,a.jsx)(u,{model:t}):null]})})),u=(0,o.observer)((function(e){let{model:t}=e;const{classes:n}=i(),{message:o}=t;return(0,a.jsx)("div",{className:n.loading,children:(0,a.jsx)(r.LoadingEllipses,{message:o})})})),g=d;var f=n(2363);const m=(0,o.observer)((function(e){let{model:t,exportSVG:n}=e;return(0,a.jsx)(g,{model:t,children:(0,a.jsx)(f.Z,{model:t,exportSVG:n})})}))}}]);
//# sourceMappingURL=9141.7b7d88b4.chunk.js.map