"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const action = {
    title: 'Track Event',
    description: "Send an event to Userpilot. It's mandatory to identify a user by calling identify() prior to invoking other methods such as track(). You can learn more by visiting the [Userpilot documentation](https://docs.userpilot.com/article/23-identify-users-track-custom-events).",
    platform: 'web',
    defaultSubscription: 'type = "track"',
    fields: {
        name: {
            type: 'string',
            required: true,
            description: 'Event name',
            label: 'Name',
            default: {
                '@path': '$.event'
            }
        },
        properties: {
            type: 'object',
            required: false,
            description: 'Event properties',
            label: 'Properties',
            default: {
                '@path': '$.properties'
            }
        }
    },
    perform: (_, event) => {
        window.userpilot.track(event.payload.name, event.payload.properties ?? {});
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map