"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDocumentApproved = exports.isEmptyDocumentBody = exports.getDocumentBody = void 0;
/**
 * Return document body
 * @param doc LegalPage document
 * @return string Body document
 */
const getDocumentBody = (doc) => {
    if (doc.html_body && doc.html_body !== '<p></p>') {
        return doc.html_body;
    }
    return '<p><b><FormattedMessage id="ui.consentSolution.emptyDocument" defaultMessage="ui.consentSolution.emptyDocument" /></b></p>';
};
exports.getDocumentBody = getDocumentBody;
/**
 * Return true if document body is empty
 * @param doc LegalPage document
 * @return boolean
 */
const isEmptyDocumentBody = (doc) => {
    return !doc.html_body || (doc.html_body && (doc.html_body === '<p></p>' || doc.html_body === ''));
};
exports.isEmptyDocumentBody = isEmptyDocumentBody;
/**
 * Return true if document is acked
 * @param doc LegalPage document
 * @return boolean
 */
const isDocumentApproved = (doc) => {
    return doc.ack && doc.ack.accepted_at;
};
exports.isDocumentApproved = isDocumentApproved;
