@qwanyx/stack 0.2.18 → 0.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/MailClient.d.ts +4 -2
- package/dist/index.cjs.js +18 -18
- package/dist/index.esm.js +634 -632
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ var Rl = Object.defineProperty;
|
|
|
2
2
|
var jl = (r, e, t) => e in r ? Rl(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var or = (r, e, t) => jl(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import * as ss from "react";
|
|
5
|
-
import Ks, { useState as Q, useCallback as Z, useEffect as
|
|
5
|
+
import Ks, { useState as Q, useCallback as Z, useEffect as ge, useMemo as Pt, useRef as bs, createContext as Il, useContext as Ml, useLayoutEffect as er, Suspense as $l, forwardRef as Qo } from "react";
|
|
6
6
|
import { flushSync as ql, createPortal as zl } from "react-dom";
|
|
7
7
|
class cf {
|
|
8
8
|
constructor(e) {
|
|
@@ -3559,29 +3559,31 @@ class la {
|
|
|
3559
3559
|
/**
|
|
3560
3560
|
* Move emails to trash (soft delete)
|
|
3561
3561
|
* Tries multiple folder names for Gmail locales
|
|
3562
|
+
* @param sourceFolder - The folder where the emails currently are (default: INBOX)
|
|
3562
3563
|
*/
|
|
3563
|
-
async trashEmails(e, t) {
|
|
3564
|
-
const
|
|
3565
|
-
for (const
|
|
3566
|
-
const
|
|
3567
|
-
|
|
3568
|
-
...t.map((
|
|
3569
|
-
],
|
|
3570
|
-
if (
|
|
3571
|
-
return { success: !0, moved:
|
|
3564
|
+
async trashEmails(e, t, n = "INBOX") {
|
|
3565
|
+
const s = ["[Gmail]/Trash", "[Gmail]/Corbeille", "[Gmail]/Bin", "Trash"];
|
|
3566
|
+
for (const o of s) {
|
|
3567
|
+
const i = [
|
|
3568
|
+
`SELECT "${n}"`,
|
|
3569
|
+
...t.map((a) => `UID MOVE ${a} "${o}"`)
|
|
3570
|
+
], l = (await this.imapExec(e, i)).responses.filter((a) => a.ok && a.command === "UID MOVE").length;
|
|
3571
|
+
if (l > 0)
|
|
3572
|
+
return { success: !0, moved: l };
|
|
3572
3573
|
}
|
|
3573
3574
|
return { success: !1, moved: 0 };
|
|
3574
3575
|
}
|
|
3575
3576
|
/**
|
|
3576
3577
|
* Archive emails (remove from inbox, keep in All Mail)
|
|
3578
|
+
* @param sourceFolder - The folder where the emails currently are (default: INBOX)
|
|
3577
3579
|
*/
|
|
3578
|
-
async archiveEmails(e, t) {
|
|
3579
|
-
const
|
|
3580
|
-
|
|
3581
|
-
...t.map((
|
|
3580
|
+
async archiveEmails(e, t, n = "INBOX") {
|
|
3581
|
+
const s = [
|
|
3582
|
+
`SELECT "${n}"`,
|
|
3583
|
+
...t.map((u) => `UID STORE ${u} +FLAGS (\\Deleted)`),
|
|
3582
3584
|
"EXPUNGE"
|
|
3583
|
-
],
|
|
3584
|
-
return { success:
|
|
3585
|
+
], i = (await this.imapExec(e, s)).responses.filter((u) => u.ok && u.command === "UID STORE").length;
|
|
3586
|
+
return { success: i > 0, archived: i };
|
|
3585
3587
|
}
|
|
3586
3588
|
/**
|
|
3587
3589
|
* List available folders
|
|
@@ -3917,7 +3919,7 @@ function da(r, e, t = {}) {
|
|
|
3917
3919
|
}
|
|
3918
3920
|
}
|
|
3919
3921
|
}, [r, JSON.stringify(e), n, o, i]);
|
|
3920
|
-
return
|
|
3922
|
+
return ge(() => {
|
|
3921
3923
|
s && h();
|
|
3922
3924
|
}, [h, s]), {
|
|
3923
3925
|
data: u,
|
|
@@ -4095,18 +4097,18 @@ function ha() {
|
|
|
4095
4097
|
}
|
|
4096
4098
|
return null;
|
|
4097
4099
|
}
|
|
4098
|
-
var I = Object.assign, W = 0, ne,
|
|
4099
|
-
function
|
|
4100
|
+
var I = Object.assign, W = 0, ne, Se, Me, vt, ut, ae, $e;
|
|
4101
|
+
function qe() {
|
|
4100
4102
|
}
|
|
4101
|
-
|
|
4103
|
+
qe.__reactDisabledLog = !0;
|
|
4102
4104
|
function lt() {
|
|
4103
4105
|
{
|
|
4104
4106
|
if (W === 0) {
|
|
4105
|
-
ne = console.log,
|
|
4107
|
+
ne = console.log, Se = console.info, Me = console.warn, vt = console.error, ut = console.group, ae = console.groupCollapsed, $e = console.groupEnd;
|
|
4106
4108
|
var m = {
|
|
4107
4109
|
configurable: !0,
|
|
4108
4110
|
enumerable: !0,
|
|
4109
|
-
value:
|
|
4111
|
+
value: qe,
|
|
4110
4112
|
writable: !0
|
|
4111
4113
|
};
|
|
4112
4114
|
Object.defineProperties(console, {
|
|
@@ -4135,10 +4137,10 @@ function ha() {
|
|
|
4135
4137
|
value: ne
|
|
4136
4138
|
}),
|
|
4137
4139
|
info: I({}, m, {
|
|
4138
|
-
value:
|
|
4140
|
+
value: Se
|
|
4139
4141
|
}),
|
|
4140
4142
|
warn: I({}, m, {
|
|
4141
|
-
value:
|
|
4143
|
+
value: Me
|
|
4142
4144
|
}),
|
|
4143
4145
|
error: I({}, m, {
|
|
4144
4146
|
value: vt
|
|
@@ -4147,49 +4149,49 @@ function ha() {
|
|
|
4147
4149
|
value: ut
|
|
4148
4150
|
}),
|
|
4149
4151
|
groupCollapsed: I({}, m, {
|
|
4150
|
-
value:
|
|
4152
|
+
value: ae
|
|
4151
4153
|
}),
|
|
4152
4154
|
groupEnd: I({}, m, {
|
|
4153
|
-
value:
|
|
4155
|
+
value: $e
|
|
4154
4156
|
})
|
|
4155
4157
|
});
|
|
4156
4158
|
}
|
|
4157
4159
|
W < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
4158
4160
|
}
|
|
4159
4161
|
}
|
|
4160
|
-
var
|
|
4161
|
-
function
|
|
4162
|
+
var ve = D.ReactCurrentDispatcher, Ze;
|
|
4163
|
+
function Te(m, T, R) {
|
|
4162
4164
|
{
|
|
4163
|
-
if (
|
|
4165
|
+
if (Ze === void 0)
|
|
4164
4166
|
try {
|
|
4165
4167
|
throw Error();
|
|
4166
4168
|
} catch (J) {
|
|
4167
4169
|
var q = J.stack.trim().match(/\n( *(at )?)/);
|
|
4168
|
-
|
|
4170
|
+
Ze = q && q[1] || "";
|
|
4169
4171
|
}
|
|
4170
4172
|
return `
|
|
4171
|
-
` +
|
|
4173
|
+
` + Ze + m;
|
|
4172
4174
|
}
|
|
4173
4175
|
}
|
|
4174
|
-
var
|
|
4176
|
+
var ze = !1, et;
|
|
4175
4177
|
{
|
|
4176
4178
|
var Gn = typeof WeakMap == "function" ? WeakMap : Map;
|
|
4177
|
-
|
|
4179
|
+
et = new Gn();
|
|
4178
4180
|
}
|
|
4179
4181
|
function Hr(m, T) {
|
|
4180
|
-
if (!m ||
|
|
4182
|
+
if (!m || ze)
|
|
4181
4183
|
return "";
|
|
4182
4184
|
{
|
|
4183
|
-
var R =
|
|
4185
|
+
var R = et.get(m);
|
|
4184
4186
|
if (R !== void 0)
|
|
4185
4187
|
return R;
|
|
4186
4188
|
}
|
|
4187
4189
|
var q;
|
|
4188
|
-
|
|
4190
|
+
ze = !0;
|
|
4189
4191
|
var J = Error.prepareStackTrace;
|
|
4190
4192
|
Error.prepareStackTrace = void 0;
|
|
4191
4193
|
var X;
|
|
4192
|
-
X =
|
|
4194
|
+
X = ve.current, ve.current = null, lt();
|
|
4193
4195
|
try {
|
|
4194
4196
|
if (T) {
|
|
4195
4197
|
var K = function() {
|
|
@@ -4202,50 +4204,50 @@ function ha() {
|
|
|
4202
4204
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
4203
4205
|
try {
|
|
4204
4206
|
Reflect.construct(K, []);
|
|
4205
|
-
} catch (
|
|
4206
|
-
q =
|
|
4207
|
+
} catch (be) {
|
|
4208
|
+
q = be;
|
|
4207
4209
|
}
|
|
4208
4210
|
Reflect.construct(m, [], K);
|
|
4209
4211
|
} else {
|
|
4210
4212
|
try {
|
|
4211
4213
|
K.call();
|
|
4212
|
-
} catch (
|
|
4213
|
-
q =
|
|
4214
|
+
} catch (be) {
|
|
4215
|
+
q = be;
|
|
4214
4216
|
}
|
|
4215
4217
|
m.call(K.prototype);
|
|
4216
4218
|
}
|
|
4217
4219
|
} else {
|
|
4218
4220
|
try {
|
|
4219
4221
|
throw Error();
|
|
4220
|
-
} catch (
|
|
4221
|
-
q =
|
|
4222
|
+
} catch (be) {
|
|
4223
|
+
q = be;
|
|
4222
4224
|
}
|
|
4223
4225
|
m();
|
|
4224
4226
|
}
|
|
4225
|
-
} catch (
|
|
4226
|
-
if (
|
|
4227
|
-
for (var V =
|
|
4228
|
-
`),
|
|
4229
|
-
`),
|
|
4230
|
-
|
|
4231
|
-
for (;
|
|
4232
|
-
if (V[
|
|
4233
|
-
if (
|
|
4227
|
+
} catch (be) {
|
|
4228
|
+
if (be && q && typeof be.stack == "string") {
|
|
4229
|
+
for (var V = be.stack.split(`
|
|
4230
|
+
`), me = q.stack.split(`
|
|
4231
|
+
`), ie = V.length - 1, oe = me.length - 1; ie >= 1 && oe >= 0 && V[ie] !== me[oe]; )
|
|
4232
|
+
oe--;
|
|
4233
|
+
for (; ie >= 1 && oe >= 0; ie--, oe--)
|
|
4234
|
+
if (V[ie] !== me[oe]) {
|
|
4235
|
+
if (ie !== 1 || oe !== 1)
|
|
4234
4236
|
do
|
|
4235
|
-
if (
|
|
4236
|
-
var
|
|
4237
|
-
` + V[
|
|
4238
|
-
return m.displayName &&
|
|
4237
|
+
if (ie--, oe--, oe < 0 || V[ie] !== me[oe]) {
|
|
4238
|
+
var Ne = `
|
|
4239
|
+
` + V[ie].replace(" at new ", " at ");
|
|
4240
|
+
return m.displayName && Ne.includes("<anonymous>") && (Ne = Ne.replace("<anonymous>", m.displayName)), typeof m == "function" && et.set(m, Ne), Ne;
|
|
4239
4241
|
}
|
|
4240
|
-
while (
|
|
4242
|
+
while (ie >= 1 && oe >= 0);
|
|
4241
4243
|
break;
|
|
4242
4244
|
}
|
|
4243
4245
|
}
|
|
4244
4246
|
} finally {
|
|
4245
|
-
|
|
4247
|
+
ze = !1, ve.current = X, at(), Error.prepareStackTrace = J;
|
|
4246
4248
|
}
|
|
4247
|
-
var qt = m ? m.displayName || m.name : "", Dt = qt ?
|
|
4248
|
-
return typeof m == "function" &&
|
|
4249
|
+
var qt = m ? m.displayName || m.name : "", Dt = qt ? Te(qt) : "";
|
|
4250
|
+
return typeof m == "function" && et.set(m, Dt), Dt;
|
|
4249
4251
|
}
|
|
4250
4252
|
function Jn(m, T, R) {
|
|
4251
4253
|
return Hr(m, !1);
|
|
@@ -4254,29 +4256,29 @@ function ha() {
|
|
|
4254
4256
|
var T = m.prototype;
|
|
4255
4257
|
return !!(T && T.isReactComponent);
|
|
4256
4258
|
}
|
|
4257
|
-
function
|
|
4259
|
+
function It(m, T, R) {
|
|
4258
4260
|
if (m == null)
|
|
4259
4261
|
return "";
|
|
4260
4262
|
if (typeof m == "function")
|
|
4261
4263
|
return Hr(m, Qn(m));
|
|
4262
4264
|
if (typeof m == "string")
|
|
4263
|
-
return
|
|
4265
|
+
return Te(m);
|
|
4264
4266
|
switch (m) {
|
|
4265
4267
|
case a:
|
|
4266
|
-
return
|
|
4268
|
+
return Te("Suspense");
|
|
4267
4269
|
case c:
|
|
4268
|
-
return
|
|
4270
|
+
return Te("SuspenseList");
|
|
4269
4271
|
}
|
|
4270
4272
|
if (typeof m == "object")
|
|
4271
4273
|
switch (m.$$typeof) {
|
|
4272
4274
|
case l:
|
|
4273
4275
|
return Jn(m.render);
|
|
4274
4276
|
case f:
|
|
4275
|
-
return
|
|
4277
|
+
return It(m.type, T, R);
|
|
4276
4278
|
case d: {
|
|
4277
4279
|
var q = m, J = q._payload, X = q._init;
|
|
4278
4280
|
try {
|
|
4279
|
-
return
|
|
4281
|
+
return It(X(J), T, R);
|
|
4280
4282
|
} catch {
|
|
4281
4283
|
}
|
|
4282
4284
|
}
|
|
@@ -4284,9 +4286,9 @@ function ha() {
|
|
|
4284
4286
|
return "";
|
|
4285
4287
|
}
|
|
4286
4288
|
var bt = Object.prototype.hasOwnProperty, Gr = {}, Jr = D.ReactDebugCurrentFrame;
|
|
4287
|
-
function
|
|
4289
|
+
function Mt(m) {
|
|
4288
4290
|
if (m) {
|
|
4289
|
-
var T = m._owner, R =
|
|
4291
|
+
var T = m._owner, R = It(m.type, m._source, T ? T.type : null);
|
|
4290
4292
|
Jr.setExtraStackFrame(R);
|
|
4291
4293
|
} else
|
|
4292
4294
|
Jr.setExtraStackFrame(null);
|
|
@@ -4299,19 +4301,19 @@ function ha() {
|
|
|
4299
4301
|
var V = void 0;
|
|
4300
4302
|
try {
|
|
4301
4303
|
if (typeof m[K] != "function") {
|
|
4302
|
-
var
|
|
4303
|
-
throw
|
|
4304
|
+
var me = Error((q || "React class") + ": " + R + " type `" + K + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof m[K] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
4305
|
+
throw me.name = "Invariant Violation", me;
|
|
4304
4306
|
}
|
|
4305
4307
|
V = m[K](T, K, q, R, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
4306
|
-
} catch (
|
|
4307
|
-
V =
|
|
4308
|
+
} catch (ie) {
|
|
4309
|
+
V = ie;
|
|
4308
4310
|
}
|
|
4309
|
-
V && !(V instanceof Error) && (
|
|
4311
|
+
V && !(V instanceof Error) && (Mt(J), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", q || "React class", R, K, typeof V), Mt(null)), V instanceof Error && !(V.message in Gr) && (Gr[V.message] = !0, Mt(J), y("Failed %s type: %s", R, V.message), Mt(null));
|
|
4310
4312
|
}
|
|
4311
4313
|
}
|
|
4312
4314
|
}
|
|
4313
4315
|
var Xn = Array.isArray;
|
|
4314
|
-
function
|
|
4316
|
+
function M(m) {
|
|
4315
4317
|
return Xn(m);
|
|
4316
4318
|
}
|
|
4317
4319
|
function z(m) {
|
|
@@ -4320,21 +4322,21 @@ function ha() {
|
|
|
4320
4322
|
return R;
|
|
4321
4323
|
}
|
|
4322
4324
|
}
|
|
4323
|
-
function
|
|
4325
|
+
function se(m) {
|
|
4324
4326
|
try {
|
|
4325
|
-
return
|
|
4327
|
+
return Be(m), !1;
|
|
4326
4328
|
} catch {
|
|
4327
4329
|
return !0;
|
|
4328
4330
|
}
|
|
4329
4331
|
}
|
|
4330
|
-
function
|
|
4332
|
+
function Be(m) {
|
|
4331
4333
|
return "" + m;
|
|
4332
4334
|
}
|
|
4333
|
-
function
|
|
4334
|
-
if (
|
|
4335
|
-
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", z(m)),
|
|
4335
|
+
function Ae(m) {
|
|
4336
|
+
if (se(m))
|
|
4337
|
+
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", z(m)), Be(m);
|
|
4336
4338
|
}
|
|
4337
|
-
var
|
|
4339
|
+
var Ue = D.ReactCurrentOwner, Zn = {
|
|
4338
4340
|
key: !0,
|
|
4339
4341
|
ref: !0,
|
|
4340
4342
|
__self: !0,
|
|
@@ -4357,7 +4359,7 @@ function ha() {
|
|
|
4357
4359
|
return m.key !== void 0;
|
|
4358
4360
|
}
|
|
4359
4361
|
function bl(m, T) {
|
|
4360
|
-
typeof m.ref == "string" &&
|
|
4362
|
+
typeof m.ref == "string" && Ue.current;
|
|
4361
4363
|
}
|
|
4362
4364
|
function Dl(m, T) {
|
|
4363
4365
|
{
|
|
@@ -4412,26 +4414,26 @@ function ha() {
|
|
|
4412
4414
|
};
|
|
4413
4415
|
function Al(m, T, R, q, J) {
|
|
4414
4416
|
{
|
|
4415
|
-
var X, K = {}, V = null,
|
|
4416
|
-
R !== void 0 && (
|
|
4417
|
+
var X, K = {}, V = null, me = null;
|
|
4418
|
+
R !== void 0 && (Ae(R), V = "" + R), vl(T) && (Ae(T.key), V = "" + T.key), xl(T) && (me = T.ref, bl(T, J));
|
|
4417
4419
|
for (X in T)
|
|
4418
4420
|
bt.call(T, X) && !Zn.hasOwnProperty(X) && (K[X] = T[X]);
|
|
4419
4421
|
if (m && m.defaultProps) {
|
|
4420
|
-
var
|
|
4421
|
-
for (X in
|
|
4422
|
-
K[X] === void 0 && (K[X] =
|
|
4422
|
+
var ie = m.defaultProps;
|
|
4423
|
+
for (X in ie)
|
|
4424
|
+
K[X] === void 0 && (K[X] = ie[X]);
|
|
4423
4425
|
}
|
|
4424
|
-
if (V ||
|
|
4425
|
-
var
|
|
4426
|
-
V && Dl(K,
|
|
4426
|
+
if (V || me) {
|
|
4427
|
+
var oe = typeof m == "function" ? m.displayName || m.name || "Unknown" : m;
|
|
4428
|
+
V && Dl(K, oe), me && wl(K, oe);
|
|
4427
4429
|
}
|
|
4428
|
-
return Cl(m, V,
|
|
4430
|
+
return Cl(m, V, me, J, q, Ue.current, K);
|
|
4429
4431
|
}
|
|
4430
4432
|
}
|
|
4431
4433
|
var es = D.ReactCurrentOwner, Di = D.ReactDebugCurrentFrame;
|
|
4432
4434
|
function $t(m) {
|
|
4433
4435
|
if (m) {
|
|
4434
|
-
var T = m._owner, R =
|
|
4436
|
+
var T = m._owner, R = It(m.type, m._source, T ? T.type : null);
|
|
4435
4437
|
Di.setExtraStackFrame(R);
|
|
4436
4438
|
} else
|
|
4437
4439
|
Di.setExtraStackFrame(null);
|
|
@@ -4486,7 +4488,7 @@ Check the top-level render call using <` + R + ">.");
|
|
|
4486
4488
|
{
|
|
4487
4489
|
if (typeof m != "object")
|
|
4488
4490
|
return;
|
|
4489
|
-
if (
|
|
4491
|
+
if (M(m))
|
|
4490
4492
|
for (var R = 0; R < m.length; R++) {
|
|
4491
4493
|
var q = m[R];
|
|
4492
4494
|
rs(q) && Ai(q, T);
|
|
@@ -4545,33 +4547,33 @@ Check the top-level render call using <` + R + ">.");
|
|
|
4545
4547
|
if (!K) {
|
|
4546
4548
|
var V = "";
|
|
4547
4549
|
(m === void 0 || typeof m == "object" && m !== null && Object.keys(m).length === 0) && (V += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
4548
|
-
var
|
|
4549
|
-
|
|
4550
|
-
var
|
|
4551
|
-
m === null ?
|
|
4550
|
+
var me = El();
|
|
4551
|
+
me ? V += me : V += wi();
|
|
4552
|
+
var ie;
|
|
4553
|
+
m === null ? ie = "null" : M(m) ? ie = "array" : m !== void 0 && m.$$typeof === e ? (ie = "<" + ($(m.type) || "Unknown") + " />", V = " Did you accidentally export a JSX literal instead of a component?") : ie = typeof m, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ie, V);
|
|
4552
4554
|
}
|
|
4553
|
-
var
|
|
4554
|
-
if (
|
|
4555
|
-
return
|
|
4555
|
+
var oe = Al(m, T, R, J, X);
|
|
4556
|
+
if (oe == null)
|
|
4557
|
+
return oe;
|
|
4556
4558
|
if (K) {
|
|
4557
|
-
var
|
|
4558
|
-
if (
|
|
4559
|
+
var Ne = T.children;
|
|
4560
|
+
if (Ne !== void 0)
|
|
4559
4561
|
if (q)
|
|
4560
|
-
if (
|
|
4561
|
-
for (var qt = 0; qt <
|
|
4562
|
-
Ei(
|
|
4563
|
-
Object.freeze && Object.freeze(
|
|
4562
|
+
if (M(Ne)) {
|
|
4563
|
+
for (var qt = 0; qt < Ne.length; qt++)
|
|
4564
|
+
Ei(Ne[qt], m);
|
|
4565
|
+
Object.freeze && Object.freeze(Ne);
|
|
4564
4566
|
} else
|
|
4565
4567
|
y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
4566
4568
|
else
|
|
4567
|
-
Ei(
|
|
4569
|
+
Ei(Ne, m);
|
|
4568
4570
|
}
|
|
4569
4571
|
if (bt.call(T, "key")) {
|
|
4570
|
-
var Dt = $(m),
|
|
4572
|
+
var Dt = $(m), be = Object.keys(T).filter(function(Ol) {
|
|
4571
4573
|
return Ol !== "key";
|
|
4572
|
-
}), ns =
|
|
4574
|
+
}), ns = be.length > 0 ? "{key: someKey, " + be.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
4573
4575
|
if (!ki[Dt + ns]) {
|
|
4574
|
-
var Pl =
|
|
4576
|
+
var Pl = be.length > 0 ? "{" + be.join(": ..., ") + ": ...}" : "{}";
|
|
4575
4577
|
y(`A props object containing a "key" prop is being spread into JSX:
|
|
4576
4578
|
let props = %s;
|
|
4577
4579
|
<%s {...props} />
|
|
@@ -4580,7 +4582,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4580
4582
|
<%s key={someKey} {...props} />`, ns, Dt, Pl, Dt), ki[Dt + ns] = !0;
|
|
4581
4583
|
}
|
|
4582
4584
|
}
|
|
4583
|
-
return m === n ? Tl(
|
|
4585
|
+
return m === n ? Tl(oe) : Sl(oe), oe;
|
|
4584
4586
|
}
|
|
4585
4587
|
}
|
|
4586
4588
|
function Bl(m, T, R) {
|
|
@@ -4702,7 +4704,7 @@ function hf({
|
|
|
4702
4704
|
let I = g;
|
|
4703
4705
|
return u && w && l.length > 0 && (I = as.search(I, w, l)), Object.keys(C).length > 0 && (I = as.filterByFields(I, C)), as.paginate(I, k, f);
|
|
4704
4706
|
}, [g, w, C, k, f, u, l]);
|
|
4705
|
-
|
|
4707
|
+
ge(() => {
|
|
4706
4708
|
A(1);
|
|
4707
4709
|
}, [w, C]);
|
|
4708
4710
|
const P = () => {
|
|
@@ -4994,7 +4996,7 @@ function mf({
|
|
|
4994
4996
|
const A = Math.floor(Math.random() * k.length);
|
|
4995
4997
|
return k[A];
|
|
4996
4998
|
}, [r]), y = Z(() => Math.random() * (n - t) + t, [t, n]);
|
|
4997
|
-
|
|
4999
|
+
ge(() => {
|
|
4998
5000
|
if (r.length === 0) {
|
|
4999
5001
|
a([]), f([]);
|
|
5000
5002
|
return;
|
|
@@ -5042,7 +5044,7 @@ function mf({
|
|
|
5042
5044
|
}, k);
|
|
5043
5045
|
_.current[b] = A;
|
|
5044
5046
|
}, [y, D, l, c, p]), x = bs(!1);
|
|
5045
|
-
|
|
5047
|
+
ge(() => {
|
|
5046
5048
|
if (!(l.length === 0 || r.length <= 1) && !x.current) {
|
|
5047
5049
|
x.current = !0;
|
|
5048
5050
|
for (let b = 0; b < l.length; b++)
|
|
@@ -5195,105 +5197,105 @@ function yf({
|
|
|
5195
5197
|
renderLoading: y,
|
|
5196
5198
|
theme: w = {}
|
|
5197
5199
|
}) {
|
|
5198
|
-
const x = { ...ga, ...w }, [C, b] = Q([]), [k, A] = Q(!1), [S, P] = Q(null), [F, U] = Q(/* @__PURE__ */ new Set()), [$, I] = Q(null), [W, ne] = Q(null), [
|
|
5199
|
-
if (
|
|
5200
|
+
const x = { ...ga, ...w }, [C, b] = Q([]), [k, A] = Q(!1), [S, P] = Q(null), [F, U] = Q(/* @__PURE__ */ new Set()), [$, I] = Q(null), [W, ne] = Q(null), [Se, Me] = Q(null), [vt, ut] = Q(!1), ae = Pt(() => e ? new la({ baseUrl: r, system_id: e }) : null, [r, e]), $e = Z(async () => {
|
|
5201
|
+
if (ae) {
|
|
5200
5202
|
A(!0), P(null);
|
|
5201
5203
|
try {
|
|
5202
|
-
const
|
|
5203
|
-
|
|
5204
|
-
} catch (
|
|
5205
|
-
const z =
|
|
5204
|
+
const M = await ae.listEmails(t, n, s);
|
|
5205
|
+
M != null && M.messages && (b(M.messages), h == null || h(M.messages));
|
|
5206
|
+
} catch (M) {
|
|
5207
|
+
const z = M instanceof Error ? M : new Error("Failed to fetch emails");
|
|
5206
5208
|
P(z.message), d == null || d(z);
|
|
5207
5209
|
}
|
|
5208
5210
|
A(!1);
|
|
5209
5211
|
}
|
|
5210
|
-
}, [
|
|
5211
|
-
|
|
5212
|
-
l &&
|
|
5213
|
-
}, [l,
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
if (le) {
|
|
5218
|
-
ne(j), Ie(null), ut(!0);
|
|
5212
|
+
}, [ae, t, n, s, d, h]);
|
|
5213
|
+
ge(() => {
|
|
5214
|
+
l && $e();
|
|
5215
|
+
}, [l, $e]);
|
|
5216
|
+
const qe = Z(async (M) => {
|
|
5217
|
+
if (ae) {
|
|
5218
|
+
ne(M), Me(null), ut(!0);
|
|
5219
5219
|
try {
|
|
5220
|
-
const z = await
|
|
5221
|
-
z != null && z.body &&
|
|
5220
|
+
const z = await ae.getEmailParsed(t, M.uid, s || "INBOX");
|
|
5221
|
+
z != null && z.body && Me(z.body);
|
|
5222
5222
|
} catch (z) {
|
|
5223
5223
|
console.error("Failed to fetch email body:", z);
|
|
5224
5224
|
}
|
|
5225
5225
|
ut(!1);
|
|
5226
5226
|
}
|
|
5227
|
-
}, [
|
|
5228
|
-
a == null || a(
|
|
5229
|
-
}, [a, i,
|
|
5227
|
+
}, [ae, t, s]), lt = Z((M) => {
|
|
5228
|
+
a == null || a(M), i && qe(M);
|
|
5229
|
+
}, [a, i, qe]), at = Z((M, z, se) => {
|
|
5230
5230
|
if (!o) {
|
|
5231
|
-
a == null || a(
|
|
5231
|
+
a == null || a(M), i && qe(M);
|
|
5232
5232
|
return;
|
|
5233
5233
|
}
|
|
5234
|
-
const
|
|
5235
|
-
if (
|
|
5236
|
-
const
|
|
5234
|
+
const Be = M.uid;
|
|
5235
|
+
if (se.shiftKey && $ !== null) {
|
|
5236
|
+
const Ae = Math.min($, z), Ue = Math.max($, z), Zn = C.slice(Ae, Ue + 1).map((Qr) => Qr.uid), ir = new Set(Zn);
|
|
5237
5237
|
U(ir), c == null || c(Array.from(ir));
|
|
5238
|
-
} else if (
|
|
5239
|
-
U((
|
|
5240
|
-
const
|
|
5241
|
-
return
|
|
5238
|
+
} else if (se.ctrlKey || se.metaKey)
|
|
5239
|
+
U((Ae) => {
|
|
5240
|
+
const Ue = new Set(Ae);
|
|
5241
|
+
return Ue.has(Be) ? Ue.delete(Be) : Ue.add(Be), c == null || c(Array.from(Ue)), Ue;
|
|
5242
5242
|
}), I(z);
|
|
5243
5243
|
else {
|
|
5244
|
-
const
|
|
5245
|
-
U(
|
|
5244
|
+
const Ae = /* @__PURE__ */ new Set([Be]);
|
|
5245
|
+
U(Ae), I(z), c == null || c(Array.from(Ae));
|
|
5246
5246
|
}
|
|
5247
|
-
}, [o, $, C, F, a, c, i]),
|
|
5248
|
-
if (!
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
}
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5247
|
+
}, [o, $, C, F, a, c, i]), ve = Z(async () => {
|
|
5248
|
+
if (!ae || F.size === 0) return;
|
|
5249
|
+
const M = s || "INBOX";
|
|
5250
|
+
try {
|
|
5251
|
+
const z = await ae.trashEmails(t, Array.from(F), M);
|
|
5252
|
+
if (console.log("Trash result:", z), z.success && z.moved > 0) {
|
|
5253
|
+
b((Be) => Be.filter((Ae) => !F.has(Ae.uid)));
|
|
5254
|
+
const se = Array.from(F);
|
|
5255
|
+
U(/* @__PURE__ */ new Set()), f == null || f(se);
|
|
5256
|
+
} else
|
|
5257
|
+
P("Failed to move emails to trash");
|
|
5258
|
+
} catch (z) {
|
|
5259
|
+
const se = z instanceof Error ? z : new Error("Trash failed");
|
|
5260
|
+
console.error("Trash error:", se), P(se.message), d == null || d(se);
|
|
5261
|
+
}
|
|
5262
|
+
}, [ae, t, F, s, f, d]), Ze = Z(async () => {
|
|
5263
|
+
if (!ae || F.size === 0) return;
|
|
5264
|
+
const M = s || "INBOX";
|
|
5265
|
+
try {
|
|
5266
|
+
const z = await ae.archiveEmails(t, Array.from(F), M);
|
|
5267
|
+
if (console.log("Archive result:", z), z.success && z.archived > 0) {
|
|
5268
|
+
b((Be) => Be.filter((Ae) => !F.has(Ae.uid)));
|
|
5269
|
+
const se = Array.from(F);
|
|
5270
|
+
U(/* @__PURE__ */ new Set()), f == null || f(se);
|
|
5271
|
+
} else
|
|
5272
|
+
P("Failed to archive emails");
|
|
5273
|
+
} catch (z) {
|
|
5274
|
+
const se = z instanceof Error ? z : new Error("Archive failed");
|
|
5275
|
+
console.error("Archive error:", se), P(se.message), d == null || d(se);
|
|
5276
|
+
}
|
|
5277
|
+
}, [ae, t, F, s, f, d]), Te = Z(() => {
|
|
5276
5278
|
if (F.size === C.length)
|
|
5277
5279
|
U(/* @__PURE__ */ new Set()), c == null || c([]);
|
|
5278
5280
|
else {
|
|
5279
|
-
const
|
|
5280
|
-
U(
|
|
5281
|
+
const M = new Set(C.map((z) => z.uid));
|
|
5282
|
+
U(M), c == null || c(Array.from(M));
|
|
5281
5283
|
}
|
|
5282
|
-
}, [C, F.size, c]),
|
|
5284
|
+
}, [C, F.size, c]), ze = Z(() => {
|
|
5283
5285
|
U(/* @__PURE__ */ new Set()), c == null || c([]);
|
|
5284
|
-
}, [c]),
|
|
5285
|
-
delete:
|
|
5286
|
-
archive:
|
|
5287
|
-
refresh:
|
|
5288
|
-
selectAll:
|
|
5289
|
-
clearSelection:
|
|
5290
|
-
}, Gn = (
|
|
5291
|
-
if (!
|
|
5292
|
-
const z = new Date(
|
|
5293
|
-
return z.toDateString() ===
|
|
5294
|
-
}, Hr = (
|
|
5286
|
+
}, [c]), et = {
|
|
5287
|
+
delete: ve,
|
|
5288
|
+
archive: Ze,
|
|
5289
|
+
refresh: $e,
|
|
5290
|
+
selectAll: Te,
|
|
5291
|
+
clearSelection: ze
|
|
5292
|
+
}, Gn = (M) => {
|
|
5293
|
+
if (!M) return "";
|
|
5294
|
+
const z = new Date(M), se = /* @__PURE__ */ new Date();
|
|
5295
|
+
return z.toDateString() === se.toDateString() ? z.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : z.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
5296
|
+
}, Hr = (M, z) => /* @__PURE__ */ v.jsx("div", { style: {
|
|
5295
5297
|
padding: "12px 16px",
|
|
5296
|
-
background: z ? x.selectedBackground :
|
|
5298
|
+
background: z ? x.selectedBackground : M.seen ? x.cardBackground : x.unreadBackground,
|
|
5297
5299
|
borderBottom: `1px solid ${x.border}`,
|
|
5298
5300
|
cursor: "pointer",
|
|
5299
5301
|
transition: "background 0.15s ease"
|
|
@@ -5301,43 +5303,43 @@ function yf({
|
|
|
5301
5303
|
/* @__PURE__ */ v.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
5302
5304
|
/* @__PURE__ */ v.jsx("div", { style: {
|
|
5303
5305
|
fontSize: "14px",
|
|
5304
|
-
fontWeight:
|
|
5306
|
+
fontWeight: M.seen ? 400 : 600,
|
|
5305
5307
|
color: x.text,
|
|
5306
5308
|
whiteSpace: "nowrap",
|
|
5307
5309
|
overflow: "hidden",
|
|
5308
5310
|
textOverflow: "ellipsis"
|
|
5309
|
-
}, children: Xr(
|
|
5311
|
+
}, children: Xr(M.from).split("@")[0] }),
|
|
5310
5312
|
/* @__PURE__ */ v.jsx("div", { style: {
|
|
5311
5313
|
fontSize: "14px",
|
|
5312
|
-
fontWeight:
|
|
5313
|
-
color:
|
|
5314
|
+
fontWeight: M.seen ? 400 : 500,
|
|
5315
|
+
color: M.seen ? x.textSecondary : x.text,
|
|
5314
5316
|
marginTop: "2px",
|
|
5315
5317
|
whiteSpace: "nowrap",
|
|
5316
5318
|
overflow: "hidden",
|
|
5317
5319
|
textOverflow: "ellipsis"
|
|
5318
|
-
}, children: Xr(
|
|
5320
|
+
}, children: Xr(M.subject) || "(No subject)" })
|
|
5319
5321
|
] }),
|
|
5320
5322
|
/* @__PURE__ */ v.jsx("div", { style: {
|
|
5321
5323
|
fontSize: "12px",
|
|
5322
5324
|
color: x.textSecondary,
|
|
5323
5325
|
flexShrink: 0
|
|
5324
|
-
}, children: Gn(
|
|
5325
|
-
] }) }), Jn = (
|
|
5326
|
-
/* @__PURE__ */ v.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color: x.text }, children: Xr(
|
|
5326
|
+
}, children: Gn(M.date) })
|
|
5327
|
+
] }) }), Jn = (M) => /* @__PURE__ */ v.jsxs("div", { style: { padding: "24px" }, children: [
|
|
5328
|
+
/* @__PURE__ */ v.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color: x.text }, children: Xr(M.subject) || "(No subject)" }),
|
|
5327
5329
|
/* @__PURE__ */ v.jsxs("div", { style: { fontSize: "14px", color: x.textSecondary, marginBottom: "16px" }, children: [
|
|
5328
5330
|
"From: ",
|
|
5329
|
-
Xr(
|
|
5331
|
+
Xr(M.from),
|
|
5330
5332
|
" • ",
|
|
5331
|
-
new Date(
|
|
5333
|
+
new Date(M.date).toLocaleString()
|
|
5332
5334
|
] }),
|
|
5333
|
-
vt ? /* @__PURE__ */ v.jsx("div", { style: { fontSize: "14px", color: x.textSecondary }, children: "Loading..." }) :
|
|
5335
|
+
vt ? /* @__PURE__ */ v.jsx("div", { style: { fontSize: "14px", color: x.textSecondary }, children: "Loading..." }) : Se ? /* @__PURE__ */ v.jsx(
|
|
5334
5336
|
"div",
|
|
5335
5337
|
{
|
|
5336
5338
|
style: { fontSize: "14px", color: x.text },
|
|
5337
|
-
dangerouslySetInnerHTML: { __html:
|
|
5339
|
+
dangerouslySetInnerHTML: { __html: Se }
|
|
5338
5340
|
}
|
|
5339
5341
|
) : /* @__PURE__ */ v.jsx("div", { style: { fontSize: "14px", color: x.textSecondary }, children: "No content available" })
|
|
5340
|
-
] }), Qn = (
|
|
5342
|
+
] }), Qn = (M, z) => /* @__PURE__ */ v.jsxs("div", { style: {
|
|
5341
5343
|
display: "flex",
|
|
5342
5344
|
alignItems: "center",
|
|
5343
5345
|
gap: "8px",
|
|
@@ -5358,12 +5360,12 @@ function yf({
|
|
|
5358
5360
|
cursor: "pointer",
|
|
5359
5361
|
color: x.text
|
|
5360
5362
|
},
|
|
5361
|
-
children:
|
|
5363
|
+
children: M.length === C.length ? "Deselect All" : "Select All"
|
|
5362
5364
|
}
|
|
5363
5365
|
),
|
|
5364
|
-
|
|
5366
|
+
M.length > 0 && /* @__PURE__ */ v.jsxs(v.Fragment, { children: [
|
|
5365
5367
|
/* @__PURE__ */ v.jsxs("span", { style: { fontSize: "13px", color: x.textSecondary }, children: [
|
|
5366
|
-
|
|
5368
|
+
M.length,
|
|
5367
5369
|
" selected"
|
|
5368
5370
|
] }),
|
|
5369
5371
|
/* @__PURE__ */ v.jsx(
|
|
@@ -5428,7 +5430,7 @@ function yf({
|
|
|
5428
5430
|
children: /* @__PURE__ */ v.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "refresh" })
|
|
5429
5431
|
}
|
|
5430
5432
|
)
|
|
5431
|
-
] }),
|
|
5433
|
+
] }), It = () => /* @__PURE__ */ v.jsx("div", { style: {
|
|
5432
5434
|
padding: "48px",
|
|
5433
5435
|
textAlign: "center",
|
|
5434
5436
|
color: x.textSecondary
|
|
@@ -5436,7 +5438,7 @@ function yf({
|
|
|
5436
5438
|
padding: "48px",
|
|
5437
5439
|
textAlign: "center",
|
|
5438
5440
|
color: x.textSecondary
|
|
5439
|
-
}, children: "Loading..." }), Gr = p || Hr, Jr = g || Jn,
|
|
5441
|
+
}, children: "Loading..." }), Gr = p || Hr, Jr = g || Jn, Mt = _ || Qn, Yn = D || It, Xn = y || bt;
|
|
5440
5442
|
return k && C.length === 0 ? /* @__PURE__ */ v.jsx("div", { style: { background: x.background, width: "100%", height: "100%" }, children: Xn() }) : /* @__PURE__ */ v.jsxs("div", { style: { display: "flex", background: x.background, width: "100%", height: "100%" }, children: [
|
|
5441
5443
|
/* @__PURE__ */ v.jsxs("div", { style: {
|
|
5442
5444
|
flex: i && W ? "0 0 50%" : "1",
|
|
@@ -5445,7 +5447,7 @@ function yf({
|
|
|
5445
5447
|
borderRight: i && W ? `1px solid ${x.border}` : "none",
|
|
5446
5448
|
overflow: "hidden"
|
|
5447
5449
|
}, children: [
|
|
5448
|
-
o &&
|
|
5450
|
+
o && Mt(Array.from(F), et),
|
|
5449
5451
|
S && /* @__PURE__ */ v.jsx("div", { style: {
|
|
5450
5452
|
padding: "12px 16px",
|
|
5451
5453
|
background: "#fef2f2",
|
|
@@ -5453,14 +5455,14 @@ function yf({
|
|
|
5453
5455
|
fontSize: "14px",
|
|
5454
5456
|
borderBottom: `1px solid ${x.border}`
|
|
5455
5457
|
}, children: S }),
|
|
5456
|
-
/* @__PURE__ */ v.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: C.length === 0 ? Yn() : C.map((
|
|
5458
|
+
/* @__PURE__ */ v.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: C.length === 0 ? Yn() : C.map((M, z) => /* @__PURE__ */ v.jsx(
|
|
5457
5459
|
"div",
|
|
5458
5460
|
{
|
|
5459
|
-
onClick: (
|
|
5460
|
-
onDoubleClick: () => lt(
|
|
5461
|
-
children: Gr(
|
|
5461
|
+
onClick: (se) => at(M, z, se),
|
|
5462
|
+
onDoubleClick: () => lt(M),
|
|
5463
|
+
children: Gr(M, F.has(M.uid))
|
|
5462
5464
|
},
|
|
5463
|
-
|
|
5465
|
+
M.uid
|
|
5464
5466
|
)) })
|
|
5465
5467
|
] }),
|
|
5466
5468
|
i && W && /* @__PURE__ */ v.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: Jr(W) })
|
|
@@ -5591,22 +5593,22 @@ var ya = ma(function(r) {
|
|
|
5591
5593
|
for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
|
|
5592
5594
|
throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
5593
5595
|
});
|
|
5594
|
-
const eu =
|
|
5596
|
+
const eu = Il(null);
|
|
5595
5597
|
function _a(r, e) {
|
|
5596
5598
|
return { getTheme: function() {
|
|
5597
5599
|
return e ?? null;
|
|
5598
5600
|
} };
|
|
5599
5601
|
}
|
|
5600
|
-
function
|
|
5601
|
-
const r =
|
|
5602
|
+
function Ye() {
|
|
5603
|
+
const r = Ml(eu);
|
|
5602
5604
|
return r == null && ya(8), r;
|
|
5603
5605
|
}
|
|
5604
5606
|
function Pr(r) {
|
|
5605
5607
|
return {};
|
|
5606
5608
|
}
|
|
5607
|
-
const Hs = {}, xa = {}, tu = {}, Et = {}, Ht = {}, kr = {}, Gt = {}, Fn = {}, Cs = {}, Sr = {}, Tr = {}, Re = {}, Gs = {}, Js = {}, va = {}, ru = {}, ba = {}, nu = {}, Da = {}, su = {}, iu = {}, fn = {}, wa = {}, ou = {}, uu = {}, lu = {}, Ca = {}, Aa = {}, Ea = {},
|
|
5609
|
+
const Hs = {}, xa = {}, tu = {}, Et = {}, Ht = {}, kr = {}, Gt = {}, Fn = {}, Cs = {}, Sr = {}, Tr = {}, Re = {}, Gs = {}, Js = {}, va = {}, ru = {}, ba = {}, nu = {}, Da = {}, su = {}, iu = {}, fn = {}, wa = {}, ou = {}, uu = {}, lu = {}, Ca = {}, Aa = {}, Ea = {}, Ii = {}, au = {}, ka = {}, cu = {}, du = {}, Sa = {}, Ln = {}, Qs = {}, As = {}, Ta = {}, Ba = {}, Zr = {}, en = {}, Na = {}, Fa = {}, La = {}, Ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Pa = Ie && "documentMode" in document ? document.documentMode : null, Le = Ie && /Mac|iPod|iPhone|iPad/.test(navigator.platform), mt = Ie && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), hn = !(!Ie || !("InputEvent" in window) || Pa) && "getTargetRanges" in new window.InputEvent("input"), Pn = Ie && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Or = Ie && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Oa = Ie && /Android/.test(navigator.userAgent), fu = Ie && /^(?=.*Chrome).*/i.test(navigator.userAgent), Ra = Ie && Oa && fu, Ys = Ie && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !fu, Rr = 1, _t = 3, Tt = 0, hu = 1, Yt = 2, ja = 0, Ia = 1, Ma = 2, pn = 4, gn = 8, Xs = 128, $a = 112 | (3 | pn | gn) | Xs, Zs = 1, ei = 2, ti = 3, ri = 4, ni = 5, si = 6, On = Pn || Or || Ys ? " " : "", nt = `
|
|
5608
5610
|
|
|
5609
|
-
`, qa = mt ? " " : On, pu = "֑-߿יִ-﷽ﹰ-ﻼ", gu = "A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--", za = new RegExp("^[^" + gu + "]*[" + pu + "]"), Ua = new RegExp("^[^" + pu + "]*[" + gu + "]"), Bt = { bold: 1, code: 16, highlight: Xs, italic: 2, strikethrough: pn, subscript: 32, superscript: 64, underline: gn }, Wa = { directionless: 1, unmergeable: 2 },
|
|
5611
|
+
`, qa = mt ? " " : On, pu = "֑-߿יִ-﷽ﹰ-ﻼ", gu = "A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--", za = new RegExp("^[^" + gu + "]*[" + pu + "]"), Ua = new RegExp("^[^" + pu + "]*[" + gu + "]"), Bt = { bold: 1, code: 16, highlight: Xs, italic: 2, strikethrough: pn, subscript: 32, superscript: 64, underline: gn }, Wa = { directionless: 1, unmergeable: 2 }, Mi = { center: ei, end: si, justify: ri, left: Zs, right: ti, start: ni }, Va = { [ei]: "center", [si]: "end", [ri]: "justify", [Zs]: "left", [ti]: "right", [ni]: "start" }, Ka = { normal: 0, segmented: 2, token: 1 }, Ha = { [ja]: "normal", [Ma]: "segmented", [Ia]: "token" };
|
|
5610
5612
|
function Ga(r) {
|
|
5611
5613
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
5612
5614
|
}
|
|
@@ -5631,7 +5633,7 @@ function cs(r, e, t) {
|
|
|
5631
5633
|
return s && (r === s || n && r.previousSibling === s) || n && jn(r, t) !== void 0;
|
|
5632
5634
|
}
|
|
5633
5635
|
function Ya(r, e, t) {
|
|
5634
|
-
const n =
|
|
5636
|
+
const n = Fe(t._window);
|
|
5635
5637
|
let s = null, o = null;
|
|
5636
5638
|
n !== null && n.anchorNode === r && (s = n.anchorOffset, o = n.focusOffset);
|
|
5637
5639
|
const i = r.nodeValue;
|
|
@@ -5645,7 +5647,7 @@ function Xa(r, e, t) {
|
|
|
5645
5647
|
return e.nodeType === _t && t.isAttached();
|
|
5646
5648
|
}
|
|
5647
5649
|
function Za(r, e, t, n) {
|
|
5648
|
-
for (let s = r; s && !fc(s); s =
|
|
5650
|
+
for (let s = r; s && !fc(s); s = Ir(s)) {
|
|
5649
5651
|
const o = jn(s, e);
|
|
5650
5652
|
if (o !== void 0) {
|
|
5651
5653
|
const i = pe(o, t);
|
|
@@ -5657,10 +5659,10 @@ function mu(r, e, t) {
|
|
|
5657
5659
|
Es = !0;
|
|
5658
5660
|
const n = performance.now() - ii > Ja;
|
|
5659
5661
|
try {
|
|
5660
|
-
|
|
5661
|
-
const s =
|
|
5662
|
+
Ee(r, () => {
|
|
5663
|
+
const s = j() || function(d) {
|
|
5662
5664
|
return d.getEditorState().read(() => {
|
|
5663
|
-
const h =
|
|
5665
|
+
const h = j();
|
|
5664
5666
|
return h !== null ? h.clone() : null;
|
|
5665
5667
|
});
|
|
5666
5668
|
}(r), o = /* @__PURE__ */ new Map(), i = r.getRootElement(), u = r._editorState, l = r._blockCursorElement;
|
|
@@ -5706,7 +5708,7 @@ function mu(r, e, t) {
|
|
|
5706
5708
|
}
|
|
5707
5709
|
t.takeRecords();
|
|
5708
5710
|
}
|
|
5709
|
-
s !== null && (a && (s.dirty = !0,
|
|
5711
|
+
s !== null && (a && (s.dirty = !0, Ge(s)), mt && Su(r) && s.insertRawText(c));
|
|
5710
5712
|
});
|
|
5711
5713
|
} finally {
|
|
5712
5714
|
Es = !1;
|
|
@@ -5718,7 +5720,7 @@ function yu(r) {
|
|
|
5718
5720
|
}
|
|
5719
5721
|
function _u(r) {
|
|
5720
5722
|
(function(e) {
|
|
5721
|
-
ii === 0 &&
|
|
5723
|
+
ii === 0 && Mn(e).addEventListener("textInput", Qa, !0);
|
|
5722
5724
|
})(r), r._observer = new MutationObserver((e, t) => {
|
|
5723
5725
|
mu(r, e, t);
|
|
5724
5726
|
});
|
|
@@ -5797,7 +5799,7 @@ function vu(r) {
|
|
|
5797
5799
|
for (; e != null; ) {
|
|
5798
5800
|
const t = Rn(e);
|
|
5799
5801
|
if (ui(t)) return t;
|
|
5800
|
-
e =
|
|
5802
|
+
e = Ir(e);
|
|
5801
5803
|
}
|
|
5802
5804
|
return null;
|
|
5803
5805
|
}
|
|
@@ -5829,7 +5831,7 @@ function bu(r) {
|
|
|
5829
5831
|
}
|
|
5830
5832
|
function nc(r, e) {
|
|
5831
5833
|
if (e != null) return void (r.__key = e);
|
|
5832
|
-
|
|
5834
|
+
De(), Gu();
|
|
5833
5835
|
const t = te(), n = it(), s = "" + ec++;
|
|
5834
5836
|
n._nodeMap.set(s, r), E(r) ? t._dirtyElements.set(s, !0) : t._dirtyLeaves.add(s), t._cloneNotNeeded.add(s), t._dirtyType = hu, r.__key = s;
|
|
5835
5837
|
}
|
|
@@ -5879,8 +5881,8 @@ function xn(r) {
|
|
|
5879
5881
|
const u = e.__key;
|
|
5880
5882
|
s._dirtyType = hu, E(r) ? i.set(u, !0) : s._dirtyLeaves.add(u);
|
|
5881
5883
|
}
|
|
5882
|
-
function
|
|
5883
|
-
|
|
5884
|
+
function he(r) {
|
|
5885
|
+
De();
|
|
5884
5886
|
const e = te(), t = e._compositionKey;
|
|
5885
5887
|
if (r !== t) {
|
|
5886
5888
|
if (e._compositionKey = r, t !== null) {
|
|
@@ -5912,7 +5914,7 @@ function Xt(r, e) {
|
|
|
5912
5914
|
for (; t != null; ) {
|
|
5913
5915
|
const n = Du(t, e);
|
|
5914
5916
|
if (n !== null) return n;
|
|
5915
|
-
t =
|
|
5917
|
+
t = Ir(t);
|
|
5916
5918
|
}
|
|
5917
5919
|
return null;
|
|
5918
5920
|
}
|
|
@@ -5929,8 +5931,8 @@ function re() {
|
|
|
5929
5931
|
function Cu(r) {
|
|
5930
5932
|
return r._nodeMap.get("root");
|
|
5931
5933
|
}
|
|
5932
|
-
function
|
|
5933
|
-
|
|
5934
|
+
function Ge(r) {
|
|
5935
|
+
De();
|
|
5934
5936
|
const e = it();
|
|
5935
5937
|
r !== null && (r.dirty = !0, r.setCachedNodes(null)), e._selection = r;
|
|
5936
5938
|
}
|
|
@@ -5940,7 +5942,7 @@ function Vt(r) {
|
|
|
5940
5942
|
for (; o != null; ) {
|
|
5941
5943
|
const i = jn(o, s);
|
|
5942
5944
|
if (i !== void 0) return i;
|
|
5943
|
-
o =
|
|
5945
|
+
o = Ir(o);
|
|
5944
5946
|
}
|
|
5945
5947
|
return null;
|
|
5946
5948
|
}(r, e);
|
|
@@ -5965,7 +5967,7 @@ function ku(r) {
|
|
|
5965
5967
|
return r.nodeType === _t ? r.nodeValue : null;
|
|
5966
5968
|
}
|
|
5967
5969
|
function ai(r, e, t) {
|
|
5968
|
-
const n =
|
|
5970
|
+
const n = Fe(e._window);
|
|
5969
5971
|
if (n === null) return;
|
|
5970
5972
|
const s = n.anchorNode;
|
|
5971
5973
|
let { anchorOffset: o, focusOffset: i } = n;
|
|
@@ -5990,7 +5992,7 @@ function ci(r, e, t, n, s) {
|
|
|
5990
5992
|
const l = o.getTextContent();
|
|
5991
5993
|
if (s || u !== l) {
|
|
5992
5994
|
if (u === "") {
|
|
5993
|
-
if (
|
|
5995
|
+
if (he(null), Pn || Or || Ys) o.remove();
|
|
5994
5996
|
else {
|
|
5995
5997
|
const g = te();
|
|
5996
5998
|
setTimeout(() => {
|
|
@@ -6003,10 +6005,10 @@ function ci(r, e, t, n, s) {
|
|
|
6003
6005
|
}
|
|
6004
6006
|
const a = o.getParent(), c = zr(), f = o.getTextContentSize(), d = ht(), h = o.getKey();
|
|
6005
6007
|
if (o.isToken() || d !== null && h === d && !i || B(c) && (a !== null && !a.canInsertTextBefore() && c.anchor.offset === 0 || c.anchor.key === r.__key && c.anchor.offset === 0 && !o.canInsertTextBefore() && !i || c.focus.key === r.__key && c.focus.offset === f && !o.canInsertTextAfter() && !i)) return void o.markDirty();
|
|
6006
|
-
const p =
|
|
6008
|
+
const p = j();
|
|
6007
6009
|
if (!B(p) || t === null || n === null) return void o.setTextContent(u);
|
|
6008
6010
|
if (p.setTextNodeRange(o, t, o, n), o.isSegmented()) {
|
|
6009
|
-
const g =
|
|
6011
|
+
const g = ce(o.getTextContent());
|
|
6010
6012
|
o.replace(g), o = g;
|
|
6011
6013
|
}
|
|
6012
6014
|
o.setTextContent(u);
|
|
@@ -6045,7 +6047,7 @@ function Ji(r, e, t) {
|
|
|
6045
6047
|
}
|
|
6046
6048
|
function ic() {
|
|
6047
6049
|
const r = re();
|
|
6048
|
-
|
|
6050
|
+
Ge(xu(r.select(0, r.getChildrenSize())));
|
|
6049
6051
|
}
|
|
6050
6052
|
function br(r, e) {
|
|
6051
6053
|
r.__lexicalClassNameCache === void 0 && (r.__lexicalClassNameCache = {});
|
|
@@ -6087,20 +6089,20 @@ function Br(r, e) {
|
|
|
6087
6089
|
return null;
|
|
6088
6090
|
}
|
|
6089
6091
|
function Su(r) {
|
|
6090
|
-
const e =
|
|
6092
|
+
const e = Mn(r).event, t = e && e.inputType;
|
|
6091
6093
|
return t === "insertFromPaste" || t === "insertFromPasteAsQuotation";
|
|
6092
6094
|
}
|
|
6093
6095
|
function O(r, e, t) {
|
|
6094
6096
|
return Yu(r, e, t);
|
|
6095
6097
|
}
|
|
6096
|
-
function
|
|
6097
|
-
return !
|
|
6098
|
+
function In(r) {
|
|
6099
|
+
return !_e(r) && !r.isLastChild() && !r.isInline();
|
|
6098
6100
|
}
|
|
6099
6101
|
function vn(r, e) {
|
|
6100
6102
|
const t = r._keyToDOMMap.get(e);
|
|
6101
6103
|
return t === void 0 && N(75, e), t;
|
|
6102
6104
|
}
|
|
6103
|
-
function
|
|
6105
|
+
function Ir(r) {
|
|
6104
6106
|
const e = r.assignedSlot || r.parentElement;
|
|
6105
6107
|
return e !== null && e.nodeType === 11 ? e.host : e;
|
|
6106
6108
|
}
|
|
@@ -6112,22 +6114,22 @@ function Dr(r, e) {
|
|
|
6112
6114
|
}
|
|
6113
6115
|
return !1;
|
|
6114
6116
|
}
|
|
6115
|
-
function
|
|
6117
|
+
function Mn(r) {
|
|
6116
6118
|
const e = r._window;
|
|
6117
6119
|
return e === null && N(78), e;
|
|
6118
6120
|
}
|
|
6119
6121
|
function oc(r) {
|
|
6120
6122
|
let e = r.getParentOrThrow();
|
|
6121
6123
|
for (; e !== null; ) {
|
|
6122
|
-
if (
|
|
6124
|
+
if (Je(e)) return e;
|
|
6123
6125
|
e = e.getParentOrThrow();
|
|
6124
6126
|
}
|
|
6125
6127
|
return e;
|
|
6126
6128
|
}
|
|
6127
|
-
function
|
|
6128
|
-
return
|
|
6129
|
+
function Je(r) {
|
|
6130
|
+
return _e(r) || E(r) && r.isShadowRoot();
|
|
6129
6131
|
}
|
|
6130
|
-
function
|
|
6132
|
+
function Xe(r) {
|
|
6131
6133
|
const e = te(), t = r.constructor.getType(), n = e._nodes.get(t);
|
|
6132
6134
|
n === void 0 && N(200, r.constructor.name, t);
|
|
6133
6135
|
const { replace: s, replaceWithKlass: o } = n;
|
|
@@ -6138,7 +6140,7 @@ function Ye(r) {
|
|
|
6138
6140
|
return r;
|
|
6139
6141
|
}
|
|
6140
6142
|
function ds(r, e) {
|
|
6141
|
-
!
|
|
6143
|
+
!_e(r.getParent()) || E(e) || Y(e) || N(99);
|
|
6142
6144
|
}
|
|
6143
6145
|
function fs(r) {
|
|
6144
6146
|
return (Y(r) || E(r) && !r.canBeEmpty()) && !r.isInline();
|
|
@@ -6181,8 +6183,8 @@ function uc(r, e, t) {
|
|
|
6181
6183
|
}
|
|
6182
6184
|
n !== null && fi(n, r, e);
|
|
6183
6185
|
}
|
|
6184
|
-
function
|
|
6185
|
-
return
|
|
6186
|
+
function Fe(r) {
|
|
6187
|
+
return Ie ? (r || window).getSelection() : null;
|
|
6186
6188
|
}
|
|
6187
6189
|
function lc(r) {
|
|
6188
6190
|
return st(r) && r.tagName === "A";
|
|
@@ -6203,7 +6205,7 @@ function bn(r) {
|
|
|
6203
6205
|
}
|
|
6204
6206
|
function dt(r) {
|
|
6205
6207
|
if (Y(r) && !r.isInline()) return !0;
|
|
6206
|
-
if (!E(r) ||
|
|
6208
|
+
if (!E(r) || Je(r)) return !1;
|
|
6207
6209
|
const e = r.getFirstChild(), t = e === null || St(e) || L(e) || e.isInline();
|
|
6208
6210
|
return !r.isInline() && r.canBeEmpty() !== !1 && t;
|
|
6209
6211
|
}
|
|
@@ -6248,14 +6250,14 @@ function Tu(r, e, t, n, s, o) {
|
|
|
6248
6250
|
i.__parent === e && (E(i) && Tu(i, u, t, n, s, o), t.has(u) || o.delete(u), s.push(u)), i = i.getNextSibling();
|
|
6249
6251
|
}
|
|
6250
6252
|
}
|
|
6251
|
-
let yt,
|
|
6253
|
+
let yt, xe, Nr, $n, Ss, Ts, Nt, je, Bs, Fr, ue = "", ye = "", We = null, Pe = "", rt = "", Bu = !1, Lr = !1, ln = null;
|
|
6252
6254
|
function Dn(r, e) {
|
|
6253
6255
|
const t = Nt.get(r);
|
|
6254
6256
|
if (e !== null) {
|
|
6255
6257
|
const n = Ls(r);
|
|
6256
6258
|
n.parentNode === e && e.removeChild(n);
|
|
6257
6259
|
}
|
|
6258
|
-
if (je.has(r) ||
|
|
6260
|
+
if (je.has(r) || xe._keyToDOMMap.delete(r), E(t)) {
|
|
6259
6261
|
const n = Cn(t, Nt);
|
|
6260
6262
|
Ns(n, 0, n.length - 1, null);
|
|
6261
6263
|
}
|
|
@@ -6288,43 +6290,43 @@ function Fu(r, e) {
|
|
|
6288
6290
|
function wn(r, e) {
|
|
6289
6291
|
const t = je.get(r);
|
|
6290
6292
|
t === void 0 && N(60);
|
|
6291
|
-
const n = t.createDOM(yt,
|
|
6293
|
+
const n = t.createDOM(yt, xe);
|
|
6292
6294
|
if (function(s, o, i) {
|
|
6293
6295
|
const u = i._keyToDOMMap;
|
|
6294
6296
|
(function(l, a, c) {
|
|
6295
6297
|
l[`__lexicalKey_${a._key}`] = c;
|
|
6296
6298
|
})(o, i, s), u.set(s, o);
|
|
6297
|
-
}(r, n,
|
|
6299
|
+
}(r, n, xe), L(t) ? n.setAttribute("data-lexical-text", "true") : Y(t) && n.setAttribute("data-lexical-decorator", "true"), E(t)) {
|
|
6298
6300
|
const s = t.__indent, o = t.__size;
|
|
6299
6301
|
if (s !== 0 && Nu(n, s), o !== 0) {
|
|
6300
6302
|
const u = o - 1;
|
|
6301
6303
|
(function(l, a, c, f) {
|
|
6302
|
-
const d =
|
|
6303
|
-
|
|
6304
|
+
const d = ye;
|
|
6305
|
+
ye = "", Fs(l, c, 0, a, c.getDOMSlot(f)), Pu(c, f), ye = d;
|
|
6304
6306
|
})(Cn(t, je), u, t, n);
|
|
6305
6307
|
}
|
|
6306
6308
|
const i = t.__format;
|
|
6307
|
-
i !== 0 && Fu(n, i), t.isInline() || Lu(null, t, n),
|
|
6309
|
+
i !== 0 && Fu(n, i), t.isInline() || Lu(null, t, n), In(t) && (ue += nt, rt += nt);
|
|
6308
6310
|
} else {
|
|
6309
6311
|
const s = t.getTextContent();
|
|
6310
6312
|
if (Y(t)) {
|
|
6311
|
-
const o = t.decorate(
|
|
6313
|
+
const o = t.decorate(xe, yt);
|
|
6312
6314
|
o !== null && Ou(r, o), n.contentEditable = "false";
|
|
6313
|
-
} else L(t) && (t.isDirectionless() || (
|
|
6314
|
-
|
|
6315
|
+
} else L(t) && (t.isDirectionless() || (ye += s));
|
|
6316
|
+
ue += s, rt += s;
|
|
6315
6317
|
}
|
|
6316
6318
|
return e !== null && e.insertChild(n), di(Fr, Nr, $n, t, "created"), n;
|
|
6317
6319
|
}
|
|
6318
6320
|
function Fs(r, e, t, n, s) {
|
|
6319
|
-
const o =
|
|
6320
|
-
|
|
6321
|
+
const o = ue;
|
|
6322
|
+
ue = "";
|
|
6321
6323
|
let i = t;
|
|
6322
6324
|
for (; i <= n; ++i) {
|
|
6323
6325
|
wn(r[i], s);
|
|
6324
6326
|
const u = je.get(r[i]);
|
|
6325
|
-
u !== null && L(u) && (
|
|
6327
|
+
u !== null && L(u) && (We === null && (We = u.getFormat()), Pe === "" && (Pe = u.getStyle()));
|
|
6326
6328
|
}
|
|
6327
|
-
|
|
6329
|
+
In(e) && (ue += nt), s.element.__lexicalTextContent = ue, ue = o + ue;
|
|
6328
6330
|
}
|
|
6329
6331
|
function Zi(r, e) {
|
|
6330
6332
|
if (r) {
|
|
@@ -6343,8 +6345,8 @@ function Lu(r, e, t) {
|
|
|
6343
6345
|
}
|
|
6344
6346
|
function Pu(r, e) {
|
|
6345
6347
|
const t = e.__lexicalDirTextContent || "", n = e.__lexicalDir || "";
|
|
6346
|
-
if (t !==
|
|
6347
|
-
const o =
|
|
6348
|
+
if (t !== ye || n !== ln) {
|
|
6349
|
+
const o = ye === "", i = o ? ln : (s = ye, za.test(s) ? "rtl" : Ua.test(s) ? "ltr" : null);
|
|
6348
6350
|
if (i !== n) {
|
|
6349
6351
|
const u = e.classList, l = yt.theme;
|
|
6350
6352
|
let a = n !== null ? l[n] : void 0, c = i !== null ? l[i] : void 0;
|
|
@@ -6368,16 +6370,16 @@ function Pu(r, e) {
|
|
|
6368
6370
|
}
|
|
6369
6371
|
Lr || (r.getWritable().__dir = i);
|
|
6370
6372
|
}
|
|
6371
|
-
ln = i, e.__lexicalDirTextContent =
|
|
6373
|
+
ln = i, e.__lexicalDirTextContent = ye, e.__lexicalDir = i;
|
|
6372
6374
|
}
|
|
6373
6375
|
var s;
|
|
6374
6376
|
}
|
|
6375
6377
|
function pc(r, e, t) {
|
|
6376
|
-
const n =
|
|
6378
|
+
const n = ye;
|
|
6377
6379
|
var s;
|
|
6378
|
-
|
|
6379
|
-
const l =
|
|
6380
|
-
|
|
6380
|
+
ye = "", We = null, Pe = "", function(o, i, u) {
|
|
6381
|
+
const l = ue, a = o.__size, c = i.__size;
|
|
6382
|
+
ue = "";
|
|
6381
6383
|
const f = u.element;
|
|
6382
6384
|
if (a === 1 && c === 1) {
|
|
6383
6385
|
const d = o.__first, h = i.__first;
|
|
@@ -6396,7 +6398,7 @@ function pc(r, e, t) {
|
|
|
6396
6398
|
Dn(d, null);
|
|
6397
6399
|
}
|
|
6398
6400
|
const p = je.get(h);
|
|
6399
|
-
L(p) && (
|
|
6401
|
+
L(p) && (We === null && (We = p.getFormat()), Pe === "" && (Pe = p.getStyle()));
|
|
6400
6402
|
} else {
|
|
6401
6403
|
const d = Cn(o, Nt), h = Cn(i, je);
|
|
6402
6404
|
if (d.length !== a && N(227), h.length !== c && N(228), a === 0) c !== 0 && Fs(h, i, 0, c - 1, u);
|
|
@@ -6413,27 +6415,27 @@ function pc(r, e, t) {
|
|
|
6413
6415
|
if ($ === I) A = hs(mr(I, w.element)), S++, P++;
|
|
6414
6416
|
else {
|
|
6415
6417
|
b === void 0 && (b = new Set(g)), k === void 0 && (k = new Set(_));
|
|
6416
|
-
const ne = k.has($),
|
|
6417
|
-
if (ne) if (
|
|
6418
|
-
const
|
|
6419
|
-
|
|
6418
|
+
const ne = k.has($), Se = b.has(I);
|
|
6419
|
+
if (ne) if (Se) {
|
|
6420
|
+
const Me = vn(xe, I);
|
|
6421
|
+
Me === A ? A = hs(mr(I, w.element)) : (w.withBefore(A).insertChild(Me), mr(I, w.element)), S++, P++;
|
|
6420
6422
|
} else wn(I, w.withBefore(A)), P++;
|
|
6421
6423
|
else A = hs(Ls($)), Dn($, w.element), S++;
|
|
6422
6424
|
}
|
|
6423
6425
|
const W = je.get(I);
|
|
6424
|
-
W !== null && L(W) && (
|
|
6426
|
+
W !== null && L(W) && (We === null && (We = W.getFormat()), Pe === "" && (Pe = W.getStyle()));
|
|
6425
6427
|
}
|
|
6426
6428
|
const F = S > x, U = P > C;
|
|
6427
6429
|
if (F && !U) {
|
|
6428
|
-
const $ = _[C + 1], I = $ === void 0 ? null :
|
|
6430
|
+
const $ = _[C + 1], I = $ === void 0 ? null : xe.getElementByKey($);
|
|
6429
6431
|
Fs(_, p, P, C, w.withBefore(I));
|
|
6430
6432
|
} else U && !F && Ns(g, S, x, w.element);
|
|
6431
6433
|
})(i, d, h, a, c, u);
|
|
6432
6434
|
}
|
|
6433
|
-
|
|
6434
|
-
}(r, e, e.getDOMSlot(t)), Pu(e, t), Zt(s = e) &&
|
|
6435
|
+
In(i) && (ue += nt), f.__lexicalTextContent = ue, ue = l + ue;
|
|
6436
|
+
}(r, e, e.getDOMSlot(t)), Pu(e, t), Zt(s = e) && We != null && We !== s.__textFormat && !Lr && (s.setTextFormat(We), s.setTextStyle(Pe)), function(o) {
|
|
6435
6437
|
Zt(o) && Pe !== "" && Pe !== o.__textStyle && !Lr && o.setTextStyle(Pe);
|
|
6436
|
-
}(e),
|
|
6438
|
+
}(e), ye = n;
|
|
6437
6439
|
}
|
|
6438
6440
|
function Cn(r, e) {
|
|
6439
6441
|
const t = [];
|
|
@@ -6448,16 +6450,16 @@ function mr(r, e) {
|
|
|
6448
6450
|
const t = Nt.get(r);
|
|
6449
6451
|
let n = je.get(r);
|
|
6450
6452
|
t !== void 0 && n !== void 0 || N(61);
|
|
6451
|
-
const s = Bu || Ts.has(r) || Ss.has(r), o = vn(
|
|
6453
|
+
const s = Bu || Ts.has(r) || Ss.has(r), o = vn(xe, r);
|
|
6452
6454
|
if (t === n && !s) {
|
|
6453
6455
|
if (E(t)) {
|
|
6454
6456
|
const i = o.__lexicalTextContent;
|
|
6455
|
-
i !== void 0 && (
|
|
6457
|
+
i !== void 0 && (ue += i, rt += i);
|
|
6456
6458
|
const u = o.__lexicalDirTextContent;
|
|
6457
|
-
u !== void 0 && (
|
|
6459
|
+
u !== void 0 && (ye += u);
|
|
6458
6460
|
} else {
|
|
6459
6461
|
const i = t.getTextContent();
|
|
6460
|
-
L(t) && !t.isDirectionless() && (
|
|
6462
|
+
L(t) && !t.isDirectionless() && (ye += i), rt += i, ue += i;
|
|
6461
6463
|
}
|
|
6462
6464
|
return o;
|
|
6463
6465
|
}
|
|
@@ -6469,38 +6471,38 @@ function mr(r, e) {
|
|
|
6469
6471
|
const i = n.__indent;
|
|
6470
6472
|
i !== t.__indent && Nu(o, i);
|
|
6471
6473
|
const u = n.__format;
|
|
6472
|
-
u !== t.__format && Fu(o, u), s && (pc(t, n, o),
|
|
6474
|
+
u !== t.__format && Fu(o, u), s && (pc(t, n, o), _e(n) || n.isInline() || Lu(t, n, o)), In(n) && (ue += nt, rt += nt);
|
|
6473
6475
|
} else {
|
|
6474
6476
|
const i = n.getTextContent();
|
|
6475
6477
|
if (Y(n)) {
|
|
6476
|
-
const u = n.decorate(
|
|
6478
|
+
const u = n.decorate(xe, yt);
|
|
6477
6479
|
u !== null && Ou(r, u);
|
|
6478
|
-
} else L(n) && !n.isDirectionless() && (
|
|
6479
|
-
|
|
6480
|
+
} else L(n) && !n.isDirectionless() && (ye += i);
|
|
6481
|
+
ue += i, rt += i;
|
|
6480
6482
|
}
|
|
6481
|
-
if (!Lr &&
|
|
6483
|
+
if (!Lr && _e(n) && n.__cachedText !== rt) {
|
|
6482
6484
|
const i = n.getWritable();
|
|
6483
6485
|
i.__cachedText = rt, n = i;
|
|
6484
6486
|
}
|
|
6485
6487
|
return o;
|
|
6486
6488
|
}
|
|
6487
6489
|
function Ou(r, e) {
|
|
6488
|
-
let t =
|
|
6489
|
-
const n =
|
|
6490
|
+
let t = xe._pendingDecorators;
|
|
6491
|
+
const n = xe._decorators;
|
|
6490
6492
|
if (t === null) {
|
|
6491
6493
|
if (n[r] === e) return;
|
|
6492
|
-
t = wu(
|
|
6494
|
+
t = wu(xe);
|
|
6493
6495
|
}
|
|
6494
6496
|
t[r] = e;
|
|
6495
6497
|
}
|
|
6496
6498
|
function hs(r) {
|
|
6497
6499
|
let e = r.nextSibling;
|
|
6498
|
-
return e !== null && e ===
|
|
6500
|
+
return e !== null && e === xe._blockCursorElement && (e = e.nextSibling), e;
|
|
6499
6501
|
}
|
|
6500
6502
|
function gc(r, e, t, n, s, o) {
|
|
6501
|
-
|
|
6503
|
+
ue = "", rt = "", ye = "", Bu = n === Yt, ln = null, xe = t, yt = t._config, Nr = t._nodes, $n = xe._listeners.mutation, Ss = s, Ts = o, Nt = r._nodeMap, je = e._nodeMap, Lr = e._readOnly, Bs = new Map(t._keyToDOMMap);
|
|
6502
6504
|
const i = /* @__PURE__ */ new Map();
|
|
6503
|
-
return Fr = i, mr("root", null),
|
|
6505
|
+
return Fr = i, mr("root", null), xe = void 0, Nr = void 0, Ss = void 0, Ts = void 0, Nt = void 0, je = void 0, yt = void 0, Bs = void 0, Fr = void 0, i;
|
|
6504
6506
|
}
|
|
6505
6507
|
function Ls(r) {
|
|
6506
6508
|
const e = Bs.get(r);
|
|
@@ -6597,48 +6599,48 @@ const tt = Object.freeze({}), Ps = 30, Os = [["keydown", function(r, e) {
|
|
|
6597
6599
|
}
|
|
6598
6600
|
}], ["pointerdown", function(r, e) {
|
|
6599
6601
|
const t = r.target, n = r.pointerType;
|
|
6600
|
-
t instanceof Node && n !== "touch" &&
|
|
6602
|
+
t instanceof Node && n !== "touch" && Ee(e, () => {
|
|
6601
6603
|
Y(Xt(t)) || (js = !0);
|
|
6602
6604
|
});
|
|
6603
6605
|
}], ["compositionstart", function(r, e) {
|
|
6604
|
-
|
|
6605
|
-
const t =
|
|
6606
|
+
Ee(e, () => {
|
|
6607
|
+
const t = j();
|
|
6606
6608
|
if (B(t) && !e.isComposing()) {
|
|
6607
6609
|
const n = t.anchor, s = t.anchor.getNode();
|
|
6608
|
-
|
|
6610
|
+
he(n.key), (r.timeStamp < wr + Ps || n.type === "element" || !t.isCollapsed() || s.getFormat() !== t.format || L(s) && s.getStyle() !== t.style) && O(e, Gt, qa);
|
|
6609
6611
|
}
|
|
6610
6612
|
});
|
|
6611
6613
|
}], ["compositionend", function(r, e) {
|
|
6612
|
-
mt ? fr = !0 :
|
|
6614
|
+
mt ? fr = !0 : Ee(e, () => {
|
|
6613
6615
|
ps(e, r.data);
|
|
6614
6616
|
});
|
|
6615
6617
|
}], ["input", function(r, e) {
|
|
6616
|
-
r.stopPropagation(),
|
|
6617
|
-
const t =
|
|
6618
|
-
if (n != null && B(t) &&
|
|
6618
|
+
r.stopPropagation(), Ee(e, () => {
|
|
6619
|
+
const t = j(), n = r.data, s = $u(r);
|
|
6620
|
+
if (n != null && B(t) && Mu(t, s, n, r.timeStamp, !1)) {
|
|
6619
6621
|
fr && (ps(e, n), fr = !1);
|
|
6620
|
-
const o = t.anchor.getNode(), i =
|
|
6622
|
+
const o = t.anchor.getNode(), i = Fe(e._window);
|
|
6621
6623
|
if (i === null) return;
|
|
6622
6624
|
const u = t.isBackward(), l = u ? t.anchor.offset : t.focus.offset, a = u ? t.focus.offset : t.anchor.offset;
|
|
6623
6625
|
hn && !t.isCollapsed() && L(o) && i.anchorNode !== null && o.getTextContent().slice(0, l) + n + o.getTextContent().slice(l + a) === ku(i.anchorNode) || O(e, Gt, n);
|
|
6624
6626
|
const c = n.length;
|
|
6625
|
-
mt && c > 1 && r.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= c), Pn || Or || Ys || !e.isComposing() || (wr = 0,
|
|
6627
|
+
mt && c > 1 && r.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= c), Pn || Or || Ys || !e.isComposing() || (wr = 0, he(null));
|
|
6626
6628
|
} else
|
|
6627
6629
|
ai(!1, e, n !== null ? n : void 0), fr && (ps(e, n || void 0), fr = !1);
|
|
6628
|
-
|
|
6630
|
+
De(), yu(te());
|
|
6629
6631
|
}), Wt = null;
|
|
6630
6632
|
}], ["click", function(r, e) {
|
|
6631
|
-
|
|
6632
|
-
const t =
|
|
6633
|
+
Ee(e, () => {
|
|
6634
|
+
const t = j(), n = Fe(e._window), s = zr();
|
|
6633
6635
|
if (n) {
|
|
6634
6636
|
if (B(t)) {
|
|
6635
6637
|
const o = t.anchor, i = o.getNode();
|
|
6636
|
-
o.type === "element" && o.offset === 0 && t.isCollapsed() && !
|
|
6638
|
+
o.type === "element" && o.offset === 0 && t.isCollapsed() && !_e(i) && re().getChildrenSize() === 1 && i.getTopLevelElementOrThrow().isEmpty() && s !== null && t.is(s) ? (n.removeAllRanges(), t.dirty = !0) : r.detail === 3 && !t.isCollapsed() && i !== t.focus.getNode() && (E(i) ? i.select(0) : i.getParentOrThrow().select(0));
|
|
6637
6639
|
} else if (r.pointerType === "touch") {
|
|
6638
6640
|
const o = n.anchorNode;
|
|
6639
6641
|
if (o !== null) {
|
|
6640
6642
|
const i = o.nodeType;
|
|
6641
|
-
(i === Rr || i === _t) &&
|
|
6643
|
+
(i === Rr || i === _t) && Ge(mi(s, n, e, r));
|
|
6642
6644
|
}
|
|
6643
6645
|
}
|
|
6644
6646
|
}
|
|
@@ -6647,27 +6649,27 @@ const tt = Object.freeze({}), Ps = 30, Os = [["keydown", function(r, e) {
|
|
|
6647
6649
|
}], ["cut", tt], ["copy", tt], ["dragstart", tt], ["dragover", tt], ["dragend", tt], ["paste", tt], ["focus", tt], ["blur", tt], ["drop", tt]];
|
|
6648
6650
|
hn && Os.push(["beforeinput", (r, e) => function(t, n) {
|
|
6649
6651
|
const s = t.inputType, o = $u(t);
|
|
6650
|
-
s === "deleteCompositionText" || mt && Su(n) || s !== "insertCompositionText" &&
|
|
6651
|
-
const i =
|
|
6652
|
+
s === "deleteCompositionText" || mt && Su(n) || s !== "insertCompositionText" && Ee(n, () => {
|
|
6653
|
+
const i = j();
|
|
6652
6654
|
if (s === "deleteContentBackward") {
|
|
6653
6655
|
if (i === null) {
|
|
6654
6656
|
const h = zr();
|
|
6655
6657
|
if (!B(h)) return;
|
|
6656
|
-
|
|
6658
|
+
Ge(h.clone());
|
|
6657
6659
|
}
|
|
6658
6660
|
if (B(i)) {
|
|
6659
6661
|
const h = i.anchor.key === i.focus.key;
|
|
6660
6662
|
if (u = t.timeStamp, Ru === "MediaLast" && u < wr + Ps && n.isComposing() && h) {
|
|
6661
|
-
if (
|
|
6662
|
-
|
|
6663
|
-
|
|
6663
|
+
if (he(null), wr = 0, setTimeout(() => {
|
|
6664
|
+
Ee(n, () => {
|
|
6665
|
+
he(null);
|
|
6664
6666
|
});
|
|
6665
6667
|
}, Ps), B(i)) {
|
|
6666
6668
|
const p = i.anchor.getNode();
|
|
6667
6669
|
p.markDirty(), i.format = p.getFormat(), L(p) || N(142), i.style = p.getStyle();
|
|
6668
6670
|
}
|
|
6669
6671
|
} else {
|
|
6670
|
-
|
|
6672
|
+
he(null), t.preventDefault();
|
|
6671
6673
|
const p = i.anchor.getNode(), g = p.getTextContent(), _ = p.canInsertTextAfter(), D = i.anchor.offset === 0 && i.focus.offset === g.length;
|
|
6672
6674
|
Ra && h && !D && _ || O(n, Et, !0);
|
|
6673
6675
|
}
|
|
@@ -6677,7 +6679,7 @@ hn && Os.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6677
6679
|
var u;
|
|
6678
6680
|
if (!B(i)) return;
|
|
6679
6681
|
const l = t.data;
|
|
6680
|
-
Wt !== null && ai(!1, n, Wt), i.dirty && Wt === null || !i.isCollapsed() ||
|
|
6682
|
+
Wt !== null && ai(!1, n, Wt), i.dirty && Wt === null || !i.isCollapsed() || _e(i.anchor.getNode()) || o === null || i.applyDOMRange(o), Wt = null;
|
|
6681
6683
|
const a = i.anchor, c = i.focus, f = a.getNode(), d = c.getNode();
|
|
6682
6684
|
if (s !== "insertText" && s !== "insertTranspose") switch (t.preventDefault(), s) {
|
|
6683
6685
|
case "insertFromYank":
|
|
@@ -6686,13 +6688,13 @@ hn && Os.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6686
6688
|
O(n, Gt, t);
|
|
6687
6689
|
break;
|
|
6688
6690
|
case "insertFromComposition":
|
|
6689
|
-
|
|
6691
|
+
he(null), O(n, Gt, t);
|
|
6690
6692
|
break;
|
|
6691
6693
|
case "insertLineBreak":
|
|
6692
|
-
|
|
6694
|
+
he(null), O(n, Ht, !1);
|
|
6693
6695
|
break;
|
|
6694
6696
|
case "insertParagraph":
|
|
6695
|
-
|
|
6697
|
+
he(null), Cr && !Or ? (Cr = !1, O(n, Ht, !1)) : O(n, kr, void 0);
|
|
6696
6698
|
break;
|
|
6697
6699
|
case "insertFromPaste":
|
|
6698
6700
|
case "insertFromPasteAsQuotation":
|
|
@@ -6750,16 +6752,16 @@ hn && Os.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6750
6752
|
else if (l == null && t.dataTransfer) {
|
|
6751
6753
|
const h = t.dataTransfer.getData("text/plain");
|
|
6752
6754
|
t.preventDefault(), i.insertRawText(h);
|
|
6753
|
-
} else l != null &&
|
|
6755
|
+
} else l != null && Mu(i, o, l, t.timeStamp, !0) ? (t.preventDefault(), O(n, Gt, l)) : Wt = l;
|
|
6754
6756
|
ju = t.timeStamp;
|
|
6755
6757
|
}
|
|
6756
6758
|
});
|
|
6757
6759
|
}(r, e)]);
|
|
6758
6760
|
let wr = 0, Ru = null, ju = 0, Wt = null;
|
|
6759
6761
|
const An = /* @__PURE__ */ new WeakMap();
|
|
6760
|
-
let Rs = !1, js = !1, Cr = !1, fr = !1,
|
|
6761
|
-
function
|
|
6762
|
-
const o = r.anchor, i = r.focus, u = o.getNode(), l = te(), a =
|
|
6762
|
+
let Rs = !1, js = !1, Cr = !1, fr = !1, Iu = [0, "", 0, "root", 0];
|
|
6763
|
+
function Mu(r, e, t, n, s) {
|
|
6764
|
+
const o = r.anchor, i = r.focus, u = o.getNode(), l = te(), a = Fe(l._window), c = a !== null ? a.anchorNode : null, f = o.key, d = l.getElementByKey(f), h = t.length;
|
|
6763
6765
|
return f !== i.key || !L(u) || (!s && (!hn || ju < n + 50) || u.isDirty() && h < 2 || Au(t)) && o.offset !== i.offset && !u.isComposing() || Ct(u) || u.isDirty() && h > 1 || (s || !hn) && d !== null && !u.isComposing() && c !== yn(d) || a !== null && e !== null && (!e.collapsed || e.startContainer !== a.anchorNode || e.startOffset !== a.anchorOffset) || u.getFormat() !== r.format || u.getStyle() !== r.style || sc(r, u);
|
|
6764
6766
|
}
|
|
6765
6767
|
function eo(r, e) {
|
|
@@ -6767,15 +6769,15 @@ function eo(r, e) {
|
|
|
6767
6769
|
}
|
|
6768
6770
|
function to(r, e, t) {
|
|
6769
6771
|
const { anchorNode: n, anchorOffset: s, focusNode: o, focusOffset: i } = r;
|
|
6770
|
-
Rs && (Rs = !1, eo(n, s) && eo(o, i)) ||
|
|
6771
|
-
if (!t) return void
|
|
6772
|
+
Rs && (Rs = !1, eo(n, s) && eo(o, i)) || Ee(e, () => {
|
|
6773
|
+
if (!t) return void Ge(null);
|
|
6772
6774
|
if (!jr(e, n, o)) return;
|
|
6773
|
-
const u =
|
|
6775
|
+
const u = j();
|
|
6774
6776
|
if (B(u)) {
|
|
6775
6777
|
const l = u.anchor, a = l.getNode();
|
|
6776
6778
|
if (u.isCollapsed()) {
|
|
6777
6779
|
r.type === "Range" && r.anchorNode === r.focusNode && (u.dirty = !0);
|
|
6778
|
-
const c =
|
|
6780
|
+
const c = Mn(e).event, f = c ? c.timeStamp : performance.now(), [d, h, p, g, _] = Iu, D = re(), y = e.isComposing() === !1 && D.getTextContent() === "";
|
|
6779
6781
|
if (f < _ + 200 && l.offset === p && l.key === g) u.format = d, u.style = h;
|
|
6780
6782
|
else if (l.type === "text") L(a) || N(141), u.format = a.getFormat(), u.style = a.getStyle();
|
|
6781
6783
|
else if (l.type === "element" && !y) {
|
|
@@ -6802,14 +6804,14 @@ function $u(r) {
|
|
|
6802
6804
|
}
|
|
6803
6805
|
function ps(r, e) {
|
|
6804
6806
|
const t = r._compositionKey;
|
|
6805
|
-
if (
|
|
6807
|
+
if (he(null), t !== null && e != null) {
|
|
6806
6808
|
if (e === "") {
|
|
6807
6809
|
const n = pe(t), s = yn(r.getElementByKey(t));
|
|
6808
6810
|
return void (s !== null && s.nodeValue !== null && L(n) && ci(n, s.nodeValue, null, null, !0));
|
|
6809
6811
|
}
|
|
6810
6812
|
if (e[e.length - 1] === `
|
|
6811
6813
|
`) {
|
|
6812
|
-
const n =
|
|
6814
|
+
const n = j();
|
|
6813
6815
|
if (B(n)) {
|
|
6814
6816
|
const s = n.focus;
|
|
6815
6817
|
return n.anchor.set(s.key, s.offset, s.type), void O(r, fn, null);
|
|
@@ -6824,15 +6826,15 @@ function qu(r) {
|
|
|
6824
6826
|
}
|
|
6825
6827
|
const Jt = /* @__PURE__ */ new Map();
|
|
6826
6828
|
function zu(r) {
|
|
6827
|
-
const e = r.target, t =
|
|
6829
|
+
const e = r.target, t = Fe(e == null ? null : e.nodeType === 9 ? e.defaultView : e.ownerDocument.defaultView);
|
|
6828
6830
|
if (t === null) return;
|
|
6829
6831
|
const n = vu(t.anchorNode);
|
|
6830
6832
|
if (n === null) return;
|
|
6831
|
-
js && (js = !1,
|
|
6833
|
+
js && (js = !1, Ee(n, () => {
|
|
6832
6834
|
const a = zr(), c = t.anchorNode;
|
|
6833
6835
|
if (c === null) return;
|
|
6834
6836
|
const f = c.nodeType;
|
|
6835
|
-
f !== Rr && f !== _t ||
|
|
6837
|
+
f !== Rr && f !== _t || Ge(mi(a, t, n, r));
|
|
6836
6838
|
}));
|
|
6837
6839
|
const s = li(n), o = s[s.length - 1], i = o._key, u = Jt.get(i), l = u || o;
|
|
6838
6840
|
l !== n && to(t, l, !1), to(t, n, !0), n !== o ? Jt.set(i, n) : u && Jt.delete(i);
|
|
@@ -6859,12 +6861,12 @@ function mc(r) {
|
|
|
6859
6861
|
for (let i = 0; i < o.length; i++) o[i]();
|
|
6860
6862
|
r.__lexicalEventHandles = [];
|
|
6861
6863
|
}
|
|
6862
|
-
function
|
|
6863
|
-
|
|
6864
|
+
function Is(r, e, t) {
|
|
6865
|
+
De();
|
|
6864
6866
|
const n = r.__key, s = r.getParent();
|
|
6865
6867
|
if (s === null) return;
|
|
6866
6868
|
const o = function(u) {
|
|
6867
|
-
const l =
|
|
6869
|
+
const l = j();
|
|
6868
6870
|
if (!B(l) || !E(u)) return l;
|
|
6869
6871
|
const { anchor: a, focus: c } = l, f = a.getNode(), d = c.getNode();
|
|
6870
6872
|
return Dr(f, u) && a.set(u.__key, 0, "element"), Dr(d, u) && c.set(u.__key, 0, "element"), l;
|
|
@@ -6873,12 +6875,12 @@ function Ms(r, e, t) {
|
|
|
6873
6875
|
if (B(o) && e) {
|
|
6874
6876
|
const u = o.anchor, l = o.focus;
|
|
6875
6877
|
u.key === n && (kn(u, r, s, r.getPreviousSibling(), r.getNextSibling()), i = !0), l.key === n && (kn(l, r, s, r.getPreviousSibling(), r.getNextSibling()), i = !0);
|
|
6876
|
-
} else
|
|
6878
|
+
} else Ve(o) && e && r.isSelected() && r.selectPrevious();
|
|
6877
6879
|
if (B(o) && e && !i) {
|
|
6878
6880
|
const u = r.getIndexWithinParent();
|
|
6879
6881
|
kt(r), En(o, s, u, -1);
|
|
6880
6882
|
} else kt(r);
|
|
6881
|
-
t ||
|
|
6883
|
+
t || Je(s) || s.canBeEmpty() || !s.isEmpty() || Is(s, e), e && _e(s) && s.isEmpty() && s.selectEnd();
|
|
6882
6884
|
}
|
|
6883
6885
|
class qn {
|
|
6884
6886
|
static getType() {
|
|
@@ -6910,7 +6912,7 @@ class qn {
|
|
|
6910
6912
|
return !1;
|
|
6911
6913
|
}
|
|
6912
6914
|
isSelected(e) {
|
|
6913
|
-
const t = e ||
|
|
6915
|
+
const t = e || j();
|
|
6914
6916
|
if (t == null) return !1;
|
|
6915
6917
|
const n = t.getNodes().some((s) => s.__key === this.__key);
|
|
6916
6918
|
if (L(this)) return n;
|
|
@@ -6949,7 +6951,7 @@ class qn {
|
|
|
6949
6951
|
let e = this;
|
|
6950
6952
|
for (; e !== null; ) {
|
|
6951
6953
|
const t = e.getParent();
|
|
6952
|
-
if (
|
|
6954
|
+
if (Je(t)) return E(e) || e === this && Y(e) || N(194), e;
|
|
6953
6955
|
e = t;
|
|
6954
6956
|
}
|
|
6955
6957
|
return null;
|
|
@@ -7076,8 +7078,8 @@ class qn {
|
|
|
7076
7078
|
return e === null && N(113), e;
|
|
7077
7079
|
}
|
|
7078
7080
|
getWritable() {
|
|
7079
|
-
|
|
7080
|
-
const e = it(), t = te(), n = e._nodeMap, s = this.__key, o = this.getLatest(), i = t._cloneNotNeeded, u =
|
|
7081
|
+
De();
|
|
7082
|
+
const e = it(), t = te(), n = e._nodeMap, s = this.__key, o = this.getLatest(), i = t._cloneNotNeeded, u = j();
|
|
7081
7083
|
if (u !== null && u.setCachedNodes(null), i.has(s)) return xn(o), o;
|
|
7082
7084
|
const l = hi(o);
|
|
7083
7085
|
return i.add(s), xn(l), n.set(s, l), l;
|
|
@@ -7107,27 +7109,27 @@ class qn {
|
|
|
7107
7109
|
return null;
|
|
7108
7110
|
}
|
|
7109
7111
|
remove(e) {
|
|
7110
|
-
|
|
7112
|
+
Is(this, !0, e);
|
|
7111
7113
|
}
|
|
7112
7114
|
replace(e, t) {
|
|
7113
|
-
|
|
7114
|
-
let n =
|
|
7115
|
+
De();
|
|
7116
|
+
let n = j();
|
|
7115
7117
|
n !== null && (n = n.clone()), ds(this, e);
|
|
7116
7118
|
const s = this.getLatest(), o = this.__key, i = e.__key, u = e.getWritable(), l = this.getParentOrThrow().getWritable(), a = l.__size;
|
|
7117
7119
|
kt(u);
|
|
7118
7120
|
const c = s.getPreviousSibling(), f = s.getNextSibling(), d = s.__prev, h = s.__next, p = s.__parent;
|
|
7119
|
-
if (
|
|
7121
|
+
if (Is(s, !1, !0), c === null ? l.__first = i : c.getWritable().__next = i, u.__prev = d, f === null ? l.__last = i : f.getWritable().__prev = i, u.__next = h, u.__parent = p, l.__size = a, t && (E(this) && E(u) || N(139), this.getChildren().forEach((g) => {
|
|
7120
7122
|
u.append(g);
|
|
7121
7123
|
})), B(n)) {
|
|
7122
|
-
|
|
7124
|
+
Ge(n);
|
|
7123
7125
|
const g = n.anchor, _ = n.focus;
|
|
7124
7126
|
g.key === o && uo(g, u), _.key === o && uo(_, u);
|
|
7125
7127
|
}
|
|
7126
|
-
return ht() === o &&
|
|
7128
|
+
return ht() === o && he(i), u;
|
|
7127
7129
|
}
|
|
7128
7130
|
insertAfter(e, t = !0) {
|
|
7129
|
-
|
|
7130
|
-
const n = this.getWritable(), s = e.getWritable(), o = s.getParent(), i =
|
|
7131
|
+
De(), ds(this, e);
|
|
7132
|
+
const n = this.getWritable(), s = e.getWritable(), o = s.getParent(), i = j();
|
|
7131
7133
|
let u = !1, l = !1;
|
|
7132
7134
|
if (o !== null) {
|
|
7133
7135
|
const h = e.getIndexWithinParent();
|
|
@@ -7146,19 +7148,19 @@ class qn {
|
|
|
7146
7148
|
return e;
|
|
7147
7149
|
}
|
|
7148
7150
|
insertBefore(e, t = !0) {
|
|
7149
|
-
|
|
7151
|
+
De(), ds(this, e);
|
|
7150
7152
|
const n = this.getWritable(), s = e.getWritable(), o = s.__key;
|
|
7151
7153
|
kt(s);
|
|
7152
7154
|
const i = this.getPreviousSibling(), u = this.getParentOrThrow().getWritable(), l = n.__prev, a = this.getIndexWithinParent();
|
|
7153
7155
|
i === null ? u.__first = o : i.getWritable().__next = o, u.__size++, n.__prev = o, s.__prev = l, s.__next = n.__key, s.__parent = n.__parent;
|
|
7154
|
-
const c =
|
|
7156
|
+
const c = j();
|
|
7155
7157
|
return t && B(c) && En(c, this.getParentOrThrow(), a), e;
|
|
7156
7158
|
}
|
|
7157
7159
|
isParentRequired() {
|
|
7158
7160
|
return !1;
|
|
7159
7161
|
}
|
|
7160
7162
|
createParentElementNode() {
|
|
7161
|
-
return
|
|
7163
|
+
return le();
|
|
7162
7164
|
}
|
|
7163
7165
|
selectStart() {
|
|
7164
7166
|
return this.selectPrevious();
|
|
@@ -7167,7 +7169,7 @@ class qn {
|
|
|
7167
7169
|
return this.selectNext(0, 0);
|
|
7168
7170
|
}
|
|
7169
7171
|
selectPrevious(e, t) {
|
|
7170
|
-
|
|
7172
|
+
De();
|
|
7171
7173
|
const n = this.getPreviousSibling(), s = this.getParentOrThrow();
|
|
7172
7174
|
if (n === null) return s.select(0, 0);
|
|
7173
7175
|
if (E(n)) return n.select();
|
|
@@ -7178,7 +7180,7 @@ class qn {
|
|
|
7178
7180
|
return n.select(e, t);
|
|
7179
7181
|
}
|
|
7180
7182
|
selectNext(e, t) {
|
|
7181
|
-
|
|
7183
|
+
De();
|
|
7182
7184
|
const n = this.getNextSibling(), s = this.getParentOrThrow();
|
|
7183
7185
|
if (n === null) return s.select();
|
|
7184
7186
|
if (E(n)) return n.select(0, 0);
|
|
@@ -7195,12 +7197,12 @@ class qn {
|
|
|
7195
7197
|
this.markDirty();
|
|
7196
7198
|
}
|
|
7197
7199
|
}
|
|
7198
|
-
class
|
|
7200
|
+
class Mr extends qn {
|
|
7199
7201
|
static getType() {
|
|
7200
7202
|
return "linebreak";
|
|
7201
7203
|
}
|
|
7202
7204
|
static clone(e) {
|
|
7203
|
-
return new
|
|
7205
|
+
return new Mr(e.__key);
|
|
7204
7206
|
}
|
|
7205
7207
|
constructor(e) {
|
|
7206
7208
|
super(e);
|
|
@@ -7248,10 +7250,10 @@ function yc(r) {
|
|
|
7248
7250
|
return { node: Ft() };
|
|
7249
7251
|
}
|
|
7250
7252
|
function Ft() {
|
|
7251
|
-
return
|
|
7253
|
+
return Xe(new Mr());
|
|
7252
7254
|
}
|
|
7253
7255
|
function St(r) {
|
|
7254
|
-
return r instanceof
|
|
7256
|
+
return r instanceof Mr;
|
|
7255
7257
|
}
|
|
7256
7258
|
function tn(r) {
|
|
7257
7259
|
return r.nodeType === _t && /^( |\t|\r?\n)+$/.test(r.textContent || "");
|
|
@@ -7390,7 +7392,7 @@ class tr extends qn {
|
|
|
7390
7392
|
return { "#text": () => ({ conversion: bc, priority: 0 }), b: () => ({ conversion: xc, priority: 0 }), code: () => ({ conversion: ct, priority: 0 }), em: () => ({ conversion: ct, priority: 0 }), i: () => ({ conversion: ct, priority: 0 }), s: () => ({ conversion: ct, priority: 0 }), span: () => ({ conversion: _c, priority: 0 }), strong: () => ({ conversion: ct, priority: 0 }), sub: () => ({ conversion: ct, priority: 0 }), sup: () => ({ conversion: ct, priority: 0 }), u: () => ({ conversion: ct, priority: 0 }) };
|
|
7391
7393
|
}
|
|
7392
7394
|
static importJSON(e) {
|
|
7393
|
-
const t =
|
|
7395
|
+
const t = ce(e.text);
|
|
7394
7396
|
return t.setFormat(e.format), t.setDetail(e.detail), t.setMode(e.mode), t.setStyle(e.style), t;
|
|
7395
7397
|
}
|
|
7396
7398
|
exportDOM(e) {
|
|
@@ -7438,9 +7440,9 @@ class tr extends qn {
|
|
|
7438
7440
|
return t.__text = e, t;
|
|
7439
7441
|
}
|
|
7440
7442
|
select(e, t) {
|
|
7441
|
-
|
|
7443
|
+
De();
|
|
7442
7444
|
let n = e, s = t;
|
|
7443
|
-
const o =
|
|
7445
|
+
const o = j(), i = this.getTextContent(), u = this.__key;
|
|
7444
7446
|
if (typeof i == "string") {
|
|
7445
7447
|
const l = i.length;
|
|
7446
7448
|
n === void 0 && (n = l), s === void 0 && (s = l);
|
|
@@ -7448,7 +7450,7 @@ class tr extends qn {
|
|
|
7448
7450
|
if (!B(o)) return Hu(u, n, u, s, "text", "text");
|
|
7449
7451
|
{
|
|
7450
7452
|
const l = ht();
|
|
7451
|
-
l !== o.anchor.key && l !== o.focus.key ||
|
|
7453
|
+
l !== o.anchor.key && l !== o.focus.key || he(u), o.setTextNodeRange(this, n, this, s);
|
|
7452
7454
|
}
|
|
7453
7455
|
return o;
|
|
7454
7456
|
}
|
|
@@ -7463,7 +7465,7 @@ class tr extends qn {
|
|
|
7463
7465
|
const o = this.getWritable(), i = o.__text, u = n.length;
|
|
7464
7466
|
let l = e;
|
|
7465
7467
|
l < 0 && (l = u + l, l < 0 && (l = 0));
|
|
7466
|
-
const a =
|
|
7468
|
+
const a = j();
|
|
7467
7469
|
if (s && B(a)) {
|
|
7468
7470
|
const f = e + u;
|
|
7469
7471
|
a.setTextNodeRange(o, f, o, f);
|
|
@@ -7478,7 +7480,7 @@ class tr extends qn {
|
|
|
7478
7480
|
return !0;
|
|
7479
7481
|
}
|
|
7480
7482
|
splitText(...e) {
|
|
7481
|
-
|
|
7483
|
+
De();
|
|
7482
7484
|
const t = this.getLatest(), n = t.getTextContent(), s = t.__key, o = ht(), i = new Set(e), u = [], l = n.length;
|
|
7483
7485
|
let a = "";
|
|
7484
7486
|
for (let C = 0; C < l; C++) a !== "" && i.has(C) && (u.push(a), a = ""), a += n[C];
|
|
@@ -7490,18 +7492,18 @@ class tr extends qn {
|
|
|
7490
7492
|
let h;
|
|
7491
7493
|
const p = t.getFormat(), g = t.getStyle(), _ = t.__detail;
|
|
7492
7494
|
let D = !1;
|
|
7493
|
-
t.isSegmented() ? (h =
|
|
7494
|
-
const y =
|
|
7495
|
+
t.isSegmented() ? (h = ce(f), h.__format = p, h.__style = g, h.__detail = _, D = !0) : (h = t.getWritable(), h.__text = f);
|
|
7496
|
+
const y = j(), w = [h];
|
|
7495
7497
|
let x = f.length;
|
|
7496
7498
|
for (let C = 1; C < c; C++) {
|
|
7497
|
-
const b = u[C], k = b.length, A =
|
|
7499
|
+
const b = u[C], k = b.length, A = ce(b).getWritable();
|
|
7498
7500
|
A.__format = p, A.__style = g, A.__detail = _;
|
|
7499
7501
|
const S = A.__key, P = x + k;
|
|
7500
7502
|
if (B(y)) {
|
|
7501
7503
|
const F = y.anchor, U = y.focus;
|
|
7502
7504
|
F.key === s && F.type === "text" && F.offset > x && F.offset <= P && (F.key = S, F.offset -= x, y.dirty = !0), U.key === s && U.type === "text" && U.offset > x && U.offset <= P && (U.key = S, U.offset -= x, y.dirty = !0);
|
|
7503
7505
|
}
|
|
7504
|
-
o === s &&
|
|
7506
|
+
o === s && he(S), x = P, w.push(A);
|
|
7505
7507
|
}
|
|
7506
7508
|
if (d !== null) {
|
|
7507
7509
|
(function(k) {
|
|
@@ -7517,8 +7519,8 @@ class tr extends qn {
|
|
|
7517
7519
|
const t = e === this.getPreviousSibling();
|
|
7518
7520
|
t || e === this.getNextSibling() || N(50);
|
|
7519
7521
|
const n = this.__key, s = e.__key, o = this.__text, i = o.length;
|
|
7520
|
-
ht() === s &&
|
|
7521
|
-
const u =
|
|
7522
|
+
ht() === s && he(n);
|
|
7523
|
+
const u = j();
|
|
7522
7524
|
if (B(u)) {
|
|
7523
7525
|
const f = u.anchor, d = u.focus;
|
|
7524
7526
|
f !== null && f.key === s && (go(f, t, n, e, i), u.dirty = !0), d !== null && d.key === s && (go(d, t, n, e, i), u.dirty = !0);
|
|
@@ -7560,7 +7562,7 @@ function bc(r) {
|
|
|
7560
7562
|
const u = n[i];
|
|
7561
7563
|
u === `
|
|
7562
7564
|
` || u === `\r
|
|
7563
|
-
` ? s.push(Ft()) : u === " " ? s.push(qr()) : u !== "" && s.push(
|
|
7565
|
+
` ? s.push(Ft()) : u === " " ? s.push(qr()) : u !== "" && s.push(ce(u));
|
|
7564
7566
|
}
|
|
7565
7567
|
return { node: s };
|
|
7566
7568
|
}
|
|
@@ -7585,7 +7587,7 @@ function bc(r) {
|
|
|
7585
7587
|
}
|
|
7586
7588
|
s && (t = t.slice(0, t.length - 1));
|
|
7587
7589
|
}
|
|
7588
|
-
return t === "" ? { node: null } : { node:
|
|
7590
|
+
return t === "" ? { node: null } : { node: ce(t) };
|
|
7589
7591
|
}
|
|
7590
7592
|
function oo(r, e) {
|
|
7591
7593
|
let t = r;
|
|
@@ -7611,8 +7613,8 @@ function ct(r) {
|
|
|
7611
7613
|
const e = Dc[r.nodeName.toLowerCase()];
|
|
7612
7614
|
return e === void 0 ? { node: null } : { forChild: gi(r.style, e), node: null };
|
|
7613
7615
|
}
|
|
7614
|
-
function
|
|
7615
|
-
return
|
|
7616
|
+
function ce(r = "") {
|
|
7617
|
+
return Xe(new tr(r));
|
|
7616
7618
|
}
|
|
7617
7619
|
function L(r) {
|
|
7618
7620
|
return r instanceof tr;
|
|
@@ -7661,7 +7663,7 @@ class $r extends tr {
|
|
|
7661
7663
|
}
|
|
7662
7664
|
}
|
|
7663
7665
|
function qr() {
|
|
7664
|
-
return
|
|
7666
|
+
return Xe(new $r());
|
|
7665
7667
|
}
|
|
7666
7668
|
function wc(r) {
|
|
7667
7669
|
return r instanceof $r;
|
|
@@ -7692,10 +7694,10 @@ class Cc {
|
|
|
7692
7694
|
}
|
|
7693
7695
|
set(e, t, n) {
|
|
7694
7696
|
const s = this._selection, o = this.key;
|
|
7695
|
-
this.key = e, this.offset = t, this.type = n, Ur() || (ht() === o &&
|
|
7697
|
+
this.key = e, this.offset = t, this.type = n, Ur() || (ht() === o && he(e), s !== null && (s.setCachedNodes(null), s.dirty = !0));
|
|
7696
7698
|
}
|
|
7697
7699
|
}
|
|
7698
|
-
function
|
|
7700
|
+
function Qe(r, e, t) {
|
|
7699
7701
|
return new Cc(r, e, t);
|
|
7700
7702
|
}
|
|
7701
7703
|
function ys(r, e) {
|
|
@@ -7734,7 +7736,7 @@ class zn {
|
|
|
7734
7736
|
this._cachedNodes = e;
|
|
7735
7737
|
}
|
|
7736
7738
|
is(e) {
|
|
7737
|
-
if (!
|
|
7739
|
+
if (!Ve(e)) return !1;
|
|
7738
7740
|
const t = this._nodes, n = e._nodes;
|
|
7739
7741
|
return t.size === n.size && Array.from(t).every((s) => n.has(s));
|
|
7740
7742
|
}
|
|
@@ -7839,7 +7841,7 @@ class xt {
|
|
|
7839
7841
|
getTextContent() {
|
|
7840
7842
|
const e = this.getNodes();
|
|
7841
7843
|
if (e.length === 0) return "";
|
|
7842
|
-
const t = e[0], n = e[e.length - 1], s = this.anchor, o = this.focus, i = s.isBefore(o), [u, l] =
|
|
7844
|
+
const t = e[0], n = e[e.length - 1], s = this.anchor, o = this.focus, i = s.isBefore(o), [u, l] = Ms(this);
|
|
7843
7845
|
let a = "", c = !0;
|
|
7844
7846
|
for (let f = 0; f < e.length; f++) {
|
|
7845
7847
|
const d = e[f];
|
|
@@ -7860,7 +7862,7 @@ class xt {
|
|
|
7860
7862
|
}
|
|
7861
7863
|
clone() {
|
|
7862
7864
|
const e = this.anchor, t = this.focus;
|
|
7863
|
-
return new xt(
|
|
7865
|
+
return new xt(Qe(e.key, e.offset, e.type), Qe(t.key, t.offset, t.type), this.format, this.style);
|
|
7864
7866
|
}
|
|
7865
7867
|
toggleFormat(e) {
|
|
7866
7868
|
this.format = _n(this.format, e, null), this.dirty = !0;
|
|
@@ -7878,7 +7880,7 @@ class xt {
|
|
|
7878
7880
|
const i = t[o];
|
|
7879
7881
|
i === `
|
|
7880
7882
|
` || i === `\r
|
|
7881
|
-
` ? n.push(Ft()) : i === " " ? n.push(qr()) : n.push(
|
|
7883
|
+
` ? n.push(Ft()) : i === " " ? n.push(qr()) : n.push(ce(i));
|
|
7882
7884
|
}
|
|
7883
7885
|
this.insertNodes(n);
|
|
7884
7886
|
}
|
|
@@ -7886,7 +7888,7 @@ class xt {
|
|
|
7886
7888
|
const t = this.anchor, n = this.focus, s = this.format, o = this.style;
|
|
7887
7889
|
let i = t, u = n;
|
|
7888
7890
|
!this.isCollapsed() && n.isBefore(t) && (i = n, u = t), i.type === "element" && function(_, D, y, w) {
|
|
7889
|
-
const x = _.getNode(), C = x.getChildAtIndex(_.offset), b =
|
|
7891
|
+
const x = _.getNode(), C = x.getChildAtIndex(_.offset), b = ce(), k = _e(x) ? le().append(b) : b;
|
|
7890
7892
|
b.setFormat(y), b.setStyle(w), C === null ? x.append(k) : C.insertBefore(k), _.is(D) && D.set(b.__key, 0, "text"), _.set(b.__key, 0, "text");
|
|
7891
7893
|
}(i, u, s, o);
|
|
7892
7894
|
const l = i.offset;
|
|
@@ -7898,12 +7900,12 @@ class xt {
|
|
|
7898
7900
|
let g = c[f - 1];
|
|
7899
7901
|
if (f === 1 && u.type === "element" && (a = h, u.set(i.key, a, "text")), this.isCollapsed() && l === h && (d.isSegmented() || d.isToken() || !d.canInsertTextAfter() || !p.canInsertTextAfter() && d.getNextSibling() === null)) {
|
|
7900
7902
|
let _ = d.getNextSibling();
|
|
7901
|
-
if (L(_) && _.canInsertTextBefore() && !Ct(_) || (_ =
|
|
7903
|
+
if (L(_) && _.canInsertTextBefore() && !Ct(_) || (_ = ce(), _.setFormat(s), _.setStyle(o), p.canInsertTextAfter() ? d.insertAfter(_) : p.insertAfter(_)), _.select(0, 0), d = _, e !== "") return void this.insertText(e);
|
|
7902
7904
|
} else if (this.isCollapsed() && l === 0 && (d.isSegmented() || d.isToken() || !d.canInsertTextBefore() || !p.canInsertTextBefore() && d.getPreviousSibling() === null)) {
|
|
7903
7905
|
let _ = d.getPreviousSibling();
|
|
7904
|
-
if (L(_) && !Ct(_) || (_ =
|
|
7906
|
+
if (L(_) && !Ct(_) || (_ = ce(), _.setFormat(s), p.canInsertTextBefore() ? d.insertBefore(_) : p.insertBefore(_)), _.select(), d = _, e !== "") return void this.insertText(e);
|
|
7905
7907
|
} else if (d.isSegmented() && l !== h) {
|
|
7906
|
-
const _ =
|
|
7908
|
+
const _ = ce(d.getTextContent());
|
|
7907
7909
|
_.setFormat(s), d.replace(_), d = _;
|
|
7908
7910
|
} else if (!this.isCollapsed() && e !== "") {
|
|
7909
7911
|
const _ = g.getParent();
|
|
@@ -7911,18 +7913,18 @@ class xt {
|
|
|
7911
7913
|
}
|
|
7912
7914
|
if (f === 1) {
|
|
7913
7915
|
if (d.isToken()) {
|
|
7914
|
-
const w =
|
|
7916
|
+
const w = ce(e);
|
|
7915
7917
|
return w.select(), void d.replace(w);
|
|
7916
7918
|
}
|
|
7917
7919
|
const _ = d.getFormat(), D = d.getStyle();
|
|
7918
7920
|
if (l !== a || _ === s && D === o) {
|
|
7919
7921
|
if (wc(d)) {
|
|
7920
|
-
const w =
|
|
7922
|
+
const w = ce(e);
|
|
7921
7923
|
return w.setFormat(s), w.setStyle(o), w.select(), void d.replace(w);
|
|
7922
7924
|
}
|
|
7923
7925
|
} else {
|
|
7924
7926
|
if (d.getTextContent() !== "") {
|
|
7925
|
-
const w =
|
|
7927
|
+
const w = ce(e);
|
|
7926
7928
|
if (w.setFormat(s), w.setStyle(o), w.select(), l === 0) d.insertBefore(w, !1);
|
|
7927
7929
|
else {
|
|
7928
7930
|
const [x] = d.splitText(l);
|
|
@@ -7942,10 +7944,10 @@ class xt {
|
|
|
7942
7944
|
while (y.isInline());
|
|
7943
7945
|
if (u.type === "text" && (a !== 0 || g.getTextContent() === "") || u.type === "element" && g.getIndexWithinParent() < a) if (L(g) && !g.isToken() && a !== g.getTextContentSize()) {
|
|
7944
7946
|
if (g.isSegmented()) {
|
|
7945
|
-
const A =
|
|
7947
|
+
const A = ce(g.getTextContent());
|
|
7946
7948
|
g.replace(A), g = A;
|
|
7947
7949
|
}
|
|
7948
|
-
|
|
7950
|
+
_e(u.getNode()) || u.type !== "text" || (g = g.spliceText(0, a, "")), _.add(g.__key);
|
|
7949
7951
|
} else {
|
|
7950
7952
|
const A = g.getParentOrThrow();
|
|
7951
7953
|
A.canBeEmpty() || A.getChildrenSize() !== 1 ? g.remove() : A.remove();
|
|
@@ -7966,7 +7968,7 @@ class xt {
|
|
|
7966
7968
|
}
|
|
7967
7969
|
if (d.isToken()) if (l === h) d.select();
|
|
7968
7970
|
else {
|
|
7969
|
-
const A =
|
|
7971
|
+
const A = ce(e);
|
|
7970
7972
|
A.select(), d.replace(A);
|
|
7971
7973
|
}
|
|
7972
7974
|
else d = d.spliceText(l, h - l, e, !0), d.getTextContent() === "" ? d.remove() : d.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length);
|
|
@@ -7987,7 +7989,7 @@ class xt {
|
|
|
7987
7989
|
const c = (f, d) => {
|
|
7988
7990
|
if (f.getTextContent() === "") f.remove();
|
|
7989
7991
|
else if (d !== 0 && Ct(f)) {
|
|
7990
|
-
const h =
|
|
7992
|
+
const h = ce(f.getTextContent());
|
|
7991
7993
|
return h.setFormat(f.getFormat()), h.setStyle(f.getStyle()), f.replace(h);
|
|
7992
7994
|
}
|
|
7993
7995
|
};
|
|
@@ -8002,7 +8004,7 @@ class xt {
|
|
|
8002
8004
|
L(u) && (u.spliceText(0, o.offset, ""), u = c(u, o.offset) || u), i.isAttached() && L(i) ? i.selectEnd() : u.isAttached() && L(u) && u.selectStart(), E(l) && E(a) && l !== a && (l.append(...a.getChildren()), a.remove(), o.set(s.key, s.offset, s.type));
|
|
8003
8005
|
}
|
|
8004
8006
|
formatText(e, t = null) {
|
|
8005
|
-
if (this.isCollapsed()) return this.toggleFormat(e), void
|
|
8007
|
+
if (this.isCollapsed()) return this.toggleFormat(e), void he(null);
|
|
8006
8008
|
const n = this.getNodes(), s = [];
|
|
8007
8009
|
for (const x of n) L(x) && s.push(x);
|
|
8008
8010
|
const o = (x) => {
|
|
@@ -8013,7 +8015,7 @@ class xt {
|
|
|
8013
8015
|
}
|
|
8014
8016
|
});
|
|
8015
8017
|
}, i = s.length;
|
|
8016
|
-
if (i === 0) return this.toggleFormat(e),
|
|
8018
|
+
if (i === 0) return this.toggleFormat(e), he(null), void o(t);
|
|
8017
8019
|
const u = this.anchor, l = this.focus, a = this.isBackward(), c = a ? l : u, f = a ? u : l;
|
|
8018
8020
|
let d = 0, h = s[0], p = c.type === "element" ? 0 : c.offset;
|
|
8019
8021
|
if (c.type === "text" && p === h.getTextContentSize() && (d = 1, h = s[1], p = 0), h == null) return;
|
|
@@ -8044,7 +8046,7 @@ class xt {
|
|
|
8044
8046
|
if (e.length === 0) return;
|
|
8045
8047
|
if (this.anchor.key === "root") {
|
|
8046
8048
|
this.insertParagraph();
|
|
8047
|
-
const p =
|
|
8049
|
+
const p = j();
|
|
8048
8050
|
return B(p) || N(134), p.insertNodes(e);
|
|
8049
8051
|
}
|
|
8050
8052
|
const t = (this.isBackward() ? this.focus : this.anchor).getNode(), n = dr(t, dt), s = e[e.length - 1];
|
|
@@ -8062,7 +8064,7 @@ class xt {
|
|
|
8062
8064
|
return n.splice(p, 0, e), void s.selectEnd();
|
|
8063
8065
|
}
|
|
8064
8066
|
const o = function(p) {
|
|
8065
|
-
const g =
|
|
8067
|
+
const g = le();
|
|
8066
8068
|
let _ = null;
|
|
8067
8069
|
for (let D = 0; D < p.length; D++) {
|
|
8068
8070
|
const y = p[D], w = St(y);
|
|
@@ -8090,7 +8092,7 @@ class xt {
|
|
|
8090
8092
|
}
|
|
8091
8093
|
insertParagraph() {
|
|
8092
8094
|
if (this.anchor.key === "root") {
|
|
8093
|
-
const i =
|
|
8095
|
+
const i = le();
|
|
8094
8096
|
return re().splice(this.anchor.offset, 0, [i]), i.select(), i;
|
|
8095
8097
|
}
|
|
8096
8098
|
const e = _s(this), t = dr(this.anchor.getNode(), dt);
|
|
@@ -8108,7 +8110,7 @@ class xt {
|
|
|
8108
8110
|
extract() {
|
|
8109
8111
|
const e = this.getNodes(), t = e.length, n = t - 1, s = this.anchor, o = this.focus;
|
|
8110
8112
|
let i = e[0], u = e[n];
|
|
8111
|
-
const [l, a] =
|
|
8113
|
+
const [l, a] = Ms(this);
|
|
8112
8114
|
if (t === 0) return [];
|
|
8113
8115
|
if (t === 1) {
|
|
8114
8116
|
if (L(i) && !this.isCollapsed()) {
|
|
@@ -8133,7 +8135,7 @@ class xt {
|
|
|
8133
8135
|
if (Y(u) && !u.isIsolated()) {
|
|
8134
8136
|
if (i && u.isKeyboardSelectable()) {
|
|
8135
8137
|
const h = ho();
|
|
8136
|
-
return h.add(u.__key), void
|
|
8138
|
+
return h.add(u.__key), void Ge(h);
|
|
8137
8139
|
}
|
|
8138
8140
|
const d = t ? u.getPreviousSibling() : u.getNextSibling();
|
|
8139
8141
|
if (L(d)) {
|
|
@@ -8146,13 +8148,13 @@ class xt {
|
|
|
8146
8148
|
return E(d) ? (g = d.__key, p = t ? d.getChildrenSize() : 0) : (p = u.getIndexWithinParent(), g = h.__key, t || p++), s.set(g, p, "element"), void (i && o.set(g, p, "element"));
|
|
8147
8149
|
}
|
|
8148
8150
|
}
|
|
8149
|
-
const l = te(), a =
|
|
8151
|
+
const l = te(), a = Fe(l._window);
|
|
8150
8152
|
if (!a) return;
|
|
8151
8153
|
const c = l._blockCursorElement, f = l._rootElement;
|
|
8152
8154
|
if (f === null || c === null || !E(u) || u.isInline() || u.canBeEmpty() || fi(c, l, f), function(d, h, p, g) {
|
|
8153
8155
|
d.modify(h, p, g);
|
|
8154
8156
|
}(a, e, t ? "backward" : "forward", n), a.rangeCount > 0) {
|
|
8155
|
-
const d = a.getRangeAt(0), h = this.anchor.getNode(), p =
|
|
8157
|
+
const d = a.getRangeAt(0), h = this.anchor.getNode(), p = _e(h) ? h : oc(h);
|
|
8156
8158
|
if (this.applyDOMRange(d), this.dirty = !0, !i) {
|
|
8157
8159
|
const g = this.getNodes(), _ = [];
|
|
8158
8160
|
let D = !1;
|
|
@@ -8192,7 +8194,7 @@ class xt {
|
|
|
8192
8194
|
if (i.isKeyboardSelectable() && E(s) && s.getChildrenSize() === 0) {
|
|
8193
8195
|
s.remove();
|
|
8194
8196
|
const u = ho();
|
|
8195
|
-
u.add(i.__key),
|
|
8197
|
+
u.add(i.__key), Ge(u);
|
|
8196
8198
|
} else
|
|
8197
8199
|
i.remove(), te().dispatchCommand(Hs, void 0);
|
|
8198
8200
|
return;
|
|
@@ -8221,7 +8223,7 @@ class xt {
|
|
|
8221
8223
|
}
|
|
8222
8224
|
if (this.removeText(), e && !t && this.isCollapsed() && this.anchor.type === "element" && this.anchor.offset === 0) {
|
|
8223
8225
|
const n = this.anchor.getNode();
|
|
8224
|
-
n.isEmpty() &&
|
|
8226
|
+
n.isEmpty() && _e(n.getParent()) && n.getIndexWithinParent() === 0 && n.collapseAtStart(this);
|
|
8225
8227
|
}
|
|
8226
8228
|
}
|
|
8227
8229
|
deleteLine(e) {
|
|
@@ -8249,7 +8251,7 @@ class xt {
|
|
|
8249
8251
|
return [this.anchor, this.focus];
|
|
8250
8252
|
}
|
|
8251
8253
|
}
|
|
8252
|
-
function
|
|
8254
|
+
function Ve(r) {
|
|
8253
8255
|
return r instanceof zn;
|
|
8254
8256
|
}
|
|
8255
8257
|
function lo(r) {
|
|
@@ -8258,7 +8260,7 @@ function lo(r) {
|
|
|
8258
8260
|
const t = r.getNode();
|
|
8259
8261
|
return e === t.getChildrenSize() ? t.getTextContent().length : 0;
|
|
8260
8262
|
}
|
|
8261
|
-
function
|
|
8263
|
+
function Ms(r) {
|
|
8262
8264
|
const e = r.getStartEndPoints();
|
|
8263
8265
|
if (e === null) return [0, 0];
|
|
8264
8266
|
const [t, n] = e;
|
|
@@ -8309,10 +8311,10 @@ function co(r, e, t, n) {
|
|
|
8309
8311
|
const h = d.getIndexWithinParent();
|
|
8310
8312
|
o = e === 0 && Y(d) && Vt(r) === d ? h : h + 1, d = d.getParentOrThrow();
|
|
8311
8313
|
}
|
|
8312
|
-
if (E(d)) return
|
|
8314
|
+
if (E(d)) return Qe(d.__key, o, "element");
|
|
8313
8315
|
}
|
|
8314
8316
|
} else s = Vt(r);
|
|
8315
|
-
return L(s) ?
|
|
8317
|
+
return L(s) ? Qe(s.__key, o, "text") : null;
|
|
8316
8318
|
}
|
|
8317
8319
|
function fo(r, e, t) {
|
|
8318
8320
|
const n = r.offset, s = r.getNode();
|
|
@@ -8360,11 +8362,11 @@ function $s(r) {
|
|
|
8360
8362
|
return E(r) && !r.isInline();
|
|
8361
8363
|
}
|
|
8362
8364
|
function Hu(r, e, t, n, s, o) {
|
|
8363
|
-
const i = it(), u = new xt(
|
|
8365
|
+
const i = it(), u = new xt(Qe(r, e, s), Qe(t, n, o), 0, "");
|
|
8364
8366
|
return u.dirty = !0, i._selection = u, u;
|
|
8365
8367
|
}
|
|
8366
8368
|
function Ac() {
|
|
8367
|
-
const r =
|
|
8369
|
+
const r = Qe("root", 0, "element"), e = Qe("root", 0, "element");
|
|
8368
8370
|
return new xt(r, e, 0, "");
|
|
8369
8371
|
}
|
|
8370
8372
|
function ho() {
|
|
@@ -8383,7 +8385,7 @@ function mi(r, e, t, n) {
|
|
|
8383
8385
|
const [p, g] = h;
|
|
8384
8386
|
return new xt(p, g, B(r) ? r.format : 0, B(r) ? r.style : "");
|
|
8385
8387
|
}
|
|
8386
|
-
function
|
|
8388
|
+
function j() {
|
|
8387
8389
|
return it()._selection;
|
|
8388
8390
|
}
|
|
8389
8391
|
function zr() {
|
|
@@ -8457,7 +8459,7 @@ function Ec(r, e, t, n, s, o, i) {
|
|
|
8457
8459
|
S = W.getFormat() !== x || W.getStyle() !== C;
|
|
8458
8460
|
} else B(r) && r.anchor.type === "text" && (S = !0);
|
|
8459
8461
|
var P, F, U, $, I;
|
|
8460
|
-
if (h.type === "text" && (A = yn(D)), k !== null && A !== null && (b && (r === null || S || B(r) && (r.format !== x || r.style !== C)) && (P = x, F = C, U = y, $ = p, I = performance.now(),
|
|
8462
|
+
if (h.type === "text" && (A = yn(D)), k !== null && A !== null && (b && (r === null || S || B(r) && (r.format !== x || r.style !== C)) && (P = x, F = C, U = y, $ = p, I = performance.now(), Iu = [P, F, U, $, I]), a !== y || c !== w || u !== k || l !== A || n.type === "Range" && b || (f !== null && o.contains(f) || o.focus({ preventScroll: !0 }), d.type === "element"))) {
|
|
8461
8463
|
try {
|
|
8462
8464
|
n.setBaseAndExtent(k, y, A, w);
|
|
8463
8465
|
} catch {
|
|
@@ -8467,30 +8469,30 @@ function Ec(r, e, t, n, s, o, i) {
|
|
|
8467
8469
|
if (W !== null) {
|
|
8468
8470
|
let ne;
|
|
8469
8471
|
if (W instanceof Text) {
|
|
8470
|
-
const
|
|
8471
|
-
|
|
8472
|
+
const Se = document.createRange();
|
|
8473
|
+
Se.selectNode(W), ne = Se.getBoundingClientRect();
|
|
8472
8474
|
} else ne = W.getBoundingClientRect();
|
|
8473
|
-
(function(
|
|
8474
|
-
const ut = vt.ownerDocument,
|
|
8475
|
-
if (
|
|
8476
|
-
let { top:
|
|
8477
|
-
for (;
|
|
8478
|
-
const
|
|
8479
|
-
if (
|
|
8475
|
+
(function(Se, Me, vt) {
|
|
8476
|
+
const ut = vt.ownerDocument, ae = ut.defaultView;
|
|
8477
|
+
if (ae === null) return;
|
|
8478
|
+
let { top: $e, bottom: qe } = Me, lt = 0, at = 0, ve = vt;
|
|
8479
|
+
for (; ve !== null; ) {
|
|
8480
|
+
const Ze = ve === ut.body;
|
|
8481
|
+
if (Ze) lt = 0, at = Mn(Se).innerHeight;
|
|
8480
8482
|
else {
|
|
8481
|
-
const
|
|
8482
|
-
lt =
|
|
8483
|
+
const ze = ve.getBoundingClientRect();
|
|
8484
|
+
lt = ze.top, at = ze.bottom;
|
|
8483
8485
|
}
|
|
8484
|
-
let
|
|
8485
|
-
if (
|
|
8486
|
+
let Te = 0;
|
|
8487
|
+
if ($e < lt ? Te = -(lt - $e) : qe > at && (Te = qe - at), Te !== 0) if (Ze) ae.scrollBy(0, Te);
|
|
8486
8488
|
else {
|
|
8487
|
-
const
|
|
8488
|
-
|
|
8489
|
-
const
|
|
8490
|
-
|
|
8489
|
+
const ze = ve.scrollTop;
|
|
8490
|
+
ve.scrollTop += Te;
|
|
8491
|
+
const et = ve.scrollTop - ze;
|
|
8492
|
+
$e -= et, qe -= et;
|
|
8491
8493
|
}
|
|
8492
|
-
if (
|
|
8493
|
-
|
|
8494
|
+
if (Ze) break;
|
|
8495
|
+
ve = Ir(ve);
|
|
8494
8496
|
}
|
|
8495
8497
|
})(t, ne, o);
|
|
8496
8498
|
}
|
|
@@ -8499,13 +8501,13 @@ function Ec(r, e, t, n, s, o, i) {
|
|
|
8499
8501
|
}
|
|
8500
8502
|
}
|
|
8501
8503
|
function kc(r) {
|
|
8502
|
-
let e =
|
|
8504
|
+
let e = j() || zr();
|
|
8503
8505
|
e === null && (e = re().selectEnd()), e.insertNodes(r);
|
|
8504
8506
|
}
|
|
8505
8507
|
function _s(r) {
|
|
8506
8508
|
let e = r;
|
|
8507
8509
|
r.isCollapsed() || e.removeText();
|
|
8508
|
-
const t =
|
|
8510
|
+
const t = j();
|
|
8509
8511
|
B(t) && (e = t), B(e) || N(161);
|
|
8510
8512
|
const n = e.anchor;
|
|
8511
8513
|
let s = n.getNode(), o = n.offset;
|
|
@@ -8515,7 +8517,7 @@ function _s(r) {
|
|
|
8515
8517
|
function Sc(r, e) {
|
|
8516
8518
|
const t = r.getParent();
|
|
8517
8519
|
if (!t) {
|
|
8518
|
-
const s =
|
|
8520
|
+
const s = le();
|
|
8519
8521
|
return re().append(s), s.select(), [re(), 0];
|
|
8520
8522
|
}
|
|
8521
8523
|
if (L(r)) {
|
|
@@ -8527,27 +8529,27 @@ function Sc(r, e) {
|
|
|
8527
8529
|
if (!E(r) || e === 0) return [t, r.getIndexWithinParent()];
|
|
8528
8530
|
const n = r.getChildAtIndex(e);
|
|
8529
8531
|
if (n) {
|
|
8530
|
-
const s = new xt(
|
|
8532
|
+
const s = new xt(Qe(r.__key, e, "element"), Qe(r.__key, e, "element"), 0, ""), o = r.insertNewAfter(s);
|
|
8531
8533
|
o && o.append(n, ...n.getNextSiblings());
|
|
8532
8534
|
}
|
|
8533
8535
|
return [t, r.getIndexWithinParent() + 1];
|
|
8534
8536
|
}
|
|
8535
|
-
let
|
|
8537
|
+
let de = null, fe = null, we = !1, xs = !1, an = 0;
|
|
8536
8538
|
const mo = { characterData: !0, childList: !0, subtree: !0 };
|
|
8537
8539
|
function Ur() {
|
|
8538
|
-
return
|
|
8540
|
+
return we || de !== null && de._readOnly;
|
|
8539
8541
|
}
|
|
8540
|
-
function
|
|
8541
|
-
|
|
8542
|
+
function De() {
|
|
8543
|
+
we && N(13);
|
|
8542
8544
|
}
|
|
8543
8545
|
function Gu() {
|
|
8544
8546
|
an > 99 && N(14);
|
|
8545
8547
|
}
|
|
8546
8548
|
function it() {
|
|
8547
|
-
return
|
|
8549
|
+
return de === null && N(195, Ju()), de;
|
|
8548
8550
|
}
|
|
8549
8551
|
function te() {
|
|
8550
|
-
return
|
|
8552
|
+
return fe === null && N(196, Ju()), fe;
|
|
8551
8553
|
}
|
|
8552
8554
|
function Ju() {
|
|
8553
8555
|
let r = 0;
|
|
@@ -8564,7 +8566,7 @@ function Ju() {
|
|
|
8564
8566
|
return e.size && (n += ` and incompatible editors with versions ${Array.from(e).join(", ")}`), n;
|
|
8565
8567
|
}
|
|
8566
8568
|
function Tc() {
|
|
8567
|
-
return
|
|
8569
|
+
return fe;
|
|
8568
8570
|
}
|
|
8569
8571
|
function yo(r, e, t) {
|
|
8570
8572
|
const n = e.__type, s = function(u, l) {
|
|
@@ -8602,21 +8604,21 @@ function yi(r, e) {
|
|
|
8602
8604
|
return o;
|
|
8603
8605
|
}
|
|
8604
8606
|
function xo(r, e, t) {
|
|
8605
|
-
const n =
|
|
8606
|
-
|
|
8607
|
+
const n = de, s = we, o = fe;
|
|
8608
|
+
de = e, we = !0, fe = r;
|
|
8607
8609
|
try {
|
|
8608
8610
|
return t();
|
|
8609
8611
|
} finally {
|
|
8610
|
-
|
|
8612
|
+
de = n, we = s, fe = o;
|
|
8611
8613
|
}
|
|
8612
8614
|
}
|
|
8613
8615
|
function pt(r, e) {
|
|
8614
8616
|
const t = r._pendingEditorState, n = r._rootElement, s = r._headless || n === null;
|
|
8615
8617
|
if (t === null) return;
|
|
8616
|
-
const o = r._editorState, i = o._selection, u = t._selection, l = r._dirtyType !== Tt, a =
|
|
8618
|
+
const o = r._editorState, i = o._selection, u = t._selection, l = r._dirtyType !== Tt, a = de, c = we, f = fe, d = r._updating, h = r._observer;
|
|
8617
8619
|
let p = null;
|
|
8618
8620
|
if (r._pendingEditorState = null, r._editorState = t, !s && l && h !== null) {
|
|
8619
|
-
|
|
8621
|
+
fe = r, de = t, we = !1, r._updating = !0;
|
|
8620
8622
|
try {
|
|
8621
8623
|
const b = r._dirtyType, k = r._dirtyElements, A = r._dirtyLeaves;
|
|
8622
8624
|
h.disconnect(), p = gc(o, t, r, b, k, A);
|
|
@@ -8624,7 +8626,7 @@ function pt(r, e) {
|
|
|
8624
8626
|
if (b instanceof Error && r._onError(b), xs) throw b;
|
|
8625
8627
|
return tl(r, null, n, t), _u(r), r._dirtyType = Yt, xs = !0, pt(r, o), void (xs = !1);
|
|
8626
8628
|
} finally {
|
|
8627
|
-
h.observe(n, mo), r._updating = d,
|
|
8629
|
+
h.observe(n, mo), r._updating = d, de = a, we = c, fe = f;
|
|
8628
8630
|
}
|
|
8629
8631
|
}
|
|
8630
8632
|
t._readOnly || (t._readOnly = !0);
|
|
@@ -8636,9 +8638,9 @@ function pt(r, e) {
|
|
|
8636
8638
|
let F;
|
|
8637
8639
|
for (F in S) P.has(F) || (S === A && (S = wu(b)), delete S[F]);
|
|
8638
8640
|
}(r, t);
|
|
8639
|
-
const x = s ? null :
|
|
8641
|
+
const x = s ? null : Fe(r._window);
|
|
8640
8642
|
if (r._editable && x !== null && (l || u === null || u.dirty)) {
|
|
8641
|
-
|
|
8643
|
+
fe = r, de = t;
|
|
8642
8644
|
try {
|
|
8643
8645
|
if (h !== null && h.disconnect(), l || u === null || u.dirty) {
|
|
8644
8646
|
const b = r._blockCursorElement;
|
|
@@ -8646,7 +8648,7 @@ function pt(r, e) {
|
|
|
8646
8648
|
}
|
|
8647
8649
|
uc(r, n, u), h !== null && h.observe(n, mo);
|
|
8648
8650
|
} finally {
|
|
8649
|
-
|
|
8651
|
+
fe = f, de = a;
|
|
8650
8652
|
}
|
|
8651
8653
|
}
|
|
8652
8654
|
p !== null && function(b, k, A, S, P) {
|
|
@@ -8692,7 +8694,7 @@ function Ar(r, e, t, ...n) {
|
|
|
8692
8694
|
}
|
|
8693
8695
|
}
|
|
8694
8696
|
function Yu(r, e, t) {
|
|
8695
|
-
if (r._updating === !1 ||
|
|
8697
|
+
if (r._updating === !1 || fe !== r) {
|
|
8696
8698
|
let s = !1;
|
|
8697
8699
|
return r.update(() => {
|
|
8698
8700
|
s = Yu(r, e, t);
|
|
@@ -8738,11 +8740,11 @@ function Xu(r, e, t) {
|
|
|
8738
8740
|
const u = r._editorState;
|
|
8739
8741
|
let l = r._pendingEditorState, a = !1;
|
|
8740
8742
|
(l === null || l._readOnly) && (l = r._pendingEditorState = Zu(l || u), a = !0), l._flushSync = i;
|
|
8741
|
-
const c =
|
|
8742
|
-
|
|
8743
|
+
const c = de, f = we, d = fe, h = r._updating;
|
|
8744
|
+
de = l, we = !1, r._updating = !0, fe = r;
|
|
8743
8745
|
try {
|
|
8744
8746
|
a && (r._headless ? u._selection !== null && (l._selection = u._selection.clone()) : l._selection = function(D) {
|
|
8745
|
-
const y = D.getEditorState()._selection, w =
|
|
8747
|
+
const y = D.getEditorState()._selection, w = Fe(D._window);
|
|
8746
8748
|
return B(y) || y == null ? mi(y, w, D, null) : y.clone();
|
|
8747
8749
|
}(r));
|
|
8748
8750
|
const g = r._compositionKey;
|
|
@@ -8803,11 +8805,11 @@ function Xu(r, e, t) {
|
|
|
8803
8805
|
if (B(_)) {
|
|
8804
8806
|
const D = l._nodeMap, y = _.anchor.key, w = _.focus.key;
|
|
8805
8807
|
D.get(y) !== void 0 && D.get(w) !== void 0 || N(19);
|
|
8806
|
-
} else
|
|
8808
|
+
} else Ve(_) && _._nodes.size === 0 && (l._selection = null);
|
|
8807
8809
|
} catch (g) {
|
|
8808
8810
|
return g instanceof Error && r._onError(g), r._pendingEditorState = u, r._dirtyType = Yt, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements.clear(), void pt(r);
|
|
8809
8811
|
} finally {
|
|
8810
|
-
|
|
8812
|
+
de = c, we = f, fe = d, r._updating = h, an = 0;
|
|
8811
8813
|
}
|
|
8812
8814
|
r._dirtyType !== Tt || function(g, _) {
|
|
8813
8815
|
const D = _.getEditorState()._selection, y = g._selection;
|
|
@@ -8819,7 +8821,7 @@ function Xu(r, e, t) {
|
|
|
8819
8821
|
pt(r);
|
|
8820
8822
|
}) : (l._flushSync = !1, a && (n.clear(), r._deferred = [], r._pendingEditorState = null));
|
|
8821
8823
|
}
|
|
8822
|
-
function
|
|
8824
|
+
function Ee(r, e, t) {
|
|
8823
8825
|
r._updating ? r._updates.push([e, t]) : Xu(r, e, t);
|
|
8824
8826
|
}
|
|
8825
8827
|
class Er {
|
|
@@ -9053,14 +9055,14 @@ class ot extends qn {
|
|
|
9053
9055
|
}
|
|
9054
9056
|
hasFormat(e) {
|
|
9055
9057
|
if (e !== "") {
|
|
9056
|
-
const t =
|
|
9058
|
+
const t = Mi[e];
|
|
9057
9059
|
return !!(this.getFormat() & t);
|
|
9058
9060
|
}
|
|
9059
9061
|
return !1;
|
|
9060
9062
|
}
|
|
9061
9063
|
select(e, t) {
|
|
9062
|
-
|
|
9063
|
-
const n =
|
|
9064
|
+
De();
|
|
9065
|
+
const n = j();
|
|
9064
9066
|
let s = e, o = t;
|
|
9065
9067
|
const i = this.getChildrenSize();
|
|
9066
9068
|
if (!this.canBeEmpty()) {
|
|
@@ -9096,7 +9098,7 @@ class ot extends qn {
|
|
|
9096
9098
|
return t.__dir = e, t;
|
|
9097
9099
|
}
|
|
9098
9100
|
setFormat(e) {
|
|
9099
|
-
return this.getWritable().__format = e !== "" ?
|
|
9101
|
+
return this.getWritable().__format = e !== "" ? Mi[e] : 0, this;
|
|
9100
9102
|
}
|
|
9101
9103
|
setStyle(e) {
|
|
9102
9104
|
return this.getWritable().__style = e || "", this;
|
|
@@ -9146,10 +9148,10 @@ class ot extends qn {
|
|
|
9146
9148
|
} else p.__prev = null;
|
|
9147
9149
|
}
|
|
9148
9150
|
if (i.__size = d, a.length) {
|
|
9149
|
-
const p =
|
|
9151
|
+
const p = j();
|
|
9150
9152
|
if (B(p)) {
|
|
9151
9153
|
const g = new Set(a), _ = new Set(l), { anchor: D, focus: y } = p;
|
|
9152
|
-
Do(D, g, _) && kn(D, D.getNode(), this, f, c), Do(y, g, _) && kn(y, y.getNode(), this, f, c), d !== 0 || this.canBeEmpty() ||
|
|
9154
|
+
Do(D, g, _) && kn(D, D.getNode(), this, f, c), Do(y, g, _) && kn(y, y.getNode(), this, f, c), d !== 0 || this.canBeEmpty() || Je(this) || this.remove();
|
|
9153
9155
|
}
|
|
9154
9156
|
}
|
|
9155
9157
|
return i;
|
|
@@ -9301,7 +9303,7 @@ class Wr extends ot {
|
|
|
9301
9303
|
return !0;
|
|
9302
9304
|
}
|
|
9303
9305
|
}
|
|
9304
|
-
function
|
|
9306
|
+
function _e(r) {
|
|
9305
9307
|
return r instanceof Wr;
|
|
9306
9308
|
}
|
|
9307
9309
|
function Zu(r) {
|
|
@@ -9405,14 +9407,14 @@ class rr extends ot {
|
|
|
9405
9407
|
return { element: t };
|
|
9406
9408
|
}
|
|
9407
9409
|
static importJSON(e) {
|
|
9408
|
-
const t =
|
|
9410
|
+
const t = le();
|
|
9409
9411
|
return t.setFormat(e.format), t.setIndent(e.indent), t.setDirection(e.direction), t.setTextFormat(e.textFormat), t;
|
|
9410
9412
|
}
|
|
9411
9413
|
exportJSON() {
|
|
9412
9414
|
return { ...super.exportJSON(), textFormat: this.getTextFormat(), textStyle: this.getTextStyle(), type: "paragraph", version: 1 };
|
|
9413
9415
|
}
|
|
9414
9416
|
insertNewAfter(e, t) {
|
|
9415
|
-
const n =
|
|
9417
|
+
const n = le();
|
|
9416
9418
|
n.setTextFormat(e.format), n.setTextStyle(e.style);
|
|
9417
9419
|
const s = this.getDirection();
|
|
9418
9420
|
return n.setDirection(s), n.setFormat(this.getFormatType()), n.setStyle(this.getTextStyle()), this.insertAfter(n, t), n;
|
|
@@ -9427,11 +9429,11 @@ class rr extends ot {
|
|
|
9427
9429
|
}
|
|
9428
9430
|
}
|
|
9429
9431
|
function Fc(r) {
|
|
9430
|
-
const e =
|
|
9432
|
+
const e = le();
|
|
9431
9433
|
return r.style && (e.setFormat(r.style.textAlign), pi(r, e)), { node: e };
|
|
9432
9434
|
}
|
|
9433
|
-
function
|
|
9434
|
-
return
|
|
9435
|
+
function le() {
|
|
9436
|
+
return Xe(new rr());
|
|
9435
9437
|
}
|
|
9436
9438
|
function Zt(r) {
|
|
9437
9439
|
return r instanceof rr;
|
|
@@ -9444,7 +9446,7 @@ function tl(r, e, t, n) {
|
|
|
9444
9446
|
o !== null && (o.disconnect(), r._observer = null), e !== null && (e.textContent = ""), t !== null && (t.textContent = "", s.set("root", t));
|
|
9445
9447
|
}
|
|
9446
9448
|
function Pc(r) {
|
|
9447
|
-
const e = r || {}, t = Tc(), n = e.theme || {}, s = r === void 0 ? t : e.parentEditor || null, o = e.disableEvents || !1, i = _i(), u = e.namespace || (s !== null ? s._config.namespace : Eu()), l = e.editorState, a = [Wr, tr,
|
|
9449
|
+
const e = r || {}, t = Tc(), n = e.theme || {}, s = r === void 0 ? t : e.parentEditor || null, o = e.disableEvents || !1, i = _i(), u = e.namespace || (s !== null ? s._config.namespace : Eu()), l = e.editorState, a = [Wr, tr, Mr, $r, rr, xi, ...e.nodes || []], { onError: c, html: f } = e, d = e.editable === void 0 || e.editable;
|
|
9448
9450
|
let h;
|
|
9449
9451
|
if (r === void 0 && t !== null) h = t._nodes;
|
|
9450
9452
|
else {
|
|
@@ -9558,7 +9560,7 @@ class Wn {
|
|
|
9558
9560
|
s.push(l);
|
|
9559
9561
|
}
|
|
9560
9562
|
var i, u;
|
|
9561
|
-
return i = this, u = e.getType(),
|
|
9563
|
+
return i = this, u = e.getType(), Ee(i, () => {
|
|
9562
9564
|
const l = it();
|
|
9563
9565
|
if (l.isEmpty()) return;
|
|
9564
9566
|
if (u === "root") return void re().markDirty();
|
|
@@ -9651,15 +9653,15 @@ class Wn {
|
|
|
9651
9653
|
}
|
|
9652
9654
|
parseEditorState(e, t) {
|
|
9653
9655
|
return function(n, s, o) {
|
|
9654
|
-
const i = _i(), u =
|
|
9655
|
-
s._dirtyElements = /* @__PURE__ */ new Map(), s._dirtyLeaves = /* @__PURE__ */ new Set(), s._cloneNotNeeded = /* @__PURE__ */ new Set(), s._dirtyType = 0,
|
|
9656
|
+
const i = _i(), u = de, l = we, a = fe, c = s._dirtyElements, f = s._dirtyLeaves, d = s._cloneNotNeeded, h = s._dirtyType;
|
|
9657
|
+
s._dirtyElements = /* @__PURE__ */ new Map(), s._dirtyLeaves = /* @__PURE__ */ new Set(), s._cloneNotNeeded = /* @__PURE__ */ new Set(), s._dirtyType = 0, de = i, we = !1, fe = s;
|
|
9656
9658
|
try {
|
|
9657
9659
|
const p = s._nodes;
|
|
9658
9660
|
yi(n.root, p), o && o(), i._readOnly = !0;
|
|
9659
9661
|
} catch (p) {
|
|
9660
9662
|
p instanceof Error && s._onError(p);
|
|
9661
9663
|
} finally {
|
|
9662
|
-
s._dirtyElements = c, s._dirtyLeaves = f, s._cloneNotNeeded = d, s._dirtyType = h,
|
|
9664
|
+
s._dirtyElements = c, s._dirtyLeaves = f, s._cloneNotNeeded = d, s._dirtyType = h, de = u, we = l, fe = a;
|
|
9663
9665
|
}
|
|
9664
9666
|
return i;
|
|
9665
9667
|
}(typeof e == "string" ? JSON.parse(e) : e, this, t);
|
|
@@ -9668,12 +9670,12 @@ class Wn {
|
|
|
9668
9670
|
return pt(this), this.getEditorState().read(e, { editor: this });
|
|
9669
9671
|
}
|
|
9670
9672
|
update(e, t) {
|
|
9671
|
-
|
|
9673
|
+
Ee(this, e, t);
|
|
9672
9674
|
}
|
|
9673
9675
|
focus(e, t = {}) {
|
|
9674
9676
|
const n = this._rootElement;
|
|
9675
|
-
n !== null && (n.setAttribute("autocapitalize", "off"),
|
|
9676
|
-
const s =
|
|
9677
|
+
n !== null && (n.setAttribute("autocapitalize", "off"), Ee(this, () => {
|
|
9678
|
+
const s = j(), o = re();
|
|
9677
9679
|
s !== null ? s.dirty = !0 : o.getChildrenSize() !== 0 && (t.defaultSelection === "rootStart" ? o.selectStart() : o.selectEnd());
|
|
9678
9680
|
}, { onUpdate: () => {
|
|
9679
9681
|
n.removeAttribute("autocapitalize"), e && e();
|
|
@@ -9682,7 +9684,7 @@ class Wn {
|
|
|
9682
9684
|
blur() {
|
|
9683
9685
|
const e = this._rootElement;
|
|
9684
9686
|
e !== null && e.blur();
|
|
9685
|
-
const t =
|
|
9687
|
+
const t = Fe(this._window);
|
|
9686
9688
|
t !== null && t.removeAllRanges();
|
|
9687
9689
|
}
|
|
9688
9690
|
isEditable() {
|
|
@@ -9696,7 +9698,7 @@ class Wn {
|
|
|
9696
9698
|
}
|
|
9697
9699
|
}
|
|
9698
9700
|
Wn.version = "0.21.0+prod.esm";
|
|
9699
|
-
const rl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Oc = rl ? er :
|
|
9701
|
+
const rl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Oc = rl ? er : ge, nn = { tag: "history-merge" };
|
|
9700
9702
|
function Rc({ initialConfig: r, children: e }) {
|
|
9701
9703
|
const t = Pt(() => {
|
|
9702
9704
|
const { theme: n, namespace: s, nodes: o, onError: i, editorState: u, html: l } = r, a = _a(null, n), c = Pc({ editable: r.editable, html: l, namespace: s, nodes: o, onError: (f) => i(f, c), theme: n });
|
|
@@ -9705,10 +9707,10 @@ function Rc({ initialConfig: r, children: e }) {
|
|
|
9705
9707
|
if (d === void 0) f.update(() => {
|
|
9706
9708
|
const h = re();
|
|
9707
9709
|
if (h.isEmpty()) {
|
|
9708
|
-
const p =
|
|
9710
|
+
const p = le();
|
|
9709
9711
|
h.append(p);
|
|
9710
9712
|
const g = rl ? document.activeElement : null;
|
|
9711
|
-
(
|
|
9713
|
+
(j() !== null || g !== null && g === f.getRootElement()) && p.select();
|
|
9712
9714
|
}
|
|
9713
9715
|
}, nn);
|
|
9714
9716
|
else if (d !== null) switch (typeof d) {
|
|
@@ -9733,20 +9735,20 @@ function Rc({ initialConfig: r, children: e }) {
|
|
|
9733
9735
|
s.setEditable(n === void 0 || n);
|
|
9734
9736
|
}, []), v.jsx(eu.Provider, { value: t, children: e });
|
|
9735
9737
|
}
|
|
9736
|
-
const jc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er :
|
|
9737
|
-
function
|
|
9738
|
+
const jc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : ge;
|
|
9739
|
+
function Ic(r) {
|
|
9738
9740
|
return { initialValueFn: () => r.isEditable(), subscribe: (e) => r.registerEditableListener(e) };
|
|
9739
9741
|
}
|
|
9740
|
-
function
|
|
9742
|
+
function Mc() {
|
|
9741
9743
|
return function(r) {
|
|
9742
|
-
const [e] =
|
|
9744
|
+
const [e] = Ye(), t = Pt(() => r(e), [e, r]), [n, s] = Q(() => t.initialValueFn()), o = bs(n);
|
|
9743
9745
|
return jc(() => {
|
|
9744
9746
|
const { initialValueFn: i, subscribe: u } = t, l = i();
|
|
9745
9747
|
return o.current !== l && (o.current = l, s(l)), u((a) => {
|
|
9746
9748
|
o.current = a, s(a);
|
|
9747
9749
|
});
|
|
9748
9750
|
}, [t, r]), n;
|
|
9749
|
-
}(
|
|
9751
|
+
}(Ic);
|
|
9750
9752
|
}
|
|
9751
9753
|
function $c() {
|
|
9752
9754
|
return re().getTextContent();
|
|
@@ -9811,7 +9813,7 @@ function sl(r, e) {
|
|
|
9811
9813
|
if (e.isSelected(r) && !e.isSegmented() && !e.isToken() && t !== null) {
|
|
9812
9814
|
const [n, s] = t, o = r.isBackward(), i = n.getNode(), u = s.getNode(), l = e.is(i), a = e.is(u);
|
|
9813
9815
|
if (l || a) {
|
|
9814
|
-
const [c, f] =
|
|
9816
|
+
const [c, f] = Ms(r), d = i.is(u), h = e.is(o ? u : i), p = e.is(o ? i : u);
|
|
9815
9817
|
let g, _ = 0;
|
|
9816
9818
|
return d ? (_ = c > f ? f : c, g = c > f ? c : f) : h ? (_ = o ? f : c, g = void 0) : p && (_ = 0, g = o ? c : f), e.__text = e.__text.slice(_, g), e;
|
|
9817
9819
|
}
|
|
@@ -9852,14 +9854,14 @@ function Qc(r, e, t, n) {
|
|
|
9852
9854
|
}
|
|
9853
9855
|
function Yc(r) {
|
|
9854
9856
|
const e = r.anchor.getNode();
|
|
9855
|
-
return (
|
|
9857
|
+
return (_e(e) ? e : e.getParentOrThrow()).getDirection() === "rtl";
|
|
9856
9858
|
}
|
|
9857
9859
|
function Co(r, e, t) {
|
|
9858
9860
|
const n = Yc(r);
|
|
9859
9861
|
Qc(r, e, t ? !n : n, "character");
|
|
9860
9862
|
}
|
|
9861
9863
|
function Ao(r) {
|
|
9862
|
-
if (Y(r) || !E(r) ||
|
|
9864
|
+
if (Y(r) || !E(r) || Je(r)) return !1;
|
|
9863
9865
|
const e = r.getFirstChild(), t = e === null || St(e) || L(e) || e.isInline();
|
|
9864
9866
|
return !r.isInline() && r.canBeEmpty() !== !1 && t;
|
|
9865
9867
|
}
|
|
@@ -9936,7 +9938,7 @@ function nd(r) {
|
|
|
9936
9938
|
if (l) {
|
|
9937
9939
|
const [a, c, f, d, h, p] = l;
|
|
9938
9940
|
r.update(() => {
|
|
9939
|
-
const g =
|
|
9941
|
+
const g = j();
|
|
9940
9942
|
if (B(g)) {
|
|
9941
9943
|
const _ = g.anchor;
|
|
9942
9944
|
let D = _.getNode(), y = 0, w = 0;
|
|
@@ -10036,12 +10038,12 @@ function fl(r, e, t, n, s = /* @__PURE__ */ new Map(), o) {
|
|
|
10036
10038
|
}
|
|
10037
10039
|
const f = r.childNodes;
|
|
10038
10040
|
let d = [];
|
|
10039
|
-
const h = (u == null || !
|
|
10041
|
+
const h = (u == null || !Je(u)) && (u != null && $s(u) || n);
|
|
10040
10042
|
for (let p = 0; p < f.length; p++) d.push(...fl(f[p], e, t, h, new Map(s), u));
|
|
10041
10043
|
return c != null && (d = c(d)), bn(r) && (d = sd(r, d, h ? () => {
|
|
10042
10044
|
const p = new xi();
|
|
10043
10045
|
return t.push(p), p;
|
|
10044
|
-
} :
|
|
10046
|
+
} : le)), u == null ? d.length > 0 ? i = i.concat(d) : bn(r) && function(p) {
|
|
10045
10047
|
return p.nextSibling == null || p.previousSibling == null ? !1 : ks(p.nextSibling) && ks(p.previousSibling);
|
|
10046
10048
|
}(r) && (i = i.concat(Ft())) : E(u) && u.append(...d), i;
|
|
10047
10049
|
}
|
|
@@ -10067,10 +10069,10 @@ var Sn = id(function(r) {
|
|
|
10067
10069
|
for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
|
|
10068
10070
|
throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
10069
10071
|
});
|
|
10070
|
-
function od(r, e =
|
|
10072
|
+
function od(r, e = j()) {
|
|
10071
10073
|
return e == null && Sn(166), B(e) && e.isCollapsed() || e.getNodes().length === 0 ? "" : al(r, e);
|
|
10072
10074
|
}
|
|
10073
|
-
function ud(r, e =
|
|
10075
|
+
function ud(r, e = j()) {
|
|
10074
10076
|
return e == null && Sn(166), B(e) && e.isCollapsed() || e.getNodes().length === 0 ? null : JSON.stringify(ld(r, e));
|
|
10075
10077
|
}
|
|
10076
10078
|
function Eo(r, e, t) {
|
|
@@ -10094,7 +10096,7 @@ function Eo(r, e, t) {
|
|
|
10094
10096
|
const i = o.split(/(\r?\n|\t)/);
|
|
10095
10097
|
i[i.length - 1] === "" && i.pop();
|
|
10096
10098
|
for (let u = 0; u < i.length; u++) {
|
|
10097
|
-
const l =
|
|
10099
|
+
const l = j();
|
|
10098
10100
|
if (B(l)) {
|
|
10099
10101
|
const a = i[u];
|
|
10100
10102
|
a === `
|
|
@@ -10160,7 +10162,7 @@ async function So(r, e, t) {
|
|
|
10160
10162
|
l(To(r, e, t));
|
|
10161
10163
|
});
|
|
10162
10164
|
});
|
|
10163
|
-
const n = r.getRootElement(), s = r._window == null ? window.document : r._window.document, o =
|
|
10165
|
+
const n = r.getRootElement(), s = r._window == null ? window.document : r._window.document, o = Fe(r._window);
|
|
10164
10166
|
if (n === null || o === null) return !1;
|
|
10165
10167
|
const i = s.createElement("span");
|
|
10166
10168
|
i.style.cssText = "position: fixed; top: -1000px;", i.append(s.createTextNode("#")), n.append(i);
|
|
@@ -10174,11 +10176,11 @@ async function So(r, e, t) {
|
|
|
10174
10176
|
}
|
|
10175
10177
|
function To(r, e, t) {
|
|
10176
10178
|
if (t === void 0) {
|
|
10177
|
-
const s =
|
|
10179
|
+
const s = Fe(r._window);
|
|
10178
10180
|
if (!s) return !1;
|
|
10179
10181
|
const o = s.anchorNode, i = s.focusNode;
|
|
10180
10182
|
if (o !== null && i !== null && !jr(r, o, i)) return !1;
|
|
10181
|
-
const u =
|
|
10183
|
+
const u = j();
|
|
10182
10184
|
if (u === null) return !1;
|
|
10183
10185
|
t = dd(u);
|
|
10184
10186
|
}
|
|
@@ -10187,7 +10189,7 @@ function To(r, e, t) {
|
|
|
10187
10189
|
return n !== null && (fd(n, t), !0);
|
|
10188
10190
|
}
|
|
10189
10191
|
const cd = [["text/html", od], ["application/x-lexical-editor", ud]];
|
|
10190
|
-
function dd(r =
|
|
10192
|
+
function dd(r = j()) {
|
|
10191
10193
|
const e = { "text/plain": r ? r.getTextContent() : "" };
|
|
10192
10194
|
if (r) {
|
|
10193
10195
|
const t = ac();
|
|
@@ -10255,11 +10257,11 @@ class Kn extends ot {
|
|
|
10255
10257
|
return { ...super.exportJSON(), type: "quote" };
|
|
10256
10258
|
}
|
|
10257
10259
|
insertNewAfter(e, t) {
|
|
10258
|
-
const n =
|
|
10260
|
+
const n = le(), s = this.getDirection();
|
|
10259
10261
|
return n.setDirection(s), this.insertAfter(n, t), n;
|
|
10260
10262
|
}
|
|
10261
10263
|
collapseAtStart() {
|
|
10262
|
-
const e =
|
|
10264
|
+
const e = le();
|
|
10263
10265
|
return this.getChildren().forEach((t) => e.append(t)), this.replace(e), !0;
|
|
10264
10266
|
}
|
|
10265
10267
|
canMergeWhenEmpty() {
|
|
@@ -10267,7 +10269,7 @@ class Kn extends ot {
|
|
|
10267
10269
|
}
|
|
10268
10270
|
}
|
|
10269
10271
|
function vi() {
|
|
10270
|
-
return
|
|
10272
|
+
return Xe(new Kn());
|
|
10271
10273
|
}
|
|
10272
10274
|
class Hn extends ot {
|
|
10273
10275
|
static getType() {
|
|
@@ -10318,15 +10320,15 @@ class Hn extends ot {
|
|
|
10318
10320
|
return { ...super.exportJSON(), tag: this.getTag(), type: "heading", version: 1 };
|
|
10319
10321
|
}
|
|
10320
10322
|
insertNewAfter(e, t = !0) {
|
|
10321
|
-
const n = e ? e.anchor.offset : 0, s = this.getLastDescendant(), o = !s || e && e.anchor.key === s.getKey() && n === s.getTextContentSize() || !e ?
|
|
10323
|
+
const n = e ? e.anchor.offset : 0, s = this.getLastDescendant(), o = !s || e && e.anchor.key === s.getKey() && n === s.getTextContentSize() || !e ? le() : yr(this.getTag()), i = this.getDirection();
|
|
10322
10324
|
if (o.setDirection(i), this.insertAfter(o, t), n === 0 && !this.isEmpty() && e) {
|
|
10323
|
-
const u =
|
|
10325
|
+
const u = le();
|
|
10324
10326
|
u.select(), this.replace(u, !0);
|
|
10325
10327
|
}
|
|
10326
10328
|
return o;
|
|
10327
10329
|
}
|
|
10328
10330
|
collapseAtStart() {
|
|
10329
|
-
const e = this.isEmpty() ?
|
|
10331
|
+
const e = this.isEmpty() ? le() : yr(this.getTag());
|
|
10330
10332
|
return this.getChildren().forEach((t) => e.append(t)), this.replace(e), !0;
|
|
10331
10333
|
}
|
|
10332
10334
|
extractWithChild() {
|
|
@@ -10346,7 +10348,7 @@ function _d(r) {
|
|
|
10346
10348
|
return r.style !== null && (e.setFormat(r.style.textAlign), pi(r, e)), { node: e };
|
|
10347
10349
|
}
|
|
10348
10350
|
function yr(r) {
|
|
10349
|
-
return
|
|
10351
|
+
return Xe(new Hn(r));
|
|
10350
10352
|
}
|
|
10351
10353
|
function sn(r) {
|
|
10352
10354
|
let e = null;
|
|
@@ -10355,7 +10357,7 @@ function sn(r) {
|
|
|
10355
10357
|
return [n, Array.from(e.files), s];
|
|
10356
10358
|
}
|
|
10357
10359
|
function Po(r) {
|
|
10358
|
-
const e =
|
|
10360
|
+
const e = j();
|
|
10359
10361
|
if (!B(e)) return !1;
|
|
10360
10362
|
const t = /* @__PURE__ */ new Set(), n = e.getNodes();
|
|
10361
10363
|
for (let s = 0; s < n.length; s++) {
|
|
@@ -10374,19 +10376,19 @@ function on(r) {
|
|
|
10374
10376
|
}
|
|
10375
10377
|
function xd(r) {
|
|
10376
10378
|
return Ot(r.registerCommand(tu, (e) => {
|
|
10377
|
-
const t =
|
|
10378
|
-
return !!
|
|
10379
|
+
const t = j();
|
|
10380
|
+
return !!Ve(t) && (t.clear(), !0);
|
|
10379
10381
|
}, 0), r.registerCommand(Et, (e) => {
|
|
10380
|
-
const t =
|
|
10382
|
+
const t = j();
|
|
10381
10383
|
return !!B(t) && (t.deleteCharacter(e), !0);
|
|
10382
10384
|
}, G), r.registerCommand(Sr, (e) => {
|
|
10383
|
-
const t =
|
|
10385
|
+
const t = j();
|
|
10384
10386
|
return !!B(t) && (t.deleteWord(e), !0);
|
|
10385
10387
|
}, G), r.registerCommand(Tr, (e) => {
|
|
10386
|
-
const t =
|
|
10388
|
+
const t = j();
|
|
10387
10389
|
return !!B(t) && (t.deleteLine(e), !0);
|
|
10388
10390
|
}, G), r.registerCommand(Gt, (e) => {
|
|
10389
|
-
const t =
|
|
10391
|
+
const t = j();
|
|
10390
10392
|
if (typeof e == "string") t !== null && t.insertText(e);
|
|
10391
10393
|
else {
|
|
10392
10394
|
if (t === null) return !1;
|
|
@@ -10399,14 +10401,14 @@ function xd(r) {
|
|
|
10399
10401
|
}
|
|
10400
10402
|
return !0;
|
|
10401
10403
|
}, G), r.registerCommand(Cs, () => {
|
|
10402
|
-
const e =
|
|
10404
|
+
const e = j();
|
|
10403
10405
|
return !!B(e) && (e.removeText(), !0);
|
|
10404
10406
|
}, G), r.registerCommand(Re, (e) => {
|
|
10405
|
-
const t =
|
|
10407
|
+
const t = j();
|
|
10406
10408
|
return !!B(t) && (t.formatText(e), !0);
|
|
10407
10409
|
}, G), r.registerCommand(ka, (e) => {
|
|
10408
|
-
const t =
|
|
10409
|
-
if (!B(t) && !
|
|
10410
|
+
const t = j();
|
|
10411
|
+
if (!B(t) && !Ve(t)) return !1;
|
|
10410
10412
|
const n = t.getNodes();
|
|
10411
10413
|
for (const s of n) {
|
|
10412
10414
|
const o = Vn(s, (i) => E(i) && !i.isInline());
|
|
@@ -10414,20 +10416,20 @@ function xd(r) {
|
|
|
10414
10416
|
}
|
|
10415
10417
|
return !0;
|
|
10416
10418
|
}, G), r.registerCommand(Ht, (e) => {
|
|
10417
|
-
const t =
|
|
10419
|
+
const t = j();
|
|
10418
10420
|
return !!B(t) && (t.insertLineBreak(e), !0);
|
|
10419
10421
|
}, G), r.registerCommand(kr, () => {
|
|
10420
|
-
const e =
|
|
10422
|
+
const e = j();
|
|
10421
10423
|
return !!B(e) && (e.insertParagraph(), !0);
|
|
10422
10424
|
}, G), r.registerCommand(Aa, () => (kc([qr()]), !0), G), r.registerCommand(Ea, () => Po((e) => {
|
|
10423
10425
|
const t = e.getIndent();
|
|
10424
10426
|
e.setIndent(t + 1);
|
|
10425
|
-
}), G), r.registerCommand(
|
|
10427
|
+
}), G), r.registerCommand(Ii, () => Po((e) => {
|
|
10426
10428
|
const t = e.getIndent();
|
|
10427
10429
|
t > 0 && e.setIndent(t - 1);
|
|
10428
10430
|
}), G), r.registerCommand(su, (e) => {
|
|
10429
|
-
const t =
|
|
10430
|
-
if (
|
|
10431
|
+
const t = j();
|
|
10432
|
+
if (Ve(t) && !on(e.target)) {
|
|
10431
10433
|
const n = t.getNodes();
|
|
10432
10434
|
if (n.length > 0) return n[0].selectPrevious(), !0;
|
|
10433
10435
|
} else if (B(t)) {
|
|
@@ -10436,8 +10438,8 @@ function xd(r) {
|
|
|
10436
10438
|
}
|
|
10437
10439
|
return !1;
|
|
10438
10440
|
}, G), r.registerCommand(iu, (e) => {
|
|
10439
|
-
const t =
|
|
10440
|
-
if (
|
|
10441
|
+
const t = j();
|
|
10442
|
+
if (Ve(t)) {
|
|
10441
10443
|
const n = t.getNodes();
|
|
10442
10444
|
if (n.length > 0) return n[0].selectNext(0, 0), !0;
|
|
10443
10445
|
} else if (B(t)) {
|
|
@@ -10450,8 +10452,8 @@ function xd(r) {
|
|
|
10450
10452
|
}
|
|
10451
10453
|
return !1;
|
|
10452
10454
|
}, G), r.registerCommand(nu, (e) => {
|
|
10453
|
-
const t =
|
|
10454
|
-
if (
|
|
10455
|
+
const t = j();
|
|
10456
|
+
if (Ve(t)) {
|
|
10455
10457
|
const n = t.getNodes();
|
|
10456
10458
|
if (n.length > 0) return e.preventDefault(), n[0].selectPrevious(), !0;
|
|
10457
10459
|
}
|
|
@@ -10462,8 +10464,8 @@ function xd(r) {
|
|
|
10462
10464
|
}
|
|
10463
10465
|
return !1;
|
|
10464
10466
|
}, G), r.registerCommand(ru, (e) => {
|
|
10465
|
-
const t =
|
|
10466
|
-
if (
|
|
10467
|
+
const t = j();
|
|
10468
|
+
if (Ve(t) && !on(e.target)) {
|
|
10467
10469
|
const s = t.getNodes();
|
|
10468
10470
|
if (s.length > 0) return e.preventDefault(), s[0].selectNext(0, 0), !0;
|
|
10469
10471
|
}
|
|
@@ -10472,16 +10474,16 @@ function xd(r) {
|
|
|
10472
10474
|
return !!wo(t, !1) && (e.preventDefault(), Co(t, n, !1), !0);
|
|
10473
10475
|
}, G), r.registerCommand(ou, (e) => {
|
|
10474
10476
|
if (on(e.target)) return !1;
|
|
10475
|
-
const t =
|
|
10477
|
+
const t = j();
|
|
10476
10478
|
if (!B(t)) return !1;
|
|
10477
10479
|
const { anchor: n } = t, s = n.getNode();
|
|
10478
|
-
return t.isCollapsed() && n.offset === 0 && !
|
|
10480
|
+
return t.isCollapsed() && n.offset === 0 && !_e(s) && rd(s).getIndent() > 0 ? (e.preventDefault(), r.dispatchCommand(Ii, void 0)) : (!No || navigator.language !== "ko-KR") && (e.preventDefault(), r.dispatchCommand(Et, !0));
|
|
10479
10481
|
}, G), r.registerCommand(lu, (e) => {
|
|
10480
10482
|
if (on(e.target)) return !1;
|
|
10481
|
-
const t =
|
|
10483
|
+
const t = j();
|
|
10482
10484
|
return !!B(t) && (e.preventDefault(), r.dispatchCommand(Et, !1));
|
|
10483
10485
|
}, G), r.registerCommand(fn, (e) => {
|
|
10484
|
-
const t =
|
|
10486
|
+
const t = j();
|
|
10485
10487
|
if (!B(t)) return !1;
|
|
10486
10488
|
if (e !== null) {
|
|
10487
10489
|
if ((No || gd || yd) && pd) return !1;
|
|
@@ -10489,7 +10491,7 @@ function xd(r) {
|
|
|
10489
10491
|
}
|
|
10490
10492
|
return r.dispatchCommand(kr, void 0);
|
|
10491
10493
|
}, G), r.registerCommand(uu, () => {
|
|
10492
|
-
const e =
|
|
10494
|
+
const e = j();
|
|
10493
10495
|
return !!B(e) && (r.blur(), !0);
|
|
10494
10496
|
}, G), r.registerCommand(au, (e) => {
|
|
10495
10497
|
const [, t] = sn(e);
|
|
@@ -10505,19 +10507,19 @@ function xd(r) {
|
|
|
10505
10507
|
l.anchor.set(c, f, "element"), l.focus.set(c, f, "element");
|
|
10506
10508
|
}
|
|
10507
10509
|
const a = xu(l);
|
|
10508
|
-
|
|
10510
|
+
Ge(a);
|
|
10509
10511
|
}
|
|
10510
10512
|
r.dispatchCommand(Fo, t);
|
|
10511
10513
|
}
|
|
10512
10514
|
return e.preventDefault(), !0;
|
|
10513
10515
|
}
|
|
10514
|
-
const n =
|
|
10516
|
+
const n = j();
|
|
10515
10517
|
return !!B(n);
|
|
10516
10518
|
}, G), r.registerCommand(cu, (e) => {
|
|
10517
|
-
const [t] = sn(e), n =
|
|
10519
|
+
const [t] = sn(e), n = j();
|
|
10518
10520
|
return !(t && !B(n));
|
|
10519
10521
|
}, G), r.registerCommand(du, (e) => {
|
|
10520
|
-
const [t] = sn(e), n =
|
|
10522
|
+
const [t] = sn(e), n = j();
|
|
10521
10523
|
if (t && !B(n)) return !1;
|
|
10522
10524
|
const s = Bo(e.clientX, e.clientY);
|
|
10523
10525
|
if (s !== null) {
|
|
@@ -10527,31 +10529,31 @@ function xd(r) {
|
|
|
10527
10529
|
return !0;
|
|
10528
10530
|
}, G), r.registerCommand(As, () => (ic(), !0), G), r.registerCommand(Ln, (e) => (So(r, gt(e, ClipboardEvent) ? e : null), !0), G), r.registerCommand(Qs, (e) => (async function(t, n) {
|
|
10529
10531
|
await So(n, gt(t, ClipboardEvent) ? t : null), n.update(() => {
|
|
10530
|
-
const s =
|
|
10531
|
-
B(s) ? s.removeText() :
|
|
10532
|
+
const s = j();
|
|
10533
|
+
B(s) ? s.removeText() : Ve(s) && s.getNodes().forEach((o) => o.remove());
|
|
10532
10534
|
});
|
|
10533
10535
|
}(e, r), !0), G), r.registerCommand(Fn, (e) => {
|
|
10534
10536
|
const [, t, n] = sn(e);
|
|
10535
|
-
return t.length > 0 && !n ? (r.dispatchCommand(Fo, t), !0) : oi(e.target) ? !1 :
|
|
10537
|
+
return t.length > 0 && !n ? (r.dispatchCommand(Fo, t), !0) : oi(e.target) ? !1 : j() !== null && (function(s, o) {
|
|
10536
10538
|
s.preventDefault(), o.update(() => {
|
|
10537
|
-
const i =
|
|
10539
|
+
const i = j(), u = gt(s, InputEvent) || gt(s, KeyboardEvent) ? null : s.clipboardData;
|
|
10538
10540
|
u != null && i !== null && Eo(u, i, o);
|
|
10539
10541
|
}, { tag: "paste" });
|
|
10540
10542
|
}(e, r), !0);
|
|
10541
10543
|
}, G));
|
|
10542
10544
|
}
|
|
10543
|
-
const qs = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er :
|
|
10545
|
+
const qs = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : ge;
|
|
10544
10546
|
function Oo(r) {
|
|
10545
10547
|
return r.getEditorState().read(nl(r.isComposing()));
|
|
10546
10548
|
}
|
|
10547
10549
|
function vd({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
|
|
10548
|
-
const [n] =
|
|
10550
|
+
const [n] = Ye(), s = function(o, i) {
|
|
10549
10551
|
const [u, l] = Q(() => o.getDecorators());
|
|
10550
10552
|
return qs(() => o.registerDecoratorListener((a) => {
|
|
10551
10553
|
ql(() => {
|
|
10552
10554
|
l(a);
|
|
10553
10555
|
});
|
|
10554
|
-
}), [o]),
|
|
10556
|
+
}), [o]), ge(() => {
|
|
10555
10557
|
l(o.getDecorators());
|
|
10556
10558
|
}, [o]), Pt(() => {
|
|
10557
10559
|
const a = [], c = Object.keys(u);
|
|
@@ -10567,7 +10569,7 @@ function vd({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
|
|
|
10567
10569
|
}(n), v.jsxs(v.Fragment, { children: [r, v.jsx(bd, { content: e }), s] });
|
|
10568
10570
|
}
|
|
10569
10571
|
function bd({ content: r }) {
|
|
10570
|
-
const [e] =
|
|
10572
|
+
const [e] = Ye(), t = function(s) {
|
|
10571
10573
|
const [o, i] = Q(() => Oo(s));
|
|
10572
10574
|
return qs(() => {
|
|
10573
10575
|
function u() {
|
|
@@ -10580,10 +10582,10 @@ function bd({ content: r }) {
|
|
|
10580
10582
|
u();
|
|
10581
10583
|
}));
|
|
10582
10584
|
}, [s]), o;
|
|
10583
|
-
}(e), n =
|
|
10585
|
+
}(e), n = Mc();
|
|
10584
10586
|
return t ? typeof r == "function" ? r(n) : r : null;
|
|
10585
10587
|
}
|
|
10586
|
-
const pl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er :
|
|
10588
|
+
const pl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : ge;
|
|
10587
10589
|
function Dd({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: s, ariaErrorMessage: o, ariaExpanded: i, ariaInvalid: u, ariaLabel: l, ariaLabelledBy: a, ariaMultiline: c, ariaOwns: f, ariaRequired: d, autoCapitalize: h, className: p, id: g, role: _ = "textbox", spellCheck: D = !0, style: y, tabIndex: w, "data-testid": x, ...C }, b) {
|
|
10588
10590
|
const [k, A] = Q(r.isEditable()), S = Z((F) => {
|
|
10589
10591
|
F && F.ownerDocument && F.ownerDocument.defaultView ? r.setRootElement(F) : r.setRootElement(null);
|
|
@@ -10604,7 +10606,7 @@ function Ro(r) {
|
|
|
10604
10606
|
}
|
|
10605
10607
|
const Cd = Qo(Ad);
|
|
10606
10608
|
function Ad(r, e) {
|
|
10607
|
-
const { placeholder: t, ...n } = r, [s] =
|
|
10609
|
+
const { placeholder: t, ...n } = r, [s] = Ye();
|
|
10608
10610
|
return v.jsxs(v.Fragment, { children: [v.jsx(wd, { editor: s, ...n, ref: e }), t != null && v.jsx(Ed, { editor: s, content: t })] });
|
|
10609
10611
|
}
|
|
10610
10612
|
function Ed({ content: r, editor: e }) {
|
|
@@ -10643,7 +10645,7 @@ function Bd(r, e, t, n, s) {
|
|
|
10643
10645
|
for (const [b, k] of w) {
|
|
10644
10646
|
if (!k) continue;
|
|
10645
10647
|
const A = x.get(b);
|
|
10646
|
-
A === void 0 ||
|
|
10648
|
+
A === void 0 || _e(A) || C.push(A);
|
|
10647
10649
|
}
|
|
10648
10650
|
return C;
|
|
10649
10651
|
}(e, t, n);
|
|
@@ -10679,7 +10681,7 @@ function Nd(r, e) {
|
|
|
10679
10681
|
return t = c, n = f, d;
|
|
10680
10682
|
};
|
|
10681
10683
|
}
|
|
10682
|
-
function
|
|
10684
|
+
function Io(r) {
|
|
10683
10685
|
r.undoStack = [], r.redoStack = [], r.current = null;
|
|
10684
10686
|
}
|
|
10685
10687
|
function Fd(r, e, t) {
|
|
@@ -10698,7 +10700,7 @@ function Fd(r, e, t) {
|
|
|
10698
10700
|
const c = u.pop();
|
|
10699
10701
|
u.length === 0 && o.dispatchCommand(Zr, !1), i.current = c || null, c && c.editor.setEditorState(c.editorState, { tag: "historic" });
|
|
10700
10702
|
}
|
|
10701
|
-
}(r, e), !0), G), r.registerCommand(Ta, () => (
|
|
10703
|
+
}(r, e), !0), G), r.registerCommand(Ta, () => (Io(e), !1), G), r.registerCommand(Ba, () => (Io(e), r.dispatchCommand(Zr, !1), r.dispatchCommand(en, !1), !0), G), r.registerUpdateListener(({ editorState: o, prevEditorState: i, dirtyLeaves: u, dirtyElements: l, tags: a }) => {
|
|
10702
10704
|
const c = e.current, f = e.redoStack, d = e.undoStack, h = c === null ? null : c.editorState;
|
|
10703
10705
|
if (c !== null && o === h) return;
|
|
10704
10706
|
const p = n(i, o, c, u, l, a);
|
|
@@ -10711,15 +10713,15 @@ function Ld() {
|
|
|
10711
10713
|
return { current: null, redoStack: [], undoStack: [] };
|
|
10712
10714
|
}
|
|
10713
10715
|
function Pd({ delay: r, externalHistoryState: e }) {
|
|
10714
|
-
const [t] =
|
|
10716
|
+
const [t] = Ye();
|
|
10715
10717
|
return function(n, s, o = 1e3) {
|
|
10716
10718
|
const i = Pt(() => s || Ld(), [s]);
|
|
10717
|
-
|
|
10719
|
+
ge(() => Fd(n, i, o), [o, n, i]);
|
|
10718
10720
|
}(t, e, r), null;
|
|
10719
10721
|
}
|
|
10720
|
-
const Od = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er :
|
|
10722
|
+
const Od = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : ge;
|
|
10721
10723
|
function Rd({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: e = !1, onChange: t }) {
|
|
10722
|
-
const [n] =
|
|
10724
|
+
const [n] = Ye();
|
|
10723
10725
|
return Od(() => {
|
|
10724
10726
|
if (t) return n.registerUpdateListener(({ editorState: s, dirtyElements: o, dirtyLeaves: i, prevEditorState: u, tags: l }) => {
|
|
10725
10727
|
e && o.size === 0 && i.size === 0 || r && l.has("history-merge") || u.isEmpty() || t(s, n, l);
|
|
@@ -10731,11 +10733,11 @@ function Ws(r, e) {
|
|
|
10731
10733
|
return t.__proto__ = n, t;
|
|
10732
10734
|
}, Ws(r, e);
|
|
10733
10735
|
}
|
|
10734
|
-
var
|
|
10736
|
+
var Mo = { error: null }, jd = function(r) {
|
|
10735
10737
|
var e, t;
|
|
10736
10738
|
function n() {
|
|
10737
10739
|
for (var o, i = arguments.length, u = new Array(i), l = 0; l < i; l++) u[l] = arguments[l];
|
|
10738
|
-
return (o = r.call.apply(r, [this].concat(u)) || this).state =
|
|
10740
|
+
return (o = r.call.apply(r, [this].concat(u)) || this).state = Mo, o.resetErrorBoundary = function() {
|
|
10739
10741
|
for (var a, c = arguments.length, f = new Array(c), d = 0; d < c; d++) f[d] = arguments[d];
|
|
10740
10742
|
o.props.onReset == null || (a = o.props).onReset.apply(a, f), o.reset();
|
|
10741
10743
|
}, o;
|
|
@@ -10745,7 +10747,7 @@ var Io = { error: null }, jd = function(r) {
|
|
|
10745
10747
|
};
|
|
10746
10748
|
var s = n.prototype;
|
|
10747
10749
|
return s.reset = function() {
|
|
10748
|
-
this.setState(
|
|
10750
|
+
this.setState(Mo);
|
|
10749
10751
|
}, s.componentDidCatch = function(o, i) {
|
|
10750
10752
|
var u, l;
|
|
10751
10753
|
(u = (l = this.props).onError) == null || u.call(l, o, i);
|
|
@@ -10766,13 +10768,13 @@ var Io = { error: null }, jd = function(r) {
|
|
|
10766
10768
|
return this.props.children;
|
|
10767
10769
|
}, n;
|
|
10768
10770
|
}(ss.Component);
|
|
10769
|
-
function
|
|
10771
|
+
function Id({ children: r, onError: e }) {
|
|
10770
10772
|
return v.jsx(jd, { fallback: v.jsx("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: r });
|
|
10771
10773
|
}
|
|
10772
|
-
function
|
|
10774
|
+
function Md(r) {
|
|
10773
10775
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
10774
10776
|
}
|
|
10775
|
-
var
|
|
10777
|
+
var Ke = Md(function(r) {
|
|
10776
10778
|
const e = new URLSearchParams();
|
|
10777
10779
|
e.append("code", r);
|
|
10778
10780
|
for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
|
|
@@ -10787,7 +10789,7 @@ function $d(r) {
|
|
|
10787
10789
|
e++, t = n.getParent();
|
|
10788
10790
|
continue;
|
|
10789
10791
|
}
|
|
10790
|
-
|
|
10792
|
+
Ke(40);
|
|
10791
10793
|
}
|
|
10792
10794
|
return e;
|
|
10793
10795
|
}
|
|
@@ -10795,7 +10797,7 @@ function $d(r) {
|
|
|
10795
10797
|
}
|
|
10796
10798
|
function Vs(r) {
|
|
10797
10799
|
let e = r.getParent();
|
|
10798
|
-
H(e) ||
|
|
10800
|
+
H(e) || Ke(40);
|
|
10799
10801
|
let t = e;
|
|
10800
10802
|
for (; t !== null; ) t = t.getParent(), H(t) && (e = t);
|
|
10801
10803
|
return e;
|
|
@@ -10809,29 +10811,29 @@ function gl(r) {
|
|
|
10809
10811
|
}
|
|
10810
10812
|
return e;
|
|
10811
10813
|
}
|
|
10812
|
-
function
|
|
10814
|
+
function He(r) {
|
|
10813
10815
|
return ee(r) && H(r.getFirstChild());
|
|
10814
10816
|
}
|
|
10815
10817
|
function $o(r) {
|
|
10816
|
-
return
|
|
10818
|
+
return ke().append(r);
|
|
10817
10819
|
}
|
|
10818
10820
|
function ml(r, e) {
|
|
10819
10821
|
return ee(r) && (e.length === 0 || e.length === 1 && r.is(e[0]) && r.getChildrenSize() === 0);
|
|
10820
10822
|
}
|
|
10821
10823
|
function qo(r, e) {
|
|
10822
10824
|
r.update(() => {
|
|
10823
|
-
const t =
|
|
10825
|
+
const t = j();
|
|
10824
10826
|
if (t !== null) {
|
|
10825
10827
|
const n = t.getNodes();
|
|
10826
10828
|
if (B(t)) {
|
|
10827
10829
|
const o = t.getStartEndPoints();
|
|
10828
|
-
o === null &&
|
|
10830
|
+
o === null && Ke(143);
|
|
10829
10831
|
const [i] = o, u = i.getNode(), l = u.getParent();
|
|
10830
10832
|
if (ml(u, n)) {
|
|
10831
|
-
const a =
|
|
10832
|
-
if (
|
|
10833
|
+
const a = Ce(e);
|
|
10834
|
+
if (Je(l)) {
|
|
10833
10835
|
u.replace(a);
|
|
10834
|
-
const c =
|
|
10836
|
+
const c = ke();
|
|
10835
10837
|
E(u) && (c.setFormat(u.getFormatType()), c.setIndent(u.getIndent())), a.append(c);
|
|
10836
10838
|
} else if (ee(u)) {
|
|
10837
10839
|
const c = u.getParentOrThrow();
|
|
@@ -10850,14 +10852,14 @@ function qo(r, e) {
|
|
|
10850
10852
|
const l = u.getKey();
|
|
10851
10853
|
if (H(u)) {
|
|
10852
10854
|
if (!s.has(l)) {
|
|
10853
|
-
const a =
|
|
10855
|
+
const a = Ce(e);
|
|
10854
10856
|
Lt(a, u.getChildren()), u.replace(a), s.add(l);
|
|
10855
10857
|
}
|
|
10856
10858
|
break;
|
|
10857
10859
|
}
|
|
10858
10860
|
{
|
|
10859
10861
|
const a = u.getParent();
|
|
10860
|
-
if (
|
|
10862
|
+
if (Je(a) && !s.has(l)) {
|
|
10861
10863
|
s.add(l), zo(u, e);
|
|
10862
10864
|
break;
|
|
10863
10865
|
}
|
|
@@ -10875,25 +10877,25 @@ function Lt(r, e) {
|
|
|
10875
10877
|
}
|
|
10876
10878
|
function zo(r, e) {
|
|
10877
10879
|
if (H(r)) return r;
|
|
10878
|
-
const t = r.getPreviousSibling(), n = r.getNextSibling(), s =
|
|
10880
|
+
const t = r.getPreviousSibling(), n = r.getNextSibling(), s = ke();
|
|
10879
10881
|
let o;
|
|
10880
10882
|
if (Lt(s, r.getChildren()), H(t) && e === t.getListType()) t.append(s), H(n) && e === n.getListType() && (Lt(t, n.getChildren()), n.remove()), o = t;
|
|
10881
10883
|
else if (H(n) && e === n.getListType()) n.getFirstChildOrThrow().insertBefore(s), o = n;
|
|
10882
10884
|
else {
|
|
10883
|
-
const i =
|
|
10885
|
+
const i = Ce(e);
|
|
10884
10886
|
i.append(s), r.replace(i), o = i;
|
|
10885
10887
|
}
|
|
10886
10888
|
return s.setFormat(r.getFormatType()), s.setIndent(r.getIndent()), r.remove(), o;
|
|
10887
10889
|
}
|
|
10888
10890
|
function bi(r, e) {
|
|
10889
10891
|
const t = r.getLastChild(), n = e.getFirstChild();
|
|
10890
|
-
t && n &&
|
|
10892
|
+
t && n && He(t) && He(n) && (bi(t.getFirstChild(), n.getFirstChild()), n.remove());
|
|
10891
10893
|
const s = e.getChildren();
|
|
10892
10894
|
s.length > 0 && r.append(...s), e.remove();
|
|
10893
10895
|
}
|
|
10894
10896
|
function qd(r) {
|
|
10895
10897
|
r.update(() => {
|
|
10896
|
-
const e =
|
|
10898
|
+
const e = j();
|
|
10897
10899
|
if (B(e)) {
|
|
10898
10900
|
const t = /* @__PURE__ */ new Set(), n = e.getNodes(), s = e.anchor.getNode();
|
|
10899
10901
|
if (ml(s, n)) t.add(Vs(s));
|
|
@@ -10908,7 +10910,7 @@ function qd(r) {
|
|
|
10908
10910
|
let i = o;
|
|
10909
10911
|
const u = gl(o);
|
|
10910
10912
|
for (const l of u) {
|
|
10911
|
-
const a =
|
|
10913
|
+
const a = le();
|
|
10912
10914
|
Lt(a, l.getChildren()), i.insertAfter(a), i = a, l.__key === e.anchor.key && e.anchor.set(a.getKey(), 0, "element"), l.__key === e.focus.key && e.focus.set(a.getKey(), 0, "element"), l.remove();
|
|
10913
10915
|
}
|
|
10914
10916
|
o.remove();
|
|
@@ -10918,65 +10920,65 @@ function qd(r) {
|
|
|
10918
10920
|
}
|
|
10919
10921
|
function zd(r) {
|
|
10920
10922
|
const e = /* @__PURE__ */ new Set();
|
|
10921
|
-
if (
|
|
10923
|
+
if (He(r) || e.has(r.getKey())) return;
|
|
10922
10924
|
const t = r.getParent(), n = r.getNextSibling(), s = r.getPreviousSibling();
|
|
10923
|
-
if (
|
|
10925
|
+
if (He(n) && He(s)) {
|
|
10924
10926
|
const o = s.getFirstChild();
|
|
10925
10927
|
if (H(o)) {
|
|
10926
10928
|
o.append(r);
|
|
10927
10929
|
const i = n.getFirstChild();
|
|
10928
10930
|
H(i) && (Lt(o, i.getChildren()), n.remove(), e.add(n.getKey()));
|
|
10929
10931
|
}
|
|
10930
|
-
} else if (
|
|
10932
|
+
} else if (He(n)) {
|
|
10931
10933
|
const o = n.getFirstChild();
|
|
10932
10934
|
if (H(o)) {
|
|
10933
10935
|
const i = o.getFirstChild();
|
|
10934
10936
|
i !== null && i.insertBefore(r);
|
|
10935
10937
|
}
|
|
10936
|
-
} else if (
|
|
10938
|
+
} else if (He(s)) {
|
|
10937
10939
|
const o = s.getFirstChild();
|
|
10938
10940
|
H(o) && o.append(r);
|
|
10939
10941
|
} else if (H(t)) {
|
|
10940
|
-
const o =
|
|
10942
|
+
const o = ke(), i = Ce(t.getListType());
|
|
10941
10943
|
o.append(i), i.append(r), s ? s.insertAfter(o) : n ? n.insertBefore(o) : t.append(o);
|
|
10942
10944
|
}
|
|
10943
10945
|
}
|
|
10944
10946
|
function Ud(r) {
|
|
10945
|
-
if (
|
|
10947
|
+
if (He(r)) return;
|
|
10946
10948
|
const e = r.getParent(), t = e ? e.getParent() : void 0;
|
|
10947
10949
|
if (H(t ? t.getParent() : void 0) && ee(t) && H(e)) {
|
|
10948
10950
|
const n = e ? e.getFirstChild() : void 0, s = e ? e.getLastChild() : void 0;
|
|
10949
10951
|
if (r.is(n)) t.insertBefore(r), e.isEmpty() && t.remove();
|
|
10950
10952
|
else if (r.is(s)) t.insertAfter(r), e.isEmpty() && t.remove();
|
|
10951
10953
|
else {
|
|
10952
|
-
const o = e.getListType(), i =
|
|
10954
|
+
const o = e.getListType(), i = ke(), u = Ce(o);
|
|
10953
10955
|
i.append(u), r.getPreviousSiblings().forEach((c) => u.append(c));
|
|
10954
|
-
const l =
|
|
10956
|
+
const l = ke(), a = Ce(o);
|
|
10955
10957
|
l.append(a), Lt(a, r.getNextSiblings()), t.insertBefore(i), t.insertAfter(l), t.replace(r);
|
|
10956
10958
|
}
|
|
10957
10959
|
}
|
|
10958
10960
|
}
|
|
10959
10961
|
function Wd() {
|
|
10960
|
-
const r =
|
|
10962
|
+
const r = j();
|
|
10961
10963
|
if (!B(r) || !r.isCollapsed()) return !1;
|
|
10962
10964
|
const e = r.anchor.getNode();
|
|
10963
10965
|
if (!ee(e) || e.getChildrenSize() !== 0) return !1;
|
|
10964
10966
|
const t = Vs(e), n = e.getParent();
|
|
10965
|
-
H(n) ||
|
|
10967
|
+
H(n) || Ke(40);
|
|
10966
10968
|
const s = n.getParent();
|
|
10967
10969
|
let o;
|
|
10968
|
-
if (
|
|
10970
|
+
if (Je(s)) o = le(), t.insertAfter(o);
|
|
10969
10971
|
else {
|
|
10970
10972
|
if (!ee(s)) return !1;
|
|
10971
|
-
o =
|
|
10973
|
+
o = ke(), s.insertAfter(o);
|
|
10972
10974
|
}
|
|
10973
10975
|
o.select();
|
|
10974
10976
|
const i = e.getNextSiblings();
|
|
10975
10977
|
if (i.length > 0) {
|
|
10976
|
-
const u =
|
|
10978
|
+
const u = Ce(n.getListType());
|
|
10977
10979
|
if (Zt(o)) o.insertAfter(u);
|
|
10978
10980
|
else {
|
|
10979
|
-
const l =
|
|
10981
|
+
const l = ke();
|
|
10980
10982
|
l.append(u), o.insertAfter(l);
|
|
10981
10983
|
}
|
|
10982
10984
|
i.forEach((l) => {
|
|
@@ -11018,7 +11020,7 @@ class Rt extends ot {
|
|
|
11018
11020
|
}
|
|
11019
11021
|
static transform() {
|
|
11020
11022
|
return (e) => {
|
|
11021
|
-
if (ee(e) ||
|
|
11023
|
+
if (ee(e) || Ke(144), e.__checked == null) return;
|
|
11022
11024
|
const t = e.getParent();
|
|
11023
11025
|
H(t) && t.getListType() !== "check" && e.getChecked() != null && e.setChecked(void 0);
|
|
11024
11026
|
};
|
|
@@ -11027,7 +11029,7 @@ class Rt extends ot {
|
|
|
11027
11029
|
return { li: () => ({ conversion: Vd, priority: 0 }) };
|
|
11028
11030
|
}
|
|
11029
11031
|
static importJSON(e) {
|
|
11030
|
-
const t =
|
|
11032
|
+
const t = ke();
|
|
11031
11033
|
return t.setChecked(e.checked), t.setValue(e.value), t.setFormat(e.format), t.setDirection(e.direction), t;
|
|
11032
11034
|
}
|
|
11033
11035
|
exportDOM(e) {
|
|
@@ -11055,7 +11057,7 @@ class Rt extends ot {
|
|
|
11055
11057
|
if (n.__first === this.getKey()) n.insertBefore(e);
|
|
11056
11058
|
else if (n.__last === this.getKey()) n.insertAfter(e);
|
|
11057
11059
|
else {
|
|
11058
|
-
const s =
|
|
11060
|
+
const s = Ce(n.getListType());
|
|
11059
11061
|
let o = this.getNextSibling();
|
|
11060
11062
|
for (; o; ) {
|
|
11061
11063
|
const i = o;
|
|
@@ -11063,30 +11065,30 @@ class Rt extends ot {
|
|
|
11063
11065
|
}
|
|
11064
11066
|
n.insertAfter(e), e.insertAfter(s);
|
|
11065
11067
|
}
|
|
11066
|
-
return t && (E(e) ||
|
|
11068
|
+
return t && (E(e) || Ke(139), this.getChildren().forEach((s) => {
|
|
11067
11069
|
e.append(s);
|
|
11068
11070
|
})), this.remove(), n.getChildrenSize() === 0 && n.remove(), e;
|
|
11069
11071
|
}
|
|
11070
11072
|
insertAfter(e, t = !0) {
|
|
11071
11073
|
const n = this.getParentOrThrow();
|
|
11072
|
-
if (H(n) ||
|
|
11074
|
+
if (H(n) || Ke(39), ee(e)) return super.insertAfter(e, t);
|
|
11073
11075
|
const s = this.getNextSiblings();
|
|
11074
11076
|
if (n.insertAfter(e, t), s.length !== 0) {
|
|
11075
|
-
const o =
|
|
11077
|
+
const o = Ce(n.getListType());
|
|
11076
11078
|
s.forEach((i) => o.append(i)), e.insertAfter(o, t);
|
|
11077
11079
|
}
|
|
11078
11080
|
return e;
|
|
11079
11081
|
}
|
|
11080
11082
|
remove(e) {
|
|
11081
11083
|
const t = this.getPreviousSibling(), n = this.getNextSibling();
|
|
11082
|
-
super.remove(e), t && n &&
|
|
11084
|
+
super.remove(e), t && n && He(t) && He(n) && (bi(t.getFirstChild(), n.getFirstChild()), n.remove());
|
|
11083
11085
|
}
|
|
11084
11086
|
insertNewAfter(e, t = !0) {
|
|
11085
|
-
const n =
|
|
11087
|
+
const n = ke(this.__checked == null && void 0);
|
|
11086
11088
|
return this.insertAfter(n, t), n;
|
|
11087
11089
|
}
|
|
11088
11090
|
collapseAtStart(e) {
|
|
11089
|
-
const t =
|
|
11091
|
+
const t = le();
|
|
11090
11092
|
this.getChildren().forEach((i) => t.append(i));
|
|
11091
11093
|
const n = this.getParentOrThrow(), s = n.getParentOrThrow(), o = ee(s);
|
|
11092
11094
|
if (n.getChildrenSize() === 1) if (o) n.remove(), s.select();
|
|
@@ -11124,7 +11126,7 @@ class Rt extends ot {
|
|
|
11124
11126
|
return n;
|
|
11125
11127
|
}
|
|
11126
11128
|
setIndent(e) {
|
|
11127
|
-
typeof e != "number" &&
|
|
11129
|
+
typeof e != "number" && Ke(117), (e = Math.floor(e)) >= 0 || Ke(199);
|
|
11128
11130
|
let t = this.getIndent();
|
|
11129
11131
|
for (; t !== e; ) t < e ? (zd(this), t++) : (Ud(this), t--);
|
|
11130
11132
|
return this;
|
|
@@ -11147,7 +11149,7 @@ class Rt extends ot {
|
|
|
11147
11149
|
return !0;
|
|
11148
11150
|
}
|
|
11149
11151
|
createParentElementNode() {
|
|
11150
|
-
return
|
|
11152
|
+
return Ce("bullet");
|
|
11151
11153
|
}
|
|
11152
11154
|
canMergeWhenEmpty() {
|
|
11153
11155
|
return !0;
|
|
@@ -11174,13 +11176,13 @@ function Vd(r) {
|
|
|
11174
11176
|
for (const t of r.children) if (t.tagName === "INPUT") return Kd(t);
|
|
11175
11177
|
}
|
|
11176
11178
|
const e = r.getAttribute("aria-checked");
|
|
11177
|
-
return { node:
|
|
11179
|
+
return { node: ke(e === "true" || e !== "false" && void 0) };
|
|
11178
11180
|
}
|
|
11179
11181
|
function Kd(r) {
|
|
11180
|
-
return r.getAttribute("type") !== "checkbox" ? { node: null } : { node:
|
|
11182
|
+
return r.getAttribute("type") !== "checkbox" ? { node: null } : { node: ke(r.hasAttribute("checked")) };
|
|
11181
11183
|
}
|
|
11182
|
-
function
|
|
11183
|
-
return
|
|
11184
|
+
function ke(r) {
|
|
11185
|
+
return Xe(new Rt(void 0, r));
|
|
11184
11186
|
}
|
|
11185
11187
|
function ee(r) {
|
|
11186
11188
|
return r instanceof Rt;
|
|
@@ -11220,7 +11222,7 @@ class sr extends ot {
|
|
|
11220
11222
|
}
|
|
11221
11223
|
static transform() {
|
|
11222
11224
|
return (e) => {
|
|
11223
|
-
H(e) ||
|
|
11225
|
+
H(e) || Ke(163), function(t) {
|
|
11224
11226
|
const n = t.getNextSibling();
|
|
11225
11227
|
H(n) && t.getListType() === n.getListType() && bi(t, n);
|
|
11226
11228
|
}(e), function(t) {
|
|
@@ -11234,7 +11236,7 @@ class sr extends ot {
|
|
|
11234
11236
|
return { ol: () => ({ conversion: Ko, priority: 0 }), ul: () => ({ conversion: Ko, priority: 0 }) };
|
|
11235
11237
|
}
|
|
11236
11238
|
static importJSON(e) {
|
|
11237
|
-
const t =
|
|
11239
|
+
const t = Ce(e.listType, e.start);
|
|
11238
11240
|
return t.setFormat(e.format), t.setIndent(e.indent), t.setDirection(e.direction), t;
|
|
11239
11241
|
}
|
|
11240
11242
|
exportDOM(e) {
|
|
@@ -11255,11 +11257,11 @@ class sr extends ot {
|
|
|
11255
11257
|
const n = e[t];
|
|
11256
11258
|
if (ee(n)) super.append(n);
|
|
11257
11259
|
else {
|
|
11258
|
-
const s =
|
|
11260
|
+
const s = ke();
|
|
11259
11261
|
if (H(n)) s.append(n);
|
|
11260
11262
|
else if (E(n)) if (n.isInline()) s.append(n);
|
|
11261
11263
|
else {
|
|
11262
|
-
const o =
|
|
11264
|
+
const o = ce(n.getTextContent());
|
|
11263
11265
|
s.append(o);
|
|
11264
11266
|
}
|
|
11265
11267
|
else s.append(n);
|
|
@@ -11306,15 +11308,15 @@ function Hd(r) {
|
|
|
11306
11308
|
function Ko(r) {
|
|
11307
11309
|
const e = r.nodeName.toLowerCase();
|
|
11308
11310
|
let t = null;
|
|
11309
|
-
return e === "ol" ? t =
|
|
11311
|
+
return e === "ol" ? t = Ce("number", r.start) : e === "ul" && (t = function(n) {
|
|
11310
11312
|
if (n.getAttribute("__lexicallisttype") === "check" || n.classList.contains("contains-task-list")) return !0;
|
|
11311
11313
|
for (const s of n.childNodes) if (st(s) && s.hasAttribute("aria-checked")) return !0;
|
|
11312
11314
|
return !1;
|
|
11313
|
-
}(r) ?
|
|
11315
|
+
}(r) ? Ce("check") : Ce("bullet")), { after: Hd, node: t };
|
|
11314
11316
|
}
|
|
11315
11317
|
const Ho = { ol: "number", ul: "bullet" };
|
|
11316
|
-
function
|
|
11317
|
-
return
|
|
11318
|
+
function Ce(r, e = 1) {
|
|
11319
|
+
return Xe(new sr(r, e));
|
|
11318
11320
|
}
|
|
11319
11321
|
function H(r) {
|
|
11320
11322
|
return r instanceof sr;
|
|
@@ -11324,11 +11326,11 @@ function Jd(r) {
|
|
|
11324
11326
|
return Ot(r.registerCommand(_l, () => (qo(r, "number"), !0), Kt), r.registerCommand(yl, () => (qo(r, "bullet"), !0), Kt), r.registerCommand(Gd, () => (qd(r), !0), Kt), r.registerCommand(kr, () => !!Wd(), Kt));
|
|
11325
11327
|
}
|
|
11326
11328
|
function Qd() {
|
|
11327
|
-
const [r] =
|
|
11328
|
-
return
|
|
11329
|
+
const [r] = Ye();
|
|
11330
|
+
return ge(() => {
|
|
11329
11331
|
if (!r.hasNodes([sr, Rt])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
|
|
11330
11332
|
}, [r]), function(e) {
|
|
11331
|
-
|
|
11333
|
+
ge(() => Jd(e), [e]);
|
|
11332
11334
|
}(r), null;
|
|
11333
11335
|
}
|
|
11334
11336
|
const Yd = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "sms:", "tel:"]);
|
|
@@ -11435,7 +11437,7 @@ function Xd(r) {
|
|
|
11435
11437
|
return { node: e };
|
|
11436
11438
|
}
|
|
11437
11439
|
function Bn(r, e) {
|
|
11438
|
-
return
|
|
11440
|
+
return Xe(new jt(r, e));
|
|
11439
11441
|
}
|
|
11440
11442
|
function hr(r) {
|
|
11441
11443
|
return r instanceof jt;
|
|
@@ -11483,14 +11485,14 @@ class Kr extends jt {
|
|
|
11483
11485
|
}
|
|
11484
11486
|
}
|
|
11485
11487
|
function Go(r, e) {
|
|
11486
|
-
return
|
|
11488
|
+
return Xe(new Kr(r, e));
|
|
11487
11489
|
}
|
|
11488
11490
|
function Zd(r) {
|
|
11489
11491
|
return r instanceof Kr;
|
|
11490
11492
|
}
|
|
11491
11493
|
const Jo = Pr();
|
|
11492
11494
|
function vs(r, e = {}) {
|
|
11493
|
-
const { target: t, title: n } = e, s = e.rel === void 0 ? "noreferrer" : e.rel, o =
|
|
11495
|
+
const { target: t, title: n } = e, s = e.rel === void 0 ? "noreferrer" : e.rel, o = j();
|
|
11494
11496
|
if (!B(o)) return;
|
|
11495
11497
|
const i = o.extract();
|
|
11496
11498
|
if (r === null) i.forEach((u) => {
|
|
@@ -11528,8 +11530,8 @@ function vs(r, e = {}) {
|
|
|
11528
11530
|
}
|
|
11529
11531
|
}
|
|
11530
11532
|
function ef({ validateUrl: r, attributes: e }) {
|
|
11531
|
-
const [t] =
|
|
11532
|
-
return
|
|
11533
|
+
const [t] = Ye();
|
|
11534
|
+
return ge(() => {
|
|
11533
11535
|
if (!t.hasNodes([jt])) throw new Error("LinkPlugin: LinkNode not registered on editor");
|
|
11534
11536
|
return Ot(t.registerCommand(Jo, (n) => {
|
|
11535
11537
|
if (n === null) return vs(n), !0;
|
|
@@ -11539,7 +11541,7 @@ function ef({ validateUrl: r, attributes: e }) {
|
|
|
11539
11541
|
return vs(s, { ...e, rel: i, target: o, title: u }), !0;
|
|
11540
11542
|
}
|
|
11541
11543
|
}, Kt), r !== void 0 ? t.registerCommand(Fn, (n) => {
|
|
11542
|
-
const s =
|
|
11544
|
+
const s = j();
|
|
11543
11545
|
if (!B(s) || s.isCollapsed() || !gt(n, ClipboardEvent)) return !1;
|
|
11544
11546
|
const o = n;
|
|
11545
11547
|
if (o.clipboardData === null) return !1;
|
|
@@ -11579,7 +11581,7 @@ const tf = {
|
|
|
11579
11581
|
}
|
|
11580
11582
|
};
|
|
11581
11583
|
function nf({ theme: r, disabled: e }) {
|
|
11582
|
-
const [t] =
|
|
11584
|
+
const [t] = Ye(), n = Z(() => {
|
|
11583
11585
|
t.dispatchCommand(Re, "bold");
|
|
11584
11586
|
}, [t]), s = Z(() => {
|
|
11585
11587
|
t.dispatchCommand(Re, "italic");
|
|
@@ -11591,7 +11593,7 @@ function nf({ theme: r, disabled: e }) {
|
|
|
11591
11593
|
t.dispatchCommand(_l, void 0);
|
|
11592
11594
|
}, [t]), l = Z(() => {
|
|
11593
11595
|
t.update(() => {
|
|
11594
|
-
const f =
|
|
11596
|
+
const f = j();
|
|
11595
11597
|
B(f) && Jc(f, () => vi());
|
|
11596
11598
|
});
|
|
11597
11599
|
}, [t]), a = {
|
|
@@ -11739,13 +11741,13 @@ function nf({ theme: r, disabled: e }) {
|
|
|
11739
11741
|
);
|
|
11740
11742
|
}
|
|
11741
11743
|
function sf({ html: r }) {
|
|
11742
|
-
const [e] =
|
|
11743
|
-
return
|
|
11744
|
+
const [e] = Ye();
|
|
11745
|
+
return ge(() => {
|
|
11744
11746
|
r && e.update(() => {
|
|
11745
11747
|
const t = re();
|
|
11746
11748
|
t.clear();
|
|
11747
11749
|
const s = new DOMParser().parseFromString(r, "text/html"), o = ll(e, s);
|
|
11748
|
-
o.length > 0 ? t.append(...o) : t.append(
|
|
11750
|
+
o.length > 0 ? t.append(...o) : t.append(le());
|
|
11749
11751
|
});
|
|
11750
11752
|
}, []), null;
|
|
11751
11753
|
}
|
|
@@ -11926,7 +11928,7 @@ function xf({
|
|
|
11926
11928
|
}
|
|
11927
11929
|
),
|
|
11928
11930
|
placeholder: /* @__PURE__ */ v.jsx("div", { className: "mail-editor-placeholder", children: t }),
|
|
11929
|
-
ErrorBoundary:
|
|
11931
|
+
ErrorBoundary: Id
|
|
11930
11932
|
}
|
|
11931
11933
|
) }),
|
|
11932
11934
|
/* @__PURE__ */ v.jsx(Qd, {}),
|