"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
Object.defineProperty(exports, "init", {
  enumerable: true,
  get: function () {
    return _init.default;
  }
});
Object.defineProperty(exports, "parsePost", {
  enumerable: true,
  get: function () {
    return _parseFilters.parsePost;
  }
});
Object.defineProperty(exports, "parseRaw", {
  enumerable: true,
  get: function () {
    return _parseFilters.parseRaw;
  }
});
Object.defineProperty(exports, "postSummary", {
  enumerable: true,
  get: function () {
    return _parseFilters.postSummary;
  }
});
Object.defineProperty(exports, "topicTeaser", {
  enumerable: true,
  get: function () {
    return _parseFilters.topicTeaser;
  }
});
Object.defineProperty(exports, "postCreate", {
  enumerable: true,
  get: function () {
    return _postSave.postSave;
  }
});
Object.defineProperty(exports, "postEdit", {
  enumerable: true,
  get: function () {
    return _postSave.postSave;
  }
});
Object.defineProperty(exports, "privilegesList", {
  enumerable: true,
  get: function () {
    return _privileges.privilegesList;
  }
});
Object.defineProperty(exports, "privilegesGroupsList", {
  enumerable: true,
  get: function () {
    return _privileges.privilegesGroupsList;
  }
});
Object.defineProperty(exports, "privilegesListHuman", {
  enumerable: true,
  get: function () {
    return _privileges.privilegesListHuman;
  }
});
exports.postPurge = exports.postRestore = exports.postDelete = exports.sanitizeConfig = exports.composerFormatting = exports.adminMenu = exports.addNavigation = void 0;

require("source-map-support/register");

var _init = _interopRequireDefault(require("./init"));

var _parseFilters = require("./parseFilters");

var _postSave = require("./postSave");

var _privileges = require("./privileges");

var _event = require("./event");

require("./sockets");

var _translatorModule = require("./translatorModule");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const {
  Translator
} = require.main.require('./public/src/modules/translator');

(0, _translatorModule.initialize)(Translator);

const addNavigation = (navs, callback) => {
  navs.push({
    route: '/calendar',
    title: '\\[\\[calendar:calendar\\]\\]',
    iconClass: 'fa-calendar',
    textClass: 'visible-xs-inline',
    text: '\\[\\[calendar:calendar\\]\\]'
  });
  callback(null, navs);
};

exports.addNavigation = addNavigation;

const adminMenu = (header, callback) => {
  header.plugins.push({
    route: '/plugins/calendar',
    icon: 'fa-calendar',
    name: 'Calendar'
  });
  callback(null, header);
};

exports.adminMenu = adminMenu;

const composerFormatting = (data, callback) => {
  data.options.push({
    name: 'plugin-calendar-event',
    className: 'fa fa-calendar-o plugin-calendar-composer-edit-event',
    title: '[[calendar:edit_event]]'
  });
  callback(null, data);
};

exports.composerFormatting = composerFormatting;

const sanitizeConfig = (config, callback) => {
  config.allowedTags.push('input');
  config.allowedAttributes.input = ['class', 'title', 'type']; // in case we're on an older NodeBB version

  config.allowedClasses = config.allowedClasses || {};
  config.allowedClasses.input = ['form-control'];
  callback(null, config);
};

exports.sanitizeConfig = sanitizeConfig;

const postDelete = data => {
  (0, _event.deleteEvent)(data);
};

exports.postDelete = postDelete;

const postRestore = data => {
  (0, _event.restoreEvent)(data);
};

exports.postRestore = postRestore;

const postPurge = data => {
  (0, _event.purgeEvent)(data);
};

exports.postPurge = postPurge;
//# sourceMappingURL=index.js.map