import{m as g,o as b,R as e,a as h,J as v}from"./index-Bm2SqMk3.js";const y=g()({hoverVertical:{background:"#333",border:"none",width:1,height:"100%",cursor:"default",position:"absolute",pointerEvents:"none"}}),T=b(function({model:a,height:n,clientMouseCoord:c,offsetMouseCoord:r,clientRect:l,TooltipContents:u,useClientY:m}){const{featureUnderMouse:s}=a,{classes:i}=y(),E=c[0]+5,t=m?c[1]:(l==null?void 0:l.top)||0;return s?e.createElement(e.Fragment,null,e.createElement(h.Suspense,{fallback:null},e.createElement(v,{clientPoint:{x:E,y:t}},e.createElement(u,{model:a,feature:s}))),e.createElement("div",{className:i.hoverVertical,style:{left:r[0],height:n}})):null}),p=o=>o.toLocaleString("en-US"),k=e.forwardRef(function({model:a,feature:n},c){const r=n.get("start"),l=n.get("end"),u=n.get("refName"),m=r===l?p(r):`${p(r)}..${p(l)}`,s=n.get("sources"),i=n.get("source"),E=Object.fromEntries(a.sources.map(t=>[t.name,t]));return e.createElement("div",{ref:c},[u,m].filter(t=>!!t).join(":"),e.createElement("br",null),s?e.createElement("table",null,e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"color"),e.createElement("th",null,"source"),e.createElement("th",null,"score"))),e.createElement("tbody",null,Object.entries(s).map(([t,f])=>{var d;return e.createElement("tr",{key:t},e.createElement("td",{style:{background:(d=E[t])===null||d===void 0?void 0:d.color}}," "),e.createElement("td",null,t),e.createElement("td",null,f.score))}))):e.createElement("span",null,i))}),j=b(o=>e.createElement(T,{useClientY:!0,TooltipContents:k,...o}));export{j as default};
