/**
 * DevExtreme (cjs/__internal/scheduler/appointments/m_appointment_layout.js)
 * Version: 24.1.7-build-24272-1937
 * Build date: Sat Sep 28 2024
 *
 * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.createAppointmentLayout = exports.createAgendaAppointmentLayout = void 0;
var _dom_adapter = _interopRequireDefault(require("../../../core/dom_adapter"));
var _renderer = _interopRequireDefault(require("../../../core/renderer"));
var _message = _interopRequireDefault(require("../../../localization/message"));
var _m_classes = require("../m_classes");

function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    }
}
const allDayText = ` ${_message.default.format("dxScheduler-allDay")}: `;
const createAppointmentLayout = (formatText, config) => {
    const result = (0, _renderer.default)(_dom_adapter.default.createDocumentFragment());
    (0, _renderer.default)("<div>").text(formatText.text).addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_TITLE).appendTo(result);
    if (config.html) {
        result.html(config.html)
    }
    const $contentDetails = (0, _renderer.default)("<div>").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_CONTENT_DETAILS).appendTo(result);
    (0, _renderer.default)("<div>").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_DATE).text(formatText.formatDate).appendTo($contentDetails);
    config.isRecurrence && (0, _renderer.default)("<span>").addClass(`${_m_classes.APPOINTMENT_CONTENT_CLASSES.RECURRING_ICON} dx-icon-repeat`).appendTo(result);
    config.isAllDay && (0, _renderer.default)("<div>").text(allDayText).addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.ALL_DAY_CONTENT).prependTo($contentDetails);
    return result
};
exports.createAppointmentLayout = createAppointmentLayout;
const createAgendaAppointmentLayout = (formatText, config) => {
    const result = (0, _renderer.default)(_dom_adapter.default.createDocumentFragment());
    const leftLayoutContainer = (0, _renderer.default)("<div>").addClass("dx-scheduler-agenda-appointment-left-layout").appendTo(result);
    const rightLayoutContainer = (0, _renderer.default)("<div>").addClass("dx-scheduler-agenda-appointment-right-layout").appendTo(result);
    const marker = (0, _renderer.default)("<div>").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.AGENDA_MARKER).appendTo(leftLayoutContainer);
    config.isRecurrence && (0, _renderer.default)("<span>").addClass(`${_m_classes.APPOINTMENT_CONTENT_CLASSES.RECURRING_ICON} dx-icon-repeat`).appendTo(marker);
    (0, _renderer.default)("<div>").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_TITLE).text(formatText.text).appendTo(rightLayoutContainer);
    const additionalContainer = (0, _renderer.default)("<div>").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_CONTENT_DETAILS).appendTo(rightLayoutContainer);
    (0, _renderer.default)("<div>").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_DATE).text(formatText.formatDate).appendTo(additionalContainer);
    if (config.isAllDay) {
        (0, _renderer.default)("<div>").text(allDayText).addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.ALL_DAY_CONTENT).prependTo(additionalContainer)
    }
    return result
};
exports.createAgendaAppointmentLayout = createAgendaAppointmentLayout;
