@powerduck/md-editor 0.9.0 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import { Compartment as Be, EditorState as Ht } from "@codemirror/state";
1
+ import { Compartment as Be, EditorState as Ft } from "@codemirror/state";
2
2
  import { EditorView as ge, keymap as $e, lineNumbers as Ue } from "@codemirror/view";
3
3
  import { history as zt, defaultKeymap as Kt, historyKeymap as Gt } from "@codemirror/commands";
4
4
  import { markdown as qt } from "@codemirror/lang-markdown";
5
5
  import { languages as Wt } from "@codemirror/language-data";
6
6
  import Yt from "markdown-it";
7
- import Fe from "katex";
7
+ import He from "katex";
8
8
  class Zt {
9
9
  constructor(e, t = {}) {
10
- this.dropdown = null, this.items = [], this.selectedIndex = 0, this.trigger = null, this.searchAbort = null, this.destroyed = !1, this.view = e, this.options = {
10
+ this.dropdown = null, this.items = [], this.selectedIndex = 0, this.trigger = null, this.activeHead = 0, this.searchAbort = null, this.destroyed = !1, this.view = e, this.options = {
11
11
  onMentionSearch: t.onMentionSearch ?? (() => []),
12
12
  onMentionSelect: t.onMentionSelect ?? ((i) => `@${i.label}`),
13
13
  minChars: t.minChars ?? 0,
@@ -35,9 +35,9 @@ class Zt {
35
35
  if (!this.dropdown || this.items.length === 0) return !1;
36
36
  switch (e.key) {
37
37
  case "ArrowDown":
38
- return e.preventDefault(), this.selectedIndex = (this.selectedIndex + 1) % this.items.length, this.renderDropdown(), !0;
38
+ return e.preventDefault(), this.selectedIndex = (this.selectedIndex + 1) % this.items.length, this.updateActiveClass(), !0;
39
39
  case "ArrowUp":
40
- return e.preventDefault(), this.selectedIndex = (this.selectedIndex - 1 + this.items.length) % this.items.length, this.renderDropdown(), !0;
40
+ return e.preventDefault(), this.selectedIndex = (this.selectedIndex - 1 + this.items.length) % this.items.length, this.updateActiveClass(), !0;
41
41
  case "Enter":
42
42
  case "Tab":
43
43
  return e.preventDefault(), this.selectItem(this.selectedIndex), !0;
@@ -47,17 +47,17 @@ class Zt {
47
47
  return !1;
48
48
  }
49
49
  findTrigger() {
50
- const { head: e } = this.view.state.selection.main, t = this.view.state.doc.lineAt(e), i = t.text, r = e - t.from;
51
- for (let a = r - 1; a >= 0; a--) {
52
- const s = i[a];
53
- if (s === "@") {
50
+ const { head: e } = this.view.state.selection.main, t = this.view.state.doc.lineAt(e), i = t.text, s = e - t.from;
51
+ for (let a = s - 1; a >= 0; a--) {
52
+ const r = i[a];
53
+ if (r === "@") {
54
54
  if (a === 0 || /\s|[^\w@]/.test(i[a - 1])) {
55
- const o = i.slice(a + 1, r);
55
+ const o = i.slice(a + 1, s);
56
56
  return /\s/.test(o) ? null : { from: t.from + a, query: o };
57
57
  }
58
58
  return null;
59
59
  }
60
- if (/\s/.test(s)) break;
60
+ if (/\s/.test(r)) break;
61
61
  }
62
62
  return null;
63
63
  }
@@ -72,19 +72,30 @@ class Zt {
72
72
  return;
73
73
  }
74
74
  try {
75
- const r = await this.options.onMentionSearch(e);
75
+ const s = await this.options.onMentionSearch(e);
76
76
  if (t || this.destroyed) return;
77
- this.items = r.slice(0, this.options.maxItems), this.selectedIndex = 0, this.items.length > 0 ? this.show() : this.hide();
77
+ this.items = s.slice(0, this.options.maxItems), this.selectedIndex = 0, this.items.length > 0 ? this.show() : this.hide();
78
78
  } catch {
79
79
  t || this.hide();
80
80
  }
81
81
  }
82
82
  show() {
83
83
  if (this.trigger) {
84
- if (!this.dropdown) {
84
+ if (this.activeHead = this.view.state.selection.main.head, !this.dropdown) {
85
85
  this.dropdown = document.createElement("div"), this.dropdown.className = "md-editor-mention-dropdown", this.dropdown.setAttribute("role", "listbox");
86
86
  const e = this.view.dom.closest(".md-editor-root"), t = (e == null ? void 0 : e.getAttribute("data-theme")) ?? "light";
87
- this.dropdown.setAttribute("data-theme", t), document.body.appendChild(this.dropdown);
87
+ this.dropdown.setAttribute("data-theme", t), document.body.appendChild(this.dropdown), this.dropdown.addEventListener("mousedown", (i) => {
88
+ const a = i.target.closest(".md-editor-mention-item");
89
+ if (!a) return;
90
+ i.preventDefault(), i.stopPropagation();
91
+ const r = Number(a.dataset.index);
92
+ Number.isNaN(r) || this.selectItem(r);
93
+ }), this.dropdown.addEventListener("mouseover", (i) => {
94
+ const a = i.target.closest(".md-editor-mention-item");
95
+ if (!a) return;
96
+ const r = Number(a.dataset.index);
97
+ !Number.isNaN(r) && r !== this.selectedIndex && (this.selectedIndex = r, this.updateActiveClass());
98
+ });
88
99
  }
89
100
  this.renderDropdown(), this.positionDropdown();
90
101
  }
@@ -92,46 +103,53 @@ class Zt {
92
103
  renderDropdown() {
93
104
  this.dropdown && (this.dropdown.innerHTML = "", this.items.forEach((e, t) => {
94
105
  const i = document.createElement("div");
95
- if (i.className = "md-editor-mention-item" + (t === this.selectedIndex ? " is-active" : ""), i.setAttribute("role", "option"), i.setAttribute("aria-selected", t === this.selectedIndex ? "true" : "false"), e.avatar) {
96
- const s = document.createElement("img");
97
- s.className = "md-editor-mention-avatar", s.src = e.avatar, s.alt = "", i.appendChild(s);
106
+ if (i.className = "md-editor-mention-item" + (t === this.selectedIndex ? " is-active" : ""), i.setAttribute("role", "option"), i.setAttribute("aria-selected", t === this.selectedIndex ? "true" : "false"), i.dataset.index = String(t), e.avatar) {
107
+ const r = document.createElement("img");
108
+ r.className = "md-editor-mention-avatar", r.src = e.avatar, r.alt = "", i.appendChild(r);
98
109
  }
99
- const r = document.createElement("div");
100
- r.className = "md-editor-mention-text";
110
+ const s = document.createElement("div");
111
+ s.className = "md-editor-mention-text";
101
112
  const a = document.createElement("div");
102
- if (a.className = "md-editor-mention-label", a.textContent = e.label, r.appendChild(a), e.description) {
103
- const s = document.createElement("div");
104
- s.className = "md-editor-mention-desc", s.textContent = e.description, r.appendChild(s);
113
+ if (a.className = "md-editor-mention-label", a.textContent = e.label, s.appendChild(a), e.description) {
114
+ const r = document.createElement("div");
115
+ r.className = "md-editor-mention-desc", r.textContent = e.description, s.appendChild(r);
105
116
  }
106
- i.appendChild(r), i.addEventListener("mousedown", (s) => {
107
- s.preventDefault(), s.stopPropagation(), this.selectItem(t);
108
- }), i.addEventListener("click", (s) => {
109
- s.preventDefault(), s.stopPropagation(), this.selectItem(t);
110
- }), i.addEventListener("mouseenter", () => {
111
- this.selectedIndex = t, this.renderDropdown();
112
- }), this.dropdown.appendChild(i);
117
+ i.appendChild(s), this.dropdown.appendChild(i);
113
118
  }));
114
119
  }
120
+ /** Update the active-item CSS class without rebuilding the DOM. */
121
+ updateActiveClass() {
122
+ if (!this.dropdown) return;
123
+ const e = this.dropdown.children;
124
+ for (let t = 0; t < e.length; t++) {
125
+ const i = e[t], s = t === this.selectedIndex;
126
+ i.classList.toggle("is-active", s), i.setAttribute("aria-selected", s ? "true" : "false");
127
+ }
128
+ }
115
129
  positionDropdown() {
116
130
  if (!this.dropdown || !this.trigger) return;
117
- const e = this.view.coordsAtPos(this.trigger.from);
118
- if (!e) return;
131
+ let e = null;
132
+ try {
133
+ e = this.view.coordsAtPos(this.trigger.from);
134
+ } catch {
135
+ e = null;
136
+ }
137
+ if (!e) {
138
+ const r = this.view.dom.getBoundingClientRect();
139
+ e = { top: r.top, bottom: r.top + 20, left: r.left };
140
+ }
119
141
  const t = this.dropdown.getBoundingClientRect(), i = window.innerHeight;
120
- let r = e.bottom + 4, a = e.left;
121
- r + t.height > i - 8 && (r = e.top - t.height - 4), a = Math.max(8, Math.min(a, window.innerWidth - t.width - 8)), this.dropdown.style.top = `${r}px`, this.dropdown.style.left = `${a}px`;
142
+ let s = e.bottom + 4, a = e.left;
143
+ s + t.height > i - 8 && (s = e.top - t.height - 4), a = Math.max(8, Math.min(a, window.innerWidth - t.width - 8)), this.dropdown.style.top = `${s}px`, this.dropdown.style.left = `${a}px`;
122
144
  }
123
145
  selectItem(e) {
124
- const t = this.items[e];
125
- if (!t || !this.trigger) return;
126
- const i = this.options.onMentionSelect(t), { head: r } = this.view.state.selection.main;
127
- this.view.dispatch({
128
- changes: {
129
- from: this.trigger.from,
130
- to: r,
131
- insert: i
132
- },
133
- selection: { anchor: this.trigger.from + i.length }
134
- }), this.hide(), this.view.focus();
146
+ const t = this.items[e], i = this.trigger;
147
+ if (!t || !i) return;
148
+ const s = this.options.onMentionSelect(t), a = i.from, r = this.activeHead;
149
+ this.view.focus(), this.view.dispatch({
150
+ changes: { from: a, to: r, insert: s },
151
+ selection: { anchor: a + s.length }
152
+ }), this.hide();
135
153
  }
136
154
  hide() {
137
155
  var e;
@@ -141,24 +159,24 @@ class Zt {
141
159
  this.destroyed = !0, this.hide();
142
160
  }
143
161
  }
144
- async function Xt(n) {
162
+ async function Vt(n) {
145
163
  const e = await fetch(n, { mode: "cors" });
146
164
  if (!e.ok) throw new Error(`HTTP ${e.status}`);
147
165
  const t = await e.text();
148
- return Vt(t, n);
166
+ return Xt(t, n);
149
167
  }
150
- function Vt(n, e) {
168
+ function Xt(n, e) {
151
169
  var c, l, d, h, p, m, y;
152
170
  const t = {}, i = new DOMParser().parseFromString(n, "text/html"), a = ((c = i.querySelector('meta[property="og:title"]')) == null ? void 0 : c.getAttribute("content")) ?? ((l = i.querySelector("title")) == null ? void 0 : l.textContent) ?? void 0;
153
171
  a && (t.title = a.trim());
154
- const s = ((d = i.querySelector('meta[property="og:description"]')) == null ? void 0 : d.getAttribute("content")) ?? ((h = i.querySelector('meta[name="description"]')) == null ? void 0 : h.getAttribute("content"));
155
- s && (t.description = s.trim());
172
+ const r = ((d = i.querySelector('meta[property="og:description"]')) == null ? void 0 : d.getAttribute("content")) ?? ((h = i.querySelector('meta[name="description"]')) == null ? void 0 : h.getAttribute("content"));
173
+ r && (t.description = r.trim());
156
174
  const o = ((p = i.querySelector('meta[property="og:image"]')) == null ? void 0 : p.getAttribute("content")) ?? ((m = i.querySelector('meta[property="og:image:secure_url"]')) == null ? void 0 : m.getAttribute("content")) ?? ((y = i.querySelector('meta[name="twitter:image"]')) == null ? void 0 : y.getAttribute("content"));
157
175
  return o && (t.thumbnail = o.startsWith("http") ? o : new URL(o, e).href), t;
158
176
  }
159
177
  class Qt {
160
178
  constructor(e, t = {}) {
161
- this.dropdown = null, this.items = [], this.selectedIndex = 0, this.trigger = null, this.searchAbort = null, this.destroyed = !1, this.view = e, this.options = {
179
+ this.dropdown = null, this.items = [], this.selectedIndex = 0, this.trigger = null, this.activeHead = 0, this.searchAbort = null, this.destroyed = !1, this.view = e, this.options = {
162
180
  onDocSearch: t.onDocSearch ?? (() => []),
163
181
  insertStyle: t.insertStyle ?? "auto",
164
182
  triggerChar: t.triggerChar ?? "/",
@@ -166,7 +184,7 @@ class Qt {
166
184
  maxItems: t.maxItems ?? 8,
167
185
  // Use the built-in fetch+DOMParser fetcher unless the consumer provides
168
186
  // their own (e.g. a backend proxy to avoid CORS).
169
- onFetchDocMeta: t.onFetchDocMeta ?? Xt
187
+ onFetchDocMeta: t.onFetchDocMeta ?? Vt
170
188
  };
171
189
  }
172
190
  /** Called on every CodeMirror update. */
@@ -184,9 +202,9 @@ class Qt {
184
202
  if (!this.dropdown || this.items.length === 0) return !1;
185
203
  switch (e.key) {
186
204
  case "ArrowDown":
187
- return e.preventDefault(), this.selectedIndex = (this.selectedIndex + 1) % this.items.length, this.renderDropdown(), !0;
205
+ return e.preventDefault(), this.selectedIndex = (this.selectedIndex + 1) % this.items.length, this.updateActiveClass(), !0;
188
206
  case "ArrowUp":
189
- return e.preventDefault(), this.selectedIndex = (this.selectedIndex - 1 + this.items.length) % this.items.length, this.renderDropdown(), !0;
207
+ return e.preventDefault(), this.selectedIndex = (this.selectedIndex - 1 + this.items.length) % this.items.length, this.updateActiveClass(), !0;
190
208
  case "Enter":
191
209
  case "Tab":
192
210
  return e.preventDefault(), this.selectItem(this.selectedIndex), !0;
@@ -196,13 +214,13 @@ class Qt {
196
214
  return !1;
197
215
  }
198
216
  findTrigger() {
199
- const { head: e } = this.view.state.selection.main, t = this.view.state.doc.lineAt(e), i = t.text, r = e - t.from, a = this.options.triggerChar;
200
- for (let s = r - 1; s >= 0; s--) {
201
- const o = i[s];
217
+ const { head: e } = this.view.state.selection.main, t = this.view.state.doc.lineAt(e), i = t.text, s = e - t.from, a = this.options.triggerChar;
218
+ for (let r = s - 1; r >= 0; r--) {
219
+ const o = i[r];
202
220
  if (o === a) {
203
- if (s === 0 || /\s/.test(i[s - 1])) {
204
- const c = i.slice(s + 1, r);
205
- return /\s/.test(c) ? null : { from: t.from + s, query: c };
221
+ if (r === 0 || /\s/.test(i[r - 1])) {
222
+ const c = i.slice(r + 1, s);
223
+ return /\s/.test(c) ? null : { from: t.from + r, query: c };
206
224
  }
207
225
  return null;
208
226
  }
@@ -221,19 +239,30 @@ class Qt {
221
239
  return;
222
240
  }
223
241
  try {
224
- const r = await this.options.onDocSearch(e);
242
+ const s = await this.options.onDocSearch(e);
225
243
  if (t || this.destroyed) return;
226
- this.items = r.slice(0, this.options.maxItems), this.selectedIndex = 0, this.items.length > 0 ? this.show() : this.hide();
244
+ this.items = s.slice(0, this.options.maxItems), this.selectedIndex = 0, this.items.length > 0 ? this.show() : this.hide();
227
245
  } catch {
228
246
  t || this.hide();
229
247
  }
230
248
  }
231
249
  show() {
232
250
  if (this.trigger) {
233
- if (!this.dropdown) {
251
+ if (this.activeHead = this.view.state.selection.main.head, !this.dropdown) {
234
252
  this.dropdown = document.createElement("div"), this.dropdown.className = "md-editor-doclink-dropdown", this.dropdown.setAttribute("role", "listbox");
235
253
  const e = this.view.dom.closest(".md-editor-root"), t = (e == null ? void 0 : e.getAttribute("data-theme")) ?? "light";
236
- this.dropdown.setAttribute("data-theme", t), document.body.appendChild(this.dropdown);
254
+ this.dropdown.setAttribute("data-theme", t), document.body.appendChild(this.dropdown), this.dropdown.addEventListener("mousedown", (i) => {
255
+ const a = i.target.closest(".md-editor-doclink-item");
256
+ if (!a) return;
257
+ i.preventDefault(), i.stopPropagation();
258
+ const r = Number(a.dataset.index);
259
+ Number.isNaN(r) || this.selectItem(r);
260
+ }), this.dropdown.addEventListener("mouseover", (i) => {
261
+ const a = i.target.closest(".md-editor-doclink-item");
262
+ if (!a) return;
263
+ const r = Number(a.dataset.index);
264
+ !Number.isNaN(r) && r !== this.selectedIndex && (this.selectedIndex = r, this.updateActiveClass());
265
+ });
237
266
  }
238
267
  this.renderDropdown(), this.positionDropdown();
239
268
  }
@@ -241,53 +270,64 @@ class Qt {
241
270
  renderDropdown() {
242
271
  this.dropdown && (this.dropdown.innerHTML = "", this.items.forEach((e, t) => {
243
272
  const i = document.createElement("div");
244
- if (i.className = "md-editor-doclink-item" + (t === this.selectedIndex ? " is-active" : ""), i.setAttribute("role", "option"), i.setAttribute("aria-selected", t === this.selectedIndex ? "true" : "false"), e.thumbnail) {
273
+ if (i.className = "md-editor-doclink-item" + (t === this.selectedIndex ? " is-active" : ""), i.setAttribute("role", "option"), i.setAttribute("aria-selected", t === this.selectedIndex ? "true" : "false"), i.dataset.index = String(t), e.thumbnail) {
245
274
  const o = document.createElement("img");
246
275
  o.className = "md-editor-doclink-thumb-img", o.src = e.thumbnail, o.alt = "", i.appendChild(o);
247
276
  }
248
- const r = document.createElement("div");
249
- r.className = "md-editor-doclink-text";
277
+ const s = document.createElement("div");
278
+ s.className = "md-editor-doclink-text";
250
279
  const a = document.createElement("div");
251
- if (a.className = "md-editor-doclink-label", a.textContent = e.title, r.appendChild(a), e.description) {
280
+ if (a.className = "md-editor-doclink-label", a.textContent = e.title, s.appendChild(a), e.description) {
252
281
  const o = document.createElement("div");
253
- o.className = "md-editor-doclink-desc", o.textContent = e.description, r.appendChild(o);
282
+ o.className = "md-editor-doclink-desc", o.textContent = e.description, s.appendChild(o);
254
283
  }
255
- const s = document.createElement("div");
256
- s.className = "md-editor-doclink-url";
284
+ const r = document.createElement("div");
285
+ r.className = "md-editor-doclink-url";
257
286
  try {
258
- s.textContent = new URL(e.url).hostname;
287
+ r.textContent = new URL(e.url).hostname;
259
288
  } catch {
260
- s.textContent = e.url;
289
+ r.textContent = e.url;
261
290
  }
262
- r.appendChild(s), i.appendChild(r), i.addEventListener("mousedown", (o) => {
263
- o.preventDefault(), o.stopPropagation(), this.selectItem(t);
264
- }), i.addEventListener("click", (o) => {
265
- o.preventDefault(), o.stopPropagation(), this.selectItem(t);
266
- }), i.addEventListener("mouseenter", () => {
267
- this.selectedIndex = t, this.renderDropdown();
268
- }), this.dropdown.appendChild(i);
291
+ s.appendChild(r), i.appendChild(s), this.dropdown.appendChild(i);
269
292
  }));
270
293
  }
294
+ /** Update the active-item CSS class without rebuilding the DOM. */
295
+ updateActiveClass() {
296
+ if (!this.dropdown) return;
297
+ const e = this.dropdown.children;
298
+ for (let t = 0; t < e.length; t++) {
299
+ const i = e[t], s = t === this.selectedIndex;
300
+ i.classList.toggle("is-active", s), i.setAttribute("aria-selected", s ? "true" : "false");
301
+ }
302
+ }
271
303
  positionDropdown() {
272
304
  if (!this.dropdown || !this.trigger) return;
273
- const e = this.view.coordsAtPos(this.trigger.from);
274
- if (!e) return;
305
+ let e = null;
306
+ try {
307
+ e = this.view.coordsAtPos(this.trigger.from);
308
+ } catch {
309
+ e = null;
310
+ }
311
+ if (!e) {
312
+ const r = this.view.dom.getBoundingClientRect();
313
+ e = { top: r.top, bottom: r.top + 20, left: r.left };
314
+ }
275
315
  const t = this.dropdown.getBoundingClientRect(), i = window.innerHeight;
276
- let r = e.bottom + 4, a = e.left;
277
- r + t.height > i - 8 && (r = e.top - t.height - 4), a = Math.max(8, Math.min(a, window.innerWidth - t.width - 8)), this.dropdown.style.top = `${r}px`, this.dropdown.style.left = `${a}px`;
316
+ let s = e.bottom + 4, a = e.left;
317
+ s + t.height > i - 8 && (s = e.top - t.height - 4), a = Math.max(8, Math.min(a, window.innerWidth - t.width - 8)), this.dropdown.style.top = `${s}px`, this.dropdown.style.left = `${a}px`;
278
318
  }
279
319
  async selectItem(e) {
280
- const t = this.items[e];
281
- if (!t || !this.trigger) return;
282
- const { head: i } = this.view.state.selection.main, r = this.trigger.from;
283
- this.view.dispatch({
284
- changes: { from: r, to: i, insert: "" }
320
+ const t = this.items[e], i = this.trigger;
321
+ if (!t || !i) return;
322
+ const s = i.from, a = this.activeHead;
323
+ this.view.focus(), this.view.dispatch({
324
+ changes: { from: s, to: a, insert: "" }
285
325
  });
286
- const a = await this.buildInsertion(t);
326
+ const r = await this.buildInsertion(t);
287
327
  this.view.dispatch({
288
- changes: { from: r, insert: a },
289
- selection: { anchor: r + a.length }
290
- }), this.hide(), this.view.focus();
328
+ changes: { from: s, insert: r },
329
+ selection: { anchor: s + r.length }
330
+ }), this.hide();
291
331
  }
292
332
  /**
293
333
  * Build the markdown insertion string for a selected document.
@@ -317,9 +357,9 @@ class Qt {
317
357
  return `[${e.title}](${e.url})`;
318
358
  if (t === "card" && !a)
319
359
  return `[${e.title}](${e.url})`;
320
- const s = [`:::doc-link ${e.url}`];
321
- return s.push(`# ${i.title ?? e.title}`), i.thumbnail && s.push(`![thumbnail](${i.thumbnail})`), i.description && s.push(i.description), s.push(":::"), `
322
- ` + s.join(`
360
+ const r = [`:::doc-link ${e.url}`];
361
+ return r.push(`# ${i.title ?? e.title}`), i.thumbnail && r.push(`![thumbnail](${i.thumbnail})`), i.description && r.push(i.description), r.push(":::"), `
362
+ ` + r.join(`
323
363
  `) + `
324
364
  `;
325
365
  }
@@ -333,63 +373,63 @@ class Qt {
333
373
  }
334
374
  const Jt = /^:::doc-link\s+(\S+)(?:\s+(.+))?$/, jt = /^:::\s*$/;
335
375
  function en(n) {
336
- n.block.ruler.before("fence", "doclink_block", (e, t, i, r) => {
337
- const s = e.src.slice(e.bMarks[t], e.eMarks[t]).match(Jt);
338
- if (!s) return !1;
339
- const o = s[1] ?? "";
376
+ n.block.ruler.before("fence", "doclink_block", (e, t, i, s) => {
377
+ const r = e.src.slice(e.bMarks[t], e.eMarks[t]).match(Jt);
378
+ if (!r) return !1;
379
+ const o = r[1] ?? "";
340
380
  let c = t + 1, l = !1;
341
381
  for (; c < i; ) {
342
- const b = e.src.slice(e.bMarks[c], e.eMarks[c]);
343
- if (jt.test(b.trim())) {
382
+ const f = e.src.slice(e.bMarks[c], e.eMarks[c]);
383
+ if (jt.test(f.trim())) {
344
384
  l = !0;
345
385
  break;
346
386
  }
347
387
  c++;
348
388
  }
349
389
  if (!l) return !1;
350
- if (r) return !0;
390
+ if (s) return !0;
351
391
  const d = e.src.slice(e.bMarks[t + 1], e.bMarks[c]).split(`
352
- `).map((b) => b.trim()).filter((b) => b.length > 0);
392
+ `).map((f) => f.trim()).filter((f) => f.length > 0);
353
393
  let h = "", p = "";
354
394
  const m = [];
355
- for (const b of d)
356
- if (b.startsWith("# "))
357
- h = b.slice(2).trim();
358
- else if (b.startsWith("![thumbnail](")) {
359
- const w = b.match(/^!\[thumbnail\]\((.+)\)$/);
360
- w && (p = w[1] ?? "");
395
+ for (const f of d)
396
+ if (f.startsWith("# "))
397
+ h = f.slice(2).trim();
398
+ else if (f.startsWith("![thumbnail](")) {
399
+ const v = f.match(/^!\[thumbnail\]\((.+)\)$/);
400
+ v && (p = v[1] ?? "");
361
401
  } else
362
- m.push(b);
402
+ m.push(f);
363
403
  const y = e.push("doclink_block", "div", 0);
364
404
  return y.content = JSON.stringify({ url: o, title: h, thumbnail: p, description: m.join(" ") }), e.line = c + 1, !0;
365
405
  }), n.renderer.rules.doclink_block = (e, t) => {
366
406
  const i = e[t];
367
407
  if (!i) return "";
368
- let r;
408
+ let s;
369
409
  try {
370
- r = JSON.parse(i.content);
410
+ s = JSON.parse(i.content);
371
411
  } catch {
372
412
  return "";
373
413
  }
374
- const { url: a, title: s, thumbnail: o, description: c } = r;
414
+ const { url: a, title: r, thumbnail: o, description: c } = s;
375
415
  let l = a;
376
416
  try {
377
417
  l = new URL(a).hostname;
378
418
  } catch {
379
419
  }
380
- const d = o ? `<div class="md-editor-doclink-card-thumb"><img src="${He(o)}" alt="" loading="lazy" /></div>` : "";
381
- return `<a class="md-editor-doclink-card" href="${He(a)}" target="_blank" rel="noopener noreferrer"><div class="md-editor-doclink-card-body"><div class="md-editor-doclink-card-title">${Te(s)}</div>` + (c ? `<div class="md-editor-doclink-card-desc">${Te(c)}</div>` : "") + `<div class="md-editor-doclink-card-url">${Te(l)}</div></div>` + d + "</a>";
420
+ const d = o ? `<div class="md-editor-doclink-card-thumb"><img src="${Fe(o)}" alt="" loading="lazy" /></div>` : "";
421
+ return `<a class="md-editor-doclink-card" href="${Fe(a)}" target="_blank" rel="noopener noreferrer"><div class="md-editor-doclink-card-body"><div class="md-editor-doclink-card-title">${Se(r)}</div>` + (c ? `<div class="md-editor-doclink-card-desc">${Se(c)}</div>` : "") + `<div class="md-editor-doclink-card-url">${Se(l)}</div></div>` + d + "</a>";
382
422
  };
383
423
  }
384
- function Te(n) {
424
+ function Se(n) {
385
425
  return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
386
426
  }
387
- function He(n) {
427
+ function Fe(n) {
388
428
  return n.replace(/"/g, "&quot;").replace(/</g, "&lt;");
389
429
  }
390
430
  class tn {
391
431
  constructor(e, t) {
392
- var r, a;
432
+ var s, a;
393
433
  this.lineNumbersCompartment = new Be(), this.customKeymapCompartment = new Be(), this.mention = null, this.docLink = null, this.onImageFile = t.onImageFile;
394
434
  const i = [
395
435
  zt(),
@@ -398,50 +438,50 @@ class tn {
398
438
  qt({ codeLanguages: Wt }),
399
439
  ge.lineWrapping,
400
440
  this.lineNumbersCompartment.of(t.lineNumbers ? Ue() : []),
401
- ge.updateListener.of((s) => {
441
+ ge.updateListener.of((r) => {
402
442
  var o, c, l;
403
- (s.docChanged || s.selectionSet) && ((o = t.onChange) == null || o.call(t, s.state.doc.toString()), (c = this.mention) == null || c.update(), (l = this.docLink) == null || l.update());
443
+ (r.docChanged || r.selectionSet) && ((o = t.onChange) == null || o.call(t, r.state.doc.toString()), (c = this.mention) == null || c.update(), (l = this.docLink) == null || l.update());
404
444
  }),
405
445
  // Close dropdowns when the editor loses focus
406
446
  ge.domEventHandlers({
407
- paste: (s) => this.handlePaste(s),
408
- drop: (s) => this.handleDrop(s),
447
+ paste: (r) => this.handlePaste(r),
448
+ drop: (r) => this.handleDrop(r),
409
449
  blur: () => {
410
450
  window.setTimeout(() => {
411
- var s, o;
412
- this.view.dom.contains(document.activeElement) || ((s = this.mention) == null || s.hide(), (o = this.docLink) == null || o.hide());
451
+ var r, o;
452
+ this.view.dom.contains(document.activeElement) || ((r = this.mention) == null || r.hide(), (o = this.docLink) == null || o.hide());
413
453
  }, 150);
414
454
  },
415
- keydown: (s) => {
455
+ keydown: (r) => {
416
456
  var o, c;
417
- return !!((o = this.mention) != null && o.handleKey(s) || (c = this.docLink) != null && c.handleKey(s));
457
+ return !!((o = this.mention) != null && o.handleKey(r) || (c = this.docLink) != null && c.handleKey(r));
418
458
  }
419
459
  })
420
460
  ];
421
461
  this.view = new ge({
422
- state: Ht.create({ doc: t.value ?? "", extensions: i }),
462
+ state: Ft.create({ doc: t.value ?? "", extensions: i }),
423
463
  parent: e
424
- }), (r = t.mention) != null && r.onMentionSearch && (this.mention = new Zt(this.view, t.mention)), (a = t.docLink) != null && a.onDocSearch && (this.docLink = new Qt(this.view, t.docLink));
464
+ }), (s = t.mention) != null && s.onMentionSearch && (this.mention = new Zt(this.view, t.mention)), (a = t.docLink) != null && a.onDocSearch && (this.docLink = new Qt(this.view, t.docLink));
425
465
  }
426
466
  handlePaste(e) {
427
- var i, r;
467
+ var i, s;
428
468
  const t = (i = e.clipboardData) == null ? void 0 : i.items;
429
469
  if (!t) return !1;
430
470
  for (const a of Array.from(t))
431
471
  if (a.type.startsWith("image/")) {
432
- const s = a.getAsFile();
433
- if (s)
434
- return (r = this.onImageFile) == null || r.call(this, s), e.preventDefault(), !0;
472
+ const r = a.getAsFile();
473
+ if (r)
474
+ return (s = this.onImageFile) == null || s.call(this, r), e.preventDefault(), !0;
435
475
  }
436
476
  return !1;
437
477
  }
438
478
  handleDrop(e) {
439
- var i, r;
479
+ var i, s;
440
480
  const t = (i = e.dataTransfer) == null ? void 0 : i.files;
441
481
  if (!t || t.length === 0) return !1;
442
482
  for (const a of Array.from(t))
443
483
  if (a.type.startsWith("image/"))
444
- return (r = this.onImageFile) == null || r.call(this, a), e.preventDefault(), !0;
484
+ return (s = this.onImageFile) == null || s.call(this, a), e.preventDefault(), !0;
445
485
  return !1;
446
486
  }
447
487
  /**
@@ -478,12 +518,12 @@ class tn {
478
518
  * selected, insert prefix + placeholder + suffix and select the placeholder.
479
519
  */
480
520
  wrapSelection(e, t, i) {
481
- const { from: r, to: a } = this.view.state.selection.main, o = this.view.state.doc.sliceString(r, a) || i, c = `${e}${o}${t}`;
521
+ const { from: s, to: a } = this.view.state.selection.main, o = this.view.state.doc.sliceString(s, a) || i, c = `${e}${o}${t}`;
482
522
  this.view.dispatch({
483
- changes: { from: r, to: a, insert: c },
523
+ changes: { from: s, to: a, insert: c },
484
524
  selection: {
485
- anchor: r + e.length,
486
- head: r + e.length + o.length
525
+ anchor: s + e.length,
526
+ head: s + e.length + o.length
487
527
  }
488
528
  }), this.view.focus();
489
529
  }
@@ -497,20 +537,20 @@ class tn {
497
537
  * ordered list, etc. If nothing is selected, inserts prefix + placeholder.
498
538
  */
499
539
  wrapLines(e, t) {
500
- const { from: i, to: r } = this.view.state.selection.main;
501
- let a = this.view.state.doc.sliceString(i, r);
540
+ const { from: i, to: s } = this.view.state.selection.main;
541
+ let a = this.view.state.doc.sliceString(i, s);
502
542
  if (a) {
503
543
  const o = a.split(`
504
544
  `).map((c) => `${e}${c}`).join(`
505
545
  `);
506
546
  this.view.dispatch({
507
- changes: { from: i, to: r, insert: o },
547
+ changes: { from: i, to: s, insert: o },
508
548
  selection: { anchor: i, head: i + o.length }
509
549
  });
510
550
  } else {
511
- const s = this.view.state.doc.lineAt(i);
512
- a = s.text;
513
- const o = s.from, c = s.to, d = (a ? a.split(`
551
+ const r = this.view.state.doc.lineAt(i);
552
+ a = r.text;
553
+ const o = r.from, c = r.to, d = (a ? a.split(`
514
554
  `) : [t]).map((h) => `${e}${h}`).join(`
515
555
  `);
516
556
  this.view.dispatch({
@@ -542,18 +582,14 @@ class tn {
542
582
  * otherwise → check all. Plain lines or `- ` lists get `- [ ] ` prepended.
543
583
  */
544
584
  toggleTaskList() {
545
- const { from: e, to: t } = this.view.state.selection.main, i = this.view.state.doc.lineAt(e), r = this.view.state.doc.lineAt(t), a = [];
546
- for (let d = i.number; d <= r.number; d++)
547
- a.push(this.view.state.doc.line(d).text);
548
- const s = a.every(
549
- (d) => /^- \[[ xX]\]\s/.test(d) || /^- \[[ xX]\]$/.test(d)
550
- ), o = a.every(
551
- (d) => /^- \[ \]\s/.test(d) || /^- \[ \]$/.test(d)
552
- ), l = a.map((d) => s ? o ? d.replace(/^- \[ \](\s?)/, "- [x]$1") : d.replace(/^- \[[xX]\](\s?)/, "- [ ]$1") : /^-(\s|$)/.test(d) ? d.replace(/^-(\s?)/, "- [ ]$1") : `- [ ] ${d}`).join(`
585
+ const { from: e, to: t } = this.view.state.selection.main, i = this.view.state.doc.lineAt(e), s = this.view.state.doc.lineAt(t), a = [];
586
+ for (let p = i.number; p <= s.number; p++)
587
+ a.push(this.view.state.doc.line(p).text);
588
+ const r = /^- \[\s*(?:[xX])?\s*\](\s|$)/, o = /^- \[\s*\](\s|$)/, c = a.every((p) => r.test(p)), l = a.every((p) => o.test(p)), h = a.map((p) => c ? l ? p.replace(/^- \[\s*\](\s?)/, "- [x]$1") : p.replace(/^- \[\s*[xX]\s*\](\s?)/, "- [ ]$1") : /^-(\s|$)/.test(p) ? p.replace(/^-(\s?)/, "- [ ]$1") : `- [ ] ${p}`).join(`
553
589
  `);
554
590
  this.view.dispatch({
555
- changes: { from: i.from, to: r.to, insert: l },
556
- selection: { anchor: i.from, head: i.from + l.length }
591
+ changes: { from: i.from, to: s.to, insert: h },
592
+ selection: { anchor: i.from, head: i.from + h.length }
557
593
  }), this.view.focus();
558
594
  }
559
595
  destroy() {
@@ -562,18 +598,18 @@ class tn {
562
598
  }
563
599
  }
564
600
  const nn = /^\$([^$\n]+?)\$/;
565
- function rn(n) {
601
+ function sn(n) {
566
602
  return /^[\d.,]+$/.test(n.trim());
567
603
  }
568
- function sn(n) {
569
- n.block.ruler.before("fence", "math_block", (e, t, i, r) => {
604
+ function rn(n) {
605
+ n.block.ruler.before("fence", "math_block", (e, t, i, s) => {
570
606
  const a = e.src.slice(e.bMarks[t], e.eMarks[t]);
571
607
  if (!a.startsWith("$$")) return !1;
572
- const s = a.match(/^\$\$(.+?)\$\$\s*$/);
573
- if (s) {
574
- if (r) return !0;
608
+ const r = a.match(/^\$\$(.+?)\$\$\s*$/);
609
+ if (r) {
610
+ if (s) return !0;
575
611
  const h = e.push("math_block", "div", 0);
576
- return h.content = s[1].trim(), h.markup = "$$", e.line = t + 1, !0;
612
+ return h.content = r[1].trim(), h.markup = "$$", e.line = t + 1, !0;
577
613
  }
578
614
  let o = t + 1, c = !1;
579
615
  for (; o < e.lineMax; ) {
@@ -584,14 +620,14 @@ function sn(n) {
584
620
  o++;
585
621
  }
586
622
  if (!c) return !1;
587
- if (r) return !0;
623
+ if (s) return !0;
588
624
  const l = e.src.slice(e.bMarks[t] + 2, e.eMarks[o] - 2).trim(), d = e.push("math_block", "div", 0);
589
625
  return d.content = l, d.markup = "$$", e.line = o + 1, !0;
590
626
  }), n.renderer.rules.math_block = (e, t) => {
591
- var r;
592
- const i = ((r = e[t]) == null ? void 0 : r.content) ?? "";
627
+ var s;
628
+ const i = ((s = e[t]) == null ? void 0 : s.content) ?? "";
593
629
  try {
594
- return `<div class="md-editor-math-block">${Fe.renderToString(i, {
630
+ return `<div class="md-editor-math-block">${He.renderToString(i, {
595
631
  displayMode: !0,
596
632
  throwOnError: !1,
597
633
  strict: !1
@@ -603,16 +639,16 @@ function sn(n) {
603
639
  if (e.src[e.pos] !== "$" || e.src[e.pos + 1] === "$") return !1;
604
640
  const i = e.src.slice(e.pos).match(nn);
605
641
  if (!i) return !1;
606
- const r = i[1] ?? "";
607
- if (rn(r)) return !1;
642
+ const s = i[1] ?? "";
643
+ if (sn(s)) return !1;
608
644
  if (t) return !0;
609
645
  const a = e.push("math_inline", "span", 0);
610
- return a.content = r, a.markup = "$", e.pos += i[0].length, !0;
646
+ return a.content = s, a.markup = "$", e.pos += i[0].length, !0;
611
647
  }), n.renderer.rules.math_inline = (e, t) => {
612
- var r;
613
- const i = ((r = e[t]) == null ? void 0 : r.content) ?? "";
648
+ var s;
649
+ const i = ((s = e[t]) == null ? void 0 : s.content) ?? "";
614
650
  try {
615
- return Fe.renderToString(i, {
651
+ return He.renderToString(i, {
616
652
  displayMode: !1,
617
653
  throwOnError: !1,
618
654
  strict: !1
@@ -638,14 +674,14 @@ function on(n) {
638
674
  n.block.ruler.before(
639
675
  "fence",
640
676
  "mindmap_fence",
641
- (t, i, r, a) => {
642
- const s = t.bMarks[i] + t.tShift[i], o = t.eMarks[i], l = t.src.slice(s, o).match(/^(`{3,})\s*mindmap\s*$/i);
677
+ (t, i, s, a) => {
678
+ const r = t.bMarks[i] + t.tShift[i], o = t.eMarks[i], l = t.src.slice(r, o).match(/^(`{3,})\s*mindmap\s*$/i);
643
679
  if (!l) return !1;
644
680
  if (a) return !0;
645
681
  const d = l[1].length;
646
682
  let h = i + 1, p = 1;
647
- for (; h < r; ) {
648
- const b = t.bMarks[h] + t.tShift[h], w = t.eMarks[h], O = t.src.slice(b, w).match(/^(`{3,})\s*(.*)$/);
683
+ for (; h < s; ) {
684
+ const f = t.bMarks[h] + t.tShift[h], v = t.eMarks[h], O = t.src.slice(f, v).match(/^(`{3,})\s*(.*)$/);
649
685
  if (O && O[1].length >= d) {
650
686
  if (O[2].trim())
651
687
  p++;
@@ -653,7 +689,7 @@ function on(n) {
653
689
  }
654
690
  h++;
655
691
  }
656
- const m = h < r ? h : r - 1, y = t.push("mindmap_block", "div", 0);
692
+ const m = h < s ? h : s - 1, y = t.push("mindmap_block", "div", 0);
657
693
  return y.content = t.getLines(
658
694
  i + 1,
659
695
  m,
@@ -662,20 +698,20 @@ function on(n) {
662
698
  ), y.map = [i, m + 1], y.markup = l[1], y.info = "mindmap", t.line = m + 1, !0;
663
699
  }
664
700
  ), n.renderer.rules.mindmap_block = (t, i) => {
665
- const r = t[i];
666
- if (!r) return "";
667
- const a = `md-editor-mindmap-${++Ke}`, s = encodeURIComponent(r.content);
668
- return `<div class="md-editor-mindmap" id="${a}" data-source="${s}"></div>`;
701
+ const s = t[i];
702
+ if (!s) return "";
703
+ const a = `md-editor-mindmap-${++Ke}`, r = encodeURIComponent(s.content);
704
+ return `<div class="md-editor-mindmap" id="${a}" data-source="${r}"></div>`;
669
705
  };
670
- const e = n.renderer.rules.fence ? n.renderer.rules.fence.bind(n.renderer.rules) : (t, i, r, a, s) => s.renderToken(t, i, r);
671
- n.renderer.rules.fence = (t, i, r, a, s) => {
706
+ const e = n.renderer.rules.fence ? n.renderer.rules.fence.bind(n.renderer.rules) : (t, i, s, a, r) => r.renderToken(t, i, s);
707
+ n.renderer.rules.fence = (t, i, s, a, r) => {
672
708
  const o = t[i];
673
- if (!o) return e(t, i, r, a, s);
709
+ if (!o) return e(t, i, s, a, r);
674
710
  if (o.info.trim().toLowerCase() === "mindmap") {
675
711
  const l = `md-editor-mindmap-${++Ke}`, d = encodeURIComponent(o.content);
676
712
  return `<div class="md-editor-mindmap" id="${l}" data-source="${d}"></div>`;
677
713
  }
678
- return e(t, i, r, a, s);
714
+ return e(t, i, s, a, r);
679
715
  };
680
716
  }
681
717
  const an = 600, cn = 320;
@@ -684,21 +720,21 @@ async function ln(n) {
684
720
  ".md-editor-mindmap:not([data-hydrated])"
685
721
  );
686
722
  if (e.length === 0) return;
687
- const { Transformer: t } = await import("markmap-lib"), i = await import("markmap-view"), r = i.Markmap ?? i.default;
688
- if (!r) return;
723
+ const { Transformer: t } = await import("markmap-lib"), i = await import("markmap-view"), s = i.Markmap ?? i.default;
724
+ if (!s) return;
689
725
  const a = new t();
690
- for (const s of Array.from(e)) {
691
- s.setAttribute("data-hydrated", "1");
692
- const o = decodeURIComponent(s.dataset.source ?? "") || "- Empty mindmap", { root: c } = a.transform(o);
693
- s.innerHTML = "";
694
- const l = s.clientWidth > 0 ? s.clientWidth : an, d = s.clientHeight > 0 ? s.clientHeight : cn, h = document.createElementNS("http://www.w3.org/2000/svg", "svg");
695
- h.setAttribute("width", String(l)), h.setAttribute("height", String(d)), h.style.width = "100%", h.style.height = "100%", h.style.display = "block", s.appendChild(h);
696
- const p = r.create(h, { autoFit: !1 }, c), m = () => {
726
+ for (const r of Array.from(e)) {
727
+ r.setAttribute("data-hydrated", "1");
728
+ const o = decodeURIComponent(r.dataset.source ?? "") || "- Empty mindmap", { root: c } = a.transform(o);
729
+ r.innerHTML = "";
730
+ const l = r.clientWidth > 0 ? r.clientWidth : an, d = r.clientHeight > 0 ? r.clientHeight : cn, h = document.createElementNS("http://www.w3.org/2000/svg", "svg");
731
+ h.setAttribute("width", String(l)), h.setAttribute("height", String(d)), h.style.width = "100%", h.style.height = "100%", h.style.display = "block", r.appendChild(h);
732
+ const p = s.create(h, { autoFit: !1 }, c), m = () => {
697
733
  try {
698
- const b = h.querySelector("g");
699
- if (b) {
700
- const w = b.getAttribute("transform") || "";
701
- (!w || w.includes("NaN")) && b.setAttribute(
734
+ const f = h.querySelector("g");
735
+ if (f) {
736
+ const v = f.getAttribute("transform") || "";
737
+ (!v || v.includes("NaN")) && f.setAttribute(
702
738
  "transform",
703
739
  `translate(40, ${d / 2}) scale(1)`
704
740
  );
@@ -706,11 +742,11 @@ async function ln(n) {
706
742
  } catch {
707
743
  }
708
744
  };
709
- m(), (typeof requestAnimationFrame == "function" ? requestAnimationFrame : (b) => setTimeout(b, 16))(() => {
710
- var b;
745
+ m(), (typeof requestAnimationFrame == "function" ? requestAnimationFrame : (f) => setTimeout(f, 16))(() => {
746
+ var f;
711
747
  try {
712
- const w = h.getBoundingClientRect();
713
- w.width > 0 && w.height > 0 && ((b = p.fit) == null || b.call(p), m());
748
+ const v = h.getBoundingClientRect();
749
+ v.width > 0 && v.height > 0 && ((f = p.fit) == null || f.call(p), m());
714
750
  } catch {
715
751
  }
716
752
  });
@@ -740,7 +776,7 @@ class Ge {
740
776
  this.isMatchIgnored = !0;
741
777
  }
742
778
  }
743
- function rt(n) {
779
+ function st(n) {
744
780
  return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;");
745
781
  }
746
782
  function Q(n, ...e) {
@@ -748,8 +784,8 @@ function Q(n, ...e) {
748
784
  for (const i in n)
749
785
  t[i] = n[i];
750
786
  return e.forEach(function(i) {
751
- for (const r in i)
752
- t[r] = i[r];
787
+ for (const s in i)
788
+ t[s] = i[s];
753
789
  }), /** @type {T} */
754
790
  t;
755
791
  }
@@ -760,7 +796,7 @@ const un = "</span>", qe = (n) => !!n.scope, hn = (n, { prefix: e }) => {
760
796
  const t = n.split(".");
761
797
  return [
762
798
  `${e}${t.shift()}`,
763
- ...t.map((i, r) => `${i}${"_".repeat(r + 1)}`)
799
+ ...t.map((i, s) => `${i}${"_".repeat(s + 1)}`)
764
800
  ].join(" ");
765
801
  }
766
802
  return `${e}${n}`;
@@ -780,7 +816,7 @@ class pn {
780
816
  *
781
817
  * @param {string} text */
782
818
  addText(e) {
783
- this.buffer += rt(e);
819
+ this.buffer += st(e);
784
820
  }
785
821
  /**
786
822
  * Adds a node open to the output stream (if needed)
@@ -910,7 +946,7 @@ class gn extends Ae {
910
946
  function de(n) {
911
947
  return n ? typeof n == "string" ? n : n.source : null;
912
948
  }
913
- function st(n) {
949
+ function rt(n) {
914
950
  return te("(?=", n, ")");
915
951
  }
916
952
  function mn(n) {
@@ -954,17 +990,17 @@ function xe(n, { joinWith: e }) {
954
990
  let t = 0;
955
991
  return n.map((i) => {
956
992
  t += 1;
957
- const r = t;
958
- let a = de(i), s = "";
993
+ const s = t;
994
+ let a = de(i), r = "";
959
995
  for (; a.length > 0; ) {
960
996
  const o = En.exec(a);
961
997
  if (!o) {
962
- s += a;
998
+ r += a;
963
999
  break;
964
1000
  }
965
- s += a.substring(0, o.index), a = a.substring(o.index + o[0].length), o[0][0] === "\\" && o[1] ? s += "\\" + String(Number(o[1]) + r) : (s += o[0], (o[0] === "(" || /^\(\?[<']/.test(o[0])) && t++);
1001
+ r += a.substring(0, o.index), a = a.substring(o.index + o[0].length), o[0][0] === "\\" && o[1] ? r += "\\" + String(Number(o[1]) + s) : (r += o[0], (o[0] === "(" || /^\(\?[<']/.test(o[0])) && t++);
966
1002
  }
967
- return s;
1003
+ return r;
968
1004
  }).map((i) => `(${i})`).join(e);
969
1005
  }
970
1006
  const yn = /\b\B/, at = "[a-zA-Z]\\w*", Ce = "[a-zA-Z_]\\w*", ct = "\\b\\d+(\\.\\d+)?", lt = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", dt = "\\b(0b[01]+)", wn = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", vn = (n = {}) => {
@@ -999,7 +1035,7 @@ const yn = /\b\B/, at = "[a-zA-Z]\\w*", Ce = "[a-zA-Z_]\\w*", ct = "\\b\\d+(\\.\
999
1035
  end: '"',
1000
1036
  illegal: "\\n",
1001
1037
  contains: [ue]
1002
- }, Tn = {
1038
+ }, Sn = {
1003
1039
  begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
1004
1040
  }, we = function(n, e, t = {}) {
1005
1041
  const i = Q(
@@ -1020,7 +1056,7 @@ const yn = /\b\B/, at = "[a-zA-Z]\\w*", Ce = "[a-zA-Z_]\\w*", ct = "\\b\\d+(\\.\
1020
1056
  excludeBegin: !0,
1021
1057
  relevance: 0
1022
1058
  });
1023
- const r = ye(
1059
+ const s = ye(
1024
1060
  // list of common 1 and 2 letter words in English
1025
1061
  "I",
1026
1062
  "a",
@@ -1060,14 +1096,14 @@ const yn = /\b\B/, at = "[a-zA-Z]\\w*", Ce = "[a-zA-Z_]\\w*", ct = "\\b\\d+(\\.\
1060
1096
  /[ ]+/,
1061
1097
  // necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
1062
1098
  "(",
1063
- r,
1099
+ s,
1064
1100
  /[.]?[:]?([.][ ]|[ ])/,
1065
1101
  "){3}"
1066
1102
  )
1067
1103
  // look for 3 words in a row
1068
1104
  }
1069
1105
  ), i;
1070
- }, Sn = we("//", "$"), An = we("/\\*", "\\*/"), xn = we("#", "$"), Cn = {
1106
+ }, Tn = we("//", "$"), An = we("/\\*", "\\*/"), xn = we("#", "$"), Cn = {
1071
1107
  scope: "number",
1072
1108
  begin: ct,
1073
1109
  relevance: 0
@@ -1127,7 +1163,7 @@ var me = /* @__PURE__ */ Object.freeze({
1127
1163
  BINARY_NUMBER_RE: dt,
1128
1164
  COMMENT: we,
1129
1165
  C_BLOCK_COMMENT_MODE: An,
1130
- C_LINE_COMMENT_MODE: Sn,
1166
+ C_LINE_COMMENT_MODE: Tn,
1131
1167
  C_NUMBER_MODE: Mn,
1132
1168
  C_NUMBER_RE: lt,
1133
1169
  END_SAME_AS_BEGIN: Pn,
@@ -1137,7 +1173,7 @@ var me = /* @__PURE__ */ Object.freeze({
1137
1173
  METHOD_GUARD: Dn,
1138
1174
  NUMBER_MODE: Cn,
1139
1175
  NUMBER_RE: ct,
1140
- PHRASAL_WORDS_MODE: Tn,
1176
+ PHRASAL_WORDS_MODE: Sn,
1141
1177
  QUOTE_STRING_MODE: Nn,
1142
1178
  REGEXP_MODE: On,
1143
1179
  RE_STARTERS_RE: wn,
@@ -1155,10 +1191,10 @@ function $n(n, e) {
1155
1191
  function Un(n, e) {
1156
1192
  e && n.beginKeywords && (n.begin = "\\b(" + n.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", n.__beforeBegin = Bn, n.keywords = n.keywords || n.beginKeywords, delete n.beginKeywords, n.relevance === void 0 && (n.relevance = 0));
1157
1193
  }
1158
- function Fn(n, e) {
1194
+ function Hn(n, e) {
1159
1195
  Array.isArray(n.illegal) && (n.illegal = ye(...n.illegal));
1160
1196
  }
1161
- function Hn(n, e) {
1197
+ function Fn(n, e) {
1162
1198
  if (n.match) {
1163
1199
  if (n.begin || n.end) throw new Error("begin & end are not supported with match");
1164
1200
  n.begin = n.match, delete n.match;
@@ -1173,7 +1209,7 @@ const Kn = (n, e) => {
1173
1209
  const t = Object.assign({}, n);
1174
1210
  Object.keys(n).forEach((i) => {
1175
1211
  delete n[i];
1176
- }), n.keywords = t.keywords, n.begin = te(t.beforeMatch, st(t.begin)), n.starts = {
1212
+ }), n.keywords = t.keywords, n.begin = te(t.beforeMatch, rt(t.begin)), n.starts = {
1177
1213
  relevance: 0,
1178
1214
  contains: [
1179
1215
  Object.assign(t, { endsParent: !0 })
@@ -1197,14 +1233,14 @@ const Kn = (n, e) => {
1197
1233
  ], qn = "keyword";
1198
1234
  function ut(n, e, t = qn) {
1199
1235
  const i = /* @__PURE__ */ Object.create(null);
1200
- return typeof n == "string" ? r(t, n.split(" ")) : Array.isArray(n) ? r(t, n) : Object.keys(n).forEach(function(a) {
1236
+ return typeof n == "string" ? s(t, n.split(" ")) : Array.isArray(n) ? s(t, n) : Object.keys(n).forEach(function(a) {
1201
1237
  Object.assign(
1202
1238
  i,
1203
1239
  ut(n[a], e, a)
1204
1240
  );
1205
1241
  }), i;
1206
- function r(a, s) {
1207
- e && (s = s.map((o) => o.toLowerCase())), s.forEach(function(o) {
1242
+ function s(a, r) {
1243
+ e && (r = r.map((o) => o.toLowerCase())), r.forEach(function(o) {
1208
1244
  const c = o.split("|");
1209
1245
  i[c[0]] = [a, Wn(c[0], c[1])];
1210
1246
  });
@@ -1225,10 +1261,10 @@ const Ye = {}, ee = (n) => {
1225
1261
  }, _e = new Error();
1226
1262
  function ht(n, e, { key: t }) {
1227
1263
  let i = 0;
1228
- const r = n[t], a = {}, s = {};
1264
+ const s = n[t], a = {}, r = {};
1229
1265
  for (let o = 1; o <= e.length; o++)
1230
- s[o + i] = r[o], a[o + i] = !0, i += ot(e[o - 1]);
1231
- n[t] = s, n[t]._emit = a, n[t]._multi = !0;
1266
+ r[o + i] = s[o], a[o + i] = !0, i += ot(e[o - 1]);
1267
+ n[t] = r, n[t]._emit = a, n[t]._multi = !0;
1232
1268
  }
1233
1269
  function Zn(n) {
1234
1270
  if (Array.isArray(n.begin)) {
@@ -1239,7 +1275,7 @@ function Zn(n) {
1239
1275
  ht(n, n.begin, { key: "beginScope" }), n.begin = xe(n.begin, { joinWith: "" });
1240
1276
  }
1241
1277
  }
1242
- function Xn(n) {
1278
+ function Vn(n) {
1243
1279
  if (Array.isArray(n.end)) {
1244
1280
  if (n.skip || n.excludeEnd || n.returnEnd)
1245
1281
  throw ee("skip, excludeEnd, returnEnd not compatible with endScope: {}"), _e;
@@ -1248,16 +1284,16 @@ function Xn(n) {
1248
1284
  ht(n, n.end, { key: "endScope" }), n.end = xe(n.end, { joinWith: "" });
1249
1285
  }
1250
1286
  }
1251
- function Vn(n) {
1287
+ function Xn(n) {
1252
1288
  n.scope && typeof n.scope == "object" && n.scope !== null && (n.beginScope = n.scope, delete n.scope);
1253
1289
  }
1254
1290
  function Qn(n) {
1255
- Vn(n), typeof n.beginScope == "string" && (n.beginScope = { _wrap: n.beginScope }), typeof n.endScope == "string" && (n.endScope = { _wrap: n.endScope }), Zn(n), Xn(n);
1291
+ Xn(n), typeof n.beginScope == "string" && (n.beginScope = { _wrap: n.beginScope }), typeof n.endScope == "string" && (n.endScope = { _wrap: n.endScope }), Zn(n), Vn(n);
1256
1292
  }
1257
1293
  function Jn(n) {
1258
- function e(s, o) {
1294
+ function e(r, o) {
1259
1295
  return new RegExp(
1260
- de(s),
1296
+ de(r),
1261
1297
  "m" + (n.case_insensitive ? "i" : "") + (n.unicodeRegex ? "u" : "") + (o ? "g" : "")
1262
1298
  );
1263
1299
  }
@@ -1316,44 +1352,44 @@ function Jn(n) {
1316
1352
  return l && (this.regexIndex += l.position + 1, this.regexIndex === this.count && this.considerAll()), l;
1317
1353
  }
1318
1354
  }
1319
- function r(s) {
1355
+ function s(r) {
1320
1356
  const o = new i();
1321
- return s.contains.forEach((c) => o.addRule(c.begin, { rule: c, type: "begin" })), s.terminatorEnd && o.addRule(s.terminatorEnd, { type: "end" }), s.illegal && o.addRule(s.illegal, { type: "illegal" }), o;
1357
+ return r.contains.forEach((c) => o.addRule(c.begin, { rule: c, type: "begin" })), r.terminatorEnd && o.addRule(r.terminatorEnd, { type: "end" }), r.illegal && o.addRule(r.illegal, { type: "illegal" }), o;
1322
1358
  }
1323
- function a(s, o) {
1359
+ function a(r, o) {
1324
1360
  const c = (
1325
1361
  /** @type CompiledMode */
1326
- s
1362
+ r
1327
1363
  );
1328
- if (s.isCompiled) return c;
1364
+ if (r.isCompiled) return c;
1329
1365
  [
1330
1366
  $n,
1331
1367
  // do this early so compiler extensions generally don't have to worry about
1332
1368
  // the distinction between match/begin
1333
- Hn,
1369
+ Fn,
1334
1370
  Qn,
1335
1371
  Kn
1336
- ].forEach((d) => d(s, o)), n.compilerExtensions.forEach((d) => d(s, o)), s.__beforeBegin = null, [
1372
+ ].forEach((d) => d(r, o)), n.compilerExtensions.forEach((d) => d(r, o)), r.__beforeBegin = null, [
1337
1373
  Un,
1338
1374
  // do this later so compiler extensions that come earlier have access to the
1339
1375
  // raw array if they wanted to perhaps manipulate it, etc.
1340
- Fn,
1376
+ Hn,
1341
1377
  // default to 1 relevance if not specified
1342
1378
  zn
1343
- ].forEach((d) => d(s, o)), s.isCompiled = !0;
1379
+ ].forEach((d) => d(r, o)), r.isCompiled = !0;
1344
1380
  let l = null;
1345
- return typeof s.keywords == "object" && s.keywords.$pattern && (s.keywords = Object.assign({}, s.keywords), l = s.keywords.$pattern, delete s.keywords.$pattern), l = l || /\w+/, s.keywords && (s.keywords = ut(s.keywords, n.case_insensitive)), c.keywordPatternRe = e(l, !0), o && (s.begin || (s.begin = /\B|\b/), c.beginRe = e(c.begin), !s.end && !s.endsWithParent && (s.end = /\B|\b/), s.end && (c.endRe = e(c.end)), c.terminatorEnd = de(c.end) || "", s.endsWithParent && o.terminatorEnd && (c.terminatorEnd += (s.end ? "|" : "") + o.terminatorEnd)), s.illegal && (c.illegalRe = e(
1381
+ return typeof r.keywords == "object" && r.keywords.$pattern && (r.keywords = Object.assign({}, r.keywords), l = r.keywords.$pattern, delete r.keywords.$pattern), l = l || /\w+/, r.keywords && (r.keywords = ut(r.keywords, n.case_insensitive)), c.keywordPatternRe = e(l, !0), o && (r.begin || (r.begin = /\B|\b/), c.beginRe = e(c.begin), !r.end && !r.endsWithParent && (r.end = /\B|\b/), r.end && (c.endRe = e(c.end)), c.terminatorEnd = de(c.end) || "", r.endsWithParent && o.terminatorEnd && (c.terminatorEnd += (r.end ? "|" : "") + o.terminatorEnd)), r.illegal && (c.illegalRe = e(
1346
1382
  /** @type {RegExp | string} */
1347
- s.illegal
1348
- )), s.contains || (s.contains = []), s.contains = [].concat(...s.contains.map(function(d) {
1349
- return jn(d === "self" ? s : d);
1350
- })), s.contains.forEach(function(d) {
1383
+ r.illegal
1384
+ )), r.contains || (r.contains = []), r.contains = [].concat(...r.contains.map(function(d) {
1385
+ return jn(d === "self" ? r : d);
1386
+ })), r.contains.forEach(function(d) {
1351
1387
  a(
1352
1388
  /** @type Mode */
1353
1389
  d,
1354
1390
  c
1355
1391
  );
1356
- }), s.starts && a(s.starts, o), c.matcher = r(c), c;
1392
+ }), r.starts && a(r.starts, o), c.matcher = s(c), c;
1357
1393
  }
1358
1394
  if (n.compilerExtensions || (n.compilerExtensions = []), n.contains && n.contains.includes("self"))
1359
1395
  throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
@@ -1376,10 +1412,10 @@ class ti extends Error {
1376
1412
  super(e), this.name = "HTMLInjectionError", this.html = t;
1377
1413
  }
1378
1414
  }
1379
- const Se = rt, Xe = Q, Ve = Symbol("nomatch"), ni = 7, gt = function(n) {
1415
+ const Te = st, Ve = Q, Xe = Symbol("nomatch"), ni = 7, gt = function(n) {
1380
1416
  const e = /* @__PURE__ */ Object.create(null), t = /* @__PURE__ */ Object.create(null), i = [];
1381
- let r = !0;
1382
- const a = "Could not find the language '{}', did you forget to load/include a language module?", s = { disableAutodetect: !0, name: "Plain text", contains: [] };
1417
+ let s = !0;
1418
+ const a = "Could not find the language '{}', did you forget to load/include a language module?", r = { disableAutodetect: !0, name: "Plain text", contains: [] };
1383
1419
  let o = {
1384
1420
  ignoreUnescapedHTML: !1,
1385
1421
  throwUnescapedHTML: !1,
@@ -1398,98 +1434,98 @@ const Se = rt, Xe = Q, Ve = Symbol("nomatch"), ni = 7, gt = function(n) {
1398
1434
  function l(u) {
1399
1435
  let _ = u.className + " ";
1400
1436
  _ += u.parentNode ? u.parentNode.className : "";
1401
- const f = o.languageDetectRe.exec(_);
1402
- if (f) {
1403
- const k = $(f[1]);
1404
- return k || (Ze(a.replace("{}", f[1])), Ze("Falling back to no-highlight mode for this block.", u)), k ? f[1] : "no-highlight";
1437
+ const b = o.languageDetectRe.exec(_);
1438
+ if (b) {
1439
+ const k = $(b[1]);
1440
+ return k || (Ze(a.replace("{}", b[1])), Ze("Falling back to no-highlight mode for this block.", u)), k ? b[1] : "no-highlight";
1405
1441
  }
1406
1442
  return _.split(/\s+/).find((k) => c(k) || $(k));
1407
1443
  }
1408
- function d(u, _, f) {
1409
- let k = "", T = "";
1410
- typeof _ == "object" ? (k = u, f = _.ignoreIllegals, T = _.language) : (ne("10.7.0", "highlight(lang, code, ...args) has been deprecated."), ne("10.7.0", `Please use highlight(code, options) instead.
1411
- https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), f === void 0 && (f = !0);
1444
+ function d(u, _, b) {
1445
+ let k = "", S = "";
1446
+ typeof _ == "object" ? (k = u, b = _.ignoreIllegals, S = _.language) : (ne("10.7.0", "highlight(lang, code, ...args) has been deprecated."), ne("10.7.0", `Please use highlight(code, options) instead.
1447
+ https://github.com/highlightjs/highlight.js/issues/2277`), S = u, k = _), b === void 0 && (b = !0);
1412
1448
  const P = {
1413
1449
  code: k,
1414
- language: T
1450
+ language: S
1415
1451
  };
1416
- V("before:highlight", P);
1417
- const z = P.result ? P.result : h(P.language, P.code, f);
1418
- return z.code = P.code, V("after:highlight", z), z;
1452
+ X("before:highlight", P);
1453
+ const z = P.result ? P.result : h(P.language, P.code, b);
1454
+ return z.code = P.code, X("after:highlight", z), z;
1419
1455
  }
1420
- function h(u, _, f, k) {
1421
- const T = /* @__PURE__ */ Object.create(null);
1456
+ function h(u, _, b, k) {
1457
+ const S = /* @__PURE__ */ Object.create(null);
1422
1458
  function P(g, E) {
1423
1459
  return g.keywords[E];
1424
1460
  }
1425
1461
  function z() {
1426
- if (!v.keywords) {
1427
- H.addText(C);
1462
+ if (!w.keywords) {
1463
+ F.addText(M);
1428
1464
  return;
1429
1465
  }
1430
1466
  let g = 0;
1431
- v.keywordPatternRe.lastIndex = 0;
1432
- let E = v.keywordPatternRe.exec(C), N = "";
1467
+ w.keywordPatternRe.lastIndex = 0;
1468
+ let E = w.keywordPatternRe.exec(M), N = "";
1433
1469
  for (; E; ) {
1434
- N += C.substring(g, E.index);
1435
- const A = Y.case_insensitive ? E[0].toLowerCase() : E[0], K = P(v, A);
1470
+ N += M.substring(g, E.index);
1471
+ const x = Y.case_insensitive ? E[0].toLowerCase() : E[0], K = P(w, x);
1436
1472
  if (K) {
1437
1473
  const [Z, Ut] = K;
1438
- if (H.addText(N), N = "", T[A] = (T[A] || 0) + 1, T[A] <= ni && (pe += Ut), Z.startsWith("_"))
1474
+ if (F.addText(N), N = "", S[x] = (S[x] || 0) + 1, S[x] <= ni && (pe += Ut), Z.startsWith("_"))
1439
1475
  N += E[0];
1440
1476
  else {
1441
- const Ft = Y.classNameAliases[Z] || Z;
1442
- W(E[0], Ft);
1477
+ const Ht = Y.classNameAliases[Z] || Z;
1478
+ W(E[0], Ht);
1443
1479
  }
1444
1480
  } else
1445
1481
  N += E[0];
1446
- g = v.keywordPatternRe.lastIndex, E = v.keywordPatternRe.exec(C);
1482
+ g = w.keywordPatternRe.lastIndex, E = w.keywordPatternRe.exec(M);
1447
1483
  }
1448
- N += C.substring(g), H.addText(N);
1484
+ N += M.substring(g), F.addText(N);
1449
1485
  }
1450
1486
  function q() {
1451
- if (C === "") return;
1487
+ if (M === "") return;
1452
1488
  let g = null;
1453
- if (typeof v.subLanguage == "string") {
1454
- if (!e[v.subLanguage]) {
1455
- H.addText(C);
1489
+ if (typeof w.subLanguage == "string") {
1490
+ if (!e[w.subLanguage]) {
1491
+ F.addText(M);
1456
1492
  return;
1457
1493
  }
1458
- g = h(v.subLanguage, C, !0, Pe[v.subLanguage]), Pe[v.subLanguage] = /** @type {CompiledMode} */
1494
+ g = h(w.subLanguage, M, !0, Pe[w.subLanguage]), Pe[w.subLanguage] = /** @type {CompiledMode} */
1459
1495
  g._top;
1460
1496
  } else
1461
- g = m(C, v.subLanguage.length ? v.subLanguage : null);
1462
- v.relevance > 0 && (pe += g.relevance), H.__addSublanguage(g._emitter, g.language);
1497
+ g = m(M, w.subLanguage.length ? w.subLanguage : null);
1498
+ w.relevance > 0 && (pe += g.relevance), F.__addSublanguage(g._emitter, g.language);
1463
1499
  }
1464
1500
  function G() {
1465
- v.subLanguage != null ? q() : z(), C = "";
1501
+ w.subLanguage != null ? q() : z(), M = "";
1466
1502
  }
1467
1503
  function W(g, E) {
1468
- g !== "" && (H.startScope(E), H.addText(g), H.endScope());
1504
+ g !== "" && (F.startScope(E), F.addText(g), F.endScope());
1469
1505
  }
1470
1506
  function Oe(g, E) {
1471
1507
  let N = 1;
1472
- const A = E.length - 1;
1473
- for (; N <= A; ) {
1508
+ const x = E.length - 1;
1509
+ for (; N <= x; ) {
1474
1510
  if (!g._emit[N]) {
1475
1511
  N++;
1476
1512
  continue;
1477
1513
  }
1478
1514
  const K = Y.classNameAliases[g[N]] || g[N], Z = E[N];
1479
- K ? W(Z, K) : (C = Z, z(), C = ""), N++;
1515
+ K ? W(Z, K) : (M = Z, z(), M = ""), N++;
1480
1516
  }
1481
1517
  }
1482
1518
  function Ie(g, E) {
1483
- return g.scope && typeof g.scope == "string" && H.openNode(Y.classNameAliases[g.scope] || g.scope), g.beginScope && (g.beginScope._wrap ? (W(C, Y.classNameAliases[g.beginScope._wrap] || g.beginScope._wrap), C = "") : g.beginScope._multi && (Oe(g.beginScope, E), C = "")), v = Object.create(g, { parent: { value: v } }), v;
1519
+ return g.scope && typeof g.scope == "string" && F.openNode(Y.classNameAliases[g.scope] || g.scope), g.beginScope && (g.beginScope._wrap ? (W(M, Y.classNameAliases[g.beginScope._wrap] || g.beginScope._wrap), M = "") : g.beginScope._multi && (Oe(g.beginScope, E), M = "")), w = Object.create(g, { parent: { value: w } }), w;
1484
1520
  }
1485
1521
  function Le(g, E, N) {
1486
- let A = _n(g.endRe, N);
1487
- if (A) {
1522
+ let x = _n(g.endRe, N);
1523
+ if (x) {
1488
1524
  if (g["on:end"]) {
1489
1525
  const K = new Ge(g);
1490
- g["on:end"](E, K), K.isMatchIgnored && (A = !1);
1526
+ g["on:end"](E, K), K.isMatchIgnored && (x = !1);
1491
1527
  }
1492
- if (A) {
1528
+ if (x) {
1493
1529
  for (; g.endsParent && g.parent; )
1494
1530
  g = g.parent;
1495
1531
  return g;
@@ -1499,95 +1535,95 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), f ===
1499
1535
  return Le(g.parent, E, N);
1500
1536
  }
1501
1537
  function Lt(g) {
1502
- return v.matcher.regexIndex === 0 ? (C += g[0], 1) : (Ne = !0, 0);
1538
+ return w.matcher.regexIndex === 0 ? (M += g[0], 1) : (Ne = !0, 0);
1503
1539
  }
1504
1540
  function Dt(g) {
1505
- const E = g[0], N = g.rule, A = new Ge(N), K = [N.__beforeBegin, N["on:begin"]];
1541
+ const E = g[0], N = g.rule, x = new Ge(N), K = [N.__beforeBegin, N["on:begin"]];
1506
1542
  for (const Z of K)
1507
- if (Z && (Z(g, A), A.isMatchIgnored))
1543
+ if (Z && (Z(g, x), x.isMatchIgnored))
1508
1544
  return Lt(E);
1509
- return N.skip ? C += E : (N.excludeBegin && (C += E), G(), !N.returnBegin && !N.excludeBegin && (C = E)), Ie(N, g), N.returnBegin ? 0 : E.length;
1545
+ return N.skip ? M += E : (N.excludeBegin && (M += E), G(), !N.returnBegin && !N.excludeBegin && (M = E)), Ie(N, g), N.returnBegin ? 0 : E.length;
1510
1546
  }
1511
1547
  function Pt(g) {
1512
- const E = g[0], N = _.substring(g.index), A = Le(v, g, N);
1513
- if (!A)
1514
- return Ve;
1515
- const K = v;
1516
- v.endScope && v.endScope._wrap ? (G(), W(E, v.endScope._wrap)) : v.endScope && v.endScope._multi ? (G(), Oe(v.endScope, g)) : K.skip ? C += E : (K.returnEnd || K.excludeEnd || (C += E), G(), K.excludeEnd && (C = E));
1548
+ const E = g[0], N = _.substring(g.index), x = Le(w, g, N);
1549
+ if (!x)
1550
+ return Xe;
1551
+ const K = w;
1552
+ w.endScope && w.endScope._wrap ? (G(), W(E, w.endScope._wrap)) : w.endScope && w.endScope._multi ? (G(), Oe(w.endScope, g)) : K.skip ? M += E : (K.returnEnd || K.excludeEnd || (M += E), G(), K.excludeEnd && (M = E));
1517
1553
  do
1518
- v.scope && H.closeNode(), !v.skip && !v.subLanguage && (pe += v.relevance), v = v.parent;
1519
- while (v !== A.parent);
1520
- return A.starts && Ie(A.starts, g), K.returnEnd ? 0 : E.length;
1554
+ w.scope && F.closeNode(), !w.skip && !w.subLanguage && (pe += w.relevance), w = w.parent;
1555
+ while (w !== x.parent);
1556
+ return x.starts && Ie(x.starts, g), K.returnEnd ? 0 : E.length;
1521
1557
  }
1522
1558
  function Bt() {
1523
1559
  const g = [];
1524
- for (let E = v; E !== Y; E = E.parent)
1560
+ for (let E = w; E !== Y; E = E.parent)
1525
1561
  E.scope && g.unshift(E.scope);
1526
- g.forEach((E) => H.openNode(E));
1562
+ g.forEach((E) => F.openNode(E));
1527
1563
  }
1528
1564
  let he = {};
1529
1565
  function De(g, E) {
1530
1566
  const N = E && E[0];
1531
- if (C += g, N == null)
1567
+ if (M += g, N == null)
1532
1568
  return G(), 0;
1533
1569
  if (he.type === "begin" && E.type === "end" && he.index === E.index && N === "") {
1534
- if (C += _.slice(E.index, E.index + 1), !r) {
1535
- const A = new Error(`0 width match regex (${u})`);
1536
- throw A.languageName = u, A.badRule = he.rule, A;
1570
+ if (M += _.slice(E.index, E.index + 1), !s) {
1571
+ const x = new Error(`0 width match regex (${u})`);
1572
+ throw x.languageName = u, x.badRule = he.rule, x;
1537
1573
  }
1538
1574
  return 1;
1539
1575
  }
1540
1576
  if (he = E, E.type === "begin")
1541
1577
  return Dt(E);
1542
- if (E.type === "illegal" && !f) {
1543
- const A = new Error('Illegal lexeme "' + N + '" for mode "' + (v.scope || "<unnamed>") + '"');
1544
- throw A.mode = v, A;
1578
+ if (E.type === "illegal" && !b) {
1579
+ const x = new Error('Illegal lexeme "' + N + '" for mode "' + (w.scope || "<unnamed>") + '"');
1580
+ throw x.mode = w, x;
1545
1581
  } else if (E.type === "end") {
1546
- const A = Pt(E);
1547
- if (A !== Ve)
1548
- return A;
1582
+ const x = Pt(E);
1583
+ if (x !== Xe)
1584
+ return x;
1549
1585
  }
1550
1586
  if (E.type === "illegal" && N === "")
1551
- return E.index === _.length || (C += `
1587
+ return E.index === _.length || (M += `
1552
1588
  `), 1;
1553
1589
  if (ke > 1e5 && ke > E.index * 3)
1554
1590
  throw new Error("potential infinite loop, way more iterations than matches");
1555
- return C += N, N.length;
1591
+ return M += N, N.length;
1556
1592
  }
1557
1593
  const Y = $(u);
1558
1594
  if (!Y)
1559
1595
  throw ee(a.replace("{}", u)), new Error('Unknown language: "' + u + '"');
1560
1596
  const $t = Jn(Y);
1561
- let ve = "", v = k || $t;
1562
- const Pe = {}, H = new o.__emitter(o);
1597
+ let ve = "", w = k || $t;
1598
+ const Pe = {}, F = new o.__emitter(o);
1563
1599
  Bt();
1564
- let C = "", pe = 0, j = 0, ke = 0, Ne = !1;
1600
+ let M = "", pe = 0, j = 0, ke = 0, Ne = !1;
1565
1601
  try {
1566
1602
  if (Y.__emitTokens)
1567
- Y.__emitTokens(_, H);
1603
+ Y.__emitTokens(_, F);
1568
1604
  else {
1569
- for (v.matcher.considerAll(); ; ) {
1570
- ke++, Ne ? Ne = !1 : v.matcher.considerAll(), v.matcher.lastIndex = j;
1571
- const g = v.matcher.exec(_);
1605
+ for (w.matcher.considerAll(); ; ) {
1606
+ ke++, Ne ? Ne = !1 : w.matcher.considerAll(), w.matcher.lastIndex = j;
1607
+ const g = w.matcher.exec(_);
1572
1608
  if (!g) break;
1573
1609
  const E = _.substring(j, g.index), N = De(E, g);
1574
1610
  j = g.index + N;
1575
1611
  }
1576
1612
  De(_.substring(j));
1577
1613
  }
1578
- return H.finalize(), ve = H.toHTML(), {
1614
+ return F.finalize(), ve = F.toHTML(), {
1579
1615
  language: u,
1580
1616
  value: ve,
1581
1617
  relevance: pe,
1582
1618
  illegal: !1,
1583
- _emitter: H,
1584
- _top: v
1619
+ _emitter: F,
1620
+ _top: w
1585
1621
  };
1586
1622
  } catch (g) {
1587
1623
  if (g.message && g.message.includes("Illegal"))
1588
1624
  return {
1589
1625
  language: u,
1590
- value: Se(_),
1626
+ value: Te(_),
1591
1627
  illegal: !0,
1592
1628
  relevance: 0,
1593
1629
  _illegalBy: {
@@ -1597,38 +1633,38 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), f ===
1597
1633
  mode: g.mode,
1598
1634
  resultSoFar: ve
1599
1635
  },
1600
- _emitter: H
1636
+ _emitter: F
1601
1637
  };
1602
- if (r)
1638
+ if (s)
1603
1639
  return {
1604
1640
  language: u,
1605
- value: Se(_),
1641
+ value: Te(_),
1606
1642
  illegal: !1,
1607
1643
  relevance: 0,
1608
1644
  errorRaised: g,
1609
- _emitter: H,
1610
- _top: v
1645
+ _emitter: F,
1646
+ _top: w
1611
1647
  };
1612
1648
  throw g;
1613
1649
  }
1614
1650
  }
1615
1651
  function p(u) {
1616
1652
  const _ = {
1617
- value: Se(u),
1653
+ value: Te(u),
1618
1654
  illegal: !1,
1619
1655
  relevance: 0,
1620
- _top: s,
1656
+ _top: r,
1621
1657
  _emitter: new o.__emitter(o)
1622
1658
  };
1623
1659
  return _._emitter.addText(u), _;
1624
1660
  }
1625
1661
  function m(u, _) {
1626
1662
  _ = _ || o.languages || Object.keys(e);
1627
- const f = p(u), k = _.filter($).filter(X).map(
1663
+ const b = p(u), k = _.filter($).filter(V).map(
1628
1664
  (G) => h(G, u, !1)
1629
1665
  );
1630
- k.unshift(f);
1631
- const T = k.sort((G, W) => {
1666
+ k.unshift(b);
1667
+ const S = k.sort((G, W) => {
1632
1668
  if (G.relevance !== W.relevance) return W.relevance - G.relevance;
1633
1669
  if (G.language && W.language) {
1634
1670
  if ($(G.language).supersetOf === W.language)
@@ -1637,20 +1673,20 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), f ===
1637
1673
  return -1;
1638
1674
  }
1639
1675
  return 0;
1640
- }), [P, z] = T, q = P;
1676
+ }), [P, z] = S, q = P;
1641
1677
  return q.secondBest = z, q;
1642
1678
  }
1643
- function y(u, _, f) {
1644
- const k = _ && t[_] || f;
1679
+ function y(u, _, b) {
1680
+ const k = _ && t[_] || b;
1645
1681
  u.classList.add("hljs"), u.classList.add(`language-${k}`);
1646
1682
  }
1647
- function b(u) {
1683
+ function f(u) {
1648
1684
  let _ = null;
1649
- const f = l(u);
1650
- if (c(f)) return;
1651
- if (V(
1685
+ const b = l(u);
1686
+ if (c(b)) return;
1687
+ if (X(
1652
1688
  "before:highlightElement",
1653
- { el: u, language: f }
1689
+ { el: u, language: b }
1654
1690
  ), u.dataset.highlighted) {
1655
1691
  console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.", u);
1656
1692
  return;
@@ -1661,49 +1697,49 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), f ===
1661
1697
  u.innerHTML
1662
1698
  );
1663
1699
  _ = u;
1664
- const k = _.textContent, T = f ? d(k, { language: f, ignoreIllegals: !0 }) : m(k);
1665
- u.innerHTML = T.value, u.dataset.highlighted = "yes", y(u, f, T.language), u.result = {
1666
- language: T.language,
1700
+ const k = _.textContent, S = b ? d(k, { language: b, ignoreIllegals: !0 }) : m(k);
1701
+ u.innerHTML = S.value, u.dataset.highlighted = "yes", y(u, b, S.language), u.result = {
1702
+ language: S.language,
1667
1703
  // TODO: remove with version 11.0
1668
- re: T.relevance,
1669
- relevance: T.relevance
1670
- }, T.secondBest && (u.secondBest = {
1671
- language: T.secondBest.language,
1672
- relevance: T.secondBest.relevance
1673
- }), V("after:highlightElement", { el: u, result: T, text: k });
1674
- }
1675
- function w(u) {
1676
- o = Xe(o, u);
1677
- }
1678
- const M = () => {
1679
- x(), ne("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
1704
+ re: S.relevance,
1705
+ relevance: S.relevance
1706
+ }, S.secondBest && (u.secondBest = {
1707
+ language: S.secondBest.language,
1708
+ relevance: S.secondBest.relevance
1709
+ }), X("after:highlightElement", { el: u, result: S, text: k });
1710
+ }
1711
+ function v(u) {
1712
+ o = Ve(o, u);
1713
+ }
1714
+ const T = () => {
1715
+ C(), ne("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
1680
1716
  };
1681
1717
  function O() {
1682
- x(), ne("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
1718
+ C(), ne("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
1683
1719
  }
1684
1720
  let U = !1;
1685
- function x() {
1721
+ function C() {
1686
1722
  function u() {
1687
- x();
1723
+ C();
1688
1724
  }
1689
1725
  if (document.readyState === "loading") {
1690
1726
  U || window.addEventListener("DOMContentLoaded", u, !1), U = !0;
1691
1727
  return;
1692
1728
  }
1693
- document.querySelectorAll(o.cssSelector).forEach(b);
1729
+ document.querySelectorAll(o.cssSelector).forEach(f);
1694
1730
  }
1695
1731
  function I(u, _) {
1696
- let f = null;
1732
+ let b = null;
1697
1733
  try {
1698
- f = _(n);
1734
+ b = _(n);
1699
1735
  } catch (k) {
1700
- if (ee("Language definition for '{}' could not be registered.".replace("{}", u)), r)
1736
+ if (ee("Language definition for '{}' could not be registered.".replace("{}", u)), s)
1701
1737
  ee(k);
1702
1738
  else
1703
1739
  throw k;
1704
- f = s;
1740
+ b = r;
1705
1741
  }
1706
- f.name || (f.name = u), e[u] = f, f.rawDefinition = _.bind(null, n), f.aliases && F(f.aliases, { languageName: u });
1742
+ b.name || (b.name = u), e[u] = b, b.rawDefinition = _.bind(null, n), b.aliases && H(b.aliases, { languageName: u });
1707
1743
  }
1708
1744
  function D(u) {
1709
1745
  delete e[u];
@@ -1716,12 +1752,12 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), f ===
1716
1752
  function $(u) {
1717
1753
  return u = (u || "").toLowerCase(), e[u] || e[t[u]];
1718
1754
  }
1719
- function F(u, { languageName: _ }) {
1720
- typeof u == "string" && (u = [u]), u.forEach((f) => {
1721
- t[f.toLowerCase()] = _;
1755
+ function H(u, { languageName: _ }) {
1756
+ typeof u == "string" && (u = [u]), u.forEach((b) => {
1757
+ t[b.toLowerCase()] = _;
1722
1758
  });
1723
1759
  }
1724
- function X(u) {
1760
+ function V(u) {
1725
1761
  const _ = $(u);
1726
1762
  return _ && !_.disableAutodetect;
1727
1763
  }
@@ -1743,41 +1779,41 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), f ===
1743
1779
  const _ = i.indexOf(u);
1744
1780
  _ !== -1 && i.splice(_, 1);
1745
1781
  }
1746
- function V(u, _) {
1747
- const f = u;
1782
+ function X(u, _) {
1783
+ const b = u;
1748
1784
  i.forEach(function(k) {
1749
- k[f] && k[f](_);
1785
+ k[b] && k[b](_);
1750
1786
  });
1751
1787
  }
1752
1788
  function ce(u) {
1753
- return ne("10.7.0", "highlightBlock will be removed entirely in v12.0"), ne("10.7.0", "Please use highlightElement now."), b(u);
1789
+ return ne("10.7.0", "highlightBlock will be removed entirely in v12.0"), ne("10.7.0", "Please use highlightElement now."), f(u);
1754
1790
  }
1755
1791
  Object.assign(n, {
1756
1792
  highlight: d,
1757
1793
  highlightAuto: m,
1758
- highlightAll: x,
1759
- highlightElement: b,
1794
+ highlightAll: C,
1795
+ highlightElement: f,
1760
1796
  // TODO: Remove with v12 API
1761
1797
  highlightBlock: ce,
1762
- configure: w,
1763
- initHighlighting: M,
1798
+ configure: v,
1799
+ initHighlighting: T,
1764
1800
  initHighlightingOnLoad: O,
1765
1801
  registerLanguage: I,
1766
1802
  unregisterLanguage: D,
1767
1803
  listLanguages: B,
1768
1804
  getLanguage: $,
1769
- registerAliases: F,
1770
- autoDetection: X,
1771
- inherit: Xe,
1805
+ registerAliases: H,
1806
+ autoDetection: V,
1807
+ inherit: Ve,
1772
1808
  addPlugin: oe,
1773
1809
  removePlugin: ae
1774
1810
  }), n.debugMode = function() {
1775
- r = !1;
1811
+ s = !1;
1776
1812
  }, n.safeMode = function() {
1777
- r = !0;
1813
+ s = !0;
1778
1814
  }, n.versionString = ei, n.regex = {
1779
1815
  concat: te,
1780
- lookahead: st,
1816
+ lookahead: rt,
1781
1817
  either: ye,
1782
1818
  optional: fn,
1783
1819
  anyNumberOfTimes: mn
@@ -1785,12 +1821,12 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), f ===
1785
1821
  for (const u in me)
1786
1822
  typeof me[u] == "object" && it(me[u]);
1787
1823
  return Object.assign(n, me), n;
1788
- }, se = gt({});
1789
- se.newInstance = () => gt({});
1790
- var ii = se;
1791
- se.HighlightJS = se;
1792
- se.default = se;
1793
- const S = /* @__PURE__ */ dn(ii), Qe = "[A-Za-z$_][0-9A-Za-z$_]*", ri = [
1824
+ }, re = gt({});
1825
+ re.newInstance = () => gt({});
1826
+ var ii = re;
1827
+ re.HighlightJS = re;
1828
+ re.default = re;
1829
+ const A = /* @__PURE__ */ dn(ii), Qe = "[A-Za-z$_][0-9A-Za-z$_]*", si = [
1794
1830
  "as",
1795
1831
  // for exports
1796
1832
  "in",
@@ -1835,7 +1871,7 @@ const S = /* @__PURE__ */ dn(ii), Qe = "[A-Za-z$_][0-9A-Za-z$_]*", ri = [
1835
1871
  "extends",
1836
1872
  // It's reached stage 3, which is "recommended for implementation":
1837
1873
  "using"
1838
- ], si = [
1874
+ ], ri = [
1839
1875
  "true",
1840
1876
  "false",
1841
1877
  "null",
@@ -1938,21 +1974,21 @@ const S = /* @__PURE__ */ dn(ii), Qe = "[A-Za-z$_][0-9A-Za-z$_]*", ri = [
1938
1974
  ft
1939
1975
  );
1940
1976
  function _t(n) {
1941
- const e = n.regex, t = (f, { after: k }) => {
1942
- const T = "</" + f[0].slice(1);
1943
- return f.input.indexOf(T, k) !== -1;
1944
- }, i = Qe, r = {
1977
+ const e = n.regex, t = (b, { after: k }) => {
1978
+ const S = "</" + b[0].slice(1);
1979
+ return b.input.indexOf(S, k) !== -1;
1980
+ }, i = Qe, s = {
1945
1981
  begin: "<>",
1946
1982
  end: "</>"
1947
- }, a = /<[A-Za-z0-9\\._:-]+\s*\/>/, s = {
1983
+ }, a = /<[A-Za-z0-9\\._:-]+\s*\/>/, r = {
1948
1984
  begin: /<[A-Za-z0-9\\._:-]+/,
1949
1985
  end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
1950
1986
  /**
1951
1987
  * @param {RegExpMatchArray} match
1952
1988
  * @param {CallbackResponse} response
1953
1989
  */
1954
- isTrulyOpeningTag: (f, k) => {
1955
- const T = f[0].length + f.index, P = f.input[T];
1990
+ isTrulyOpeningTag: (b, k) => {
1991
+ const S = b[0].length + b.index, P = b.input[S];
1956
1992
  if (
1957
1993
  // HTML should not include another raw `<` inside a tag
1958
1994
  // nested type?
@@ -1964,9 +2000,9 @@ function _t(n) {
1964
2000
  k.ignoreMatch();
1965
2001
  return;
1966
2002
  }
1967
- P === ">" && (t(f, { after: T }) || k.ignoreMatch());
2003
+ P === ">" && (t(b, { after: S }) || k.ignoreMatch());
1968
2004
  let z;
1969
- const q = f.input.substring(T);
2005
+ const q = b.input.substring(S);
1970
2006
  if (z = q.match(/^\s*=/)) {
1971
2007
  k.ignoreMatch();
1972
2008
  return;
@@ -1978,8 +2014,8 @@ function _t(n) {
1978
2014
  }
1979
2015
  }, o = {
1980
2016
  $pattern: Qe,
1981
- keyword: ri,
1982
- literal: si,
2017
+ keyword: si,
2018
+ literal: ri,
1983
2019
  built_in: ai,
1984
2020
  "variable.language": oi
1985
2021
  }, c = "[0-9](_?[0-9])*", l = `\\.(${c})`, d = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", h = {
@@ -2030,7 +2066,7 @@ function _t(n) {
2030
2066
  ],
2031
2067
  subLanguage: "css"
2032
2068
  }
2033
- }, b = {
2069
+ }, f = {
2034
2070
  begin: ".?gql`",
2035
2071
  end: "",
2036
2072
  starts: {
@@ -2042,7 +2078,7 @@ function _t(n) {
2042
2078
  ],
2043
2079
  subLanguage: "graphql"
2044
2080
  }
2045
- }, w = {
2081
+ }, v = {
2046
2082
  className: "string",
2047
2083
  begin: "`",
2048
2084
  end: "`",
@@ -2100,8 +2136,8 @@ function _t(n) {
2100
2136
  n.QUOTE_STRING_MODE,
2101
2137
  m,
2102
2138
  y,
2103
- b,
2104
- w,
2139
+ f,
2140
+ v,
2105
2141
  // Skip numbers when they are part of a variable name
2106
2142
  { match: /\$\d+/ },
2107
2143
  h
@@ -2119,13 +2155,13 @@ function _t(n) {
2119
2155
  "self"
2120
2156
  ].concat(U)
2121
2157
  });
2122
- const x = [].concat(O, p.contains), I = x.concat([
2158
+ const C = [].concat(O, p.contains), I = C.concat([
2123
2159
  // eat recursive parens in sub expressions
2124
2160
  {
2125
2161
  begin: /(\s*)\(/,
2126
2162
  end: /\)/,
2127
2163
  keywords: o,
2128
- contains: ["self"].concat(x)
2164
+ contains: ["self"].concat(C)
2129
2165
  }
2130
2166
  ]), D = {
2131
2167
  className: "params",
@@ -2194,12 +2230,12 @@ function _t(n) {
2194
2230
  ...ft
2195
2231
  ]
2196
2232
  }
2197
- }, F = {
2233
+ }, H = {
2198
2234
  label: "use_strict",
2199
2235
  className: "meta",
2200
2236
  relevance: 10,
2201
2237
  begin: /^\s*['"]use (strict|asm)['"]/
2202
- }, X = {
2238
+ }, V = {
2203
2239
  variants: [
2204
2240
  {
2205
2241
  match: [
@@ -2229,8 +2265,8 @@ function _t(n) {
2229
2265
  match: /\b[A-Z][A-Z_0-9]+\b/,
2230
2266
  className: "variable.constant"
2231
2267
  };
2232
- function oe(f) {
2233
- return e.concat("(?!", f.join("|"), ")");
2268
+ function oe(b) {
2269
+ return e.concat("(?!", b.join("|"), ")");
2234
2270
  }
2235
2271
  const ae = {
2236
2272
  match: e.concat(
@@ -2240,13 +2276,13 @@ function _t(n) {
2240
2276
  "super",
2241
2277
  "import",
2242
2278
  "await"
2243
- ].map((f) => `${f}\\s*\\(`)),
2279
+ ].map((b) => `${b}\\s*\\(`)),
2244
2280
  i,
2245
2281
  e.lookahead(/\s*\(/)
2246
2282
  ),
2247
2283
  className: "title.function",
2248
2284
  relevance: 0
2249
- }, V = {
2285
+ }, X = {
2250
2286
  begin: e.concat(/\./, e.lookahead(
2251
2287
  e.concat(i, /(?![0-9A-Za-z$_(])/)
2252
2288
  )),
@@ -2306,13 +2342,13 @@ function _t(n) {
2306
2342
  binary: "node",
2307
2343
  relevance: 5
2308
2344
  }),
2309
- F,
2345
+ H,
2310
2346
  n.APOS_STRING_MODE,
2311
2347
  n.QUOTE_STRING_MODE,
2312
2348
  m,
2313
2349
  y,
2314
- b,
2315
- w,
2350
+ f,
2351
+ v,
2316
2352
  O,
2317
2353
  // Skip numbers when they are part of a variable name
2318
2354
  { match: /\$\d+/ },
@@ -2377,21 +2413,21 @@ function _t(n) {
2377
2413
  {
2378
2414
  // JSX
2379
2415
  variants: [
2380
- { begin: r.begin, end: r.end },
2416
+ { begin: s.begin, end: s.end },
2381
2417
  { match: a },
2382
2418
  {
2383
- begin: s.begin,
2419
+ begin: r.begin,
2384
2420
  // we carefully check the opening tag to see if it truly
2385
2421
  // is a tag and not a false positive
2386
- "on:begin": s.isTrulyOpeningTag,
2387
- end: s.end
2422
+ "on:begin": r.isTrulyOpeningTag,
2423
+ end: r.end
2388
2424
  }
2389
2425
  ],
2390
2426
  subLanguage: "xml",
2391
2427
  contains: [
2392
2428
  {
2393
- begin: s.begin,
2394
- end: s.end,
2429
+ begin: r.begin,
2430
+ end: r.end,
2395
2431
  skip: !0,
2396
2432
  contains: ["self"]
2397
2433
  }
@@ -2399,7 +2435,7 @@ function _t(n) {
2399
2435
  }
2400
2436
  ]
2401
2437
  },
2402
- X,
2438
+ V,
2403
2439
  {
2404
2440
  // prevent this from getting swallowed up by function
2405
2441
  // since they appear "function like"
@@ -2423,7 +2459,7 @@ function _t(n) {
2423
2459
  match: /\.\.\./,
2424
2460
  relevance: 0
2425
2461
  },
2426
- V,
2462
+ X,
2427
2463
  // hack: prevents detection of keywords in some circumstances
2428
2464
  // .keyword()
2429
2465
  // $keyword = x
@@ -2589,27 +2625,27 @@ const Ee = "[A-Za-z$_][0-9A-Za-z$_]*", Et = [
2589
2625
  "self",
2590
2626
  "global"
2591
2627
  // Node.js
2592
- ], Tt = [].concat(
2628
+ ], St = [].concat(
2593
2629
  kt,
2594
2630
  wt,
2595
2631
  vt
2596
2632
  );
2597
2633
  function ci(n) {
2598
- const e = n.regex, t = (f, { after: k }) => {
2599
- const T = "</" + f[0].slice(1);
2600
- return f.input.indexOf(T, k) !== -1;
2601
- }, i = Ee, r = {
2634
+ const e = n.regex, t = (b, { after: k }) => {
2635
+ const S = "</" + b[0].slice(1);
2636
+ return b.input.indexOf(S, k) !== -1;
2637
+ }, i = Ee, s = {
2602
2638
  begin: "<>",
2603
2639
  end: "</>"
2604
- }, a = /<[A-Za-z0-9\\._:-]+\s*\/>/, s = {
2640
+ }, a = /<[A-Za-z0-9\\._:-]+\s*\/>/, r = {
2605
2641
  begin: /<[A-Za-z0-9\\._:-]+/,
2606
2642
  end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
2607
2643
  /**
2608
2644
  * @param {RegExpMatchArray} match
2609
2645
  * @param {CallbackResponse} response
2610
2646
  */
2611
- isTrulyOpeningTag: (f, k) => {
2612
- const T = f[0].length + f.index, P = f.input[T];
2647
+ isTrulyOpeningTag: (b, k) => {
2648
+ const S = b[0].length + b.index, P = b.input[S];
2613
2649
  if (
2614
2650
  // HTML should not include another raw `<` inside a tag
2615
2651
  // nested type?
@@ -2621,9 +2657,9 @@ function ci(n) {
2621
2657
  k.ignoreMatch();
2622
2658
  return;
2623
2659
  }
2624
- P === ">" && (t(f, { after: T }) || k.ignoreMatch());
2660
+ P === ">" && (t(b, { after: S }) || k.ignoreMatch());
2625
2661
  let z;
2626
- const q = f.input.substring(T);
2662
+ const q = b.input.substring(S);
2627
2663
  if (z = q.match(/^\s*=/)) {
2628
2664
  k.ignoreMatch();
2629
2665
  return;
@@ -2637,7 +2673,7 @@ function ci(n) {
2637
2673
  $pattern: Ee,
2638
2674
  keyword: Et,
2639
2675
  literal: yt,
2640
- built_in: Tt,
2676
+ built_in: St,
2641
2677
  "variable.language": Nt
2642
2678
  }, c = "[0-9](_?[0-9])*", l = `\\.(${c})`, d = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", h = {
2643
2679
  className: "number",
@@ -2687,7 +2723,7 @@ function ci(n) {
2687
2723
  ],
2688
2724
  subLanguage: "css"
2689
2725
  }
2690
- }, b = {
2726
+ }, f = {
2691
2727
  begin: ".?gql`",
2692
2728
  end: "",
2693
2729
  starts: {
@@ -2699,7 +2735,7 @@ function ci(n) {
2699
2735
  ],
2700
2736
  subLanguage: "graphql"
2701
2737
  }
2702
- }, w = {
2738
+ }, v = {
2703
2739
  className: "string",
2704
2740
  begin: "`",
2705
2741
  end: "`",
@@ -2757,8 +2793,8 @@ function ci(n) {
2757
2793
  n.QUOTE_STRING_MODE,
2758
2794
  m,
2759
2795
  y,
2760
- b,
2761
- w,
2796
+ f,
2797
+ v,
2762
2798
  // Skip numbers when they are part of a variable name
2763
2799
  { match: /\$\d+/ },
2764
2800
  h
@@ -2776,13 +2812,13 @@ function ci(n) {
2776
2812
  "self"
2777
2813
  ].concat(U)
2778
2814
  });
2779
- const x = [].concat(O, p.contains), I = x.concat([
2815
+ const C = [].concat(O, p.contains), I = C.concat([
2780
2816
  // eat recursive parens in sub expressions
2781
2817
  {
2782
2818
  begin: /(\s*)\(/,
2783
2819
  end: /\)/,
2784
2820
  keywords: o,
2785
- contains: ["self"].concat(x)
2821
+ contains: ["self"].concat(C)
2786
2822
  }
2787
2823
  ]), D = {
2788
2824
  className: "params",
@@ -2851,12 +2887,12 @@ function ci(n) {
2851
2887
  ...vt
2852
2888
  ]
2853
2889
  }
2854
- }, F = {
2890
+ }, H = {
2855
2891
  label: "use_strict",
2856
2892
  className: "meta",
2857
2893
  relevance: 10,
2858
2894
  begin: /^\s*['"]use (strict|asm)['"]/
2859
- }, X = {
2895
+ }, V = {
2860
2896
  variants: [
2861
2897
  {
2862
2898
  match: [
@@ -2886,8 +2922,8 @@ function ci(n) {
2886
2922
  match: /\b[A-Z][A-Z_0-9]+\b/,
2887
2923
  className: "variable.constant"
2888
2924
  };
2889
- function oe(f) {
2890
- return e.concat("(?!", f.join("|"), ")");
2925
+ function oe(b) {
2926
+ return e.concat("(?!", b.join("|"), ")");
2891
2927
  }
2892
2928
  const ae = {
2893
2929
  match: e.concat(
@@ -2897,13 +2933,13 @@ function ci(n) {
2897
2933
  "super",
2898
2934
  "import",
2899
2935
  "await"
2900
- ].map((f) => `${f}\\s*\\(`)),
2936
+ ].map((b) => `${b}\\s*\\(`)),
2901
2937
  i,
2902
2938
  e.lookahead(/\s*\(/)
2903
2939
  ),
2904
2940
  className: "title.function",
2905
2941
  relevance: 0
2906
- }, V = {
2942
+ }, X = {
2907
2943
  begin: e.concat(/\./, e.lookahead(
2908
2944
  e.concat(i, /(?![0-9A-Za-z$_(])/)
2909
2945
  )),
@@ -2963,13 +2999,13 @@ function ci(n) {
2963
2999
  binary: "node",
2964
3000
  relevance: 5
2965
3001
  }),
2966
- F,
3002
+ H,
2967
3003
  n.APOS_STRING_MODE,
2968
3004
  n.QUOTE_STRING_MODE,
2969
3005
  m,
2970
3006
  y,
2971
- b,
2972
- w,
3007
+ f,
3008
+ v,
2973
3009
  O,
2974
3010
  // Skip numbers when they are part of a variable name
2975
3011
  { match: /\$\d+/ },
@@ -3034,21 +3070,21 @@ function ci(n) {
3034
3070
  {
3035
3071
  // JSX
3036
3072
  variants: [
3037
- { begin: r.begin, end: r.end },
3073
+ { begin: s.begin, end: s.end },
3038
3074
  { match: a },
3039
3075
  {
3040
- begin: s.begin,
3076
+ begin: r.begin,
3041
3077
  // we carefully check the opening tag to see if it truly
3042
3078
  // is a tag and not a false positive
3043
- "on:begin": s.isTrulyOpeningTag,
3044
- end: s.end
3079
+ "on:begin": r.isTrulyOpeningTag,
3080
+ end: r.end
3045
3081
  }
3046
3082
  ],
3047
3083
  subLanguage: "xml",
3048
3084
  contains: [
3049
3085
  {
3050
- begin: s.begin,
3051
- end: s.end,
3086
+ begin: r.begin,
3087
+ end: r.end,
3052
3088
  skip: !0,
3053
3089
  contains: ["self"]
3054
3090
  }
@@ -3056,7 +3092,7 @@ function ci(n) {
3056
3092
  }
3057
3093
  ]
3058
3094
  },
3059
- X,
3095
+ V,
3060
3096
  {
3061
3097
  // prevent this from getting swallowed up by function
3062
3098
  // since they appear "function like"
@@ -3080,7 +3116,7 @@ function ci(n) {
3080
3116
  match: /\.\.\./,
3081
3117
  relevance: 0
3082
3118
  },
3083
- V,
3119
+ X,
3084
3120
  // hack: prevents detection of keywords in some circumstances
3085
3121
  // .keyword()
3086
3122
  // $keyword = x
@@ -3104,8 +3140,8 @@ function ci(n) {
3104
3140
  ]
3105
3141
  };
3106
3142
  }
3107
- function St(n) {
3108
- const e = n.regex, t = ci(n), i = Ee, r = [
3143
+ function Tt(n) {
3144
+ const e = n.regex, t = ci(n), i = Ee, s = [
3109
3145
  "any",
3110
3146
  "void",
3111
3147
  "number",
@@ -3126,13 +3162,13 @@ function St(n) {
3126
3162
  1: "keyword",
3127
3163
  3: "title.class"
3128
3164
  }
3129
- }, s = {
3165
+ }, r = {
3130
3166
  beginKeywords: "interface",
3131
3167
  end: /\{/,
3132
3168
  excludeEnd: !0,
3133
3169
  keywords: {
3134
3170
  keyword: "interface extends",
3135
- built_in: r
3171
+ built_in: s
3136
3172
  },
3137
3173
  contains: [t.exports.CLASS_REFERENCE]
3138
3174
  }, o = {
@@ -3157,19 +3193,19 @@ function St(n) {
3157
3193
  $pattern: Ee,
3158
3194
  keyword: Et.concat(c),
3159
3195
  literal: yt,
3160
- built_in: Tt.concat(r),
3196
+ built_in: St.concat(s),
3161
3197
  "variable.language": Nt
3162
3198
  }, d = {
3163
3199
  className: "meta",
3164
3200
  begin: "@" + i
3165
- }, h = (b, w, M) => {
3166
- const O = b.contains.findIndex((U) => U.label === w);
3201
+ }, h = (f, v, T) => {
3202
+ const O = f.contains.findIndex((U) => U.label === v);
3167
3203
  if (O === -1)
3168
3204
  throw new Error("can not find mode to replace");
3169
- b.contains.splice(O, 1, M);
3205
+ f.contains.splice(O, 1, T);
3170
3206
  };
3171
3207
  Object.assign(t.keywords, l), t.exports.PARAMS_CONTAINS.push(d);
3172
- const p = t.contains.find((b) => b.scope === "attr"), m = Object.assign(
3208
+ const p = t.contains.find((f) => f.scope === "attr"), m = Object.assign(
3173
3209
  {},
3174
3210
  p,
3175
3211
  { match: e.concat(i, e.lookahead(/\s*\?:/)) }
@@ -3184,11 +3220,11 @@ function St(n) {
3184
3220
  ]), t.contains = t.contains.concat([
3185
3221
  d,
3186
3222
  a,
3187
- s,
3223
+ r,
3188
3224
  m
3189
3225
  // Added for optional property assignment highlighting
3190
3226
  ]), h(t, "shebang", n.SHEBANG()), h(t, "use_strict", o);
3191
- const y = t.contains.find((b) => b.label === "func.def");
3227
+ const y = t.contains.find((f) => f.label === "func.def");
3192
3228
  return y.relevance = 0, Object.assign(t, {
3193
3229
  name: "TypeScript",
3194
3230
  aliases: [
@@ -3430,7 +3466,7 @@ function At(n) {
3430
3466
  n.APOS_STRING_MODE,
3431
3467
  n.QUOTE_STRING_MODE
3432
3468
  ]
3433
- }, p = "[0-9](_?[0-9])*", m = `(\\b(${p}))?\\.(${p})|\\b(${p})\\.`, y = `\\b|${i.join("|")}`, b = {
3469
+ }, p = "[0-9](_?[0-9])*", m = `(\\b(${p}))?\\.(${p})|\\b(${p})\\.`, y = `\\b|${i.join("|")}`, f = {
3434
3470
  className: "number",
3435
3471
  relevance: 0,
3436
3472
  variants: [
@@ -3474,7 +3510,7 @@ function At(n) {
3474
3510
  begin: `\\b(${p})[jJ](?=${y})`
3475
3511
  }
3476
3512
  ]
3477
- }, w = {
3513
+ }, v = {
3478
3514
  className: "comment",
3479
3515
  begin: e.lookahead(/# type:/),
3480
3516
  end: /$/,
@@ -3491,7 +3527,7 @@ function At(n) {
3491
3527
  endsWithParent: !0
3492
3528
  }
3493
3529
  ]
3494
- }, M = {
3530
+ }, T = {
3495
3531
  className: "params",
3496
3532
  variants: [
3497
3533
  // Exclude params in functions without params
@@ -3509,7 +3545,7 @@ function At(n) {
3509
3545
  contains: [
3510
3546
  "self",
3511
3547
  c,
3512
- b,
3548
+ f,
3513
3549
  h,
3514
3550
  n.HASH_COMMENT_MODE
3515
3551
  ]
@@ -3518,7 +3554,7 @@ function At(n) {
3518
3554
  };
3519
3555
  return l.contains = [
3520
3556
  h,
3521
- b,
3557
+ f,
3522
3558
  c
3523
3559
  ], {
3524
3560
  name: "Python",
@@ -3532,7 +3568,7 @@ function At(n) {
3532
3568
  illegal: /(<\/|\?)|=>/,
3533
3569
  contains: [
3534
3570
  c,
3535
- b,
3571
+ f,
3536
3572
  {
3537
3573
  // very common convention
3538
3574
  scope: "variable.language",
@@ -3546,7 +3582,7 @@ function At(n) {
3546
3582
  },
3547
3583
  { match: /\bor\b/, scope: "keyword" },
3548
3584
  h,
3549
- w,
3585
+ v,
3550
3586
  n.HASH_COMMENT_MODE,
3551
3587
  {
3552
3588
  match: [
@@ -3558,7 +3594,7 @@ function At(n) {
3558
3594
  1: "keyword",
3559
3595
  3: "title.function"
3560
3596
  },
3561
- contains: [M]
3597
+ contains: [T]
3562
3598
  },
3563
3599
  {
3564
3600
  variants: [
@@ -3592,8 +3628,8 @@ function At(n) {
3592
3628
  begin: /^[\t ]*@/,
3593
3629
  end: /(?=#)|$/,
3594
3630
  contains: [
3595
- b,
3596
- M,
3631
+ f,
3632
+ T,
3597
3633
  h
3598
3634
  ]
3599
3635
  }
@@ -3618,7 +3654,7 @@ function ui(n) {
3618
3654
  "true",
3619
3655
  "false",
3620
3656
  "null"
3621
- ], r = {
3657
+ ], s = {
3622
3658
  scope: "literal",
3623
3659
  beginKeywords: i.join(" ")
3624
3660
  };
@@ -3633,7 +3669,7 @@ function ui(n) {
3633
3669
  t,
3634
3670
  n.APOS_STRING_MODE,
3635
3671
  n.QUOTE_STRING_MODE,
3636
- r,
3672
+ s,
3637
3673
  di,
3638
3674
  n.C_LINE_COMMENT_MODE,
3639
3675
  n.C_BLOCK_COMMENT_MODE
@@ -3666,7 +3702,7 @@ function Me(n) {
3666
3702
  i
3667
3703
  ]
3668
3704
  });
3669
- const r = {
3705
+ const s = {
3670
3706
  className: "subst",
3671
3707
  begin: /\$\(/,
3672
3708
  end: /\)/,
@@ -3682,7 +3718,7 @@ function Me(n) {
3682
3718
  2: "comment"
3683
3719
  }
3684
3720
  }
3685
- ), s = {
3721
+ ), r = {
3686
3722
  begin: /<<-?\s*(?=\w+)/,
3687
3723
  starts: { contains: [
3688
3724
  n.END_SAME_AS_BEGIN({
@@ -3698,10 +3734,10 @@ function Me(n) {
3698
3734
  contains: [
3699
3735
  n.BACKSLASH_ESCAPE,
3700
3736
  t,
3701
- r
3737
+ s
3702
3738
  ]
3703
3739
  };
3704
- r.contains.push(o);
3740
+ s.contains.push(o);
3705
3741
  const c = {
3706
3742
  match: /\\"/
3707
3743
  }, l = {
@@ -3740,7 +3776,7 @@ function Me(n) {
3740
3776
  returnBegin: !0,
3741
3777
  contains: [n.inherit(n.TITLE_MODE, { begin: /\w[\w\d_]*/ })],
3742
3778
  relevance: 0
3743
- }, b = [
3779
+ }, f = [
3744
3780
  "if",
3745
3781
  "then",
3746
3782
  "else",
@@ -3758,10 +3794,10 @@ function Me(n) {
3758
3794
  "coproc",
3759
3795
  "function",
3760
3796
  "select"
3761
- ], w = [
3797
+ ], v = [
3762
3798
  "true",
3763
3799
  "false"
3764
- ], M = { match: /(\/[a-z._-]+)+/ }, O = [
3800
+ ], T = { match: /(\/[a-z._-]+)+/ }, O = [
3765
3801
  "break",
3766
3802
  "cd",
3767
3803
  "continue",
@@ -3803,7 +3839,7 @@ function Me(n) {
3803
3839
  "typeset",
3804
3840
  "ulimit",
3805
3841
  "unalias"
3806
- ], x = [
3842
+ ], C = [
3807
3843
  "autoload",
3808
3844
  "bg",
3809
3845
  "bindkey",
@@ -3985,15 +4021,15 @@ function Me(n) {
3985
4021
  ],
3986
4022
  keywords: {
3987
4023
  $pattern: /\b[a-z][a-z0-9._-]+\b/,
3988
- keyword: b,
3989
- literal: w,
4024
+ keyword: f,
4025
+ literal: v,
3990
4026
  built_in: [
3991
4027
  ...O,
3992
4028
  ...U,
3993
4029
  // Shell modifiers
3994
4030
  "set",
3995
4031
  "shopt",
3996
- ...x,
4032
+ ...C,
3997
4033
  ...I
3998
4034
  ]
3999
4035
  },
@@ -4005,8 +4041,8 @@ function Me(n) {
4005
4041
  y,
4006
4042
  h,
4007
4043
  a,
4008
- s,
4009
- M,
4044
+ r,
4045
+ T,
4010
4046
  o,
4011
4047
  c,
4012
4048
  l,
@@ -4823,7 +4859,7 @@ const hi = (n) => ({
4823
4859
  "zoom"
4824
4860
  ].sort().reverse();
4825
4861
  function yi(n) {
4826
- const e = n.regex, t = hi(n), i = { begin: /-(webkit|moz|ms|o)-(?=[a-z])/ }, r = "and or not only", a = /@-?\w[\w]*(-\w+)*/, s = "[a-zA-Z-][a-zA-Z0-9_-]*", o = [
4862
+ const e = n.regex, t = hi(n), i = { begin: /-(webkit|moz|ms|o)-(?=[a-z])/ }, s = "and or not only", a = /@-?\w[\w]*(-\w+)*/, r = "[a-zA-Z-][a-zA-Z0-9_-]*", o = [
4827
4863
  n.APOS_STRING_MODE,
4828
4864
  n.QUOTE_STRING_MODE
4829
4865
  ];
@@ -4850,7 +4886,7 @@ function yi(n) {
4850
4886
  },
4851
4887
  {
4852
4888
  className: "selector-class",
4853
- begin: "\\." + s,
4889
+ begin: "\\." + r,
4854
4890
  relevance: 0
4855
4891
  },
4856
4892
  t.ATTRIBUTE_SELECTOR_MODE,
@@ -4925,7 +4961,7 @@ function yi(n) {
4925
4961
  relevance: 0,
4926
4962
  keywords: {
4927
4963
  $pattern: /[a-z-]+/,
4928
- keyword: r,
4964
+ keyword: s,
4929
4965
  attribute: fi.join(" ")
4930
4966
  },
4931
4967
  contains: [
@@ -4947,7 +4983,7 @@ function yi(n) {
4947
4983
  };
4948
4984
  }
4949
4985
  function Re(n) {
4950
- const e = n.regex, t = e.concat(/[\p{L}_]/u, e.optional(/[\p{L}0-9_.-]*:/u), /[\p{L}0-9_.-]*/u), i = /[\p{L}0-9._:-]+/u, r = {
4986
+ const e = n.regex, t = e.concat(/[\p{L}_]/u, e.optional(/[\p{L}0-9_.-]*:/u), /[\p{L}0-9_.-]*/u), i = /[\p{L}0-9._:-]+/u, s = {
4951
4987
  className: "symbol",
4952
4988
  begin: /&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/
4953
4989
  }, a = {
@@ -4959,7 +4995,7 @@ function Re(n) {
4959
4995
  illegal: /\n/
4960
4996
  }
4961
4997
  ]
4962
- }, s = n.inherit(a, {
4998
+ }, r = n.inherit(a, {
4963
4999
  begin: /\(/,
4964
5000
  end: /\)/
4965
5001
  }), o = n.inherit(n.APOS_STRING_MODE, { className: "string" }), c = n.inherit(n.QUOTE_STRING_MODE, { className: "string" }), l = {
@@ -4983,12 +5019,12 @@ function Re(n) {
4983
5019
  {
4984
5020
  begin: /"/,
4985
5021
  end: /"/,
4986
- contains: [r]
5022
+ contains: [s]
4987
5023
  },
4988
5024
  {
4989
5025
  begin: /'/,
4990
5026
  end: /'/,
4991
- contains: [r]
5027
+ contains: [s]
4992
5028
  },
4993
5029
  { begin: /[^\s"'=<>`]+/ }
4994
5030
  ]
@@ -5023,7 +5059,7 @@ function Re(n) {
5023
5059
  a,
5024
5060
  c,
5025
5061
  o,
5026
- s,
5062
+ r,
5027
5063
  {
5028
5064
  begin: /\[/,
5029
5065
  end: /\]/,
@@ -5034,7 +5070,7 @@ function Re(n) {
5034
5070
  end: />/,
5035
5071
  contains: [
5036
5072
  a,
5037
- s,
5073
+ r,
5038
5074
  c,
5039
5075
  o
5040
5076
  ]
@@ -5053,7 +5089,7 @@ function Re(n) {
5053
5089
  end: /\]\]>/,
5054
5090
  relevance: 10
5055
5091
  },
5056
- r,
5092
+ s,
5057
5093
  // xml processing instructions
5058
5094
  {
5059
5095
  className: "meta",
@@ -5165,7 +5201,7 @@ function wi(n) {
5165
5201
  contains: [{ match: /''/ }]
5166
5202
  }
5167
5203
  ]
5168
- }, r = {
5204
+ }, s = {
5169
5205
  begin: /"/,
5170
5206
  end: /"/,
5171
5207
  contains: [{ match: /""/ }]
@@ -5175,7 +5211,7 @@ function wi(n) {
5175
5211
  // Not sure it's correct to call NULL literal, and clauses like IS [NOT] NULL look strange that way.
5176
5212
  // "null",
5177
5213
  "unknown"
5178
- ], s = [
5214
+ ], r = [
5179
5215
  "double precision",
5180
5216
  "large object",
5181
5217
  "with timezone",
@@ -5707,14 +5743,14 @@ function wi(n) {
5707
5743
  ], m = d, y = [
5708
5744
  ...l,
5709
5745
  ...c
5710
- ].filter((I) => !d.includes(I)), b = {
5746
+ ].filter((I) => !d.includes(I)), f = {
5711
5747
  scope: "variable",
5712
5748
  match: /@[a-z0-9][a-z0-9_]*/
5713
- }, w = {
5749
+ }, v = {
5714
5750
  scope: "operator",
5715
5751
  match: /[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,
5716
5752
  relevance: 0
5717
- }, M = {
5753
+ }, T = {
5718
5754
  match: e.concat(/\b/, e.either(...m), /\s*\(/),
5719
5755
  relevance: 0,
5720
5756
  keywords: { built_in: m }
@@ -5731,12 +5767,12 @@ function wi(n) {
5731
5767
  match: O(p),
5732
5768
  relevance: 0
5733
5769
  };
5734
- function x(I, {
5770
+ function C(I, {
5735
5771
  exceptions: D,
5736
5772
  when: B
5737
5773
  } = {}) {
5738
5774
  const $ = B;
5739
- return D = D || [], I.map((F) => F.match(/\|\d+$/) || D.includes(F) ? F : $(F) ? `${F}|0` : F);
5775
+ return D = D || [], I.map((H) => H.match(/\|\d+$/) || D.includes(H) ? H : $(H) ? `${H}|0` : H);
5740
5776
  }
5741
5777
  return {
5742
5778
  name: "SQL",
@@ -5745,7 +5781,7 @@ function wi(n) {
5745
5781
  illegal: /[{}]|<\//,
5746
5782
  keywords: {
5747
5783
  $pattern: /\b[\w\.]+/,
5748
- keyword: x(y, { when: (I) => I.length < 3 }),
5784
+ keyword: C(y, { when: (I) => I.length < 3 }),
5749
5785
  literal: a,
5750
5786
  type: o,
5751
5787
  built_in: h
@@ -5753,17 +5789,17 @@ function wi(n) {
5753
5789
  contains: [
5754
5790
  {
5755
5791
  scope: "type",
5756
- match: O(s)
5792
+ match: O(r)
5757
5793
  },
5758
5794
  U,
5759
- M,
5760
- b,
5795
+ T,
5796
+ f,
5761
5797
  i,
5762
- r,
5798
+ s,
5763
5799
  n.C_NUMBER_MODE,
5764
5800
  n.C_BLOCK_COMMENT_MODE,
5765
5801
  t,
5766
- w
5802
+ v
5767
5803
  ]
5768
5804
  };
5769
5805
  }
@@ -5782,7 +5818,7 @@ function xt(n) {
5782
5818
  begin: /'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/
5783
5819
  }
5784
5820
  ]
5785
- }, r = {
5821
+ }, s = {
5786
5822
  className: "template-variable",
5787
5823
  variants: [
5788
5824
  {
@@ -5808,7 +5844,7 @@ function xt(n) {
5808
5844
  relevance: 0
5809
5845
  }
5810
5846
  ]
5811
- }, s = {
5847
+ }, r = {
5812
5848
  className: "string",
5813
5849
  relevance: 0,
5814
5850
  variants: [
@@ -5820,9 +5856,9 @@ function xt(n) {
5820
5856
  ],
5821
5857
  contains: [
5822
5858
  n.BACKSLASH_ESCAPE,
5823
- r
5859
+ s
5824
5860
  ]
5825
- }, o = n.inherit(s, { variants: [
5861
+ }, o = n.inherit(r, { variants: [
5826
5862
  {
5827
5863
  begin: /'/,
5828
5864
  end: /'/,
@@ -5853,13 +5889,13 @@ function xt(n) {
5853
5889
  contains: [m],
5854
5890
  illegal: "\\n",
5855
5891
  relevance: 0
5856
- }, b = {
5892
+ }, f = {
5857
5893
  begin: "\\[",
5858
5894
  end: "\\]",
5859
5895
  contains: [m],
5860
5896
  illegal: "\\n",
5861
5897
  relevance: 0
5862
- }, w = [
5898
+ }, v = [
5863
5899
  i,
5864
5900
  {
5865
5901
  className: "meta",
@@ -5936,15 +5972,15 @@ function xt(n) {
5936
5972
  relevance: 0
5937
5973
  },
5938
5974
  y,
5939
- b,
5975
+ f,
5940
5976
  a,
5941
- s
5942
- ], M = [...w];
5943
- return M.pop(), M.push(o), m.contains = M, {
5977
+ r
5978
+ ], T = [...v];
5979
+ return T.pop(), T.push(o), m.contains = T, {
5944
5980
  name: "YAML",
5945
5981
  case_insensitive: !0,
5946
5982
  aliases: ["yml"],
5947
- contains: w
5983
+ contains: v
5948
5984
  };
5949
5985
  }
5950
5986
  function Ct(n) {
@@ -5953,7 +5989,7 @@ function Ct(n) {
5953
5989
  end: ">",
5954
5990
  subLanguage: "xml",
5955
5991
  relevance: 0
5956
- }, i = { match: /^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/ }, r = {
5992
+ }, i = { match: /^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/ }, s = {
5957
5993
  className: "code",
5958
5994
  variants: [
5959
5995
  // TODO: fix to allow these to work with sublanguage also
@@ -5987,7 +6023,7 @@ function Ct(n) {
5987
6023
  begin: "^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",
5988
6024
  end: "\\s+",
5989
6025
  excludeEnd: !0
5990
- }, s = {
6026
+ }, r = {
5991
6027
  begin: /^\[[^\n]+\]:/,
5992
6028
  returnBegin: !0,
5993
6029
  contains: [
@@ -6104,8 +6140,8 @@ function Ct(n) {
6104
6140
  d,
6105
6141
  h,
6106
6142
  p
6107
- ].forEach((M) => {
6108
- M.contains = M.contains.concat(m);
6143
+ ].forEach((T) => {
6144
+ T.contains = T.contains.concat(m);
6109
6145
  }), m = m.concat(l, d), {
6110
6146
  name: "Markdown",
6111
6147
  aliases: [
@@ -6148,9 +6184,9 @@ function Ct(n) {
6148
6184
  contains: m,
6149
6185
  end: "$"
6150
6186
  },
6151
- r,
6152
- c,
6153
6187
  s,
6188
+ c,
6189
+ r,
6154
6190
  {
6155
6191
  //https://spec.commonmark.org/0.31.2/#entity-references
6156
6192
  scope: "literal",
@@ -6313,16 +6349,16 @@ function vi(n) {
6313
6349
  };
6314
6350
  }
6315
6351
  function Mt(n) {
6316
- const e = n.regex, t = /(r#)?/, i = e.concat(t, n.UNDERSCORE_IDENT_RE), r = e.concat(t, n.IDENT_RE), a = {
6352
+ const e = n.regex, t = /(r#)?/, i = e.concat(t, n.UNDERSCORE_IDENT_RE), s = e.concat(t, n.IDENT_RE), a = {
6317
6353
  scope: "title.function.invoke",
6318
6354
  relevance: 0,
6319
6355
  begin: e.concat(
6320
6356
  /\b/,
6321
6357
  /(?!(?:let|for|while|if|else|match)\b)/,
6322
- r,
6358
+ s,
6323
6359
  e.lookahead(/\s*\(/)
6324
6360
  )
6325
- }, s = "([ui](8|16|32|64|128|size)|f(16|32|64|128))?", o = [
6361
+ }, r = "([ui](8|16|32|64|128|size)|f(16|32|64|128))?", o = [
6326
6362
  "abstract",
6327
6363
  "as",
6328
6364
  "async",
@@ -6518,10 +6554,10 @@ function Mt(n) {
6518
6554
  {
6519
6555
  scope: "number",
6520
6556
  variants: [
6521
- { begin: "\\b0b([01_]+)" + s },
6522
- { begin: "\\b0o([0-7_]+)" + s },
6523
- { begin: "\\b0x([A-Fa-f0-9_]+)" + s },
6524
- { begin: "\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)" + s }
6557
+ { begin: "\\b0b([01_]+)" + r },
6558
+ { begin: "\\b0o([0-7_]+)" + r },
6559
+ { begin: "\\b0x([A-Fa-f0-9_]+)" + r },
6560
+ { begin: "\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)" + r }
6525
6561
  ],
6526
6562
  relevance: 0
6527
6563
  },
@@ -6628,18 +6664,18 @@ function Mt(n) {
6628
6664
  ]
6629
6665
  };
6630
6666
  }
6631
- var re = "[0-9](_*[0-9])*", fe = `\\.(${re})`, be = "[0-9a-fA-F](_*[0-9a-fA-F])*", Je = {
6667
+ var se = "[0-9](_*[0-9])*", fe = `\\.(${se})`, be = "[0-9a-fA-F](_*[0-9a-fA-F])*", Je = {
6632
6668
  className: "number",
6633
6669
  variants: [
6634
6670
  // DecimalFloatingPointLiteral
6635
6671
  // including ExponentPart
6636
- { begin: `(\\b(${re})((${fe})|\\.)?|(${fe}))[eE][+-]?(${re})[fFdD]?\\b` },
6672
+ { begin: `(\\b(${se})((${fe})|\\.)?|(${fe}))[eE][+-]?(${se})[fFdD]?\\b` },
6637
6673
  // excluding ExponentPart
6638
- { begin: `\\b(${re})((${fe})[fFdD]?\\b|\\.([fFdD]\\b)?)` },
6674
+ { begin: `\\b(${se})((${fe})[fFdD]?\\b|\\.([fFdD]\\b)?)` },
6639
6675
  { begin: `(${fe})[fFdD]?\\b` },
6640
- { begin: `\\b(${re})[fFdD]\\b` },
6676
+ { begin: `\\b(${se})[fFdD]\\b` },
6641
6677
  // HexadecimalFloatingPointLiteral
6642
- { begin: `\\b0[xX]((${be})\\.?|(${be})?\\.(${be}))[pP][+-]?(${re})[fFdD]?\\b` },
6678
+ { begin: `\\b0[xX]((${be})\\.?|(${be})?\\.(${be}))[pP][+-]?(${se})[fFdD]?\\b` },
6643
6679
  // DecimalIntegerLiteral
6644
6680
  { begin: "\\b(0|[1-9](_*[0-9])*)[lL]?\\b" },
6645
6681
  // HexIntegerLiteral
@@ -6655,8 +6691,8 @@ function Rt(n, e, t) {
6655
6691
  return t === -1 ? "" : n.replace(e, (i) => Rt(n, e, t - 1));
6656
6692
  }
6657
6693
  function ki(n) {
6658
- const e = n.regex, t = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", i = "(?:(?:\\s*\\[\\s*])+)?", r = t + "<@@@>" + i, s = "(?:" + ("\\?(?:\\s+(?:extends|super)\\s+" + r + ")?") + "|" + r + ")", o = Rt(
6659
- "(?:\\s*<\\s*" + s + "(?:\\s*,\\s*" + s + ")*\\s*>)?",
6694
+ const e = n.regex, t = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", i = "(?:(?:\\s*\\[\\s*])+)?", s = t + "<@@@>" + i, r = "(?:" + ("\\?(?:\\s+(?:extends|super)\\s+" + s + ")?") + "|" + s + ")", o = Rt(
6695
+ "(?:\\s*<\\s*" + r + "(?:\\s*,\\s*" + r + ")*\\s*>)?",
6660
6696
  /<@@@>/g,
6661
6697
  2
6662
6698
  ), p = {
@@ -6875,7 +6911,7 @@ function ki(n) {
6875
6911
  };
6876
6912
  }
6877
6913
  function Ni(n) {
6878
- const e = n.regex, t = n.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }] }), i = "decltype\\(auto\\)", r = "[a-zA-Z_]\\w*::", s = "(" + i + "|" + e.optional(r) + "[a-zA-Z_]\\w*" + e.optional("<[^<>]+>") + ")", o = e.concat(/\batomic_/, e.either(
6914
+ const e = n.regex, t = n.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }] }), i = "decltype\\(auto\\)", s = "[a-zA-Z_]\\w*::", r = "(" + i + "|" + e.optional(s) + "[a-zA-Z_]\\w*" + e.optional("<[^<>]+>") + ")", o = e.concat(/\batomic_/, e.either(
6879
6915
  "bool",
6880
6916
  "char",
6881
6917
  "schar",
@@ -6986,11 +7022,11 @@ function Ni(n) {
6986
7022
  }, y = [
6987
7023
  p,
6988
7024
  m
6989
- ], b = {
7025
+ ], f = {
6990
7026
  className: "title",
6991
- begin: e.optional(r) + n.IDENT_RE,
7027
+ begin: e.optional(s) + n.IDENT_RE,
6992
7028
  relevance: 0
6993
- }, w = e.optional(r) + n.IDENT_RE + "\\s*\\(", M = 12, x = {
7029
+ }, v = e.optional(s) + n.IDENT_RE + "\\s*\\(", T = 12, C = {
6994
7030
  keyword: [
6995
7031
  "asm",
6996
7032
  "auto",
@@ -7099,35 +7135,35 @@ function Ni(n) {
7099
7135
  end: /;/
7100
7136
  }
7101
7137
  ],
7102
- keywords: x,
7138
+ keywords: C,
7103
7139
  contains: I.concat([
7104
7140
  {
7105
7141
  begin: /\(/,
7106
7142
  end: /\)/,
7107
- keywords: x,
7143
+ keywords: C,
7108
7144
  contains: I.concat(["self"]),
7109
7145
  relevance: 0
7110
7146
  }
7111
7147
  ]),
7112
7148
  relevance: 0
7113
7149
  }, B = {
7114
- begin: "(" + s + "[\\*&\\s]+){1," + M + "}" + w,
7150
+ begin: "(" + r + "[\\*&\\s]+){1," + T + "}" + v,
7115
7151
  returnBegin: !0,
7116
7152
  end: /[{;=]/,
7117
7153
  excludeEnd: !0,
7118
- keywords: x,
7154
+ keywords: C,
7119
7155
  illegal: /[^\w\s\*&:<>.]/,
7120
7156
  contains: [
7121
7157
  {
7122
7158
  // to prevent it from being confused as the function title
7123
7159
  begin: i,
7124
- keywords: x,
7160
+ keywords: C,
7125
7161
  relevance: 0
7126
7162
  },
7127
7163
  {
7128
- begin: w,
7164
+ begin: v,
7129
7165
  returnBegin: !0,
7130
- contains: [n.inherit(b, { className: "title.function" })],
7166
+ contains: [n.inherit(f, { className: "title.function" })],
7131
7167
  relevance: 0
7132
7168
  },
7133
7169
  // allow for multiple declarations, e.g.:
@@ -7140,7 +7176,7 @@ function Ni(n) {
7140
7176
  className: "params",
7141
7177
  begin: /\(/,
7142
7178
  end: /\)/,
7143
- keywords: x,
7179
+ keywords: C,
7144
7180
  relevance: 0,
7145
7181
  contains: [
7146
7182
  t,
@@ -7152,7 +7188,7 @@ function Ni(n) {
7152
7188
  {
7153
7189
  begin: /\(/,
7154
7190
  end: /\)/,
7155
- keywords: x,
7191
+ keywords: C,
7156
7192
  relevance: 0,
7157
7193
  contains: [
7158
7194
  "self",
@@ -7174,7 +7210,7 @@ function Ni(n) {
7174
7210
  return {
7175
7211
  name: "C",
7176
7212
  aliases: ["h"],
7177
- keywords: x,
7213
+ keywords: C,
7178
7214
  // Until differentiations are added between `c` and `cpp`, `c` will
7179
7215
  // not be auto-detected to avoid auto-detect conflicts between C and C++
7180
7216
  disableAutodetect: !0,
@@ -7187,7 +7223,7 @@ function Ni(n) {
7187
7223
  ...y,
7188
7224
  {
7189
7225
  begin: n.IDENT_RE + "::",
7190
- keywords: x
7226
+ keywords: C
7191
7227
  },
7192
7228
  {
7193
7229
  className: "class",
@@ -7203,12 +7239,12 @@ function Ni(n) {
7203
7239
  exports: {
7204
7240
  preprocessor: m,
7205
7241
  strings: d,
7206
- keywords: x
7242
+ keywords: C
7207
7243
  }
7208
7244
  };
7209
7245
  }
7210
7246
  function Ot(n) {
7211
- const e = n.regex, t = n.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }] }), i = "decltype\\(auto\\)", r = "[a-zA-Z_]\\w*::", s = "(?!struct)(" + i + "|" + e.optional(r) + "[a-zA-Z_]\\w*" + e.optional("<[^<>]+>") + ")", o = {
7247
+ const e = n.regex, t = n.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }] }), i = "decltype\\(auto\\)", s = "[a-zA-Z_]\\w*::", r = "(?!struct)(" + i + "|" + e.optional(s) + "[a-zA-Z_]\\w*" + e.optional("<[^<>]+>") + ")", o = {
7212
7248
  className: "type",
7213
7249
  begin: "\\b[a-z\\d_]*_t\\b"
7214
7250
  }, l = {
@@ -7286,9 +7322,9 @@ function Ot(n) {
7286
7322
  p
7287
7323
  ], y = {
7288
7324
  className: "title",
7289
- begin: e.optional(r) + n.IDENT_RE,
7325
+ begin: e.optional(s) + n.IDENT_RE,
7290
7326
  relevance: 0
7291
- }, b = e.optional(r) + n.IDENT_RE + "\\s*\\(", w = 12, M = [
7327
+ }, f = e.optional(s) + n.IDENT_RE + "\\s*\\(", v = 12, T = [
7292
7328
  "alignas",
7293
7329
  "alignof",
7294
7330
  "and",
@@ -7451,7 +7487,7 @@ function Ot(n) {
7451
7487
  "weak_ptr",
7452
7488
  "wstring",
7453
7489
  "wstring_view"
7454
- ], x = [
7490
+ ], C = [
7455
7491
  "abort",
7456
7492
  "abs",
7457
7493
  "acos",
@@ -7554,7 +7590,7 @@ function Ot(n) {
7554
7590
  "vsprintf"
7555
7591
  ], B = {
7556
7592
  type: O,
7557
- keyword: M,
7593
+ keyword: T,
7558
7594
  literal: [
7559
7595
  "NULL",
7560
7596
  "false",
@@ -7569,15 +7605,15 @@ function Ot(n) {
7569
7605
  relevance: 0,
7570
7606
  keywords: {
7571
7607
  // Only for relevance, not highlighting.
7572
- _hint: x
7608
+ _hint: C
7573
7609
  },
7574
7610
  begin: e.concat(
7575
7611
  /\b/,
7576
- `(?!${M.join("|")})`,
7612
+ `(?!${T.join("|")})`,
7577
7613
  n.IDENT_RE,
7578
7614
  e.lookahead(/(<[^<>]+>|)\s*\(/)
7579
7615
  )
7580
- }, F = [
7616
+ }, H = [
7581
7617
  $,
7582
7618
  ...m,
7583
7619
  o,
@@ -7585,7 +7621,7 @@ function Ot(n) {
7585
7621
  n.C_BLOCK_COMMENT_MODE,
7586
7622
  d,
7587
7623
  l
7588
- ], X = {
7624
+ ], V = {
7589
7625
  // This mode covers expression context where we can't expect a function
7590
7626
  // definition and shouldn't highlight anything that looks like one:
7591
7627
  // `return some()`, `else if()`, `(x*sum(1, 2))`
@@ -7604,19 +7640,19 @@ function Ot(n) {
7604
7640
  }
7605
7641
  ],
7606
7642
  keywords: B,
7607
- contains: F.concat([
7643
+ contains: H.concat([
7608
7644
  {
7609
7645
  begin: /\(/,
7610
7646
  end: /\)/,
7611
7647
  keywords: B,
7612
- contains: F.concat(["self"]),
7648
+ contains: H.concat(["self"]),
7613
7649
  relevance: 0
7614
7650
  }
7615
7651
  ]),
7616
7652
  relevance: 0
7617
7653
  }, J = {
7618
7654
  className: "function",
7619
- begin: "(" + s + "[\\*&\\s]+){1," + w + "}" + b,
7655
+ begin: "(" + r + "[\\*&\\s]+){1," + v + "}" + f,
7620
7656
  returnBegin: !0,
7621
7657
  end: /[{;=]/,
7622
7658
  excludeEnd: !0,
@@ -7630,7 +7666,7 @@ function Ot(n) {
7630
7666
  relevance: 0
7631
7667
  },
7632
7668
  {
7633
- begin: b,
7669
+ begin: f,
7634
7670
  returnBegin: !0,
7635
7671
  contains: [y],
7636
7672
  relevance: 0
@@ -7706,10 +7742,10 @@ function Ot(n) {
7706
7742
  illegal: "</",
7707
7743
  classNameAliases: { "function.dispatch": "built_in" },
7708
7744
  contains: [].concat(
7709
- X,
7745
+ V,
7710
7746
  J,
7711
7747
  $,
7712
- F,
7748
+ H,
7713
7749
  [
7714
7750
  ...m,
7715
7751
  {
@@ -7742,50 +7778,50 @@ function Ot(n) {
7742
7778
  )
7743
7779
  };
7744
7780
  }
7745
- S.registerLanguage("javascript", _t);
7746
- S.registerLanguage("js", _t);
7747
- S.registerLanguage("typescript", St);
7748
- S.registerLanguage("ts", St);
7749
- S.registerLanguage("python", At);
7750
- S.registerLanguage("py", At);
7751
- S.registerLanguage("json", ui);
7752
- S.registerLanguage("bash", Me);
7753
- S.registerLanguage("sh", Me);
7754
- S.registerLanguage("shell", Me);
7755
- S.registerLanguage("css", yi);
7756
- S.registerLanguage("xml", Re);
7757
- S.registerLanguage("html", Re);
7758
- S.registerLanguage("svg", Re);
7759
- S.registerLanguage("sql", wi);
7760
- S.registerLanguage("yaml", xt);
7761
- S.registerLanguage("yml", xt);
7762
- S.registerLanguage("markdown", Ct);
7763
- S.registerLanguage("md", Ct);
7764
- S.registerLanguage("go", vi);
7765
- S.registerLanguage("rust", Mt);
7766
- S.registerLanguage("rs", Mt);
7767
- S.registerLanguage("java", ki);
7768
- S.registerLanguage("c", Ni);
7769
- S.registerLanguage("cpp", Ot);
7770
- S.registerLanguage("c++", Ot);
7771
- const Ti = /* @__PURE__ */ new Set(["mindmap"]);
7781
+ A.registerLanguage("javascript", _t);
7782
+ A.registerLanguage("js", _t);
7783
+ A.registerLanguage("typescript", Tt);
7784
+ A.registerLanguage("ts", Tt);
7785
+ A.registerLanguage("python", At);
7786
+ A.registerLanguage("py", At);
7787
+ A.registerLanguage("json", ui);
7788
+ A.registerLanguage("bash", Me);
7789
+ A.registerLanguage("sh", Me);
7790
+ A.registerLanguage("shell", Me);
7791
+ A.registerLanguage("css", yi);
7792
+ A.registerLanguage("xml", Re);
7793
+ A.registerLanguage("html", Re);
7794
+ A.registerLanguage("svg", Re);
7795
+ A.registerLanguage("sql", wi);
7796
+ A.registerLanguage("yaml", xt);
7797
+ A.registerLanguage("yml", xt);
7798
+ A.registerLanguage("markdown", Ct);
7799
+ A.registerLanguage("md", Ct);
7800
+ A.registerLanguage("go", vi);
7801
+ A.registerLanguage("rust", Mt);
7802
+ A.registerLanguage("rs", Mt);
7803
+ A.registerLanguage("java", ki);
7804
+ A.registerLanguage("c", Ni);
7805
+ A.registerLanguage("cpp", Ot);
7806
+ A.registerLanguage("c++", Ot);
7807
+ const Si = /* @__PURE__ */ new Set(["mindmap"]);
7772
7808
  function le(n) {
7773
7809
  return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
7774
7810
  }
7775
- function Si(n, e = {}) {
7776
- const t = new Set(e.reservedLanguages ?? Ti), i = n.renderer.rules.fence ? n.renderer.rules.fence.bind(n.renderer.rules) : (r, a, s, o, c) => c.renderToken(r, a, s);
7777
- n.renderer.rules.fence = (r, a, s, o, c) => {
7778
- var b;
7779
- const l = r[a];
7780
- if (!l) return i(r, a, s, o, c);
7781
- const h = ((b = l.info.trim().split(/\s+/)[0]) == null ? void 0 : b.toLowerCase()) ?? "";
7811
+ function Ti(n, e = {}) {
7812
+ const t = new Set(e.reservedLanguages ?? Si), i = n.renderer.rules.fence ? n.renderer.rules.fence.bind(n.renderer.rules) : (s, a, r, o, c) => c.renderToken(s, a, r);
7813
+ n.renderer.rules.fence = (s, a, r, o, c) => {
7814
+ var f;
7815
+ const l = s[a];
7816
+ if (!l) return i(s, a, r, o, c);
7817
+ const h = ((f = l.info.trim().split(/\s+/)[0]) == null ? void 0 : f.toLowerCase()) ?? "";
7782
7818
  if (t.has(h))
7783
- return i(r, a, s, o, c);
7819
+ return i(s, a, r, o, c);
7784
7820
  const p = l.content;
7785
7821
  let m, y = h || "text";
7786
- if (h && S.getLanguage(h))
7822
+ if (h && A.getLanguage(h))
7787
7823
  try {
7788
- m = S.highlight(p, {
7824
+ m = A.highlight(p, {
7789
7825
  language: h,
7790
7826
  ignoreIllegals: !0
7791
7827
  }).value;
@@ -7794,15 +7830,15 @@ function Si(n, e = {}) {
7794
7830
  }
7795
7831
  else if (h)
7796
7832
  try {
7797
- const w = S.highlightAuto(p);
7798
- m = w.value, y = w.language || h;
7833
+ const v = A.highlightAuto(p);
7834
+ m = v.value, y = v.language || h;
7799
7835
  } catch {
7800
7836
  m = le(p);
7801
7837
  }
7802
7838
  else
7803
7839
  try {
7804
- const w = S.highlightAuto(p);
7805
- m = w.value, y = w.language || "text";
7840
+ const v = A.highlightAuto(p);
7841
+ m = v.value, y = v.language || "text";
7806
7842
  } catch {
7807
7843
  m = le(p);
7808
7844
  }
@@ -7837,16 +7873,16 @@ function Oi(n, e = "video") {
7837
7873
  return `![${e}](${n})`;
7838
7874
  }
7839
7875
  function Ii(n) {
7840
- const e = n.renderer.rules.image ? n.renderer.rules.image.bind(n.renderer.rules) : (t, i, r, a, s) => s.renderToken(t, i, r);
7841
- n.renderer.rules.image = (t, i, r, a, s) => {
7876
+ const e = n.renderer.rules.image ? n.renderer.rules.image.bind(n.renderer.rules) : (t, i, s, a, r) => r.renderToken(t, i, s);
7877
+ n.renderer.rules.image = (t, i, s, a, r) => {
7842
7878
  const o = t[i];
7843
- if (!o) return e(t, i, r, a, s);
7879
+ if (!o) return e(t, i, s, a, r);
7844
7880
  const c = o.attrGet("src") ?? "";
7845
7881
  if (Ri(c)) {
7846
7882
  const l = o.content || "";
7847
7883
  return `<video src="${c}" controls class="md-editor-video" title="${l}">${l}</video>`;
7848
7884
  }
7849
- return e(t, i, r, a, s);
7885
+ return e(t, i, s, a, r);
7850
7886
  };
7851
7887
  }
7852
7888
  const Li = /* @__PURE__ */ new Set([
@@ -7872,10 +7908,10 @@ const Li = /* @__PURE__ */ new Set([
7872
7908
  success: "✓"
7873
7909
  };
7874
7910
  function $i(n) {
7875
- n.block.ruler.before("fence", "tips_block", (e, t, i, r) => {
7876
- const s = e.src.slice(e.bMarks[t], e.eMarks[t]).match(Di);
7877
- if (!s) return !1;
7878
- const o = (s[1] ?? "").toLowerCase();
7911
+ n.block.ruler.before("fence", "tips_block", (e, t, i, s) => {
7912
+ const r = e.src.slice(e.bMarks[t], e.eMarks[t]).match(Di);
7913
+ if (!r) return !1;
7914
+ const o = (r[1] ?? "").toLowerCase();
7879
7915
  if (!Li.has(o)) return !1;
7880
7916
  let c = t + 1, l = !1;
7881
7917
  for (; c < i; ) {
@@ -7887,26 +7923,26 @@ function $i(n) {
7887
7923
  c++;
7888
7924
  }
7889
7925
  if (!l) return !1;
7890
- if (r) return !0;
7891
- const d = s[2] ?? et[o] ?? o, h = e.src.slice(e.bMarks[t + 1], e.bMarks[c]).trim(), p = n.render(h), m = e.push("tips_block", "div", 0);
7926
+ if (s) return !0;
7927
+ const d = r[2] ?? et[o] ?? o, h = e.src.slice(e.bMarks[t + 1], e.bMarks[c]).trim(), p = n.render(h), m = e.push("tips_block", "div", 0);
7892
7928
  return m.content = p, m.info = o, m.markup = d, e.line = c + 1, !0;
7893
7929
  }), n.renderer.rules.tips_block = (e, t) => {
7894
7930
  const i = e[t];
7895
7931
  if (!i) return "";
7896
- const r = i.info ?? "notice", a = i.markup ?? et[r] ?? "Notice", s = Bi[r] ?? "i", o = i.content ?? "";
7897
- return `<div class="md-editor-tip md-editor-tip--${r}"><div class="md-editor-tip-header"><span class="md-editor-tip-icon">${s}</span><span class="md-editor-tip-title">${Ui(a)}</span></div><div class="md-editor-tip-body">${o}</div></div>`;
7932
+ const s = i.info ?? "notice", a = i.markup ?? et[s] ?? "Notice", r = Bi[s] ?? "i", o = i.content ?? "";
7933
+ return `<div class="md-editor-tip md-editor-tip--${s}"><div class="md-editor-tip-header"><span class="md-editor-tip-icon">${r}</span><span class="md-editor-tip-title">${Ui(a)}</span></div><div class="md-editor-tip-body">${o}</div></div>`;
7898
7934
  };
7899
7935
  }
7900
7936
  function Ui(n) {
7901
7937
  return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
7902
7938
  }
7903
- function Fi(n) {
7939
+ function Hi(n) {
7904
7940
  const e = n.renderer.rules.list_item_open;
7905
- n.renderer.rules.list_item_open = (t, i, r, a, s) => {
7941
+ n.renderer.rules.list_item_open = (t, i, s, a, r) => {
7906
7942
  var l, d;
7907
7943
  const o = t[i];
7908
7944
  if (!o)
7909
- return e ? e(t, i, r, a, s) : s.renderToken(t, i, r);
7945
+ return e ? e(t, i, s, a, r) : r.renderToken(t, i, s);
7910
7946
  let c;
7911
7947
  for (let h = i + 1; h < t.length && h < i + 6; h++) {
7912
7948
  if (((l = t[h]) == null ? void 0 : l.type) === "inline") {
@@ -7916,18 +7952,19 @@ function Fi(n) {
7916
7952
  if (((d = t[h]) == null ? void 0 : d.type) === "list_item_close") break;
7917
7953
  }
7918
7954
  if (c && c.content) {
7919
- const h = c.content, p = /^\[\s\]\s/.test(h), m = /^\[[xX]\]\s/.test(h);
7955
+ const h = c.content, p = /^\[\s*\]\s/.test(h), m = /^\[\s*[xX]\s*\]\s/.test(h);
7920
7956
  if (p || m) {
7921
- if (c.content = h.replace(/^\[[ xX]\]\s/, ""), c.children && c.children.length > 0) {
7922
- const w = c.children[0];
7923
- w && w.type === "text" && (w.content = w.content.replace(/^\[[ xX]\]\s/, ""));
7957
+ const y = /^\[\s*(?:[xX])?\s*\]\s/;
7958
+ if (c.content = h.replace(y, ""), c.children && c.children.length > 0) {
7959
+ const T = c.children[0];
7960
+ T && T.type === "text" && (T.content = T.content.replace(y, ""));
7924
7961
  }
7925
7962
  o.attrSet("class", "task-list-item");
7926
- const y = `<input type="checkbox" disabled${p ? " checked" : ""} /> `;
7927
- return (e ? e(t, i, r, a, s) : s.renderToken(t, i, r)) + y;
7963
+ const f = `<input type="checkbox" disabled${p ? " checked" : ""} /> `;
7964
+ return (e ? e(t, i, s, a, r) : r.renderToken(t, i, s)) + f;
7928
7965
  }
7929
7966
  }
7930
- return e ? e(t, i, r, a, s) : s.renderToken(t, i, r);
7967
+ return e ? e(t, i, s, a, r) : r.renderToken(t, i, s);
7931
7968
  };
7932
7969
  }
7933
7970
  class It {
@@ -7937,9 +7974,9 @@ class It {
7937
7974
  linkify: !0,
7938
7975
  breaks: e.breaks ?? !1,
7939
7976
  typographer: !0
7940
- }), e.math !== !1 && sn(this.md), this.mindmapEnabled = e.mindmap !== !1, this.mindmapEnabled && on(this.md), e.codeHighlight !== !1 && Si(this.md, {
7977
+ }), e.math !== !1 && rn(this.md), this.mindmapEnabled = e.mindmap !== !1, this.mindmapEnabled && on(this.md), e.codeHighlight !== !1 && Ti(this.md, {
7941
7978
  reservedLanguages: this.mindmapEnabled ? ["mindmap"] : []
7942
- }), e.tips !== !1 && $i(this.md), Fi(this.md), en(this.md), Ii(this.md);
7979
+ }), e.tips !== !1 && $i(this.md), Hi(this.md), en(this.md), Ii(this.md);
7943
7980
  }
7944
7981
  render(e) {
7945
7982
  return this.md.render(e || "");
@@ -7952,19 +7989,19 @@ class It {
7952
7989
  this.mindmapEnabled && await ln(e);
7953
7990
  }
7954
7991
  }
7955
- function or(n, e = {}) {
7992
+ function os(n, e = {}) {
7956
7993
  return new It(e).render(n);
7957
7994
  }
7958
- class Hi {
7995
+ class Fi {
7959
7996
  constructor(e) {
7960
7997
  this.buttons = /* @__PURE__ */ new Map(), this.el = document.createElement("div"), this.el.className = "md-editor-toolbar", this.el.setAttribute("role", "toolbar");
7961
7998
  for (const t of e) {
7962
7999
  const i = document.createElement("button");
7963
- if (i.type = "button", i.className = "md-editor-toolbar-btn", t.toggle && i.classList.add("is-toggle"), t.active && i.classList.add("is-active"), i.title = t.title, i.setAttribute("aria-label", t.title), i.setAttribute("data-action", t.name), i.innerHTML = t.icon, i.addEventListener("mousedown", (r) => {
7964
- r.preventDefault(), r.stopPropagation(), t.handler(i);
8000
+ if (i.type = "button", i.className = "md-editor-toolbar-btn", t.toggle && i.classList.add("is-toggle"), t.active && i.classList.add("is-active"), i.title = t.title, i.setAttribute("aria-label", t.title), i.setAttribute("data-action", t.name), i.innerHTML = t.icon, i.addEventListener("mousedown", (s) => {
8001
+ s.preventDefault(), s.stopPropagation(), t.handler(i);
7965
8002
  }), this.buttons.set(t.name, i), this.el.appendChild(i), t.groupEnd) {
7966
- const r = document.createElement("span");
7967
- r.className = "md-editor-toolbar-sep", this.el.appendChild(r);
8003
+ const s = document.createElement("span");
8004
+ s.className = "md-editor-toolbar-sep", this.el.appendChild(s);
7968
8005
  }
7969
8006
  }
7970
8007
  }
@@ -8010,15 +8047,15 @@ function Wi(n) {
8010
8047
  function Yi(n) {
8011
8048
  const e = n.split(`
8012
8049
  `), t = [];
8013
- let i = [], r = !1, a = "", s = 0;
8050
+ let i = [], s = !1, a = "", r = 0;
8014
8051
  for (const c of e) {
8015
8052
  const l = c.match(Gi);
8016
8053
  if (l) {
8017
8054
  const d = l[1] ?? "", h = d[0] ?? "", p = d.length;
8018
- r ? h === a && p >= s && qi.test(c) && (r = !1) : (r = !0, a = h, s = p), i.push(c);
8055
+ s ? h === a && p >= r && qi.test(c) && (s = !1) : (s = !0, a = h, r = p), i.push(c);
8019
8056
  continue;
8020
8057
  }
8021
- if (!r && Ki.test(c) && i.length > 0) {
8058
+ if (!s && Ki.test(c) && i.length > 0) {
8022
8059
  t.push(i.join(`
8023
8060
  `)), i = [c];
8024
8061
  continue;
@@ -8038,17 +8075,17 @@ class Zi {
8038
8075
  this.container = e, this.renderBlock = t, this.maxCacheEntries = i, this.nodeByKey = /* @__PURE__ */ new Map(), this.htmlByHash = /* @__PURE__ */ new Map(), this.prevBlocks = [];
8039
8076
  }
8040
8077
  update(e) {
8041
- const t = Yi(e), i = document.createDocumentFragment(), r = /* @__PURE__ */ new Map();
8078
+ const t = Yi(e), i = document.createDocumentFragment(), s = /* @__PURE__ */ new Map();
8042
8079
  let a = 0;
8043
- for (const s of t) {
8044
- let o = this.nodeByKey.get(s.key);
8080
+ for (const r of t) {
8081
+ let o = this.nodeByKey.get(r.key);
8045
8082
  if (!o) {
8046
- let c = this.htmlByHash.get(s.hash);
8047
- c === void 0 && (c = this.renderBlock(s.source), this.htmlByHash.set(s.hash, c), a++), o = document.createElement("div"), o.className = "md-editor-block", o.dataset.blockKey = s.key, o.innerHTML = c;
8083
+ let c = this.htmlByHash.get(r.hash);
8084
+ c === void 0 && (c = this.renderBlock(r.source), this.htmlByHash.set(r.hash, c), a++), o = document.createElement("div"), o.className = "md-editor-block", o.dataset.blockKey = r.key, o.innerHTML = c;
8048
8085
  }
8049
- r.set(s.key, o), i.appendChild(o);
8086
+ s.set(r.key, o), i.appendChild(o);
8050
8087
  }
8051
- return this.container.innerHTML = "", this.container.appendChild(i), this.nodeByKey = r, this.prevBlocks = t, this.evictCacheIfNeeded(t), { rerenderedCount: a, totalCount: t.length };
8088
+ return this.container.innerHTML = "", this.container.appendChild(i), this.nodeByKey = s, this.prevBlocks = t, this.evictCacheIfNeeded(t), { rerenderedCount: a, totalCount: t.length };
8052
8089
  }
8053
8090
  /**
8054
8091
  * When the cache exceeds the limit, evict hashes that no longer appear in
@@ -8068,28 +8105,28 @@ class Zi {
8068
8105
  this.container.innerHTML = "", this.nodeByKey.clear(), this.htmlByHash.clear(), this.prevBlocks = [];
8069
8106
  }
8070
8107
  }
8071
- function Xi(n, e) {
8108
+ function Vi(n, e) {
8072
8109
  let t, i;
8073
- const r = (...a) => {
8110
+ const s = (...a) => {
8074
8111
  i = a, t !== void 0 && clearTimeout(t), t = setTimeout(() => {
8075
8112
  t = void 0, i && n(...i);
8076
8113
  }, e);
8077
8114
  };
8078
- return r.cancel = () => {
8115
+ return s.cancel = () => {
8079
8116
  t !== void 0 && clearTimeout(t), t = void 0;
8080
- }, r.flush = () => {
8117
+ }, s.flush = () => {
8081
8118
  t !== void 0 && (clearTimeout(t), t = void 0, i && n(...i));
8082
- }, r;
8119
+ }, s;
8083
8120
  }
8084
- function Vi(n, e = 120, t = 600) {
8085
- const i = Math.max(0, n), r = Math.floor(i / 2e4) * 60;
8086
- return Math.min(t, e + r);
8121
+ function Xi(n, e = 120, t = 600) {
8122
+ const i = Math.max(0, n), s = Math.floor(i / 2e4) * 60;
8123
+ return Math.min(t, e + s);
8087
8124
  }
8088
- function ar(n, e = 300) {
8125
+ function as(n, e = 300) {
8089
8126
  const t = window;
8090
8127
  return typeof t.requestIdleCallback == "function" ? t.requestIdleCallback(n, { timeout: e }) : window.setTimeout(n, 0);
8091
8128
  }
8092
- function cr(n) {
8129
+ function cs(n) {
8093
8130
  const e = window;
8094
8131
  typeof e.cancelIdleCallback == "function" ? e.cancelIdleCallback(n) : clearTimeout(n);
8095
8132
  }
@@ -8174,8 +8211,8 @@ const L = (n) => `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xm
8174
8211
  class ie {
8175
8212
  constructor(e, t) {
8176
8213
  this.inputs = /* @__PURE__ */ new Map(), this.destroyed = !1, this.anchor = e, this.config = t, this.el = document.createElement("div"), this.el.className = "md-editor-popup", this.el.setAttribute("role", "dialog"), this.el.setAttribute("aria-label", t.title), t.theme && this.el.setAttribute("data-theme", t.theme), this.build(), this.onOutsideClick = (i) => {
8177
- const r = i.target;
8178
- !this.el.contains(r) && !this.anchor.contains(r) && this.hide();
8214
+ const s = i.target;
8215
+ !this.el.contains(s) && !this.anchor.contains(s) && this.hide();
8179
8216
  }, this.onKeyDown = (i) => {
8180
8217
  i.key === "Escape" && this.hide();
8181
8218
  };
@@ -8185,22 +8222,22 @@ class ie {
8185
8222
  e.className = "md-editor-popup-header", e.textContent = this.config.title;
8186
8223
  const t = document.createElement("div");
8187
8224
  t.className = "md-editor-popup-body";
8188
- for (const s of this.config.fields) {
8225
+ for (const r of this.config.fields) {
8189
8226
  const o = document.createElement("div");
8190
8227
  o.className = "md-editor-popup-field";
8191
8228
  const c = document.createElement("label");
8192
- c.className = "md-editor-popup-label", c.textContent = s.label, c.setAttribute("for", `md-editor-popup-${s.name}`);
8229
+ c.className = "md-editor-popup-label", c.textContent = r.label, c.setAttribute("for", `md-editor-popup-${r.name}`);
8193
8230
  let l;
8194
- s.type === "textarea" ? (l = document.createElement("textarea"), l.rows = 2) : (l = document.createElement("input"), l.type = "text"), l.id = `md-editor-popup-${s.name}`, l.className = "md-editor-popup-input", s.placeholder && (l.placeholder = s.placeholder), s.required && (l.required = !0), o.appendChild(c), o.appendChild(l), t.appendChild(o), this.inputs.set(s.name, l);
8231
+ r.type === "textarea" ? (l = document.createElement("textarea"), l.rows = 2) : (l = document.createElement("input"), l.type = "text"), l.id = `md-editor-popup-${r.name}`, l.className = "md-editor-popup-input", r.placeholder && (l.placeholder = r.placeholder), r.required && (l.required = !0), o.appendChild(c), o.appendChild(l), t.appendChild(o), this.inputs.set(r.name, l);
8195
8232
  }
8196
8233
  const i = document.createElement("div");
8197
8234
  i.className = "md-editor-popup-footer";
8198
- const r = document.createElement("button");
8199
- r.type = "button", r.className = "md-editor-popup-btn md-editor-popup-btn--ghost", r.textContent = "Cancel", r.addEventListener("click", () => this.hide());
8235
+ const s = document.createElement("button");
8236
+ s.type = "button", s.className = "md-editor-popup-btn md-editor-popup-btn--ghost", s.textContent = "Cancel", s.addEventListener("click", () => this.hide());
8200
8237
  const a = document.createElement("button");
8201
- a.type = "button", a.className = "md-editor-popup-btn md-editor-popup-btn--primary", a.textContent = this.config.submitLabel ?? "Insert", a.addEventListener("click", () => this.submit()), i.appendChild(r), i.appendChild(a), this.el.appendChild(e), this.el.appendChild(t), this.el.appendChild(i);
8202
- for (const s of this.inputs.values())
8203
- s.tagName === "INPUT" && s.addEventListener("keydown", (o) => {
8238
+ a.type = "button", a.className = "md-editor-popup-btn md-editor-popup-btn--primary", a.textContent = this.config.submitLabel ?? "Insert", a.addEventListener("click", () => this.submit()), i.appendChild(s), i.appendChild(a), this.el.appendChild(e), this.el.appendChild(t), this.el.appendChild(i);
8239
+ for (const r of this.inputs.values())
8240
+ r.tagName === "INPUT" && r.addEventListener("keydown", (o) => {
8204
8241
  const c = o;
8205
8242
  c.key === "Enter" && (c.preventDefault(), this.submit());
8206
8243
  });
@@ -8223,8 +8260,8 @@ class ie {
8223
8260
  position() {
8224
8261
  const e = this.anchor.getBoundingClientRect(), t = this.el.getBoundingClientRect();
8225
8262
  let i = e.left;
8226
- const r = e.bottom + 6;
8227
- i + t.width > window.innerWidth - 8 && (i = window.innerWidth - t.width - 8), i < 8 && (i = 8), this.el.style.left = `${i + window.scrollX}px`, this.el.style.top = `${r + window.scrollY}px`;
8263
+ const s = e.bottom + 6;
8264
+ i + t.width > window.innerWidth - 8 && (i = window.innerWidth - t.width - 8), i < 8 && (i = 8), this.el.style.left = `${i + window.scrollX}px`, this.el.style.top = `${s + window.scrollY}px`;
8228
8265
  }
8229
8266
  destroy() {
8230
8267
  this.hide(), this.destroyed = !0, this.inputs.clear();
@@ -8244,17 +8281,17 @@ const Qi = [
8244
8281
  { action: "preview", key: "Mod-Alt-p", description: "Toggle preview" },
8245
8282
  { action: "theme", key: "Mod-Shift-l", description: "Toggle theme" }
8246
8283
  ];
8247
- function lr(n, e) {
8284
+ function ls(n, e) {
8248
8285
  var c;
8249
8286
  const t = n.toLowerCase().split("-");
8250
- let i = "", r = !1, a = !1, s = !1, o = !1;
8287
+ let i = "", s = !1, a = !1, r = !1, o = !1;
8251
8288
  for (const l of t)
8252
8289
  switch (l) {
8253
8290
  case "mod":
8254
- (c = navigator.platform) != null && c.toLowerCase().includes("mac") ? a = !0 : r = !0;
8291
+ (c = navigator.platform) != null && c.toLowerCase().includes("mac") ? a = !0 : s = !0;
8255
8292
  break;
8256
8293
  case "ctrl":
8257
- r = !0;
8294
+ s = !0;
8258
8295
  break;
8259
8296
  case "meta":
8260
8297
  case "cmd":
@@ -8262,7 +8299,7 @@ function lr(n, e) {
8262
8299
  break;
8263
8300
  case "alt":
8264
8301
  case "option":
8265
- s = !0;
8302
+ r = !0;
8266
8303
  break;
8267
8304
  case "shift":
8268
8305
  o = !0;
@@ -8270,13 +8307,13 @@ function lr(n, e) {
8270
8307
  default:
8271
8308
  i = l;
8272
8309
  }
8273
- return !(e.ctrlKey !== r || e.metaKey !== a || e.altKey !== s || e.shiftKey !== o || e.key.toLowerCase() !== i);
8310
+ return !(e.ctrlKey !== s || e.metaKey !== a || e.altKey !== r || e.shiftKey !== o || e.key.toLowerCase() !== i);
8274
8311
  }
8275
- function dr(n) {
8312
+ function ds(n) {
8276
8313
  var i;
8277
8314
  const e = ((i = navigator.platform) == null ? void 0 : i.toLowerCase().includes("mac")) ?? !1;
8278
- return n.split("-").map((r) => {
8279
- switch (r.toLowerCase()) {
8315
+ return n.split("-").map((s) => {
8316
+ switch (s.toLowerCase()) {
8280
8317
  case "mod":
8281
8318
  return e ? "Cmd" : "Ctrl";
8282
8319
  case "ctrl":
@@ -8289,36 +8326,36 @@ function dr(n) {
8289
8326
  case "shift":
8290
8327
  return "Shift";
8291
8328
  default:
8292
- return r.toUpperCase();
8329
+ return s.toUpperCase();
8293
8330
  }
8294
8331
  }).join("+");
8295
8332
  }
8296
8333
  function Ji(n) {
8297
8334
  var i;
8298
8335
  const e = ((i = navigator.platform) == null ? void 0 : i.toLowerCase().includes("mac")) ?? !1;
8299
- return n.split("-").map((r) => {
8300
- let a = r, s = "";
8301
- switch (r.toLowerCase()) {
8336
+ return n.split("-").map((s) => {
8337
+ let a = s, r = "";
8338
+ switch (s.toLowerCase()) {
8302
8339
  case "mod":
8303
- a = e ? "Cmd" : "Ctrl", s = e ? "⌘" : "";
8340
+ a = e ? "Cmd" : "Ctrl", r = e ? "⌘" : "";
8304
8341
  break;
8305
8342
  case "ctrl":
8306
- a = "Ctrl", s = e ? "⌃" : "";
8343
+ a = "Ctrl", r = e ? "⌃" : "";
8307
8344
  break;
8308
8345
  case "meta":
8309
8346
  case "cmd":
8310
- a = "Cmd", s = "⌘";
8347
+ a = "Cmd", r = "⌘";
8311
8348
  break;
8312
8349
  case "alt":
8313
- a = e ? "Option" : "Alt", s = e ? "⌥" : "";
8350
+ a = e ? "Option" : "Alt", r = e ? "⌥" : "";
8314
8351
  break;
8315
8352
  case "shift":
8316
- a = "Shift", s = "⇧";
8353
+ a = "Shift", r = "⇧";
8317
8354
  break;
8318
8355
  default:
8319
- a = r.toUpperCase();
8356
+ a = s.toUpperCase();
8320
8357
  }
8321
- return `<kbd class="md-editor-kbd">${s ? `<span class="md-editor-kbd-symbol">${s}</span>` : ""}<span>${a}</span></kbd>`;
8358
+ return `<kbd class="md-editor-kbd">${r ? `<span class="md-editor-kbd-symbol">${r}</span>` : ""}<span>${a}</span></kbd>`;
8322
8359
  }).join('<span class="md-editor-kbd-plus">+</span>');
8323
8360
  }
8324
8361
  const nt = {
@@ -8348,7 +8385,7 @@ const nt = {
8348
8385
  ---
8349
8386
  `, "", ""]
8350
8387
  };
8351
- class ur {
8388
+ class us {
8352
8389
  constructor(e, t = {}) {
8353
8390
  this.previewPane = null, this.incremental = null, this.toolbar = null, this.statusBar = null, this.activePopup = null, this.scheduledRender = null, this.scheduledWait = 0;
8354
8391
  const i = typeof e == "string" ? document.querySelector(e) : e;
@@ -8361,16 +8398,16 @@ class ur {
8361
8398
  }), this.buildLayout(), this.codeEditor = new tn(this.editorPane, {
8362
8399
  value: t.value ?? "",
8363
8400
  lineNumbers: this.mode === "complex",
8364
- onChange: (r) => {
8401
+ onChange: (s) => {
8365
8402
  var a;
8366
- (a = this.onChange) == null || a.call(this, r), this.autoPreview && this.requestPreviewRender(r), this.updateStatusBar(r);
8403
+ (a = this.onChange) == null || a.call(this, s), this.autoPreview && this.requestPreviewRender(s), this.updateStatusBar(s);
8367
8404
  },
8368
- onImageFile: (r) => this.handleImageFile(r),
8405
+ onImageFile: (s) => this.handleImageFile(s),
8369
8406
  mention: t.mention,
8370
8407
  docLink: t.docLink
8371
8408
  }), this.setupKeyboardShortcuts(), this.mode === "complex" && (this.buildToolbar(), this.buildStatusBar()), this.previewPane && (this.previewPane.classList.add("markdown-body"), this.incremental = new Zi(
8372
8409
  this.previewPane,
8373
- (r) => this.renderer.render(r)
8410
+ (s) => this.renderer.render(s)
8374
8411
  ), this.setupCopyHandler()), this.renderPreview(t.value ?? ""), this.updateStatusBar(t.value ?? "");
8375
8412
  }
8376
8413
  // ---------- Layout ----------
@@ -8391,12 +8428,12 @@ class ur {
8391
8428
  return this.toolbarConfig && !Array.isArray(this.toolbarConfig) ? ((i = this.toolbarConfig[e]) == null ? void 0 : i.icon) ?? t : t;
8392
8429
  }
8393
8430
  buildToolbar() {
8394
- const e = [], t = (i, r, a, s, o = {}) => {
8431
+ const e = [], t = (i, s, a, r, o = {}) => {
8395
8432
  this.isActionVisible(i) && e.push({
8396
8433
  name: i,
8397
- title: this.getActionLabel(i, r),
8434
+ title: this.getActionLabel(i, s),
8398
8435
  icon: this.getActionIcon(i, a),
8399
- handler: s,
8436
+ handler: r,
8400
8437
  ...o
8401
8438
  });
8402
8439
  };
@@ -8408,7 +8445,7 @@ class ur {
8408
8445
  "Toggle theme",
8409
8446
  this.theme === "dark" ? R.sun : R.moon,
8410
8447
  () => this.setTheme(this.theme === "dark" ? "light" : "dark")
8411
- ), this.toolbar = new Hi(e), this.container.insertBefore(this.toolbar.el, this.body);
8448
+ ), this.toolbar = new Fi(e), this.container.insertBefore(this.toolbar.el, this.body);
8412
8449
  }
8413
8450
  buildStatusBar() {
8414
8451
  this.statusBar = new zi({
@@ -8475,8 +8512,8 @@ class ur {
8475
8512
  { name: "url", label: "Image URL", placeholder: "https://example.com/image.png" },
8476
8513
  ...t ? [{ name: "file", label: "Or paste/drop an image into the editor", type: "text", placeholder: "Upload via paste or drag-and-drop" }] : []
8477
8514
  ],
8478
- onSubmit: (r) => {
8479
- const a = r.url ?? "";
8515
+ onSubmit: (s) => {
8516
+ const a = s.url ?? "";
8480
8517
  a && this.codeEditor.insertAtCursor(je(a, "image"));
8481
8518
  }
8482
8519
  }), this.activePopup.show();
@@ -8491,8 +8528,8 @@ class ur {
8491
8528
  { name: "alt", label: "Title", placeholder: "video title" }
8492
8529
  ],
8493
8530
  onSubmit: (i) => {
8494
- const r = i.url ?? "";
8495
- r && this.codeEditor.insertAtCursor(Oi(r, i.alt || "video"));
8531
+ const s = i.url ?? "";
8532
+ s && this.codeEditor.insertAtCursor(Oi(s, i.alt || "video"));
8496
8533
  }
8497
8534
  }), this.activePopup.show();
8498
8535
  }
@@ -8510,7 +8547,7 @@ class ur {
8510
8547
  }
8511
8548
  ],
8512
8549
  onSubmit: (i) => {
8513
- const r = i.url ?? "", a = Ci(r);
8550
+ const s = i.url ?? "", a = Ci(s);
8514
8551
  a && this.codeEditor.insertAtCursor(Mi(a));
8515
8552
  }
8516
8553
  }), this.activePopup.show();
@@ -8526,22 +8563,22 @@ class ur {
8526
8563
  ],
8527
8564
  submitLabel: "Insert",
8528
8565
  onSubmit: (i) => {
8529
- const r = Math.max(1, Math.min(50, parseInt(i.rows ?? "3", 10) || 3)), a = Math.max(1, Math.min(20, parseInt(i.cols ?? "3", 10) || 3));
8530
- this.codeEditor.insertAtCursor(this.generateTable(r, a));
8566
+ const s = Math.max(1, Math.min(50, parseInt(i.rows ?? "3", 10) || 3)), a = Math.max(1, Math.min(20, parseInt(i.cols ?? "3", 10) || 3));
8567
+ this.codeEditor.insertAtCursor(this.generateTable(s, a));
8531
8568
  }
8532
8569
  }), this.activePopup.show();
8533
8570
  }
8534
8571
  generateTable(e, t) {
8535
- const i = "| " + Array.from({ length: t }, (o, c) => `Col ${c + 1}`).join(" | ") + " |", r = "| " + Array.from({ length: t }, () => "---").join(" | ") + " |", a = Math.max(0, e - 1), s = Array.from(
8572
+ const i = "| " + Array.from({ length: t }, (o, c) => `Col ${c + 1}`).join(" | ") + " |", s = "| " + Array.from({ length: t }, () => "---").join(" | ") + " |", a = Math.max(0, e - 1), r = Array.from(
8536
8573
  { length: a },
8537
8574
  () => "| " + Array.from({ length: t }, () => "content").join(" | ") + " |"
8538
8575
  ).join(`
8539
8576
  `);
8540
8577
  return a > 0 ? `${i}
8541
- ${r}
8542
8578
  ${s}
8543
- ` : `${i}
8544
8579
  ${r}
8580
+ ` : `${i}
8581
+ ${s}
8545
8582
  `;
8546
8583
  }
8547
8584
  showHelpPopup(e) {
@@ -8555,7 +8592,7 @@ ${r}
8555
8592
  }
8556
8593
  }), i = t.el.querySelector(".md-editor-popup-body");
8557
8594
  if (i) {
8558
- const s = [
8595
+ const r = [
8559
8596
  { label: "Task list", hint: "- [ ] checked / - [x] unchecked" },
8560
8597
  { label: "@mention", hint: "Type @ then pick a user from the dropdown" },
8561
8598
  { label: "Document link", hint: "Type / then pick a document" },
@@ -8568,15 +8605,15 @@ ${r}
8568
8605
  <span class="md-editor-help-desc">${o.description}</span>
8569
8606
  <span class="md-editor-help-keys">${Ji(o.key)}</span>
8570
8607
  </div>`
8571
- ).join("") + '</div><div class="md-editor-help-section-title">Syntax</div><div class="md-editor-help-list">' + s.map(
8608
+ ).join("") + '</div><div class="md-editor-help-section-title">Syntax</div><div class="md-editor-help-list">' + r.map(
8572
8609
  (o) => `<div class="md-editor-help-row">
8573
8610
  <span class="md-editor-help-desc">${o.label}</span>
8574
8611
  <span class="md-editor-help-syntax">${o.hint}</span>
8575
8612
  </div>`
8576
8613
  ).join("") + "</div>";
8577
8614
  }
8578
- const r = t.el.querySelector(".md-editor-popup-footer");
8579
- r && r.remove(), this.activePopup = t, this.activePopup.show();
8615
+ const s = t.el.querySelector(".md-editor-popup-footer");
8616
+ s && s.remove(), this.activePopup = t, this.activePopup.show();
8580
8617
  }
8581
8618
  // ---------- Image upload ----------
8582
8619
  async handleImageFile(e) {
@@ -8589,8 +8626,8 @@ ${r}
8589
8626
  }
8590
8627
  // ---------- Tips / callout dropdown ----------
8591
8628
  showTipsPopup(e) {
8592
- var s;
8593
- (s = this.activePopup) == null || s.destroy();
8629
+ var r;
8630
+ (r = this.activePopup) == null || r.destroy();
8594
8631
  const t = [
8595
8632
  { key: "notice", label: "Notice", color: "#0969da" },
8596
8633
  { key: "info", label: "Info", color: "#0969da" },
@@ -8604,8 +8641,8 @@ ${r}
8604
8641
  fields: [],
8605
8642
  onSubmit: () => {
8606
8643
  }
8607
- }), r = i.el.querySelector(".md-editor-popup-body");
8608
- if (r) {
8644
+ }), s = i.el.querySelector(".md-editor-popup-body");
8645
+ if (s) {
8609
8646
  const o = document.createElement("div");
8610
8647
  o.className = "md-editor-tips-grid";
8611
8648
  for (const c of t) {
@@ -8621,7 +8658,7 @@ Your ${c.key.toLowerCase()} content here.
8621
8658
  ), i.hide();
8622
8659
  }), o.appendChild(l);
8623
8660
  }
8624
- r.innerHTML = "", r.appendChild(o);
8661
+ s.innerHTML = "", s.appendChild(o);
8625
8662
  }
8626
8663
  const a = i.el.querySelector(".md-editor-popup-footer");
8627
8664
  a && a.remove(), this.activePopup = i, this.activePopup.show();
@@ -8631,21 +8668,21 @@ Your ${c.key.toLowerCase()} content here.
8631
8668
  this.previewPane && this.previewPane.addEventListener("click", (e) => {
8632
8669
  const t = e.target.closest(".md-editor-codeblock-copy");
8633
8670
  if (!t) return;
8634
- const i = t.closest(".md-editor-codeblock"), r = i == null ? void 0 : i.querySelector("code");
8635
- if (!r) return;
8636
- const a = r.textContent ?? "";
8671
+ const i = t.closest(".md-editor-codeblock"), s = i == null ? void 0 : i.querySelector("code");
8672
+ if (!s) return;
8673
+ const a = s.textContent ?? "";
8637
8674
  this.copyToClipboard(a, t);
8638
8675
  });
8639
8676
  }
8640
8677
  copyToClipboard(e, t) {
8641
- var r;
8678
+ var s;
8642
8679
  const i = () => {
8643
8680
  const a = t.textContent;
8644
8681
  t.textContent = "Copied!", t.classList.add("is-copied"), window.setTimeout(() => {
8645
8682
  t.textContent = a, t.classList.remove("is-copied");
8646
8683
  }, 2e3);
8647
8684
  };
8648
- (r = navigator.clipboard) != null && r.writeText ? navigator.clipboard.writeText(e).then(i).catch(() => {
8685
+ (s = navigator.clipboard) != null && s.writeText ? navigator.clipboard.writeText(e).then(i).catch(() => {
8649
8686
  this.fallbackCopy(e, i);
8650
8687
  }) : this.fallbackCopy(e, i);
8651
8688
  }
@@ -8653,19 +8690,19 @@ Your ${c.key.toLowerCase()} content here.
8653
8690
  try {
8654
8691
  const i = document.createElement("textarea");
8655
8692
  i.value = e, i.style.position = "fixed", i.style.opacity = "0", document.body.appendChild(i), i.select();
8656
- const r = document.execCommand("copy");
8657
- document.body.removeChild(i), r && t();
8693
+ const s = document.execCommand("copy");
8694
+ document.body.removeChild(i), s && t();
8658
8695
  } catch {
8659
8696
  }
8660
8697
  }
8661
8698
  // ---------- Snippets ----------
8662
8699
  insertSnippet(e) {
8663
- const [t, i, r] = nt[e];
8664
- this.codeEditor.insertAtCursor(`${t}${r}${i}`);
8700
+ const [t, i, s] = nt[e];
8701
+ this.codeEditor.insertAtCursor(`${t}${s}${i}`);
8665
8702
  }
8666
8703
  wrapSnippet(e) {
8667
- const [t, i, r] = nt[e];
8668
- this.codeEditor.wrapSelection(t, i, r);
8704
+ const [t, i, s] = nt[e];
8705
+ this.codeEditor.wrapSelection(t, i, s);
8669
8706
  }
8670
8707
  togglePreview() {
8671
8708
  var t;
@@ -8675,22 +8712,22 @@ Your ${c.key.toLowerCase()} content here.
8675
8712
  }
8676
8713
  // ---------- Render scheduling (performance core) ----------
8677
8714
  requestPreviewRender(e) {
8678
- var i, r;
8679
- const t = this.renderDebounceOpt === !1 ? 0 : this.renderDebounceOpt ?? Vi(e.length);
8715
+ var i, s;
8716
+ const t = this.renderDebounceOpt === !1 ? 0 : this.renderDebounceOpt ?? Xi(e.length);
8680
8717
  if (t === 0) {
8681
8718
  (i = this.scheduledRender) == null || i.cancel(), this.scheduledRender = null, this.renderPreview(e);
8682
8719
  return;
8683
8720
  }
8684
- (!this.scheduledRender || this.scheduledWait !== t) && ((r = this.scheduledRender) == null || r.cancel(), this.scheduledRender = Xi((a) => this.renderPreview(a), t), this.scheduledWait = t), this.scheduledRender(e);
8721
+ (!this.scheduledRender || this.scheduledWait !== t) && ((s = this.scheduledRender) == null || s.cancel(), this.scheduledRender = Vi((a) => this.renderPreview(a), t), this.scheduledWait = t), this.scheduledRender(e);
8685
8722
  }
8686
8723
  renderPreview(e) {
8687
8724
  if (!this.previewPane || !this.incremental) return;
8688
8725
  const { totalCount: t } = this.incremental.update(e);
8689
8726
  if (this.renderer.hydrate(this.previewPane), this.statusBar) {
8690
- const { charCount: i, wordCount: r } = tt(e);
8727
+ const { charCount: i, wordCount: s } = tt(e);
8691
8728
  this.statusBar.update({
8692
8729
  charCount: i,
8693
- wordCount: r,
8730
+ wordCount: s,
8694
8731
  blockCount: t,
8695
8732
  mode: this.mode,
8696
8733
  autoPreview: this.autoPreview
@@ -8698,13 +8735,13 @@ Your ${c.key.toLowerCase()} content here.
8698
8735
  }
8699
8736
  }
8700
8737
  updateStatusBar(e) {
8701
- var r;
8738
+ var s;
8702
8739
  if (!this.statusBar) return;
8703
8740
  const { charCount: t, wordCount: i } = tt(e);
8704
8741
  this.statusBar.update({
8705
8742
  charCount: t,
8706
8743
  wordCount: i,
8707
- blockCount: ((r = this.incremental) == null ? void 0 : r.getBlockCount()) ?? 0,
8744
+ blockCount: ((s = this.incremental) == null ? void 0 : s.getBlockCount()) ?? 0,
8708
8745
  mode: this.mode,
8709
8746
  autoPreview: this.autoPreview
8710
8747
  });
@@ -8728,8 +8765,8 @@ Your ${c.key.toLowerCase()} content here.
8728
8765
  this.autoPreview = e, e && this.renderPreview(this.codeEditor.getValue()), this.updateStatusBar(this.codeEditor.getValue());
8729
8766
  }
8730
8767
  setMode(e) {
8731
- var t, i, r;
8732
- e !== this.mode && (this.mode = e, this.container.classList.remove("md-editor-mode-simple", "md-editor-mode-complex"), this.container.classList.add(`md-editor-mode-${e}`), this.codeEditor.setLineNumbers(e === "complex"), (t = this.toolbar) == null || t.destroy(), this.toolbar = null, (i = this.statusBar) == null || i.destroy(), this.statusBar = null, (r = this.activePopup) == null || r.destroy(), this.activePopup = null, e === "complex" && (this.buildToolbar(), this.buildStatusBar(), this.updateStatusBar(this.codeEditor.getValue())));
8768
+ var t, i, s;
8769
+ e !== this.mode && (this.mode = e, this.container.classList.remove("md-editor-mode-simple", "md-editor-mode-complex"), this.container.classList.add(`md-editor-mode-${e}`), this.codeEditor.setLineNumbers(e === "complex"), (t = this.toolbar) == null || t.destroy(), this.toolbar = null, (i = this.statusBar) == null || i.destroy(), this.statusBar = null, (s = this.activePopup) == null || s.destroy(), this.activePopup = null, e === "complex" && (this.buildToolbar(), this.buildStatusBar(), this.updateStatusBar(this.codeEditor.getValue())));
8733
8770
  }
8734
8771
  setTheme(e) {
8735
8772
  var t;
@@ -8739,32 +8776,32 @@ Your ${c.key.toLowerCase()} content here.
8739
8776
  this.codeEditor.focus();
8740
8777
  }
8741
8778
  destroy() {
8742
- var e, t, i, r, a;
8743
- (e = this.scheduledRender) == null || e.cancel(), this.scheduledRender = null, (t = this.activePopup) == null || t.destroy(), this.activePopup = null, this.codeEditor.destroy(), (i = this.toolbar) == null || i.destroy(), this.toolbar = null, (r = this.statusBar) == null || r.destroy(), this.statusBar = null, (a = this.incremental) == null || a.destroy(), this.incremental = null, this.container.innerHTML = "", this.container.classList.remove("md-editor-root", `md-editor-mode-${this.mode}`), this.container.removeAttribute("data-theme");
8779
+ var e, t, i, s, a;
8780
+ (e = this.scheduledRender) == null || e.cancel(), this.scheduledRender = null, (t = this.activePopup) == null || t.destroy(), this.activePopup = null, this.codeEditor.destroy(), (i = this.toolbar) == null || i.destroy(), this.toolbar = null, (s = this.statusBar) == null || s.destroy(), this.statusBar = null, (a = this.incremental) == null || a.destroy(), this.incremental = null, this.container.innerHTML = "", this.container.classList.remove("md-editor-root", `md-editor-mode-${this.mode}`), this.container.removeAttribute("data-theme");
8744
8781
  }
8745
8782
  }
8746
8783
  export {
8747
8784
  tn as CodeEditor,
8748
8785
  Qi as DEFAULT_SHORTCUTS,
8749
8786
  Zi as IncrementalRenderer,
8750
- ur as MarkdownEditor,
8787
+ us as MarkdownEditor,
8751
8788
  ie as Popup,
8752
8789
  It as Renderer,
8753
8790
  zi as StatusBar,
8754
- Hi as Toolbar,
8755
- Vi as adaptiveDebounceMs,
8756
- cr as cancelIdle,
8791
+ Fi as Toolbar,
8792
+ Xi as adaptiveDebounceMs,
8793
+ cs as cancelIdle,
8757
8794
  tt as countText,
8758
- Xi as debounce,
8795
+ Vi as debounce,
8759
8796
  Ci as extractYouTubeId,
8760
- dr as formatShortcut,
8797
+ ds as formatShortcut,
8761
8798
  Ji as formatShortcutHtml,
8762
8799
  R as icons,
8763
8800
  je as imageMarkdown,
8764
8801
  Ri as isVideoFile,
8765
- lr as matchShortcut,
8766
- or as renderMarkdown,
8767
- ar as scheduleIdle,
8802
+ ls as matchShortcut,
8803
+ os as renderMarkdown,
8804
+ as as scheduleIdle,
8768
8805
  Yi as splitIntoBlocks,
8769
8806
  Oi as videoMarkdown,
8770
8807
  Mi as youTubeEmbedMarkdown