"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[9141],{2363:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(66204),a=n(80846),o=n(90872),l=n(43800),s=n(25086),i=n(94924);function c(e,t){const n=t?(0,s.I)(t):void 0;let r=e.get("start"),a=e.get("end");const o=e.get("strand"),l=e.get("mate"),i=e.get("refName");let c,m=0,d=0;if(["<TRA","<DEL","<INV","<INS","<DUP","<CNV"].some((e=>t?.startsWith(e)))){const t=e.get("INFO")?.END?.[0]||e.get("end");m=t,d=t-1,c=e.get("INFO")?.CHR2?.[0]??i,r=e.get("start"),a=e.get("start")+1}else if(n?.MatePosition){const e=n.MatePosition.split(":");m=+e[1],d=+e[1]-1,c=e[0]}return{k1:{refName:i,start:r,end:a,strand:o},k2:l??{refName:c,end:m,start:d}}}const m=r.forwardRef((function({feature:e,alt:t},n){const a=function(e,t){const{k1:n,k2:r}=c(e,t);return[e.get("name"),e.get("id"),(0,o.assembleLocString)(n),(0,o.assembleLocString)(r),e.get("INFO")?.SVTYPE,t].filter((e=>!!e)).join(" - ")}(e,t),l=20+(0,o.measureText)(a);return null!==n?r.createElement(i.u,{triggerRef:n},r.createElement("rect",{x:12,y:0,width:l,height:20,rx:5,ry:5,fill:"black",fillOpacity:"50%"}),r.createElement("text",{x:22,y:14,fontSize:10,fill:"white",textLength:l-20},a)):null})),d=(0,a.observer)((function({model:e,feature:t,alt:n,assembly:a,view:o}){const[s,i]=(0,r.useState)(!1),{height:d}=e,{k1:u,k2:g}=c(t,n),f=(0,r.useRef)(null),b=(0,l.getConf)(e,"color",{feature:t,alt:n}),h=a.getCanonicalRefName(u.refName)||u.refName,p=a.getCanonicalRefName(g.refName)||g.refName,E=u.start,k=g.start,v=o.bpToPx({refName:h,coord:E})?.offsetPx,x=o.bpToPx({refName:p,coord:k})?.offsetPx;if(void 0!==v&&void 0!==x){const a=(x-v)/2,l=Math.abs(a),c=Math.min(d,l),u=v-o.offsetPx,g=x-o.offsetPx;return l>1?r.createElement(r.Fragment,null,r.createElement("path",{d:`M ${u} 0 C ${u} ${c}, ${g} ${c}, ${g} 0`,ref:f,stroke:s?"black":b,strokeWidth:3,onMouseOut:()=>i(!1),onMouseOver:()=>i(!0),onClick:()=>e.selectFeature(t),fill:"none",pointerEvents:"stroke"}),s?r.createElement(m,{feature:t,alt:n,ref:f}):null):null}return null})),u=(0,a.observer)((function({model:e,exportSVG:t,children:n}){const{height:a}=e,l=(0,o.getContainingView)(e),s=Math.round(l.dynamicBlocks.totalWidthPx);return t?r.createElement(r.Fragment,null,n):r.createElement("svg",{width:s,height:a},n)})),g=(0,a.observer)((function({model:e,exportSVG:t}){const n=(0,o.getContainingView)(e),a=(0,o.getSession)(e),{assemblyManager:l}=a,{features:s}=e,i=l.get(n.assemblyNames[0]);return i?r.createElement(u,{model:e,exportSVG:t},s?.map((t=>{const o=t.get("ALT");return o?.map((o=>r.createElement(d,{key:t.id()+"-"+o,session:a,feature:t,alt:o,view:n,model:e,assembly:i})))??r.createElement(d,{key:t.id(),session:a,feature:t,view:n,model:e,assembly:i})}))):null})),f=g},59141:(e,t,n)=>{n.r(t),n.d(t,{default:()=>g});var r=n(66204),a=n(80846),o=n(35421),l=n(4592);const s=(0,n(38684).ZL)()((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,a.observer)((function({model:e,children:t}){const{error:n,regionTooLarge:a}=e;return n?r.createElement(l.rK,{message:`${n}`,severity:"error",buttonText:"Reload",action:e.reload}):a?e.regionCannotBeRendered():r.createElement(c,{model:e},t)})),c=(0,a.observer)((function({model:e,children:t}){const{loading:n}=e;return r.createElement("div",null,t,n?r.createElement(m,{model:e}):null)})),m=(0,a.observer)((function({model:e}){const{classes:t}=s(),{message:n}=e;return r.createElement("div",{className:t.loading},r.createElement(o.LoadingEllipses,{message:n}))})),d=i;var u=n(2363);const g=(0,a.observer)((function({model:e,exportSVG:t}){return r.createElement(d,{model:e},r.createElement(u.Z,{model:e,exportSVG:t}))}))}}]);
//# sourceMappingURL=9141.0d73a1d3.chunk.js.map