"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.clearCookiesExecutor = void 0;
const toolExecutor_types_1 = require("../toolExecutor-types");
const stepCapture_1 = require("../../background/capture/stepCapture");
const mablscript_step_types_1 = require("../../sharedUtils/mablscript-step-types");
exports.clearCookiesExecutor = {
    needsFind: () => false,
    getStepType: () => mablscript_step_types_1.StepType.CLEAR_COOKIES,
    execute: async (payload, stateProvider, eventHandler, logger) => {
        const contextInfo = payload.contextInfo ?? (await stateProvider.getActiveContextInfo());
        const step = {
            action: 'record',
            listener: 'clear-cookies',
        };
        return (0, toolExecutor_types_1.recordStepAndTrackResult)(() => (0, stepCapture_1.recordTrainedStep)(step, contextInfo, true, undefined, stateProvider, eventHandler), 0, stateProvider, eventHandler, logger);
    },
};
