"use strict";var e=require("prop-types"),i=require("react"),l=require("./Tooltip.css.js"),n=require("../../../../utils/convert.js"),t=require("react/jsx-runtime");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(e),s={Dash:"dashed",Solid:"solid",Dot:"dotted"},u=function(e){var r,o,u,d,a=e.points,c=i.useMemo((function(){for(var e=0;e<a.length;e+=1){var i,l;if(null!==(i=a[e])&&void 0!==i&&null!==(l=i[0])&&void 0!==l&&l.plotX)return e}return 0}),[a]);return t.jsxs("div",{className:l.container,style:{transform:"translate(".concat(null===(r=a[c])||void 0===r||null===(o=r[0])||void 0===o?void 0:o.plotX,"px, 0)")},children:[t.jsxs("div",{className:l.indexTooltip,children:[null===(u=a[c])||void 0===u||null===(d=u[0])||void 0===d?void 0:d.x," ’"]}),a.map((function(e,i){return t.jsx("div",{className:l.tooltipContainer,children:!!e.length&&t.jsx("table",{className:l.content,children:t.jsx("tbody",{children:e.map((function(e){var i,r,o,u,d,a,c,v=e.id,p=e.y,m=e.series;return t.jsxs("tr",{children:[t.jsx("td",{children:t.jsx("div",{className:l.line,style:{borderBottom:"1px ".concat(s[null==m||null===(i=m.userOptions)||void 0===i?void 0:i.dashStyle]," ").concat((null==m||null===(r=m.userOptions)||void 0===r?void 0:r.color)||(null==m||null===(o=m.userOptions)||void 0===o?void 0:o.lineColor))}})}),t.jsx("td",{className:l.name,children:null==m||null===(u=m.userOptions)||void 0===u?void 0:u.name}),t.jsx("td",{className:l.value,children:(c=p,Number.isFinite(c)?Math.round(1e5*c)/1e5:"-")}),t.jsx("td",{className:l.units,children:n.getUnitDisplay(null==m||null===(d=m.userOptions)||void 0===d?void 0:d.unitType)||(null==m||null===(a=m.userOptions)||void 0===a?void 0:a.unit)})]},v)}))})})},"points_from_track_".concat(i))}))]})};u.propTypes={points:o.default.arrayOf(o.default.arrayOf(o.default.shape({plotX:o.default.number.isRequired,x:o.default.number.isRequired}))).isRequired},module.exports=u;
