"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[3656],{63656:(e,t,o)=>{o.r(t),o.d(t,{default:()=>b});var i=o(7552),a=o(67112),l=o(99546),n=o(87485),s=o(21230),r=o(84340),h=o(27614),g=o(37962),m=o(89870),c=o(68446),d=o(75785),f=o(69500);const k=(0,d.n9)()((e=>({highlight:{height:"100%",position:"absolute",overflow:"hidden",background:(0,n.M)(e.palette.highlight.main).alpha(.35).toRgbString()},linkIcon:{color:(0,n.M)(e.palette.highlight.main).darken(.2).toRgbString()},z3:{zIndex:3}}))),b=(0,c.observer)((function({model:e,highlight:t}){const{classes:o}=k(),[n,c]=(0,i.useState)(!1),d=(0,i.useRef)(null),b=(0,l.getSession)(e),{assemblyManager:u}=b,x=()=>{e.removeHighlight(t)};function w(){c(!1)}const N=u.get(t.assemblyName),p=(t=>{const o=e.bpToPx({refName:t.refName,coord:t.start}),i=e.bpToPx({refName:t.refName,coord:t.end});return o&&i?{width:Math.max(Math.abs(i.offsetPx-o.offsetPx),3),left:Math.min(o.offsetPx,i.offsetPx)-e.offsetPx}:void 0})({...t,refName:N?.getCanonicalRefName(t.refName)??t.refName});return p?(0,f.jsxs)("div",{className:o.highlight,style:{left:p.left,width:p.width},children:[(0,f.jsx)(g.A,{title:"Highlighted from URL parameter",arrow:!0,children:(0,f.jsx)(m.A,{ref:d,className:o.z3,onClick:()=>{c(!0)},children:(0,f.jsx)(h.A,{fontSize:"small",className:o.linkIcon})})}),(0,f.jsx)(a.Menu,{anchorEl:d.current,onMenuItemClick:(e,t)=>{t(b),w()},open:n,onClose:w,menuItems:[{label:"Dismiss highlight",icon:r.A,onClick:()=>{x()}},{label:"Bookmark highlighted region",icon:s.A,onClick:()=>{let e=b.widgets.get("GridBookmark");e||(e=b.addWidget("GridBookmarkWidget","GridBookmark")),e.addBookmark(t),x()}}]})]}):null}))}}]);
//# sourceMappingURL=3656.25621891.chunk.js.map