@linker-design-plus/tiny-peony 1.4.25 → 1.4.27

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
@@ -8,7 +8,7 @@ var kC = (I) => Object.prototype.toString.call(I), ge = (I) => kC(I) === "[objec
8
8
  return [Be(B), B];
9
9
  };
10
10
  const II = NB("tag"), ZA = NB("c"), Qe = () => typeof window > "u" ? !1 : window.location.protocol === "https:", MI = (I) => Object.prototype.toString.call(I).slice(8, -1).toLocaleLowerCase(), GB = (I) => MI(I) === "string", kB = (I) => MI(I) === "array", Ee = (I) => MI(I) === "null", ee = (I) => MI(I) === "undefined", q = (I) => Ee(I) || ee(I), $ = (I) => I instanceof HTMLElement, HA = (I) => (I == null ? void 0 : I.nodeType) === Node.TEXT_NODE;
11
- var te = /* @__PURE__ */ ((I) => (I.None = "None", I.Caret = "Caret", I.Range = "Range", I))(te || {}), x = /* @__PURE__ */ ((I) => (I.pausation = "pausation", I.pronunciation = "pronunciation", I.anchor = "anchor", I.homophones = "homophones", I.highlight = "highlight", I.placeholderoldSpace = "placeholderoldSpace", I))(x || {}), SB = /* @__PURE__ */ ((I) => (I.single = "single", I.multiple = "multiple", I))(SB || {});
11
+ var te = /* @__PURE__ */ ((I) => (I.None = "None", I.Caret = "Caret", I.Range = "Range", I))(te || {}), b = /* @__PURE__ */ ((I) => (I.pausation = "pausation", I.pronunciation = "pronunciation", I.anchor = "anchor", I.homophones = "homophones", I.highlight = "highlight", I))(b || {}), SB = /* @__PURE__ */ ((I) => (I.single = "single", I.multiple = "multiple", I))(SB || {});
12
12
  class oe {
13
13
  }
14
14
  class ne {
@@ -34,9 +34,9 @@ class se extends ae {
34
34
  }
35
35
  }
36
36
  const ce = (I, E) => {
37
- var y;
37
+ var f;
38
38
  E.preventDefault();
39
- const B = ((y = E.data) == null ? void 0 : y.length) ?? 0, t = I.content.calcTextCount() - B, o = I.maxLength - t;
39
+ const B = ((f = E.data) == null ? void 0 : f.length) ?? 0, t = I.content.calcTextCount() - B, o = I.maxLength - t;
40
40
  if (o >= B || !B) return;
41
41
  const r = o <= 0 ? B : B - o, a = window.getSelection(), i = a == null ? void 0 : a.getRangeAt(0);
42
42
  if (q(a) || q(i)) return;
@@ -92,7 +92,7 @@ class de extends ne {
92
92
  const o = JI(this._editor, kB(B) ? B : [B]), r = this.getParas()[0], a = (i = r.textContent) != null && i.length ? void 0 : o.shift();
93
93
  a && (r.innerHTML = a, t == null || t(r)), o.forEach((h) => {
94
94
  const d = document.createElement("p");
95
- d.innerHTML = h, d.classList.add(GA), this._editorElement.appendChild(d), t == null || t(d);
95
+ d.innerHTML = h, d.classList.add(NA), this._editorElement.appendChild(d), t == null || t(d);
96
96
  });
97
97
  }
98
98
  // 增加内容
@@ -110,7 +110,7 @@ class de extends ne {
110
110
  // 获取段落节点
111
111
  getParas() {
112
112
  return Array.from(
113
- this._editorElement.querySelectorAll(`.${GA}`)
113
+ this._editorElement.querySelectorAll(`.${NA}`)
114
114
  );
115
115
  }
116
116
  // 获取纯文本内容(段落划分)
@@ -120,14 +120,11 @@ class de extends ne {
120
120
  let a = "";
121
121
  for (let i = 0; i < r.length; i++) {
122
122
  const h = r[i];
123
- HA(h) ? a += h.textContent ?? "" : $(h) && (a += ((c) => {
124
- const { type: y, value: D, raw: u } = c.dataset;
125
- if ([x.anchor, x.placeholderoldSpace].includes(y)) {
126
- const R = t(c);
127
- return typeof R == "string" ? R : "";
128
- }
129
- return y === x.pronunciation ? D ?? "" : u ?? "";
130
- })(h));
123
+ HA(h) ? a += h.textContent ?? "" : $(h) && (a += // 主播标签需要递归处理
124
+ b.anchor === h.dataset.type ? t(h) : (
125
+ // 读音替换标签,需要使用替换后文本
126
+ b.pronunciation === h.dataset.type ? h.dataset.value : h.dataset.raw ?? ""
127
+ ));
131
128
  }
132
129
  return a;
133
130
  };
@@ -161,7 +158,7 @@ class de extends ne {
161
158
  */
162
159
  _calcRange(B) {
163
160
  const t = B.commonAncestorContainer;
164
- if ($(B.startContainer) && B.startContainer.dataset.type === x.highlight && B.endContainer.nodeType === Node.TEXT_NODE) {
161
+ if ($(B.startContainer) && B.startContainer.dataset.type === b.highlight && B.endContainer.nodeType === Node.TEXT_NODE) {
165
162
  const h = document.createRange();
166
163
  return h.setStartAfter(B.startContainer), h.collapse(!0), h;
167
164
  }
@@ -244,7 +241,7 @@ class he extends re {
244
241
  let o = B;
245
242
  for (; o && o.parentElement; ) {
246
243
  const a = Array.from(o.parentElement.childNodes).indexOf(o);
247
- if (t.unshift({ index: a }), $(o) && o.tagName === "P" && o.classList.contains(GA))
244
+ if (t.unshift({ index: a }), $(o) && o.tagName === "P" && o.classList.contains(NA))
248
245
  break;
249
246
  o = o.parentElement;
250
247
  }
@@ -281,13 +278,13 @@ class he extends re {
281
278
  const t = window.getSelection();
282
279
  if (q(t)) return;
283
280
  const o = (h) => {
284
- let d = this._editor.content.getParas(), { index: c } = h[0], y = null, D = 0;
281
+ let d = this._editor.content.getParas(), { index: c } = h[0], f = null, D = 0;
285
282
  for (; D < h.length; ) {
286
- if (y = d[c], HA(y)) return y;
287
- if (d = Array.from(y.childNodes), D++, D >= h.length) break;
283
+ if (f = d[c], HA(f)) return f;
284
+ if (d = Array.from(f.childNodes), D++, D >= h.length) break;
288
285
  c = h[D].index;
289
286
  }
290
- return y;
287
+ return f;
291
288
  }, r = o(B.startMatchedIndexes), a = o(B.endMatchedIndexes), i = document.createRange();
292
289
  i.setStart(r, B.startOffset), i.setEnd(a, B.endOffset), t.removeAllRanges(), t.addRange(i);
293
290
  }
@@ -350,15 +347,15 @@ const yI = (I, E) => {
350
347
  i = I.cursor.isRangeInEditor() ? window.getSelection().getRangeAt(0) : t, i = HA(i.commonAncestorContainer) && i.commonAncestorContainer.textContent === "粘贴文本" ? t : i;
351
348
  const [D] = PA(
352
349
  i.commonAncestorContainer,
353
- (m) => m.tagName === "P" && m.classList.contains(GA)
354
- ), [u] = PA(i.startContainer, (m) => m.tagName === "SPAN" && m.dataset.type === x.anchor), R = document.createRange(), F = !!u;
350
+ (m) => m.tagName === "P" && m.classList.contains(NA)
351
+ ), [u] = PA(i.startContainer, (m) => m.tagName === "SPAN" && m.dataset.type === b.anchor), R = document.createRange(), F = !!u;
355
352
  R.setStart(i.startContainer, i.startOffset), R.setEndAfter(D.lastChild);
356
353
  const M = R.extractContents();
357
354
  if (!(D != null && D.textContent))
358
355
  D.innerHTML = o;
359
356
  else if (HA(D.lastChild))
360
357
  D.lastChild.textContent += o;
361
- else if ($(D.lastChild) && D.lastChild.dataset.type === x.anchor) {
358
+ else if ($(D.lastChild) && D.lastChild.dataset.type === b.anchor) {
362
359
  const { lastChild: m } = D.lastChild;
363
360
  HA(m) ? m.textContent += o : m == null || m.appendChild(document.createTextNode(o));
364
361
  } else
@@ -371,17 +368,17 @@ const yI = (I, E) => {
371
368
  if (a.forEach((m) => {
372
369
  var X;
373
370
  const P = document.createElement("p");
374
- if (P.classList.add(GA), P.textContent = m, (X = D == null ? void 0 : D.parentNode) == null || X.insertBefore(P, G), G = P.nextSibling, yI(I, P), F) {
371
+ if (P.classList.add(NA), P.textContent = m, (X = D == null ? void 0 : D.parentNode) == null || X.insertBefore(P, G), G = P.nextSibling, yI(I, P), F) {
375
372
  const K = u.cloneNode(!1);
376
373
  K.innerHTML = P.innerHTML, P.innerHTML = K.outerHTML;
377
374
  }
378
375
  }), !r) return;
379
376
  const S = document.createElement("p");
380
- if (S.classList.add(GA), S.appendChild(M), !S.textContent)
377
+ if (S.classList.add(NA), S.appendChild(M), !S.textContent)
381
378
  S.innerHTML = r;
382
379
  else if (HA(S.firstChild))
383
380
  S.firstChild.textContent = r + S.firstChild.textContent;
384
- else if ($(S.firstChild) && S.firstChild.dataset.type === x.anchor) {
381
+ else if ($(S.firstChild) && S.firstChild.dataset.type === b.anchor) {
385
382
  const { firstChild: m } = S.firstChild;
386
383
  HA(m) ? m.textContent = r + m.textContent : m == null || m.insertBefore(document.createTextNode(r), m.firstChild);
387
384
  } else
@@ -390,7 +387,7 @@ const yI = (I, E) => {
390
387
  var P;
391
388
  return !((P = S.textContent) != null && P.trim().endsWith(`停顿: ${m}S`));
392
389
  }) && yI(I, S);
393
- }, [Re] = ZA("paragraph"), GA = Re(), Fe = `<p class="${GA}"><br /></p>`;
390
+ }, [Re] = ZA("paragraph"), NA = Re(), Fe = `<p class="${NA}"><br /></p>`;
394
391
  class Ne extends oe {
395
392
  constructor(B, t) {
396
393
  super();
@@ -429,7 +426,7 @@ class Ne extends oe {
429
426
  var t;
430
427
  if (B.removedNodes.length) {
431
428
  const o = B.removedNodes[0];
432
- if ($(o) && o.dataset.type === x.highlight) {
429
+ if ($(o) && o.dataset.type === b.highlight) {
433
430
  const r = window.getSelection(), { range: a } = this.cursor;
434
431
  if (q(a) || q(r)) return;
435
432
  const i = document.createTextNode(""), h = document.createRange();
@@ -437,7 +434,7 @@ class Ne extends oe {
437
434
  }
438
435
  }
439
436
  B.addedNodes.forEach((o) => {
440
- $(o) && o.tagName === "P" && !o.classList.contains(GA) && o.classList.add(GA);
437
+ $(o) && o.tagName === "P" && !o.classList.contains(NA) && o.classList.add(NA);
441
438
  }), B.removedNodes.length && !this.content.getParas().length && this.content.insertEmptyPara(), (t = this._onchange) == null || t.call(this, this.content.calcTextCount()), Array.from(document.querySelectorAll("p")).forEach((o) => {
442
439
  Array.from(o.style).includes("text-indent") && o.removeAttribute("style"), Array.from(o.childNodes).forEach((a) => {
443
440
  var i;
@@ -450,7 +447,7 @@ class Ne extends oe {
450
447
  var D;
451
448
  const r = o.parentNode, a = o.firstChild;
452
449
  if (o && o.getAttribute("data-placeholder") !== null) return;
453
- const h = o && o.style.textIndent === "20px" && o.style.fontSize && o.style.color, d = o && o.style.backgroundColor && ((D = o.parentElement) == null ? void 0 : D.style.textIndent) === "0px", c = o && Array.from(o.childNodes).every((u) => HA(u) && !u.textContent || $(u) && u.tagName === "BR"), y = o && $(o.firstChild) && o.firstChild.tagName === "BR";
450
+ const h = o && o.style.textIndent === "20px" && o.style.fontSize && o.style.color, d = o && o.style.backgroundColor && ((D = o.parentElement) == null ? void 0 : D.style.textIndent) === "0px", c = o && Array.from(o.childNodes).every((u) => HA(u) && !u.textContent || $(u) && u.tagName === "BR"), f = o && $(o.firstChild) && o.firstChild.tagName === "BR";
454
451
  if (h || d) {
455
452
  for (; o.firstChild; )
456
453
  r == null || r.insertBefore(o.firstChild, o);
@@ -461,7 +458,7 @@ class Ne extends oe {
461
458
  const u = window.getSelection(), F = (u == null ? void 0 : u.getRangeAt(0)).cloneRange();
462
459
  F.setStartAfter(F.startContainer), F.setEndAfter(F.endContainer), u == null || u.removeAllRanges(), u == null || u.addRange(F);
463
460
  }
464
- y && o.removeChild(o.firstChild);
461
+ f && o.removeChild(o.firstChild);
465
462
  }), this.content.getParas().forEach((o) => {
466
463
  const r = o.firstChild, a = o.lastChild;
467
464
  o.childNodes.length > 1 && ($(a) && a.tagName === "BR" && a.remove(), $(r) && r.tagName === "BR" && r.remove(), Array.from(o.childNodes).forEach((i) => {
@@ -483,22 +480,22 @@ class Ne extends oe {
483
480
  var r, a, i, h, d;
484
481
  const t = window.getSelection(), o = t.getRangeAt(0);
485
482
  if (B.key === "Backspace" && o.startOffset === 0 && o.collapsed) {
486
- const [c] = PA(o.startContainer, (D) => D.tagName === "P" && D.classList.contains(GA)), y = c == null ? void 0 : c.previousElementSibling;
487
- if (y) {
483
+ const [c] = PA(o.startContainer, (D) => D.tagName === "P" && D.classList.contains(NA)), f = c == null ? void 0 : c.previousElementSibling;
484
+ if (f) {
488
485
  B.preventDefault();
489
- const D = y.childNodes, u = y.childNodes[0];
486
+ const D = f.childNodes, u = f.childNodes[0];
490
487
  if (
491
488
  // 一个节点
492
489
  D.length === 1 && // 空文本节点
493
490
  (HA(u) && u.textContent === "" || // 换行元素节点
494
491
  $(u) && u.tagName === "BR")
495
492
  ) {
496
- y.remove();
493
+ f.remove();
497
494
  const R = document.createRange();
498
495
  R.setStart(c.firstChild, 0), R.collapse(!0), t.removeAllRanges(), t.addRange(R);
499
496
  } else {
500
497
  const R = document.createRange();
501
- R.selectNodeContents(y), R.collapse(!1), t.removeAllRanges(), t.addRange(R);
498
+ R.selectNodeContents(f), R.collapse(!1), t.removeAllRanges(), t.addRange(R);
502
499
  const F = document.createDocumentFragment(), M = c.firstChild;
503
500
  for (; c.firstChild; )
504
501
  F.appendChild(c.firstChild);
@@ -509,9 +506,9 @@ class Ne extends oe {
509
506
  }
510
507
  }
511
508
  if (B.key === "Delete" && Ge()) {
512
- const c = getSelection(), y = (r = getSelection()) == null ? void 0 : r.getRangeAt(0);
513
- if (q(c) || q(y)) return;
514
- const D = WA(y.endContainer), u = D == null ? void 0 : D.nextElementSibling;
509
+ const c = getSelection(), f = (r = getSelection()) == null ? void 0 : r.getRangeAt(0);
510
+ if (q(c) || q(f)) return;
511
+ const D = WA(f.endContainer), u = D == null ? void 0 : D.nextElementSibling;
515
512
  if (q(D) || q(u)) return;
516
513
  const R = document.createRange();
517
514
  for (R.selectNodeContents(D), R.collapse(!1); u.firstChild; )
@@ -521,11 +518,11 @@ class Ne extends oe {
521
518
  if (B.key === "Enter") {
522
519
  const { range: c } = this.cursor;
523
520
  if (ge(c)) return;
524
- const [y] = PA(c == null ? void 0 : c.commonAncestorContainer, (D) => D.tagName === "SPAN" && D.dataset.type === x.anchor);
525
- if (c != null && c.collapsed && c.startOffset === 0 && y) {
521
+ const [f] = PA(c == null ? void 0 : c.commonAncestorContainer, (D) => D.tagName === "SPAN" && D.dataset.type === b.anchor);
522
+ if (c != null && c.collapsed && c.startOffset === 0 && f) {
526
523
  B.preventDefault();
527
524
  const D = document.createElement("p");
528
- D.innerHTML = "<br />", this._editorElement.insertBefore(D, y.parentElement);
525
+ D.innerHTML = "<br />", this._editorElement.insertBefore(D, f.parentElement);
529
526
  }
530
527
  if (c && B.shiftKey) {
531
528
  const D = WA(c.startContainer);
@@ -538,13 +535,13 @@ class Ne extends oe {
538
535
  } else if (c.startOffset === 0) {
539
536
  B.preventDefault();
540
537
  const u = document.createElement("p");
541
- u.classList.add(GA), u.innerHTML = "<br />", (h = D == null ? void 0 : D.textContent) != null && h.length ? D == null || D.before(u) : D == null || D.after(u);
538
+ u.classList.add(NA), u.innerHTML = "<br />", (h = D == null ? void 0 : D.textContent) != null && h.length ? D == null || D.before(u) : D == null || D.after(u);
542
539
  const R = document.createRange();
543
540
  R.setStart(u.firstChild || u, 0), R.collapse(!0), t.removeAllRanges(), t.addRange(R);
544
541
  } else {
545
542
  B.preventDefault();
546
543
  const u = document.createElement("p");
547
- u.classList.add(GA);
544
+ u.classList.add(NA);
548
545
  const R = document.createRange();
549
546
  R.setStart(c.startContainer, c.startOffset), R.setEndAfter(D.lastChild);
550
547
  const F = R.extractContents();
@@ -599,7 +596,7 @@ const Kg = (I, E, B, t) => {
599
596
  }, WA = (I) => {
600
597
  const [E] = PA(
601
598
  I,
602
- (B) => B.tagName === "P" && B.classList.contains(GA)
599
+ (B) => B.tagName === "P" && B.classList.contains(NA)
603
600
  );
604
601
  return E;
605
602
  }, hC = (I, E) => {
@@ -617,14 +614,14 @@ const Kg = (I, E, B, t) => {
617
614
  const t = I.previousSibling, o = I.nextSibling, r = E ?? I.textContent ?? "";
618
615
  if (B && // 空节点
619
616
  (!t && !o || // 相邻停顿节点
620
- $(t) && t.dataset.type === x.pausation || // 相邻功能节点
617
+ $(t) && t.dataset.type === b.pausation || // 相邻功能节点
621
618
  $(t) && [
622
- x.anchor,
623
- x.homophones,
624
- x.pausation,
625
- x.pronunciation
619
+ b.anchor,
620
+ b.homophones,
621
+ b.pausation,
622
+ b.pronunciation
626
623
  ].includes(t.dataset.type))) {
627
- $(I) && I.dataset.type !== x.pausation ? I.replaceWith(I.dataset.raw ?? "") : (a = I.parentNode) == null || a.removeChild(I);
624
+ $(I) && I.dataset.type !== b.pausation ? I.replaceWith(I.dataset.raw ?? "") : (a = I.parentNode) == null || a.removeChild(I);
628
625
  return;
629
626
  }
630
627
  if (HA(t)) {
@@ -754,12 +751,12 @@ function Ug(...I) {
754
751
  B = lB(B), t = lB(t);
755
752
  const r = [], a = () => {
756
753
  r.forEach((c) => c()), r.length = 0;
757
- }, i = (c, y, D, u) => (c.addEventListener(y, D, u), () => c.removeEventListener(y, D, u)), h = gI(
754
+ }, i = (c, f, D, u) => (c.addEventListener(f, D, u), () => c.removeEventListener(f, D, u)), h = gI(
758
755
  () => [Ye(E), Jg(o)],
759
- ([c, y]) => {
756
+ ([c, f]) => {
760
757
  if (a(), !c)
761
758
  return;
762
- const D = Me(y) ? { ...y } : y;
759
+ const D = Me(f) ? { ...f } : f;
763
760
  r.push(
764
761
  ...B.flatMap((u) => t.map((R) => i(c, u, R, D)))
765
762
  );
@@ -785,8 +782,8 @@ function dB(I, E = {}) {
785
782
  controls: B = !1,
786
783
  navigator: t = JB
787
784
  } = E, o = YB(() => t && "permissions" in t), r = rB(), a = typeof I == "string" ? { name: I } : I, i = rB(), h = () => {
788
- var c, y;
789
- i.value = (y = (c = r.value) == null ? void 0 : c.state) != null ? y : "prompt";
785
+ var c, f;
786
+ i.value = (f = (c = r.value) == null ? void 0 : c.state) != null ? f : "prompt";
790
787
  };
791
788
  Ug(r, "change", h, { passive: !0 });
792
789
  const d = pe(async () => {
@@ -816,7 +813,7 @@ function me(I = {}) {
816
813
  source: t,
817
814
  copiedDuring: o = 1500,
818
815
  legacy: r = !1
819
- } = I, a = YB(() => E && "clipboard" in E), i = dB("clipboard-read"), h = dB("clipboard-write"), d = MA(() => a.value || r), c = yA(""), y = yA(!1), D = Je(() => y.value = !1, o, { immediate: !1 });
816
+ } = I, a = YB(() => E && "clipboard" in E), i = dB("clipboard-read"), h = dB("clipboard-write"), d = MA(() => a.value || r), c = yA(""), f = yA(!1), D = Je(() => f.value = !1, o, { immediate: !1 });
820
817
  function u() {
821
818
  a.value && G(i.value) ? E.clipboard.readText().then((S) => {
822
819
  c.value = S;
@@ -824,7 +821,7 @@ function me(I = {}) {
824
821
  }
825
822
  d.value && B && Ug(["copy", "cut"], u, { passive: !0 });
826
823
  async function R(S = Jg(t)) {
827
- d.value && S != null && (a.value && G(h.value) ? await E.clipboard.writeText(S) : F(S), c.value = S, y.value = !0, D.start());
824
+ d.value && S != null && (a.value && G(h.value) ? await E.clipboard.writeText(S) : F(S), c.value = S, f.value = !0, D.start());
828
825
  }
829
826
  function F(S) {
830
827
  const p = document.createElement("textarea");
@@ -840,7 +837,7 @@ function me(I = {}) {
840
837
  return {
841
838
  isSupported: d,
842
839
  text: c,
843
- copied: y,
840
+ copied: f,
844
841
  copy: R
845
842
  };
846
843
  }
@@ -861,10 +858,10 @@ function HI(I = {}) {
861
858
  scroll: i = !0,
862
859
  eventFilter: h
863
860
  } = I;
864
- let d = null, c = 0, y = 0;
861
+ let d = null, c = 0, f = 0;
865
862
  const D = yA(o.x), u = yA(o.y), R = yA(null), F = typeof E == "function" ? E : Ke[E], M = (K) => {
866
863
  const W = F(K);
867
- d = K, W && ([D.value, u.value] = W, R.value = "mouse"), r && (c = r.scrollX, y = r.scrollY);
864
+ d = K, W && ([D.value, u.value] = W, R.value = "mouse"), r && (c = r.scrollX, f = r.scrollY);
868
865
  }, G = (K) => {
869
866
  if (K.touches.length > 0) {
870
867
  const W = F(K.touches[0]);
@@ -874,7 +871,7 @@ function HI(I = {}) {
874
871
  if (!d || !r)
875
872
  return;
876
873
  const K = F(d);
877
- d instanceof MouseEvent && K && (D.value = K[0] + r.scrollX - c, u.value = K[1] + r.scrollY - y);
874
+ d instanceof MouseEvent && K && (D.value = K[0] + r.scrollX - c, u.value = K[1] + r.scrollY - f);
878
875
  }, p = () => {
879
876
  D.value = o.x, u.value = o.y;
880
877
  }, m = h ? (K) => h(() => M(K), {}) : (K) => M(K), P = h ? (K) => h(() => G(K), {}) : (K) => G(K), X = h ? () => h(() => S(), {}) : () => S();
@@ -922,7 +919,7 @@ const ve = ["onClick"], qe = /* @__PURE__ */ vA({
922
919
  for (const [t, o] of E)
923
920
  B[t] = o;
924
921
  return B;
925
- }, HB = /* @__PURE__ */ JA(qe, [["__scopeId", "data-v-a957cba2"]]), xe = 0, Mg = x.pausation, [uC] = II(Mg), mB = uC("close"), { x: be, y: Te } = HI(), Pe = `<svg class="${mB}" width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
922
+ }, HB = /* @__PURE__ */ JA(qe, [["__scopeId", "data-v-a957cba2"]]), xe = 0, Mg = b.pausation, [uC] = II(Mg), mB = uC("close"), { x: be, y: Te } = HI(), Pe = `<svg class="${mB}" width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
926
923
  <g id="V1.0" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
927
924
  <g id="虚拟精品录音间-插入停顿" transform="translate(-1287, -152)" fill="currentColor" fill-rule="nonzero">
928
925
  <g id="编组-4备份-4" transform="translate(1227, 149)">
@@ -949,17 +946,17 @@ const ve = ["onClick"], qe = /* @__PURE__ */ vA({
949
946
  `
950
947
  ), E;
951
948
  }, We = (I, E) => {
952
- const B = SC(x.pausation), { onOK: t } = E, o = (d, c) => {
949
+ const B = SC(b.pausation), { onOK: t } = E, o = (d, c) => {
953
950
  t == null || t(d, c), r();
954
951
  }, r = () => {
955
952
  h.component && (h.component.props.visible = !1);
956
953
  }, a = (d) => {
957
- var c, y;
954
+ var c, f;
958
955
  if (h.component) {
959
956
  let D = Te.value, u = be.value;
960
957
  if (d.popupContainer) {
961
958
  const { offsetTop: R, offsetLeft: F, offsetHeight: M, offsetWidth: G } = d.popupContainer;
962
- D = R + M + 5 + (((c = d.extraPos) == null ? void 0 : c.top) ?? 0), u = F - (88 - G) / 2 + (((y = d.extraPos) == null ? void 0 : y.left) ?? 0);
959
+ D = R + M + 5 + (((c = d.extraPos) == null ? void 0 : c.top) ?? 0), u = F - (88 - G) / 2 + (((f = d.extraPos) == null ? void 0 : f.left) ?? 0);
963
960
  }
964
961
  B.setAttribute("style", `top: ${D}px; left: ${u}px`), Object.entries(d).forEach(([R, F]) => {
965
962
  h.component.props[R] = F;
@@ -1024,8 +1021,8 @@ class Ve extends pI {
1024
1021
  }
1025
1022
  if (q(this.modalInstance)) {
1026
1023
  const i = (h, d) => {
1027
- var y;
1028
- if (q(this.modalInstance) || q((y = this.modalInstance) == null ? void 0 : y.target)) return;
1024
+ var f;
1025
+ if (q(this.modalInstance) || q((f = this.modalInstance) == null ? void 0 : f.target)) return;
1029
1026
  const { target: c } = this.modalInstance;
1030
1027
  c.dataset.value = String(d), c.firstElementChild.innerHTML = `停顿: ${d}S`;
1031
1028
  };
@@ -1153,7 +1150,7 @@ const Oe = { style: { display: "none" } }, Xe = /* @__PURE__ */ vA({
1153
1150
  }
1154
1151
  }), ze = /* @__PURE__ */ JA(Xe, [["__scopeId", "data-v-e430f236"]]);
1155
1152
  let Ze = 0;
1156
- const kg = x.pronunciation, [Sg] = II(kg), KB = Sg("close"), { x: _e, y: $e } = HI(), At = `<svg class="${KB}" width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1153
+ const kg = b.pronunciation, [Sg] = II(kg), KB = Sg("close"), { x: _e, y: $e } = HI(), At = `<svg class="${KB}" width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1157
1154
  <g id="V1.0" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
1158
1155
  <g id="虚拟精品录音间-读音替换" transform="translate(-1287, -152)" fill="currentColor" fill-rule="nonzero">
1159
1156
  <g id="编组-4备份-4" transform="translate(1227, 149)">
@@ -1165,7 +1162,7 @@ const kg = x.pronunciation, [Sg] = II(kg), KB = Sg("close"), { x: _e, y: $e } =
1165
1162
  </g>
1166
1163
  </g>
1167
1164
  </svg>`, gt = (I, E) => {
1168
- const B = SC(x.pronunciation), { oldText: t, onOk: o, onCancel: r, onTryPlay: a } = E, i = (R, F, M) => {
1165
+ const B = SC(b.pronunciation), { oldText: t, onOk: o, onCancel: r, onTryPlay: a } = E, i = (R, F, M) => {
1169
1166
  o == null || o(R, F, M), d();
1170
1167
  }, h = (R) => {
1171
1168
  r == null || r(R), d();
@@ -1223,8 +1220,8 @@ class It extends pI {
1223
1220
  if (q(this.modalInstance)) {
1224
1221
  const i = (h, d, c) => {
1225
1222
  if (q(this.modalInstance) || q(this.modalInstance.target)) return;
1226
- const { target: y } = this.modalInstance, D = y.querySelector(`.${Sg("replace-text")}`);
1227
- q(D) || (y.dataset.value = d, D.innerHTML = d);
1223
+ const { target: f } = this.modalInstance, D = f.querySelector(`.${Sg("replace-text")}`);
1224
+ q(D) || (f.dataset.value = d, D.innerHTML = d);
1228
1225
  };
1229
1226
  this.modalInstance = gt(ze, {
1230
1227
  oldText: r.dataset.raw,
@@ -1274,7 +1271,7 @@ const vB = [
1274
1271
  "rgba(255, 232, 145, 0.5)",
1275
1272
  "rgba(201, 233, 104, 0.5)",
1276
1273
  "rgba(255, 206, 190, 0.5)"
1277
- ], Lg = x.anchor, [zg] = II(Lg);
1274
+ ], Lg = b.anchor, [zg] = II(Lg);
1278
1275
  class Ct extends pI {
1279
1276
  constructor(B) {
1280
1277
  super();
@@ -1335,19 +1332,19 @@ class Ct extends pI {
1335
1332
  if (HA(fA)) {
1336
1333
  const J = fA.textContent;
1337
1334
  let H = fA.parentNode, dA = AA.startContainer;
1338
- H.dataset.type === x.highlight && (dA = H.nextSibling, H = H.parentNode);
1335
+ H.dataset.type === b.highlight && (dA = H.nextSibling, H = H.parentNode);
1339
1336
  const wA = H.cloneNode(!1), RA = document.createDocumentFragment();
1340
1337
  for (; H.firstChild && H.firstChild !== dA; )
1341
1338
  RA.appendChild(H.firstChild);
1342
1339
  return wA.appendChild(RA), wA.appendChild(document.createTextNode(J.slice(0, AA.startOffset))), fA.replaceWith(J.slice(AA.startOffset)), (z = H.parentNode) == null || z.insertBefore(wA, H), H;
1343
1340
  }
1344
1341
  }
1345
- return $(U) && U.classList.contains(GA) ? U.childNodes[AA.endOffset] : U;
1342
+ return $(U) && U.classList.contains(NA) ? U.childNodes[AA.endOffset] : U;
1346
1343
  };
1347
1344
  [p, m, P, X] = h(
1348
1345
  CA,
1349
1346
  c,
1350
- y,
1347
+ f,
1351
1348
  EA ? D : CA[0],
1352
1349
  EA ? u : CA[0].childNodes.length,
1353
1350
  EA ? kA : null,
@@ -1380,7 +1377,7 @@ class Ct extends pI {
1380
1377
  var Z, eA, BA, tA;
1381
1378
  const fA = Array.isArray(AA) ? AA : [AA], [U] = K, v = document.createRange();
1382
1379
  v.setStart(W, EA), v.setEnd(CA, nA), (Z = getSelection()) == null || Z.removeAllRanges(), (eA = getSelection()) == null || eA.addRange(v);
1383
- const O = v.startContainer === v.endContainer && ((tA = (BA = v.startContainer.parentElement) == null ? void 0 : BA.dataset) == null ? void 0 : tA.type) === x.highlight ? v.startContainer.parentElement.cloneNode(!1) : null, z = v.cloneContents(), J = document.createDocumentFragment();
1380
+ const O = v.startContainer === v.endContainer && ((tA = (BA = v.startContainer.parentElement) == null ? void 0 : BA.dataset) == null ? void 0 : tA.type) === b.highlight ? v.startContainer.parentElement.cloneNode(!1) : null, z = v.cloneContents(), J = document.createDocumentFragment();
1384
1381
  Array.from(z.childNodes).forEach((DA) => {
1385
1382
  if (!$(DA) || !DA.classList.contains(zg())) {
1386
1383
  O && O.appendChild(DA), J.appendChild(O ?? DA);
@@ -1389,22 +1386,22 @@ class Ct extends pI {
1389
1386
  J.append(...Array.from(DA.childNodes));
1390
1387
  });
1391
1388
  let H = document.createTextNode(""), dA = 0, wA = document.createTextNode(""), RA = 0;
1392
- return fA.includes("start") && (H = J.firstChild, dA = 0), fA.includes("end") && (wA = J.lastChild, RA = HA(wA) ? wA.data.length : $(J.lastChild) && J.lastChild.dataset.type === x.highlight ? J.lastChild.childNodes.length : J.childNodes.length), v.deleteContents(), U.insertBefore(J, typeof kA == "function" ? kA() : kA), [H, dA, wA, RA];
1389
+ return fA.includes("start") && (H = J.firstChild, dA = 0), fA.includes("end") && (wA = J.lastChild, RA = HA(wA) ? wA.data.length : $(J.lastChild) && J.lastChild.dataset.type === b.highlight ? J.lastChild.childNodes.length : J.childNodes.length), v.deleteContents(), U.insertBefore(J, typeof kA == "function" ? kA() : kA), [H, dA, wA, RA];
1393
1390
  }, d = async (K) => {
1394
1391
  var EA, CA;
1395
1392
  const W = document.createRange();
1396
- p === P && $(p) && p.dataset.type === x.highlight ? W.selectNode(p) : (W.setStart(p, m), W.setEnd(P, X)), (EA = getSelection()) == null || EA.removeAllRanges(), (CA = getSelection()) == null || CA.addRange(W), this.editor.cursor.range = W, this._insertAnchorTag(B.anchor, K);
1397
- }, { startContainer: c, startOffset: y, endContainer: D, endOffset: u } = t, R = r(D), F = WA(c), M = WA(D), G = F === M ? [F] : [F, ...hC(F, M), M], S = G.map((K, W) => {
1393
+ p === P && $(p) && p.dataset.type === b.highlight ? W.selectNode(p) : (W.setStart(p, m), W.setEnd(P, X)), (EA = getSelection()) == null || EA.removeAllRanges(), (CA = getSelection()) == null || CA.addRange(W), this.editor.cursor.range = W, this._insertAnchorTag(B.anchor, K);
1394
+ }, { startContainer: c, startOffset: f, endContainer: D, endOffset: u } = t, R = r(D), F = WA(c), M = WA(D), G = F === M ? [F] : [F, ...hC(F, M), M], S = G.map((K, W) => {
1398
1395
  let EA = [], CA = 0, nA = K.childNodes.length;
1399
1396
  switch (W) {
1400
1397
  case 0: {
1401
- CA = o(r(c)), nA = // 同一段落
1398
+ CA = $(c) && c.classList.contains(NA) ? 0 : o(r(c)), nA = // 同一段落
1402
1399
  G.length - 1 === W && // 非P段落
1403
- !($(D) && D.classList.contains(GA)) ? o(r(D)) + 1 : K.childNodes.length, EA = Array.from(K.childNodes).slice(CA, nA);
1400
+ !($(D) && D.classList.contains(NA)) ? o(r(D)) + 1 : K.childNodes.length, EA = Array.from(K.childNodes).slice(CA, nA);
1404
1401
  break;
1405
1402
  }
1406
1403
  case G.length - 1:
1407
- CA = 0, nA = $(D) && D.classList.contains(GA) ? K.childNodes.length : o(r(D)) + 1, EA = Array.from(K.childNodes).slice(0, nA);
1404
+ CA = 0, nA = $(D) && D.classList.contains(NA) ? K.childNodes.length : o(r(D)) + 1, EA = Array.from(K.childNodes).slice(0, nA);
1408
1405
  break;
1409
1406
  default:
1410
1407
  CA = 0, nA = K.childNodes.length, EA = Array.from(K.childNodes).slice(CA, nA);
@@ -1424,7 +1421,7 @@ class Ct extends pI {
1424
1421
  return B.length ? Math.max(...B) + 1 : 1;
1425
1422
  }
1426
1423
  _insertAnchorTag(B, t) {
1427
- const o = this._newAnchorId, r = String(Date.now()), a = vB[(o - 1) % 10], i = this.editor.cursor.range, { startContainer: h, startOffset: d, endContainer: c, endOffset: y } = i, D = (p) => $(p) && p.tagName === "DIV" ? p.firstElementChild : $(p) && p.tagName === "P" ? p : WA(p), u = (p) => {
1424
+ const o = this._newAnchorId, r = String(Date.now()), a = vB[(o - 1) % 10], i = this.editor.cursor.range, { startContainer: h, startOffset: d, endContainer: c, endOffset: f } = i, D = (p) => $(p) && p.tagName === "DIV" ? p.firstElementChild : $(p) && p.tagName === "P" ? p : WA(p), u = (p) => {
1428
1425
  const m = document.createElement("span");
1429
1426
  return Kg(
1430
1427
  m,
@@ -1453,7 +1450,7 @@ class Ct extends pI {
1453
1450
  if (F(p, P))
1454
1451
  W.selectNode(Array.from(p.childNodes).slice(m, X)[0]);
1455
1452
  else {
1456
- const AA = $(P) && [x.pausation].includes(P.dataset.type) ? P.childNodes.length : X;
1453
+ const AA = $(P) && [b.pausation].includes(P.dataset.type) ? P.childNodes.length : X;
1457
1454
  $(p) && p.tagName === "P" ? (W.setStart(p.firstChild, 0), W.setEnd(p, p.childNodes.length)) : (W.setStart(p, m), W.setEnd(P, AA));
1458
1455
  }
1459
1456
  const EA = window.getSelection();
@@ -1467,7 +1464,7 @@ class Ct extends pI {
1467
1464
  }, F = (p, m) => {
1468
1465
  var P, X;
1469
1466
  return $(p) && p.tagName === "P" && p === m && // @ts-ignore
1470
- ((X = (P = Array.from(p.childNodes).slice(i.startOffset, i.endOffset)[0]) == null ? void 0 : P.dataset) == null ? void 0 : X.type) === x.highlight;
1467
+ ((X = (P = Array.from(p.childNodes).slice(i.startOffset, i.endOffset)[0]) == null ? void 0 : P.dataset) == null ? void 0 : X.type) === b.highlight;
1471
1468
  }, M = D(h), G = D(c), S = hC(M, G);
1472
1469
  if (M === G) {
1473
1470
  const p = F(h, c);
@@ -1475,16 +1472,16 @@ class Ct extends pI {
1475
1472
  p ? h : $(h) && h.tagName === "P" ? h.firstChild : h,
1476
1473
  p ? d : $(h) && h.tagName === "P" ? 0 : d,
1477
1474
  c,
1478
- y,
1475
+ f,
1479
1476
  !0
1480
1477
  ), this._fixedAnchorSelection(t), this._fixedAnchorOrder(B), this._fixedAnchorHighlightContent();
1481
1478
  return;
1482
1479
  }
1483
- R(h, d, M, M.childNodes.length, !0), S.forEach((p) => R(p, 0, p, p.childNodes.length)), R(G.firstChild, 0, c, y, !1), this._fixedAnchorSelection(t), this._fixedAnchorOrder(B), this._fixedAnchorHighlightContent();
1480
+ R(h, d, M, M.childNodes.length, !0), S.forEach((p) => R(p, 0, p, p.childNodes.length)), R(G.firstChild, 0, c, f, !1), this._fixedAnchorSelection(t), this._fixedAnchorOrder(B), this._fixedAnchorHighlightContent();
1484
1481
  }
1485
1482
  _isIntersectOtherAnchors() {
1486
1483
  const { range: B } = this.editor.cursor;
1487
- return Array.from(document.querySelectorAll(`.tag-${x.anchor}`)).some((o) => B == null ? void 0 : B.intersectsNode(o));
1484
+ return Array.from(document.querySelectorAll(`.tag-${b.anchor}`)).some((o) => B == null ? void 0 : B.intersectsNode(o));
1488
1485
  }
1489
1486
  _calcTopValue(B) {
1490
1487
  return B.top - this.editor.editorTop() + 16;
@@ -1493,15 +1490,15 @@ class Ct extends pI {
1493
1490
  var R;
1494
1491
  if (!($(B) && B.classList.contains(zg()))) return;
1495
1492
  const t = B, o = Array.from(
1496
- document.querySelectorAll(`.tag-${x.anchor}`)
1493
+ document.querySelectorAll(`.tag-${b.anchor}`)
1497
1494
  ), r = t.dataset.id, a = Number((R = t.dataset.id) == null ? void 0 : R.split("_")[1]), i = o.indexOf(t), h = this._calcTopValue(t.getBoundingClientRect()), d = [];
1498
1495
  if (i < 0) return;
1499
1496
  for (let F = i; F < o.length && r === o[F].dataset.id; F++)
1500
1497
  d.push(o[F]);
1501
- const y = Object.values(this.data).flat().find((F) => F.id === a), D = String(Date.now()), u = { ...y, data: { ...y.data, uid: D } };
1498
+ const f = Object.values(this.data).flat().find((F) => F.id === a), D = String(Date.now()), u = { ...f, data: { ...f.data, uid: D } };
1502
1499
  d.forEach((F) => {
1503
1500
  F.dataset.uid = D, F.dataset.top = String(h);
1504
- }), this._recordAnchor(u.data, u.id, h, y.background);
1501
+ }), this._recordAnchor(u.data, u.id, h, f.background);
1505
1502
  }
1506
1503
  _fixedAnchorOrder(B) {
1507
1504
  const t = this.data[B.top], r = Array.from(document.querySelectorAll(`span[data-top="${B.top}"]`)).map((a) => [Number(a.dataset.id.split("_")[1]), a.dataset.uid]).reduce((a, i) => {
@@ -1522,7 +1519,7 @@ class Ct extends pI {
1522
1519
  }
1523
1520
  _fixedAnchorHighlightContent() {
1524
1521
  Array.from(
1525
- this.editor.element.querySelectorAll(`span[data-type="${x.highlight}"]`)
1522
+ this.editor.element.querySelectorAll(`span[data-type="${b.highlight}"]`)
1526
1523
  ).forEach((B) => {
1527
1524
  B.dataset.raw = B.innerHTML;
1528
1525
  });
@@ -1598,7 +1595,7 @@ const Bt = ["onClick"], Qt = /* @__PURE__ */ vA({
1598
1595
  [LI, B.visible]
1599
1596
  ]);
1600
1597
  }
1601
- }), Et = /* @__PURE__ */ JA(Qt, [["__scopeId", "data-v-8471a3e1"]]), et = 0, pg = x.homophones, [NI] = II(pg), qB = NI("close"), { x: tt, y: ot } = HI(), nt = `<svg class="${qB}" width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1598
+ }), Et = /* @__PURE__ */ JA(Qt, [["__scopeId", "data-v-8471a3e1"]]), et = 0, pg = b.homophones, [NI] = II(pg), qB = NI("close"), { x: tt, y: ot } = HI(), nt = `<svg class="${qB}" width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1602
1599
  <g id="V1.0" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
1603
1600
  <g id="虚拟精品录音间-读音替换" transform="translate(-1287, -152)" fill="currentColor" fill-rule="nonzero">
1604
1601
  <g id="编组-4备份-4" transform="translate(1227, 149)">
@@ -1629,7 +1626,7 @@ const Bt = ["onClick"], Qt = /* @__PURE__ */ vA({
1629
1626
  `
1630
1627
  ), r;
1631
1628
  }, rt = (I, E) => {
1632
- const B = SC(x.homophones), { word: t, data: o, onOK: r, onCancel: a } = E, i = (u, R) => {
1629
+ const B = SC(b.homophones), { word: t, data: o, onOK: r, onCancel: a } = E, i = (u, R) => {
1633
1630
  r == null || r(u, R), d();
1634
1631
  }, h = (u) => {
1635
1632
  a == null || a(u), d();
@@ -1693,11 +1690,11 @@ class at extends pI {
1693
1690
  return;
1694
1691
  }
1695
1692
  if (q(this.modalInstance)) {
1696
- const d = (c, y) => {
1693
+ const d = (c, f) => {
1697
1694
  var M, G;
1698
1695
  if (q(this.modalInstance) || q(this.modalInstance.target)) return;
1699
- const { target: D } = this.modalInstance, u = D.querySelector(`.${NI("raw")}`), R = (M = D.dataset.data) == null ? void 0 : M.split(",").indexOf(y), F = (G = D.dataset.formattedData) == null ? void 0 : G.split(",");
1700
- q(u) || q(R) || q(F) || (D.dataset.value = y, D.dataset.formattedValue = F[R], u.innerHTML = `${D.dataset.raw}[${y}]`);
1696
+ const { target: D } = this.modalInstance, u = D.querySelector(`.${NI("raw")}`), R = (M = D.dataset.data) == null ? void 0 : M.split(",").indexOf(f), F = (G = D.dataset.formattedData) == null ? void 0 : G.split(",");
1697
+ q(u) || q(R) || q(F) || (D.dataset.value = f, D.dataset.formattedValue = F[R], u.innerHTML = `${D.dataset.raw}[${f}]`);
1701
1698
  };
1702
1699
  this.modalInstance = rt(Et, {
1703
1700
  word: r.dataset.raw,
@@ -1721,27 +1718,27 @@ class at extends pI {
1721
1718
  var d;
1722
1719
  let h = a;
1723
1720
  for (let c = 0; c < r.length; c++) {
1724
- const y = r[c], D = (d = y == null ? void 0 : y.dataset) == null ? void 0 : d.type, u = [
1725
- x.pausation,
1726
- x.pronunciation,
1727
- x.homophones
1728
- ].includes(D) ? y.dataset.raw ?? "" : y.textContent ?? "", R = i.wordIndex - (h + 1);
1721
+ const f = r[c], D = (d = f == null ? void 0 : f.dataset) == null ? void 0 : d.type, u = [
1722
+ b.pausation,
1723
+ b.pronunciation,
1724
+ b.homophones
1725
+ ].includes(D) ? f.dataset.raw ?? "" : f.textContent ?? "", R = i.wordIndex - (h + 1);
1729
1726
  if (R >= u.length) {
1730
1727
  h += u.length;
1731
1728
  continue;
1732
1729
  }
1733
- if ($(y)) {
1734
- if ([x.pausation, x.pronunciation].includes(D)) return;
1735
- if (x.homophones === D) {
1736
- this._calc(y, R, i);
1730
+ if ($(f)) {
1731
+ if ([b.pausation, b.pronunciation].includes(D)) return;
1732
+ if (b.homophones === D) {
1733
+ this._calc(f, R, i);
1737
1734
  return;
1738
1735
  }
1739
- if (x.anchor === D) {
1740
- o(Array.from(y.childNodes), h, i);
1736
+ if (b.anchor === D) {
1737
+ o(Array.from(f.childNodes), h, i);
1741
1738
  return;
1742
1739
  }
1743
1740
  }
1744
- this._calc(y, R, i);
1741
+ this._calc(f, R, i);
1745
1742
  return;
1746
1743
  }
1747
1744
  };
@@ -1763,7 +1760,7 @@ class at extends pI {
1763
1760
  );
1764
1761
  a.selectNode(B), a.setStart(B, t), a.setEnd(B, t + 1), a.deleteContents(), a.insertNode(i), r == null || r.removeAllRanges(), r == null || r.addRange(a), this.editor.cursor.toEnd(i);
1765
1762
  }
1766
- $(B) && B.dataset.type === x.homophones && (B.dataset.value = o.modify, B.firstElementChild.innerHTML = `${o.word}[${o.modify}]`);
1763
+ $(B) && B.dataset.type === b.homophones && (B.dataset.value = o.modify, B.firstElementChild.innerHTML = `${o.word}[${o.modify}]`);
1767
1764
  }
1768
1765
  setup() {
1769
1766
  }
@@ -1798,11 +1795,11 @@ const st = {
1798
1795
  return Kg(
1799
1796
  h,
1800
1797
  { class: yC },
1801
- { type: x.highlight, raw: i }
1798
+ { type: b.highlight, raw: i }
1802
1799
  ), h;
1803
1800
  }, t = (i) => {
1804
1801
  var c;
1805
- return (((c = I.value) == null ? void 0 : c.content.getTextContent()) ?? []).reduce((y, D, u) => {
1802
+ return (((c = I.value) == null ? void 0 : c.content.getTextContent()) ?? []).reduce((f, D, u) => {
1806
1803
  const R = [];
1807
1804
  let F = 0;
1808
1805
  for (; F !== -1; )
@@ -1812,7 +1809,7 @@ const st = {
1812
1809
  paraIndex: u,
1813
1810
  index: F
1814
1811
  }), F += i.length);
1815
- return y.concat(R);
1812
+ return f.concat(R);
1816
1813
  }, []);
1817
1814
  }, o = (i, h, d) => {
1818
1815
  var D;
@@ -1821,35 +1818,35 @@ const st = {
1821
1818
  dynamicMatchingContent: h.matchingContent,
1822
1819
  dynamicMatchingContentIndex: h.index,
1823
1820
  restIndex: h.index
1824
- }, y = [];
1821
+ }, f = [];
1825
1822
  for (let u = 0; u < i.length; u++) {
1826
- if (!c.dynamicMatchingContent.length) return y;
1827
- const R = i[u], F = (D = R == null ? void 0 : R.dataset) == null ? void 0 : D.type, M = [x.pausation, x.homophones, x.highlight].includes(
1823
+ if (!c.dynamicMatchingContent.length) return f;
1824
+ const R = i[u], F = (D = R == null ? void 0 : R.dataset) == null ? void 0 : D.type, M = [b.pausation, b.homophones, b.highlight].includes(
1828
1825
  F
1829
- ) ? R.dataset.raw ?? "" : x.pronunciation === F ? R.dataset.value ?? "" : R.textContent ?? "";
1826
+ ) ? R.dataset.raw ?? "" : b.pronunciation === F ? R.dataset.value ?? "" : R.textContent ?? "";
1830
1827
  if (c.restIndex = c.dynamicMatchingContentIndex - (c.accuSearchIndex + 1), c.restIndex >= M.length) {
1831
1828
  c.accuSearchIndex += M.length;
1832
1829
  continue;
1833
1830
  }
1834
- if (x.pausation === F) continue;
1835
- if (x.anchor === F) {
1836
- y.push(...o(Array.from(R.childNodes), h, c));
1831
+ if (b.pausation === F) continue;
1832
+ if (b.anchor === F) {
1833
+ f.push(...o(Array.from(R.childNodes), h, c));
1837
1834
  continue;
1838
1835
  }
1839
1836
  let G, S;
1840
1837
  switch (F) {
1841
- case x.pronunciation: {
1838
+ case b.pronunciation: {
1842
1839
  G = R.querySelector(".tag-pronunciation__replace-text").childNodes[0], S = IC(
1843
1840
  G.textContent,
1844
1841
  c.dynamicMatchingContent
1845
1842
  ).length;
1846
1843
  break;
1847
1844
  }
1848
- case x.homophones: {
1845
+ case b.homophones: {
1849
1846
  G = R.querySelector(".tag-homophones__raw").childNodes[0], S = 1;
1850
1847
  break;
1851
1848
  }
1852
- case x.highlight: {
1849
+ case b.highlight: {
1853
1850
  G = R.childNodes[0], S = IC(
1854
1851
  G.textContent,
1855
1852
  c.dynamicMatchingContent
@@ -1864,7 +1861,7 @@ const st = {
1864
1861
  break;
1865
1862
  }
1866
1863
  }
1867
- y.push({
1864
+ f.push({
1868
1865
  content: h.matchingContent,
1869
1866
  matchedContent: c.dynamicMatchingContent.slice(0, S),
1870
1867
  node: G,
@@ -1872,24 +1869,24 @@ const st = {
1872
1869
  endOffset: c.restIndex + S,
1873
1870
  parentNodeType: F,
1874
1871
  isPausationNode: !1,
1875
- isPronunciationNode: x.pronunciation === F,
1876
- isHomophoneNode: x.homophones === F,
1877
- isHighlightNode: x.highlight === F,
1872
+ isPronunciationNode: b.pronunciation === F,
1873
+ isHomophoneNode: b.homophones === F,
1874
+ isHighlightNode: b.highlight === F,
1878
1875
  isHighlight: ![
1879
- x.pronunciation,
1880
- x.homophones,
1881
- x.highlight
1876
+ b.pronunciation,
1877
+ b.homophones,
1878
+ b.highlight
1882
1879
  ].includes(F)
1883
1880
  }), c.accuSearchIndex = -1, c.dynamicMatchingContent = c.dynamicMatchingContent.slice(S), c.dynamicMatchingContentIndex = 0, c.restIndex = 0;
1884
1881
  }
1885
- return y;
1882
+ return f;
1886
1883
  };
1887
1884
  return {
1888
1885
  renderHighlight: (i) => {
1889
1886
  const h = (d) => {
1890
1887
  var D;
1891
- const c = ((D = I.value) == null ? void 0 : D.content.getParas()) ?? [], y = o(Array.from(c[d.paraIndex].childNodes), d);
1892
- y.some((u) => !u.isHighlight) || y.forEach((u) => {
1888
+ const c = ((D = I.value) == null ? void 0 : D.content.getParas()) ?? [], f = o(Array.from(c[d.paraIndex].childNodes), d);
1889
+ f.some((u) => !u.isHighlight) || f.forEach((u) => {
1893
1890
  const R = window.getSelection();
1894
1891
  if (q(R)) return;
1895
1892
  const F = document.createRange();
@@ -1903,8 +1900,8 @@ const st = {
1903
1900
  Array.from(
1904
1901
  ((h = I.value) == null ? void 0 : h._editorElement.querySelectorAll(`.${yC}`)) ?? []
1905
1902
  ).forEach((d) => {
1906
- const c = Array.from(d.childNodes), y = c[0], D = c.length - 1, u = c[D] !== c[0] && HA(c[D]) ? c[D] : null, R = document.createDocumentFragment();
1907
- c.forEach((F) => R.appendChild(F)), d.replaceWith(R), lg(y), u && lg(u);
1903
+ const c = Array.from(d.childNodes), f = c[0], D = c.length - 1, u = c[D] !== c[0] && HA(c[D]) ? c[D] : null, R = document.createDocumentFragment();
1904
+ c.forEach((F) => R.appendChild(F)), d.replaceWith(R), lg(f), u && lg(u);
1908
1905
  });
1909
1906
  }
1910
1907
  };
@@ -2342,7 +2339,7 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2342
2339
  return typeof __filename < "u" && (t || (t = __filename)), function(r = {}) {
2343
2340
  var a, i = Object.assign({}, r), h, d, c = new Promise((A, g) => {
2344
2341
  h = A, d = g;
2345
- }), y = typeof window == "object", D = typeof importScripts == "function", u = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string", R = Object.assign({}, i), F = "./this.program", M = (A, g) => {
2342
+ }), f = typeof window == "object", D = typeof importScripts == "function", u = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string", R = Object.assign({}, i), F = "./this.program", M = (A, g) => {
2346
2343
  throw g;
2347
2344
  }, G = "", S, p, m;
2348
2345
  if (u) {
@@ -2357,7 +2354,7 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2357
2354
  }, !i.thisProgram && process.argv.length > 1 && (F = process.argv[1].replace(/\\/g, "/")), process.argv.slice(2), M = (A, g) => {
2358
2355
  throw process.exitCode = A, g;
2359
2356
  };
2360
- } else (y || D) && (D ? G = self.location.href : typeof document < "u" && document.currentScript && (G = document.currentScript.src), t && (G = t), G.startsWith("blob:") ? G = "" : G = G.substr(0, G.replace(/[?#].*/, "").lastIndexOf("/") + 1), S = (A) => {
2357
+ } else (f || D) && (D ? G = self.location.href : typeof document < "u" && document.currentScript && (G = document.currentScript.src), t && (G = t), G.startsWith("blob:") ? G = "" : G = G.substr(0, G.replace(/[?#].*/, "").lastIndexOf("/") + 1), S = (A) => {
2361
2358
  var g = new XMLHttpRequest();
2362
2359
  return g.open("GET", A, !1), g.send(null), g.responseText;
2363
2360
  }, D && (m = (A) => {
@@ -2550,14 +2547,14 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2550
2547
  EI[w] = g;
2551
2548
  });
2552
2549
  function Q(w) {
2553
- var f = C(w);
2554
- f.length !== A.length && eI("Mismatched type converter count");
2555
- for (var k = 0; k < A.length; ++k) Eg(A[k], f[k]);
2550
+ var y = C(w);
2551
+ y.length !== A.length && eI("Mismatched type converter count");
2552
+ for (var k = 0; k < A.length; ++k) Eg(A[k], y[k]);
2556
2553
  }
2557
2554
  var n = new Array(g.length), s = [], l = 0;
2558
- g.forEach((w, f) => {
2559
- wg.hasOwnProperty(w) ? n[f] = wg[w] : (s.push(w), Fg.hasOwnProperty(w) || (Fg[w] = []), Fg[w].push(() => {
2560
- n[f] = wg[w], ++l, l === s.length && Q(n);
2555
+ g.forEach((w, y) => {
2556
+ wg.hasOwnProperty(w) ? n[y] = wg[w] : (s.push(w), Fg.hasOwnProperty(w) || (Fg[w] = []), Fg[w].push(() => {
2557
+ n[y] = wg[w], ++l, l === s.length && Q(n);
2561
2558
  }));
2562
2559
  }), s.length === 0 && Q(n);
2563
2560
  };
@@ -2638,8 +2635,8 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2638
2635
  if (!l) return n.call(this);
2639
2636
  var w;
2640
2637
  this.isConst ? w = l.constPointerType : w = l.pointerType;
2641
- var f = qC(g, this.registeredClass, w.registeredClass);
2642
- return f === null ? n.call(this) : this.isSmartPointer ? tI(w.registeredClass.instancePrototype, { ptrType: w, ptr: f, smartPtrType: this, smartPtr: A }) : tI(w.registeredClass.instancePrototype, { ptrType: w, ptr: f });
2638
+ var y = qC(g, this.registeredClass, w.registeredClass);
2639
+ return y === null ? n.call(this) : this.isSmartPointer ? tI(w.registeredClass.instancePrototype, { ptrType: w, ptr: y, smartPtrType: this, smartPtr: A }) : tI(w.registeredClass.instancePrototype, { ptrType: w, ptr: y });
2643
2640
  }
2644
2641
  var Wg = (A) => typeof FinalizationRegistry > "u" ? (Wg = (g) => g, A) : (qI = new FinalizationRegistry((g) => {
2645
2642
  vC(g.$$);
@@ -2741,8 +2738,8 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2741
2738
  (g = this.rawDestructor) == null || g.call(this, A);
2742
2739
  }, argPackAdvance: og, readValueFromPointer: iI, fromWireType: cQ });
2743
2740
  };
2744
- function rI(A, g, C, Q, n, s, l, w, f, k, Y) {
2745
- this.name = A, this.registeredClass = g, this.isReference = C, this.isConst = Q, this.isSmartPointer = n, this.pointeeType = s, this.sharingPolicy = l, this.rawGetPointee = w, this.rawConstructor = f, this.rawShare = k, this.rawDestructor = Y, !n && g.baseClass === void 0 ? Q ? (this.toWireType = yQ, this.destructorFunction = null) : (this.toWireType = RQ, this.destructorFunction = null) : this.toWireType = fQ;
2741
+ function rI(A, g, C, Q, n, s, l, w, y, k, Y) {
2742
+ this.name = A, this.registeredClass = g, this.isReference = C, this.isConst = Q, this.isSmartPointer = n, this.pointeeType = s, this.sharingPolicy = l, this.rawGetPointee = w, this.rawConstructor = y, this.rawShare = k, this.rawDestructor = Y, !n && g.baseClass === void 0 ? Q ? (this.toWireType = yQ, this.destructorFunction = null) : (this.toWireType = RQ, this.destructorFunction = null) : this.toWireType = fQ;
2746
2743
  }
2747
2744
  var NQ = (A, g, C) => {
2748
2745
  i.hasOwnProperty(A) || eI("Replacing nonexistent public symbol"), i[A].overloadTable !== void 0 && C !== void 0 ? i[A].overloadTable[C] = g : (i[A] = g, i[A].argCount = C);
@@ -2786,13 +2783,13 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2786
2783
  }
2787
2784
  }
2788
2785
  throw g.forEach(n), new bC(`${A}: ` + C.map(TC).join([", "]));
2789
- }, UQ = (A, g, C, Q, n, s, l, w, f, k, Y, j, b) => {
2790
- Y = zA(Y), s = Dg(n, s), w && (w = Dg(l, w)), k && (k = Dg(f, k)), b = Dg(j, b);
2786
+ }, UQ = (A, g, C, Q, n, s, l, w, y, k, Y, j, x) => {
2787
+ Y = zA(Y), s = Dg(n, s), w && (w = Dg(l, w)), k && (k = Dg(y, k)), x = Dg(j, x);
2791
2788
  var V = DQ(Y);
2792
2789
  dQ(V, function() {
2793
2790
  aI(`Cannot construct ${Y} due to unbound types`, [Q]);
2794
2791
  }), hg([A, g, C], Q ? [Q] : [], (_) => {
2795
- var NA;
2792
+ var GA;
2796
2793
  _ = _[0];
2797
2794
  var hA, FA;
2798
2795
  Q ? (hA = _.registeredClass, FA = hA.instancePrototype) : FA = oI.prototype;
@@ -2804,8 +2801,8 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2804
2801
  return iB.apply(this, AC);
2805
2802
  }), L = Object.create(FA, { constructor: { value: LA } });
2806
2803
  LA.prototype = L;
2807
- var T = new uQ(Y, LA, L, b, hA, s, w, k);
2808
- T.baseClass && ((NA = T.baseClass).__derivedClasses ?? (NA.__derivedClasses = []), T.baseClass.__derivedClasses.push(T));
2804
+ var T = new uQ(Y, LA, L, x, hA, s, w, k);
2805
+ T.baseClass && ((GA = T.baseClass).__derivedClasses ?? (GA.__derivedClasses = []), T.baseClass.__derivedClasses.push(T));
2809
2806
  var UA = new rI(Y, T, !0, !1, !1), sA = new rI(Y + "*", T, !1, !1, !1), VA = new rI(Y + " const*", T, !1, !0, !1);
2810
2807
  return xC[A] = { pointerType: sA, constPointerType: VA }, NQ(V, LA), [UA, sA, VA];
2811
2808
  });
@@ -2828,7 +2825,7 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2828
2825
  return n instanceof Object ? n : Q;
2829
2826
  }
2830
2827
  function JQ(A, g, C, Q) {
2831
- for (var n = PC(A), s = A.length, l = "", w = "", f = 0; f < s - 2; ++f) l += (f !== 0 ? ", " : "") + "arg" + f, w += (f !== 0 ? ", " : "") + "arg" + f + "Wired";
2828
+ for (var n = PC(A), s = A.length, l = "", w = "", y = 0; y < s - 2; ++y) l += (y !== 0 ? ", " : "") + "arg" + y, w += (y !== 0 ? ", " : "") + "arg" + y + "Wired";
2832
2829
  var k = `
2833
2830
  return function (${l}) {
2834
2831
  if (arguments.length !== ${s - 2}) {
@@ -2839,15 +2836,15 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2839
2836
  var Y = n ? "destructors" : "null", j = ["humanName", "throwBindingError", "invoker", "fn", "runDestructors", "retType", "classParam"];
2840
2837
  g && (k += "var thisWired = classParam['toWireType'](" + Y + `, this);
2841
2838
  `);
2842
- for (var f = 0; f < s - 2; ++f) k += "var arg" + f + "Wired = argType" + f + "['toWireType'](" + Y + ", arg" + f + `);
2843
- `, j.push("argType" + f);
2839
+ for (var y = 0; y < s - 2; ++y) k += "var arg" + y + "Wired = argType" + y + "['toWireType'](" + Y + ", arg" + y + `);
2840
+ `, j.push("argType" + y);
2844
2841
  if (g && (w = "thisWired" + (w.length > 0 ? ", " : "") + w), k += (C || Q ? "var rv = " : "") + "invoker(fn" + (w.length > 0 ? ", " : "") + w + `);
2845
2842
  `, n) k += `runDestructors(destructors);
2846
2843
  `;
2847
- else for (var f = g ? 1 : 2; f < A.length; ++f) {
2848
- var b = f === 1 ? "thisWired" : "arg" + (f - 2) + "Wired";
2849
- A[f].destructorFunction !== null && (k += `${b}_dtor(${b});
2850
- `, j.push(`${b}_dtor`));
2844
+ else for (var y = g ? 1 : 2; y < A.length; ++y) {
2845
+ var x = y === 1 ? "thisWired" : "arg" + (y - 2) + "Wired";
2846
+ A[y].destructorFunction !== null && (k += `${x}_dtor(${x});
2847
+ `, j.push(`${x}_dtor`));
2851
2848
  }
2852
2849
  return C && (k += `var ret = retType['fromWireType'](rv);
2853
2850
  return ret;
@@ -2857,11 +2854,11 @@ return ret;
2857
2854
  function PI(A, g, C, Q, n, s) {
2858
2855
  var l = g.length;
2859
2856
  l < 2 && oA("argTypes array size mismatch! Must at least get return value and 'this' types!");
2860
- for (var w = g[1] !== null && C !== null, f = PC(g), k = g[0].name !== "void", Y = [A, oA, Q, n, MQ, g[0], g[1]], j = 0; j < l - 2; ++j) Y.push(g[j + 2]);
2861
- if (!f) for (var j = w ? 1 : 2; j < g.length; ++j) g[j].destructorFunction !== null && Y.push(g[j].destructorFunction);
2862
- let [b, V] = JQ(g, w, k, s);
2863
- b.push(V);
2864
- var _ = pQ(Function, b)(...Y);
2857
+ for (var w = g[1] !== null && C !== null, y = PC(g), k = g[0].name !== "void", Y = [A, oA, Q, n, MQ, g[0], g[1]], j = 0; j < l - 2; ++j) Y.push(g[j + 2]);
2858
+ if (!y) for (var j = w ? 1 : 2; j < g.length; ++j) g[j].destructorFunction !== null && Y.push(g[j].destructorFunction);
2859
+ let [x, V] = JQ(g, w, k, s);
2860
+ x.push(V);
2861
+ var _ = pQ(Function, x)(...Y);
2865
2862
  return nI(A, _);
2866
2863
  }
2867
2864
  var jI = (A, g) => {
@@ -2872,18 +2869,18 @@ return ret;
2872
2869
  let g = A.indexOf("(");
2873
2870
  return g !== -1 ? A.substr(0, g) : A;
2874
2871
  }, YQ = (A, g, C, Q, n, s, l, w) => {
2875
- var f = jI(C, Q);
2872
+ var y = jI(C, Q);
2876
2873
  g = zA(g), g = jC(g), s = Dg(n, s), hg([], [A], (k) => {
2877
2874
  k = k[0];
2878
2875
  var Y = `${k.name}.${g}`;
2879
2876
  function j() {
2880
- aI(`Cannot call ${Y} due to unbound types`, f);
2877
+ aI(`Cannot call ${Y} due to unbound types`, y);
2881
2878
  }
2882
2879
  g.startsWith("@@") && (g = Symbol[g.substring(2)]);
2883
- var b = k.registeredClass.constructor;
2884
- return b[g] === void 0 ? (j.argCount = C - 1, b[g] = j) : (bI(b, g, Y), b[g].overloadTable[C - 1] = j), hg([], f, (V) => {
2880
+ var x = k.registeredClass.constructor;
2881
+ return x[g] === void 0 ? (j.argCount = C - 1, x[g] = j) : (bI(x, g, Y), x[g].overloadTable[C - 1] = j), hg([], y, (V) => {
2885
2882
  var _ = [V[0], null].concat(V.slice(1)), hA = PI(Y, _, null, s, l, w);
2886
- if (b[g].overloadTable === void 0 ? (hA.argCount = C - 1, b[g] = hA) : b[g].overloadTable[C - 1] = hA, k.registeredClass.__derivedClasses) for (let FA of k.registeredClass.__derivedClasses) FA.constructor.hasOwnProperty(g) || (FA.constructor[g] = hA);
2883
+ if (x[g].overloadTable === void 0 ? (hA.argCount = C - 1, x[g] = hA) : x[g].overloadTable[C - 1] = hA, k.registeredClass.__derivedClasses) for (let FA of k.registeredClass.__derivedClasses) FA.constructor.hasOwnProperty(g) || (FA.constructor[g] = hA);
2887
2884
  return [];
2888
2885
  }), [];
2889
2886
  });
@@ -2891,24 +2888,24 @@ return ret;
2891
2888
  var l = jI(g, C);
2892
2889
  n = Dg(Q, n), hg([], [A], (w) => {
2893
2890
  w = w[0];
2894
- var f = `constructor ${w.name}`;
2891
+ var y = `constructor ${w.name}`;
2895
2892
  if (w.registeredClass.constructor_body === void 0 && (w.registeredClass.constructor_body = []), w.registeredClass.constructor_body[g - 1] !== void 0) throw new Ng(`Cannot register multiple constructors with identical number of parameters (${g - 1}) for class '${w.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
2896
2893
  return w.registeredClass.constructor_body[g - 1] = () => {
2897
2894
  aI(`Cannot construct ${w.name} due to unbound types`, l);
2898
- }, hg([], l, (k) => (k.splice(1, 0, null), w.registeredClass.constructor_body[g - 1] = PI(f, k, null, n, s), [])), [];
2895
+ }, hg([], l, (k) => (k.splice(1, 0, null), w.registeredClass.constructor_body[g - 1] = PI(y, k, null, n, s), [])), [];
2899
2896
  });
2900
- }, mQ = (A, g, C, Q, n, s, l, w, f) => {
2897
+ }, mQ = (A, g, C, Q, n, s, l, w, y) => {
2901
2898
  var k = jI(C, Q);
2902
2899
  g = zA(g), g = jC(g), s = Dg(n, s), hg([], [A], (Y) => {
2903
2900
  Y = Y[0];
2904
2901
  var j = `${Y.name}.${g}`;
2905
2902
  g.startsWith("@@") && (g = Symbol[g.substring(2)]), w && Y.registeredClass.pureVirtualFunctions.push(g);
2906
- function b() {
2903
+ function x() {
2907
2904
  aI(`Cannot call ${j} due to unbound types`, k);
2908
2905
  }
2909
2906
  var V = Y.registeredClass.instancePrototype, _ = V[g];
2910
- return _ === void 0 || _.overloadTable === void 0 && _.className !== Y.name && _.argCount === C - 2 ? (b.argCount = C - 2, b.className = Y.name, V[g] = b) : (bI(V, g, j), V[g].overloadTable[C - 2] = b), hg([], k, (hA) => {
2911
- var FA = PI(j, hA, Y, s, l, f);
2907
+ return _ === void 0 || _.overloadTable === void 0 && _.className !== Y.name && _.argCount === C - 2 ? (x.argCount = C - 2, x.className = Y.name, V[g] = x) : (bI(V, g, j), V[g].overloadTable[C - 2] = x), hg([], k, (hA) => {
2908
+ var FA = PI(j, hA, Y, s, l, y);
2912
2909
  return V[g].overloadTable === void 0 ? (FA.argCount = C - 2, V[g] = FA) : V[g].overloadTable[C - 2] = FA, [];
2913
2910
  }), [];
2914
2911
  });
@@ -2971,18 +2968,18 @@ return ret;
2971
2968
  var l = 32 - 8 * C;
2972
2969
  s = (Y) => Y << l >>> l;
2973
2970
  }
2974
- var w = g.includes("unsigned"), f = (Y, j) => {
2971
+ var w = g.includes("unsigned"), y = (Y, j) => {
2975
2972
  }, k;
2976
2973
  w ? k = function(Y, j) {
2977
- return f(j, this.name), j >>> 0;
2974
+ return y(j, this.name), j >>> 0;
2978
2975
  } : k = function(Y, j) {
2979
- return f(j, this.name), j;
2976
+ return y(j, this.name), j;
2980
2977
  }, Eg(A, { name: g, fromWireType: s, toWireType: k, argPackAdvance: og, readValueFromPointer: PQ(g, C, Q !== 0), destructorFunction: null });
2981
2978
  }, WQ = (A, g, C) => {
2982
2979
  var Q = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array], n = Q[g];
2983
2980
  function s(l) {
2984
- var w = H[l >> 2], f = H[l + 4 >> 2];
2985
- return new n(U.buffer, f, w);
2981
+ var w = H[l >> 2], y = H[l + 4 >> 2];
2982
+ return new n(U.buffer, y, w);
2986
2983
  }
2987
2984
  C = zA(C), Eg(A, { name: C, fromWireType: s, argPackAdvance: og, readValueFromPointer: s }, { ignoreDuplicateRegistrations: !0 });
2988
2985
  }, VQ = (A, g) => {
@@ -2992,8 +2989,8 @@ return ret;
2992
2989
  for (var n = C, s = C + Q - 1, l = 0; l < A.length; ++l) {
2993
2990
  var w = A.charCodeAt(l);
2994
2991
  if (w >= 55296 && w <= 57343) {
2995
- var f = A.charCodeAt(++l);
2996
- w = 65536 + ((w & 1023) << 10) | f & 1023;
2992
+ var y = A.charCodeAt(++l);
2993
+ w = 65536 + ((w & 1023) << 10) | y & 1023;
2997
2994
  }
2998
2995
  if (w <= 127) {
2999
2996
  if (C >= s) break;
@@ -3030,8 +3027,8 @@ return ret;
3030
3027
  s += String.fromCharCode((l & 31) << 6 | w);
3031
3028
  continue;
3032
3029
  }
3033
- var f = A[g++] & 63;
3034
- if ((l & 240) == 224 ? l = (l & 15) << 12 | w << 6 | f : l = (l & 7) << 18 | w << 12 | f << 6 | A[g++] & 63, l < 65536) s += String.fromCharCode(l);
3030
+ var y = A[g++] & 63;
3031
+ if ((l & 240) == 224 ? l = (l & 15) << 12 | w << 6 | y : l = (l & 7) << 18 | w << 12 | y << 6 | A[g++] & 63, l < 65536) s += String.fromCharCode(l);
3035
3032
  else {
3036
3033
  var k = l - 65536;
3037
3034
  s += String.fromCharCode(55296 | k >> 10, 56320 | k & 1023);
@@ -3043,29 +3040,29 @@ return ret;
3043
3040
  var C = g === "std::string";
3044
3041
  Eg(A, { name: g, fromWireType(Q) {
3045
3042
  var n = H[Q >> 2], s = Q + 4, l;
3046
- if (C) for (var w = s, f = 0; f <= n; ++f) {
3047
- var k = s + f;
3048
- if (f == n || v[k] == 0) {
3043
+ if (C) for (var w = s, y = 0; y <= n; ++y) {
3044
+ var k = s + y;
3045
+ if (y == n || v[k] == 0) {
3049
3046
  var Y = k - w, j = cI(w, Y);
3050
3047
  l === void 0 ? l = j : (l += "\0", l += j), w = k + 1;
3051
3048
  }
3052
3049
  }
3053
3050
  else {
3054
- for (var b = new Array(n), f = 0; f < n; ++f) b[f] = String.fromCharCode(v[s + f]);
3055
- l = b.join("");
3051
+ for (var x = new Array(n), y = 0; y < n; ++y) x[y] = String.fromCharCode(v[s + y]);
3052
+ l = x.join("");
3056
3053
  }
3057
3054
  return tg(Q), l;
3058
3055
  }, toWireType(Q, n) {
3059
3056
  n instanceof ArrayBuffer && (n = new Uint8Array(n));
3060
3057
  var s, l = typeof n == "string";
3061
3058
  l || n instanceof Uint8Array || n instanceof Uint8ClampedArray || n instanceof Int8Array || oA("Cannot pass non-string to std::string"), C && l ? s = XI(n) : s = n.length;
3062
- var w = $I(4 + s + 1), f = w + 4;
3063
- if (H[w >> 2] = s, C && l) VC(n, f, s + 1);
3059
+ var w = $I(4 + s + 1), y = w + 4;
3060
+ if (H[w >> 2] = s, C && l) VC(n, y, s + 1);
3064
3061
  else if (l) for (var k = 0; k < s; ++k) {
3065
3062
  var Y = n.charCodeAt(k);
3066
- Y > 255 && (tg(f), oA("String has UTF-16 code units that do not fit in 8 bits")), v[f + k] = Y;
3063
+ Y > 255 && (tg(y), oA("String has UTF-16 code units that do not fit in 8 bits")), v[y + k] = Y;
3067
3064
  }
3068
- else for (var k = 0; k < s; ++k) v[f + k] = n[k];
3065
+ else for (var k = 0; k < s; ++k) v[y + k] = n[k];
3069
3066
  return Q !== null && Q.push(tg, w), w;
3070
3067
  }, argPackAdvance: og, readValueFromPointer: iI, destructorFunction(Q) {
3071
3068
  tg(Q);
@@ -3118,18 +3115,18 @@ return ret;
3118
3115
  C = zA(C);
3119
3116
  var Q, n, s, l;
3120
3117
  g === 2 ? (Q = XQ, n = zQ, l = ZQ, s = (w) => z[w >> 1]) : g === 4 && (Q = _Q, n = $Q, l = AE, s = (w) => H[w >> 2]), Eg(A, { name: C, fromWireType: (w) => {
3121
- for (var f = H[w >> 2], k, Y = w + 4, j = 0; j <= f; ++j) {
3122
- var b = w + 4 + j * g;
3123
- if (j == f || s(b) == 0) {
3124
- var V = b - Y, _ = Q(Y, V);
3125
- k === void 0 ? k = _ : (k += "\0", k += _), Y = b + g;
3118
+ for (var y = H[w >> 2], k, Y = w + 4, j = 0; j <= y; ++j) {
3119
+ var x = w + 4 + j * g;
3120
+ if (j == y || s(x) == 0) {
3121
+ var V = x - Y, _ = Q(Y, V);
3122
+ k === void 0 ? k = _ : (k += "\0", k += _), Y = x + g;
3126
3123
  }
3127
3124
  }
3128
3125
  return tg(w), k;
3129
- }, toWireType: (w, f) => {
3130
- typeof f != "string" && oA(`Cannot pass non-string to C++ string type ${C}`);
3131
- var k = l(f), Y = $I(4 + k + g);
3132
- return H[Y >> 2] = k / g, n(f, Y + 4, k + g), w !== null && w.push(tg, Y), Y;
3126
+ }, toWireType: (w, y) => {
3127
+ typeof y != "string" && oA(`Cannot pass non-string to C++ string type ${C}`);
3128
+ var k = l(y), Y = $I(4 + k + g);
3129
+ return H[Y >> 2] = k / g, n(y, Y + 4, k + g), w !== null && w.push(tg, Y), Y;
3133
3130
  }, argPackAdvance: og, readValueFromPointer: iI, destructorFunction(w) {
3134
3131
  tg(w);
3135
3132
  } });
@@ -3253,8 +3250,8 @@ return ret;
3253
3250
  l = w;
3254
3251
  break;
3255
3252
  }
3256
- for (var f = [], w = l; w < Q.length; w++) f.push("..");
3257
- return f = f.concat(n.slice(l)), f.join("/");
3253
+ for (var y = [], w = l; w < Q.length; w++) y.push("..");
3254
+ return y = y.concat(n.slice(l)), y.join("/");
3258
3255
  } }, ZI = [];
3259
3256
  function lI(A, g, C) {
3260
3257
  var Q = XI(A) + 1, n = new Array(Q), s = OI(A, n, 0, n.length);
@@ -3442,15 +3439,15 @@ return ret;
3442
3439
  return RE.forEach((s) => {
3443
3440
  n || s.canHandle(g) && (s.handle(A, g, C, Q), n = !0);
3444
3441
  }), n;
3445
- }, NE = (A, g, C, Q, n, s, l, w, f, k) => {
3442
+ }, NE = (A, g, C, Q, n, s, l, w, y, k) => {
3446
3443
  var Y = g ? eg.resolve(lA.join2(A, g)) : A;
3447
- function j(b) {
3444
+ function j(x) {
3448
3445
  function V(_) {
3449
- k == null || k(), w || fE(A, g, _, Q, n, f), s == null || s(), Cg();
3446
+ k == null || k(), w || fE(A, g, _, Q, n, y), s == null || s(), Cg();
3450
3447
  }
3451
- FE(b, Y, V, () => {
3448
+ FE(x, Y, V, () => {
3452
3449
  l == null || l(), Cg();
3453
- }) || V(b);
3450
+ }) || V(x);
3454
3451
  }
3455
3452
  _A(), typeof C == "string" ? yE(C, j, l) : j(C);
3456
3453
  }, GE = (A) => {
@@ -3524,11 +3521,11 @@ return ret;
3524
3521
  for (var Q = A.split("/").filter((j) => !!j), n = e.root, s = "/", l = 0; l < Q.length; l++) {
3525
3522
  var w = l === Q.length - 1;
3526
3523
  if (w && g.parent) break;
3527
- if (n = e.lookupNode(n, Q[l]), s = lA.join2(s, Q[l]), e.isMountpoint(n) && (!w || w && g.follow_mount) && (n = n.mounted.root), !w || g.follow) for (var f = 0; e.isLink(n.mode); ) {
3524
+ if (n = e.lookupNode(n, Q[l]), s = lA.join2(s, Q[l]), e.isMountpoint(n) && (!w || w && g.follow_mount) && (n = n.mounted.root), !w || g.follow) for (var y = 0; e.isLink(n.mode); ) {
3528
3525
  var k = e.readlink(s);
3529
3526
  s = eg.resolve(lA.dirname(s), k);
3530
3527
  var Y = e.lookupPath(s, { recurse_count: g.recurse_count + 1 });
3531
- if (n = Y.node, f++ > 40) throw new e.ErrnoError(32);
3528
+ if (n = Y.node, y++ > 40) throw new e.ErrnoError(32);
3532
3529
  }
3533
3530
  }
3534
3531
  return { path: s, node: n };
@@ -3670,16 +3667,16 @@ return ret;
3670
3667
  if (C = l.path, s = l.node, e.isMountpoint(s)) throw new e.ErrnoError(10);
3671
3668
  if (!e.isDir(s.mode)) throw new e.ErrnoError(54);
3672
3669
  }
3673
- var w = { type: A, opts: g, mountpoint: C, mounts: [] }, f = A.mount(w);
3674
- return f.mount = w, w.root = f, Q ? e.root = f : s && (s.mounted = w, s.mount && s.mount.mounts.push(w)), f;
3670
+ var w = { type: A, opts: g, mountpoint: C, mounts: [] }, y = A.mount(w);
3671
+ return y.mount = w, w.root = y, Q ? e.root = y : s && (s.mounted = w, s.mount && s.mount.mounts.push(w)), y;
3675
3672
  }, unmount(A) {
3676
3673
  var g = e.lookupPath(A, { follow_mount: !1 });
3677
3674
  if (!e.isMountpoint(g.node)) throw new e.ErrnoError(28);
3678
3675
  var C = g.node, Q = C.mounted, n = e.getMounts(Q);
3679
3676
  Object.keys(e.nameTable).forEach((l) => {
3680
3677
  for (var w = e.nameTable[l]; w; ) {
3681
- var f = w.name_next;
3682
- n.includes(w.mount) && e.destroyNode(w), w = f;
3678
+ var y = w.name_next;
3679
+ n.includes(w.mount) && e.destroyNode(w), w = y;
3683
3680
  }
3684
3681
  }), C.mounted = null;
3685
3682
  var s = C.mount.mounts.indexOf(Q);
@@ -3717,27 +3714,27 @@ return ret;
3717
3714
  if (!Q.node_ops.symlink) throw new e.ErrnoError(63);
3718
3715
  return Q.node_ops.symlink(Q, n, A);
3719
3716
  }, rename(A, g) {
3720
- var C = lA.dirname(A), Q = lA.dirname(g), n = lA.basename(A), s = lA.basename(g), l, w, f;
3721
- if (l = e.lookupPath(A, { parent: !0 }), w = l.node, l = e.lookupPath(g, { parent: !0 }), f = l.node, !w || !f) throw new e.ErrnoError(44);
3722
- if (w.mount !== f.mount) throw new e.ErrnoError(75);
3717
+ var C = lA.dirname(A), Q = lA.dirname(g), n = lA.basename(A), s = lA.basename(g), l, w, y;
3718
+ if (l = e.lookupPath(A, { parent: !0 }), w = l.node, l = e.lookupPath(g, { parent: !0 }), y = l.node, !w || !y) throw new e.ErrnoError(44);
3719
+ if (w.mount !== y.mount) throw new e.ErrnoError(75);
3723
3720
  var k = e.lookupNode(w, n), Y = eg.relative(A, Q);
3724
3721
  if (Y.charAt(0) !== ".") throw new e.ErrnoError(28);
3725
3722
  if (Y = eg.relative(g, C), Y.charAt(0) !== ".") throw new e.ErrnoError(55);
3726
3723
  var j;
3727
3724
  try {
3728
- j = e.lookupNode(f, s);
3725
+ j = e.lookupNode(y, s);
3729
3726
  } catch {
3730
3727
  }
3731
3728
  if (k !== j) {
3732
- var b = e.isDir(k.mode), V = e.mayDelete(w, n, b);
3729
+ var x = e.isDir(k.mode), V = e.mayDelete(w, n, x);
3733
3730
  if (V) throw new e.ErrnoError(V);
3734
- if (V = j ? e.mayDelete(f, s, b) : e.mayCreate(f, s), V) throw new e.ErrnoError(V);
3731
+ if (V = j ? e.mayDelete(y, s, x) : e.mayCreate(y, s), V) throw new e.ErrnoError(V);
3735
3732
  if (!w.node_ops.rename) throw new e.ErrnoError(63);
3736
3733
  if (e.isMountpoint(k) || j && e.isMountpoint(j)) throw new e.ErrnoError(10);
3737
- if (f !== w && (V = e.nodePermissions(w, "w"), V)) throw new e.ErrnoError(V);
3734
+ if (y !== w && (V = e.nodePermissions(w, "w"), V)) throw new e.ErrnoError(V);
3738
3735
  e.hashRemoveNode(k);
3739
3736
  try {
3740
- w.node_ops.rename(k, f, s);
3737
+ w.node_ops.rename(k, y, s);
3741
3738
  } catch (_) {
3742
3739
  throw _;
3743
3740
  } finally {
@@ -3991,15 +3988,15 @@ return ret;
3991
3988
  }, createDataFile(A, g, C, Q, n, s) {
3992
3989
  var l = g;
3993
3990
  A && (A = typeof A == "string" ? A : e.getPath(A), l = g ? lA.join2(A, g) : A);
3994
- var w = _I(Q, n), f = e.create(l, w);
3991
+ var w = _I(Q, n), y = e.create(l, w);
3995
3992
  if (C) {
3996
3993
  if (typeof C == "string") {
3997
3994
  for (var k = new Array(C.length), Y = 0, j = C.length; Y < j; ++Y) k[Y] = C.charCodeAt(Y);
3998
3995
  C = k;
3999
3996
  }
4000
- e.chmod(f, w | 146);
4001
- var b = e.open(f, 577);
4002
- e.write(b, C, 0, C.length, 0, s), e.close(b), e.chmod(f, w);
3997
+ e.chmod(y, w | 146);
3998
+ var x = e.open(y, 577);
3999
+ e.write(x, C, 0, C.length, 0, s), e.close(x), e.chmod(y, w);
4003
4000
  }
4004
4001
  }, createDevice(A, g, C, Q) {
4005
4002
  var n = lA.join2(typeof A == "string" ? A : e.getPath(A), g), s = _I(!!C, !!Q);
@@ -4008,28 +4005,28 @@ return ret;
4008
4005
  return e.registerDevice(l, { open(w) {
4009
4006
  w.seekable = !1;
4010
4007
  }, close(w) {
4011
- var f;
4012
- (f = Q == null ? void 0 : Q.buffer) != null && f.length && Q(10);
4013
- }, read(w, f, k, Y, j) {
4014
- for (var b = 0, V = 0; V < Y; V++) {
4008
+ var y;
4009
+ (y = Q == null ? void 0 : Q.buffer) != null && y.length && Q(10);
4010
+ }, read(w, y, k, Y, j) {
4011
+ for (var x = 0, V = 0; V < Y; V++) {
4015
4012
  var _;
4016
4013
  try {
4017
4014
  _ = C();
4018
4015
  } catch {
4019
4016
  throw new e.ErrnoError(29);
4020
4017
  }
4021
- if (_ === void 0 && b === 0) throw new e.ErrnoError(6);
4018
+ if (_ === void 0 && x === 0) throw new e.ErrnoError(6);
4022
4019
  if (_ == null) break;
4023
- b++, f[k + V] = _;
4020
+ x++, y[k + V] = _;
4024
4021
  }
4025
- return b && (w.node.timestamp = Date.now()), b;
4026
- }, write(w, f, k, Y, j) {
4027
- for (var b = 0; b < Y; b++) try {
4028
- Q(f[k + b]);
4022
+ return x && (w.node.timestamp = Date.now()), x;
4023
+ }, write(w, y, k, Y, j) {
4024
+ for (var x = 0; x < Y; x++) try {
4025
+ Q(y[k + x]);
4029
4026
  } catch {
4030
4027
  throw new e.ErrnoError(29);
4031
4028
  }
4032
- return Y && (w.node.timestamp = Date.now()), b;
4029
+ return Y && (w.node.timestamp = Date.now()), x;
4033
4030
  } }), e.mkdev(n, s, l);
4034
4031
  }, forceLoadFile(A) {
4035
4032
  if (A.isDevice || A.isFolder || A.link || A.contents) return !0;
@@ -4062,13 +4059,13 @@ return ret;
4062
4059
  var T = (sA, VA) => {
4063
4060
  if (sA > VA) throw new Error("invalid range (" + sA + ", " + VA + ") or no bytes requested!");
4064
4061
  if (VA > _ - 1) throw new Error("only " + _ + " bytes available! programmer error!");
4065
- var NA = new XMLHttpRequest();
4066
- if (NA.open("GET", C, !1), _ !== L && NA.setRequestHeader("Range", "bytes=" + sA + "-" + VA), NA.responseType = "arraybuffer", NA.overrideMimeType && NA.overrideMimeType("text/plain; charset=x-user-defined"), NA.send(null), !(NA.status >= 200 && NA.status < 300 || NA.status === 304)) throw new Error("Couldn't load " + C + ". Status: " + NA.status);
4067
- return NA.response !== void 0 ? new Uint8Array(NA.response || []) : lI(NA.responseText || "", !0);
4062
+ var GA = new XMLHttpRequest();
4063
+ if (GA.open("GET", C, !1), _ !== L && GA.setRequestHeader("Range", "bytes=" + sA + "-" + VA), GA.responseType = "arraybuffer", GA.overrideMimeType && GA.overrideMimeType("text/plain; charset=x-user-defined"), GA.send(null), !(GA.status >= 200 && GA.status < 300 || GA.status === 304)) throw new Error("Couldn't load " + C + ". Status: " + GA.status);
4064
+ return GA.response !== void 0 ? new Uint8Array(GA.response || []) : lI(GA.responseText || "", !0);
4068
4065
  }, UA = this;
4069
4066
  UA.setDataGetter((sA) => {
4070
- var VA = sA * L, NA = (sA + 1) * L - 1;
4071
- if (NA = Math.min(NA, _ - 1), typeof UA.chunks[sA] > "u" && (UA.chunks[sA] = T(VA, NA)), typeof UA.chunks[sA] > "u") throw new Error("doXHR failed!");
4067
+ var VA = sA * L, GA = (sA + 1) * L - 1;
4068
+ if (GA = Math.min(GA, _ - 1), typeof UA.chunks[sA] > "u" && (UA.chunks[sA] = T(VA, GA)), typeof UA.chunks[sA] > "u") throw new Error("doXHR failed!");
4072
4069
  return UA.chunks[sA];
4073
4070
  }), (LA || !_) && (L = _ = 1, _ = this.getter(0).length, L = _, K("LazyFiles on gzip forces download of the whole file when length is accessed")), this._length = _, this._chunkSize = L, this.lengthKnown = !0;
4074
4071
  }
@@ -4083,29 +4080,29 @@ return ret;
4083
4080
  if (!D) throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";
4084
4081
  var l = new s(), w = { isDevice: !1, contents: l };
4085
4082
  } else var w = { isDevice: !1, url: C };
4086
- var f = e.createFile(A, g, w, Q, n);
4087
- w.contents ? f.contents = w.contents : w.url && (f.contents = null, f.url = w.url), Object.defineProperties(f, { usedBytes: { get: function() {
4083
+ var y = e.createFile(A, g, w, Q, n);
4084
+ w.contents ? y.contents = w.contents : w.url && (y.contents = null, y.url = w.url), Object.defineProperties(y, { usedBytes: { get: function() {
4088
4085
  return this.contents.length;
4089
4086
  } } });
4090
- var k = {}, Y = Object.keys(f.stream_ops);
4091
- Y.forEach((b) => {
4092
- var V = f.stream_ops[b];
4093
- k[b] = (..._) => (e.forceLoadFile(f), V(..._));
4087
+ var k = {}, Y = Object.keys(y.stream_ops);
4088
+ Y.forEach((x) => {
4089
+ var V = y.stream_ops[x];
4090
+ k[x] = (..._) => (e.forceLoadFile(y), V(..._));
4094
4091
  });
4095
- function j(b, V, _, hA, FA) {
4096
- var LA = b.node.contents;
4092
+ function j(x, V, _, hA, FA) {
4093
+ var LA = x.node.contents;
4097
4094
  if (FA >= LA.length) return 0;
4098
4095
  var L = Math.min(LA.length - FA, hA);
4099
4096
  if (LA.slice) for (var T = 0; T < L; T++) V[_ + T] = LA[FA + T];
4100
4097
  else for (var T = 0; T < L; T++) V[_ + T] = LA.get(FA + T);
4101
4098
  return L;
4102
4099
  }
4103
- return k.read = (b, V, _, hA, FA) => (e.forceLoadFile(f), j(b, V, _, hA, FA)), k.mmap = (b, V, _, hA, FA) => {
4104
- e.forceLoadFile(f);
4100
+ return k.read = (x, V, _, hA, FA) => (e.forceLoadFile(y), j(x, V, _, hA, FA)), k.mmap = (x, V, _, hA, FA) => {
4101
+ e.forceLoadFile(y);
4105
4102
  var LA = CB(V);
4106
4103
  if (!LA) throw new e.ErrnoError(48);
4107
- return j(b, U, LA, V, _), { ptr: LA, allocated: !0 };
4108
- }, f.stream_ops = k, f;
4104
+ return j(x, U, LA, V, _), { ptr: LA, allocated: !0 };
4105
+ }, y.stream_ops = k, y;
4109
4106
  } }, Xg = { DEFAULT_POLLMASK: 5, calculateAt(A, g, C) {
4110
4107
  if (lA.isAbs(g)) return g;
4111
4108
  var Q;
@@ -4149,9 +4146,9 @@ return ret;
4149
4146
  for (var n = 0, s = 0; s < C; s++) {
4150
4147
  var l = H[g >> 2], w = H[g + 4 >> 2];
4151
4148
  g += 8;
4152
- var f = e.read(A, U, l, w, Q);
4153
- if (f < 0) return -1;
4154
- if (n += f, f < w) break;
4149
+ var y = e.read(A, U, l, w, Q);
4150
+ if (y < 0) return -1;
4151
+ if (n += y, y < w) break;
4155
4152
  }
4156
4153
  return n;
4157
4154
  };
@@ -4180,9 +4177,9 @@ return ret;
4180
4177
  for (var n = 0, s = 0; s < C; s++) {
4181
4178
  var l = H[g >> 2], w = H[g + 4 >> 2];
4182
4179
  g += 8;
4183
- var f = e.write(A, U, l, w, Q);
4184
- if (f < 0) return -1;
4185
- n += f;
4180
+ var y = e.write(A, U, l, w, Q);
4181
+ if (y < 0) return -1;
4182
+ n += y;
4186
4183
  }
4187
4184
  return n;
4188
4185
  };
@@ -4209,13 +4206,13 @@ return ret;
4209
4206
  U.set(A, g);
4210
4207
  }, KE = (A, g, C, Q) => {
4211
4208
  var n = H[Q + 40 >> 2], s = { tm_sec: J[Q >> 2], tm_min: J[Q + 4 >> 2], tm_hour: J[Q + 8 >> 2], tm_mday: J[Q + 12 >> 2], tm_mon: J[Q + 16 >> 2], tm_year: J[Q + 20 >> 2], tm_wday: J[Q + 24 >> 2], tm_yday: J[Q + 28 >> 2], tm_isdst: J[Q + 32 >> 2], tm_gmtoff: J[Q + 36 >> 2], tm_zone: n ? cI(n) : "" }, l = cI(C), w = { "%c": "%a %b %d %H:%M:%S %Y", "%D": "%m/%d/%y", "%F": "%Y-%m-%d", "%h": "%b", "%r": "%I:%M:%S %p", "%R": "%H:%M", "%T": "%H:%M:%S", "%x": "%m/%d/%y", "%X": "%H:%M:%S", "%Ec": "%c", "%EC": "%C", "%Ex": "%m/%d/%y", "%EX": "%H:%M:%S", "%Ey": "%y", "%EY": "%Y", "%Od": "%d", "%Oe": "%e", "%OH": "%H", "%OI": "%I", "%Om": "%m", "%OM": "%M", "%OS": "%S", "%Ou": "%u", "%OU": "%U", "%OV": "%V", "%Ow": "%w", "%OW": "%W", "%Oy": "%y" };
4212
- for (var f in w) l = l.replace(new RegExp(f, "g"), w[f]);
4209
+ for (var y in w) l = l.replace(new RegExp(y, "g"), w[y]);
4213
4210
  var k = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], Y = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
4214
4211
  function j(L, T, UA) {
4215
4212
  for (var sA = typeof L == "number" ? L.toString() : L || ""; sA.length < T; ) sA = UA[0] + sA;
4216
4213
  return sA;
4217
4214
  }
4218
- function b(L, T) {
4215
+ function x(L, T) {
4219
4216
  return j(L, T, "0");
4220
4217
  }
4221
4218
  function V(L, T) {
@@ -4244,19 +4241,19 @@ return ret;
4244
4241
  }
4245
4242
  }
4246
4243
  function hA(L) {
4247
- var T = HE(new Date(L.tm_year + 1900, 0, 1), L.tm_yday), UA = new Date(T.getFullYear(), 0, 4), sA = new Date(T.getFullYear() + 1, 0, 4), VA = _(UA), NA = _(sA);
4248
- return V(VA, T) <= 0 ? V(NA, T) <= 0 ? T.getFullYear() + 1 : T.getFullYear() : T.getFullYear() - 1;
4244
+ var T = HE(new Date(L.tm_year + 1900, 0, 1), L.tm_yday), UA = new Date(T.getFullYear(), 0, 4), sA = new Date(T.getFullYear() + 1, 0, 4), VA = _(UA), GA = _(sA);
4245
+ return V(VA, T) <= 0 ? V(GA, T) <= 0 ? T.getFullYear() + 1 : T.getFullYear() : T.getFullYear() - 1;
4249
4246
  }
4250
4247
  var FA = { "%a": (L) => k[L.tm_wday].substring(0, 3), "%A": (L) => k[L.tm_wday], "%b": (L) => Y[L.tm_mon].substring(0, 3), "%B": (L) => Y[L.tm_mon], "%C": (L) => {
4251
4248
  var T = L.tm_year + 1900;
4252
- return b(T / 100 | 0, 2);
4253
- }, "%d": (L) => b(L.tm_mday, 2), "%e": (L) => j(L.tm_mday, 2, " "), "%g": (L) => hA(L).toString().substring(2), "%G": hA, "%H": (L) => b(L.tm_hour, 2), "%I": (L) => {
4249
+ return x(T / 100 | 0, 2);
4250
+ }, "%d": (L) => x(L.tm_mday, 2), "%e": (L) => j(L.tm_mday, 2, " "), "%g": (L) => hA(L).toString().substring(2), "%G": hA, "%H": (L) => x(L.tm_hour, 2), "%I": (L) => {
4254
4251
  var T = L.tm_hour;
4255
- return T == 0 ? T = 12 : T > 12 && (T -= 12), b(T, 2);
4256
- }, "%j": (L) => b(L.tm_mday + YE(dI(L.tm_year + 1900) ? BB : QB, L.tm_mon - 1), 3), "%m": (L) => b(L.tm_mon + 1, 2), "%M": (L) => b(L.tm_min, 2), "%n": () => `
4257
- `, "%p": (L) => L.tm_hour >= 0 && L.tm_hour < 12 ? "AM" : "PM", "%S": (L) => b(L.tm_sec, 2), "%t": () => " ", "%u": (L) => L.tm_wday || 7, "%U": (L) => {
4252
+ return T == 0 ? T = 12 : T > 12 && (T -= 12), x(T, 2);
4253
+ }, "%j": (L) => x(L.tm_mday + YE(dI(L.tm_year + 1900) ? BB : QB, L.tm_mon - 1), 3), "%m": (L) => x(L.tm_mon + 1, 2), "%M": (L) => x(L.tm_min, 2), "%n": () => `
4254
+ `, "%p": (L) => L.tm_hour >= 0 && L.tm_hour < 12 ? "AM" : "PM", "%S": (L) => x(L.tm_sec, 2), "%t": () => " ", "%u": (L) => L.tm_wday || 7, "%U": (L) => {
4258
4255
  var T = L.tm_yday + 7 - L.tm_wday;
4259
- return b(Math.floor(T / 7), 2);
4256
+ return x(Math.floor(T / 7), 2);
4260
4257
  }, "%V": (L) => {
4261
4258
  var T = Math.floor((L.tm_yday + 7 - (L.tm_wday + 6) % 7) / 7);
4262
4259
  if ((L.tm_wday + 371 - L.tm_yday - 2) % 7 <= 2 && T++, T) {
@@ -4269,16 +4266,16 @@ return ret;
4269
4266
  var sA = (L.tm_wday + 7 - L.tm_yday - 1) % 7;
4270
4267
  (sA == 4 || sA == 5 && dI(L.tm_year % 400 - 1)) && T++;
4271
4268
  }
4272
- return b(T, 2);
4269
+ return x(T, 2);
4273
4270
  }, "%w": (L) => L.tm_wday, "%W": (L) => {
4274
4271
  var T = L.tm_yday + 7 - (L.tm_wday + 6) % 7;
4275
- return b(Math.floor(T / 7), 2);
4272
+ return x(Math.floor(T / 7), 2);
4276
4273
  }, "%y": (L) => (L.tm_year + 1900).toString().substring(2), "%Y": (L) => L.tm_year + 1900, "%z": (L) => {
4277
4274
  var T = L.tm_gmtoff, UA = T >= 0;
4278
4275
  return T = Math.abs(T) / 60, T = T / 60 * 100 + T % 60, (UA ? "+" : "-") + ("0000" + T).slice(-4);
4279
4276
  }, "%Z": (L) => L.tm_zone, "%%": () => "%" };
4280
4277
  l = l.replace(/%%/g, "\0\0");
4281
- for (var f in FA) l.includes(f) && (l = l.replace(new RegExp(f, "g"), FA[f](s)));
4278
+ for (var y in FA) l.includes(y) && (l = l.replace(new RegExp(y, "g"), FA[y](s)));
4282
4279
  l = l.replace(/\0\0/g, "%");
4283
4280
  var LA = lI(l, !1);
4284
4281
  return LA.length > g ? 0 : (mE(LA, A), LA.length - 1);
@@ -4293,7 +4290,7 @@ return ret;
4293
4290
  }
4294
4291
  }, lQ(), rQ(), FQ(), bC = i.UnboundTypeError = LQ(Error, "UnboundTypeError"), qQ(), e.createPreloadedFile = NE, e.staticInit();
4295
4292
  var qE = { t: $B, f: gQ, x: IQ, p: CQ, k: EQ, j: UQ, d: YQ, o: HQ, c: mQ, E: WC, i: TQ, b: jQ, a: WQ, y: VQ, h: OQ, e: gE, l: IE, v: CE, w: BE, u: QE, m: eE, r: rE, s: sE, B: lE, C: dE, A: kE, z: LE, n: ME, g: JE, D: AB, q: vE }, bA = _B(), EB = (A) => (EB = bA.H)(A), $I = (A) => ($I = bA.J)(A), tg = (A) => (tg = bA.K)(A), eB = (A, g) => (eB = bA.L)(A, g), tB = (A, g) => (tB = bA.M)(A, g), oB = (A) => (oB = bA.N)(A);
4296
- i.dynCall_jiji = (A, g, C, Q, n) => (i.dynCall_jiji = bA.O)(A, g, C, Q, n), i.dynCall_viijii = (A, g, C, Q, n, s, l) => (i.dynCall_viijii = bA.P)(A, g, C, Q, n, s, l), i.dynCall_iiiiij = (A, g, C, Q, n, s, l) => (i.dynCall_iiiiij = bA.Q)(A, g, C, Q, n, s, l), i.dynCall_iiiiijj = (A, g, C, Q, n, s, l, w, f) => (i.dynCall_iiiiijj = bA.R)(A, g, C, Q, n, s, l, w, f), i.dynCall_iiiiiijj = (A, g, C, Q, n, s, l, w, f, k) => (i.dynCall_iiiiiijj = bA.S)(A, g, C, Q, n, s, l, w, f, k);
4293
+ i.dynCall_jiji = (A, g, C, Q, n) => (i.dynCall_jiji = bA.O)(A, g, C, Q, n), i.dynCall_viijii = (A, g, C, Q, n, s, l) => (i.dynCall_viijii = bA.P)(A, g, C, Q, n, s, l), i.dynCall_iiiiij = (A, g, C, Q, n, s, l) => (i.dynCall_iiiiij = bA.Q)(A, g, C, Q, n, s, l), i.dynCall_iiiiijj = (A, g, C, Q, n, s, l, w, y) => (i.dynCall_iiiiijj = bA.R)(A, g, C, Q, n, s, l, w, y), i.dynCall_iiiiiijj = (A, g, C, Q, n, s, l, w, y, k) => (i.dynCall_iiiiiijj = bA.S)(A, g, C, Q, n, s, l, w, y, k);
4297
4294
  var wI;
4298
4295
  rA = function A() {
4299
4296
  wI || nB(), wI || (rA = A);
@@ -4356,7 +4353,7 @@ const ho = [
4356
4353
  },
4357
4354
  r.content
4358
4355
  ), B = (o, r, a) => {
4359
- const { title: i, content: h, modalClass: d } = r, c = iC(i) ? I(o, r) : i, y = iC(h) ? E(o, r) : h, D = [
4356
+ const { title: i, content: h, modalClass: d } = r, c = iC(i) ? I(o, r) : i, f = iC(h) ? E(o, r) : h, D = [
4360
4357
  "common-modal",
4361
4358
  ["info", "success", "warning", "error", "confirm", "syncConfirm"].includes(o) && `common-modal__${o}`,
4362
4359
  r.hideHeaderBorder !== !1 && "hide-header-border"
@@ -4368,7 +4365,7 @@ const ho = [
4368
4365
  draggable: !0,
4369
4366
  ...co(r, ["title", "content", "modalClass"]),
4370
4367
  title: c,
4371
- content: y,
4368
+ content: f,
4372
4369
  class: D,
4373
4370
  modalClass: iC(d) || Array.isArray(d) ? d : ""
4374
4371
  };
@@ -4469,7 +4466,7 @@ const ho = [
4469
4466
  if (q(I) || q(I.editorCore.value)) return;
4470
4467
  const { cursor: h, content: d } = I.editorCore.value, { range: c } = h;
4471
4468
  if (q(c)) return;
4472
- const { startContainer: y, endContainer: D, startOffset: u, endOffset: R } = c, F = WA(c.startContainer), M = WA(c.endContainer), G = hC(F, M), S = d.getParas(), p = F === M;
4469
+ const { startContainer: f, endContainer: D, startOffset: u, endOffset: R } = c, F = WA(c.startContainer), M = WA(c.endContainer), G = hC(F, M), S = d.getParas(), p = F === M;
4473
4470
  B({
4474
4471
  index: S.indexOf(F),
4475
4472
  offset: p && u > R ? R : u
@@ -4501,16 +4498,16 @@ const ho = [
4501
4498
  (AA = I.editorCore.value) == null || AA.content.update(kA);
4502
4499
  };
4503
4500
  if (F === M) {
4504
- const X = $(y) && y.tagName === "P";
4501
+ const X = $(f) && f.tagName === "P";
4505
4502
  P(
4506
- X ? y.firstChild : y,
4503
+ X ? f.firstChild : f,
4507
4504
  X ? 0 : u,
4508
4505
  D,
4509
4506
  R
4510
4507
  );
4511
4508
  return;
4512
4509
  }
4513
- P(y, u, F, F.childNodes.length), G.forEach((X) => P(X, 0, X, X.childNodes.length)), P(M.firstChild, 0, D, R);
4510
+ P(f, u, F, F.childNodes.length), G.forEach((X) => P(X, 0, X, X.childNodes.length)), P(M.firstChild, 0, D, R);
4514
4511
  }, a = () => {
4515
4512
  var d;
4516
4513
  Array.from(
@@ -4521,7 +4518,7 @@ const ho = [
4521
4518
  highlightRange: r,
4522
4519
  unhighlightRange: a,
4523
4520
  revertRange: () => {
4524
- var y, D;
4521
+ var f, D;
4525
4522
  if (q(I) || q(I.editorCore.value)) return;
4526
4523
  a();
4527
4524
  const { content: h } = I.editorCore.value, d = h.getParas(), c = document.createRange();
@@ -4531,7 +4528,7 @@ const ho = [
4531
4528
  ), c.setEnd(
4532
4529
  d[t.value.index].firstChild,
4533
4530
  t.value.offset ?? 0
4534
- ), (y = getSelection()) == null || y.removeAllRanges(), (D = getSelection()) == null || D.addRange(c), I.editorCore.value.cursor._recordRange();
4531
+ ), (f = getSelection()) == null || f.removeAllRanges(), (D = getSelection()) == null || D.addRange(c), I.editorCore.value.cursor._recordRange();
4535
4532
  }
4536
4533
  };
4537
4534
  }, Ro = (I, E, B) => {
@@ -4549,12 +4546,12 @@ const ho = [
4549
4546
  onChange: (U) => {
4550
4547
  var v;
4551
4548
  r.value = U, a.value = !!((v = t.value) != null && v.element.querySelector(
4552
- `span[data-type=${x.pausation}]`
4549
+ `span[data-type=${b.pausation}]`
4553
4550
  )), B("update:textCount", U), B("change", U);
4554
4551
  },
4555
4552
  onUndoChange: (U) => {
4556
4553
  var v;
4557
- q((v = o.value.plugin[x.anchor]) == null ? void 0 : v.data) || (o.value.plugin[x.anchor].data = JSON.parse(U));
4554
+ q((v = o.value.plugin[b.anchor]) == null ? void 0 : v.data) || (o.value.plugin[b.anchor].data = JSON.parse(U));
4558
4555
  }
4559
4556
  }), o.value = {
4560
4557
  base: {
@@ -4564,16 +4561,16 @@ const ho = [
4564
4561
  command: t.value.command
4565
4562
  },
4566
4563
  plugin: {
4567
- [x.pausation]: t.value.plugin.pausation,
4568
- [x.pronunciation]: t.value.plugin.pronunciation,
4569
- [x.homophones]: t.value.plugin.homophones,
4570
- [x.anchor]: t.value.plugin.anchor
4564
+ [b.pausation]: t.value.plugin.pausation,
4565
+ [b.pronunciation]: t.value.plugin.pronunciation,
4566
+ [b.homophones]: t.value.plugin.homophones,
4567
+ [b.anchor]: t.value.plugin.anchor
4571
4568
  }
4572
4569
  }, i = new MutationObserver(([U]) => {
4573
4570
  var v, O;
4574
- Object.keys(((O = (v = o.value) == null ? void 0 : v.plugin[x.anchor]) == null ? void 0 : O.data) ?? []).forEach((z) => {
4571
+ Object.keys(((O = (v = o.value) == null ? void 0 : v.plugin[b.anchor]) == null ? void 0 : O.data) ?? []).forEach((z) => {
4575
4572
  var wA, RA;
4576
- const J = ((RA = (wA = o.value) == null ? void 0 : wA.plugin[x.anchor]) == null ? void 0 : RA.data[z]) ?? [], [H, dA] = J.reduce(
4573
+ const J = ((RA = (wA = o.value) == null ? void 0 : wA.plugin[b.anchor]) == null ? void 0 : RA.data[z]) ?? [], [H, dA] = J.reduce(
4577
4574
  (Z, eA) => {
4578
4575
  const BA = Array.from(
4579
4576
  document.body.querySelectorAll(`span[data-frag-id="anchor_${eA.id}"]`)
@@ -4582,14 +4579,14 @@ const ho = [
4582
4579
  },
4583
4580
  [[], []]
4584
4581
  );
4585
- o.value.plugin[x.anchor].data[z] = H, dA.forEach((Z) => B("anchorRemove", Z.data));
4582
+ o.value.plugin[b.anchor].data[z] = H, dA.forEach((Z) => B("anchorRemove", Z.data));
4586
4583
  });
4587
4584
  }), i.observe(I.value, {
4588
4585
  childList: !0,
4589
4586
  subtree: !0,
4590
4587
  characterData: !0
4591
4588
  });
4592
- }, y = () => {
4589
+ }, f = () => {
4593
4590
  var U;
4594
4591
  (U = t.value) == null || U.destroy(), t.value = void 0, o.value = void 0, i == null || i.disconnect(), i = null;
4595
4592
  }, D = (U) => {
@@ -4605,7 +4602,7 @@ const ho = [
4605
4602
  var z;
4606
4603
  const U = (z = o.value) == null ? void 0 : z.base.cursor.range;
4607
4604
  if (q(U)) return !1;
4608
- const [v] = PA(U.startContainer, (J) => J.tagName === "P" && J.classList.contains(GA)), [O] = PA(U.endContainer, (J) => J.tagName === "P" && J.classList.contains(GA));
4605
+ const [v] = PA(U.startContainer, (J) => J.tagName === "P" && J.classList.contains(NA)), [O] = PA(U.endContainer, (J) => J.tagName === "P" && J.classList.contains(NA));
4609
4606
  return !(q(v) || q(O) || v === O);
4610
4607
  }, X = (U) => {
4611
4608
  var J, H;
@@ -4613,7 +4610,7 @@ const ho = [
4613
4610
  return q(v) || q(O) || q(z) ? !1 : z.some((dA) => v.intersectsNode(dA));
4614
4611
  }, K = (U) => {
4615
4612
  var v;
4616
- return HA(U) ? ((v = U.textContent) == null ? void 0 : v.replace(/</g, "&lt;").replace(/>/g, "&gt;")) ?? "" : U.dataset.type === x.pausation ? `<break time="${Number(U.dataset.value) * 1e3}"/>` : U.dataset.type === x.pronunciation ? U.dataset.value : U.dataset.type === x.highlight ? U.dataset.raw : U.dataset.type === x.homophones ? `<phoneme alphabet="py" ph="${U.dataset.formattedValue}">${U.dataset.raw}</phoneme>` : "";
4613
+ return HA(U) ? ((v = U.textContent) == null ? void 0 : v.replace(/</g, "&lt;").replace(/>/g, "&gt;")) ?? "" : U.dataset.type === b.pausation ? `<break time="${Number(U.dataset.value) * 1e3}"/>` : U.dataset.type === b.pronunciation ? U.dataset.value : U.dataset.type === b.highlight ? U.dataset.raw : U.dataset.type === b.homophones ? `<phoneme alphabet="py" ph="${U.dataset.formattedValue}">${U.dataset.raw}</phoneme>` : "";
4617
4614
  }, W = (U, v) => {
4618
4615
  var wA;
4619
4616
  const O = Le(U);
@@ -4622,7 +4619,7 @@ const ho = [
4622
4619
  const J = (wA = t.value) == null ? void 0 : wA.cursor.range;
4623
4620
  let H = -1;
4624
4621
  if (v && (J != null && J.collapse)) {
4625
- const [RA] = PA(J == null ? void 0 : J.startContainer, (Z) => $(Z) && Z.dataset.type === x.anchor);
4622
+ const [RA] = PA(J == null ? void 0 : J.startContainer, (Z) => $(Z) && Z.dataset.type === b.anchor);
4626
4623
  H = O.findIndex((Z) => Z === RA), z = H > -1 ? O.slice(H) : O;
4627
4624
  }
4628
4625
  return z.map((RA, Z) => {
@@ -4645,7 +4642,7 @@ const ho = [
4645
4642
  var J;
4646
4643
  return (J = z.textContent) == null ? void 0 : J.trim();
4647
4644
  }
4648
- ).map((z) => Array.from(z.childNodes)).flat().every((z) => HA(z) && ["", " ", null].includes(z.textContent) || $(z) && z.dataset.type === x.anchor || $(z) && z.tagName === "BR");
4645
+ ).map((z) => Array.from(z.childNodes)).flat().every((z) => HA(z) && ["", " ", null].includes(z.textContent) || $(z) && z.dataset.type === b.anchor || $(z) && z.tagName === "BR");
4649
4646
  }, nA = (U) => {
4650
4647
  U.forEach((v) => {
4651
4648
  var z;
@@ -4659,7 +4656,7 @@ const ho = [
4659
4656
  u(""), B("clear"), setTimeout(() => {
4660
4657
  var J, H;
4661
4658
  const U = window.getSelection(), v = U != null && U.rangeCount ? U == null ? void 0 : U.getRangeAt(0) : null;
4662
- if (q(U) || v && $(v.commonAncestorContainer) && v.commonAncestorContainer.classList.contains(GA))
4659
+ if (q(U) || v && $(v.commonAncestorContainer) && v.commonAncestorContainer.classList.contains(NA))
4663
4660
  return;
4664
4661
  const O = document.createRange(), z = (H = (J = t.value) == null ? void 0 : J.content.getParas()) == null ? void 0 : H[0];
4665
4662
  q(z) || (O.selectNodeContents(z), O.collapse(!1), U.removeAllRanges(), U.addRange(O));
@@ -4687,7 +4684,7 @@ const ho = [
4687
4684
  }
4688
4685
  YI(t.value, JI(t.value, v));
4689
4686
  };
4690
- return mg(c), RB(y), {
4687
+ return mg(c), RB(f), {
4691
4688
  editorCore: t,
4692
4689
  editorAction: o,
4693
4690
  count: r,
@@ -4718,21 +4715,21 @@ const ho = [
4718
4715
  setup(I) {
4719
4716
  const [E] = ZA("quick-context-menu"), B = gg(fg), { x: t, y: o } = HI(), r = (G, S) => {
4720
4717
  var p, m;
4721
- (m = (p = B == null ? void 0 : B.editorAction.value) == null ? void 0 : p.plugin.pausation) == null || m.add({ delay: S }), y(!1);
4718
+ (m = (p = B == null ? void 0 : B.editorAction.value) == null ? void 0 : p.plugin.pausation) == null || m.add({ delay: S }), f(!1);
4722
4719
  }, a = async () => {
4723
4720
  let G = "", S = [];
4724
4721
  G = await (window.microApp ? window.rawWindow.navigator : window.navigator).clipboard.readText(), S = (G == null ? void 0 : G.split(/(?:\r?\n){2,}/).map((m) => m.trim()).filter((m) => m)) ?? [], YI(
4725
4722
  B.editorCore.value,
4726
4723
  JI(B.editorCore.value, S)
4727
- ), y(!1);
4728
- }, i = yA(), h = yA(!1), d = yA({ zIndex: -10 }), c = Qe(), y = (G) => {
4724
+ ), f(!1);
4725
+ }, i = yA(), h = yA(!1), d = yA({ zIndex: -10 }), c = Qe(), f = (G) => {
4729
4726
  h.value = G ?? !h.value, F(!1);
4730
4727
  }, D = (G) => {
4731
4728
  const S = G.target, [p] = PA(S, (m) => m.classList.contains(ko));
4732
- p && (G.preventDefault(), G.stopPropagation(), d.value = { top: `${o.value}px`, left: `${t.value}px` }, y(!0));
4729
+ p && (G.preventDefault(), G.stopPropagation(), d.value = { top: `${o.value}px`, left: `${t.value}px` }, f(!0));
4733
4730
  }, u = (G) => {
4734
4731
  var S;
4735
- (S = i.value) != null && S.contains(G.target) || (d.value = { zIndex: -10 }, y(!1));
4732
+ (S = i.value) != null && S.contains(G.target) || (d.value = { zIndex: -10 }, f(!1));
4736
4733
  }, R = yA(), F = (G) => {
4737
4734
  var S;
4738
4735
  (S = R.value) == null || S.$el.setAttribute("style", G ? "display: block" : "display: none");
@@ -5032,23 +5029,23 @@ const nn = /* @__PURE__ */ JA(en, [["render", on]]), jB = () => {
5032
5029
  if (q(E) || q(E.editorCore.value)) return;
5033
5030
  const d = (P) => {
5034
5031
  const X = document.createElement("p");
5035
- return X.textContent = P, X.classList.add(GA), X;
5032
+ return X.textContent = P, X.classList.add(NA), X;
5036
5033
  };
5037
5034
  B.revertRange();
5038
5035
  const {
5039
5036
  range: c
5040
5037
  } = E.editorCore.value.cursor;
5041
5038
  if (q(c)) return;
5042
- const y = WA(c.endContainer);
5043
- if (q(y) || q(y.parentNode)) return;
5039
+ const f = WA(c.endContainer);
5040
+ if (q(f) || q(f.parentNode)) return;
5044
5041
  const D = document.createRange();
5045
- D.setStart(c.endContainer, c.endOffset), D.setEndAfter(y);
5042
+ D.setStart(c.endContainer, c.endOffset), D.setEndAfter(f);
5046
5043
  const u = D.extractContents(), R = (((m = B.activedContent.value) == null ? void 0 : m.content) ?? "").split($g), F = document.createDocumentFragment();
5047
5044
  R.forEach((P) => {
5048
5045
  F.appendChild(d(P));
5049
5046
  });
5050
- const M = F.lastChild, G = y.parentNode;
5051
- G.insertBefore(F, y.nextSibling), G.insertBefore(u, M.nextSibling);
5047
+ const M = F.lastChild, G = f.parentNode;
5048
+ G.insertBefore(F, f.nextSibling), G.insertBefore(u, M.nextSibling);
5052
5049
  const S = window.getSelection();
5053
5050
  if (!S) return;
5054
5051
  const p = document.createRange();
@@ -5057,11 +5054,11 @@ const nn = /* @__PURE__ */ JA(en, [["render", on]]), jB = () => {
5057
5054
  const {
5058
5055
  content: d,
5059
5056
  contentPage: c,
5060
- setRefineContent: y,
5057
+ setRefineContent: f,
5061
5058
  setActivedRefineContent: D,
5062
5059
  setContentPage: u
5063
5060
  } = B, R = d.value.filter((M, G) => G !== c.value - 1), F = R[c.value - 1] ? c.value : c.value - 1;
5064
- u(F), y(R), D(d.value[c.value - 1]);
5061
+ u(F), f(R), D(d.value[c.value - 1]);
5065
5062
  }, h = yA();
5066
5063
  return gI(() => {
5067
5064
  var d;
@@ -5262,7 +5259,7 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5262
5259
  var d, c;
5263
5260
  if ((d = i.children) != null && d.length) {
5264
5261
  if (I.shortcutPosition.value === ag.底部) {
5265
- const y = Number.parseFloat(getComputedStyle(I.scrollElm.value).height), D = ((c = I.scrollElm.value) == null ? void 0 : c.scrollTop) ?? 0, u = y + D, R = Number.parseFloat(getComputedStyle(I.refineGeneratorRef.value).top), F = Number.parseFloat(getComputedStyle(I.refineGeneratorRef.value).height), M = sC.length * Zg + _g * 2, G = i.children.length * Zg, S = (sC.length - h) * Zg + _g, p = (
5262
+ const f = Number.parseFloat(getComputedStyle(I.scrollElm.value).height), D = ((c = I.scrollElm.value) == null ? void 0 : c.scrollTop) ?? 0, u = f + D, R = Number.parseFloat(getComputedStyle(I.refineGeneratorRef.value).top), F = Number.parseFloat(getComputedStyle(I.refineGeneratorRef.value).height), M = sC.length * Zg + _g * 2, G = i.children.length * Zg, S = (sC.length - h) * Zg + _g, p = (
5266
5263
  // 弹窗定位 + 高度
5267
5264
  R + F + // 指令列表高度 + marginTop 8px
5268
5265
  M + 8 + // 子指令列表高度 + bottomTop 8px
@@ -5276,13 +5273,13 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5276
5273
  }
5277
5274
  }, [t, o] = fI(), [r, a] = KA(-1);
5278
5275
  return () => {
5279
- const i = (d, c, y = !0) => {
5276
+ const i = (d, c, f = !0) => {
5280
5277
  var D, u;
5281
5278
  return N(cg, null, [N("li", {
5282
5279
  class: uI("shortcut-item"),
5283
5280
  onClick: () => E(d),
5284
- onMouseenter: y ? () => B(d, c) : DC,
5285
- onMouseleave: y ? () => o(!1) : DC
5281
+ onMouseenter: f ? () => B(d, c) : DC,
5282
+ onMouseleave: f ? () => o(!1) : DC
5286
5283
  }, [N(OA("a-space"), {
5287
5284
  style: "justify-content: space-between",
5288
5285
  fill: !0
@@ -5382,7 +5379,7 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5382
5379
  return;
5383
5380
  }
5384
5381
  h(), o(!0);
5385
- }, y = kI(() => {
5382
+ }, f = kI(() => {
5386
5383
  t.value && h();
5387
5384
  }), D = kI(async (M) => {
5388
5385
  var S, p;
@@ -5398,10 +5395,10 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5398
5395
  });
5399
5396
  mg(() => {
5400
5397
  var M;
5401
- document.addEventListener("mousedown", d), document.addEventListener("mouseup", c), document.addEventListener("selectionchange", D), (M = E.scrollElm.value) == null || M.addEventListener("scroll", y);
5398
+ document.addEventListener("mousedown", d), document.addEventListener("mouseup", c), document.addEventListener("selectionchange", D), (M = E.scrollElm.value) == null || M.addEventListener("scroll", f);
5402
5399
  }), GC(() => {
5403
5400
  var M;
5404
- document.removeEventListener("mousedown", d), document.removeEventListener("mouseup", c), document.removeEventListener("selectionchange", D), (M = E.scrollElm.value) == null || M.removeEventListener("scroll", y);
5401
+ document.removeEventListener("mousedown", d), document.removeEventListener("mouseup", c), document.removeEventListener("selectionchange", D), (M = E.scrollElm.value) == null || M.removeEventListener("scroll", f);
5405
5402
  });
5406
5403
  const u = () => {
5407
5404
  E.highlightRange(), o(!1), E.showRefineGenerator(), NC(() => {
@@ -5448,7 +5445,7 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5448
5445
  sg.顶部对齐
5449
5446
  ), d = () => {
5450
5447
  if (!I.visible.value) return;
5451
- const y = I.scrollElm.value, D = Number.parseFloat(getComputedStyle(y).height), R = y.scrollTop + D, F = Number.parseFloat(getComputedStyle(E.value).top), M = Number.parseFloat(
5448
+ const f = I.scrollElm.value, D = Number.parseFloat(getComputedStyle(f).height), R = f.scrollTop + D, F = Number.parseFloat(getComputedStyle(E.value).top), M = Number.parseFloat(
5452
5449
  getComputedStyle(I.refineGeneratorRef.value).height
5453
5450
  );
5454
5451
  o(
@@ -5460,11 +5457,11 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5460
5457
  );
5461
5458
  }, c = kI(d);
5462
5459
  return mg(() => {
5463
- var y;
5464
- (y = B.value) == null || y.addEventListener("scroll", c);
5460
+ var f;
5461
+ (f = B.value) == null || f.addEventListener("scroll", c);
5465
5462
  }), GC(() => {
5466
- var y;
5467
- (y = B.value) == null || y.removeEventListener("scroll", c);
5463
+ var f;
5464
+ (f = B.value) == null || f.removeEventListener("scroll", c);
5468
5465
  }), {
5469
5466
  generatorPosition: t,
5470
5467
  shortcutPosition: r,
@@ -5493,12 +5490,12 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5493
5490
  createSession: a,
5494
5491
  sendSessionMessage: i,
5495
5492
  abortSession: h
5496
- } = o.refineContext, [d, c] = KA(void 0), y = () => (i.abort(), h({
5493
+ } = o.refineContext, [d, c] = KA(void 0), f = () => (i.abort(), h({
5497
5494
  sessionId: d.value
5498
5495
  })), D = yA(), [u, R] = KA({
5499
5496
  zIndex: -10
5500
5497
  }), [F, M] = KA(!1, (rA) => {
5501
- rA || (d.value && [jA.等待生成, jA.正在生成].includes(v.value) && y(), c(void 0), EA(!1), nA(void 0), U(!1), O(jA.未生成), J(0), dA([]), RA(void 0), AA(!0), R({
5498
+ rA || (d.value && [jA.等待生成, jA.正在生成].includes(v.value) && f(), c(void 0), EA(!1), nA(void 0), U(!1), O(jA.未生成), J(0), dA([]), RA(void 0), AA(!0), R({
5502
5499
  zIndex: -10
5503
5500
  }));
5504
5501
  }), G = () => {
@@ -5598,7 +5595,7 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5598
5595
  setContentVisible: U,
5599
5596
  setContentState: O,
5600
5597
  showRefineGenerator: S,
5601
- abortSession: y,
5598
+ abortSession: f,
5602
5599
  /** highlight range */
5603
5600
  scrollElm: P,
5604
5601
  highlightRange: E,
@@ -5807,7 +5804,7 @@ const DB = /* @__PURE__ */ JA(mn, [["render", Kn]]), [TA] = ZA("editor-container
5807
5804
  hasPausationTag: h,
5808
5805
  getContent: d,
5809
5806
  setContent: c,
5810
- appendContent: y,
5807
+ appendContent: f,
5811
5808
  getTextContent: D,
5812
5809
  insertContent: u,
5813
5810
  deleteContent: R,
@@ -5832,7 +5829,7 @@ const DB = /* @__PURE__ */ JA(mn, [["render", Kn]]), [TA] = ZA("editor-container
5832
5829
  editorAction: a,
5833
5830
  getContent: d,
5834
5831
  setContent: c,
5835
- appendContent: y,
5832
+ appendContent: f,
5836
5833
  getTextContent: D,
5837
5834
  insertContent: u,
5838
5835
  deleteContent: R,
@@ -6027,7 +6024,7 @@ const DB = /* @__PURE__ */ JA(mn, [["render", Kn]]), [TA] = ZA("editor-container
6027
6024
  onDragover: (Z) => Z.preventDefault(),
6028
6025
  onDrop: (Z) => Z.preventDefault()
6029
6026
  }, [N("p", {
6030
- class: GA
6027
+ class: NA
6031
6028
  }, [N("br", null, null)])])])]), I.simple ? null : N("div", {
6032
6029
  ref: o,
6033
6030
  class: TA("core-anchor")
@@ -6044,7 +6041,7 @@ const DB = /* @__PURE__ */ JA(mn, [["render", Kn]]), [TA] = ZA("editor-container
6044
6041
  }, [JSON.stringify(AA.value), Object.values(AA.value).flat().length])]),
6045
6042
  innerGetContent: d,
6046
6043
  innerSetContent: c,
6047
- innerAppendContent: y,
6044
+ innerAppendContent: f,
6048
6045
  innerGetTextContent: D,
6049
6046
  innerInsertContent: u,
6050
6047
  innerDeleteContent: R,
@@ -6130,7 +6127,7 @@ const DB = /* @__PURE__ */ JA(mn, [["render", Kn]]), [TA] = ZA("editor-container
6130
6127
  return this.innerInsertContentAtCursor(I);
6131
6128
  },
6132
6129
  clear() {
6133
- return this.setContent(`<p class="${GA}"><br /></p>`);
6130
+ return this.setContent(`<p class="${NA}"><br /></p>`);
6134
6131
  },
6135
6132
  renderHighlight(I) {
6136
6133
  return this.innerRenderHightlight(I);
@@ -6159,7 +6156,7 @@ export {
6159
6156
  pI as IPlugin,
6160
6157
  re as IUndoManager,
6161
6158
  SB as ListenModeEnum,
6162
- x as PluginFlag,
6159
+ b as PluginFlag,
6163
6160
  te as SelectionType,
6164
6161
  bn as default
6165
6162
  };