Your Name 1912bcd25b
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
chore: sync all remaining local workspace changes
2026-05-08 11:26:57 +08:00

3058 lines
105 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* Extracted from browser-delivered Turbopack chunk: 2a4e4dccbc3fdacb.bc4b655d5c.js
* Module id: 999445
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
var t = e.i(673654),
n = (e, t) => {
if ("slot" === e) return 0;
if (e instanceof Function) return e(t);
let { children: n, ...r } = null != t ? t : {};
if ("svg" === e)
throw Error(
"SVG elements are not supported in the JSX syntax, use the array syntax instead",
);
return [e, r, n];
},
r = /^\s*>\s$/,
i = t.Node.create({
name: "blockquote",
addOptions: () => ({ HTMLAttributes: {} }),
content: "block+",
group: "block",
defining: !0,
parseHTML: () => [{ tag: "blockquote" }],
renderHTML({ HTMLAttributes: e }) {
return n("blockquote", {
...(0, t.mergeAttributes)(this.options.HTMLAttributes, e),
children: n("slot", {}),
});
},
parseMarkdown: (e, t) =>
t.createNode("blockquote", void 0, t.parseChildren(e.tokens || [])),
renderMarkdown: (e, t) => {
if (!e.content) return "";
let n = [];
return (
e.content.forEach((e) => {
let r = t
.renderChildren([e])
.split("\n")
.map((e) => ("" === e.trim() ? ">" : `> ${e}`));
n.push(r.join("\n"));
}),
n.join(`
>
`)
);
},
addCommands() {
return {
setBlockquote:
() =>
({ commands: e }) =>
e.wrapIn(this.name),
toggleBlockquote:
() =>
({ commands: e }) =>
e.toggleWrap(this.name),
unsetBlockquote:
() =>
({ commands: e }) =>
e.lift(this.name),
};
},
addKeyboardShortcuts() {
return {
"Mod-Shift-b": () => this.editor.commands.toggleBlockquote(),
};
},
addInputRules() {
return [(0, t.wrappingInputRule)({ find: r, type: this.type })];
},
}),
o = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,
s = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,
l = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,
a = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,
d = t.Mark.create({
name: "bold",
addOptions: () => ({ HTMLAttributes: {} }),
parseHTML() {
return [
{ tag: "strong" },
{
tag: "b",
getAttrs: (e) => "normal" !== e.style.fontWeight && null,
},
{
style: "font-weight=400",
clearMark: (e) => e.type.name === this.name,
},
{
style: "font-weight",
getAttrs: (e) => /^(bold(er)?|[5-9]\d{2,})$/.test(e) && null,
},
];
},
renderHTML({ HTMLAttributes: e }) {
return n("strong", {
...(0, t.mergeAttributes)(this.options.HTMLAttributes, e),
children: n("slot", {}),
});
},
markdownTokenName: "strong",
parseMarkdown: (e, t) =>
t.applyMark("bold", t.parseInline(e.tokens || [])),
renderMarkdown: (e, t) => `**${t.renderChildren(e)}**`,
addCommands() {
return {
setBold:
() =>
({ commands: e }) =>
e.setMark(this.name),
toggleBold:
() =>
({ commands: e }) =>
e.toggleMark(this.name),
unsetBold:
() =>
({ commands: e }) =>
e.unsetMark(this.name),
};
},
addKeyboardShortcuts() {
return {
"Mod-b": () => this.editor.commands.toggleBold(),
"Mod-B": () => this.editor.commands.toggleBold(),
};
},
addInputRules() {
return [
(0, t.markInputRule)({ find: o, type: this.type }),
(0, t.markInputRule)({ find: l, type: this.type }),
];
},
addPasteRules() {
return [
(0, t.markPasteRule)({ find: s, type: this.type }),
(0, t.markPasteRule)({ find: a, type: this.type }),
];
},
}),
c = /(^|[^`])`([^`]+)`(?!`)$/,
h = /(^|[^`])`([^`]+)`(?!`)/g,
p = t.Mark.create({
name: "code",
addOptions: () => ({ HTMLAttributes: {} }),
excludes: "_",
code: !0,
exitable: !0,
parseHTML: () => [{ tag: "code" }],
renderHTML({ HTMLAttributes: e }) {
return [
"code",
(0, t.mergeAttributes)(this.options.HTMLAttributes, e),
0,
];
},
markdownTokenName: "codespan",
parseMarkdown: (e, t) =>
t.applyMark("code", [{ type: "text", text: e.text || "" }]),
renderMarkdown: (e, t) =>
e.content ? `\`${t.renderChildren(e.content)}\`` : "",
addCommands() {
return {
setCode:
() =>
({ commands: e }) =>
e.setMark(this.name),
toggleCode:
() =>
({ commands: e }) =>
e.toggleMark(this.name),
unsetCode:
() =>
({ commands: e }) =>
e.unsetMark(this.name),
};
},
addKeyboardShortcuts() {
return { "Mod-e": () => this.editor.commands.toggleCode() };
},
addInputRules() {
return [(0, t.markInputRule)({ find: c, type: this.type })];
},
addPasteRules() {
return [(0, t.markPasteRule)({ find: h, type: this.type })];
},
});
e.i(608469);
var u = e.i(111092),
f = /^```([a-z]+)?[\s\n]$/,
m = /^~~~([a-z]+)?[\s\n]$/,
g = t.Node.create({
name: "codeBlock",
addOptions: () => ({
languageClassPrefix: "language-",
exitOnTripleEnter: !0,
exitOnArrowDown: !0,
defaultLanguage: null,
enableTabIndentation: !1,
tabSize: 4,
HTMLAttributes: {},
}),
content: "text*",
marks: "",
group: "block",
code: !0,
defining: !0,
addAttributes() {
return {
language: {
default: this.options.defaultLanguage,
parseHTML: (e) => {
var t;
let { languageClassPrefix: n } = this.options;
if (!n) return null;
let r = [
...((null == (t = e.firstElementChild)
? void 0
: t.classList) || []),
]
.filter((e) => e.startsWith(n))
.map((e) => e.replace(n, ""))[0];
return r || null;
},
rendered: !1,
},
};
},
parseHTML: () => [{ tag: "pre", preserveWhitespace: "full" }],
renderHTML({ node: e, HTMLAttributes: n }) {
return [
"pre",
(0, t.mergeAttributes)(this.options.HTMLAttributes, n),
[
"code",
{
class: e.attrs.language
? this.options.languageClassPrefix + e.attrs.language
: null,
},
0,
],
];
},
markdownTokenName: "code",
parseMarkdown: (e, t) => {
var n;
return (null == (n = e.raw) ? void 0 : n.startsWith("```")) === !1 &&
"indented" !== e.codeBlockStyle
? []
: t.createNode(
"codeBlock",
{ language: e.lang || null },
e.text ? [t.createTextNode(e.text)] : [],
);
},
renderMarkdown: (e, t) => {
var n;
let r = (null == (n = e.attrs) ? void 0 : n.language) || "";
return e.content
? [`\`\`\`${r}`, t.renderChildren(e.content), "```"].join("\n")
: `\`\`\`${r}
\`\`\``;
},
addCommands() {
return {
setCodeBlock:
(e) =>
({ commands: t }) =>
t.setNode(this.name, e),
toggleCodeBlock:
(e) =>
({ commands: t }) =>
t.toggleNode(this.name, "paragraph", e),
};
},
addKeyboardShortcuts() {
return {
"Mod-Alt-c": () => this.editor.commands.toggleCodeBlock(),
Backspace: () => {
let { empty: e, $anchor: t } = this.editor.state.selection,
n = 1 === t.pos;
return (
!!e &&
t.parent.type.name === this.name &&
(!!n || !t.parent.textContent.length) &&
this.editor.commands.clearNodes()
);
},
Tab: ({ editor: e }) => {
var t;
if (!this.options.enableTabIndentation) return !1;
let n = null != (t = this.options.tabSize) ? t : 4,
{ state: r } = e,
{ selection: i } = r,
{ $from: o, empty: s } = i;
if (o.parent.type !== this.type) return !1;
let l = " ".repeat(n);
return s
? e.commands.insertContent(l)
: e.commands.command(({ tr: e }) => {
let { from: t, to: n } = i,
o = r.doc
.textBetween(t, n, "\n", "\n")
.split("\n")
.map((e) => l + e)
.join("\n");
return e.replaceWith(t, n, r.schema.text(o)), !0;
});
},
"Shift-Tab": ({ editor: e }) => {
var t;
if (!this.options.enableTabIndentation) return !1;
let n = null != (t = this.options.tabSize) ? t : 4,
{ state: r } = e,
{ selection: i } = r,
{ $from: o, empty: s } = i;
return (
o.parent.type === this.type &&
(s
? e.commands.command(({ tr: e }) => {
var t;
let { pos: i } = o,
s = o.start(),
l = o.end(),
a = r.doc.textBetween(s, l, "\n", "\n").split("\n"),
d = 0,
c = 0,
h = i - s;
for (let e = 0; e < a.length; e += 1) {
if (c + a[e].length >= h) {
d = e;
break;
}
c += a[e].length + 1;
}
let p = Math.min(
(
(null == (t = a[d].match(/^ */)) ? void 0 : t[0]) ||
""
).length,
n,
);
if (0 === p) return !0;
let f = s;
for (let e = 0; e < d; e += 1) f += a[e].length + 1;
return (
e.delete(f, f + p),
i - f <= p &&
e.setSelection(u.TextSelection.create(e.doc, f)),
!0
);
})
: e.commands.command(({ tr: e }) => {
let { from: t, to: o } = i,
s = r.doc
.textBetween(t, o, "\n", "\n")
.split("\n")
.map((e) => {
var t;
let r = Math.min(
(
(null == (t = e.match(/^ */))
? void 0
: t[0]) || ""
).length,
n,
);
return e.slice(r);
})
.join("\n");
return e.replaceWith(t, o, r.schema.text(s)), !0;
}))
);
},
Enter: ({ editor: e }) => {
if (!this.options.exitOnTripleEnter) return !1;
let { state: t } = e,
{ selection: n } = t,
{ $from: r, empty: i } = n;
if (!i || r.parent.type !== this.type) return !1;
let o = r.parentOffset === r.parent.nodeSize - 2,
s = r.parent.textContent.endsWith("\n\n");
return (
!!o &&
!!s &&
e
.chain()
.command(({ tr: e }) => (e.delete(r.pos - 2, r.pos), !0))
.exitCode()
.run()
);
},
ArrowDown: ({ editor: e }) => {
if (!this.options.exitOnArrowDown) return !1;
let { state: t } = e,
{ selection: n, doc: r } = t,
{ $from: i, empty: o } = n;
if (
!o ||
i.parent.type !== this.type ||
i.parentOffset !== i.parent.nodeSize - 2
)
return !1;
let s = i.after();
return (
void 0 !== s &&
(r.nodeAt(s)
? e.commands.command(
({ tr: e }) => (
e.setSelection(u.Selection.near(r.resolve(s))), !0
),
)
: e.commands.exitCode())
);
},
};
},
addInputRules() {
return [
(0, t.textblockTypeInputRule)({
find: f,
type: this.type,
getAttributes: (e) => ({ language: e[1] }),
}),
(0, t.textblockTypeInputRule)({
find: m,
type: this.type,
getAttributes: (e) => ({ language: e[1] }),
}),
];
},
addProseMirrorPlugins() {
return [
new u.Plugin({
key: new u.PluginKey("codeBlockVSCodeHandler"),
props: {
handlePaste: (e, t) => {
if (!t.clipboardData || this.editor.isActive(this.type.name))
return !1;
let n = t.clipboardData.getData("text/plain"),
r = t.clipboardData.getData("vscode-editor-data"),
i = r ? JSON.parse(r) : void 0,
o = null == i ? void 0 : i.mode;
if (!n || !o) return !1;
let { tr: s, schema: l } = e.state,
a = l.text(n.replace(/\r\n?/g, "\n"));
return (
s.replaceSelectionWith(
this.type.create({ language: o }, a),
),
s.selection.$from.parent.type !== this.type &&
s.setSelection(
u.TextSelection.near(
s.doc.resolve(Math.max(0, s.selection.from - 2)),
),
),
s.setMeta("paste", !0),
e.dispatch(s),
!0
);
},
},
}),
];
},
}),
y = t.Node.create({
name: "doc",
topNode: !0,
content: "block+",
renderMarkdown: (e, t) =>
e.content ? t.renderChildren(e.content, "\n\n") : "",
}),
b = t.Node.create({
name: "hardBreak",
markdownTokenName: "br",
addOptions: () => ({ keepMarks: !0, HTMLAttributes: {} }),
inline: !0,
group: "inline",
selectable: !1,
linebreakReplacement: !0,
parseHTML: () => [{ tag: "br" }],
renderHTML({ HTMLAttributes: e }) {
return ["br", (0, t.mergeAttributes)(this.options.HTMLAttributes, e)];
},
renderText: () => "\n",
renderMarkdown: () => `
`,
parseMarkdown: () => ({ type: "hardBreak" }),
addCommands() {
return {
setHardBreak:
() =>
({ commands: e, chain: t, state: n, editor: r }) =>
e.first([
() => e.exitCode(),
() =>
e.command(() => {
let { selection: e, storedMarks: i } = n;
if (e.$from.parent.type.spec.isolating) return !1;
let { keepMarks: o } = this.options,
{ splittableMarks: s } = r.extensionManager,
l = i || (e.$to.parentOffset && e.$from.marks());
return t()
.insertContent({ type: this.name })
.command(({ tr: e, dispatch: t }) => {
if (t && l && o) {
let t = l.filter((e) => s.includes(e.type.name));
e.ensureMarks(t);
}
return !0;
})
.run();
}),
]),
};
},
addKeyboardShortcuts() {
return {
"Mod-Enter": () => this.editor.commands.setHardBreak(),
"Shift-Enter": () => this.editor.commands.setHardBreak(),
};
},
}),
k = t.Node.create({
name: "heading",
addOptions: () => ({ levels: [1, 2, 3, 4, 5, 6], HTMLAttributes: {} }),
content: "inline*",
group: "block",
defining: !0,
addAttributes: () => ({ level: { default: 1, rendered: !1 } }),
parseHTML() {
return this.options.levels.map((e) => ({
tag: `h${e}`,
attrs: { level: e },
}));
},
renderHTML({ node: e, HTMLAttributes: n }) {
let r = this.options.levels.includes(e.attrs.level)
? e.attrs.level
: this.options.levels[0];
return [
`h${r}`,
(0, t.mergeAttributes)(this.options.HTMLAttributes, n),
0,
];
},
parseMarkdown: (e, t) =>
t.createNode(
"heading",
{ level: e.depth || 1 },
t.parseInline(e.tokens || []),
),
renderMarkdown: (e, t) => {
var n;
let r = (null == (n = e.attrs) ? void 0 : n.level)
? parseInt(e.attrs.level, 10)
: 1,
i = "#".repeat(r);
return e.content ? `${i} ${t.renderChildren(e.content)}` : "";
},
addCommands() {
return {
setHeading:
(e) =>
({ commands: t }) =>
!!this.options.levels.includes(e.level) &&
t.setNode(this.name, e),
toggleHeading:
(e) =>
({ commands: t }) =>
!!this.options.levels.includes(e.level) &&
t.toggleNode(this.name, "paragraph", e),
};
},
addKeyboardShortcuts() {
return this.options.levels.reduce(
(e, t) => ({
...e,
...{
[`Mod-Alt-${t}`]: () =>
this.editor.commands.toggleHeading({ level: t }),
},
}),
{},
);
},
addInputRules() {
return this.options.levels.map((e) =>
(0, t.textblockTypeInputRule)({
find: RegExp(
`^(#{${Math.min(...this.options.levels)},${e}})\\s$`,
),
type: this.type,
getAttributes: { level: e },
}),
);
},
}),
v = t.Node.create({
name: "horizontalRule",
addOptions: () => ({ HTMLAttributes: {}, nextNodeType: "paragraph" }),
group: "block",
parseHTML: () => [{ tag: "hr" }],
renderHTML({ HTMLAttributes: e }) {
return ["hr", (0, t.mergeAttributes)(this.options.HTMLAttributes, e)];
},
markdownTokenName: "hr",
parseMarkdown: (e, t) => t.createNode("horizontalRule"),
renderMarkdown: () => "---",
addCommands() {
return {
setHorizontalRule:
() =>
({ chain: e, state: n }) => {
if (!(0, t.canInsertNode)(n, n.schema.nodes[this.name]))
return !1;
let { selection: r } = n,
{ $to: i } = r,
o = e();
return (
(0, t.isNodeSelection)(r)
? o.insertContentAt(i.pos, { type: this.name })
: o.insertContent({ type: this.name }),
o
.command(({ state: e, tr: t, dispatch: n }) => {
if (n) {
let { $to: n } = t.selection,
r = n.end();
if (n.nodeAfter)
n.nodeAfter.isTextblock
? t.setSelection(
u.TextSelection.create(t.doc, n.pos + 1),
)
: n.nodeAfter.isBlock
? t.setSelection(
u.NodeSelection.create(t.doc, n.pos),
)
: t.setSelection(
u.TextSelection.create(t.doc, n.pos),
);
else {
let i =
e.schema.nodes[this.options.nextNodeType] ||
n.parent.type.contentMatch.defaultType,
o = null == i ? void 0 : i.create();
o &&
(t.insert(r, o),
t.setSelection(
u.TextSelection.create(t.doc, r + 1),
));
}
t.scrollIntoView();
}
return !0;
})
.run()
);
},
};
},
addInputRules() {
return [
(0, t.nodeInputRule)({
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
type: this.type,
}),
];
},
}),
w = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,
S = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,
x = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,
M = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,
C = t.Mark.create({
name: "italic",
addOptions: () => ({ HTMLAttributes: {} }),
parseHTML() {
return [
{ tag: "em" },
{
tag: "i",
getAttrs: (e) => "normal" !== e.style.fontStyle && null,
},
{
style: "font-style=normal",
clearMark: (e) => e.type.name === this.name,
},
{ style: "font-style=italic" },
];
},
renderHTML({ HTMLAttributes: e }) {
return [
"em",
(0, t.mergeAttributes)(this.options.HTMLAttributes, e),
0,
];
},
addCommands() {
return {
setItalic:
() =>
({ commands: e }) =>
e.setMark(this.name),
toggleItalic:
() =>
({ commands: e }) =>
e.toggleMark(this.name),
unsetItalic:
() =>
({ commands: e }) =>
e.unsetMark(this.name),
};
},
markdownTokenName: "em",
parseMarkdown: (e, t) =>
t.applyMark("italic", t.parseInline(e.tokens || [])),
renderMarkdown: (e, t) => `*${t.renderChildren(e)}*`,
addKeyboardShortcuts() {
return {
"Mod-i": () => this.editor.commands.toggleItalic(),
"Mod-I": () => this.editor.commands.toggleItalic(),
};
},
addInputRules() {
return [
(0, t.markInputRule)({ find: w, type: this.type }),
(0, t.markInputRule)({ find: x, type: this.type }),
];
},
addPasteRules() {
return [
(0, t.markPasteRule)({ find: S, type: this.type }),
(0, t.markPasteRule)({ find: M, type: this.type }),
];
},
});
let T = "numeric",
N = "ascii",
E = "alpha",
O = "asciinumeric",
A = "alphanumeric",
D = "domain",
R = "emoji",
I = "whitespace";
function P(e, t, n) {
for (let r in (t[T] && ((t[O] = !0), (t[A] = !0)),
t[N] && ((t[O] = !0), (t[E] = !0)),
t[O] && (t[A] = !0),
t[E] && (t[A] = !0),
t[A] && (t[D] = !0),
t[R] && (t[D] = !0),
t)) {
let t = (r in n || (n[r] = []), n[r]);
0 > t.indexOf(e) && t.push(e);
}
}
function L(e = null) {
(this.j = {}), (this.jr = []), (this.jd = null), (this.t = e);
}
(L.groups = {}),
(L.prototype = {
accepts() {
return !!this.t;
},
go(e) {
let t = this.j[e];
if (t) return t;
for (let t = 0; t < this.jr.length; t++) {
let n = this.jr[t][0],
r = this.jr[t][1];
if (r && n.test(e)) return r;
}
return this.jd;
},
has(e, t = !1) {
return t ? e in this.j : !!this.go(e);
},
ta(e, t, n, r) {
for (let i = 0; i < e.length; i++) this.tt(e[i], t, n, r);
},
tr(e, t, n, r) {
let i;
return (
(r = r || L.groups),
t && t.j ? (i = t) : ((i = new L(t)), n && r && P(t, n, r)),
this.jr.push([e, i]),
i
);
},
ts(e, t, n, r) {
let i = this,
o = e.length;
if (!o) return i;
for (let t = 0; t < o - 1; t++) i = i.tt(e[t]);
return i.tt(e[o - 1], t, n, r);
},
tt(e, t, n, r) {
if (((r = r || L.groups), t && t.j)) return (this.j[e] = t), t;
let i,
o = this.go(e);
return (
o
? (Object.assign((i = new L()).j, o.j),
i.jr.push.apply(i.jr, o.jr),
(i.jd = o.jd),
(i.t = o.t))
: (i = new L()),
t &&
(r &&
(i.t && "string" == typeof i.t
? P(
t,
Object.assign(
(function (e, t) {
let n = {};
for (let r in t) t[r].indexOf(e) >= 0 && (n[r] = !0);
return n;
})(i.t, r),
n,
),
r,
)
: n && P(t, n, r)),
(i.t = t)),
(this.j[e] = i),
i
);
},
});
let z = (e, t, n, r, i) => e.ta(t, n, r, i),
B = (e, t, n, r, i) => e.tr(t, n, r, i),
$ = (e, t, n, r, i) => e.ts(t, n, r, i),
j = (e, t, n, r, i) => e.tt(t, n, r, i),
F = "WORD",
V = "UWORD",
H = "ASCIINUMERICAL",
W = "ALPHANUMERICAL",
_ = "LOCALHOST",
q = "UTLD",
K = "SCHEME",
U = "SLASH_SCHEME",
J = "OPENBRACE",
G = "CLOSEBRACE",
Y = "OPENBRACKET",
Q = "CLOSEBRACKET",
X = "OPENPAREN",
Z = "CLOSEPAREN",
ee = "OPENANGLEBRACKET",
et = "CLOSEANGLEBRACKET",
en = "FULLWIDTHLEFTPAREN",
er = "FULLWIDTHRIGHTPAREN",
ei = "LEFTCORNERBRACKET",
eo = "RIGHTCORNERBRACKET",
es = "LEFTWHITECORNERBRACKET",
el = "RIGHTWHITECORNERBRACKET",
ea = "FULLWIDTHLESSTHAN",
ed = "FULLWIDTHGREATERTHAN",
ec = "AMPERSAND",
eh = "APOSTROPHE",
ep = "ASTERISK",
eu = "BACKSLASH",
ef = "BACKTICK",
em = "CARET",
eg = "COLON",
ey = "COMMA",
eb = "DOLLAR",
ek = "EQUALS",
ev = "EXCLAMATION",
ew = "HYPHEN",
eS = "PERCENT",
ex = "PIPE",
eM = "PLUS",
eC = "POUND",
eT = "QUERY",
eN = "QUOTE",
eE = "FULLWIDTHMIDDLEDOT",
eO = "SEMI",
eA = "SLASH",
eD = "TILDE",
eR = "UNDERSCORE",
eI = "EMOJI";
var eP = Object.freeze({
__proto__: null,
ALPHANUMERICAL: W,
AMPERSAND: ec,
APOSTROPHE: eh,
ASCIINUMERICAL: H,
ASTERISK: ep,
AT: "AT",
BACKSLASH: eu,
BACKTICK: ef,
CARET: em,
CLOSEANGLEBRACKET: et,
CLOSEBRACE: G,
CLOSEBRACKET: Q,
CLOSEPAREN: Z,
COLON: eg,
COMMA: ey,
DOLLAR: eb,
DOT: "DOT",
EMOJI: eI,
EQUALS: ek,
EXCLAMATION: ev,
FULLWIDTHGREATERTHAN: ed,
FULLWIDTHLEFTPAREN: en,
FULLWIDTHLESSTHAN: ea,
FULLWIDTHMIDDLEDOT: eE,
FULLWIDTHRIGHTPAREN: er,
HYPHEN: ew,
LEFTCORNERBRACKET: ei,
LEFTWHITECORNERBRACKET: es,
LOCALHOST: _,
NL: "NL",
NUM: "NUM",
OPENANGLEBRACKET: ee,
OPENBRACE: J,
OPENBRACKET: Y,
OPENPAREN: X,
PERCENT: eS,
PIPE: ex,
PLUS: eM,
POUND: eC,
QUERY: eT,
QUOTE: eN,
RIGHTCORNERBRACKET: eo,
RIGHTWHITECORNERBRACKET: el,
SCHEME: K,
SEMI: eO,
SLASH: eA,
SLASH_SCHEME: U,
SYM: "SYM",
TILDE: eD,
TLD: "TLD",
UNDERSCORE: eR,
UTLD: q,
UWORD: V,
WORD: F,
WS: "WS",
});
let eL = /[a-z]/,
ez = /\p{L}/u,
eB = /\p{Emoji}/u,
e$ = /\d/,
ej = /\s/,
eF = null,
eV = null;
function eH(e, t) {
let n = (function (e) {
let t = [],
n = e.length,
r = 0;
for (; r < n; ) {
let i,
o = e.charCodeAt(r),
s =
o < 55296 ||
o > 56319 ||
r + 1 === n ||
(i = e.charCodeAt(r + 1)) < 56320 ||
i > 57343
? e[r]
: e.slice(r, r + 2);
t.push(s), (r += s.length);
}
return t;
})(t.replace(/[A-Z]/g, (e) => e.toLowerCase())),
r = n.length,
i = [],
o = 0,
s = 0;
for (; s < r; ) {
let l = e,
a = null,
d = 0,
c = null,
h = -1,
p = -1;
for (; s < r && (a = l.go(n[s])); )
(l = a).accepts()
? ((h = 0), (p = 0), (c = l))
: h >= 0 && ((h += n[s].length), p++),
(d += n[s].length),
(o += n[s].length),
s++;
(o -= h),
(s -= p),
(d -= h),
i.push({ t: c.t, v: t.slice(o - d, o), s: o - d, e: o });
}
return i;
}
function eW(e, t, n, r, i) {
let o,
s = t.length;
for (let n = 0; n < s - 1; n++) {
let s = t[n];
e.j[s] ? (o = e.j[s]) : (((o = new L(r)).jr = i.slice()), (e.j[s] = o)),
(e = o);
}
return ((o = new L(n)).jr = i.slice()), (e.j[t[s - 1]] = o), o;
}
function e_(e) {
let t = [],
n = [],
r = 0;
for (; r < e.length; ) {
let i = 0;
for (; "0123456789".indexOf(e[r + i]) >= 0; ) i++;
if (i > 0) {
t.push(n.join(""));
for (let t = parseInt(e.substring(r, r + i), 10); t > 0; t--) n.pop();
r += i;
} else n.push(e[r]), r++;
}
return t;
}
let eq = {
defaultProtocol: "http",
events: null,
format: eU,
formatHref: eU,
nl2br: !1,
tagName: "a",
target: null,
rel: null,
validate: !0,
truncate: 1 / 0,
className: null,
attributes: null,
ignoreTags: [],
render: null,
};
function eK(e, t = null) {
let n = Object.assign({}, eq);
e && (n = Object.assign(n, e instanceof eK ? e.o : e));
let r = n.ignoreTags,
i = [];
for (let e = 0; e < r.length; e++) i.push(r[e].toUpperCase());
(this.o = n), t && (this.defaultRender = t), (this.ignoreTags = i);
}
function eU(e) {
return e;
}
function eJ(e, t) {
(this.t = "token"), (this.v = e), (this.tk = t);
}
function eG(e, t) {
class n extends eJ {
constructor(t, n) {
super(t, n), (this.t = e);
}
}
for (let e in t) n.prototype[e] = t[e];
return (n.t = e), n;
}
(eK.prototype = {
o: eq,
ignoreTags: [],
defaultRender: (e) => e,
check(e) {
return this.get("validate", e.toString(), e);
},
get(e, t, n) {
let r = null != t,
i = this.o[e];
return (
i &&
("object" == typeof i
? "function" == typeof (i = n.t in i ? i[n.t] : eq[e]) &&
r &&
(i = i(t, n))
: "function" == typeof i && r && (i = i(t, n.t, n))),
i
);
},
getObj(e, t, n) {
let r = this.o[e];
return "function" == typeof r && null != t && (r = r(t, n.t, n)), r;
},
render(e) {
let t = e.render(this);
return (this.get("render", null, e) || this.defaultRender)(t, e.t, e);
},
}),
(eJ.prototype = {
isLink: !1,
toString() {
return this.v;
},
toHref(e) {
return this.toString();
},
toFormattedString(e) {
let t = this.toString(),
n = e.get("truncate", t, this),
r = e.get("format", t, this);
return n && r.length > n ? r.substring(0, n) + "…" : r;
},
toFormattedHref(e) {
return e.get(
"formatHref",
this.toHref(e.get("defaultProtocol")),
this,
);
},
startIndex() {
return this.tk[0].s;
},
endIndex() {
return this.tk[this.tk.length - 1].e;
},
toObject(e = eq.defaultProtocol) {
return {
type: this.t,
value: this.toString(),
isLink: this.isLink,
href: this.toHref(e),
start: this.startIndex(),
end: this.endIndex(),
};
},
toFormattedObject(e) {
return {
type: this.t,
value: this.toFormattedString(e),
isLink: this.isLink,
href: this.toFormattedHref(e),
start: this.startIndex(),
end: this.endIndex(),
};
},
validate(e) {
return e.get("validate", this.toString(), this);
},
render(e) {
let t = this.toHref(e.get("defaultProtocol")),
n = e.get("formatHref", t, this),
r = e.get("tagName", t, this),
i = this.toFormattedString(e),
o = {},
s = e.get("className", t, this),
l = e.get("target", t, this),
a = e.get("rel", t, this),
d = e.getObj("attributes", t, this),
c = e.getObj("events", t, this);
return (
(o.href = n),
s && (o.class = s),
l && (o.target = l),
a && (o.rel = a),
d && Object.assign(o, d),
{ tagName: r, attributes: o, content: i, eventListeners: c }
);
},
});
let eY = eG("email", {
isLink: !0,
toHref() {
return "mailto:" + this.toString();
},
}),
eQ = eG("text"),
eX = eG("nl"),
eZ = eG("url", {
isLink: !0,
toHref(e = eq.defaultProtocol) {
return this.hasProtocol() ? this.v : `${e}://${this.v}`;
},
hasProtocol() {
let e = this.tk;
return e.length >= 2 && e[0].t !== _ && e[1].t === eg;
},
}),
e0 = (e) => new L(e);
function e1(e, t, n) {
let r = n[0].s,
i = n[n.length - 1].e;
return new e(t.slice(r, i), n);
}
let e2 = ("u" > typeof console && console && console.warn) || (() => {}),
e3 = {
scanner: null,
parser: null,
tokenQueue: [],
pluginQueue: [],
customSchemes: [],
initialized: !1,
};
function e4(e, t = !1) {
if (
(e3.initialized &&
e2(
`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,
),
!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))
)
throw Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);
e3.customSchemes.push([e, t]);
}
function e5(e) {
return (
e3.initialized ||
(function () {
e3.scanner = (function (e = []) {
let t = {};
L.groups = t;
let n = new L();
null == eF &&
(eF = e_(
"aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",
)),
null == eV &&
(eV = e_(
"ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",
)),
j(n, "'", eh),
j(n, "{", J),
j(n, "}", G),
j(n, "[", Y),
j(n, "]", Q),
j(n, "(", X),
j(n, ")", Z),
j(n, "<", ee),
j(n, ">", et),
j(n, "(", en),
j(n, ")", er),
j(n, "「", ei),
j(n, "」", eo),
j(n, "『", es),
j(n, "』", el),
j(n, "<", ea),
j(n, ">", ed),
j(n, "&", ec),
j(n, "*", ep),
j(n, "@", "AT"),
j(n, "`", ef),
j(n, "^", em),
j(n, ":", eg),
j(n, ",", ey),
j(n, "$", eb),
j(n, ".", "DOT"),
j(n, "=", ek),
j(n, "!", ev),
j(n, "-", ew),
j(n, "%", eS),
j(n, "|", ex),
j(n, "+", eM),
j(n, "#", eC),
j(n, "?", eT),
j(n, '"', eN),
j(n, "/", eA),
j(n, ";", eO),
j(n, "~", eD),
j(n, "_", eR),
j(n, "\\", eu),
j(n, "・", eE);
let r = B(n, e$, "NUM", { [T]: !0 });
B(r, e$, r);
let i = B(r, eL, H, { [O]: !0 }),
o = B(r, ez, W, { [A]: !0 }),
s = B(n, eL, F, { [N]: !0 });
B(s, e$, i), B(s, eL, s), B(i, e$, i), B(i, eL, i);
let l = B(n, ez, V, { [E]: !0 });
B(l, eL),
B(l, e$, o),
B(l, ez, l),
B(o, e$, o),
B(o, eL),
B(o, ez, o);
let a = j(n, "\n", "NL", { [I]: !0 }),
d = j(n, "\r", "WS", { [I]: !0 }),
c = B(n, ej, "WS", { [I]: !0 });
j(n, "", c),
j(d, "\n", a),
j(d, "", c),
B(d, ej, c),
j(c, "\r"),
j(c, "\n"),
B(c, ej, c),
j(c, "", c);
let h = B(n, eB, eI, { [R]: !0 });
j(h, "#"), B(h, eB, h), j(h, "️", h);
let p = j(h, "‍");
j(p, "#"), B(p, eB, h);
let u = [
[eL, s],
[e$, i],
],
f = [
[eL, null],
[ez, l],
[e$, o],
];
for (let e = 0; e < eF.length; e++) eW(n, eF[e], "TLD", F, u);
for (let e = 0; e < eV.length; e++) eW(n, eV[e], q, V, f);
P("TLD", { tld: !0, ascii: !0 }, t),
P(q, { utld: !0, alpha: !0 }, t),
eW(n, "file", K, F, u),
eW(n, "mailto", K, F, u),
eW(n, "http", U, F, u),
eW(n, "https", U, F, u),
eW(n, "ftp", U, F, u),
eW(n, "ftps", U, F, u),
P(K, { scheme: !0, ascii: !0 }, t),
P(U, { slashscheme: !0, ascii: !0 }, t),
(e = e.sort((e, t) => (e[0] > t[0] ? 1 : -1)));
for (let t = 0; t < e.length; t++) {
let r = e[t][0],
i = e[t][1] ? { scheme: !0 } : { slashscheme: !0 };
r.indexOf("-") >= 0
? (i[D] = !0)
: eL.test(r)
? e$.test(r)
? (i[O] = !0)
: (i[N] = !0)
: (i[T] = !0),
$(n, r, r, i);
}
return (
$(n, "localhost", _, { ascii: !0 }),
(n.jd = new L("SYM")),
{ start: n, tokens: Object.assign({ groups: t }, eP) }
);
})(e3.customSchemes);
for (let e = 0; e < e3.tokenQueue.length; e++)
e3.tokenQueue[e][1]({ scanner: e3.scanner });
e3.parser = (function ({ groups: e }) {
let t = e.domain.concat([
ec,
ep,
"AT",
eu,
ef,
em,
eb,
ek,
ew,
"NUM",
eS,
ex,
eM,
eC,
eA,
"SYM",
eD,
eR,
]),
n = [
eh,
eg,
ey,
"DOT",
ev,
eS,
eT,
eN,
eO,
ee,
et,
J,
G,
Q,
Y,
X,
Z,
en,
er,
ei,
eo,
es,
el,
ea,
ed,
],
r = [
ec,
eh,
ep,
eu,
ef,
em,
eb,
ek,
ew,
J,
G,
eS,
ex,
eM,
eC,
eT,
eA,
"SYM",
eD,
eR,
],
i = e0(),
o = j(i, eD);
z(o, r, o), z(o, e.domain, o);
let s = e0(),
l = e0(),
a = e0();
z(i, e.domain, s),
z(i, e.scheme, l),
z(i, e.slashscheme, a),
z(s, r, o),
z(s, e.domain, s);
let d = j(s, "AT");
j(o, "AT", d), j(l, "AT", d), j(a, "AT", d);
let c = j(o, "DOT");
z(c, r, o), z(c, e.domain, o);
let h = e0();
z(d, e.domain, h), z(h, e.domain, h);
let p = j(h, "DOT");
z(p, e.domain, h);
let u = e0(eY);
z(p, e.tld, u), z(p, e.utld, u), j(d, _, u);
let f = j(h, ew);
j(f, ew, f),
z(f, e.domain, h),
z(u, e.domain, h),
j(u, "DOT", p),
j(u, ew, f),
z(j(u, eg), e.numeric, eY);
let m = j(s, ew),
g = j(s, "DOT");
j(m, ew, m), z(m, e.domain, s), z(g, r, o), z(g, e.domain, s);
let y = e0(eZ);
z(g, e.tld, y),
z(g, e.utld, y),
z(y, e.domain, s),
z(y, r, o),
j(y, "DOT", g),
j(y, ew, m),
j(y, "AT", d);
let b = j(y, eg),
k = e0(eZ);
z(b, e.numeric, k);
let v = e0(eZ),
w = e0();
z(v, t, v),
z(v, n, w),
z(w, t, v),
z(w, n, w),
j(y, eA, v),
j(k, eA, v);
let S = j(l, eg),
x = j(a, eg),
M = j(x, eA),
C = j(M, eA);
z(l, e.domain, s),
j(l, "DOT", g),
j(l, ew, m),
z(a, e.domain, s),
j(a, "DOT", g),
j(a, ew, m),
z(S, e.domain, v),
j(S, eA, v),
j(S, eT, v),
z(C, e.domain, v),
z(C, t, v),
j(C, eA, v);
let T = [
[J, G],
[Y, Q],
[X, Z],
[ee, et],
[en, er],
[ei, eo],
[es, el],
[ea, ed],
];
for (let e = 0; e < T.length; e++) {
let [r, i] = T[e],
o = j(v, r);
j(w, r, o), j(o, i, v);
let s = e0(eZ);
z(o, t, s);
let l = e0();
z(o, n),
z(s, t, s),
z(s, n, l),
z(l, t, s),
z(l, n, l),
j(s, i, v),
j(l, i, v);
}
return j(i, _, y), j(i, "NL", eX), { start: i, tokens: eP };
})(e3.scanner.tokens);
for (let e = 0; e < e3.pluginQueue.length; e++)
e3.pluginQueue[e][1]({ scanner: e3.scanner, parser: e3.parser });
e3.initialized = !0;
})(),
(function (e, t, n) {
let r = n.length,
i = 0,
o = [],
s = [];
for (; i < r; ) {
let l = e,
a = null,
d = null,
c = 0,
h = null,
p = -1;
for (; i < r && !(a = l.go(n[i].t)); ) s.push(n[i++]);
for (; i < r && (d = a || l.go(n[i].t)); )
(a = null),
(l = d).accepts() ? ((p = 0), (h = l)) : p >= 0 && p++,
i++,
c++;
if (p < 0) (i -= c) < r && (s.push(n[i]), i++);
else {
s.length > 0 && (o.push(e1(eQ, t, s)), (s = [])),
(i -= p),
(c -= p);
let e = h.t,
r = n.slice(i - c, i);
o.push(e1(e, t, r));
}
}
return s.length > 0 && o.push(e1(eQ, t, s)), o;
})(e3.parser.start, e, eH(e3.scanner.start, e))
);
}
function e6(e, t = null, n = null) {
if (t && "object" == typeof t) {
if (n)
throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);
(n = t), (t = null);
}
let r = new eK(n),
i = e5(e),
o = [];
for (let e = 0; e < i.length; e++) {
let n = i[e];
n.isLink &&
(!t || n.t === t) &&
r.check(n) &&
o.push(n.toFormattedObject(r));
}
return o;
}
e5.scan = eH;
var e9 = "[\0-   ᠎ -\u2029  ]",
e7 = new RegExp(e9),
e8 = RegExp(`${e9}$`),
te = RegExp(e9, "g");
function tt(e, t) {
let n = [
"http",
"https",
"ftp",
"ftps",
"mailto",
"tel",
"callto",
"sms",
"cid",
"xmpp",
];
return (
t &&
t.forEach((e) => {
let t = "string" == typeof e ? e : e.scheme;
t && n.push(t);
}),
!e ||
e
.replace(te, "")
.match(
RegExp(
`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,
"i",
),
)
);
}
var tn = t.Mark.create({
name: "link",
priority: 1e3,
keepOnSplit: !1,
exitable: !0,
onCreate() {
this.options.validate &&
!this.options.shouldAutoLink &&
((this.options.shouldAutoLink = this.options.validate),
console.warn(
"The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.",
)),
this.options.protocols.forEach((e) => {
"string" == typeof e ? e4(e) : e4(e.scheme, e.optionalSlashes);
});
},
onDestroy() {
(L.groups = {}),
(e3.scanner = null),
(e3.parser = null),
(e3.tokenQueue = []),
(e3.pluginQueue = []),
(e3.customSchemes = []),
(e3.initialized = !1);
},
inclusive() {
return this.options.autolink;
},
addOptions: () => ({
openOnClick: !0,
enableClickSelection: !1,
linkOnPaste: !0,
autolink: !0,
protocols: [],
defaultProtocol: "http",
HTMLAttributes: {
target: "_blank",
rel: "noopener noreferrer nofollow",
class: null,
},
isAllowedUri: (e, t) => !!tt(e, t.protocols),
validate: (e) => !!e,
shouldAutoLink: (e) => {
let t = /^[a-z][a-z0-9+.-]*:\/\//i.test(e),
n = /^[a-z][a-z0-9+.-]*:/i.test(e);
if (t || (n && !e.includes("@"))) return !0;
let r = (e.includes("@") ? e.split("@").pop() : e).split(
/[/?#:]/,
)[0];
return !/^\d{1,3}(\.\d{1,3}){3}$/.test(r) && !!/\./.test(r);
},
}),
addAttributes() {
return {
href: { default: null, parseHTML: (e) => e.getAttribute("href") },
target: { default: this.options.HTMLAttributes.target },
rel: { default: this.options.HTMLAttributes.rel },
class: { default: this.options.HTMLAttributes.class },
title: { default: null },
};
},
parseHTML() {
return [
{
tag: "a[href]",
getAttrs: (e) => {
let t = e.getAttribute("href");
return (
!!t &&
!!this.options.isAllowedUri(t, {
defaultValidate: (e) => !!tt(e, this.options.protocols),
protocols: this.options.protocols,
defaultProtocol: this.options.defaultProtocol,
}) &&
null
);
},
},
];
},
renderHTML({ HTMLAttributes: e }) {
return this.options.isAllowedUri(e.href, {
defaultValidate: (e) => !!tt(e, this.options.protocols),
protocols: this.options.protocols,
defaultProtocol: this.options.defaultProtocol,
})
? ["a", (0, t.mergeAttributes)(this.options.HTMLAttributes, e), 0]
: [
"a",
(0, t.mergeAttributes)(this.options.HTMLAttributes, {
...e,
href: "",
}),
0,
];
},
markdownTokenName: "link",
parseMarkdown: (e, t) =>
t.applyMark("link", t.parseInline(e.tokens || []), {
href: e.href,
title: e.title || null,
}),
renderMarkdown: (e, t) => {
var n, r, i, o;
let s =
null != (r = null == (n = e.attrs) ? void 0 : n.href) ? r : "",
l = null != (o = null == (i = e.attrs) ? void 0 : i.title) ? o : "",
a = t.renderChildren(e);
return l ? `[${a}](${s} "${l}")` : `[${a}](${s})`;
},
addCommands() {
return {
setLink:
(e) =>
({ chain: t }) => {
let { href: n } = e;
return (
!!this.options.isAllowedUri(n, {
defaultValidate: (e) => !!tt(e, this.options.protocols),
protocols: this.options.protocols,
defaultProtocol: this.options.defaultProtocol,
}) &&
t().setMark(this.name, e).setMeta("preventAutolink", !0).run()
);
},
toggleLink:
(e) =>
({ chain: t }) => {
let { href: n } = e || {};
return (
(!n ||
!!this.options.isAllowedUri(n, {
defaultValidate: (e) => !!tt(e, this.options.protocols),
protocols: this.options.protocols,
defaultProtocol: this.options.defaultProtocol,
})) &&
t()
.toggleMark(this.name, e, { extendEmptyMarkRange: !0 })
.setMeta("preventAutolink", !0)
.run()
);
},
unsetLink:
() =>
({ chain: e }) =>
e()
.unsetMark(this.name, { extendEmptyMarkRange: !0 })
.setMeta("preventAutolink", !0)
.run(),
};
},
addPasteRules() {
return [
(0, t.markPasteRule)({
find: (e) => {
let t = [];
if (e) {
let { protocols: n, defaultProtocol: r } = this.options,
i = e6(e).filter(
(e) =>
e.isLink &&
this.options.isAllowedUri(e.value, {
defaultValidate: (e) => !!tt(e, n),
protocols: n,
defaultProtocol: r,
}),
);
i.length &&
i.forEach((e) => {
this.options.shouldAutoLink(e.value) &&
t.push({
text: e.value,
data: { href: e.href },
index: e.start,
});
});
}
return t;
},
type: this.type,
getAttributes: (e) => {
var t;
return { href: null == (t = e.data) ? void 0 : t.href };
},
}),
];
},
addProseMirrorPlugins() {
var e, n, r;
let i = [],
{ protocols: o, defaultProtocol: s } = this.options;
return (
this.options.autolink &&
i.push(
((e = {
type: this.type,
defaultProtocol: this.options.defaultProtocol,
validate: (e) =>
this.options.isAllowedUri(e, {
defaultValidate: (e) => !!tt(e, o),
protocols: o,
defaultProtocol: s,
}),
shouldAutoLink: this.options.shouldAutoLink,
}),
new u.Plugin({
key: new u.PluginKey("autolink"),
appendTransaction: (n, r, i) => {
let o = n.some((e) => e.docChanged) && !r.doc.eq(i.doc),
s = n.some((e) => e.getMeta("preventAutolink"));
if (!o || s) return;
let { tr: l } = i,
a = (0, t.combineTransactionSteps)(r.doc, [...n]);
if (
((0, t.getChangedRanges)(a).forEach(({ newRange: n }) => {
let r,
o,
s = (0, t.findChildrenInRange)(
i.doc,
n,
(e) => e.isTextblock,
);
if (s.length > 1)
(r = s[0]),
(o = i.doc.textBetween(
r.pos,
r.pos + r.node.nodeSize,
void 0,
" ",
));
else if (s.length) {
let e = i.doc.textBetween(n.from, n.to, " ", " ");
if (!e8.test(e)) return;
(r = s[0]),
(o = i.doc.textBetween(r.pos, n.to, void 0, " "));
}
if (r && o) {
let n = o.split(e7).filter(Boolean);
if (n.length <= 0) return !1;
let s = n[n.length - 1],
a = r.pos + o.lastIndexOf(s);
if (!s) return !1;
let d = e5(s).map((t) =>
t.toObject(e.defaultProtocol),
);
if (
!(1 === d.length
? d[0].isLink
: 3 === d.length &&
!!d[1].isLink &&
["()", "[]"].includes(d[0].value + d[2].value))
)
return !1;
d.filter((e) => e.isLink)
.map((e) => ({
...e,
from: a + e.start + 1,
to: a + e.end + 1,
}))
.filter(
(e) =>
!i.schema.marks.code ||
!i.doc.rangeHasMark(
e.from,
e.to,
i.schema.marks.code,
),
)
.filter((t) => e.validate(t.value))
.filter((t) => e.shouldAutoLink(t.value))
.forEach((n) => {
(0, t.getMarksBetween)(n.from, n.to, i.doc).some(
(t) => t.mark.type === e.type,
) ||
l.addMark(
n.from,
n.to,
e.type.create({ href: n.href }),
);
});
}
}),
l.steps.length)
)
return l;
},
})),
),
i.push(
((n = {
type: this.type,
editor: this.editor,
openOnClick:
"whenNotEditable" === this.options.openOnClick ||
this.options.openOnClick,
enableClickSelection: this.options.enableClickSelection,
}),
new u.Plugin({
key: new u.PluginKey("handleClickLink"),
props: {
handleClick: (e, r, i) => {
var o, s;
if (0 !== i.button || !e.editable) return !1;
let l = null;
if (i.target instanceof HTMLAnchorElement) l = i.target;
else {
let e = i.target;
if (!e) return !1;
let t = n.editor.view.dom;
(l = e.closest("a")) && !t.contains(l) && (l = null);
}
if (!l) return !1;
let a = !1;
if (
(n.enableClickSelection &&
(a = n.editor.commands.extendMarkRange(n.type.name)),
n.openOnClick)
) {
let r = (0, t.getAttributes)(e.state, n.type.name),
i = null != (o = l.href) ? o : r.href,
d = null != (s = l.target) ? s : r.target;
i && (window.open(i, d), (a = !0));
}
return a;
},
},
})),
),
this.options.linkOnPaste &&
i.push(
((r = {
editor: this.editor,
defaultProtocol: this.options.defaultProtocol,
type: this.type,
shouldAutoLink: this.options.shouldAutoLink,
}),
new u.Plugin({
key: new u.PluginKey("handlePasteLink"),
props: {
handlePaste: (e, t, n) => {
let { shouldAutoLink: i } = r,
{ state: o } = e,
{ selection: s } = o,
{ empty: l } = s;
if (l) return !1;
let a = "";
n.content.forEach((e) => {
a += e.textContent;
});
let d = e6(a, {
defaultProtocol: r.defaultProtocol,
}).find((e) => e.isLink && e.value === a);
return (
!!a &&
!!d &&
(void 0 === i || !!i(d.value)) &&
r.editor.commands.setMark(r.type, { href: d.href })
);
},
},
})),
),
i
);
},
}),
tr = Object.defineProperty,
ti = "textStyle",
to = /^\s*([-+*])\s$/,
ts = t.Node.create({
name: "bulletList",
addOptions: () => ({
itemTypeName: "listItem",
HTMLAttributes: {},
keepMarks: !1,
keepAttributes: !1,
}),
group: "block list",
content() {
return `${this.options.itemTypeName}+`;
},
parseHTML: () => [{ tag: "ul" }],
renderHTML({ HTMLAttributes: e }) {
return [
"ul",
(0, t.mergeAttributes)(this.options.HTMLAttributes, e),
0,
];
},
markdownTokenName: "list",
parseMarkdown: (e, t) =>
"list" !== e.type || e.ordered
? []
: {
type: "bulletList",
content: e.items ? t.parseChildren(e.items) : [],
},
renderMarkdown: (e, t) =>
e.content ? t.renderChildren(e.content, "\n") : "",
markdownOptions: { indentsContent: !0 },
addCommands() {
return {
toggleBulletList:
() =>
({ commands: e, chain: t }) =>
this.options.keepAttributes
? t()
.toggleList(
this.name,
this.options.itemTypeName,
this.options.keepMarks,
)
.updateAttributes(
"listItem",
this.editor.getAttributes(ti),
)
.run()
: e.toggleList(
this.name,
this.options.itemTypeName,
this.options.keepMarks,
),
};
},
addKeyboardShortcuts() {
return {
"Mod-Shift-8": () => this.editor.commands.toggleBulletList(),
};
},
addInputRules() {
let e = (0, t.wrappingInputRule)({ find: to, type: this.type });
return (
(this.options.keepMarks || this.options.keepAttributes) &&
(e = (0, t.wrappingInputRule)({
find: to,
type: this.type,
keepMarks: this.options.keepMarks,
keepAttributes: this.options.keepAttributes,
getAttributes: () => this.editor.getAttributes(ti),
editor: this.editor,
})),
[e]
);
},
}),
tl = t.Node.create({
name: "listItem",
addOptions: () => ({
HTMLAttributes: {},
bulletListTypeName: "bulletList",
orderedListTypeName: "orderedList",
}),
content: "paragraph block*",
defining: !0,
parseHTML: () => [{ tag: "li" }],
renderHTML({ HTMLAttributes: e }) {
return [
"li",
(0, t.mergeAttributes)(this.options.HTMLAttributes, e),
0,
];
},
markdownTokenName: "list_item",
parseMarkdown: (e, t) => {
if ("list_item" !== e.type) return [];
let n = [];
if (e.tokens && e.tokens.length > 0)
if (e.tokens.some((e) => "paragraph" === e.type))
n = t.parseChildren(e.tokens);
else {
let r = e.tokens[0];
if (r && "text" === r.type && r.tokens && r.tokens.length > 0) {
if (
((n = [
{ type: "paragraph", content: t.parseInline(r.tokens) },
]),
e.tokens.length > 1)
) {
let r = e.tokens.slice(1),
i = t.parseChildren(r);
n.push(...i);
}
} else n = t.parseChildren(e.tokens);
}
return (
0 === n.length && (n = [{ type: "paragraph", content: [] }]),
{ type: "listItem", content: n }
);
},
renderMarkdown: (e, n, r) =>
(0, t.renderNestedMarkdownContent)(
e,
n,
(e) => {
var t, n;
if ("bulletList" === e.parentType) return "- ";
if ("orderedList" === e.parentType) {
let r =
(null == (n = null == (t = e.meta) ? void 0 : t.parentAttrs)
? void 0
: n.start) || 1;
return `${r + e.index}. `;
}
return "- ";
},
r,
),
addKeyboardShortcuts() {
return {
Enter: () => this.editor.commands.splitListItem(this.name),
Tab: () => this.editor.commands.sinkListItem(this.name),
"Shift-Tab": () => this.editor.commands.liftListItem(this.name),
};
},
}),
ta = {},
td = {
findListItemPos: () => th,
getNextListDepth: () => tp,
handleBackspace: () => tg,
handleDelete: () => tk,
hasListBefore: () => tu,
hasListItemAfter: () => tv,
hasListItemBefore: () => tf,
listItemHasSubList: () => tm,
nextListIsDeeper: () => ty,
nextListIsHigher: () => tb,
};
for (var tc in td) tr(ta, tc, { get: td[tc], enumerable: !0 });
var th = (e, n) => {
let { $from: r } = n.selection,
i = (0, t.getNodeType)(e, n.schema),
o = r.depth,
s = r.pos,
l = null;
for (; o > 0 && null === l; )
r.node(o).type === i ? (l = o) : ((o -= 1), (s -= 1));
return null === l ? null : { $pos: n.doc.resolve(s), depth: l };
},
tp = (e, n) => {
let r = th(e, n);
if (!r) return !1;
let [, i] = (0, t.getNodeAtPosition)(n, e, r.$pos.pos + 4);
return i;
},
tu = (e, t, n) => {
let { $anchor: r } = e.selection,
i = Math.max(0, r.pos - 2),
o = e.doc.resolve(i).node();
return !!o && !!n.includes(o.type.name);
},
tf = (e, t) => {
var n;
let { $anchor: r } = t.selection,
i = t.doc.resolve(r.pos - 2);
return (
0 !== i.index() &&
(null == (n = i.nodeBefore) ? void 0 : n.type.name) === e
);
},
tm = (e, n, r) => {
if (!r) return !1;
let i = (0, t.getNodeType)(e, n.schema),
o = !1;
return (
r.descendants((e) => {
e.type === i && (o = !0);
}),
o
);
},
tg = (e, n, r) => {
if (e.commands.undoInputRule()) return !0;
if (e.state.selection.from !== e.state.selection.to) return !1;
if (!(0, t.isNodeActive)(e.state, n) && tu(e.state, n, r)) {
let { $anchor: t } = e.state.selection,
r = e.state.doc.resolve(t.before() - 1),
i = [];
r.node().descendants((e, t) => {
e.type.name === n && i.push({ node: e, pos: t });
});
let o = i.at(-1);
if (!o) return !1;
let s = e.state.doc.resolve(r.start() + o.pos + 1);
return e
.chain()
.cut({ from: t.start() - 1, to: t.end() + 1 }, s.end())
.joinForward()
.run();
}
if (
!(0, t.isNodeActive)(e.state, n) ||
!(0, t.isAtStartOfNode)(e.state)
)
return !1;
let i = th(n, e.state);
if (!i) return !1;
let o = e.state.doc.resolve(i.$pos.pos - 2).node(i.depth),
s = tm(n, e.state, o);
return tf(n, e.state) && !s
? e.commands.joinItemBackward()
: e.chain().liftListItem(n).run();
},
ty = (e, t) => {
let n = tp(e, t),
r = th(e, t);
return !!r && !!n && n > r.depth;
},
tb = (e, t) => {
let n = tp(e, t),
r = th(e, t);
return !!r && !!n && n < r.depth;
},
tk = (e, n) => {
if (
!(0, t.isNodeActive)(e.state, n) ||
!(0, t.isAtEndOfNode)(e.state, n)
)
return !1;
let { selection: r } = e.state,
{ $from: i, $to: o } = r;
return (
!(!r.empty && i.sameParent(o)) &&
(ty(n, e.state)
? e
.chain()
.focus(e.state.selection.from + 4)
.lift(n)
.joinBackward()
.run()
: tb(n, e.state)
? e.chain().joinForward().joinBackward().run()
: e.commands.joinItemForward())
);
},
tv = (e, t) => {
var n;
let { $anchor: r } = t.selection,
i = t.doc.resolve(r.pos - r.parentOffset - 2);
return (
i.index() !== i.parent.childCount - 1 &&
(null == (n = i.nodeAfter) ? void 0 : n.type.name) === e
);
},
tw = t.Extension.create({
name: "listKeymap",
addOptions: () => ({
listTypes: [
{
itemName: "listItem",
wrapperNames: ["bulletList", "orderedList"],
},
{ itemName: "taskItem", wrapperNames: ["taskList"] },
],
}),
addKeyboardShortcuts() {
return {
Delete: ({ editor: e }) => {
let t = !1;
return (
this.options.listTypes.forEach(({ itemName: n }) => {
void 0 !== e.state.schema.nodes[n] && tk(e, n) && (t = !0);
}),
t
);
},
"Mod-Delete": ({ editor: e }) => {
let t = !1;
return (
this.options.listTypes.forEach(({ itemName: n }) => {
void 0 !== e.state.schema.nodes[n] && tk(e, n) && (t = !0);
}),
t
);
},
Backspace: ({ editor: e }) => {
let t = !1;
return (
this.options.listTypes.forEach(
({ itemName: n, wrapperNames: r }) => {
void 0 !== e.state.schema.nodes[n] &&
tg(e, n, r) &&
(t = !0);
},
),
t
);
},
"Mod-Backspace": ({ editor: e }) => {
let t = !1;
return (
this.options.listTypes.forEach(
({ itemName: n, wrapperNames: r }) => {
void 0 !== e.state.schema.nodes[n] &&
tg(e, n, r) &&
(t = !0);
},
),
t
);
},
};
},
}),
tS = /^(\s*)(\d+)\.\s+(.*)$/,
tx = /^\s/,
tM = "textStyle",
tC = /^(\d+)\.\s$/,
tT = t.Node.create({
name: "orderedList",
addOptions: () => ({
itemTypeName: "listItem",
HTMLAttributes: {},
keepMarks: !1,
keepAttributes: !1,
}),
group: "block list",
content() {
return `${this.options.itemTypeName}+`;
},
addAttributes: () => ({
start: {
default: 1,
parseHTML: (e) =>
e.hasAttribute("start")
? parseInt(e.getAttribute("start") || "", 10)
: 1,
},
type: { default: null, parseHTML: (e) => e.getAttribute("type") },
}),
parseHTML: () => [{ tag: "ol" }],
renderHTML({ HTMLAttributes: e }) {
let { start: n, ...r } = e;
return 1 === n
? ["ol", (0, t.mergeAttributes)(this.options.HTMLAttributes, r), 0]
: ["ol", (0, t.mergeAttributes)(this.options.HTMLAttributes, e), 0];
},
markdownTokenName: "list",
parseMarkdown: (e, t) => {
var n;
if ("list" !== e.type || !e.ordered) return [];
let r = e.start || 1,
i = e.items
? ((n = e.items),
n.map((e) => {
if ("list_item" !== e.type) return t.parseChildren([e])[0];
let n = [];
return (
e.tokens &&
e.tokens.length > 0 &&
e.tokens.forEach((e) => {
if (
"paragraph" === e.type ||
"list" === e.type ||
"blockquote" === e.type ||
"code" === e.type
)
n.push(...t.parseChildren([e]));
else if ("text" === e.type && e.tokens) {
let r = t.parseChildren([e]);
n.push({ type: "paragraph", content: r });
} else {
let r = t.parseChildren([e]);
r.length > 0 && n.push(...r);
}
}),
{ type: "listItem", content: n }
);
}))
: [];
return 1 !== r
? { type: "orderedList", attrs: { start: r }, content: i }
: { type: "orderedList", content: i };
},
renderMarkdown: (e, t) =>
e.content ? t.renderChildren(e.content, "\n") : "",
markdownTokenizer: {
name: "orderedList",
level: "block",
start: (e) => {
let t = e.match(/^(\s*)(\d+)\.\s+/),
n = null == t ? void 0 : t.index;
return void 0 !== n ? n : -1;
},
tokenize: (e, t, n) => {
var r;
let i = e.split("\n"),
[o, s] = (function (e) {
let t = [],
n = 0,
r = 0;
for (; n < e.length; ) {
let i = e[n],
o = i.match(tS);
if (!o) break;
let [, s, l, a] = o,
d = s.length,
c = a,
h = n + 1,
p = [i];
for (; h < e.length; ) {
let t = e[h];
if (t.match(tS)) break;
if ("" === t.trim()) p.push(t), (c += "\n"), (h += 1);
else if (t.match(tx))
p.push(t),
(c += `
${t.slice(d + 2)}`),
(h += 1);
else break;
}
t.push({
indent: d,
number: parseInt(l, 10),
content: c.trim(),
raw: p.join("\n"),
}),
(r = h),
(n = h);
}
return [t, r];
})(i);
if (0 === o.length) return;
let l = (function e(t, n, r) {
var i;
let o = [],
s = 0;
for (; s < t.length; ) {
let l = t[s];
if (l.indent === n) {
let a = l.content.split("\n"),
d = (null == (i = a[0]) ? void 0 : i.trim()) || "",
c = [];
d &&
c.push({
type: "paragraph",
raw: d,
tokens: r.inlineTokens(d),
});
let h = a.slice(1).join("\n").trim();
if (h) {
let e = r.blockTokens(h);
c.push(...e);
}
let p = s + 1,
u = [];
for (; p < t.length && t[p].indent > n; )
u.push(t[p]), (p += 1);
if (u.length > 0) {
let t = Math.min(...u.map((e) => e.indent)),
n = e(u, t, r);
c.push({
type: "list",
ordered: !0,
start: u[0].number,
items: n,
raw: u.map((e) => e.raw).join("\n"),
});
}
o.push({ type: "list_item", raw: l.raw, tokens: c }), (s = p);
} else s += 1;
}
return o;
})(o, 0, n);
if (0 !== l.length)
return {
type: "list",
ordered: !0,
start: (null == (r = o[0]) ? void 0 : r.number) || 1,
items: l,
raw: i.slice(0, s).join("\n"),
};
},
},
markdownOptions: { indentsContent: !0 },
addCommands() {
return {
toggleOrderedList:
() =>
({ commands: e, chain: t }) =>
this.options.keepAttributes
? t()
.toggleList(
this.name,
this.options.itemTypeName,
this.options.keepMarks,
)
.updateAttributes(
"listItem",
this.editor.getAttributes(tM),
)
.run()
: e.toggleList(
this.name,
this.options.itemTypeName,
this.options.keepMarks,
),
};
},
addKeyboardShortcuts() {
return {
"Mod-Shift-7": () => this.editor.commands.toggleOrderedList(),
};
},
addInputRules() {
let e = (0, t.wrappingInputRule)({
find: tC,
type: this.type,
getAttributes: (e) => ({ start: +e[1] }),
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1],
});
return (
(this.options.keepMarks || this.options.keepAttributes) &&
(e = (0, t.wrappingInputRule)({
find: tC,
type: this.type,
keepMarks: this.options.keepMarks,
keepAttributes: this.options.keepAttributes,
getAttributes: (e) => ({
start: +e[1],
...this.editor.getAttributes(tM),
}),
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1],
editor: this.editor,
})),
[e]
);
},
}),
tN = /^\s*(\[([( |x])?\])\s$/,
tE = t.Node.create({
name: "taskItem",
addOptions: () => ({
nested: !1,
HTMLAttributes: {},
taskListTypeName: "taskList",
a11y: void 0,
}),
content() {
return this.options.nested ? "paragraph block*" : "paragraph+";
},
defining: !0,
addAttributes: () => ({
checked: {
default: !1,
keepOnSplit: !1,
parseHTML: (e) => {
let t = e.getAttribute("data-checked");
return "" === t || "true" === t;
},
renderHTML: (e) => ({ "data-checked": e.checked }),
},
}),
parseHTML() {
return [{ tag: `li[data-type="${this.name}"]`, priority: 51 }];
},
renderHTML({ node: e, HTMLAttributes: n }) {
return [
"li",
(0, t.mergeAttributes)(this.options.HTMLAttributes, n, {
"data-type": this.name,
}),
[
"label",
[
"input",
{
type: "checkbox",
checked: e.attrs.checked ? "checked" : null,
},
],
["span"],
],
["div", 0],
];
},
parseMarkdown: (e, t) => {
let n = [];
if (
(e.tokens && e.tokens.length > 0
? n.push(t.createNode("paragraph", {}, t.parseInline(e.tokens)))
: e.text
? n.push(
t.createNode("paragraph", {}, [
t.createNode("text", { text: e.text }),
]),
)
: n.push(t.createNode("paragraph", {}, [])),
e.nestedTokens && e.nestedTokens.length > 0)
) {
let r = t.parseChildren(e.nestedTokens);
n.push(...r);
}
return t.createNode("taskItem", { checked: e.checked || !1 }, n);
},
renderMarkdown: (e, n) => {
var r;
let i = (null == (r = e.attrs) ? void 0 : r.checked) ? "x" : " ",
o = `- [${i}] `;
return (0, t.renderNestedMarkdownContent)(e, n, o);
},
addKeyboardShortcuts() {
let e = {
Enter: () => this.editor.commands.splitListItem(this.name),
"Shift-Tab": () => this.editor.commands.liftListItem(this.name),
};
return this.options.nested
? { ...e, Tab: () => this.editor.commands.sinkListItem(this.name) }
: e;
},
addNodeView() {
return ({ node: e, HTMLAttributes: n, getPos: r, editor: i }) => {
let o = document.createElement("li"),
s = document.createElement("label"),
l = document.createElement("span"),
a = document.createElement("input"),
d = document.createElement("div"),
c = (e) => {
var t, n;
a.ariaLabel =
(null ==
(n =
null == (t = this.options.a11y) ? void 0 : t.checkboxLabel)
? void 0
: n.call(t, e, a.checked)) ||
`Task item checkbox for ${e.textContent || "empty task item"}`;
};
c(e),
(s.contentEditable = "false"),
(a.type = "checkbox"),
a.addEventListener("mousedown", (e) => e.preventDefault()),
a.addEventListener("change", (t) => {
if (!i.isEditable && !this.options.onReadOnlyChecked) {
a.checked = !a.checked;
return;
}
let { checked: n } = t.target;
i.isEditable &&
"function" == typeof r &&
i
.chain()
.focus(void 0, { scrollIntoView: !1 })
.command(({ tr: e }) => {
let t = r();
if ("number" != typeof t) return !1;
let i = e.doc.nodeAt(t);
return (
e.setNodeMarkup(t, void 0, {
...(null == i ? void 0 : i.attrs),
checked: n,
}),
!0
);
})
.run(),
i.isEditable ||
!this.options.onReadOnlyChecked ||
this.options.onReadOnlyChecked(e, n) ||
(a.checked = !a.checked);
}),
Object.entries(this.options.HTMLAttributes).forEach(([e, t]) => {
o.setAttribute(e, t);
}),
(o.dataset.checked = e.attrs.checked),
(a.checked = e.attrs.checked),
s.append(a, l),
o.append(s, d),
Object.entries(n).forEach(([e, t]) => {
o.setAttribute(e, t);
});
let h = new Set(Object.keys(n));
return {
dom: o,
contentDOM: d,
update: (e) => {
if (e.type !== this.type) return !1;
(o.dataset.checked = e.attrs.checked),
(a.checked = e.attrs.checked),
c(e);
let n = i.extensionManager.attributes,
r = (0, t.getRenderedAttributes)(e, n),
s = new Set(Object.keys(r)),
l = this.options.HTMLAttributes;
return (
h.forEach((e) => {
s.has(e) ||
(e in l ? o.setAttribute(e, l[e]) : o.removeAttribute(e));
}),
Object.entries(r).forEach(([e, t]) => {
null == t
? e in l
? o.setAttribute(e, l[e])
: o.removeAttribute(e)
: o.setAttribute(e, t);
}),
(h = s),
!0
);
},
};
};
},
addInputRules() {
return [
(0, t.wrappingInputRule)({
find: tN,
type: this.type,
getAttributes: (e) => ({ checked: "x" === e[e.length - 1] }),
}),
];
},
}),
tO = t.Node.create({
name: "taskList",
addOptions: () => ({ itemTypeName: "taskItem", HTMLAttributes: {} }),
group: "block list",
content() {
return `${this.options.itemTypeName}+`;
},
parseHTML() {
return [{ tag: `ul[data-type="${this.name}"]`, priority: 51 }];
},
renderHTML({ HTMLAttributes: e }) {
return [
"ul",
(0, t.mergeAttributes)(this.options.HTMLAttributes, e, {
"data-type": this.name,
}),
0,
];
},
parseMarkdown: (e, t) =>
t.createNode("taskList", {}, t.parseChildren(e.items || [])),
renderMarkdown: (e, t) =>
e.content ? t.renderChildren(e.content, "\n") : "",
markdownTokenizer: {
name: "taskList",
level: "block",
start(e) {
var t;
let n =
null == (t = e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))
? void 0
: t.index;
return void 0 !== n ? n : -1;
},
tokenize(e, n, r) {
let i = (e) => {
let n = (0, t.parseIndentedBlocks)(
e,
{
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
extractItemData: (e) => ({
indentLevel: e[1].length,
mainContent: e[4],
checked: "x" === e[3].toLowerCase(),
}),
createToken: (e, t) => ({
type: "taskItem",
raw: "",
mainContent: e.mainContent,
indentLevel: e.indentLevel,
checked: e.checked,
text: e.mainContent,
tokens: r.inlineTokens(e.mainContent),
nestedTokens: t,
}),
customNestedParser: i,
},
r,
);
return n
? [{ type: "taskList", raw: n.raw, items: n.items }]
: r.blockTokens(e);
},
o = (0, t.parseIndentedBlocks)(
e,
{
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
extractItemData: (e) => ({
indentLevel: e[1].length,
mainContent: e[4],
checked: "x" === e[3].toLowerCase(),
}),
createToken: (e, t) => ({
type: "taskItem",
raw: "",
mainContent: e.mainContent,
indentLevel: e.indentLevel,
checked: e.checked,
text: e.mainContent,
tokens: r.inlineTokens(e.mainContent),
nestedTokens: t,
}),
customNestedParser: i,
},
r,
);
if (o) return { type: "taskList", raw: o.raw, items: o.items };
},
},
markdownOptions: { indentsContent: !0 },
addCommands() {
return {
toggleTaskList:
() =>
({ commands: e }) =>
e.toggleList(this.name, this.options.itemTypeName),
};
},
addKeyboardShortcuts() {
return { "Mod-Shift-9": () => this.editor.commands.toggleTaskList() };
},
});
t.Extension.create({
name: "listKit",
addExtensions() {
let e = [];
return (
!1 !== this.options.bulletList &&
e.push(ts.configure(this.options.bulletList)),
!1 !== this.options.listItem &&
e.push(tl.configure(this.options.listItem)),
!1 !== this.options.listKeymap &&
e.push(tw.configure(this.options.listKeymap)),
!1 !== this.options.orderedList &&
e.push(tT.configure(this.options.orderedList)),
!1 !== this.options.taskItem &&
e.push(tE.configure(this.options.taskItem)),
!1 !== this.options.taskList &&
e.push(tO.configure(this.options.taskList)),
e
);
},
});
var tA = "&nbsp;",
tD = t.Node.create({
name: "paragraph",
priority: 1e3,
addOptions: () => ({ HTMLAttributes: {} }),
group: "block",
content: "inline*",
parseHTML: () => [{ tag: "p" }],
renderHTML({ HTMLAttributes: e }) {
return [
"p",
(0, t.mergeAttributes)(this.options.HTMLAttributes, e),
0,
];
},
parseMarkdown: (e, t) => {
let n = e.tokens || [];
if (1 === n.length && "image" === n[0].type)
return t.parseChildren([n[0]]);
let r = t.parseInline(n);
return 1 === r.length &&
"text" === r[0].type &&
(r[0].text === tA || " " === r[0].text)
? t.createNode("paragraph", void 0, [])
: t.createNode("paragraph", void 0, r);
},
renderMarkdown: (e, t) => {
if (!e) return "";
let n = Array.isArray(e.content) ? e.content : [];
return 0 === n.length ? tA : t.renderChildren(n);
},
addCommands() {
return {
setParagraph:
() =>
({ commands: e }) =>
e.setNode(this.name),
};
},
addKeyboardShortcuts() {
return { "Mod-Alt-0": () => this.editor.commands.setParagraph() };
},
}),
tR = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,
tI = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,
tP = t.Mark.create({
name: "strike",
addOptions: () => ({ HTMLAttributes: {} }),
parseHTML: () => [
{ tag: "s" },
{ tag: "del" },
{ tag: "strike" },
{
style: "text-decoration",
consuming: !1,
getAttrs: (e) => !!e.includes("line-through") && {},
},
],
renderHTML({ HTMLAttributes: e }) {
return [
"s",
(0, t.mergeAttributes)(this.options.HTMLAttributes, e),
0,
];
},
markdownTokenName: "del",
parseMarkdown: (e, t) =>
t.applyMark("strike", t.parseInline(e.tokens || [])),
renderMarkdown: (e, t) => `~~${t.renderChildren(e)}~~`,
addCommands() {
return {
setStrike:
() =>
({ commands: e }) =>
e.setMark(this.name),
toggleStrike:
() =>
({ commands: e }) =>
e.toggleMark(this.name),
unsetStrike:
() =>
({ commands: e }) =>
e.unsetMark(this.name),
};
},
addKeyboardShortcuts() {
return { "Mod-Shift-s": () => this.editor.commands.toggleStrike() };
},
addInputRules() {
return [(0, t.markInputRule)({ find: tR, type: this.type })];
},
addPasteRules() {
return [(0, t.markPasteRule)({ find: tI, type: this.type })];
},
}),
tL = t.Node.create({
name: "text",
group: "inline",
parseMarkdown: (e) => ({ type: "text", text: e.text || "" }),
renderMarkdown: (e) => e.text || "",
}),
tz = t.Mark.create({
name: "underline",
addOptions: () => ({ HTMLAttributes: {} }),
parseHTML: () => [
{ tag: "u" },
{
style: "text-decoration",
consuming: !1,
getAttrs: (e) => !!e.includes("underline") && {},
},
],
renderHTML({ HTMLAttributes: e }) {
return [
"u",
(0, t.mergeAttributes)(this.options.HTMLAttributes, e),
0,
];
},
parseMarkdown(e, t) {
return t.applyMark(
this.name || "underline",
t.parseInline(e.tokens || []),
);
},
renderMarkdown: (e, t) => `++${t.renderChildren(e)}++`,
markdownTokenizer: {
name: "underline",
level: "inline",
start: (e) => e.indexOf("++"),
tokenize(e, t, n) {
let r = /^(\+\+)([\s\S]+?)(\+\+)/.exec(e);
if (!r) return;
let i = r[2].trim();
return {
type: "underline",
raw: r[0],
text: i,
tokens: n.inlineTokens(i),
};
},
},
addCommands() {
return {
setUnderline:
() =>
({ commands: e }) =>
e.setMark(this.name),
toggleUnderline:
() =>
({ commands: e }) =>
e.toggleMark(this.name),
unsetUnderline:
() =>
({ commands: e }) =>
e.unsetMark(this.name),
};
},
addKeyboardShortcuts() {
return {
"Mod-u": () => this.editor.commands.toggleUnderline(),
"Mod-U": () => this.editor.commands.toggleUnderline(),
};
},
}),
tB = e.i(589430),
t$ = t.Extension.create({
name: "starterKit",
addExtensions() {
var e, t, n, r;
let o = [];
return (
!1 !== this.options.bold && o.push(d.configure(this.options.bold)),
!1 !== this.options.blockquote &&
o.push(i.configure(this.options.blockquote)),
!1 !== this.options.bulletList &&
o.push(ts.configure(this.options.bulletList)),
!1 !== this.options.code && o.push(p.configure(this.options.code)),
!1 !== this.options.codeBlock &&
o.push(g.configure(this.options.codeBlock)),
!1 !== this.options.document &&
o.push(y.configure(this.options.document)),
!1 !== this.options.dropcursor &&
o.push(tB.Dropcursor.configure(this.options.dropcursor)),
!1 !== this.options.gapcursor &&
o.push(tB.Gapcursor.configure(this.options.gapcursor)),
!1 !== this.options.hardBreak &&
o.push(b.configure(this.options.hardBreak)),
!1 !== this.options.heading &&
o.push(k.configure(this.options.heading)),
!1 !== this.options.undoRedo &&
o.push(tB.UndoRedo.configure(this.options.undoRedo)),
!1 !== this.options.horizontalRule &&
o.push(v.configure(this.options.horizontalRule)),
!1 !== this.options.italic &&
o.push(C.configure(this.options.italic)),
!1 !== this.options.listItem &&
o.push(tl.configure(this.options.listItem)),
!1 !== this.options.listKeymap &&
o.push(
tw.configure(
null == (e = this.options) ? void 0 : e.listKeymap,
),
),
!1 !== this.options.link &&
o.push(
tn.configure(null == (t = this.options) ? void 0 : t.link),
),
!1 !== this.options.orderedList &&
o.push(tT.configure(this.options.orderedList)),
!1 !== this.options.paragraph &&
o.push(tD.configure(this.options.paragraph)),
!1 !== this.options.strike &&
o.push(tP.configure(this.options.strike)),
!1 !== this.options.text && o.push(tL.configure(this.options.text)),
!1 !== this.options.underline &&
o.push(
tz.configure(null == (n = this.options) ? void 0 : n.underline),
),
!1 !== this.options.trailingNode &&
o.push(
tB.TrailingNode.configure(
null == (r = this.options) ? void 0 : r.trailingNode,
),
),
o
);
},
});
e.s(["default", () => t$], 999445);
};
export default moduleFactory;