import {
e
} from "./chunk-KVKFRDRF.js";
import {
ge,
gt,
je
} from "./chunk-O6L55DMN.js";
import "./chunk-FNDTTSSL.js";
import "./chunk-KE6WE6IM.js";
import "./chunk-KRMUJIEJ.js";
import "./chunk-YFT6OQ5R.js";
import "./chunk-USOO7D3G.js";
import "./chunk-F73GDDKZ.js";
import {
forEach_default,
merge_default
} from "./chunk-LK7GAOJV.js";
import "./chunk-GCDLWRBO.js";
import {
createBaseVNode,
createElementBlock,
defineComponent,
openBlock,
vModelText,
withDirectives
} from "./chunk-YI6SOFIT.js";
import "./chunk-PLDDJCW6.js";
// node_modules/@fast-crud/fast-extends/dist/index-61efc2d4.mjs
var Nt = { exports: {} };
(function(et, ot) {
(function(n, t) {
et.exports = t();
})(window, function() {
return (
/******/
function(s) {
var n = {};
function t(e2) {
if (n[e2])
return n[e2].exports;
var a = n[e2] = {
/******/
i: e2,
/******/
l: false,
/******/
exports: {}
/******/
};
return s[e2].call(a.exports, a, a.exports, t), a.l = true, a.exports;
}
return t.m = s, t.c = n, t.d = function(e2, a, r) {
t.o(e2, a) || Object.defineProperty(e2, a, { enumerable: true, get: r });
}, t.r = function(e2) {
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(e2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e2, "__esModule", { value: true });
}, t.t = function(e2, a) {
if (a & 1 && (e2 = t(e2)), a & 8 || a & 4 && typeof e2 == "object" && e2 && e2.__esModule)
return e2;
var r = /* @__PURE__ */ Object.create(null);
if (t.r(r), Object.defineProperty(r, "default", { enumerable: true, value: e2 }), a & 2 && typeof e2 != "string")
for (var o in e2)
t.d(r, o, (function(v) {
return e2[v];
}).bind(null, o));
return r;
}, t.n = function(e2) {
var a = e2 && e2.__esModule ? (
/******/
function() {
return e2.default;
}
) : (
/******/
function() {
return e2;
}
);
return t.d(a, "a", a), a;
}, t.o = function(e2, a) {
return Object.prototype.hasOwnProperty.call(e2, a);
}, t.p = "", t(t.s = 141);
}([
/* 0 */
/***/
function(s, n) {
function t(e2) {
return e2 && e2.__esModule ? e2 : {
default: e2
};
}
s.exports = t;
},
/* 1 */
/***/
function(s, n, t) {
s.exports = t(142);
},
/* 2 */
/***/
function(s, n, t) {
t.r(n), t.d(n, "__extends", function() {
return a;
}), t.d(n, "__assign", function() {
return r;
}), t.d(n, "__rest", function() {
return o;
}), t.d(n, "__decorate", function() {
return v;
}), t.d(n, "__param", function() {
return g;
}), t.d(n, "__metadata", function() {
return d;
}), t.d(n, "__awaiter", function() {
return p;
}), t.d(n, "__generator", function() {
return f;
}), t.d(n, "__createBinding", function() {
return i;
}), t.d(n, "__exportStar", function() {
return u;
}), t.d(n, "__values", function() {
return l;
}), t.d(n, "__read", function() {
return m;
}), t.d(n, "__spread", function() {
return c;
}), t.d(n, "__spreadArrays", function() {
return h;
}), t.d(n, "__spreadArray", function() {
return A;
}), t.d(n, "__await", function() {
return y;
}), t.d(n, "__asyncGenerator", function() {
return x;
}), t.d(n, "__asyncDelegator", function() {
return S;
}), t.d(n, "__asyncValues", function() {
return T;
}), t.d(n, "__makeTemplateObject", function() {
return I;
}), t.d(n, "__importStar", function() {
return E;
}), t.d(n, "__importDefault", function() {
return D;
}), t.d(n, "__classPrivateFieldGet", function() {
return P;
}), t.d(n, "__classPrivateFieldSet", function() {
return M;
});
var e2 = function(R, N) {
return e2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(B, F) {
B.__proto__ = F;
} || function(B, F) {
for (var O in F)
Object.prototype.hasOwnProperty.call(F, O) && (B[O] = F[O]);
}, e2(R, N);
};
function a(R, N) {
if (typeof N != "function" && N !== null)
throw new TypeError("Class extends value " + String(N) + " is not a constructor or null");
e2(R, N);
function B() {
this.constructor = R;
}
R.prototype = N === null ? Object.create(N) : (B.prototype = N.prototype, new B());
}
var r = function() {
return r = Object.assign || function(N) {
for (var B, F = 1, O = arguments.length; F < O; F++) {
B = arguments[F];
for (var H in B)
Object.prototype.hasOwnProperty.call(B, H) && (N[H] = B[H]);
}
return N;
}, r.apply(this, arguments);
};
function o(R, N) {
var B = {};
for (var F in R)
Object.prototype.hasOwnProperty.call(R, F) && N.indexOf(F) < 0 && (B[F] = R[F]);
if (R != null && typeof Object.getOwnPropertySymbols == "function")
for (var O = 0, F = Object.getOwnPropertySymbols(R); O < F.length; O++)
N.indexOf(F[O]) < 0 && Object.prototype.propertyIsEnumerable.call(R, F[O]) && (B[F[O]] = R[F[O]]);
return B;
}
function v(R, N, B, F) {
var O = arguments.length, H = O < 3 ? N : F === null ? F = Object.getOwnPropertyDescriptor(N, B) : F, L;
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
H = Reflect.decorate(R, N, B, F);
else
for (var U = R.length - 1; U >= 0; U--)
(L = R[U]) && (H = (O < 3 ? L(H) : O > 3 ? L(N, B, H) : L(N, B)) || H);
return O > 3 && H && Object.defineProperty(N, B, H), H;
}
function g(R, N) {
return function(B, F) {
N(B, F, R);
};
}
function d(R, N) {
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
return Reflect.metadata(R, N);
}
function p(R, N, B, F) {
function O(H) {
return H instanceof B ? H : new B(function(L) {
L(H);
});
}
return new (B || (B = Promise))(function(H, L) {
function U(K) {
try {
j(F.next(K));
} catch (V) {
L(V);
}
}
function z(K) {
try {
j(F.throw(K));
} catch (V) {
L(V);
}
}
function j(K) {
K.done ? H(K.value) : O(K.value).then(U, z);
}
j((F = F.apply(R, N || [])).next());
});
}
function f(R, N) {
var B = { label: 0, sent: function() {
if (H[0] & 1)
throw H[1];
return H[1];
}, trys: [], ops: [] }, F, O, H, L;
return L = { next: U(0), throw: U(1), return: U(2) }, typeof Symbol == "function" && (L[Symbol.iterator] = function() {
return this;
}), L;
function U(j) {
return function(K) {
return z([j, K]);
};
}
function z(j) {
if (F)
throw new TypeError("Generator is already executing.");
for (; B; )
try {
if (F = 1, O && (H = j[0] & 2 ? O.return : j[0] ? O.throw || ((H = O.return) && H.call(O), 0) : O.next) && !(H = H.call(O, j[1])).done)
return H;
switch (O = 0, H && (j = [j[0] & 2, H.value]), j[0]) {
case 0:
case 1:
H = j;
break;
case 4:
return B.label++, { value: j[1], done: false };
case 5:
B.label++, O = j[1], j = [0];
continue;
case 7:
j = B.ops.pop(), B.trys.pop();
continue;
default:
if (H = B.trys, !(H = H.length > 0 && H[H.length - 1]) && (j[0] === 6 || j[0] === 2)) {
B = 0;
continue;
}
if (j[0] === 3 && (!H || j[1] > H[0] && j[1] < H[3])) {
B.label = j[1];
break;
}
if (j[0] === 6 && B.label < H[1]) {
B.label = H[1], H = j;
break;
}
if (H && B.label < H[2]) {
B.label = H[2], B.ops.push(j);
break;
}
H[2] && B.ops.pop(), B.trys.pop();
continue;
}
j = N.call(R, B);
} catch (K) {
j = [6, K], O = 0;
} finally {
F = H = 0;
}
if (j[0] & 5)
throw j[1];
return { value: j[0] ? j[1] : void 0, done: true };
}
}
var i = Object.create ? function(R, N, B, F) {
F === void 0 && (F = B), Object.defineProperty(R, F, { enumerable: true, get: function() {
return N[B];
} });
} : function(R, N, B, F) {
F === void 0 && (F = B), R[F] = N[B];
};
function u(R, N) {
for (var B in R)
B !== "default" && !Object.prototype.hasOwnProperty.call(N, B) && i(N, R, B);
}
function l(R) {
var N = typeof Symbol == "function" && Symbol.iterator, B = N && R[N], F = 0;
if (B)
return B.call(R);
if (R && typeof R.length == "number")
return {
next: function() {
return R && F >= R.length && (R = void 0), { value: R && R[F++], done: !R };
}
};
throw new TypeError(N ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function m(R, N) {
var B = typeof Symbol == "function" && R[Symbol.iterator];
if (!B)
return R;
var F = B.call(R), O, H = [], L;
try {
for (; (N === void 0 || N-- > 0) && !(O = F.next()).done; )
H.push(O.value);
} catch (U) {
L = { error: U };
} finally {
try {
O && !O.done && (B = F.return) && B.call(F);
} finally {
if (L)
throw L.error;
}
}
return H;
}
function c() {
for (var R = [], N = 0; N < arguments.length; N++)
R = R.concat(m(arguments[N]));
return R;
}
function h() {
for (var R = 0, N = 0, B = arguments.length; N < B; N++)
R += arguments[N].length;
for (var F = Array(R), O = 0, N = 0; N < B; N++)
for (var H = arguments[N], L = 0, U = H.length; L < U; L++, O++)
F[O] = H[L];
return F;
}
function A(R, N) {
for (var B = 0, F = N.length, O = R.length; B < F; B++, O++)
R[O] = N[B];
return R;
}
function y(R) {
return this instanceof y ? (this.v = R, this) : new y(R);
}
function x(R, N, B) {
if (!Symbol.asyncIterator)
throw new TypeError("Symbol.asyncIterator is not defined.");
var F = B.apply(R, N || []), O, H = [];
return O = {}, L("next"), L("throw"), L("return"), O[Symbol.asyncIterator] = function() {
return this;
}, O;
function L(Q) {
F[Q] && (O[Q] = function(w) {
return new Promise(function(G, X) {
H.push([Q, w, G, X]) > 1 || U(Q, w);
});
});
}
function U(Q, w) {
try {
z(F[Q](w));
} catch (G) {
V(H[0][3], G);
}
}
function z(Q) {
Q.value instanceof y ? Promise.resolve(Q.value.v).then(j, K) : V(H[0][2], Q);
}
function j(Q) {
U("next", Q);
}
function K(Q) {
U("throw", Q);
}
function V(Q, w) {
Q(w), H.shift(), H.length && U(H[0][0], H[0][1]);
}
}
function S(R) {
var N, B;
return N = {}, F("next"), F("throw", function(O) {
throw O;
}), F("return"), N[Symbol.iterator] = function() {
return this;
}, N;
function F(O, H) {
N[O] = R[O] ? function(L) {
return (B = !B) ? { value: y(R[O](L)), done: O === "return" } : H ? H(L) : L;
} : H;
}
}
function T(R) {
if (!Symbol.asyncIterator)
throw new TypeError("Symbol.asyncIterator is not defined.");
var N = R[Symbol.asyncIterator], B;
return N ? N.call(R) : (R = typeof l == "function" ? l(R) : R[Symbol.iterator](), B = {}, F("next"), F("throw"), F("return"), B[Symbol.asyncIterator] = function() {
return this;
}, B);
function F(H) {
B[H] = R[H] && function(L) {
return new Promise(function(U, z) {
L = R[H](L), O(U, z, L.done, L.value);
});
};
}
function O(H, L, U, z) {
Promise.resolve(z).then(function(j) {
H({ value: j, done: U });
}, L);
}
}
function I(R, N) {
return Object.defineProperty ? Object.defineProperty(R, "raw", { value: N }) : R.raw = N, R;
}
var C = Object.create ? function(R, N) {
Object.defineProperty(R, "default", { enumerable: true, value: N });
} : function(R, N) {
R.default = N;
};
function E(R) {
if (R && R.__esModule)
return R;
var N = {};
if (R != null)
for (var B in R)
B !== "default" && Object.prototype.hasOwnProperty.call(R, B) && i(N, R, B);
return C(N, R), N;
}
function D(R) {
return R && R.__esModule ? R : { default: R };
}
function P(R, N) {
if (!N.has(R))
throw new TypeError("attempted to get private field on non-instance");
return N.get(R);
}
function M(R, N, B) {
if (!N.has(R))
throw new TypeError("attempted to set private field on non-instance");
return N.set(R, B), B;
}
},
/* 3 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(89)), o = e2(t(4)), v = e2(t(26)), g = e2(t(17)), d = e2(t(121)), p = e2(t(27)), f = e2(t(91)), i = e2(t(70)), u = e2(t(28)), l = e2(t(57));
(0, a.default)(n, "__esModule", {
value: true
}), n.DomElement = void 0;
var m = t(2), c = t(6), h = [];
function A(C) {
var E = document.createElement("div");
E.innerHTML = C;
var D = E.children;
return c.toArray(D);
}
function y(C) {
return C ? C instanceof HTMLCollection || C instanceof NodeList : false;
}
function x(C) {
var E = document.querySelectorAll(C);
return c.toArray(E);
}
function S(C) {
var E = [], D = [];
return (0, r.default)(C) ? E = C : E = C.split(";"), (0, o.default)(E).call(E, function(P) {
var M, R = (0, v.default)(M = P.split(":")).call(M, function(N) {
return (0, g.default)(N).call(N);
});
R.length === 2 && D.push(R[0] + ":" + R[1]);
}), D;
}
var T = (
/** @class */
function() {
function C(E) {
if (this.elems = [], this.length = this.elems.length, this.dataSource = new d.default(), !!E) {
if (E instanceof C)
return E;
var D = [], P = E instanceof Node ? E.nodeType : -1;
if (this.selector = E, P === 1 || P === 9)
D = [E];
else if (y(E))
D = c.toArray(E);
else if (E instanceof Array)
D = E;
else if (typeof E == "string") {
var M, R = (0, g.default)(M = E.replace(`/
/mg`, "")).call(M);
(0, p.default)(R).call(R, "<") === 0 ? D = A(R) : D = x(R);
}
var N = D.length;
if (!N)
return this;
for (var B = 0; B < N; B++)
this.elems.push(D[B]);
this.length = N;
}
}
return (0, a.default)(C.prototype, "id", {
/**
* 获取元素 id
*/
get: function() {
return this.elems[0].id;
},
enumerable: false,
configurable: true
}), C.prototype.forEach = function(E) {
for (var D = 0; D < this.length; D++) {
var P = this.elems[D], M = E.call(P, P, D);
if (M === false)
break;
}
return this;
}, C.prototype.clone = function(E) {
var D;
E === void 0 && (E = false);
var P = [];
return (0, o.default)(D = this.elems).call(D, function(M) {
P.push(M.cloneNode(!!E));
}), I(P);
}, C.prototype.get = function(E) {
E === void 0 && (E = 0);
var D = this.length;
return E >= D && (E = E % D), I(this.elems[E]);
}, C.prototype.first = function() {
return this.get(0);
}, C.prototype.last = function() {
var E = this.length;
return this.get(E - 1);
}, C.prototype.on = function(E, D, P) {
var M;
return E ? (typeof D == "function" && (P = D, D = ""), (0, o.default)(M = this).call(M, function(R) {
if (!D) {
R.addEventListener(E, P);
return;
}
var N = function(F) {
var O = F.target;
O.matches(D) && P.call(O, F);
};
R.addEventListener(E, N), h.push({
elem: R,
selector: D,
fn: P,
agentFn: N
});
})) : this;
}, C.prototype.off = function(E, D, P) {
var M;
return E ? (typeof D == "function" && (P = D, D = ""), (0, o.default)(M = this).call(M, function(R) {
if (D) {
for (var N = -1, B = 0; B < h.length; B++) {
var F = h[B];
if (F.selector === D && F.fn === P && F.elem === R) {
N = B;
break;
}
}
if (N !== -1) {
var O = (0, f.default)(h).call(h, N, 1)[0].agentFn;
R.removeEventListener(E, O);
}
} else
R.removeEventListener(E, P);
})) : this;
}, C.prototype.attr = function(E, D) {
var P;
return D == null ? this.elems[0].getAttribute(E) || "" : (0, o.default)(P = this).call(P, function(M) {
M.setAttribute(E, D);
});
}, C.prototype.removeAttr = function(E) {
var D;
(0, o.default)(D = this).call(D, function(P) {
P.removeAttribute(E);
});
}, C.prototype.addClass = function(E) {
var D;
return E ? (0, o.default)(D = this).call(D, function(P) {
if (P.className) {
var M = P.className.split(/\s/);
M = (0, i.default)(M).call(M, function(R) {
return !!(0, g.default)(R).call(R);
}), (0, p.default)(M).call(M, E) < 0 && M.push(E), P.className = M.join(" ");
} else
P.className = E;
}) : this;
}, C.prototype.removeClass = function(E) {
var D;
return E ? (0, o.default)(D = this).call(D, function(P) {
if (P.className) {
var M = P.className.split(/\s/);
M = (0, i.default)(M).call(M, function(R) {
return R = (0, g.default)(R).call(R), !(!R || R === E);
}), P.className = M.join(" ");
}
}) : this;
}, C.prototype.hasClass = function(E) {
if (!E)
return false;
var D = this.elems[0];
if (!D.className)
return false;
var P = D.className.split(/\s/);
return (0, u.default)(P).call(P, E);
}, C.prototype.css = function(E, D) {
var P, M;
return D == "" ? M = "" : M = E + ":" + D + ";", (0, o.default)(P = this).call(P, function(R) {
var N, B = (0, g.default)(N = R.getAttribute("style") || "").call(N);
if (B) {
var F = S(B);
F = (0, v.default)(F).call(F, function(O) {
return (0, p.default)(O).call(O, E) === 0 ? M : O;
}), M != "" && (0, p.default)(F).call(F, M) < 0 && F.push(M), M == "" && (F = S(F)), R.setAttribute("style", F.join("; "));
} else
R.setAttribute("style", M);
});
}, C.prototype.getBoundingClientRect = function() {
var E = this.elems[0];
return E.getBoundingClientRect();
}, C.prototype.show = function() {
return this.css("display", "block");
}, C.prototype.hide = function() {
return this.css("display", "none");
}, C.prototype.children = function() {
var E = this.elems[0];
return E ? I(E.children) : null;
}, C.prototype.childNodes = function() {
var E = this.elems[0];
return E ? I(E.childNodes) : null;
}, C.prototype.replaceChildAll = function(E) {
for (var D = this.getNode(), P = this.elems[0]; P.hasChildNodes(); )
D.firstChild && P.removeChild(D.firstChild);
this.append(E);
}, C.prototype.append = function(E) {
var D;
return (0, o.default)(D = this).call(D, function(P) {
(0, o.default)(E).call(E, function(M) {
P.appendChild(M);
});
});
}, C.prototype.remove = function() {
var E;
return (0, o.default)(E = this).call(E, function(D) {
if (D.remove)
D.remove();
else {
var P = D.parentElement;
P && P.removeChild(D);
}
});
}, C.prototype.isContain = function(E) {
var D = this.elems[0], P = E.elems[0];
return D.contains(P);
}, C.prototype.getNodeName = function() {
var E = this.elems[0];
return E.nodeName;
}, C.prototype.getNode = function(E) {
E === void 0 && (E = 0);
var D;
return D = this.elems[E], D;
}, C.prototype.find = function(E) {
var D = this.elems[0];
return I(D.querySelectorAll(E));
}, C.prototype.text = function(E) {
if (E) {
var P;
return (0, o.default)(P = this).call(P, function(M) {
M.innerHTML = E;
});
} else {
var D = this.elems[0];
return D.innerHTML.replace(/<[^>]+>/g, function() {
return "";
});
}
}, C.prototype.html = function(E) {
var D = this.elems[0];
return E ? (D.innerHTML = E, this) : D.innerHTML;
}, C.prototype.val = function() {
var E, D = this.elems[0];
return (0, g.default)(E = D.value).call(E);
}, C.prototype.focus = function() {
var E;
return (0, o.default)(E = this).call(E, function(D) {
D.focus();
});
}, C.prototype.prev = function() {
var E = this.elems[0];
return I(E.previousElementSibling);
}, C.prototype.next = function() {
var E = this.elems[0];
return I(E.nextElementSibling);
}, C.prototype.getNextSibling = function() {
var E = this.elems[0];
return I(E.nextSibling);
}, C.prototype.parent = function() {
var E = this.elems[0];
return I(E.parentElement);
}, C.prototype.parentUntil = function(E, D) {
var P = D || this.elems[0];
if (P.nodeName === "BODY")
return null;
var M = P.parentElement;
return M === null ? null : M.matches(E) ? I(M) : this.parentUntil(E, M);
}, C.prototype.parentUntilEditor = function(E, D, P) {
var M = P || this.elems[0];
if (I(M).equal(D.$textContainerElem) || I(M).equal(D.$toolbarElem))
return null;
var R = M.parentElement;
return R === null ? null : R.matches(E) ? I(R) : this.parentUntilEditor(E, D, R);
}, C.prototype.equal = function(E) {
return E instanceof C ? this.elems[0] === E.elems[0] : E instanceof HTMLElement ? this.elems[0] === E : false;
}, C.prototype.insertBefore = function(E) {
var D, P = I(E), M = P.elems[0];
return M ? (0, o.default)(D = this).call(D, function(R) {
var N = M.parentNode;
N == null || N.insertBefore(R, M);
}) : this;
}, C.prototype.insertAfter = function(E) {
var D, P = I(E), M = P.elems[0], R = M && M.nextSibling;
return M ? (0, o.default)(D = this).call(D, function(N) {
var B = M.parentNode;
R ? B.insertBefore(N, R) : B.appendChild(N);
}) : this;
}, C.prototype.data = function(E, D) {
if (D != null)
this.dataSource.set(E, D);
else
return this.dataSource.get(E);
}, C.prototype.getNodeTop = function(E) {
if (this.length < 1)
return this;
var D = this.parent();
return E.$textElem.equal(this) || E.$textElem.equal(D) ? this : (D.prior = this, D.getNodeTop(E));
}, C.prototype.getOffsetData = function() {
var E = this.elems[0];
return {
top: E.offsetTop,
left: E.offsetLeft,
width: E.offsetWidth,
height: E.offsetHeight,
parent: E.offsetParent
};
}, C.prototype.scrollTop = function(E) {
var D = this.elems[0];
D.scrollTo({
top: E
});
}, C;
}()
);
n.DomElement = T;
function I() {
for (var C = [], E = 0; E < arguments.length; E++)
C[E] = arguments[E];
return new ((0, l.default)(T).apply(T, m.__spreadArrays([void 0], C)))();
}
n.default = I;
},
/* 4 */
/***/
function(s, n, t) {
s.exports = t(180);
},
/* 5 */
/***/
function(s, n, t) {
var e2 = t(8), a = t(71).f, r = t(101), o = t(9), v = t(40), g = t(19), d = t(16), p = function(f) {
var i = function(u, l, m) {
if (this instanceof f) {
switch (arguments.length) {
case 0:
return new f();
case 1:
return new f(u);
case 2:
return new f(u, l);
}
return new f(u, l, m);
}
return f.apply(this, arguments);
};
return i.prototype = f.prototype, i;
};
s.exports = function(f, i) {
var u = f.target, l = f.global, m = f.stat, c = f.proto, h = l ? e2 : m ? e2[u] : (e2[u] || {}).prototype, A = l ? o : o[u] || (o[u] = {}), y = A.prototype, x, S, T, I, C, E, D, P, M;
for (I in i)
x = r(l ? I : u + (m ? "." : "#") + I, f.forced), S = !x && h && d(h, I), E = A[I], S && (f.noTargetGet ? (M = a(h, I), D = M && M.value) : D = h[I]), C = S && D ? D : i[I], !(S && typeof E == typeof C) && (f.bind && S ? P = v(C, e2) : f.wrap && S ? P = p(C) : c && typeof C == "function" ? P = v(Function.call, C) : P = C, (f.sham || C && C.sham || E && E.sham) && g(P, "sham", true), A[I] = P, c && (T = u + "Prototype", d(o, T) || g(o, T, {}), o[T][I] = C, f.real && y && !y[I] && g(y, I, C)));
};
},
/* 6 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(92)), r = e2(t(1)), o = e2(t(256)), v = e2(t(45)), g = e2(t(46)), d = e2(t(89)), p = e2(t(26));
(0, r.default)(n, "__esModule", {
value: true
}), n.hexToRgb = n.getRandomCode = n.toArray = n.deepClone = n.isFunction = n.debounce = n.throttle = n.arrForEach = n.forEach = n.replaceSpecialSymbol = n.replaceHtmlSymbol = n.getRandom = n.UA = void 0;
var f = t(2), i = (
/** @class */
function() {
function E() {
this._ua = navigator.userAgent;
var D = this._ua.match(/(Edge?)\/(\d+)/);
this.isOldEdge = !!(D && D[1] == "Edge" && (0, o.default)(D[2]) < 19), this.isFirefox = !!(/Firefox\/\d+/.test(this._ua) && !/Seamonkey\/\d+/.test(this._ua));
}
return E.prototype.isIE = function() {
return "ActiveXObject" in window;
}, E.prototype.isWebkit = function() {
return /webkit/i.test(this._ua);
}, E;
}()
);
n.UA = new i();
function u(E) {
var D;
return E === void 0 && (E = ""), E + (0, v.default)(D = Math.random().toString()).call(D, 2);
}
n.getRandom = u;
function l(E) {
return E.replace(//gm, ">").replace(/"/gm, """).replace(/(\r\n|\r|\n)/g, "
");
}
n.replaceHtmlSymbol = l;
function m(E) {
return E.replace(/</gm, "<").replace(/>/gm, ">").replace(/"/gm, '"');
}
n.replaceSpecialSymbol = m;
function c(E, D) {
for (var P in E)
if (Object.prototype.hasOwnProperty.call(E, P)) {
var M = D(P, E[P]);
if (M === false)
break;
}
}
n.forEach = c;
function h(E, D) {
var P, M, R, N = E.length || 0;
for (P = 0; P < N && (M = E[P], R = D.call(E, M, P), R !== false); P++)
;
}
n.arrForEach = h;
function A(E, D) {
D === void 0 && (D = 200);
var P = false;
return function() {
for (var M = this, R = [], N = 0; N < arguments.length; N++)
R[N] = arguments[N];
P || (P = true, (0, g.default)(function() {
P = false, E.call.apply(E, f.__spreadArrays([M], R));
}, D));
};
}
n.throttle = A;
function y(E, D) {
D === void 0 && (D = 200);
var P = 0;
return function() {
for (var M = this, R = [], N = 0; N < arguments.length; N++)
R[N] = arguments[N];
P && window.clearTimeout(P), P = (0, g.default)(function() {
P = 0, E.call.apply(E, f.__spreadArrays([M], R));
}, D);
};
}
n.debounce = y;
function x(E) {
return typeof E == "function";
}
n.isFunction = x;
function S(E) {
if ((0, a.default)(E) !== "object" || typeof E == "function" || E === null)
return E;
var D;
(0, d.default)(E) && (D = []), (0, d.default)(E) || (D = {});
for (var P in E)
Object.prototype.hasOwnProperty.call(E, P) && (D[P] = S(E[P]));
return D;
}
n.deepClone = S;
function T(E) {
return (0, v.default)(Array.prototype).call(E);
}
n.toArray = T;
function I() {
var E;
return (0, v.default)(E = Math.random().toString(36)).call(E, -5);
}
n.getRandomCode = I;
function C(E) {
var D = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(E);
if (D == null)
return null;
var P = (0, p.default)(D).call(D, function(B) {
return (0, o.default)(B, 16);
}), M = P[1], R = P[2], N = P[3];
return "rgb(" + M + ", " + R + ", " + N + ")";
}
n.hexToRgb = C;
},
/* 7 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
}), n.EMPTY_P_REGEX = n.EMPTY_P_LAST_REGEX = n.EMPTY_P = n.urlRegex = n.EMPTY_FN = void 0;
function r() {
}
n.EMPTY_FN = r, n.urlRegex = /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-.,@?^=%&:/~+#]*[\w\-@?^=%&/~+#])?/g, n.EMPTY_P = '
<\/p>$/gim, n.EMPTY_P_REGEX = /
/gim; }, /* 8 */ /***/ function(s, n, t) { (function(e2) { var a = function(r) { return r && r.Math == Math && r; }; s.exports = // eslint-disable-next-line no-undef a(typeof globalThis == "object" && globalThis) || a(typeof window == "object" && window) || a(typeof self == "object" && self) || a(typeof e2 == "object" && e2) || // eslint-disable-next-line no-new-func Function("return this")(); }).call(this, t(145)); }, /* 9 */ /***/ function(s, n) { s.exports = {}; }, /* 10 */ /***/ function(s, n, t) { var e2 = t(8), a = t(74), r = t(16), o = t(64), v = t(76), g = t(106), d = a("wks"), p = e2.Symbol, f = g ? p : p && p.withoutSetter || o; s.exports = function(i) { return r(d, i) || (v && r(p, i) ? d[i] = p[i] : d[i] = f("Symbol." + i)), d[i]; }; }, /* 11 */ /***/ function(s, n) { s.exports = function(t) { try { return !!t(); } catch { return true; } }; }, /* 12 */ /***/ function(s, n, t) { var e2 = t(9), a = t(16), r = t(93), o = t(18).f; s.exports = function(v) { var g = e2.Symbol || (e2.Symbol = {}); a(g, v) || o(g, v, { value: r.f(v) }); }; }, /* 13 */ /***/ function(s, n) { s.exports = function(t) { return typeof t == "object" ? t !== null : typeof t == "function"; }; }, /* 14 */ /***/ function(s, n, t) { var e2 = t(11); s.exports = !e2(function() { return Object.defineProperty({}, 1, { get: function() { return 7; } })[1] != 7; }); }, /* 15 */ /***/ function(s, n, t) { var e2 = t(9); s.exports = function(a) { return e2[a + "Prototype"]; }; }, /* 16 */ /***/ function(s, n) { var t = {}.hasOwnProperty; s.exports = function(e2, a) { return t.call(e2, a); }; }, /* 17 */ /***/ function(s, n, t) { s.exports = t(192); }, /* 18 */ /***/ function(s, n, t) { var e2 = t(14), a = t(100), r = t(25), o = t(60), v = Object.defineProperty; n.f = e2 ? v : function(d, p, f) { if (r(d), p = o(p, true), r(f), a) try { return v(d, p, f); } catch { } if ("get" in f || "set" in f) throw TypeError("Accessors not supported"); return "value" in f && (d[p] = f.value), d; }; }, /* 19 */ /***/ function(s, n, t) { var e2 = t(14), a = t(18), r = t(48); s.exports = e2 ? function(o, v, g) { return a.f(o, v, r(1, g)); } : function(o, v, g) { return o[v] = g, o; }; }, /* 20 */ /***/ function(s, n, t) { var e2 = /* @__PURE__ */ function() { var h; return function() { return typeof h > "u" && (h = !!(window && document && document.all && !window.atob)), h; }; }(), a = /* @__PURE__ */ function() { var h = {}; return function(y) { if (typeof h[y] > "u") { var x = document.querySelector(y); if (window.HTMLIFrameElement && x instanceof window.HTMLIFrameElement) try { x = x.contentDocument.head; } catch { x = null; } h[y] = x; } return h[y]; }; }(), r = []; function o(c) { for (var h = -1, A = 0; A < r.length; A++) if (r[A].identifier === c) { h = A; break; } return h; } function v(c, h) { for (var A = {}, y = [], x = 0; x < c.length; x++) { var S = c[x], T = h.base ? S[0] + h.base : S[0], I = A[T] || 0, C = "".concat(T, " ").concat(I); A[T] = I + 1; var E = o(C), D = { css: S[1], media: S[2], sourceMap: S[3] }; E !== -1 ? (r[E].references++, r[E].updater(D)) : r.push({ identifier: C, updater: m(D, h), references: 1 }), y.push(C); } return y; } function g(c) { var h = document.createElement("style"), A = c.attributes || {}; if (typeof A.nonce > "u") { var y = t.nc; y && (A.nonce = y); } if (Object.keys(A).forEach(function(S) { h.setAttribute(S, A[S]); }), typeof c.insert == "function") c.insert(h); else { var x = a(c.insert || "head"); if (!x) throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid."); x.appendChild(h); } return h; } function d(c) { if (c.parentNode === null) return false; c.parentNode.removeChild(c); } var p = /* @__PURE__ */ function() { var h = []; return function(y, x) { return h[y] = x, h.filter(Boolean).join(` `); }; }(); function f(c, h, A, y) { var x = A ? "" : y.media ? "@media ".concat(y.media, " {").concat(y.css, "}") : y.css; if (c.styleSheet) c.styleSheet.cssText = p(h, x); else { var S = document.createTextNode(x), T = c.childNodes; T[h] && c.removeChild(T[h]), T.length ? c.insertBefore(S, T[h]) : c.appendChild(S); } } function i(c, h, A) { var y = A.css, x = A.media, S = A.sourceMap; if (x ? c.setAttribute("media", x) : c.removeAttribute("media"), S && typeof btoa < "u" && (y += ` /*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(S)))), " */")), c.styleSheet) c.styleSheet.cssText = y; else { for (; c.firstChild; ) c.removeChild(c.firstChild); c.appendChild(document.createTextNode(y)); } } var u = null, l = 0; function m(c, h) { var A, y, x; if (h.singleton) { var S = l++; A = u || (u = g(h)), y = f.bind(null, A, S, false), x = f.bind(null, A, S, true); } else A = g(h), y = i.bind(null, A, h), x = function() { d(A); }; return y(c), function(I) { if (I) { if (I.css === c.css && I.media === c.media && I.sourceMap === c.sourceMap) return; y(c = I); } else x(); }; } s.exports = function(c, h) { h = h || {}, !h.singleton && typeof h.singleton != "boolean" && (h.singleton = e2()), c = c || []; var A = v(c, h); return function(x) { if (x = x || [], Object.prototype.toString.call(x) === "[object Array]") { for (var S = 0; S < A.length; S++) { var T = A[S], I = o(T); r[I].references--; } for (var C = v(x, h), E = 0; E < A.length; E++) { var D = A[E], P = o(D); r[P].references === 0 && (r[P].updater(), r.splice(P, 1)); } A = C; } }; }; }, /* 21 */ /***/ function(s, n, t) { s.exports = function(r) { var o = []; return o.toString = function() { return this.map(function(g) { var d = e2(g, r); return g[2] ? "@media ".concat(g[2], " {").concat(d, "}") : d; }).join(""); }, o.i = function(v, g, d) { typeof v == "string" && (v = [[null, v, ""]]); var p = {}; if (d) for (var f = 0; f < this.length; f++) { var i = this[f][0]; i != null && (p[i] = true); } for (var u = 0; u < v.length; u++) { var l = [].concat(v[u]); d && p[l[0]] || (g && (l[2] ? l[2] = "".concat(g, " and ").concat(l[2]) : l[2] = g), o.push(l)); } }, o; }; function e2(r, o) { var v = r[1] || "", g = r[3]; if (!g) return v; if (o && typeof btoa == "function") { var d = a(g), p = g.sources.map(function(f) { return "/*# sourceURL=".concat(g.sourceRoot || "").concat(f, " */"); }); return [v].concat(p).concat([d]).join(` `); } return [v].join(` `); } function a(r) { var o = btoa(unescape(encodeURIComponent(JSON.stringify(r)))), v = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o); return "/*# ".concat(v, " */"); } }, /* 22 */ /***/ function(s, n, t) { var e2 = t(14), a = t(11), r = t(16), o = Object.defineProperty, v = {}, g = function(d) { throw d; }; s.exports = function(d, p) { if (r(v, d)) return v[d]; p || (p = {}); var f = [][d], i = r(p, "ACCESSORS") ? p.ACCESSORS : false, u = r(p, 0) ? p[0] : g, l = r(p, 1) ? p[1] : void 0; return v[d] = !!f && !a(function() { if (i && !e2) return true; var m = { length: -1 }; i ? o(m, 1, { enumerable: true, get: g }) : m[1] = 1, f.call(m, u, l); }); }; }, /* 23 */ /***/ function(s, n, t) { var e2 = t(0), a = e2(t(1)); (0, a.default)(n, "__esModule", { value: true }); var r = t(2), o = r.__importDefault(t(95)), v = ( /** @class */ function(g) { r.__extends(d, g); function d(p, f) { return g.call(this, p, f) || this; } return d; }(o.default) ); n.default = v; }, /* 24 */ /***/ function(s, n, t) { var e2 = t(0), a = e2(t(1)), r = e2(t(4)), o = e2(t(46)); (0, a.default)(n, "__esModule", { value: true }); var v = t(2), g = v.__importDefault(t(3)), d = v.__importDefault(t(95)), p = v.__importDefault(t(134)), f = ( /** @class */ function(i) { v.__extends(u, i); function u(l, m, c) { var h = i.call(this, l, m) || this; c.title = m.i18next.t("menus.dropListMenu." + c.title); var A = m.config.lang === "zh-CN" ? "" : "w-e-drop-list-tl"; if (A !== "" && c.type === "list") { var y; (0, r.default)(y = c.list).call(y, function(S) { var T = S.$elem, I = g.default(T.children()); if (I.length > 0) { var C = I == null ? void 0 : I.getNodeName(); C && C === "I" && T.addClass(A); } }); } var x = new p.default(h, c); return h.dropList = x, l.on("click", function() { var S; m.selection.getRange() != null && (l.css("z-index", m.zIndex.get("menu")), (0, r.default)(S = m.txt.eventHooks.dropListMenuHoverEvents).call(S, function(T) { return T(); }), x.show()); }).on("mouseleave", function() { l.css("z-index", "auto"), x.hideTimeoutId = (0, o.default)(function() { x.hide(); }); }), h; } return u; }(d.default) ); n.default = f; }, /* 25 */ /***/ function(s, n, t) { var e2 = t(13); s.exports = function(a) { if (!e2(a)) throw TypeError(String(a) + " is not an object"); return a; }; }, /* 26 */ /***/ function(s, n, t) { s.exports = t(188); }, /* 27 */ /***/ function(s, n, t) { s.exports = t(201); }, /* 28 */ /***/ function(s, n, t) { s.exports = t(213); }, /* 29 */ /***/ function(s, n, t) { s.exports = t(283); }, /* 30 */ /***/ function(s, n, t) { var e2 = t(72), a = t(49); s.exports = function(r) { return e2(a(r)); }; }, /* 31 */ /***/ function(s, n, t) { var e2 = t(49); s.exports = function(a) { return Object(e2(a)); }; }, /* 32 */ /***/ function(s, n, t) { var e2 = t(40), a = t(72), r = t(31), o = t(35), v = t(88), g = [].push, d = function(p) { var f = p == 1, i = p == 2, u = p == 3, l = p == 4, m = p == 6, c = p == 5 || m; return function(h, A, y, x) { for (var S = r(h), T = a(S), I = e2(A, y, 3), C = o(T.length), E = 0, D = x || v, P = f ? D(h, C) : i ? D(h, 0) : void 0, M, R; C > E; E++) if ((c || E in T) && (M = T[E], R = I(M, E, S), p)) { if (f) P[E] = R; else if (R) switch (p) { case 3: return true; case 5: return M; case 6: return E; case 2: g.call(P, M); } else if (l) return false; } return m ? -1 : u || l ? l : P; }; }; s.exports = { // `Array.prototype.forEach` method // https://tc39.github.io/ecma262/#sec-array.prototype.foreach forEach: d(0), // `Array.prototype.map` method // https://tc39.github.io/ecma262/#sec-array.prototype.map map: d(1), // `Array.prototype.filter` method // https://tc39.github.io/ecma262/#sec-array.prototype.filter filter: d(2), // `Array.prototype.some` method // https://tc39.github.io/ecma262/#sec-array.prototype.some some: d(3), // `Array.prototype.every` method // https://tc39.github.io/ecma262/#sec-array.prototype.every every: d(4), // `Array.prototype.find` method // https://tc39.github.io/ecma262/#sec-array.prototype.find find: d(5), // `Array.prototype.findIndex` method // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex findIndex: d(6) }; }, /* 33 */ /***/ function(s, n, t) { var e2 = t(0), a = e2(t(1)), r = e2(t(4)), o = e2(t(29)), v = e2(t(132)); (0, a.default)(n, "__esModule", { value: true }); var g = t(2), d = g.__importDefault(t(3)), p = t(7), f = ( /** @class */ function() { function i(u, l) { this.menu = u, this.conf = l, this.$container = d.default('
'); var m = u.editor; m.txt.eventHooks.clickEvents.push(i.hideCurAllPanels), m.txt.eventHooks.toolbarClickEvents.push(i.hideCurAllPanels), m.txt.eventHooks.dropListMenuHoverEvents.push(i.hideCurAllPanels); } return i.prototype.create = function() { var u = this, l = this.menu; if (!i.createdMenus.has(l)) { var m = this.conf, c = this.$container, h = m.width || 300, A = l.editor.$toolbarElem.getBoundingClientRect(), y = l.$elem.getBoundingClientRect(), x = A.height + A.top - y.top, S = (A.width - h) / 2 + A.left - y.left, T = 300; Math.abs(S) > T && (y.left < document.documentElement.clientWidth / 2 ? S = -y.width / 2 : S = -h + y.width / 2), c.css("width", h + "px").css("margin-top", x + "px").css("margin-left", S + "px").css("z-index", l.editor.zIndex.get("panel")); var I = d.default(''); c.append(I), I.on("click", function() { u.remove(); }); var C = d.default('" + h + "
"; } return c = c.replace(/<(\d)/gm, function(A, y) { return "<" + y; }), c = c.replace(/<(\/?meta.*?)>/gim, ""), c = g.default(c, u, l), c; } n.getPasteHtml = p; function f(i) { var u, l = [], m = d(i); if (m) return l; var c = (u = i.clipboardData) === null || u === void 0 ? void 0 : u.items; return c && (0, r.default)(v).call(v, c, function(h, A) { var y = A.type; /image/i.test(y) && l.push(A.getAsFile()); }), l; } n.getPasteImgs = f; }, /* 132 */ /***/ function(s, n, t) { s.exports = t(294); }, /* 133 */ /***/ function(s, n, t) { s.exports = t(310); }, /* 134 */ /***/ function(s, n, t) { var e2 = t(0), a = e2(t(1)), r = e2(t(4)), o = e2(t(46)); (0, a.default)(n, "__esModule", { value: true }); var v = t(2), g = v.__importDefault(t(3)), d = t(7), p = ( /** @class */ function() { function f(i, u) { var l = this; this.hideTimeoutId = 0, this.menu = i, this.conf = u; var m = g.default(''), c = g.default("" + u.title + "
"); c.addClass("w-e-dp-title"), m.append(c); var h = u.list || [], A = u.type || "list", y = u.clickHandler || d.EMPTY_FN, x = g.default('` + l.i18next.t("menus.dropListMenu.list.无序列表") + `
`), value: p.UnorderedList }, { $elem: o.default(`
` + l.i18next.t("menus.dropListMenu.list.有序列表") + `
`), value: p.OrderedList }], clickHandler: function(y) { m.command(y); } }; return m = i.call(this, c, l, h) || this, m; } return u.prototype.command = function(l) { var m = this.editor, c = m.selection.getSelectionContainerElem(); c !== void 0 && (this.handleSelectionRangeNodes(l), this.tryChangeActive()); }, u.prototype.validator = function(l, m, c) { return !(!l.length || !m.length || c.equal(l) || c.equal(m)); }, u.prototype.handleSelectionRangeNodes = function(l) { var m = this.editor, c = m.selection, h = l.toLowerCase(), A = c.getSelectionContainerElem(), y = c.getSelectionStartElem().getNodeTop(m), x = c.getSelectionEndElem().getNodeTop(m); if (this.validator(y, x, m.$textElem)) { var S = c.getRange(), T = S == null ? void 0 : S.collapsed; m.$textElem.equal(A) || (A = A.getNodeTop(m)); var I = { editor: m, listType: l, listTarget: h, $selectionElem: A, $startElem: y, $endElem: x }, C; this.isOrderElem(A) ? C = d.ClassType.Wrap : this.isOrderElem(y) && this.isOrderElem(x) ? C = d.ClassType.Join : this.isOrderElem(y) ? C = d.ClassType.StartJoin : this.isOrderElem(x) ? C = d.ClassType.EndJoin : C = d.ClassType.Other; var E = new d.default(d.createListHandle(C, I, S)); g.updateRange(m, E.getSelectionRangeElem(), !!T); } }, u.prototype.isOrderElem = function(l) { var m = l.getNodeName(); return m === p.OrderedList || m === p.UnorderedList; }, u.prototype.tryChangeActive = function() { }, u; }(v.default) ); n.default = f; }, /* 138 */ /***/ function(s, n, t) { s.exports = t(395); }, /* 139 */ /***/ function(s, n, t) { var e2 = t(0), a = e2(t(1)); (0, a.default)(n, "__esModule", { value: true }); function r(o) { var v = o.selection.getSelectionContainerElem(); return v != null && v.length ? !!(v.getNodeName() == "CODE" || v.getNodeName() == "PRE" || v.parent().getNodeName() == "CODE" || v.parent().getNodeName() == "PRE" || /hljs/.test(v.parent().attr("class"))) : false; } n.default = r; }, /* 140 */ /***/ function(s, n, t) { var e2 = t(0), a = e2(t(1)), r = e2(t(29)); (0, a.default)(n, "__esModule", { value: true }), n.todo = void 0; var o = t(2), v = o.__importDefault(t(3)), g = ( /** @class */ function() { function p(f) { var i; this.template = '
<\/p>/gim, ""), T = T.replace(c.EMPTY_P_LAST_REGEX, ""), T = T.replace(c.EMPTY_P_REGEX, "
"); var I = T.match(/<(img|br|hr|input)[^>]*>/gi); return I !== null && (0, o.default)(I).call(I, function(C) { C.match(/\/>/) || (T = T.replace(C, C.substring(0, C.length - 1) + "/>")); }), T; } y = (0, v.default)(y).call(y), y === "" && (y = c.EMPTY_P), (0, g.default)(y).call(y, "<") !== 0 && (y = "
" + y + "
"), S.html(y), x.initSelection(); }, A.prototype.setJSON = function(y) { var x = m.default(y).children(), S = this.editor, T = S.$textElem; x && T.replaceChildAll(x); }, A.prototype.getJSON = function() { var y = this.editor, x = y.$textElem; return l.default(x); }, A.prototype.text = function(y) { var x = this.editor, S = x.$textElem; if (y == null) { var T = S.text(); return T = T.replace(/\u200b/gm, ""), T; } S.text("" + y + "
"), x.initSelection(); }, A.prototype.append = function(y) { var x = this.editor; (0, g.default)(y).call(y, "<") !== 0 && (y = "" + y + "
"), this.html(this.html() + y), x.initSelection(); }, A.prototype._saveRange = function() { var y = this.editor, x = y.$textElem, S = f.default(document); function T() { y.selection.saveRange(), y.menus.changeActive(); } x.on("keyup", T); function I() { T(), x.off("click", I); } x.on("click", I); function C() { T(), S.off("mouseup", C); } function E() { S.on("mouseup", C), x.off("mouseleave", E); } x.on("mousedown", function() { x.on("mouseleave", E); }), x.on("mouseup", function(D) { x.off("mouseleave", E), (0, d.default)(function() { var P = y.selection, M = P.getRange(); M !== null && T(); }, 0); }); }, A.prototype._bindEventHooks = function() { var y = this.editor, x = y.$textElem, S = this.eventHooks; x.on("click", function(I) { var C = S.clickEvents; (0, o.default)(C).call(C, function(E) { return E(I); }); }), x.on("keyup", function(I) { if (I.keyCode === 13) { var C = S.enterUpEvents; (0, o.default)(C).call(C, function(E) { return E(I); }); } }), x.on("keyup", function(I) { var C = S.keyupEvents; (0, o.default)(C).call(C, function(E) { return E(I); }); }), x.on("keydown", function(I) { var C = S.keydownEvents; (0, o.default)(C).call(C, function(E) { return E(I); }); }), x.on("keyup", function(I) { if (!(I.keyCode !== 8 && I.keyCode !== 46)) { var C = S.deleteUpEvents; (0, o.default)(C).call(C, function(E) { return E(I); }); } }), x.on("keydown", function(I) { if (!(I.keyCode !== 8 && I.keyCode !== 46)) { var C = S.deleteDownEvents; (0, o.default)(C).call(C, function(E) { return E(I); }); } }), x.on("paste", function(I) { if (!u.UA.isIE()) { I.preventDefault(); var C = S.pasteEvents; (0, o.default)(C).call(C, function(E) { return E(I); }); } }), x.on("keydown", function(I) { (y.isFocus || y.isCompatibleMode) && (I.ctrlKey || I.metaKey) && I.keyCode === 90 && (I.preventDefault(), I.shiftKey ? y.history.restore() : y.history.revoke()); }), x.on("keyup", function(I) { if (I.keyCode === 9) { I.preventDefault(); var C = S.tabUpEvents; (0, o.default)(C).call(C, function(E) { return E(I); }); } }), x.on("keydown", function(I) { if (I.keyCode === 9) { I.preventDefault(); var C = S.tabDownEvents; (0, o.default)(C).call(C, function(E) { return E(I); }); } }), x.on( "scroll", // 使用节流 u.throttle(function(I) { var C = S.textScrollEvents; (0, o.default)(C).call(C, function(E) { return E(I); }); }, 100) ); function T(I) { I.preventDefault(); } f.default(document).on("dragleave", T).on("drop", T).on("dragenter", T).on("dragover", T), y.beforeDestroy(function() { f.default(document).off("dragleave", T).off("drop", T).off("dragenter", T).off("dragover", T); }), x.on("drop", function(I) { I.preventDefault(); var C = S.dropEvents; (0, o.default)(C).call(C, function(E) { return E(I); }); }), x.on("click", function(I) { var C = null, E = I.target, D = f.default(E); if (D.getNodeName() === "A") C = D; else { var P = D.parentUntil("a"); P != null && (C = P); } if (C) { var M = S.linkClickEvents; (0, o.default)(M).call(M, function(R) { return R(C); }); } }), x.on("click", function(I) { var C = null, E = I.target, D = f.default(E); if (D.getNodeName() === "IMG" && !D.elems[0].getAttribute("data-emoji") && (I.stopPropagation(), C = D), !!C) { var P = S.imgClickEvents; (0, o.default)(P).call(P, function(M) { return M(C); }); } }), x.on("click", function(I) { var C = null, E = I.target, D = f.default(E); if (D.getNodeName() === "PRE") C = D; else { var P = D.parentUntil("pre"); P !== null && (C = P); } if (C) { var M = S.codeClickEvents; (0, o.default)(M).call(M, function(R) { return R(C); }); } }), x.on("click", function(I) { var C = null, E = I.target, D = f.default(E); if (D.getNodeName() === "HR" && (C = D), !!C) { y.selection.createRangeByElem(C), y.selection.restoreSelection(); var P = S.splitLineEvents; (0, o.default)(P).call(P, function(M) { return M(C); }); } }), y.$toolbarElem.on("click", function(I) { var C = S.toolbarClickEvents; (0, o.default)(C).call(C, function(E) { return E(I); }); }), y.$textContainerElem.on("mousedown", function(I) { var C = I.target, E = f.default(C); if (E.hasClass("w-e-img-drag-rb")) { var D = S.imgDragBarMouseDownEvents; (0, o.default)(D).call(D, function(P) { return P(); }); } }), x.on("click", function(I) { var C = null, E = I.target; if (C = f.default(E).parentUntilEditor("TABLE", y, E), !!C) { var D = S.tableClickEvents; (0, o.default)(D).call(D, function(P) { return P(C, I); }); } }), x.on("keydown", function(I) { if (I.keyCode === 13) { var C = S.enterDownEvents; (0, o.default)(C).call(C, function(E) { return E(I); }); } }), x.on("click", function(I) { var C = null, E = I.target, D = f.default(E); if (D.getNodeName() === "VIDEO" && (I.stopPropagation(), C = D), !!C) { var P = S.videoClickEvents; (0, o.default)(P).call(P, function(M) { return M(C); }); } }); }, A; }() ); n.default = h; }, /* 283 */ /***/ function(s, n, t) { var e2 = t(284); s.exports = e2; }, /* 284 */ /***/ function(s, n, t) { var e2 = t(285), a = Array.prototype; s.exports = function(r) { var o = r.find; return r === a || r instanceof Array && o === a.find ? e2 : o; }; }, /* 285 */ /***/ function(s, n, t) { t(286); var e2 = t(15); s.exports = e2("Array").find; }, /* 286 */ /***/ function(s, n, t) { var e2 = t(5), a = t(32).find, r = t(82), o = t(22), v = "find", g = true, d = o(v); v in [] && Array(1)[v](function() { g = false; }), e2({ target: "Array", proto: true, forced: g || !d }, { find: function(f) { return a(this, f, arguments.length > 1 ? arguments[1] : void 0); } }), r(v); }, /* 287 */ /***/ function(s, n, t) { var e2 = t(0), a = e2(t(1)); (0, a.default)(n, "__esModule", { value: true }); var r = t(2), o = r.__importDefault(t(288)), v = r.__importStar(t(289)), g = r.__importDefault(t(290)), d = r.__importDefault(t(291)), p = r.__importDefault(t(298)); function f(i) { var u = i.editor, l = i.eventHooks; o.default(u, l.enterUpEvents, l.enterDownEvents), v.default(u, l.deleteUpEvents, l.deleteDownEvents), v.cutToKeepP(u, l.keyupEvents), g.default(u, l.tabDownEvents), d.default(u, l.pasteEvents), p.default(u, l.imgClickEvents); } n.default = f; }, /* 288 */ /***/ function(s, n, t) { var e2 = t(0), a = e2(t(1)), r = e2(t(27)); (0, a.default)(n, "__esModule", { value: true }); var o = t(2), v = t(7), g = o.__importDefault(t(3)); function d(p, f, i) { function u(c) { var h, A = g.default(v.EMPTY_P); if (A.insertBefore(c), (0, r.default)(h = c.html()).call(h, "
") {
u(A);
return;
}
if (h.getNodeName() === "FONT" && h.text() === "" && h.attr("face") === "monospace") {
u(A);
return;
}
if (A.equal(c)) {
var y = h.getNodeName();
y === "P" && h.attr("data-we-empty-p") === null || h.text() || u(h);
}
}
f.push(l);
function m(c) {
var h;
p.selection.saveRange((h = getSelection()) === null || h === void 0 ? void 0 : h.getRangeAt(0));
var A = p.selection.getSelectionContainerElem();
A.id === p.textElemId && (c.preventDefault(), p.cmd.do("insertHTML", "").replace(/<\/div>/gim, "
")).call(c), A = document.createElement("div"); return A.innerHTML = h, A.innerHTML.replace(/<\/p>/gim, "");
}
function f(m) {
var c = m.replace(/ " + A.i18next.t("menus.dropListMenu.head.正文") + " "
}],
clickHandler: function(C) {
y.command(C);
}
};
y = c.call(this, x, A, S) || this;
var T = A.config.onCatalogChange;
return T && (y.oldCatalogs = [], y.addListenerCatalog(), y.getCatalogs()), y;
}
return h.prototype.command = function(A) {
var y = this.editor, x = y.selection.getSelectionContainerElem();
if (x && y.$textElem.equal(x))
this.setMultilineHead(A);
else {
var S;
if ((0, r.default)(S = ["OL", "UL", "LI", "TABLE", "TH", "TR", "CODE", "HR"]).call(S, i.default(x).getNodeName()) > -1)
return;
y.cmd.do("formatBlock", A);
}
A !== " " && this.addUidForSelectionElem();
}, h.prototype.addUidForSelectionElem = function() {
var A = this.editor, y = A.selection.getSelectionContainerElem(), x = u.getRandomCode();
i.default(y).attr("id", x);
}, h.prototype.addListenerCatalog = function() {
var A = this, y = this.editor;
y.txt.eventHooks.changeEvents.push(function() {
A.getCatalogs();
});
}, h.prototype.getCatalogs = function() {
var A = this.editor, y = this.editor.$textElem, x = A.config.onCatalogChange, S = (0, o.default)(y).call(y, "h1,h2,h3,h4,h5"), T = [];
(0, v.default)(S).call(S, function(I, C) {
var E = i.default(I), D = E.attr("id"), P = E.getNodeName(), M = E.text();
D || (D = u.getRandomCode(), E.attr("id", D)), M && T.push({
tag: P,
id: D,
text: M
});
}), (0, g.default)(this.oldCatalogs) !== (0, g.default)(T) && (this.oldCatalogs = T, x && x(T));
}, h.prototype.setMultilineHead = function(A) {
var y = this, x, S, T = this.editor, I = T.selection, C = (x = I.getSelectionContainerElem()) === null || x === void 0 ? void 0 : x.elems[0], E = ["IMG", "VIDEO", "TABLE", "TH", "TR", "UL", "OL", "PRE", "HR", "BLOCKQUOTE"], D = i.default(I.getSelectionStartElem()), P = i.default(I.getSelectionEndElem());
P.elems[0].outerHTML === i.default(l.EMPTY_P).elems[0].outerHTML && !P.elems[0].nextSibling && (P = P.prev());
var M = [];
M.push(D.getNodeTop(T));
var R = [], N = (S = I.getRange()) === null || S === void 0 ? void 0 : S.commonAncestorContainer.childNodes;
N == null || (0, v.default)(N).call(N, function(O, H) {
O === M[0].getNode() && R.push(H), O === P.getNodeTop(T).getNode() && R.push(H);
});
for (var B = 0; M[B].getNode() !== P.getNodeTop(T).getNode(); ) {
if (!M[B].elems[0])
return;
var F = i.default(M[B].next().getNode());
M.push(F), B++;
}
M == null || (0, v.default)(M).call(M, function(O, H) {
if (!y.hasTag(O, E)) {
var L = i.default(A), U = O.parent().getNode();
L.html("" + O.html()), U.insertBefore(L.getNode(), O.getNode()), O.remove();
}
}), I.createRangeByElems(C.children[R[0]], C.children[R[1]]);
}, h.prototype.hasTag = function(A, y) {
var x = this, S;
if (!A)
return false;
if ((0, d.default)(y).call(y, A == null ? void 0 : A.getNodeName()))
return true;
var T = false;
return (S = A.children()) === null || S === void 0 || (0, v.default)(S).call(S, function(I) {
T = x.hasTag(i.default(I), y);
}), T;
}, h.prototype.tryChangeActive = function() {
var A = this.editor, y = /^h/i, x = A.cmd.queryCommandValue("formatBlock");
y.test(x) ? this.active() : this.unActive();
}, h;
}(f.default)
);
n.default = m;
},
/* 317 */
/***/
function(s, n, t) {
s.exports = t(318);
},
/* 318 */
/***/
function(s, n, t) {
var e2 = t(319);
s.exports = e2;
},
/* 319 */
/***/
function(s, n, t) {
t(320);
var e2 = t(9);
e2.JSON || (e2.JSON = { stringify: JSON.stringify }), s.exports = function(r, o, v) {
return e2.JSON.stringify.apply(null, arguments);
};
},
/* 320 */
/***/
function(s, n, t) {
var e2 = t(5), a = t(36), r = t(11), o = a("JSON", "stringify"), v = /[\uD800-\uDFFF]/g, g = /^[\uD800-\uDBFF]$/, d = /^[\uDC00-\uDFFF]$/, p = function(i, u, l) {
var m = l.charAt(u - 1), c = l.charAt(u + 1);
return g.test(i) && !d.test(c) || d.test(i) && !g.test(m) ? "\\u" + i.charCodeAt(0).toString(16) : i;
}, f = r(function() {
return o("\uDF06\uD834") !== '"\\udf06\\ud834"' || o("\uDEAD") !== '"\\udead"';
});
o && e2({ target: "JSON", stat: true, forced: f }, {
// eslint-disable-next-line no-unused-vars
stringify: function(u, l, m) {
var c = o.apply(null, arguments);
return typeof c == "string" ? c.replace(v, p) : c;
}
});
},
/* 321 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(17));
(0, a.default)(n, "__esModule", {
value: true
});
var o = t(2), v = o.__importDefault(t(38)), g = o.__importDefault(t(3)), d = o.__importDefault(t(322)), p = o.__importStar(t(96)), f = o.__importDefault(t(33)), i = o.__importDefault(t(324)), u = t(7), l = (
/** @class */
function(m) {
o.__extends(c, m);
function c(h) {
var A = this, y = g.default(' ` + l + " ' + f.name + "
` + m.i18next.t("menus.dropListMenu.justify.靠左") + `
` + m.i18next.t("menus.dropListMenu.justify.居中") + `
` + m.i18next.t("menus.dropListMenu.justify.靠右") + `
` + m.i18next.t("menus.dropListMenu.justify.两端") + `
` + u.i18next.t("menus.dropListMenu.indent.增加缩进") + `
`),
value: "increase"
}, {
$elem: v.default(`
` + u.i18next.t("menus.dropListMenu.indent.减少缩进") + `
`),
value: "decrease"
}],
clickHandler: function(A) {
l.command(A);
}
};
return l = f.call(this, m, u, c) || this, l;
}
return i.prototype.command = function(u) {
var l = this.editor, m = l.selection.getSelectionContainerElem();
if (m && l.$textElem.equal(m)) {
var c = l.selection.getSelectionRangeTopNodes();
c.length > 0 && (0, r.default)(c).call(c, function(h) {
d.default(v.default(h), u, l);
});
} else
m && m.length > 0 && (0, r.default)(m).call(m, function(h) {
d.default(v.default(h), u, l);
});
l.selection.restoreSelection(), this.tryChangeActive();
}, i.prototype.tryChangeActive = function() {
var u = this.editor, l = u.selection.getSelectionStartElem(), m = v.default(l).getNodeTop(u);
m.length <= 0 || (m.elems[0].style.paddingLeft != "" ? this.active() : this.unActive());
}, i;
}(g.default)
);
n.default = p;
},
/* 366 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(45)), o = e2(t(17));
(0, a.default)(n, "__esModule", {
value: true
});
var v = t(2), g = v.__importDefault(t(367)), d = v.__importDefault(t(368)), p = /^(\d+)(\w+)$/, f = /^(\d+)%$/;
function i(l) {
var m = l.config.indentation;
if (typeof m == "string") {
if (p.test(m)) {
var c, h = (0, r.default)(c = (0, o.default)(m).call(m).match(p)).call(c, 1, 3), A = h[0], y = h[1];
return {
value: Number(A),
unit: y
};
} else if (f.test(m))
return {
value: Number((0, o.default)(m).call(m).match(f)[1]),
unit: "%"
};
} else if (m.value !== void 0 && m.unit)
return m;
return {
value: 2,
unit: "em"
};
}
function u(l, m, c) {
var h = l.getNodeTop(c), A = /^(P|H[0-9]*)$/;
A.test(h.getNodeName()) && (m === "increase" ? g.default(h, i(c)) : m === "decrease" && d.default(h, i(c)));
}
n.default = u;
},
/* 367 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(45));
(0, a.default)(n, "__esModule", {
value: true
});
function o(v, g) {
var d = v.elems[0];
if (d.style.paddingLeft === "")
v.css("padding-left", g.value + g.unit);
else {
var p = d.style.paddingLeft, f = (0, r.default)(p).call(p, 0, p.length - g.unit.length), i = Number(f) + g.value;
v.css("padding-left", "" + i + g.unit);
}
}
n.default = o;
},
/* 368 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(45));
(0, a.default)(n, "__esModule", {
value: true
});
function o(v, g) {
var d = v.elems[0];
if (d.style.paddingLeft !== "") {
var p = d.style.paddingLeft, f = (0, r.default)(p).call(p, 0, p.length - g.unit.length), i = Number(f) - g.value;
i > 0 ? v.css("padding-left", "" + i + g.unit) : v.css("padding-left", "");
}
}
n.default = o;
},
/* 369 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(3)), v = r.__importDefault(t(38)), g = r.__importDefault(t(33)), d = r.__importDefault(t(370)), p = (
/** @class */
function(f) {
r.__extends(i, f);
function i(u) {
var l = this, m = o.default(`
|
/gm, `
`).replace(/<[^>]+>/gm, "");
return c;
}
function i(m) {
var c;
if (m === "")
return false;
var h = document.createElement("div");
return h.innerHTML = m, ((c = h.firstChild) === null || c === void 0 ? void 0 : c.nodeName) === "P";
}
function u(m) {
if (!(m != null && m.length))
return false;
var c = m.elems[0];
return c.nodeName === "P" && c.innerHTML === "
";
}
function l(m, c) {
function h(A) {
var y = m.config, x = y.pasteFilterStyle, S = y.pasteIgnoreImg, T = y.pasteTextHandle, I = v.getPasteHtml(A, x, S), C = v.getPasteText(A);
C = C.replace(/\n/gm, "
");
var E = m.selection.getSelectionContainerElem();
if (E) {
var D = E == null ? void 0 : E.getNodeName(), P = E == null ? void 0 : E.getNodeTop(m), M = "";
if (P.elems[0] && (M = P == null ? void 0 : P.getNodeName()), D === "CODE" || M === "PRE") {
T && g.isFunction(T) && (C = "" + (T(C) || "")), m.cmd.do("insertHTML", f(C));
return;
}
if (d.urlRegex.test(C) && x) {
T && g.isFunction(T) && (C = "" + (T(C) || ""));
var R = C.replace(d.urlRegex, function(z) {
return '' + z + "";
}), N = m.selection.getRange(), B = document.createElement("div"), F = document.createDocumentFragment();
if (B.innerHTML = R, N == null)
return;
for (; B.childNodes.length; )
F.append(B.childNodes[0]);
var O = F.querySelectorAll("a");
(0, o.default)(O).call(O, function(z) {
z.innerText = z.href;
}), N.insertNode && (N.deleteContents(), N.insertNode(F)), m.selection.clearWindowSelectionRange();
return;
}
if (I)
try {
T && g.isFunction(T) && (I = "" + (T(I) || ""));
var H = /[\.\#\@]?\w+[ ]+\{[^}]*\}/.test(I);
if (H && x)
m.cmd.do("insertHTML", "" + p(C));
else {
var L = p(I);
if (i(L)) {
var U = m.$textElem;
if (m.cmd.do("insertHTML", L), U.equal(E)) {
m.selection.createEmptyRange();
return;
}
u(P) && P.remove();
} else
m.cmd.do("insertHTML", L);
}
} catch {
T && g.isFunction(T) && (C = "" + (T(C) || "")), m.cmd.do("insertHTML", "" + p(C));
}
}
}
c.push(h);
}
n.default = l;
},
/* 292 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(17)), o = e2(t(4)), v = e2(t(28));
(0, a.default)(n, "__esModule", {
value: true
});
var g = t(2), d = t(293), p = g.__importDefault(t(297));
function f(c) {
var h = /.*?<\/span>/gi, A = /(.*?)<\/span>/;
return c.replace(h, function(y) {
var x = y.match(A);
return x == null ? "" : x[1];
});
}
function i(c, h) {
var A;
return c = (0, r.default)(A = c.toLowerCase()).call(A), !!(d.IGNORE_TAGS.has(c) || h && c === "img");
}
function u(c, h) {
var A = "";
A = "<" + c;
var y = [];
(0, o.default)(h).call(h, function(S) {
y.push(S.name + '="' + S.value + '"');
}), y.length > 0 && (A = A + " " + y.join(" "));
var x = d.EMPTY_TAGS.has(c);
return A = A + (x ? "/" : "") + ">", A;
}
function l(c) {
return "" + c + ">";
}
function m(c, h, A) {
h === void 0 && (h = true), A === void 0 && (A = false);
var y = [], x = "";
function S(E) {
E = (0, r.default)(E).call(E), E && (d.EMPTY_TAGS.has(E) || (x = E));
}
function T() {
x = "";
}
var I = new p.default();
I.parse(c, {
startElement: function(D, P) {
if (S(D), !i(D, A)) {
var M = d.NECESSARY_ATTRS.get(D) || [], R = [];
(0, o.default)(P).call(P, function(B) {
var F = B.name;
if (F === "style") {
h || R.push(B);
return;
}
(0, v.default)(M).call(M, F) !== false && R.push(B);
});
var N = u(D, R);
y.push(N);
}
},
characters: function(D) {
D && (i(x, A) || y.push(D));
},
endElement: function(D) {
if (!i(D, A)) {
var P = l(D);
y.push(P), T();
}
},
comment: function(D) {
S(D);
}
});
var C = y.join("");
return C = f(C), C;
}
n.default = m;
},
/* 293 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(132)), o = e2(t(121));
(0, a.default)(n, "__esModule", {
value: true
}), n.TOP_LEVEL_TAGS = n.EMPTY_TAGS = n.NECESSARY_ATTRS = n.IGNORE_TAGS = void 0, n.IGNORE_TAGS = new r.default(["doctype", "!doctype", "html", "head", "meta", "body", "script", "style", "link", "frame", "iframe", "title", "svg", "center", "o:p"]), n.NECESSARY_ATTRS = new o.default([["img", ["src", "alt"]], ["a", ["href", "target"]], ["td", ["colspan", "rowspan"]], ["th", ["colspan", "rowspan"]]]), n.EMPTY_TAGS = new r.default(["area", "base", "basefont", "br", "col", "hr", "img", "input", "isindex", "embed"]), n.TOP_LEVEL_TAGS = new r.default(["h1", "h2", "h3", "h4", "h5", "p", "ul", "ol", "table", "blockquote", "pre", "hr", "form"]);
},
/* 294 */
/***/
function(s, n, t) {
var e2 = t(295);
s.exports = e2;
},
/* 295 */
/***/
function(s, n, t) {
t(296), t(61), t(50), t(54);
var e2 = t(9);
s.exports = e2.Set;
},
/* 296 */
/***/
function(s, n, t) {
var e2 = t(122), a = t(124);
s.exports = e2("Set", function(r) {
return function() {
return r(this, arguments.length ? arguments[0] : void 0);
};
}, a);
},
/* 297 */
/***/
function(s, n) {
function t() {
}
t.prototype = {
handler: null,
// regexps
startTagRe: /^<([^>\s\/]+)((\s+[^=>\s]+(\s*=\s*((\"[^"]*\")|(\'[^']*\')|[^>\s]+))?)*)\s*\/?\s*>/m,
endTagRe: /^<\/([^>\s]+)[^>]*>/m,
attrRe: /([^=\s]+)(\s*=\s*((\"([^"]*)\")|(\'([^']*)\')|[^>\s]+))?/gm,
parse: function(e2, a) {
a && (this.contentHandler = a);
for (var r, o, v, g = false, d = this; e2.length > 0; )
e2.substring(0, 4) == ""), v != -1 ? (this.contentHandler.comment(e2.substring(4, v)), e2 = e2.substring(v + 3), g = false) : g = true) : e2.substring(0, 2) == "" ? this.endTagRe.test(e2) ? (r = RegExp.lastMatch, o = RegExp.rightContext, r.replace(this.endTagRe, function() {
return d.parseEndTag.apply(d, arguments);
}), e2 = o, g = false) : g = true : e2.charAt(0) == "<" && (this.startTagRe.test(e2) ? (r = RegExp.lastMatch, o = RegExp.rightContext, r.replace(this.startTagRe, function() {
return d.parseStartTag.apply(d, arguments);
}), e2 = o, g = false) : g = true), g && (v = e2.indexOf("<"), v == -1 ? (this.contentHandler.characters(e2), e2 = "") : (this.contentHandler.characters(e2.substring(0, v)), e2 = e2.substring(v))), g = true;
},
parseStartTag: function(e2, a, r) {
var o = this.parseAttributes(a, r);
this.contentHandler.startElement(a, o);
},
parseEndTag: function(e2, a) {
this.contentHandler.endElement(a);
},
parseAttributes: function(e2, a) {
var r = this, o = [];
return a.replace(this.attrRe, function(v, g, d, p, f, i, u, l) {
o.push(r.parseAttribute(e2, v, g, d, p, f, i, u, l));
}), o;
},
parseAttribute: function(e2, a, r) {
var o = "";
arguments[7] ? o = arguments[8] : arguments[5] ? o = arguments[6] : arguments[3] && (o = arguments[4]);
var v = !o && !arguments[3];
return { name: r, value: v ? null : o };
}
}, s.exports = t;
},
/* 298 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
function r(o, v) {
function g(d) {
o.selection.createRangeByElem(d), o.selection.restoreSelection();
}
v.push(g);
}
n.default = r;
},
/* 299 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(4));
(0, a.default)(n, "__esModule", {
value: true
});
var o = t(2), v = t(6), g = o.__importDefault(t(3));
function d(p) {
var f = [], i = p.childNodes() || [];
return (0, r.default)(i).call(i, function(u) {
var l, m = u.nodeType;
if (m === 3 && (l = u.textContent || "", l = v.replaceHtmlSymbol(l)), m === 1) {
l = {}, l = l, l.tag = u.nodeName.toLowerCase();
for (var c = [], h = u.attributes, A = h.length || 0, y = 0; y < A; y++) {
var x = h[y];
c.push({
name: x.name,
value: x.value
});
}
l.attrs = c, l.children = d(g.default(u));
}
l && f.push(l);
}), f;
}
n.default = d;
},
/* 300 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(92)), r = e2(t(1)), o = e2(t(4));
(0, r.default)(n, "__esModule", {
value: true
});
var v = t(2), g = v.__importDefault(t(3));
function d(p, f) {
f === void 0 && (f = document.createElement("div"));
var i = f;
return (0, o.default)(p).call(p, function(u) {
var l;
if (typeof u == "string" && (l = document.createTextNode(u)), (0, a.default)(u) === "object") {
var m;
l = document.createElement(u.tag), (0, o.default)(m = u.attrs).call(m, function(c) {
g.default(l).attr(c.name, c.value);
}), u.children && u.children.length > 0 && d(u.children, l.getRootNode());
}
l && i.appendChild(l);
}), g.default(i);
}
n.default = d;
},
/* 301 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(89)), o = e2(t(70)), v = e2(t(28)), g = e2(t(302)), d = e2(t(4)), p = e2(t(94)), f = e2(t(133)), i = e2(t(46)), u = e2(t(57));
(0, a.default)(n, "__esModule", {
value: true
});
var l = t(2), m = l.__importDefault(t(87)), c = l.__importDefault(t(314)), h = l.__importDefault(t(3)), A = (
/** @class */
function() {
function y(x) {
this.editor = x, this.menuList = [], this.constructorList = c.default;
}
return y.prototype.extend = function(x, S) {
!S || typeof S != "function" || (this.constructorList[x] = S);
}, y.prototype.init = function() {
var x, S, T = this, I = this.editor.config, C = I.excludeMenus;
(0, r.default)(C) === false && (C = []), I.menus = (0, o.default)(x = I.menus).call(x, function(F) {
return (0, v.default)(C).call(C, F) === false;
});
var E = (0, g.default)(m.default.globalCustomMenuConstructorList);
E = (0, o.default)(E).call(E, function(F) {
return (0, v.default)(C).call(C, F);
}), (0, d.default)(E).call(E, function(F) {
delete m.default.globalCustomMenuConstructorList[F];
}), (0, d.default)(S = I.menus).call(S, function(F) {
var O = T.constructorList[F];
T._initMenuList(F, O);
});
for (var D = 0, P = (0, p.default)(m.default.globalCustomMenuConstructorList); D < P.length; D++) {
var M = P[D], R = M[0], N = M[1], B = N;
this._initMenuList(R, B);
}
this._addToToolbar(), I.showMenuTooltips && this._bindMenuTooltips();
}, y.prototype._initMenuList = function(x, S) {
var T;
if (!(S == null || typeof S != "function") && !(0, f.default)(T = this.menuList).call(T, function(C) {
return C.key === x;
})) {
var I = new S(this.editor);
I.key = x, this.menuList.push(I);
}
}, y.prototype._bindMenuTooltips = function() {
var x = this.editor, S = x.$toolbarElem, T = x.config, I = T.menuTooltipPosition, C = h.default('`);
C.css("visibility", "hidden"), S.append(C), C.css("z-index", x.zIndex.get("tooltip"));
var E = 0;
function D() {
E && clearTimeout(E);
}
function P() {
D(), C.css("visibility", "hidden");
}
S.on("mouseover", function(M) {
var R = M.target, N = h.default(R), B, F;
if (N.isContain(S)) {
P();
return;
}
if (N.parentUntil(".w-e-droplist") != null)
P();
else if (N.attr("data-title"))
B = N.attr("data-title"), F = N;
else {
var O = N.parentUntil(".w-e-menu");
O != null && (B = O.attr("data-title"), F = O);
}
if (B && F) {
D();
var H = F.getOffsetData();
C.text(x.i18next.t("menus.title." + B));
var L = C.getOffsetData(), U = H.left + H.width / 2 - L.width / 2;
C.css("left", U + "px"), I === "up" ? C.css("top", H.top - L.height - 8 + "px") : I === "down" && C.css("top", H.top + H.height + 8 + "px"), E = (0, i.default)(function() {
C.css("visibility", "visible");
}, 200);
} else
P();
}).on("mouseleave", function() {
P();
});
}, y.prototype._addToToolbar = function() {
var x, S = this.editor, T = S.$toolbarElem;
(0, d.default)(x = this.menuList).call(x, function(I) {
var C = I.$elem;
C && T.append(C);
});
}, y.prototype.menuFind = function(x) {
for (var S = this.menuList, T = 0, I = S.length; T < I; T++)
if (S[T].key === x)
return S[T];
return S[0];
}, y.prototype.changeActive = function() {
var x;
(0, d.default)(x = this.menuList).call(x, function(S) {
var T;
(0, i.default)((0, u.default)(T = S.tryChangeActive).call(T, S), 100);
});
}, y;
}()
);
n.default = A;
},
/* 302 */
/***/
function(s, n, t) {
s.exports = t(303);
},
/* 303 */
/***/
function(s, n, t) {
var e2 = t(304);
s.exports = e2;
},
/* 304 */
/***/
function(s, n, t) {
t(305);
var e2 = t(9);
s.exports = e2.Object.keys;
},
/* 305 */
/***/
function(s, n, t) {
var e2 = t(5), a = t(31), r = t(52), o = t(11), v = o(function() {
r(1);
});
e2({ target: "Object", stat: true, forced: v }, {
keys: function(d) {
return r(a(d));
}
});
},
/* 306 */
/***/
function(s, n, t) {
var e2 = t(307);
s.exports = e2;
},
/* 307 */
/***/
function(s, n, t) {
t(308);
var e2 = t(9);
s.exports = e2.Object.entries;
},
/* 308 */
/***/
function(s, n, t) {
var e2 = t(5), a = t(309).entries;
e2({ target: "Object", stat: true }, {
entries: function(o) {
return a(o);
}
});
},
/* 309 */
/***/
function(s, n, t) {
var e2 = t(14), a = t(52), r = t(30), o = t(59).f, v = function(g) {
return function(d) {
for (var p = r(d), f = a(p), i = f.length, u = 0, l = [], m; i > u; )
m = f[u++], (!e2 || o.call(p, m)) && l.push(g ? [m, p[m]] : p[m]);
return l;
};
};
s.exports = {
// `Object.entries` method
// https://tc39.github.io/ecma262/#sec-object.entries
entries: v(true),
// `Object.values` method
// https://tc39.github.io/ecma262/#sec-object.values
values: v(false)
};
},
/* 310 */
/***/
function(s, n, t) {
var e2 = t(311);
s.exports = e2;
},
/* 311 */
/***/
function(s, n, t) {
var e2 = t(312), a = Array.prototype;
s.exports = function(r) {
var o = r.some;
return r === a || r instanceof Array && o === a.some ? e2 : o;
};
},
/* 312 */
/***/
function(s, n, t) {
t(313);
var e2 = t(15);
s.exports = e2("Array").some;
},
/* 313 */
/***/
function(s, n, t) {
var e2 = t(5), a = t(32).some, r = t(67), o = t(22), v = r("some"), g = o("some");
e2({ target: "Array", proto: true, forced: !v || !g }, {
some: function(p) {
return a(this, p, arguments.length > 1 ? arguments[1] : void 0);
}
});
},
/* 314 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(315)), v = r.__importDefault(t(316)), g = r.__importDefault(t(321)), d = r.__importDefault(t(326)), p = r.__importDefault(t(327)), f = r.__importDefault(t(328)), i = r.__importDefault(t(329)), u = r.__importDefault(t(331)), l = r.__importDefault(t(333)), m = r.__importDefault(t(334)), c = r.__importDefault(t(337)), h = r.__importDefault(t(338)), A = r.__importDefault(t(339)), y = r.__importDefault(t(350)), x = r.__importDefault(t(365)), S = r.__importDefault(t(369)), T = r.__importDefault(t(137)), I = r.__importDefault(t(378)), C = r.__importDefault(t(380)), E = r.__importDefault(t(381)), D = r.__importDefault(t(382)), P = r.__importDefault(t(401)), M = r.__importDefault(t(406)), R = r.__importDefault(t(409));
n.default = {
bold: o.default,
head: v.default,
italic: d.default,
link: g.default,
underline: p.default,
strikeThrough: f.default,
fontName: i.default,
fontSize: u.default,
justify: l.default,
quote: m.default,
backColor: c.default,
foreColor: h.default,
video: A.default,
image: y.default,
indent: x.default,
emoticon: S.default,
list: T.default,
lineHeight: I.default,
undo: C.default,
redo: E.default,
table: D.default,
code: P.default,
splitLine: M.default,
todo: R.default
};
},
/* 315 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(23)), v = r.__importDefault(t(3)), g = (
/** @class */
function(d) {
r.__extends(p, d);
function p(f) {
var i = this, u = v.default(``);
return i = d.call(this, u, f) || this, i;
}
return p.prototype.clickHandler = function() {
var f = this.editor, i = f.selection.isSelectionEmpty();
i && f.selection.createEmptyRange(), f.cmd.do("bold"), i && (f.selection.collapseRange(), f.selection.restoreSelection());
}, p.prototype.tryChangeActive = function() {
var f = this.editor;
f.cmd.queryCommandState("bold") ? this.active() : this.unActive();
}, p;
}(o.default)
);
n.default = g;
},
/* 316 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(27)), o = e2(t(29)), v = e2(t(4)), g = e2(t(317)), d = e2(t(28));
(0, a.default)(n, "__esModule", {
value: true
});
var p = t(2), f = p.__importDefault(t(24)), i = p.__importDefault(t(3)), u = t(6), l = t(7), m = (
/** @class */
function(c) {
p.__extends(h, c);
function h(A) {
var y = this, x = i.default(''), S = {
width: 100,
title: "设置标题",
type: "list",
list: [{
$elem: i.default("H1
"),
value: ""
}, {
$elem: i.default("
H2
"),
value: ""
}, {
$elem: i.default("
H3
"),
value: ""
}, {
$elem: i.default("
H4
"),
value: ""
}, {
$elem: i.default("
H5
"),
value: ""
}, {
$elem: i.default("
, 插入后:value="">
", 插入一个img元素
// panel 中可包含多个 tab
tabs: [{
// tab 的标题
title: l.i18next.t("menus.panelMenus.link.链接"),
// 模板
tpl: `
");
} else {
var E, D = x.elems[0], P = D.innerHTML, M = D.parentElement;
M && (0, r.default)(E = d.EXTRA_TAG).call(E, M.nodeName) ? M.innerHTML = P : y.cmd.do("insertHTML", "" + P + "");
}
return true;
}
}];
u = new g.default(i, c, h), u.create();
}
function m() {
u && (u.remove(), u = null);
}
return {
showLinkTooltip: l,
hideLinkTooltip: m
};
}
function f(i) {
var u = p(i), l = u.showLinkTooltip, m = u.hideLinkTooltip;
i.txt.eventHooks.linkClickEvents.push(l), i.txt.eventHooks.clickEvents.push(m), i.txt.eventHooks.keyupEvents.push(m), i.txt.eventHooks.toolbarClickEvents.push(m), i.txt.eventHooks.menuClickEvents.push(m), i.txt.eventHooks.textScrollEvents.push(m);
}
n.default = f;
},
/* 326 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(23)), v = r.__importDefault(t(3)), g = (
/** @class */
function(d) {
r.__extends(p, d);
function p(f) {
var i = this, u = v.default(``);
return i = d.call(this, u, f) || this, i;
}
return p.prototype.clickHandler = function() {
var f = this.editor, i = f.selection.isSelectionEmpty();
i && f.selection.createEmptyRange(), f.cmd.do("italic"), i && (f.selection.collapseRange(), f.selection.restoreSelection());
}, p.prototype.tryChangeActive = function() {
var f = this.editor;
f.cmd.queryCommandState("italic") ? this.active() : this.unActive();
}, p;
}(o.default)
);
n.default = g;
},
/* 327 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(23)), v = r.__importDefault(t(3)), g = (
/** @class */
function(d) {
r.__extends(p, d);
function p(f) {
var i = this, u = v.default(``);
return i = d.call(this, u, f) || this, i;
}
return p.prototype.clickHandler = function() {
var f = this.editor, i = f.selection.isSelectionEmpty();
i && f.selection.createEmptyRange(), f.cmd.do("underline"), i && (f.selection.collapseRange(), f.selection.restoreSelection());
}, p.prototype.tryChangeActive = function() {
var f = this.editor;
f.cmd.queryCommandState("underline") ? this.active() : this.unActive();
}, p;
}(o.default)
);
n.default = g;
},
/* 328 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(23)), v = r.__importDefault(t(3)), g = (
/** @class */
function(d) {
r.__extends(p, d);
function p(f) {
var i = this, u = v.default(``);
return i = d.call(this, u, f) || this, i;
}
return p.prototype.clickHandler = function() {
var f = this.editor, i = f.selection.isSelectionEmpty();
i && f.selection.createEmptyRange(), f.cmd.do("strikeThrough"), i && (f.selection.collapseRange(), f.selection.restoreSelection());
}, p.prototype.tryChangeActive = function() {
var f = this.editor;
f.cmd.queryCommandState("strikeThrough") ? this.active() : this.unActive();
}, p;
}(o.default)
);
n.default = g;
},
/* 329 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(24)), v = r.__importDefault(t(3)), g = r.__importDefault(t(330)), d = (
/** @class */
function(p) {
r.__extends(f, p);
function f(i) {
var u = this, l = v.default(``), m = new g.default(i.config.fontNames), c = {
width: 100,
title: "设置字体",
type: "list",
list: m.getItemList(),
clickHandler: function(A) {
u.command(A);
}
};
return u = p.call(this, l, i, c) || this, u;
}
return f.prototype.command = function(i) {
var u, l = this.editor, m = l.selection.isSelectionEmpty(), c = (u = l.selection.getSelectionContainerElem()) === null || u === void 0 ? void 0 : u.elems[0];
if (c != null) {
var h = (c == null ? void 0 : c.nodeName.toLowerCase()) !== "p", A = (c == null ? void 0 : c.getAttribute("face")) === i;
if (m) {
if (h && !A) {
var y = l.selection.getSelectionRangeTopNodes();
l.selection.createRangeByElem(y[0]), l.selection.moveCursor(y[0].elems[0]);
}
l.selection.setRangeToElem(c), l.selection.createEmptyRange();
}
l.cmd.do("fontName", i), m && (l.selection.collapseRange(), l.selection.restoreSelection());
}
}, f.prototype.tryChangeActive = function() {
}, f;
}(o.default)
);
n.default = d;
},
/* 330 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(4));
(0, a.default)(n, "__esModule", {
value: true
});
var o = t(2), v = o.__importDefault(t(3)), g = (
/** @class */
function() {
function d(p) {
var f = this;
this.itemList = [], (0, r.default)(p).call(p, function(i) {
var u = typeof i == "string" ? i : i.value, l = typeof i == "string" ? i : i.name;
f.itemList.push({
$elem: v.default(`
`;
}), h = (0, o.default)(h).call(h, function(x) {
return x !== "";
});
} else {
var y;
h = (0, r.default)(y = c.content).call(y, function(x) {
return '' + x + "";
});
}
return h.join("").replace(/ /g, "");
}
var l = (0, r.default)(i).call(i, function(c) {
return {
title: f.i18next.t("menus.panelMenus.emoticon." + c.title),
// 判断type类型如果是image则以img的形式插入否则以内容
tpl: "
/g);
return S === null || (0, r.default)(S).call(S, function(T) {
x = x.replace(T, T.replace(/<\/code>/g, `
`).replace(/
/g, ""));
}), x;
}
function y(x) {
var S, T = x.match(//gm);
if (!T || !T.length)
return x;
for (var I = (0, r.default)(S = d.deepClone(T)).call(S, function(E) {
return E = E.replace(/]+>/, ""), E.replace(/<\/span>/, "");
}), C = 0; C < T.length; C++)
x = x.replace(T[C], I[C]);
return y(x);
}
}
n.formatCodeHtml = l;
var m = (
/** @class */
function(c) {
o.__extends(h, c);
function h(A) {
var y = this, x = g.default('');
return y = c.call(this, x, A) || this, u.default(A), y;
}
return h.prototype.insertLineCode = function(A) {
var y = this.editor, x = g.default("" + A + "");
y.cmd.do("insertElem", x), y.selection.createRangeByElem(x, false), y.selection.restoreSelection();
}, h.prototype.clickHandler = function() {
var A = this.editor, y = A.selection.getSelectionText();
this.isActive || (A.selection.isSelectionEmpty() ? this.createPanel("", "") : this.insertLineCode(y));
}, h.prototype.createPanel = function(A, y) {
var x = p.default(this.editor, A, y), S = new i.default(this, x);
S.create();
}, h.prototype.tryChangeActive = function() {
var A = this.editor;
f.default(A) ? this.active() : this.unActive();
}, h;
}(v.default)
);
n.default = m;
},
/* 402 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(26));
(0, a.default)(n, "__esModule", {
value: true
});
var o = t(2), v = t(6), g = o.__importDefault(t(3)), d = o.__importDefault(t(139)), p = t(7);
function f(i, u, l) {
var m, c = v.getRandom("input-iframe"), h = v.getRandom("select"), A = v.getRandom("btn-ok");
function y(I, C) {
var E, D = d.default(i);
D && x();
var P = (E = i.selection.getSelectionStartElem()) === null || E === void 0 ? void 0 : E.elems[0].innerHTML;
P && i.cmd.do("insertHTML", p.EMPTY_P);
var M = C.replace(//g, ">");
i.highlight && (M = i.highlight.highlightAuto(M).value), i.cmd.do("insertHTML", '' + M + "
");
var R = i.selection.getSelectionStartElem(), N = R == null ? void 0 : R.getNodeTop(i);
(N == null ? void 0 : N.getNextSibling().elems.length) === 0 && g.default(p.EMPTY_P).insertAfter(N);
}
function x() {
if (d.default(i)) {
var I = i.selection.getSelectionStartElem(), C = I == null ? void 0 : I.getNodeTop(i);
C && (i.selection.createRangeByElem(C), i.selection.restoreSelection());
}
}
var S = function(C) {
return i.i18next.t(C);
}, T = {
width: 500,
height: 0,
// panel 中可包含多个 tab
tabs: [{
// tab 的标题
title: S("menus.panelMenus.code.插入代码"),
// 模板
tpl: `
`,
// 事件绑定
events: [
// 插入链接
{
selector: "#" + A,
type: "click",
fn: function() {
var C = document.getElementById(c), E = g.default("#" + h), D = E.val(), P = C.value;
if (P)
return d.default(i) ? false : (y(D, P), true);
}
}
]
}]
};
return T;
}
n.default = f;
},
/* 403 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(404)), v = r.__importDefault(t(405));
function g(d) {
o.default(d), v.default(d);
}
n.default = g;
},
/* 404 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
}), n.createShowHideFn = void 0;
var r = t(2), o = r.__importDefault(t(3)), v = r.__importDefault(t(39));
function g(p) {
var f;
function i(l) {
var m = "menus.panelMenus.code.", c = function(y, x) {
return x === void 0 && (x = m), p.i18next.t(x + y);
}, h = [{
$elem: o.default("" + c("删除代码") + ""),
onClick: function(y, x) {
return x.remove(), true;
}
}];
f = new v.default(p, l, h), f.create();
}
function u() {
f && (f.remove(), f = null);
}
return {
showCodeTooltip: i,
hideCodeTooltip: u
};
}
n.createShowHideFn = g;
function d(p) {
var f = g(p), i = f.showCodeTooltip, u = f.hideCodeTooltip;
p.txt.eventHooks.codeClickEvents.push(i), p.txt.eventHooks.clickEvents.push(u), p.txt.eventHooks.toolbarClickEvents.push(u), p.txt.eventHooks.menuClickEvents.push(u), p.txt.eventHooks.textScrollEvents.push(u);
}
n.default = d;
},
/* 405 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = t(7), v = r.__importDefault(t(3));
function g(d) {
var p = d.$textElem, f = d.selection, i = d.txt, u = i.eventHooks.keydownEvents;
u.push(function(l) {
var m;
if (l.keyCode === 40) {
var c = f.getSelectionContainerElem(), h = (m = p.children()) === null || m === void 0 ? void 0 : m.last();
if ((c == null ? void 0 : c.elems[0].tagName) === "XMP" && (h == null ? void 0 : h.elems[0].tagName) === "PRE") {
var A = v.default(o.EMPTY_P);
p.append(A);
}
}
}), u.push(function(l) {
d.selection.saveRange();
var m = f.getSelectionContainerElem();
if (m) {
var c = m.getNodeTop(d), h = c == null ? void 0 : c.prev(), A = c == null ? void 0 : c.getNextSibling();
if (h.length && (h == null ? void 0 : h.getNodeName()) === "PRE" && A.length === 0 && f.getCursorPos() === 0 && l.keyCode === 8) {
var y = v.default(o.EMPTY_P);
p.append(y);
}
}
});
}
n.default = g;
},
/* 406 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(23)), v = r.__importDefault(t(3)), g = r.__importDefault(t(407)), d = t(6), p = t(7), f = (
/** @class */
function(i) {
r.__extends(u, i);
function u(l) {
var m = this, c = v.default('');
return m = i.call(this, c, l) || this, g.default(l), m;
}
return u.prototype.clickHandler = function() {
var l = this.editor, m = l.selection.getRange(), c = l.selection.getSelectionContainerElem();
if (c != null && c.length) {
var h = v.default(c.elems[0]), A = h.parentUntil("TABLE", c.elems[0]), y = h.children();
h.getNodeName() !== "CODE" && (A && v.default(A.elems[0]).getNodeName() === "TABLE" || y && y.length !== 0 && v.default(y.elems[0]).getNodeName() === "IMG" && !(m != null && m.collapsed) || this.createSplitLine());
}
}, u.prototype.createSplitLine = function() {
var l = "
" + p.EMPTY_P;
d.UA.isFirefox && (l = "
"), this.editor.cmd.do("insertHTML", l);
}, u.prototype.tryChangeActive = function() {
}, u;
}(o.default)
);
n.default = f;
},
/* 407 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(408));
function v(g) {
o.default(g);
}
n.default = v;
},
/* 408 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(3)), v = r.__importDefault(t(39));
function g(p) {
var f;
function i(l) {
var m = [{
$elem: o.default("" + p.i18next.t("menus.panelMenus.删除") + ""),
onClick: function(h, A) {
return h.selection.createRangeByElem(A), h.selection.restoreSelection(), h.cmd.do("delete"), true;
}
}];
f = new v.default(p, l, m), f.create();
}
function u() {
f && (f.remove(), f = null);
}
return {
showSplitLineTooltip: i,
hideSplitLineTooltip: u
};
}
function d(p) {
var f = g(p), i = f.showSplitLineTooltip, u = f.hideSplitLineTooltip;
p.txt.eventHooks.splitLineEvents.push(i), p.txt.eventHooks.clickEvents.push(u), p.txt.eventHooks.keyupEvents.push(u), p.txt.eventHooks.toolbarClickEvents.push(u), p.txt.eventHooks.menuClickEvents.push(u), p.txt.eventHooks.textScrollEvents.push(u);
}
n.default = d;
},
/* 409 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(4));
(0, a.default)(n, "__esModule", {
value: true
});
var o = t(2), v = o.__importDefault(t(3)), g = o.__importDefault(t(23)), d = t(98), p = o.__importDefault(t(415)), f = o.__importDefault(t(140)), i = (
/** @class */
function(u) {
o.__extends(l, u);
function l(m) {
var c = this, h = v.default(``);
return c = u.call(this, h, m) || this, p.default(m), c;
}
return l.prototype.clickHandler = function() {
var m = this.editor;
d.isAllTodo(m) ? (this.cancelTodo(), this.tryChangeActive()) : this.setTodo();
}, l.prototype.tryChangeActive = function() {
d.isAllTodo(this.editor) ? this.active() : this.unActive();
}, l.prototype.setTodo = function() {
var m = this.editor, c = m.selection.getSelectionRangeTopNodes();
(0, r.default)(c).call(c, function(h) {
var A, y = h == null ? void 0 : h.getNodeName();
if (y === "P") {
var x = f.default(h), S = x.getTodo(), T = (A = S.children()) === null || A === void 0 ? void 0 : A.getNode();
S.insertAfter(h), m.selection.moveCursor(T), h.remove();
}
}), this.tryChangeActive();
}, l.prototype.cancelTodo = function() {
var m = this.editor, c = m.selection.getSelectionRangeTopNodes();
(0, r.default)(c).call(c, function(h) {
var A, y, x, S = (y = (A = h.childNodes()) === null || A === void 0 ? void 0 : A.childNodes()) === null || y === void 0 ? void 0 : y.clone(true), T = v.default("");
T.append(S), T.insertAfter(h), (x = T.childNodes()) === null || x === void 0 || x.get(0).remove(), m.selection.moveCursor(T.getNode()), h.remove();
});
}, l;
}(g.default)
);
n.default = i;
},
/* 410 */
/***/
function(s, n, t) {
s.exports = t(411);
},
/* 411 */
/***/
function(s, n, t) {
var e2 = t(412);
s.exports = e2;
},
/* 412 */
/***/
function(s, n, t) {
var e2 = t(413), a = Array.prototype;
s.exports = function(r) {
var o = r.every;
return r === a || r instanceof Array && o === a.every ? e2 : o;
};
},
/* 413 */
/***/
function(s, n, t) {
t(414);
var e2 = t(15);
s.exports = e2("Array").every;
},
/* 414 */
/***/
function(s, n, t) {
var e2 = t(5), a = t(32).every, r = t(67), o = t(22), v = r("every"), g = o("every");
e2({ target: "Array", proto: true, forced: !v || !g }, {
every: function(p) {
return a(this, p, arguments.length > 1 ? arguments[1] : void 0);
}
});
},
/* 415 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(4));
(0, a.default)(n, "__esModule", {
value: true
});
var o = t(2), v = o.__importDefault(t(3)), g = t(98), d = o.__importDefault(t(140)), p = t(98), f = t(7);
function i(u) {
function l(A) {
var y, x;
if (g.isAllTodo(u)) {
A.preventDefault();
var S = u.selection, T = S.getSelectionRangeTopNodes()[0], I = (y = T.childNodes()) === null || y === void 0 ? void 0 : y.get(0), C = (x = window.getSelection()) === null || x === void 0 ? void 0 : x.anchorNode, E = S.getRange();
if (!(E != null && E.collapsed)) {
var D = E == null ? void 0 : E.commonAncestorContainer.childNodes, P = E == null ? void 0 : E.startContainer, M = E == null ? void 0 : E.endContainer, R = E == null ? void 0 : E.startOffset, N = E == null ? void 0 : E.endOffset, B = 0, F = 0, O = [];
D == null || (0, r.default)(D).call(D, function(G, X) {
G.contains(P) && (B = X), G.contains(M) && (F = X);
}), F - B > 1 && (D == null || (0, r.default)(D).call(D, function(G, X) {
X <= B || X >= F || O.push(G);
}), (0, r.default)(O).call(O, function(G) {
G.remove();
})), p.dealTextNode(P, R), p.dealTextNode(M, N, false), u.selection.moveCursor(M, 0);
}
if (T.text() === "") {
var H = v.default(f.EMPTY_P);
H.insertAfter(T), S.moveCursor(H.getNode()), T.remove();
return;
}
var L = S.getCursorPos(), U = g.getCursorNextNode(I == null ? void 0 : I.getNode(), C, L), z = d.default(v.default(U)), j = z.getInputContainer(), K = j.parent().getNode(), V = z.getTodo(), Q = j.getNode().nextSibling;
if ((I == null ? void 0 : I.text()) === "" && (I == null || I.append(v.default("
"))), V.insertAfter(T), !Q || (Q == null ? void 0 : Q.textContent) === "") {
if ((Q == null ? void 0 : Q.nodeName) !== "BR") {
var w = v.default("
");
w.insertAfter(j);
}
S.moveCursor(K, 1);
} else
S.moveCursor(K);
}
}
function m(A) {
var y, x;
if (g.isAllTodo(u)) {
var S = u.selection, T = S.getSelectionRangeTopNodes()[0], I = (y = T.childNodes()) === null || y === void 0 ? void 0 : y.getNode(), C = v.default(""), E = C.getNode(), D = (x = window.getSelection()) === null || x === void 0 ? void 0 : x.anchorNode, P = S.getCursorPos(), M = D.previousSibling;
if (T.text() === "") {
A.preventDefault();
var R = v.default(f.EMPTY_P);
R.insertAfter(T), T.remove(), S.moveCursor(R.getNode(), 0);
return;
}
if ((M == null ? void 0 : M.nodeName) === "SPAN" && M.childNodes[0].nodeName === "INPUT" && P === 0) {
var N;
A.preventDefault(), I == null || (0, r.default)(N = I.childNodes).call(N, function(B, F) {
F !== 0 && E.appendChild(B.cloneNode(true));
}), C.insertAfter(T), T.remove();
}
}
}
function c() {
var A = u.selection, y = A.getSelectionRangeTopNodes()[0];
y && p.isTodo(y) && y.text() === "" && (v.default(f.EMPTY_P).insertAfter(y), y.remove());
}
function h(A) {
A && A.target instanceof HTMLInputElement && A.target.type === "checkbox" && (A.target.checked ? A.target.setAttribute("checked", "true") : A.target.removeAttribute("checked"));
}
u.txt.eventHooks.enterDownEvents.push(l), u.txt.eventHooks.deleteUpEvents.push(c), u.txt.eventHooks.deleteDownEvents.push(m), u.txt.eventHooks.clickEvents.push(h);
}
n.default = i;
},
/* 416 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
}), n.selectorValidator = void 0;
var r = t(2), o = r.__importDefault(t(3)), v = t(6), g = t(7), d = r.__importDefault(t(130)), p = {
border: "1px solid #c9d8db",
toolbarBgColor: "#FFF",
toolbarBottomBorder: "1px solid #EEE"
};
function f(u) {
var l = u.toolbarSelector, m = o.default(l), c = u.textSelector, h = u.config, A = h.height, y = u.i18next, x = o.default(""), S = o.default(""), T, I, C = null;
c == null ? (I = m.children(), m.append(x).append(S), x.css("background-color", p.toolbarBgColor).css("border", p.border).css("border-bottom", p.toolbarBottomBorder), S.css("border", p.border).css("border-top", "none").css("height", A + "px")) : (m.append(x), C = o.default(c).children(), o.default(c).append(S), I = S.children()), T = o.default(""), T.attr("contenteditable", "true").css("width", "100%").css("height", "100%");
var E, D = u.config.placeholder;
D !== d.default.placeholder ? E = o.default("" + D + "") : E = o.default("" + y.t(D) + ""), E.addClass("placeholder"), I && I.length ? (T.append(I), E.hide()) : T.append(o.default(g.EMPTY_P)), C && C.length && (T.append(C), E.hide()), S.append(T), S.append(E), x.addClass("w-e-toolbar").css("z-index", u.zIndex.get("toolbar")), S.addClass("w-e-text-container"), S.css("z-index", u.zIndex.get()), T.addClass("w-e-text");
var P = v.getRandom("toolbar-elem");
x.attr("id", P);
var M = v.getRandom("text-elem");
T.attr("id", M);
var R = S.getBoundingClientRect().height, N = T.getBoundingClientRect().height;
R !== N && T.css("min-height", R + "px"), u.$toolbarElem = x, u.$textContainerElem = S, u.$textElem = T, u.toolbarElemId = P, u.textElemId = M;
}
n.default = f;
function i(u) {
var l = "data-we-id", m = /^wangEditor-\d+$/, c = u.textSelector, h = u.toolbarSelector, A = {
bar: o.default(""),
text: o.default("")
};
if (h == null)
throw new Error("错误:初始化编辑器时候未传入任何参数,请查阅文档");
if (A.bar = o.default(h), !A.bar.elems.length)
throw new Error("无效的节点选择器:" + h);
if (m.test(A.bar.attr(l)))
throw new Error("初始化节点已存在编辑器实例,无法重复创建编辑器");
if (c) {
if (A.text = o.default(c), !A.text.elems.length)
throw new Error("无效的节点选择器:" + c);
if (m.test(A.text.attr(l)))
throw new Error("初始化节点已存在编辑器实例,无法重复创建编辑器");
}
A.bar.attr(l, u.id), A.text.attr(l, u.id), u.beforeDestroy(function() {
A.bar.removeAttr(l), A.text.removeAttr(l);
});
}
n.selectorValidator = i;
},
/* 417 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(3)), v = t(7);
function g(d, p) {
var f = d.$textElem, i = f.children();
if (!i || !i.length) {
f.append(o.default(v.EMPTY_P)), g(d);
return;
}
var u = i.last();
if (p) {
var l = u.html().toLowerCase(), m = u.getNodeName();
if (l !== "
" && l !== "
" || m !== "P") {
f.append(o.default(v.EMPTY_P)), g(d);
return;
}
}
d.selection.createRangeByElem(u, false, true), d.config.focus ? d.selection.restoreSelection() : d.selection.clearWindowSelectionRange();
}
n.default = g;
},
/* 418 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(4));
(0, a.default)(n, "__esModule", {
value: true
});
var o = t(2), v = o.__importDefault(t(3));
function g(l) {
d(l), p(l), f(l);
}
function d(l) {
l.txt.eventHooks.changeEvents.push(function() {
var m = l.config.onchange;
if (m) {
var c = l.txt.html() || "";
l.isFocus = true, m(c);
}
l.txt.togglePlaceholder();
});
}
function p(l) {
l.isFocus = false;
function m(c) {
var h = c.target, A = v.default(h), y = l.$textElem, x = l.$toolbarElem, S = y.isContain(A), T = x.isContain(A), I = x.elems[0] == c.target;
if (S)
l.isFocus || u(l), l.isFocus = true;
else {
if (T && !I || !l.isFocus)
return;
i(l), l.isFocus = false;
}
}
document.activeElement === l.$textElem.elems[0] && l.config.focus && (u(l), l.isFocus = true), v.default(document).on("click", m), l.beforeDestroy(function() {
v.default(document).off("click", m);
});
}
function f(l) {
l.$textElem.on("compositionstart", function() {
l.isComposing = true, l.txt.togglePlaceholder();
}).on("compositionend", function() {
l.isComposing = false, l.txt.togglePlaceholder();
});
}
function i(l) {
var m, c = l.config, h = c.onblur, A = l.txt.html() || "";
(0, r.default)(m = l.txt.eventHooks.onBlurEvents).call(m, function(y) {
return y();
}), h(A);
}
function u(l) {
var m = l.config, c = m.onfocus, h = l.txt.html() || "";
c(h);
}
n.default = g;
},
/* 419 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
function r(o) {
var v = o.config, g = v.lang, d = v.languages;
if (o.i18next != null) {
try {
o.i18next.init({
ns: "wangEditor",
lng: g,
defaultNS: "wangEditor",
resources: d
});
} catch (p) {
throw new Error("i18next:" + p);
}
return;
}
o.i18next = {
t: function(f) {
var i = f.split(".");
return i[i.length - 1];
}
};
}
n.default = r;
},
/* 420 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(29));
(0, a.default)(n, "__esModule", {
value: true
}), n.setUnFullScreen = n.setFullScreen = void 0;
var o = t(2), v = o.__importDefault(t(3));
t(421);
var g = "w-e-icon-fullscreen", d = "w-e-icon-fullscreen_exit", p = "w-e-full-screen-editor";
n.setFullScreen = function(i) {
var u = v.default(i.toolbarSelector), l = i.$textContainerElem, m = i.$toolbarElem, c = (0, r.default)(m).call(m, "i." + g), h = i.config;
c.removeClass(g), c.addClass(d), u.addClass(p), u.css("z-index", h.zIndexFullScreen);
var A = m.getBoundingClientRect();
l.css("height", "calc(100% - " + A.height + "px)");
}, n.setUnFullScreen = function(i) {
var u = v.default(i.toolbarSelector), l = i.$textContainerElem, m = i.$toolbarElem, c = (0, r.default)(m).call(m, "i." + d), h = i.config;
c.removeClass(d), c.addClass(g), u.removeClass(p), u.css("z-index", "auto"), l.css("height", h.height + "px");
};
var f = function(u) {
if (!u.textSelector && u.config.showFullScreen) {
var l = u.$toolbarElem, m = v.default(``);
m.on("click", function(c) {
var h, A = (0, r.default)(h = v.default(c.currentTarget)).call(h, "i");
A.hasClass(g) ? (m.attr("data-title", "取消全屏"), n.setFullScreen(u)) : (m.attr("data-title", "全屏"), n.setUnFullScreen(u));
}), l.append(m);
}
};
n.default = f;
},
/* 421 */
/***/
function(s, n, t) {
var e2 = t(20), a = t(422);
a = a.__esModule ? a.default : a, typeof a == "string" && (a = [[s.i, a, ""]]);
var r = {};
r.insert = "head", r.singleton = false, e2(a, r), s.exports = a.locals || {};
},
/* 422 */
/***/
function(s, n, t) {
var e2 = t(21);
n = e2(false), n.push([s.i, `.w-e-full-screen-editor {
position: fixed;
width: 100%!important;
height: 100%!important;
left: 0;
top: 0;
}
`, ""]), s.exports = n;
},
/* 423 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(29));
(0, a.default)(n, "__esModule", {
value: true
});
var o = function(g, d) {
var p, f = g.isEnable ? g.$textElem : (0, r.default)(p = g.$textContainerElem).call(p, ".w-e-content-mantle"), i = (0, r.default)(f).call(f, "[id='" + d + "']"), u = i.getOffsetData().top;
f.scrollTop(u);
};
n.default = o;
},
/* 424 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(129)), v = {
menu: 2,
panel: 2,
toolbar: 1,
tooltip: 1,
textContainer: 1
}, g = (
/** @class */
function() {
function d() {
this.tier = v, this.baseZIndex = o.default.zIndex;
}
return d.prototype.get = function(p) {
return p && this.tier[p] ? this.baseZIndex + this.tier[p] : this.baseZIndex;
}, d.prototype.init = function(p) {
this.baseZIndex == o.default.zIndex && (this.baseZIndex = p.config.zIndex);
}, d;
}()
);
n.default = g;
},
/* 425 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(70)), o = e2(t(4));
(0, a.default)(n, "__esModule", {
value: true
});
var v = t(2), g = v.__importDefault(t(426)), d = t(6), p = t(7);
function f(u, l) {
return (0, r.default)(u).call(u, function(m) {
var c = m.type, h = m.target, A = m.attributeName;
return c != "attributes" || c == "attributes" && (A == "contenteditable" || h != l);
});
}
var i = (
/** @class */
function(u) {
v.__extends(l, u);
function l(m) {
var c = u.call(this, function(h, A) {
var y;
if (h = f(h, A.target), (y = c.data).push.apply(y, h), m.isCompatibleMode)
c.asyncSave();
else if (!m.isComposing)
return c.asyncSave();
}) || this;
return c.editor = m, c.data = [], c.asyncSave = p.EMPTY_FN, c;
}
return l.prototype.save = function() {
this.data.length && (this.editor.history.save(this.data), this.data.length = 0, this.emit());
}, l.prototype.emit = function() {
var m;
(0, o.default)(m = this.editor.txt.eventHooks.changeEvents).call(m, function(c) {
return c();
});
}, l.prototype.observe = function() {
var m = this;
u.prototype.observe.call(this, this.editor.$textElem.elems[0]);
var c = this.editor.config.onchangeTimeout;
this.asyncSave = d.debounce(function() {
m.save();
}, c), this.editor.isCompatibleMode || this.editor.$textElem.on("compositionend", function() {
m.asyncSave();
});
}, l;
}(g.default)
);
n.default = i;
},
/* 426 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = (
/** @class */
function() {
function o(v, g) {
var d = this;
this.options = {
subtree: true,
childList: true,
attributes: true,
attributeOldValue: true,
characterData: true,
characterDataOldValue: true
}, this.callback = function(p) {
v(p, d);
}, this.observer = new MutationObserver(this.callback), g && (this.options = g);
}
return (0, a.default)(o.prototype, "target", {
get: function() {
return this.node;
},
enumerable: false,
configurable: true
}), o.prototype.observe = function(v) {
this.node instanceof Node || (this.node = v, this.connect());
}, o.prototype.connect = function() {
if (this.node)
return this.observer.observe(this.node, this.options), this;
throw new Error("还未初始化绑定,请您先绑定有效的 Node 节点");
}, o.prototype.disconnect = function() {
var v = this.observer.takeRecords();
v.length && this.callback(v), this.observer.disconnect();
}, o;
}()
);
n.default = r;
},
/* 427 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(428)), v = r.__importDefault(t(435)), g = r.__importDefault(t(436)), d = (
/** @class */
function() {
function p(f) {
this.editor = f, this.content = new o.default(f), this.scroll = new v.default(f), this.range = new g.default(f);
}
return (0, a.default)(p.prototype, "size", {
/**
* 获取缓存中的数据长度。格式为:[正常的数据的条数,被撤销的数据的条数]
*/
get: function() {
return this.scroll.size;
},
enumerable: false,
configurable: true
}), p.prototype.observe = function() {
this.content.observe(), this.scroll.observe(), !this.editor.isCompatibleMode && this.range.observe();
}, p.prototype.save = function(f) {
f.length && (this.content.save(f), this.scroll.save(), !this.editor.isCompatibleMode && this.range.save());
}, p.prototype.revoke = function() {
this.editor.change.disconnect();
var f = this.content.revoke();
f && (this.scroll.revoke(), this.editor.isCompatibleMode || (this.range.revoke(), this.editor.$textElem.focus())), this.editor.change.connect(), f && this.editor.change.emit();
}, p.prototype.restore = function() {
this.editor.change.disconnect();
var f = this.content.restore();
f && (this.scroll.restore(), this.editor.isCompatibleMode || (this.range.restore(), this.editor.$textElem.focus())), this.editor.change.connect(), f && this.editor.change.emit();
}, p;
}()
);
n.default = d;
},
/* 428 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(429)), v = r.__importDefault(t(433)), g = (
/** @class */
function() {
function d(p) {
this.editor = p;
}
return d.prototype.observe = function() {
this.editor.isCompatibleMode ? this.cache = new v.default(this.editor) : this.cache = new o.default(this.editor), this.cache.observe();
}, d.prototype.save = function(p) {
this.editor.isCompatibleMode ? this.cache.save() : this.cache.compile(p);
}, d.prototype.revoke = function() {
var p;
return (p = this.cache) === null || p === void 0 ? void 0 : p.revoke();
}, d.prototype.restore = function() {
var p;
return (p = this.cache) === null || p === void 0 ? void 0 : p.restore();
}, d;
}()
);
n.default = g;
},
/* 429 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(99)), v = r.__importDefault(t(431)), g = t(432), d = (
/** @class */
function(p) {
r.__extends(f, p);
function f(i) {
var u = p.call(this, i.config.historyMaxSize) || this;
return u.editor = i, u;
}
return f.prototype.observe = function() {
this.resetMaxSize(this.editor.config.historyMaxSize);
}, f.prototype.compile = function(i) {
return this.save(v.default(i)), this;
}, f.prototype.revoke = function() {
return p.prototype.revoke.call(this, function(i) {
g.revoke(i);
});
}, f.prototype.restore = function() {
return p.prototype.restore.call(this, function(i) {
g.restore(i);
});
}, f;
}(o.default)
);
n.default = d;
},
/* 430 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
}), n.CeilStack = void 0;
var r = (
/** @class */
function() {
function o(v) {
v === void 0 && (v = 0), this.data = [], this.max = 0, this.reset = false, v = Math.abs(v), v && (this.max = v);
}
return o.prototype.resetMax = function(v) {
v = Math.abs(v), !this.reset && !isNaN(v) && (this.max = v, this.reset = true);
}, (0, a.default)(o.prototype, "size", {
/**
* 当前栈中的数据条数
*/
get: function() {
return this.data.length;
},
enumerable: false,
configurable: true
}), o.prototype.instack = function(v) {
return this.data.unshift(v), this.max && this.size > this.max && (this.data.length = this.max), this;
}, o.prototype.outstack = function() {
return this.data.shift();
}, o.prototype.clear = function() {
return this.data.length = 0, this;
}, o;
}()
);
n.CeilStack = r;
},
/* 431 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(4)), o = e2(t(27));
(0, a.default)(n, "__esModule", {
value: true
}), n.compliePosition = n.complieNodes = n.compileValue = n.compileType = void 0;
var v = t(6);
function g(m) {
switch (m) {
case "childList":
return "node";
case "attributes":
return "attr";
default:
return "text";
}
}
n.compileType = g;
function d(m) {
switch (m.type) {
case "attributes":
return m.target.getAttribute(m.attributeName) || "";
case "characterData":
return m.target.textContent;
default:
return "";
}
}
n.compileValue = d;
function p(m) {
var c = {};
return m.addedNodes.length && (c.add = v.toArray(m.addedNodes)), m.removedNodes.length && (c.remove = v.toArray(m.removedNodes)), c;
}
n.complieNodes = p;
function f(m) {
var c;
return m.previousSibling ? c = {
type: "before",
target: m.previousSibling
} : m.nextSibling ? c = {
type: "after",
target: m.nextSibling
} : c = {
type: "parent",
target: m.target
}, c;
}
n.compliePosition = f;
var i = ["UL", "OL", "H1", "H2", "H3", "H4", "H5", "H6"];
function u(m) {
var c = [], h = false, A = [];
return (0, r.default)(m).call(m, function(y, x) {
var S = {
type: g(y.type),
target: y.target,
attr: y.attributeName || "",
value: d(y) || "",
oldValue: y.oldValue || "",
nodes: p(y),
position: f(y)
};
if (c.push(S), !!v.UA.isFirefox) {
if (h && y.addedNodes.length && y.addedNodes[0].nodeType == 1) {
var T = y.addedNodes[0], I = {
type: "node",
target: T,
attr: "",
value: "",
oldValue: "",
nodes: {
add: [h]
},
position: {
type: "parent",
target: T
}
};
(0, o.default)(i).call(i, T.nodeName) != -1 ? (I.nodes.add = v.toArray(T.childNodes), c.push(I)) : h.nodeType == 3 ? (l(T, A) && (I.nodes.add = v.toArray(T.childNodes)), c.push(I)) : (0, o.default)(i).call(i, y.target.nodeName) == -1 && l(T, A) && (I.nodes.add = v.toArray(T.childNodes), c.push(I));
}
S.type == "node" && y.removedNodes.length == 1 ? (h = y.removedNodes[0], A.push(h)) : (h = false, A.length = 0);
}
}), c;
}
n.default = u;
function l(m, c) {
for (var h = 0, A = c.length - 1; A > 0 && m.contains(c[A]); A--)
h++;
return h;
}
},
/* 432 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(4)), o = e2(t(94));
(0, a.default)(n, "__esModule", {
value: true
}), n.restore = n.revoke = void 0;
function v(A, y) {
var x = A.position.target;
switch (A.position.type) {
case "before":
x.nextSibling ? (x = x.nextSibling, (0, r.default)(y).call(y, function(S) {
A.target.insertBefore(S, x);
})) : (0, r.default)(y).call(y, function(S) {
A.target.appendChild(S);
});
break;
case "after":
(0, r.default)(y).call(y, function(S) {
A.target.insertBefore(S, x);
});
break;
default:
(0, r.default)(y).call(y, function(S) {
x.appendChild(S);
});
break;
}
}
function g(A) {
for (var y = 0, x = (0, o.default)(A.nodes); y < x.length; y++) {
var S = x[y], T = S[0], I = S[1];
switch (T) {
case "add":
(0, r.default)(I).call(I, function(C) {
A.target.removeChild(C);
});
break;
default: {
v(A, I);
break;
}
}
}
}
function d(A) {
var y = A.target;
A.oldValue == null ? y.removeAttribute(A.attr) : y.setAttribute(A.attr, A.oldValue);
}
function p(A) {
A.target.textContent = A.oldValue;
}
var f = {
node: g,
text: p,
attr: d
};
function i(A) {
for (var y = A.length - 1; y > -1; y--) {
var x = A[y];
f[x.type](x);
}
}
n.revoke = i;
function u(A) {
for (var y = 0, x = (0, o.default)(A.nodes); y < x.length; y++) {
var S = x[y], T = S[0], I = S[1];
switch (T) {
case "add": {
v(A, I);
break;
}
default: {
(0, r.default)(I).call(I, function(C) {
C.parentNode.removeChild(C);
});
break;
}
}
}
}
function l(A) {
A.target.textContent = A.value;
}
function m(A) {
A.target.setAttribute(A.attr, A.value);
}
var c = {
node: u,
text: l,
attr: m
};
function h(A) {
for (var y = 0, x = A; y < x.length; y++) {
var S = x[y];
c[S.type](S);
}
}
n.restore = h;
},
/* 433 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(434), o = (
/** @class */
function() {
function v(g) {
this.editor = g, this.data = new r.TailChain();
}
return v.prototype.observe = function() {
this.data.resetMax(this.editor.config.historyMaxSize), this.data.insertLast(this.editor.$textElem.html());
}, v.prototype.save = function() {
return this.data.insertLast(this.editor.$textElem.html()), this;
}, v.prototype.revoke = function() {
var g = this.data.prev();
return g ? (this.editor.$textElem.html(g), true) : false;
}, v.prototype.restore = function() {
var g = this.data.next();
return g ? (this.editor.$textElem.html(g), true) : false;
}, v;
}()
);
n.default = o;
},
/* 434 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(91));
(0, a.default)(n, "__esModule", {
value: true
}), n.TailChain = void 0;
var o = (
/** @class */
function() {
function v() {
this.data = [], this.max = 0, this.point = 0, this.isRe = false;
}
return v.prototype.resetMax = function(g) {
g = Math.abs(g), g && (this.max = g);
}, (0, a.default)(v.prototype, "size", {
/**
* 当前链表的长度
*/
get: function() {
return this.data.length;
},
enumerable: false,
configurable: true
}), v.prototype.insertLast = function(g) {
if (this.isRe) {
var d;
(0, r.default)(d = this.data).call(d, this.point + 1), this.isRe = false;
}
for (this.data.push(g); this.max && this.size > this.max; )
this.data.shift();
return this.point = this.size - 1, this;
}, v.prototype.current = function() {
return this.data[this.point];
}, v.prototype.prev = function() {
if (!this.isRe && (this.isRe = true), this.point--, this.point < 0) {
this.point = 0;
return;
}
return this.current();
}, v.prototype.next = function() {
if (!this.isRe && (this.isRe = true), this.point++, this.point >= this.size) {
this.point = this.size - 1;
return;
}
return this.current();
}, v;
}()
);
n.TailChain = o;
},
/* 435 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(99)), v = (
/** @class */
function(g) {
r.__extends(d, g);
function d(p) {
var f = g.call(this, p.config.historyMaxSize) || this;
return f.editor = p, f.last = 0, f.target = p.$textElem.elems[0], f;
}
return d.prototype.observe = function() {
var p = this;
this.target = this.editor.$textElem.elems[0], this.editor.$textElem.on("scroll", function() {
p.last = p.target.scrollTop;
}), this.resetMaxSize(this.editor.config.historyMaxSize);
}, d.prototype.save = function() {
return g.prototype.save.call(this, [this.last, this.target.scrollTop]), this;
}, d.prototype.revoke = function() {
var p = this;
return g.prototype.revoke.call(this, function(f) {
p.target.scrollTop = f[0];
});
}, d.prototype.restore = function() {
var p = this;
return g.prototype.restore.call(this, function(f) {
p.target.scrollTop = f[1];
});
}, d;
}(o.default)
);
n.default = v;
},
/* 436 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = t(2), o = r.__importDefault(t(99)), v = r.__importDefault(t(3)), g = t(6);
function d(f) {
return {
start: [f.startContainer, f.startOffset],
end: [f.endContainer, f.endOffset],
root: f.commonAncestorContainer,
collapsed: f.collapsed
};
}
var p = (
/** @class */
function(f) {
r.__extends(i, f);
function i(u) {
var l = f.call(this, u.config.historyMaxSize) || this;
return l.editor = u, l.lastRange = d(document.createRange()), l.root = u.$textElem.elems[0], l.updateLastRange = g.debounce(function() {
l.lastRange = d(l.rangeHandle);
}, u.config.onchangeTimeout), l;
}
return (0, a.default)(i.prototype, "rangeHandle", {
/**
* 获取 Range 对象
*/
get: function() {
var l = document.getSelection();
return l && l.rangeCount ? l.getRangeAt(0) : document.createRange();
},
enumerable: false,
configurable: true
}), i.prototype.observe = function() {
var u = this;
this.root = this.editor.$textElem.elems[0], this.resetMaxSize(this.editor.config.historyMaxSize);
function l() {
var c = u.rangeHandle;
(u.root === c.commonAncestorContainer || u.root.contains(c.commonAncestorContainer)) && (u.editor.isComposing || u.updateLastRange());
}
function m(c) {
(c.key == "Backspace" || c.key == "Delete") && u.updateLastRange();
}
v.default(document).on("selectionchange", l), this.editor.beforeDestroy(function() {
v.default(document).off("selectionchange", l);
}), u.editor.$textElem.on("keydown", m);
}, i.prototype.save = function() {
var u = d(this.rangeHandle);
return f.prototype.save.call(this, [this.lastRange, u]), this.lastRange = u, this;
}, i.prototype.set = function(u) {
try {
if (u) {
var l = this.rangeHandle;
return l.setStart.apply(l, u.start), l.setEnd.apply(l, u.end), this.editor.menus.changeActive(), true;
}
} catch {
return false;
}
return false;
}, i.prototype.revoke = function() {
var u = this;
return f.prototype.revoke.call(this, function(l) {
u.set(l[0]);
});
}, i.prototype.restore = function() {
var u = this;
return f.prototype.restore.call(this, function(l) {
u.set(l[1]);
});
}, i;
}(o.default)
);
n.default = p;
},
/* 437 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(29));
(0, a.default)(n, "__esModule", {
value: true
});
var o = t(2), v = o.__importDefault(t(3));
t(438);
function g(d) {
var p = false, f, i;
d.txt.eventHooks.changeEvents.push(function() {
p && (0, r.default)(f).call(f, ".w-e-content-preview").html(d.$textElem.html());
});
function u() {
if (!p) {
d.$textElem.hide();
var m = d.zIndex.get("textContainer"), c = d.txt.html();
f = v.default('
` + c + `
`), d.$textContainerElem.append(f);
var h = d.zIndex.get("menu");
i = v.default(''), d.$toolbarElem.append(i), p = true, d.isEnable = false;
}
}
function l() {
p && (f.remove(), i.remove(), d.$textElem.show(), p = false, d.isEnable = true);
}
return {
disable: u,
enable: l
};
}
n.default = g;
},
/* 438 */
/***/
function(s, n, t) {
var e2 = t(20), a = t(439);
a = a.__esModule ? a.default : a, typeof a == "string" && (a = [[s.i, a, ""]]);
var r = {};
r.insert = "head", r.singleton = false, e2(a, r), s.exports = a.locals || {};
},
/* 439 */
/***/
function(s, n, t) {
var e2 = t(21);
n = e2(false), n.push([s.i, `.w-e-content-mantle {
width: 100%;
height: 100%;
overflow-y: auto;
}
.w-e-content-mantle .w-e-content-preview {
width: 100%;
min-height: 100%;
padding: 0 10px;
line-height: 1.5;
}
.w-e-content-mantle .w-e-content-preview img {
cursor: default;
}
.w-e-content-mantle .w-e-content-preview img:hover {
box-shadow: none;
}
.w-e-menue-mantle {
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
}
`, ""]), s.exports = n;
},
/* 440 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
var r = (
/** @class */
function() {
function o(v) {
var g = this;
this.editor = v;
var d = function() {
var f = document.activeElement;
f === v.$textElem.elems[0] && g.emit();
};
window.document.addEventListener("selectionchange", d), this.editor.beforeDestroy(function() {
window.document.removeEventListener("selectionchange", d);
});
}
return o.prototype.emit = function() {
var v, g = this.editor.config.onSelectionChange;
if (g) {
var d = this.editor.selection;
d.saveRange(), d.isSelectionEmpty() || g({
// 当前文本
text: d.getSelectionText(),
// 当前的html
html: (v = d.getSelectionContainerElem()) === null || v === void 0 ? void 0 : v.elems[0].innerHTML,
// select对象
selection: d
});
}
}, o;
}()
);
n.default = r;
},
/* 441 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1)), r = e2(t(128)), o = e2(t(94)), v = e2(t(4));
(0, a.default)(n, "__esModule", {
value: true
}), n.registerPlugin = void 0;
var g = t(2), d = g.__importDefault(t(87)), p = t(6);
function f(u, l, m) {
if (!u)
throw new TypeError("name is not define");
if (!l)
throw new TypeError("options is not define");
if (!l.intention)
throw new TypeError("options.intention is not define");
if (l.intention && typeof l.intention != "function")
throw new TypeError("options.intention is not function");
m[u], m[u] = l;
}
n.registerPlugin = f;
function i(u) {
var l = (0, r.default)({}, p.deepClone(d.default.globalPluginsFunctionList), p.deepClone(u.pluginsFunctionList)), m = (0, o.default)(l);
(0, v.default)(m).call(m, function(c) {
c[0];
var h = c[1], A = h.intention, y = h.config;
A(u, y);
});
}
n.default = i;
},
/* 442 */
/***/
function(s, n, t) {
var e2 = t(0), a = e2(t(1));
(0, a.default)(n, "__esModule", {
value: true
});
}
/******/
]).default
);
});
})(Nt);
var zt = Nt.exports;
var Vt = e(zt);
var Gt = {
menus: [
"head",
"bold",
"fontSize",
"fontName",
"italic",
"underline",
"strikeThrough",
"indent",
"lineHeight",
"foreColor",
"backColor",
"link",
"list",
"todo",
"justify",
"quote",
"emoticon",
"image",
"video",
"table",
"code",
"splitLine",
"undo",
"redo"
],
// 不显示的菜单
excludeMenus: [],
// 隐藏菜单栏提示
showMenuTooltips: false,
// 颜色
colors: ["#000000", "#eeece0", "#1c487f", "#4d80bf"],
// 配置字体
fontNames: [
"黑体",
"仿宋",
"楷体",
"标楷体",
"华文仿宋",
"华文楷体",
"宋体",
"微软雅黑",
"Arial",
"Tahoma",
"Verdana",
"Times New Roman",
"Courier New"
],
// 字号
fontSizes: {
"x-small": { name: "10px", value: "1" },
small: { name: "13px", value: "2" },
normal: { name: "16px", value: "3" },
large: { name: "18px", value: "4" },
"x-large": { name: "24px", value: "5" },
"xx-large": { name: "32px", value: "6" },
"xxx-large": { name: "48px", value: "7" }
},
// 行高
lineHeights: ["1", "1.15", "1.6", "2", "2.5", "3"],
// 粘贴过滤
pasteFilterStyle: true,
// 忽略粘贴内容中的图片
pasteIgnoreImg: true,
// 是否带cookie
withCredentials: true,
// 上传图片接口 如果不配置这个设置,那么就不会开启远程上传功能
// uploadImgServer = '',
// 上传图片字段名
uploadFileName: "file",
// 最多可以上传2M的图
uploadImgMaxSize: 2 * 1024 * 1024,
// 图片类型
uploadImgAccept: ["jpg", "jpeg", "png", "gif", "bmp"],
// 一次最多上传 1 个图片
uploadImgMaxLength: 5,
// 超时时间
uploadImgTimeout: 5 * 1e3
};
var Kt = defineComponent({
name: "FsEditorWang",
props: {
modelValue: {
type: String,
required: false,
default: ""
},
config: {
type: Object
},
/**
* 同一个页面多个edit时,需要配置不同的id
*/
id: {
default: "1"
},
/**
* uploader参数,配置则开启上传
*/
uploader: {
type: Object
},
disabled: {
type: Boolean
}
},
emits: ["update:modelValue", "change", "ready"],
data() {
return {
editor: null,
currentValue: "",
options: {}
};
},
computed: {
uniqueId() {
return "fs-wang-editor-" + this.id;
}
},
watch: {
modelValue: {
handler(et) {
et !== this.currentValue && (this.currentValue = et, this.editor && this.editor.txt.html(et));
},
immediate: true
},
disabled: {
handler(et) {
this.setDisabled(et);
},
immediate: true
}
},
mounted() {
this.init();
},
beforeUnmount() {
this.editor.destroy(), this.editor = null;
},
methods: {
init() {
let et = null;
try {
et = new Vt("#" + this.uniqueId);
} catch (ot) {
console.error(ot);
return;
}
if (merge_default(et.config, Gt, je.wangEditor, this.config), et.config.onchange = (ot) => {
this.$emit("update:modelValue", ot), this.$emit("change", ot), this.currentValue = ot;
}, this.uploader) {
const ot = async (s, n) => {
var g;
const t = {
status: "uploading",
progress: 0
}, e2 = (d) => {
t.progress = d.percent;
}, a = (d) => {
t.status = "error", t.message = "文件上传出错:" + d.message, console.error(t.message, d);
}, r = {
file: s,
fileName: s.name,
onProgress: e2,
onError: a
}, o = await this.doUpload(r);
let v = o == null ? void 0 : o.url;
(g = this.uploader) != null && g.buildUrl && (v = await this.uploader.buildUrl(o)), n(v);
};
et.config.customUploadImg = async (s, n) => {
forEach_default(s, (t) => {
ot(t, n);
});
};
}
et.create(), et.txt.html(this.currentValue), this.editor = et, this.setDisabled(this.disabled), this.$emit("ready", { editor: et });
},
async doUpload(et) {
et.options = this.uploader;
const { getUploaderImpl: ot } = gt();
let s = await ot(et.options.type);
if (s == null)
throw new Error("Sorry,The component is not ready yet");
return await (s == null ? void 0 : s.upload(et));
},
setDisabled(et = false) {
this.editor && (et === true ? this.editor.disable() : this.editor.enable());
}
}
});
var Jt = { class: "fs-editor-wang" };
var Wt = ["id"];
function Xt(et, ot, s, n, t, e2) {
return openBlock(), createElementBlock("div", Jt, [
createBaseVNode("div", { id: et.uniqueId }, null, 8, Wt),
withDirectives(createBaseVNode("textarea", {
"onUpdate:modelValue": ot[0] || (ot[0] = (a) => et.currentValue = a),
class: "fs-editor-wang-preview",
readonly: ""
}, null, 512), [
[vModelText, et.currentValue]
])
]);
}
var ee = ge(Kt, [["render", Xt]]);
export {
ee as default
};
/*! Bundled license information:
@fast-crud/fast-extends/dist/index-61efc2d4.mjs:
(*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** *)
*/
//# sourceMappingURL=index-61efc2d4-ZYYKKOL6.js.map