"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.eventBulkCreateRegex = exports.country_code = exports.phone_number = exports.properties = exports.location = exports.image = exports.title = exports.organization = exports.last_name = exports.first_name = exports.batch_size = exports.enable_batching = exports.external_id = exports.email = exports.list_id = void 0;
const config_1 = require("./config");
exports.list_id = {
    label: 'List Id',
    description: `'Insert the ID of the default list that you'd like to subscribe users to when you call .identify().'`,
    type: 'string',
    default: {
        '@if': {
            exists: {
                '@path': '$.context.personas.audience_settings.listId'
            },
            then: { '@path': '$.context.personas.audience_settings.listId' },
            else: { '@path': '$.context.personas.external_audience_id' }
        }
    },
    unsafe_hidden: true,
    required: true
};
exports.email = {
    label: 'Email',
    description: `The user's email to send to Klavio.`,
    type: 'string',
    default: {
        '@path': '$.context.traits.email'
    },
    format: 'email'
};
exports.external_id = {
    label: 'External ID',
    description: `A unique identifier used by customers to associate Klaviyo profiles with profiles in an external system. One of External ID and Email required.`,
    type: 'string'
};
exports.enable_batching = {
    type: 'boolean',
    label: 'Batch Data to Klaviyo',
    description: 'When enabled, the action will use the klaviyo batch API.',
    default: true
};
exports.batch_size = {
    label: 'Batch Size',
    description: 'Maximum number of events to include in each batch. Actual batch sizes may be lower.',
    type: 'number',
    required: false,
    unsafe_hidden: true,
    default: 10000
};
exports.first_name = {
    label: 'First Name',
    description: `Individual's first name.`,
    type: 'string',
    default: { '@path': '$.properties.firstName' }
};
exports.last_name = {
    label: 'Last Name',
    description: `Individual's last name.`,
    type: 'string',
    default: { '@path': '$.properties.lastName' }
};
exports.organization = {
    label: 'Organization',
    description: `Name of the company or organization within the company for whom the individual works.`,
    type: 'string',
    default: { '@path': '$.properties.company.name' }
};
exports.title = {
    label: 'Title',
    description: `Individual's job title.`,
    type: 'string',
    default: { '@path': '$.properties.title' }
};
exports.image = {
    label: 'Image',
    description: `URL pointing to the location of a profile image.`,
    type: 'string',
    default: { '@path': '$.properties.avatar' }
};
exports.location = {
    label: 'Location',
    description: `Individual's address.`,
    type: 'object',
    properties: {
        address1: {
            label: 'Address 1',
            type: 'string',
            allowNull: true
        },
        address2: {
            label: 'Address 2',
            type: 'string',
            allowNull: true
        },
        city: {
            label: 'City',
            type: 'string',
            allowNull: true
        },
        region: {
            label: 'Region',
            type: 'string',
            allowNull: true
        },
        zip: {
            label: 'ZIP',
            type: 'string',
            allowNull: true
        },
        latitude: {
            label: 'Latitude',
            type: 'string',
            allowNull: true
        },
        longitude: {
            label: 'Longitide',
            type: 'string',
            allowNull: true
        },
        country: {
            label: 'Country',
            type: 'string',
            allowNull: true
        }
    },
    default: {
        city: { '@path': '$.properties.address.city' },
        region: { '@path': '$.properties.address.state' },
        zip: { '@path': '$.properties.address.postal_code' },
        address1: { '@path': '$.properties.address.street' },
        country: { '@path': '$.properties.address.country' }
    }
};
exports.properties = {
    description: 'An object containing key/value pairs for any custom properties assigned to this profile.',
    label: 'Properties',
    type: 'object',
    default: { '@path': '$.properties.properties' }
};
exports.phone_number = {
    label: 'Phone Number',
    description: `Individual's phone number in E.164 format. If SMS is not enabled and if you use Phone Number as identifier, then you have to provide one of Email or External ID.`,
    type: 'string',
    default: { '@path': '$.context.traits.phone' }
};
exports.country_code = {
    label: 'Country Code',
    description: `Country Code in ISO 3166-1 alpha-2 format. If provided, this will be used to validate and automatically format Phone Number field in E.164 format accepted by Klaviyo.`,
    type: 'string',
    choices: config_1.COUNTRY_CODES,
    depends_on: {
        conditions: [
            {
                fieldKey: 'phone_number',
                operator: 'is_not',
                value: ''
            }
        ]
    }
};
exports.eventBulkCreateRegex = /\/data\/attributes\/events-bulk-create\/data\/(\d+)/;
//# sourceMappingURL=properties.js.map