function e(e) {
var r = {
omitExtraWLInCodeBlocks: {
defaultValue: !1,
describe: "Omit the default extra whiteline added to code blocks",
type: "boolean"
},
noHeaderId: {
defaultValue: !1,
describe: "Turn on/off generated header id",
type: "boolean"
},
prefixHeaderId: {
defaultValue: !1,
describe: "Specify a prefix to generated header ids",
type: "string"
},
headerLevelStart: {
defaultValue: !1,
describe: "The header blocks level start",
type: "integer"
},
parseImgDimensions: {
defaultValue: !1,
describe: "Turn on/off image dimension parsing",
type: "boolean"
},
simplifiedAutoLink: {
defaultValue: !1,
describe: "Turn on/off GFM autolink style",
type: "boolean"
},
literalMidWordUnderscores: {
defaultValue: !1,
describe: "Parse midword underscores as literal underscores",
type: "boolean"
},
strikethrough: {
defaultValue: !1,
describe: "Turn on/off strikethrough support",
type: "boolean"
},
tables: {
defaultValue: !1,
describe: "Turn on/off tables support",
type: "boolean"
},
tablesHeaderId: {
defaultValue: !1,
describe: "Add an id to table headers",
type: "boolean"
},
ghCodeBlocks: {
defaultValue: !0,
describe: "Turn on/off GFM fenced code blocks support",
type: "boolean"
},
tasklists: {
defaultValue: !1,
describe: "Turn on/off GFM tasklist support",
type: "boolean"
},
smoothLivePreview: {
defaultValue: !1,
describe: "Prevents weird effects in live previews due to incomplete input",
type: "boolean"
},
smartIndentationFix: {
defaultValue: !1,
description: "Tries to smartly fix identation in es6 strings",
type: "boolean"
}
};
if (!1 === e) return JSON.parse(JSON.stringify(r));
var t = {};
for (var n in r) r.hasOwnProperty(n) && (t[n] = r[n].defaultValue);
return t;
}
function r(e, r) {
var t = r ? "Error in " + r + " extension->" : "Error in unnamed extension", a = {
valid: !0,
error: ""
};
s.helper.isArray(e) || (e = [ e ]);
for (var o = 0; o < e.length; ++o) {
var i = t + " sub-extension " + o + ": ", l = e[o];
if ("object" !== (void 0 === l ? "undefined" : n(l))) return a.valid = !1, a.error = i + "must be an object, but " + (void 0 === l ? "undefined" : n(l)) + " given",
a;
if (!s.helper.isString(l.type)) return a.valid = !1, a.error = i + 'property "type" must be a string, but ' + n(l.type) + " given",
a;
var c = l.type = l.type.toLowerCase();
if ("language" === c && (c = l.type = "lang"), "html" === c && (c = l.type = "output"),
"lang" !== c && "output" !== c && "listener" !== c) return a.valid = !1, a.error = i + "type " + c + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"',
a;
if ("listener" === c) {
if (s.helper.isUndefined(l.listeners)) return a.valid = !1, a.error = i + '. Extensions of type "listener" must have a property called "listeners"',
a;
} else if (s.helper.isUndefined(l.filter) && s.helper.isUndefined(l.regex)) return a.valid = !1,
a.error = i + c + ' extensions must define either a "regex" property or a "filter" method',
a;
if (l.listeners) {
if ("object" !== n(l.listeners)) return a.valid = !1, a.error = i + '"listeners" property must be an object but ' + n(l.listeners) + " given",
a;
for (var u in l.listeners) if (l.listeners.hasOwnProperty(u) && "function" != typeof l.listeners[u]) return a.valid = !1,
a.error = i + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + u + " must be a function but " + n(l.listeners[u]) + " given",
a;
}
if (l.filter) {
if ("function" != typeof l.filter) return a.valid = !1, a.error = i + '"filter" must be a function, but ' + n(l.filter) + " given",
a;
} else if (l.regex) {
if (s.helper.isString(l.regex) && (l.regex = new RegExp(l.regex, "g")), !l.regex instanceof RegExp) return a.valid = !1,
a.error = i + '"regex" property must either be a string or a RegExp object, but ' + n(l.regex) + " given",
a;
if (s.helper.isUndefined(l.replace)) return a.valid = !1, a.error = i + '"regex" extensions must implement a replace string or function',
a;
}
}
return a;
}
function t(e, r) {
return "~E" + r.charCodeAt(0) + "E";
}
var n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e;
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
}, s = {}, a = {}, o = {}, i = e(!0), l = {
github: {
omitExtraWLInCodeBlocks: !0,
prefixHeaderId: "user-content-",
simplifiedAutoLink: !0,
literalMidWordUnderscores: !0,
strikethrough: !0,
tables: !0,
tablesHeaderId: !0,
ghCodeBlocks: !0,
tasklists: !0
},
vanilla: e(!0)
};
s.helper = {}, s.extensions = {}, s.setOption = function(e, r) {
return i[e] = r, this;
}, s.getOption = function(e) {
return i[e];
}, s.getOptions = function() {
return i;
}, s.resetOptions = function() {
i = e(!0);
}, s.setFlavor = function(e) {
if (l.hasOwnProperty(e)) {
var r = l[e];
for (var t in r) r.hasOwnProperty(t) && (i[t] = r[t]);
}
}, s.getDefaultOptions = function(r) {
return e(r);
}, s.subParser = function(e, r) {
if (s.helper.isString(e)) {
if (void 0 === r) {
if (a.hasOwnProperty(e)) return a[e];
throw Error("SubParser named " + e + " not registered!");
}
a[e] = r;
}
}, s.extension = function(e, t) {
if (!s.helper.isString(e)) throw Error("Extension 'name' must be a string");
if (e = s.helper.stdExtName(e), s.helper.isUndefined(t)) {
if (!o.hasOwnProperty(e)) throw Error("Extension named " + e + " is not registered!");
return o[e];
}
"function" == typeof t && (t = t()), s.helper.isArray(t) || (t = [ t ]);
var n = r(t, e);
if (!n.valid) throw Error(n.error);
o[e] = t;
}, s.getAllExtensions = function() {
return o;
}, s.removeExtension = function(e) {
delete o[e];
}, s.resetExtensions = function() {
o = {};
}, s.validateExtension = function(e) {
var t = r(e, null);
return !!t.valid || (console.warn(t.error), !1);
}, s.hasOwnProperty("helper") || (s.helper = {}), s.helper.isString = function(e) {
return "string" == typeof e || e instanceof String;
}, s.helper.isFunction = function(e) {
var r = {};
return e && "[object Function]" === r.toString.call(e);
}, s.helper.forEach = function(e, r) {
if ("function" == typeof e.forEach) e.forEach(r); else for (var t = 0; t < e.length; t++) r(e[t], t, e);
}, s.helper.isArray = function(e) {
return e.constructor === Array;
}, s.helper.isUndefined = function(e) {
return void 0 === e;
}, s.helper.stdExtName = function(e) {
return e.replace(/[_-]||\s/g, "").toLowerCase();
}, s.helper.escapeCharactersCallback = t, s.helper.escapeCharacters = function(e, r, n) {
var s = "([" + r.replace(/([\[\]\\])/g, "\\$1") + "])";
n && (s = "\\\\" + s);
var a = new RegExp(s, "g");
return e = e.r