"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateURL = void 0;
const validateURL = (settings) => {
    if (settings.customURL) {
        const urlRegEx = /^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/;
        const regExMatcher = new RegExp(urlRegEx);
        const isCustomURLValid = typeof settings.customURL === 'string' && regExMatcher.test(settings.customURL);
        if (!isCustomURLValid) {
            throw new Error(`The Custom URL: ${settings.customURL} is invalid. It probably lacks the HTTP/HTTPS protocol or has an incorrect format.`);
        }
    }
};
exports.validateURL = validateURL;
//# sourceMappingURL=url-validator.js.map