"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.batch_keys = exports.batch_size = exports.enable_batching = exports.audience_key = exports.traits_or_props = exports.crm_id = exports.email = exports.identifier_type = exports.computation_class = exports.audience_id = void 0;
const constants_1 = require("../constants");
exports.audience_id = {
    label: 'Audience ID',
    description: 'The ID of the audience to which you want to add or remove users.',
    type: 'string',
    required: true,
    default: {
        '@path': '$.context.personas.external_audience_id'
    },
    unsafe_hidden: true
};
exports.computation_class = {
    label: 'Computation Class',
    description: 'Hidden field: The computation class for the audience.',
    type: 'string',
    required: true,
    default: {
        '@path': '$.context.personas.computation_class'
    },
    choices: [
        { label: 'audience', value: 'audience' },
        { label: 'journey_step', value: 'journey_step' }
    ],
    unsafe_hidden: true
};
exports.identifier_type = {
    label: 'Identifier Type',
    description: 'The type of identifier you are using to sync users.',
    type: 'string',
    required: true,
    default: 'Email',
    choices: [
        { label: 'Email', value: 'Email' },
        { label: 'CRM ID', value: 'CRM' }
    ]
};
exports.email = {
    label: 'Email',
    description: 'The email address of the user to add or remove from the audience.',
    type: 'string',
    required: {
        ...constants_1.EMAIL_CONDITION
    },
    depends_on: {
        ...constants_1.EMAIL_CONDITION
    },
    default: {
        '@if': {
            exists: { '@path': '$.context.traits.email' },
            then: { '@path': '$.context.traits.email' },
            else: { '@path': '$.properties.email' }
        }
    },
    category: 'hashedPII'
};
exports.crm_id = {
    label: 'CRM ID',
    description: 'The CRM ID of the user to add or remove from the audience.',
    type: 'string',
    required: {
        ...constants_1.CRM_CONDITION
    },
    depends_on: {
        ...constants_1.CRM_CONDITION
    },
    default: {
        '@path': '$.userId'
    }
};
exports.traits_or_props = {
    label: '[Hidden] Traits or Properties',
    description: '[Hidden] properties object from track() payloads. Note: identify calls are not handled and are disabled in the Partner Portal.',
    type: 'object',
    required: true,
    unsafe_hidden: true,
    default: { '@path': '$.properties' }
};
exports.audience_key = {
    label: '[Hidden] Audience Key',
    description: '[Hidden]: The Engage Audience Key / Slug.',
    type: 'string',
    required: true,
    unsafe_hidden: true,
    default: {
        '@path': '$.context.personas.computation_key'
    }
};
exports.enable_batching = {
    label: 'Enable Batching',
    description: 'Enable batching of user syncs to optimize performance. When enabled, user syncs will be sent in batches based on the specified batch size.',
    type: 'boolean',
    required: true,
    default: true,
    readOnly: true
};
exports.batch_size = {
    label: '[Hidden] Batch Size',
    description: '[Hidden] The number of user syncs to include in each batch when batching is enabled. Must be between 1 and 1000.',
    type: 'number',
    required: true,
    default: 1000,
    minimum: 1,
    maximum: 1000,
    unsafe_hidden: true
};
exports.batch_keys = {
    label: '[Hidden] Batch Keys',
    description: '[Hidden] The keys to use for batching user syncs. Users with the same values for these keys will be grouped together in the same batch.',
    type: 'string',
    required: false,
    default: ['identifier_type', 'audience_id'],
    unsafe_hidden: true,
    multiple: true
};
//# sourceMappingURL=fields.js.map