var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React, { forwardRef } from 'react';
import { BUMP_RADIUS, LINE_MARGIN } from './constants';
export var HistoryCircle = forwardRef(function (_a, ref) {
    var x = _a.x, y = _a.y, color = _a.color, isDashed = _a.isDashed, isCollapsed = _a.isCollapsed, showCollapseIcon = _a.showCollapseIcon, showLine = _a.showLine, otherProps = __rest(_a, ["x", "y", "color", "isDashed", "isCollapsed", "showCollapseIcon", "showLine"]);
    var radius = showCollapseIcon ? BUMP_RADIUS * 2 : BUMP_RADIUS;
    return (React.createElement("g", __assign({ "data-reltio-id": "history-circle" }, otherProps, { ref: ref }),
        showLine && (React.createElement("rect", { id: "line", x: x - radius - LINE_MARGIN, y: y - radius - LINE_MARGIN, width: radius * 2 + LINE_MARGIN * 2, height: 2, fill: color })),
        React.createElement("circle", { cx: x, cy: y, r: radius, fill: isDashed ? '#fff' : color, stroke: color, strokeDasharray: isDashed ? '1,1' : undefined, strokeWidth: 2 }),
        showCollapseIcon && (React.createElement("g", { id: "icon" },
            React.createElement("rect", { x: x - 4, y: y - 1, width: 8, height: 2, fill: "#fff" }),
            isCollapsed && React.createElement("rect", { x: x - 1, y: y - 4, width: 2, height: 8, fill: "#fff" })))));
});
HistoryCircle.displayName = 'HistoryCircle';
