@naersen/tts-rich-text 0.4.0 → 0.5.0
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/README.md +16 -0
- package/dist/components/tts-rich-text/editor/useSSETool.d.ts +1 -1
- package/dist/editor/index.d.ts +4 -0
- package/dist/index.js +639 -610
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getInitContent as ut, convertToTtsFormat as Wl } from "./core.js";
|
|
2
|
-
import { DeleteMode as
|
|
3
|
-
import { ref as k, computed as T, useSlots as wl, defineComponent as $, useCssVars as Bi, unref as j, toRefs as Lt, openBlock as Y, createElementBlock as L, normalizeClass as bn, createBlock as _, mergeProps as Sl, createSlots as Ol, withCtx as N, createElementVNode as A, createVNode as J, renderList as gn, renderSlot as wn, normalizeProps as Yl, guardReactiveProps as kl, normalizeStyle as ae, toDisplayString as P, getCurrentScope as Qi, onScopeDispose as Kl, readonly as Ht, toRef as Vl, customRef as Gl, watch as cn, onMounted as Oe, nextTick as ye, getCurrentInstance as _i, shallowRef as At, watchEffect as oi, toRaw as $i, Fragment as tn, createCommentVNode as yn, Transition as Xl, withModifiers as Zt, inject as Jl, provide as Ll,
|
|
4
|
-
import { ElButton as Ml, ElMessage as xt, ElMessageBox as Nl, ElDialog as
|
|
2
|
+
import { DeleteMode as cd, LanguageOptions as dd, NumberToTextTools as md, StopOptions as pd, ToolConfig as fd, allToolTypes as yd, getVisualLength as qd, resolveTtsEditorFeatures as zd, sanitizePastedHtml as bd, sanitizePastedText as jd, splitTextToSentences as vd, toCardinal as Ad, toColloquial as Zd, toPhoneReading as xd, toPositional as Cd, transformParagraph as Id } from "./core.js";
|
|
3
|
+
import { ref as k, computed as T, useSlots as wl, defineComponent as $, useCssVars as Bi, unref as j, toRefs as Lt, openBlock as Y, createElementBlock as L, normalizeClass as bn, createBlock as _, mergeProps as Sl, createSlots as Ol, withCtx as N, createElementVNode as A, createVNode as J, renderList as gn, renderSlot as wn, normalizeProps as Yl, guardReactiveProps as kl, normalizeStyle as ae, toDisplayString as P, getCurrentScope as Qi, onScopeDispose as Kl, readonly as Ht, toRef as Vl, customRef as Gl, watch as cn, onMounted as Oe, nextTick as ye, getCurrentInstance as _i, shallowRef as At, watchEffect as oi, toRaw as $i, Fragment as tn, createCommentVNode as yn, Transition as Xl, withModifiers as Zt, inject as Jl, provide as Ll, onUnmounted as Hl, onBeforeUnmount as Ye, h as no, withDirectives as Fe, vModelText as Pe, isRef as eo, createTextVNode as An, toValue as Tl, reactive as Tt, useModel as Mt, mergeModels as me } from "vue";
|
|
4
|
+
import { ElButton as Ml, ElMessage as xt, ElMessageBox as Nl, ElDialog as ke, ElInput as li, ElPopover as tt, ElInputNumber as Rl } from "element-plus";
|
|
5
5
|
import { Node as Fl, Extension as Pl, isTextSelection as El, posToDOMRect as to, getText as Ul, getTextSerializersFromSchema as Dl } from "@tiptap/core";
|
|
6
|
-
import { nodeViewProps as Bl, NodeViewWrapper as Ql, NodeViewContent as
|
|
6
|
+
import { nodeViewProps as Bl, NodeViewWrapper as Ql, NodeViewContent as Ge, VueNodeViewRenderer as _l, mergeAttributes as si, useEditor as $l, EditorContent as ns } from "@tiptap/vue-3";
|
|
7
7
|
import es from "@tiptap/starter-kit";
|
|
8
8
|
import { Placeholder as ts } from "@tiptap/extensions";
|
|
9
9
|
var io = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -157,13 +157,13 @@ var lo = { exports: {} };
|
|
|
157
157
|
}, I.format = function(b) {
|
|
158
158
|
var w = this, x = this.$locale();
|
|
159
159
|
if (!this.isValid()) return x.invalidDate || m;
|
|
160
|
-
var G = b || "YYYY-MM-DDTHH:mm:ssZ", R = p.z(this), Q = this.$H, en = this.$m, rn = this.$M, an = x.weekdays, zn = x.months, re = x.meridiem, Bn = function(mn, Rn, be,
|
|
161
|
-
return mn && (mn[Rn] || mn(w, G)) || be[Rn].slice(0,
|
|
160
|
+
var G = b || "YYYY-MM-DDTHH:mm:ssZ", R = p.z(this), Q = this.$H, en = this.$m, rn = this.$M, an = x.weekdays, zn = x.months, re = x.meridiem, Bn = function(mn, Rn, be, Ve) {
|
|
161
|
+
return mn && (mn[Rn] || mn(w, G)) || be[Rn].slice(0, Ve);
|
|
162
162
|
}, ze = function(mn) {
|
|
163
163
|
return p.s(Q % 12 || 12, mn, "0");
|
|
164
164
|
}, Qn = re || function(mn, Rn, be) {
|
|
165
|
-
var
|
|
166
|
-
return be ?
|
|
165
|
+
var Ve = mn < 12 ? "AM" : "PM";
|
|
166
|
+
return be ? Ve.toLowerCase() : Ve;
|
|
167
167
|
};
|
|
168
168
|
return G.replace(z, function(mn, Rn) {
|
|
169
169
|
return Rn || function(be) {
|
|
@@ -363,7 +363,7 @@ var ro = { exports: {} };
|
|
|
363
363
|
})(ro);
|
|
364
364
|
var os = ro.exports;
|
|
365
365
|
const ls = /* @__PURE__ */ oo(os);
|
|
366
|
-
var ss = typeof global == "object" && global && global.Object === Object && global, rs = typeof self == "object" && self && self.Object === Object && self, hs = ss || rs || Function("return this")(),
|
|
366
|
+
var ss = typeof global == "object" && global && global.Object === Object && global, rs = typeof self == "object" && self && self.Object === Object && self, hs = ss || rs || Function("return this")(), Ee = hs.Symbol, ho = Object.prototype, us = ho.hasOwnProperty, as = ho.toString, je = Ee ? Ee.toStringTag : void 0;
|
|
367
367
|
function gs(e) {
|
|
368
368
|
var n = us.call(e, je), t = e[je];
|
|
369
369
|
try {
|
|
@@ -378,7 +378,7 @@ var cs = Object.prototype, ds = cs.toString;
|
|
|
378
378
|
function ms(e) {
|
|
379
379
|
return ds.call(e);
|
|
380
380
|
}
|
|
381
|
-
var ps = "[object Null]", fs = "[object Undefined]", ri =
|
|
381
|
+
var ps = "[object Null]", fs = "[object Undefined]", ri = Ee ? Ee.toStringTag : void 0;
|
|
382
382
|
function uo(e) {
|
|
383
383
|
return e == null ? e === void 0 ? fs : ps : ri && ri in Object(e) ? gs(e) : ms(e);
|
|
384
384
|
}
|
|
@@ -397,7 +397,7 @@ function It(e) {
|
|
|
397
397
|
return e === void 0;
|
|
398
398
|
}
|
|
399
399
|
so.extend(ls);
|
|
400
|
-
const
|
|
400
|
+
const Hn = (e) => {
|
|
401
401
|
const n = /^-?\d+(\.\d+)?$/;
|
|
402
402
|
return bs(e) || qs(e) && n.test(e) ? `${e}px` : e;
|
|
403
403
|
}, go = (e) => {
|
|
@@ -600,7 +600,7 @@ const Ln = (e) => {
|
|
|
600
600
|
return f && (a[f] = d), a;
|
|
601
601
|
},
|
|
602
602
|
{}
|
|
603
|
-
), h = T(() => (r[o.value] ?? r[`${l.value}-${o.value}`] ?? "").replace("<svg", '<svg fill="currentColor"')), u = T(() => It(t.value) ? "1em" :
|
|
603
|
+
), h = T(() => (r[o.value] ?? r[`${l.value}-${o.value}`] ?? "").replace("<svg", '<svg fill="currentColor"')), u = T(() => It(t.value) ? "1em" : Hn(Ct(t.value) ? t.value[0] : t.value)), g = T(() => It(t.value) ? "1em" : Hn(Ct(t.value) ? t.value[1] : t.value));
|
|
604
604
|
return (a, c) => (Y(), L("span", {
|
|
605
605
|
"aria-hidden": "true",
|
|
606
606
|
class: bn(["svg-icon", a.$attrs.class]),
|
|
@@ -659,8 +659,8 @@ const Ln = (e) => {
|
|
|
659
659
|
return (n, t) => (Y(), L("div", dr, [
|
|
660
660
|
A("div", {
|
|
661
661
|
style: ae({
|
|
662
|
-
width: j(
|
|
663
|
-
height: j(
|
|
662
|
+
width: j(Hn)(e.size),
|
|
663
|
+
height: j(Hn)(e.size)
|
|
664
664
|
}),
|
|
665
665
|
class: "cx-empty-icon"
|
|
666
666
|
}, [
|
|
@@ -677,7 +677,7 @@ const Ln = (e) => {
|
|
|
677
677
|
function pe(e) {
|
|
678
678
|
return Qi() ? (Kl(e), !0) : !1;
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function Ue() {
|
|
681
681
|
const e = /* @__PURE__ */ new Set(), n = (o) => {
|
|
682
682
|
e.delete(o);
|
|
683
683
|
};
|
|
@@ -696,7 +696,7 @@ function Ee() {
|
|
|
696
696
|
function nn(e) {
|
|
697
697
|
return typeof e == "function" ? e() : j(e);
|
|
698
698
|
}
|
|
699
|
-
const
|
|
699
|
+
const Ke = typeof window < "u" && typeof document < "u";
|
|
700
700
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
701
701
|
const qr = Object.prototype.toString, mo = (e) => qr.call(e) === "[object Object]", po = () => {
|
|
702
702
|
}, zr = (e, n) => Object.prototype.hasOwnProperty.call(e, n);
|
|
@@ -747,7 +747,7 @@ function Cr(e, n, t = {}) {
|
|
|
747
747
|
o.value = !1, l = null, e(...u);
|
|
748
748
|
}, nn(n));
|
|
749
749
|
}
|
|
750
|
-
return i && (o.value = !0,
|
|
750
|
+
return i && (o.value = !0, Ke && h()), pe(r), {
|
|
751
751
|
isPending: Ht(o),
|
|
752
752
|
start: h,
|
|
753
753
|
stop: r
|
|
@@ -804,7 +804,7 @@ function ui(e, n, t = {}) {
|
|
|
804
804
|
}
|
|
805
805
|
return { stop: h, ignoreUpdates: s, ignorePrevAsyncUpdates: r };
|
|
806
806
|
}
|
|
807
|
-
const Nt =
|
|
807
|
+
const Nt = Ke ? window : void 0, fo = Ke ? window.document : void 0, yo = Ke ? window.navigator : void 0;
|
|
808
808
|
function ne(e) {
|
|
809
809
|
var n;
|
|
810
810
|
const t = nn(e);
|
|
@@ -911,7 +911,7 @@ function wr(e, n = {}) {
|
|
|
911
911
|
var t, i;
|
|
912
912
|
const o = k(!1), l = At(null);
|
|
913
913
|
let s = 0, r = !0;
|
|
914
|
-
if (
|
|
914
|
+
if (Ke) {
|
|
915
915
|
const h = typeof n == "function" ? { onDrop: n } : n, u = (t = h.multiple) != null ? t : !0, g = (i = h.preventDefaultForUnhandled) != null ? i : !1, a = (m) => {
|
|
916
916
|
var y, z;
|
|
917
917
|
const C = Array.from((z = (y = m.dataTransfer) == null ? void 0 : y.files) != null ? z : []);
|
|
@@ -1061,7 +1061,7 @@ const Yr = {
|
|
|
1061
1061
|
function kr(e = {}) {
|
|
1062
1062
|
const {
|
|
1063
1063
|
document: n = fo
|
|
1064
|
-
} = e, t = k(null), { on: i, trigger: o } =
|
|
1064
|
+
} = e, t = k(null), { on: i, trigger: o } = Ue(), { on: l, trigger: s } = Ue();
|
|
1065
1065
|
let r;
|
|
1066
1066
|
n && (r = n.createElement("input"), r.type = "file", r.onchange = (g) => {
|
|
1067
1067
|
const a = g.target;
|
|
@@ -1112,7 +1112,7 @@ function Gr(e, n = {}) {
|
|
|
1112
1112
|
};
|
|
1113
1113
|
const {
|
|
1114
1114
|
document: t = fo
|
|
1115
|
-
} = n, i = k(0), o = k(0), l = k(!1), s = k(1), r = k(!1), h = k(!1), u = k(!1), g = k(1), a = k(!1), c = k([]), d = k([]), f = k(-1), m = k(!1), y = k(!1), z = t && "pictureInPictureEnabled" in t, C =
|
|
1115
|
+
} = n, i = k(0), o = k(0), l = k(!1), s = k(1), r = k(!1), h = k(!1), u = k(!1), g = k(1), a = k(!1), c = k([]), d = k([]), f = k(-1), m = k(!1), y = k(!1), z = t && "pictureInPictureEnabled" in t, C = Ue(), S = Ue(), W = (p) => {
|
|
1116
1116
|
at(e, (Z) => {
|
|
1117
1117
|
if (p) {
|
|
1118
1118
|
const O = typeof p == "number" ? p : p.id;
|
|
@@ -1250,7 +1250,7 @@ const Xr = { class: "cx-radio-group" }, Jr = ["onClick"], Lr = {
|
|
|
1250
1250
|
i("update:modelValue", m), i("change", m);
|
|
1251
1251
|
}
|
|
1252
1252
|
), g = k([]), a = k(), c = (m = 18) => {
|
|
1253
|
-
const y =
|
|
1253
|
+
const y = Hn(m);
|
|
1254
1254
|
return {
|
|
1255
1255
|
width: y,
|
|
1256
1256
|
height: y,
|
|
@@ -1265,8 +1265,8 @@ const Xr = { class: "cx-radio-group" }, Jr = ["onClick"], Lr = {
|
|
|
1265
1265
|
), y = m === -1 ? 0 : m, z = g.value[y];
|
|
1266
1266
|
a.value = {
|
|
1267
1267
|
...t.sliderStyle || {},
|
|
1268
|
-
width:
|
|
1269
|
-
transform: `translateX(${
|
|
1268
|
+
width: Hn(z == null ? void 0 : z.offsetWidth),
|
|
1269
|
+
transform: `translateX(${Hn(z == null ? void 0 : z.offsetLeft)})`
|
|
1270
1270
|
};
|
|
1271
1271
|
};
|
|
1272
1272
|
return cn(() => u.value, f, {
|
|
@@ -1328,8 +1328,8 @@ const Xr = { class: "cx-radio-group" }, Jr = ["onClick"], Lr = {
|
|
|
1328
1328
|
src: j(Tr),
|
|
1329
1329
|
class: "cx-spin-loading",
|
|
1330
1330
|
style: ae({
|
|
1331
|
-
width: j(
|
|
1332
|
-
height: j(
|
|
1331
|
+
width: j(Hn)(e.size),
|
|
1332
|
+
height: j(Hn)(e.size)
|
|
1333
1333
|
})
|
|
1334
1334
|
}, null, 12, Fr),
|
|
1335
1335
|
e.text ? (Y(), L("span", Pr, P(e.text), 1)) : yn("", !0)
|
|
@@ -1452,7 +1452,7 @@ const Xr = { class: "cx-radio-group" }, Jr = ["onClick"], Lr = {
|
|
|
1452
1452
|
label: "停顿 1 秒",
|
|
1453
1453
|
value: 1
|
|
1454
1454
|
}
|
|
1455
|
-
],
|
|
1455
|
+
], De = [
|
|
1456
1456
|
{
|
|
1457
1457
|
value: "zh",
|
|
1458
1458
|
label: "中文"
|
|
@@ -1637,7 +1637,7 @@ const Xr = { class: "cx-radio-group" }, Jr = ["onClick"], Lr = {
|
|
|
1637
1637
|
content: []
|
|
1638
1638
|
}
|
|
1639
1639
|
]
|
|
1640
|
-
}), sh = { class: "icon-wrapper tag-icon" }, rh = { key: 0 }, hh = { key: 1 }, uh = { class: "icon-wrapper delete-icon" },
|
|
1640
|
+
}), sh = { class: "icon-wrapper tag-icon" }, rh = { key: 0 }, hh = { key: 1 }, uh = { class: "icon-wrapper delete-icon" }, Xe = ":", ah = /* @__PURE__ */ $({
|
|
1641
1641
|
__name: "tag-node-view",
|
|
1642
1642
|
props: Bl,
|
|
1643
1643
|
setup(e) {
|
|
@@ -1657,7 +1657,7 @@ const Xr = { class: "cx-radio-group" }, Jr = ["onClick"], Lr = {
|
|
|
1657
1657
|
}, r = T(() => {
|
|
1658
1658
|
var u;
|
|
1659
1659
|
if (o.value === M.language.type)
|
|
1660
|
-
return ((u =
|
|
1660
|
+
return ((u = De.find((g) => g.value === i.value.code)) == null ? void 0 : u.label) || "";
|
|
1661
1661
|
}), h = T(() => M[o.value].icon);
|
|
1662
1662
|
return (u, g) => (Y(), _(j(Ql), {
|
|
1663
1663
|
as: "span",
|
|
@@ -1676,30 +1676,30 @@ const Xr = { class: "cx-radio-group" }, Jr = ["onClick"], Lr = {
|
|
|
1676
1676
|
}, null, 8, ["name"])
|
|
1677
1677
|
]),
|
|
1678
1678
|
o.value === j(M).stop.type ? (Y(), L("span", rh, "停顿")) : o.value === j(M).customStop.type ? (Y(), L("span", hh, "停顿" + P((a = i.value) == null ? void 0 : a.time) + "s", 1)) : o.value === j(M).continue.type ? (Y(), L(tn, { key: 2 }, [
|
|
1679
|
-
A("span", null, "连续" + P(
|
|
1680
|
-
J(j(
|
|
1679
|
+
A("span", null, "连续" + P(Xe)),
|
|
1680
|
+
J(j(Ge), {
|
|
1681
1681
|
as: "span",
|
|
1682
1682
|
class: "tag-content"
|
|
1683
1683
|
})
|
|
1684
1684
|
], 64)) : o.value === j(M).replace.type ? (Y(), L(tn, { key: 3 }, [
|
|
1685
|
-
A("span", null, "替换" + P(
|
|
1686
|
-
J(j(
|
|
1685
|
+
A("span", null, "替换" + P(Xe)),
|
|
1686
|
+
J(j(Ge), {
|
|
1687
1687
|
as: "span",
|
|
1688
1688
|
class: "tag-content"
|
|
1689
1689
|
}),
|
|
1690
1690
|
g[0] || (g[0] = A("span", null, "→", -1)),
|
|
1691
1691
|
A("span", null, P((c = i.value) == null ? void 0 : c.text), 1)
|
|
1692
1692
|
], 64)) : o.value === j(M).pinyin.type ? (Y(), L(tn, { key: 4 }, [
|
|
1693
|
-
A("span", null, "拼音" + P(
|
|
1694
|
-
J(j(
|
|
1693
|
+
A("span", null, "拼音" + P(Xe)),
|
|
1694
|
+
J(j(Ge), {
|
|
1695
1695
|
as: "span",
|
|
1696
1696
|
class: "tag-content"
|
|
1697
1697
|
}),
|
|
1698
1698
|
g[1] || (g[1] = A("span", null, "→", -1)),
|
|
1699
1699
|
A("span", null, P((d = i.value) == null ? void 0 : d.text), 1)
|
|
1700
1700
|
], 64)) : o.value === j(M).language.type ? (Y(), L(tn, { key: 5 }, [
|
|
1701
|
-
A("span", null, P(r.value) + P(
|
|
1702
|
-
J(j(
|
|
1701
|
+
A("span", null, P(r.value) + P(Xe), 1),
|
|
1702
|
+
J(j(Ge), {
|
|
1703
1703
|
as: "span",
|
|
1704
1704
|
class: "tag-content"
|
|
1705
1705
|
})
|
|
@@ -2007,15 +2007,15 @@ class D {
|
|
|
2007
2007
|
*/
|
|
2008
2008
|
findIndex(n) {
|
|
2009
2009
|
if (n == 0)
|
|
2010
|
-
return
|
|
2010
|
+
return Je(0, n);
|
|
2011
2011
|
if (n == this.size)
|
|
2012
|
-
return
|
|
2012
|
+
return Je(this.content.length, n);
|
|
2013
2013
|
if (n > this.size || n < 0)
|
|
2014
2014
|
throw new RangeError(`Position ${n} outside of fragment (${this})`);
|
|
2015
2015
|
for (let t = 0, i = 0; ; t++) {
|
|
2016
2016
|
let o = this.child(t), l = i + o.nodeSize;
|
|
2017
2017
|
if (l >= n)
|
|
2018
|
-
return l == n ?
|
|
2018
|
+
return l == n ? Je(t + 1, l) : Je(t, i);
|
|
2019
2019
|
i = l;
|
|
2020
2020
|
}
|
|
2021
2021
|
}
|
|
@@ -2081,7 +2081,7 @@ class D {
|
|
|
2081
2081
|
}
|
|
2082
2082
|
D.empty = new D([], 0);
|
|
2083
2083
|
const dt = { index: 0, offset: 0 };
|
|
2084
|
-
function
|
|
2084
|
+
function Je(e, n) {
|
|
2085
2085
|
return dt.index = e, dt.offset = n, dt;
|
|
2086
2086
|
}
|
|
2087
2087
|
class mh extends Error {
|
|
@@ -2195,7 +2195,7 @@ function ci(e) {
|
|
|
2195
2195
|
function fh(e) {
|
|
2196
2196
|
return (e - (e & xo)) / Co;
|
|
2197
2197
|
}
|
|
2198
|
-
const Io = 1, Wo = 2,
|
|
2198
|
+
const Io = 1, Wo = 2, Ne = 4, wo = 8;
|
|
2199
2199
|
class di {
|
|
2200
2200
|
/**
|
|
2201
2201
|
@internal
|
|
@@ -2215,13 +2215,13 @@ class di {
|
|
|
2215
2215
|
Tells you whether the token before the mapped position was deleted.
|
|
2216
2216
|
*/
|
|
2217
2217
|
get deletedBefore() {
|
|
2218
|
-
return (this.delInfo & (Io |
|
|
2218
|
+
return (this.delInfo & (Io | Ne)) > 0;
|
|
2219
2219
|
}
|
|
2220
2220
|
/**
|
|
2221
2221
|
True when the token after the mapped position was deleted.
|
|
2222
2222
|
*/
|
|
2223
2223
|
get deletedAfter() {
|
|
2224
|
-
return (this.delInfo & (Wo |
|
|
2224
|
+
return (this.delInfo & (Wo | Ne)) > 0;
|
|
2225
2225
|
}
|
|
2226
2226
|
/**
|
|
2227
2227
|
Tells whether any of the steps mapped through deletes across the
|
|
@@ -2229,7 +2229,7 @@ class di {
|
|
|
2229
2229
|
position).
|
|
2230
2230
|
*/
|
|
2231
2231
|
get deletedAcross() {
|
|
2232
|
-
return (this.delInfo &
|
|
2232
|
+
return (this.delInfo & Ne) > 0;
|
|
2233
2233
|
}
|
|
2234
2234
|
}
|
|
2235
2235
|
class pn {
|
|
@@ -2272,7 +2272,7 @@ class pn {
|
|
|
2272
2272
|
let c = u ? n == h ? -1 : n == a ? 1 : t : t, d = h + o + (c < 0 ? 0 : g);
|
|
2273
2273
|
if (i)
|
|
2274
2274
|
return d;
|
|
2275
|
-
let f = n == (t < 0 ? h : a) ? null : ph(r / 3, n - h), m = n == h ? Wo : n == a ? Io :
|
|
2275
|
+
let f = n == (t < 0 ? h : a) ? null : ph(r / 3, n - h), m = n == h ? Wo : n == a ? Io : Ne;
|
|
2276
2276
|
return (t < 0 ? n != h : n != a) && (m |= wo), new di(d, m, f);
|
|
2277
2277
|
}
|
|
2278
2278
|
o += g - u;
|
|
@@ -2733,7 +2733,7 @@ class Ze extends dn {
|
|
|
2733
2733
|
}
|
|
2734
2734
|
}
|
|
2735
2735
|
dn.jsonID("attr", Ze);
|
|
2736
|
-
class
|
|
2736
|
+
class Be extends dn {
|
|
2737
2737
|
/**
|
|
2738
2738
|
Construct an attribute step.
|
|
2739
2739
|
*/
|
|
@@ -2752,7 +2752,7 @@ class De extends dn {
|
|
|
2752
2752
|
return pn.empty;
|
|
2753
2753
|
}
|
|
2754
2754
|
invert(n) {
|
|
2755
|
-
return new
|
|
2755
|
+
return new Be(this.attr, n.attrs[this.attr]);
|
|
2756
2756
|
}
|
|
2757
2757
|
map(n) {
|
|
2758
2758
|
return this;
|
|
@@ -2763,10 +2763,10 @@ class De extends dn {
|
|
|
2763
2763
|
static fromJSON(n, t) {
|
|
2764
2764
|
if (typeof t.attr != "string")
|
|
2765
2765
|
throw new RangeError("Invalid input for DocAttrStep.fromJSON");
|
|
2766
|
-
return new
|
|
2766
|
+
return new Be(t.attr, t.value);
|
|
2767
2767
|
}
|
|
2768
2768
|
}
|
|
2769
|
-
dn.jsonID("docAttr",
|
|
2769
|
+
dn.jsonID("docAttr", Be);
|
|
2770
2770
|
let Ie = class extends Error {
|
|
2771
2771
|
};
|
|
2772
2772
|
Ie = function e(n) {
|
|
@@ -2887,7 +2887,7 @@ class B {
|
|
|
2887
2887
|
negative, it will search backwards first.
|
|
2888
2888
|
*/
|
|
2889
2889
|
static near(n, t = 1) {
|
|
2890
|
-
return this.findFrom(n, t) || this.findFrom(n, -t) || new
|
|
2890
|
+
return this.findFrom(n, t) || this.findFrom(n, -t) || new Tn(n.node(0));
|
|
2891
2891
|
}
|
|
2892
2892
|
/**
|
|
2893
2893
|
Find the cursor or leaf node selection closest to the start of
|
|
@@ -2896,14 +2896,14 @@ class B {
|
|
|
2896
2896
|
exists.
|
|
2897
2897
|
*/
|
|
2898
2898
|
static atStart(n) {
|
|
2899
|
-
return ue(n, n, 0, 0, 1) || new
|
|
2899
|
+
return ue(n, n, 0, 0, 1) || new Tn(n);
|
|
2900
2900
|
}
|
|
2901
2901
|
/**
|
|
2902
2902
|
Find the cursor or leaf node selection closest to the end of the
|
|
2903
2903
|
given document.
|
|
2904
2904
|
*/
|
|
2905
2905
|
static atEnd(n) {
|
|
2906
|
-
return ue(n, n, n.content.size, n.childCount, -1) || new
|
|
2906
|
+
return ue(n, n, n.content.size, n.childCount, -1) || new Tn(n);
|
|
2907
2907
|
}
|
|
2908
2908
|
/**
|
|
2909
2909
|
Deserialize the JSON representation of a selection. Must be
|
|
@@ -3099,7 +3099,7 @@ class Et {
|
|
|
3099
3099
|
return i && vn.isSelectable(i) ? new vn(t) : B.near(t);
|
|
3100
3100
|
}
|
|
3101
3101
|
}
|
|
3102
|
-
class
|
|
3102
|
+
class Tn extends B {
|
|
3103
3103
|
/**
|
|
3104
3104
|
Create an all-selection over the given document.
|
|
3105
3105
|
*/
|
|
@@ -3121,25 +3121,25 @@ class Hn extends B {
|
|
|
3121
3121
|
@internal
|
|
3122
3122
|
*/
|
|
3123
3123
|
static fromJSON(n) {
|
|
3124
|
-
return new
|
|
3124
|
+
return new Tn(n);
|
|
3125
3125
|
}
|
|
3126
3126
|
map(n) {
|
|
3127
|
-
return new
|
|
3127
|
+
return new Tn(n);
|
|
3128
3128
|
}
|
|
3129
3129
|
eq(n) {
|
|
3130
|
-
return n instanceof
|
|
3130
|
+
return n instanceof Tn;
|
|
3131
3131
|
}
|
|
3132
3132
|
getBookmark() {
|
|
3133
3133
|
return yh;
|
|
3134
3134
|
}
|
|
3135
3135
|
}
|
|
3136
|
-
B.jsonID("all",
|
|
3136
|
+
B.jsonID("all", Tn);
|
|
3137
3137
|
const yh = {
|
|
3138
3138
|
map() {
|
|
3139
3139
|
return this;
|
|
3140
3140
|
},
|
|
3141
3141
|
resolve(e) {
|
|
3142
|
-
return new
|
|
3142
|
+
return new Tn(e);
|
|
3143
3143
|
}
|
|
3144
3144
|
};
|
|
3145
3145
|
function ue(e, n, t, i, o, l = !1) {
|
|
@@ -3174,33 +3174,33 @@ function fi(e, n, t) {
|
|
|
3174
3174
|
function yi(e, n) {
|
|
3175
3175
|
return !n || !e ? e : e.bind(n);
|
|
3176
3176
|
}
|
|
3177
|
-
class
|
|
3177
|
+
class Le {
|
|
3178
3178
|
constructor(n, t, i) {
|
|
3179
3179
|
this.name = n, this.init = yi(t.init, i), this.apply = yi(t.apply, i);
|
|
3180
3180
|
}
|
|
3181
3181
|
}
|
|
3182
|
-
new
|
|
3182
|
+
new Le("doc", {
|
|
3183
3183
|
init(e) {
|
|
3184
3184
|
return e.doc || e.schema.topNodeType.createAndFill();
|
|
3185
3185
|
},
|
|
3186
3186
|
apply(e) {
|
|
3187
3187
|
return e.doc;
|
|
3188
3188
|
}
|
|
3189
|
-
}), new
|
|
3189
|
+
}), new Le("selection", {
|
|
3190
3190
|
init(e, n) {
|
|
3191
3191
|
return e.selection || B.atStart(n.doc);
|
|
3192
3192
|
},
|
|
3193
3193
|
apply(e) {
|
|
3194
3194
|
return e.selection;
|
|
3195
3195
|
}
|
|
3196
|
-
}), new
|
|
3196
|
+
}), new Le("storedMarks", {
|
|
3197
3197
|
init(e) {
|
|
3198
3198
|
return e.storedMarks || null;
|
|
3199
3199
|
},
|
|
3200
3200
|
apply(e, n, t, i) {
|
|
3201
3201
|
return i.selection.$cursor ? e.storedMarks : null;
|
|
3202
3202
|
}
|
|
3203
|
-
}), new
|
|
3203
|
+
}), new Le("scrollToSelection", {
|
|
3204
3204
|
init() {
|
|
3205
3205
|
return 0;
|
|
3206
3206
|
},
|
|
@@ -3529,34 +3529,226 @@ function xh(e = {}) {
|
|
|
3529
3529
|
}
|
|
3530
3530
|
const Ko = Symbol("useRichTextEditor"), Ch = (e) => {
|
|
3531
3531
|
Ll(Ko, e);
|
|
3532
|
-
},
|
|
3532
|
+
}, Gn = () => {
|
|
3533
3533
|
const e = Jl(Ko);
|
|
3534
3534
|
if (!e)
|
|
3535
3535
|
throw new Error(
|
|
3536
3536
|
"TTS editor context is missing; use TtsEditorRoot or useEditorProvider"
|
|
3537
3537
|
);
|
|
3538
3538
|
return e;
|
|
3539
|
-
}, Ih = {
|
|
3539
|
+
}, Ih = (e) => e ? typeof e == "function" ? e() : e.value : null, Vo = (e) => {
|
|
3540
|
+
const n = k(!1), t = k("");
|
|
3541
|
+
let i = null, o = null;
|
|
3542
|
+
const l = () => {
|
|
3543
|
+
!e.scrollTarget || o !== null || (o = requestAnimationFrame(async () => {
|
|
3544
|
+
o = null, await ye();
|
|
3545
|
+
const h = Ih(e.scrollTarget);
|
|
3546
|
+
h && (h.scrollTop = h.scrollHeight);
|
|
3547
|
+
}));
|
|
3548
|
+
}, s = async (h = {}) => {
|
|
3549
|
+
if (!(n.value || !e.runner)) {
|
|
3550
|
+
n.value = !0, t.value = "", i = new AbortController();
|
|
3551
|
+
try {
|
|
3552
|
+
const u = await e.runner(h, {
|
|
3553
|
+
signal: i.signal,
|
|
3554
|
+
onChunk: (g) => {
|
|
3555
|
+
var a;
|
|
3556
|
+
t.value += g, l(), (a = e.onChange) == null || a.call(e, g);
|
|
3557
|
+
}
|
|
3558
|
+
});
|
|
3559
|
+
u && !t.value && (t.value = u);
|
|
3560
|
+
} catch (u) {
|
|
3561
|
+
if (!(u instanceof Error && u.name === "AbortError"))
|
|
3562
|
+
throw u;
|
|
3563
|
+
} finally {
|
|
3564
|
+
n.value = !1, i = null;
|
|
3565
|
+
}
|
|
3566
|
+
}
|
|
3567
|
+
}, r = () => {
|
|
3568
|
+
i == null || i.abort(), i = null;
|
|
3569
|
+
};
|
|
3570
|
+
return Hl(() => {
|
|
3571
|
+
o !== null && cancelAnimationFrame(o), r();
|
|
3572
|
+
}), {
|
|
3573
|
+
exec: s,
|
|
3574
|
+
result: t,
|
|
3575
|
+
loading: n,
|
|
3576
|
+
abort: r
|
|
3577
|
+
};
|
|
3578
|
+
}, hd = () => {
|
|
3579
|
+
const { services: e } = Gn();
|
|
3580
|
+
let n = null, t = null;
|
|
3581
|
+
const i = () => {
|
|
3582
|
+
n && (URL.revokeObjectURL(n), n = null);
|
|
3583
|
+
}, o = () => {
|
|
3584
|
+
t == null || t.abort(), t = null;
|
|
3585
|
+
}, l = async (s) => {
|
|
3586
|
+
const r = e.value.synthesizePreview;
|
|
3587
|
+
if (!r) return null;
|
|
3588
|
+
o(), i(), t = new AbortController();
|
|
3589
|
+
try {
|
|
3590
|
+
const h = await r(s, t.signal);
|
|
3591
|
+
return h instanceof Blob ? (n = URL.createObjectURL(h), n) : h;
|
|
3592
|
+
} catch (h) {
|
|
3593
|
+
if (h instanceof Error && h.name === "AbortError") return null;
|
|
3594
|
+
throw h;
|
|
3595
|
+
} finally {
|
|
3596
|
+
t = null;
|
|
3597
|
+
}
|
|
3598
|
+
};
|
|
3599
|
+
return Ye(() => {
|
|
3600
|
+
o(), i();
|
|
3601
|
+
}), { testAudio: l };
|
|
3602
|
+
}, Wh = Symbol("stop-audio"), wh = (e) => {
|
|
3603
|
+
const n = Or(Wh);
|
|
3604
|
+
return n.on(e.on), n;
|
|
3605
|
+
}, Sh = (e) => {
|
|
3606
|
+
const n = e == null ? void 0 : e.toLowerCase();
|
|
3607
|
+
return n === "mp3" ? "audio/mpeg" : n === "wav" ? "audio/wav" : n === "ogg" ? "audio/ogg" : n ? `audio/${n}` : "audio/wav";
|
|
3608
|
+
}, Oh = (e) => typeof e.duration == "number" ? e.duration : typeof e.start == "number" && typeof e.end == "number" ? Math.max(0, e.end - e.start) : 0, Yh = (e, n) => {
|
|
3609
|
+
const t = e.includes(",") ? e.split(",").pop() || "" : e, i = atob(t), o = new Uint8Array(i.length);
|
|
3610
|
+
for (let l = 0; l < i.length; l += 1)
|
|
3611
|
+
o[l] = i.charCodeAt(l);
|
|
3612
|
+
return URL.createObjectURL(
|
|
3613
|
+
new Blob([o], { type: Sh(n) })
|
|
3614
|
+
);
|
|
3615
|
+
}, kh = (e) => {
|
|
3616
|
+
const { services: n } = Gn(), t = k(!1), i = k([]), o = k(-1), l = k("idle"), s = k(!1), r = k(!1);
|
|
3617
|
+
let h = null, u = null;
|
|
3618
|
+
const g = T(() => {
|
|
3619
|
+
var q;
|
|
3620
|
+
return o.value < 0 ? "" : ((q = i.value[o.value]) == null ? void 0 : q.src) || "";
|
|
3621
|
+
}), a = Gr(e, { src: g }), { playing: c } = a, d = T(() => l.value === "playing"), f = T(() => i.value.length > 0), m = T(
|
|
3622
|
+
() => i.value.reduce((q, I) => q + I.duration, 0)
|
|
3623
|
+
), y = T(() => o.value <= 0 ? 0 : i.value.slice(0, o.value).reduce((q, I) => q + I.duration, 0)), z = T({
|
|
3624
|
+
get() {
|
|
3625
|
+
return o.value < 0 || !g.value ? 0 : y.value + a.currentTime.value;
|
|
3626
|
+
},
|
|
3627
|
+
set(q) {
|
|
3628
|
+
a.currentTime.value = Math.max(
|
|
3629
|
+
0,
|
|
3630
|
+
q - y.value
|
|
3631
|
+
);
|
|
3632
|
+
}
|
|
3633
|
+
}), C = T({
|
|
3634
|
+
get: () => c.value,
|
|
3635
|
+
set(q) {
|
|
3636
|
+
l.value = q ? "playing" : "paused", c.value = q;
|
|
3637
|
+
}
|
|
3638
|
+
}), S = {
|
|
3639
|
+
...a,
|
|
3640
|
+
playing: C,
|
|
3641
|
+
currentTime: z,
|
|
3642
|
+
duration: m
|
|
3643
|
+
}, W = async () => {
|
|
3644
|
+
s.value = !1, await ye(), c.value = !0;
|
|
3645
|
+
}, X = async () => {
|
|
3646
|
+
i.value.length && (o.value = 0, a.currentTime.value = 0, await W());
|
|
3647
|
+
}, K = async () => {
|
|
3648
|
+
if (l.value !== "playing") return;
|
|
3649
|
+
const q = o.value + 1;
|
|
3650
|
+
if (!i.value[q]) {
|
|
3651
|
+
r.value ? l.value = "idle" : s.value = !0;
|
|
3652
|
+
return;
|
|
3653
|
+
}
|
|
3654
|
+
o.value = q, await W();
|
|
3655
|
+
}, V = async () => {
|
|
3656
|
+
if (l.value = "playing", o.value < 0 || s.value) {
|
|
3657
|
+
await K();
|
|
3658
|
+
return;
|
|
3659
|
+
}
|
|
3660
|
+
if (m.value > 0 && z.value >= m.value) {
|
|
3661
|
+
await X();
|
|
3662
|
+
return;
|
|
3663
|
+
}
|
|
3664
|
+
c.value = !0;
|
|
3665
|
+
};
|
|
3666
|
+
U(e, "ended", () => {
|
|
3667
|
+
K();
|
|
3668
|
+
}), U(e, "loadedmetadata", () => {
|
|
3669
|
+
var b;
|
|
3670
|
+
const q = i.value[o.value], I = (b = e == null ? void 0 : e.value) == null ? void 0 : b.duration;
|
|
3671
|
+
q && !q.duration && Number.isFinite(I) && (q.duration = I || 0);
|
|
3672
|
+
});
|
|
3673
|
+
const H = () => {
|
|
3674
|
+
l.value = "stopped", c.value = !1, s.value = !1, t.value = !1, h == null || h.abort(), h = null;
|
|
3675
|
+
}, F = () => {
|
|
3676
|
+
i.value.forEach((q) => URL.revokeObjectURL(q.src)), i.value = [], o.value = -1, a.currentTime.value = 0, s.value = !1, r.value = !1;
|
|
3677
|
+
}, v = () => {
|
|
3678
|
+
r.value = !0, s.value && o.value >= i.value.length - 1 && (s.value = !1, l.value = "idle"), t.value = !1;
|
|
3679
|
+
}, p = (q) => {
|
|
3680
|
+
if (q.done) {
|
|
3681
|
+
v(), u = q;
|
|
3682
|
+
return;
|
|
3683
|
+
}
|
|
3684
|
+
q.audio_base64 && (i.value[q.index] = {
|
|
3685
|
+
src: Yh(q.audio_base64, q.audio_format),
|
|
3686
|
+
duration: Oh(q)
|
|
3687
|
+
}, l.value === "playing" && (o.value < 0 || s.value) && K());
|
|
3688
|
+
}, Z = (q) => {
|
|
3689
|
+
const I = q instanceof Blob ? URL.createObjectURL(q) : q;
|
|
3690
|
+
i.value[0] = { src: I, duration: 0 }, r.value = !0, K();
|
|
3691
|
+
}, O = async (q) => {
|
|
3692
|
+
const I = n.value.synthesizePreviewStream, b = n.value.synthesizePreview;
|
|
3693
|
+
if (!I && !b) return null;
|
|
3694
|
+
H(), F(), t.value = !0, u = null, l.value = "playing";
|
|
3695
|
+
const w = new AbortController();
|
|
3696
|
+
h = w;
|
|
3697
|
+
try {
|
|
3698
|
+
if (I)
|
|
3699
|
+
u = await I(q, {
|
|
3700
|
+
signal: w.signal,
|
|
3701
|
+
onMessage: (x) => {
|
|
3702
|
+
w.signal.aborted || p(x);
|
|
3703
|
+
}
|
|
3704
|
+
}), r.value || v();
|
|
3705
|
+
else if (b) {
|
|
3706
|
+
const x = await b(q, w.signal);
|
|
3707
|
+
if (w.signal.aborted) return null;
|
|
3708
|
+
Z(x);
|
|
3709
|
+
}
|
|
3710
|
+
return u;
|
|
3711
|
+
} catch (x) {
|
|
3712
|
+
if (x instanceof Error && x.name === "AbortError") return null;
|
|
3713
|
+
throw x;
|
|
3714
|
+
} finally {
|
|
3715
|
+
h === w && (t.value = !1, h = null);
|
|
3716
|
+
}
|
|
3717
|
+
};
|
|
3718
|
+
return Ye(() => {
|
|
3719
|
+
H(), F();
|
|
3720
|
+
}), {
|
|
3721
|
+
execute: O,
|
|
3722
|
+
loading: t,
|
|
3723
|
+
abort: H,
|
|
3724
|
+
resume: V,
|
|
3725
|
+
stop: H,
|
|
3726
|
+
playing: C,
|
|
3727
|
+
mediaControls: S,
|
|
3728
|
+
shouldAutoPlay: d,
|
|
3729
|
+
hasAudio: f
|
|
3730
|
+
};
|
|
3731
|
+
}, Kh = {
|
|
3540
3732
|
minSegmentLength: 32,
|
|
3541
3733
|
maxSegmentLength: 128,
|
|
3542
3734
|
rebalanceRatio: 0.4
|
|
3543
|
-
},
|
|
3735
|
+
}, Go = /[一-鿿㐀-䶿豈- -〿-]/, Vh = /[。!?!?\.]/, Gh = /[;;]/, Xh = /[,,、::]/, Jh = /[。!?!?,,、;;::\.]/, Xo = "", Jo = "", Ln = (e) => {
|
|
3544
3736
|
let n = 0;
|
|
3545
3737
|
for (const t of e)
|
|
3546
|
-
n +=
|
|
3738
|
+
n += Go.test(t) ? 2 : 1;
|
|
3547
3739
|
return n;
|
|
3548
|
-
},
|
|
3549
|
-
`).map((n) => n.trim()).filter(Boolean).join(" ").replace(/\s+/g, " ").trim(),
|
|
3740
|
+
}, Lh = (e) => e.replace(/\r/g, "").split(`
|
|
3741
|
+
`).map((n) => n.trim()).filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), Hh = (e) => {
|
|
3550
3742
|
let n = e, t = "";
|
|
3551
3743
|
for (; t !== n; )
|
|
3552
|
-
t = n, n = n.replace(/(\d),(\d)/g, `$1${
|
|
3744
|
+
t = n, n = n.replace(/(\d),(\d)/g, `$1${Xo}$2`);
|
|
3553
3745
|
for (t = ""; t !== n; )
|
|
3554
|
-
t = n, n = n.replace(/(\d)\.(\d)/g, `$1${
|
|
3746
|
+
t = n, n = n.replace(/(\d)\.(\d)/g, `$1${Jo}$2`);
|
|
3555
3747
|
return n;
|
|
3556
|
-
}, qi = (e) => e.split(
|
|
3748
|
+
}, qi = (e) => e.split(Xo).join(",").split(Jo).join("."), Yt = (e, n) => {
|
|
3557
3749
|
let t = 0;
|
|
3558
3750
|
for (let i = 0; i < e.length; i += 1)
|
|
3559
|
-
if (t +=
|
|
3751
|
+
if (t += Go.test(e[i]) ? 2 : 1, t >= n)
|
|
3560
3752
|
return i + 1;
|
|
3561
3753
|
return e.length;
|
|
3562
3754
|
}, kt = (e, n, t, i, o) => {
|
|
@@ -3570,7 +3762,7 @@ const Ko = Symbol("useRichTextEditor"), Ch = (e) => {
|
|
|
3570
3762
|
break;
|
|
3571
3763
|
}
|
|
3572
3764
|
return l;
|
|
3573
|
-
},
|
|
3765
|
+
}, Lo = (e, n, t, i) => {
|
|
3574
3766
|
let o = -1, l = Number.POSITIVE_INFINITY;
|
|
3575
3767
|
const s = Math.max(1, t), r = Math.min(e.length, i);
|
|
3576
3768
|
for (let h = s; h <= r; h += 1) {
|
|
@@ -3581,11 +3773,11 @@ const Ko = Symbol("useRichTextEditor"), Ch = (e) => {
|
|
|
3581
3773
|
break;
|
|
3582
3774
|
}
|
|
3583
3775
|
return o;
|
|
3584
|
-
},
|
|
3776
|
+
}, Th = (e, n) => {
|
|
3585
3777
|
const t = [];
|
|
3586
3778
|
let i = e.trim();
|
|
3587
|
-
for (; i &&
|
|
3588
|
-
const o =
|
|
3779
|
+
for (; i && Ln(i) > n; ) {
|
|
3780
|
+
const o = Ln(i), l = Math.min(
|
|
3589
3781
|
Math.floor(o / 2),
|
|
3590
3782
|
n
|
|
3591
3783
|
), s = Yt(i, l), r = Math.max(1, Math.floor(s / 3)), h = Math.max(
|
|
@@ -3597,15 +3789,15 @@ const Ko = Symbol("useRichTextEditor"), Ch = (e) => {
|
|
|
3597
3789
|
s,
|
|
3598
3790
|
r,
|
|
3599
3791
|
h,
|
|
3600
|
-
|
|
3792
|
+
Gh
|
|
3601
3793
|
);
|
|
3602
3794
|
u < 0 && (u = kt(
|
|
3603
3795
|
i,
|
|
3604
3796
|
s,
|
|
3605
3797
|
r,
|
|
3606
3798
|
h,
|
|
3607
|
-
|
|
3608
|
-
)), u < 0 && (u =
|
|
3799
|
+
Xh
|
|
3800
|
+
)), u < 0 && (u = Lo(
|
|
3609
3801
|
i,
|
|
3610
3802
|
s,
|
|
3611
3803
|
r,
|
|
@@ -3613,21 +3805,21 @@ const Ko = Symbol("useRichTextEditor"), Ch = (e) => {
|
|
|
3613
3805
|
)), (u < 0 || u >= i.length) && (u = s), t.push(i.slice(0, u).trim()), i = i.slice(u).trim();
|
|
3614
3806
|
}
|
|
3615
3807
|
return i && t.push(i), t;
|
|
3616
|
-
},
|
|
3808
|
+
}, Mh = (e, n) => {
|
|
3617
3809
|
if (e.length <= 1)
|
|
3618
3810
|
return e;
|
|
3619
|
-
const t = e[e.length - 1], i = e.reduce((c, d) => c +
|
|
3620
|
-
if (
|
|
3811
|
+
const t = e[e.length - 1], i = e.reduce((c, d) => c + Ln(d), 0) / e.length, o = Math.floor(i * n);
|
|
3812
|
+
if (Ln(t) >= o)
|
|
3621
3813
|
return e;
|
|
3622
|
-
const s = `${e[e.length - 2]}${t}`, r = Math.floor(
|
|
3814
|
+
const s = `${e[e.length - 2]}${t}`, r = Math.floor(Ln(s) / 2), h = Yt(s, r), u = Math.max(1, Math.floor(h / 3));
|
|
3623
3815
|
let g = kt(
|
|
3624
3816
|
s,
|
|
3625
3817
|
h,
|
|
3626
3818
|
u,
|
|
3627
3819
|
s.length,
|
|
3628
|
-
|
|
3820
|
+
Jh
|
|
3629
3821
|
);
|
|
3630
|
-
if (g < 0 && (g =
|
|
3822
|
+
if (g < 0 && (g = Lo(
|
|
3631
3823
|
s,
|
|
3632
3824
|
h,
|
|
3633
3825
|
u,
|
|
@@ -3636,15 +3828,15 @@ const Ko = Symbol("useRichTextEditor"), Ch = (e) => {
|
|
|
3636
3828
|
return e;
|
|
3637
3829
|
const a = [...e];
|
|
3638
3830
|
return a[a.length - 2] = s.slice(0, g).trim(), a[a.length - 1] = s.slice(g).trim(), a.filter(Boolean);
|
|
3639
|
-
},
|
|
3831
|
+
}, Nh = (e, n = {}) => {
|
|
3640
3832
|
const t = {
|
|
3641
|
-
...
|
|
3833
|
+
...Kh,
|
|
3642
3834
|
...n
|
|
3643
|
-
}, i =
|
|
3835
|
+
}, i = Lh(e);
|
|
3644
3836
|
if (!i)
|
|
3645
3837
|
return [];
|
|
3646
|
-
const o =
|
|
3647
|
-
if (
|
|
3838
|
+
const o = Hh(i);
|
|
3839
|
+
if (Ln(o) <= t.minSegmentLength)
|
|
3648
3840
|
return [qi(o)];
|
|
3649
3841
|
const l = [], s = o.split(new RegExp("(?<=[。!?!?\\.])"));
|
|
3650
3842
|
let r = "";
|
|
@@ -3653,15 +3845,15 @@ const Ko = Symbol("useRichTextEditor"), Ch = (e) => {
|
|
|
3653
3845
|
continue;
|
|
3654
3846
|
r += u;
|
|
3655
3847
|
const g = r[r.length - 1] ?? "";
|
|
3656
|
-
|
|
3848
|
+
Ln(r) >= t.minSegmentLength && Vh.test(g) && (l.push(r.trim()), r = "");
|
|
3657
3849
|
}
|
|
3658
|
-
r && (l.length > 0 &&
|
|
3659
|
-
const h = l.flatMap((u) =>
|
|
3660
|
-
return
|
|
3850
|
+
r && (l.length > 0 && Ln(r) < t.minSegmentLength ? l[l.length - 1] += r : l.push(r.trim()));
|
|
3851
|
+
const h = l.flatMap((u) => Ln(u) <= t.maxSegmentLength ? [u] : Th(u, t.maxSegmentLength));
|
|
3852
|
+
return Mh(
|
|
3661
3853
|
h,
|
|
3662
3854
|
t.rebalanceRatio
|
|
3663
3855
|
).map(qi);
|
|
3664
|
-
},
|
|
3856
|
+
}, Ho = (e) => e.type === "text" ? e.text || "" : (e.content || []).map(Ho).join(""), Rh = (e) => {
|
|
3665
3857
|
const n = e.content || [];
|
|
3666
3858
|
let t = "";
|
|
3667
3859
|
const i = [], o = [], l = {
|
|
@@ -3733,7 +3925,7 @@ const Ko = Symbol("useRichTextEditor"), Ch = (e) => {
|
|
|
3733
3925
|
return;
|
|
3734
3926
|
}
|
|
3735
3927
|
if (s.type !== "customTag") return;
|
|
3736
|
-
const r = (c = s.attrs) == null ? void 0 : c.categ, h = (d = s.attrs) == null ? void 0 : d.payload, u = t.length, g =
|
|
3928
|
+
const r = (c = s.attrs) == null ? void 0 : c.categ, h = (d = s.attrs) == null ? void 0 : d.payload, u = t.length, g = Ho(s), a = l[r];
|
|
3737
3929
|
g && o.push({
|
|
3738
3930
|
start: u,
|
|
3739
3931
|
end: u + g.length
|
|
@@ -3748,7 +3940,7 @@ const Ko = Symbol("useRichTextEditor"), Ch = (e) => {
|
|
|
3748
3940
|
protectedRanges: o,
|
|
3749
3941
|
playments: i
|
|
3750
3942
|
};
|
|
3751
|
-
}, zi = (e) => e.type === "text" || e.type === "customTag",
|
|
3943
|
+
}, zi = (e) => e.type === "text" || e.type === "customTag", Fh = (e) => {
|
|
3752
3944
|
const n = e.content || [];
|
|
3753
3945
|
if (e.type === "paragraph") return [e];
|
|
3754
3946
|
if (e.type === "doc")
|
|
@@ -3760,7 +3952,7 @@ const Ko = Symbol("useRichTextEditor"), Ch = (e) => {
|
|
|
3760
3952
|
content: n.filter(zi)
|
|
3761
3953
|
}
|
|
3762
3954
|
] : [];
|
|
3763
|
-
},
|
|
3955
|
+
}, Ph = (e, n) => {
|
|
3764
3956
|
let t = 0;
|
|
3765
3957
|
return n.map((i) => {
|
|
3766
3958
|
const o = e.indexOf(i, t), l = o >= 0 ? o : t, s = l + i.length;
|
|
@@ -3770,7 +3962,7 @@ const Ko = Symbol("useRichTextEditor"), Ch = (e) => {
|
|
|
3770
3962
|
end: s
|
|
3771
3963
|
};
|
|
3772
3964
|
});
|
|
3773
|
-
},
|
|
3965
|
+
}, Eh = (e, n) => e.reduce((t, i) => {
|
|
3774
3966
|
if (n.some(
|
|
3775
3967
|
(l) => i.start > l.start && i.start < l.end
|
|
3776
3968
|
) && t.length) {
|
|
@@ -3778,16 +3970,16 @@ const Ko = Symbol("useRichTextEditor"), Ch = (e) => {
|
|
|
3778
3970
|
return l.text += i.text, l.end = i.end, t;
|
|
3779
3971
|
}
|
|
3780
3972
|
return t.push({ ...i }), t;
|
|
3781
|
-
}, []),
|
|
3782
|
-
const n =
|
|
3973
|
+
}, []), Uh = (e, n, t, i) => e.position >= n && e.position < t ? !0 : !e.text && i && e.position === t, Dh = (e) => {
|
|
3974
|
+
const n = Nh(e.text);
|
|
3783
3975
|
if (n.length <= 1) return [e];
|
|
3784
|
-
const t =
|
|
3785
|
-
|
|
3976
|
+
const t = Eh(
|
|
3977
|
+
Ph(e.text, n),
|
|
3786
3978
|
e.protectedRanges || []
|
|
3787
3979
|
);
|
|
3788
3980
|
return t.map((i, o) => {
|
|
3789
3981
|
const l = o === t.length - 1, s = e.playments.filter(
|
|
3790
|
-
(r) =>
|
|
3982
|
+
(r) => Uh(r, i.start, i.end, l)
|
|
3791
3983
|
).map((r) => ({
|
|
3792
3984
|
...r,
|
|
3793
3985
|
position: r.position - i.start
|
|
@@ -3797,18 +3989,18 @@ const Ko = Symbol("useRichTextEditor"), Ch = (e) => {
|
|
|
3797
3989
|
playments: s
|
|
3798
3990
|
};
|
|
3799
3991
|
});
|
|
3800
|
-
},
|
|
3992
|
+
}, To = (e) => {
|
|
3801
3993
|
const n = {
|
|
3802
3994
|
playments: [],
|
|
3803
3995
|
sentences: []
|
|
3804
3996
|
};
|
|
3805
|
-
return
|
|
3806
|
-
const o =
|
|
3807
|
-
!o.text && !o.playments.length ||
|
|
3997
|
+
return Fh(e).forEach((i) => {
|
|
3998
|
+
const o = Rh(i);
|
|
3999
|
+
!o.text && !o.playments.length || Dh(o).forEach(({ text: l, playments: s }) => {
|
|
3808
4000
|
n.sentences.push(l), n.playments.push(s);
|
|
3809
4001
|
});
|
|
3810
4002
|
}), n;
|
|
3811
|
-
},
|
|
4003
|
+
}, Mo = {
|
|
3812
4004
|
0: "零",
|
|
3813
4005
|
1: "一",
|
|
3814
4006
|
2: "二",
|
|
@@ -3819,20 +4011,20 @@ const Ko = Symbol("useRichTextEditor"), Ch = (e) => {
|
|
|
3819
4011
|
7: "七",
|
|
3820
4012
|
8: "八",
|
|
3821
4013
|
9: "九"
|
|
3822
|
-
},
|
|
3823
|
-
function
|
|
3824
|
-
return e ? e.split("").map((n) =>
|
|
4014
|
+
}, Bh = ["", "十", "百", "千"], Qh = ["", "万", "亿", "万亿"];
|
|
4015
|
+
function _h(e) {
|
|
4016
|
+
return e ? e.split("").map((n) => Mo[n] || n).join("") : "";
|
|
3825
4017
|
}
|
|
3826
|
-
function
|
|
4018
|
+
function $h(e) {
|
|
3827
4019
|
const n = e.length;
|
|
3828
4020
|
let t = "", i = !1;
|
|
3829
4021
|
for (let o = 0; o < n; o++) {
|
|
3830
4022
|
const l = e[o], s = n - 1 - o;
|
|
3831
|
-
l === "0" ? !i && t !== "" && (i = !0) : (i && (t += "零", i = !1), t +=
|
|
4023
|
+
l === "0" ? !i && t !== "" && (i = !0) : (i && (t += "零", i = !1), t += Mo[l] + Bh[s]);
|
|
3832
4024
|
}
|
|
3833
4025
|
return t.startsWith("一十") && t.length === 2 && (t = t.substring(1)), t;
|
|
3834
4026
|
}
|
|
3835
|
-
function
|
|
4027
|
+
function No(e) {
|
|
3836
4028
|
if (!e) return "";
|
|
3837
4029
|
if (e === "0" || (e = e.replace(/^0+/, "") || "0", e === "0")) return "零";
|
|
3838
4030
|
let n = "";
|
|
@@ -3842,23 +4034,23 @@ function Mo(e) {
|
|
|
3842
4034
|
i.unshift(e.substring(l, o));
|
|
3843
4035
|
}
|
|
3844
4036
|
for (let o = 0; o < i.length; o++) {
|
|
3845
|
-
const l = i[o], s =
|
|
4037
|
+
const l = i[o], s = $h(l);
|
|
3846
4038
|
if (s !== "") {
|
|
3847
4039
|
const r = i.length - 1 - o;
|
|
3848
|
-
n += s +
|
|
4040
|
+
n += s + Qh[r];
|
|
3849
4041
|
}
|
|
3850
4042
|
}
|
|
3851
4043
|
return n;
|
|
3852
4044
|
}
|
|
3853
|
-
function
|
|
3854
|
-
return
|
|
4045
|
+
function nu(e) {
|
|
4046
|
+
return No(e);
|
|
3855
4047
|
}
|
|
3856
|
-
const
|
|
3857
|
-
{ label: "基数读法", func:
|
|
4048
|
+
const eu = [
|
|
4049
|
+
{ label: "基数读法", func: _h },
|
|
3858
4050
|
// { label: '位数读法', func: toPhoneReading },
|
|
3859
|
-
{ label: "位数读法", func:
|
|
3860
|
-
{ label: "口语读法", func:
|
|
3861
|
-
],
|
|
4051
|
+
{ label: "位数读法", func: No },
|
|
4052
|
+
{ label: "口语读法", func: nu }
|
|
4053
|
+
], Ro = Object.keys(M), tu = {
|
|
3862
4054
|
1: {
|
|
3863
4055
|
visibleToolTypes: [
|
|
3864
4056
|
M.customStop.type,
|
|
@@ -3870,24 +4062,24 @@ const Uh = [
|
|
|
3870
4062
|
M.aiRewrite.type,
|
|
3871
4063
|
M.upload.type
|
|
3872
4064
|
],
|
|
3873
|
-
languageOptions:
|
|
4065
|
+
languageOptions: De.filter(
|
|
3874
4066
|
(e) => ["zh", "en"].includes(e.value)
|
|
3875
4067
|
),
|
|
3876
4068
|
maxPinyinLength: 4,
|
|
3877
4069
|
maxNumberLength: 16
|
|
3878
4070
|
},
|
|
3879
4071
|
2: {
|
|
3880
|
-
visibleToolTypes:
|
|
3881
|
-
languageOptions:
|
|
4072
|
+
visibleToolTypes: Ro,
|
|
4073
|
+
languageOptions: De,
|
|
3882
4074
|
maxPinyinLength: 4,
|
|
3883
4075
|
maxNumberLength: 16
|
|
3884
4076
|
}
|
|
3885
|
-
},
|
|
3886
|
-
visibleToolTypes:
|
|
3887
|
-
languageOptions:
|
|
4077
|
+
}, iu = {
|
|
4078
|
+
visibleToolTypes: Ro,
|
|
4079
|
+
languageOptions: De,
|
|
3888
4080
|
maxPinyinLength: 4,
|
|
3889
4081
|
maxNumberLength: 16
|
|
3890
|
-
},
|
|
4082
|
+
}, ou = /^[\u3400-\u9fff]+$/, lu = ({
|
|
3891
4083
|
editorContext: e,
|
|
3892
4084
|
openModal: n
|
|
3893
4085
|
}) => {
|
|
@@ -3901,7 +4093,7 @@ const Uh = [
|
|
|
3901
4093
|
hasSelectedText: h,
|
|
3902
4094
|
isSelectedPureNumber: u
|
|
3903
4095
|
} = e, { features: g, notify: a, services: c } = e, d = T(() => {
|
|
3904
|
-
const p =
|
|
4096
|
+
const p = tu[t.value] ?? iu;
|
|
3905
4097
|
return {
|
|
3906
4098
|
visibleToolTypes: g.value.tools ?? p.visibleToolTypes,
|
|
3907
4099
|
languageOptions: g.value.languages ?? p.languageOptions,
|
|
@@ -3917,7 +4109,7 @@ const Uh = [
|
|
|
3917
4109
|
}
|
|
3918
4110
|
);
|
|
3919
4111
|
return Z && a("info", "请选择纯文本"), Z;
|
|
3920
|
-
}, y = (p) =>
|
|
4112
|
+
}, y = (p) => ou.test(p) ? Array.from(p).length > d.value.maxPinyinLength ? (a(
|
|
3921
4113
|
"info",
|
|
3922
4114
|
`最多选择${d.value.maxPinyinLength}个中文`
|
|
3923
4115
|
), !0) : !1 : (a("info", "请选择中文"), !0), z = [
|
|
@@ -3978,7 +4170,7 @@ const Uh = [
|
|
|
3978
4170
|
], C = T(() => {
|
|
3979
4171
|
const p = new Set(d.value.visibleToolTypes);
|
|
3980
4172
|
return z.filter((Z) => p.has(Z.tool.type));
|
|
3981
|
-
}), S = T(() => d.value.languageOptions), W = T(() => u.value ?
|
|
4173
|
+
}), S = T(() => d.value.languageOptions), W = T(() => u.value ? eu.map((p) => ({
|
|
3982
4174
|
label: p.label,
|
|
3983
4175
|
value: p.func(r.value)
|
|
3984
4176
|
})) : []), X = (p) => p === M.formula.type ? !c.value.readFormula : p === M.aiRewrite.type ? !c.value.generateDraft : p === M.upload.type ? !c.value.parseDocument : !1;
|
|
@@ -4001,18 +4193,18 @@ const Uh = [
|
|
|
4001
4193
|
o({ categ: "pinyin", payload: { text: p } });
|
|
4002
4194
|
}
|
|
4003
4195
|
};
|
|
4004
|
-
},
|
|
4196
|
+
}, su = {
|
|
4005
4197
|
1: /* @__PURE__ */ new Set([M.pinyin.type]),
|
|
4006
4198
|
2: /* @__PURE__ */ new Set([
|
|
4007
4199
|
M.pinyin.type,
|
|
4008
4200
|
M.continue.type,
|
|
4009
4201
|
M.stop.type
|
|
4010
4202
|
])
|
|
4011
|
-
},
|
|
4203
|
+
}, Fo = (e, n) => {
|
|
4012
4204
|
var i, o;
|
|
4013
|
-
const t =
|
|
4014
|
-
return t != null && t.size ? e.type === fe && t.has((i = e.attrs) == null ? void 0 : i.categ) ? !0 : ((o = e.content) == null ? void 0 : o.some((l) =>
|
|
4015
|
-
},
|
|
4205
|
+
const t = su[n];
|
|
4206
|
+
return t != null && t.size ? e.type === fe && t.has((i = e.attrs) == null ? void 0 : i.categ) ? !0 : ((o = e.content) == null ? void 0 : o.some((l) => Fo(l, n))) ?? !1 : !1;
|
|
4207
|
+
}, ru = (e) => {
|
|
4016
4208
|
const { richTextEditor: n } = e, t = (r) => `V${r}`, i = (r) => r === 2 ? "#00a2ff" : "#ff9900", o = (r, h) => {
|
|
4017
4209
|
const u = t(r), g = t(h);
|
|
4018
4210
|
return `
|
|
@@ -4047,30 +4239,30 @@ const Uh = [
|
|
|
4047
4239
|
var a;
|
|
4048
4240
|
if (r === h) return !0;
|
|
4049
4241
|
const u = (a = n.editor.value) == null ? void 0 : a.getJSON();
|
|
4050
|
-
if (!u || !
|
|
4242
|
+
if (!u || !Fo(u, r)) return !0;
|
|
4051
4243
|
const g = await l(r, h);
|
|
4052
4244
|
return g && n.clearContent(), g;
|
|
4053
4245
|
} };
|
|
4054
|
-
},
|
|
4246
|
+
}, hu = /* @__PURE__ */ $({
|
|
4055
4247
|
__name: "index",
|
|
4056
4248
|
setup(e) {
|
|
4057
|
-
const { editor: n } =
|
|
4249
|
+
const { editor: n } = Gn();
|
|
4058
4250
|
return (t, i) => j(n) ? (Y(), _(j(ns), {
|
|
4059
4251
|
key: 0,
|
|
4060
4252
|
class: "tts-editor-content",
|
|
4061
4253
|
editor: j(n)
|
|
4062
4254
|
}, null, 8, ["editor"])) : yn("", !0);
|
|
4063
4255
|
}
|
|
4064
|
-
}),
|
|
4256
|
+
}), uu = /* @__PURE__ */ sn(hu, [["__scopeId", "data-v-d764ae22"]]), Po = ["top", "right", "bottom", "left"], bi = ["start", "end"], ji = /* @__PURE__ */ Po.reduce((e, n) => e.concat(n, n + "-" + bi[0], n + "-" + bi[1]), []), Yn = Math.min, Cn = Math.max, Qe = Math.round, Mn = (e) => ({
|
|
4065
4257
|
x: e,
|
|
4066
4258
|
y: e
|
|
4067
|
-
}),
|
|
4259
|
+
}), au = {
|
|
4068
4260
|
left: "right",
|
|
4069
4261
|
right: "left",
|
|
4070
4262
|
bottom: "top",
|
|
4071
4263
|
top: "bottom"
|
|
4072
4264
|
};
|
|
4073
|
-
function
|
|
4265
|
+
function Eo(e, n, t) {
|
|
4074
4266
|
return Cn(e, Yn(n, t));
|
|
4075
4267
|
}
|
|
4076
4268
|
function Nn(e, n) {
|
|
@@ -4082,7 +4274,7 @@ function Wn(e) {
|
|
|
4082
4274
|
function In(e) {
|
|
4083
4275
|
return e.split("-")[1];
|
|
4084
4276
|
}
|
|
4085
|
-
function
|
|
4277
|
+
function Uo(e) {
|
|
4086
4278
|
return e === "x" ? "y" : "x";
|
|
4087
4279
|
}
|
|
4088
4280
|
function Dt(e) {
|
|
@@ -4093,44 +4285,44 @@ function Sn(e) {
|
|
|
4093
4285
|
return n === "t" || n === "b" ? "y" : "x";
|
|
4094
4286
|
}
|
|
4095
4287
|
function Bt(e) {
|
|
4096
|
-
return
|
|
4288
|
+
return Uo(Sn(e));
|
|
4097
4289
|
}
|
|
4098
|
-
function
|
|
4290
|
+
function Do(e, n, t) {
|
|
4099
4291
|
t === void 0 && (t = !1);
|
|
4100
4292
|
const i = In(e), o = Bt(e), l = Dt(o);
|
|
4101
4293
|
let s = o === "x" ? i === (t ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4102
|
-
return n.reference[l] > n.floating[l] && (s =
|
|
4294
|
+
return n.reference[l] > n.floating[l] && (s = $e(s)), [s, $e(s)];
|
|
4103
4295
|
}
|
|
4104
|
-
function
|
|
4105
|
-
const n =
|
|
4106
|
-
return [
|
|
4296
|
+
function gu(e) {
|
|
4297
|
+
const n = $e(e);
|
|
4298
|
+
return [_e(e), n, _e(n)];
|
|
4107
4299
|
}
|
|
4108
|
-
function
|
|
4300
|
+
function _e(e) {
|
|
4109
4301
|
return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
|
|
4110
4302
|
}
|
|
4111
|
-
const vi = ["left", "right"], Ai = ["right", "left"],
|
|
4112
|
-
function
|
|
4303
|
+
const vi = ["left", "right"], Ai = ["right", "left"], cu = ["top", "bottom"], du = ["bottom", "top"];
|
|
4304
|
+
function mu(e, n, t) {
|
|
4113
4305
|
switch (e) {
|
|
4114
4306
|
case "top":
|
|
4115
4307
|
case "bottom":
|
|
4116
4308
|
return t ? n ? Ai : vi : n ? vi : Ai;
|
|
4117
4309
|
case "left":
|
|
4118
4310
|
case "right":
|
|
4119
|
-
return n ?
|
|
4311
|
+
return n ? cu : du;
|
|
4120
4312
|
default:
|
|
4121
4313
|
return [];
|
|
4122
4314
|
}
|
|
4123
4315
|
}
|
|
4124
|
-
function
|
|
4316
|
+
function pu(e, n, t, i) {
|
|
4125
4317
|
const o = In(e);
|
|
4126
|
-
let l =
|
|
4127
|
-
return o && (l = l.map((s) => s + "-" + o), n && (l = l.concat(l.map(
|
|
4318
|
+
let l = mu(Wn(e), t === "start", i);
|
|
4319
|
+
return o && (l = l.map((s) => s + "-" + o), n && (l = l.concat(l.map(_e)))), l;
|
|
4128
4320
|
}
|
|
4129
|
-
function
|
|
4321
|
+
function $e(e) {
|
|
4130
4322
|
const n = Wn(e);
|
|
4131
|
-
return
|
|
4323
|
+
return au[n] + e.slice(n.length);
|
|
4132
4324
|
}
|
|
4133
|
-
function
|
|
4325
|
+
function fu(e) {
|
|
4134
4326
|
var n, t, i, o;
|
|
4135
4327
|
return {
|
|
4136
4328
|
top: (n = e.top) != null ? n : 0,
|
|
@@ -4140,7 +4332,7 @@ function uu(e) {
|
|
|
4140
4332
|
};
|
|
4141
4333
|
}
|
|
4142
4334
|
function Qt(e) {
|
|
4143
|
-
return typeof e != "number" ?
|
|
4335
|
+
return typeof e != "number" ? fu(e) : {
|
|
4144
4336
|
top: e,
|
|
4145
4337
|
right: e,
|
|
4146
4338
|
bottom: e,
|
|
@@ -4206,7 +4398,7 @@ function Zi(e, n, t) {
|
|
|
4206
4398
|
const f = In(n);
|
|
4207
4399
|
return f && (d[s] += c * (f === "end" ? 1 : -1) * (t && u ? -1 : 1)), d;
|
|
4208
4400
|
}
|
|
4209
|
-
async function
|
|
4401
|
+
async function yu(e, n) {
|
|
4210
4402
|
var t;
|
|
4211
4403
|
n === void 0 && (n = {});
|
|
4212
4404
|
const {
|
|
@@ -4248,7 +4440,7 @@ async function au(e, n) {
|
|
|
4248
4440
|
right: (X.right - z.right + f.right) / W.x
|
|
4249
4441
|
};
|
|
4250
4442
|
}
|
|
4251
|
-
const
|
|
4443
|
+
const qu = 50, zu = async (e, n, t) => {
|
|
4252
4444
|
const {
|
|
4253
4445
|
placement: i = "bottom",
|
|
4254
4446
|
strategy: o = "absolute",
|
|
@@ -4256,7 +4448,7 @@ const gu = 50, cu = async (e, n, t) => {
|
|
|
4256
4448
|
platform: s
|
|
4257
4449
|
} = t, r = s.detectOverflow ? s : {
|
|
4258
4450
|
...s,
|
|
4259
|
-
detectOverflow:
|
|
4451
|
+
detectOverflow: yu
|
|
4260
4452
|
}, h = await (s.isRTL == null ? void 0 : s.isRTL(n));
|
|
4261
4453
|
let u = await s.getElementRects({
|
|
4262
4454
|
reference: e,
|
|
@@ -4296,7 +4488,7 @@ const gu = 50, cu = async (e, n, t) => {
|
|
|
4296
4488
|
g = S ?? g, a = W ?? a, f[z] = {
|
|
4297
4489
|
...f[z],
|
|
4298
4490
|
...X
|
|
4299
|
-
}, K && d <
|
|
4491
|
+
}, K && d < qu && (d++, typeof K == "object" && (K.placement && (c = K.placement), K.rects && (u = K.rects === !0 ? await s.getElementRects({
|
|
4300
4492
|
reference: e,
|
|
4301
4493
|
floating: n,
|
|
4302
4494
|
strategy: o
|
|
@@ -4312,7 +4504,7 @@ const gu = 50, cu = async (e, n, t) => {
|
|
|
4312
4504
|
strategy: o,
|
|
4313
4505
|
middlewareData: f
|
|
4314
4506
|
};
|
|
4315
|
-
},
|
|
4507
|
+
}, bu = (e) => ({
|
|
4316
4508
|
name: "arrow",
|
|
4317
4509
|
options: e,
|
|
4318
4510
|
async fn(n) {
|
|
@@ -4336,7 +4528,7 @@ const gu = 50, cu = async (e, n, t) => {
|
|
|
4336
4528
|
}, d = Bt(o), f = Dt(d), m = await s.getDimensions(u), y = d === "y", z = y ? "top" : "left", C = y ? "bottom" : "right", S = y ? "clientHeight" : "clientWidth", W = l.reference[f] + l.reference[d] - c[d] - l.floating[f], X = c[d] - l.reference[d], K = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(u));
|
|
4337
4529
|
let V = K ? K[S] : 0;
|
|
4338
4530
|
(!V || !await (s.isElement == null ? void 0 : s.isElement(K))) && (V = r.floating[S] || l.floating[f]);
|
|
4339
|
-
const H = W / 2 - X / 2, F = V / 2 - m[f] / 2 - 1, v = Yn(a[z], F), p = Yn(a[C], F), Z = V - m[f] - p, O = V / 2 - m[f] / 2 + H, q =
|
|
4531
|
+
const H = W / 2 - X / 2, F = V / 2 - m[f] / 2 - 1, v = Yn(a[z], F), p = Yn(a[C], F), Z = V - m[f] - p, O = V / 2 - m[f] / 2 + H, q = Eo(v, O, Z), I = !h.arrow && In(o) != null && O !== q && l.reference[f] / 2 - (O < v ? v : p) - m[f] / 2 < 0, b = I ? O < v ? O - v : O - Z : 0;
|
|
4340
4532
|
return {
|
|
4341
4533
|
[d]: c[d] + b,
|
|
4342
4534
|
data: {
|
|
@@ -4350,10 +4542,10 @@ const gu = 50, cu = async (e, n, t) => {
|
|
|
4350
4542
|
};
|
|
4351
4543
|
}
|
|
4352
4544
|
});
|
|
4353
|
-
function
|
|
4354
|
-
return (e ? [...t.filter((o) => In(o) === e), ...t.filter((o) => In(o) !== e)] : t.filter((o) => Wn(o) === o)).filter((o) => e ? In(o) === e || (n ?
|
|
4545
|
+
function ju(e, n, t) {
|
|
4546
|
+
return (e ? [...t.filter((o) => In(o) === e), ...t.filter((o) => In(o) !== e)] : t.filter((o) => Wn(o) === o)).filter((o) => e ? In(o) === e || (n ? _e(o) !== o : !1) : !0);
|
|
4355
4547
|
}
|
|
4356
|
-
const
|
|
4548
|
+
const vu = function(e) {
|
|
4357
4549
|
return e === void 0 && (e = {}), {
|
|
4358
4550
|
name: "autoPlacement",
|
|
4359
4551
|
options: e,
|
|
@@ -4371,7 +4563,7 @@ const pu = function(e) {
|
|
|
4371
4563
|
allowedPlacements: c = ji,
|
|
4372
4564
|
autoAlignment: d = !0,
|
|
4373
4565
|
...f
|
|
4374
|
-
} = Nn(e, n), m = a !== void 0 || c === ji ?
|
|
4566
|
+
} = Nn(e, n), m = a !== void 0 || c === ji ? ju(a || null, d, c) : c, y = ((t = s.autoPlacement) == null ? void 0 : t.index) || 0, z = m[y];
|
|
4375
4567
|
if (z == null)
|
|
4376
4568
|
return {};
|
|
4377
4569
|
if (r !== z)
|
|
@@ -4380,7 +4572,7 @@ const pu = function(e) {
|
|
|
4380
4572
|
placement: m[0]
|
|
4381
4573
|
}
|
|
4382
4574
|
};
|
|
4383
|
-
const C = await h.detectOverflow(n, f), S =
|
|
4575
|
+
const C = await h.detectOverflow(n, f), S = Do(z, l, await (h.isRTL == null ? void 0 : h.isRTL(u.floating))), W = [C[Wn(z)], C[S[0]], C[S[1]]], X = [...((i = s.autoPlacement) == null ? void 0 : i.overflows) || [], {
|
|
4384
4576
|
placement: z,
|
|
4385
4577
|
overflows: W
|
|
4386
4578
|
}], K = m[y + 1];
|
|
@@ -4420,7 +4612,7 @@ const pu = function(e) {
|
|
|
4420
4612
|
} : {};
|
|
4421
4613
|
}
|
|
4422
4614
|
};
|
|
4423
|
-
},
|
|
4615
|
+
}, Au = function(e) {
|
|
4424
4616
|
return e === void 0 && (e = {}), {
|
|
4425
4617
|
name: "flip",
|
|
4426
4618
|
options: e,
|
|
@@ -4444,12 +4636,12 @@ const pu = function(e) {
|
|
|
4444
4636
|
} = Nn(e, n);
|
|
4445
4637
|
if ((t = l.arrow) != null && t.alignmentOffset)
|
|
4446
4638
|
return {};
|
|
4447
|
-
const z = Wn(o), C = Sn(r), S = Wn(r) === r, W = await (h.isRTL == null ? void 0 : h.isRTL(u.floating)), X = c || (S || !m ? [
|
|
4448
|
-
!c && K && X.push(...
|
|
4639
|
+
const z = Wn(o), C = Sn(r), S = Wn(r) === r, W = await (h.isRTL == null ? void 0 : h.isRTL(u.floating)), X = c || (S || !m ? [$e(r)] : gu(r)), K = f !== "none";
|
|
4640
|
+
!c && K && X.push(...pu(r, m, f, W));
|
|
4449
4641
|
const V = [r, ...X], H = await h.detectOverflow(n, y), F = [];
|
|
4450
4642
|
let v = ((i = l.flip) == null ? void 0 : i.overflows) || [];
|
|
4451
4643
|
if (g && F.push(H[z]), a) {
|
|
4452
|
-
const q =
|
|
4644
|
+
const q = Do(o, s, W);
|
|
4453
4645
|
F.push(H[q[0]], H[q[1]]);
|
|
4454
4646
|
}
|
|
4455
4647
|
if (v = [...v, {
|
|
@@ -4511,9 +4703,9 @@ function xi(e, n) {
|
|
|
4511
4703
|
};
|
|
4512
4704
|
}
|
|
4513
4705
|
function Ci(e) {
|
|
4514
|
-
return
|
|
4706
|
+
return Po.some((n) => e[n] >= 0);
|
|
4515
4707
|
}
|
|
4516
|
-
const
|
|
4708
|
+
const Zu = function(e) {
|
|
4517
4709
|
return e === void 0 && (e = {}), {
|
|
4518
4710
|
name: "hide",
|
|
4519
4711
|
options: e,
|
|
@@ -4556,7 +4748,7 @@ const yu = function(e) {
|
|
|
4556
4748
|
}
|
|
4557
4749
|
};
|
|
4558
4750
|
};
|
|
4559
|
-
function
|
|
4751
|
+
function Bo(e) {
|
|
4560
4752
|
const n = Yn(...e.map((l) => l.left)), t = Yn(...e.map((l) => l.top)), i = Cn(...e.map((l) => l.right)), o = Cn(...e.map((l) => l.bottom));
|
|
4561
4753
|
return {
|
|
4562
4754
|
x: n,
|
|
@@ -4565,16 +4757,16 @@ function Do(e) {
|
|
|
4565
4757
|
height: o - t
|
|
4566
4758
|
};
|
|
4567
4759
|
}
|
|
4568
|
-
function
|
|
4760
|
+
function xu(e) {
|
|
4569
4761
|
const n = e.slice().sort((o, l) => o.y - l.y), t = [];
|
|
4570
4762
|
let i = null;
|
|
4571
4763
|
for (let o = 0; o < n.length; o++) {
|
|
4572
4764
|
const l = n[o];
|
|
4573
4765
|
!i || l.y - i.y > i.height / 2 ? t.push([l]) : t[t.length - 1].push(l), i = l;
|
|
4574
4766
|
}
|
|
4575
|
-
return t.map((o) => Fn(
|
|
4767
|
+
return t.map((o) => Fn(Bo(o)));
|
|
4576
4768
|
}
|
|
4577
|
-
const
|
|
4769
|
+
const Cu = function(e) {
|
|
4578
4770
|
return e === void 0 && (e = {}), {
|
|
4579
4771
|
name: "inline",
|
|
4580
4772
|
options: e,
|
|
@@ -4592,7 +4784,7 @@ const zu = function(e) {
|
|
|
4592
4784
|
} = Nn(e, n), g = Array.from(await (l.getClientRects == null ? void 0 : l.getClientRects(i.reference)) || []);
|
|
4593
4785
|
if (!g.length)
|
|
4594
4786
|
return {};
|
|
4595
|
-
const a =
|
|
4787
|
+
const a = xu(g), c = Fn(Bo(g)), d = Qt(r);
|
|
4596
4788
|
function f() {
|
|
4597
4789
|
if (a.length === 2 && (a[0].left > a[1].right || a[1].left > a[0].right) && h != null && u != null)
|
|
4598
4790
|
return a.find((y) => h > y.left - d.left && h < y.right + d.right && u > y.top - d.top && u < y.bottom + d.bottom) || c;
|
|
@@ -4630,13 +4822,13 @@ const zu = function(e) {
|
|
|
4630
4822
|
} : {};
|
|
4631
4823
|
}
|
|
4632
4824
|
};
|
|
4633
|
-
},
|
|
4634
|
-
async function
|
|
4825
|
+
}, Iu = /* @__PURE__ */ new Set(["left", "top"]);
|
|
4826
|
+
async function Wu(e, n) {
|
|
4635
4827
|
const {
|
|
4636
4828
|
placement: t,
|
|
4637
4829
|
platform: i,
|
|
4638
4830
|
elements: o
|
|
4639
|
-
} = e, l = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), s = Wn(t), r = In(t), h = Sn(t) === "y", u =
|
|
4831
|
+
} = e, l = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), s = Wn(t), r = In(t), h = Sn(t) === "y", u = Iu.has(s) ? -1 : 1, g = l && h ? -1 : 1, a = Nn(n, e);
|
|
4640
4832
|
let {
|
|
4641
4833
|
mainAxis: c,
|
|
4642
4834
|
crossAxis: d,
|
|
@@ -4658,7 +4850,7 @@ async function ju(e, n) {
|
|
|
4658
4850
|
y: d * g
|
|
4659
4851
|
};
|
|
4660
4852
|
}
|
|
4661
|
-
const
|
|
4853
|
+
const wu = function(e) {
|
|
4662
4854
|
return e === void 0 && (e = 0), {
|
|
4663
4855
|
name: "offset",
|
|
4664
4856
|
options: e,
|
|
@@ -4669,7 +4861,7 @@ const vu = function(e) {
|
|
|
4669
4861
|
y: l,
|
|
4670
4862
|
placement: s,
|
|
4671
4863
|
middlewareData: r
|
|
4672
|
-
} = n, h = await
|
|
4864
|
+
} = n, h = await Wu(n, e);
|
|
4673
4865
|
return s === ((t = r.offset) == null ? void 0 : t.placement) && (i = r.arrow) != null && i.alignmentOffset ? {} : {
|
|
4674
4866
|
x: o + h.x,
|
|
4675
4867
|
y: l + h.y,
|
|
@@ -4680,7 +4872,7 @@ const vu = function(e) {
|
|
|
4680
4872
|
};
|
|
4681
4873
|
}
|
|
4682
4874
|
};
|
|
4683
|
-
},
|
|
4875
|
+
}, Su = function(e) {
|
|
4684
4876
|
return e === void 0 && (e = {}), {
|
|
4685
4877
|
name: "shift",
|
|
4686
4878
|
options: e,
|
|
@@ -4709,9 +4901,9 @@ const vu = function(e) {
|
|
|
4709
4901
|
} = Nn(e, n), g = {
|
|
4710
4902
|
x: t,
|
|
4711
4903
|
y: i
|
|
4712
|
-
}, a = await l.detectOverflow(n, u), c = Sn(o), d =
|
|
4904
|
+
}, a = await l.detectOverflow(n, u), c = Sn(o), d = Uo(c);
|
|
4713
4905
|
let f = g[d], m = g[c];
|
|
4714
|
-
const y = (C, S) =>
|
|
4906
|
+
const y = (C, S) => Eo(S + a[C === "y" ? "top" : "left"], S, S - a[C === "y" ? "bottom" : "right"]);
|
|
4715
4907
|
s && (f = y(d, f)), r && (m = y(c, m));
|
|
4716
4908
|
const z = h.fn({
|
|
4717
4909
|
...n,
|
|
@@ -4731,7 +4923,7 @@ const vu = function(e) {
|
|
|
4731
4923
|
};
|
|
4732
4924
|
}
|
|
4733
4925
|
};
|
|
4734
|
-
},
|
|
4926
|
+
}, Ou = function(e) {
|
|
4735
4927
|
return e === void 0 && (e = {}), {
|
|
4736
4928
|
name: "size",
|
|
4737
4929
|
options: e,
|
|
@@ -4771,7 +4963,7 @@ function ot() {
|
|
|
4771
4963
|
return typeof window < "u";
|
|
4772
4964
|
}
|
|
4773
4965
|
function qe(e) {
|
|
4774
|
-
return
|
|
4966
|
+
return Qo(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
4775
4967
|
}
|
|
4776
4968
|
function fn(e) {
|
|
4777
4969
|
var n;
|
|
@@ -4779,9 +4971,9 @@ function fn(e) {
|
|
|
4779
4971
|
}
|
|
4780
4972
|
function Un(e) {
|
|
4781
4973
|
var n;
|
|
4782
|
-
return (n = (
|
|
4974
|
+
return (n = (Qo(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : n.documentElement;
|
|
4783
4975
|
}
|
|
4784
|
-
function
|
|
4976
|
+
function Qo(e) {
|
|
4785
4977
|
return ot() ? e instanceof Node || e instanceof fn(e).Node : !1;
|
|
4786
4978
|
}
|
|
4787
4979
|
function kn(e) {
|
|
@@ -4802,7 +4994,7 @@ function lt(e) {
|
|
|
4802
4994
|
} = Kn(e);
|
|
4803
4995
|
return /auto|scroll|overlay|hidden|clip/.test(n + i + t) && o !== "inline" && o !== "contents";
|
|
4804
4996
|
}
|
|
4805
|
-
function
|
|
4997
|
+
function Yu(e) {
|
|
4806
4998
|
return /^(table|td|th)$/.test(qe(e));
|
|
4807
4999
|
}
|
|
4808
5000
|
function st(e) {
|
|
@@ -4817,13 +5009,13 @@ function st(e) {
|
|
|
4817
5009
|
return !1;
|
|
4818
5010
|
}
|
|
4819
5011
|
}
|
|
4820
|
-
const
|
|
5012
|
+
const ku = /transform|translate|scale|rotate|perspective|filter/, Ku = /paint|layout|strict|content/, _n = (e) => !!e && e !== "none";
|
|
4821
5013
|
let yt;
|
|
4822
5014
|
function _t(e) {
|
|
4823
5015
|
const n = kn(e) ? Kn(e) : e;
|
|
4824
|
-
return _n(n.transform) || _n(n.translate) || _n(n.scale) || _n(n.rotate) || _n(n.perspective) || !$t() && (_n(n.backdropFilter) || _n(n.filter)) ||
|
|
5016
|
+
return _n(n.transform) || _n(n.translate) || _n(n.scale) || _n(n.rotate) || _n(n.perspective) || !$t() && (_n(n.backdropFilter) || _n(n.filter)) || ku.test(n.willChange || "") || Ku.test(n.contain || "");
|
|
4825
5017
|
}
|
|
4826
|
-
function
|
|
5018
|
+
function Vu(e) {
|
|
4827
5019
|
let n = oe(e);
|
|
4828
5020
|
for (; Dn(n) && !We(n); ) {
|
|
4829
5021
|
if (_t(n))
|
|
@@ -4864,64 +5056,64 @@ function oe(e) {
|
|
|
4864
5056
|
);
|
|
4865
5057
|
return Ii(n) ? n.host : n;
|
|
4866
5058
|
}
|
|
4867
|
-
function
|
|
5059
|
+
function _o(e) {
|
|
4868
5060
|
const n = oe(e);
|
|
4869
|
-
return We(n) ? (e.ownerDocument || e).body : Dn(n) && lt(n) ? n :
|
|
5061
|
+
return We(n) ? (e.ownerDocument || e).body : Dn(n) && lt(n) ? n : _o(n);
|
|
4870
5062
|
}
|
|
4871
|
-
function
|
|
5063
|
+
function $o(e, n, t) {
|
|
4872
5064
|
var i;
|
|
4873
5065
|
n === void 0 && (n = []);
|
|
4874
|
-
const o =
|
|
4875
|
-
return l ? (Kt(s), n.concat(s, s.visualViewport || [], lt(o) ? o : [], [])) : n.concat(o,
|
|
5066
|
+
const o = _o(e), l = o === ((i = e.ownerDocument) == null ? void 0 : i.body), s = fn(o);
|
|
5067
|
+
return l ? (Kt(s), n.concat(s, s.visualViewport || [], lt(o) ? o : [], [])) : n.concat(o, $o(o, []));
|
|
4876
5068
|
}
|
|
4877
5069
|
function Kt(e) {
|
|
4878
5070
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
4879
5071
|
}
|
|
4880
|
-
function
|
|
5072
|
+
function nl(e) {
|
|
4881
5073
|
const n = Kn(e);
|
|
4882
5074
|
let t = parseFloat(n.width) || 0, i = parseFloat(n.height) || 0;
|
|
4883
|
-
const o = Dn(e), l = o ? e.offsetWidth : t, s = o ? e.offsetHeight : i, r =
|
|
5075
|
+
const o = Dn(e), l = o ? e.offsetWidth : t, s = o ? e.offsetHeight : i, r = Qe(t) !== l || Qe(i) !== s;
|
|
4884
5076
|
return r && (t = l, i = s), {
|
|
4885
5077
|
width: t,
|
|
4886
5078
|
height: i,
|
|
4887
5079
|
$: r
|
|
4888
5080
|
};
|
|
4889
5081
|
}
|
|
4890
|
-
function
|
|
5082
|
+
function el(e) {
|
|
4891
5083
|
return kn(e) ? e : e.contextElement;
|
|
4892
5084
|
}
|
|
4893
5085
|
function de(e) {
|
|
4894
|
-
const n =
|
|
5086
|
+
const n = el(e);
|
|
4895
5087
|
if (!Dn(n))
|
|
4896
|
-
return
|
|
5088
|
+
return Mn(1);
|
|
4897
5089
|
const t = n.getBoundingClientRect(), {
|
|
4898
5090
|
width: i,
|
|
4899
5091
|
height: o,
|
|
4900
5092
|
$: l
|
|
4901
|
-
} =
|
|
4902
|
-
let s = (l ?
|
|
5093
|
+
} = nl(n);
|
|
5094
|
+
let s = (l ? Qe(t.width) : t.width) / i, r = (l ? Qe(t.height) : t.height) / o;
|
|
4903
5095
|
return (!s || !Number.isFinite(s)) && (s = 1), (!r || !Number.isFinite(r)) && (r = 1), {
|
|
4904
5096
|
x: s,
|
|
4905
5097
|
y: r
|
|
4906
5098
|
};
|
|
4907
5099
|
}
|
|
4908
|
-
const
|
|
4909
|
-
function
|
|
5100
|
+
const Gu = /* @__PURE__ */ Mn(0);
|
|
5101
|
+
function tl(e) {
|
|
4910
5102
|
const n = fn(e);
|
|
4911
|
-
return !$t() || !n.visualViewport ?
|
|
5103
|
+
return !$t() || !n.visualViewport ? Gu : {
|
|
4912
5104
|
x: n.visualViewport.offsetLeft,
|
|
4913
5105
|
y: n.visualViewport.offsetTop
|
|
4914
5106
|
};
|
|
4915
5107
|
}
|
|
4916
|
-
function
|
|
5108
|
+
function Xu(e, n, t) {
|
|
4917
5109
|
return n === void 0 && (n = !1), !!t && n && t === fn(e);
|
|
4918
5110
|
}
|
|
4919
5111
|
function we(e, n, t, i) {
|
|
4920
5112
|
n === void 0 && (n = !1), t === void 0 && (t = !1);
|
|
4921
|
-
const o = e.getBoundingClientRect(), l =
|
|
4922
|
-
let s =
|
|
5113
|
+
const o = e.getBoundingClientRect(), l = el(e);
|
|
5114
|
+
let s = Mn(1);
|
|
4923
5115
|
n && (i ? kn(i) && (s = de(i)) : s = de(e));
|
|
4924
|
-
const r =
|
|
5116
|
+
const r = Xu(l, t, i) ? tl(l) : Mn(0);
|
|
4925
5117
|
let h = (o.left + r.x) / s.x, u = (o.top + r.y) / s.y, g = o.width / s.x, a = o.height / s.y;
|
|
4926
5118
|
if (l && i) {
|
|
4927
5119
|
const c = fn(l), d = kn(i) ? fn(i) : i;
|
|
@@ -4942,14 +5134,14 @@ function ht(e, n) {
|
|
|
4942
5134
|
const t = rt(e).scrollLeft;
|
|
4943
5135
|
return n ? n.left + t : we(Un(e)).left + t;
|
|
4944
5136
|
}
|
|
4945
|
-
function
|
|
5137
|
+
function il(e, n) {
|
|
4946
5138
|
const t = e.getBoundingClientRect(), i = t.left + n.scrollLeft - ht(e, t), o = t.top + n.scrollTop;
|
|
4947
5139
|
return {
|
|
4948
5140
|
x: i,
|
|
4949
5141
|
y: o
|
|
4950
5142
|
};
|
|
4951
5143
|
}
|
|
4952
|
-
function
|
|
5144
|
+
function Ju(e) {
|
|
4953
5145
|
let {
|
|
4954
5146
|
elements: n,
|
|
4955
5147
|
rect: t,
|
|
@@ -4962,13 +5154,13 @@ function Ou(e) {
|
|
|
4962
5154
|
let h = {
|
|
4963
5155
|
scrollLeft: 0,
|
|
4964
5156
|
scrollTop: 0
|
|
4965
|
-
}, u =
|
|
4966
|
-
const g =
|
|
5157
|
+
}, u = Mn(1);
|
|
5158
|
+
const g = Mn(0), a = Dn(i);
|
|
4967
5159
|
if ((a || !l) && ((qe(i) !== "body" || lt(s)) && (h = rt(i)), a)) {
|
|
4968
5160
|
const d = we(i);
|
|
4969
5161
|
u = de(i), g.x = d.x + i.clientLeft, g.y = d.y + i.clientTop;
|
|
4970
5162
|
}
|
|
4971
|
-
const c = s && !a && !l ?
|
|
5163
|
+
const c = s && !a && !l ? il(s, h) : Mn(0);
|
|
4972
5164
|
return {
|
|
4973
5165
|
width: t.width * u.x,
|
|
4974
5166
|
height: t.height * u.y,
|
|
@@ -4976,10 +5168,10 @@ function Ou(e) {
|
|
|
4976
5168
|
y: t.y * u.y - h.scrollTop * u.y + g.y + c.y
|
|
4977
5169
|
};
|
|
4978
5170
|
}
|
|
4979
|
-
function
|
|
5171
|
+
function Lu(e) {
|
|
4980
5172
|
return e.getClientRects ? Array.from(e.getClientRects()) : [];
|
|
4981
5173
|
}
|
|
4982
|
-
function
|
|
5174
|
+
function Hu(e) {
|
|
4983
5175
|
const n = rt(e), t = e.ownerDocument.body, i = Cn(e.scrollWidth, e.clientWidth, t.scrollWidth, t.clientWidth), o = Cn(e.scrollHeight, e.clientHeight, t.scrollHeight, t.clientHeight);
|
|
4984
5176
|
let l = -n.scrollLeft + ht(e);
|
|
4985
5177
|
const s = -n.scrollTop;
|
|
@@ -4990,8 +5182,8 @@ function ku(e) {
|
|
|
4990
5182
|
y: s
|
|
4991
5183
|
};
|
|
4992
5184
|
}
|
|
4993
|
-
const
|
|
4994
|
-
function
|
|
5185
|
+
const Tu = 25;
|
|
5186
|
+
function Mu(e, n, t) {
|
|
4995
5187
|
t === void 0 && (t = "viewport");
|
|
4996
5188
|
const i = t === "layoutViewport", o = fn(e), l = Un(e), s = o.visualViewport;
|
|
4997
5189
|
let r = l.clientWidth, h = l.clientHeight, u = 0, g = 0;
|
|
@@ -5001,7 +5193,7 @@ function Vu(e, n, t) {
|
|
|
5001
5193
|
}
|
|
5002
5194
|
if (ht(l) <= 0) {
|
|
5003
5195
|
const c = l.ownerDocument, d = c.body, f = getComputedStyle(d), m = c.compatMode === "CSS1Compat" && parseFloat(f.marginLeft) + parseFloat(f.marginRight) || 0, y = Math.abs(l.clientWidth - d.clientWidth - m), z = getComputedStyle(l).scrollbarGutter === "stable both-edges" ? y / 2 : y;
|
|
5004
|
-
z <=
|
|
5196
|
+
z <= Tu && (r -= z);
|
|
5005
5197
|
}
|
|
5006
5198
|
return {
|
|
5007
5199
|
width: r,
|
|
@@ -5010,7 +5202,7 @@ function Vu(e, n, t) {
|
|
|
5010
5202
|
y: g
|
|
5011
5203
|
};
|
|
5012
5204
|
}
|
|
5013
|
-
function
|
|
5205
|
+
function Nu(e, n) {
|
|
5014
5206
|
const t = we(e, !0, n === "fixed"), i = t.top + e.clientTop, o = t.left + e.clientLeft, l = de(e), s = e.clientWidth * l.x, r = e.clientHeight * l.y, h = o * l.x, u = i * l.y;
|
|
5015
5207
|
return {
|
|
5016
5208
|
width: s,
|
|
@@ -5022,13 +5214,13 @@ function Gu(e, n) {
|
|
|
5022
5214
|
function Wi(e, n, t) {
|
|
5023
5215
|
let i;
|
|
5024
5216
|
if (n === "viewport" || n === "layoutViewport")
|
|
5025
|
-
i =
|
|
5217
|
+
i = Mu(e, t, n);
|
|
5026
5218
|
else if (n === "document")
|
|
5027
|
-
i =
|
|
5219
|
+
i = Hu(Un(e));
|
|
5028
5220
|
else if (kn(n))
|
|
5029
|
-
i =
|
|
5221
|
+
i = Nu(n, t);
|
|
5030
5222
|
else {
|
|
5031
|
-
const o =
|
|
5223
|
+
const o = tl(e);
|
|
5032
5224
|
i = {
|
|
5033
5225
|
x: n.x - o.x,
|
|
5034
5226
|
y: n.y - o.y,
|
|
@@ -5038,11 +5230,11 @@ function Wi(e, n, t) {
|
|
|
5038
5230
|
}
|
|
5039
5231
|
return Fn(i);
|
|
5040
5232
|
}
|
|
5041
|
-
function
|
|
5233
|
+
function Ru(e, n) {
|
|
5042
5234
|
const t = n.get(e);
|
|
5043
5235
|
if (t)
|
|
5044
5236
|
return t;
|
|
5045
|
-
let i =
|
|
5237
|
+
let i = $o(e, []).filter((r) => kn(r) && qe(r) !== "body"), o = null;
|
|
5046
5238
|
const l = Kn(e).position === "fixed";
|
|
5047
5239
|
let s = l ? oe(e) : e;
|
|
5048
5240
|
for (; kn(s) && !We(s); ) {
|
|
@@ -5051,14 +5243,14 @@ function Xu(e, n) {
|
|
|
5051
5243
|
}
|
|
5052
5244
|
return n.set(e, i), i;
|
|
5053
5245
|
}
|
|
5054
|
-
function
|
|
5246
|
+
function Fu(e) {
|
|
5055
5247
|
let {
|
|
5056
5248
|
element: n,
|
|
5057
5249
|
boundary: t,
|
|
5058
5250
|
rootBoundary: i,
|
|
5059
5251
|
strategy: o
|
|
5060
5252
|
} = e;
|
|
5061
|
-
const s = [...t === "clippingAncestors" ? st(n) ? [] :
|
|
5253
|
+
const s = [...t === "clippingAncestors" ? st(n) ? [] : Ru(n, this._c) : [].concat(t), i], r = Wi(n, s[0], o);
|
|
5062
5254
|
let h = r.top, u = r.right, g = r.bottom, a = r.left;
|
|
5063
5255
|
for (let c = 1; c < s.length; c++) {
|
|
5064
5256
|
const d = Wi(n, s[c], o);
|
|
@@ -5071,29 +5263,29 @@ function Ju(e) {
|
|
|
5071
5263
|
y: h
|
|
5072
5264
|
};
|
|
5073
5265
|
}
|
|
5074
|
-
function
|
|
5266
|
+
function Pu(e) {
|
|
5075
5267
|
const {
|
|
5076
5268
|
width: n,
|
|
5077
5269
|
height: t
|
|
5078
|
-
} =
|
|
5270
|
+
} = nl(e);
|
|
5079
5271
|
return {
|
|
5080
5272
|
width: n,
|
|
5081
5273
|
height: t
|
|
5082
5274
|
};
|
|
5083
5275
|
}
|
|
5084
|
-
function
|
|
5276
|
+
function Eu(e, n, t) {
|
|
5085
5277
|
const i = Dn(n), o = Un(n), l = t === "fixed", s = we(e, !0, l, n);
|
|
5086
5278
|
let r = {
|
|
5087
5279
|
scrollLeft: 0,
|
|
5088
5280
|
scrollTop: 0
|
|
5089
5281
|
};
|
|
5090
|
-
const h =
|
|
5282
|
+
const h = Mn(0);
|
|
5091
5283
|
if ((i || !l) && ((qe(n) !== "body" || lt(o)) && (r = rt(n)), i)) {
|
|
5092
5284
|
const c = we(n, !0, l, n);
|
|
5093
5285
|
h.x = c.x + n.clientLeft, h.y = c.y + n.clientTop;
|
|
5094
5286
|
}
|
|
5095
5287
|
!i && o && (h.x = ht(o));
|
|
5096
|
-
const u = o && !i && !l ?
|
|
5288
|
+
const u = o && !i && !l ? il(o, r) : Mn(0), g = s.left + r.scrollLeft - h.x - u.x, a = s.top + r.scrollTop - h.y - u.y;
|
|
5097
5289
|
return {
|
|
5098
5290
|
x: g,
|
|
5099
5291
|
y: a,
|
|
@@ -5112,7 +5304,7 @@ function wi(e, n) {
|
|
|
5112
5304
|
let t = e.offsetParent;
|
|
5113
5305
|
return Un(e) === t && (t = t.ownerDocument.body), t;
|
|
5114
5306
|
}
|
|
5115
|
-
function
|
|
5307
|
+
function ol(e, n) {
|
|
5116
5308
|
const t = fn(e);
|
|
5117
5309
|
if (st(e))
|
|
5118
5310
|
return t;
|
|
@@ -5126,14 +5318,14 @@ function il(e, n) {
|
|
|
5126
5318
|
return t;
|
|
5127
5319
|
}
|
|
5128
5320
|
let i = wi(e, n);
|
|
5129
|
-
for (; i &&
|
|
5321
|
+
for (; i && Yu(i) && qt(i); )
|
|
5130
5322
|
i = wi(i, n);
|
|
5131
|
-
return i && We(i) && qt(i) && !_t(i) ? t : i ||
|
|
5323
|
+
return i && We(i) && qt(i) && !_t(i) ? t : i || Vu(e) || t;
|
|
5132
5324
|
}
|
|
5133
|
-
const
|
|
5134
|
-
const n = this.getOffsetParent ||
|
|
5325
|
+
const Uu = async function(e) {
|
|
5326
|
+
const n = this.getOffsetParent || ol, t = this.getDimensions, i = await t(e.floating);
|
|
5135
5327
|
return {
|
|
5136
|
-
reference:
|
|
5328
|
+
reference: Eu(e.reference, await n(e.floating), e.strategy),
|
|
5137
5329
|
floating: {
|
|
5138
5330
|
x: 0,
|
|
5139
5331
|
y: 0,
|
|
@@ -5142,27 +5334,27 @@ const Tu = async function(e) {
|
|
|
5142
5334
|
}
|
|
5143
5335
|
};
|
|
5144
5336
|
};
|
|
5145
|
-
function
|
|
5337
|
+
function Du(e) {
|
|
5146
5338
|
return Kn(e).direction === "rtl";
|
|
5147
5339
|
}
|
|
5148
|
-
const
|
|
5149
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
5340
|
+
const Bu = {
|
|
5341
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Ju,
|
|
5150
5342
|
getDocumentElement: Un,
|
|
5151
|
-
getClippingRect:
|
|
5152
|
-
getOffsetParent:
|
|
5153
|
-
getElementRects:
|
|
5154
|
-
getClientRects:
|
|
5155
|
-
getDimensions:
|
|
5343
|
+
getClippingRect: Fu,
|
|
5344
|
+
getOffsetParent: ol,
|
|
5345
|
+
getElementRects: Uu,
|
|
5346
|
+
getClientRects: Lu,
|
|
5347
|
+
getDimensions: Pu,
|
|
5156
5348
|
getScale: de,
|
|
5157
5349
|
isElement: kn,
|
|
5158
|
-
isRTL:
|
|
5159
|
-
},
|
|
5350
|
+
isRTL: Du
|
|
5351
|
+
}, ll = wu, sl = vu, rl = Su, hl = Au, ul = Ou, al = Zu, gl = bu, cl = Cu, dl = (e, n, t) => {
|
|
5160
5352
|
const i = /* @__PURE__ */ new Map(), o = t ?? {}, l = {
|
|
5161
|
-
...
|
|
5353
|
+
...Bu,
|
|
5162
5354
|
...o.platform,
|
|
5163
5355
|
_c: i
|
|
5164
5356
|
};
|
|
5165
|
-
return
|
|
5357
|
+
return zu(e, n, {
|
|
5166
5358
|
...o,
|
|
5167
5359
|
platform: l
|
|
5168
5360
|
});
|
|
@@ -5220,7 +5412,7 @@ var Pn = {
|
|
|
5220
5412
|
220: "\\",
|
|
5221
5413
|
221: "]",
|
|
5222
5414
|
222: "'"
|
|
5223
|
-
},
|
|
5415
|
+
}, nt = {
|
|
5224
5416
|
48: ")",
|
|
5225
5417
|
49: "!",
|
|
5226
5418
|
50: "@",
|
|
@@ -5245,18 +5437,18 @@ var Pn = {
|
|
|
5245
5437
|
220: "|",
|
|
5246
5438
|
221: "}",
|
|
5247
5439
|
222: '"'
|
|
5248
|
-
},
|
|
5440
|
+
}, Qu = typeof navigator < "u" && /Mac/.test(navigator.platform), _u = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
5249
5441
|
for (var un = 0; un < 10; un++) Pn[48 + un] = Pn[96 + un] = String(un);
|
|
5250
5442
|
for (var un = 1; un <= 24; un++) Pn[un + 111] = "F" + un;
|
|
5251
5443
|
for (var un = 65; un <= 90; un++)
|
|
5252
|
-
Pn[un] = String.fromCharCode(un + 32),
|
|
5253
|
-
for (var zt in Pn)
|
|
5254
|
-
function
|
|
5255
|
-
var n =
|
|
5444
|
+
Pn[un] = String.fromCharCode(un + 32), nt[un] = String.fromCharCode(un);
|
|
5445
|
+
for (var zt in Pn) nt.hasOwnProperty(zt) || (nt[zt] = Pn[zt]);
|
|
5446
|
+
function $u(e) {
|
|
5447
|
+
var n = Qu && e.metaKey && e.shiftKey && !e.ctrlKey && !e.altKey || _u && e.shiftKey && e.key && e.key.length == 1 || e.key == "Unidentified", t = !n && e.key || (e.shiftKey ? nt : Pn)[e.keyCode] || e.key || "Unidentified";
|
|
5256
5448
|
return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
|
|
5257
5449
|
}
|
|
5258
|
-
const
|
|
5259
|
-
function
|
|
5450
|
+
const na = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), ea = typeof navigator < "u" && /Win/.test(navigator.platform);
|
|
5451
|
+
function ta(e) {
|
|
5260
5452
|
let n = e.split(/-(?!$)/), t = n[n.length - 1];
|
|
5261
5453
|
t == "Space" && (t = " ");
|
|
5262
5454
|
let i, o, l, s;
|
|
@@ -5271,25 +5463,25 @@ function Du(e) {
|
|
|
5271
5463
|
else if (/^s(hift)?$/i.test(h))
|
|
5272
5464
|
l = !0;
|
|
5273
5465
|
else if (/^mod$/i.test(h))
|
|
5274
|
-
|
|
5466
|
+
na ? s = !0 : o = !0;
|
|
5275
5467
|
else
|
|
5276
5468
|
throw new Error("Unrecognized modifier name: " + h);
|
|
5277
5469
|
}
|
|
5278
5470
|
return i && (t = "Alt-" + t), o && (t = "Ctrl-" + t), s && (t = "Meta-" + t), l && (t = "Shift-" + t), t;
|
|
5279
5471
|
}
|
|
5280
|
-
function
|
|
5472
|
+
function ia(e) {
|
|
5281
5473
|
let n = /* @__PURE__ */ Object.create(null);
|
|
5282
5474
|
for (let t in e)
|
|
5283
|
-
n[
|
|
5475
|
+
n[ta(t)] = e[t];
|
|
5284
5476
|
return n;
|
|
5285
5477
|
}
|
|
5286
5478
|
function bt(e, n, t = !0) {
|
|
5287
5479
|
return n.altKey && (e = "Alt-" + e), n.ctrlKey && (e = "Ctrl-" + e), n.metaKey && (e = "Meta-" + e), t && n.shiftKey && (e = "Shift-" + e), e;
|
|
5288
5480
|
}
|
|
5289
|
-
function
|
|
5290
|
-
let n =
|
|
5481
|
+
function oa(e) {
|
|
5482
|
+
let n = ia(e);
|
|
5291
5483
|
return function(t, i) {
|
|
5292
|
-
let o =
|
|
5484
|
+
let o = $u(i), l, s = n[bt(o, i)];
|
|
5293
5485
|
if (s && s(t.state, t.dispatch, t))
|
|
5294
5486
|
return !0;
|
|
5295
5487
|
if (o.length == 1 && o != " ") {
|
|
@@ -5299,7 +5491,7 @@ function Qu(e) {
|
|
|
5299
5491
|
return !0;
|
|
5300
5492
|
}
|
|
5301
5493
|
if ((i.altKey || i.metaKey || i.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
|
|
5302
|
-
!(
|
|
5494
|
+
!(ea && i.ctrlKey && i.altKey) && (l = Pn[i.keyCode]) && l != o) {
|
|
5303
5495
|
let r = n[bt(l, i)];
|
|
5304
5496
|
if (r && r(t.state, t.dispatch, t))
|
|
5305
5497
|
return !0;
|
|
@@ -5319,7 +5511,7 @@ if (typeof WeakMap < "u") {
|
|
|
5319
5511
|
for (let o = 0; o < e.length; o += 2) if (e[o] == i) return e[o + 1];
|
|
5320
5512
|
}, Gt = (i, o) => (t == 10 && (t = 0), e[t++] = i, e[t++] = o);
|
|
5321
5513
|
}
|
|
5322
|
-
var
|
|
5514
|
+
var Jn = class {
|
|
5323
5515
|
constructor(e, n, t, i) {
|
|
5324
5516
|
this.width = e, this.height = n, this.map = t, this.problems = i;
|
|
5325
5517
|
}
|
|
@@ -5378,12 +5570,12 @@ var Xn = class {
|
|
|
5378
5570
|
}
|
|
5379
5571
|
}
|
|
5380
5572
|
static get(e) {
|
|
5381
|
-
return Vt(e) || Gt(e,
|
|
5573
|
+
return Vt(e) || Gt(e, la(e));
|
|
5382
5574
|
}
|
|
5383
5575
|
};
|
|
5384
|
-
function
|
|
5576
|
+
function la(e) {
|
|
5385
5577
|
if (e.type.spec.tableRole != "table") throw new RangeError("Not a table node: " + e.type.name);
|
|
5386
|
-
const n =
|
|
5578
|
+
const n = sa(e), t = e.childCount, i = [];
|
|
5387
5579
|
let o = 0, l = null;
|
|
5388
5580
|
const s = [];
|
|
5389
5581
|
for (let u = 0, g = n * t; u < g; u++) i[u] = 0;
|
|
@@ -5430,12 +5622,12 @@ function _u(e) {
|
|
|
5430
5622
|
}), g++;
|
|
5431
5623
|
}
|
|
5432
5624
|
(n === 0 || t === 0) && (l || (l = [])).push({ type: "zero_sized" });
|
|
5433
|
-
const r = new
|
|
5625
|
+
const r = new Jn(n, t, i, l);
|
|
5434
5626
|
let h = !1;
|
|
5435
5627
|
for (let u = 0; !h && u < s.length; u += 2) s[u] != null && s[u + 1] < t && (h = !0);
|
|
5436
|
-
return h &&
|
|
5628
|
+
return h && ra(r, s, e), r;
|
|
5437
5629
|
}
|
|
5438
|
-
function
|
|
5630
|
+
function sa(e) {
|
|
5439
5631
|
let n = -1, t = !1;
|
|
5440
5632
|
for (let i = 0; i < e.childCount; i++) {
|
|
5441
5633
|
const o = e.child(i);
|
|
@@ -5455,7 +5647,7 @@ function $u(e) {
|
|
|
5455
5647
|
}
|
|
5456
5648
|
return n;
|
|
5457
5649
|
}
|
|
5458
|
-
function
|
|
5650
|
+
function ra(e, n, t) {
|
|
5459
5651
|
e.problems || (e.problems = []);
|
|
5460
5652
|
const i = {};
|
|
5461
5653
|
for (let o = 0; o < e.map.length; o++) {
|
|
@@ -5468,7 +5660,7 @@ function na(e, n, t) {
|
|
|
5468
5660
|
const h = s.attrs;
|
|
5469
5661
|
for (let u = 0; u < h.colspan; u++) {
|
|
5470
5662
|
const g = n[(o + u) % e.width * 2];
|
|
5471
|
-
g != null && (!h.colwidth || h.colwidth[u] != g) && ((r || (r =
|
|
5663
|
+
g != null && (!h.colwidth || h.colwidth[u] != g) && ((r || (r = ha(h)))[u] = g);
|
|
5472
5664
|
}
|
|
5473
5665
|
r && e.problems.unshift({
|
|
5474
5666
|
type: "colwidth mismatch",
|
|
@@ -5477,7 +5669,7 @@ function na(e, n, t) {
|
|
|
5477
5669
|
});
|
|
5478
5670
|
}
|
|
5479
5671
|
}
|
|
5480
|
-
function
|
|
5672
|
+
function ha(e) {
|
|
5481
5673
|
if (e.colwidth) return e.colwidth.slice();
|
|
5482
5674
|
const n = [];
|
|
5483
5675
|
for (let t = 0; t < e.colspan; t++) n.push(0);
|
|
@@ -5495,24 +5687,24 @@ function ni(e) {
|
|
|
5495
5687
|
return n;
|
|
5496
5688
|
}
|
|
5497
5689
|
new En("selectingCells");
|
|
5498
|
-
function
|
|
5690
|
+
function ua(e) {
|
|
5499
5691
|
for (let n = e.depth - 1; n > 0; n--) if (e.node(n).type.spec.tableRole == "row") return e.node(0).resolve(e.before(n + 1));
|
|
5500
5692
|
return null;
|
|
5501
5693
|
}
|
|
5502
|
-
function
|
|
5694
|
+
function ml(e) {
|
|
5503
5695
|
const n = e.selection.$head;
|
|
5504
5696
|
for (let t = n.depth; t > 0; t--) if (n.node(t).type.spec.tableRole == "row") return !0;
|
|
5505
5697
|
return !1;
|
|
5506
5698
|
}
|
|
5507
|
-
function
|
|
5699
|
+
function aa(e) {
|
|
5508
5700
|
const n = e.selection;
|
|
5509
5701
|
if ("$anchorCell" in n && n.$anchorCell) return n.$anchorCell.pos > n.$headCell.pos ? n.$anchorCell : n.$headCell;
|
|
5510
5702
|
if ("node" in n && n.node && n.node.type.spec.tableRole == "cell") return n.$anchor;
|
|
5511
|
-
const t =
|
|
5703
|
+
const t = ua(n.$head) || ga(n.$head);
|
|
5512
5704
|
if (t) return t;
|
|
5513
5705
|
throw new RangeError(`No cell found around position ${n.head}`);
|
|
5514
5706
|
}
|
|
5515
|
-
function
|
|
5707
|
+
function ga(e) {
|
|
5516
5708
|
for (let n = e.nodeAfter, t = e.pos; n; n = n.firstChild, t++) {
|
|
5517
5709
|
const i = n.type.spec.tableRole;
|
|
5518
5710
|
if (i == "cell" || i == "header_cell") return e.doc.resolve(t);
|
|
@@ -5525,11 +5717,11 @@ function oa(e) {
|
|
|
5525
5717
|
function Si(e) {
|
|
5526
5718
|
return e.parent.type.spec.tableRole == "row" && !!e.nodeAfter;
|
|
5527
5719
|
}
|
|
5528
|
-
function
|
|
5720
|
+
function pl(e, n) {
|
|
5529
5721
|
return e.depth == n.depth && e.pos >= n.start(-1) && e.pos <= n.end(-1);
|
|
5530
5722
|
}
|
|
5531
|
-
function
|
|
5532
|
-
const i = e.node(-1), o =
|
|
5723
|
+
function fl(e, n, t) {
|
|
5724
|
+
const i = e.node(-1), o = Jn.get(i), l = e.start(-1), s = o.nextCell(e.pos - l, n, t);
|
|
5533
5725
|
return s == null ? null : e.node(0).resolve(l + s);
|
|
5534
5726
|
}
|
|
5535
5727
|
function Oi(e, n, t = 1) {
|
|
@@ -5539,9 +5731,9 @@ function Oi(e, n, t = 1) {
|
|
|
5539
5731
|
};
|
|
5540
5732
|
return i.colwidth && (i.colwidth = i.colwidth.slice(), i.colwidth.splice(n, t), i.colwidth.some((o) => o > 0) || (i.colwidth = null)), i;
|
|
5541
5733
|
}
|
|
5542
|
-
var On = class
|
|
5734
|
+
var On = class Xn extends B {
|
|
5543
5735
|
constructor(n, t = n) {
|
|
5544
|
-
const i = n.node(-1), o =
|
|
5736
|
+
const i = n.node(-1), o = Jn.get(i), l = n.start(-1), s = o.rectBetween(n.pos - l, t.pos - l), r = n.node(0), h = o.cellsInRect(s).filter((g) => g != t.pos - l);
|
|
5545
5737
|
h.unshift(t.pos - l);
|
|
5546
5738
|
const u = h.map((g) => {
|
|
5547
5739
|
const a = i.nodeAt(g);
|
|
@@ -5553,14 +5745,14 @@ var On = class Gn extends B {
|
|
|
5553
5745
|
}
|
|
5554
5746
|
map(n, t) {
|
|
5555
5747
|
const i = n.resolve(t.map(this.$anchorCell.pos)), o = n.resolve(t.map(this.$headCell.pos));
|
|
5556
|
-
if (Si(i) && Si(o) &&
|
|
5748
|
+
if (Si(i) && Si(o) && pl(i, o)) {
|
|
5557
5749
|
const l = this.$anchorCell.node(-1) != i.node(-1);
|
|
5558
|
-
return l && this.isRowSelection() ?
|
|
5750
|
+
return l && this.isRowSelection() ? Xn.rowSelection(i, o) : l && this.isColSelection() ? Xn.colSelection(i, o) : new Xn(i, o);
|
|
5559
5751
|
}
|
|
5560
5752
|
return jn.between(i, o);
|
|
5561
5753
|
}
|
|
5562
5754
|
content() {
|
|
5563
|
-
const n = this.$anchorCell.node(-1), t =
|
|
5755
|
+
const n = this.$anchorCell.node(-1), t = Jn.get(n), i = this.$anchorCell.start(-1), o = t.rectBetween(this.$anchorCell.pos - i, this.$headCell.pos - i), l = {}, s = [];
|
|
5564
5756
|
for (let h = o.top; h < o.bottom; h++) {
|
|
5565
5757
|
const u = [];
|
|
5566
5758
|
for (let g = h * t.width + o.left, a = o.left; a < o.right; a++, g++) {
|
|
@@ -5604,7 +5796,7 @@ var On = class Gn extends B {
|
|
|
5604
5796
|
this.replace(n, new E(D.from(t), 0, 0));
|
|
5605
5797
|
}
|
|
5606
5798
|
forEachCell(n) {
|
|
5607
|
-
const t = this.$anchorCell.node(-1), i =
|
|
5799
|
+
const t = this.$anchorCell.node(-1), i = Jn.get(t), o = this.$anchorCell.start(-1), l = i.cellsInRect(i.rectBetween(this.$anchorCell.pos - o, this.$headCell.pos - o));
|
|
5608
5800
|
for (let s = 0; s < l.length; s++) n(t.nodeAt(l[s]), o + l[s]);
|
|
5609
5801
|
}
|
|
5610
5802
|
isColSelection() {
|
|
@@ -5614,21 +5806,21 @@ var On = class Gn extends B {
|
|
|
5614
5806
|
return Math.max(i, o) == this.$headCell.node(-1).childCount;
|
|
5615
5807
|
}
|
|
5616
5808
|
static colSelection(n, t = n) {
|
|
5617
|
-
const i = n.node(-1), o =
|
|
5618
|
-
return s.top <= r.top ? (s.top > 0 && (n = h.resolve(l + o.map[s.left])), r.bottom < o.height && (t = h.resolve(l + o.map[o.width * (o.height - 1) + r.right - 1]))) : (r.top > 0 && (t = h.resolve(l + o.map[r.left])), s.bottom < o.height && (n = h.resolve(l + o.map[o.width * (o.height - 1) + s.right - 1]))), new
|
|
5809
|
+
const i = n.node(-1), o = Jn.get(i), l = n.start(-1), s = o.findCell(n.pos - l), r = o.findCell(t.pos - l), h = n.node(0);
|
|
5810
|
+
return s.top <= r.top ? (s.top > 0 && (n = h.resolve(l + o.map[s.left])), r.bottom < o.height && (t = h.resolve(l + o.map[o.width * (o.height - 1) + r.right - 1]))) : (r.top > 0 && (t = h.resolve(l + o.map[r.left])), s.bottom < o.height && (n = h.resolve(l + o.map[o.width * (o.height - 1) + s.right - 1]))), new Xn(n, t);
|
|
5619
5811
|
}
|
|
5620
5812
|
isRowSelection() {
|
|
5621
|
-
const n = this.$anchorCell.node(-1), t =
|
|
5813
|
+
const n = this.$anchorCell.node(-1), t = Jn.get(n), i = this.$anchorCell.start(-1), o = t.colCount(this.$anchorCell.pos - i), l = t.colCount(this.$headCell.pos - i);
|
|
5622
5814
|
if (Math.min(o, l) > 0) return !1;
|
|
5623
5815
|
const s = o + this.$anchorCell.nodeAfter.attrs.colspan, r = l + this.$headCell.nodeAfter.attrs.colspan;
|
|
5624
5816
|
return Math.max(s, r) == t.width;
|
|
5625
5817
|
}
|
|
5626
5818
|
eq(n) {
|
|
5627
|
-
return n instanceof
|
|
5819
|
+
return n instanceof Xn && n.$anchorCell.pos == this.$anchorCell.pos && n.$headCell.pos == this.$headCell.pos;
|
|
5628
5820
|
}
|
|
5629
5821
|
static rowSelection(n, t = n) {
|
|
5630
|
-
const i = n.node(-1), o =
|
|
5631
|
-
return s.left <= r.left ? (s.left > 0 && (n = h.resolve(l + o.map[s.top * o.width])), r.right < o.width && (t = h.resolve(l + o.map[o.width * (r.top + 1) - 1]))) : (r.left > 0 && (t = h.resolve(l + o.map[r.top * o.width])), s.right < o.width && (n = h.resolve(l + o.map[o.width * (s.top + 1) - 1]))), new
|
|
5822
|
+
const i = n.node(-1), o = Jn.get(i), l = n.start(-1), s = o.findCell(n.pos - l), r = o.findCell(t.pos - l), h = n.node(0);
|
|
5823
|
+
return s.left <= r.left ? (s.left > 0 && (n = h.resolve(l + o.map[s.top * o.width])), r.right < o.width && (t = h.resolve(l + o.map[o.width * (r.top + 1) - 1]))) : (r.left > 0 && (t = h.resolve(l + o.map[r.top * o.width])), s.right < o.width && (n = h.resolve(l + o.map[o.width * (s.top + 1) - 1]))), new Xn(n, t);
|
|
5632
5824
|
}
|
|
5633
5825
|
toJSON() {
|
|
5634
5826
|
return {
|
|
@@ -5638,32 +5830,32 @@ var On = class Gn extends B {
|
|
|
5638
5830
|
};
|
|
5639
5831
|
}
|
|
5640
5832
|
static fromJSON(n, t) {
|
|
5641
|
-
return new
|
|
5833
|
+
return new Xn(n.resolve(t.anchor), n.resolve(t.head));
|
|
5642
5834
|
}
|
|
5643
5835
|
static create(n, t, i = t) {
|
|
5644
|
-
return new
|
|
5836
|
+
return new Xn(n.resolve(t), n.resolve(i));
|
|
5645
5837
|
}
|
|
5646
5838
|
getBookmark() {
|
|
5647
|
-
return new
|
|
5839
|
+
return new ca(this.$anchorCell.pos, this.$headCell.pos);
|
|
5648
5840
|
}
|
|
5649
5841
|
};
|
|
5650
5842
|
On.prototype.visible = !1;
|
|
5651
5843
|
B.jsonID("cell", On);
|
|
5652
|
-
var
|
|
5844
|
+
var ca = class yl {
|
|
5653
5845
|
constructor(n, t) {
|
|
5654
5846
|
this.anchor = n, this.head = t;
|
|
5655
5847
|
}
|
|
5656
5848
|
map(n) {
|
|
5657
|
-
return new
|
|
5849
|
+
return new yl(n.map(this.anchor), n.map(this.head));
|
|
5658
5850
|
}
|
|
5659
5851
|
resolve(n) {
|
|
5660
5852
|
const t = n.resolve(this.anchor), i = n.resolve(this.head);
|
|
5661
|
-
return t.parent.type.spec.tableRole == "row" && i.parent.type.spec.tableRole == "row" && t.index() < t.parent.childCount && i.index() < i.parent.childCount &&
|
|
5853
|
+
return t.parent.type.spec.tableRole == "row" && i.parent.type.spec.tableRole == "row" && t.index() < t.parent.childCount && i.index() < i.parent.childCount && pl(t, i) ? new On(t, i) : B.near(i, 1);
|
|
5662
5854
|
}
|
|
5663
5855
|
};
|
|
5664
5856
|
new En("fix-tables");
|
|
5665
|
-
function
|
|
5666
|
-
const n = e.selection, t =
|
|
5857
|
+
function ql(e) {
|
|
5858
|
+
const n = e.selection, t = aa(e), i = t.node(-1), o = t.start(-1), l = Jn.get(i);
|
|
5667
5859
|
return {
|
|
5668
5860
|
...n instanceof On ? l.rectBetween(n.$anchorCell.pos - o, n.$headCell.pos - o) : l.findCell(t.pos - o),
|
|
5669
5861
|
tableStart: o,
|
|
@@ -5671,11 +5863,11 @@ function yl(e) {
|
|
|
5671
5863
|
table: i
|
|
5672
5864
|
};
|
|
5673
5865
|
}
|
|
5674
|
-
function
|
|
5866
|
+
function da(e) {
|
|
5675
5867
|
return function(n, t) {
|
|
5676
|
-
if (!
|
|
5868
|
+
if (!ml(n)) return !1;
|
|
5677
5869
|
if (t) {
|
|
5678
|
-
const i = ni(n.schema), o =
|
|
5870
|
+
const i = ni(n.schema), o = ql(n), l = n.tr, s = o.map.cellsInRect(e == "column" ? {
|
|
5679
5871
|
left: o.left,
|
|
5680
5872
|
top: 0,
|
|
5681
5873
|
right: o.right,
|
|
@@ -5707,10 +5899,10 @@ function Yi(e, n, t) {
|
|
|
5707
5899
|
return !0;
|
|
5708
5900
|
}
|
|
5709
5901
|
function ei(e, n) {
|
|
5710
|
-
return n = n || { useDeprecatedLogic: !1 }, n.useDeprecatedLogic ?
|
|
5711
|
-
if (!
|
|
5902
|
+
return n = n || { useDeprecatedLogic: !1 }, n.useDeprecatedLogic ? da(e) : function(t, i) {
|
|
5903
|
+
if (!ml(t)) return !1;
|
|
5712
5904
|
if (i) {
|
|
5713
|
-
const o = ni(t.schema), l =
|
|
5905
|
+
const o = ni(t.schema), l = ql(t), s = t.tr, r = Yi("row", l, o), h = Yi("column", l, o), u = (e === "column" ? r : e === "row" && h) ? 1 : 0, g = e == "column" ? {
|
|
5714
5906
|
left: 0,
|
|
5715
5907
|
top: u,
|
|
5716
5908
|
right: 1,
|
|
@@ -5732,7 +5924,7 @@ function ei(e, n) {
|
|
|
5732
5924
|
ei("row", { useDeprecatedLogic: !0 });
|
|
5733
5925
|
ei("column", { useDeprecatedLogic: !0 });
|
|
5734
5926
|
ei("cell", { useDeprecatedLogic: !0 });
|
|
5735
|
-
function
|
|
5927
|
+
function He(e, n) {
|
|
5736
5928
|
const t = e.selection;
|
|
5737
5929
|
if (!(t instanceof On)) return !1;
|
|
5738
5930
|
if (n) {
|
|
@@ -5743,55 +5935,55 @@ function Le(e, n) {
|
|
|
5743
5935
|
}
|
|
5744
5936
|
return !0;
|
|
5745
5937
|
}
|
|
5746
|
-
|
|
5747
|
-
ArrowLeft:
|
|
5748
|
-
ArrowRight:
|
|
5749
|
-
ArrowUp:
|
|
5750
|
-
ArrowDown:
|
|
5751
|
-
"Shift-ArrowLeft":
|
|
5752
|
-
"Shift-ArrowRight":
|
|
5753
|
-
"Shift-ArrowUp":
|
|
5754
|
-
"Shift-ArrowDown":
|
|
5755
|
-
Backspace:
|
|
5756
|
-
"Mod-Backspace":
|
|
5757
|
-
Delete:
|
|
5758
|
-
"Mod-Delete":
|
|
5938
|
+
oa({
|
|
5939
|
+
ArrowLeft: Te("horiz", -1),
|
|
5940
|
+
ArrowRight: Te("horiz", 1),
|
|
5941
|
+
ArrowUp: Te("vert", -1),
|
|
5942
|
+
ArrowDown: Te("vert", 1),
|
|
5943
|
+
"Shift-ArrowLeft": Me("horiz", -1),
|
|
5944
|
+
"Shift-ArrowRight": Me("horiz", 1),
|
|
5945
|
+
"Shift-ArrowUp": Me("vert", -1),
|
|
5946
|
+
"Shift-ArrowDown": Me("vert", 1),
|
|
5947
|
+
Backspace: He,
|
|
5948
|
+
"Mod-Backspace": He,
|
|
5949
|
+
Delete: He,
|
|
5950
|
+
"Mod-Delete": He
|
|
5759
5951
|
});
|
|
5760
|
-
function
|
|
5952
|
+
function Re(e, n, t) {
|
|
5761
5953
|
return t.eq(e.selection) ? !1 : (n && n(e.tr.setSelection(t).scrollIntoView()), !0);
|
|
5762
5954
|
}
|
|
5763
|
-
function
|
|
5955
|
+
function Te(e, n) {
|
|
5764
5956
|
return (t, i, o) => {
|
|
5765
5957
|
if (!o) return !1;
|
|
5766
5958
|
const l = t.selection;
|
|
5767
|
-
if (l instanceof On) return
|
|
5959
|
+
if (l instanceof On) return Re(t, i, B.near(l.$headCell, n));
|
|
5768
5960
|
if (e != "horiz" && !l.empty) return !1;
|
|
5769
|
-
const s =
|
|
5961
|
+
const s = zl(o, e, n);
|
|
5770
5962
|
if (s == null) return !1;
|
|
5771
|
-
if (e == "horiz") return
|
|
5963
|
+
if (e == "horiz") return Re(t, i, B.near(t.doc.resolve(l.head + n), n));
|
|
5772
5964
|
{
|
|
5773
|
-
const r = t.doc.resolve(s), h =
|
|
5965
|
+
const r = t.doc.resolve(s), h = fl(r, e, n);
|
|
5774
5966
|
let u;
|
|
5775
|
-
return h ? u = B.near(h, 1) : n < 0 ? u = B.near(t.doc.resolve(r.before(-1)), -1) : u = B.near(t.doc.resolve(r.after(-1)), 1),
|
|
5967
|
+
return h ? u = B.near(h, 1) : n < 0 ? u = B.near(t.doc.resolve(r.before(-1)), -1) : u = B.near(t.doc.resolve(r.after(-1)), 1), Re(t, i, u);
|
|
5776
5968
|
}
|
|
5777
5969
|
};
|
|
5778
5970
|
}
|
|
5779
|
-
function
|
|
5971
|
+
function Me(e, n) {
|
|
5780
5972
|
return (t, i, o) => {
|
|
5781
5973
|
if (!o) return !1;
|
|
5782
5974
|
const l = t.selection;
|
|
5783
5975
|
let s;
|
|
5784
5976
|
if (l instanceof On) s = l;
|
|
5785
5977
|
else {
|
|
5786
|
-
const h =
|
|
5978
|
+
const h = zl(o, e, n);
|
|
5787
5979
|
if (h == null) return !1;
|
|
5788
5980
|
s = new On(t.doc.resolve(h));
|
|
5789
5981
|
}
|
|
5790
|
-
const r =
|
|
5791
|
-
return r ?
|
|
5982
|
+
const r = fl(s.$headCell, e, n);
|
|
5983
|
+
return r ? Re(t, i, new On(s.$anchorCell, r)) : !1;
|
|
5792
5984
|
};
|
|
5793
5985
|
}
|
|
5794
|
-
function
|
|
5986
|
+
function zl(e, n, t) {
|
|
5795
5987
|
if (!(e.state.selection instanceof jn)) return null;
|
|
5796
5988
|
const { $head: i } = e.state.selection;
|
|
5797
5989
|
for (let o = i.depth - 1; o >= 0; o--) {
|
|
@@ -5805,11 +5997,11 @@ function ql(e, n, t) {
|
|
|
5805
5997
|
return null;
|
|
5806
5998
|
}
|
|
5807
5999
|
new En("tableColumnResizing");
|
|
5808
|
-
function
|
|
6000
|
+
function ma(e, n) {
|
|
5809
6001
|
const t = Math.min(e.top, n.top), i = Math.max(e.bottom, n.bottom), o = Math.min(e.left, n.left), s = Math.max(e.right, n.right) - o, r = i - t, h = o, u = t;
|
|
5810
6002
|
return new DOMRect(h, u, s, r);
|
|
5811
6003
|
}
|
|
5812
|
-
var
|
|
6004
|
+
var pa = class {
|
|
5813
6005
|
constructor({
|
|
5814
6006
|
editor: e,
|
|
5815
6007
|
element: n,
|
|
@@ -5893,31 +6085,31 @@ var ha = class {
|
|
|
5893
6085
|
get middlewares() {
|
|
5894
6086
|
const e = [];
|
|
5895
6087
|
return this.floatingUIOptions.flip && e.push(
|
|
5896
|
-
|
|
6088
|
+
hl(
|
|
5897
6089
|
typeof this.floatingUIOptions.flip != "boolean" ? this.floatingUIOptions.flip : void 0
|
|
5898
6090
|
)
|
|
5899
6091
|
), this.floatingUIOptions.shift && e.push(
|
|
5900
|
-
|
|
6092
|
+
rl(
|
|
5901
6093
|
typeof this.floatingUIOptions.shift != "boolean" ? this.floatingUIOptions.shift : void 0
|
|
5902
6094
|
)
|
|
5903
6095
|
), this.floatingUIOptions.offset && e.push(
|
|
5904
|
-
|
|
6096
|
+
ll(
|
|
5905
6097
|
typeof this.floatingUIOptions.offset != "boolean" ? this.floatingUIOptions.offset : void 0
|
|
5906
6098
|
)
|
|
5907
|
-
), this.floatingUIOptions.arrow && e.push(
|
|
5908
|
-
|
|
6099
|
+
), this.floatingUIOptions.arrow && e.push(gl(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(
|
|
6100
|
+
ul(
|
|
5909
6101
|
typeof this.floatingUIOptions.size != "boolean" ? this.floatingUIOptions.size : void 0
|
|
5910
6102
|
)
|
|
5911
6103
|
), this.floatingUIOptions.autoPlacement && e.push(
|
|
5912
|
-
|
|
6104
|
+
sl(
|
|
5913
6105
|
typeof this.floatingUIOptions.autoPlacement != "boolean" ? this.floatingUIOptions.autoPlacement : void 0
|
|
5914
6106
|
)
|
|
5915
6107
|
), this.floatingUIOptions.hide && e.push(
|
|
5916
|
-
|
|
6108
|
+
al(
|
|
5917
6109
|
typeof this.floatingUIOptions.hide != "boolean" ? this.floatingUIOptions.hide : void 0
|
|
5918
6110
|
)
|
|
5919
6111
|
), this.floatingUIOptions.inline && e.push(
|
|
5920
|
-
|
|
6112
|
+
cl(
|
|
5921
6113
|
typeof this.floatingUIOptions.inline != "boolean" ? this.floatingUIOptions.inline : void 0
|
|
5922
6114
|
)
|
|
5923
6115
|
), e;
|
|
@@ -5946,7 +6138,7 @@ var ha = class {
|
|
|
5946
6138
|
const { $anchorCell: r, $headCell: h } = i, u = r ? r.pos : h.pos, g = h ? h.pos : r.pos, a = this.view.nodeDOM(u), c = this.view.nodeDOM(g);
|
|
5947
6139
|
if (!a || !c)
|
|
5948
6140
|
return;
|
|
5949
|
-
const d = a === c ? a.getBoundingClientRect() :
|
|
6141
|
+
const d = a === c ? a.getBoundingClientRect() : ma(
|
|
5950
6142
|
a.getBoundingClientRect(),
|
|
5951
6143
|
c.getBoundingClientRect()
|
|
5952
6144
|
);
|
|
@@ -5961,7 +6153,7 @@ var ha = class {
|
|
|
5961
6153
|
if (!this.isVisible)
|
|
5962
6154
|
return;
|
|
5963
6155
|
const e = this.virtualElement;
|
|
5964
|
-
e &&
|
|
6156
|
+
e && dl(e, this.element, {
|
|
5965
6157
|
placement: this.floatingUIOptions.placement,
|
|
5966
6158
|
strategy: this.floatingUIOptions.strategy,
|
|
5967
6159
|
middleware: this.middlewares
|
|
@@ -6022,10 +6214,10 @@ var ha = class {
|
|
|
6022
6214
|
destroy() {
|
|
6023
6215
|
this.hide(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.removeEventListener("dragstart", this.dragstartHandler), window.removeEventListener("resize", this.resizeHandler), this.scrollTarget.removeEventListener("scroll", this.resizeHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler), this.editor.off("transaction", this.transactionHandler), this.floatingUIOptions.onDestroy && this.floatingUIOptions.onDestroy();
|
|
6024
6216
|
}
|
|
6025
|
-
},
|
|
6217
|
+
}, fa = (e) => new Ut({
|
|
6026
6218
|
key: typeof e.pluginKey == "string" ? new En(e.pluginKey) : e.pluginKey,
|
|
6027
|
-
view: (n) => new
|
|
6028
|
-
}),
|
|
6219
|
+
view: (n) => new pa({ view: n, ...e })
|
|
6220
|
+
}), ya = $({
|
|
6029
6221
|
name: "BubbleMenu",
|
|
6030
6222
|
inheritAttrs: !1,
|
|
6031
6223
|
props: {
|
|
@@ -6077,7 +6269,7 @@ var ha = class {
|
|
|
6077
6269
|
} = e, d = o.value;
|
|
6078
6270
|
d && (d.style.visibility = "hidden", d.style.position = "absolute", d.remove(), ye(() => {
|
|
6079
6271
|
s.registerPlugin(
|
|
6080
|
-
|
|
6272
|
+
fa({
|
|
6081
6273
|
editor: s,
|
|
6082
6274
|
element: d,
|
|
6083
6275
|
options: r,
|
|
@@ -6090,7 +6282,7 @@ var ha = class {
|
|
|
6090
6282
|
})
|
|
6091
6283
|
);
|
|
6092
6284
|
}));
|
|
6093
|
-
}),
|
|
6285
|
+
}), Ye(() => {
|
|
6094
6286
|
const { editor: s } = e;
|
|
6095
6287
|
s.unregisterPlugin(l);
|
|
6096
6288
|
}), () => {
|
|
@@ -6098,7 +6290,7 @@ var ha = class {
|
|
|
6098
6290
|
return no("div", { ref: o, ...t }, (s = n.default) == null ? void 0 : s.call(n));
|
|
6099
6291
|
};
|
|
6100
6292
|
}
|
|
6101
|
-
}),
|
|
6293
|
+
}), qa = class {
|
|
6102
6294
|
constructor({
|
|
6103
6295
|
editor: e,
|
|
6104
6296
|
element: n,
|
|
@@ -6164,31 +6356,31 @@ var ha = class {
|
|
|
6164
6356
|
get middlewares() {
|
|
6165
6357
|
const e = [];
|
|
6166
6358
|
return this.floatingUIOptions.flip && e.push(
|
|
6167
|
-
|
|
6359
|
+
hl(
|
|
6168
6360
|
typeof this.floatingUIOptions.flip != "boolean" ? this.floatingUIOptions.flip : void 0
|
|
6169
6361
|
)
|
|
6170
6362
|
), this.floatingUIOptions.shift && e.push(
|
|
6171
|
-
|
|
6363
|
+
rl(
|
|
6172
6364
|
typeof this.floatingUIOptions.shift != "boolean" ? this.floatingUIOptions.shift : void 0
|
|
6173
6365
|
)
|
|
6174
6366
|
), this.floatingUIOptions.offset && e.push(
|
|
6175
|
-
|
|
6367
|
+
ll(
|
|
6176
6368
|
typeof this.floatingUIOptions.offset != "boolean" ? this.floatingUIOptions.offset : void 0
|
|
6177
6369
|
)
|
|
6178
|
-
), this.floatingUIOptions.arrow && e.push(
|
|
6179
|
-
|
|
6370
|
+
), this.floatingUIOptions.arrow && e.push(gl(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(
|
|
6371
|
+
ul(
|
|
6180
6372
|
typeof this.floatingUIOptions.size != "boolean" ? this.floatingUIOptions.size : void 0
|
|
6181
6373
|
)
|
|
6182
6374
|
), this.floatingUIOptions.autoPlacement && e.push(
|
|
6183
|
-
|
|
6375
|
+
sl(
|
|
6184
6376
|
typeof this.floatingUIOptions.autoPlacement != "boolean" ? this.floatingUIOptions.autoPlacement : void 0
|
|
6185
6377
|
)
|
|
6186
6378
|
), this.floatingUIOptions.hide && e.push(
|
|
6187
|
-
|
|
6379
|
+
al(
|
|
6188
6380
|
typeof this.floatingUIOptions.hide != "boolean" ? this.floatingUIOptions.hide : void 0
|
|
6189
6381
|
)
|
|
6190
6382
|
), this.floatingUIOptions.inline && e.push(
|
|
6191
|
-
|
|
6383
|
+
cl(
|
|
6192
6384
|
typeof this.floatingUIOptions.inline != "boolean" ? this.floatingUIOptions.inline : void 0
|
|
6193
6385
|
)
|
|
6194
6386
|
), e;
|
|
@@ -6220,7 +6412,7 @@ var ha = class {
|
|
|
6220
6412
|
if (!((n = (e = this.view) == null ? void 0 : e.dom) != null && n.parentNode))
|
|
6221
6413
|
return;
|
|
6222
6414
|
const { selection: t } = this.editor.state, i = to(this.view, t.from, t.to);
|
|
6223
|
-
|
|
6415
|
+
dl({
|
|
6224
6416
|
getBoundingClientRect: () => i,
|
|
6225
6417
|
getClientRects: () => [i]
|
|
6226
6418
|
}, this.element, {
|
|
@@ -6254,9 +6446,9 @@ var ha = class {
|
|
|
6254
6446
|
destroy() {
|
|
6255
6447
|
this.hide(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), window.removeEventListener("resize", this.resizeHandler), this.scrollTarget.removeEventListener("scroll", this.resizeHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler), this.editor.off("transaction", this.transactionHandler), this.floatingUIOptions.onDestroy && this.floatingUIOptions.onDestroy();
|
|
6256
6448
|
}
|
|
6257
|
-
},
|
|
6449
|
+
}, za = (e) => new Ut({
|
|
6258
6450
|
key: typeof e.pluginKey == "string" ? new En(e.pluginKey) : e.pluginKey,
|
|
6259
|
-
view: (n) => new
|
|
6451
|
+
view: (n) => new qa({ view: n, ...e })
|
|
6260
6452
|
});
|
|
6261
6453
|
$({
|
|
6262
6454
|
name: "FloatingMenu",
|
|
@@ -6299,7 +6491,7 @@ $({
|
|
|
6299
6491
|
return Oe(() => {
|
|
6300
6492
|
const { editor: s, updateDelay: r, resizeDelay: h, options: u, appendTo: g, shouldShow: a } = e, c = o.value;
|
|
6301
6493
|
c && (c.style.visibility = "hidden", c.style.position = "absolute", c.remove(), s.registerPlugin(
|
|
6302
|
-
|
|
6494
|
+
za({
|
|
6303
6495
|
pluginKey: l,
|
|
6304
6496
|
editor: s,
|
|
6305
6497
|
element: c,
|
|
@@ -6310,7 +6502,7 @@ $({
|
|
|
6310
6502
|
shouldShow: a
|
|
6311
6503
|
})
|
|
6312
6504
|
));
|
|
6313
|
-
}),
|
|
6505
|
+
}), Ye(() => {
|
|
6314
6506
|
const { editor: s } = e;
|
|
6315
6507
|
s.unregisterPlugin(l);
|
|
6316
6508
|
}), () => {
|
|
@@ -6319,139 +6511,10 @@ $({
|
|
|
6319
6511
|
};
|
|
6320
6512
|
}
|
|
6321
6513
|
});
|
|
6322
|
-
const
|
|
6323
|
-
const n = Or(da);
|
|
6324
|
-
return n.on(e.on), n;
|
|
6325
|
-
}, pa = (e) => {
|
|
6326
|
-
const n = e == null ? void 0 : e.toLowerCase();
|
|
6327
|
-
return n === "mp3" ? "audio/mpeg" : n === "wav" ? "audio/wav" : n === "ogg" ? "audio/ogg" : n ? `audio/${n}` : "audio/wav";
|
|
6328
|
-
}, fa = (e) => typeof e.duration == "number" ? e.duration : typeof e.start == "number" && typeof e.end == "number" ? Math.max(0, e.end - e.start) : 0, ya = (e, n) => {
|
|
6329
|
-
const t = e.includes(",") ? e.split(",").pop() || "" : e, i = atob(t), o = new Uint8Array(i.length);
|
|
6330
|
-
for (let l = 0; l < i.length; l += 1)
|
|
6331
|
-
o[l] = i.charCodeAt(l);
|
|
6332
|
-
return URL.createObjectURL(
|
|
6333
|
-
new Blob([o], { type: pa(n) })
|
|
6334
|
-
);
|
|
6335
|
-
}, qa = (e) => {
|
|
6336
|
-
const { services: n } = Mn(), t = k(!1), i = k([]), o = k(-1), l = k("idle"), s = k(!1), r = k(!1);
|
|
6337
|
-
let h = null, u = null;
|
|
6338
|
-
const g = T(() => {
|
|
6339
|
-
var q;
|
|
6340
|
-
return o.value < 0 ? "" : ((q = i.value[o.value]) == null ? void 0 : q.src) || "";
|
|
6341
|
-
}), a = Gr(e, { src: g }), { playing: c } = a, d = T(() => l.value === "playing"), f = T(() => i.value.length > 0), m = T(
|
|
6342
|
-
() => i.value.reduce((q, I) => q + I.duration, 0)
|
|
6343
|
-
), y = T(() => o.value <= 0 ? 0 : i.value.slice(0, o.value).reduce((q, I) => q + I.duration, 0)), z = T({
|
|
6344
|
-
get() {
|
|
6345
|
-
return o.value < 0 || !g.value ? 0 : y.value + a.currentTime.value;
|
|
6346
|
-
},
|
|
6347
|
-
set(q) {
|
|
6348
|
-
a.currentTime.value = Math.max(
|
|
6349
|
-
0,
|
|
6350
|
-
q - y.value
|
|
6351
|
-
);
|
|
6352
|
-
}
|
|
6353
|
-
}), C = T({
|
|
6354
|
-
get: () => c.value,
|
|
6355
|
-
set(q) {
|
|
6356
|
-
l.value = q ? "playing" : "paused", c.value = q;
|
|
6357
|
-
}
|
|
6358
|
-
}), S = {
|
|
6359
|
-
...a,
|
|
6360
|
-
playing: C,
|
|
6361
|
-
currentTime: z,
|
|
6362
|
-
duration: m
|
|
6363
|
-
}, W = async () => {
|
|
6364
|
-
s.value = !1, await ye(), c.value = !0;
|
|
6365
|
-
}, X = async () => {
|
|
6366
|
-
i.value.length && (o.value = 0, a.currentTime.value = 0, await W());
|
|
6367
|
-
}, K = async () => {
|
|
6368
|
-
if (l.value !== "playing") return;
|
|
6369
|
-
const q = o.value + 1;
|
|
6370
|
-
if (!i.value[q]) {
|
|
6371
|
-
r.value ? l.value = "idle" : s.value = !0;
|
|
6372
|
-
return;
|
|
6373
|
-
}
|
|
6374
|
-
o.value = q, await W();
|
|
6375
|
-
}, V = async () => {
|
|
6376
|
-
if (l.value = "playing", o.value < 0 || s.value) {
|
|
6377
|
-
await K();
|
|
6378
|
-
return;
|
|
6379
|
-
}
|
|
6380
|
-
if (m.value > 0 && z.value >= m.value) {
|
|
6381
|
-
await X();
|
|
6382
|
-
return;
|
|
6383
|
-
}
|
|
6384
|
-
c.value = !0;
|
|
6385
|
-
};
|
|
6386
|
-
U(e, "ended", () => {
|
|
6387
|
-
K();
|
|
6388
|
-
}), U(e, "loadedmetadata", () => {
|
|
6389
|
-
var b;
|
|
6390
|
-
const q = i.value[o.value], I = (b = e == null ? void 0 : e.value) == null ? void 0 : b.duration;
|
|
6391
|
-
q && !q.duration && Number.isFinite(I) && (q.duration = I || 0);
|
|
6392
|
-
});
|
|
6393
|
-
const H = () => {
|
|
6394
|
-
l.value = "stopped", c.value = !1, s.value = !1, t.value = !1, h == null || h.abort(), h = null;
|
|
6395
|
-
}, F = () => {
|
|
6396
|
-
i.value.forEach((q) => URL.revokeObjectURL(q.src)), i.value = [], o.value = -1, a.currentTime.value = 0, s.value = !1, r.value = !1;
|
|
6397
|
-
}, v = () => {
|
|
6398
|
-
r.value = !0, s.value && o.value >= i.value.length - 1 && (s.value = !1, l.value = "idle"), t.value = !1;
|
|
6399
|
-
}, p = (q) => {
|
|
6400
|
-
if (q.done) {
|
|
6401
|
-
v(), u = q;
|
|
6402
|
-
return;
|
|
6403
|
-
}
|
|
6404
|
-
q.audio_base64 && (i.value[q.index] = {
|
|
6405
|
-
src: ya(q.audio_base64, q.audio_format),
|
|
6406
|
-
duration: fa(q)
|
|
6407
|
-
}, l.value === "playing" && (o.value < 0 || s.value) && K());
|
|
6408
|
-
}, Z = (q) => {
|
|
6409
|
-
const I = q instanceof Blob ? URL.createObjectURL(q) : q;
|
|
6410
|
-
i.value[0] = { src: I, duration: 0 }, r.value = !0, K();
|
|
6411
|
-
}, O = async (q) => {
|
|
6412
|
-
const I = n.value.synthesizePreviewStream, b = n.value.synthesizePreview;
|
|
6413
|
-
if (!I && !b) return null;
|
|
6414
|
-
H(), F(), t.value = !0, u = null, l.value = "playing";
|
|
6415
|
-
const w = new AbortController();
|
|
6416
|
-
h = w;
|
|
6417
|
-
try {
|
|
6418
|
-
if (I)
|
|
6419
|
-
u = await I(q, {
|
|
6420
|
-
signal: w.signal,
|
|
6421
|
-
onMessage: (x) => {
|
|
6422
|
-
w.signal.aborted || p(x);
|
|
6423
|
-
}
|
|
6424
|
-
}), r.value || v();
|
|
6425
|
-
else if (b) {
|
|
6426
|
-
const x = await b(q, w.signal);
|
|
6427
|
-
if (w.signal.aborted) return null;
|
|
6428
|
-
Z(x);
|
|
6429
|
-
}
|
|
6430
|
-
return u;
|
|
6431
|
-
} catch (x) {
|
|
6432
|
-
if (x instanceof Error && x.name === "AbortError") return null;
|
|
6433
|
-
throw x;
|
|
6434
|
-
} finally {
|
|
6435
|
-
h === w && (t.value = !1, h = null);
|
|
6436
|
-
}
|
|
6437
|
-
};
|
|
6438
|
-
return et(() => {
|
|
6439
|
-
H(), F();
|
|
6440
|
-
}), {
|
|
6441
|
-
execute: O,
|
|
6442
|
-
loading: t,
|
|
6443
|
-
abort: H,
|
|
6444
|
-
resume: V,
|
|
6445
|
-
stop: H,
|
|
6446
|
-
playing: C,
|
|
6447
|
-
mediaControls: S,
|
|
6448
|
-
shouldAutoPlay: d,
|
|
6449
|
-
hasAudio: f
|
|
6450
|
-
};
|
|
6451
|
-
}, za = { key: 0 }, ba = ["onClick"], ja = /* @__PURE__ */ $({
|
|
6514
|
+
const ba = { key: 0 }, ja = ["onClick"], va = /* @__PURE__ */ $({
|
|
6452
6515
|
__name: "selection-menu",
|
|
6453
6516
|
setup(e) {
|
|
6454
|
-
const n =
|
|
6517
|
+
const n = Gn(), {
|
|
6455
6518
|
editor: t,
|
|
6456
6519
|
getSelectedJson: i,
|
|
6457
6520
|
getReferencedVirtualElement: o,
|
|
@@ -6460,7 +6523,7 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
6460
6523
|
services: r
|
|
6461
6524
|
} = n, h = T(
|
|
6462
6525
|
() => n.features.value.enablePreview !== !1 && !!(r.value.synthesizePreviewStream || r.value.synthesizePreview)
|
|
6463
|
-
), u = `tts-rich-text-preview-${Ot(6)}`, g = k(), a =
|
|
6526
|
+
), u = `tts-rich-text-preview-${Ot(6)}`, g = k(), a = kh(g), c = wh({
|
|
6464
6527
|
on: () => {
|
|
6465
6528
|
a.abort();
|
|
6466
6529
|
}
|
|
@@ -6480,7 +6543,7 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
6480
6543
|
if (!y.timberId) return;
|
|
6481
6544
|
const C = i();
|
|
6482
6545
|
if (!C) return;
|
|
6483
|
-
const S =
|
|
6546
|
+
const S = To(C);
|
|
6484
6547
|
d(), await a.execute({
|
|
6485
6548
|
...y,
|
|
6486
6549
|
...S,
|
|
@@ -6492,8 +6555,8 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
6492
6555
|
}
|
|
6493
6556
|
}
|
|
6494
6557
|
];
|
|
6495
|
-
return (y, z) => h.value ? (Y(), L("div",
|
|
6496
|
-
j(t) ? (Y(), _(j(
|
|
6558
|
+
return (y, z) => h.value ? (Y(), L("div", ba, [
|
|
6559
|
+
j(t) ? (Y(), _(j(ya), {
|
|
6497
6560
|
key: 0,
|
|
6498
6561
|
"plugin-key": u,
|
|
6499
6562
|
editor: j(t),
|
|
@@ -6506,7 +6569,7 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
6506
6569
|
type: "button",
|
|
6507
6570
|
class: "lsh-menu-item",
|
|
6508
6571
|
onClick: C.onClick
|
|
6509
|
-
}, P(C.label), 9,
|
|
6572
|
+
}, P(C.label), 9, ja)), 64))
|
|
6510
6573
|
]),
|
|
6511
6574
|
_: 1
|
|
6512
6575
|
}, 8, ["editor", "get-referenced-virtual-element"])) : yn("", !0),
|
|
@@ -6517,7 +6580,7 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
6517
6580
|
}, null, 512)
|
|
6518
6581
|
])) : yn("", !0);
|
|
6519
6582
|
}
|
|
6520
|
-
}),
|
|
6583
|
+
}), Aa = /* @__PURE__ */ sn(va, [["__scopeId", "data-v-3171f4b7"]]), Za = /* @__PURE__ */ $({
|
|
6521
6584
|
__name: "index",
|
|
6522
6585
|
props: {
|
|
6523
6586
|
textLimit: { default: 8e3 },
|
|
@@ -6548,7 +6611,7 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
6548
6611
|
onChange: () => o("change")
|
|
6549
6612
|
}), { editor: g, clearContent: a, replaceContentWithText: c } = u;
|
|
6550
6613
|
Ch(u);
|
|
6551
|
-
const { handleChangeVoice: d } =
|
|
6614
|
+
const { handleChangeVoice: d } = ru({
|
|
6552
6615
|
richTextEditor: u
|
|
6553
6616
|
});
|
|
6554
6617
|
return n({
|
|
@@ -6565,56 +6628,17 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
6565
6628
|
},
|
|
6566
6629
|
getTtsData: () => {
|
|
6567
6630
|
var m;
|
|
6568
|
-
return
|
|
6631
|
+
return To(((m = g.value) == null ? void 0 : m.getJSON()) ?? ge());
|
|
6569
6632
|
},
|
|
6570
6633
|
replaceText: c,
|
|
6571
6634
|
handleChangeVoice: d
|
|
6572
6635
|
}
|
|
6573
6636
|
}), (m, y) => (Y(), L(tn, null, [
|
|
6574
6637
|
wn(m.$slots, "default"),
|
|
6575
|
-
i.showSelectionMenu ? (Y(), _(
|
|
6638
|
+
i.showSelectionMenu ? (Y(), _(Aa, { key: 0 })) : yn("", !0)
|
|
6576
6639
|
], 64));
|
|
6577
6640
|
}
|
|
6578
|
-
}),
|
|
6579
|
-
const n = k(!1), t = k("");
|
|
6580
|
-
let i = null, o = null;
|
|
6581
|
-
const l = () => {
|
|
6582
|
-
!e.scrollTarget || o !== null || (o = requestAnimationFrame(async () => {
|
|
6583
|
-
o = null, await ye();
|
|
6584
|
-
const h = Za(e.scrollTarget);
|
|
6585
|
-
h && (h.scrollTop = h.scrollHeight);
|
|
6586
|
-
}));
|
|
6587
|
-
}, s = async (h = {}) => {
|
|
6588
|
-
if (!(n.value || !e.runner)) {
|
|
6589
|
-
n.value = !0, t.value = "", i = new AbortController();
|
|
6590
|
-
try {
|
|
6591
|
-
const u = await e.runner(h, {
|
|
6592
|
-
signal: i.signal,
|
|
6593
|
-
onChunk: (g) => {
|
|
6594
|
-
var a;
|
|
6595
|
-
t.value += g, l(), (a = e.onChange) == null || a.call(e, g);
|
|
6596
|
-
}
|
|
6597
|
-
});
|
|
6598
|
-
u && !t.value && (t.value = u);
|
|
6599
|
-
} catch (u) {
|
|
6600
|
-
if (!(u instanceof Error && u.name === "AbortError"))
|
|
6601
|
-
throw u;
|
|
6602
|
-
} finally {
|
|
6603
|
-
n.value = !1, i = null;
|
|
6604
|
-
}
|
|
6605
|
-
}
|
|
6606
|
-
}, r = () => {
|
|
6607
|
-
i == null || i.abort(), i = null;
|
|
6608
|
-
};
|
|
6609
|
-
return Hl(() => {
|
|
6610
|
-
o !== null && cancelAnimationFrame(o), r();
|
|
6611
|
-
}), {
|
|
6612
|
-
exec: s,
|
|
6613
|
-
result: t,
|
|
6614
|
-
loading: n,
|
|
6615
|
-
abort: r
|
|
6616
|
-
};
|
|
6617
|
-
}, xa = { class: "lsh-content-box" }, Ca = { class: "lsh-form-box" }, Ia = { class: "lsh-form-top" }, Wa = { class: "lsh-form-bottom" }, wa = { class: "lsh-form-item" }, Sa = { class: "lsh-form-item-top" }, Oa = { class: "lsh-tip" }, Ya = ["onUpdate:modelValue", "placeholder", "maxlength"], ka = { class: "lsh-form-box" }, Ka = {
|
|
6641
|
+
}), xa = { class: "lsh-content-box" }, Ca = { class: "lsh-form-box" }, Ia = { class: "lsh-form-top" }, Wa = { class: "lsh-form-bottom" }, wa = { class: "lsh-form-item" }, Sa = { class: "lsh-form-item-top" }, Oa = { class: "lsh-tip" }, Ya = ["onUpdate:modelValue", "placeholder", "maxlength"], ka = { class: "lsh-form-box" }, Ka = {
|
|
6618
6642
|
key: 0,
|
|
6619
6643
|
class: "lsh-form-bottom gray"
|
|
6620
6644
|
}, Va = { class: "lsh-tip" }, Ga = {
|
|
@@ -6627,7 +6651,7 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
6627
6651
|
__name: "ai-rewrite-modal",
|
|
6628
6652
|
emits: ["confirm"],
|
|
6629
6653
|
setup(e, { expose: n, emit: t }) {
|
|
6630
|
-
const i = t, o = k(!1), l = k(), s =
|
|
6654
|
+
const i = t, o = k(!1), l = k(), s = Gn(), { notify: r, services: h, textLimitLength: u } = s, g = Vo({
|
|
6631
6655
|
runner: (Z, O) => {
|
|
6632
6656
|
var q, I;
|
|
6633
6657
|
return ((I = (q = h.value).generateDraft) == null ? void 0 : I.call(
|
|
@@ -6684,7 +6708,7 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
6684
6708
|
open: () => {
|
|
6685
6709
|
C();
|
|
6686
6710
|
}
|
|
6687
|
-
}), (Z, O) => (Y(), _(j(
|
|
6711
|
+
}), (Z, O) => (Y(), _(j(ke), {
|
|
6688
6712
|
modelValue: o.value,
|
|
6689
6713
|
"onUpdate:modelValue": O[1] || (O[1] = (q) => o.value = q),
|
|
6690
6714
|
width: 800,
|
|
@@ -6761,7 +6785,7 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
6761
6785
|
A("span", null, P(q.label), 1),
|
|
6762
6786
|
A("span", Oa, P(q.modelValue.value.length) + "/" + P(q.maxLength), 1)
|
|
6763
6787
|
]),
|
|
6764
|
-
|
|
6788
|
+
Fe(A("textarea", {
|
|
6765
6789
|
class: "lsh-textarea",
|
|
6766
6790
|
"onUpdate:modelValue": (I) => q.modelValue.value = I,
|
|
6767
6791
|
placeholder: q.placeholder,
|
|
@@ -6769,7 +6793,7 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
6769
6793
|
resizable: !1,
|
|
6770
6794
|
maxlength: q.maxLength
|
|
6771
6795
|
}, null, 12, Ya), [
|
|
6772
|
-
[
|
|
6796
|
+
[Pe, q.modelValue.value]
|
|
6773
6797
|
])
|
|
6774
6798
|
])), 64))
|
|
6775
6799
|
])
|
|
@@ -6779,13 +6803,13 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
6779
6803
|
A("span", { class: "lsh-title" }, "AI写稿结果")
|
|
6780
6804
|
], -1)),
|
|
6781
6805
|
j(c) || y.value ? (Y(), L("div", Ka, [
|
|
6782
|
-
|
|
6806
|
+
Fe(A("textarea", {
|
|
6783
6807
|
class: "lsh-textarea lsh-result-box",
|
|
6784
6808
|
ref_key: "textBoxRef",
|
|
6785
6809
|
ref: l,
|
|
6786
6810
|
"onUpdate:modelValue": O[0] || (O[0] = (q) => eo(c) ? c.value = q : null)
|
|
6787
6811
|
}, null, 512), [
|
|
6788
|
-
[
|
|
6812
|
+
[Pe, j(c)]
|
|
6789
6813
|
]),
|
|
6790
6814
|
A("div", Va, [
|
|
6791
6815
|
O[5] || (O[5] = A("span", null, "内容由AI生成,仅供参考", -1)),
|
|
@@ -6819,7 +6843,7 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
6819
6843
|
}), Ta = /* @__PURE__ */ sn(Ha, [["__scopeId", "data-v-259be8b7"]]), Ma = { class: "lsh-footer-box" }, Na = { class: "lsh-option-item gray" }, Ra = { class: "lsh-option-item gray" }, Fa = /* @__PURE__ */ $({
|
|
6820
6844
|
__name: "editor-footer",
|
|
6821
6845
|
setup(e) {
|
|
6822
|
-
const n =
|
|
6846
|
+
const n = Gn(), { clearContent: t, textLimitLength: i, textLength: o } = n, l = T(() => As(o.value / 2));
|
|
6823
6847
|
return (s, r) => (Y(), L("div", Ma, [
|
|
6824
6848
|
A("div", Na, [
|
|
6825
6849
|
J(j(hn), { name: "editor-text" }),
|
|
@@ -6923,7 +6947,7 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
6923
6947
|
__name: "formula-modal",
|
|
6924
6948
|
emits: ["confirm"],
|
|
6925
6949
|
setup(e, { expose: n, emit: t }) {
|
|
6926
|
-
const i = t, o = k(!1), l = k(""), s = k(), r =
|
|
6950
|
+
const i = t, o = k(!1), l = k(""), s = k(), r = Gn(), { services: h, textLength: u, textLimitLength: g } = r, a = Vo({
|
|
6927
6951
|
runner: (K, V) => {
|
|
6928
6952
|
var H, F;
|
|
6929
6953
|
return ((F = (H = h.value).readFormula) == null ? void 0 : F.call(H, String(K.formula ?? ""), V)) ?? Promise.resolve();
|
|
@@ -6947,7 +6971,7 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
6947
6971
|
open: (K) => {
|
|
6948
6972
|
l.value = K, C(), m();
|
|
6949
6973
|
}
|
|
6950
|
-
}), (K, V) => (Y(), _(j(
|
|
6974
|
+
}), (K, V) => (Y(), _(j(ke), {
|
|
6951
6975
|
modelValue: o.value,
|
|
6952
6976
|
"onUpdate:modelValue": V[2] || (V[2] = (H) => o.value = H),
|
|
6953
6977
|
width: 800,
|
|
@@ -7007,13 +7031,13 @@ const da = Symbol("stop-audio"), ma = (e) => {
|
|
|
7007
7031
|
]))
|
|
7008
7032
|
]),
|
|
7009
7033
|
j(d) || f.value ? (Y(), L("div", $a, [
|
|
7010
|
-
|
|
7034
|
+
Fe(A("textarea", {
|
|
7011
7035
|
class: "lsh-textarea lsh-result-box",
|
|
7012
7036
|
ref_key: "textBoxRef",
|
|
7013
7037
|
ref: s,
|
|
7014
7038
|
"onUpdate:modelValue": V[1] || (V[1] = (H) => eo(d) ? d.value = H : null)
|
|
7015
7039
|
}, null, 512), [
|
|
7016
|
-
[
|
|
7040
|
+
[Pe, j(d)]
|
|
7017
7041
|
]),
|
|
7018
7042
|
A("div", ng, [
|
|
7019
7043
|
V[7] || (V[7] = A("span", null, "内容由AI生成,仅供参考", -1)),
|
|
@@ -7051,7 +7075,7 @@ function xn(e) {
|
|
|
7051
7075
|
var n;
|
|
7052
7076
|
return e.length - (((n = e.match(rg)) === null || n === void 0 ? void 0 : n.length) || 0);
|
|
7053
7077
|
}
|
|
7054
|
-
function
|
|
7078
|
+
function et(e) {
|
|
7055
7079
|
const n = [];
|
|
7056
7080
|
let t = 0;
|
|
7057
7081
|
for (; t < e.length; ) {
|
|
@@ -30619,7 +30643,7 @@ class Wg {
|
|
|
30619
30643
|
// 构建 trie 树
|
|
30620
30644
|
buildTrie(n) {
|
|
30621
30645
|
for (let t of n) {
|
|
30622
|
-
const i =
|
|
30646
|
+
const i = et(t.zh);
|
|
30623
30647
|
let o = this.root;
|
|
30624
30648
|
for (let l = 0; l < i.length; l++) {
|
|
30625
30649
|
let s = i[l];
|
|
@@ -30674,7 +30698,7 @@ class Wg {
|
|
|
30674
30698
|
// 搜索字符串返回匹配的模式串
|
|
30675
30699
|
match(n, t) {
|
|
30676
30700
|
let i = this.root, o = [];
|
|
30677
|
-
const l =
|
|
30701
|
+
const l = et(n);
|
|
30678
30702
|
for (let s = 0; s < l.length; s++) {
|
|
30679
30703
|
let r = l[s];
|
|
30680
30704
|
for (; i !== null && !i.children.has(r); )
|
|
@@ -30725,7 +30749,7 @@ const Ae = (e) => {
|
|
|
30725
30749
|
}, Xg = (e, n, t, i, o) => {
|
|
30726
30750
|
const l = o ? Gg(e) : e, s = jl.search(l, t, i);
|
|
30727
30751
|
let r = 0;
|
|
30728
|
-
const h =
|
|
30752
|
+
const h = et(e);
|
|
30729
30753
|
for (let u = 0; u < h.length; ) {
|
|
30730
30754
|
const g = s[r];
|
|
30731
30755
|
if (g && u === g.index) {
|
|
@@ -31000,7 +31024,7 @@ function Ug(e, n = Eg) {
|
|
|
31000
31024
|
}
|
|
31001
31025
|
const Dg = (e) => {
|
|
31002
31026
|
const n = kg();
|
|
31003
|
-
return
|
|
31027
|
+
return et(e).map((t) => {
|
|
31004
31028
|
const i = n.get(t) || Vn.get(t) || t;
|
|
31005
31029
|
return {
|
|
31006
31030
|
origin: t,
|
|
@@ -31122,7 +31146,7 @@ const ic = { class: "lsh-header-content" }, oc = { class: "lsh-content-box" }, l
|
|
|
31122
31146
|
__name: "mark-pinyin-modal",
|
|
31123
31147
|
emits: ["confirm"],
|
|
31124
31148
|
setup(e, { expose: n, emit: t }) {
|
|
31125
|
-
const i = t, { voiceVersion: o } =
|
|
31149
|
+
const i = t, { voiceVersion: o } = Gn(), l = k(!1), s = [
|
|
31126
31150
|
{
|
|
31127
31151
|
label: "汉字查询",
|
|
31128
31152
|
value: "auto"
|
|
@@ -31204,7 +31228,7 @@ const ic = { class: "lsh-header-content" }, oc = { class: "lsh-content-box" }, l
|
|
|
31204
31228
|
final: ""
|
|
31205
31229
|
})), u.value = 0, h.value = he[0].value, g.pinyinOptions = [], F(v), a();
|
|
31206
31230
|
}
|
|
31207
|
-
}), (v, p) => (Y(), _(j(
|
|
31231
|
+
}), (v, p) => (Y(), _(j(ke), {
|
|
31208
31232
|
modelValue: l.value,
|
|
31209
31233
|
"onUpdate:modelValue": p[4] || (p[4] = (Z) => l.value = Z),
|
|
31210
31234
|
width: 800,
|
|
@@ -31247,12 +31271,12 @@ const ic = { class: "lsh-header-content" }, oc = { class: "lsh-content-box" }, l
|
|
|
31247
31271
|
A("div", oc, [
|
|
31248
31272
|
A("div", null, [
|
|
31249
31273
|
p[6] || (p[6] = A("div", { class: "lsh-label" }, "拼音", -1)),
|
|
31250
|
-
r.value === "auto" ?
|
|
31274
|
+
r.value === "auto" ? Fe((Y(), L("input", {
|
|
31251
31275
|
key: 0,
|
|
31252
31276
|
class: "lsh-text-box",
|
|
31253
31277
|
"onUpdate:modelValue": p[1] || (p[1] = (Z) => g.autoPinyin = Z)
|
|
31254
31278
|
}, null, 512)), [
|
|
31255
|
-
[
|
|
31279
|
+
[Pe, g.autoPinyin]
|
|
31256
31280
|
]) : (Y(), L("div", lc, P(K.value), 1))
|
|
31257
31281
|
]),
|
|
31258
31282
|
r.value === "auto" ? (Y(), L("div", sc, [
|
|
@@ -31376,7 +31400,7 @@ const ic = { class: "lsh-header-content" }, oc = { class: "lsh-content-box" }, l
|
|
|
31376
31400
|
open: (g) => {
|
|
31377
31401
|
l.origin = g, l.new = "", s();
|
|
31378
31402
|
}
|
|
31379
|
-
}), (g, a) => (Y(), _(j(
|
|
31403
|
+
}), (g, a) => (Y(), _(j(ke), {
|
|
31380
31404
|
modelValue: o.value,
|
|
31381
31405
|
"onUpdate:modelValue": a[2] || (a[2] = (c) => o.value = c),
|
|
31382
31406
|
width: 400,
|
|
@@ -31572,7 +31596,7 @@ const ic = { class: "lsh-header-content" }, oc = { class: "lsh-content-box" }, l
|
|
|
31572
31596
|
__name: "upload-modal",
|
|
31573
31597
|
emits: ["confirm"],
|
|
31574
31598
|
setup(e, { expose: n, emit: t }) {
|
|
31575
|
-
const i = t, { notify: o, services: l } =
|
|
31599
|
+
const i = t, { notify: o, services: l } = Gn(), s = k(!1), r = k([]), h = k(!1);
|
|
31576
31600
|
let u = null;
|
|
31577
31601
|
const g = [
|
|
31578
31602
|
"文件内尽量为纯文本内容,掺杂图片等其他格式内容会影响读取效果",
|
|
@@ -31599,7 +31623,7 @@ const ic = { class: "lsh-header-content" }, oc = { class: "lsh-content-box" }, l
|
|
|
31599
31623
|
open: () => {
|
|
31600
31624
|
a();
|
|
31601
31625
|
}
|
|
31602
|
-
}),
|
|
31626
|
+
}), Ye(() => u == null ? void 0 : u.abort()), (m, y) => (Y(), _(j(ke), {
|
|
31603
31627
|
modelValue: s.value,
|
|
31604
31628
|
"onUpdate:modelValue": y[1] || (y[1] = (z) => s.value = z),
|
|
31605
31629
|
width: 800,
|
|
@@ -31655,7 +31679,7 @@ const ic = { class: "lsh-header-content" }, oc = { class: "lsh-content-box" }, l
|
|
|
31655
31679
|
}), Fc = /* @__PURE__ */ sn(Rc, [["__scopeId", "data-v-cdac4822"]]), Pc = { class: "lsh-more-list" }, Ec = /* @__PURE__ */ $({
|
|
31656
31680
|
__name: "editor-toolbar",
|
|
31657
31681
|
setup(e) {
|
|
31658
|
-
const n =
|
|
31682
|
+
const n = Gn(), { replaceContentWithText: t } = n, i = k(), o = k(), l = k(/* @__PURE__ */ new Map()), s = k(""), r = k(!1), h = Tt({
|
|
31659
31683
|
customStop: !1,
|
|
31660
31684
|
language: !1,
|
|
31661
31685
|
number: !1
|
|
@@ -31668,7 +31692,7 @@ const ic = { class: "lsh-header-content" }, oc = { class: "lsh-content-box" }, l
|
|
|
31668
31692
|
setLanguage: S,
|
|
31669
31693
|
replaceText: W,
|
|
31670
31694
|
markPinyin: X
|
|
31671
|
-
} =
|
|
31695
|
+
} = lu({
|
|
31672
31696
|
editorContext: n,
|
|
31673
31697
|
openModal: {
|
|
31674
31698
|
pinyin: (b) => {
|
|
@@ -31904,7 +31928,7 @@ const ic = { class: "lsh-header-content" }, oc = { class: "lsh-content-box" }, l
|
|
|
31904
31928
|
var d;
|
|
31905
31929
|
return ((d = s.value) == null ? void 0 : d.handleChangeVoice(a, c)) ?? Promise.resolve(!1);
|
|
31906
31930
|
}
|
|
31907
|
-
}), (a, c) => (Y(), _(j(
|
|
31931
|
+
}), (a, c) => (Y(), _(j(Za), {
|
|
31908
31932
|
ref_key: "rootRef",
|
|
31909
31933
|
ref: s,
|
|
31910
31934
|
"initial-content": i.modelValue,
|
|
@@ -31954,7 +31978,7 @@ const ic = { class: "lsh-header-content" }, oc = { class: "lsh-content-box" }, l
|
|
|
31954
31978
|
], 8, Qc)) : yn("", !0)
|
|
31955
31979
|
]),
|
|
31956
31980
|
A("div", _c, [
|
|
31957
|
-
J(j(
|
|
31981
|
+
J(j(uu), { class: "editor-shell" }),
|
|
31958
31982
|
wn(a.$slots, "editor-after", {
|
|
31959
31983
|
editor: (m = s.value) == null ? void 0 : m.editor
|
|
31960
31984
|
}, void 0, !0)
|
|
@@ -31977,7 +32001,7 @@ const ic = { class: "lsh-header-content" }, oc = { class: "lsh-content-box" }, l
|
|
|
31977
32001
|
_: 3
|
|
31978
32002
|
}, 8, ["initial-content", "text-limit", "voice-version", "placeholder", "disabled", "features", "services", "get-preview-params", "show-selection-menu"]));
|
|
31979
32003
|
}
|
|
31980
|
-
}),
|
|
32004
|
+
}), ud = /* @__PURE__ */ sn(nd, [["__scopeId", "data-v-139882dc"]]);
|
|
31981
32005
|
export {
|
|
31982
32006
|
fe as CustomTagName,
|
|
31983
32007
|
on as CxButton,
|
|
@@ -31985,41 +32009,46 @@ export {
|
|
|
31985
32009
|
ct as CxRadioGroup,
|
|
31986
32010
|
qo as CxSpin,
|
|
31987
32011
|
th as CxUpload,
|
|
31988
|
-
|
|
31989
|
-
|
|
31990
|
-
|
|
31991
|
-
|
|
32012
|
+
cd as DeleteMode,
|
|
32013
|
+
dd as LanguageOptions,
|
|
32014
|
+
md as NumberToTextTools,
|
|
32015
|
+
pd as StopOptions,
|
|
31992
32016
|
hn as SvgIcon,
|
|
31993
|
-
|
|
32017
|
+
fd as ToolConfig,
|
|
31994
32018
|
Ta as TtsAiRewriteModal,
|
|
31995
|
-
|
|
32019
|
+
uu as TtsEditorContent,
|
|
31996
32020
|
Pa as TtsEditorFooter,
|
|
31997
|
-
|
|
32021
|
+
Za as TtsEditorRoot,
|
|
31998
32022
|
Uc as TtsEditorToolbar,
|
|
31999
32023
|
og as TtsFormulaModal,
|
|
32000
32024
|
Cc as TtsMarkPinyinModal,
|
|
32001
32025
|
wc as TtsReplaceTextModal,
|
|
32002
|
-
|
|
32003
|
-
|
|
32026
|
+
ud as TtsRichTextEditor,
|
|
32027
|
+
Aa as TtsSelectionMenu,
|
|
32004
32028
|
gh as TtsTagNodeView,
|
|
32005
32029
|
Fc as TtsUploadModal,
|
|
32006
|
-
|
|
32030
|
+
yd as allToolTypes,
|
|
32007
32031
|
Wl as convertToTtsFormat,
|
|
32008
32032
|
dh as createCustomTagNode,
|
|
32009
32033
|
qh as createTtsCharacterCount,
|
|
32010
32034
|
ut as getInitContent,
|
|
32011
|
-
|
|
32012
|
-
|
|
32013
|
-
zd as
|
|
32014
|
-
bd as
|
|
32015
|
-
jd as
|
|
32016
|
-
vd as
|
|
32017
|
-
Ad as
|
|
32018
|
-
Zd as
|
|
32019
|
-
xd as
|
|
32020
|
-
Cd as
|
|
32021
|
-
|
|
32035
|
+
qd as getVisualLength,
|
|
32036
|
+
Wh as globalAudioControlKey,
|
|
32037
|
+
zd as resolveTtsEditorFeatures,
|
|
32038
|
+
bd as sanitizePastedHtml,
|
|
32039
|
+
jd as sanitizePastedText,
|
|
32040
|
+
vd as splitTextToSentences,
|
|
32041
|
+
Ad as toCardinal,
|
|
32042
|
+
Zd as toColloquial,
|
|
32043
|
+
xd as toPhoneReading,
|
|
32044
|
+
Cd as toPositional,
|
|
32045
|
+
Id as transformParagraph,
|
|
32046
|
+
Gn as useEditorContext,
|
|
32022
32047
|
Ch as useEditorProvider,
|
|
32048
|
+
wh as useGlobalAudioControl,
|
|
32023
32049
|
xh as useRichTextEditor,
|
|
32024
|
-
|
|
32050
|
+
Vo as useSSETool,
|
|
32051
|
+
kh as useSynthesizeAudioTool,
|
|
32052
|
+
hd as useTestAudioTool,
|
|
32053
|
+
ru as useVoiceChangeConfirm
|
|
32025
32054
|
};
|