@chaulapatrice/richtext-editor 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,179 +2,474 @@ import { a as e, s as t, t as n } from "./chunk-DtEjhu0W.js";
2
2
  import { t as r } from "./chunk-ZUYEQ4TG-DyRB4dkI.js";
3
3
  import { i } from "./chunk-SRAX5OIU-ChrAirkN.js";
4
4
  import a from "react";
5
- //#region node_modules/react/cjs/react-jsx-runtime.production.js
6
- var o = /* @__PURE__ */ n(((e) => {
7
- var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
8
- function r(e, n, r) {
9
- var i = null;
10
- if (r !== void 0 && (i = "" + r), n.key !== void 0 && (i = "" + n.key), "key" in n) for (var a in r = {}, n) a !== "key" && (r[a] = n[a]);
11
- else r = n;
12
- return n = r.ref, {
13
- $$typeof: t,
5
+ //#region node_modules/react/cjs/react-jsx-runtime.production.min.js
6
+ var o = /* @__PURE__ */ n(((t) => {
7
+ var n = e("react"), r = Symbol.for("react.element"), i = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, o = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = {
8
+ key: !0,
9
+ ref: !0,
10
+ __self: !0,
11
+ __source: !0
12
+ };
13
+ function c(e, t, n) {
14
+ var i, c = {}, l = null, u = null;
15
+ for (i in n !== void 0 && (l = "" + n), t.key !== void 0 && (l = "" + t.key), t.ref !== void 0 && (u = t.ref), t) a.call(t, i) && !s.hasOwnProperty(i) && (c[i] = t[i]);
16
+ if (e && e.defaultProps) for (i in t = e.defaultProps, t) c[i] === void 0 && (c[i] = t[i]);
17
+ return {
18
+ $$typeof: r,
14
19
  type: e,
15
- key: i,
16
- ref: n === void 0 ? null : n,
17
- props: r
20
+ key: l,
21
+ ref: u,
22
+ props: c,
23
+ _owner: o.current
18
24
  };
19
25
  }
20
- e.Fragment = n, e.jsx = r, e.jsxs = r;
26
+ t.Fragment = i, t.jsx = c, t.jsxs = c;
21
27
  })), s = /* @__PURE__ */ n(((t) => {
22
28
  process.env.NODE_ENV !== "production" && (function() {
23
- function n(e) {
29
+ var n = e("react"), r = Symbol.for("react.element"), i = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), l = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), g = Symbol.iterator, _ = "@@iterator";
30
+ function v(e) {
31
+ if (typeof e != "object" || !e) return null;
32
+ var t = g && e[g] || e[_];
33
+ return typeof t == "function" ? t : null;
34
+ }
35
+ var y = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
36
+ function b(e) {
37
+ x("error", e, [...arguments].slice(1));
38
+ }
39
+ function x(e, t, n) {
40
+ var r = y.ReactDebugCurrentFrame.getStackAddendum();
41
+ r !== "" && (t += "%s", n = n.concat([r]));
42
+ var i = n.map(function(e) {
43
+ return String(e);
44
+ });
45
+ i.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, i);
46
+ }
47
+ var S = !1, C = !1, w = !1, T = !1, E = !1, D = Symbol.for("react.module.reference");
48
+ function ee(e) {
49
+ return !!(typeof e == "string" || typeof e == "function" || e === a || e === s || E || e === o || e === d || e === f || T || e === h || S || C || w || typeof e == "object" && e && (e.$$typeof === m || e.$$typeof === p || e.$$typeof === c || e.$$typeof === l || e.$$typeof === u || e.$$typeof === D || e.getModuleId !== void 0));
50
+ }
51
+ function te(e, t, n) {
52
+ var r = e.displayName;
53
+ if (r) return r;
54
+ var i = t.displayName || t.name || "";
55
+ return i === "" ? n : n + "(" + i + ")";
56
+ }
57
+ function ne(e) {
58
+ return e.displayName || "Context";
59
+ }
60
+ function re(e) {
24
61
  if (e == null) return null;
25
- if (typeof e == "function") return e.$$typeof === te ? null : e.displayName || e.name || null;
62
+ if (typeof e.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function") return e.displayName || e.name || null;
26
63
  if (typeof e == "string") return e;
27
64
  switch (e) {
28
- case v: return "Fragment";
29
- case b: return "Profiler";
30
- case y: return "StrictMode";
31
- case w: return "Suspense";
32
- case T: return "SuspenseList";
33
- case ee: return "Activity";
65
+ case a: return "Fragment";
66
+ case i: return "Portal";
67
+ case s: return "Profiler";
68
+ case o: return "StrictMode";
69
+ case d: return "Suspense";
70
+ case f: return "SuspenseList";
34
71
  }
35
- if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
36
- case _: return "Portal";
37
- case S: return e.displayName || "Context";
38
- case x: return (e._context.displayName || "Context") + ".Consumer";
39
- case C:
40
- var t = e.render;
41
- return e = e.displayName, e ||= (e = t.displayName || t.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
42
- case E: return t = e.displayName || null, t === null ? n(e.type) || "Memo" : t;
43
- case D:
44
- t = e._payload, e = e._init;
72
+ if (typeof e == "object") switch (e.$$typeof) {
73
+ case l: return ne(e) + ".Consumer";
74
+ case c: return ne(e._context) + ".Provider";
75
+ case u: return te(e, e.render, "ForwardRef");
76
+ case p:
77
+ var t = e.displayName || null;
78
+ return t === null ? re(e.type) || "Memo" : t;
79
+ case m:
80
+ var n = e, r = n._payload, h = n._init;
45
81
  try {
46
- return n(e(t));
47
- } catch {}
82
+ return re(h(r));
83
+ } catch {
84
+ return null;
85
+ }
48
86
  }
49
87
  return null;
50
88
  }
51
- function r(e) {
52
- return "" + e;
89
+ var ie = Object.assign, ae = 0, oe, se, ce, le, ue, de, fe;
90
+ function pe() {}
91
+ pe.__reactDisabledLog = !0;
92
+ function me() {
93
+ if (ae === 0) {
94
+ oe = console.log, se = console.info, ce = console.warn, le = console.error, ue = console.group, de = console.groupCollapsed, fe = console.groupEnd;
95
+ var e = {
96
+ configurable: !0,
97
+ enumerable: !0,
98
+ value: pe,
99
+ writable: !0
100
+ };
101
+ Object.defineProperties(console, {
102
+ info: e,
103
+ log: e,
104
+ warn: e,
105
+ error: e,
106
+ group: e,
107
+ groupCollapsed: e,
108
+ groupEnd: e
109
+ });
110
+ }
111
+ ae++;
112
+ }
113
+ function he() {
114
+ if (ae--, ae === 0) {
115
+ var e = {
116
+ configurable: !0,
117
+ enumerable: !0,
118
+ writable: !0
119
+ };
120
+ Object.defineProperties(console, {
121
+ log: ie({}, e, { value: oe }),
122
+ info: ie({}, e, { value: se }),
123
+ warn: ie({}, e, { value: ce }),
124
+ error: ie({}, e, { value: le }),
125
+ group: ie({}, e, { value: ue }),
126
+ groupCollapsed: ie({}, e, { value: de }),
127
+ groupEnd: ie({}, e, { value: fe })
128
+ });
129
+ }
130
+ ae < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
53
131
  }
54
- function i(e) {
132
+ var ge = y.ReactCurrentDispatcher, _e;
133
+ function ve(e, t, n) {
134
+ if (_e === void 0) try {
135
+ throw Error();
136
+ } catch (e) {
137
+ var r = e.stack.trim().match(/\n( *(at )?)/);
138
+ _e = r && r[1] || "";
139
+ }
140
+ return "\n" + _e + e;
141
+ }
142
+ var ye = !1, be = new (typeof WeakMap == "function" ? WeakMap : Map)();
143
+ function xe(e, t) {
144
+ if (!e || ye) return "";
145
+ var n = be.get(e);
146
+ if (n !== void 0) return n;
147
+ var r;
148
+ ye = !0;
149
+ var i = Error.prepareStackTrace;
150
+ Error.prepareStackTrace = void 0;
151
+ var a = ge.current;
152
+ ge.current = null, me();
55
153
  try {
56
- r(e);
57
- var t = !1;
58
- } catch {
59
- t = !0;
154
+ if (t) {
155
+ var o = function() {
156
+ throw Error();
157
+ };
158
+ if (Object.defineProperty(o.prototype, "props", { set: function() {
159
+ throw Error();
160
+ } }), typeof Reflect == "object" && Reflect.construct) {
161
+ try {
162
+ Reflect.construct(o, []);
163
+ } catch (e) {
164
+ r = e;
165
+ }
166
+ Reflect.construct(e, [], o);
167
+ } else {
168
+ try {
169
+ o.call();
170
+ } catch (e) {
171
+ r = e;
172
+ }
173
+ e.call(o.prototype);
174
+ }
175
+ } else {
176
+ try {
177
+ throw Error();
178
+ } catch (e) {
179
+ r = e;
180
+ }
181
+ e();
182
+ }
183
+ } catch (t) {
184
+ if (t && r && typeof t.stack == "string") {
185
+ for (var s = t.stack.split("\n"), c = r.stack.split("\n"), l = s.length - 1, u = c.length - 1; l >= 1 && u >= 0 && s[l] !== c[u];) u--;
186
+ for (; l >= 1 && u >= 0; l--, u--) if (s[l] !== c[u]) {
187
+ if (l !== 1 || u !== 1) do
188
+ if (l--, u--, u < 0 || s[l] !== c[u]) {
189
+ var d = "\n" + s[l].replace(" at new ", " at ");
190
+ return e.displayName && d.includes("<anonymous>") && (d = d.replace("<anonymous>", e.displayName)), typeof e == "function" && be.set(e, d), d;
191
+ }
192
+ while (l >= 1 && u >= 0);
193
+ break;
194
+ }
195
+ }
196
+ } finally {
197
+ ye = !1, ge.current = a, he(), Error.prepareStackTrace = i;
60
198
  }
61
- if (t) {
62
- t = console;
63
- var n = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
64
- return n.call(t, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", i), r(e);
199
+ var f = e ? e.displayName || e.name : "", p = f ? ve(f) : "";
200
+ return typeof e == "function" && be.set(e, p), p;
201
+ }
202
+ function Se(e, t, n) {
203
+ return xe(e, !1);
204
+ }
205
+ function Ce(e) {
206
+ var t = e.prototype;
207
+ return !!(t && t.isReactComponent);
208
+ }
209
+ function we(e, t, n) {
210
+ if (e == null) return "";
211
+ if (typeof e == "function") return xe(e, Ce(e));
212
+ if (typeof e == "string") return ve(e);
213
+ switch (e) {
214
+ case d: return ve("Suspense");
215
+ case f: return ve("SuspenseList");
216
+ }
217
+ if (typeof e == "object") switch (e.$$typeof) {
218
+ case u: return Se(e.render);
219
+ case p: return we(e.type, t, n);
220
+ case m:
221
+ var r = e, i = r._payload, a = r._init;
222
+ try {
223
+ return we(a(i), t, n);
224
+ } catch {}
65
225
  }
226
+ return "";
66
227
  }
67
- function a(e) {
68
- if (e === v) return "<>";
69
- if (typeof e == "object" && e && e.$$typeof === D) return "<...>";
228
+ var Te = Object.prototype.hasOwnProperty, Ee = {}, De = y.ReactDebugCurrentFrame;
229
+ function Oe(e) {
230
+ if (e) {
231
+ var t = e._owner, n = we(e.type, e._source, t ? t.type : null);
232
+ De.setExtraStackFrame(n);
233
+ } else De.setExtraStackFrame(null);
234
+ }
235
+ function ke(e, t, n, r, i) {
236
+ var a = Function.call.bind(Te);
237
+ for (var o in e) if (a(e, o)) {
238
+ var s = void 0;
239
+ try {
240
+ if (typeof e[o] != "function") {
241
+ var c = Error((r || "React class") + ": " + n + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
242
+ throw c.name = "Invariant Violation", c;
243
+ }
244
+ s = e[o](t, o, r, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
245
+ } catch (e) {
246
+ s = e;
247
+ }
248
+ s && !(s instanceof Error) && (Oe(i), b("%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).", r || "React class", n, o, typeof s), Oe(null)), s instanceof Error && !(s.message in Ee) && (Ee[s.message] = !0, Oe(i), b("Failed %s type: %s", n, s.message), Oe(null));
249
+ }
250
+ }
251
+ var Ae = Array.isArray;
252
+ function je(e) {
253
+ return Ae(e);
254
+ }
255
+ function Me(e) {
256
+ return typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
257
+ }
258
+ function Ne(e) {
70
259
  try {
71
- var t = n(e);
72
- return t ? "<" + t + ">" : "<...>";
260
+ return Pe(e), !1;
73
261
  } catch {
74
- return "<...>";
262
+ return !0;
75
263
  }
76
264
  }
77
- function o() {
78
- var e = ne.A;
79
- return e === null ? null : e.getOwner();
265
+ function Pe(e) {
266
+ return "" + e;
80
267
  }
81
- function s() {
82
- return Error("react-stack-top-frame");
268
+ function Fe(e) {
269
+ if (Ne(e)) return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Me(e)), Pe(e);
270
+ }
271
+ var Ie = y.ReactCurrentOwner, Le = {
272
+ key: !0,
273
+ ref: !0,
274
+ __self: !0,
275
+ __source: !0
276
+ }, Re, ze, Be = {};
277
+ function Ve(e) {
278
+ if (Te.call(e, "ref")) {
279
+ var t = Object.getOwnPropertyDescriptor(e, "ref").get;
280
+ if (t && t.isReactWarning) return !1;
281
+ }
282
+ return e.ref !== void 0;
83
283
  }
84
- function c(e) {
85
- if (re.call(e, "key")) {
284
+ function He(e) {
285
+ if (Te.call(e, "key")) {
86
286
  var t = Object.getOwnPropertyDescriptor(e, "key").get;
87
287
  if (t && t.isReactWarning) return !1;
88
288
  }
89
289
  return e.key !== void 0;
90
290
  }
91
- function l(e, t) {
92
- function n() {
93
- oe || (oe = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
291
+ function Ue(e, t) {
292
+ if (typeof e.ref == "string" && Ie.current && t && Ie.current.stateNode !== t) {
293
+ var n = re(Ie.current.type);
294
+ Be[n] || (b("Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref", re(Ie.current.type), e.ref), Be[n] = !0);
94
295
  }
296
+ }
297
+ function We(e, t) {
298
+ var n = function() {
299
+ Re || (Re = !0, b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
300
+ };
95
301
  n.isReactWarning = !0, Object.defineProperty(e, "key", {
96
302
  get: n,
97
303
  configurable: !0
98
304
  });
99
305
  }
100
- function u() {
101
- var e = n(this.type);
102
- return se[e] || (se[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
306
+ function Ge(e, t) {
307
+ var n = function() {
308
+ ze || (ze = !0, b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
309
+ };
310
+ n.isReactWarning = !0, Object.defineProperty(e, "ref", {
311
+ get: n,
312
+ configurable: !0
313
+ });
103
314
  }
104
- function d(e, t, n, r, i, a) {
105
- var o = n.ref;
106
- return e = {
107
- $$typeof: g,
315
+ var Ke = function(e, t, n, i, a, o, s) {
316
+ var c = {
317
+ $$typeof: r,
108
318
  type: e,
109
319
  key: t,
110
- props: n,
111
- _owner: r
112
- }, (o === void 0 ? null : o) === null ? Object.defineProperty(e, "ref", {
113
- enumerable: !1,
114
- value: null
115
- }) : Object.defineProperty(e, "ref", {
116
- enumerable: !1,
117
- get: u
118
- }), e._store = {}, Object.defineProperty(e._store, "validated", {
119
- configurable: !1,
120
- enumerable: !1,
121
- writable: !0,
122
- value: 0
123
- }), Object.defineProperty(e, "_debugInfo", {
320
+ ref: n,
321
+ props: s,
322
+ _owner: o
323
+ };
324
+ return c._store = {}, Object.defineProperty(c._store, "validated", {
124
325
  configurable: !1,
125
326
  enumerable: !1,
126
327
  writable: !0,
127
- value: null
128
- }), Object.defineProperty(e, "_debugStack", {
328
+ value: !1
329
+ }), Object.defineProperty(c, "_self", {
129
330
  configurable: !1,
130
331
  enumerable: !1,
131
- writable: !0,
332
+ writable: !1,
132
333
  value: i
133
- }), Object.defineProperty(e, "_debugTask", {
334
+ }), Object.defineProperty(c, "_source", {
134
335
  configurable: !1,
135
336
  enumerable: !1,
136
- writable: !0,
337
+ writable: !1,
137
338
  value: a
138
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
139
- }
140
- function f(e, t, r, a, s, u) {
141
- var f = t.children;
142
- if (f !== void 0) if (a) if (ie(f)) {
143
- for (a = 0; a < f.length; a++) p(f[a]);
144
- Object.freeze && Object.freeze(f);
145
- } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
146
- else p(f);
147
- if (re.call(t, "key")) {
148
- f = n(e);
149
- var m = Object.keys(t).filter(function(e) {
339
+ }), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
340
+ };
341
+ function qe(e, t, n, r, i) {
342
+ var a, o = {}, s = null, c = null;
343
+ for (a in n !== void 0 && (Fe(n), s = "" + n), He(t) && (Fe(t.key), s = "" + t.key), Ve(t) && (c = t.ref, Ue(t, i)), t) Te.call(t, a) && !Le.hasOwnProperty(a) && (o[a] = t[a]);
344
+ if (e && e.defaultProps) {
345
+ var l = e.defaultProps;
346
+ for (a in l) o[a] === void 0 && (o[a] = l[a]);
347
+ }
348
+ if (s || c) {
349
+ var u = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
350
+ s && We(o, u), c && Ge(o, u);
351
+ }
352
+ return Ke(e, s, c, i, r, Ie.current, o);
353
+ }
354
+ var Je = y.ReactCurrentOwner, Ye = y.ReactDebugCurrentFrame;
355
+ function Xe(e) {
356
+ if (e) {
357
+ var t = e._owner, n = we(e.type, e._source, t ? t.type : null);
358
+ Ye.setExtraStackFrame(n);
359
+ } else Ye.setExtraStackFrame(null);
360
+ }
361
+ var Ze = !1;
362
+ function Qe(e) {
363
+ return typeof e == "object" && !!e && e.$$typeof === r;
364
+ }
365
+ function $e() {
366
+ if (Je.current) {
367
+ var e = re(Je.current.type);
368
+ if (e) return "\n\nCheck the render method of `" + e + "`.";
369
+ }
370
+ return "";
371
+ }
372
+ function et(e) {
373
+ if (e !== void 0) {
374
+ var t = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
375
+ return "\n\nCheck your code at " + t + ":" + n + ".";
376
+ }
377
+ return "";
378
+ }
379
+ var tt = {};
380
+ function nt(e) {
381
+ var t = $e();
382
+ if (!t) {
383
+ var n = typeof e == "string" ? e : e.displayName || e.name;
384
+ n && (t = "\n\nCheck the top-level render call using <" + n + ">.");
385
+ }
386
+ return t;
387
+ }
388
+ function rt(e, t) {
389
+ if (!(!e._store || e._store.validated || e.key != null)) {
390
+ e._store.validated = !0;
391
+ var n = nt(t);
392
+ if (!tt[n]) {
393
+ tt[n] = !0;
394
+ var r = "";
395
+ e && e._owner && e._owner !== Je.current && (r = " It was passed a child from " + re(e._owner.type) + "."), Xe(e), b("Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.", n, r), Xe(null);
396
+ }
397
+ }
398
+ }
399
+ function it(e, t) {
400
+ if (typeof e == "object") {
401
+ if (je(e)) for (var n = 0; n < e.length; n++) {
402
+ var r = e[n];
403
+ Qe(r) && rt(r, t);
404
+ }
405
+ else if (Qe(e)) e._store && (e._store.validated = !0);
406
+ else if (e) {
407
+ var i = v(e);
408
+ if (typeof i == "function" && i !== e.entries) for (var a = i.call(e), o; !(o = a.next()).done;) Qe(o.value) && rt(o.value, t);
409
+ }
410
+ }
411
+ }
412
+ function at(e) {
413
+ var t = e.type;
414
+ if (!(t == null || typeof t == "string")) {
415
+ var n;
416
+ if (typeof t == "function") n = t.propTypes;
417
+ else if (typeof t == "object" && (t.$$typeof === u || t.$$typeof === p)) n = t.propTypes;
418
+ else return;
419
+ if (n) {
420
+ var r = re(t);
421
+ ke(n, e.props, "prop", r, e);
422
+ } else t.PropTypes !== void 0 && !Ze && (Ze = !0, b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", re(t) || "Unknown"));
423
+ typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
424
+ }
425
+ }
426
+ function ot(e) {
427
+ for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
428
+ var r = t[n];
429
+ if (r !== "children" && r !== "key") {
430
+ Xe(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", r), Xe(null);
431
+ break;
432
+ }
433
+ }
434
+ e.ref !== null && (Xe(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), Xe(null));
435
+ }
436
+ var st = {};
437
+ function ct(e, t, n, i, o, s) {
438
+ var c = ee(e);
439
+ if (!c) {
440
+ var l = "";
441
+ (e === void 0 || typeof e == "object" && e && Object.keys(e).length === 0) && (l += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
442
+ var u = et(o);
443
+ u ? l += u : l += $e();
444
+ var d;
445
+ e === null ? d = "null" : je(e) ? d = "array" : e !== void 0 && e.$$typeof === r ? (d = "<" + (re(e.type) || "Unknown") + " />", l = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, l);
446
+ }
447
+ var f = qe(e, t, n, o, s);
448
+ if (f == null) return f;
449
+ if (c) {
450
+ var p = t.children;
451
+ if (p !== void 0) if (i) if (je(p)) {
452
+ for (var m = 0; m < p.length; m++) it(p[m], e);
453
+ Object.freeze && Object.freeze(p);
454
+ } else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
455
+ else it(p, e);
456
+ }
457
+ if (Te.call(t, "key")) {
458
+ var h = re(e), g = Object.keys(t).filter(function(e) {
150
459
  return e !== "key";
151
- });
152
- a = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", ue[f + a] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", a, f, m, f), ue[f + a] = !0);
460
+ }), _ = g.length > 0 ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}";
461
+ st[h + _] || (b("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", _, h, g.length > 0 ? "{" + g.join(": ..., ") + ": ...}" : "{}", h), st[h + _] = !0);
153
462
  }
154
- if (f = null, r !== void 0 && (i(r), f = "" + r), c(t) && (i(t.key), f = "" + t.key), "key" in t) for (var h in r = {}, t) h !== "key" && (r[h] = t[h]);
155
- else r = t;
156
- return f && l(r, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), d(e, f, r, o(), s, u);
463
+ return e === a ? ot(f) : at(f), f;
157
464
  }
158
- function p(e) {
159
- m(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === D && (e._payload.status === "fulfilled" ? m(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
465
+ function lt(e, t, n) {
466
+ return ct(e, t, n, !0);
160
467
  }
161
- function m(e) {
162
- return typeof e == "object" && !!e && e.$$typeof === g;
468
+ function ut(e, t, n) {
469
+ return ct(e, t, n, !1);
163
470
  }
164
- var h = e("react"), g = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), S = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), ee = Symbol.for("react.activity"), te = Symbol.for("react.client.reference"), ne = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, re = Object.prototype.hasOwnProperty, ie = Array.isArray, ae = console.createTask ? console.createTask : function() {
165
- return null;
166
- };
167
- h = { react_stack_bottom_frame: function(e) {
168
- return e();
169
- } };
170
- var oe, se = {}, ce = h.react_stack_bottom_frame.bind(h, s)(), le = ae(a(s)), ue = {};
171
- t.Fragment = v, t.jsx = function(e, t, n) {
172
- var r = 1e4 > ne.recentlyCreatedOwnerStacks++;
173
- return f(e, t, n, !1, r ? Error("react-stack-top-frame") : ce, r ? ae(a(e)) : le);
174
- }, t.jsxs = function(e, t, n) {
175
- var r = 1e4 > ne.recentlyCreatedOwnerStacks++;
176
- return f(e, t, n, !0, r ? Error("react-stack-top-frame") : ce, r ? ae(a(e)) : le);
177
- };
471
+ var dt = ut, ft = lt;
472
+ t.Fragment = a, t.jsx = dt, t.jsxs = ft;
178
473
  })();
179
474
  })), c = /* @__PURE__ */ n(((e, t) => {
180
475
  process.env.NODE_ENV === "production" ? t.exports = o() : t.exports = s();
@@ -16259,7 +16554,7 @@ var eE = $T, $ = (e, t, n = !0, r) => {
16259
16554
  } : e), $E = (e) => QE(e), eD = (e) => QE(e), tD = async (e) => {
16260
16555
  let t;
16261
16556
  if (e.type === N.png) try {
16262
- return await (await import("./image-GAAHSSAO-BU9ODTqe.js")).decodePngMetadata(e);
16557
+ return await (await import("./image-GAAHSSAO-sdevgWOw.js")).decodePngMetadata(e);
16263
16558
  } catch (e) {
16264
16559
  throw e.message === "INVALID" ? new yh("Image doesn't contain scene", "IMAGE_NOT_CONTAINS_SCENE_DATA") : new yh("Error: cannot restore image");
16265
16560
  }
@@ -1,3 +1,3 @@
1
- import { Ba as e, Os as t } from "./chunk-K2UTITRG-BGSulWJm.js";
1
+ import { Ba as e, Os as t } from "./chunk-K2UTITRG-nWrUL4WL.js";
2
2
  import "./chunk-SRAX5OIU-ChrAirkN.js";
3
3
  export { t as decodePngMetadata, e as encodePngMetadata };
@@ -1,5 +1,5 @@
1
1
  import { a as e, r as t, s as n, t as r } from "./chunk-DtEjhu0W.js";
2
- import { $ as i, $a as a, $c as o, $i as s, $l as c, $n as l, $o as u, $r as d, $s as f, $t as p, A as m, Ac as h, Ai as g, Al as _, An as v, Ao as y, Ar as b, As as x, At as S, Au as C, B as w, Bc as ee, Bi as T, Bl as te, Bn as ne, Bo as re, Br as E, Bs as ie, Bt as ae, Bu as oe, C as se, Ca as ce, Cc as le, Ci as ue, Cl as de, Cn as fe, Co as pe, Cr as me, Cs as he, Ct as ge, Cu as _e, D as ve, Da as ye, Dc as be, Di as xe, Dl as Se, Dn as Ce, Do as we, Dr as Te, Ds as Ee, Dt as De, Du as Oe, E as ke, Ea as Ae, Ec as je, Ei as Me, El as Ne, En as Pe, Eo as Fe, Er as Ie, Es as Le, Et as Re, Eu as ze, F as Be, Fa as Ve, Fc as He, Fi as Ue, Fl as We, Fn as Ge, Fo as Ke, Fr as qe, Fs as Je, Ft as Ye, Fu as Xe, G as Ze, Ga as Qe, Gc as eee, Gi as $e, Gl as et, Gn as tt, Go as nt, Gr as tee, Gs as rt, Gt as it, Gu as nee, H as ree, Ha as at, Hc as ot, Hi as iee, Hl as st, Hn as ct, Ho as lt, Hr as ut, Hs as dt, Ht as ft, Hu as D, I as pt, Ia as mt, Ic as aee, Ii as oee, Il as ht, In as gt, Io as _t, Ir as vt, Is as see, It as yt, Iu as bt, J as xt, Ja as St, Jc as cee, Ji as lee, Jn as uee, Jo as Ct, Jr as wt, Js as Tt, Jt as Et, K as Dt, Ka as Ot, Kc as kt, Ki as At, Kl as jt, Kn as Mt, Ko as Nt, Kr as dee, Ks as Pt, Kt as Ft, Ku as It, L as Lt, La as fee, Lc as pee, Li as mee, Ll as hee, Ln as Rt, Lo as gee, Lr as zt, Ls as Bt, Lt as Vt, Lu as Ht, M as Ut, Ma as Wt, Mc as _ee, Mi as Gt, Ml as Kt, Mn as vee, Mo as O, Mr as qt, Ms as Jt, Mt as Yt, Mu as Xt, N as Zt, Na as Qt, Nc as $t, Ni as en, Nl as yee, Nn as k, No as bee, Nr as tn, Ns as nn, Nt as rn, Nu as an, O as on, Oa as sn, Oc as cn, Oi as ln, Ol as un, On as dn, Oo as fn, Or as pn, Ot as mn, Ou as hn, P as gn, Pa as _n, Pc as vn, Pi as yn, Pl as A, Pn as bn, Po as xn, Pr as xee, Ps as See, Pt as Cee, Pu as Sn, Q as Cn, Qa as wn, Qc as Tn, Qi as En, Ql as Dn, Qn as On, Qo as kn, Qr as An, Qs as jn, Qt as Mn, R as Nn, Ra as wee, Rc as Tee, Ri as Pn, Rl as Fn, Rn as In, Ro as Ln, Rr as j, Rs as Eee, Rt as Rn, Ru as Dee, S as zn, Sa as Oee, Sc as Bn, Si as Vn, Sl as Hn, Sn as Un, So as Wn, Sr as Gn, Ss as Kn, St as qn, T as Jn, Ta as Yn, Tc as Xn, Ti as Zn, Tl as Qn, Tn as $n, To as er, Tr as tr, Ts as nr, Tt as rr, Tu as ir, U as ar, Ua as or, Uc as sr, Ui as cr, Ul as lr, Un as ur, Uo as dr, Ur as fr, Us as pr, Ut as mr, Uu as hr, V as gr, Va as kee, Vc as _r, Vi as vr, Vl as yr, Vn as br, Vo as xr, Vr as Aee, Vs as Sr, Vt as Cr, Vu as wr, W as Tr, Wa as Er, Wc as jee, Wi as Mee, Wl as Dr, Wn as Or, Wo as kr, Wr as Ar, Ws as jr, Wt as Nee, Wu as Pee, X as Fee, Xa as Mr, Xc as Nr, Xi as Pr, Xl as Iee, Xn as Lee, Xo as Fr, Xr as Ree, Xs as Ir, Xt as zee, Y as Bee, Ya as Lr, Yc as Vee, Yi as Hee, Yl as Rr, Yn as Uee, Yo as Wee, Yr as zr, Ys as Gee, Yt as Kee, Z as qee, Za as Br, Zc as Vr, Zi as Hr, Zl as Ur, Zn as Jee, Zo as Yee, Zr as Wr, Zs as Gr, Zt as Xee, _ as Zee, _a as Kr, _c as qr, _i as Jr, _l as Yr, _n as Xr, _o as Zr, _r as Qr, _s as $r, _t as ei, _u as ti, a as ni, aa as Qee, ac as $ee, ai as ri, al as ete, an as ii, ao as tte, ar as ai, as as oi, at as si, au as ci, b as li, ba as ui, bc as di, bi as nte, bl as fi, bn as pi, bo as rte, br as mi, bs as hi, bt as ite, bu as ate, c as gi, ca as _i, cc as vi, ci as yi, cl as bi, cn as xi, co as Si, cr as Ci, cs as wi, ct as Ti, cu as Ei, d as Di, da as Oi, dc as ki, di as Ai, dl as ji, dn as Mi, do as Ni, dr as Pi, ds as Fi, dt as Ii, du as Li, ea as Ri, ec as zi, ei as Bi, el as Vi, en as Hi, eo as Ui, er as Wi, es as Gi, et as Ki, eu as qi, f as Ji, fa as Yi, fc as Xi, fi as Zi, fl as Qi, fn as $i, fo as ea, fr as ta, fs as na, ft as ra, fu as ia, g as aa, ga as oa, gc as sa, gi as ca, gl as la, gn as ua, go as M, gr as ote, gs as da, gt as ste, gu as fa, h as cte, ha as lte, hc as ute, hi as pa, hl as ma, hn as ha, ho as dte, hr as ga, hs as _a, ht as va, hu as fte, i as ya, ia as ba, ic as pte, ii as xa, il as Sa, in as Ca, io as wa, ir as Ta, is as Ea, it as Da, iu as Oa, j as ka, ja as Aa, jc as ja, ji as Ma, jl as Na, jn as Pa, jo as Fa, jr as Ia, js as La, jt as Ra, ju as za, k as Ba, ka as Va, kc as Ha, ki as Ua, kl as mte, kn as hte, ko as Wa, kr as gte, ks as Ga, kt as Ka, ku as qa, l as Ja, la as Ya, lc as Xa, li as _te, ll as vte, ln as yte, lo as bte, lr as Za, ls as xte, lt as Qa, lu as Ste, m as Cte, ma as $a, mc as eo, mi as wte, ml as Tte, mn as to, mo as no, mr as Ete, ms as ro, mt as io, mu as Dte, na as ao, nc as Ote, ni as oo, nl as so, nn as co, no as kte, nr as Ate, ns as jte, nt as Mte, nu as lo, o as Nte, oa as uo, oc as Pte, oi as fo, ol as po, on as Fte, oo as mo, or as ho, os as go, ot as _o, ou as vo, p as yo, pa as bo, pc as xo, pi as So, pl as Co, pn as wo, po as To, pr as Eo, ps as Do, pt as Oo, pu as ko, q as Ao, qa as jo, qc as Mo, qi as No, ql as Po, qn as Fo, qo as Io, qr as Lo, qs as Ro, qt as zo, qu as Bo, r as Vo, ra as Ho, rc as Uo, ri as Wo, rl as Go, rn as Ko, ro as qo, rr as Jo, rs as Yo, rt as Xo, ru as Zo, s as Qo, sa as $o, sc as es, si as ts, sl as ns, sn as rs, so as is, sr as as, ss as os, st as ss, su as cs, t as ls, tc as us, ti as ds, tl as fs, tn as ps, to as ms, tr as hs, ts as gs, tt as _s, tu as vs, u as ys, ua as N, uc as bs, ui as xs, ul as Ss, un as Cs, uo as ws, ur as Ts, us as Es, ut as Ds, uu as Os, v as ks, va as As, vc as js, vi as Ms, vl as Ns, vn as Ps, vo as Fs, vr as Is, vs as Ls, vt as Rs, vu as zs, wa as Bs, wc as Vs, wi as Hs, wl as Us, wn as Ws, wo as Gs, wr as Ks, ws as qs, wt as Js, wu as Ys, x as Xs, xa as Zs, xc as Qs, xi as $s, xl as ec, xn as tc, xo as nc, xr as rc, xs as ic, xt as ac, xu as oc, y as sc, ya as cc, yc as lc, yi as uc, yl as dc, yn as Ite, yo as Lte, yr as Rte, ys as zte, yu as fc, z as pc, za as mc, zc as Bte, zi as hc, zl as Vte, zn as Hte, zo as gc, zr as Ute, zs as Wte, zt as Gte, zu as _c } from "./chunk-K2UTITRG-BGSulWJm.js";
2
+ import { $ as i, $a as a, $c as o, $i as s, $l as c, $n as l, $o as u, $r as d, $s as f, $t as p, A as m, Ac as h, Ai as g, Al as _, An as v, Ao as y, Ar as b, As as x, At as S, Au as C, B as w, Bc as ee, Bi as T, Bl as te, Bn as ne, Bo as re, Br as E, Bs as ie, Bt as ae, Bu as oe, C as se, Ca as ce, Cc as le, Ci as ue, Cl as de, Cn as fe, Co as pe, Cr as me, Cs as he, Ct as ge, Cu as _e, D as ve, Da as ye, Dc as be, Di as xe, Dl as Se, Dn as Ce, Do as we, Dr as Te, Ds as Ee, Dt as De, Du as Oe, E as ke, Ea as Ae, Ec as je, Ei as Me, El as Ne, En as Pe, Eo as Fe, Er as Ie, Es as Le, Et as Re, Eu as ze, F as Be, Fa as Ve, Fc as He, Fi as Ue, Fl as We, Fn as Ge, Fo as Ke, Fr as qe, Fs as Je, Ft as Ye, Fu as Xe, G as Ze, Ga as Qe, Gc as eee, Gi as $e, Gl as et, Gn as tt, Go as nt, Gr as tee, Gs as rt, Gt as it, Gu as nee, H as ree, Ha as at, Hc as ot, Hi as iee, Hl as st, Hn as ct, Ho as lt, Hr as ut, Hs as dt, Ht as ft, Hu as D, I as pt, Ia as mt, Ic as aee, Ii as oee, Il as ht, In as gt, Io as _t, Ir as vt, Is as see, It as yt, Iu as bt, J as xt, Ja as St, Jc as cee, Ji as lee, Jn as uee, Jo as Ct, Jr as wt, Js as Tt, Jt as Et, K as Dt, Ka as Ot, Kc as kt, Ki as At, Kl as jt, Kn as Mt, Ko as Nt, Kr as dee, Ks as Pt, Kt as Ft, Ku as It, L as Lt, La as fee, Lc as pee, Li as mee, Ll as hee, Ln as Rt, Lo as gee, Lr as zt, Ls as Bt, Lt as Vt, Lu as Ht, M as Ut, Ma as Wt, Mc as _ee, Mi as Gt, Ml as Kt, Mn as vee, Mo as O, Mr as qt, Ms as Jt, Mt as Yt, Mu as Xt, N as Zt, Na as Qt, Nc as $t, Ni as en, Nl as yee, Nn as k, No as bee, Nr as tn, Ns as nn, Nt as rn, Nu as an, O as on, Oa as sn, Oc as cn, Oi as ln, Ol as un, On as dn, Oo as fn, Or as pn, Ot as mn, Ou as hn, P as gn, Pa as _n, Pc as vn, Pi as yn, Pl as A, Pn as bn, Po as xn, Pr as xee, Ps as See, Pt as Cee, Pu as Sn, Q as Cn, Qa as wn, Qc as Tn, Qi as En, Ql as Dn, Qn as On, Qo as kn, Qr as An, Qs as jn, Qt as Mn, R as Nn, Ra as wee, Rc as Tee, Ri as Pn, Rl as Fn, Rn as In, Ro as Ln, Rr as j, Rs as Eee, Rt as Rn, Ru as Dee, S as zn, Sa as Oee, Sc as Bn, Si as Vn, Sl as Hn, Sn as Un, So as Wn, Sr as Gn, Ss as Kn, St as qn, T as Jn, Ta as Yn, Tc as Xn, Ti as Zn, Tl as Qn, Tn as $n, To as er, Tr as tr, Ts as nr, Tt as rr, Tu as ir, U as ar, Ua as or, Uc as sr, Ui as cr, Ul as lr, Un as ur, Uo as dr, Ur as fr, Us as pr, Ut as mr, Uu as hr, V as gr, Va as kee, Vc as _r, Vi as vr, Vl as yr, Vn as br, Vo as xr, Vr as Aee, Vs as Sr, Vt as Cr, Vu as wr, W as Tr, Wa as Er, Wc as jee, Wi as Mee, Wl as Dr, Wn as Or, Wo as kr, Wr as Ar, Ws as jr, Wt as Nee, Wu as Pee, X as Fee, Xa as Mr, Xc as Nr, Xi as Pr, Xl as Iee, Xn as Lee, Xo as Fr, Xr as Ree, Xs as Ir, Xt as zee, Y as Bee, Ya as Lr, Yc as Vee, Yi as Hee, Yl as Rr, Yn as Uee, Yo as Wee, Yr as zr, Ys as Gee, Yt as Kee, Z as qee, Za as Br, Zc as Vr, Zi as Hr, Zl as Ur, Zn as Jee, Zo as Yee, Zr as Wr, Zs as Gr, Zt as Xee, _ as Zee, _a as Kr, _c as qr, _i as Jr, _l as Yr, _n as Xr, _o as Zr, _r as Qr, _s as $r, _t as ei, _u as ti, a as ni, aa as Qee, ac as $ee, ai as ri, al as ete, an as ii, ao as tte, ar as ai, as as oi, at as si, au as ci, b as li, ba as ui, bc as di, bi as nte, bl as fi, bn as pi, bo as rte, br as mi, bs as hi, bt as ite, bu as ate, c as gi, ca as _i, cc as vi, ci as yi, cl as bi, cn as xi, co as Si, cr as Ci, cs as wi, ct as Ti, cu as Ei, d as Di, da as Oi, dc as ki, di as Ai, dl as ji, dn as Mi, do as Ni, dr as Pi, ds as Fi, dt as Ii, du as Li, ea as Ri, ec as zi, ei as Bi, el as Vi, en as Hi, eo as Ui, er as Wi, es as Gi, et as Ki, eu as qi, f as Ji, fa as Yi, fc as Xi, fi as Zi, fl as Qi, fn as $i, fo as ea, fr as ta, fs as na, ft as ra, fu as ia, g as aa, ga as oa, gc as sa, gi as ca, gl as la, gn as ua, go as M, gr as ote, gs as da, gt as ste, gu as fa, h as cte, ha as lte, hc as ute, hi as pa, hl as ma, hn as ha, ho as dte, hr as ga, hs as _a, ht as va, hu as fte, i as ya, ia as ba, ic as pte, ii as xa, il as Sa, in as Ca, io as wa, ir as Ta, is as Ea, it as Da, iu as Oa, j as ka, ja as Aa, jc as ja, ji as Ma, jl as Na, jn as Pa, jo as Fa, jr as Ia, js as La, jt as Ra, ju as za, k as Ba, ka as Va, kc as Ha, ki as Ua, kl as mte, kn as hte, ko as Wa, kr as gte, ks as Ga, kt as Ka, ku as qa, l as Ja, la as Ya, lc as Xa, li as _te, ll as vte, ln as yte, lo as bte, lr as Za, ls as xte, lt as Qa, lu as Ste, m as Cte, ma as $a, mc as eo, mi as wte, ml as Tte, mn as to, mo as no, mr as Ete, ms as ro, mt as io, mu as Dte, na as ao, nc as Ote, ni as oo, nl as so, nn as co, no as kte, nr as Ate, ns as jte, nt as Mte, nu as lo, o as Nte, oa as uo, oc as Pte, oi as fo, ol as po, on as Fte, oo as mo, or as ho, os as go, ot as _o, ou as vo, p as yo, pa as bo, pc as xo, pi as So, pl as Co, pn as wo, po as To, pr as Eo, ps as Do, pt as Oo, pu as ko, q as Ao, qa as jo, qc as Mo, qi as No, ql as Po, qn as Fo, qo as Io, qr as Lo, qs as Ro, qt as zo, qu as Bo, r as Vo, ra as Ho, rc as Uo, ri as Wo, rl as Go, rn as Ko, ro as qo, rr as Jo, rs as Yo, rt as Xo, ru as Zo, s as Qo, sa as $o, sc as es, si as ts, sl as ns, sn as rs, so as is, sr as as, ss as os, st as ss, su as cs, t as ls, tc as us, ti as ds, tl as fs, tn as ps, to as ms, tr as hs, ts as gs, tt as _s, tu as vs, u as ys, ua as N, uc as bs, ui as xs, ul as Ss, un as Cs, uo as ws, ur as Ts, us as Es, ut as Ds, uu as Os, v as ks, va as As, vc as js, vi as Ms, vl as Ns, vn as Ps, vo as Fs, vr as Is, vs as Ls, vt as Rs, vu as zs, wa as Bs, wc as Vs, wi as Hs, wl as Us, wn as Ws, wo as Gs, wr as Ks, ws as qs, wt as Js, wu as Ys, x as Xs, xa as Zs, xc as Qs, xi as $s, xl as ec, xn as tc, xo as nc, xr as rc, xs as ic, xt as ac, xu as oc, y as sc, ya as cc, yc as lc, yi as uc, yl as dc, yn as Ite, yo as Lte, yr as Rte, ys as zte, yu as fc, z as pc, za as mc, zc as Bte, zi as hc, zl as Vte, zn as Hte, zo as gc, zr as Ute, zs as Wte, zt as Gte, zu as _c } from "./chunk-K2UTITRG-nWrUL4WL.js";
3
3
  import { t as vc } from "./katex-CNJa78_M.js";
4
4
  import { t as Kte } from "./emoji-list-CLzE-Tot.js";
5
5
  import { t as qte } from "./isObject-BvCDNFEA.js";
@@ -40023,7 +40023,7 @@ var uce = k({
40023
40023
  });
40024
40024
  if (e === "png") {
40025
40025
  let e = Ur(u);
40026
- return n.exportEmbedScene && (e = e.then((e) => import("./image-GAAHSSAO-BU9ODTqe.js").then(({ encodePngMetadata: i }) => i({
40026
+ return n.exportEmbedScene && (e = e.then((e) => import("./image-GAAHSSAO-sdevgWOw.js").then(({ encodePngMetadata: i }) => i({
40027
40027
  blob: e,
40028
40028
  metadata: mte(t, n, r, "local")
40029
40029
  })))), kr(e, {
@@ -1,11 +1,21 @@
1
1
  (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t(require(`react`),require(`lexical`),require(`react-dom`)):typeof define==`function`&&define.amd?define([`react`,`lexical`,`react-dom`],t):(e=typeof globalThis<`u`?globalThis:e||self,e.OnalengRichTextEditor=t(e.React,e.Lexical,e.ReactDOM))})(this,function(e,t,n){var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>()=>(e&&(t=e(e=0)),t),d=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),f=(e,t)=>{let n={};for(var r in e)i(n,r,{get:e[r],enumerable:!0});return t||i(n,Symbol.toStringTag,{value:`Module`}),n},p=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),u=0,d=s.length,f;u<d;u++)f=s[u],!l.call(e,f)&&f!==n&&i(e,f,{get:(e=>t[e]).bind(null,f),enumerable:!(r=a(t,f))||r.enumerable});return e},m=(e,t,n)=>(p(e,t,`default`),n&&p(n,t,`default`)),h=(e,t,n)=>(n=e==null?{}:r(s(e)),p(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),g=e=>l.call(e,`module.exports`)?e[`module.exports`]:p(i({},`__esModule`,{value:!0}),e);let _=h(e,1);e=h(e),n=h(n,1);var v=(0,_.createContext)(null);function y(e,t){let n=null;return e!=null&&(n=e[1]),{getTheme:function(){return t??(n==null?null:n.getTheme())}}}function b(){let e=(0,_.useContext)(v);return e??function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}function x({defaultSelection:e}){let[t]=b();return(0,_.useEffect)(()=>{t.focus(()=>{let e=document.activeElement,n=t.getRootElement();n===null||e!==null&&n.contains(e)||n.focus({preventScroll:!0})},{defaultSelection:e})},[e,t]),null}var S=class extends t.ElementNode{$config(){return this.config(`overflow`,{$transform(e){e.isEmpty()&&e.remove()},extends:t.ElementNode})}createDOM(e){let t=document.createElement(`span`),n=e.theme.characterLimit;return typeof n==`string`&&(t.className=n),t}updateDOM(e,t){return!1}insertNewAfter(e,t=!0){return this.getParentOrThrow().insertNewAfter(e,t)}excludeFromCopy(){return!0}};function C(){return(0,t.$applyNodeReplacement)(new S)}function w(e){return e instanceof S}(0,t.defineExtension)({name:`@lexical/overflow`,nodes:()=>[S]});function T(){return(0,t.$getRoot)().getTextContent()}function E(e,t=!0){if(e)return!1;let n=T();return t&&(n=n.trim()),n===``}function D(e){if(!E(e,!1))return!1;let n=(0,t.$getRoot)().getChildren(),r=n.length;if(r>1)return!1;for(let e=0;e<r;e++){let r=n[e];if((0,t.$isDecoratorNode)(r))return!1;if((0,t.$isElementNode)(r)){if(!(0,t.$isParagraphNode)(r)||r.__indent!==0)return!1;let n=r.getChildren(),i=n.length;for(let r=0;r<i;r++){let r=n[e];if(!(0,t.$isTextNode)(r))return!1}}}return!0}function O(e){return()=>D(e)}function k(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function A(e,n,r,i){let a=e=>e instanceof r,o=e=>{let n=(0,t.$createTextNode)(e.getTextContent());n.setFormat(e.getFormat()),e.replace(n)};return[e.registerNodeTransform(t.TextNode,e=>{if(!e.isSimpleText())return;let r,s=e.getPreviousSibling(),l=e.getTextContent(),u=e;if((0,t.$isTextNode)(s)){let t=s.getTextContent(),r=n(t+l);if(a(s)){if(r===null||(e=>e.getLatest().__mode)(s)!==0)return void o(s);{let n=r.end-t.length;if(n>0){let r=t+l.slice(0,n);if(s.select(),s.setTextContent(r),n===l.length)e.remove();else{let t=l.slice(n);e.setTextContent(t)}return}}}else if(r===null||r.start<t.length)return}let d=0;for(;;){r=n(l);let e,f=r===null?``:l.slice(r.end);if(l=f,f===``){let e=u.getNextSibling();if((0,t.$isTextNode)(e)){f=u.getTextContent()+e.getTextContent();let t=n(f);if(t===null)return void(a(e)?o(e):e.markDirty());if(t.start!==0)return}}if(r===null)return;if(r.start===0&&(0,t.$isTextNode)(s)&&s.isTextEntity()){d+=r.end;continue}r.start===0?[e,u]=u.splitText(r.end):[,e,u]=u.splitText(r.start+d,r.end+d),e===void 0&&k(165,`nodeToReplace`);let p=i(e);if(p.setFormat(e.getFormat()),e.replace(p),u==null)return;d=0,s=p}}),e.registerNodeTransform(r,e=>{let r=e.getTextContent(),i=n(r);if(i===null||i.start!==0)return void o(e);if(r.length>i.end)return void e.splitText(i.end);let s=e.getPreviousSibling();(0,t.$isTextNode)(s)&&s.isTextEntity()&&(o(s),o(e));let l=e.getNextSibling();(0,t.$isTextNode)(l)&&l.isTextEntity()&&(o(l),a(e)&&o(e))})]}function j(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var M=new Map;function N(e){let t=e;for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function P(e){let t=e.parentNode;if(t==null)throw Error(`Should never happen`);return[t,Array.from(t.childNodes).indexOf(e)]}function F(e,n,r,i,a){let o=n.getKey(),s=i.getKey(),l=document.createRange(),u=e.getElementByKey(o),d=e.getElementByKey(s),f=r,p=a;if((0,t.$isTextNode)(n)&&(u=N(u)),(0,t.$isTextNode)(i)&&(d=N(d)),n===void 0||i===void 0||u===null||d===null)return null;u.nodeName===`BR`&&([u,f]=P(u)),d.nodeName===`BR`&&([d,p]=P(d));let m=u.firstChild;u===d&&m!=null&&m.nodeName===`BR`&&f===0&&p===0&&(p=1);try{l.setStart(u,f),l.setEnd(d,p)}catch{return null}return!l.collapsed||f===p&&o===s||(l.setStart(d,p),l.setEnd(u,f)),l}function I(e,t){let n=e.getRootElement();if(n===null)return[];let r=n.getBoundingClientRect(),i=getComputedStyle(n),a=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight),o=Array.from(t.getClientRects()),s,l=o.length;o.sort((e,t)=>{let n=e.top-t.top;return Math.abs(n)<=3?e.left-t.left:n});for(let e=0;e<l;e++){let t=o[e],n=s&&s.top<=t.top&&s.top+s.height>t.top&&s.left+s.width>t.left,i=t.width+a===r.width;n||i?(o.splice(e--,1),l--):s=t}return o}function L(e){let t={};if(!e)return t;let n=e.split(`;`);for(let e of n)if(e!==``){let[n,r]=e.split(/:([^]+)/);n&&r&&(t[n.trim()]=r.trim())}return t}function R(e){let t=M.get(e);return t===void 0&&(t=L(e),M.set(e,t)),t}function ee(e){let t=``;for(let n in e)n&&(t+=`${n}: ${e[n]};`);return t}function te(e){let n=(0,t.$getEditor)().getElementByKey(e.getKey());if(n===null)return null;let r=n.ownerDocument.defaultView;return r===null?null:r.getComputedStyle(n)}function z(e){return te((0,t.$isRootNode)(e)?e:e.getParentOrThrow())}function ne(e){let t=z(e);return t!==null&&t.direction===`rtl`}function re(e,n,r=`self`){let i=e.getStartEndPoints();if(n.isSelected(e)&&!(0,t.$isTokenOrSegmented)(n)&&i!==null){let[a,o]=i,s=e.isBackward(),l=a.getNode(),u=o.getNode(),d=n.is(l),f=n.is(u);if(d||f){let[i,a]=(0,t.$getCharacterOffsets)(e),o=l.is(u),d=n.is(s?u:l),f=n.is(s?l:u),p,m=0;o?(m=i>a?a:i,p=i>a?i:a):d?(m=s?a:i,p=void 0):f&&(m=0,p=s?i:a);let h=n.__text.slice(m,p);h!==n.__text&&(r===`clone`&&(n=(0,t.$cloneWithPropertiesEphemeral)(n)),n.__text=h)}}return n}function ie(e){if(e.type===`text`)return e.offset===e.getNode().getTextContentSize();let n=e.getNode();return(0,t.$isElementNode)(n)||j(177),e.offset===n.getChildrenSize()}function ae(e,n,r){let i=n.getNode(),a=r;if((0,t.$isElementNode)(i)){let e=i.getDescendantByIndex(n.offset);e!==null&&(i=e)}for(;a>0&&i!==null;){if((0,t.$isElementNode)(i)){let e=i.getLastDescendant();e!==null&&(i=e)}let r=i.getPreviousSibling(),o=0;if(r===null){let e=i.getParentOrThrow(),t=e.getPreviousSibling();for(;t===null;){if(e=e.getParent(),e===null){r=null;break}t=e.getPreviousSibling()}e!==null&&(o=e.isInline()?0:2,r=t)}let s=i.getTextContent();s===``&&(0,t.$isElementNode)(i)&&!i.isInline()&&(s=`
2
2
 
3
- `);let l=s.length;if(!(0,t.$isTextNode)(i)||a>=l){let e=i.getParent();i.remove(),e==null||e.getChildrenSize()!==0||(0,t.$isRootNode)(e)||e.remove(),a-=l+o,i=r}else{let r=i.getKey(),o=e.getEditorState().read(()=>{let e=(0,t.$getNodeByKey)(r);return(0,t.$isTextNode)(e)&&e.isSimpleText()?e.getTextContent():null}),u=l-a,d=s.slice(0,u);if(o!==null&&o!==s){let e=(0,t.$getPreviousSelection)(),n=i;if(i.isSimpleText())i.setTextContent(o);else{let e=(0,t.$createTextNode)(o);i.replace(e),n=e}if((0,t.$isRangeSelection)(e)&&e.isCollapsed()){let t=e.anchor.offset;n.select(t,t)}}else if(i.isSimpleText()){let e=n.key===r,t=n.offset;t<a&&(t=l);let o=e?t-a:0,s=e?t:u;if(e&&o===0){let[e]=i.splitText(o,s);e.remove()}else{let[,e]=i.splitText(o,s);e.remove()}}else{let e=(0,t.$createTextNode)(d);i.replace(e)}a=0}}}function oe(e){let t=e.getStyle(),n=L(t);M.set(t,n)}function se(e,n){((0,t.$isRangeSelection)(e)?e.isCollapsed():(0,t.$isTextNode)(e)||(0,t.$isElementNode)(e))||j(280);let r=R((0,t.$isRangeSelection)(e)?e.style:(0,t.$isTextNode)(e)?e.getStyle():e.getTextStyle()),i=Object.entries(n).reduce((t,[n,i])=>(typeof i==`function`?t[n]=i(r[n],e):i===null?delete t[n]:t[n]=i,t),{...r}),a=ee(i);(0,t.$isRangeSelection)(e)||(0,t.$isTextNode)(e)?e.setStyle(a):e.setTextStyle(a),M.set(a,i)}function ce(e,n){if((0,t.$isRangeSelection)(e)&&e.isCollapsed()){se(e,n);let r=e.anchor.getNode();(0,t.$isElementNode)(r)&&r.isEmpty()&&se(r,n)}le(e=>{se(e,n)});let r=e.getNodes();if(r.length>0){let e=new Set;for(let i of r){if(!(0,t.$isElementNode)(i)||!i.canBeEmpty()||i.getChildrenSize()!==0)continue;let r=i.getKey();e.has(r)||(e.add(r),se(i,n))}}}function le(e){let n=(0,t.$getSelection)();if(!n)return;let r=new Map,i=e=>r.get(e.getKey())||[0,e.getTextContentSize()];if((0,t.$isRangeSelection)(n))for(let e of(0,t.$caretRangeFromSelection)(n).getTextSlices())e&&r.set(e.caret.origin.getKey(),e.getSliceIndices());let a=n.getNodes();for(let n of a){if(!(0,t.$isTextNode)(n)||!n.canHaveFormat())continue;let[r,a]=i(n);a!==r&&((0,t.$isTokenOrSegmented)(n)||r===0&&a===n.getTextContentSize()?e(n):e(n.splitText(r,a)[r===0?0:1]))}(0,t.$isRangeSelection)(n)&&n.anchor.type===`text`&&n.focus.type===`text`&&n.anchor.key===n.focus.key&&ue(n)}function ue(e){if(e.isBackward()){let{anchor:t,focus:n}=e,{key:r,offset:i,type:a}=t;t.set(n.key,n.offset,n.type),n.set(r,i,a)}}function de(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function fe(e,n,r=de){if(e===null)return;let i=e.getStartEndPoints(),a=new Map,o=null;if(i){let[e,n]=i;o=(0,t.$createRangeSelection)(),o.anchor.set(e.key,e.offset,e.type),o.focus.set(n.key,n.offset,n.type);let r=(0,t.$findMatchingParent)(e.getNode(),t.INTERNAL_$isBlock),s=(0,t.$findMatchingParent)(n.getNode(),t.INTERNAL_$isBlock);(0,t.$isElementNode)(r)&&a.set(r.getKey(),r),(0,t.$isElementNode)(s)&&a.set(s.getKey(),s)}for(let n of e.getNodes())if((0,t.$isElementNode)(n)&&(0,t.INTERNAL_$isBlock)(n))a.set(n.getKey(),n);else if(i===null){let e=(0,t.$findMatchingParent)(n,t.INTERNAL_$isBlock);(0,t.$isElementNode)(e)&&a.set(e.getKey(),e)}for(let[e,t]of a){let i=n();r(t,i),t.replace(i,!0),o&&(e===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,o.anchor.type),e===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,o.focus.type))}o&&e.is((0,t.$getSelection)())&&(0,t.$setSelection)(o)}function pe(e){let t=me(e);return t!==null&&t.writingMode===`vertical-rl`}function me(e){let n=e.anchor.getNode();return(0,t.$isElementNode)(n)?te(n):z(n)}function he(e,n){let r=pe(e)?!n:n;_e(e)&&(r=!r);let i=(0,t.$caretFromPoint)(e.focus,r?`previous`:`next`);if((0,t.$isExtendableTextPointCaret)(i))return!1;for(let e of(0,t.$extendCaretToRange)(i)){if((0,t.$isChildCaret)(e))return!e.origin.isInline();if(!(0,t.$isElementNode)(e.origin)){if((0,t.$isDecoratorNode)(e.origin))return!0;break}}return!1}function ge(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function _e(e){let t=me(e);return t!==null&&t.direction===`rtl`}function ve(e,t,n){let r=_e(e),i;i=pe(e)||r?!n:n,ge(e,t,i,`character`)}function ye(e,t,n){let r=R(e.getStyle());return r!==null&&r[t]||n}function be(e,n,r=``){let i=null,a=e.getNodes(),o=e.anchor,s=e.focus,l=e.isBackward(),u=l?s.offset:o.offset,d=l?s.getNode():o.getNode();if((0,t.$isRangeSelection)(e)&&e.isCollapsed()&&e.style!==``){let t=R(e.style);if(t!==null&&n in t)return t[n]}for(let e=0;e<a.length;e++){let o=a[e];if((e===0||u!==0||!o.is(d))&&(0,t.$isTextNode)(o)){let e=ye(o,n,r);if(i===null)i=e;else if(i!==e){i=``;break}}}return i===null?r:i}function xe(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Se=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Ce=Se&&`documentMode`in document?document.documentMode:null,we=Se&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Te=Se&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);!(!Se||!(`InputEvent`in window)||Ce)&&`getTargetRanges`in new window.InputEvent(`input`),Se&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Se&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,Se&&/Android/.test(navigator.userAgent);var Ee=Se&&/^(?=.*Chrome).*/i.test(navigator.userAgent);Se&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);function De(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function Oe(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function ke(e){return`${e}px`}var Ae={attributes:!0,characterData:!0,childList:!0,subtree:!0};function je(e,n,r){let i=null,a=null,o=null,s=[],l=document.createElement(`div`);function u(){i===null&&xe(182),a===null&&xe(183);let{left:t,top:o}=a.getBoundingClientRect(),u=I(e,n);var d,f;l.isConnected||(f=l,(d=a).insertBefore(f,d.firstChild));let p=!1;for(let e=0;e<u.length;e++){let n=u[e],r=s[e]||document.createElement(`div`),i=r.style;i.position!==`absolute`&&(i.position=`absolute`,p=!0);let a=ke(n.left-t);i.left!==a&&(i.left=a,p=!0);let d=ke(n.top-o);i.top!==d&&(r.style.top=d,p=!0);let f=ke(n.width);i.width!==f&&(r.style.width=f,p=!0);let m=ke(n.height);i.height!==m&&(r.style.height=m,p=!0),r.parentNode!==l&&(l.append(r),p=!0),s[e]=r}for(;s.length>u.length;)s.pop();p&&r(s)}function d(){a=null,i=null,o!==null&&o.disconnect(),o=null,l.remove();for(let e of s)e.remove();s=[]}l.style.position=`relative`;let f=e.registerRootListener(function n(){let r=e.getRootElement();if(r===null)return d();let s=r.parentElement;if(!(0,t.isHTMLElement)(s))return d();d(),i=r,a=s,o=new MutationObserver(t=>{let r=e.getRootElement(),o=r&&r.parentElement;if(r!==i||o!==a)return n();for(let e of t)if(!l.contains(e.target))return u()}),o.observe(s,Ae),u()});return()=>{f(),d()}}function Me(e,n,r){if(e.type!==`text`&&(0,t.$isElementNode)(n)){let t=n.getDOMSlot(r);return[t.element,t.getFirstChildOffset()+e.offset]}return[(0,t.getDOMTextNode)(r)||r,e.offset]}function Ne(e,n){let r=null,i=null,a=null,o=null,s=null,l=null,u=()=>{};function d(d){d.read(()=>{let d=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(d))return r=null,a=null,o=null,l=null,u(),void(u=()=>{});let[f,p]=function(e){let t=e.getStartEndPoints();return e.isBackward()?[t[1],t[0]]:t}(d),m=f.getNode(),h=m.getKey(),g=f.offset,_=p.getNode(),v=_.getKey(),y=p.offset,b=e.getElementByKey(h),x=e.getElementByKey(v),S=r===null||b!==i||g!==a||h!==r.getKey(),C=o===null||x!==s||y!==l||v!==o.getKey();if((S||C)&&b!==null&&x!==null){let t=function(e,t,n,r,i,a,o){let s=(e._window?e._window.document:document).createRange();return s.setStart(...Me(t,n,r)),s.setEnd(...Me(i,a,o)),s}(e,f,m,b,p,_,x);u(),u=je(e,t,e=>{if(n===void 0)for(let t of e){let e=t.style;e.background!==`Highlight`&&(e.background=`Highlight`),e.color!==`HighlightText`&&(e.color=`HighlightText`),e.marginTop!==ke(-1.5)&&(e.marginTop=ke(-1.5)),e.paddingTop!==ke(4)&&(e.paddingTop=ke(4)),e.paddingBottom!==ke(0)&&(e.paddingBottom=ke(0))}else n(e)})}r=m,i=b,a=g,o=_,s=x,l=y})}return d(e.getEditorState()),Oe(e.registerUpdateListener(({editorState:e})=>d(e)),()=>{u()})}function Pe(e){let t=null,n=()=>{let n=getSelection(),r=n&&n.anchorNode,i=e.getRootElement();r!==null&&i!==null&&i.contains(r)?t!==null&&(t(),t=null):t===null&&(t=Ne(e))};return document.addEventListener(`selectionchange`,n),()=>{t!==null&&t(),document.removeEventListener(`selectionchange`,n)}}var Fe=Se,Ie=we,Le=Ee,Re=Te;function ze(e,...t){let n=De(...t);n.length>0&&e.classList.add(...n)}function Be(e,...t){let n=De(...t);n.length>0&&e.classList.remove(...n)}function Ve(e,t){for(let n of t)if(e.type.startsWith(n))return!0;return!1}function He(e,t){let n=e[Symbol.iterator]();return new Promise((e,r)=>{let i=[],a=()=>{let{done:o,value:s}=n.next();if(o)return e(i);let l=new FileReader;l.addEventListener(`error`,r),l.addEventListener(`load`,()=>{let e=l.result;typeof e==`string`&&i.push({file:s,result:e}),a()}),Ve(s,t)?l.readAsDataURL(s):a()};a()})}function Ue(e,t){return Array.from(Ge(e,t))}function We(e){return e?e.getAdjacentCaret():null}function Ge(e,t){return qe(`next`,e,t)}function Ke(e,n){let r=(0,t.$getAdjacentSiblingOrParentSiblingCaret)((0,t.$getSiblingCaret)(e,n));return r&&r[0]}function qe(e,n,r){let i=(0,t.$getRoot)(),a=n||i,o=(0,t.$isElementNode)(a)?(0,t.$getChildCaret)(a,e):(0,t.$getSiblingCaret)(a,e),s=Je(a),l=r?(0,t.$getAdjacentChildCaret)((0,t.$getChildCaretOrSelf)((0,t.$getSiblingCaret)(r,e)))||Ke(r,e):Ke(a,e),u=s;return(0,t.makeStepwiseIterator)({hasNext:e=>e!==null,initial:o,map:e=>({depth:u,node:e.origin}),step:e=>{if(e.isSameNodeCaret(l))return null;(0,t.$isChildCaret)(e)&&u++;let n=(0,t.$getAdjacentSiblingOrParentSiblingCaret)(e);return!n||n[0].isSameNodeCaret(l)?null:(u+=n[1],n[0])}})}function Je(e){let t=-1;for(let n=e;n!==null;n=n.getParent())t++;return t}function Ye(e){let n=(0,t.$getAdjacentSiblingOrParentSiblingCaret)((0,t.$getChildCaretOrSelf)((0,t.$getSiblingCaret)(e,`previous`)),`root`);return n&&n[0].origin}function Xe(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function Ze(e){let n=(0,t.$findMatchingParent)(e,e=>(0,t.$isElementNode)(e)&&!e.isInline());return(0,t.$isElementNode)(n)||xe(4,e.__key),n}function Qe(e,n){let r=new Map,i=e._pendingEditorState;for(let[e,i]of n._nodeMap)r.set(e,(0,t.$cloneWithProperties)(i));i&&(i._nodeMap=r),e._dirtyType=2;let a=n._selection;(0,t.$setSelection)(a===null?null:a.clone())}function $e(e){let n=(0,t.$getSelection)()||(0,t.$getPreviousSelection)(),r;if((0,t.$isRangeSelection)(n))r=(0,t.$caretFromPoint)(n.focus,`next`);else{if(n!=null){let e=n.getNodes(),i=e[e.length-1];i&&(r=(0,t.$getSiblingCaret)(i,`next`))}r||=(0,t.$getChildCaret)((0,t.$getRoot)(),`previous`).getFlipped().insert((0,t.$createParagraphNode)())}let i=et(e,r),a=(0,t.$getAdjacentChildCaret)(i);return(0,t.$setSelectionFromCaretRange)((0,t.$getCollapsedCaretRange)((0,t.$isChildCaret)(a)?(0,t.$normalizeCaret)(a):i)),e.getLatest()}function et(e,n,r){let i=(0,t.$getCaretInDirection)(n,`next`);for(let e=i;e;e=(0,t.$splitAtPointCaretNext)(e,r))i=e;return(0,t.$isTextPointCaret)(i)&&xe(283),i.insert(e.isInline()?(0,t.$createParagraphNode)().append(e):e),(0,t.$getCaretInDirection)((0,t.$getSiblingCaret)(e.getLatest(),`next`),n.direction)}function tt(e,t){let n=t();return e.replace(n),n.append(e),n}function nt(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function rt(e,t){let n=[];for(let r=0;r<e.length;r++){let i=t(e[r]);i!==null&&n.push(i)}return n}function it(e,n){(0,t.$getChildCaret)(e,`next`).insert(n)}var at=!(Re||!Fe)&&void 0;function ot(e){let t=1;if(function(){if(at===void 0){let e=document.createElement(`div`);e.style.cssText=`position: absolute; opacity: 0; width: 100px; left: -1000px;`,document.body.appendChild(e);let t=e.getBoundingClientRect();e.style.setProperty(`zoom`,`2`),at=e.getBoundingClientRect().width===t.width,document.body.removeChild(e)}return at}())for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue(`zoom`)),e=e.parentElement;return t}function st(e){return e._parentEditor!==null}function ct(e,t){return lt(e,t,null)}function lt(e,n,r){let i=!1;for(let a of dt(e))n(a)?r!==null&&r(a):(i=!0,(0,t.$isElementNode)(a)&&lt(a,n,r||(e=>a.insertAfter(e))),a.remove());return i}function ut(e,n){let r=[],i=Array.from(e).reverse();for(let e=i.pop();e!==void 0;e=i.pop())if(n(e))r.push(e);else if((0,t.$isElementNode)(e))for(let t of dt(e))i.push(t);return r}function dt(e){return ft((0,t.$getChildCaret)(e,`previous`))}function ft(e){return(0,t.makeStepwiseIterator)({hasNext:t.$isSiblingCaret,initial:e.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}function pt(e){(0,t.$rewindSiblingCaret)((0,t.$getSiblingCaret)(e,`next`)).splice(1,e.getChildren())}var mt=d((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),ht=d((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===k?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case w:return`Suspense`;case T:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(typeof e.tag==`number`&&console.error(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var n=e.render;return e=e.displayName,e||=(e=n.displayName||n.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return n=e.displayName||null,n===null?t(e.type)||`Memo`:n;case D:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function n(e){return``+e}function r(e){try{n(e);var t=!1}catch{t=!0}if(t){t=console;var r=t.error,i=typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`;return r.call(t,`The provided key is an unsupported type %s. This value must be coerced to a string before using it here.`,i),n(e)}}function i(e){if(e===v)return`<>`;if(typeof e==`object`&&e&&e.$$typeof===D)return`<...>`;try{var n=t(e);return n?`<`+n+`>`:`<...>`}catch{return`<...>`}}function a(){var e=A.A;return e===null?null:e.getOwner()}function o(){return Error(`react-stack-top-frame`)}function s(e){if(j.call(e,`key`)){var t=Object.getOwnPropertyDescriptor(e,`key`).get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function l(e,t){function n(){P||(P=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,`key`,{get:n,configurable:!0})}function u(){var e=t(this.type);return F[e]||(F[e]=!0,console.error(`Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.`)),e=this.props.ref,e===void 0?null:e}function d(e,t,n,r,i,a){var o=n.ref;return e={$$typeof:g,type:e,key:t,props:n,_owner:r},(o===void 0?null:o)===null?Object.defineProperty(e,`ref`,{enumerable:!1,value:null}):Object.defineProperty(e,`ref`,{enumerable:!1,get:u}),e._store={},Object.defineProperty(e._store,`validated`,{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,`_debugInfo`,{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,`_debugStack`,{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.defineProperty(e,`_debugTask`,{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function f(e,n,i,o,u,f){var m=n.children;if(m!==void 0)if(o)if(M(m)){for(o=0;o<m.length;o++)p(m[o]);Object.freeze&&Object.freeze(m)}else console.error(`React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.`);else p(m);if(j.call(n,`key`)){m=t(e);var h=Object.keys(n).filter(function(e){return e!==`key`});o=0<h.length?`{key: someKey, `+h.join(`: ..., `)+`: ...}`:`{key: someKey}`,R[m+o]||(h=0<h.length?`{`+h.join(`: ..., `)+`: ...}`:`{}`,console.error(`A props object containing a "key" prop is being spread into JSX:
3
+ `);let l=s.length;if(!(0,t.$isTextNode)(i)||a>=l){let e=i.getParent();i.remove(),e==null||e.getChildrenSize()!==0||(0,t.$isRootNode)(e)||e.remove(),a-=l+o,i=r}else{let r=i.getKey(),o=e.getEditorState().read(()=>{let e=(0,t.$getNodeByKey)(r);return(0,t.$isTextNode)(e)&&e.isSimpleText()?e.getTextContent():null}),u=l-a,d=s.slice(0,u);if(o!==null&&o!==s){let e=(0,t.$getPreviousSelection)(),n=i;if(i.isSimpleText())i.setTextContent(o);else{let e=(0,t.$createTextNode)(o);i.replace(e),n=e}if((0,t.$isRangeSelection)(e)&&e.isCollapsed()){let t=e.anchor.offset;n.select(t,t)}}else if(i.isSimpleText()){let e=n.key===r,t=n.offset;t<a&&(t=l);let o=e?t-a:0,s=e?t:u;if(e&&o===0){let[e]=i.splitText(o,s);e.remove()}else{let[,e]=i.splitText(o,s);e.remove()}}else{let e=(0,t.$createTextNode)(d);i.replace(e)}a=0}}}function oe(e){let t=e.getStyle(),n=L(t);M.set(t,n)}function se(e,n){((0,t.$isRangeSelection)(e)?e.isCollapsed():(0,t.$isTextNode)(e)||(0,t.$isElementNode)(e))||j(280);let r=R((0,t.$isRangeSelection)(e)?e.style:(0,t.$isTextNode)(e)?e.getStyle():e.getTextStyle()),i=Object.entries(n).reduce((t,[n,i])=>(typeof i==`function`?t[n]=i(r[n],e):i===null?delete t[n]:t[n]=i,t),{...r}),a=ee(i);(0,t.$isRangeSelection)(e)||(0,t.$isTextNode)(e)?e.setStyle(a):e.setTextStyle(a),M.set(a,i)}function ce(e,n){if((0,t.$isRangeSelection)(e)&&e.isCollapsed()){se(e,n);let r=e.anchor.getNode();(0,t.$isElementNode)(r)&&r.isEmpty()&&se(r,n)}le(e=>{se(e,n)});let r=e.getNodes();if(r.length>0){let e=new Set;for(let i of r){if(!(0,t.$isElementNode)(i)||!i.canBeEmpty()||i.getChildrenSize()!==0)continue;let r=i.getKey();e.has(r)||(e.add(r),se(i,n))}}}function le(e){let n=(0,t.$getSelection)();if(!n)return;let r=new Map,i=e=>r.get(e.getKey())||[0,e.getTextContentSize()];if((0,t.$isRangeSelection)(n))for(let e of(0,t.$caretRangeFromSelection)(n).getTextSlices())e&&r.set(e.caret.origin.getKey(),e.getSliceIndices());let a=n.getNodes();for(let n of a){if(!(0,t.$isTextNode)(n)||!n.canHaveFormat())continue;let[r,a]=i(n);a!==r&&((0,t.$isTokenOrSegmented)(n)||r===0&&a===n.getTextContentSize()?e(n):e(n.splitText(r,a)[r===0?0:1]))}(0,t.$isRangeSelection)(n)&&n.anchor.type===`text`&&n.focus.type===`text`&&n.anchor.key===n.focus.key&&ue(n)}function ue(e){if(e.isBackward()){let{anchor:t,focus:n}=e,{key:r,offset:i,type:a}=t;t.set(n.key,n.offset,n.type),n.set(r,i,a)}}function de(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function fe(e,n,r=de){if(e===null)return;let i=e.getStartEndPoints(),a=new Map,o=null;if(i){let[e,n]=i;o=(0,t.$createRangeSelection)(),o.anchor.set(e.key,e.offset,e.type),o.focus.set(n.key,n.offset,n.type);let r=(0,t.$findMatchingParent)(e.getNode(),t.INTERNAL_$isBlock),s=(0,t.$findMatchingParent)(n.getNode(),t.INTERNAL_$isBlock);(0,t.$isElementNode)(r)&&a.set(r.getKey(),r),(0,t.$isElementNode)(s)&&a.set(s.getKey(),s)}for(let n of e.getNodes())if((0,t.$isElementNode)(n)&&(0,t.INTERNAL_$isBlock)(n))a.set(n.getKey(),n);else if(i===null){let e=(0,t.$findMatchingParent)(n,t.INTERNAL_$isBlock);(0,t.$isElementNode)(e)&&a.set(e.getKey(),e)}for(let[e,t]of a){let i=n();r(t,i),t.replace(i,!0),o&&(e===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,o.anchor.type),e===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,o.focus.type))}o&&e.is((0,t.$getSelection)())&&(0,t.$setSelection)(o)}function pe(e){let t=me(e);return t!==null&&t.writingMode===`vertical-rl`}function me(e){let n=e.anchor.getNode();return(0,t.$isElementNode)(n)?te(n):z(n)}function he(e,n){let r=pe(e)?!n:n;_e(e)&&(r=!r);let i=(0,t.$caretFromPoint)(e.focus,r?`previous`:`next`);if((0,t.$isExtendableTextPointCaret)(i))return!1;for(let e of(0,t.$extendCaretToRange)(i)){if((0,t.$isChildCaret)(e))return!e.origin.isInline();if(!(0,t.$isElementNode)(e.origin)){if((0,t.$isDecoratorNode)(e.origin))return!0;break}}return!1}function ge(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function _e(e){let t=me(e);return t!==null&&t.direction===`rtl`}function ve(e,t,n){let r=_e(e),i;i=pe(e)||r?!n:n,ge(e,t,i,`character`)}function ye(e,t,n){let r=R(e.getStyle());return r!==null&&r[t]||n}function be(e,n,r=``){let i=null,a=e.getNodes(),o=e.anchor,s=e.focus,l=e.isBackward(),u=l?s.offset:o.offset,d=l?s.getNode():o.getNode();if((0,t.$isRangeSelection)(e)&&e.isCollapsed()&&e.style!==``){let t=R(e.style);if(t!==null&&n in t)return t[n]}for(let e=0;e<a.length;e++){let o=a[e];if((e===0||u!==0||!o.is(d))&&(0,t.$isTextNode)(o)){let e=ye(o,n,r);if(i===null)i=e;else if(i!==e){i=``;break}}}return i===null?r:i}function xe(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Se=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Ce=Se&&`documentMode`in document?document.documentMode:null,we=Se&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Te=Se&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);!(!Se||!(`InputEvent`in window)||Ce)&&`getTargetRanges`in new window.InputEvent(`input`),Se&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Se&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,Se&&/Android/.test(navigator.userAgent);var Ee=Se&&/^(?=.*Chrome).*/i.test(navigator.userAgent);Se&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);function De(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function Oe(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function ke(e){return`${e}px`}var Ae={attributes:!0,characterData:!0,childList:!0,subtree:!0};function je(e,n,r){let i=null,a=null,o=null,s=[],l=document.createElement(`div`);function u(){i===null&&xe(182),a===null&&xe(183);let{left:t,top:o}=a.getBoundingClientRect(),u=I(e,n);var d,f;l.isConnected||(f=l,(d=a).insertBefore(f,d.firstChild));let p=!1;for(let e=0;e<u.length;e++){let n=u[e],r=s[e]||document.createElement(`div`),i=r.style;i.position!==`absolute`&&(i.position=`absolute`,p=!0);let a=ke(n.left-t);i.left!==a&&(i.left=a,p=!0);let d=ke(n.top-o);i.top!==d&&(r.style.top=d,p=!0);let f=ke(n.width);i.width!==f&&(r.style.width=f,p=!0);let m=ke(n.height);i.height!==m&&(r.style.height=m,p=!0),r.parentNode!==l&&(l.append(r),p=!0),s[e]=r}for(;s.length>u.length;)s.pop();p&&r(s)}function d(){a=null,i=null,o!==null&&o.disconnect(),o=null,l.remove();for(let e of s)e.remove();s=[]}l.style.position=`relative`;let f=e.registerRootListener(function n(){let r=e.getRootElement();if(r===null)return d();let s=r.parentElement;if(!(0,t.isHTMLElement)(s))return d();d(),i=r,a=s,o=new MutationObserver(t=>{let r=e.getRootElement(),o=r&&r.parentElement;if(r!==i||o!==a)return n();for(let e of t)if(!l.contains(e.target))return u()}),o.observe(s,Ae),u()});return()=>{f(),d()}}function Me(e,n,r){if(e.type!==`text`&&(0,t.$isElementNode)(n)){let t=n.getDOMSlot(r);return[t.element,t.getFirstChildOffset()+e.offset]}return[(0,t.getDOMTextNode)(r)||r,e.offset]}function Ne(e,n){let r=null,i=null,a=null,o=null,s=null,l=null,u=()=>{};function d(d){d.read(()=>{let d=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(d))return r=null,a=null,o=null,l=null,u(),void(u=()=>{});let[f,p]=function(e){let t=e.getStartEndPoints();return e.isBackward()?[t[1],t[0]]:t}(d),m=f.getNode(),h=m.getKey(),g=f.offset,_=p.getNode(),v=_.getKey(),y=p.offset,b=e.getElementByKey(h),x=e.getElementByKey(v),S=r===null||b!==i||g!==a||h!==r.getKey(),C=o===null||x!==s||y!==l||v!==o.getKey();if((S||C)&&b!==null&&x!==null){let t=function(e,t,n,r,i,a,o){let s=(e._window?e._window.document:document).createRange();return s.setStart(...Me(t,n,r)),s.setEnd(...Me(i,a,o)),s}(e,f,m,b,p,_,x);u(),u=je(e,t,e=>{if(n===void 0)for(let t of e){let e=t.style;e.background!==`Highlight`&&(e.background=`Highlight`),e.color!==`HighlightText`&&(e.color=`HighlightText`),e.marginTop!==ke(-1.5)&&(e.marginTop=ke(-1.5)),e.paddingTop!==ke(4)&&(e.paddingTop=ke(4)),e.paddingBottom!==ke(0)&&(e.paddingBottom=ke(0))}else n(e)})}r=m,i=b,a=g,o=_,s=x,l=y})}return d(e.getEditorState()),Oe(e.registerUpdateListener(({editorState:e})=>d(e)),()=>{u()})}function Pe(e){let t=null,n=()=>{let n=getSelection(),r=n&&n.anchorNode,i=e.getRootElement();r!==null&&i!==null&&i.contains(r)?t!==null&&(t(),t=null):t===null&&(t=Ne(e))};return document.addEventListener(`selectionchange`,n),()=>{t!==null&&t(),document.removeEventListener(`selectionchange`,n)}}var Fe=Se,Ie=we,Le=Ee,Re=Te;function ze(e,...t){let n=De(...t);n.length>0&&e.classList.add(...n)}function Be(e,...t){let n=De(...t);n.length>0&&e.classList.remove(...n)}function Ve(e,t){for(let n of t)if(e.type.startsWith(n))return!0;return!1}function He(e,t){let n=e[Symbol.iterator]();return new Promise((e,r)=>{let i=[],a=()=>{let{done:o,value:s}=n.next();if(o)return e(i);let l=new FileReader;l.addEventListener(`error`,r),l.addEventListener(`load`,()=>{let e=l.result;typeof e==`string`&&i.push({file:s,result:e}),a()}),Ve(s,t)?l.readAsDataURL(s):a()};a()})}function Ue(e,t){return Array.from(Ge(e,t))}function We(e){return e?e.getAdjacentCaret():null}function Ge(e,t){return qe(`next`,e,t)}function Ke(e,n){let r=(0,t.$getAdjacentSiblingOrParentSiblingCaret)((0,t.$getSiblingCaret)(e,n));return r&&r[0]}function qe(e,n,r){let i=(0,t.$getRoot)(),a=n||i,o=(0,t.$isElementNode)(a)?(0,t.$getChildCaret)(a,e):(0,t.$getSiblingCaret)(a,e),s=Je(a),l=r?(0,t.$getAdjacentChildCaret)((0,t.$getChildCaretOrSelf)((0,t.$getSiblingCaret)(r,e)))||Ke(r,e):Ke(a,e),u=s;return(0,t.makeStepwiseIterator)({hasNext:e=>e!==null,initial:o,map:e=>({depth:u,node:e.origin}),step:e=>{if(e.isSameNodeCaret(l))return null;(0,t.$isChildCaret)(e)&&u++;let n=(0,t.$getAdjacentSiblingOrParentSiblingCaret)(e);return!n||n[0].isSameNodeCaret(l)?null:(u+=n[1],n[0])}})}function Je(e){let t=-1;for(let n=e;n!==null;n=n.getParent())t++;return t}function Ye(e){let n=(0,t.$getAdjacentSiblingOrParentSiblingCaret)((0,t.$getChildCaretOrSelf)((0,t.$getSiblingCaret)(e,`previous`)),`root`);return n&&n[0].origin}function Xe(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function Ze(e){let n=(0,t.$findMatchingParent)(e,e=>(0,t.$isElementNode)(e)&&!e.isInline());return(0,t.$isElementNode)(n)||xe(4,e.__key),n}function Qe(e,n){let r=new Map,i=e._pendingEditorState;for(let[e,i]of n._nodeMap)r.set(e,(0,t.$cloneWithProperties)(i));i&&(i._nodeMap=r),e._dirtyType=2;let a=n._selection;(0,t.$setSelection)(a===null?null:a.clone())}function $e(e){let n=(0,t.$getSelection)()||(0,t.$getPreviousSelection)(),r;if((0,t.$isRangeSelection)(n))r=(0,t.$caretFromPoint)(n.focus,`next`);else{if(n!=null){let e=n.getNodes(),i=e[e.length-1];i&&(r=(0,t.$getSiblingCaret)(i,`next`))}r||=(0,t.$getChildCaret)((0,t.$getRoot)(),`previous`).getFlipped().insert((0,t.$createParagraphNode)())}let i=et(e,r),a=(0,t.$getAdjacentChildCaret)(i);return(0,t.$setSelectionFromCaretRange)((0,t.$getCollapsedCaretRange)((0,t.$isChildCaret)(a)?(0,t.$normalizeCaret)(a):i)),e.getLatest()}function et(e,n,r){let i=(0,t.$getCaretInDirection)(n,`next`);for(let e=i;e;e=(0,t.$splitAtPointCaretNext)(e,r))i=e;return(0,t.$isTextPointCaret)(i)&&xe(283),i.insert(e.isInline()?(0,t.$createParagraphNode)().append(e):e),(0,t.$getCaretInDirection)((0,t.$getSiblingCaret)(e.getLatest(),`next`),n.direction)}function tt(e,t){let n=t();return e.replace(n),n.append(e),n}function nt(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function rt(e,t){let n=[];for(let r=0;r<e.length;r++){let i=t(e[r]);i!==null&&n.push(i)}return n}function it(e,n){(0,t.$getChildCaret)(e,`next`).insert(n)}var at=!(Re||!Fe)&&void 0;function ot(e){let t=1;if(function(){if(at===void 0){let e=document.createElement(`div`);e.style.cssText=`position: absolute; opacity: 0; width: 100px; left: -1000px;`,document.body.appendChild(e);let t=e.getBoundingClientRect();e.style.setProperty(`zoom`,`2`),at=e.getBoundingClientRect().width===t.width,document.body.removeChild(e)}return at}())for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue(`zoom`)),e=e.parentElement;return t}function st(e){return e._parentEditor!==null}function ct(e,t){return lt(e,t,null)}function lt(e,n,r){let i=!1;for(let a of dt(e))n(a)?r!==null&&r(a):(i=!0,(0,t.$isElementNode)(a)&&lt(a,n,r||(e=>a.insertAfter(e))),a.remove());return i}function ut(e,n){let r=[],i=Array.from(e).reverse();for(let e=i.pop();e!==void 0;e=i.pop())if(n(e))r.push(e);else if((0,t.$isElementNode)(e))for(let t of dt(e))i.push(t);return r}function dt(e){return ft((0,t.$getChildCaret)(e,`previous`))}function ft(e){return(0,t.makeStepwiseIterator)({hasNext:t.$isSiblingCaret,initial:e.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}function pt(e){(0,t.$rewindSiblingCaret)((0,t.$getSiblingCaret)(e,`next`)).splice(1,e.getChildren())}var mt=d((e=>{var t=require(`react`),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,l={},u=null,d=null;for(s in r!==void 0&&(u=``+r),t.key!==void 0&&(u=``+t.key),t.ref!==void 0&&(d=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(l[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)l[s]===void 0&&(l[s]=t[s]);return{$$typeof:n,type:e,key:u,ref:d,props:l,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),ht=d((e=>{process.env.NODE_ENV!==`production`&&(function(){"use strict";var t=require(`react`),n=Symbol.for(`react.element`),r=Symbol.for(`react.portal`),i=Symbol.for(`react.fragment`),a=Symbol.for(`react.strict_mode`),o=Symbol.for(`react.profiler`),s=Symbol.for(`react.provider`),l=Symbol.for(`react.context`),u=Symbol.for(`react.forward_ref`),d=Symbol.for(`react.suspense`),f=Symbol.for(`react.suspense_list`),p=Symbol.for(`react.memo`),m=Symbol.for(`react.lazy`),h=Symbol.for(`react.offscreen`),g=Symbol.iterator,_=`@@iterator`;function v(e){if(typeof e!=`object`||!e)return null;var t=g&&e[g]||e[_];return typeof t==`function`?t:null}var y=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){x(`error`,e,[...arguments].slice(1))}function x(e,t,n){var r=y.ReactDebugCurrentFrame.getStackAddendum();r!==``&&(t+=`%s`,n=n.concat([r]));var i=n.map(function(e){return String(e)});i.unshift(`Warning: `+t),Function.prototype.apply.call(console[e],console,i)}var S=!1,C=!1,w=!1,T=!1,E=!1,D=Symbol.for(`react.module.reference`);function O(e){return!!(typeof e==`string`||typeof e==`function`||e===i||e===o||E||e===a||e===d||e===f||T||e===h||S||C||w||typeof e==`object`&&e&&(e.$$typeof===m||e.$$typeof===p||e.$$typeof===s||e.$$typeof===l||e.$$typeof===u||e.$$typeof===D||e.getModuleId!==void 0))}function k(e,t,n){var r=e.displayName;if(r)return r;var i=t.displayName||t.name||``;return i===``?n:n+`(`+i+`)`}function A(e){return e.displayName||`Context`}function j(e){if(e==null)return null;if(typeof e.tag==`number`&&b(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case i:return`Fragment`;case r:return`Portal`;case o:return`Profiler`;case a:return`StrictMode`;case d:return`Suspense`;case f:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case l:return A(e)+`.Consumer`;case s:return A(e._context)+`.Provider`;case u:return k(e,e.render,`ForwardRef`);case p:var t=e.displayName||null;return t===null?j(e.type)||`Memo`:t;case m:var n=e,h=n._payload,g=n._init;try{return j(g(h))}catch{return null}}return null}var M=Object.assign,N=0,P,F,I,L,R,ee,te;function z(){}z.__reactDisabledLog=!0;function ne(){if(N===0){P=console.log,F=console.info,I=console.warn,L=console.error,R=console.group,ee=console.groupCollapsed,te=console.groupEnd;var e={configurable:!0,enumerable:!0,value:z,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}function re(){if(N--,N===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:P}),info:M({},e,{value:F}),warn:M({},e,{value:I}),error:M({},e,{value:L}),group:M({},e,{value:R}),groupCollapsed:M({},e,{value:ee}),groupEnd:M({},e,{value:te})})}N<0&&b(`disabledDepth fell below zero. This is a bug in React. Please file an issue.`)}var ie=y.ReactCurrentDispatcher,ae;function oe(e,t,n){if(ae===void 0)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);ae=r&&r[1]||``}return`
4
+ `+ae+e}var se=!1,ce=new(typeof WeakMap==`function`?WeakMap:Map);function le(e,t){if(!e||se)return``;var n=ce.get(e);if(n!==void 0)return n;var r;se=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var a=ie.current;ie.current=null,ne();try{if(t){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(o,[])}catch(e){r=e}Reflect.construct(e,[],o)}else{try{o.call()}catch(e){r=e}e.call(o.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var s=t.stack.split(`
5
+ `),l=r.stack.split(`
6
+ `),u=s.length-1,d=l.length-1;u>=1&&d>=0&&s[u]!==l[d];)d--;for(;u>=1&&d>=0;u--,d--)if(s[u]!==l[d]){if(u!==1||d!==1)do if(u--,d--,d<0||s[u]!==l[d]){var f=`
7
+ `+s[u].replace(` at new `,` at `);return e.displayName&&f.includes(`<anonymous>`)&&(f=f.replace(`<anonymous>`,e.displayName)),typeof e==`function`&&ce.set(e,f),f}while(u>=1&&d>=0);break}}}finally{se=!1,ie.current=a,re(),Error.prepareStackTrace=i}var p=e?e.displayName||e.name:``,m=p?oe(p):``;return typeof e==`function`&&ce.set(e,m),m}function ue(e,t,n){return le(e,!1)}function de(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function fe(e,t,n){if(e==null)return``;if(typeof e==`function`)return le(e,de(e));if(typeof e==`string`)return oe(e);switch(e){case d:return oe(`Suspense`);case f:return oe(`SuspenseList`)}if(typeof e==`object`)switch(e.$$typeof){case u:return ue(e.render);case p:return fe(e.type,t,n);case m:var r=e,i=r._payload,a=r._init;try{return fe(a(i),t,n)}catch{}}return``}var pe=Object.prototype.hasOwnProperty,me={},he=y.ReactDebugCurrentFrame;function ge(e){if(e){var t=e._owner,n=fe(e.type,e._source,t?t.type:null);he.setExtraStackFrame(n)}else he.setExtraStackFrame(null)}function _e(e,t,n,r,i){var a=Function.call.bind(pe);for(var o in e)if(a(e,o)){var s=void 0;try{if(typeof e[o]!=`function`){var l=Error((r||`React class`)+`: `+n+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name=`Invariant Violation`,l}s=e[o](t,o,r,n,null,`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`)}catch(e){s=e}s&&!(s instanceof Error)&&(ge(i),b("%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).",r||`React class`,n,o,typeof s),ge(null)),s instanceof Error&&!(s.message in me)&&(me[s.message]=!0,ge(i),b(`Failed %s type: %s`,n,s.message),ge(null))}}var ve=Array.isArray;function ye(e){return ve(e)}function be(e){return typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`}function xe(e){try{return Se(e),!1}catch{return!0}}function Se(e){return``+e}function Ce(e){if(xe(e))return b(`The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.`,be(e)),Se(e)}var we=y.ReactCurrentOwner,Te={key:!0,ref:!0,__self:!0,__source:!0},Ee,De,Oe={};function ke(e){if(pe.call(e,`ref`)){var t=Object.getOwnPropertyDescriptor(e,`ref`).get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function Ae(e){if(pe.call(e,`key`)){var t=Object.getOwnPropertyDescriptor(e,`key`).get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function je(e,t){if(typeof e.ref==`string`&&we.current&&t&&we.current.stateNode!==t){var n=j(we.current.type);Oe[n]||(b(`Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref`,j(we.current.type),e.ref),Oe[n]=!0)}}function Me(e,t){var n=function(){Ee||(Ee=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,`key`,{get:n,configurable:!0})}function Ne(e,t){var n=function(){De||(De=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,`ref`,{get:n,configurable:!0})}var Pe=function(e,t,r,i,a,o,s){var l={$$typeof:n,type:e,key:t,ref:r,props:s,_owner:o};return l._store={},Object.defineProperty(l._store,`validated`,{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,`_self`,{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(l,`_source`,{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function Fe(e,t,n,r,i){var a,o={},s=null,l=null;for(a in n!==void 0&&(Ce(n),s=``+n),Ae(t)&&(Ce(t.key),s=``+t.key),ke(t)&&(l=t.ref,je(t,i)),t)pe.call(t,a)&&!Te.hasOwnProperty(a)&&(o[a]=t[a]);if(e&&e.defaultProps){var u=e.defaultProps;for(a in u)o[a]===void 0&&(o[a]=u[a])}if(s||l){var d=typeof e==`function`?e.displayName||e.name||`Unknown`:e;s&&Me(o,d),l&&Ne(o,d)}return Pe(e,s,l,i,r,we.current,o)}var Ie=y.ReactCurrentOwner,Le=y.ReactDebugCurrentFrame;function Re(e){if(e){var t=e._owner,n=fe(e.type,e._source,t?t.type:null);Le.setExtraStackFrame(n)}else Le.setExtraStackFrame(null)}var ze=!1;function Be(e){return typeof e==`object`&&!!e&&e.$$typeof===n}function Ve(){if(Ie.current){var e=j(Ie.current.type);if(e)return`
8
+
9
+ Check the render method of \``+e+"`."}return``}function He(e){if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,``),n=e.lineNumber;return`
10
+
11
+ Check your code at `+t+`:`+n+`.`}return``}var Ue={};function We(e){var t=Ve();if(!t){var n=typeof e==`string`?e:e.displayName||e.name;n&&(t=`
12
+
13
+ Check the top-level render call using <`+n+`>.`)}return t}function Ge(e,t){if(!(!e._store||e._store.validated||e.key!=null)){e._store.validated=!0;var n=We(t);if(!Ue[n]){Ue[n]=!0;var r=``;e&&e._owner&&e._owner!==Ie.current&&(r=` It was passed a child from `+j(e._owner.type)+`.`),Re(e),b(`Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.`,n,r),Re(null)}}}function Ke(e,t){if(typeof e==`object`){if(ye(e))for(var n=0;n<e.length;n++){var r=e[n];Be(r)&&Ge(r,t)}else if(Be(e))e._store&&(e._store.validated=!0);else if(e){var i=v(e);if(typeof i==`function`&&i!==e.entries)for(var a=i.call(e),o;!(o=a.next()).done;)Be(o.value)&&Ge(o.value,t)}}}function qe(e){var t=e.type;if(!(t==null||typeof t==`string`)){var n;if(typeof t==`function`)n=t.propTypes;else if(typeof t==`object`&&(t.$$typeof===u||t.$$typeof===p))n=t.propTypes;else return;if(n){var r=j(t);_e(n,e.props,`prop`,r,e)}else t.PropTypes!==void 0&&!ze&&(ze=!0,b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",j(t)||`Unknown`));typeof t.getDefaultProps==`function`&&!t.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Je(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if(r!==`children`&&r!==`key`){Re(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),Re(null);break}}e.ref!==null&&(Re(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),Re(null))}var Ye={};function Xe(e,t,r,a,o,s){var l=O(e);if(!l){var u=``;(e===void 0||typeof e==`object`&&e&&Object.keys(e).length===0)&&(u+=` You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.`);var d=He(o);d?u+=d:u+=Ve();var f;e===null?f=`null`:ye(e)?f=`array`:e!==void 0&&e.$$typeof===n?(f=`<`+(j(e.type)||`Unknown`)+` />`,u=` Did you accidentally export a JSX literal instead of a component?`):f=typeof e,b(`React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s`,f,u)}var p=Fe(e,t,r,o,s);if(p==null)return p;if(l){var m=t.children;if(m!==void 0)if(a)if(ye(m)){for(var h=0;h<m.length;h++)Ke(m[h],e);Object.freeze&&Object.freeze(m)}else b(`React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.`);else Ke(m,e)}if(pe.call(t,`key`)){var g=j(e),_=Object.keys(t).filter(function(e){return e!==`key`}),v=_.length>0?`{key: someKey, `+_.join(`: ..., `)+`: ...}`:`{key: someKey}`;Ye[g+v]||(b(`A props object containing a "key" prop is being spread into JSX:
4
14
  let props = %s;
5
15
  <%s {...props} />
6
16
  React keys must be passed directly to JSX without using spread:
7
17
  let props = %s;
8
- <%s key={someKey} {...props} />`,o,m,h,m),R[m+o]=!0)}if(m=null,i!==void 0&&(r(i),m=``+i),s(n)&&(r(n.key),m=``+n.key),`key`in n)for(var g in i={},n)g!==`key`&&(i[g]=n[g]);else i=n;return m&&l(i,typeof e==`function`?e.displayName||e.name||`Unknown`:e),d(e,m,i,a(),u,f)}function p(e){m(e)?e._store&&(e._store.validated=1):typeof e==`object`&&e&&e.$$typeof===D&&(e._payload.status===`fulfilled`?m(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function m(e){return typeof e==`object`&&!!e&&e.$$typeof===g}var h=require(`react`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.client.reference`),A=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,M=Array.isArray,N=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(e){return e()}};var P,F={},I=h.react_stack_bottom_frame.bind(h,o)(),L=N(i(o)),R={};e.Fragment=v,e.jsx=function(e,t,n){var r=1e4>A.recentlyCreatedOwnerStacks++;return f(e,t,n,!1,r?Error(`react-stack-top-frame`):I,r?N(i(e)):L)},e.jsxs=function(e,t,n){var r=1e4>A.recentlyCreatedOwnerStacks++;return f(e,t,n,!0,r?Error(`react-stack-top-frame`):I,r?N(i(e)):L)}})()})),gt=d(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=mt():t.exports=ht()})),B=gt();function V(e,n,r=Object.freeze({})){let{strlen:i=e=>e.length,remainingCharacters:a=()=>{}}=r;(0,_.useEffect)(()=>{e.hasNodes([S])||function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(57)},[e]),(0,_.useEffect)(()=>{let r=e.getEditorState().read(T),o=0;return Oe(e.registerTextContentListener(e=>{r=e}),e.registerUpdateListener(({dirtyLeaves:s,dirtyElements:l})=>{let u=e.isComposing(),d=s.size>0||l.size>0;if(u||!d)return;let f=i(r),p=f>n||o!==null&&o>n;if(a(n-f),o===null||p){let a=function(e,t,n){let r=Intl.Segmenter,i=0,a=0;if(typeof r==`function`){let o=new r().segment(e);for(let{segment:e}of o){let r=a+n(e);if(r>t)break;a=r,i+=e.length}}else{let r=Array.from(e),o=r.length;for(let e=0;e<o;e++){let o=r[e],s=a+n(o);if(s>t)break;a=s,i+=o.length}}return i}(r,n,i);e.update(()=>{(function(e){let n=Ue(),r=n.length,i=0;for(let a=0;a<r;a+=1){let{node:r}=n[a],o=(0,t.$isLeafNode)(r)&&!(0,t.$findMatchingParent)(r,w);if(w(r)){let n=i;if(i+r.getTextContentSize()<=e){let e=r.getParent(),n=r.getPreviousSibling(),i=r.getNextSibling();pt(r);let a=(0,t.$getSelection)();!(0,t.$isRangeSelection)(a)||a.anchor.getNode().isAttached()&&a.focus.getNode().isAttached()||((0,t.$isTextNode)(n)?n.select():(0,t.$isTextNode)(i)?i.select():e!==null&&e.select())}else if(n<e){let i=r.getFirstDescendant(),a=n+(i===null?0:i.getTextContentSize());((0,t.$isTextNode)(i)&&i.isSimpleText()||a<=e)&&pt(r)}}else if(o){let n=i;if(i+=r.getTextContentSize(),i>e&&!w(r.getParent())){let i=(0,t.$getSelection)(),a;if(n<e&&(0,t.$isTextNode)(r)&&r.isSimpleText()){let[,t]=r.splitText(e-n);a=_t(t)}else a=_t(r);i!==null&&(0,t.$setSelection)(i),vt(a)}}}})(a)},{tag:t.HISTORY_MERGE_TAG})}o=f}),e.registerCommand(t.DELETE_CHARACTER_COMMAND,e=>{let n=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(n))return!1;let r=n.anchor.getNode().getParent(),i=r?r.getParent():null,a=i?i.getNextSibling():null;return n.deleteCharacter(e),i&&i.isEmpty()?i.remove():(0,t.$isElementNode)(a)&&a.isEmpty()&&a.remove(),!0},t.COMMAND_PRIORITY_LOW))},[e,n,a,i])}function _t(e){let t=C();return e.replace(t),t.append(e),t}function vt(e){let n=e.getPreviousSibling();if(!w(n))return;let r=e.getFirstChild(),i=n.getChildren(),a=i.length;if(r===null)e.append(...i);else for(let e=0;e<a;e++)r.insertBefore(i[e]);let o=(0,t.$getSelection)();if((0,t.$isRangeSelection)(o)){let t=o.anchor,r=t.getNode(),i=o.focus,s=t.getNode();r.is(n)?t.set(e.getKey(),t.offset,`element`):r.is(e)&&t.set(e.getKey(),a+t.offset,`element`),s.is(n)?i.set(e.getKey(),i.offset,`element`):s.is(e)&&i.set(e.getKey(),a+i.offset,`element`)}n.remove()}var yt=null;function bt(e){let t=window.TextEncoder===void 0?null:(yt===null&&(yt=new window.TextEncoder),yt);if(t===null){let t=encodeURIComponent(e).match(/%[89ABab]/g);return e.length+(t?t.length:0)}return t.encode(e).length}function xt({remainingCharacters:e}){return(0,B.jsx)(`span`,{className:`characters-limit `+(e<0?`characters-limit-exceeded`:``),children:e})}function St({charset:e=`UTF-16`,maxLength:t=5,renderer:n=xt}){let[r]=b(),[i,a]=(0,_.useState)(t);return V(r,t,(0,_.useMemo)(()=>({remainingCharacters:a,strlen:t=>{if(e===`UTF-8`)return bt(t);if(e===`UTF-16`)return t.length;throw Error(`Unrecognized charset`)}}),[e])),n({remainingCharacters:i})}var Ct=Symbol.for(`preact-signals`);function wt(){if(Ot>1)return void Ot--;let e,t=!1;for(;Et!==void 0;){let n=Et;for(Et=void 0,kt++;n!==void 0;){let r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Pt(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(kt=0,Ot--,t)throw e}function H(e){if(Ot>0)return e();Ot++;try{return e()}finally{wt()}}var Tt,Et;function Dt(e){let t=Tt;Tt=void 0;try{return e()}finally{Tt=t}}var Ot=0,kt=0,At=0;function jt(e){if(Tt===void 0)return;let t=e.n;return t===void 0||t.t!==Tt?(t={i:0,S:e,p:Tt.s,n:void 0,t:Tt,e:void 0,x:void 0,r:t},Tt.s!==void 0&&(Tt.s.n=t),Tt.s=t,e.n=t,32&Tt.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Tt.s,t.n=void 0,Tt.s.n=t,Tt.s=t),t):void 0}function Mt(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Nt(e,t){return new Mt(e,t)}function Pt(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Ft(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function It(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function Lt(e,t){Mt.call(this,void 0),this.x=e,this.s=void 0,this.g=At-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Rt(e,t){return new Lt(e,t)}function zt(e){let t=e.u;if(e.u=void 0,typeof t==`function`){Ot++;let n=Tt;Tt=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Bt(e),t}finally{Tt=n,wt()}}}function Bt(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,zt(e)}function Vt(e){if(Tt!==this)throw Error(`Out-of-order effect`);It(this),Tt=e,this.f&=-2,8&this.f&&Bt(this),wt()}function Ht(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function Ut(e,t){let n=new Ht(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}function Wt(e,t={}){let n={};for(let r in e){let i=t[r];n[r]=Nt(i===void 0?e[r]:i)}return n}Mt.prototype.brand=Ct,Mt.prototype.h=function(){return!0},Mt.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?Dt(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},Mt.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&Dt(()=>{var e;(e=this.Z)==null||e.call(this)}))}},Mt.prototype.subscribe=function(e){return Ut(()=>{let t=this.value,n=Tt;Tt=void 0;try{e(t)}finally{Tt=n}},{name:`sub`})},Mt.prototype.valueOf=function(){return this.value},Mt.prototype.toString=function(){return this.value+``},Mt.prototype.toJSON=function(){return this.value},Mt.prototype.peek=function(){let e=Tt;Tt=void 0;try{return this.value}finally{Tt=e}},Object.defineProperty(Mt.prototype,`value`,{get(){let e=jt(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(kt>100)throw Error(`Cycle detected`);this.v=e,this.i++,At++,Ot++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{wt()}}}}),Lt.prototype=new Mt,Lt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===At))return!0;if(this.g=At,this.f|=1,this.i>0&&!Pt(this))return this.f&=-2,!0;let e=Tt;try{Ft(this),Tt=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return Tt=e,It(this),this.f&=-2,!0},Lt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Mt.prototype.S.call(this,e)},Lt.prototype.U=function(e){if(this.t!==void 0&&(Mt.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},Lt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Lt.prototype,`value`,{get(){if(1&this.f)throw Error(`Cycle detected`);let e=jt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Ht.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.u=e)}finally{e()}},Ht.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,zt(this),Ft(this),Ot++;let e=Tt;return Tt=this,Vt.bind(this,e)},Ht.prototype.N=function(){2&this.f||(this.f|=2,this.o=Et,Et=this)},Ht.prototype.d=function(){this.f|=8,1&this.f||Bt(this)},Ht.prototype.dispose=function(){this.d()},(0,t.defineExtension)({build:(e,t,n)=>Wt(t),config:(0,t.safeCast)({defaultSelection:`rootEnd`,disabled:!1}),name:`@lexical/extension/AutoFocus`,register(e,t,n){let r=n.getOutput();return Ut(()=>r.disabled.value?void 0:e.registerRootListener(t=>{e.focus(()=>{let e=document.activeElement;t===null||e!==null&&t.contains(e)||t.focus({preventScroll:!0})},{defaultSelection:r.defaultSelection.peek()})}))}});function Gt(){let e=(0,t.$getRoot)(),n=(0,t.$getSelection)(),r=(0,t.$createParagraphNode)();e.clear(),e.append(r),n!==null&&r.select(),(0,t.$isRangeSelection)(n)&&(n.format=0)}function Kt(e,n=Gt){return e.registerCommand(t.CLEAR_EDITOR_COMMAND,t=>(e.update(n),!0),t.COMMAND_PRIORITY_EDITOR)}(0,t.defineExtension)({build:(e,t,n)=>Wt(t),config:(0,t.safeCast)({$onClear:Gt}),name:`@lexical/extension/ClearEditor`,register(e,t,n){let{$onClear:r}=n.getOutput();return Ut(()=>Kt(e,r.value))}});function qt(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}function Jt(e,t){let n;return Nt(e(),{unwatched(){n&&=(n(),void 0)},watched(){this.value=e(),n=t(this)}})}var Yt=(0,t.defineExtension)({build:e=>Jt(()=>e.getEditorState(),t=>e.registerUpdateListener(e=>{t.value=e.editorState})),name:`@lexical/extension/EditorState`});function Xt(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Zt(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)n[e]=Zt(n[e],r[e]);return e}return t}var Qt=0,$t=1,en=2,tn=3,nn=4,rn=5,an=6,on=7;function sn(e){return e.id===Qt}function cn(e){return e.id===en}function ln(e){return function(e){return e.id===$t}(e)||Xt(305,String(e.id),String($t)),Object.assign(e,{id:en})}var un=new Set,dn=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:Qt}}mergeConfigs(){let e=this.extension.config||{},n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):t.shallowMergeConfig;for(let t of this.configs)e=n(e,t);return e}init(e){let t=this.state;cn(t)||Xt(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:tn,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:nn,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==nn&&Xt(307,String(t.id),String(rn)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:rn,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==rn&&Xt(308,String(n.id),String(rn));let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:an})}(n),()=>{let e=this.state;e.id!==on&&Xt(309,String(n.id),String(on)),this.state=function(e){return Object.assign(e,{id:rn})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==an&&Xt(310,String(t.id),String(an)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:on})}(t),n}getSignal(){return this._signal===void 0&&Xt(311),this._signal}getInitResult(){this.extension.init===void 0&&Xt(312,this.extension.name);let e=this.state;return function(e){return e.id>=nn}(e)||Xt(313,String(e.id),String(nn)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=tn}(e)||Xt(314,String(e.id),String(tn)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Xt(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Xt(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=on}(e)||Xt(316,String(e.id),String(on)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||un}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=rn})(e)||Xt(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},fn={tag:t.HISTORY_MERGE_TAG};function pn(){let e=(0,t.$getRoot)();e.isEmpty()&&e.append((0,t.$createParagraphNode)())}var mn=(0,t.defineExtension)({config:(0,t.safeCast)({setOptions:fn,updateOptions:fn}),init:({$initialEditorState:e=pn})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:n,setOptions:r},i){let a=i.getInitResult();if(!a.initialized){a.initialized=!0;let{$initialEditorState:i}=a;if((0,t.$isEditorState)(i))e.setEditorState(i,r);else if(typeof i==`function`)e.update(()=>{i(e)},n);else if(i&&(typeof i==`string`||typeof i==`object`)){let t=e.parseEditorState(i);e.setEditorState(t,r)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[t.RootNode,t.TextNode,t.LineBreakNode,t.TabNode,t.ParagraphNode]}),hn=Symbol.for(`@lexical/extension/LexicalBuilder`);function gn(){}function _n(e){throw e}function vn(e){return Array.isArray(e)?e:[e]}var yn=`0.39.0+prod.esm`,bn=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=yn,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[vn(mn)];for(let e of t)n.push(vn(e));return new e(n)}static maybeFromEditor(t){let n=t[hn];return n&&(n.PACKAGE_VERSION!==yn&&Xt(292,n.PACKAGE_VERSION,yn),n instanceof e||Xt(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&Xt(294),n}constructEditor(){let{$initialEditorState:e,onError:n,...r}=this.buildCreateEditorArgs(),i=Object.assign((0,t.createEditor)({...r,...n?{onError:e=>{n(e,i)}}:{}}),{[hn]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=gn;function t(){try{e()}finally{e=gn}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=Oe(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&Xt(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);r?r.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&Xt(296);let[t]=vn(e);typeof t.name!=`string`&&Xt(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&Xt(298,t.name),!n){n=new dn(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&Xt(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&Xt(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=vn(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(cn(i))return;let a=n.extension.name;var o;sn(i)||Xt(300,a,r||`[unknown]`),sn(o=i)||Xt(304,String(o.id),String(Qt)),i=Object.assign(o,{id:$t}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=ln(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())sn(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&Xt(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return Oe(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of qt(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&Xt(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&Zt(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=[...t]);let s=Object.keys(i).length>0,l=r.size>0;(s||l)&&(e.html={},s&&(e.html.import=i),l&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=_n,e}};function xn(e,t){let n=bn.fromEditor(e).extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}var Sn=new Set,Cn=(0,t.defineExtension)({build(e,n,r){let i=r.getDependency(Yt).output,a=Nt({watchedNodeKeys:new Map}),o=Jt(()=>{},()=>Ut(()=>{let e=o.peek(),{watchedNodeKeys:n}=a.value,r,s=!1;i.value.read(()=>{if((0,t.$getSelection)())for(let[i,a]of n.entries()){if(a.size===0){n.delete(i);continue}let o=(0,t.$getNodeByKey)(i),l=o&&o.isSelected()||!1;s||=l!==(!!e&&e.has(i)),l&&(r||=new Set,r.add(i))}}),!s&&r&&e&&r.size===e.size||(o.value=r)}));return{watchNodeKey:function(e){let t=Rt(()=>(o.value||Sn).has(e)),{watchedNodeKeys:n}=a.peek(),r=n.get(e),i=r!==void 0;return r||=new Set,r.add(t),i||(n.set(e,r),a.value={watchedNodeKeys:n}),t}}},dependencies:[Yt],name:`@lexical/extension/NodeSelection`}),wn=(0,t.createCommand)(`INSERT_HORIZONTAL_RULE_COMMAND`),Tn=class e extends t.DecoratorNode{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return Dn().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:En,priority:0})}}exportDOM(){return{element:document.createElement(`hr`)}}createDOM(e){let t=document.createElement(`hr`);return ze(t,e.theme.hr),t}getTextContent(){return`
18
+ <%s key={someKey} {...props} />`,v,g,_.length>0?`{`+_.join(`: ..., `)+`: ...}`:`{}`,g),Ye[g+v]=!0)}return e===i?Je(p):qe(p),p}function Ze(e,t,n){return Xe(e,t,n,!0)}function Qe(e,t,n){return Xe(e,t,n,!1)}var $e=Qe,et=Ze;e.Fragment=i,e.jsx=$e,e.jsxs=et})()})),gt=d(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=mt():t.exports=ht()})),B=gt();function V(e,n,r=Object.freeze({})){let{strlen:i=e=>e.length,remainingCharacters:a=()=>{}}=r;(0,_.useEffect)(()=>{e.hasNodes([S])||function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(57)},[e]),(0,_.useEffect)(()=>{let r=e.getEditorState().read(T),o=0;return Oe(e.registerTextContentListener(e=>{r=e}),e.registerUpdateListener(({dirtyLeaves:s,dirtyElements:l})=>{let u=e.isComposing(),d=s.size>0||l.size>0;if(u||!d)return;let f=i(r),p=f>n||o!==null&&o>n;if(a(n-f),o===null||p){let a=function(e,t,n){let r=Intl.Segmenter,i=0,a=0;if(typeof r==`function`){let o=new r().segment(e);for(let{segment:e}of o){let r=a+n(e);if(r>t)break;a=r,i+=e.length}}else{let r=Array.from(e),o=r.length;for(let e=0;e<o;e++){let o=r[e],s=a+n(o);if(s>t)break;a=s,i+=o.length}}return i}(r,n,i);e.update(()=>{(function(e){let n=Ue(),r=n.length,i=0;for(let a=0;a<r;a+=1){let{node:r}=n[a],o=(0,t.$isLeafNode)(r)&&!(0,t.$findMatchingParent)(r,w);if(w(r)){let n=i;if(i+r.getTextContentSize()<=e){let e=r.getParent(),n=r.getPreviousSibling(),i=r.getNextSibling();pt(r);let a=(0,t.$getSelection)();!(0,t.$isRangeSelection)(a)||a.anchor.getNode().isAttached()&&a.focus.getNode().isAttached()||((0,t.$isTextNode)(n)?n.select():(0,t.$isTextNode)(i)?i.select():e!==null&&e.select())}else if(n<e){let i=r.getFirstDescendant(),a=n+(i===null?0:i.getTextContentSize());((0,t.$isTextNode)(i)&&i.isSimpleText()||a<=e)&&pt(r)}}else if(o){let n=i;if(i+=r.getTextContentSize(),i>e&&!w(r.getParent())){let i=(0,t.$getSelection)(),a;if(n<e&&(0,t.$isTextNode)(r)&&r.isSimpleText()){let[,t]=r.splitText(e-n);a=_t(t)}else a=_t(r);i!==null&&(0,t.$setSelection)(i),vt(a)}}}})(a)},{tag:t.HISTORY_MERGE_TAG})}o=f}),e.registerCommand(t.DELETE_CHARACTER_COMMAND,e=>{let n=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(n))return!1;let r=n.anchor.getNode().getParent(),i=r?r.getParent():null,a=i?i.getNextSibling():null;return n.deleteCharacter(e),i&&i.isEmpty()?i.remove():(0,t.$isElementNode)(a)&&a.isEmpty()&&a.remove(),!0},t.COMMAND_PRIORITY_LOW))},[e,n,a,i])}function _t(e){let t=C();return e.replace(t),t.append(e),t}function vt(e){let n=e.getPreviousSibling();if(!w(n))return;let r=e.getFirstChild(),i=n.getChildren(),a=i.length;if(r===null)e.append(...i);else for(let e=0;e<a;e++)r.insertBefore(i[e]);let o=(0,t.$getSelection)();if((0,t.$isRangeSelection)(o)){let t=o.anchor,r=t.getNode(),i=o.focus,s=t.getNode();r.is(n)?t.set(e.getKey(),t.offset,`element`):r.is(e)&&t.set(e.getKey(),a+t.offset,`element`),s.is(n)?i.set(e.getKey(),i.offset,`element`):s.is(e)&&i.set(e.getKey(),a+i.offset,`element`)}n.remove()}var yt=null;function bt(e){let t=window.TextEncoder===void 0?null:(yt===null&&(yt=new window.TextEncoder),yt);if(t===null){let t=encodeURIComponent(e).match(/%[89ABab]/g);return e.length+(t?t.length:0)}return t.encode(e).length}function xt({remainingCharacters:e}){return(0,B.jsx)(`span`,{className:`characters-limit `+(e<0?`characters-limit-exceeded`:``),children:e})}function St({charset:e=`UTF-16`,maxLength:t=5,renderer:n=xt}){let[r]=b(),[i,a]=(0,_.useState)(t);return V(r,t,(0,_.useMemo)(()=>({remainingCharacters:a,strlen:t=>{if(e===`UTF-8`)return bt(t);if(e===`UTF-16`)return t.length;throw Error(`Unrecognized charset`)}}),[e])),n({remainingCharacters:i})}var Ct=Symbol.for(`preact-signals`);function wt(){if(Ot>1)return void Ot--;let e,t=!1;for(;Et!==void 0;){let n=Et;for(Et=void 0,kt++;n!==void 0;){let r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Pt(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(kt=0,Ot--,t)throw e}function H(e){if(Ot>0)return e();Ot++;try{return e()}finally{wt()}}var Tt,Et;function Dt(e){let t=Tt;Tt=void 0;try{return e()}finally{Tt=t}}var Ot=0,kt=0,At=0;function jt(e){if(Tt===void 0)return;let t=e.n;return t===void 0||t.t!==Tt?(t={i:0,S:e,p:Tt.s,n:void 0,t:Tt,e:void 0,x:void 0,r:t},Tt.s!==void 0&&(Tt.s.n=t),Tt.s=t,e.n=t,32&Tt.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Tt.s,t.n=void 0,Tt.s.n=t,Tt.s=t),t):void 0}function Mt(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Nt(e,t){return new Mt(e,t)}function Pt(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Ft(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function It(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function Lt(e,t){Mt.call(this,void 0),this.x=e,this.s=void 0,this.g=At-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Rt(e,t){return new Lt(e,t)}function zt(e){let t=e.u;if(e.u=void 0,typeof t==`function`){Ot++;let n=Tt;Tt=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Bt(e),t}finally{Tt=n,wt()}}}function Bt(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,zt(e)}function Vt(e){if(Tt!==this)throw Error(`Out-of-order effect`);It(this),Tt=e,this.f&=-2,8&this.f&&Bt(this),wt()}function Ht(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function Ut(e,t){let n=new Ht(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}function Wt(e,t={}){let n={};for(let r in e){let i=t[r];n[r]=Nt(i===void 0?e[r]:i)}return n}Mt.prototype.brand=Ct,Mt.prototype.h=function(){return!0},Mt.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?Dt(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},Mt.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&Dt(()=>{var e;(e=this.Z)==null||e.call(this)}))}},Mt.prototype.subscribe=function(e){return Ut(()=>{let t=this.value,n=Tt;Tt=void 0;try{e(t)}finally{Tt=n}},{name:`sub`})},Mt.prototype.valueOf=function(){return this.value},Mt.prototype.toString=function(){return this.value+``},Mt.prototype.toJSON=function(){return this.value},Mt.prototype.peek=function(){let e=Tt;Tt=void 0;try{return this.value}finally{Tt=e}},Object.defineProperty(Mt.prototype,`value`,{get(){let e=jt(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(kt>100)throw Error(`Cycle detected`);this.v=e,this.i++,At++,Ot++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{wt()}}}}),Lt.prototype=new Mt,Lt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===At))return!0;if(this.g=At,this.f|=1,this.i>0&&!Pt(this))return this.f&=-2,!0;let e=Tt;try{Ft(this),Tt=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return Tt=e,It(this),this.f&=-2,!0},Lt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Mt.prototype.S.call(this,e)},Lt.prototype.U=function(e){if(this.t!==void 0&&(Mt.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},Lt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Lt.prototype,`value`,{get(){if(1&this.f)throw Error(`Cycle detected`);let e=jt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Ht.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.u=e)}finally{e()}},Ht.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,zt(this),Ft(this),Ot++;let e=Tt;return Tt=this,Vt.bind(this,e)},Ht.prototype.N=function(){2&this.f||(this.f|=2,this.o=Et,Et=this)},Ht.prototype.d=function(){this.f|=8,1&this.f||Bt(this)},Ht.prototype.dispose=function(){this.d()},(0,t.defineExtension)({build:(e,t,n)=>Wt(t),config:(0,t.safeCast)({defaultSelection:`rootEnd`,disabled:!1}),name:`@lexical/extension/AutoFocus`,register(e,t,n){let r=n.getOutput();return Ut(()=>r.disabled.value?void 0:e.registerRootListener(t=>{e.focus(()=>{let e=document.activeElement;t===null||e!==null&&t.contains(e)||t.focus({preventScroll:!0})},{defaultSelection:r.defaultSelection.peek()})}))}});function Gt(){let e=(0,t.$getRoot)(),n=(0,t.$getSelection)(),r=(0,t.$createParagraphNode)();e.clear(),e.append(r),n!==null&&r.select(),(0,t.$isRangeSelection)(n)&&(n.format=0)}function Kt(e,n=Gt){return e.registerCommand(t.CLEAR_EDITOR_COMMAND,t=>(e.update(n),!0),t.COMMAND_PRIORITY_EDITOR)}(0,t.defineExtension)({build:(e,t,n)=>Wt(t),config:(0,t.safeCast)({$onClear:Gt}),name:`@lexical/extension/ClearEditor`,register(e,t,n){let{$onClear:r}=n.getOutput();return Ut(()=>Kt(e,r.value))}});function qt(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}function Jt(e,t){let n;return Nt(e(),{unwatched(){n&&=(n(),void 0)},watched(){this.value=e(),n=t(this)}})}var Yt=(0,t.defineExtension)({build:e=>Jt(()=>e.getEditorState(),t=>e.registerUpdateListener(e=>{t.value=e.editorState})),name:`@lexical/extension/EditorState`});function Xt(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Zt(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)n[e]=Zt(n[e],r[e]);return e}return t}var Qt=0,$t=1,en=2,tn=3,nn=4,rn=5,an=6,on=7;function sn(e){return e.id===Qt}function cn(e){return e.id===en}function ln(e){return function(e){return e.id===$t}(e)||Xt(305,String(e.id),String($t)),Object.assign(e,{id:en})}var un=new Set,dn=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:Qt}}mergeConfigs(){let e=this.extension.config||{},n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):t.shallowMergeConfig;for(let t of this.configs)e=n(e,t);return e}init(e){let t=this.state;cn(t)||Xt(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:tn,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:nn,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==nn&&Xt(307,String(t.id),String(rn)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:rn,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==rn&&Xt(308,String(n.id),String(rn));let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:an})}(n),()=>{let e=this.state;e.id!==on&&Xt(309,String(n.id),String(on)),this.state=function(e){return Object.assign(e,{id:rn})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==an&&Xt(310,String(t.id),String(an)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:on})}(t),n}getSignal(){return this._signal===void 0&&Xt(311),this._signal}getInitResult(){this.extension.init===void 0&&Xt(312,this.extension.name);let e=this.state;return function(e){return e.id>=nn}(e)||Xt(313,String(e.id),String(nn)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=tn}(e)||Xt(314,String(e.id),String(tn)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Xt(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Xt(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=on}(e)||Xt(316,String(e.id),String(on)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||un}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=rn})(e)||Xt(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},fn={tag:t.HISTORY_MERGE_TAG};function pn(){let e=(0,t.$getRoot)();e.isEmpty()&&e.append((0,t.$createParagraphNode)())}var mn=(0,t.defineExtension)({config:(0,t.safeCast)({setOptions:fn,updateOptions:fn}),init:({$initialEditorState:e=pn})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:n,setOptions:r},i){let a=i.getInitResult();if(!a.initialized){a.initialized=!0;let{$initialEditorState:i}=a;if((0,t.$isEditorState)(i))e.setEditorState(i,r);else if(typeof i==`function`)e.update(()=>{i(e)},n);else if(i&&(typeof i==`string`||typeof i==`object`)){let t=e.parseEditorState(i);e.setEditorState(t,r)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[t.RootNode,t.TextNode,t.LineBreakNode,t.TabNode,t.ParagraphNode]}),hn=Symbol.for(`@lexical/extension/LexicalBuilder`);function gn(){}function _n(e){throw e}function vn(e){return Array.isArray(e)?e:[e]}var yn=`0.39.0+prod.esm`,bn=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=yn,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[vn(mn)];for(let e of t)n.push(vn(e));return new e(n)}static maybeFromEditor(t){let n=t[hn];return n&&(n.PACKAGE_VERSION!==yn&&Xt(292,n.PACKAGE_VERSION,yn),n instanceof e||Xt(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&Xt(294),n}constructEditor(){let{$initialEditorState:e,onError:n,...r}=this.buildCreateEditorArgs(),i=Object.assign((0,t.createEditor)({...r,...n?{onError:e=>{n(e,i)}}:{}}),{[hn]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=gn;function t(){try{e()}finally{e=gn}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=Oe(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&Xt(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);r?r.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&Xt(296);let[t]=vn(e);typeof t.name!=`string`&&Xt(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&Xt(298,t.name),!n){n=new dn(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&Xt(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&Xt(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=vn(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(cn(i))return;let a=n.extension.name;var o;sn(i)||Xt(300,a,r||`[unknown]`),sn(o=i)||Xt(304,String(o.id),String(Qt)),i=Object.assign(o,{id:$t}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=ln(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())sn(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&Xt(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return Oe(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of qt(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&Xt(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&Zt(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=[...t]);let s=Object.keys(i).length>0,l=r.size>0;(s||l)&&(e.html={},s&&(e.html.import=i),l&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=_n,e}};function xn(e,t){let n=bn.fromEditor(e).extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}var Sn=new Set,Cn=(0,t.defineExtension)({build(e,n,r){let i=r.getDependency(Yt).output,a=Nt({watchedNodeKeys:new Map}),o=Jt(()=>{},()=>Ut(()=>{let e=o.peek(),{watchedNodeKeys:n}=a.value,r,s=!1;i.value.read(()=>{if((0,t.$getSelection)())for(let[i,a]of n.entries()){if(a.size===0){n.delete(i);continue}let o=(0,t.$getNodeByKey)(i),l=o&&o.isSelected()||!1;s||=l!==(!!e&&e.has(i)),l&&(r||=new Set,r.add(i))}}),!s&&r&&e&&r.size===e.size||(o.value=r)}));return{watchNodeKey:function(e){let t=Rt(()=>(o.value||Sn).has(e)),{watchedNodeKeys:n}=a.peek(),r=n.get(e),i=r!==void 0;return r||=new Set,r.add(t),i||(n.set(e,r),a.value={watchedNodeKeys:n}),t}}},dependencies:[Yt],name:`@lexical/extension/NodeSelection`}),wn=(0,t.createCommand)(`INSERT_HORIZONTAL_RULE_COMMAND`),Tn=class e extends t.DecoratorNode{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return Dn().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:En,priority:0})}}exportDOM(){return{element:document.createElement(`hr`)}}createDOM(e){let t=document.createElement(`hr`);return ze(t,e.theme.hr),t}getTextContent(){return`
9
19
  `}isInline(){return!1}updateDOM(){return!1}};function En(){return{node:Dn()}}function Dn(){return(0,t.$create)(Tn)}function On(e){return e instanceof Tn}(0,t.defineExtension)({dependencies:[Yt,Cn],name:`@lexical/extension/HorizontalRule`,nodes:()=>[Tn],register(e,n,r){let{watchNodeKey:i}=r.getDependency(Cn).output,a=Nt({nodeSelections:new Map}),o=e._config.theme.hrSelected??`selected`;return Oe(e.registerCommand(t.CLICK_COMMAND,e=>{if((0,t.isDOMNode)(e.target)){let n=(0,t.$getNodeFromDOMNode)(e.target);if(On(n))return function(e,n=!1){let r=(0,t.$getSelection)(),i=e.isSelected(),a=e.getKey(),o;n&&(0,t.$isNodeSelection)(r)?o=r:(o=(0,t.$createNodeSelection)(),(0,t.$setSelection)(o)),i?o.delete(a):o.add(a)}(n,e.shiftKey),!0}return!1},t.COMMAND_PRIORITY_LOW),e.registerMutationListener(Tn,(t,n)=>{H(()=>{let n=!1,{nodeSelections:r}=a.peek();for(let[a,o]of t.entries())if(o===`destroyed`)r.delete(a),n=!0;else{let t=r.get(a),o=e.getElementByKey(a);t?t.domNode.value=o:(n=!0,r.set(a,{domNode:Nt(o),selectedSignal:i(a)}))}n&&(a.value={nodeSelections:r})})}),Ut(()=>{let e=[];for(let{domNode:t,selectedSignal:n}of a.value.nodeSelections.values())e.push(Ut(()=>{let e=t.value;e&&(n.value?ze(e,o):Be(e,o))}));return Oe(...e)}))}});function kn(e,n){return Oe(e.registerCommand(t.KEY_TAB_COMMAND,n=>{let r=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(r))return!1;n.preventDefault();let i=function(e){if(rt(e.getNodes(),e=>(0,t.$isBlockElementNode)(e)&&e.canIndent()?e:null).length>0)return!0;let n=e.anchor,r=e.focus,i=r.isBefore(n)?r:n,a=Ze(i.getNode());if(a.canIndent()){let e=a.getKey(),n=(0,t.$createRangeSelection)();if(n.anchor.set(e,0,`element`),n.focus.set(e,0,`element`),n=(0,t.$normalizeSelection__EXPERIMENTAL)(n),n.anchor.is(i))return!0}return!1}(r)?n.shiftKey?t.OUTDENT_CONTENT_COMMAND:t.INDENT_CONTENT_COMMAND:t.INSERT_TAB_COMMAND;return e.dispatchCommand(i,void 0)},t.COMMAND_PRIORITY_EDITOR),e.registerCommand(t.INDENT_CONTENT_COMMAND,()=>{let e=typeof n==`number`?n:n?n.peek():null;if(e==null)return!1;let r=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(r))return!1;let i=r.getNodes().map(e=>Ze(e).getIndent());return Math.max(...i)+1>=e},t.COMMAND_PRIORITY_CRITICAL))}(0,t.defineExtension)({build:(e,t,n)=>Wt(t),config:(0,t.safeCast)({disabled:!1,maxIndent:null}),name:`@lexical/extension/TabIndentation`,register(e,t,n){let{disabled:r,maxIndent:i}=n.getOutput();return Ut(()=>{if(!r.value)return kn(e,i)})}});function An(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function jn(e){let t=1,n=e.getParent();for(;n!=null;){if(Zn(n)){let e=n.getParent();if(ir(e)){t++,n=e.getParent();continue}An(40)}return t}return t}function Mn(e){let t=e.getParent();ir(t)||An(40);let n=t;for(;n!==null;)n=n.getParent(),ir(n)&&(t=n);return t}function Nn(e){let t=[],n=e.getChildren().filter(Zn);for(let e=0;e<n.length;e++){let r=n[e],i=r.getFirstChild();ir(i)?t=t.concat(Nn(i)):t.push(r)}return t}function Pn(e){return Zn(e)&&ir(e.getFirstChild())}function Fn(e){return Xn().append(e)}function In(e,t){return Zn(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function Ln(e){let n=(0,t.$getSelection)();if(n!==null){let r=n.getNodes();if((0,t.$isRangeSelection)(n)){let i=n.getStartEndPoints();i===null&&An(143);let[a]=i,o=a.getNode(),s=o.getParent();if((0,t.$isRootOrShadowRoot)(o)){let e=o.getFirstChild();if(e)r=e.selectStart().getNodes();else{let e=(0,t.$createParagraphNode)();o.append(e),r=e.select().getNodes()}}else if(In(o,r)){let n=rr(e);if((0,t.$isRootOrShadowRoot)(s)){o.replace(n);let e=Xn();(0,t.$isElementNode)(o)&&(e.setFormat(o.getFormatType()),e.setIndent(o.getIndent())),n.append(e)}else if(Zn(o)){let e=o.getParentOrThrow();Rn(n,e.getChildren()),e.replace(n)}return}}let i=new Set;for(let n=0;n<r.length;n++){let a=r[n];if((0,t.$isElementNode)(a)&&a.isEmpty()&&!Zn(a)&&!i.has(a.getKey())){zn(a,e);continue}let o=(0,t.$isLeafNode)(a)?a.getParent():Zn(a)&&a.isEmpty()?a:null;for(;o!=null;){let n=o.getKey();if(ir(o)){if(!i.has(n)){let t=rr(e);Rn(t,o.getChildren()),o.replace(t),i.add(n)}break}{let r=o.getParent();if((0,t.$isRootOrShadowRoot)(r)&&!i.has(n)){i.add(n),zn(o,e);break}o=r}}}}}function Rn(e,t){e.splice(e.getChildrenSize(),0,t)}function zn(e,t){if(ir(e))return e;let n=e.getPreviousSibling(),r=e.getNextSibling(),i=Xn(),a;if(Rn(i,e.getChildren()),ir(n)&&t===n.getListType())n.append(i),ir(r)&&t===r.getListType()&&(Rn(n,r.getChildren()),r.remove()),a=n;else if(ir(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),a=r;else{let n=rr(t);n.append(i),e.replace(n),a=n}return i.setFormat(e.getFormatType()),i.setIndent(e.getIndent()),e.remove(),a}function Bn(e,t){let n=e.getLastChild(),r=t.getFirstChild();n&&r&&Pn(n)&&Pn(r)&&(Bn(n.getFirstChild(),r.getFirstChild()),r.remove());let i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function Vn(){let e=(0,t.$getSelection)();if((0,t.$isRangeSelection)(e)){let n=new Set,r=e.getNodes(),i=e.anchor.getNode();if(In(i,r))n.add(Mn(i));else for(let e=0;e<r.length;e++){let i=r[e];if((0,t.$isLeafNode)(i)){let e=Xe(i,qn);e!=null&&n.add(Mn(e))}}for(let r of n){let n=r,i=Nn(r);for(let r of i){let i=(0,t.$createParagraphNode)().setTextStyle(e.style).setTextFormat(e.format);Rn(i,r.getChildren()),n.insertAfter(i),n=i,r.__key===e.anchor.key&&(0,t.$setPointFromCaret)(e.anchor,(0,t.$normalizeCaret)((0,t.$getChildCaret)(i,`next`))),r.__key===e.focus.key&&(0,t.$setPointFromCaret)(e.focus,(0,t.$normalizeCaret)((0,t.$getChildCaret)(i,`next`))),r.remove()}r.remove()}}}function Hn(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())Zn(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),ir(r.getFirstChild())||n++)}function Un(e){let t=new Set;if(Pn(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(Pn(r)&&Pn(i)){let n=i.getFirstChild();if(ir(n)){n.append(e);let i=r.getFirstChild();ir(i)&&(Rn(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(Pn(r)){let t=r.getFirstChild();if(ir(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(Pn(i)){let t=i.getFirstChild();ir(t)&&t.append(e)}else if(ir(n)){let t=Xn().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),a=rr(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function Wn(e){if(Pn(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(ir(n?n.getParent():void 0)&&Zn(n)&&ir(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=t.getListType(),i=Xn(),a=rr(r);i.append(a),e.getPreviousSiblings().forEach(e=>a.append(e));let o=Xn(),s=rr(r);o.append(s),Rn(s,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(o),n.replace(e)}}}function Gn(){let e=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(e)||!e.isCollapsed())return!1;let n=e.anchor.getNode();if(!Zn(n)||n.getChildrenSize()!==0)return!1;let r=Mn(n),i=n.getParent();ir(i)||An(40);let a=i.getParent(),o;if((0,t.$isRootOrShadowRoot)(a))o=(0,t.$createParagraphNode)(),r.insertAfter(o);else{if(!Zn(a))return!1;o=Xn(),a.insertAfter(o)}o.setTextStyle(e.style).setTextFormat(e.format).select();let s=n.getNextSiblings();if(s.length>0){let e=rr(i.getListType());if(Zn(o)){let t=Xn();t.append(e),o.insertAfter(t)}else o.insertAfter(e);e.append(...s)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!Zn(e)&&!ir(e))break;t=e}t.remove()}(n),!0}function Kn(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}var qn=class extends t.ElementNode{__value;__checked;$config(){return this.config(`listitem`,{$transform:e=>{if(e.__checked==null)return;let t=e.getParent();ir(t)&&t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0)},extends:t.ElementNode,importDOM:(0,t.buildImportMap)({li:()=>({conversion:Jn,priority:0})})})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let t=document.createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(e,t,n){let r=t.getParent();!ir(r)||r.getListType()!==`check`||ir(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),n&&t.__checked===n.__checked||e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))})(t,this,e),t.value=this.__value,function(e,t,n){let r=[],i=[],a=t.list,o=a?a.listitem:void 0,s;if(a&&a.nested&&(s=a.nested.listitem),o!==void 0&&r.push(...Kn(o)),a){let e=n.getParent(),t=ir(e)&&e.getListType()===`check`,o=n.getChecked();t&&!o||i.push(a.listitemUnchecked),t&&o||i.push(a.listitemChecked),t&&r.push(o?a.listitemChecked:a.listitemUnchecked)}if(s!==void 0){let e=Kn(s);n.getChildren().some(e=>ir(e))?r.push(...e):i.push(...e)}i.length>0&&Be(e,...i),r.length>0&&ze(e,...r)}(t,n.theme,this);let r=e?e.__style:``,i=this.__style;r!==i&&(i===``?t.removeAttribute(`style`):t.style.cssText=i),function(e,t,n){let r=R(t.__textStyle);for(let t in r)e.style.setProperty(`--listitem-marker-${t}`,r[t]);if(n)for(let t in R(n.__textStyle))t in r||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let n=0;n<e.length;n++){let r=e[n];if((0,t.$isElementNode)(r)&&this.canMergeWith(r)){let e=r.getChildren();this.append(...e),r.remove()}else super.append(r)}return this}replace(e,n){if(Zn(e))return super.replace(e);this.setIndent(0);let r=this.getParentOrThrow();if(!ir(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{let t=rr(r.getListType()),n=this.getNextSibling();for(;n;){let e=n;n=n.getNextSibling(),t.append(e)}r.insertAfter(e),e.insertAfter(t)}return n&&((0,t.$isElementNode)(e)||An(139),this.getChildren().forEach(t=>{e.append(t)})),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(ir(n)||An(39),Zn(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(n.insertAfter(e,t),r.length!==0){let i=rr(n.getListType());r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&Pn(t)&&Pn(n)&&(Bn(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){let n=Xn().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){let n=(0,t.$createParagraphNode)();this.getChildren().forEach(e=>n.append(e));let r=this.getParentOrThrow(),i=r.getParentOrThrow(),a=Zn(i);if(r.getChildrenSize()===1)if(a)r.remove(),i.select();else{r.insertBefore(n),r.remove();let t=e.anchor,i=e.focus,a=n.getKey();t.type===`element`&&t.getNode().is(this)&&t.set(a,t.offset,`element`),i.type===`element`&&i.getNode().is(this)&&i.set(a,i.offset,`element`)}else r.insertBefore(n),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return ir(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;Zn(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&An(117),(e=Math.floor(e))>=0||An(199);let t=this.getIndent();for(;t!==e;)t<e?(Un(this),t++):(Wn(this),t--);return this}canInsertAfter(e){return Zn(e)}canReplaceWith(e){return Zn(e)}canMergeWith(e){return Zn(e)||(0,t.$isParagraphNode)(e)}extractWithChild(e,n){if(!(0,t.$isRangeSelection)(n))return!1;let r=n.anchor.getNode(),i=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return rr(`bullet`)}canMergeWhenEmpty(){return!0}};function Jn(e){if(e.classList.contains(`task-list-item`)){for(let t of e.children)if(t.tagName===`INPUT`)return Yn(t)}if(e.classList.contains(`joplin-checkbox`)){for(let t of e.children)if(t.classList.contains(`checkbox-wrapper`)&&t.children.length>0&&t.children[0].tagName===`INPUT`)return Yn(t.children[0])}let t=e.getAttribute(`aria-checked`);return{node:Xn(t===`true`||t!==`false`&&void 0)}}function Yn(e){return e.getAttribute(`type`)===`checkbox`?{node:Xn(e.hasAttribute(`checked`))}:{node:null}}function Xn(e){return(0,t.$applyNodeReplacement)(new qn(void 0,e))}function Zn(e){return e instanceof qn}var Qn=class extends t.ElementNode{__tag;__start;__listType;$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.getNextSibling();ir(t)&&e.getListType()===t.getListType()&&Bn(e,t)})(e),Hn(e)},extends:t.ElementNode,importDOM:(0,t.buildImportMap)({ol:()=>({conversion:tr,priority:0}),ul:()=>({conversion:tr,priority:0})})})}constructor(e=`number`,t=1,n){super(n);let r=nr[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=document.createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,$n(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||($n(t,n.theme,this),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let n=this.createDOM(e._config,e);return(0,t.isHTMLElement)(n)&&(this.__start!==1&&n.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&n.setAttribute(`__lexicalListType`,`check`)),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,n,r){let i=r;for(let e=0;e<r.length;e++){let n=r[e];Zn(n)||(i===r&&(i=[...r]),i[e]=Xn().append(!(0,t.$isElementNode)(n)||ir(n)||n.isInline()?n:(0,t.$createTextNode)(n.getTextContent())))}return super.splice(e,n,i)}extractWithChild(e){return Zn(e)}};function $n(e,t,n){let r=[],i=[],a=t.list;if(a!==void 0){let e=a[`${n.__tag}Depth`]||[],t=jn(n)-1,o=t%e.length,s=e[o],l=a[n.__tag],u,d=a.nested,f=a.checklist;if(d!==void 0&&d.list&&(u=d.list),l!==void 0&&r.push(l),f!==void 0&&n.__listType===`check`&&r.push(f),s!==void 0){r.push(...Kn(s));for(let t=0;t<e.length;t++)t!==o&&i.push(n.__tag+t)}if(u!==void 0){let e=Kn(u);t>1?r.push(...e):i.push(...e)}}i.length>0&&Be(e,...i),r.length>0&&ze(e,...r)}function er(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(Zn(r)){t.push(r);let e=r.getChildren();e.length>1&&e.forEach(e=>{ir(e)&&t.push(Fn(e))})}else t.push(Fn(r))}return t}function tr(e){let n=e.nodeName.toLowerCase(),r=null;return n===`ol`?r=rr(`number`,e.start):n===`ul`&&(r=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`)||e.getAttribute(`data-is-checklist`)===`1`)return!0;for(let n of e.childNodes)if((0,t.isHTMLElement)(n)&&n.hasAttribute(`aria-checked`))return!0;return!1}(e)?rr(`check`):rr(`bullet`)),{after:er,node:r}}var nr={ol:`number`,ul:`bullet`};function rr(e=`number`,n=1){return(0,t.$applyNodeReplacement)(new Qn(e,n))}function ir(e){return e instanceof Qn}var ar=(0,t.createCommand)(`INSERT_CHECK_LIST_COMMAND`);function or(e){return Oe(e.registerCommand(ar,()=>(Ln(`check`),!0),t.COMMAND_PRIORITY_LOW),e.registerCommand(t.KEY_ARROW_DOWN_COMMAND,t=>dr(t,e,!1),t.COMMAND_PRIORITY_LOW),e.registerCommand(t.KEY_ARROW_UP_COMMAND,t=>dr(t,e,!0),t.COMMAND_PRIORITY_LOW),e.registerCommand(t.KEY_ESCAPE_COMMAND,()=>ur()==null?!1:(e.getRootElement()?.focus(),!0),t.COMMAND_PRIORITY_LOW),e.registerCommand(t.KEY_SPACE_COMMAND,n=>{let r=ur();return!(r==null||!e.isEditable())&&(e.update(()=>{let e=(0,t.$getNearestNodeFromDOMNode)(r);Zn(e)&&(n.preventDefault(),e.toggleChecked())}),!0)},t.COMMAND_PRIORITY_LOW),e.registerCommand(t.KEY_ARROW_LEFT_COMMAND,n=>e.getEditorState().read(()=>{let r=(0,t.$getSelection)();if((0,t.$isRangeSelection)(r)&&r.isCollapsed()){let{anchor:i}=r,a=i.type===`element`;if(a||i.offset===0){let r=i.getNode(),o=(0,t.$findMatchingParent)(r,e=>(0,t.$isElementNode)(e)&&!e.isInline());if(Zn(o)){let t=o.getParent();if(ir(t)&&t.getListType()===`check`&&(a||o.getFirstDescendant()===r)){let t=e.getElementByKey(o.__key);if(t!=null&&document.activeElement!==t)return t.focus(),n.preventDefault(),!0}}}}return!1}),t.COMMAND_PRIORITY_LOW),e.registerRootListener((e,t)=>{e!==null&&(e.addEventListener(`click`,cr),e.addEventListener(`pointerdown`,lr)),t!==null&&(t.removeEventListener(`click`,cr),t.removeEventListener(`pointerdown`,lr))}))}function sr(e,n){let r=e.target;if(!(0,t.isHTMLElement)(r))return;let i=r.firstChild;if((0,t.isHTMLElement)(i)&&(i.tagName===`UL`||i.tagName===`OL`))return;let a=r.parentNode;if(!a||a.__lexicalListType!==`check`)return;let o=r.getBoundingClientRect(),s=ot(r),l=e.clientX/s,u=window.getComputedStyle?window.getComputedStyle(r,`::before`):{width:`0px`},d=parseFloat(u.width),f=e.pointerType===`touch`?32:0;(r.dir===`rtl`?l<o.right+f&&l>o.right-d-f:l>o.left-f&&l<o.left+d+f)&&n()}function cr(e){sr(e,()=>{if((0,t.isHTMLElement)(e.target)){let n=e.target,r=(0,t.getNearestEditorFromDOMNode)(n);r!=null&&r.isEditable()&&r.update(()=>{let e=(0,t.$getNearestNodeFromDOMNode)(n);Zn(e)&&(n.focus(),e.toggleChecked())})}})}function lr(e){sr(e,()=>{e.preventDefault()})}function ur(){let e=document.activeElement;return(0,t.isHTMLElement)(e)&&e.tagName===`LI`&&e.parentNode!=null&&e.parentNode.__lexicalListType===`check`?e:null}function dr(e,n,r){let i=ur();return i!=null&&n.update(()=>{let a=(0,t.$getNearestNodeFromDOMNode)(i);if(!Zn(a))return;let o=function(e,t){let n=t?e.getPreviousSibling():e.getNextSibling(),r=e;for(;n==null&&Zn(r);)r=r.getParentOrThrow().getParent(),r!=null&&(n=t?r.getPreviousSibling():r.getNextSibling());for(;Zn(n);){let e=t?n.getLastChild():n.getFirstChild();if(!ir(e))return n;n=t?e.getLastChild():e.getFirstChild()}return null}(a,r);if(o!=null){o.selectStart();let t=n.getElementByKey(o.__key);t!=null&&(e.preventDefault(),setTimeout(()=>{t.focus()},0))}}),!1}var fr=(0,t.createCommand)(`UPDATE_LIST_START_COMMAND`),pr=(0,t.createCommand)(`INSERT_UNORDERED_LIST_COMMAND`),mr=(0,t.createCommand)(`INSERT_ORDERED_LIST_COMMAND`),hr=(0,t.createCommand)(`REMOVE_LIST_COMMAND`);function gr(e){return Oe(e.registerCommand(mr,()=>(Ln(`number`),!0),t.COMMAND_PRIORITY_LOW),e.registerCommand(fr,e=>{let{listNodeKey:n,newStart:r}=e,i=(0,t.$getNodeByKey)(n);return!!ir(i)&&(i.getListType()===`number`&&(i.setStart(r),Hn(i)),!0)},t.COMMAND_PRIORITY_LOW),e.registerCommand(pr,()=>(Ln(`bullet`),!0),t.COMMAND_PRIORITY_LOW),e.registerCommand(hr,()=>(Vn(),!0),t.COMMAND_PRIORITY_LOW),e.registerCommand(t.INSERT_PARAGRAPH_COMMAND,()=>Gn(),t.COMMAND_PRIORITY_LOW),e.registerNodeTransform(qn,e=>{let n=e.getFirstChild();if(n){if((0,t.$isTextNode)(n)){let t=n.getStyle(),r=n.getFormat();e.getTextStyle()!==t&&e.setTextStyle(t),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{let n=(0,t.$getSelection)();(0,t.$isRangeSelection)(n)&&(n.style!==e.getTextStyle()||n.format!==e.getTextFormat())&&n.isCollapsed()&&e.is(n.anchor.getNode())&&e.setTextStyle(n.style).setTextFormat(n.format)}}),e.registerNodeTransform(t.TextNode,e=>{let t=e.getParent();if(Zn(t)&&e.is(t.getFirstChild())){let n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}function _r(e){let n=e=>{let n=e.getParent();if(ir(e.getFirstChild())||!ir(n))return;let r=(0,t.$findMatchingParent)(e,e=>Zn(e)&&ir(e.getParent())&&Zn(e.getPreviousSibling()));if(r===null&&e.getIndent()>0)e.setIndent(0);else if(Zn(r)){let t=r.getPreviousSibling();if(Zn(t)){let r=function(e){let t=e,n=t.getFirstChild();for(;ir(n);){let e=n.getLastChild();if(!Zn(e))break;t=e,n=t.getFirstChild()}return t}(t).getParent();if(ir(r)){let t=jn(r);t+1<jn(n)&&e.setIndent(t)}}}};return e.registerNodeTransform(Qn,e=>{let t=[e];for(;t.length>0;){let e=t.shift();if(ir(e)){for(let r of e.getChildren())if(Zn(r)){n(r);let e=r.getFirstChild();ir(e)&&t.push(e)}}}})}var vr=(0,t.defineExtension)({build:(e,t,n)=>Wt(t),config:(0,t.safeCast)({hasStrictIndent:!1}),name:`@lexical/list/List`,nodes:()=>[Qn,qn],register(e,t,n){let r=n.getOutput();return Oe(gr(e),Ut(()=>r.hasStrictIndent.value?_r(e):void 0))}});(0,t.defineExtension)({dependencies:[vr],name:`@lexical/list/CheckList`,register:or});function yr(){let[e]=b();return(0,_.useEffect)(()=>or(e),[e]),null}var br=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?_.useLayoutEffect:_.useEffect;function xr({onClear:e}){let[t]=b();return br(()=>Kt(t,e),[t,e]),null}var Sr=new Set([`http:`,`https:`,`mailto:`,`sms:`,`tel:`]),Cr=class e extends t.ElementNode{__url;__target;__rel;__title;static getType(){return`link`}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e=``,t={},n){super(n);let{target:r=null,rel:i=null,title:a=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=a}createDOM(e){let t=document.createElement(`a`);return this.updateLinkDOM(null,t,e),ze(t,e.theme.link),t}updateLinkDOM(e,n,r){if((0,t.isHTMLAnchorElement)(n)){e&&e.__url===this.__url||(n.href=this.sanitizeUrl(this.__url));for(let t of[`target`,`rel`,`title`]){let r=`__${t}`,i=this[r];e&&e[r]===i||(i?n[t]=i:n.removeAttribute(t))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:wr,priority:1})}}static importJSON(e){return Tr().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=Pr(e);try{let t=new URL(Pr(e));if(!Sr.has(t.protocol))return`about:blank`}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=Tr(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,n,r){if(!(0,t.$isRangeSelection)(n))return!1;let i=n.anchor.getNode(),a=n.focus.getNode();return this.isParentOf(i)&&this.isParentOf(a)&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith(`mailto:`)}isWebSiteURI(){return this.__url.startsWith(`https://`)||this.__url.startsWith(`http://`)}};function wr(e){let n=null;if((0,t.isHTMLAnchorElement)(e)){let t=e.textContent;(t!==null&&t!==``||e.children.length>0)&&(n=Tr(e.getAttribute(`href`)||``,{rel:e.getAttribute(`rel`),target:e.getAttribute(`target`),title:e.getAttribute(`title`)}))}return{node:n}}function Tr(e=``,n){return(0,t.$applyNodeReplacement)(new Cr(e,n))}function Er(e){return e instanceof Cr}var Dr=class e extends Cr{__isUnlinked;constructor(e=``,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return`autolink`}static clone(t){return new e(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement(`span`):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return Or().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,n=!0){let r=this.getParentOrThrow().insertNewAfter(e,n);if((0,t.$isElementNode)(r)){let e=Or(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(e),e}return null}};function Or(e=``,n){return(0,t.$applyNodeReplacement)(new Dr(e,n))}function kr(e){return e instanceof Dr}var Ar=(0,t.createCommand)(`TOGGLE_LINK_COMMAND`);function jr(e,n){if(e.type===`element`){let r=e.getNode();return(0,t.$isElementNode)(r)||function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),r.getChildren()[e.offset+n]||null}return null}function Mr(e,n={}){let r;if(e&&typeof e==`object`){let{url:t,...i}=e;r=t,n={...i,...n}}else r=e;let{target:i,title:a}=n,o=n.rel===void 0?`noreferrer`:n.rel,s=(0,t.$getSelection)();if(s===null||!(0,t.$isRangeSelection)(s)&&!(0,t.$isNodeSelection)(s))return;if((0,t.$isNodeSelection)(s)){let e=s.getNodes();if(e.length===0)return;e.forEach(e=>{if(r===null){let n=(0,t.$findMatchingParent)(e,e=>!kr(e)&&Er(e));n&&(n.insertBefore(e),n.getChildren().length===0&&n.remove())}else{let n=(0,t.$findMatchingParent)(e,e=>!kr(e)&&Er(e));if(n)n.setURL(r),i!==void 0&&n.setTarget(i),o!==void 0&&n.setRel(o);else{let t=Tr(r,{rel:o,target:i});e.insertBefore(t),t.append(e)}}});return}let l=s.extract();if(r===null){let e=new Set;l.forEach(t=>{let n=t.getParent();if(Er(n)&&!kr(n)){let t=n.getKey();if(e.has(t))return;(function(e,t){let n=new Set(t.filter(t=>e.isParentOf(t)).map(e=>e.getKey())),r=e.getChildren(),i=r.filter(e=>n.has(e.getKey()));if(i.length===r.length)return r.forEach(t=>e.insertBefore(t)),void e.remove();let a=r.findIndex(e=>n.has(e.getKey())),o=r.findLastIndex(e=>n.has(e.getKey())),s=a===0,l=o===r.length-1;if(s)i.forEach(t=>e.insertBefore(t));else if(l)for(let t=i.length-1;t>=0;t--)e.insertAfter(i[t]);else{for(let t=i.length-1;t>=0;t--)e.insertAfter(i[t]);let t=r.slice(o+1);if(t.length>0){let n=Tr(e.getURL(),{rel:e.getRel(),target:e.getTarget(),title:e.getTitle()});i[i.length-1].insertAfter(n),t.forEach(e=>n.append(e))}}})(n,l),e.add(t)}});return}let u=new Set,d=e=>{u.has(e.getKey())||(u.add(e.getKey()),e.setURL(r),i!==void 0&&e.setTarget(i),o!==void 0&&e.setRel(o),a!==void 0&&e.setTitle(a))};if(l.length===1){let e=l[0],n=(0,t.$findMatchingParent)(e,Er);if(n!==null)return d(n)}(function(e){let n=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(n))return e();let r=(0,t.$normalizeSelection__EXPERIMENTAL)(n),i=r.isBackward(),a=jr(r.anchor,i?-1:0),o=jr(r.focus,i?0:-1);if(e(),a||o){let e=(0,t.$getSelection)();if((0,t.$isRangeSelection)(e)){let n=e.clone();if(a){let e=a.getParent();e&&n.anchor.set(e.getKey(),a.getIndexWithinParent()+ +!!i,`element`)}if(o){let e=o.getParent();e&&n.focus.set(e.getKey(),o.getIndexWithinParent()+ +!i,`element`)}(0,t.$setSelection)((0,t.$normalizeSelection__EXPERIMENTAL)(n))}}})(()=>{let e=null;for(let n of l){if(!n.isAttached())continue;let s=(0,t.$findMatchingParent)(n,Er);if(s){d(s);continue}if((0,t.$isElementNode)(n)){if(!n.isInline())continue;if(Er(n)){if(!(kr(n)||e!==null&&e.getParentOrThrow().isParentOf(n))){d(n),e=n;continue}for(let e of n.getChildren())n.insertBefore(e);n.remove();continue}}let l=n.getPreviousSibling();Er(l)&&l.is(e)?l.append(n):(e=Tr(r,{rel:o,target:i,title:a}),n.insertAfter(e),e.append(n))}})}var Nr=/^\+?[0-9\s()-]{5,}$/;function Pr(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes(`@`)?`mailto:${e}`:Nr.test(e)?`tel:${e}`:`https://${e}`}function Fr(e,n){return Oe(Ut(()=>e.registerCommand(Ar,e=>{let t=n.validateUrl.peek(),r=n.attributes.peek();if(e===null)return Mr(null),!0;if(typeof e==`string`)return!(t!==void 0&&!t(e))&&(Mr(e,r),!0);{let{url:t,target:n,rel:i,title:a}=e;return Mr(t,{...r,rel:i,target:n,title:a}),!0}},t.COMMAND_PRIORITY_LOW)),Ut(()=>{let r=n.validateUrl.value;if(!r)return;let i=n.attributes.value;return e.registerCommand(t.PASTE_COMMAND,n=>{let a=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(a)||a.isCollapsed()||!nt(n,ClipboardEvent)||n.clipboardData===null)return!1;let o=n.clipboardData.getData(`text`);return!!r(o)&&!a.getNodes().some(e=>(0,t.$isElementNode)(e))&&(e.dispatchCommand(Ar,{...i,url:o}),n.preventDefault(),!0)},t.COMMAND_PRIORITY_LOW)}))}var Ir=(0,t.defineExtension)({build:(e,t,n)=>Wt(t),config:{attributes:void 0,validateUrl:void 0},mergeConfig(e,n){let r=(0,t.shallowMergeConfig)(e,n);return e.attributes&&(r.attributes=(0,t.shallowMergeConfig)(e.attributes,r.attributes)),r},name:`@lexical/link/Link`,nodes:()=>[Cr],register:(e,t,n)=>Fr(e,n.getOutput())});function Lr(e,n,r={}){let i=r=>{let i=r.target;if(!(0,t.isDOMNode)(i))return;let a=(0,t.getNearestEditorFromDOMNode)(i);if(a===null)return;let o=null,s=null;if(a.update(()=>{let e=(0,t.$getNearestNodeFromDOMNode)(i);if(e!==null){let r=(0,t.$findMatchingParent)(e,t.$isElementNode);if(!n.disabled.peek())if(Er(r))o=r.sanitizeUrl(r.getURL()),s=r.getTarget();else{let e=function(e,t){let n=e;for(;n!=null;){if(t(n))return n;n=n.parentNode}return null}(i,t.isHTMLAnchorElement);e!==null&&(o=e.href,s=e.target)}}}),o===null||o===``)return;let l=e.getEditorState().read(t.$getSelection);if((0,t.$isRangeSelection)(l)&&!l.isCollapsed())return void r.preventDefault();let u=r.type===`auxclick`&&r.button===1;window.open(o,n.newTab.peek()||u||r.metaKey||r.ctrlKey||s===`_blank`?`_blank`:`_self`),r.preventDefault()},a=e=>{e.button===1&&i(e)};return e.registerRootListener((e,t)=>{t!==null&&(t.removeEventListener(`click`,i),t.removeEventListener(`mouseup`,a)),e!==null&&(e.addEventListener(`click`,i,r),e.addEventListener(`mouseup`,a,r))})}(0,t.defineExtension)({build:(e,t,n)=>Wt(t),config:(0,t.safeCast)({disabled:!1,newTab:!1}),dependencies:[Ir],name:`@lexical/link/ClickableLink`,register:(e,t,n)=>Lr(e,n.getOutput())});function Rr(e,t=e=>e){return n=>{let r=e.exec(n);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:t(r[0])}}}function zr(e,t){for(let n=0;n<t.length;n++){let r=t[n](e);if(r)return r}return null}var Br=/[.,;\s]/;function Vr(e){return Br.test(e)}function Hr(e){return Vr(e[e.length-1])}function Ur(e){return Vr(e[0])}function Wr(e){let n=e.getPreviousSibling();return(0,t.$isElementNode)(n)&&(n=n.getLastDescendant()),n===null||(0,t.$isLineBreakNode)(n)||(0,t.$isTextNode)(n)&&Hr(n.getTextContent())}function Gr(e){let n=e.getNextSibling();return(0,t.$isElementNode)(n)&&(n=n.getFirstDescendant()),n===null||(0,t.$isLineBreakNode)(n)||(0,t.$isTextNode)(n)&&Ur(n.getTextContent())}function Kr(e,t,n,r){return(e>0?Vr(n[e-1]):Wr(r[0]))?t<n.length?Vr(n[t]):Gr(r[r.length-1]):!1}function qr(e,t,n){let r=[],i=[],a=[],o=0,s=0,l=[...e];for(;l.length>0;){let e=l[0],u=e.getTextContent().length,d=s;s+u<=t?(r.push(e),o+=u):d>=n?a.push(e):i.push(e),s+=u,l.shift()}return[o,r,i,a]}function Jr(e,n,r,i){let a=Or(i.url,i.attributes);if(e.length===1){let o,s=e[0];n===0?[o,s]=s.splitText(r):[,o,s]=s.splitText(n,r);let l=(0,t.$createTextNode)(i.text);return l.setFormat(o.getFormat()),l.setDetail(o.getDetail()),l.setStyle(o.getStyle()),a.append(l),o.replace(a),s}if(e.length>1){let i=e[0],o,s=i.getTextContent().length;n===0?o=i:[,o]=i.splitText(n);let l=[],u;for(let t=1;t<e.length;t++){let n=e[t],i=n.getTextContent().length,a=s;if(a<r)if(s+i<=r)l.push(n);else{let[e,t]=n.splitText(r-a);l.push(e),u=t}s+=i}let d=(0,t.$getSelection)(),f=d?d.getNodes().find(t.$isTextNode):void 0,p=(0,t.$createTextNode)(o.getTextContent());return p.setFormat(o.getFormat()),p.setDetail(o.getDetail()),p.setStyle(o.getStyle()),a.append(p,...l),f&&f===o&&((0,t.$isRangeSelection)(d)?p.select(d.anchor.offset,d.focus.offset):(0,t.$isNodeSelection)(d)&&p.select(0,p.getTextContent().length)),o.replace(a),u}}function Yr(e,n,r){let i=e.getChildren(),a=i.length;for(let n=0;n<a;n++){let a=i[n];if(!(0,t.$isTextNode)(a)||!a.isSimpleText())return Xr(e),void r(null,e.getURL())}let o=e.getTextContent(),s=zr(o,n);if(s===null||s.text!==o||!Wr(e)||!Gr(e))return Xr(e),void r(null,e.getURL());let l=e.getURL();if(l!==s.url&&(e.setURL(s.url),r(s.url,l)),s.attributes){let t=e.getRel();t!==s.attributes.rel&&(e.setRel(s.attributes.rel||null),r(s.attributes.rel||null,t));let n=e.getTarget();n!==s.attributes.target&&(e.setTarget(s.attributes.target||null),r(s.attributes.target||null,n))}}function Xr(e){let t=e.getChildren();for(let n=t.length-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map(e=>e.getLatest())}var Zr={changeHandlers:[],matchers:[]};function Qr(e,n=Zr){let{matchers:r,changeHandlers:i}=n,a=(e,t)=>{for(let n of i)n(e,t)};return Oe(e.registerNodeTransform(t.TextNode,e=>{let n=e.getParentOrThrow(),i=e.getPreviousSibling();kr(n)&&!n.getIsUnlinked()?Yr(n,r,a):Er(n)||(e.isSimpleText()&&(Ur(e.getTextContent())||!kr(i))&&(function(e,t,n){let r=[...e],i=r.map(e=>e.getTextContent()).join(``),a,o=i,s=0;for(;(a=zr(o,t))&&a!==null;){let e=a.index,t=e+a.length;if(Kr(s+e,s+t,i,r)){let[i,,o,l]=qr(r,s+e,s+t),u=Jr(o,s+e-i,s+t-i,a);r=u?[u,...l]:l,n(a.url,null),s=0}else s+=t;o=o.substring(t)}})(function(e){let n=[e],r=e.getNextSibling();for(;r!==null&&(0,t.$isTextNode)(r)&&r.isSimpleText()&&(n.push(r),!/[\s]/.test(r.getTextContent()));)r=r.getNextSibling();return n}(e),r,a),(function(e,t,n){let r=e.getPreviousSibling(),i=e.getNextSibling(),a=e.getTextContent();var o;!kr(r)||r.getIsUnlinked()||Ur(a)&&(o=a,!(r.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(o):/^\.[a-zA-Z0-9]{1,}/.test(o)))||(r.append(e),Yr(r,t,n),n(null,r.getURL())),!kr(i)||i.getIsUnlinked()||Hr(a)||(Xr(i),Yr(i,t,n),n(null,i.getURL()))})(e,r,a))}),e.registerCommand(Ar,e=>{let n=(0,t.$getSelection)();return e!==null||!(0,t.$isRangeSelection)(n)||n.extract().forEach(e=>{let t=e.getParent();kr(t)&&(t.setIsUnlinked(!t.getIsUnlinked()),t.markDirty())}),!1},t.COMMAND_PRIORITY_LOW))}(0,t.defineExtension)({config:Zr,dependencies:[Ir],mergeConfig(e,n){let r=(0,t.shallowMergeConfig)(e,n);for(let t of[`matchers`,`changeHandlers`]){let i=n[t];Array.isArray(i)&&(r[t]=[...e[t],...i])}return r},name:`@lexical/link/AutoLink`,register:Qr});function $r({newTab:e=!0,disabled:t=!1}){let[n]=b();return(0,_.useEffect)(()=>Lr(n,Wt({disabled:t,newTab:e})),[n,e,t]),null}var ei=[[`Cat`,`rgb(125, 50, 0)`],[`Dog`,`rgb(100, 0, 0)`],[`Rabbit`,`rgb(150, 0, 0)`],[`Frog`,`rgb(200, 0, 0)`],[`Fox`,`rgb(200, 75, 0)`],[`Hedgehog`,`rgb(0, 75, 0)`],[`Pigeon`,`rgb(0, 125, 0)`],[`Squirrel`,`rgb(75, 100, 0)`],[`Bear`,`rgb(125, 100, 0)`],[`Tiger`,`rgb(0, 0, 150)`],[`Leopard`,`rgb(0, 0, 200)`],[`Zebra`,`rgb(0, 0, 250)`],[`Wolf`,`rgb(0, 100, 150)`],[`Owl`,`rgb(0, 100, 100)`],[`Gull`,`rgb(100, 0, 100)`],[`Squid`,`rgb(150, 0, 150)`]],ti=ei[Math.floor(Math.random()*ei.length)],ni=(0,_.createContext)(null);function ri(){return{color:ti[1],isCollabActive:!1,name:ti[0],yjsDocMap:new Map}}var ii=ri();function ai(e,t){let n=(0,_.useContext)(ni);return n??function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(319),n??=ii,e!=null&&(n.name=e),t!=null&&(n.color=t),n}var oi=()=>new Map,si=e=>{let t=oi();return e.forEach((e,n)=>{t.set(n,e)}),t},ci=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},li=(e,t)=>{let n=[];for(let[r,i]of e)n.push(t(i,r));return n},ui=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1},di=()=>new Set,fi=e=>e[e.length-1],pi=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},mi=Array.from,hi=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},gi=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},_i=(e,t)=>{let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n},vi=Array.isArray,yi=class{constructor(){this._observers=oi()}on(e,t){return ci(this._observers,e,di).add(t),t}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return mi((this._observers.get(e)||oi()).values()).forEach(e=>e(...t))}destroy(){this._observers=oi()}},bi=class{constructor(){this._observers=oi()}on(e,t){ci(this._observers,e,di).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return mi((this._observers.get(e)||oi()).values()).forEach(e=>e(...t))}destroy(){this._observers=oi()}},xi=Math.floor,Si=Math.abs,Ci=(e,t)=>e<t?e:t,wi=(e,t)=>e>t?e:t;Number.isNaN;var Ti=Math.pow,Ei=e=>e===0?1/e<0:e<0,Di=2**53-1,Oi=-(2**53-1),ki=Number.isInteger||(e=>typeof e==`number`&&isFinite(e)&&xi(e)===e);Number.isNaN,Number.parseInt;var Ai=String.fromCharCode;String.fromCodePoint,Ai(65535);var ji=e=>e.toLowerCase(),Mi=/^\s*/g,Ni=e=>e.replace(Mi,``),Pi=/([A-Z])/g,Fi=(e,t)=>Ni(e.replace(Pi,e=>`${t}${ji(e)}`)),Ii=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},Li=typeof TextEncoder<`u`?new TextEncoder:null,Ri=Li?e=>Li.encode(e):Ii,zi=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});zi&&zi.decode(new Uint8Array).length===1&&(zi=null);var Bi=(e,t)=>_i(t,()=>e).join(``),Vi=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},Hi=()=>new Vi,Ui=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},Wi=e=>{let t=new Uint8Array(Ui(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},Gi=(e,t)=>{let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(wi(n,t)*2),e.cpos=0)},Ki=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},qi=Ki,Ji=(e,t)=>{for(;t>127;)Ki(e,128|127&t),t=xi(t/128);Ki(e,127&t)},Yi=(e,t)=>{let n=Ei(t);for(n&&(t=-t),Ki(e,(t>63?128:0)|(n?64:0)|63&t),t=xi(t/64);t>0;)Ki(e,(t>127?128:0)|127&t),t=xi(t/128)},Xi=new Uint8Array(3e4),Zi=Xi.length/3,Qi=Li&&Li.encodeInto?(e,t)=>{if(t.length<Zi){let n=Li.encodeInto(t,Xi).written||0;Ji(e,n);for(let t=0;t<n;t++)Ki(e,Xi[t])}else ea(e,Ri(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;Ji(e,r);for(let t=0;t<r;t++)Ki(e,n.codePointAt(t))},$i=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=Ci(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(wi(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},ea=(e,t)=>{Ji(e,t.byteLength),$i(e,t)},ta=(e,t)=>{Gi(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},na=(e,t)=>ta(e,4).setFloat32(0,t,!1),ra=(e,t)=>ta(e,8).setFloat64(0,t,!1),ia=(e,t)=>ta(e,8).setBigInt64(0,t,!1),aa=new DataView(new ArrayBuffer(4)),oa=e=>(aa.setFloat32(0,e),aa.getFloat32(0)===e),sa=(e,t)=>{switch(typeof t){case`string`:Ki(e,119),Qi(e,t);break;case`number`:ki(t)&&Si(t)<=2147483647?(Ki(e,125),Yi(e,t)):oa(t)?(Ki(e,124),na(e,t)):(Ki(e,123),ra(e,t));break;case`bigint`:Ki(e,122),ia(e,t);break;case`object`:if(t===null)Ki(e,126);else if(vi(t)){Ki(e,117),Ji(e,t.length);for(let n=0;n<t.length;n++)sa(e,t[n])}else if(t instanceof Uint8Array)Ki(e,116),ea(e,t);else{Ki(e,118);let n=Object.keys(t);Ji(e,n.length);for(let r=0;r<n.length;r++){let i=n[r];Qi(e,i),sa(e,t[i])}}break;case`boolean`:Ki(e,t?120:121);break;default:Ki(e,127)}},ca=class extends Vi{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&Ji(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}},la=e=>{e.count>0&&(Yi(e.encoder,e.count===1?e.s:-e.s),e.count>1&&Ji(e.encoder,e.count-2))},ua=class{constructor(){this.encoder=new Vi,this.s=0,this.count=0}write(e){this.s===e?this.count++:(la(this),this.count=1,this.s=e)}toUint8Array(){return la(this),Wi(this.encoder)}},da=e=>{if(e.count>0){let t=e.diff*2+(e.count===1?0:1);Yi(e.encoder,t),e.count>1&&Ji(e.encoder,e.count-2)}},fa=class{constructor(){this.encoder=new Vi,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(da(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return da(this),Wi(this.encoder)}},pa=class{constructor(){this.sarr=[],this.s=``,this.lensE=new ua}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=``),this.lensE.write(e.length)}toUint8Array(){let e=new Vi;return this.sarr.push(this.s),this.s=``,Qi(e,this.sarr.join(``)),$i(e,this.lensE.toUint8Array()),Wi(e)}},ma=e=>Error(e),ha=()=>{throw ma(`Method unimplemented`)},ga=()=>{throw ma(`Unexpected case`)},_a=ma(`Unexpected end of array`),va=ma(`Integer out of Range`),ya=class{constructor(e){this.arr=e,this.pos=0}},ba=e=>new ya(e),xa=e=>e.pos!==e.arr.length,Sa=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},Ca=e=>Sa(e,Ta(e)),wa=e=>e.arr[e.pos++],Ta=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&127)*n,n*=128,r<128)return t;if(t>Di)throw va}throw _a},Ea=e=>{let t=e.arr[e.pos++],n=t&63,r=64,i=(t&64)>0?-1:1;if(!(t&128))return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&127)*r,r*=128,t<128)return i*n;if(n>Di)throw va}throw _a},Da=zi?e=>zi.decode(Ca(e)):e=>{let t=Ta(e);if(t===0)return``;{let n=String.fromCodePoint(wa(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(wa(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},Oa=(e,t)=>{let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},ka=[e=>void 0,e=>null,Ea,e=>Oa(e,4).getFloat32(0,!1),e=>Oa(e,8).getFloat64(0,!1),e=>Oa(e,8).getBigInt64(0,!1),e=>!1,e=>!0,Da,e=>{let t=Ta(e),n={};for(let r=0;r<t;r++){let t=Da(e);n[t]=Aa(e)}return n},e=>{let t=Ta(e),n=[];for(let r=0;r<t;r++)n.push(Aa(e));return n},Ca],Aa=e=>ka[127-wa(e)](e),ja=class extends ya{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),xa(this)?this.count=Ta(this)+1:this.count=-1),this.count--,this.s}},Ma=class extends ya{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=Ea(this);let e=Ei(this.s);this.count=1,e&&(this.s=-this.s,this.count=Ta(this)+2)}return this.count--,this.s}},Na=class extends ya{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let e=Ea(this),t=e&1;this.diff=xi(e/2),this.count=1,t&&(this.count=Ta(this)+2)}return this.s+=this.diff,this.count--,this.s}},Pa=class{constructor(e){this.decoder=new Ma(e),this.str=Da(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}};crypto.subtle;var Fa=crypto.getRandomValues.bind(crypto),Ia=()=>Fa(new Uint32Array(1))[0],La=`10000000-1000-4000-8000-100000000000`,Ra=()=>La.replace(/[018]/g,e=>(e^Ia()&15>>e/4).toString(16)),za=Date.now,Ba=e=>new Promise(e);Promise.all.bind(Promise);var Va=e=>e===void 0?null:e,Ha=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},Ua=!0;try{typeof localStorage<`u`&&localStorage&&(Ha=localStorage,Ua=!1)}catch{}var Wa=Ha,Ga=e=>Ua||addEventListener(`storage`,e),Ka=e=>Ua||removeEventListener(`storage`,e),qa=Symbol(`Equality`),Ja=(e,t)=>e===t||!!e?.[qa]?.(t)||!1,Ya=e=>typeof e==`object`,Xa=Object.assign,Za=Object.keys,Qa=(e,t)=>{for(let n in e)t(e[n],n)},$a=(e,t)=>{let n=[];for(let r in e)n.push(t(e[r],r));return n},eo=e=>Za(e).length,to=e=>{for(let t in e)return!1;return!0},no=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},ro=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),io=(e,t)=>e===t||eo(e)===eo(t)&&no(e,(e,n)=>(e!==void 0||ro(t,n))&&Ja(t[n],e)),ao=Object.freeze,oo=e=>{for(let t in e){let n=e[t];(typeof n==`object`||typeof n==`function`)&&oo(e[t])}return ao(e)},so=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&so(e,t,n+1)}},co=e=>e,lo=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[qa]!=null)return e[qa](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!lo(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(eo(e)!==eo(t))return!1;for(let n in e)if(!ro(e,n)||!lo(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!lo(e[n],t[n]))return!1;break;default:return!1}return!0},uo=(e,t)=>t.includes(e),fo=typeof process<`u`&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`,po=typeof window<`u`&&typeof document<`u`&&!fo;typeof navigator<`u`&&/Mac/.test(navigator.platform);var mo,ho=[],go=()=>{if(mo===void 0)if(fo){mo=oi();let e=process.argv,t=null;for(let n=0;n<e.length;n++){let r=e[n];r[0]===`-`?(t!==null&&mo.set(t,``),t=r):t===null?ho.push(r):(mo.set(t,r),t=null)}t!==null&&mo.set(t,``)}else typeof location==`object`?(mo=oi(),(location.search||`?`).slice(1).split(`&`).forEach(e=>{if(e.length!==0){let[t,n]=e.split(`=`);mo.set(`--${Fi(t,`-`)}`,n),mo.set(`-${Fi(t,`-`)}`,n)}})):mo=oi();return mo},_o=e=>go().has(e),vo=e=>Va(fo?process.env[e.toUpperCase().replaceAll(`-`,`_`)]:Wa.getItem(e)),yo=e=>_o(`--`+e)||vo(e)!==null,bo=yo(`production`),xo=fo&&uo(process.env.FORCE_COLOR,[`true`,`1`,`2`])||!_o(`--no-colors`)&&!yo(`no-color`)&&(!fo||process.stdout.isTTY)&&(!fo||_o(`--color`)||vo(`COLORTERM`)!==null||(vo(`TERM`)||``).includes(`color`)),So=e=>new Uint8Array(e),Co=(e,t,n)=>new Uint8Array(e,t,n),wo=e=>new Uint8Array(e),To=e=>{let t=``;for(let n=0;n<e.byteLength;n++)t+=Ai(e[n]);return btoa(t)},Eo=e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`),Do=e=>{let t=atob(e),n=So(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},Oo=e=>{let t=Buffer.from(e,`base64`);return Co(t.buffer,t.byteOffset,t.byteLength)},ko=po?To:Eo,Ao=po?Do:Oo,jo=e=>{let t=So(e.byteLength);return t.set(e),t},Mo=class{constructor(e,t){this.left=e,this.right=t}},No=(e,t)=>new Mo(e,t),Po=e=>e.next()>=.5,Fo=(e,t,n)=>xi(e.next()*(n+1-t)+t),Io=(e,t,n)=>xi(e.next()*(n+1-t)+t),Lo=(e,t,n)=>Io(e,t,n),Ro=e=>Ai(Lo(e,97,122)),zo=(e,t=0,n=20)=>{let r=Lo(e,t,n),i=``;for(let t=0;t<r;t++)i+=Ro(e);return i},Bo=(e,t)=>t[Lo(e,0,t.length-1)],Vo=Symbol(`0schema`),Ho=class{constructor(){this._rerrs=[]}extend(e,t,n,r=null){this._rerrs.push({path:e,expected:t,has:n,message:r})}toString(){let e=[];for(let t=this._rerrs.length-1;t>0;t--){let n=this._rerrs[t];e.push(Bi(` `,(this._rerrs.length-t)*2)+`${n.path==null?``:`[${n.path}] `}${n.has} doesn't match ${n.expected}. ${n.message}`)}return e.join(`
10
20
  `)}},Uo=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[qa]?Ja(e,t):vi(e)?hi(e,e=>gi(t,t=>Uo(e,t))):Ya(e)?no(e,(e,n)=>Uo(e,t[n])):!1,Wo=class{static _dilutes=!1;extends(e){let[t,n]=[this.shape,e.shape];return this.constructor._dilutes&&([n,t]=[t,n]),Uo(t,n)}equals(e){return this.constructor===e.constructor&&lo(this.shape,e.shape)}[Vo](){return!0}[qa](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){ha()}get nullable(){return Ss(this,Is)}get optional(){return new ts(this)}cast(e){return Bs(e,this),e}expect(e){return Bs(e,this),e}},Go=class extends Wo{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){let n=e?.constructor===this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor===this.shape?`Check failed`:`Constructor match failed`),n}},Ko=(e,t=null)=>new Go(e,t);Ko(Go);var qo=class extends Wo{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape(e);return!n&&t?.extend(null,`custom prop`,e?.constructor.name,`failed to check custom prop`),n}},Jo=e=>new qo(e);Ko(qo);var Yo=class extends Wo{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape.some(t=>t===e);return!n&&t?.extend(null,this.shape.join(` | `),e.toString()),n}},Xo=(...e)=>new Yo(e),Zo=Ko(Yo),Qo=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,e=>`\\`+e)),$o=e=>{if(Ms.check(e))return[Qo(e)];if(Zo.check(e))return e.shape.map(e=>e+``);if(js.check(e))return[`[+-]?\\d+.?\\d*`];if(Ns.check(e))return[`.*`];if(Cs.check(e))return e.shape.map($o).flat(1);ga()};Ko(class extends Wo{constructor(e){super(),this.shape=e,this._r=RegExp(`^`+e.map($o).map(e=>`(${e.join(`|`)})`).join(``)+`$`)}check(e,t){let n=this._r.exec(e)!=null;return!n&&t?.extend(null,this._r.toString(),e.toString(),`String doesn't match string template.`),n}});var es=Symbol(`optional`),ts=class extends Wo{constructor(e){super(),this.shape=e}check(e,t){let n=e===void 0||this.shape.check(e);return!n&&t?.extend(null,`undefined (optional)`,`()`),n}get[es](){return!0}},ns=Ko(ts),rs=class extends Wo{check(e,t){return t?.extend(null,`never`,typeof e),!1}};new rs,Ko(rs);var is=class e extends Wo{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,`object`,`null`),!1):no(this.shape,(n,r)=>{let i=this._isPartial&&!ro(e,r)||n.check(e[r],t);return!i&&t?.extend(r.toString(),n.toString(),typeof e[r],`Object property does not match`),i})}},as=e=>new is(e),os=Ko(is),ss=Jo(e=>e!=null&&(e.constructor===Object||e.constructor==null)),cs=class extends Wo{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null&&no(e,(n,r)=>{let i=this.shape.keys.check(r,t);return!i&&t?.extend(r+``,`Record`,typeof e,i?`Key doesn't match schema`:`Value doesn't match value`),i&&this.shape.values.check(n,t)})}},ls=(e,t)=>new cs(e,t),us=Ko(cs),ds=class extends Wo{constructor(e){super(),this.shape=e}check(e,t){return e!=null&&no(this.shape,(n,r)=>{let i=n.check(e[r],t);return!i&&t?.extend(r.toString(),`Tuple`,typeof n),i})}},eee=(...e)=>new ds(e);Ko(ds);var fs=class extends Wo{constructor(e){super(),this.shape=e.length===1?e[0]:new xs(e)}check(e,t){let n=vi(e)&&hi(e,e=>this.shape.check(e));return!n&&t?.extend(null,`Array`,``),n}},ps=(...e)=>new fs(e),ms=Ko(fs),hs=Jo(e=>vi(e)),gs=class extends Wo{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e instanceof this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name),n}},_s=(e,t=null)=>new gs(e,t);Ko(gs);var vs=_s(Wo),ys=Ko(class extends Wo{constructor(e){super(),this.len=e.length-1,this.args=eee(...e.slice(-1)),this.res=e[this.len]}check(e,t){let n=e.constructor===Function&&e.length<=this.len;return!n&&t?.extend(null,`function`,typeof e),n}}),bs=Jo(e=>typeof e==`function`);Ko(class extends Wo{constructor(e){super(),this.shape=e}check(e,t){let n=hi(this.shape,n=>n.check(e,t));return!n&&t?.extend(null,`Intersectinon`,typeof e),n}},e=>e.shape.length>0);var xs=class extends Wo{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){let n=gi(this.shape,n=>n.check(e,t));return t?.extend(null,`Union`,typeof e),n}},Ss=(...e)=>e.findIndex(e=>Cs.check(e))>=0?Ss(...e.map(e=>zs(e)).map(e=>Cs.check(e)?e.shape:[e]).flat(1)):e.length===1?e[0]:new xs(e),Cs=Ko(xs),ws=()=>!0,Ts=Jo(ws),Es=Ko(qo,e=>e.shape===ws),Ds=Jo(e=>typeof e==`bigint`),Os=Jo(e=>e===Ds),ks=Jo(e=>typeof e==`symbol`);Jo(e=>e===ks);var As=Jo(e=>typeof e==`number`),js=Jo(e=>e===As),Ms=Jo(e=>typeof e==`string`),Ns=Jo(e=>e===Ms),Ps=Jo(e=>typeof e==`boolean`),Fs=Jo(e=>e===Ps),tee=Xo(void 0);Ko(Yo,e=>e.shape.length===1&&e.shape[0]===void 0),Xo(void 0);var Is=Xo(null),Ls=Ko(Yo,e=>e.shape.length===1&&e.shape[0]===null);Ko(Uint8Array),Ko(Go,e=>e.shape===Uint8Array);var Rs=Ss(As,Ms,Is,tee,Ds,Ps,ks);(()=>{let e=ps(Ts),t=ls(Ms,Ts),n=Ss(As,Ms,Is,Ps,e,t);return e.shape=n,t.shape.values=n,n})();var zs=e=>{if(vs.check(e))return e;if(ss.check(e)){let t={};for(let n in e)t[n]=zs(e[n]);return as(t)}else if(hs.check(e))return Ss(...e.map(zs));else if(Rs.check(e))return Xo(e);else if(bs.check(e))return Ko(e);ga()},Bs=bo?()=>{}:(e,t)=>{let n=new Ho;if(!t.check(e,n))throw ma(`Expected value to be of type ${t.constructor.name}.\n${n.toString()}`)},nee=class{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:zs(e),h:t}),this}else(e){return this.if(Ts,e)}done(){return(e,t)=>{for(let n=0;n<this.patterns.length;n++){let r=this.patterns[n];if(r.if.check(e))return r.h(e,t)}throw ma(`Unhandled pattern`)}}},Vs=(e=>new nee(e))(Ts).if(js,(e,t)=>Fo(t,Oi,Di)).if(Ns,(e,t)=>zo(t)).if(Fs,(e,t)=>Po(t)).if(Os,(e,t)=>BigInt(Fo(t,Oi,Di))).if(Cs,(e,t)=>Hs(t,Bo(t,e.shape))).if(os,(e,t)=>{let n={};for(let r in e.shape){let i=e.shape[r];if(ns.check(i)){if(Po(t))continue;i=i.shape}n[r]=Vs(i,t)}return n}).if(ms,(e,t)=>{let n=[],r=Io(t,0,42);for(let i=0;i<r;i++)n.push(Hs(t,e.shape));return n}).if(Zo,(e,t)=>Bo(t,e.shape)).if(Ls,(e,t)=>null).if(ys,(e,t)=>{let n=Hs(t,e.res);return()=>n}).if(Es,(e,t)=>Hs(t,Bo(t,[As,Ms,Is,tee,Ds,Ps,ps(As),ls(Ss(`a`,`b`,`c`),As)]))).if(us,(e,t)=>{let n={},r=Fo(t,0,3);for(let i=0;i<r;i++){let r=Hs(t,e.shape.keys);n[r]=Hs(t,e.shape.values)}return n}).done(),Hs=(e,t)=>Vs(zs(t),e),Us=typeof document<`u`?document:{};Jo(e=>e.nodeType===Js),typeof DOMParser<`u`&&new DOMParser,Jo(e=>e.nodeType===Gs),Jo(e=>e.nodeType===Ks);var Ws=e=>li(e,(e,t)=>`${t}:${e};`).join(``),Gs=Us.ELEMENT_NODE,Ks=Us.TEXT_NODE;Us.CDATA_SECTION_NODE,Us.COMMENT_NODE;var qs=Us.DOCUMENT_NODE;Us.DOCUMENT_TYPE_NODE;var Js=Us.DOCUMENT_FRAGMENT_NODE;Jo(e=>e.nodeType===qs);var Ys=Symbol,Xs=Ys(),Zs=Ys(),Qs=Ys(),$s=Ys(),ec=Ys(),tc=Ys(),nc=Ys(),rc=Ys(),ic=Ys(),ac=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=0;for(;r<e.length;r++){let n=e[r];if(n===void 0)break;if(n.constructor===String||n.constructor===Number)t.push(n);else if(n.constructor===Object)break}for(r>0&&n.push(t.join(``));r<e.length;r++){let t=e[r];t instanceof Symbol||n.push(t)}return n};za();var oc={[Xs]:No(`font-weight`,`bold`),[Zs]:No(`font-weight`,`normal`),[Qs]:No(`color`,`blue`),[ec]:No(`color`,`green`),[$s]:No(`color`,`grey`),[tc]:No(`color`,`red`),[nc]:No(`color`,`purple`),[rc]:No(`color`,`orange`),[ic]:No(`color`,`black`)},sc=xo?e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=oi(),i=[],a=0;for(;a<e.length;a++){let i=e[a],o=oc[i];if(o!==void 0)r.set(o.left,o.right);else{if(i===void 0)break;if(i.constructor===String||i.constructor===Number){let e=Ws(r);a>0||e.length>0?(t.push(`%c`+i),n.push(e)):t.push(i)}else break}}for(a>0&&(i=n,i.unshift(t.join(``)));a<e.length;a++){let t=e[a];t instanceof Symbol||i.push(t)}return i}:ac,cc=(...e)=>{console.log(...sc(e)),uc.forEach(t=>t.print(e))},lc=(...e)=>{console.warn(...sc(e)),e.unshift(rc),uc.forEach(t=>t.print(e))},uc=di(),dc=e=>({[Symbol.iterator](){return this},next:e}),fc=(e,t)=>dc(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),pc=(e,t)=>dc(()=>{let{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}}),mc=class{constructor(e,t){this.clock=e,this.len=t}},hc=class{constructor(){this.clients=new Map}},gc=(e,t,n)=>t.clients.forEach((t,r)=>{let i=e.doc.store.clients.get(r);if(i!=null){let r=i[i.length-1],a=r.id.clock+r.length;for(let r=0,o=t[r];r<t.length&&o.clock<a;o=t[++r])lee(e,i,o.clock,o.len,n)}}),_c=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){let i=xi((n+r)/2),a=e[i],o=a.clock;if(o<=t){if(t<o+a.len)return i;n=i+1}else r=i-1}return null},vc=(e,t)=>{let n=e.clients.get(t.client);return n!==void 0&&_c(n,t.clock)!==null},yc=e=>{e.clients.forEach(e=>{e.sort((e,t)=>e.clock-t.clock);let t,n;for(t=1,n=1;t<e.length;t++){let r=e[n-1],i=e[t];r.clock+r.len>=i.clock?e[n-1]=new mc(r.clock,wi(r.len,i.clock+i.len-r.clock)):(n<t&&(e[n]=i),n++)}e.length=n})},bc=e=>{let t=new hc;for(let n=0;n<e.length;n++)e[n].clients.forEach((r,i)=>{if(!t.clients.has(i)){let a=r.slice();for(let t=n+1;t<e.length;t++)pi(a,e[t].clients.get(i)||[]);t.clients.set(i,a)}});return yc(t),t},xc=(e,t,n,r)=>{ci(e.clients,t,()=>[]).push(new mc(n,r))},Sc=()=>new hc,Cc=e=>{let t=Sc();return e.clients.forEach((e,n)=>{let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(n.deleted){let i=n.id.clock,a=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[++t+1])a+=n.length;r.push(new mc(i,a))}}r.length>0&&t.clients.set(n,r)}),t},wc=(e,t)=>{Ji(e.restEncoder,t.clients.size),mi(t.clients.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{e.resetDsCurVal(),Ji(e.restEncoder,t);let r=n.length;Ji(e.restEncoder,r);for(let t=0;t<r;t++){let r=n[t];e.writeDsClock(r.clock),e.writeDsLen(r.len)}})},Tc=e=>{let t=new hc,n=Ta(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();let n=Ta(e.restDecoder),r=Ta(e.restDecoder);if(r>0){let i=ci(t.clients,n,()=>[]);for(let t=0;t<r;t++)i.push(new mc(e.readDsClock(),e.readDsLen()))}}return t},Ec=(e,t,n)=>{let r=new hc,i=Ta(e.restDecoder);for(let a=0;a<i;a++){e.resetDsCurVal();let i=Ta(e.restDecoder),a=Ta(e.restDecoder),o=n.clients.get(i)||[],s=xl(n,i);for(let n=0;n<a;n++){let n=e.readDsClock(),a=n+e.readDsLen();if(n<s){s<a&&xc(r,i,s,a-s);let e=Cl(o,n),l=o[e];for(!l.deleted&&l.id.clock<n&&(o.splice(e+1,0,nd(t,l,n-l.id.clock)),e++);e<o.length&&(l=o[e++],l.id.clock<a);)l.deleted||(a<l.id.clock+l.length&&o.splice(e,0,nd(t,l,a-l.id.clock)),l.delete(t))}else xc(r,i,n,a-n)}}if(r.clients.size>0){let e=new Ic;return Ji(e.restEncoder,0),wc(e,r),e.toUint8Array()}return null},Dc=Ia,Oc=class e extends yi{constructor({guid:e=Ra(),collectionid:t=null,gc:n=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:a=!1,shouldLoad:o=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=Dc(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new cee,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=o,this.autoLoad=a,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=Ba(e=>{this.on(`load`,()=>{this.isLoaded=!0,e(this)})});let s=()=>Ba(e=>{let t=n=>{(n===void 0||n===!0)&&(this.off(`sync`,t),e())};this.on(`sync`,t)});this.on(`sync`,e=>{e===!1&&this.isSynced&&(this.whenSynced=s()),this.isSynced=e===void 0||e===!0,this.isSynced&&!this.isLoaded&&this.emit(`load`,[this])}),this.whenSynced=s()}load(){let e=this._item;e!==null&&!this.shouldLoad&&Pl(e.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(mi(this.subdocs).map(e=>e.guid))}transact(e,t=null){return Pl(this,e,t)}get(e,t=nu){let n=ci(this.share,e,()=>{let e=new t;return e._integrate(this,null),e}),r=n.constructor;if(t!==nu&&r!==t)if(r===nu){let r=new t;r._map=n._map,n._map.forEach(e=>{for(;e!==null;e=e.left)e.parent=r}),r._start=n._start;for(let e=r._start;e!==null;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}else throw Error(`Type with the name ${e} has already been defined with a different constructor`);return n}getArray(e=``){return this.get(e,xu)}getText(e=``){return this.get(e,ku)}getMap(e=``){return this.get(e,Su)}getXmlElement(e=``){return this.get(e,Nu)}getXmlFragment(e=``){return this.get(e,Mu)}toJSON(){let e={};return this.share.forEach((t,n)=>{e[n]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,mi(this.subdocs).forEach(e=>e.destroy());let t=this._item;if(t!==null){this._item=null;let n=t.content;n.doc=new e({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,Pl(t.parent.doc,e=>{let r=n.doc;t.deleted||e.subdocsAdded.add(r),e.subdocsRemoved.add(this)},null,!0)}this.emit(`destroyed`,[!0]),this.emit(`destroy`,[this]),super.destroy()}},kc=class{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return Ta(this.restDecoder)}readDsLen(){return Ta(this.restDecoder)}},Ac=class extends kc{readLeftID(){return rl(Ta(this.restDecoder),Ta(this.restDecoder))}readRightID(){return rl(Ta(this.restDecoder),Ta(this.restDecoder))}readClient(){return Ta(this.restDecoder)}readInfo(){return wa(this.restDecoder)}readString(){return Da(this.restDecoder)}readParentInfo(){return Ta(this.restDecoder)===1}readTypeRef(){return Ta(this.restDecoder)}readLen(){return Ta(this.restDecoder)}readAny(){return Aa(this.restDecoder)}readBuf(){return jo(Ca(this.restDecoder))}readJSON(){return JSON.parse(Da(this.restDecoder))}readKey(){return Da(this.restDecoder)}},jc=class{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Ta(this.restDecoder),this.dsCurrVal}readDsLen(){let e=Ta(this.restDecoder)+1;return this.dsCurrVal+=e,e}},Mc=class extends jc{constructor(e){super(e),this.keys=[],Ta(e),this.keyClockDecoder=new Na(Ca(e)),this.clientDecoder=new Ma(Ca(e)),this.leftClockDecoder=new Na(Ca(e)),this.rightClockDecoder=new Na(Ca(e)),this.infoDecoder=new ja(Ca(e),wa),this.stringDecoder=new Pa(Ca(e)),this.parentInfoDecoder=new ja(Ca(e),wa),this.typeRefDecoder=new Ma(Ca(e)),this.lenDecoder=new Ma(Ca(e))}readLeftID(){return new tl(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new tl(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Aa(this.restDecoder)}readBuf(){return Ca(this.restDecoder)}readJSON(){return Aa(this.restDecoder)}readKey(){let e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{let e=this.stringDecoder.read();return this.keys.push(e),e}}},Nc=class{constructor(){this.restEncoder=Hi()}toUint8Array(){return Wi(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){Ji(this.restEncoder,e)}writeDsLen(e){Ji(this.restEncoder,e)}},Pc=class extends Nc{writeLeftID(e){Ji(this.restEncoder,e.client),Ji(this.restEncoder,e.clock)}writeRightID(e){Ji(this.restEncoder,e.client),Ji(this.restEncoder,e.clock)}writeClient(e){Ji(this.restEncoder,e)}writeInfo(e){qi(this.restEncoder,e)}writeString(e){Qi(this.restEncoder,e)}writeParentInfo(e){Ji(this.restEncoder,+!!e)}writeTypeRef(e){Ji(this.restEncoder,e)}writeLen(e){Ji(this.restEncoder,e)}writeAny(e){sa(this.restEncoder,e)}writeBuf(e){ea(this.restEncoder,e)}writeJSON(e){Qi(this.restEncoder,JSON.stringify(e))}writeKey(e){Qi(this.restEncoder,e)}},Fc=class{constructor(){this.restEncoder=Hi(),this.dsCurrVal=0}toUint8Array(){return Wi(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){let t=e-this.dsCurrVal;this.dsCurrVal=e,Ji(this.restEncoder,t)}writeDsLen(e){e===0&&ga(),Ji(this.restEncoder,e-1),this.dsCurrVal+=e}},Ic=class extends Fc{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new fa,this.clientEncoder=new ua,this.leftClockEncoder=new fa,this.rightClockEncoder=new fa,this.infoEncoder=new ca(qi),this.stringEncoder=new pa,this.parentInfoEncoder=new ca(qi),this.typeRefEncoder=new ua,this.lenEncoder=new ua}toUint8Array(){let e=Hi();return Ji(e,0),ea(e,this.keyClockEncoder.toUint8Array()),ea(e,this.clientEncoder.toUint8Array()),ea(e,this.leftClockEncoder.toUint8Array()),ea(e,this.rightClockEncoder.toUint8Array()),ea(e,Wi(this.infoEncoder)),ea(e,this.stringEncoder.toUint8Array()),ea(e,Wi(this.parentInfoEncoder)),ea(e,this.typeRefEncoder.toUint8Array()),ea(e,this.lenEncoder.toUint8Array()),$i(e,Wi(this.restEncoder)),Wi(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(+!!e)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){sa(this.restEncoder,e)}writeBuf(e){ea(this.restEncoder,e)}writeJSON(e){sa(this.restEncoder,e)}writeKey(e){let t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}},Lc=(e,t,n,r)=>{r=wi(r,t[0].id.clock);let i=Cl(t,r);Ji(e.restEncoder,t.length-i),e.writeClient(n),Ji(e.restEncoder,r);let a=t[i];a.write(e,r-a.id.clock);for(let n=i+1;n<t.length;n++)t[n].write(e,0)},Rc=(e,t,n)=>{let r=new Map;n.forEach((e,n)=>{xl(t,n)>e&&r.set(n,e)}),bl(t).forEach((e,t)=>{n.has(t)||r.set(t,0)}),Ji(e.restEncoder,r.size),mi(r.entries()).sort((e,t)=>t[0]-e[0]).forEach(([n,r])=>{Lc(e,t.clients.get(n),n,r)})},zc=(e,t)=>{let n=oi(),r=Ta(e.restDecoder);for(let i=0;i<r;i++){let r=Ta(e.restDecoder),i=Array(r),a=e.readClient(),o=Ta(e.restDecoder);n.set(a,{i:0,refs:i});for(let n=0;n<r;n++){let r=e.readInfo();switch(31&r){case 0:{let t=e.readLen();i[n]=new zu(rl(a,o),t),o+=t;break}case 10:{let t=Ta(e.restDecoder);i[n]=new cd(rl(a,o),t),o+=t;break}default:{let s=(r&192)==0,l=new id(rl(a,o),null,(r&128)==128?e.readLeftID():null,null,(r&64)==64?e.readRightID():null,s?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,s&&(r&32)==32?e.readString():null,ad(e,r));i[n]=l,o+=l.length}}}}return n},ree=(e,t,n)=>{let r=[],i=mi(n.keys()).sort((e,t)=>e-t);if(i.length===0)return null;let a=()=>{if(i.length===0)return null;let e=n.get(i[i.length-1]);for(;e.refs.length===e.i;)if(i.pop(),i.length>0)e=n.get(i[i.length-1]);else return null;return e},o=a();if(o===null)return null;let s=new cee,l=new Map,u=(e,t)=>{let n=l.get(e);(n==null||n>t)&&l.set(e,t)},d=o.refs[o.i++],f=new Map,p=()=>{for(let e of r){let t=e.id.client,r=n.get(t);r?(r.i--,s.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):s.clients.set(t,[e]),i=i.filter(e=>e!==t)}r.length=0};for(;;){if(d.constructor!==cd){let i=ci(f,d.id.client,()=>xl(t,d.id.client))-d.id.clock;if(i<0)r.push(d),u(d.id.client,d.id.clock-1),p();else{let a=d.getMissing(e,t);if(a!==null){r.push(d);let e=n.get(a)||{refs:[],i:0};if(e.refs.length===e.i)u(a,xl(t,a)),p();else{d=e.refs[e.i++];continue}}else (i===0||i<d.length)&&(d.integrate(e,i),f.set(d.id.client,d.id.clock+d.length))}}if(r.length>0)d=r.pop();else if(o!==null&&o.i<o.refs.length)d=o.refs[o.i++];else{if(o=a(),o===null)break;d=o.refs[o.i++]}}if(s.clients.size>0){let e=new Ic;return Rc(e,s,new Map),Ji(e.restEncoder,0),{missing:l,update:e.toUint8Array()}}return null},Bc=(e,t)=>Rc(e,t.doc.store,t.beforeState),iee=(e,t,n,r=new Mc(e))=>Pl(t,e=>{e.local=!1;let t=!1,n=e.doc,i=n.store,a=ree(e,i,zc(r,n)),o=i.pendingStructs;if(o){for(let[e,n]of o.missing)if(n<xl(i,e)){t=!0;break}if(a){for(let[e,t]of a.missing){let n=o.missing.get(e);(n==null||n>t)&&o.missing.set(e,t)}o.update=Hl([o.update,a.update])}}else i.pendingStructs=a;let s=Ec(r,e,i);if(i.pendingDs){let t=new Mc(ba(i.pendingDs));Ta(t.restDecoder);let n=Ec(t,e,i);s&&n?i.pendingDs=Hl([s,n]):i.pendingDs=s||n}else i.pendingDs=s;if(t){let t=i.pendingStructs.update;i.pendingStructs=null,Vc(e.doc,t)}},n,!1),Vc=(e,t,n,r=Mc)=>{let i=ba(t);iee(i,e,n,new r(i))},Hc=(e,t,n)=>Vc(e,t,n,Ac),Uc=(e,t,n=new Map)=>{Rc(e,t.store,n),wc(e,Cc(t.store))},Wc=(e,t=new Uint8Array([0]),n=new Ic)=>{Uc(n,e,Kc(t));let r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(mee(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===Pc)return Vl(r.map((e,t)=>t===0?e:gee(e)));if(n.constructor===Ic)return Hl(r)}return r[0]},aee=(e,t)=>Wc(e,t,new Pc),Gc=e=>{let t=new Map,n=Ta(e.restDecoder);for(let r=0;r<n;r++){let n=Ta(e.restDecoder),r=Ta(e.restDecoder);t.set(n,r)}return t},Kc=e=>Gc(new kc(ba(e))),qc=(e,t)=>(Ji(e.restEncoder,t.size),mi(t.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{Ji(e.restEncoder,t),Ji(e.restEncoder,n)}),e),Jc=(e,t)=>qc(e,bl(t.store)),Yc=(e,t=new Fc)=>(e instanceof Map?qc(t,e):Jc(t,e),t.toUint8Array()),Xc=e=>Yc(e,new Nc),oee=class{constructor(){this.l=[]}},Zc=()=>new oee,Qc=(e,t)=>e.l.push(t),$c=(e,t)=>{let n=e.l,r=n.length;e.l=n.filter(e=>t!==e),r===e.l.length&&console.error(`[yjs] Tried to remove event handler that doesn't exist.`)},el=(e,t,n)=>so(e.l,[t,n]),tl=class{constructor(e,t){this.client=e,this.clock=t}},nl=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,rl=(e,t)=>new tl(e,t),il=e=>{for(let[t,n]of e.doc.share.entries())if(n===e)return t;throw ga()},al=(e,t)=>{for(;t!==null;){if(t.parent===e)return!0;t=t.parent._item}return!1},ol=class{constructor(e,t=e.getMap(`users`)){let n=new Map;this.yusers=t,this.doc=e,this.clients=new Map,this.dss=n;let r=(e,t)=>{let n=e.get(`ds`),r=e.get(`ids`),i=e=>this.clients.set(e,t);n.observe(e=>{e.changes.added.forEach(e=>{e.content.getContent().forEach(e=>{e instanceof Uint8Array&&this.dss.set(t,bc([this.dss.get(t)||Sc(),Tc(new kc(ba(e)))]))})})}),this.dss.set(t,bc(n.map(e=>Tc(new kc(ba(e)))))),r.observe(e=>e.changes.added.forEach(e=>e.content.getContent().forEach(i))),r.forEach(i)};t.observe(e=>{e.keysChanged.forEach(e=>r(t.get(e),e))}),t.forEach(r)}setUserMapping(e,t,n,{filter:r=()=>!0}={}){let i=this.yusers,a=i.get(n);a||(a=new Su,a.set(`ids`,new xu),a.set(`ds`,new xu),i.set(n,a)),a.get(`ids`).push([t]),i.observe(e=>{setTimeout(()=>{let e=i.get(n);if(e!==a){a=e,this.clients.forEach((e,t)=>{n===e&&a.get(`ids`).push([t])});let t=new Nc,r=this.dss.get(n);r&&(wc(t,r),a.get(`ds`).push([t.toUint8Array()]))}},0)}),e.on(`afterTransaction`,e=>{setTimeout(()=>{let t=a.get(`ds`),n=e.deleteSet;if(e.local&&n.clients.size>0&&r(e,n)){let e=new Nc;wc(e,n),t.push([e.toUint8Array()])}})})}getUserByClientId(e){return this.clients.get(e)||null}getUserByDeletedId(e){for(let[t,n]of this.dss.entries())if(vc(n,e))return t;return null}},sl=class{constructor(e,t,n,r=0){this.type=e,this.tname=t,this.item=n,this.assoc=r}},cl=class{constructor(e,t,n=0){this.type=e,this.index=t,this.assoc=n}},ll=(e,t,n=0)=>new cl(e,t,n),ul=(e,t,n)=>{let r=null,i=null;return e._item===null?i=il(e):r=rl(e._item.id.client,e._item.id.clock),new sl(r,i,t,n)},dl=(e,t,n=0)=>{let r=e._start;if(n<0){if(t===0)return ul(e,null,n);t--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>t)return ul(e,rl(r.id.client,r.id.clock+t),n);t-=r.length}if(r.right===null&&n<0)return ul(e,r.lastId,n);r=r.right}return ul(e,null,n)},fl=(e,t)=>{let n=wl(e,t);return{item:n,diff:t.clock-n.id.clock}},pl=(e,t,n=!0)=>{let r=t.store,i=e.item,a=e.type,o=e.tname,s=e.assoc,l=null,u=0;if(i!==null){if(xl(r,i.client)<=i.clock)return null;let e=n?ed(r,i):fl(r,i),t=e.item;if(!(t instanceof id))return null;if(l=t.parent,l._item===null||!l._item.deleted){u=t.deleted||!t.countable?0:e.diff+(s>=0?0:1);let n=t.left;for(;n!==null;)!n.deleted&&n.countable&&(u+=n.length),n=n.left}}else{if(o!==null)l=t.get(o);else if(a!==null){if(xl(r,a.client)<=a.clock)return null;let{item:e}=n?ed(r,a):{item:wl(r,a)};if(e instanceof id&&e.content instanceof $u)l=e.content.type;else return null}else throw ga();u=s>=0?l._length:0}return ll(l,u,e.assoc)},ml=(e,t)=>e===t||e!==null&&t!==null&&e.tname===t.tname&&nl(e.item,t.item)&&nl(e.type,t.type)&&e.assoc===t.assoc,hl=class{constructor(e,t){this.ds=e,this.sv=t}},gl=(e,t)=>new hl(e,t),see=gl(Sc(),new Map),_l=e=>gl(Cc(e.store),bl(e.store)),vl=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!vc(t.ds,e.id),yl=(e,t)=>{let n=ci(e.meta,yl,di),r=e.doc.store;n.has(t)||(t.sv.forEach((t,n)=>{t<xl(r,n)&&El(e,rl(n,t))}),gc(e,t.ds,e=>{}),n.add(t))},cee=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},bl=e=>{let t=new Map;return e.clients.forEach((e,n)=>{let r=e[e.length-1];t.set(n,r.id.clock+r.length)}),t},xl=(e,t)=>{let n=e.clients.get(t);if(n===void 0)return 0;let r=n[n.length-1];return r.id.clock+r.length},Sl=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{let e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw ga()}n.push(t)},Cl=(e,t)=>{let n=0,r=e.length-1,i=e[r],a=i.id.clock;if(a===t)return r;let o=xi(t/(a+i.length-1)*r);for(;n<=r;){if(i=e[o],a=i.id.clock,a<=t){if(t<a+i.length)return o;n=o+1}else r=o-1;o=xi((n+r)/2)}throw ga()},wl=(e,t)=>{let n=e.clients.get(t.client);return n[Cl(n,t.clock)]},Tl=(e,t,n)=>{let r=Cl(t,n),i=t[r];return i.id.clock<n&&i instanceof id?(t.splice(r+1,0,nd(e,i,n-i.id.clock)),r+1):r},El=(e,t)=>{let n=e.doc.store.clients.get(t.client);return n[Tl(e,n,t.clock)]},Dl=(e,t,n)=>{let r=t.clients.get(n.client),i=Cl(r,n.clock),a=r[i];return n.clock!==a.id.clock+a.length-1&&a.constructor!==zu&&r.splice(i+1,0,nd(e,a,n.clock-a.id.clock+1)),a},Ol=(e,t,n)=>{let r=e.clients.get(t.id.client);r[Cl(r,t.id.clock)]=n},lee=(e,t,n,r,i)=>{if(r===0)return;let a=n+r,o=Tl(e,t,n),s;do s=t[o++],a<s.id.clock+s.length&&Tl(e,t,a),i(s);while(o<t.length&&t[o].id.clock<a)},uee=class{constructor(e,t,n){this.doc=e,this.deleteSet=new hc,this.beforeState=bl(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},kl=(e,t)=>t.deleteSet.clients.size===0&&!ui(t.afterState,(e,n)=>t.beforeState.get(n)!==e)?!1:(yc(t.deleteSet),Bc(e,t),wc(e,t.deleteSet),!0),Al=(e,t,n)=>{let r=t._item;(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&ci(e.changed,t,di).add(n)},jl=(e,t)=>{let n=e[t],r=e[t-1],i=t;for(;i>0;n=r,r=e[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof id&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}let a=t-i;return a&&e.splice(t+1-a,a),a},Ml=(e,t,n)=>{for(let[r,i]of e.clients.entries()){let e=t.clients.get(r);for(let r=i.length-1;r>=0;r--){let a=i[r],o=a.clock+a.len;for(let r=Cl(e,a.clock),i=e[r];r<e.length&&i.id.clock<o;i=e[++r]){let i=e[r];if(a.clock+a.len<=i.id.clock)break;i instanceof id&&i.deleted&&!i.keep&&n(i)&&i.gc(t,!1)}}}},dee=(e,t)=>{e.clients.forEach((e,n)=>{let r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){let n=e[t],i=Ci(r.length-1,1+Cl(r,n.clock+n.len-1));for(let e=i,t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+jl(r,e)}})},Nl=(e,t)=>{if(t<e.length){let n=e[t],r=n.doc,i=r.store,a=n.deleteSet,o=n._mergeStructs;try{yc(a),n.afterState=bl(n.doc.store),r.emit(`beforeObserverCalls`,[n,r]);let e=[];n.changed.forEach((t,r)=>e.push(()=>{(r._item===null||!r._item.deleted)&&r._callObserver(n,t)})),e.push(()=>{n.changedParentTypes.forEach((t,r)=>{r._dEH.l.length>0&&(r._item===null||!r._item.deleted)&&(t=t.filter(e=>e.target._item===null||!e.target._item.deleted),t.forEach(e=>{e.currentTarget=r,e._path=null}),t.sort((e,t)=>e.path.length-t.path.length),e.push(()=>{el(r._dEH,t,n)}))}),e.push(()=>r.emit(`afterTransaction`,[n,r])),e.push(()=>{n._needFormattingCleanup&&Du(n)})}),so(e,[])}finally{r.gc&&Ml(a,i,r.gcFilter),dee(a,i),n.afterState.forEach((e,t)=>{let r=n.beforeState.get(t)||0;if(r!==e){let e=i.clients.get(t),n=wi(Cl(e,r),1);for(let t=e.length-1;t>=n;)t-=1+jl(e,t)}});for(let e=o.length-1;e>=0;e--){let{client:t,clock:n}=o[e].id,r=i.clients.get(t),a=Cl(r,n);a+1<r.length&&jl(r,a+1)>1||a>0&&jl(r,a)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(cc(rc,Xs,`[yjs] `,Zs,tc,`Changed the client-id because another client seems to be using it.`),r.clientID=Dc()),r.emit(`afterTransactionCleanup`,[n,r]),r._observers.has(`update`)){let e=new Pc;kl(e,n)&&r.emit(`update`,[e.toUint8Array(),n.origin,r,n])}if(r._observers.has(`updateV2`)){let e=new Ic;kl(e,n)&&r.emit(`updateV2`,[e.toUint8Array(),n.origin,r,n])}let{subdocsAdded:s,subdocsLoaded:l,subdocsRemoved:u}=n;(s.size>0||u.size>0||l.size>0)&&(s.forEach(e=>{e.clientID=r.clientID,e.collectionid??=r.collectionid,r.subdocs.add(e)}),u.forEach(e=>r.subdocs.delete(e)),r.emit(`subdocs`,[{loaded:l,added:s,removed:u},r,n]),u.forEach(e=>e.destroy())),e.length<=t+1?(r._transactionCleanups=[],r.emit(`afterAllTransactions`,[r,e])):Nl(e,t+1)}}},Pl=(e,t,n=null,r=!0)=>{let i=e._transactionCleanups,a=!1,o=null;e._transaction===null&&(a=!0,e._transaction=new uee(e,n,r),i.push(e._transaction),i.length===1&&e.emit(`beforeAllTransactions`,[e]),e.emit(`beforeTransaction`,[e._transaction,e]));try{o=t(e._transaction)}finally{if(a){let t=e._transaction===i[0];e._transaction=null,t&&Nl(i,0)}}return o},Fl=class{constructor(e,t){this.insertions=t,this.deletions=e,this.meta=new Map}},Il=(e,t,n)=>{gc(e,n.deletions,n=>{n instanceof id&&t.scope.some(t=>t===e.doc||al(t,n))&&td(n,!1)})},Ll=(e,t,n)=>{let r=null,i=e.doc,a=e.scope;Pl(i,n=>{for(;t.length>0&&e.currStackItem===null;){let r=i.store,o=t.pop(),s=new Set,l=[],u=!1;gc(n,o.insertions,e=>{if(e instanceof id){if(e.redone!==null){let{item:t,diff:i}=ed(r,e.id);i>0&&(t=El(n,rl(t.id.client,t.id.clock+i))),e=t}!e.deleted&&a.some(t=>t===n.doc||al(t,e))&&l.push(e)}}),gc(n,o.deletions,e=>{e instanceof id&&a.some(t=>t===n.doc||al(t,e))&&!vc(o.insertions,e.id)&&s.add(e)}),s.forEach(t=>{u=$ee(n,t,s,o.insertions,e.ignoreRemoteMapChanges,e)!==null||u});for(let t=l.length-1;t>=0;t--){let r=l[t];e.deleteFilter(r)&&(r.delete(n),u=!0)}e.currStackItem=u?o:null}n.changed.forEach((e,t)=>{e.has(null)&&t._searchMarker&&(t._searchMarker.length=0)}),r=n},e);let o=e.currStackItem;if(o!=null){let t=r.changedParentTypes;e.emit(`stack-item-popped`,[{stackItem:o,type:n,changedParentTypes:t,origin:e},e]),e.currStackItem=null}return o},Rl=class extends yi{constructor(e,{captureTimeout:t=500,captureTransaction:n=e=>!0,deleteFilter:r=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:a=!1,doc:o=vi(e)?e[0].doc:e instanceof Oc?e:e.doc}={}){super(),this.scope=[],this.doc=o,this.addToScope(e),this.deleteFilter=r,i.add(this),this.trackedOrigins=i,this.captureTransaction=n,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=a,this.captureTimeout=t,this.afterTransactionHandler=e=>{if(!this.captureTransaction(e)||!this.scope.some(t=>e.changedParentTypes.has(t)||t===this.doc)||!this.trackedOrigins.has(e.origin)&&(!e.origin||!this.trackedOrigins.has(e.origin.constructor)))return;let t=this.undoing,n=this.redoing,r=t?this.redoStack:this.undoStack;t?this.stopCapturing():n||this.clear(!1,!0);let i=new hc;e.afterState.forEach((t,n)=>{let r=e.beforeState.get(n)||0,a=t-r;a>0&&xc(i,n,r,a)});let a=za(),o=!1;if(this.lastChange>0&&a-this.lastChange<this.captureTimeout&&r.length>0&&!t&&!n){let t=r[r.length-1];t.deletions=bc([t.deletions,e.deleteSet]),t.insertions=bc([t.insertions,i])}else r.push(new Fl(e.deleteSet,i)),o=!0;!t&&!n&&(this.lastChange=a),gc(e,e.deleteSet,t=>{t instanceof id&&this.scope.some(n=>n===e.doc||al(n,t))&&td(t,!0)});let s=[{stackItem:r[r.length-1],origin:e.origin,type:t?`redo`:`undo`,changedParentTypes:e.changedParentTypes},this];o?this.emit(`stack-item-added`,s):this.emit(`stack-item-updated`,s)},this.doc.on(`afterTransaction`,this.afterTransactionHandler),this.doc.on(`destroy`,()=>{this.destroy()})}addToScope(e){let t=new Set(this.scope);e=vi(e)?e:[e],e.forEach(e=>{t.has(e)||(t.add(e),(e instanceof nu?e.doc!==this.doc:e!==this.doc)&&lc(`[yjs#509] Not same Y.Doc`),this.scope.push(e))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,t=!0){(e&&this.canUndo()||t&&this.canRedo())&&this.doc.transact(n=>{e&&(this.undoStack.forEach(e=>Il(n,this,e)),this.undoStack=[]),t&&(this.redoStack.forEach(e=>Il(n,this,e)),this.redoStack=[]),this.emit(`stack-cleared`,[{undoStackCleared:e,redoStackCleared:t}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=Ll(this,this.undoStack,`undo`)}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=Ll(this,this.redoStack,`redo`)}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off(`afterTransaction`,this.afterTransactionHandler),super.destroy()}};function*fee(e){let t=Ta(e.restDecoder);for(let n=0;n<t;n++){let t=Ta(e.restDecoder),n=e.readClient(),r=Ta(e.restDecoder);for(let i=0;i<t;i++){let t=e.readInfo();if(t===10){let t=Ta(e.restDecoder);yield new cd(rl(n,r),t),r+=t}else if(31&t){let i=(t&192)==0,a=new id(rl(n,r),null,(t&128)==128?e.readLeftID():null,null,(t&64)==64?e.readRightID():null,i?e.readParentInfo()?e.readString():e.readLeftID():null,i&&(t&32)==32?e.readString():null,ad(e,t));yield a,r+=a.length}else{let t=e.readLen();yield new zu(rl(n,r),t),r+=t}}}}var zl=class{constructor(e,t){this.gen=fee(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===cd);return this.curr}},Bl=class{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}},Vl=e=>Hl(e,Ac,Pc),pee=(e,t)=>{if(e.constructor===zu){let{client:n,clock:r}=e.id;return new zu(rl(n,r+t),e.length-t)}else if(e.constructor===cd){let{client:n,clock:r}=e.id;return new cd(rl(n,r+t),e.length-t)}else{let n=e,{client:r,clock:i}=n.id;return new id(rl(r,i+t),null,rl(r,i+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},Hl=(e,t=Mc,n=Ic)=>{if(e.length===1)return e[0];let r=e.map(e=>new t(ba(e))),i=r.map(e=>new zl(e,!0)),a=null,o=new n,s=new Bl(o);for(;i=i.filter(e=>e.curr!==null),i.sort((e,t)=>{if(e.curr.id.client===t.curr.id.client){let n=e.curr.id.clock-t.curr.id.clock;return n===0?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===cd?1:-1:n}else return t.curr.id.client-e.curr.id.client}),i.length!==0;){let e=i[0],t=e.curr.id.client;if(a!==null){let n=e.curr,r=!1;for(;n!==null&&n.id.clock+n.length<=a.struct.id.clock+a.struct.length&&n.id.client>=a.struct.id.client;)n=e.next(),r=!0;if(n===null||n.id.client!==t||r&&n.id.clock>a.struct.id.clock+a.struct.length)continue;if(t!==a.struct.id.client)Ul(s,a.struct,a.offset),a={struct:n,offset:0},e.next();else if(a.struct.id.clock+a.struct.length<n.id.clock)if(a.struct.constructor===cd)a.struct.length=n.id.clock+n.length-a.struct.id.clock;else{Ul(s,a.struct,a.offset);let e=n.id.clock-a.struct.id.clock-a.struct.length;a={struct:new cd(rl(t,a.struct.id.clock+a.struct.length),e),offset:0}}else{let t=a.struct.id.clock+a.struct.length-n.id.clock;t>0&&(a.struct.constructor===cd?a.struct.length-=t:n=pee(n,t)),a.struct.mergeWith(n)||(Ul(s,a.struct,a.offset),a={struct:n,offset:0},e.next())}}else a={struct:e.curr,offset:0},e.next();for(let n=e.curr;n!==null&&n.id.client===t&&n.id.clock===a.struct.id.clock+a.struct.length&&n.constructor!==cd;n=e.next())Ul(s,a.struct,a.offset),a={struct:n,offset:0}}return a!==null&&(Ul(s,a.struct,a.offset),a=null),Wl(s),wc(o,bc(r.map(e=>Tc(e)))),o.toUint8Array()},mee=(e,t,n=Mc,r=Ic)=>{let i=Kc(t),a=new r,o=new Bl(a),s=new n(ba(e)),l=new zl(s,!1);for(;l.curr;){let e=l.curr,t=e.id.client,n=i.get(t)||0;if(l.curr.constructor===cd){l.next();continue}if(e.id.clock+e.length>n)for(Ul(o,e,wi(n-e.id.clock,0)),l.next();l.curr&&l.curr.id.client===t;)Ul(o,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===t&&l.curr.id.clock+l.curr.length<=n;)l.next()}return Wl(o),wc(a,Tc(s)),a.toUint8Array()},hee=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:Wi(e.encoder.restEncoder)}),e.encoder.restEncoder=Hi(),e.written=0)},Ul=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&hee(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),Ji(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},Wl=e=>{hee(e);let t=e.encoder.restEncoder;Ji(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){let r=e.clientStructs[n];Ji(t,r.written),$i(t,r.restEncoder)}},Gl=(e,t,n,r)=>{let i=new n(ba(e)),a=new zl(i,!1),o=new r,s=new Bl(o);for(let e=a.curr;e!==null;e=a.next())Ul(s,t(e),0);return Wl(s),wc(o,Tc(i)),o.toUint8Array()},gee=e=>Gl(e,co,Mc,Pc),_ee=`You must not compute changes after the event-handler fired.`,Kl=class{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||=vee(this.currentTarget,this.target)}deletes(e){return vc(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw ma(_ee);let e=new Map,t=this.target;this.transaction.changed.get(t).forEach(n=>{if(n!==null){let r=t._map.get(n),i,a;if(this.adds(r)){let e=r.left;for(;e!==null&&this.adds(e);)e=e.left;if(this.deletes(r))if(e!==null&&this.deletes(e))i=`delete`,a=fi(e.content.getContent());else return;else e!==null&&this.deletes(e)?(i=`update`,a=fi(e.content.getContent())):(i=`add`,a=void 0)}else if(this.deletes(r))i=`delete`,a=fi(r.content.getContent());else return;e.set(n,{action:i,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw ma(_ee);let t=this.target,n=di(),r=di(),i=[];if(e={added:n,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null,a=()=>{e&&i.push(e)};for(let i=t._start;i!==null;i=i.right)i.deleted?this.deletes(i)&&!this.adds(i)&&((e===null||e.delete===void 0)&&(a(),e={delete:0}),e.delete+=i.length,r.add(i)):this.adds(i)?((e===null||e.insert===void 0)&&(a(),e={insert:[]}),e.insert=e.insert.concat(i.content.getContent()),n.add(i)):((e===null||e.retain===void 0)&&(a(),e={retain:0}),e.retain+=i.length);e!==null&&e.retain===void 0&&a()}this._changes=e}return e}},vee=(e,t)=>{let n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(e+=r.length),r=r.right;n.unshift(e)}t=t._item.parent}return n},ql=()=>{lc(`Invalid access: Add Yjs type to a document before reading data.`)},Jl=80,Yl=0,yee=class{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=Yl++}},Xl=e=>{e.timestamp=Yl++},Zl=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=Yl++},Ql=(e,t,n)=>{if(e.length>=Jl){let r=e.reduce((e,t)=>e.timestamp<t.timestamp?e:t);return Zl(r,t,n),r}else{let r=new yee(t,n);return e.push(r),r}},$l=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;let n=e._searchMarker.length===0?null:e._searchMarker.reduce((e,n)=>Si(t-e.index)<Si(t-n.index)?e:n),r=e._start,i=0;for(n!==null&&(r=n.p,i=n.index,Xl(n));r.right!==null&&i<t;){if(!r.deleted&&r.countable){if(t<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>t;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&Si(n.index-i)<r.parent.length/Jl?(Zl(n,r,i),n):Ql(e._searchMarker,r,i)},eu=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){let i=e[r];if(n>0){let t=i.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(i.index-=t.length);if(t===null||t.marker===!0){e.splice(r,1);continue}i.p=t,t.marker=!0}(t<i.index||n>0&&t===i.index)&&(i.index=wi(t,i.index+n))}},tu=(e,t,n)=>{let r=e,i=t.changedParentTypes;for(;ci(i,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;el(r._eH,n,t)},nu=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Zc(),this._dEH=Zc(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw ha()}clone(){throw ha()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){Qc(this._eH,e)}observeDeep(e){Qc(this._dEH,e)}unobserve(e){$c(this._eH,e)}unobserveDeep(e){$c(this._dEH,e)}toJSON(){}},ru=(e,t,n)=>{e.doc??ql(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t,i=[],a=e._start;for(;a!==null&&r>0;){if(a.countable&&!a.deleted){let e=a.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)i.push(e[n]),r--;t=0}}a=a.right}return i},iu=e=>{e.doc??ql();let t=[],n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){let e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},au=(e,t)=>{let n=[],r=e._start;for(;r!==null;){if(r.countable&&vl(r,t)){let e=r.content.getContent();for(let t=0;t<e.length;t++)n.push(e[t])}r=r.right}return n},ou=(e,t)=>{let n=0,r=e._start;for(e.doc??ql();r!==null;){if(r.countable&&!r.deleted){let i=r.content.getContent();for(let r=0;r<i.length;r++)t(i[r],n++,e)}r=r.right}},su=(e,t)=>{let n=[];return ou(e,(r,i)=>{n.push(t(r,i,e))}),n},cu=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}let e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},lu=(e,t)=>{e.doc??ql();let n=$l(e,t),r=e._start;for(n!==null&&(r=n.p,t-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},uu=(e,t,n,r)=>{let i=n,a=e.doc,o=a.clientID,s=a.store,l=n===null?t._start:n.right,u=[],d=()=>{u.length>0&&(i=new id(rl(o,xl(s,o)),i,i&&i.lastId,l,l&&l.id,t,null,new Yu(u)),i.integrate(e,0),u=[])};r.forEach(n=>{if(n===null)u.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:u.push(n);break;default:switch(d(),n.constructor){case Uint8Array:case ArrayBuffer:i=new id(rl(o,xl(s,o)),i,i&&i.lastId,l,l&&l.id,t,null,new Bu(new Uint8Array(n))),i.integrate(e,0);break;case Oc:i=new id(rl(o,xl(s,o)),i,i&&i.lastId,l,l&&l.id,t,null,new Uu(n)),i.integrate(e,0);break;default:if(n instanceof nu)i=new id(rl(o,xl(s,o)),i,i&&i.lastId,l,l&&l.id,t,null,new $u(n)),i.integrate(e,0);else throw Error(`Unexpected content type in insert operation`)}}}),d()},du=()=>ma(`Length exceeded!`),fu=(e,t,n,r)=>{if(n>t._length)throw du();if(n===0)return t._searchMarker&&eu(t._searchMarker,n,r.length),uu(e,t,null,r);let i=n,a=$l(t,n),o=t._start;for(a!==null&&(o=a.p,n-=a.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&El(e,rl(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&eu(t._searchMarker,i,r.length),uu(e,t,o,r)},bee=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((e,t)=>t.index>e.index?t:e,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return uu(e,t,r,n)},pu=(e,t,n,r)=>{if(r===0)return;let i=n,a=r,o=$l(t,n),s=t._start;for(o!==null&&(s=o.p,n-=o.index);s!==null&&n>0;s=s.right)!s.deleted&&s.countable&&(n<s.length&&El(e,rl(s.id.client,s.id.clock+n)),n-=s.length);for(;r>0&&s!==null;)s.deleted||(r<s.length&&El(e,rl(s.id.client,s.id.clock+r)),s.delete(e),r-=s.length),s=s.right;if(r>0)throw du();t._searchMarker&&eu(t._searchMarker,i,-a+r)},mu=(e,t,n)=>{let r=t._map.get(n);r!==void 0&&r.delete(e)},hu=(e,t,n,r)=>{let i=t._map.get(n)||null,a=e.doc,o=a.clientID,s;if(r==null)s=new Yu([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:s=new Yu([r]);break;case Uint8Array:s=new Bu(r);break;case Oc:s=new Uu(r);break;default:if(r instanceof nu)s=new $u(r);else throw Error(`Unexpected content type`)}new id(rl(o,xl(a.store,o)),i,i&&i.lastId,null,null,t,n,s).integrate(e,0)},gu=(e,t)=>{e.doc??ql();let n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},_u=e=>{let t={};return e.doc??ql(),e._map.forEach((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])}),t},vu=(e,t)=>{e.doc??ql();let n=e._map.get(t);return n!==void 0&&!n.deleted},xee=(e,t)=>{let n={};return e._map.forEach((e,r)=>{let i=e;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&vl(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},yu=e=>(e.doc??ql(),fc(e._map.entries(),e=>!e[1].deleted)),bu=class extends Kl{},xu=class e extends nu{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){let n=new e;return n.push(t),n}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof nu?e.clone():e)),t}get length(){return this.doc??ql(),this._length}_callObserver(e,t){super._callObserver(e,t),tu(this,e,new bu(this,e))}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):Pl(this.doc,n=>{fu(n,this,e,t)})}push(e){this.doc===null?this._prelimContent.push(...e):Pl(this.doc,t=>{bee(t,this,e)})}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):Pl(this.doc,n=>{pu(n,this,e,t)})}get(e){return lu(this,e)}toArray(){return iu(this)}slice(e=0,t=this.length){return ru(this,e,t)}toJSON(){return this.map(e=>e instanceof nu?e.toJSON():e)}map(e){return su(this,e)}forEach(e){ou(this,e)}[Symbol.iterator](){return cu(this)}_write(e){e.writeTypeRef(qee)}},See=e=>new xu,Cee=class extends Kl{constructor(e,t,n){super(e,t),this.keysChanged=n}},Su=class e extends nu{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((e,t)=>{this.set(t,e)}),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return this.forEach((e,n)=>{t.set(n,e instanceof nu?e.clone():e)}),t}_callObserver(e,t){tu(this,e,new Cee(this,e,t))}toJSON(){this.doc??ql();let e={};return this._map.forEach((t,n)=>{if(!t.deleted){let r=t.content.getContent()[t.length-1];e[n]=r instanceof nu?r.toJSON():r}}),e}get size(){return[...yu(this)].length}keys(){return pc(yu(this),e=>e[0])}values(){return pc(yu(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return pc(yu(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??ql(),this._map.forEach((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc===null?this._prelimContent.delete(e):Pl(this.doc,t=>{mu(t,this,e)})}set(e,t){return this.doc===null?this._prelimContent.set(e,t):Pl(this.doc,n=>{hu(n,this,e,t)}),t}get(e){return gu(this,e)}has(e){return vu(this,e)}clear(){this.doc===null?this._prelimContent.clear():Pl(this.doc,e=>{this.forEach(function(t,n,r){mu(e,r,n)})})}_write(e){e.writeTypeRef(Zu)}},wee=e=>new Su,Cu=(e,t)=>e===t||typeof e==`object`&&typeof t==`object`&&e&&t&&io(e,t),Tee=class{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){switch(this.right===null&&ga(),this.right.content.constructor){case Gu:this.right.deleted||Tu(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}},Eee=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case Gu:t.right.deleted||Tu(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&El(e,rl(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length);break}t.left=t.right,t.right=t.right.right}return t},wu=(e,t,n,r)=>{let i=new Map,a=r?$l(t,n):null;return a?Eee(e,new Tee(a.p.left,a.p,a.index,i),n-a.index):Eee(e,new Tee(null,t._start,0,i),n)},Dee=(e,t,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===Gu&&Cu(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();let i=e.doc,a=i.clientID;r.forEach((r,o)=>{let s=n.left,l=n.right,u=new id(rl(a,xl(i.store,a)),s,s&&s.lastId,l,l&&l.id,t,null,new Gu(o,r));u.integrate(e,0),n.right=u,n.forward()})},Tu=(e,t)=>{let{key:n,value:r}=t;r===null?e.delete(n):e.set(n,r)},Oee=(e,t)=>{for(;e.right!==null&&(e.right.deleted||e.right.content.constructor===Gu&&Cu(t[e.right.content.key]??null,e.right.content.value));)e.forward()},kee=(e,t,n,r)=>{let i=e.doc,a=i.clientID,o=new Map;for(let s in r){let l=r[s],u=n.currentAttributes.get(s)??null;if(!Cu(u,l)){o.set(s,u);let{left:r,right:d}=n;n.right=new id(rl(a,xl(i.store,a)),r,r&&r.lastId,d,d&&d.id,t,null,new Gu(s,l)),n.right.integrate(e,0),n.forward()}}return o},Aee=(e,t,n,r,i)=>{n.currentAttributes.forEach((e,t)=>{i[t]===void 0&&(i[t]=null)});let a=e.doc,o=a.clientID;Oee(n,i);let s=kee(e,t,n,i),l=r.constructor===String?new Xu(r):r instanceof nu?new $u(r):new Wu(r),{left:u,right:d,index:f}=n;t._searchMarker&&eu(t._searchMarker,n.index,l.getLength()),d=new id(rl(o,xl(a.store,o)),u,u&&u.lastId,d,d&&d.id,t,null,l),d.integrate(e,0),n.right=d,n.index=f,n.forward(),Dee(e,t,n,s)},jee=(e,t,n,r,i)=>{let a=e.doc,o=a.clientID;Oee(n,i);let s=kee(e,t,n,i);iterationLoop:for(;n.right!==null&&(r>0||s.size>0&&(n.right.deleted||n.right.content.constructor===Gu));){if(!n.right.deleted)switch(n.right.content.constructor){case Gu:{let{key:t,value:a}=n.right.content,o=i[t];if(o!==void 0){if(Cu(o,a))s.delete(t);else{if(r===0)break iterationLoop;s.set(t,a)}n.right.delete(e)}else n.currentAttributes.set(t,a);break}default:r<n.right.length&&El(e,rl(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let i=``;for(;r>0;r--)i+=`
11
21
  `;n.right=new id(rl(o,xl(a.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new Xu(i)),n.right.integrate(e,0),n.forward()}Dee(e,t,n,s)},Mee=(e,t,n,r,i)=>{let a=t,o=oi();for(;a&&(!a.countable||a.deleted);){if(!a.deleted&&a.content.constructor===Gu){let e=a.content;o.set(e.key,e)}a=a.right}let s=0,l=!1;for(;t!==a;){if(n===t&&(l=!0),!t.deleted){let n=t.content;switch(n.constructor){case Gu:{let{key:a,value:u}=n,d=r.get(a)??null;(o.get(a)!==n||d===u)&&(t.delete(e),s++,!l&&(i.get(a)??null)===u&&d!==u&&(d===null?i.delete(a):i.set(a,d))),!l&&!t.deleted&&Tu(i,n);break}}}t=t.right}return s},Nee=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;let n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===Gu){let r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},Eu=e=>{let t=0;return Pl(e.doc,n=>{let r=e._start,i=e._start,a=oi(),o=si(a);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case Gu:Tu(o,i.content);break;default:t+=Mee(n,r,i,a,o),a=si(o),r=i;break}i=i.right}}),t},Du=e=>{let t=new Set,n=e.doc;for(let[r,i]of e.afterState.entries()){let a=e.beforeState.get(r)||0;i!==a&&lee(e,n.store.clients.get(r),a,i,e=>{!e.deleted&&e.content.constructor===Gu&&e.constructor!==zu&&t.add(e.parent)})}Pl(n,n=>{gc(e,e.deleteSet,e=>{if(e instanceof zu||!e.parent._hasFormatting||t.has(e.parent))return;let r=e.parent;e.content.constructor===Gu?t.add(r):Nee(n,e)});for(let e of t)Eu(e)})},Pee=(e,t,n)=>{let r=n,i=si(t.currentAttributes),a=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case $u:case Wu:case Xu:n<t.right.length&&El(e,rl(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}a&&Mee(e,a,t.right,i,t.currentAttributes);let o=(t.left||t.right).parent;return o._searchMarker&&eu(o._searchMarker,t.index,-r+n),t},Ou=class extends Kl{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(e=>{e===null?this.childListChanged=!0:this.keysChanged.add(e)})}get changes(){if(this._changes===null){let e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){let e=this.target.doc,t=[];Pl(e,e=>{let n=new Map,r=new Map,i=this.target._start,a=null,o={},s=``,l=0,u=0,d=()=>{if(a!==null){let e=null;switch(a){case`delete`:u>0&&(e={delete:u}),u=0;break;case`insert`:(typeof s==`object`||s.length>0)&&(e={insert:s},n.size>0&&(e.attributes={},n.forEach((t,n)=>{t!==null&&(e.attributes[n]=t)}))),s=``;break;case`retain`:l>0&&(e={retain:l},to(o)||(e.attributes=Xa({},o))),l=0;break}e&&t.push(e),a=null}};for(;i!==null;){switch(i.content.constructor){case $u:case Wu:this.adds(i)?this.deletes(i)||(d(),a=`insert`,s=i.content.getContent()[0],d()):this.deletes(i)?(a!==`delete`&&(d(),a=`delete`),u+=1):i.deleted||(a!==`retain`&&(d(),a=`retain`),l+=1);break;case Xu:this.adds(i)?this.deletes(i)||(a!==`insert`&&(d(),a=`insert`),s+=i.content.str):this.deletes(i)?(a!==`delete`&&(d(),a=`delete`),u+=i.length):i.deleted||(a!==`retain`&&(d(),a=`retain`),l+=i.length);break;case Gu:{let{key:t,value:s}=i.content;if(this.adds(i))this.deletes(i)||(Cu(n.get(t)??null,s)?s!==null&&i.delete(e):(a===`retain`&&d(),Cu(s,r.get(t)??null)?delete o[t]:o[t]=s));else if(this.deletes(i)){r.set(t,s);let e=n.get(t)??null;Cu(e,s)||(a===`retain`&&d(),o[t]=e)}else if(!i.deleted){r.set(t,s);let n=o[t];n!==void 0&&(Cu(n,s)?n!==null&&i.delete(e):(a===`retain`&&d(),s===null?delete o[t]:o[t]=s))}i.deleted||(a===`insert`&&d(),Tu(n,i.content));break}}i=i.right}for(d();t.length>0;){let e=t[t.length-1];if(e.retain!==void 0&&e.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}},ku=class e extends nu{constructor(e){super(),this._pending=e===void 0?[]:[()=>this.insert(0,e)],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??ql(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(e=>e())}catch(e){console.error(e)}this._pending=null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}_callObserver(e,t){super._callObserver(e,t);let n=new Ou(this,e,t);tu(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??ql();let e=``,t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===Xu&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc===null?this._pending.push(()=>this.applyDelta(e)):Pl(this.doc,n=>{let r=new Tee(null,this._start,0,new Map);for(let i=0;i<e.length;i++){let a=e[i];if(a.insert!==void 0){let o=!t&&typeof a.insert==`string`&&i===e.length-1&&r.right===null&&a.insert.slice(-1)===`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chaulapatrice/richtext-editor",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "author": "Patrice Chaula",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,8 +37,8 @@
37
37
  },
38
38
  "peerDependencies": {
39
39
  "lexical": "0.39.0",
40
- "react": "^19.1.1",
41
- "react-dom": "^19.1.1"
40
+ "react": "^18",
41
+ "react-dom": "^18"
42
42
  },
43
43
  "dependencies": {
44
44
  "@excalidraw/excalidraw": "^0.18.0",
@@ -71,8 +71,8 @@
71
71
  },
72
72
  "devDependencies": {
73
73
  "lexical": "0.39.0",
74
- "react": "^19.1.1",
75
- "react-dom": "^19.1.1",
74
+ "react": "^18",
75
+ "react-dom": "^18",
76
76
  "@babel/plugin-transform-flow-strip-types": "^7.24.7",
77
77
  "@babel/preset-react": "^7.24.7",
78
78
  "@prettier/sync": "^0.6.1",