superrfjs
Version:
12 lines • 623 kB
JavaScript
/*!
*
* SpreadJS Library 17.0.7
*
* Copyright(c) MESCIUS inc. All rights reserved.
*
* Licensed under the SpreadJS Commercial License.
* us.sales@mescius.com
* https://developer.mescius.com/spreadjs
*
*/
!function (t) { "object" == typeof module && "object" == typeof module.exports ? module.exports = t(require("@mescius/spread-sheets")) : "function" == typeof define && define.amd ? define(["@mescius/spread-sheets"], t) : "object" == typeof exports ? exports.Spread = t(require("@mescius/spread-sheets")) : t(GC) }(function (n) { !function () { "use strict"; var i, e, t; function r(t) { var n, n, n = e[t]; return void 0 !== n || (n = e[t] = { exports: {} }, i[t].call(n.exports, n, n.exports, r)), n.exports } i = { "./dist/plugins/formulaPanel/editor/codemirror/index.js": function (T, L) { var k, B, _, N, U, H, W, V, $, q, G, h, J, K, Q, X, O, Z, y, Y, tt, b, nt, it, et, rt, ot, ut, st, at, ft, ht, ct, lt, vt, dt, yt, mt, pt, kt, gt, wt, bt, v, Mt, xt, l, St, Ct, C, jt, Pt, Ot, j, Et, At, Dt, Rt, It, Tt, Lt, Bt, _t, Ft, Nt, Ut, Ht, zt, t, n, Wt, Vt, i, $t, qt, Gt, Jt, Kt, Qt, c, Xt, n, t, Zt, e, Yt, tn, nn, en, r, o, u, g, rn, on, un, sn, an, fn, tn, P, m, hn, cn, ln, vn, dn, yn, mn, pn, kn, gn, wn, bn, Mn, xn, Sn, Cn, jn, Pn, On, En, An, d, Dn, Rn, In, Tn, Ln, Bn, _n, Fn, Nn, E, Un, Hn, zn, Wn, Vn, $n, qn, Gn, Jn, Kn, Jn, Qn, Xn, z, Zn, Yn, ti, ni, ii, ei, ri, oi, ui, si, ai, fi, hi, ci, s, li, vi, di, yi, mi, pi, ki, gi, wi, bi, Mi, xi, Si, Ci, p, ji, Pi, Oi, Ei, Ai, Di, Ri, Ii, Ti, Li, Bi, _i, Fi, Ni, Ui, Hi, zi, Wi, Vi, $i, qi, Gi, Ji, Ki, Qi, Xi, w, Zi, Yi, te, ne, e, ie, ee, re, oe, ue, se, ae, fe, he, ce, le, Yt, ve, de, ye, me, pe, ke, ge, we, be, Me, xe, Se, Ce, je, Pe, Oe, Ee, Ae, De, Re, Ie, Te, Le, Be, _e, Fe, Zt, Ne, Ue, He, ze, We, Ve, $e, nn, qe, Ge, Je, Ke, en, Qe, Xe, Ze, Ye, tr, nr, ir, er, rr, or, ur, sr, ar, fr, hr, cr, lr, u, vr, dr, yr, mr, M, pr, kr, n, gr, wr, br, x, Mr, xr, Sr, Cr, jr, Pr, Or, Er, Ar, Dr, Rr, Ir, Tr, Lr, Br, _r, Fr, r, t, e, Yt, Zt, u, nn, o, Nr, Ur, Hr, zr, Wr, Vr, $r, a, Yt, qr, Gr, Jr, t, Kr, Qr, Xr, Zr, Yr, to, no, io, Zt, e, eo, ro, oo, uo, so, nn, ao, fo, ho, co, lo, vo, u, Hr, zr, Wr, o, yo, mo, po, ko, go, wo, bo, Mo, xo, So, Vr, Co, jo, Ur, Po, Oo, Eo, Ao, Do, Ro, Io, To, Lo, Bo, Nr, _o, Fo, No, Uo, Ho, zo, Wo, Vo, $o, qo, $o, Go, Jo, Ko, Qo, Xo, Zo, Yo, tu, nu, iu, eu, r, $r, Yt, ru, ou, uu, su, au, fu, hu, cu, lu, vu, du, yu, mu, pu, ku, gu, wu, bu, Mu, xu, Su, Cu, ju, Pu, Ou, n, Vr, Ur, Eu, Au, Du, Ru, Iu, t, Tu, Lu, Bu, _u, Fu, Nu, Uu, e, Hu, zu, Wu, Vu, $u, Wr, qu, Zt, Nr, nn, zr, u, Gu, Ju, Ku, Qu, Xu, Zu, Yu, o, ts, ns, Hr, jt, r, n, is, es, rs, os, us, ss, as, fs, hs, cs, ls, vs, ds, ys, ms, ps, Yt, e, ks, gs, ws, bs, Ms, xs, Ss, Cs, js, Ps, Os, Es, As, Ds, Rs, Is, Ts, Ls, Bs, _s, Fs, Ns, t, Vr, Us, Hs, zs, Ws, Vs, $s, qs, Gs, Js, Ks, Qs, Xs, Zs, Ys, ta, na, ia, ea, ra, oa, ua, sa, aa, fa, ha, ca, la, va, da, Ur, ya, $r, ma, pa, ka, ga, wa, ba, Ma, xa, Sa, Ca, ja, Pa, Oa, Ea, Aa, Da, Ra, Ia, Ta, La, Ba, zr, _a, u, Fa, Na, Ua, Ha, za, Wa, ma, Va, $a, qa, Ga, Ja, Ka, Qa, Xa, Za, Ya, tf, nf, ef, rf, of, uf, sf, af, ff, $r, hf, cf, lf, vf, df, yf, mf, pf, as, kf, gf, fs, wf, bf, Mf, xf, Sf, Cf, jf, Pf, Xs, Of, Ef, Af, Qs, Df, Rf, If, Tf, Lf, Bf, _f, Ff, ls, Nf, Uf, Hf, o; function zf(t, n, i) { return (n = ah(n)) in t ? Object.defineProperty(t, n, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = i, t } function Wf(t) { return qf(t) || $f(t) || Xf(t) || Vf() } function Vf() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } function $f(t) { if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t) } function qf(t) { if (Array.isArray(t)) return Zf(t) } function Gf(t, n) { return Qf(t) || Kf(t, n) || Xf(t, n) || Jf() } function Jf() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } function Kf(t, n) { var i, e, r, o, u, s, a, f, i = null == t ? null : "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"]; if (null != i) { s = [], f = !(a = !0); try { if (o = (i = i.call(t)).next, 0 === n) { if (Object(i) !== i) return; a = !1 } else for (; !(a = (e = o.call(i)).done) && (s.push(e.value), s.length !== n); a = !0); } catch (t) { f = !0, r = t } finally { try { if (!a && null != i.return && (u = i.return(), Object(u) !== u)) return } finally { if (f) throw r } } return s } } function Qf(t) { if (Array.isArray(t)) return t } function F(n, t) { var i, e, t, r, o, u, i = "undefined" != typeof Symbol && n[Symbol.iterator] || n["@@iterator"]; if (i) return o = !(r = !0), { s: function t() { i = i.call(n) }, n: function t() { var n = i.next(); return r = n.done, n }, e: function t(n) { o = !0, u = n }, f: function t() { try { r || null == i.return || i.return() } finally { if (o) throw u } } }; if (Array.isArray(n) || (i = Xf(n)) || t && n && "number" == typeof n.length) return i && (n = i), e = 0, { s: t = function t() { }, n: function t() { return e >= n.length ? { done: !0 } : { done: !1, value: n[e++] } }, e: function t(n) { throw n }, f: t }; throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } function Xf(t, n) { var i; if (t) return "string" == typeof t ? Zf(t, n) : "Map" === (i = "Object" === (i = Object.prototype.toString.call(t).slice(8, -1)) && t.constructor ? t.constructor.name : i) || "Set" === i ? Array.from(t) : "Arguments" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ? Zf(t, n) : void 0 } function Zf(t, n) { (null == n || n > t.length) && (n = t.length); for (var i = 0, e = new Array(n); i < n; i++)e[i] = t[i]; return e } function Yf() { return (Yf = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function t(n, i, e) { var r, r, r = th(n, i); if (r) return (r = Object.getOwnPropertyDescriptor(r, i)).get ? r.get.call(arguments.length < 3 ? n : e) : r.value }).apply(this, arguments) } function th(t, n) { for (; !Object.prototype.hasOwnProperty.call(t, n) && null !== (t = oh(t));); return t } function f(t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(n && n.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), n && nh(t, n) } function nh(t, n) { return (nh = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function t(n, i) { return n.__proto__ = i, n })(t, n) } function S(e) { var r = rh(); return function t() { var n, i, i, n = oh(e), i = r ? (i = oh(this).constructor, Reflect.construct(n, arguments, i)) : n.apply(this, arguments); return ih(this, i) } } function ih(t, n) { if (n && ("object" === uh(n) || "function" == typeof n)) return n; if (void 0 !== n) throw new TypeError("Derived constructors may only return object or undefined"); return eh(t) } function eh(t) { if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return t } function rh() { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () { })), !0 } catch (t) { return !1 } } function oh(t) { return (oh = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function t(n) { return n.__proto__ || Object.getPrototypeOf(n) })(t) } function uh(t) { return (uh = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t })(t) } function A(t, n) { if (!(t instanceof n)) throw new TypeError("Cannot call a class as a function") } function sh(t, n) { for (var i, e, i = 0; i < n.length; i++)(e = n[i]).enumerable = e.enumerable || !1, e.configurable = !0, "value" in e && (e.writable = !0), Object.defineProperty(t, ah(e.key), e) } function D(t, n, i) { return n && sh(t.prototype, n), i && sh(t, i), Object.defineProperty(t, "prototype", { writable: !1 }), t } function ah(t) { var t = fh(t, "string"); return "symbol" === uh(t) ? t : String(t) } function fh(t, n) { var i, i; if ("object" !== uh(t) || null === t) return t; if (void 0 === (i = t[Symbol.toPrimitive])) return ("string" === n ? String : Number)(t); if ("object" !== uh(i = i.call(t, n || "default"))) return i; throw new TypeError("@@toPrimitive must return a primitive value.") } function hh(t) { var n, i, e, r, n = -1, i = F(t); try { for (i.s(); !(e = i.n()).done;)n += (r = e.value).length + 1 } catch (t) { i.e(t) } finally { i.f() } return n } function ch(t, n, i, e) { for (var r, o, u, s, a, f, h, r = 2 < arguments.length && void 0 !== i ? i : 0, o = 3 < arguments.length && void 0 !== e ? e : 1e9, u = 0, s = 0, a = !0; s < t.length && u <= o; s++)r <= (h = u + (f = t[s]).length) && (o < h && (f = f.slice(0, o - u)), u < r && (f = f.slice(r - u)), a ? (n[n.length - 1] += f, a = !1) : n.push(f)), u = h + 1; return n } function lh(t, n, i) { return ch(t, [""], n, i) } for (Object.defineProperty(L, "__esModule", { value: !0 }), L.basicSetup = L.View = L.State = L.Search = L.Lint = L.Language = L.Commands = L.Autocomplete = void 0, B = function (t) { f(a, t); var e = S(a); function a(t) { var n, i, i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : hh(t); return A(this, a), (n = e.call(this)).text = t, n.length = i, n } return D(a, [{ key: "lines", get: function t() { return this.text.length } }, { key: "children", get: function t() { return null } }, { key: "lineInner", value: function t(n, i, e, r) { for (var o, u, s, o = 0; ; o++) { if (s = r + (u = this.text[o]).length, n <= (i ? e : s)) return new W(r, s, e, u); r = s + 1, e++ } } }, { key: "decompose", value: function t(n, i, e, r) { var i, n, r, n, i = n <= 0 && i >= this.length ? this : new a(lh(this.text, n, i), Math.min(i, this.length) - Math.max(0, n)); 1 & r ? (n = e.pop(), (r = ch(i.text, n.text.slice(), 0, i.length)).length <= 32 ? e.push(new a(r, n.length + i.length)) : (n = r.length >> 1, e.push(new a(r.slice(0, n)), new a(r.slice(n))))) : e.push(i) } }, { key: "replace", value: function t(n, i, e) { var r, o; return e instanceof a ? (r = ch(this.text, ch(e.text, lh(this.text, 0, n)), i), o = this.length + e.length - (i - n), r.length <= 32 ? new a(r, o) : _.from(a.split(r, []), o)) : Yf(oh(a.prototype), "replace", this).call(this, n, i, e) } }, { key: "sliceString", value: function t(n) { for (var i, e, r, o, u, s, a, i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : this.length, e = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : "\n", r = "", o = 0, u = 0; o <= i && u < this.text.length; u++)n < o && u && (r += e), n < (a = o + (s = this.text[u]).length) && o < i && (r += s.slice(Math.max(0, n - o), i - o)), o = a + 1; return r } }, { key: "flatten", value: function t(n) { var i, e, r, i = F(this.text); try { for (i.s(); !(e = i.n()).done;)r = e.value, n.push(r) } catch (t) { i.e(t) } finally { i.f() } } }, { key: "scanIdentical", value: function t() { return 0 } }], [{ key: "split", value: function t(n, i) { var e, r, o, u, s, e = [], r = -1, o = F(n); try { for (o.s(); !(u = o.n()).done;)s = u.value, e.push(s), r += s.length + 1, 32 == e.length && (i.push(new a(e, r)), e = [], r = -1) } catch (t) { o.e(t) } finally { o.f() } return -1 < r && i.push(new a(e, r)), i } }]), a }(k = function () { function i() { A(this, i) } return D(i, [{ key: "lineAt", value: function t(n) { if (n < 0 || n > this.length) throw new RangeError("Invalid position ".concat(n, " in document of length ").concat(this.length)); return this.lineInner(n, !1, 1, 0) } }, { key: "line", value: function t(n) { if (n < 1 || n > this.lines) throw new RangeError("Invalid line number ".concat(n, " in ").concat(this.lines, "-line document")); return this.lineInner(n, !0, 1, 0) } }, { key: "replace", value: function t(n, i, e) { var r = []; return this.decompose(0, n, r, 2), e.length && e.decompose(0, e.length, r, 3), this.decompose(i, this.length, r, 1), _.from(r, this.length - (i - n) + e.length) } }, { key: "append", value: function t(n) { return this.replace(this.length, this.length, n) } }, { key: "slice", value: function t(n) { var i, e, i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : this.length, e = []; return this.decompose(n, i, e, 0), _.from(e, i - n) } }, { key: "eq", value: function t(n) { var i, e, r, o, u, s; if (n == this) return !0; if (n.length != this.length || n.lines != this.lines) return !1; for (i = this.scanIdentical(n, 1), e = this.length - this.scanIdentical(n, -1), r = new N(this), o = new N(n), s = u = i; ;) { if (r.next(u), o.next(u), u = 0, r.lineBreak != o.lineBreak || r.done != o.done || r.value != o.value) return !1; if (s += r.value.length, r.done || e <= s) return !0 } } }, { key: "iter", value: function t() { var n; return new N(this, 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 1) } }, { key: "iterRange", value: function t(n) { var i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : this.length; return new U(this, n, i) } }, { key: "iterLines", value: function t(n, i) { var n, n, n = null == n ? this.iter() : (null == i && (i = this.lines + 1), n = this.line(n).from, this.iterRange(n, Math.max(n, i == this.lines + 1 ? this.length : i <= 1 ? 0 : this.line(i - 1).to))); return new H(n) } }, { key: "toString", value: function t() { return this.sliceString(0) } }, { key: "toJSON", value: function t() { var n = []; return this.flatten(n), n } }], [{ key: "of", value: function t(n) { if (0 == n.length) throw new RangeError("A document must have at least one line"); return 1 != n.length || n[0] ? n.length <= 32 ? new B(n) : _.from(B.split(n, [])) : i.empty } }]), i }()), _ = function (t) { f(x, t); var u = S(x); function x(t, n) { var i, e, r, o; A(this, x), (i = u.call(this)).children = t, i.length = n, i.lines = 0, e = F(t); try { for (e.s(); !(r = e.n()).done;)o = r.value, i.lines += o.lines } catch (t) { e.e(t) } finally { e.f() } return i } return D(x, [{ key: "lineInner", value: function t(n, i, e, r) { for (var o, u, s, a, o = 0; ; o++) { if (s = r + (u = this.children[o]).length, a = e + u.lines - 1, n <= (i ? a : s)) return u.lineInner(n, i, e, r); r = s + 1, e = 1 + a } } }, { key: "decompose", value: function t(n, i, e, r) { for (var o, u, s, a, f, o = 0, u = 0; u <= i && o < this.children.length; o++)n <= (a = u + (s = this.children[o]).length) && u <= i && (f = r & ((u <= n ? 1 : 0) | (i <= a ? 2 : 0)), n <= u && a <= i && !f ? e.push(s) : s.decompose(n - u, i - u, e, f)), u = a + 1 } }, { key: "replace", value: function t(n, i, e) { var r, o, u, s, a, u, u; if (e.lines < this.lines) for (o = r = 0; r < this.children.length; r++) { if (s = o + (u = this.children[r]).length, o <= n && i <= s) return a = u.replace(n - o, i - o, e), u = this.lines - u.lines + a.lines, a.lines < u >> 4 && a.lines > u >> 6 ? ((u = this.children.slice())[r] = a, new x(u, this.length - (i - n) + e.length)) : Yf(oh(x.prototype), "replace", this).call(this, o, s, a); o = s + 1 } return Yf(oh(x.prototype), "replace", this).call(this, n, i, e) } }, { key: "sliceString", value: function t(n) { for (var i, e, r, o, u, s, a, i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : this.length, e = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : "\n", r = "", o = 0, u = 0; o < this.children.length && u <= i; o++)n < u && o && (r += e), n < (a = u + (s = this.children[o]).length) && u < i && (r += s.sliceString(n - u, i - u, e)), u = a + 1; return r } }, { key: "flatten", value: function t(n) { var i, e, r, i = F(this.children); try { for (i.s(); !(e = i.n()).done;)(r = e.value).flatten(n) } catch (t) { i.e(t) } finally { i.f() } } }, { key: "scanIdentical", value: function t(n, i) { var e, r, o, u, s, a, f, h, c; if (!(n instanceof x)) return 0; for (u = (o = Gf(r = (e = 0) < i ? [0, 0, this.children.length, n.children.length] : [this.children.length - 1, n.children.length - 1, -1, -1], 4))[0], s = o[1], a = o[2], f = o[3]; ; u += i, s += i) { if (u == a || s == f) return e; if ((h = this.children[u]) != (c = n.children[s])) return e + h.scanIdentical(c, i); e += h.length + 1 } } }], [{ key: "from", value: function t(n) { var i, e, r, o, u, s, a, f, h, c, l, v, d, y, m, p, k, g, w, i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : n.reduce(function (t, n) { return t + n.length + 1 }, -1), e = 0, r = F(n); try { for (r.s(); !(o = r.n()).done;)e += (u = o.value).lines } catch (t) { r.e(t) } finally { r.f() } if (e < 32) { s = [], a = F(n); try { for (a.s(); !(f = a.n()).done;)(h = f.value).flatten(s) } catch (t) { a.e(t) } finally { a.f() } return new B(s, i) } function b(t) { var n, i, e, r; if (t.lines > l && t instanceof x) { i = F(t.children); try { for (i.s(); !(e = i.n()).done;)b(r = e.value) } catch (t) { i.e(t) } finally { i.f() } } else t.lines > v && (v < y || !y) ? (M(), d.push(t)) : t instanceof B && y && (n = p[p.length - 1]) instanceof B && t.lines + n.lines <= 32 ? (y += t.lines, m += t.length + 1, p[p.length - 1] = new B(n.text.concat(t.text), n.length + 1 + t.length)) : (y + t.lines > c && M(), y += t.lines, m += t.length + 1, p.push(t)) } function M() { 0 != y && (d.push(1 == p.length ? p[0] : x.from(p, m)), m = -1, y = p.length = 0) } c = Math.max(32, e >> 5), l = c << 1, v = c >> 1, d = [], y = 0, m = -1, p = [], k = F(n); try { for (k.s(); !(g = k.n()).done;)b(w = g.value) } catch (t) { k.e(t) } finally { k.f() } return M(), 1 == d.length ? d[0] : new x(d, i) } }]), x }(k), k.empty = new B([""], 0), N = function () { function i(t) { var n = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 1; A(this, i), this.dir = n, this.done = !1, this.lineBreak = !1, this.value = "", this.nodes = [t], this.offsets = [0 < n ? 1 : (t instanceof B ? t.text : t.children).length << 1] } return D(i, [{ key: "nextInner", value: function t(n, i) { var e, r, o, u, s, s, o; for (this.done = this.lineBreak = !1; ;)if (e = this.nodes.length - 1, r = this.nodes[e], u = (o = this.offsets[e]) >> 1, s = (r instanceof B ? r.text : r.children).length, u == (0 < i ? s : 0)) { if (0 == e) return this.done = !0, this.value = "", this; 0 < i && this.offsets[e - 1]++, this.nodes.pop(), this.offsets.pop() } else if ((1 & o) == (0 < i ? 0 : 1)) { if (this.offsets[e] += i, 0 == n) return this.lineBreak = !0, this.value = "\n", this; n-- } else if (r instanceof B) { if (s = r.text[u + (i < 0 ? -1 : 0)], this.offsets[e] += i, s.length > Math.max(0, n)) return this.value = 0 == n ? s : 0 < i ? s.slice(n) : s.slice(0, s.length - n), this; n -= s.length } else n > (o = r.children[u + (i < 0 ? -1 : 0)]).length ? (n -= o.length, this.offsets[e] += i) : (i < 0 && this.offsets[e]--, this.nodes.push(o), this.offsets.push(0 < i ? 1 : (o instanceof B ? o.text : o.children).length << 1)) } }, { key: "next", value: function t() { var n = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0; return n < 0 && (this.nextInner(-n, -this.dir), n = this.value.length), this.nextInner(n, this.dir) } }]), i }(), U = function () { function e(t, n, i) { A(this, e), this.value = "", this.done = !1, this.cursor = new N(t, i < n ? -1 : 1), this.pos = i < n ? t.length : 0, this.from = Math.min(n, i), this.to = Math.max(n, i) } return D(e, [{ key: "nextInner", value: function t(n, i) { var e, r, o; return (i < 0 ? this.pos <= this.from : this.pos >= this.to) ? (this.value = "", this.done = !0) : (n += Math.max(0, i < 0 ? this.pos - this.to : this.from - this.pos), e = i < 0 ? this.pos - this.from : this.to - this.pos, e -= n = e < n ? e : n, o = (r = this.cursor.next(n)).value, this.pos += (o.length + n) * i, this.value = o.length <= e ? o : i < 0 ? o.slice(o.length - e) : o.slice(0, e), this.done = !this.value), this } }, { key: "next", value: function t() { var n = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0; return n < 0 ? n = Math.max(n, this.from - this.pos) : 0 < n && (n = Math.min(n, this.to - this.pos)), this.nextInner(n, this.cursor.dir) } }, { key: "lineBreak", get: function t() { return this.cursor.lineBreak && "" != this.value } }]), e }(), H = function () { function n(t) { A(this, n), this.inner = t, this.afterBreak = !0, this.value = "", this.done = !1 } return D(n, [{ key: "next", value: function t() { var n, i, e, r, i, n, i = this.inner.next(0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0), e = i.done, r = i.lineBreak, i = i.value; return e ? (this.done = !0, this.value = "") : r ? this.afterBreak ? this.value = "" : (this.afterBreak = !0, this.next()) : (this.value = i, this.afterBreak = !1), this } }, { key: "lineBreak", get: function t() { return !1 } }]), n }(), "undefined" != typeof Symbol && (k.prototype[Symbol.iterator] = function () { return this.iter() }, N.prototype[Symbol.iterator] = U.prototype[Symbol.iterator] = H.prototype[Symbol.iterator] = function () { return this }), W = function () { function r(t, n, i, e) { A(this, r), this.from = t, this.to = n, this.number = i, this.text = e } return D(r, [{ key: "length", get: function t() { return this.to - this.from } }]), r }(), V = "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(function (t) { return t ? parseInt(t, 36) : 1 }), $ = 1; $ < V.length; $++)V[$] += V[$ - 1]; function vh(t) { for (var n = 1; n < V.length; n += 2)if (V[n] > t) return V[n - 1] <= t } function dh(t) { return 127462 <= t && t <= 127487 } function yh(t, n) { var i, e, i, e; return (!(2 < arguments.length && void 0 !== arguments[2]) || arguments[2] ? mh : ph)(t, n, !(3 < arguments.length && void 0 !== arguments[3]) || arguments[3]) } function mh(t, n, i) { var e, r, o, u; if (n != t.length) for (n && kh(t.charCodeAt(n)) && gh(t.charCodeAt(n - 1)) && n--, n += Mh(e = wh(t, n)); n < t.length;)if (r = wh(t, n), e == q || r == q || i && vh(r)) n += Mh(r), e = r; else { if (!dh(r)) break; for (o = 0, u = n - 2; 0 <= u && dh(wh(t, u));)o++, u -= 2; if (o % 2 == 0) break; n += 2 } return n } function ph(t, n, i) { for (; 0 < n;) { var e = mh(t, n - 2, i); if (e < n) return e; n-- } return 0 } function kh(t) { return 56320 <= t && t < 57344 } function gh(t) { return 55296 <= t && t < 56320 } function wh(t, n) { var i, t, i = t.charCodeAt(n); return gh(i) && n + 1 != t.length && kh(t = t.charCodeAt(n + 1)) ? t - 56320 + (i - 55296 << 10) + 65536 : i } function bh(t) { return t <= 65535 ? String.fromCharCode(t) : (t -= 65536, String.fromCharCode(55296 + (t >> 10), 56320 + (1023 & t))) } function Mh(t) { return t < 65536 ? 1 : 2 } function xh(t, n, i, e) { var e, r, e = 3 < arguments.length && void 0 !== e && e; 0 == n && i <= 0 || (0 <= (r = t.length - 2) && i <= 0 && i == t[1 + r] ? t[r] += n : 0 == n && 0 == t[r] ? t[1 + r] += i : e ? (t[r] += n, t[1 + r] += i) : t.push(n, i)) } function Sh(t, n, i) { if (0 != i.length) { var e = n.length - 2 >> 1; if (e < t.length) t[t.length - 1] = t[t.length - 1].append(i); else { for (; t.length < e;)t.push(k.empty); t.push(i) } } } function Ch(t, n, i) { for (var e, r, o, u, s, a, f, h, c, e = t.inserted, r = 0, o = 0, u = 0; u < t.sections.length;)if (s = t.sections[u++], (a = t.sections[u++]) < 0) r += s, o += s; else { for (f = r, h = o, c = k.empty; f += s, h += a, a && e && (c = c.append(e[u - 2 >> 1])), !(i || u == t.sections.length || t.sections[u + 1] < 0);)s = t.sections[u++], a = t.sections[u++]; n(r, f, o, h, c), r = f, o = h } } function jh(t, n, i, e) { for (var r, o, u, s, a, f, h, c, l, v, d, y, r, o = [], u = 3 < arguments.length && void 0 !== e && e ? [] : null, s = new Q(t), a = new Q(n), f = -1; ;)if (-1 == s.ins && -1 == a.ins) xh(o, h = Math.min(s.len, a.len), -1), s.forward(h), a.forward(h); else if (0 <= a.ins && (s.ins < 0 || f == s.i || 0 == s.off && (a.len < s.len || a.len == s.len && !i))) { for (c = a.len, xh(o, a.ins, -1); c;)l = Math.min(s.len, c), 0 <= s.ins && f < s.i && s.len <= l && (xh(o, 0, s.ins), u && Sh(u, o, s.text), f = s.i), s.forward(l), c -= l; a.next() } else { if (!(0 <= s.ins)) { if (s.done && a.done) return u ? K.createSet(o, u) : J.create(o); throw new Error("Mismatched change set lengths") } for (v = 0, d = s.len; d;)if (-1 == a.ins) v += y = Math.min(d, a.len), d -= y, a.forward(y); else { if (!(0 == a.ins && a.len < d)) break; d -= a.len, a.next() } xh(o, v, f < s.i ? s.ins : 0), u && f < s.i && Sh(u, o, s.text), f = s.i, s.forward(s.len - d) } } function Ph(t, n, i) { for (var e, r, o, u, s, a, f, h, c, e, r = [], o = 2 < arguments.length && void 0 !== i && i ? [] : null, u = new Q(t), s = new Q(n), a = !1; ;) { if (u.done && s.done) return o ? K.createSet(r, o) : J.create(r); if (0 == u.ins) xh(r, u.len, 0, a), u.next(); else if (0 != s.len || s.done) { if (u.done || s.done) throw new Error("Mismatched change set lengths"); f = Math.min(u.len2, s.len), h = r.length, -1 == u.ins ? (xh(r, f, c = -1 == s.ins ? -1 : s.off ? 0 : s.ins, a), o && c && Sh(o, r, s.text)) : -1 == s.ins ? (xh(r, u.off ? 0 : u.len, f, a), o && Sh(o, r, u.textBit(f))) : (xh(r, u.off ? 0 : u.len, s.off ? 0 : s.ins, a), o && !s.off && Sh(o, r, s.text)), a = (u.ins > f || 0 <= s.ins && s.len > f) && (a || h < r.length), u.forward2(f), s.forward(f) } else xh(r, 0, s.ins, a), o && Sh(o, r, s.text), s.next() } } function Oh(t, n) { var i, e, r, i = F(t.ranges); try { for (i.s(); !(e = i.n()).done;)if ((r = e.value).to > n) throw new RangeError("Selection points outside of document") } catch (t) { i.e(t) } finally { i.f() } } function Eh(t, i) { return t == i || t.length == i.length && t.every(function (t, n) { return t === i[n] }) } function Ah(t, n, i) { if (t.length == n.length) { for (var e = 0; e < t.length; e++)if (!i(t[e], n[e])) return; return 1 } } function Dh(t, n) { var i, e, r, o, i = !1, e = F(n); try { for (e.s(); !(r = e.n()).done;)1 & Lh(t, o = r.value) && (i = !0) } catch (t) { e.e(t) } finally { e.f() } return i } function Rh(n, s, o) { var a, f, r, u; function h(t) { for (var n, i, e, r, o, u, n = [], i = 0; i < a.length; i++)if (e = Bh(t, a[i]), 2 == f[i]) { r = F(e); try { for (r.s(); !(o = r.n()).done;)u = o.value, n.push(u) } catch (t) { r.e(t) } finally { r.f() } } else n.push(e); return s.combine(n) } return a = o.map(function (t) { return n[t.id] }), f = o.map(function (t) { return t.type }), r = a.filter(function (t) { return !(1 & t) }), u = n[s.id] >> 1, { create: function t(n) { var i, e, r, i = F(a); try { for (i.s(); !(e = i.n()).done;)Lh(n, r = e.value) } catch (t) { i.e(t) } finally { i.f() } return n.values[u] = h(n), 1 }, update: function t(n, i) { var e; return !Dh(n, r) || (e = h(n), s.compare(e, n.values[u])) ? 0 : (n.values[u] = e, 1) }, reconfigure: function t(n, i) { var e, r, i, e, e = Dh(n, a), r = i.config.facets[s.id], i = i.facet(s); return r && !e && Eh(o, r) || (e = h(n), s.compare(e, i)) ? (n.values[u] = i, 0) : (n.values[u] = e, 1) } } } function Ih(n) { return function (t) { return new at(t, n) } } function Th(t, s, a) { var f, h; function c(t, n) { var i, e, r, o, u, i, e, i = h.get(t); if (null != i) { if (i <= n) return; -1 < (e = f[i].indexOf(t)) && f[i].splice(e, 1), t instanceof ht && a.delete(t.compartment) } if (h.set(t, n), Array.isArray(t)) { r = F(t); try { for (r.s(); !(o = r.n()).done;)c(u = o.value, n) } catch (t) { r.e(t) } finally { r.f() } } else if (t instanceof ht) { if (a.has(t.compartment)) throw new RangeError("Duplicate use of compartment in extensions"); i = s.get(t.compartment) || t.inner, a.set(t.compartment, i), c(i, n) } else if (t instanceof at) c(t.inner, t.prec); else if (t instanceof b) f[n].push(t), t.provides && c(t.provides, n); else if (t instanceof Y) f[n].push(t), t.facet.extensions && c(t.facet.extensions, rt); else { if (!(e = t.extension)) throw new Error("Unrecognized extension value in extension set (".concat(t, "). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.")); c(e, n) } } return f = [[], [], [], [], []], h = new Map, c(t, rt), f.reduce(function (t, n) { return t.concat(n) }) } function Lh(t, n) { var n, i, i; if (1 & n) return 2; if (4 == (i = t.status[n = n >> 1])) throw new Error("Cyclic dependency between fields and/or facets"); return 2 & i ? i : (t.status[n] = 4, i = t.computeSlot(t, t.config.dynamicSlots[n]), t.status[n] = 2 | i) } function Bh(t, n) { return (1 & n ? t.config.staticValues : t.values)[n >> 1] } function _h(t, n) { for (var i, e, r, o, u, i = [], e = 0, r = 0; ;) { if (u = o = void 0, e < t.length && (r == n.length || n[r] >= t[e])) o = t[e++], u = t[e++]; else { if (!(r < n.length)) return i; o = n[r++], u = n[r++] } !i.length || i[i.length - 1] < o ? i.push(o, u) : i[i.length - 1] < u && (i[i.length - 1] = u) } } function Fh(t, n, i) { var i, e, r, i, i = i ? (e = n.changes, r = K.empty(n.changes.length), t.changes.compose(n.changes)) : (e = n.changes.map(t.changes), r = t.changes.mapDesc(n.changes, !0), t.changes.compose(e)); return { changes: i, selection: n.selection ? n.selection.map(r) : null == (i = t.selection) ? void 0 : i.map(e), effects: v.mapEffects(t.effects, e).concat(v.mapEffects(n.effects, r)), annotations: t.annotations.length ? t.annotations.concat(n.annotations) : n.annotations, scrollIntoView: t.scrollIntoView || n.scrollIntoView } } function Nh(t, n, i) { var e = n.selection, r = Wh(n.annotations); return n.userEvent && (r = r.concat(Mt.userEvent.of(n.userEvent))), { changes: n.changes instanceof K ? n.changes : K.of(n.changes || [], i, t.facet(dt)), selection: e && (e instanceof O ? e : O.single(e.anchor, e.head)), effects: Wh(n.effects), annotations: r, scrollIntoView: !!n.scrollIntoView } } function Uh(t, n, i) { var e, r, o, u, e = Nh(t, n.length ? n[0] : {}, t.doc.length); for (n.length && !1 === n[0].filter && (i = !1), r = 1; r < n.length; r++)!1 === n[r].filter && (i = !1), o = !!n[r].sequential, e = Fh(e, Nh(t, n[r], o ? e.changes.newLength : t.doc.length), o); return u = Mt.create(t, e.changes, e.selection, e.effects, e.annotations, e.scrollIntoView), zh(i ? Hh(u) : u) } function Hh(t) { var n, i, e, r, o, u, s, a, f, h, c, l, n = t.startState, i = !0, e = F(n.facet(yt)); try { for (e.s(); !(r = e.n()).done;) { if (!1 === (u = (o = r.value)(t))) { i = !1; break } Array.isArray(u) && (i = !0 === i ? u : _h(i, u)) } } catch (t) { e.e(t) } finally { e.f() } for (!0 !== i && (!1 === i ? (a = t.changes.invertedDesc, s = K.empty(n.doc.length)) : (s = (f = t.changes.filter(i)).changes, a = f.filtered.mapDesc(f.changes).invertedDesc), t = Mt.create(n, s, t.selection && t.selection.map(a), v.mapEffects(t.effects, a), t.annotations, t.scrollIntoView)), c = (h = n.facet(mt)).length - 1; 0 <= c; c--)t = (l = h[c](t)) instanceof Mt ? l : Array.isArray(l) && 1 == l.length && l[0] instanceof Mt ? l[0] : Uh(n, Wh(l), !1); return t } function zh(t) { for (var n, i, e, r, o, n = t.startState, i = n.facet(pt), e = t, r = i.length - 1; 0 <= r; r--)(o = i[r](t)) && Object.keys(o).length && (e = Fh(e, Nh(n, o, t.changes.newLength), !0)); return e == t ? t : Mt.create(n, t.changes, t.selection, e.effects, e.annotations, e.scrollIntoView) } function Wh(t) { return null == t ? xt : Array.isArray(t) ? t : [t] } q = 8205, G = /\r\n?|\n/, h = function (t) { return t[t.Simple = 0] = "Simple", t[t.TrackDel = 1] = "TrackDel", t[t.TrackBefore = 2] = "TrackBefore", t[t.TrackAfter = 3] = "TrackAfter", t }(h = h || {}), K = function (t) { f(y, t); var i = S(y); function y(t, n) { var t; return A(this, y), (t = i.call(this, t)).inserted = n, t } return D(y, [{ key: "apply", value: function t(o) { if (this.length != o.length) throw new RangeError("Applying change set to a document with the wrong length"); return Ch(this, function (t, n, i, e, r) { o = o.replace(i, i + (n - t), r) }, !1), o } }, { key: "mapDesc", value: function t(n) { var i; return jh(this, n, 1 < arguments.length && void 0 !== arguments[1] && arguments[1], !0) } }, { key: "invert", value: function t(n) { for (var i, e, r, o, u, s, a, i = this.sections.slice(), e = [], r = 0, o = 0; r < i.length; r += 2) { if (u = i[r], 0 <= (s = i[r + 1])) { for (i[r] = s, i[r + 1] = u, a = r >> 1; e.length < a;)e.push(k.empty); e.push(u ? n.slice(o, o + u) : k.empty) } o += u } return new y(i, e) } }, { key: "compose", value: function t(n) { return this.empty ? n : n.empty ? this : Ph(this, n, !0) } }, { key: "map", value: function t(n) { var i; return n.empty ? this : jh(this, n, 1 < arguments.length && void 0 !== arguments[1] && arguments[1], !0) } }, { key: "iterChanges", value: function t(n) { var i; Ch(this, n, 1 < arguments.length && void 0 !== arguments[1] && arguments[1]) } }, { key: "desc", get: function t() { return J.create(this.sections) } }, { key: "filter", value: function t(n) { var i, e, r, o, u, s, a, f, h, c, l, i = [], e = [], r = [], o = new Q(this); t: for (u = 0, s = 0; ;) { for (a = u == n.length ? 1e9 : n[u++]; s < a || s == a && 0 == o.len;) { if (o.done) break t; xh(r, f = Math.min(o.len, a - s), -1), xh(i, f, h = -1 == o.ins ? -1 : 0 == o.off ? o.ins : 0), 0 < h && Sh(e, i, o.text), o.forward(f), s += f } for (c = n[u++]; s < c;) { if (o.done) break t; xh(i, l = Math.min(o.len, c - s), -1), xh(r, l, -1 == o.ins ? -1 : 0 == o.off ? o.ins : 0), o.forward(l), s += l } } return { changes: new y(i, e), filtered: J.create(r) } } }, { key: "toJSON", value: function t() { for (var n, i, e, r, n = [], i = 0; i < this.sections.length; i += 2)e = this.sections[i], r = this.sections[i + 1], n.push(r < 0 ? e : 0 == r ? [e] : [e].concat(this.inserted[i >> 1].toJSON())); return n } }], [{ key: "of", value: function t(n, s, a) { var f, h, c, l; function v(t) { var n, t, n; (0 < arguments.length && void 0 !== t && t || f.length) && (c < s && xh(f, s - c, -1), t = new y(f, h), l = l ? l.compose(t.map(l)) : t, f = [], h = [], c = 0) } function d(t) { var n, i, e, r, o, o, t, t, u; if (Array.isArray(t)) { n = F(t); try { for (n.s(); !(i = n.n()).done;)d(e = i.value) } catch (t) { n.e(t) } finally { n.f() } } else if (t instanceof y) { if (t.length != s) throw new RangeError("Mismatched change set length (got ".concat(t.length, ", expected ").concat(s, ")")); v(), l = l ? l.compose(t.map(l)) : t } else { if (r = t.from, o = t.to, t = t.insert, (o = void 0 === o ? r : o) < r || r < 0 || s < o) throw new RangeError("Invalid change range ".concat(r, " to ").concat(o, " (in doc of length ").concat(s, ")")); u = (t = t ? "string" == typeof t ? k.of(t.split(a || G)) : t : k.empty).length, r == o && 0 == u || (r < c && v(), c < r && xh(f, r - c, -1), xh(f, o - r, u), Sh(h, f, t), c = o) } } return f = [], h = [], c = 0, l = null, d(n), v(!l), l } }, { key: "empty", value: function t(n) { return new y(n ? [n, -1] : [], []) } }, { key: "fromJSON", value: function t(n) { var i, e, r, o; if (!Array.isArray(n)) throw new RangeError("Invalid JSON representation of ChangeSet"); for (i = [], e = [], r = 0; r < n.length; r++)if ("number" == typeof (o = n[r])) i.push(o, -1); else { if (!Array.isArray(o) || "number" != typeof o[0] || o.some(function (t, n) { return n && "string" != typeof t })) throw new RangeError("Invalid JSON representation of ChangeSet"); if (1 == o.length) i.push(o[0], 0); else { for (; e.length < r;)e.push(k.empty); e[r] = k.of(o.slice(1)), i.push(o[0], e[r].length) } } return new y(i, e) } }, { key: "createSet", value: function t(n, i) { return new y(n, i) } }]), y }(J = function () { function o(t) { A(this, o), this.sections = t } return D(o, [{ key: "length", get: function t() { for (var n, i, n = 0, i = 0; i < this.sections.length; i += 2)n += this.sections[i]; return n } }, { key: "newLength", get: function t() { for (var n, i, e, n = 0, i = 0; i < this.sections.length; i += 2)n += (e = this.sections[i + 1]) < 0 ? this.sections[i] : e; return n } }, { key: "empty", get: function t() { return 0 == this.sections.length || 2 == this.sections.length && this.sections[1] < 0 } }, { key: "iterGaps", value: function t(n) { for (var i, e, r, o, u, i = 0, e = 0, r = 0; i < this.sections.length;)o = this.sections[i++], (u = this.sections[i++]) < 0 ? (n(e, r, o), r += o) : r += u, e += o } }, { key: "iterChangedRanges", value: function t(n) { var i; Ch(this, n, 1 < arguments.length && void 0 !== arguments[1] && arguments[1]) } }, { key: "invertedDesc", get: function t() { for (var n, i, e, r, n = [], i = 0; i < this.sections.length;)e = this.sections[i++], (r = this.sections[i++]) < 0 ? n.push(e, r) : n.push(r, e); return new o(n) } }, { key: "composeDesc", value: function t(n) { return this.empty ? n : n.empty ? this : Ph(this, n) } }, { key: "mapDesc", value: function t(n) { var i; return n.empty ? this : jh(this, n, 1 < arguments.length && void 0 !== arguments[1] && arguments[1]) } }, { key: "mapPos", value: function t(n) { for (var i, e, r, o, u, s, a, f, i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : -1, e = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : h.Simple, r = 0, o = 0, u = 0; u < this.sections.length;) { if (f = r + (s = this.sections[u++]), (a = this.sections[u++]) < 0) { if (n < f) return o + (n - r); o += s } else { if (e != h.Simple && n <= f && (e == h.TrackDel && r < n && n < f || e == h.TrackBefore && r < n || e == h.TrackAfter && n < f)) return null; if (n < f || f == n && i < 0 && !s) return n == r || i < 0 ? o : o + a; o += a } r = f } if (r < n) throw new RangeError("Position ".concat(n, " is out of range for changeset of length ").concat(r)); return o } }, { key: "touchesRange", value: function t(n) { for (var i, e, r, o, u, s, i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : n, e = 0, r = 0; e < this.sections.length && r <= i;) { if (s = r + (o = this.sections[e++]), 0 <= (u = this.sections[e++]) && r <= i && n <= s) return !(r < n && i < s) || "cover"; r = s } return !1 } }, { key: "toString", value: function t() { for (var n, i, e, r, n = "", i = 0; i < this.sections.length;)n += (n ? " " : "") + (e = this.sections[i++]) + (0 <= (r = this.sections[i++]) ? ":" + r : ""); return n } }, { key: "toJSON", value: function t() { return this.sections } }], [{ key: "fromJSON", value: function t(n) { if (!Array.isArray(n) || n.length % 2 || n.some(function (t) { return "number" != typeof t })) throw new RangeError("Invalid JSON representation of ChangeDesc"); return new o(n) } }, { key: "create", value: function t(n) { return new o(n) } }]), o }()), Q = function () { function n(t) { A(this, n), this.set = t, this.i = 0, this.next() } return D(n, [{ key: "next", value: function t() { var n = this.set.sections; this.i < n.length ? (this.len = n[this.i++], this.ins = n[this.i++]) : (this.len = 0, this.ins = -2), this.off = 0 } }, { key: "done", get: function t() { return -2 == this.ins } }, { key: "len2", get: function t() { return this.ins < 0 ? this.len : this.ins } }, { key: "text", get: function t() { var n = this.set.inserted, i = this.i - 2 >> 1; return i >= n.length ? k.empty : n[i] } }, { key: "textBit", value: function t(n) { var i = this.set.inserted, e = this.i - 2 >> 1; return e >= i.length && !n ? k.empty : i[e].slice(this.off, null == n ? void 0 : this.off + n) } }, { key: "forward", value: function t(n) { n == this.len ? this.next() : (this.len -= n, this.off += n) } }, { key: "forward2", value: function t(n) { -1 == this.ins ? this.forward(n) : n == this.ins ? this.next() : (this.ins -= n, this.off += n) } }]), n }(), X = function () { function o(t, n, i) { A(this, o), this.from = t, this.to = n, this.flags = i } return D(o, [{ key: "anchor", get: function t() { return 16 & this.flags ? this.to : this.from } }, { key: "head", get: function t() { return 16 & this.flags ? this.from : this.to } }, { key: "empty", get: function t() { return this.from == this.to } }, { key: "assoc", get: function t() { return 4 & this.flags ? -1 : 8 & this.flags ? 1 : 0 } }, { key: "bidiLevel", get: function t() { var n = 3 & this.flags; return 3 == n ? null : n } }, { key: "goalColumn", get: function t() { var n = this.flags >> 5; return 33554431 == n ? void 0 : n } }, { key: "map", value: function t(n) { var i, e, r, i; return this.empty ? e = r = n.mapPos(this.from, 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : -1) : (e = n.mapPos(this.from, 1), r = n.mapPos(this.to, -1)), e == this.from && r == this.to ? this : new o(e, r, this.flags) } }, { key: "extend", value: function t(n) { var i, n, i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : n; return n <= this.anchor && i >= this.anchor ? O.range(n, i) : (n = Math.abs(n - this.anchor) > Math.abs(i - this.anchor) ? n : i, O.range(this.anchor, n)) } }, { key: "eq", value: function t(n) { return this.anchor == n.anchor && this.head == n.head } }, { key: "toJSON", value: function t() { return { anchor: this.anchor, head: this.head } } }], [{ key: "fromJSON", value: function t(n) { if (n && "number" == typeof n.anchor && "number" == typeof n.head) return O.range(n.anchor, n.head); throw new RangeError("Invalid JSON representation for SelectionRange") } }, { key: "create", value: function t(n, i, e) { return new o(n, i, e) } }]), o }(), O = function () { function a(t, n) { A(this, a), this.ranges = t, this.mainIndex = n } return D(a, [{ key: "map", value: function t(n) { var i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : -1; return n.empty ? this : a.create(this.ranges.map(function (t) { return t.map(n, i) }), this.mainIndex) } }, { key: "eq", value: function t(n) { if (this.ranges.length != n.ranges.length || this.mainIndex != n.mainIndex) return !1; for (var i = 0; i < this.ranges.length; i++)if (!this.ranges[i].eq(n.ranges[i])) return !1; return !0 } }, { key: "main", get: function t() { return this.ranges[this.mainIndex] } }, { key: "asSingle", value: function t() { return 1 == this.ranges.length ? this : new a([this.main], 0) } }, { key: "addRange", value: function t(n) { var i = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1]; return a.create([n].concat(this.ranges), i ? 0 : this.mainIndex + 1) } }, { key: "replaceRange", value: function t(n) { var i, e, i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : this.mainIndex, e = this.ranges.slice(); return e[i] = n, a.create(e, this.mainIndex) } }, { key: "toJSON", value: function t() { return { ranges: this.ranges.map(function (t) { return t.toJSON() }), main: this.mainIndex } } }], [{ key: "fromJSON", value: function t(n) { if (!n || !Array.isArray(n.ranges) || "number" != typeof n.main || n.main >= n.ranges.length) throw new RangeError("Invalid JSON representation for EditorSelection"); return new a(n.ranges.map(function (t) { return X.fromJSON(t) }), n.main) } }, { key: "single", value: function t(n) { var i; return new a([a.range(n, 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : n)], 0) } }, { key: "create", value: function t(n) { var i, e, r, o, i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0; if (0 == n.length) throw new RangeError("A selection needs at least one range"); for (r = e = 0; r < n.length; r++) { if ((o = n[r]).empty ? o.from <= e : o.from < e) return a.normalized(n.slice(), i); e = o.to } return new a(n, i) } }, { key: "cursor", value: function t(n) { var i, e, r, i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0, e = 2 < arguments.length ? arguments[2] : void 0, r = 3 < arguments.length ? arguments[3] : void 0; return X.create(n, n, (0 == i ? 0 : i < 0 ? 4 : 8) | (null == e ? 3 : Math.min(2, e)) | (null != r ? r : 33554431) << 5) } }, { key: "range", value: function t(n, i, e, r) { var e = (null != e ? e : 33554431) << 5 | (null == r ? 3 : Math.min(2, r)); return i < n ? X.create(i, n, 24 | e) : X.create(n, i, (n < i ? 4 : 0) | e) } }, { key: "normalized", value: function t(n) { var i, e, r, o, u, s, u, i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0, e = n[i]; for (n.sort(function (t, n) { return t.from - n.from }), i = n.indexOf(e), r = 1; r < n.length; r++)o = n[r], u = n[r - 1], (o.empty ? o.from <= u.to : o.from < u.to) && (s = u.from, u = Math.max(o.to, u.to), r <= i && i--, n.splice(--r, 2, o.anchor > o.head ? a.range(u, s) : a.range(s, u))); return new a(n, i) } }]), a }(), Z = 0, y = function () { function o(t, n, i, e, r) { A(this, o), this.combine = t, this.compareInput = n, this.compare = i, this.isStatic = e, this.id = Z++, this.default = t([]), this.extensions = "function" == typeof r ? r(this) : r } return D(o, [{ key: "of", value: function t(n) { return new Y([], this, 0, n) } }, { key: "compute", value: function t(n, i) { if (this.isStatic) throw new Error("Can't compute a static facet"); return new Y(n, this, 1, i) } }, { key: "computeN", value: function t(n, i) { if (this.isStatic) throw new Error("Can't compute a static facet"); return new Y(n, this, 2, i) } }, { key: "from", value: function t(n, i) { return i = i || function t(n) { return n }, this.compute([n], function (t) { return i(t.field(n)) }) } }], [{ key: "define", value: function t() { var n = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}; return new o(n.combine || function (t) { return t }, n.compareInput || function (t, n) { return t === n }, n.compare || (n.combine ? function (t, n) { return t === n } : Eh), !!n.static, n.enables) } }]), o }(), Y = function () { function r(t, n, i, e) { A(this, r), this.dependencies = t, this.facet = n, this.type = i, this.value = e, this.id = Z++ } return D(r, [{ key: "dynamicSlot", value: function t(n) { var o, i, u, s, a, f, h, e, r, c, l, v, d, o = this, u = this.value, s = this.facet.compareInput, a = this.id, f = n[a] >> 1, h = 2 == this.type, e = !1, r = !1, c = [], l = F(this.dependencies); try { for (l.s(); !(v = l.n()).done;)"doc" == (d = v.value) ? e = !0 : "selection" == d ? r = !0 : 0 == (1 & (null != (i = n[d.id]) ? i : 1)) && c.push(n[d.id]) } catch (t) { l.e(t) } finally { l.f() } return { create: function t(n) { return n.values[f] = u(n), 1 }, update: function t(n, i) { if (e && i.docChanged || r && (i.docChanged || i.selection) || Dh(n, c)) { var i = u(n); if (h ? !Ah(i, n.values[f], s) : !s(i, n.values[f])) return n.values[f] = i, 1 } return 0 }, reconfigure: function t(n, i) { var e, r, r, r = i.config.address[a]; if (null != r) { if (r = Bh(i, r), o.dependencies.every(function (t) { return t instanceof y ? i.facet(t) === n.facet(t) : !(t instanceof b) || i.field(t, !1) == n.field(t, !1) }) || (h ? Ah(e = u(n), r, s) : s(e = u(n), r))) return n.values[f] = r, 0 } else e = u(n); return n.values[f] = e, 1 } } } }]), r }(), tt = y.define({ static: !0 }), b = function () { function o(t, n, i, e, r) { A(this, o), this.id = t, this.createF = n, this.updateF = i, this.compareF = e, this.spec = r, this.provides = void 0 } return D(o, [{ key: "create", value: function t(n) { var i, e, i = this, e = n.facet(tt).find(function (t) { return t.field == i }); return ((null == e ? void 0 : e.create) || this.createF)(n) } }, { key: "slot", value: function t(n) { var r, o, r = this, o = n[this.id] >> 1; return { create: function t(n) { return n.values[o] = r.create(n), 1 }, update: function t(n, i) { var e, i, e = n.values[o], i = r.updateF(e, i); return r.compareF(e, i) ? 0 : (n.values[o] = i, 1) }, reconfigure: function t(n, i) { return null != i.config.address[r.id] ? (n.values[o] = i.field(r), 0) : (n.values[o] = r.create(n), 1) } } } }, { key: "init", value: function t(n) { return [this, tt.of({ field: this, create: n })] } }, { key: "extension", get: function t() { return this } }], [{ key: "define", value: function t(n) { var i = new o(Z++, n.create, n.update, n.compare || function (t, n) { return t === n }, n); return n.provide && (i.provides = n.provide(i)), i } }]), o }(), st = { highest: Ih(ut = 0), high: Ih(ot = 1), default: Ih(rt = 2), low: Ih(et = 3), lowest: Ih(it = 4) }, at = D(function t(n, i) { A(this, t), this.inner = n, this.prec = i }), ft = function () { function i() { A(this, i) } return D(i, [{ key: "of", value: function t(n) { return new ht(this, n) } }, { key: "reconfigure", value: function t(n) { return i.reconfigure.of({ compartment: this, extension: n }) } }, { key: "get", value: function t(n) { return n.config.compartments.get(this) } }]), i }(), ht = D(function t(n, i)