"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[8238],{2363:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(66204),a=n(80846),l=n(90872),o=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 l=e.get("strand"),o=e.get("mate"),i=e.get("refName");let c,m=0,f=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,f=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],f=+e[1]-1,c=e[0]}return{k1:{refName:i,start:r,end:a,strand:l},k2:o??{refName:c,end:m,start:f}}}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,l.assembleLocString)(n),(0,l.assembleLocString)(r),e.get("INFO")?.SVTYPE,t].filter((e=>!!e)).join(" - ")}(e,t),o=20+(0,l.measureText)(a);return null!==n?r.createElement(i.u,{triggerRef:n},r.createElement("rect",{x:12,y:0,width:o,height:20,rx:5,ry:5,fill:"black",fillOpacity:"50%"}),r.createElement("text",{x:22,y:14,fontSize:10,fill:"white",textLength:o-20},a)):null})),f=(0,a.observer)((function({model:e,feature:t,alt:n,assembly:a,view:l}){const[s,i]=(0,r.useState)(!1),{height:f}=e,{k1:u,k2:g}=c(t,n),d=(0,r.useRef)(null),h=(0,o.getConf)(e,"color",{feature:t,alt:n}),b=a.getCanonicalRefName(u.refName)||u.refName,E=a.getCanonicalRefName(g.refName)||g.refName,k=u.start,w=g.start,x=l.bpToPx({refName:b,coord:k})?.offsetPx,N=l.bpToPx({refName:E,coord:w})?.offsetPx;if(void 0!==x&&void 0!==N){const a=(N-x)/2,o=Math.abs(a),c=Math.min(f,o),u=x-l.offsetPx,g=N-l.offsetPx;return o>1?r.createElement(r.Fragment,null,r.createElement("path",{d:`M ${u} 0 C ${u} ${c}, ${g} ${c}, ${g} 0`,ref:d,stroke:s?"black":h,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:d}):null):null}return null})),u=(0,a.observer)((function({model:e,exportSVG:t,children:n}){const{height:a}=e,o=(0,l.getContainingView)(e),s=Math.round(o.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,l.getContainingView)(e),a=(0,l.getSession)(e),{assemblyManager:o}=a,{features:s}=e,i=o.get(n.assemblyNames[0]);return i?r.createElement(u,{model:e,exportSVG:t},s?.map((t=>{const l=t.get("ALT");return l?.map((l=>r.createElement(f,{key:t.id()+"-"+l,session:a,feature:t,alt:l,view:n,model:e,assembly:i})))??r.createElement(f,{key:t.id(),session:a,feature:t,view:n,model:e,assembly:i})}))):null})),d=g},68238:(e,t,n)=>{n.d(t,{renderArcSvg:()=>o});var r=n(66204),a=n(90872),l=n(2363);async function o(e,t){await(0,a.when)((()=>!e.loading));const n=(0,a.getContainingView)(e).dynamicBlocks.totalWidthPx,o=e.height,s="arc-"+e.id;return r.createElement(r.Fragment,null,r.createElement("defs",null,r.createElement("clipPath",{id:s},r.createElement("rect",{x:0,y:0,width:n,height:o}))),r.createElement("g",{clipPath:`url(#${s})`},r.createElement(l.Z,{model:e,exportSVG:!0})))}}}]);
//# sourceMappingURL=8238.aa12af78.chunk.js.map