import { __decorate, __metadata } from "tslib";
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { AutoBind } from '../../../Common/AutoBind';
import { StyledIconButton } from '../CommonStyles';
import { ColorIcon } from '../../../CommonUI/Icon/ColorIcon';
import { DeleteGrayIcon } from '../../../CommonUI/Icon/DeleteGrayIcon';
import { DragIcon } from '../../../CommonUI/Icon/DragIcon';
import { BaseSequenceActions } from '../BaseSequenceActions';
import { RegularSequenceActions } from '../Regular/SequenceActions';
export class DiagramSequenceActions extends BaseSequenceActions {
    onChangeColor(event) {
        var _a;
        event.stopPropagation();
        const { sequence } = this.props;
        (_a = sequence.editContext) === null || _a === void 0 ? void 0 : _a.setSelectedForColor(sequence, event.currentTarget);
    }
    render() {
        const { sequence, displayBehavior } = this.props;
        if (!sequence.isNormal)
            return _jsx(RegularSequenceActions, { sequence: sequence, displayBehavior: displayBehavior }, void 0);
        return _jsxs(_Fragment, { children: [sequence.steps.length === 1 && _jsx(StyledIconButton, Object.assign({ "data-testid": `${sequence._id}-btn-stack-color-change`, onClick: this.onChangeColor }, { children: _jsx(ColorIcon, {}, void 0) }), void 0),
                sequence.isNormal && !sequence.isPrimary && _jsx(StyledIconButton, Object.assign({ "data-testid": `${sequence._id}-btn-delete`, onClick: this.onDeleteSequence }, { children: _jsx(DeleteGrayIcon, {}, void 0) }), void 0),
                !sequence.isPrimary && _jsx(StyledIconButton, Object.assign({ className: "stack-move" }, { children: _jsx(DragIcon, {}, void 0) }), void 0)] }, void 0);
    }
}
__decorate([
    AutoBind,
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", void 0)
], DiagramSequenceActions.prototype, "onChangeColor", null);
//# sourceMappingURL=SequenceActions.js.map