"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ga4_properties_1 = require("../ga4-properties");
const ga4_functions_1 = require("../ga4-functions");
const action = {
    title: 'Search',
    description: 'The term that was searched for.',
    defaultSubscription: 'type = "track" and event = "Products Searched"',
    platform: 'web',
    fields: {
        user_id: ga4_properties_1.user_id,
        user_properties: ga4_properties_1.user_properties,
        params: ga4_properties_1.params,
        search_term: ga4_properties_1.search_term
    },
    perform: (gtag, { payload }) => {
        ga4_functions_1.updateUser(payload.user_id, payload.user_properties, gtag);
        gtag('event', 'search', {
            search_term: payload.search_term,
            ...payload.params
        });
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map