Liferay.Loader.define("dynamic-data-mapping-form-field-type$liferay-ckeditor@4.21.0-liferay.10/ckeditor/plugins/codemirror/vendors/vendors", ['module', 'exports', 'require', '../../lib/codemirror'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    (function (M, ca) {
      "object" === typeof exports && "undefined" !== typeof module ? module.exports = ca() : "function" === typeof __define_disabled__ && define.amd ? define(ca) : (M = M || self, M.CodeMirror = ca());
    })(this, function () {
      function M(a) {
        return new RegExp("(^|\\s)" + a + "(?:$|\\s)\\s*");
      }function ca(a) {
        for (var b = a.childNodes.length; 0 < b; --b) a.removeChild(a.firstChild);return a;
      }function Y(a, b) {
        return ca(a).appendChild(b);
      }function w(a, b, c, d) {
        a = document.createElement(a);c && (a.className = c);d && (a.style.cssText = d);if ("string" == typeof b) a.appendChild(document.createTextNode(b));else if (b) for (c = 0; c < b.length; ++c) a.appendChild(b[c]);return a;
      }function ra(a, b, c, d) {
        a = w(a, b, c, d);a.setAttribute("role", "presentation");return a;
      }function T(a, b) {
        3 == b.nodeType && (b = b.parentNode);if (a.contains) return a.contains(b);do if (11 == b.nodeType && (b = b.host), b == a) return !0; while (b = b.parentNode);
      }function fa() {
        var a;try {
          a = document.activeElement;
        } catch (b) {
          a = document.body || null;
        }for (; a && a.shadowRoot && a.shadowRoot.activeElement;) a = a.shadowRoot.activeElement;return a;
      }function ya(a, b) {
        var c = a.className;M(b).test(c) || (a.className += (c ? " " : "") + b);
      }function Pa(a, b) {
        for (var c = a.split(" "), d = 0; d < c.length; d++) c[d] && !M(c[d]).test(b) && (b += " " + c[d]);return b;
      }function Qa(a) {
        var b = Array.prototype.slice.call(arguments, 1);return function () {
          return a.apply(null, b);
        };
      }function za(a, b, c) {
        b || (b = {});for (var d in a) !a.hasOwnProperty(d) || !1 === c && b.hasOwnProperty(d) || (b[d] = a[d]);return b;
      }function U(a, b, c, d, e) {
        null == b && (b = a.search(/[^\s\u00a0]/), -1 == b && (b = a.length));d = d || 0;for (e = e || 0;;) {
          var f = a.indexOf("\t", d);if (0 > f || f >= b) return e + (b - d);e += f - d;e += c - e % c;d = f + 1;
        }
      }function O(a, b) {
        for (var c = 0; c < a.length; ++c) if (a[c] == b) return c;return -1;
      }function Aa(a, b, c) {
        for (var d = 0, e = 0;;) {
          var f = a.indexOf("\t", d);-1 == f && (f = a.length);var g = f - d;if (f == a.length || e + g >= b) return d + Math.min(g, b - e);e += f - d;e += c - e % c;d = f + 1;if (e >= b) return d;
        }
      }function fb(a) {
        for (; oc.length <= a;) oc.push(D(oc) + " ");return oc[a];
      }function D(a) {
        return a[a.length - 1];
      }function Ba(a, b) {
        for (var c = [], d = 0; d < a.length; d++) c[d] = b(a[d], d);return c;
      }function pc(a, b, c) {
        for (var d = 0, e = c(b); d < a.length && c(a[d]) <= e;) d++;a.splice(d, 0, b);
      }function ma() {}function qc(a, b) {
        var c;Object.create ? c = Object.create(a) : (ma.prototype = a, c = new ma());b && za(b, c);return c;
      }function gb(a) {
        return (/\w/.test(a) || "" < a && (a.toUpperCase() != a.toLowerCase() || hg.test(a))
        );
      }function Ra(a, b) {
        return b ? -1 < b.source.indexOf("\\w") && gb(a) ? !0 : b.test(a) : gb(a);
      }function hb(a) {
        for (var b in a) if (a.hasOwnProperty(b) && a[b]) return !1;return !0;
      }function K(a) {
        return 768 <= a.charCodeAt(0) && ig.test(a);
      }function Db(a, b, c) {
        for (; (0 > c ? 0 < b : b < a.length) && K(a.charAt(b));) b += c;return b;
      }function ja(a, b, c) {
        for (var d = b > c ? -1 : 1;;) {
          if (b == c) return b;var e = (b + c) / 2,
              e = 0 > d ? Math.ceil(e) : Math.floor(e);if (e == b) return a(e) ? b : c;a(e) ? c = e : b = e + d;
        }
      }function Ga(a, b, c, d) {
        if (!a) return d(b, c, "ltr", 0);for (var e = !1, f = 0; f < a.length; ++f) {
          var g = a[f];if (g.from < c && g.to > b || b == c && g.to == b) d(Math.max(g.from, b), Math.min(g.to, c), 1 == g.level ? "rtl" : "ltr", f), e = !0;
        }e || d(b, c, "ltr");
      }function J(a, b, c) {
        var d;Eb = null;for (var e = 0; e < a.length; ++e) {
          var f = a[e];if (f.from < b && f.to > b) return e;f.to == b && (f.from != f.to && "before" == c ? d = e : Eb = e);f.from == b && (f.from != f.to && "before" != c ? d = e : Eb = e);
        }return null != d ? d : Eb;
      }function n(a, b) {
        var c = a.order;null == c && (c = a.order = jg(a.text, b));return c;
      }function u(a, b, c) {
        if (a.removeEventListener) a.removeEventListener(b, c, !1);else if (a.detachEvent) a.detachEvent("on" + b, c);else {
          var d = (a = a._handlers) && a[b];d && (c = O(d, c), -1 < c && (a[b] = d.slice(0, c).concat(d.slice(c + 1))));
        }
      }function t(a, b) {
        var c = a._handlers && a._handlers[b] || rc;if (c.length) for (var d = Array.prototype.slice.call(arguments, 2), e = 0; e < c.length; ++e) c[e].apply(null, d);
      }function F(a, b, c) {
        "string" == typeof b && (b = { type: b, preventDefault: function () {
            this.defaultPrevented = !0;
          } });t(a, c || b.type, a, b);return Xc(b) || b.codemirrorIgnore;
      }function ae(a) {
        var b = a._handlers && a._handlers.cursorActivity;if (b) {
          a = a.curOp.cursorActivityHandlers || (a.curOp.cursorActivityHandlers = []);for (var c = 0; c < b.length; ++c) -1 == O(a, b[c]) && a.push(b[c]);
        }
      }function ka(a, b) {
        return 0 < (a._handlers && a._handlers[b] || rc).length;
      }function ib(a) {
        a.prototype.on = function (a, c) {
          y(this, a, c);
        };a.prototype.off = function (a, c) {
          u(this, a, c);
        };
      }function Z(a) {
        a.preventDefault ? a.preventDefault() : a.returnValue = !1;
      }function be(a) {
        a.stopPropagation ? a.stopPropagation() : a.cancelBubble = !0;
      }function Xc(a) {
        return null != a.defaultPrevented ? a.defaultPrevented : 0 == a.returnValue;
      }function Fb(a) {
        Z(a);be(a);
      }function ce(a) {
        var b = a.which;null == b && (a.button & 1 ? b = 1 : a.button & 2 ? b = 3 : a.button & 4 && (b = 2));la && a.ctrlKey && 1 == b && (b = 3);return b;
      }function kg(a) {
        if (null == Yc) {
          var b = w("span", "​");Y(a, w("span", [b, document.createTextNode("x")]));0 != a.firstChild.offsetHeight && (Yc = 1 >= b.offsetWidth && 2 < b.offsetHeight && !(B && 8 > H));
        }a = Yc ? w("span", "​") : w("span", " ", null, "display: inline-block; width: 1px; margin-right: -1px");a.setAttribute("cm-text", "");return a;
      }function lg(a, b) {
        2 < arguments.length && (b.dependencies = Array.prototype.slice.call(arguments, 2));Zc[a] = b;
      }function sc(a) {
        if ("string" == typeof a && jb.hasOwnProperty(a)) a = jb[a];else if (a && "string" == typeof a.name && jb.hasOwnProperty(a.name)) {
          var b = jb[a.name];"string" == typeof b && (b = { name: b });a = qc(b, a);a.name = b.name;
        } else {
          if ("string" == typeof a && /^[\w\-]+\/[\w\-]+\+xml$/.test(a)) return sc("application/xml");if ("string" == typeof a && /^[\w\-]+\/[\w\-]+\+json$/.test(a)) return sc("application/json");
        }return "string" == typeof a ? { name: a } : a || { name: "null" };
      }function $c(a, b) {
        b = sc(b);var c = Zc[b.name];if (!c) return $c(a, "text/plain");c = c(a, b);if (kb.hasOwnProperty(b.name)) {
          var d = kb[b.name],
              e;for (e in d) d.hasOwnProperty(e) && (c.hasOwnProperty(e) && (c["_" + e] = c[e]), c[e] = d[e]);
        }c.name = b.name;b.helperType && (c.helperType = b.helperType);if (b.modeProps) for (var f in b.modeProps) c[f] = b.modeProps[f];return c;
      }function mg(a, b) {
        var c = kb.hasOwnProperty(a) ? kb[a] : kb[a] = {};za(b, c);
      }function Sa(a, b) {
        if (!0 === b) return b;if (a.copyState) return a.copyState(b);var c = {},
            d;for (d in b) {
          var e = b[d];e instanceof Array && (e = e.concat([]));c[d] = e;
        }return c;
      }function ad(a, b) {
        for (var c; a.innerMode;) {
          c = a.innerMode(b);if (!c || c.mode == a) break;b = c.state;a = c.mode;
        }return c || { mode: a, state: b };
      }function de(a, b, c) {
        return a.startState ? a.startState(b, c) : !0;
      }function x(a, b) {
        b -= a.first;if (0 > b || b >= a.size) throw Error("There is no line " + (b + a.first) + " in the document.");for (var c = a; !c.lines;) for (var d = 0;; ++d) {
          var e = c.children[d],
              f = e.chunkSize();if (b < f) {
            c = e;break;
          }b -= f;
        }return c.lines[b];
      }function Ta(a, b, c) {
        var d = [],
            e = b.line;a.iter(b.line, c.line + 1, function (a) {
          a = a.text;e == c.line && (a = a.slice(0, c.ch));e == b.line && (a = a.slice(b.ch));d.push(a);++e;
        });return d;
      }function bd(a, b, c) {
        var d = [];a.iter(b, c, function (a) {
          d.push(a.text);
        });return d;
      }function sa(a, b) {
        var c = b - a.height;if (c) for (var d = a; d; d = d.parent) d.height += c;
      }function G(a) {
        if (null == a.parent) return null;
        var b = a.parent;a = O(b.lines, a);for (var c = b.parent; c; b = c, c = c.parent) for (var d = 0; c.children[d] != b; ++d) a += c.children[d].chunkSize();return a + b.first;
      }function Ua(a, b) {
        var c = a.first;a: do {
          for (var d = 0; d < a.children.length; ++d) {
            var e = a.children[d],
                f = e.height;if (b < f) {
              a = e;continue a;
            }b -= f;c += e.chunkSize();
          }return c;
        } while (!a.lines);for (d = 0; d < a.lines.length; ++d) {
          e = a.lines[d].height;if (b < e) break;b -= e;
        }return c + d;
      }function Gb(a, b) {
        return b >= a.first && b < a.first + a.size;
      }function cd(a, b) {
        return String(a.lineNumberFormatter(b + a.firstLineNumber));
      }function q(a, b, c) {
        void 0 === c && (c = null);if (!(this instanceof q)) return new q(a, b, c);this.line = a;this.ch = b;this.sticky = c;
      }function A(a, b) {
        return a.line - b.line || a.ch - b.ch;
      }function dd(a, b) {
        return a.sticky == b.sticky && 0 == A(a, b);
      }function ed(a) {
        return q(a.line, a.ch);
      }function tc(a, b) {
        return 0 > A(a, b) ? b : a;
      }function uc(a, b) {
        return 0 > A(a, b) ? a : b;
      }function z(a, b) {
        if (b.line < a.first) return q(a.first, 0);var c = a.first + a.size - 1;if (b.line > c) return q(c, x(a, c).text.length);var c = x(a, b.line).text.length,
            d = b.ch,
            c = null == d || d > c ? q(b.line, c) : 0 > d ? q(b.line, 0) : b;return c;
      }function ee(a, b) {
        for (var c = [], d = 0; d < b.length; d++) c[d] = z(a, b[d]);return c;
      }function fe(a, b, c, d) {
        var e = [a.state.modeGen],
            f = {};ge(a, b.text, a.doc.mode, c, function (a, b) {
          return e.push(a, b);
        }, f, d);var g = c.state;d = function (d) {
          c.baseTokens = e;var h = a.state.overlays[d],
              m = 1,
              v = 0;c.state = !0;ge(a, b.text, h.mode, c, function (a, b) {
            for (var d = m; v < a;) {
              var c = e[m];c > a && e.splice(m, 1, a, e[m + 1], c);m += 2;v = Math.min(a, c);
            }if (b) if (h.opaque) e.splice(d, m - d, a, "overlay " + b), m = d + 2;else for (; d < m; d += 2) c = e[d + 1], e[d + 1] = (c ? c + " " : "") + "overlay " + b;
          }, f);c.state = g;c.baseTokens = null;c.baseTokenPos = 1;
        };for (var h = 0; h < a.state.overlays.length; ++h) d(h);return { styles: e, classes: f.bgClass || f.textClass ? f : null };
      }function he(a, b, c) {
        if (!b.styles || b.styles[0] != a.state.modeGen) {
          var d = Hb(a, G(b)),
              e = b.text.length > a.options.maxHighlightLength && Sa(a.doc.mode, d.state),
              f = fe(a, b, d);e && (d.state = e);b.stateAfter = d.save(!e);b.styles = f.styles;f.classes ? b.styleClasses = f.classes : b.styleClasses && (b.styleClasses = null);c === a.doc.highlightFrontier && (a.doc.modeFrontier = Math.max(a.doc.modeFrontier, ++a.doc.highlightFrontier));
        }return b.styles;
      }function Hb(a, b, c) {
        var d = a.doc,
            e = a.display;if (!d.mode.startState) return new ta(d, !0, b);var f = ng(a, b, c),
            g = f > d.first && x(d, f - 1).stateAfter,
            h = g ? ta.fromSaved(d, g, f) : new ta(d, de(d.mode), f);d.iter(f, b, function (d) {
          gd(a, d.text, h);var c = h.line;d.stateAfter = c == b - 1 || 0 == c % 5 || c >= e.viewFrom && c < e.viewTo ? h.save() : null;h.nextLine();
        });c && (d.modeFrontier = h.line);return h;
      }function gd(a, b, c, d) {
        var e = a.doc.mode;a = new N(b, a.options.tabSize, c);a.start = a.pos = d || 0;for ("" == b && ie(e, c.state); !a.eol();) hd(e, a, c.state), a.start = a.pos;
      }function ie(a, b) {
        if (a.blankLine) return a.blankLine(b);if (a.innerMode) {
          var c = ad(a, b);if (c.mode.blankLine) return c.mode.blankLine(c.state);
        }
      }function hd(a, b, c, d) {
        for (var e = 0; 10 > e; e++) {
          d && (d[0] = ad(a, c).mode);var f = a.token(b, c);if (b.pos > b.start) return f;
        }throw Error("Mode " + a.name + " failed to advance stream.");
      }function je(a, b, c, d) {
        var e = a.doc,
            f = e.mode,
            g;b = z(e, b);var h = x(e, b.line);
        c = Hb(a, b.line, c);a = new N(h.text, a.options.tabSize, c);var k;for (d && (k = []); (d || a.pos < b.ch) && !a.eol();) a.start = a.pos, g = hd(f, a, c.state), d && k.push(new ke(a, g, Sa(e.mode, c.state)));return d ? k : new ke(a, g, c.state);
      }function le(a, b) {
        if (a) for (;;) {
          var c = a.match(/(?:^|\s+)line-(background-)?(\S+)/);if (!c) break;a = a.slice(0, c.index) + a.slice(c.index + c[0].length);var d = c[1] ? "bgClass" : "textClass";null == b[d] ? b[d] = c[2] : new RegExp("(?:^|\\s)" + c[2] + "(?:$|\\s)").test(b[d]) || (b[d] += " " + c[2]);
        }return a;
      }function ge(a, b, c, d, e, f, g) {
        var h = c.flattenSpans;null == h && (h = a.options.flattenSpans);var k = 0,
            l = null,
            m = new N(b, a.options.tabSize, d),
            v,
            p = a.options.addModeClass && [null];for ("" == b && le(ie(c, d.state), f); !m.eol();) {
          m.pos > a.options.maxHighlightLength ? (h = !1, g && gd(a, b, d, m.pos), m.pos = b.length, v = null) : v = le(hd(c, m, d.state, p), f);if (p) {
            var r = p[0].name;r && (v = "m-" + (v ? r + " " + v : r));
          }if (!h || l != v) {
            for (; k < m.start;) k = Math.min(m.start, k + 5E3), e(k, l);l = v;
          }m.start = m.pos;
        }for (; k < m.pos;) a = Math.min(m.pos, k + 5E3), e(a, l), k = a;
      }function ng(a, b, c) {
        for (var d, e, f = a.doc, g = c ? -1 : b - (a.doc.mode.innerMode ? 1E3 : 100); b > g; --b) {
          if (b <= f.first) return f.first;var h = x(f, b - 1),
              k = h.stateAfter;if (k && (!c || b + (k instanceof vc ? k.lookAhead : 0) <= f.modeFrontier)) return b;h = U(h.text, null, a.options.tabSize);if (null == e || d > h) e = b - 1, d = h;
        }return e;
      }function og(a, b) {
        a.modeFrontier = Math.min(a.modeFrontier, b);if (!(a.highlightFrontier < b - 10)) {
          for (var c = a.first, d = b - 1; d > c; d--) {
            var e = x(a, d).stateAfter;if (e && (!(e instanceof vc) || d + e.lookAhead < b)) {
              c = d + 1;break;
            }
          }a.highlightFrontier = Math.min(a.highlightFrontier, c);
        }
      }function wc(a, b, c) {
        this.marker = a;this.from = b;this.to = c;
      }function Ib(a, b) {
        if (a) for (var c = 0; c < a.length; ++c) {
          var d = a[c];if (d.marker == b) return d;
        }
      }function id(a, b) {
        if (b.full) return null;var c = Gb(a, b.from.line) && x(a, b.from.line).markedSpans,
            d = Gb(a, b.to.line) && x(a, b.to.line).markedSpans;if (!c && !d) return null;var e = b.from.ch,
            f = b.to.ch,
            g = 0 == A(b.from, b.to),
            h;if (c) for (var k = 0; k < c.length; ++k) {
          var l = c[k],
              m = l.marker;if (null == l.from || (m.inclusiveLeft ? l.from <= e : l.from < e) || !(l.from != e || "bookmark" != m.type || g && l.marker.insertLeft)) {
            var v = null == l.to || (m.inclusiveRight ? l.to >= e : l.to > e);(h || (h = [])).push(new wc(m, l.from, v ? null : l.to));
          }
        }var c = h,
            p;if (d) for (h = 0; h < d.length; ++h) if (k = d[h], l = k.marker, null == k.to || (l.inclusiveRight ? k.to >= f : k.to > f) || k.from == f && "bookmark" == l.type && (!g || k.marker.insertLeft)) m = null == k.from || (l.inclusiveLeft ? k.from <= f : k.from < f), (p || (p = [])).push(new wc(l, m ? null : k.from - f, null == k.to ? null : k.to - f));d = p;f = 1 == b.text.length;g = D(b.text).length + (f ? e : 0);if (c) for (p = 0; p < c.length; ++p) if (h = c[p], null == h.to) (k = Ib(d, h.marker), k) ? f && (h.to = null == k.to ? null : k.to + g) : h.to = e;if (d) for (e = 0; e < d.length; ++e) p = d[e], null != p.to && (p.to += g), null == p.from ? Ib(c, p.marker) || (p.from = g, f && (c || (c = [])).push(p)) : (p.from += g, f && (c || (c = [])).push(p));c && (c = me(c));d && d != c && (d = me(d));e = [c];if (!f) {
          var f = b.text.length - 2,
              r;if (0 < f && c) for (g = 0; g < c.length; ++g) null == c[g].to && (r || (r = [])).push(new wc(c[g].marker, null, null));for (c = 0; c < f; ++c) e.push(r);e.push(d);
        }return e;
      }function me(a) {
        for (var b = 0; b < a.length; ++b) {
          var c = a[b];null != c.from && c.from == c.to && !1 !== c.marker.clearWhenEmpty && a.splice(b--, 1);
        }return a.length ? a : null;
      }function pg(a, b, c) {
        var d = null;a.iter(b.line, c.line + 1, function (a) {
          if (a.markedSpans) for (var b = 0; b < a.markedSpans.length; ++b) {
            var c = a.markedSpans[b].marker;!c.readOnly || d && -1 != O(d, c) || (d || (d = [])).push(c);
          }
        });if (!d) return null;a = [{ from: b, to: c }];for (b = 0; b < d.length; ++b) {
          c = d[b];for (var e = c.find(0), f = 0; f < a.length; ++f) {
            var g = a[f];if (!(0 > A(g.to, e.from) || 0 < A(g.from, e.to))) {
              var h = [f, 1],
                  k = A(g.from, e.from),
                  l = A(g.to, e.to);(0 > k || !c.inclusiveLeft && !k) && h.push({ from: g.from, to: e.from });
              (0 < l || !c.inclusiveRight && !l) && h.push({ from: e.to, to: g.to });a.splice.apply(a, h);f += h.length - 3;
            }
          }
        }return a;
      }function ne(a) {
        var b = a.markedSpans;if (b) {
          for (var c = 0; c < b.length; ++c) b[c].marker.detachLine(a);a.markedSpans = null;
        }
      }function oe(a, b) {
        if (b) {
          for (var c = 0; c < b.length; ++c) b[c].marker.attachLine(a);a.markedSpans = b;
        }
      }function jd(a, b) {
        var c = a.lines.length - b.lines.length;if (0 != c) return c;var c = a.find(),
            d = b.find(),
            e = A(c.from, d.from) || (a.inclusiveLeft ? -1 : 0) - (b.inclusiveLeft ? -1 : 0);return e ? -e : (c = A(c.to, d.to) || (a.inclusiveRight ? 1 : 0) - (b.inclusiveRight ? 1 : 0)) ? c : b.id - a.id;
      }function lb(a, b) {
        var c = Ca && a.markedSpans,
            d;if (c) for (var e = void 0, f = 0; f < c.length; ++f) e = c[f], e.marker.collapsed && null == (b ? e.from : e.to) && (!d || 0 > jd(d, e.marker)) && (d = e.marker);return d;
      }function pe(a, b, c, d, e) {
        a = x(a, b);if (a = Ca && a.markedSpans) for (b = 0; b < a.length; ++b) {
          var f = a[b];if (f.marker.collapsed) {
            var g = f.marker.find(0),
                h = A(g.from, c) || (f.marker.inclusiveLeft ? -1 : 0) - (e.inclusiveLeft ? -1 : 0),
                k = A(g.to, d) || (f.marker.inclusiveRight ? 1 : 0) - (e.inclusiveRight ? 1 : 0);if (!(0 <= h && 0 >= k || 0 >= h && 0 <= k) && (0 >= h && (f.marker.inclusiveRight && e.inclusiveLeft ? 0 <= A(g.to, c) : 0 < A(g.to, c)) || 0 <= h && (f.marker.inclusiveRight && e.inclusiveLeft ? 0 >= A(g.from, d) : 0 > A(g.from, d)))) return !0;
          }
        }
      }function ua(a) {
        for (var b; b = lb(a, !0);) a = b.find(-1, !0).line;return a;
      }function kd(a, b) {
        var c = x(a, b),
            d = ua(c);return c == d ? b : G(d);
      }function qe(a, b) {
        if (b > a.lastLine()) return b;var c = x(a, b),
            d;if (!Ha(a, c)) return b;for (; d = lb(c, !1);) c = d.find(1, !0).line;return G(c) + 1;
      }function Ha(a, b) {
        var c = Ca && b.markedSpans;if (c) for (var d = void 0, e = 0; e < c.length; ++e) if (d = c[e], d.marker.collapsed && (null == d.from || !d.marker.widgetNode && 0 == d.from && d.marker.inclusiveLeft && ld(a, b, d))) return !0;
      }function ld(a, b, c) {
        if (null == c.to) return b = c.marker.find(1, !0), ld(a, b.line, Ib(b.line.markedSpans, c.marker));if (c.marker.inclusiveRight && c.to == b.text.length) return !0;for (var d = void 0, e = 0; e < b.markedSpans.length; ++e) if (d = b.markedSpans[e], d.marker.collapsed && !d.marker.widgetNode && d.from == c.to && (null == d.to || d.to != c.from) && (d.marker.inclusiveLeft || c.marker.inclusiveRight) && ld(a, b, d)) return !0;
      }function va(a) {
        a = ua(a);for (var b = 0, c = a.parent, d = 0; d < c.lines.length; ++d) {
          var e = c.lines[d];if (e == a) break;else b += e.height;
        }for (a = c.parent; a; c = a, a = c.parent) for (d = 0; d < a.children.length && (e = a.children[d], e != c); ++d) b += e.height;return b;
      }function xc(a) {
        if (0 == a.height) return 0;for (var b = a.text.length, c, d = a; c = lb(d, !0);) c = c.find(0, !0), d = c.from.line, b += c.from.ch - c.to.ch;for (d = a; c = lb(d, !1);) a = c.find(0, !0), b -= d.text.length - a.from.ch, d = a.to.line, b += d.text.length - a.to.ch;return b;
      }function md(a) {
        var b = a.display;a = a.doc;b.maxLine = x(a, a.first);b.maxLineLength = xc(b.maxLine);b.maxLineChanged = !0;a.iter(function (a) {
          var d = xc(a);d > b.maxLineLength && (b.maxLineLength = d, b.maxLine = a);
        });
      }function re(a, b) {
        if (!a || /^\s*$/.test(a)) return null;var c = b.addModeClass ? qg : rg;return c[a] || (c[a] = a.replace(/\S+/g, "cm-$\x26"));
      }function se(a, b) {
        var c = ra("span", null, null, V ? "padding-right: .1px" : null),
            c = { pre: ra("pre", [c], "CodeMirror-line"), content: c, col: 0, pos: 0, cm: a, trailingSpace: !1, splitSpaces: a.getOption("lineWrapping") };b.measure = {};for (var d = 0; d <= (b.rest ? b.rest.length : 0); d++) {
          var e = d ? b.rest[d - 1] : b.line,
              f = void 0;c.pos = 0;c.addToken = sg;var g = a.display.measure;if (null != nd) g = nd;else {
            var h = Y(g, document.createTextNode("AخA")),
                k = mb(h, 0, 1).getBoundingClientRect(),
                h = mb(h, 1, 2).getBoundingClientRect();ca(g);g = k && k.left != k.right ? nd = 3 > h.right - k.right : !1;
          }g && (f = n(e, a.doc.direction)) && (c.addToken = tg(c.addToken, f));c.map = [];g = b != a.display.externalMeasured && G(e);a: {
            f = c;g = he(a, e, g);var l = e.markedSpans,
                k = e.text,
                h = 0;if (l) for (var m = k.length, v = 0, p = 1, r = "", fd = void 0, q = void 0, u = 0, x = void 0, w = void 0, F = void 0, y = void 0, A = void 0;;) {
              if (u == v) {
                for (var x = w = F = q = "", y = A = null, u = Infinity, z = [], da = void 0, D = 0; D < l.length; ++D) {
                  var B = l[D],
                      C = B.marker;if ("bookmark" == C.type && B.from == v && C.widgetNode) z.push(C);else if (B.from <= v && (null == B.to || B.to > v || C.collapsed && B.to == v && B.from == v)) {
                    null != B.to && B.to != v && u > B.to && (u = B.to, w = "");C.className && (x += " " + C.className);C.css && (q = (q ? q + ";" : "") + C.css);C.startStyle && B.from == v && (F += " " + C.startStyle);C.endStyle && B.to == u && (da || (da = [])).push(C.endStyle, B.to);C.title && ((A || (A = {})).title = C.title);if (C.attributes) for (var E in C.attributes) (A || (A = {}))[E] = C.attributes[E];C.collapsed && (!y || 0 > jd(y.marker, C)) && (y = B);
                  } else B.from > v && u > B.from && (u = B.from);
                }if (da) for (D = 0; D < da.length; D += 2) da[D + 1] == u && (w += " " + da[D]);if (!y || y.from == v) for (da = 0; da < z.length; ++da) te(f, 0, z[da]);if (y && (y.from || 0) == v) {
                  te(f, (null == y.to ? m + 1 : y.to) - v, y.marker, null == y.from);if (null == y.to) break a;y.to == v && (y = !1);
                }
              }if (v >= m) break;for (z = Math.min(m, u);;) {
                if (r) {
                  da = v + r.length;
                  y || (D = da > z ? r.slice(0, z - v) : r, f.addToken(f, D, fd ? fd + x : x, F, v + D.length == u ? w : "", q, A));if (da >= z) {
                    r = r.slice(z - v);v = z;break;
                  }v = da;F = "";
                }r = k.slice(h, h = g[p++]);fd = re(g[p++], f.cm.options);
              }
            } else for (l = 1; l < g.length; l += 2) f.addToken(f, k.slice(h, h = g[l]), re(g[l + 1], f.cm.options));
          }e.styleClasses && (e.styleClasses.bgClass && (c.bgClass = Pa(e.styleClasses.bgClass, c.bgClass || "")), e.styleClasses.textClass && (c.textClass = Pa(e.styleClasses.textClass, c.textClass || "")));0 == c.map.length && c.map.push(0, 0, c.content.appendChild(kg(a.display.measure)));
          0 == d ? (b.measure.map = c.map, b.measure.cache = {}) : ((b.measure.maps || (b.measure.maps = [])).push(c.map), (b.measure.caches || (b.measure.caches = [])).push({}));
        }V && (E = c.content.lastChild, /\bcm-tab\b/.test(E.className) || E.querySelector && E.querySelector(".cm-tab")) && (c.content.className = "cm-tab-wrap-hack");t(a, "renderLine", a, b.line, c.pre);c.pre.className && (c.textClass = Pa(c.pre.className, c.textClass || ""));return c;
      }function ug(a) {
        var b = w("span", "•", "cm-invalidchar");b.title = "\\u" + a.charCodeAt(0).toString(16);b.setAttribute("aria-label", b.title);return b;
      }function sg(a, b, c, d, e, f, g) {
        if (b) {
          var h;if (a.splitSpaces) {
            if (h = a.trailingSpace, 1 < b.length && !/  /.test(b)) h = b;else {
              for (var k = "", l = 0; l < b.length; l++) {
                var m = b.charAt(l);" " != m || !h || l != b.length - 1 && 32 != b.charCodeAt(l + 1) || (m = " ");k += m;h = " " == m;
              }h = k;
            }
          } else h = b;k = h;l = a.cm.state.specialChars;m = !1;if (l.test(b)) {
            h = document.createDocumentFragment();for (var v = 0;;) {
              l.lastIndex = v;var p = l.exec(b),
                  r = p ? p.index - v : b.length - v;if (r) {
                var n = document.createTextNode(k.slice(v, v + r));B && 9 > H ? h.appendChild(w("span", [n])) : h.appendChild(n);a.map.push(a.pos, a.pos + r, n);a.col += r;a.pos += r;
              }if (!p) break;v += r + 1;r = void 0;"\t" == p[0] ? (p = a.cm.options.tabSize, p -= a.col % p, r = h.appendChild(w("span", fb(p), "cm-tab")), r.setAttribute("role", "presentation"), r.setAttribute("cm-text", "\t"), a.col += p) : ("\r" == p[0] || "\n" == p[0] ? (r = h.appendChild(w("span", "\r" == p[0] ? "␍" : "␤", "cm-invalidchar")), r.setAttribute("cm-text", p[0])) : (r = a.cm.options.specialCharPlaceholder(p[0]), r.setAttribute("cm-text", p[0]), B && 9 > H ? h.appendChild(w("span", [r])) : h.appendChild(r)), a.col += 1);a.map.push(a.pos, a.pos + 1, r);a.pos++;
            }
          } else a.col += b.length, h = document.createTextNode(k), a.map.push(a.pos, a.pos + b.length, h), B && 9 > H && (m = !0), a.pos += b.length;a.trailingSpace = 32 == k.charCodeAt(b.length - 1);if (c || d || e || m || f || g) {
            b = c || "";d && (b += d);e && (b += e);d = w("span", [h], b, f);if (g) for (var q in g) g.hasOwnProperty(q) && "style" != q && "class" != q && d.setAttribute(q, g[q]);return a.content.appendChild(d);
          }a.content.appendChild(h);
        }
      }function tg(a, b) {
        return function (c, d, e, f, g, h, k) {
          e = e ? e + " cm-force-border" : "cm-force-border";
          for (var l = c.pos, m = l + d.length;;) {
            for (var v = void 0, p = 0; p < b.length && !(v = b[p], v.to > l && v.from <= l); p++);if (v.to >= m) return a(c, d, e, f, g, h, k);a(c, d.slice(0, v.to - l), e, f, null, h, k);f = null;d = d.slice(v.to - l);l = v.to;
          }
        };
      }function te(a, b, c, d) {
        var e = !d && c.widgetNode;e && a.map.push(a.pos, a.pos + b, e);!d && a.cm.display.input.needsContentAttribute && (e || (e = a.content.appendChild(document.createElement("span"))), e.setAttribute("cm-marker", c.id));e && (a.cm.display.input.setUneditable(e), a.content.appendChild(e));a.pos += b;a.trailingSpace = !1;
      }function ue(a, b, c) {
        for (var d = this.line = b, e; d = lb(d, !1);) d = d.find(1, !0).line, (e || (e = [])).push(d);this.size = (this.rest = e) ? G(D(this.rest)) - c + 1 : 1;this.node = this.text = null;this.hidden = Ha(a, b);
      }function yc(a, b, c) {
        var d = [],
            e;for (e = b; e < c;) b = new ue(a.doc, x(a.doc, e), e), e += b.size, d.push(b);return d;
      }function vg(a, b) {
        var c = a.ownsGroup;if (c) try {
          var d = c.delayedCallbacks,
              e = 0;do {
            for (; e < d.length; e++) d[e].call(null);for (var f = 0; f < c.ops.length; f++) {
              var g = c.ops[f];if (g.cursorActivityHandlers) for (; g.cursorActivityCalled < g.cursorActivityHandlers.length;) g.cursorActivityHandlers[g.cursorActivityCalled++].call(null, g.cm);
            }
          } while (e < d.length);
        } finally {
          nb = null, b(c);
        }
      }function R(a, b) {
        var c = a._handlers && a._handlers[b] || rc;if (c.length) {
          var d = Array.prototype.slice.call(arguments, 2),
              e;nb ? e = nb.delayedCallbacks : Jb ? e = Jb : (e = Jb = [], setTimeout(wg, 0));for (var f = function (a) {
            e.push(function () {
              return c[a].apply(null, d);
            });
          }, g = 0; g < c.length; ++g) f(g);
        }
      }function wg() {
        var a = Jb;Jb = null;for (var b = 0; b < a.length; ++b) a[b]();
      }function ve(a, b, c, d) {
        for (var e = 0; e < b.changes.length; e++) {
          var f = b.changes[e];if ("text" == f) {
            var f = a,
                g = b,
                h = g.text.className,
                k = we(f, g);g.text == g.node && (g.node = k.pre);g.text.parentNode.replaceChild(k.pre, g.text);g.text = k.pre;k.bgClass != g.bgClass || k.textClass != g.textClass ? (g.bgClass = k.bgClass, g.textClass = k.textClass, od(f, g)) : h && (g.text.className = h);
          } else if ("gutter" == f) xe(a, b, c, d);else if ("class" == f) od(a, b);else if ("widget" == f) {
            f = a;g = b;h = d;g.alignable && (g.alignable = null);for (var k = M("CodeMirror-linewidget"), l = g.node.firstChild, m = void 0; l; l = m) m = l.nextSibling, k.test(l.className) && g.node.removeChild(l);ye(f, g, h);
          }
        }b.changes = null;
      }function Kb(a) {
        a.node == a.text && (a.node = w("div", null, null, "position: relative"), a.text.parentNode && a.text.parentNode.replaceChild(a.node, a.text), a.node.appendChild(a.text), B && 8 > H && (a.node.style.zIndex = 2));return a.node;
      }function we(a, b) {
        var c = a.display.externalMeasured;return c && c.line == b.line ? (a.display.externalMeasured = null, b.measure = c.measure, c.built) : se(a, b);
      }function od(a, b) {
        var c = b.bgClass ? b.bgClass + " " + (b.line.bgClass || "") : b.line.bgClass;c && (c += " CodeMirror-linebackground");if (b.background) c ? b.background.className = c : (b.background.parentNode.removeChild(b.background), b.background = null);else if (c) {
          var d = Kb(b);b.background = d.insertBefore(w("div", null, c), d.firstChild);a.display.input.setUneditable(b.background);
        }b.line.wrapClass ? Kb(b).className = b.line.wrapClass : b.node != b.text && (b.node.className = "");b.text.className = (b.textClass ? b.textClass + " " + (b.line.textClass || "") : b.line.textClass) || "";
      }function xe(a, b, c, d) {
        b.gutter && (b.node.removeChild(b.gutter), b.gutter = null);b.gutterBackground && (b.node.removeChild(b.gutterBackground), b.gutterBackground = null);if (b.line.gutterClass) {
          var e = Kb(b);b.gutterBackground = w("div", null, "CodeMirror-gutter-background " + b.line.gutterClass, "left: " + (a.options.fixedGutter ? d.fixedPos : -d.gutterTotalWidth) + "px; width: " + d.gutterTotalWidth + "px");a.display.input.setUneditable(b.gutterBackground);e.insertBefore(b.gutterBackground, b.text);
        }e = b.line.gutterMarkers;if (a.options.lineNumbers || e) {
          var f = Kb(b),
              g = b.gutter = w("div", null, "CodeMirror-gutter-wrapper", "left: " + (a.options.fixedGutter ? d.fixedPos : -d.gutterTotalWidth) + "px");a.display.input.setUneditable(g);f.insertBefore(g, b.text);b.line.gutterClass && (g.className += " " + b.line.gutterClass);!a.options.lineNumbers || e && e["CodeMirror-linenumbers"] || (b.lineNumber = g.appendChild(w("div", cd(a.options, c), "CodeMirror-linenumber CodeMirror-gutter-elt", "left: " + d.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + a.display.lineNumInnerWidth + "px")));if (e) for (b = 0; b < a.display.gutterSpecs.length; ++b) c = a.display.gutterSpecs[b].className, (f = e.hasOwnProperty(c) && e[c]) && g.appendChild(w("div", [f], "CodeMirror-gutter-elt", "left: " + d.gutterLeft[c] + "px; width: " + d.gutterWidth[c] + "px"));
        }
      }function xg(a, b, c, d) {
        var e = we(a, b);b.text = b.node = e.pre;e.bgClass && (b.bgClass = e.bgClass);e.textClass && (b.textClass = e.textClass);od(a, b);xe(a, b, c, d);ye(a, b, d);return b.node;
      }function ye(a, b, c) {
        ze(a, b.line, b, c, !0);if (b.rest) for (var d = 0; d < b.rest.length; d++) ze(a, b.rest[d], b, c, !1);
      }function ze(a, b, c, d, e) {
        if (b.widgets) {
          var f = Kb(c),
              g = 0;for (b = b.widgets; g < b.length; ++g) {
            var h = b[g],
                k = w("div", [h.node], "CodeMirror-linewidget" + (h.className ? " " + h.className : ""));h.handleMouseEvents || k.setAttribute("cm-ignore-events", "true");var l = h,
                m = k,
                v = d;if (l.noHScroll) {
              (c.alignable || (c.alignable = [])).push(m);var p = v.wrapperWidth;m.style.left = v.fixedPos + "px";l.coverGutter || (p -= v.gutterTotalWidth, m.style.paddingLeft = v.gutterTotalWidth + "px");m.style.width = p + "px";
            }l.coverGutter && (m.style.zIndex = 5, m.style.position = "relative", l.noHScroll || (m.style.marginLeft = -v.gutterTotalWidth + "px"));a.display.input.setUneditable(k);e && h.above ? f.insertBefore(k, c.gutter || c.text) : f.appendChild(k);R(h, "redraw");
          }
        }
      }function Lb(a) {
        if (null != a.height) return a.height;var b = a.doc.cm;if (!b) return 0;if (!T(document.body, a.node)) {
          var c = "position: relative;";a.coverGutter && (c += "margin-left: -" + b.display.gutters.offsetWidth + "px;");a.noHScroll && (c += "width: " + b.display.wrapper.clientWidth + "px;");Y(b.display.measure, w("div", [a.node], null, c));
        }return a.height = a.node.parentNode.offsetHeight;
      }function Da(a, b) {
        for (var c = b.target || b.srcElement; c != a.wrapper; c = c.parentNode) if (!c || 1 == c.nodeType && "true" == c.getAttribute("cm-ignore-events") || c.parentNode == a.sizer && c != a.mover) return !0;
      }function pd(a) {
        return a.mover.offsetHeight - a.lineSpace.offsetHeight;
      }function Ae(a) {
        if (a.cachedPaddingH) return a.cachedPaddingH;var b = Y(a.measure, w("pre", "x", "CodeMirror-line-like")),
            b = window.getComputedStyle ? window.getComputedStyle(b) : b.currentStyle,
            b = { left: parseInt(b.paddingLeft), right: parseInt(b.paddingRight) };
        isNaN(b.left) || isNaN(b.right) || (a.cachedPaddingH = b);return b;
      }function wa(a) {
        return 50 - a.display.nativeBarWidth;
      }function Va(a) {
        return a.display.scroller.clientWidth - wa(a) - a.display.barWidth;
      }function qd(a) {
        return a.display.scroller.clientHeight - wa(a) - a.display.barHeight;
      }function Be(a, b, c) {
        if (a.line == b) return { map: a.measure.map, cache: a.measure.cache };for (var d = 0; d < a.rest.length; d++) if (a.rest[d] == b) return { map: a.measure.maps[d], cache: a.measure.caches[d] };for (b = 0; b < a.rest.length; b++) if (G(a.rest[b]) > c) return { map: a.measure.maps[b],
          cache: a.measure.caches[b], before: !0 };
      }function rd(a, b) {
        if (b >= a.display.viewFrom && b < a.display.viewTo) return a.display.view[Wa(a, b)];var c = a.display.externalMeasured;if (c && b >= c.lineN && b < c.lineN + c.size) return c;
      }function Xa(a, b) {
        var c = G(b),
            d = rd(a, c);d && !d.text ? d = null : d && d.changes && (ve(a, d, c, sd(a)), a.curOp.forceUpdate = !0);if (!d) {
          var e = ua(b);d = G(e);e = a.display.externalMeasured = new ue(a.doc, e, d);e.lineN = d;d = e.built = se(a, e);e.text = d.pre;Y(a.display.lineMeasure, d.pre);d = e;
        }c = Be(d, b, c);return { line: b, view: d,
          rect: null, map: c.map, cache: c.cache, before: c.before, hasHeights: !1 };
      }function na(a, b, c, d, e) {
        b.before && (c = -1);var f = c + (d || "");if (b.cache.hasOwnProperty(f)) a = b.cache[f];else {
          b.rect || (b.rect = b.view.text.getBoundingClientRect());if (!b.hasHeights) {
            var g = b.view,
                h = b.rect,
                k = a.options.lineWrapping,
                l = k && Va(a);if (!g.measure.heights || k && g.measure.width != l) {
              var m = g.measure.heights = [];if (k) for (g.measure.width = l, g = g.text.firstChild.getClientRects(), k = 0; k < g.length - 1; k++) {
                var l = g[k],
                    v = g[k + 1];2 < Math.abs(l.bottom - v.bottom) && m.push((l.bottom + v.top) / 2 - h.top);
              }m.push(h.bottom - h.top);
            }b.hasHeights = !0;
          }m = d;g = Ce(b.map, c, m);d = g.node;h = g.start;k = g.end;c = g.collapse;var p;if (3 == d.nodeType) {
            for (var r = 0; 4 > r; r++) {
              for (; h && K(b.line.text.charAt(g.coverStart + h));) --h;for (; g.coverStart + k < g.coverEnd && K(b.line.text.charAt(g.coverStart + k));) ++k;if (B && 9 > H && 0 == h && k == g.coverEnd - g.coverStart) p = d.parentNode.getBoundingClientRect();else {
                p = mb(d, h, k).getClientRects();k = De;if ("left" == m) for (l = 0; l < p.length && (k = p[l]).left == k.right; l++);else for (l = p.length - 1; 0 <= l && (k = p[l]).left == k.right; l--);p = k;
              }if (p.left || p.right || 0 == h) break;k = h;--h;c = "right";
            }B && 11 > H && ((r = !window.screen || null == screen.logicalXDPI || screen.logicalXDPI == screen.deviceXDPI) || (null != td ? r = td : (m = Y(a.display.measure, w("span", "x")), r = m.getBoundingClientRect(), m = mb(m, 0, 1).getBoundingClientRect(), r = td = 1 < Math.abs(r.left - m.left)), r = !r), r || (r = screen.logicalXDPI / screen.deviceXDPI, m = screen.logicalYDPI / screen.deviceYDPI, p = { left: p.left * r, right: p.right * r, top: p.top * m, bottom: p.bottom * m }));
          } else 0 < h && (c = m = "right"), p = a.options.lineWrapping && 1 < (r = d.getClientRects()).length ? r["right" == m ? r.length - 1 : 0] : d.getBoundingClientRect();!(B && 9 > H) || h || p && (p.left || p.right) || (p = (p = d.parentNode.getClientRects()[0]) ? { left: p.left, right: p.left + ob(a.display), top: p.top, bottom: p.bottom } : De);d = p.top - b.rect.top;h = p.bottom - b.rect.top;r = (d + h) / 2;m = b.view.measure.heights;for (g = 0; g < m.length - 1 && !(r < m[g]); g++);c = { left: ("right" == c ? p.right : p.left) - b.rect.left, right: ("left" == c ? p.left : p.right) - b.rect.left, top: g ? m[g - 1] : 0, bottom: m[g] };
          p.left || p.right || (c.bogus = !0);a.options.singleCursorHeightPerLine || (c.rtop = d, c.rbottom = h);a = c;a.bogus || (b.cache[f] = a);
        }return { left: a.left, right: a.right, top: e ? a.rtop : a.top, bottom: e ? a.rbottom : a.bottom };
      }function Ce(a, b, c) {
        for (var d, e, f, g, h, k, l = 0; l < a.length; l += 3) {
          h = a[l];k = a[l + 1];if (b < h) e = 0, f = 1, g = "left";else if (b < k) e = b - h, f = e + 1;else if (l == a.length - 3 || b == k && a[l + 3] > b) f = k - h, e = f - 1, b >= k && (g = "right");if (null != e) {
            d = a[l + 2];h == k && c == (d.insertLeft ? "left" : "right") && (g = c);if ("left" == c && 0 == e) for (; l && a[l - 2] == a[l - 3] && a[l - 1].insertLeft;) d = a[(l -= 3) + 2], g = "left";if ("right" == c && e == k - h) for (; l < a.length - 3 && a[l + 3] == a[l + 4] && !a[l + 5].insertLeft;) d = a[(l += 3) + 2], g = "right";break;
          }
        }return { node: d, start: e, end: f, collapse: g, coverStart: h, coverEnd: k };
      }function Ee(a) {
        if (a.measure && (a.measure.cache = {}, a.measure.heights = null, a.rest)) for (var b = 0; b < a.rest.length; b++) a.measure.caches[b] = {};
      }function Fe(a) {
        a.display.externalMeasure = null;ca(a.display.lineMeasure);for (var b = 0; b < a.display.view.length; b++) Ee(a.display.view[b]);
      }function Mb(a) {
        Fe(a);
        a.display.cachedCharWidth = a.display.cachedTextHeight = a.display.cachedPaddingH = null;a.options.lineWrapping || (a.display.maxLineChanged = !0);a.display.lineNumChars = null;
      }function Ge() {
        return zc && Ac ? -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) : window.pageXOffset || (document.documentElement || document.body).scrollLeft;
      }function He() {
        return zc && Ac ? -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) : window.pageYOffset || (document.documentElement || document.body).scrollTop;
      }function ud(a) {
        var b = 0;if (a.widgets) for (var c = 0; c < a.widgets.length; ++c) a.widgets[c].above && (b += Lb(a.widgets[c]));return b;
      }function Bc(a, b, c, d, e) {
        e || (e = ud(b), c.top += e, c.bottom += e);if ("line" == d) return c;d || (d = "local");b = va(b);b = "local" == d ? b + a.display.lineSpace.offsetTop : b - a.display.viewOffset;if ("page" == d || "window" == d) a = a.display.lineSpace.getBoundingClientRect(), b += a.top + ("window" == d ? 0 : He()), d = a.left + ("window" == d ? 0 : Ge()), c.left += d, c.right += d;c.top += b;c.bottom += b;return c;
      }function Ie(a, b, c) {
        if ("div" == c) return b;var d = b.left;b = b.top;"page" == c ? (d -= Ge(), b -= He()) : "local" != c && c || (c = a.display.sizer.getBoundingClientRect(), d += c.left, b += c.top);a = a.display.lineSpace.getBoundingClientRect();return { left: d - a.left, top: b - a.top };
      }function vd(a, b, c, d, e) {
        d || (d = x(a.doc, b.line));var f = d;b = b.ch;d = na(a, Xa(a, d), b, e);return Bc(a, f, d, c);
      }function oa(a, b, c, d, e, f) {
        function g(b, g) {
          var h = na(a, e, b, g ? "right" : "left", f);g ? h.left = h.right : h.right = h.left;return Bc(a, d, h, c);
        }function h(a, b, d) {
          return g(d ? a - 1 : a, 1 == k[b].level != d);
        }d = d || x(a.doc, b.line);e || (e = Xa(a, d));var k = n(d, a.doc.direction),
            l = b.ch;b = b.sticky;l >= d.text.length ? (l = d.text.length, b = "before") : 0 >= l && (l = 0, b = "after");if (!k) return g("before" == b ? l - 1 : l, "before" == b);var m = J(k, l, b),
            v = Eb,
            m = h(l, m, "before" == b);null != v && (m.other = h(l, v, "before" != b));return m;
      }function Je(a, b) {
        var c = 0;b = z(a.doc, b);a.options.lineWrapping || (c = ob(a.display) * b.ch);var d = x(a.doc, b.line),
            e = va(d) + a.display.lineSpace.offsetTop;return { left: c, right: c, top: e, bottom: e + d.height };
      }function wd(a, b, c, d, e) {
        a = q(a, b, c);a.xRel = e;d && (a.outside = d);return a;
      }function xd(a, b, c) {
        var d = a.doc;c += a.display.viewOffset;if (0 > c) return wd(d.first, 0, null, -1, -1);var e = Ua(d, c),
            f = d.first + d.size - 1;if (e > f) return wd(d.first + d.size - 1, x(d, f).text.length, null, 1, 1);0 > b && (b = 0);for (var g = x(d, e);;) {
          var f = yg(a, g, e, b, c),
              h;h = f.ch + (0 < f.xRel || 0 < f.outside ? 1 : 0);var g = Ca && g.markedSpans,
              k = void 0;if (g) for (var l = 0; l < g.length; ++l) {
            var m = g[l];m.marker.collapsed && (null == m.from || m.from < h) && (null == m.to || m.to > h) && (!k || 0 > jd(k, m.marker)) && (k = m.marker);
          }h = k;if (!h) return f;f = h.find(1);if (f.line == e) return f;g = x(d, e = f.line);
        }
      }function Ke(a, b, c, d) {
        d -= ud(b);b = b.text.length;var e = ja(function (b) {
          return na(a, c, b - 1).bottom <= d;
        }, b, 0);b = ja(function (b) {
          return na(a, c, b).top > d;
        }, e, b);return { begin: e, end: b };
      }function Le(a, b, c, d) {
        c || (c = Xa(a, b));d = Bc(a, b, na(a, c, d), "line").top;return Ke(a, b, c, d);
      }function yd(a, b, c, d) {
        return a.bottom <= c ? !1 : a.top > c ? !0 : (d ? a.left : a.right) > b;
      }function yg(a, b, c, d, e) {
        e -= va(b);var f = Xa(a, b),
            g = ud(b),
            h = 0,
            k = b.text.length,
            l = !0,
            m = n(b, a.doc.direction);m && (m = (a.options.lineWrapping ? zg : Ag)(a, b, c, f, m, d, e), h = (l = 1 != m.level) ? m.from : m.to - 1, k = l ? m.to : m.from - 1);var v = null,
            p = null,
            m = ja(function (b) {
          var c = na(a, f, b);c.top += g;c.bottom += g;if (!yd(c, d, e, !1)) return !1;c.top <= e && c.left <= d && (v = b, p = c);return !0;
        }, h, k),
            r = !1;p ? (h = d - p.left < p.right - d, l = h == l, m = v + (l ? 0 : 1), l = l ? "after" : "before", h = h ? p.left : p.right) : (l || m != k && m != h || m++, l = 0 == m ? "after" : m == b.text.length ? "before" : na(a, f, m - (l ? 1 : 0)).bottom + g <= e == l ? "after" : "before", r = oa(a, q(c, m, l), "line", b, f), h = r.left, r = e < r.top ? -1 : e >= r.bottom ? 1 : 0);m = Db(b.text, m, 1);return wd(c, m, l, r, d - h);
      }function Ag(a, b, c, d, e, f, g) {
        var h = ja(function (h) {
          h = e[h];var k = 1 != h.level;return yd(oa(a, q(c, k ? h.to : h.from, k ? "before" : "after"), "line", b, d), f, g, !0);
        }, 0, e.length - 1),
            k = e[h];if (0 < h) {
          var l = 1 != k.level,
              l = oa(a, q(c, l ? k.from : k.to, l ? "after" : "before"), "line", b, d);yd(l, f, g, !0) && l.top > g && (k = e[h - 1]);
        }return k;
      }function zg(a, b, c, d, e, f, g) {
        g = Ke(a, b, d, g);c = g.begin;g = g.end;/\s/.test(b.text.charAt(g - 1)) && g--;for (var h = b = null, k = 0; k < e.length; k++) {
          var l = e[k];if (!(l.from >= g || l.to <= c)) {
            var m = na(a, d, 1 != l.level ? Math.min(g, l.to) - 1 : Math.max(c, l.from)).right,
                m = m < f ? f - m + 1E9 : m - f;if (!b || h > m) b = l, h = m;
          }
        }b || (b = e[e.length - 1]);b.from < c && (b = { from: c, to: b.to, level: b.level });b.to > g && (b = { from: b.from, to: g, level: b.level });return b;
      }function pb(a) {
        if (null != a.cachedTextHeight) return a.cachedTextHeight;if (null == Ya) {
          Ya = w("pre", null, "CodeMirror-line-like");for (var b = 0; 49 > b; ++b) Ya.appendChild(document.createTextNode("x")), Ya.appendChild(w("br"));Ya.appendChild(document.createTextNode("x"));
        }Y(a.measure, Ya);b = Ya.offsetHeight / 50;3 < b && (a.cachedTextHeight = b);ca(a.measure);return b || 1;
      }function ob(a) {
        if (null != a.cachedCharWidth) return a.cachedCharWidth;var b = w("span", "xxxxxxxxxx"),
            c = w("pre", [b], "CodeMirror-line-like");Y(a.measure, c);b = b.getBoundingClientRect();b = (b.right - b.left) / 10;2 < b && (a.cachedCharWidth = b);return b || 10;
      }function sd(a) {
        for (var b = a.display, c = {}, d = {}, e = b.gutters.clientLeft, f = b.gutters.firstChild, g = 0; f; f = f.nextSibling, ++g) {
          var h = a.display.gutterSpecs[g].className;c[h] = f.offsetLeft + f.clientLeft + e;d[h] = f.clientWidth;
        }return { fixedPos: zd(b), gutterTotalWidth: b.gutters.offsetWidth, gutterLeft: c, gutterWidth: d, wrapperWidth: b.wrapper.clientWidth };
      }function zd(a) {
        return a.scroller.getBoundingClientRect().left - a.sizer.getBoundingClientRect().left;
      }function Me(a) {
        var b = pb(a.display),
            c = a.options.lineWrapping,
            d = c && Math.max(5, a.display.scroller.clientWidth / ob(a.display) - 3);return function (e) {
          if (Ha(a.doc, e)) return 0;var f = 0;if (e.widgets) for (var g = 0; g < e.widgets.length; g++) e.widgets[g].height && (f += e.widgets[g].height);
          return c ? f + (Math.ceil(e.text.length / d) || 1) * b : f + b;
        };
      }function Ad(a) {
        var b = a.doc,
            c = Me(a);b.iter(function (a) {
          var b = c(a);b != a.height && sa(a, b);
        });
      }function Za(a, b, c, d) {
        var e = a.display;if (!c && "true" == (b.target || b.srcElement).getAttribute("cm-not-content")) return null;var f, g;c = e.lineSpace.getBoundingClientRect();try {
          f = b.clientX - c.left, g = b.clientY - c.top;
        } catch (h) {
          return null;
        }b = xd(a, f, g);var k;d && 0 < b.xRel && (k = x(a.doc, b.line).text).length == b.ch && (d = U(k, k.length, a.options.tabSize) - k.length, b = q(b.line, Math.max(0, Math.round((f - Ae(a.display).left) / ob(a.display)) - d)));return b;
      }function Wa(a, b) {
        if (b >= a.display.viewTo) return null;b -= a.display.viewFrom;if (0 > b) return null;for (var c = a.display.view, d = 0; d < c.length; d++) if (b -= c[d].size, 0 > b) return d;
      }function aa(a, b, c, d) {
        null == b && (b = a.doc.first);null == c && (c = a.doc.first + a.doc.size);d || (d = 0);var e = a.display;d && c < e.viewTo && (null == e.updateLineNumbers || e.updateLineNumbers > b) && (e.updateLineNumbers = b);a.curOp.viewChanged = !0;if (b >= e.viewTo) Ca && kd(a.doc, b) < e.viewTo && Ia(a);else if (c <= e.viewFrom) Ca && qe(a.doc, c + d) > e.viewFrom ? Ia(a) : (e.viewFrom += d, e.viewTo += d);else if (b <= e.viewFrom && c >= e.viewTo) Ia(a);else if (b <= e.viewFrom) {
          var f = Cc(a, c, c + d, 1);f ? (e.view = e.view.slice(f.index), e.viewFrom = f.lineN, e.viewTo += d) : Ia(a);
        } else if (c >= e.viewTo) (f = Cc(a, b, b, -1)) ? (e.view = e.view.slice(0, f.index), e.viewTo = f.lineN) : Ia(a);else {
          var f = Cc(a, b, b, -1),
              g = Cc(a, c, c + d, 1);f && g ? (e.view = e.view.slice(0, f.index).concat(yc(a, f.lineN, g.lineN)).concat(e.view.slice(g.index)), e.viewTo += d) : Ia(a);
        }if (a = e.externalMeasured) c < a.lineN ? a.lineN += d : b < a.lineN + a.size && (e.externalMeasured = null);
      }function Ja(a, b, c) {
        a.curOp.viewChanged = !0;var d = a.display,
            e = a.display.externalMeasured;e && b >= e.lineN && b < e.lineN + e.size && (d.externalMeasured = null);b < d.viewFrom || b >= d.viewTo || (a = d.view[Wa(a, b)], null != a.node && (a = a.changes || (a.changes = []), -1 == O(a, c) && a.push(c)));
      }function Ia(a) {
        a.display.viewFrom = a.display.viewTo = a.doc.first;a.display.view = [];a.display.viewOffset = 0;
      }function Cc(a, b, c, d) {
        var e = Wa(a, b),
            f = a.display.view;if (!Ca || c == a.doc.first + a.doc.size) return { index: e, lineN: c };for (var g = a.display.viewFrom, h = 0; h < e; h++) g += f[h].size;if (g != b) {
          if (0 < d) {
            if (e == f.length - 1) return null;b = g + f[e].size - b;e++;
          } else b = g - b;c += b;
        }for (; kd(a.doc, c) != c;) {
          if (e == (0 > d ? 0 : f.length - 1)) return null;c += d * f[e - (0 > d ? 1 : 0)].size;e += d;
        }return { index: e, lineN: c };
      }function Ne(a) {
        a = a.display.view;for (var b = 0, c = 0; c < a.length; c++) {
          var d = a[c];d.hidden || d.node && !d.changes || ++b;
        }return b;
      }function Nb(a) {
        a.display.input.showSelection(a.display.input.prepareSelection());
      }function Oe(a, b) {
        void 0 === b && (b = !0);for (var c = a.doc, d = {}, e = d.cursors = document.createDocumentFragment(), f = d.selection = document.createDocumentFragment(), g = 0; g < c.sel.ranges.length; g++) if (b || g != c.sel.primIndex) {
          var h = c.sel.ranges[g];if (!(h.from().line >= a.display.viewTo || h.to().line < a.display.viewFrom)) {
            var k = h.empty();(k || a.options.showCursorWhenSelecting) && Pe(a, h.head, e);k || Bg(a, h, f);
          }
        }return d;
      }function Pe(a, b, c) {
        b = oa(a, b, "div", null, null, !a.options.singleCursorHeightPerLine);var d = c.appendChild(w("div", " ", "CodeMirror-cursor"));
        d.style.left = b.left + "px";d.style.top = b.top + "px";d.style.height = Math.max(0, b.bottom - b.top) * a.options.cursorHeight + "px";b.other && (a = c.appendChild(w("div", " ", "CodeMirror-cursor CodeMirror-secondarycursor")), a.style.display = "", a.style.left = b.other.left + "px", a.style.top = b.other.top + "px", a.style.height = .85 * (b.other.bottom - b.other.top) + "px");
      }function Dc(a, b) {
        return a.top - b.top || a.left - b.left;
      }function Bg(a, b, c) {
        function d(a, b, d, c) {
          0 > b && (b = 0);b = Math.round(b);c = Math.round(c);h.appendChild(w("div", null, "CodeMirror-selected", "position: absolute; left: " + a + "px;\n                             top: " + b + "px; width: " + (null == d ? m - a : d) + "px;\n                             height: " + (c - b) + "px"));
        }function e(b, c, e) {
          function f(c, d) {
            return vd(a, q(b, c), "div", k, d);
          }function h(b, c, d) {
            b = Le(a, k, null, b);c = "ltr" == c == ("after" == d) ? "left" : "right";d = "after" == d ? b.begin : b.end - (/\s/.test(k.text.charAt(b.end - 1)) ? 2 : 1);return f(d, c)[c];
          }var k = x(g, b),
              p = k.text.length,
              u,
              t,
              y = n(k, g.direction);Ga(y, c || 0, null == e ? p : e, function (a, b, g, k) {
            var r = "ltr" == g,
                n = f(a, r ? "left" : "right"),
                q = f(b - 1, r ? "right" : "left"),
                x = null == c && 0 == a,
                w = null == e && b == p,
                F = 0 == k;k = !y || k == y.length - 1;3 >= q.top - n.top ? (b = (v ? x : w) && F ? l : (r ? n : q).left, d(b, n.top, ((v ? w : x) && k ? m : (r ? q : n).right) - b, n.bottom)) : (r ? (r = v && x && F ? l : n.left, x = v ? m : h(a, g, "before"), a = v ? l : h(b, g, "after"), w = v && w && k ? m : q.right) : (r = v ? h(a, g, "before") : l, x = !v && x && F ? m : n.right, a = !v && w && k ? l : q.left, w = v ? h(b, g, "after") : m), d(r, n.top, x - r, n.bottom), n.bottom < q.top && d(l, n.bottom, null, q.top), d(a, q.top, w - a, q.bottom));if (!u || 0 > Dc(n, u)) u = n;0 > Dc(q, u) && (u = q);if (!t || 0 > Dc(n, t)) t = n;0 > Dc(q, t) && (t = q);
          });return { start: u, end: t };
        }var f = a.display,
            g = a.doc,
            h = document.createDocumentFragment(),
            k = Ae(a.display),
            l = k.left,
            m = Math.max(f.sizerWidth, Va(a) - f.sizer.offsetLeft) - k.right,
            v = "ltr" == g.direction,
            f = b.from();b = b.to();if (f.line == b.line) e(f.line, f.ch, b.ch);else {
          var p = x(g, f.line),
              k = x(g, b.line),
              k = ua(p) == ua(k),
              f = e(f.line, f.ch, k ? p.text.length + 1 : null).end;b = e(b.line, k ? 0 : null, b.ch).start;k && (f.top < b.top - 2 ? (d(f.right, f.top, null, f.bottom), d(l, b.top, b.left, b.bottom)) : d(f.right, f.top, b.left - f.right, f.bottom));f.bottom < b.top && d(l, f.bottom, null, b.top);
        }c.appendChild(h);
      }function Bd(a) {
        if (a.state.focused) {
          var b = a.display;clearInterval(b.blinker);var c = !0;b.cursorDiv.style.visibility = "";0 < a.options.cursorBlinkRate ? b.blinker = setInterval(function () {
            a.hasFocus() || qb(a);b.cursorDiv.style.visibility = (c = !c) ? "" : "hidden";
          }, a.options.cursorBlinkRate) : 0 > a.options.cursorBlinkRate && (b.cursorDiv.style.visibility = "hidden");
        }
      }function Qe(a) {
        a.state.focused || (a.display.input.focus(), Cd(a));
      }function Re(a) {
        a.state.delayingBlurEvent = !0;setTimeout(function () {
          a.state.delayingBlurEvent && (a.state.delayingBlurEvent = !1, qb(a));
        }, 100);
      }function Cd(a, b) {
        a.state.delayingBlurEvent && (a.state.delayingBlurEvent = !1);"nocursor" != a.options.readOnly && (a.state.focused || (t(a, "focus", a, b), a.state.focused = !0, ya(a.display.wrapper, "CodeMirror-focused"), a.curOp || a.display.selForContextMenu == a.doc.sel || (a.display.input.reset(), V && setTimeout(function () {
          return a.display.input.reset(!0);
        }, 20)), a.display.input.receivedFocus()), Bd(a));
      }function qb(a, b) {
        a.state.delayingBlurEvent || (a.state.focused && (t(a, "blur", a, b), a.state.focused = !1, $a(a.display.wrapper, "CodeMirror-focused")), clearInterval(a.display.blinker), setTimeout(function () {
          a.state.focused || (a.display.shift = !1);
        }, 150));
      }function Ec(a) {
        for (var b = a.display, c = b.lineDiv.offsetTop, d = 0; d < b.view.length; d++) {
          var e = b.view[d],
              f = a.options.lineWrapping,
              g = void 0,
              h = 0;if (!e.hidden) {
            if (B && 8 > H) f = e.node.offsetTop + e.node.offsetHeight, g = f - c, c = f;else {
              var k = e.node.getBoundingClientRect(),
                  g = k.bottom - k.top;!f && e.text.firstChild && (h = e.text.firstChild.getBoundingClientRect().right - k.left - 1);
            }f = e.line.height - g;if (.005 < f || -.005 > f) if (sa(e.line, g), Se(e.line), e.rest) for (g = 0; g < e.rest.length; g++) Se(e.rest[g]);h > a.display.sizerWidth && (h = Math.ceil(h / ob(a.display)), h > a.display.maxLineLength && (a.display.maxLineLength = h, a.display.maxLine = e.line, a.display.maxLineChanged = !0));
          }
        }
      }function Se(a) {
        if (a.widgets) for (var b = 0; b < a.widgets.length; ++b) {
          var c = a.widgets[b],
              d = c.node.parentNode;d && (c.height = d.offsetHeight);
        }
      }function Fc(a, b, c) {
        var d = c && null != c.top ? Math.max(0, c.top) : a.scroller.scrollTop,
            d = Math.floor(d - a.lineSpace.offsetTop),
            e = c && null != c.bottom ? c.bottom : d + a.wrapper.clientHeight,
            d = Ua(b, d),
            e = Ua(b, e);if (c && c.ensure) {
          var f = c.ensure.from.line;c = c.ensure.to.line;f < d ? (d = f, e = Ua(b, va(x(b, f)) + a.wrapper.clientHeight)) : Math.min(c, b.lastLine()) >= e && (d = Ua(b, va(x(b, c)) - a.wrapper.clientHeight), e = c);
        }return { from: d, to: Math.max(e, d + 1) };
      }function Dd(a, b) {
        var c = a.display,
            d = pb(a.display);0 > b.top && (b.top = 0);var e = a.curOp && null != a.curOp.scrollTop ? a.curOp.scrollTop : c.scroller.scrollTop,
            f = qd(a),
            g = {};b.bottom - b.top > f && (b.bottom = b.top + f);var h = a.doc.height + pd(c),
            k = b.top < d,
            d = b.bottom > h - d;b.top < e ? g.scrollTop = k ? 0 : b.top : b.bottom > e + f && (f = Math.min(b.top, (d ? h : b.bottom) - f), f != e && (g.scrollTop = f));e = a.options.fixedGutter ? 0 : c.gutters.offsetWidth;f = a.curOp && null != a.curOp.scrollLeft ? a.curOp.scrollLeft : c.scroller.scrollLeft - e;c = Va(a) - c.gutters.offsetWidth;if (h = b.right - b.left > c) b.right = b.left + c;10 > b.left ? g.scrollLeft = 0 : b.left < f ? g.scrollLeft = Math.max(0, b.left + e - (h ? 0 : 10)) : b.right > c + f - 3 && (g.scrollLeft = b.right + (h ? 0 : 10) - c);
        return g;
      }function Gc(a, b) {
        null != b && (Hc(a), a.curOp.scrollTop = (null == a.curOp.scrollTop ? a.doc.scrollTop : a.curOp.scrollTop) + b);
      }function rb(a) {
        Hc(a);var b = a.getCursor();a.curOp.scrollToPos = { from: b, to: b, margin: a.options.cursorScrollMargin };
      }function Ob(a, b, c) {
        null == b && null == c || Hc(a);null != b && (a.curOp.scrollLeft = b);null != c && (a.curOp.scrollTop = c);
      }function Hc(a) {
        var b = a.curOp.scrollToPos;if (b) {
          a.curOp.scrollToPos = null;var c = Je(a, b.from),
              d = Je(a, b.to);Te(a, c, d, b.margin);
        }
      }function Te(a, b, c, d) {
        b = Dd(a, { left: Math.min(b.left, c.left), top: Math.min(b.top, c.top) - d, right: Math.max(b.right, c.right), bottom: Math.max(b.bottom, c.bottom) + d });Ob(a, b.scrollLeft, b.scrollTop);
      }function Pb(a, b) {
        2 > Math.abs(a.doc.scrollTop - b) || (Ea || Ed(a, { top: b }), Ue(a, b, !0), Ea && Ed(a), Qb(a, 100));
      }function Ue(a, b, c) {
        b = Math.max(0, Math.min(a.display.scroller.scrollHeight - a.display.scroller.clientHeight, b));if (a.display.scroller.scrollTop != b || c) a.doc.scrollTop = b, a.display.scrollbars.setScrollTop(b), a.display.scroller.scrollTop != b && (a.display.scroller.scrollTop = b);
      }function ab(a, b, c, d) {
        b = Math.max(0, Math.min(b, a.display.scroller.scrollWidth - a.display.scroller.clientWidth));(c ? b == a.doc.scrollLeft : 2 > Math.abs(a.doc.scrollLeft - b)) && !d || (a.doc.scrollLeft = b, Ve(a), a.display.scroller.scrollLeft != b && (a.display.scroller.scrollLeft = b), a.display.scrollbars.setScrollLeft(b));
      }function Rb(a) {
        var b = a.display,
            c = b.gutters.offsetWidth,
            d = Math.round(a.doc.height + pd(a.display));return { clientHeight: b.scroller.clientHeight, viewHeight: b.wrapper.clientHeight, scrollWidth: b.scroller.scrollWidth,
          clientWidth: b.scroller.clientWidth, viewWidth: b.wrapper.clientWidth, barLeft: a.options.fixedGutter ? c : 0, docHeight: d, scrollHeight: d + wa(a) + b.barHeight, nativeBarWidth: b.nativeBarWidth, gutterWidth: c };
      }function sb(a, b) {
        b || (b = Rb(a));var c = a.display.barWidth,
            d = a.display.barHeight;We(a, b);for (var e = 0; 4 > e && c != a.display.barWidth || d != a.display.barHeight; e++) c != a.display.barWidth && a.options.lineWrapping && Ec(a), We(a, Rb(a)), c = a.display.barWidth, d = a.display.barHeight;
      }function We(a, b) {
        var c = a.display,
            d = c.scrollbars.update(b);
        c.sizer.style.paddingRight = (c.barWidth = d.right) + "px";c.sizer.style.paddingBottom = (c.barHeight = d.bottom) + "px";c.heightForcer.style.borderBottom = d.bottom + "px solid transparent";d.right && d.bottom ? (c.scrollbarFiller.style.display = "block", c.scrollbarFiller.style.height = d.bottom + "px", c.scrollbarFiller.style.width = d.right + "px") : c.scrollbarFiller.style.display = "";d.bottom && a.options.coverGutterNextToScrollbar && a.options.fixedGutter ? (c.gutterFiller.style.display = "block", c.gutterFiller.style.height = d.bottom + "px", c.gutterFiller.style.width = b.gutterWidth + "px") : c.gutterFiller.style.display = "";
      }function Xe(a) {
        a.display.scrollbars && (a.display.scrollbars.clear(), a.display.scrollbars.addClass && $a(a.display.wrapper, a.display.scrollbars.addClass));a.display.scrollbars = new Ye[a.options.scrollbarStyle](function (b) {
          a.display.wrapper.insertBefore(b, a.display.scrollbarFiller);y(b, "mousedown", function () {
            a.state.focused && setTimeout(function () {
              return a.display.input.focus();
            }, 0);
          });b.setAttribute("cm-not-content", "true");
        }, function (b, c) {
          "horizontal" == c ? ab(a, b) : Pb(a, b);
        }, a);a.display.scrollbars.addClass && ya(a.display.wrapper, a.display.scrollbars.addClass);
      }function bb(a) {
        a.curOp = { cm: a, viewChanged: !1, startHeight: a.doc.height, forceUpdate: !1, updateInput: 0, typing: !1, changeObjs: null, cursorActivityHandlers: null, cursorActivityCalled: 0, selectionChanged: !1, updateMaxLine: !1, scrollLeft: null, scrollTop: null, scrollToPos: null, focus: !1, id: ++Cg };a = a.curOp;nb ? nb.ops.push(a) : a.ownsGroup = nb = { ops: [a], delayedCallbacks: [] };
      }function cb(a) {
        (a = a.curOp) && vg(a, function (a) {
          for (var c = 0; c < a.ops.length; c++) a.ops[c].cm.curOp = null;a = a.ops;for (c = 0; c < a.length; c++) {
            var d = a[c],
                e = d.cm,
                f = e.display,
                g = e.display;!g.scrollbarsClipped && g.scroller.offsetWidth && (g.nativeBarWidth = g.scroller.offsetWidth - g.scroller.clientWidth, g.heightForcer.style.height = wa(e) + "px", g.sizer.style.marginBottom = -g.nativeBarWidth + "px", g.sizer.style.borderRightWidth = wa(e) + "px", g.scrollbarsClipped = !0);d.updateMaxLine && md(e);d.mustUpdate = d.viewChanged || d.forceUpdate || null != d.scrollTop || d.scrollToPos && (d.scrollToPos.from.line < f.viewFrom || d.scrollToPos.to.line >= f.viewTo) || f.maxLineChanged && e.options.lineWrapping;d.update = d.mustUpdate && new Ic(e, d.mustUpdate && { top: d.scrollTop, ensure: d.scrollToPos }, d.forceUpdate);
          }for (c = 0; c < a.length; c++) d = a[c], d.updatedDisplay = d.mustUpdate && Fd(d.cm, d.update);for (c = 0; c < a.length; c++) if (d = a[c], e = d.cm, f = e.display, d.updatedDisplay && Ec(e), d.barMeasure = Rb(e), f.maxLineChanged && !e.options.lineWrapping && (g = void 0, g = f.maxLine.text.length, g = na(e, Xa(e, f.maxLine), g, void 0), d.adjustWidthTo = g.left + 3, e.display.sizerWidth = d.adjustWidthTo, d.barMeasure.scrollWidth = Math.max(f.scroller.clientWidth, f.sizer.offsetLeft + d.adjustWidthTo + wa(e) + e.display.barWidth), d.maxScrollLeft = Math.max(0, f.sizer.offsetLeft + d.adjustWidthTo - Va(e))), d.updatedDisplay || d.selectionChanged) d.preparedSelection = f.input.prepareSelection();for (c = 0; c < a.length; c++) d = a[c], e = d.cm, null != d.adjustWidthTo && (e.display.sizer.style.minWidth = d.adjustWidthTo + "px", d.maxScrollLeft < e.doc.scrollLeft && ab(e, Math.min(e.display.scroller.scrollLeft, d.maxScrollLeft), !0), e.display.maxLineChanged = !1), f = d.focus && d.focus == fa(), d.preparedSelection && e.display.input.showSelection(d.preparedSelection, f), (d.updatedDisplay || d.startHeight != e.doc.height) && sb(e, d.barMeasure), d.updatedDisplay && Gd(e, d.barMeasure), d.selectionChanged && Bd(e), e.state.focused && d.updateInput && e.display.input.reset(d.typing), f && Qe(d.cm);for (c = 0; c < a.length; c++) {
            d = a[c];e = d.cm;f = e.display;g = e.doc;d.updatedDisplay && Ze(e, d.update);null == f.wheelStartX || null == d.scrollTop && null == d.scrollLeft && !d.scrollToPos || (f.wheelStartX = f.wheelStartY = null);null != d.scrollTop && Ue(e, d.scrollTop, d.forceScroll);null != d.scrollLeft && ab(e, d.scrollLeft, !0, !0);if (d.scrollToPos) {
              var h = z(g, d.scrollToPos.from),
                  k = z(g, d.scrollToPos.to),
                  l = d.scrollToPos.margin;null == l && (l = 0);var m = void 0;e.options.lineWrapping || h != k || (h = h.ch ? q(h.line, "before" == h.sticky ? h.ch - 1 : h.ch, "after") : h, k = "before" == h.sticky ? q(h.line, h.ch + 1, "before") : h);for (var v = 0; 5 > v; v++) {
                var p = !1,
                    m = oa(e, h),
                    r = k && k != h ? oa(e, k) : m,
                    m = { left: Math.min(m.left, r.left),
                  top: Math.min(m.top, r.top) - l, right: Math.max(m.left, r.left), bottom: Math.max(m.bottom, r.bottom) + l },
                    r = Dd(e, m),
                    n = e.doc.scrollTop,
                    u = e.doc.scrollLeft;null != r.scrollTop && (Pb(e, r.scrollTop), 1 < Math.abs(e.doc.scrollTop - n) && (p = !0));null != r.scrollLeft && (ab(e, r.scrollLeft), 1 < Math.abs(e.doc.scrollLeft - u) && (p = !0));if (!p) break;
              }k = m;F(e, "scrollCursorIntoView") || (l = e.display, v = l.sizer.getBoundingClientRect(), h = null, 0 > k.top + v.top ? h = !0 : k.bottom + v.top > (window.innerHeight || document.documentElement.clientHeight) && (h = !1), null == h || Dg || (k = w("div", "​", null, "position: absolute;\n                         top: " + (k.top - l.viewOffset - e.display.lineSpace.offsetTop) + "px;\n                         height: " + (k.bottom - k.top + wa(e) + l.barHeight) + "px;\n                         left: " + k.left + "px; width: " + Math.max(2, k.right - k.left) + "px;"), e.display.lineSpace.appendChild(k), k.scrollIntoView(h), e.display.lineSpace.removeChild(k)));
            }k = d.maybeHiddenMarkers;h = d.maybeUnhiddenMarkers;if (k) for (l = 0; l < k.length; ++l) k[l].lines.length || t(k[l], "hide");if (h) for (k = 0; k < h.length; ++k) h[k].lines.length && t(h[k], "unhide");f.wrapper.offsetHeight && (g.scrollTop = e.display.scroller.scrollTop);d.changeObjs && t(e, "changes", e, d.changeObjs);d.update && d.update.finish();
          }
        });
      }function ea(a, b) {
        if (a.curOp) return b();bb(a);try {
          return b();
        } finally {
          cb(a);
        }
      }function P(a, b) {
        return function () {
          if (a.curOp) return b.apply(a, arguments);bb(a);try {
            return b.apply(a, arguments);
          } finally {
            cb(a);
          }
        };
      }function W(a) {
        return function () {
          if (this.curOp) return a.apply(this, arguments);bb(this);
          try {
            return a.apply(this, arguments);
          } finally {
            cb(this);
          }
        };
      }function Q(a) {
        return function () {
          var b = this.cm;if (!b || b.curOp) return a.apply(this, arguments);bb(b);try {
            return a.apply(this, arguments);
          } finally {
            cb(b);
          }
        };
      }function Qb(a, b) {
        a.doc.highlightFrontier < a.display.viewTo && a.state.highlight.set(b, Qa(Eg, a));
      }function Eg(a) {
        var b = a.doc;if (!(b.highlightFrontier >= a.display.viewTo)) {
          var c = +new Date() + a.options.workTime,
              d = Hb(a, b.highlightFrontier),
              e = [];b.iter(d.line, Math.min(b.first + b.size, a.display.viewTo + 500), function (f) {
            if (d.line >= a.display.viewFrom) {
              var g = f.styles,
                  h = f.text.length > a.options.maxHighlightLength ? Sa(b.mode, d.state) : null,
                  k = fe(a, f, d, !0);h && (d.state = h);f.styles = k.styles;h = f.styleClasses;(k = k.classes) ? f.styleClasses = k : h && (f.styleClasses = null);k = !g || g.length != f.styles.length || h != k && (!h || !k || h.bgClass != k.bgClass || h.textClass != k.textClass);for (h = 0; !k && h < g.length; ++h) k = g[h] != f.styles[h];k && e.push(d.line);f.stateAfter = d.save();
            } else f.text.length <= a.options.maxHighlightLength && gd(a, f.text, d), f.stateAfter = 0 == d.line % 5 ? d.save() : null;d.nextLine();if (+new Date() > c) return Qb(a, a.options.workDelay), !0;
          });b.highlightFrontier = d.line;b.modeFrontier = Math.max(b.modeFrontier, d.line);e.length && ea(a, function () {
            for (var b = 0; b < e.length; b++) Ja(a, e[b], "text");
          });
        }
      }function Fd(a, b) {
        var c = a.display,
            d = a.doc;if (b.editorIsHidden) return Ia(a), !1;if (!b.force && b.visible.from >= c.viewFrom && b.visible.to <= c.viewTo && (null == c.updateLineNumbers || c.updateLineNumbers >= c.viewTo) && c.renderedView == c.view && 0 == Ne(a)) return !1;$e(a) && (Ia(a), b.dims = sd(a));var e = d.first + d.size,
            f = Math.max(b.visible.from - a.options.viewportMargin, d.first),
            g = Math.min(e, b.visible.to + a.options.viewportMargin);c.viewFrom < f && 20 > f - c.viewFrom && (f = Math.max(d.first, c.viewFrom));c.viewTo > g && 20 > c.viewTo - g && (g = Math.min(e, c.viewTo));Ca && (f = kd(a.doc, f), g = qe(a.doc, g));d = f != c.viewFrom || g != c.viewTo || c.lastWrapHeight != b.wrapperHeight || c.lastWrapWidth != b.wrapperWidth;e = a.display;0 == e.view.length || f >= e.viewTo || g <= e.viewFrom ? (e.view = yc(a, f, g), e.viewFrom = f) : (e.viewFrom > f ? e.view = yc(a, f, e.viewFrom).concat(e.view) : e.viewFrom < f && (e.view = e.view.slice(Wa(a, f))), e.viewFrom = f, e.viewTo < g ? e.view = e.view.concat(yc(a, e.viewTo, g)) : e.viewTo > g && (e.view = e.view.slice(0, Wa(a, g))));e.viewTo = g;c.viewOffset = va(x(a.doc, c.viewFrom));a.display.mover.style.top = c.viewOffset + "px";g = Ne(a);if (!d && 0 == g && !b.force && c.renderedView == c.view && (null == c.updateLineNumbers || c.updateLineNumbers >= c.viewTo)) return !1;a.hasFocus() ? f = null : (f = fa()) && T(a.display.lineDiv, f) ? (f = { activeElt: f }, window.getSelection && (e = window.getSelection(), e.anchorNode && e.extend && T(a.display.lineDiv, e.anchorNode) && (f.anchorNode = e.anchorNode, f.anchorOffset = e.anchorOffset, f.focusNode = e.focusNode, f.focusOffset = e.focusOffset))) : f = null;4 < g && (c.lineDiv.style.display = "none");Fg(a, c.updateLineNumbers, b.dims);4 < g && (c.lineDiv.style.display = "");c.renderedView = c.view;(g = f) && g.activeElt && g.activeElt != fa() && (g.activeElt.focus(), !/^(INPUT|TEXTAREA)$/.test(g.activeElt.nodeName) && g.anchorNode && T(document.body, g.anchorNode) && T(document.body, g.focusNode) && (f = window.getSelection(), e = document.createRange(), e.setEnd(g.anchorNode, g.anchorOffset), e.collapse(!1), f.removeAllRanges(), f.addRange(e), f.extend(g.focusNode, g.focusOffset)));ca(c.cursorDiv);ca(c.selectionDiv);c.gutters.style.height = c.sizer.style.minHeight = 0;d && (c.lastWrapHeight = b.wrapperHeight, c.lastWrapWidth = b.wrapperWidth, Qb(a, 400));c.updateLineNumbers = null;return !0;
      }function Ze(a, b) {
        for (var c = b.viewport, d = !0;; d = !1) {
          if (d && a.options.lineWrapping && b.oldDisplayWidth != Va(a)) d && (b.visible = Fc(a.display, a.doc, c));else if (c && null != c.top && (c = { top: Math.min(a.doc.height + pd(a.display) - qd(a), c.top) }), b.visible = Fc(a.display, a.doc, c), b.visible.from >= a.display.viewFrom && b.visible.to <= a.display.viewTo) break;if (!Fd(a, b)) break;Ec(a);d = Rb(a);Nb(a);sb(a, d);Gd(a, d);b.force = !1;
        }b.signal(a, "update", a);if (a.display.viewFrom != a.display.reportedViewFrom || a.display.viewTo != a.display.reportedViewTo) b.signal(a, "viewportChange", a, a.display.viewFrom, a.display.viewTo), a.display.reportedViewFrom = a.display.viewFrom, a.display.reportedViewTo = a.display.viewTo;
      }function Ed(a, b) {
        var c = new Ic(a, b);if (Fd(a, c)) {
          Ec(a);Ze(a, c);var d = Rb(a);Nb(a);sb(a, d);Gd(a, d);c.finish();
        }
      }function Fg(a, b, c) {
        function d(b) {
          var c = b.nextSibling;V && la && a.display.currentWheelTarget == b ? b.style.display = "none" : b.parentNode.removeChild(b);return c;
        }for (var e = a.display, f = a.options.lineNumbers, g = e.lineDiv, h = g.firstChild, k = e.view, e = e.viewFrom, l = 0; l < k.length; l++) {
          var m = k[l];if (!m.hidden) if (m.node && m.node.parentNode == g) {
            for (; h != m.node;) h = d(h);h = f && null != b && b <= e && m.lineNumber;m.changes && (-1 < O(m.changes, "gutter") && (h = !1), ve(a, m, e, c));h && (ca(m.lineNumber), m.lineNumber.appendChild(document.createTextNode(cd(a.options, e))));h = m.node.nextSibling;
          } else {
            var v = xg(a, m, e, c);g.insertBefore(v, h);
          }e += m.size;
        }for (; h;) h = d(h);
      }function Hd(a) {
        a.sizer.style.marginLeft = a.gutters.offsetWidth + "px";
      }function Gd(a, b) {
        a.display.sizer.style.minHeight = b.docHeight + "px";a.display.heightForcer.style.top = b.docHeight + "px";a.display.gutters.style.height = b.docHeight + a.display.barHeight + wa(a) + "px";
      }function Ve(a) {
        var b = a.display,
            c = b.view;if (b.alignWidgets || b.gutters.firstChild && a.options.fixedGutter) {
          for (var d = zd(b) - b.scroller.scrollLeft + a.doc.scrollLeft, e = b.gutters.offsetWidth, f = d + "px", g = 0; g < c.length; g++) if (!c[g].hidden) {
            a.options.fixedGutter && (c[g].gutter && (c[g].gutter.style.left = f), c[g].gutterBackground && (c[g].gutterBackground.style.left = f));var h = c[g].alignable;if (h) for (var k = 0; k < h.length; k++) h[k].style.left = f;
          }a.options.fixedGutter && (b.gutters.style.left = d + e + "px");
        }
      }function $e(a) {
        if (!a.options.lineNumbers) return !1;var b = a.doc,
            b = cd(a.options, b.first + b.size - 1),
            c = a.display;if (b.length != c.lineNumChars) {
          var d = c.measure.appendChild(w("div", [w("div", b)], "CodeMirror-linenumber CodeMirror-gutter-elt")),
              e = d.firstChild.offsetWidth,
              d = d.offsetWidth - e;c.lineGutter.style.width = "";c.lineNumInnerWidth = Math.max(e, c.lineGutter.offsetWidth - d) + 1;c.lineNumWidth = c.lineNumInnerWidth + d;c.lineNumChars = c.lineNumInnerWidth ? b.length : -1;c.lineGutter.style.width = c.lineNumWidth + "px";Hd(a.display);return !0;
        }return !1;
      }function Id(a, b) {
        for (var c = [], d = !1, e = 0; e < a.length; e++) {
          var f = a[e],
              g = null;"string" != typeof f && (g = f.style, f = f.className);if ("CodeMirror-linenumbers" == f) if (b) d = !0;else continue;c.push({ className: f, style: g });
        }b && !d && c.push({ className: "CodeMirror-linenumbers", style: null });return c;
      }function af(a) {
        var b = a.gutters,
            c = a.gutterSpecs;ca(b);a.lineGutter = null;for (var d = 0; d < c.length; ++d) {
          var e = c[d],
              f = e.className,
              e = e.style,
              g = b.appendChild(w("div", null, "CodeMirror-gutter " + f));e && (g.style.cssText = e);"CodeMirror-linenumbers" == f && (a.lineGutter = g, g.style.width = (a.lineNumWidth || 1) + "px");
        }b.style.display = c.length ? "" : "none";Hd(a);
      }function Sb(a) {
        af(a.display);aa(a);Ve(a);
      }function Gg(a, b, c, d) {
        this.input = c;this.scrollbarFiller = w("div", null, "CodeMirror-scrollbar-filler");this.scrollbarFiller.setAttribute("cm-not-content", "true");this.gutterFiller = w("div", null, "CodeMirror-gutter-filler");this.gutterFiller.setAttribute("cm-not-content", "true");this.lineDiv = ra("div", null, "CodeMirror-code");this.selectionDiv = w("div", null, null, "position: relative; z-index: 1");this.cursorDiv = w("div", null, "CodeMirror-cursors");this.measure = w("div", null, "CodeMirror-measure");this.lineMeasure = w("div", null, "CodeMirror-measure");this.lineSpace = ra("div", [this.measure, this.lineMeasure, this.selectionDiv, this.cursorDiv, this.lineDiv], null, "position: relative; outline: none");var e = ra("div", [this.lineSpace], "CodeMirror-lines");this.mover = w("div", [e], null, "position: relative");this.sizer = w("div", [this.mover], "CodeMirror-sizer");this.sizerWidth = null;this.heightForcer = w("div", null, null, "position: absolute; height: 50px; width: 1px;");
        this.gutters = w("div", null, "CodeMirror-gutters");this.lineGutter = null;this.scroller = w("div", [this.sizer, this.heightForcer, this.gutters], "CodeMirror-scroll");this.scroller.setAttribute("tabIndex", "-1");this.wrapper = w("div", [this.scrollbarFiller, this.gutterFiller, this.scroller], "CodeMirror");B && 8 > H && (this.gutters.style.zIndex = -1, this.scroller.style.paddingRight = 0);V || Ea && Tb || (this.scroller.draggable = !0);a && (a.appendChild ? a.appendChild(this.wrapper) : a(this.wrapper));this.reportedViewFrom = this.reportedViewTo = this.viewFrom = this.viewTo = b.first;this.view = [];this.externalMeasured = this.renderedView = null;this.lastWrapHeight = this.lastWrapWidth = this.viewOffset = 0;this.updateLineNumbers = null;this.nativeBarWidth = this.barHeight = this.barWidth = 0;this.scrollbarsClipped = !1;this.lineNumWidth = this.lineNumInnerWidth = this.lineNumChars = null;this.alignWidgets = !1;this.maxLine = this.cachedCharWidth = this.cachedTextHeight = this.cachedPaddingH = null;this.maxLineLength = 0;this.maxLineChanged = !1;this.wheelDX = this.wheelDY = this.wheelStartX = this.wheelStartY = null;this.shift = !1;this.activeTouch = this.selForContextMenu = null;this.gutterSpecs = Id(d.gutters, d.lineNumbers);af(this);c.init(this);
      }function bf(a) {
        var b = a.wheelDeltaX,
            c = a.wheelDeltaY;null == b && a.detail && a.axis == a.HORIZONTAL_AXIS && (b = a.detail);null == c && a.detail && a.axis == a.VERTICAL_AXIS ? c = a.detail : null == c && (c = a.wheelDelta);return { x: b, y: c };
      }function Hg(a) {
        a = bf(a);a.x *= ga;a.y *= ga;return a;
      }function cf(a, b) {
        var c = bf(b),
            d = c.x,
            c = c.y,
            e = a.display,
            f = e.scroller,
            g = f.scrollWidth > f.clientWidth,
            h = f.scrollHeight > f.clientHeight;if (d && g || c && h) {
          if (c && la && V) {
            var g = b.target,
                k = e.view;a: for (; g != f; g = g.parentNode) for (var l = 0; l < k.length; l++) if (k[l].node == g) {
              a.display.currentWheelTarget = g;break a;
            }
          }!d || Ea || pa || null == ga ? (c && null != ga && (h = c * ga, g = a.doc.scrollTop, k = g + e.wrapper.clientHeight, 0 > h ? g = Math.max(0, g + h - 50) : k = Math.min(a.doc.height, k + h + 50), Ed(a, { top: g, bottom: k })), 20 > Jc && (null == e.wheelStartX ? (e.wheelStartX = f.scrollLeft, e.wheelStartY = f.scrollTop, e.wheelDX = d, e.wheelDY = c, setTimeout(function () {
            if (null != e.wheelStartX) {
              var a = f.scrollLeft - e.wheelStartX,
                  b = f.scrollTop - e.wheelStartY,
                  a = b && e.wheelDY && b / e.wheelDY || a && e.wheelDX && a / e.wheelDX;e.wheelStartX = e.wheelStartY = null;a && (ga = (ga * Jc + a) / (Jc + 1), ++Jc);
            }
          }, 200)) : (e.wheelDX += d, e.wheelDY += c))) : (c && h && Pb(a, Math.max(0, f.scrollTop + c * ga)), ab(a, Math.max(0, f.scrollLeft + d * ga)), (!c || c && h) && Z(b), e.wheelStartX = null);
        }
      }function qa(a, b, c) {
        a = a && a.options.selectionsMayTouch;c = b[c];b.sort(function (a, b) {
          return A(a.from(), b.from());
        });c = O(b, c);for (var d = 1; d < b.length; d++) {
          var e = b[d],
              f = b[d - 1],
              g = A(f.to(), e.from());if (a && !e.empty() ? 0 < g : 0 <= g) {
            var g = uc(f.from(), e.from()),
                h = tc(f.to(), e.to()),
                e = f.empty() ? e.from() == e.head : f.from() == f.head;d <= c && --c;b.splice(--d, 2, new C(e ? h : g, e ? g : h));
          }
        }return new ha(b, c);
      }function Fa(a, b) {
        return new ha([new C(a, b || a)], 0);
      }function Ka(a) {
        return a.text ? q(a.from.line + a.text.length - 1, D(a.text).length + (1 == a.text.length ? a.from.ch : 0)) : a.to;
      }function df(a, b) {
        if (0 > A(a, b.from)) return a;if (0 >= A(a, b.to)) return Ka(b);var c = a.line + b.text.length - (b.to.line - b.from.line) - 1,
            d = a.ch;a.line == b.to.line && (d += Ka(b).ch - b.to.ch);return q(c, d);
      }function Jd(a, b) {
        for (var c = [], d = 0; d < a.sel.ranges.length; d++) {
          var e = a.sel.ranges[d];c.push(new C(df(e.anchor, b), df(e.head, b)));
        }return qa(a.cm, c, a.sel.primIndex);
      }function ef(a, b, c) {
        return a.line == b.line ? q(c.line, a.ch - b.ch + c.ch) : q(c.line + (a.line - b.line), a.ch);
      }function Kd(a) {
        a.doc.mode = $c(a.options, a.doc.modeOption);Ub(a);
      }function Ub(a) {
        a.doc.iter(function (a) {
          a.stateAfter && (a.stateAfter = null);a.styles && (a.styles = null);
        });a.doc.modeFrontier = a.doc.highlightFrontier = a.doc.first;
        Qb(a, 100);a.state.modeGen++;a.curOp && aa(a);
      }function ff(a, b) {
        return 0 == b.from.ch && 0 == b.to.ch && "" == D(b.text) && (!a.cm || a.cm.options.wholeLineUpdateBefore);
      }function Ld(a, b, c, d) {
        function e(a, c, e) {
          a.text = c;a.stateAfter && (a.stateAfter = null);a.styles && (a.styles = null);null != a.order && (a.order = null);ne(a);oe(a, e);c = d ? d(a) : 1;c != a.height && sa(a, c);R(a, "change", a, b);
        }function f(a, b) {
          for (var e = [], f = a; f < b; ++f) e.push(new tb(k[f], c ? c[f] : null, d));return e;
        }var g = b.from,
            h = b.to,
            k = b.text,
            l = x(a, g.line),
            m = x(a, h.line),
            v = D(k),
            p = c ? c[k.length - 1] : null,
            r = h.line - g.line;b.full ? (a.insert(0, f(0, k.length)), a.remove(k.length, a.size - k.length)) : ff(a, b) ? (h = f(0, k.length - 1), e(m, m.text, p), r && a.remove(g.line, r), h.length && a.insert(g.line, h)) : l == m ? 1 == k.length ? e(l, l.text.slice(0, g.ch) + v + l.text.slice(h.ch), p) : (r = f(1, k.length - 1), r.push(new tb(v + l.text.slice(h.ch), p, d)), e(l, l.text.slice(0, g.ch) + k[0], c ? c[0] : null), a.insert(g.line + 1, r)) : 1 == k.length ? (e(l, l.text.slice(0, g.ch) + k[0] + m.text.slice(h.ch), c ? c[0] : null), a.remove(g.line + 1, r)) : (e(l, l.text.slice(0, g.ch) + k[0], c ? c[0] : null), e(m, v + m.text.slice(h.ch), p), p = f(1, k.length - 1), 1 < r && a.remove(g.line + 1, r - 1), a.insert(g.line + 1, p));R(a, "change", a, b);
      }function La(a, b, c) {
        function d(a, f, g) {
          if (a.linked) for (var h = 0; h < a.linked.length; ++h) {
            var k = a.linked[h];if (k.doc != f) {
              var l = g && k.sharedHist;if (!c || l) b(k.doc, l), d(k.doc, a, l);
            }
          }
        }d(a, null, !0);
      }function gf(a, b) {
        if (b.cm) throw Error("This document is already in use.");a.doc = b;b.cm = a;Ad(a);Kd(a);hf(a);a.options.lineWrapping || md(a);a.options.mode = b.modeOption;aa(a);
      }function hf(a) {
        ("rtl" == a.doc.direction ? ya : $a)(a.display.lineDiv, "CodeMirror-rtl");
      }function Ig(a) {
        ea(a, function () {
          hf(a);aa(a);
        });
      }function Kc(a) {
        this.done = [];this.undone = [];this.undoDepth = Infinity;this.lastModTime = this.lastSelTime = 0;this.lastOrigin = this.lastSelOrigin = this.lastOp = this.lastSelOp = null;this.generation = this.maxGeneration = a || 1;
      }function Md(a, b) {
        var c = { from: ed(b.from), to: Ka(b), text: Ta(a, b.from, b.to) };jf(a, c, b.from.line, b.to.line + 1);La(a, function (a) {
          return jf(a, c, b.from.line, b.to.line + 1);
        }, !0);return c;
      }function kf(a) {
        for (; a.length;) if (D(a).ranges) a.pop();else break;
      }function lf(a, b, c, d) {
        var e = a.history;e.undone.length = 0;var f = +new Date(),
            g,
            h,
            k;if (k = e.lastOp == d || e.lastOrigin == b.origin && b.origin && ("+" == b.origin.charAt(0) && e.lastModTime > f - (a.cm ? a.cm.options.historyEventDelay : 500) || "*" == b.origin.charAt(0))) e.lastOp == d ? (kf(e.done), g = D(e.done)) : e.done.length && !D(e.done).ranges ? g = D(e.done) : 1 < e.done.length && !e.done[e.done.length - 2].ranges ? (e.done.pop(), g = D(e.done)) : g = void 0, k = g;if (k) h = D(g.changes), 0 == A(b.from, b.to) && 0 == A(b.from, h.to) ? h.to = Ka(b) : g.changes.push(Md(a, b));else for ((g = D(e.done)) && g.ranges || Lc(a.sel, e.done), g = { changes: [Md(a, b)], generation: e.generation }, e.done.push(g); e.done.length > e.undoDepth;) e.done.shift(), e.done[0].ranges || e.done.shift();e.done.push(c);e.generation = ++e.maxGeneration;e.lastModTime = e.lastSelTime = f;e.lastOp = e.lastSelOp = d;e.lastOrigin = e.lastSelOrigin = b.origin;h || t(a, "historyAdded");
      }function Lc(a, b) {
        var c = D(b);c && c.ranges && c.equals(a) || b.push(a);
      }function jf(a, b, c, d) {
        var e = b["spans_" + a.id],
            f = 0;a.iter(Math.max(a.first, c), Math.min(a.first + a.size, d), function (c) {
          c.markedSpans && ((e || (e = b["spans_" + a.id] = {}))[f] = c.markedSpans);++f;
        });
      }function Jg(a) {
        if (!a) return null;for (var b, c = 0; c < a.length; ++c) a[c].marker.explicitlyCleared ? b || (b = a.slice(0, c)) : b && b.push(a[c]);return b ? b.length ? b : null : a;
      }function mf(a, b) {
        var c;if (c = b["spans_" + a.id]) {
          for (var d = [], e = 0; e < b.text.length; ++e) d.push(Jg(c[e]));c = d;
        } else c = null;d = id(a, b);if (!c) return d;if (!d) return c;for (e = 0; e < c.length; ++e) {
          var f = c[e],
              g = d[e];if (f && g) {
            var h = 0;a: for (; h < g.length; ++h) {
              for (var k = g[h], l = 0; l < f.length; ++l) if (f[l].marker == k.marker) continue a;f.push(k);
            }
          } else g && (c[e] = g);
        }return c;
      }function ub(a, b, c) {
        for (var d = [], e = 0; e < a.length; ++e) {
          var f = a[e];if (f.ranges) d.push(c ? ha.prototype.deepCopy.call(f) : f);else {
            var f = f.changes,
                g = [];d.push({ changes: g });for (var h = 0; h < f.length; ++h) {
              var k = f[h],
                  l = void 0;g.push({ from: k.from, to: k.to, text: k.text });if (b) for (var m in k) (l = m.match(/^spans_(\d+)$/)) && -1 < O(b, Number(l[1])) && (D(g)[m] = k[m], delete k[m]);
            }
          }
        }return d;
      }function Nd(a, b, c, d) {
        return d ? (a = a.anchor, c && (d = 0 > A(b, a), d != 0 > A(c, a) ? (a = b, b = c) : d != 0 > A(b, c) && (b = c)), new C(a, b)) : new C(c || b, b);
      }function Mc(a, b, c, d, e) {
        null == e && (e = a.cm && (a.cm.display.shift || a.extend));S(a, new ha([Nd(a.sel.primary(), b, c, e)], 0), d);
      }function nf(a, b, c) {
        for (var d = [], e = a.cm && (a.cm.display.shift || a.extend), f = 0; f < a.sel.ranges.length; f++) d[f] = Nd(a.sel.ranges[f], b[f], null, e);b = qa(a.cm, d, a.sel.primIndex);S(a, b, c);
      }function Od(a, b, c, d) {
        var e = a.sel.ranges.slice(0);e[b] = c;S(a, qa(a.cm, e, a.sel.primIndex), d);
      }function Kg(a, b, c) {
        c = { ranges: b.ranges, update: function (b) {
            this.ranges = [];for (var c = 0; c < b.length; c++) this.ranges[c] = new C(z(a, b[c].anchor), z(a, b[c].head));
          }, origin: c && c.origin };t(a, "beforeSelectionChange", a, c);a.cm && t(a.cm, "beforeSelectionChange", a.cm, c);return c.ranges != b.ranges ? qa(a.cm, c.ranges, c.ranges.length - 1) : b;
      }function of(a, b, c) {
        var d = a.history.done,
            e = D(d);e && e.ranges ? (d[d.length - 1] = b, Nc(a, b, c)) : S(a, b, c);
      }function S(a, b, c) {
        Nc(a, b, c);b = a.sel;var d = a.cm ? a.cm.curOp.id : NaN,
            e = a.history,
            f = c && c.origin,
            g;if (!(g = d == e.lastSelOp) && (g = f && e.lastSelOrigin == f) && !(g = e.lastModTime == e.lastSelTime && e.lastOrigin == f)) {
          g = D(e.done);var h = f.charAt(0);g = "*" == h || "+" == h && g.ranges.length == b.ranges.length && g.somethingSelected() == b.somethingSelected() && new Date() - a.history.lastSelTime <= (a.cm ? a.cm.options.historyEventDelay : 500);
        }g ? e.done[e.done.length - 1] = b : Lc(b, e.done);e.lastSelTime = +new Date();e.lastSelOrigin = f;e.lastSelOp = d;c && !1 !== c.clearRedo && kf(e.undone);
      }function Nc(a, b, c) {
        if (ka(a, "beforeSelectionChange") || a.cm && ka(a.cm, "beforeSelectionChange")) b = Kg(a, b, c);var d = c && c.bias || (0 > A(b.primary().head, a.sel.primary().head) ? -1 : 1);pf(a, qf(a, b, d, !0));c && !1 === c.scroll || !a.cm || rb(a.cm);
      }function pf(a, b) {
        b.equals(a.sel) || (a.sel = b, a.cm && (a.cm.curOp.updateInput = 1, a.cm.curOp.selectionChanged = !0, ae(a.cm)), R(a, "cursorActivity", a));
      }function rf(a) {
        pf(a, qf(a, a.sel, null, !1));
      }function qf(a, b, c, d) {
        for (var e, f = 0; f < b.ranges.length; f++) {
          var g = b.ranges[f],
              h = b.ranges.length == a.sel.ranges.length && a.sel.ranges[f],
              k = Oc(a, g.anchor, h && h.anchor, c, d),
              h = Oc(a, g.head, h && h.head, c, d);if (e || k != g.anchor || h != g.head) e || (e = b.ranges.slice(0, f)), e[f] = new C(k, h);
        }return e ? qa(a.cm, e, b.primIndex) : b;
      }function vb(a, b, c, d, e) {
        var f = x(a, b.line);if (f.markedSpans) for (var g = 0; g < f.markedSpans.length; ++g) {
          var h = f.markedSpans[g],
              k = h.marker,
              l = "selectLeft" in k ? !k.selectLeft : k.inclusiveLeft,
              m = "selectRight" in k ? !k.selectRight : k.inclusiveRight;if ((null == h.from || (l ? h.from <= b.ch : h.from < b.ch)) && (null == h.to || (m ? h.to >= b.ch : h.to > b.ch))) {
            if (e && (t(k, "beforeCursorEnter"), k.explicitlyCleared)) if (f.markedSpans) {
              --g;continue;
            } else break;if (k.atomic) {
              if (c) {
                g = k.find(0 > d ? 1 : -1);h = void 0;if (0 > d ? m : l) g = sf(a, g, -d, g && g.line == b.line ? f : null);if (g && g.line == b.line && (h = A(g, c)) && (0 > d ? 0 > h : 0 < h)) return vb(a, g, b, d, e);
              }c = k.find(0 > d ? -1 : 1);if (0 > d ? l : m) c = sf(a, c, d, c.line == b.line ? f : null);return c ? vb(a, c, b, d, e) : null;
            }
          }
        }return b;
      }function Oc(a, b, c, d, e) {
        d = d || 1;b = vb(a, b, c, d, e) || !e && vb(a, b, c, d, !0) || vb(a, b, c, -d, e) || !e && vb(a, b, c, -d, !0);return b ? b : (a.cantEdit = !0, q(a.first, 0));
      }function sf(a, b, c, d) {
        return 0 > c && 0 == b.ch ? b.line > a.first ? z(a, q(b.line - 1)) : null : 0 < c && b.ch == (d || x(a, b.line)).text.length ? b.line < a.first + a.size - 1 ? q(b.line + 1, 0) : null : new q(b.line, b.ch + c);
      }function tf(a) {
        a.setSelection(q(a.firstLine(), 0), q(a.lastLine()), xa);
      }function uf(a, b, c) {
        var d = { canceled: !1, from: b.from, to: b.to, text: b.text, origin: b.origin, cancel: function () {
            return d.canceled = !0;
          } };c && (d.update = function (b, c, g, h) {
          b && (d.from = z(a, b));c && (d.to = z(a, c));g && (d.text = g);void 0 !== h && (d.origin = h);
        });t(a, "beforeChange", a, d);a.cm && t(a.cm, "beforeChange", a.cm, d);return d.canceled ? (a.cm && (a.cm.curOp.updateInput = 2), null) : { from: d.from, to: d.to, text: d.text,
          origin: d.origin };
      }function wb(a, b, c) {
        if (a.cm) {
          if (!a.cm.curOp) return P(a.cm, wb)(a, b, c);if (a.cm.state.suppressEdits) return;
        }if (ka(a, "beforeChange") || a.cm && ka(a.cm, "beforeChange")) if (b = uf(a, b, !0), !b) return;if (c = vf && !c && pg(a, b.from, b.to)) for (var d = c.length - 1; 0 <= d; --d) wf(a, { from: c[d].from, to: c[d].to, text: d ? [""] : b.text, origin: b.origin });else wf(a, b);
      }function wf(a, b) {
        if (1 != b.text.length || "" != b.text[0] || 0 != A(b.from, b.to)) {
          var c = Jd(a, b);lf(a, b, c, a.cm ? a.cm.curOp.id : NaN);Vb(a, b, c, id(a, b));var d = [];La(a, function (a, c) {
            c || -1 != O(d, a.history) || (xf(a.history, b), d.push(a.history));Vb(a, b, null, id(a, b));
          });
        }
      }function Pc(a, b, c) {
        var d = a.cm && a.cm.state.suppressEdits;if (!d || c) {
          for (var e = a.history, f, g = a.sel, h = "undo" == b ? e.done : e.undone, k = "undo" == b ? e.undone : e.done, l = 0; l < h.length && (f = h[l], c ? !f.ranges || f.equals(a.sel) : f.ranges); l++);if (l != h.length) {
            for (e.lastOrigin = e.lastSelOrigin = null;;) if (f = h.pop(), f.ranges) {
              Lc(f, k);if (c && !f.equals(a.sel)) {
                S(a, f, { clearRedo: !1 });return;
              }g = f;
            } else {
              if (d) {
                h.push(f);return;
              }break;
            }var m = [];Lc(g, k);
            k.push({ changes: m, generation: e.generation });e.generation = f.generation || ++e.maxGeneration;var v = ka(a, "beforeChange") || a.cm && ka(a.cm, "beforeChange");c = function (c) {
              var d = f.changes[c];d.origin = b;if (v && !uf(a, d, !1)) return h.length = 0, {};m.push(Md(a, d));var e = c ? Jd(a, d) : D(h);Vb(a, d, e, mf(a, d));!c && a.cm && a.cm.scrollIntoView({ from: d.from, to: Ka(d) });var g = [];La(a, function (a, b) {
                b || -1 != O(g, a.history) || (xf(a.history, d), g.push(a.history));Vb(a, d, null, mf(a, d));
              });
            };for (d = f.changes.length - 1; 0 <= d; --d) if (e = c(d)) return e.v;
          }
        }
      }
      function yf(a, b) {
        if (0 != b && (a.first += b, a.sel = new ha(Ba(a.sel.ranges, function (a) {
          return new C(q(a.anchor.line + b, a.anchor.ch), q(a.head.line + b, a.head.ch));
        }), a.sel.primIndex), a.cm)) {
          aa(a.cm, a.first, a.first - b, b);for (var c = a.cm.display, d = c.viewFrom; d < c.viewTo; d++) Ja(a.cm, d, "gutter");
        }
      }function Vb(a, b, c, d) {
        if (a.cm && !a.cm.curOp) return P(a.cm, Vb)(a, b, c, d);if (b.to.line < a.first) yf(a, b.text.length - 1 - (b.to.line - b.from.line));else if (!(b.from.line > a.lastLine())) {
          if (b.from.line < a.first) {
            var e = b.text.length - 1 - (a.first - b.from.line);yf(a, e);b = { from: q(a.first, 0), to: q(b.to.line + e, b.to.ch), text: [D(b.text)], origin: b.origin };
          }e = a.lastLine();b.to.line > e && (b = { from: b.from, to: q(e, x(a, e).text.length), text: [b.text[0]], origin: b.origin });b.removed = Ta(a, b.from, b.to);c || (c = Jd(a, b));a.cm ? Lg(a.cm, b, d) : Ld(a, b, d);Nc(a, c, xa);a.cantEdit && Oc(a, q(a.firstLine(), 0)) && (a.cantEdit = !1);
        }
      }function Lg(a, b, c) {
        var d = a.doc,
            e = a.display,
            f = b.from,
            g = b.to,
            h = !1,
            k = f.line;a.options.lineWrapping || (k = G(ua(x(d, f.line))), d.iter(k, g.line + 1, function (a) {
          if (a == e.maxLine) return h = !0;
        }));-1 < d.sel.contains(b.from, b.to) && ae(a);Ld(d, b, c, Me(a));a.options.lineWrapping || (d.iter(k, f.line + b.text.length, function (a) {
          var b = xc(a);b > e.maxLineLength && (e.maxLine = a, e.maxLineLength = b, e.maxLineChanged = !0, h = !1);
        }), h && (a.curOp.updateMaxLine = !0));og(d, f.line);Qb(a, 400);c = b.text.length - (g.line - f.line) - 1;b.full ? aa(a) : f.line != g.line || 1 != b.text.length || ff(a.doc, b) ? aa(a, f.line, g.line + 1, c) : Ja(a, f.line, "text");c = ka(a, "changes");if ((d = ka(a, "change")) || c) b = { from: f, to: g, text: b.text, removed: b.removed, origin: b.origin }, d && R(a, "change", a, b), c && (a.curOp.changeObjs || (a.curOp.changeObjs = [])).push(b);a.display.selForContextMenu = null;
      }function xb(a, b, c, d, e) {
        d || (d = c);0 > A(d, c) && (d = [d, c], c = d[0], d = d[1]);"string" == typeof b && (b = a.splitLines(b));wb(a, { from: c, to: d, text: b, origin: e });
      }function zf(a, b, c, d) {
        c < a.line ? a.line += d : b < a.line && (a.line = b, a.ch = 0);
      }function Af(a, b, c, d) {
        for (var e = 0; e < a.length; ++e) {
          var f = a[e],
              g = !0;if (f.ranges) for (f.copied || (f = a[e] = f.deepCopy(), f.copied = !0), g = 0; g < f.ranges.length; g++) zf(f.ranges[g].anchor, b, c, d), zf(f.ranges[g].head, b, c, d);else {
            for (var h = 0; h < f.changes.length; ++h) {
              var k = f.changes[h];if (c < k.from.line) k.from = q(k.from.line + d, k.from.ch), k.to = q(k.to.line + d, k.to.ch);else if (b <= k.to.line) {
                g = !1;break;
              }
            }g || (a.splice(0, e + 1), e = 0);
          }
        }
      }function xf(a, b) {
        var c = b.from.line,
            d = b.to.line,
            e = b.text.length - (d - c) - 1;Af(a.done, c, d, e);Af(a.undone, c, d, e);
      }function Wb(a, b, c, d) {
        var e = b,
            f = b;"number" == typeof b ? f = x(a, Math.max(a.first, Math.min(b, a.first + a.size - 1))) : e = G(b);if (null == e) return null;d(f, e) && a.cm && Ja(a.cm, e, c);return f;
      }
      function Xb(a) {
        this.lines = a;this.parent = null;for (var b = 0, c = 0; c < a.length; ++c) a[c].parent = this, b += a[c].height;this.height = b;
      }function Yb(a) {
        this.children = a;for (var b = 0, c = 0, d = 0; d < a.length; ++d) {
          var e = a[d],
              b = b + e.chunkSize(),
              c = c + e.height;e.parent = this;
        }this.size = b;this.height = c;this.parent = null;
      }function Mg(a, b, c, d) {
        var e = new Zb(a, c, d),
            f = a.cm;f && e.noHScroll && (f.display.alignWidgets = !0);Wb(a, b, "widget", function (b) {
          var c = b.widgets || (b.widgets = []);null == e.insertAt ? c.push(e) : c.splice(Math.min(c.length - 1, Math.max(0, e.insertAt)), 0, e);e.line = b;f && !Ha(a, b) && (c = va(b) < a.scrollTop, sa(b, b.height + Lb(e)), c && Gc(f, e.height), f.curOp.forceUpdate = !0);return !0;
        });f && R(f, "lineWidgetAdded", f, e, "number" == typeof b ? b : G(b));return e;
      }function yb(a, b, c, d, e) {
        if (d && d.shared) return Ng(a, b, c, d, e);if (a.cm && !a.cm.curOp) return P(a.cm, yb)(a, b, c, d, e);var f = new Ma(a, e);e = A(b, c);d && za(d, f, !1);if (0 < e || 0 == e && !1 !== f.clearWhenEmpty) return f;f.replacedWith && (f.collapsed = !0, f.widgetNode = ra("span", [f.replacedWith], "CodeMirror-widget"), d.handleMouseEvents || f.widgetNode.setAttribute("cm-ignore-events", "true"), d.insertLeft && (f.widgetNode.insertLeft = !0));if (f.collapsed) {
          if (pe(a, b.line, b, c, f) || b.line != c.line && pe(a, c.line, b, c, f)) throw Error("Inserting collapsed marker partially overlapping an existing one");Ca = !0;
        }f.addToHistory && lf(a, { from: b, to: c, origin: "markText" }, a.sel, NaN);var g = b.line,
            h = a.cm,
            k;a.iter(g, c.line + 1, function (a) {
          h && f.collapsed && !h.options.lineWrapping && ua(a) == h.display.maxLine && (k = !0);f.collapsed && g != b.line && sa(a, 0);var d = new wc(f, g == b.line ? b.ch : null, g == c.line ? c.ch : null);a.markedSpans = a.markedSpans ? a.markedSpans.concat([d]) : [d];d.marker.attachLine(a);++g;
        });f.collapsed && a.iter(b.line, c.line + 1, function (b) {
          Ha(a, b) && sa(b, 0);
        });f.clearOnEnter && y(f, "beforeCursorEnter", function () {
          return f.clear();
        });f.readOnly && (vf = !0, (a.history.done.length || a.history.undone.length) && a.clearHistory());f.collapsed && (f.id = ++Bf, f.atomic = !0);if (h) {
          k && (h.curOp.updateMaxLine = !0);if (f.collapsed) aa(h, b.line, c.line + 1);else if (f.className || f.startStyle || f.endStyle || f.css || f.attributes || f.title) for (d = b.line; d <= c.line; d++) Ja(h, d, "text");f.atomic && rf(h.doc);R(h, "markerAdded", h, f);
        }return f;
      }function Ng(a, b, c, d, e) {
        d = za(d);d.shared = !1;var f = [yb(a, b, c, d, e)],
            g = f[0],
            h = d.widgetNode;La(a, function (a) {
          h && (d.widgetNode = h.cloneNode(!0));f.push(yb(a, z(a, b), z(a, c), d, e));for (var l = 0; l < a.linked.length; ++l) if (a.linked[l].isParent) return;g = D(f);
        });return new $b(f, g);
      }function Cf(a) {
        return a.findMarks(q(a.first, 0), a.clipPos(q(a.lastLine())), function (a) {
          return a.parent;
        });
      }function Og(a) {
        for (var b = function (b) {
          b = a[b];var c = [b.primary.doc];La(b.primary.doc, function (a) {
            return c.push(a);
          });for (var f = 0; f < b.markers.length; f++) {
            var g = b.markers[f];-1 == O(c, g.doc) && (g.parent = null, b.markers.splice(f--, 1));
          }
        }, c = 0; c < a.length; c++) b(c);
      }function Pg(a) {
        var b = this;Df(b);if (!F(b, a) && !Da(b.display, a)) {
          Z(a);B && (Ef = +new Date());var c = Za(b, a, !0),
              d = a.dataTransfer.files;if (c && !b.isReadOnly()) if (d && d.length && window.FileReader && window.File) for (var e = d.length, f = Array(e), g = 0, h = function () {
            ++g == e && P(b, function () {
              c = z(b.doc, c);
              var a = { from: c, to: c, text: b.doc.splitLines(f.filter(function (a) {
                  return null != a;
                }).join(b.doc.lineSeparator())), origin: "paste" };wb(b.doc, a);of(b.doc, Fa(z(b.doc, c), z(b.doc, Ka(a))));
            })();
          }, k = function (a, c) {
            if (b.options.allowDropFileTypes && -1 == O(b.options.allowDropFileTypes, a.type)) h();else {
              var d = new FileReader();d.onerror = function () {
                return h();
              };d.onload = function () {
                var a = d.result;/[\x00-\x08\x0e-\x1f]{2}/.test(a) || (f[c] = a);h();
              };d.readAsText(a);
            }
          }, l = 0; l < d.length; l++) k(d[l], l);else if (b.state.draggingText && -1 < b.doc.sel.contains(c)) b.state.draggingText(a), setTimeout(function () {
            return b.display.input.focus();
          }, 20);else try {
            if (k = a.dataTransfer.getData("Text")) {
              b.state.draggingText && !b.state.draggingText.copy && (l = b.listSelections());Nc(b.doc, Fa(c, c));if (l) for (d = 0; d < l.length; ++d) xb(b.doc, "", l[d].anchor, l[d].head, "drag");b.replaceSelection(k, "around", "paste");b.display.input.focus();
            }
          } catch (m) {}
        }
      }function Df(a) {
        a.display.dragCursor && (a.display.lineSpace.removeChild(a.display.dragCursor), a.display.dragCursor = null);
      }function Ff(a) {
        if (document.getElementsByClassName) {
          for (var b = document.getElementsByClassName("CodeMirror"), c = [], d = 0; d < b.length; d++) {
            var e = b[d].CodeMirror;e && c.push(e);
          }c.length && c[0].operation(function () {
            for (var b = 0; b < c.length; b++) a(c[b]);
          });
        }
      }function Qg() {
        var a;y(window, "resize", function () {
          null == a && (a = setTimeout(function () {
            a = null;Ff(Rg);
          }, 100));
        });y(window, "blur", function () {
          return Ff(qb);
        });
      }function Rg(a) {
        var b = a.display;b.cachedCharWidth = b.cachedTextHeight = b.cachedPaddingH = null;b.scrollbarsClipped = !1;a.setSize();
      }function Sg(a) {
        var b = a.split(/-(?!$)/);a = b[b.length - 1];for (var c, d, e, f, g = 0; g < b.length - 1; g++) {
          var h = b[g];if (/^(cmd|meta|m)$/i.test(h)) f = !0;else if (/^a(lt)?$/i.test(h)) c = !0;else if (/^(c|ctrl|control)$/i.test(h)) d = !0;else if (/^s(hift)?$/i.test(h)) e = !0;else throw Error("Unrecognized modifier name: " + h);
        }c && (a = "Alt-" + a);d && (a = "Ctrl-" + a);f && (a = "Cmd-" + a);e && (a = "Shift-" + a);return a;
      }function Tg(a) {
        var b = {},
            c;for (c in a) if (a.hasOwnProperty(c)) {
          var d = a[c];if (!/^(name|fallthrough|(de|at)tach)$/.test(c)) {
            if ("..." != d) for (var e = Ba(c.split(" "), Sg), f = 0; f < e.length; f++) {
              var g = void 0,
                  h = void 0;f == e.length - 1 ? (h = e.join(" "), g = d) : (h = e.slice(0, f + 1).join(" "), g = "...");var k = b[h];if (!k) b[h] = g;else if (k != g) throw Error("Inconsistent bindings for " + h);
            }delete a[c];
          }
        }for (var l in b) a[l] = b[l];return a;
      }function zb(a, b, c, d) {
        b = Qc(b);var e = b.call ? b.call(a, d) : b[a];if (!1 === e) return "nothing";if ("..." === e) return "multi";if (null != e && c(e)) return "handled";if (b.fallthrough) {
          if ("[object Array]" != Object.prototype.toString.call(b.fallthrough)) return zb(a, b.fallthrough, c, d);for (e = 0; e < b.fallthrough.length; e++) {
            var f = zb(a, b.fallthrough[e], c, d);if (f) return f;
          }
        }
      }function Gf(a) {
        a = "string" == typeof a ? a : Na[a.keyCode];return "Ctrl" == a || "Alt" == a || "Shift" == a || "Mod" == a;
      }function Hf(a, b, c) {
        var d = a;b.altKey && "Alt" != d && (a = "Alt-" + a);(If ? b.metaKey : b.ctrlKey) && "Ctrl" != d && (a = "Ctrl-" + a);(If ? b.ctrlKey : b.metaKey) && "Mod" != d && (a = "Cmd-" + a);!c && b.shiftKey && "Shift" != d && (a = "Shift-" + a);return a;
      }function Jf(a, b) {
        if (pa && 34 == a.keyCode && a["char"]) return !1;var c = Na[a.keyCode];if (null == c || a.altGraphKey) return !1;3 == a.keyCode && a.code && (c = a.code);
        return Hf(c, a, b);
      }function Qc(a) {
        return "string" == typeof a ? ac[a] : a;
      }function Ab(a, b) {
        for (var c = a.doc.sel.ranges, d = [], e = 0; e < c.length; e++) {
          for (var f = b(c[e]); d.length && 0 >= A(f.from, D(d).to);) {
            var g = d.pop();if (0 > A(g.from, f.from)) {
              f.from = g.from;break;
            }
          }d.push(f);
        }ea(a, function () {
          for (var b = d.length - 1; 0 <= b; b--) xb(a.doc, "", d[b].from, d[b].to, "+delete");rb(a);
        });
      }function Pd(a, b, c) {
        b = Db(a.text, b + c, c);return 0 > b || b > a.text.length ? null : b;
      }function Qd(a, b, c) {
        a = Pd(a, b.ch, c);return null == a ? null : new q(b.line, a, 0 > c ? "after" : "before");
      }function Rd(a, b, c, d, e) {
        if (a && ("rtl" == b.doc.direction && (e = -e), a = n(c, b.doc.direction))) {
          a = 0 > e ? D(a) : a[0];var f = 0 > e == (1 == a.level) ? "after" : "before",
              g;if (0 < a.level || "rtl" == b.doc.direction) {
            var h = Xa(b, c);g = 0 > e ? c.text.length - 1 : 0;var k = na(b, h, g).top;g = ja(function (a) {
              return na(b, h, a).top == k;
            }, 0 > e == (1 == a.level) ? a.from : a.to - 1, g);"before" == f && (g = Pd(c, g, 1));
          } else g = 0 > e ? a.to : a.from;return new q(d, g, f);
        }return new q(d, 0 > e ? c.text.length : 0, 0 > e ? "before" : "after");
      }function Ug(a, b, c, d) {
        var e = n(b, a.doc.direction);
        if (!e) return Qd(b, c, d);c.ch >= b.text.length ? (c.ch = b.text.length, c.sticky = "before") : 0 >= c.ch && (c.ch = 0, c.sticky = "after");var f = J(e, c.ch, c.sticky),
            g = e[f];if ("ltr" == a.doc.direction && 0 == g.level % 2 && (0 < d ? g.to > c.ch : g.from < c.ch)) return Qd(b, c, d);var h = function (a, c) {
          return Pd(b, a instanceof q ? a.ch : a, c);
        },
            k,
            l = function (c) {
          if (!a.options.lineWrapping) return { begin: 0, end: b.text.length };k = k || Xa(a, b);return Le(a, b, k, c);
        },
            m = l("before" == c.sticky ? h(c, -1) : c.ch);if ("rtl" == a.doc.direction || 1 == g.level) {
          var v = 1 == g.level == 0 > d,
              p = h(c, v ? 1 : -1);if (null != p && (v ? p <= g.to && p <= m.end : p >= g.from && p >= m.begin)) return new q(c.line, p, v ? "before" : "after");
        }g = function (a, b, d) {
          for (var f = function (a, b) {
            return b ? new q(c.line, h(a, 1), "before") : new q(c.line, a, "after");
          }; 0 <= a && a < e.length; a += b) {
            var g = e[a],
                k = 0 < b == (1 != g.level),
                l = k ? d.begin : h(d.end, -1);if (g.from <= l && l < g.to) return f(l, k);l = k ? g.from : h(g.to, -1);if (d.begin <= l && l < d.end) return f(l, k);
          }
        };if (f = g(f + d, d, m)) return f;m = 0 < d ? m.end : h(m.begin, -1);return null == m || 0 < d && m == b.text.length || !(f = g(0 < d ? 0 : e.length - 1, d, l(m))) ? null : f;
      }function Kf(a, b) {
        var c = x(a.doc, b),
            d = ua(c);d != c && (b = G(d));return Rd(!0, a, d, b, 1);
      }function Lf(a, b) {
        var c = Kf(a, b.line),
            d = x(a.doc, c.line),
            e = n(d, a.doc.direction);return e && 0 != e[0].level ? c : (d = Math.max(c.ch, d.text.search(/\S/)), q(c.line, b.line == c.line && b.ch <= d && b.ch ? 0 : d, c.sticky));
      }function Rc(a, b, c) {
        if ("string" == typeof b && (b = bc[b], !b)) return !1;a.display.input.ensurePolled();var d = a.display.shift,
            e = !1;try {
          a.isReadOnly() && (a.state.suppressEdits = !0), c && (a.display.shift = !1), e = b(a) != Sc;
        } finally {
          a.display.shift = d, a.state.suppressEdits = !1;
        }return e;
      }function cc(a, b, c, d) {
        var e = a.state.keySeq;if (e) {
          if (Gf(b)) return "handled";/\'$/.test(b) ? a.state.keySeq = null : Vg.set(50, function () {
            a.state.keySeq == e && (a.state.keySeq = null, a.display.input.reset());
          });if (Mf(a, e + " " + b, c, d)) return !0;
        }return Mf(a, b, c, d);
      }function Mf(a, b, c, d) {
        a: {
          for (var e = 0; e < a.state.keyMaps.length; e++) {
            var f = zb(b, a.state.keyMaps[e], d, a);if (f) {
              d = f;break a;
            }
          }d = a.options.extraKeys && zb(b, a.options.extraKeys, d, a) || zb(b, a.options.keyMap, d, a);
        }"multi" == d && (a.state.keySeq = b);"handled" == d && R(a, "keyHandled", a, b, c);if ("handled" == d || "multi" == d) Z(c), Bd(a);return !!d;
      }function Nf(a, b) {
        var c = Jf(b, !0);return c ? b.shiftKey && !a.state.keySeq ? cc(a, "Shift-" + c, b, function (b) {
          return Rc(a, b, !0);
        }) || cc(a, c, b, function (b) {
          if ("string" == typeof b ? /^go[A-Z]/.test(b) : b.motion) return Rc(a, b);
        }) : cc(a, c, b, function (b) {
          return Rc(a, b);
        }) : !1;
      }function Wg(a, b, c) {
        return cc(a, "'" + c + "'", b, function (b) {
          return Rc(a, b, !0);
        });
      }function Of(a) {
        if (!a.target || a.target == this.display.input.getField()) if (this.curOp.focus = fa(), !F(this, a)) {
          B && 11 > H && 27 == a.keyCode && (a.returnValue = !1);var b = a.keyCode;this.display.shift = 16 == b || a.shiftKey;var c = Nf(this, a);pa && (Sd = c ? b : null, !c && 88 == b && !Xg && (la ? a.metaKey : a.ctrlKey) && this.replaceSelection("", null, "cut"));Ea && !la && !c && 46 == b && a.shiftKey && !a.ctrlKey && document.execCommand && document.execCommand("cut");18 != b || /\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className) || Yg(this);
        }
      }function Yg(a) {
        function b(a) {
          18 != a.keyCode && a.altKey || ($a(c, "CodeMirror-crosshair"), u(document, "keyup", b), u(document, "mouseover", b));
        }var c = a.display.lineDiv;ya(c, "CodeMirror-crosshair");y(document, "keyup", b);y(document, "mouseover", b);
      }function Pf(a) {
        16 == a.keyCode && (this.doc.sel.shift = !1);F(this, a);
      }function Qf(a) {
        if (!(a.target && a.target != this.display.input.getField() || Da(this.display, a) || F(this, a) || a.ctrlKey && !a.altKey || la && a.metaKey)) {
          var b = a.keyCode,
              c = a.charCode;if (pa && b == Sd) Sd = null, Z(a);else if (!pa || a.which && !(10 > a.which) || !Nf(this, a)) if (b = String.fromCharCode(null == c ? b : c), "\b" != b && !Wg(this, a, b)) this.display.input.onKeyPress(a);
        }
      }
      function Zg(a, b) {
        var c = +new Date();if (dc && dc.compare(c, a, b)) return ec = dc = null, "triple";if (ec && ec.compare(c, a, b)) return dc = new Td(c, a, b), ec = null, "double";ec = new Td(c, a, b);dc = null;return "single";
      }function Rf(a) {
        var b = this.display;if (!(F(this, a) || b.activeTouch && b.input.supportsTouch())) if (b.input.ensurePolled(), b.shift = a.shiftKey, Da(b, a)) V || (b.scroller.draggable = !1, setTimeout(function () {
          return b.scroller.draggable = !0;
        }, 100));else if (!Tc(this, a, "gutterClick", !0)) {
          var c = Za(this, a),
              d = ce(a),
              e = c ? Zg(c, d) : "single";
          window.focus();1 == d && this.state.selectingText && this.state.selectingText(a);if (!c || !$g(this, d, c, e, a)) if (1 == d) c ? ah(this, c, e, a) : (a.target || a.srcElement) == b.scroller && Z(a);else if (2 == d) c && Mc(this.doc, c), setTimeout(function () {
            return b.input.focus();
          }, 20);else if (3 == d) if (Ud) this.display.input.onContextMenu(a);else Re(this);
        }
      }function $g(a, b, c, d, e) {
        var f = "Click";"double" == d ? f = "Double" + f : "triple" == d && (f = "Triple" + f);return cc(a, Hf((1 == b ? "Left" : 2 == b ? "Middle" : "Right") + f, e), e, function (b) {
          "string" == typeof b && (b = bc[b]);if (!b) return !1;var d = !1;try {
            a.isReadOnly() && (a.state.suppressEdits = !0), d = b(a, c) != Sc;
          } finally {
            a.state.suppressEdits = !1;
          }return d;
        });
      }function ah(a, b, c, d) {
        B ? setTimeout(Qa(Qe, a), 0) : a.curOp.focus = fa();var e = a.getOption("configureMouse"),
            e = e ? e(a, c, d) : {};null == e.unit && (e.unit = (bh ? d.shiftKey && d.metaKey : d.altKey) ? "rectangle" : "single" == c ? "char" : "double" == c ? "word" : "line");if (null == e.extend || a.doc.extend) e.extend = a.doc.extend || d.shiftKey;null == e.addNew && (e.addNew = la ? d.metaKey : d.ctrlKey);null == e.moveOnDrag && (e.moveOnDrag = !(la ? d.altKey : d.ctrlKey));var f = a.doc.sel,
            g;a.options.dragDrop && ch && !a.isReadOnly() && "single" == c && -1 < (g = f.contains(b)) && (0 > A((g = f.ranges[g]).from(), b) || 0 < b.xRel) && (0 < A(g.to(), b) || 0 > b.xRel) ? dh(a, d, b, e) : eh(a, d, b, e);
      }function dh(a, b, c, d) {
        var e = a.display,
            f = !1,
            g = P(a, function (b) {
          V && (e.scroller.draggable = !1);a.state.draggingText = !1;u(e.wrapper.ownerDocument, "mouseup", g);u(e.wrapper.ownerDocument, "mousemove", h);u(e.scroller, "dragstart", k);u(e.scroller, "drop", g);f || (Z(b), d.addNew || Mc(a.doc, c, null, null, d.extend), V && !Vd || B && 9 == H ? setTimeout(function () {
            e.wrapper.ownerDocument.body.focus({ preventScroll: !0 });e.input.focus();
          }, 20) : e.input.focus());
        }),
            h = function (a) {
          f = f || 10 <= Math.abs(b.clientX - a.clientX) + Math.abs(b.clientY - a.clientY);
        },
            k = function () {
          return f = !0;
        };V && (e.scroller.draggable = !0);a.state.draggingText = g;g.copy = !d.moveOnDrag;e.scroller.dragDrop && e.scroller.dragDrop();y(e.wrapper.ownerDocument, "mouseup", g);y(e.wrapper.ownerDocument, "mousemove", h);y(e.scroller, "dragstart", k);y(e.scroller, "drop", g);Re(a);setTimeout(function () {
          return e.input.focus();
        }, 20);
      }function Sf(a, b, c) {
        if ("char" == c) return new C(b, b);if ("word" == c) return a.findWordAt(b);if ("line" == c) return new C(q(b.line, 0), z(a.doc, q(b.line + 1, 0)));a = c(a, b);return new C(a.from, a.to);
      }function eh(a, b, c, d) {
        function e(b) {
          if (0 != A(r, b)) if (r = b, "rectangle" == d.unit) {
            for (var e = [], f = a.options.tabSize, g = U(x(k, c.line).text, c.ch, f), h = U(x(k, b.line).text, b.ch, f), p = Math.min(g, h), g = Math.max(g, h), h = Math.min(c.line, b.line), n = Math.min(a.lastLine(), Math.max(c.line, b.line)); h <= n; h++) {
              var t = x(k, h).text,
                  u = Aa(t, p, f);p == g ? e.push(new C(q(h, u), q(h, u))) : t.length > u && e.push(new C(q(h, u), q(h, Aa(t, g, f))));
            }e.length || e.push(new C(c, c));S(k, qa(a, v.ranges.slice(0, m).concat(e), m), { origin: "*mouse", scroll: !1 });a.scrollIntoView(b);
          } else e = l, p = Sf(a, b, d.unit), b = e.anchor, 0 < A(p.anchor, b) ? (f = p.head, b = uc(e.from(), p.anchor)) : (f = p.anchor, b = tc(e.to(), p.head)), e = v.ranges.slice(0), e[m] = fh(a, new C(z(k, b), f)), S(k, qa(a, e, m), Wd);
        }function f(b) {
          var c = ++t,
              g = Za(a, b, !0, "rectangle" == d.unit);if (g) if (0 != A(g, r)) {
            a.curOp.focus = fa();e(g);var l = Fc(h, k);(g.line >= l.to || g.line < l.from) && setTimeout(P(a, function () {
              t == c && f(b);
            }), 150);
          } else {
            var m = b.clientY < n.top ? -20 : b.clientY > n.bottom ? 20 : 0;m && setTimeout(P(a, function () {
              t == c && (h.scroller.scrollTop += m, f(b));
            }), 50);
          }
        }function g(b) {
          a.state.selectingText = !1;t = Infinity;b && (Z(b), h.input.focus());u(h.wrapper.ownerDocument, "mousemove", w);u(h.wrapper.ownerDocument, "mouseup", F);k.history.lastSelOrigin = null;
        }var h = a.display,
            k = a.doc;Z(b);var l,
            m,
            v = k.sel,
            p = v.ranges;d.addNew && !d.extend ? (m = k.sel.contains(c), l = -1 < m ? p[m] : new C(c, c)) : (l = k.sel.primary(), m = k.sel.primIndex);"rectangle" == d.unit ? (d.addNew || (l = new C(c, c)), c = Za(a, b, !0, !0), m = -1) : (b = Sf(a, c, d.unit), l = d.extend ? Nd(l, b.anchor, b.head, d.extend) : b);d.addNew ? -1 == m ? (m = p.length, S(k, qa(a, p.concat([l]), m), { scroll: !1, origin: "*mouse" })) : 1 < p.length && p[m].empty() && "char" == d.unit && !d.extend ? (S(k, qa(a, p.slice(0, m).concat(p.slice(m + 1)), 0), { scroll: !1, origin: "*mouse" }), v = k.sel) : Od(k, m, l, Wd) : (m = 0, S(k, new ha([l], 0), Wd), v = k.sel);var r = c,
            n = h.wrapper.getBoundingClientRect(),
            t = 0,
            w = P(a, function (a) {
          0 !== a.buttons && ce(a) ? f(a) : g(a);
        }),
            F = P(a, g);a.state.selectingText = F;y(h.wrapper.ownerDocument, "mousemove", w);y(h.wrapper.ownerDocument, "mouseup", F);
      }function fh(a, b) {
        var c = b.anchor,
            d = b.head,
            e = x(a.doc, c.line);if (0 == A(c, d) && c.sticky == d.sticky) return b;e = n(e);if (!e) return b;var f = J(e, c.ch, c.sticky),
            g = e[f];if (g.from != c.ch && g.to != c.ch) return b;var h = f + (g.from == c.ch == (1 != g.level) ? 0 : 1);if (0 == h || h == e.length) return b;var k;d.line != c.line ? k = 0 < (d.line - c.line) * ("ltr" == a.doc.direction ? 1 : -1) : (k = J(e, d.ch, d.sticky), f = k - f || (d.ch - c.ch) * (1 == g.level ? -1 : 1), k = k == h - 1 || k == h ? 0 > f : 0 < f);e = e[h + (k ? -1 : 0)];e = (h = k == (1 == e.level)) ? e.from : e.to;h = h ? "after" : "before";return c.ch == e && c.sticky == h ? b : new C(new q(c.line, e, h), d);
      }function Tc(a, b, c, d) {
        var e, f;if (b.touches) e = b.touches[0].clientX, f = b.touches[0].clientY;else try {
          e = b.clientX, f = b.clientY;
        } catch (g) {
          return !1;
        }if (e >= Math.floor(a.display.gutters.getBoundingClientRect().right)) return !1;d && Z(b);d = a.display;var h = d.lineDiv.getBoundingClientRect();if (f > h.bottom || !ka(a, c)) return Xc(b);f -= h.top - d.viewOffset;for (h = 0; h < a.display.gutterSpecs.length; ++h) {
          var k = d.gutters.childNodes[h];if (k && k.getBoundingClientRect().right >= e) return e = Ua(a.doc, f), t(a, c, a, e, a.display.gutterSpecs[h].className, b), Xc(b);
        }
      }function Tf(a, b) {
        var c;(c = Da(a.display, b)) || (c = ka(a, "gutterContextMenu") ? Tc(a, b, "gutterContextMenu", !1) : !1);if (!c && !F(a, b, "contextmenu") && !Ud) a.display.input.onContextMenu(b);
      }function Uf(a) {
        a.display.wrapper.className = a.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + a.options.theme.replace(/(^|\s)\s*/g, " cm-s-");Mb(a);
      }function gh(a, b, c) {
        !b != !(c && c != Bb) && (c = a.display.dragFunctions, b = b ? y : u, b(a.display.scroller, "dragstart", c.start), b(a.display.scroller, "dragenter", c.enter), b(a.display.scroller, "dragover", c.over), b(a.display.scroller, "dragleave", c.leave), b(a.display.scroller, "drop", c.drop));
      }function hh(a) {
        a.options.lineWrapping ? (ya(a.display.wrapper, "CodeMirror-wrap"), a.display.sizer.style.minWidth = "", a.display.sizerWidth = null) : ($a(a.display.wrapper, "CodeMirror-wrap"), md(a));Ad(a);aa(a);Mb(a);setTimeout(function () {
          return sb(a);
        }, 100);
      }function I(a, b) {
        var c = this;if (!(this instanceof I)) return new I(a, b);this.options = b = b ? za(b) : {};za(Vf, b, !1);var d = b.value;"string" == typeof d ? d = new ba(d, b.mode, null, b.lineSeparator, b.direction) : b.mode && (d.modeOption = b.mode);this.doc = d;var e = new I.inputStyles[b.inputStyle](this),
            e = this.display = new Gg(a, d, e, b);e.wrapper.CodeMirror = this;Uf(this);b.lineWrapping && (this.display.wrapper.className += " CodeMirror-wrap");Xe(this);this.state = { keyMaps: [],
          overlays: [], modeGen: 0, overwrite: !1, delayingBlurEvent: !1, focused: !1, suppressEdits: !1, pasteIncoming: -1, cutIncoming: -1, selectingText: !1, draggingText: !1, highlight: new Oa(), keySeq: null, specialChars: null };b.autofocus && !Tb && e.input.focus();B && 11 > H && setTimeout(function () {
          return c.display.input.reset(!0);
        }, 20);ih(this);Wf || (Qg(), Wf = !0);bb(this);this.curOp.forceUpdate = !0;gf(this, d);b.autofocus && !Tb || this.hasFocus() ? setTimeout(function () {
          c.hasFocus() && !c.state.focused && Cd(c);
        }, 20) : qb(this);for (var f in Uc) if (Uc.hasOwnProperty(f)) Uc[f](this, b[f], Bb);$e(this);b.finishInit && b.finishInit(this);for (d = 0; d < Xd.length; ++d) Xd[d](this);cb(this);V && b.lineWrapping && "optimizelegibility" == getComputedStyle(e.lineDiv).textRendering && (e.lineDiv.style.textRendering = "auto");
      }function ih(a) {
        function b() {
          d.activeTouch && (e = setTimeout(function () {
            return d.activeTouch = null;
          }, 1E3), f = d.activeTouch, f.end = +new Date());
        }function c(a, b) {
          if (null == b.left) return !0;var c = b.left - a.left,
              d = b.top - a.top;return 400 < c * c + d * d;
        }var d = a.display;y(d.scroller, "mousedown", P(a, Rf));B && 11 > H ? y(d.scroller, "dblclick", P(a, function (b) {
          if (!F(a, b)) {
            var c = Za(a, b);!c || Tc(a, b, "gutterClick", !0) || Da(a.display, b) || (Z(b), b = a.findWordAt(c), Mc(a.doc, b.anchor, b.head));
          }
        })) : y(d.scroller, "dblclick", function (b) {
          return F(a, b) || Z(b);
        });y(d.scroller, "contextmenu", function (b) {
          return Tf(a, b);
        });y(d.input.getField(), "contextmenu", function (b) {
          d.scroller.contains(b.target) || Tf(a, b);
        });var e,
            f = { end: 0 };y(d.scroller, "touchstart", function (b) {
          var c;if (c = !F(a, b)) 1 != b.touches.length ? c = !1 : (c = b.touches[0], c = 1 >= c.radiusX && 1 >= c.radiusY), c = !c;c && !Tc(a, b, "gutterClick", !0) && (d.input.ensurePolled(), clearTimeout(e), c = +new Date(), d.activeTouch = { start: c, moved: !1, prev: 300 >= c - f.end ? f : null }, 1 == b.touches.length && (d.activeTouch.left = b.touches[0].pageX, d.activeTouch.top = b.touches[0].pageY));
        });y(d.scroller, "touchmove", function () {
          d.activeTouch && (d.activeTouch.moved = !0);
        });y(d.scroller, "touchend", function (e) {
          var f = d.activeTouch;if (f && !Da(d, e) && null != f.left && !f.moved && 300 > new Date() - f.start) {
            var g = a.coordsChar(d.activeTouch, "page"),
                f = !f.prev || c(f, f.prev) ? new C(g, g) : !f.prev.prev || c(f, f.prev.prev) ? a.findWordAt(g) : new C(q(g.line, 0), z(a.doc, q(g.line + 1, 0)));a.setSelection(f.anchor, f.head);a.focus();Z(e);
          }b();
        });y(d.scroller, "touchcancel", b);y(d.scroller, "scroll", function () {
          d.scroller.clientHeight && (Pb(a, d.scroller.scrollTop), ab(a, d.scroller.scrollLeft, !0), t(a, "scroll", a));
        });y(d.scroller, "mousewheel", function (b) {
          return cf(a, b);
        });y(d.scroller, "DOMMouseScroll", function (b) {
          return cf(a, b);
        });y(d.wrapper, "scroll", function () {
          return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0;
        });d.dragFunctions = { enter: function (b) {
            F(a, b) || Fb(b);
          }, over: function (b) {
            if (!F(a, b)) {
              var c = Za(a, b);if (c) {
                var d = document.createDocumentFragment();Pe(a, c, d);a.display.dragCursor || (a.display.dragCursor = w("div", null, "CodeMirror-cursors CodeMirror-dragcursors"), a.display.lineSpace.insertBefore(a.display.dragCursor, a.display.cursorDiv));Y(a.display.dragCursor, d);
              }Fb(b);
            }
          }, start: function (b) {
            if (B && (!a.state.draggingText || 100 > +new Date() - Ef)) Fb(b);else if (!F(a, b) && !Da(a.display, b) && (b.dataTransfer.setData("Text", a.getSelection()), b.dataTransfer.effectAllowed = "copyMove", b.dataTransfer.setDragImage && !Vd)) {
              var c = w("img", null, null, "position: fixed; left: 0; top: 0;");c.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw\x3d\x3d";pa && (c.width = c.height = 1, a.display.wrapper.appendChild(c), c._top = c.offsetTop);b.dataTransfer.setDragImage(c, 0, 0);pa && c.parentNode.removeChild(c);
            }
          }, drop: P(a, Pg), leave: function (b) {
            F(a, b) || Df(a);
          } };var g = d.input.getField();y(g, "keyup", function (b) {
          return Pf.call(a, b);
        });y(g, "keydown", P(a, Of));y(g, "keypress", P(a, Qf));y(g, "focus", function (b) {
          return Cd(a, b);
        });y(g, "blur", function (b) {
          return qb(a, b);
        });
      }function fc(a, b, c, d) {
        var e = a.doc,
            f;null == c && (c = "add");"smart" == c && (e.mode.indent ? f = Hb(a, b).state : c = "prev");var g = a.options.tabSize,
            h = x(e, b),
            k = U(h.text, null, g);h.stateAfter && (h.stateAfter = null);var l = h.text.match(/^\s*/)[0],
            m;if (!d && !/\S/.test(h.text)) m = 0, c = "not";else if ("smart" == c && (m = e.mode.indent(f, h.text.slice(l.length), h.text), m == Sc || 150 < m)) {
          if (!d) return;c = "prev";
        }"prev" == c ? m = b > e.first ? U(x(e, b - 1).text, null, g) : 0 : "add" == c ? m = k + a.options.indentUnit : "subtract" == c ? m = k - a.options.indentUnit : "number" == typeof c && (m = k + c);m = Math.max(0, m);c = "";d = 0;if (a.options.indentWithTabs) for (a = Math.floor(m / g); a; --a) d += g, c += "\t";d < m && (c += fb(m - d));if (c != l) return xb(e, c, q(b, 0), q(b, l.length), "+input"), h.stateAfter = null, !0;for (g = 0; g < e.sel.ranges.length; g++) if (h = e.sel.ranges[g], h.head.line == b && h.head.ch < l.length) {
          b = q(b, l.length);Od(e, g, new C(b, b));break;
        }
      }function Xf(a) {
        ia = a;
      }function Yd(a, b, c, d, e) {
        var f = a.doc;a.display.shift = !1;d || (d = f.sel);var g = +new Date() - 200,
            h = "paste" == e || a.state.pasteIncoming > g,
            k = Zd(b),
            l = null;if (h && 1 < d.ranges.length) if (ia && ia.text.join("\n") == b) {
          if (0 == d.ranges.length % ia.text.length) for (var l = [], m = 0; m < ia.text.length; m++) l.push(f.splitLines(ia.text[m]));
        } else k.length == d.ranges.length && a.options.pasteLinesPerSelection && (l = Ba(k, function (a) {
          return [a];
        }));for (var m = a.curOp.updateInput, v = d.ranges.length - 1; 0 <= v; v--) {
          var p = d.ranges[v],
              r = p.from(),
              n = p.to();p.empty() && (c && 0 < c ? r = q(r.line, r.ch - c) : a.state.overwrite && !h ? n = q(n.line, Math.min(x(f, n.line).text.length, n.ch + D(k).length)) : h && ia && ia.lineWise && ia.text.join("\n") == k.join("\n") && (r = n = q(r.line, 0)));p = { from: r, to: n, text: l ? l[v % l.length] : k, origin: e || (h ? "paste" : a.state.cutIncoming > g ? "cut" : "+input") };wb(a.doc, p);R(a, "inputRead", a, p);
        }b && !h && Yf(a, b);rb(a);2 > a.curOp.updateInput && (a.curOp.updateInput = m);a.curOp.typing = !0;a.state.pasteIncoming = a.state.cutIncoming = -1;
      }function Zf(a, b) {
        var c = a.clipboardData && a.clipboardData.getData("Text");if (c) return a.preventDefault(), b.isReadOnly() || b.options.disableInput || ea(b, function () {
          return Yd(b, c, 0, null, "paste");
        }), !0;
      }function Yf(a, b) {
        if (a.options.electricChars && a.options.smartIndent) for (var c = a.doc.sel, d = c.ranges.length - 1; 0 <= d; d--) {
          var e = c.ranges[d];if (!(100 < e.head.ch || d && c.ranges[d - 1].head.line == e.head.line)) {
            var f = a.getModeAt(e.head),
                g = !1;if (f.electricChars) for (var h = 0; h < f.electricChars.length; h++) {
              if (-1 < b.indexOf(f.electricChars.charAt(h))) {
                g = fc(a, e.head.line, "smart");break;
              }
            } else f.electricInput && f.electricInput.test(x(a.doc, e.head.line).text.slice(0, e.head.ch)) && (g = fc(a, e.head.line, "smart"));g && R(a, "electricInput", a, e.head.line);
          }
        }
      }function $f(a) {
        for (var b = [], c = [], d = 0; d < a.doc.sel.ranges.length; d++) {
          var e = a.doc.sel.ranges[d].head.line,
              e = { anchor: q(e, 0), head: q(e + 1, 0) };c.push(e);b.push(a.getRange(e.anchor, e.head));
        }return { text: b, ranges: c };
      }function ag(a, b, c, d) {
        a.setAttribute("autocorrect", c ? "" : "off");a.setAttribute("autocapitalize", d ? "" : "off");a.setAttribute("spellcheck", !!b);
      }function bg() {
        var a = w("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),
            b = w("div", [a], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");V ? a.style.width = "1000px" : a.setAttribute("wrap", "off");gc && (a.style.border = "1px solid black");ag(a);return b;
      }function $d(a, b, c, d, e) {
        function f(f) {
          var g;"codepoint" == d ? (g = k.text.charCodeAt(b.ch + (0 < d ? 0 : -1)), g = isNaN(g) ? null : new q(b.line, Math.max(0, Math.min(k.text.length, b.ch + c * (55296 <= g && 56320 > g ? 2 : 1))), -c)) : g = e ? Ug(a.cm, k, b, c) : Qd(k, b, c);if (null == g) {
            if (f = !f) f = b.line + l, f < a.first || f >= a.first + a.size ? f = !1 : (b = new q(f, b.ch, b.sticky), f = k = x(a, f));if (f) b = Rd(e, a.cm, k, b.line, l);else return !1;
          } else b = g;return !0;
        }var g = b,
            h = c,
            k = x(a, b.line),
            l = e && "rtl" == a.direction ? -c : c;if ("char" == d || "codepoint" == d) f();else if ("column" == d) f(!0);else if ("word" == d || "group" == d) for (var m = null, v = "group" == d, p = a.cm && a.cm.getHelper(b, "wordChars"), r = !0; !(0 > c) || f(!r); r = !1) {
          var n = k.text.charAt(b.ch) || "\n",
              n = Ra(n, p) ? "w" : v && "\n" == n ? "n" : !v || /\s/.test(n) ? null : "p";!v || r || n || (n = "s");if (m && m != n) {
            0 > c && (c = 1, f(), b.sticky = "after");break;
          }n && (m = n);if (0 < c && !f(!r)) break;
        }h = Oc(a, b, g, h, !0);dd(g, h) && (h.hitSide = !0);return h;
      }function cg(a, b, c, d) {
        var e = a.doc,
            f = b.left,
            g;"page" == d ? (g = Math.min(a.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight), g = Math.max(g - .5 * pb(a.display), 3), g = (0 < c ? b.bottom : b.top) + c * g) : "line" == d && (g = 0 < c ? b.bottom + 3 : b.top - 3);for (;;) {
          b = xd(a, f, g);if (!b.outside) break;if (0 > c ? 0 >= g : g >= e.height) {
            b.hitSide = !0;break;
          }g += 5 * c;
        }return b;
      }function dg(a, b) {
        var c = rd(a, b.line);if (!c || c.hidden) return null;var d = x(a.doc, b.line),
            c = Be(c, d, b.line),
            d = n(d, a.doc.direction),
            e = "left";d && (e = J(d, b.ch) % 2 ? "right" : "left");c = Ce(c.map, b.ch, e);c.offset = "right" == c.collapse ? c.end : c.start;return c;
      }function jh(a) {
        for (; a; a = a.parentNode) if (/CodeMirror-gutter-wrapper/.test(a.className)) return !0;return !1;
      }function Cb(a, b) {
        b && (a.bad = !0);return a;
      }function kh(a, b, c, d, e) {
        function f(a) {
          return function (b) {
            return b.id == a;
          };
        }function g() {
          m && (l += n, p && (l += n), m = p = !1);
        }function h(a) {
          a && (g(), l += a);
        }function k(b) {
          if (1 == b.nodeType) {
            var c = b.getAttribute("cm-text");if (c) h(c);else {
              var c = b.getAttribute("cm-marker"),
                  l;if (c) b = a.findMarks(q(d, 0), q(e + 1, 0), f(+c)), b.length && (l = b[0].find(0)) && h(Ta(a.doc, l.from, l.to).join(n));else if ("false" != b.getAttribute("contenteditable") && (l = /^(pre|div|p|li|table|br)$/i.test(b.nodeName), /^br$/i.test(b.nodeName) || 0 != b.textContent.length)) {
                l && g();for (c = 0; c < b.childNodes.length; c++) k(b.childNodes[c]);/^(pre|p)$/i.test(b.nodeName) && (p = !0);l && (m = !0);
              }
            }
          } else 3 == b.nodeType && h(b.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " "));
        }for (var l = "", m = !1, n = a.doc.lineSeparator(), p = !1;;) {
          k(b);if (b == c) break;b = b.nextSibling;p = !1;
        }return l;
      }function Vc(a, b, c) {
        var d;if (b == a.display.lineDiv) {
          d = a.display.lineDiv.childNodes[c];if (!d) return Cb(a.clipPos(q(a.display.viewTo - 1)), !0);b = null;c = 0;
        } else for (d = b;; d = d.parentNode) {
          if (!d || d == a.display.lineDiv) return null;if (d.parentNode && d.parentNode == a.display.lineDiv) break;
        }for (var e = 0; e < a.display.view.length; e++) {
          var f = a.display.view[e];if (f.node == d) return lh(f, b, c);
        }
      }function lh(a, b, c) {
        function d(b, c, d) {
          for (var e = -1; e < (l ? l.length : 0); e++) for (var f = 0 > e ? k.map : l[e], g = 0; g < f.length; g += 3) {
            var h = f[g + 2];if (h == b || h == c) {
              c = G(0 > e ? a.line : a.rest[e]);e = f[g] + d;if (0 > d || h != b) e = f[g + (d ? 1 : 0)];return q(c, e);
            }
          }
        }var e = a.text.firstChild,
            f = !1;if (!b || !T(e, b)) return Cb(q(G(a.line), 0), !0);if (b == e && (f = !0, b = e.childNodes[c], c = 0, !b)) return c = a.rest ? D(a.rest) : a.line, Cb(q(G(c), c.text.length), f);var g = 3 == b.nodeType ? b : null,
            h = b;g || 1 != b.childNodes.length || 3 != b.firstChild.nodeType || (g = b.firstChild, c && (c = g.nodeValue.length));for (; h.parentNode != e;) h = h.parentNode;var k = a.measure,
            l = k.maps;
        if (b = d(g, h, c)) return Cb(b, f);e = h.nextSibling;for (g = g ? g.nodeValue.length - c : 0; e; e = e.nextSibling) {
          if (b = d(e, e.firstChild, 0)) return Cb(q(b.line, b.ch - g), f);g += e.textContent.length;
        }for (h = h.previousSibling; h; h = h.previousSibling) {
          if (b = d(h, h.firstChild, -1)) return Cb(q(b.line, b.ch + c), f);c += h.textContent.length;
        }
      }var X = navigator.userAgent,
          eg = navigator.platform,
          Ea = /gecko\/\d/i.test(X),
          fg = /MSIE \d/.test(X),
          gg = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(X),
          hc = /Edge\/(\d+)/.exec(X),
          B = fg || gg || hc,
          H = B && (fg ? document.documentMode || 6 : +(hc || gg)[1]),
          V = !hc && /WebKit\//.test(X),
          mh = V && /Qt\/\d+\.\d+/.test(X),
          zc = !hc && /Chrome\//.test(X),
          pa = /Opera\//.test(X),
          Vd = /Apple Computer/.test(navigator.vendor),
          nh = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(X),
          Dg = /PhantomJS/.test(X),
          gc = !hc && /AppleWebKit/.test(X) && /Mobile\/\w+/.test(X),
          Ac = /Android/.test(X),
          Tb = gc || Ac || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(X),
          la = gc || /Mac/.test(eg),
          bh = /\bCrOS\b/.test(X),
          oh = /win/i.test(eg),
          db = pa && X.match(/Version\/(\d*\.\d*)/);db && (db = Number(db[1]));db && 15 <= db && (pa = !1, V = !0);var If = la && (mh || pa && (null == db || 12.11 > db)),
          Ud = Ea || B && 9 <= H,
          $a = function (a, b) {
        var c = a.className,
            d = M(b).exec(c);if (d) {
          var e = c.slice(d.index + d[0].length);a.className = c.slice(0, d.index) + (e ? d[1] + e : "");
        }
      },
          mb;mb = document.createRange ? function (a, b, c, d) {
        var e = document.createRange();e.setEnd(d || a, c);e.setStart(a, b);return e;
      } : function (a, b, c) {
        var d = document.body.createTextRange();try {
          d.moveToElementText(a.parentNode);
        } catch (e) {
          return d;
        }d.collapse(!0);d.moveEnd("character", c);d.moveStart("character", b);return d;
      };var ic = function (a) {
        a.select();
      };gc ? ic = function (a) {
        a.selectionStart = 0;a.selectionEnd = a.value.length;
      } : B && (ic = function (a) {
        try {
          a.select();
        } catch (b) {}
      });var Oa = function () {
        this.f = this.id = null;this.time = 0;this.handler = Qa(this.onTimeout, this);
      };Oa.prototype.onTimeout = function (a) {
        a.id = 0;a.time <= +new Date() ? a.f() : setTimeout(a.handler, a.time - +new Date());
      };Oa.prototype.set = function (a, b) {
        this.f = b;var c = +new Date() + a;if (!this.id || c < this.time) clearTimeout(this.id), this.id = setTimeout(this.handler, a), this.time = c;
      };var Sc = { toString: function () {
          return "CodeMirror.Pass";
        } },
          xa = { scroll: !1 },
          Wd = { origin: "*mouse" },
          jc = { origin: "+move" },
          oc = [""],
          hg = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,
          ig = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,
          Eb = null,
          jg = function () {
        function a(a) {
          return 247 >= a ? "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(a) : 1424 <= a && 1524 >= a ? "R" : 1536 <= a && 1785 >= a ? "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(a - 1536) : 1774 <= a && 2220 >= a ? "r" : 8192 <= a && 8203 >= a ? "w" : 8204 == a ? "b" : "L";
        }function b(a, b, c) {
          this.level = a;this.from = b;this.to = c;
        }var c = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,
            d = /[stwN]/,
            e = /[LRr]/,
            f = /[Lb1n]/,
            g = /[1n]/;return function (h, k) {
          var l = "ltr" == k ? "L" : "R";if (0 == h.length || "ltr" == k && !c.test(h)) return !1;for (var m = h.length, n = [], p = 0; p < m; ++p) n.push(a(h.charCodeAt(p)));for (var p = 0, r = l; p < m; ++p) {
            var q = n[p];"m" == q ? n[p] = r : r = q;
          }p = 0;for (r = l; p < m; ++p) q = n[p], "1" == q && "r" == r ? n[p] = "n" : e.test(q) && (r = q, "r" == q && (n[p] = "R"));
          p = 1;for (r = n[0]; p < m - 1; ++p) q = n[p], "+" == q && "1" == r && "1" == n[p + 1] ? n[p] = "1" : "," != q || r != n[p + 1] || "1" != r && "n" != r || (n[p] = r), r = q;for (p = 0; p < m; ++p) if (r = n[p], "," == r) n[p] = "N";else if ("%" == r) {
            r = void 0;for (r = p + 1; r < m && "%" == n[r]; ++r);for (q = p && "!" == n[p - 1] || r < m && "1" == n[r] ? "1" : "N"; p < r; ++p) n[p] = q;p = r - 1;
          }p = 0;for (r = l; p < m; ++p) q = n[p], "L" == r && "1" == q ? n[p] = "L" : e.test(q) && (r = q);for (r = 0; r < m; ++r) if (d.test(n[r])) {
            p = void 0;for (p = r + 1; p < m && d.test(n[p]); ++p);q = "L" == (r ? n[r - 1] : l);for (q = q == ("L" == (p < m ? n[p] : l)) ? q ? "L" : "R" : l; r < p; ++r) n[r] = q;r = p - 1;
          }for (var l = [], t, p = 0; p < m;) if (f.test(n[p])) {
            r = p;for (++p; p < m && f.test(n[p]); ++p);l.push(new b(0, r, p));
          } else {
            var u = p,
                r = l.length,
                q = "rtl" == k ? 1 : 0;for (++p; p < m && "L" != n[p]; ++p);for (var x = u; x < p;) if (g.test(n[x])) {
              u < x && (l.splice(r, 0, new b(1, u, x)), r += q);u = x;for (++x; x < p && g.test(n[x]); ++x);l.splice(r, 0, new b(2, u, x));r += q;u = x;
            } else ++x;u < p && l.splice(r, 0, new b(1, u, p));
          }"ltr" == k && (1 == l[0].level && (t = h.match(/^\s+/)) && (l[0].from = t[0].length, l.unshift(new b(0, 0, t[0].length))), 1 == D(l).level && (t = h.match(/\s+$/)) && (D(l).to -= t[0].length, l.push(new b(0, m - t[0].length, m))));return "rtl" == k ? l.reverse() : l;
        };
      }(),
          rc = [],
          y = function (a, b, c) {
        a.addEventListener ? a.addEventListener(b, c, !1) : a.attachEvent ? a.attachEvent("on" + b, c) : (a = a._handlers || (a._handlers = {}), a[b] = (a[b] || rc).concat(c));
      },
          ch = function () {
        if (B && 9 > H) return !1;var a = w("div");return "draggable" in a || "dragDrop" in a;
      }(),
          Yc,
          nd,
          Zd = 3 != "\n\nb".split(/\n/).length ? function (a) {
        for (var b = 0, c = [], d = a.length; b <= d;) {
          var e = a.indexOf("\n", b);-1 == e && (e = a.length);var f = a.slice(b, "\r" == a.charAt(e - 1) ? e - 1 : e),
              g = f.indexOf("\r");-1 != g ? (c.push(f.slice(0, g)), b += g + 1) : (c.push(f), b = e + 1);
        }return c;
      } : function (a) {
        return a.split(/\r\n?|\n/);
      },
          ph = window.getSelection ? function (a) {
        try {
          return a.selectionStart != a.selectionEnd;
        } catch (b) {
          return !1;
        }
      } : function (a) {
        var b;try {
          b = a.ownerDocument.selection.createRange();
        } catch (c) {}return b && b.parentElement() == a ? 0 != b.compareEndPoints("StartToEnd", b) : !1;
      },
          Xg = function () {
        var a = w("div");if ("oncopy" in a) return !0;a.setAttribute("oncopy", "return;");return "function" == typeof a.oncopy;
      }(),
          td = null,
          Zc = {},
          jb = {},
          kb = {},
          N = function (a, b, c) {
        this.pos = this.start = 0;this.string = a;this.tabSize = b || 8;this.lineStart = this.lastColumnPos = this.lastColumnValue = 0;this.lineOracle = c;
      };N.prototype.eol = function () {
        return this.pos >= this.string.length;
      };N.prototype.sol = function () {
        return this.pos == this.lineStart;
      };N.prototype.peek = function () {
        return this.string.charAt(this.pos) || void 0;
      };N.prototype.next = function () {
        if (this.pos < this.string.length) return this.string.charAt(this.pos++);
      };N.prototype.eat = function (a) {
        var b = this.string.charAt(this.pos);if ("string" == typeof a ? b == a : b && (a.test ? a.test(b) : a(b))) return ++this.pos, b;
      };N.prototype.eatWhile = function (a) {
        for (var b = this.pos; this.eat(a););return this.pos > b;
      };N.prototype.eatSpace = function () {
        for (var a = this.pos; /[\s\u00a0]/.test(this.string.charAt(this.pos));) ++this.pos;return this.pos > a;
      };N.prototype.skipToEnd = function () {
        this.pos = this.string.length;
      };N.prototype.skipTo = function (a) {
        a = this.string.indexOf(a, this.pos);if (-1 < a) return this.pos = a, !0;
      };N.prototype.backUp = function (a) {
        this.pos -= a;
      };N.prototype.column = function () {
        this.lastColumnPos < this.start && (this.lastColumnValue = U(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue), this.lastColumnPos = this.start);return this.lastColumnValue - (this.lineStart ? U(this.string, this.lineStart, this.tabSize) : 0);
      };N.prototype.indentation = function () {
        return U(this.string, null, this.tabSize) - (this.lineStart ? U(this.string, this.lineStart, this.tabSize) : 0);
      };N.prototype.match = function (a, b, c) {
        if ("string" == typeof a) {
          var d = function (a) {
            return c ? a.toLowerCase() : a;
          },
              e = this.string.substr(this.pos, a.length);if (d(e) == d(a)) return !1 !== b && (this.pos += a.length), !0;
        } else {
          if ((a = this.string.slice(this.pos).match(a)) && 0 < a.index) return null;a && !1 !== b && (this.pos += a[0].length);return a;
        }
      };N.prototype.current = function () {
        return this.string.slice(this.start, this.pos);
      };N.prototype.hideFirstChars = function (a, b) {
        this.lineStart += a;try {
          return b();
        } finally {
          this.lineStart -= a;
        }
      };N.prototype.lookAhead = function (a) {
        var b = this.lineOracle;return b && b.lookAhead(a);
      };N.prototype.baseToken = function () {
        var a = this.lineOracle;return a && a.baseToken(this.pos);
      };var vc = function (a, b) {
        this.state = a;this.lookAhead = b;
      },
          ta = function (a, b, c, d) {
        this.state = b;this.doc = a;this.line = c;this.maxLookAhead = d || 0;this.baseTokens = null;this.baseTokenPos = 1;
      };ta.prototype.lookAhead = function (a) {
        var b = this.doc.getLine(this.line + a);null != b && a > this.maxLookAhead && (this.maxLookAhead = a);return b;
      };ta.prototype.baseToken = function (a) {
        if (!this.baseTokens) return null;for (; this.baseTokens[this.baseTokenPos] <= a;) this.baseTokenPos += 2;var b = this.baseTokens[this.baseTokenPos + 1];return { type: b && b.replace(/( |^)overlay .*/, ""), size: this.baseTokens[this.baseTokenPos] - a };
      };ta.prototype.nextLine = function () {
        this.line++;0 < this.maxLookAhead && this.maxLookAhead--;
      };ta.fromSaved = function (a, b, c) {
        return b instanceof vc ? new ta(a, Sa(a.mode, b.state), c, b.lookAhead) : new ta(a, Sa(a.mode, b), c);
      };ta.prototype.save = function (a) {
        a = !1 !== a ? Sa(this.doc.mode, this.state) : this.state;return 0 < this.maxLookAhead ? new vc(a, this.maxLookAhead) : a;
      };var ke = function (a, b, c) {
        this.start = a.start;this.end = a.pos;this.string = a.current();this.type = b || null;this.state = c;
      },
          vf = !1,
          Ca = !1,
          tb = function (a, b, c) {
        this.text = a;oe(this, b);this.height = c ? c(this) : 1;
      };tb.prototype.lineNo = function () {
        return G(this);
      };ib(tb);var rg = {},
          qg = {},
          nb = null,
          Jb = null,
          De = { left: 0, right: 0, top: 0, bottom: 0 },
          Ya,
          eb = function (a, b, c) {
        this.cm = c;var d = this.vert = w("div", [w("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"),
            e = this.horiz = w("div", [w("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar");
        d.tabIndex = e.tabIndex = -1;a(d);a(e);y(d, "scroll", function () {
          d.clientHeight && b(d.scrollTop, "vertical");
        });y(e, "scroll", function () {
          e.clientWidth && b(e.scrollLeft, "horizontal");
        });this.checkedZeroWidth = !1;B && 8 > H && (this.horiz.style.minHeight = this.vert.style.minWidth = "18px");
      };eb.prototype.update = function (a) {
        var b = a.scrollWidth > a.clientWidth + 1,
            c = a.scrollHeight > a.clientHeight + 1,
            d = a.nativeBarWidth;c ? (this.vert.style.display = "block", this.vert.style.bottom = b ? d + "px" : "0", this.vert.firstChild.style.height = Math.max(0, a.scrollHeight - a.clientHeight + (a.viewHeight - (b ? d : 0))) + "px") : (this.vert.style.display = "", this.vert.firstChild.style.height = "0");b ? (this.horiz.style.display = "block", this.horiz.style.right = c ? d + "px" : "0", this.horiz.style.left = a.barLeft + "px", this.horiz.firstChild.style.width = Math.max(0, a.scrollWidth - a.clientWidth + (a.viewWidth - a.barLeft - (c ? d : 0))) + "px") : (this.horiz.style.display = "", this.horiz.firstChild.style.width = "0");!this.checkedZeroWidth && 0 < a.clientHeight && (0 == d && this.zeroWidthHack(), this.checkedZeroWidth = !0);return { right: c ? d : 0, bottom: b ? d : 0 };
      };eb.prototype.setScrollLeft = function (a) {
        this.horiz.scrollLeft != a && (this.horiz.scrollLeft = a);this.disableHoriz && this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz");
      };eb.prototype.setScrollTop = function (a) {
        this.vert.scrollTop != a && (this.vert.scrollTop = a);this.disableVert && this.enableZeroWidthBar(this.vert, this.disableVert, "vert");
      };eb.prototype.zeroWidthHack = function () {
        this.horiz.style.height = this.vert.style.width = la && !nh ? "12px" : "18px";this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none";this.disableHoriz = new Oa();this.disableVert = new Oa();
      };eb.prototype.enableZeroWidthBar = function (a, b, c) {
        function d() {
          var e = a.getBoundingClientRect();("vert" == c ? document.elementFromPoint(e.right - 1, (e.top + e.bottom) / 2) : document.elementFromPoint((e.right + e.left) / 2, e.bottom - 1)) != a ? a.style.pointerEvents = "none" : b.set(1E3, d);
        }a.style.pointerEvents = "auto";b.set(1E3, d);
      };eb.prototype.clear = function () {
        var a = this.horiz.parentNode;a.removeChild(this.horiz);a.removeChild(this.vert);
      };
      var kc = function () {};kc.prototype.update = function () {
        return { bottom: 0, right: 0 };
      };kc.prototype.setScrollLeft = function () {};kc.prototype.setScrollTop = function () {};kc.prototype.clear = function () {};var Ye = { "native": eb, "null": kc },
          Cg = 0,
          Ic = function (a, b, c) {
        var d = a.display;this.viewport = b;this.visible = Fc(d, a.doc, b);this.editorIsHidden = !d.wrapper.offsetWidth;this.wrapperHeight = d.wrapper.clientHeight;this.wrapperWidth = d.wrapper.clientWidth;this.oldDisplayWidth = Va(a);this.force = c;this.dims = sd(a);this.events = [];
      };Ic.prototype.signal = function (a, b) {
        ka(a, b) && this.events.push(arguments);
      };Ic.prototype.finish = function () {
        for (var a = 0; a < this.events.length; a++) t.apply(null, this.events[a]);
      };var Jc = 0,
          ga = null;B ? ga = -.53 : Ea ? ga = 15 : zc ? ga = -.7 : Vd && (ga = -1 / 3);var ha = function (a, b) {
        this.ranges = a;this.primIndex = b;
      };ha.prototype.primary = function () {
        return this.ranges[this.primIndex];
      };ha.prototype.equals = function (a) {
        if (a == this) return !0;if (a.primIndex != this.primIndex || a.ranges.length != this.ranges.length) return !1;for (var b = 0; b < this.ranges.length; b++) {
          var c = this.ranges[b],
              d = a.ranges[b];if (!dd(c.anchor, d.anchor) || !dd(c.head, d.head)) return !1;
        }return !0;
      };ha.prototype.deepCopy = function () {
        for (var a = [], b = 0; b < this.ranges.length; b++) a[b] = new C(ed(this.ranges[b].anchor), ed(this.ranges[b].head));return new ha(a, this.primIndex);
      };ha.prototype.somethingSelected = function () {
        for (var a = 0; a < this.ranges.length; a++) if (!this.ranges[a].empty()) return !0;return !1;
      };ha.prototype.contains = function (a, b) {
        b || (b = a);for (var c = 0; c < this.ranges.length; c++) {
          var d = this.ranges[c];if (0 <= A(b, d.from()) && 0 >= A(a, d.to())) return c;
        }return -1;
      };var C = function (a, b) {
        this.anchor = a;this.head = b;
      };C.prototype.from = function () {
        return uc(this.anchor, this.head);
      };C.prototype.to = function () {
        return tc(this.anchor, this.head);
      };C.prototype.empty = function () {
        return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch;
      };Xb.prototype = { chunkSize: function () {
          return this.lines.length;
        }, removeInner: function (a, b) {
          for (var c = a; c < a + b; ++c) {
            var e = this.lines[c];this.height -= e.height;var f = e;f.parent = null;ne(f);R(e, "delete");
          }this.lines.splice(a, b);
        }, collapse: function (a) {
          a.push.apply(a, this.lines);
        }, insertInner: function (a, b, c) {
          this.height += c;this.lines = this.lines.slice(0, a).concat(b).concat(this.lines.slice(a));for (a = 0; a < b.length; ++a) b[a].parent = this;
        }, iterN: function (a, b, c) {
          for (b = a + b; a < b; ++a) if (c(this.lines[a])) return !0;
        } };Yb.prototype = { chunkSize: function () {
          return this.size;
        }, removeInner: function (a, b) {
          this.size -= b;for (var c = 0; c < this.children.length; ++c) {
            var d = this.children[c],
                e = d.chunkSize();if (a < e) {
              var f = Math.min(b, e - a),
                  g = d.height;d.removeInner(a, f);this.height -= g - d.height;e == f && (this.children.splice(c--, 1), d.parent = null);if (0 == (b -= f)) break;a = 0;
            } else a -= e;
          }25 > this.size - b && (1 < this.children.length || !(this.children[0] instanceof Xb)) && (c = [], this.collapse(c), this.children = [new Xb(c)], this.children[0].parent = this);
        }, collapse: function (a) {
          for (var b = 0; b < this.children.length; ++b) this.children[b].collapse(a);
        }, insertInner: function (a, b, c) {
          this.size += b.length;this.height += c;for (var d = 0; d < this.children.length; ++d) {
            var e = this.children[d],
                f = e.chunkSize();if (a <= f) {
              e.insertInner(a, b, c);if (e.lines && 50 < e.lines.length) {
                for (b = a = e.lines.length % 25 + 25; b < e.lines.length;) c = new Xb(e.lines.slice(b, b += 25)), e.height -= c.height, this.children.splice(++d, 0, c), c.parent = this;e.lines = e.lines.slice(0, a);this.maybeSpill();
              }break;
            }a -= f;
          }
        }, maybeSpill: function () {
          if (!(10 >= this.children.length)) {
            var a = this;do {
              var b = a.children.splice(a.children.length - 5, 5),
                  b = new Yb(b);if (a.parent) {
                a.size -= b.size;a.height -= b.height;var c = O(a.parent.children, a);a.parent.children.splice(c + 1, 0, b);
              } else c = new Yb(a.children), c.parent = a, a.children = [c, b], a = c;b.parent = a.parent;
            } while (10 < a.children.length);a.parent.maybeSpill();
          }
        }, iterN: function (a, b, c) {
          for (var d = 0; d < this.children.length; ++d) {
            var e = this.children[d],
                f = e.chunkSize();if (a < f) {
              f = Math.min(b, f - a);if (e.iterN(a, f, c)) return !0;if (0 == (b -= f)) break;a = 0;
            } else a -= f;
          }
        } };var Zb = function (a, b, c) {
        if (c) for (var d in c) c.hasOwnProperty(d) && (this[d] = c[d]);this.doc = a;this.node = b;
      };Zb.prototype.clear = function () {
        var a = this.doc.cm,
            b = this.line.widgets,
            c = this.line,
            d = G(c);if (null != d && b) {
          for (var e = 0; e < b.length; ++e) b[e] == this && b.splice(e--, 1);b.length || (c.widgets = null);var f = Lb(this);sa(c, Math.max(0, c.height - f));a && (ea(a, function () {
            va(c) < (a.curOp && a.curOp.scrollTop || a.doc.scrollTop) && Gc(a, -f);Ja(a, d, "widget");
          }), R(a, "lineWidgetCleared", a, this, d));
        }
      };Zb.prototype.changed = function () {
        var a = this,
            b = this.height,
            c = this.doc.cm,
            d = this.line;this.height = null;var e = Lb(this) - b;e && (Ha(this.doc, d) || sa(d, d.height + e), c && ea(c, function () {
          c.curOp.forceUpdate = !0;va(d) < (c.curOp && c.curOp.scrollTop || c.doc.scrollTop) && Gc(c, e);R(c, "lineWidgetChanged", c, a, G(d));
        }));
      };ib(Zb);var Bf = 0,
          Ma = function (a, b) {
        this.lines = [];this.type = b;this.doc = a;this.id = ++Bf;
      };Ma.prototype.clear = function () {
        if (!this.explicitlyCleared) {
          var a = this.doc.cm,
              b = a && !a.curOp;b && bb(a);if (ka(this, "clear")) {
            var c = this.find();c && R(this, "clear", c.from, c.to);
          }for (var d = c = null, e = 0; e < this.lines.length; ++e) {
            var f = this.lines[e],
                g = Ib(f.markedSpans, this);a && !this.collapsed ? Ja(a, G(f), "text") : a && (null != g.to && (d = G(f)), null != g.from && (c = G(f)));for (var h = f, k = f.markedSpans, l = g, m = void 0, n = 0; n < k.length; ++n) k[n] != l && (m || (m = [])).push(k[n]);h.markedSpans = m;null == g.from && this.collapsed && !Ha(this.doc, f) && a && sa(f, pb(a.display));
          }if (a && this.collapsed && !a.options.lineWrapping) for (e = 0; e < this.lines.length; ++e) f = ua(this.lines[e]), g = xc(f), g > a.display.maxLineLength && (a.display.maxLine = f, a.display.maxLineLength = g, a.display.maxLineChanged = !0);null != c && a && this.collapsed && aa(a, c, d + 1);this.lines.length = 0;this.explicitlyCleared = !0;this.atomic && this.doc.cantEdit && (this.doc.cantEdit = !1, a && rf(a.doc));a && R(a, "markerCleared", a, this, c, d);b && cb(a);this.parent && this.parent.clear();
        }
      };Ma.prototype.find = function (a, b) {
        null == a && "bookmark" == this.type && (a = 1);for (var c, d, e = 0; e < this.lines.length; ++e) {
          var f = this.lines[e],
              g = Ib(f.markedSpans, this);if (null != g.from && (c = q(b ? f : G(f), g.from), -1 == a)) return c;if (null != g.to && (d = q(b ? f : G(f), g.to), 1 == a)) return d;
        }return c && { from: c, to: d };
      };Ma.prototype.changed = function () {
        var a = this,
            b = this.find(-1, !0),
            c = this,
            d = this.doc.cm;b && d && ea(d, function () {
          var e = b.line,
              f = G(b.line);if (f = rd(d, f)) Ee(f), d.curOp.selectionChanged = d.curOp.forceUpdate = !0;d.curOp.updateMaxLine = !0;Ha(c.doc, e) || null == c.height || (f = c.height, c.height = null, (f = Lb(c) - f) && sa(e, e.height + f));R(d, "markerChanged", d, a);
        });
      };Ma.prototype.attachLine = function (a) {
        if (!this.lines.length && this.doc.cm) {
          var b = this.doc.cm.curOp;b.maybeHiddenMarkers && -1 != O(b.maybeHiddenMarkers, this) || (b.maybeUnhiddenMarkers || (b.maybeUnhiddenMarkers = [])).push(this);
        }this.lines.push(a);
      };Ma.prototype.detachLine = function (a) {
        this.lines.splice(O(this.lines, a), 1);!this.lines.length && this.doc.cm && (a = this.doc.cm.curOp, (a.maybeHiddenMarkers || (a.maybeHiddenMarkers = [])).push(this));
      };ib(Ma);var $b = function (a, b) {
        this.markers = a;this.primary = b;for (var c = 0; c < a.length; ++c) a[c].parent = this;
      };$b.prototype.clear = function () {
        if (!this.explicitlyCleared) {
          this.explicitlyCleared = !0;for (var a = 0; a < this.markers.length; ++a) this.markers[a].clear();R(this, "clear");
        }
      };$b.prototype.find = function (a, b) {
        return this.primary.find(a, b);
      };ib($b);var qh = 0,
          ba = function (a, b, c, d, e) {
        if (!(this instanceof ba)) return new ba(a, b, c, d, e);null == c && (c = 0);Yb.call(this, [new Xb([new tb("", null)])]);this.first = c;this.scrollTop = this.scrollLeft = 0;this.cantEdit = !1;this.cleanGeneration = 1;this.modeFrontier = this.highlightFrontier = c;c = q(c, 0);this.sel = Fa(c);this.history = new Kc(null);this.id = ++qh;this.modeOption = b;this.lineSep = d;this.direction = "rtl" == e ? "rtl" : "ltr";this.extend = !1;"string" == typeof a && (a = this.splitLines(a));Ld(this, { from: c, to: c, text: a });S(this, Fa(c), xa);
      };ba.prototype = qc(Yb.prototype, { constructor: ba, iter: function (a, b, c) {
          c ? this.iterN(a - this.first, b - a, c) : this.iterN(this.first, this.first + this.size, a);
        }, insert: function (a, b) {
          for (var c = 0, d = 0; d < b.length; ++d) c += b[d].height;this.insertInner(a - this.first, b, c);
        }, remove: function (a, b) {
          this.removeInner(a - this.first, b);
        }, getValue: function (a) {
          var b = bd(this, this.first, this.first + this.size);return !1 === a ? b : b.join(a || this.lineSeparator());
        }, setValue: Q(function (a) {
          var b = q(this.first, 0),
              c = this.first + this.size - 1;wb(this, { from: b, to: q(c, x(this, c).text.length), text: this.splitLines(a), origin: "setValue",
            full: !0 }, !0);this.cm && Ob(this.cm, 0, 0);S(this, Fa(b), xa);
        }), replaceRange: function (a, b, c, d) {
          b = z(this, b);c = c ? z(this, c) : b;xb(this, a, b, c, d);
        }, getRange: function (a, b, c) {
          a = Ta(this, z(this, a), z(this, b));return !1 === c ? a : a.join(c || this.lineSeparator());
        }, getLine: function (a) {
          return (a = this.getLineHandle(a)) && a.text;
        }, getLineHandle: function (a) {
          if (Gb(this, a)) return x(this, a);
        }, getLineNumber: function (a) {
          return G(a);
        }, getLineHandleVisualStart: function (a) {
          "number" == typeof a && (a = x(this, a));return ua(a);
        }, lineCount: function () {
          return this.size;
        },
        firstLine: function () {
          return this.first;
        }, lastLine: function () {
          return this.first + this.size - 1;
        }, clipPos: function (a) {
          return z(this, a);
        }, getCursor: function (a) {
          var b = this.sel.primary();return null == a || "head" == a ? b.head : "anchor" == a ? b.anchor : "end" == a || "to" == a || !1 === a ? b.to() : b.from();
        }, listSelections: function () {
          return this.sel.ranges;
        }, somethingSelected: function () {
          return this.sel.somethingSelected();
        }, setCursor: Q(function (a, b, c) {
          a = z(this, "number" == typeof a ? q(a, b || 0) : a);S(this, Fa(a, null), c);
        }), setSelection: Q(function (a, b, c) {
          var d = z(this, a);a = z(this, b || a);S(this, Fa(d, a), c);
        }), extendSelection: Q(function (a, b, c) {
          Mc(this, z(this, a), b && z(this, b), c);
        }), extendSelections: Q(function (a, b) {
          nf(this, ee(this, a), b);
        }), extendSelectionsBy: Q(function (a, b) {
          var c = Ba(this.sel.ranges, a);nf(this, ee(this, c), b);
        }), setSelections: Q(function (a, b, c) {
          if (a.length) {
            for (var d = [], e = 0; e < a.length; e++) d[e] = new C(z(this, a[e].anchor), z(this, a[e].head));null == b && (b = Math.min(a.length - 1, this.sel.primIndex));S(this, qa(this.cm, d, b), c);
          }
        }), addSelection: Q(function (a, b, c) {
          var d = this.sel.ranges.slice(0);d.push(new C(z(this, a), z(this, b || a)));S(this, qa(this.cm, d, d.length - 1), c);
        }), getSelection: function (a) {
          for (var b = this.sel.ranges, c, d = 0; d < b.length; d++) {
            var e = Ta(this, b[d].from(), b[d].to());c = c ? c.concat(e) : e;
          }return !1 === a ? c : c.join(a || this.lineSeparator());
        }, getSelections: function (a) {
          for (var b = [], c = this.sel.ranges, d = 0; d < c.length; d++) {
            var e = Ta(this, c[d].from(), c[d].to());!1 !== a && (e = e.join(a || this.lineSeparator()));b[d] = e;
          }return b;
        }, replaceSelection: function (a, b, c) {
          for (var d = [], e = 0; e < this.sel.ranges.length; e++) d[e] = a;this.replaceSelections(d, b, c || "+input");
        }, replaceSelections: Q(function (a, b, c) {
          for (var d = [], e = this.sel, f = 0; f < e.ranges.length; f++) {
            var g = e.ranges[f];d[f] = { from: g.from(), to: g.to(), text: this.splitLines(a[f]), origin: c };
          }if (a = b && "end" != b) {
            a = [];e = c = q(this.first, 0);for (f = 0; f < d.length; f++) {
              var h = d[f],
                  g = ef(h.from, c, e),
                  k = ef(Ka(h), c, e);c = h.to;e = k;"around" == b ? (h = this.sel.ranges[f], h = 0 > A(h.head, h.anchor), a[f] = new C(h ? k : g, h ? g : k)) : a[f] = new C(g, g);
            }a = new ha(a, this.sel.primIndex);
          }b = a;for (a = d.length - 1; 0 <= a; a--) wb(this, d[a]);b ? of(this, b) : this.cm && rb(this.cm);
        }), undo: Q(function () {
          Pc(this, "undo");
        }), redo: Q(function () {
          Pc(this, "redo");
        }), undoSelection: Q(function () {
          Pc(this, "undo", !0);
        }), redoSelection: Q(function () {
          Pc(this, "redo", !0);
        }), setExtending: function (a) {
          this.extend = a;
        }, getExtending: function () {
          return this.extend;
        }, historySize: function () {
          for (var a = this.history, b = 0, c = 0, d = 0; d < a.done.length; d++) a.done[d].ranges || ++b;for (d = 0; d < a.undone.length; d++) a.undone[d].ranges || ++c;return { undo: b, redo: c };
        },
        clearHistory: function () {
          var a = this;this.history = new Kc(this.history.maxGeneration);La(this, function (b) {
            return b.history = a.history;
          }, !0);
        }, markClean: function () {
          this.cleanGeneration = this.changeGeneration(!0);
        }, changeGeneration: function (a) {
          a && (this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null);return this.history.generation;
        }, isClean: function (a) {
          return this.history.generation == (a || this.cleanGeneration);
        }, getHistory: function () {
          return { done: ub(this.history.done), undone: ub(this.history.undone) };
        },
        setHistory: function (a) {
          var b = this.history = new Kc(this.history.maxGeneration);b.done = ub(a.done.slice(0), null, !0);b.undone = ub(a.undone.slice(0), null, !0);
        }, setGutterMarker: Q(function (a, b, c) {
          return Wb(this, a, "gutter", function (a) {
            var e = a.gutterMarkers || (a.gutterMarkers = {});e[b] = c;!c && hb(e) && (a.gutterMarkers = null);return !0;
          });
        }), clearGutter: Q(function (a) {
          var b = this;this.iter(function (c) {
            c.gutterMarkers && c.gutterMarkers[a] && Wb(b, c, "gutter", function () {
              c.gutterMarkers[a] = null;hb(c.gutterMarkers) && (c.gutterMarkers = null);return !0;
            });
          });
        }), lineInfo: function (a) {
          var b;if ("number" == typeof a) {
            if (!Gb(this, a)) return null;b = a;a = x(this, a);if (!a) return null;
          } else if (b = G(a), null == b) return null;return { line: b, handle: a, text: a.text, gutterMarkers: a.gutterMarkers, textClass: a.textClass, bgClass: a.bgClass, wrapClass: a.wrapClass, widgets: a.widgets };
        }, addLineClass: Q(function (a, b, c) {
          return Wb(this, a, "gutter" == b ? "gutter" : "class", function (a) {
            var e = "text" == b ? "textClass" : "background" == b ? "bgClass" : "gutter" == b ? "gutterClass" : "wrapClass";if (a[e]) {
              if (M(c).test(a[e])) return !1;
              a[e] += " " + c;
            } else a[e] = c;return !0;
          });
        }), removeLineClass: Q(function (a, b, c) {
          return Wb(this, a, "gutter" == b ? "gutter" : "class", function (a) {
            var e = "text" == b ? "textClass" : "background" == b ? "bgClass" : "gutter" == b ? "gutterClass" : "wrapClass",
                f = a[e];if (f) {
              if (null == c) a[e] = null;else {
                var g = f.match(M(c));if (!g) return !1;var h = g.index + g[0].length;a[e] = f.slice(0, g.index) + (g.index && h != f.length ? " " : "") + f.slice(h) || null;
              }
            } else return !1;return !0;
          });
        }), addLineWidget: Q(function (a, b, c) {
          return Mg(this, a, b, c);
        }), removeLineWidget: function (a) {
          a.clear();
        },
        markText: function (a, b, c) {
          return yb(this, z(this, a), z(this, b), c, c && c.type || "range");
        }, setBookmark: function (a, b) {
          var c = { replacedWith: b && (null == b.nodeType ? b.widget : b), insertLeft: b && b.insertLeft, clearWhenEmpty: !1, shared: b && b.shared, handleMouseEvents: b && b.handleMouseEvents };a = z(this, a);return yb(this, a, a, c, "bookmark");
        }, findMarksAt: function (a) {
          a = z(this, a);var b = [],
              c = x(this, a.line).markedSpans;if (c) for (var d = 0; d < c.length; ++d) {
            var e = c[d];(null == e.from || e.from <= a.ch) && (null == e.to || e.to >= a.ch) && b.push(e.marker.parent || e.marker);
          }return b;
        }, findMarks: function (a, b, c) {
          a = z(this, a);b = z(this, b);var d = [],
              e = a.line;this.iter(a.line, b.line + 1, function (f) {
            if (f = f.markedSpans) for (var g = 0; g < f.length; g++) {
              var h = f[g];null != h.to && e == a.line && a.ch >= h.to || null == h.from && e != a.line || null != h.from && e == b.line && h.from >= b.ch || c && !c(h.marker) || d.push(h.marker.parent || h.marker);
            }++e;
          });return d;
        }, getAllMarks: function () {
          var a = [];this.iter(function (b) {
            if (b = b.markedSpans) for (var c = 0; c < b.length; ++c) null != b[c].from && a.push(b[c].marker);
          });return a;
        }, posFromIndex: function (a) {
          var b,
              c = this.first,
              d = this.lineSeparator().length;this.iter(function (e) {
            e = e.text.length + d;if (e > a) return b = a, !0;a -= e;++c;
          });return z(this, q(c, b));
        }, indexFromPos: function (a) {
          a = z(this, a);var b = a.ch;if (a.line < this.first || 0 > a.ch) return 0;var c = this.lineSeparator().length;this.iter(this.first, a.line, function (a) {
            b += a.text.length + c;
          });return b;
        }, copy: function (a) {
          var b = new ba(bd(this, this.first, this.first + this.size), this.modeOption, this.first, this.lineSep, this.direction);b.scrollTop = this.scrollTop;b.scrollLeft = this.scrollLeft;
          b.sel = this.sel;b.extend = !1;a && (b.history.undoDepth = this.history.undoDepth, b.setHistory(this.getHistory()));return b;
        }, linkedDoc: function (a) {
          a || (a = {});var b = this.first,
              c = this.first + this.size;null != a.from && a.from > b && (b = a.from);null != a.to && a.to < c && (c = a.to);b = new ba(bd(this, b, c), a.mode || this.modeOption, b, this.lineSep, this.direction);a.sharedHist && (b.history = this.history);(this.linked || (this.linked = [])).push({ doc: b, sharedHist: a.sharedHist });b.linked = [{ doc: this, isParent: !0, sharedHist: a.sharedHist }];a = Cf(this);
          for (c = 0; c < a.length; c++) {
            var d = a[c],
                e = d.find(),
                f = b.clipPos(e.from),
                e = b.clipPos(e.to);A(f, e) && (f = yb(b, f, e, d.primary, d.primary.type), d.markers.push(f), f.parent = d);
          }return b;
        }, unlinkDoc: function (a) {
          a instanceof I && (a = a.doc);if (this.linked) for (var b = 0; b < this.linked.length; ++b) if (this.linked[b].doc == a) {
            this.linked.splice(b, 1);a.unlinkDoc(this);Og(Cf(this));break;
          }if (a.history == this.history) {
            var c = [a.id];La(a, function (a) {
              return c.push(a.id);
            }, !0);a.history = new Kc(null);a.history.done = ub(this.history.done, c);
            a.history.undone = ub(this.history.undone, c);
          }
        }, iterLinkedDocs: function (a) {
          La(this, a);
        }, getMode: function () {
          return this.mode;
        }, getEditor: function () {
          return this.cm;
        }, splitLines: function (a) {
          return this.lineSep ? a.split(this.lineSep) : Zd(a);
        }, lineSeparator: function () {
          return this.lineSep || "\n";
        }, setDirection: Q(function (a) {
          "rtl" != a && (a = "ltr");a != this.direction && (this.direction = a, this.iter(function (a) {
            return a.order = null;
          }), this.cm && Ig(this.cm));
        }) });ba.prototype.eachLine = ba.prototype.iter;for (var Ef = 0, Wf = !1, Na = { 3: "Pause",
        8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", 46: "Delete", 59: ";", 61: "\x3d", 91: "Mod", 92: "Mod", 93: "Mod", 106: "*", 107: "\x3d", 109: "-", 110: ".", 111: "/", 145: "ScrollLock", 173: "-", 186: ";", 187: "\x3d", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", 221: "]", 222: "'", 224: "Mod", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",
        63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert" }, lc = 0; 10 > lc; lc++) Na[lc + 48] = Na[lc + 96] = String(lc);for (var Wc = 65; 90 >= Wc; Wc++) Na[Wc] = String.fromCharCode(Wc);for (var mc = 1; 12 >= mc; mc++) Na[mc + 111] = Na[mc + 63235] = "F" + mc;var ac = { basic: { Left: "goCharLeft", Right: "goCharRight", Up: "goLineUp", Down: "goLineDown", End: "goLineEnd", Home: "goLineStartSmart", PageUp: "goPageUp", PageDown: "goPageDown", Delete: "delCharAfter", Backspace: "delCharBefore", "Shift-Backspace": "delCharBefore", Tab: "defaultTab", "Shift-Tab": "indentAuto",
          Enter: "newlineAndIndent", Insert: "toggleOverwrite", Esc: "singleSelection" }, pcDefault: { "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev",
          "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", fallthrough: "basic" }, emacsy: { "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore",
          "Ctrl-K": "killLine", "Ctrl-T": "transposeChars", "Ctrl-O": "openLine" }, macDefault: { "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", "Cmd-G": "findNext",
          "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", fallthrough: ["basic", "emacsy"] } };ac["default"] = la ? ac.macDefault : ac.pcDefault;var bc = { selectAll: tf, singleSelection: function (a) {
          return a.setSelection(a.getCursor("anchor"), a.getCursor("head"), xa);
        }, killLine: function (a) {
          return Ab(a, function (b) {
            if (b.empty()) {
              var c = x(a.doc, b.head.line).text.length;return b.head.ch == c && b.head.line < a.lastLine() ? { from: b.head, to: q(b.head.line + 1, 0) } : { from: b.head, to: q(b.head.line, c) };
            }return { from: b.from(), to: b.to() };
          });
        }, deleteLine: function (a) {
          return Ab(a, function (b) {
            return { from: q(b.from().line, 0), to: z(a.doc, q(b.to().line + 1, 0)) };
          });
        }, delLineLeft: function (a) {
          return Ab(a, function (a) {
            return { from: q(a.from().line, 0), to: a.from() };
          });
        }, delWrappedLineLeft: function (a) {
          return Ab(a, function (b) {
            var c = a.charCoords(b.head, "div").top + 5;return { from: a.coordsChar({ left: 0, top: c }, "div"), to: b.from() };
          });
        }, delWrappedLineRight: function (a) {
          return Ab(a, function (b) {
            var c = a.charCoords(b.head, "div").top + 5,
                c = a.coordsChar({ left: a.display.lineDiv.offsetWidth + 100, top: c }, "div");return { from: b.from(), to: c };
          });
        }, undo: function (a) {
          return a.undo();
        }, redo: function (a) {
          return a.redo();
        }, undoSelection: function (a) {
          return a.undoSelection();
        }, redoSelection: function (a) {
          return a.redoSelection();
        }, goDocStart: function (a) {
          return a.extendSelection(q(a.firstLine(), 0));
        }, goDocEnd: function (a) {
          return a.extendSelection(q(a.lastLine()));
        }, goLineStart: function (a) {
          return a.extendSelectionsBy(function (b) {
            return Kf(a, b.head.line);
          }, { origin: "+move", bias: 1 });
        }, goLineStartSmart: function (a) {
          return a.extendSelectionsBy(function (b) {
            return Lf(a, b.head);
          }, { origin: "+move", bias: 1 });
        }, goLineEnd: function (a) {
          return a.extendSelectionsBy(function (b) {
            b = b.head.line;var c = x(a.doc, b),
                d;d = c;for (var e; e = lb(d, !1);) d = e.find(1, !0).line;d != c && (b = G(d));return Rd(!0, a, c, b, -1);
          }, { origin: "+move", bias: -1 });
        },
        goLineRight: function (a) {
          return a.extendSelectionsBy(function (b) {
            b = a.cursorCoords(b.head, "div").top + 5;return a.coordsChar({ left: a.display.lineDiv.offsetWidth + 100, top: b }, "div");
          }, jc);
        }, goLineLeft: function (a) {
          return a.extendSelectionsBy(function (b) {
            b = a.cursorCoords(b.head, "div").top + 5;return a.coordsChar({ left: 0, top: b }, "div");
          }, jc);
        }, goLineLeftSmart: function (a) {
          return a.extendSelectionsBy(function (b) {
            var c = a.cursorCoords(b.head, "div").top + 5,
                c = a.coordsChar({ left: 0, top: c }, "div");return c.ch < a.getLine(c.line).search(/\S/) ? Lf(a, b.head) : c;
          }, jc);
        }, goLineUp: function (a) {
          return a.moveV(-1, "line");
        }, goLineDown: function (a) {
          return a.moveV(1, "line");
        }, goPageUp: function (a) {
          return a.moveV(-1, "page");
        }, goPageDown: function (a) {
          return a.moveV(1, "page");
        }, goCharLeft: function (a) {
          return a.moveH(-1, "char");
        }, goCharRight: function (a) {
          return a.moveH(1, "char");
        }, goColumnLeft: function (a) {
          return a.moveH(-1, "column");
        }, goColumnRight: function (a) {
          return a.moveH(1, "column");
        }, goWordLeft: function (a) {
          return a.moveH(-1, "word");
        }, goGroupRight: function (a) {
          return a.moveH(1, "group");
        }, goGroupLeft: function (a) {
          return a.moveH(-1, "group");
        }, goWordRight: function (a) {
          return a.moveH(1, "word");
        }, delCharBefore: function (a) {
          return a.deleteH(-1, "codepoint");
        }, delCharAfter: function (a) {
          return a.deleteH(1, "char");
        }, delWordBefore: function (a) {
          return a.deleteH(-1, "word");
        }, delWordAfter: function (a) {
          return a.deleteH(1, "word");
        }, delGroupBefore: function (a) {
          return a.deleteH(-1, "group");
        }, delGroupAfter: function (a) {
          return a.deleteH(1, "group");
        }, indentAuto: function (a) {
          return a.indentSelection("smart");
        },
        indentMore: function (a) {
          return a.indentSelection("add");
        }, indentLess: function (a) {
          return a.indentSelection("subtract");
        }, insertTab: function (a) {
          return a.replaceSelection("\t");
        }, insertSoftTab: function (a) {
          for (var b = [], c = a.listSelections(), d = a.options.tabSize, e = 0; e < c.length; e++) {
            var f = c[e].from(),
                f = U(a.getLine(f.line), f.ch, d);b.push(fb(d - f % d));
          }a.replaceSelections(b);
        }, defaultTab: function (a) {
          a.somethingSelected() ? a.indentSelection("add") : a.execCommand("insertTab");
        }, transposeChars: function (a) {
          return ea(a, function () {
            for (var b = a.listSelections(), c = [], d = 0; d < b.length; d++) if (b[d].empty()) {
              var e = b[d].head,
                  f = x(a.doc, e.line).text;if (f) if (e.ch == f.length && (e = new q(e.line, e.ch - 1)), 0 < e.ch) e = new q(e.line, e.ch + 1), a.replaceRange(f.charAt(e.ch - 1) + f.charAt(e.ch - 2), q(e.line, e.ch - 2), e, "+transpose");else if (e.line > a.doc.first) {
                var g = x(a.doc, e.line - 1).text;g && (e = new q(e.line, 1), a.replaceRange(f.charAt(0) + a.doc.lineSeparator() + g.charAt(g.length - 1), q(e.line - 1, g.length - 1), e, "+transpose"));
              }c.push(new C(e, e));
            }a.setSelections(c);
          });
        }, newlineAndIndent: function (a) {
          return ea(a, function () {
            for (var b = a.listSelections(), c = b.length - 1; 0 <= c; c--) a.replaceRange(a.doc.lineSeparator(), b[c].anchor, b[c].head, "+input");b = a.listSelections();for (c = 0; c < b.length; c++) a.indentLine(b[c].from().line, null, !0);rb(a);
          });
        }, openLine: function (a) {
          return a.replaceSelection("\n", "start");
        }, toggleOverwrite: function (a) {
          return a.toggleOverwrite();
        } },
          Vg = new Oa(),
          Sd = null,
          Td = function (a, b, c) {
        this.time = a;this.pos = b;this.button = c;
      };Td.prototype.compare = function (a, b, c) {
        return this.time + 400 > a && 0 == A(b, this.pos) && c == this.button;
      };
      var ec,
          dc,
          Bb = { toString: function () {
          return "CodeMirror.Init";
        } },
          Vf = {},
          Uc = {};I.defaults = Vf;I.optionHandlers = Uc;var Xd = [];I.defineInitHook = function (a) {
        return Xd.push(a);
      };var ia = null,
          E = function (a) {
        this.cm = a;this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;this.polling = new Oa();this.composing = null;this.gracePeriod = !1;this.readDOMTimeout = null;
      };E.prototype.init = function (a) {
        function b(a) {
          for (a = a.target; a; a = a.parentNode) {
            if (a == g) return !0;if (/\bCodeMirror-(?:line)?widget\b/.test(a.className)) break;
          }return !1;
        }
        function c(a) {
          if (b(a) && !F(f, a)) {
            if (f.somethingSelected()) Xf({ lineWise: !1, text: f.getSelections() }), "cut" == a.type && f.replaceSelection("", null, "cut");else if (f.options.lineWiseCopyCut) {
              var c = $f(f);Xf({ lineWise: !0, text: c.text });"cut" == a.type && f.operation(function () {
                f.setSelections(c.ranges, 0, xa);f.replaceSelection("", null, "cut");
              });
            } else return;if (a.clipboardData) {
              a.clipboardData.clearData();var d = ia.text.join("\n");a.clipboardData.setData("Text", d);if (a.clipboardData.getData("Text") == d) {
                a.preventDefault();
                return;
              }
            }var m = bg();a = m.firstChild;f.display.lineSpace.insertBefore(m, f.display.lineSpace.firstChild);a.value = ia.text.join("\n");var n = document.activeElement;ic(a);setTimeout(function () {
              f.display.lineSpace.removeChild(m);n.focus();n == g && e.showPrimarySelection();
            }, 50);
          }
        }var d = this,
            e = this,
            f = e.cm,
            g = e.div = a.lineDiv;ag(g, f.options.spellcheck, f.options.autocorrect, f.options.autocapitalize);y(g, "paste", function (a) {
          !b(a) || F(f, a) || Zf(a, f) || 11 >= H && setTimeout(P(f, function () {
            return d.updateFromDOM();
          }), 20);
        });y(g, "compositionstart", function (a) {
          d.composing = { data: a.data, done: !1 };
        });y(g, "compositionupdate", function (a) {
          d.composing || (d.composing = { data: a.data, done: !1 });
        });y(g, "compositionend", function (a) {
          d.composing && (a.data != d.composing.data && d.readFromDOMSoon(), d.composing.done = !0);
        });y(g, "touchstart", function () {
          return e.forceCompositionEnd();
        });y(g, "input", function () {
          d.composing || d.readFromDOMSoon();
        });y(g, "copy", c);y(g, "cut", c);
      };E.prototype.screenReaderLabelChanged = function (a) {
        a ? this.div.setAttribute("aria-label", a) : this.div.removeAttribute("aria-label");
      };E.prototype.prepareSelection = function () {
        var a = Oe(this.cm, !1);a.focus = document.activeElement == this.div;return a;
      };E.prototype.showSelection = function (a, b) {
        a && this.cm.display.view.length && ((a.focus || b) && this.showPrimarySelection(), this.showMultipleSelections(a));
      };E.prototype.getSelection = function () {
        return this.cm.display.wrapper.ownerDocument.getSelection();
      };E.prototype.showPrimarySelection = function () {
        var a = this.getSelection(),
            b = this.cm,
            c = b.doc.sel.primary(),
            d = c.from(),
            c = c.to();if (b.display.viewTo == b.display.viewFrom || d.line >= b.display.viewTo || c.line < b.display.viewFrom) a.removeAllRanges();else {
          var e = Vc(b, a.anchorNode, a.anchorOffset),
              f = Vc(b, a.focusNode, a.focusOffset);if (!e || e.bad || !f || f.bad || 0 != A(uc(e, f), d) || 0 != A(tc(e, f), c)) if (e = b.display.view, d = d.line >= b.display.viewFrom && dg(b, d) || { node: e[0].measure.map[2], offset: 0 }, c = c.line < b.display.viewTo && dg(b, c), c || (c = e[e.length - 1].measure, c = c.maps ? c.maps[c.maps.length - 1] : c.map, c = { node: c[c.length - 1], offset: c[c.length - 2] - c[c.length - 3] }), d && c) {
            var e = a.rangeCount && a.getRangeAt(0),
                g;try {
              g = mb(d.node, d.offset, c.offset, c.node);
            } catch (h) {}g && (!Ea && b.state.focused ? (a.collapse(d.node, d.offset), g.collapsed || (a.removeAllRanges(), a.addRange(g))) : (a.removeAllRanges(), a.addRange(g)), e && null == a.anchorNode ? a.addRange(e) : Ea && this.startGracePeriod());this.rememberSelection();
          } else a.removeAllRanges();
        }
      };E.prototype.startGracePeriod = function () {
        var a = this;clearTimeout(this.gracePeriod);this.gracePeriod = setTimeout(function () {
          a.gracePeriod = !1;a.selectionChanged() && a.cm.operation(function () {
            return a.cm.curOp.selectionChanged = !0;
          });
        }, 20);
      };E.prototype.showMultipleSelections = function (a) {
        Y(this.cm.display.cursorDiv, a.cursors);Y(this.cm.display.selectionDiv, a.selection);
      };E.prototype.rememberSelection = function () {
        var a = this.getSelection();this.lastAnchorNode = a.anchorNode;this.lastAnchorOffset = a.anchorOffset;this.lastFocusNode = a.focusNode;this.lastFocusOffset = a.focusOffset;
      };E.prototype.selectionInEditor = function () {
        var a = this.getSelection();if (!a.rangeCount) return !1;
        a = a.getRangeAt(0).commonAncestorContainer;return T(this.div, a);
      };E.prototype.focus = function () {
        "nocursor" != this.cm.options.readOnly && (this.selectionInEditor() && document.activeElement == this.div || this.showSelection(this.prepareSelection(), !0), this.div.focus());
      };E.prototype.blur = function () {
        this.div.blur();
      };E.prototype.getField = function () {
        return this.div;
      };E.prototype.supportsTouch = function () {
        return !0;
      };E.prototype.receivedFocus = function () {
        function a() {
          b.cm.state.focused && (b.pollSelection(), b.polling.set(b.cm.options.pollInterval, a));
        }var b = this;this.selectionInEditor() ? this.pollSelection() : ea(this.cm, function () {
          return b.cm.curOp.selectionChanged = !0;
        });this.polling.set(this.cm.options.pollInterval, a);
      };E.prototype.selectionChanged = function () {
        var a = this.getSelection();return a.anchorNode != this.lastAnchorNode || a.anchorOffset != this.lastAnchorOffset || a.focusNode != this.lastFocusNode || a.focusOffset != this.lastFocusOffset;
      };E.prototype.pollSelection = function () {
        if (null == this.readDOMTimeout && !this.gracePeriod && this.selectionChanged()) {
          var a = this.getSelection(),
              b = this.cm;if (Ac && zc && this.cm.display.gutterSpecs.length && jh(a.anchorNode)) this.cm.triggerOnKeyDown({ type: "keydown", keyCode: 8, preventDefault: Math.abs }), this.blur(), this.focus();else if (!this.composing) {
            this.rememberSelection();var c = Vc(b, a.anchorNode, a.anchorOffset),
                d = Vc(b, a.focusNode, a.focusOffset);c && d && ea(b, function () {
              S(b.doc, Fa(c, d), xa);if (c.bad || d.bad) b.curOp.selectionChanged = !0;
            });
          }
        }
      };E.prototype.pollContent = function () {
        null != this.readDOMTimeout && (clearTimeout(this.readDOMTimeout), this.readDOMTimeout = null);var a = this.cm,
            b = a.display,
            c = a.doc.sel.primary(),
            d = c.from(),
            e = c.to();0 == d.ch && d.line > a.firstLine() && (d = q(d.line - 1, x(a.doc, d.line - 1).length));e.ch == x(a.doc, e.line).text.length && e.line < a.lastLine() && (e = q(e.line + 1, 0));if (d.line < b.viewFrom || e.line > b.viewTo - 1) return !1;var f;d.line == b.viewFrom || 0 == (f = Wa(a, d.line)) ? (c = G(b.view[0].line), f = b.view[0].node) : (c = G(b.view[f].line), f = b.view[f - 1].node.nextSibling);var g = Wa(a, e.line);g == b.view.length - 1 ? (e = b.viewTo - 1, b = b.lineDiv.lastChild) : (e = G(b.view[g + 1].line) - 1, b = b.view[g + 1].node.previousSibling);if (!f) return !1;b = a.doc.splitLines(kh(a, f, b, c, e));for (f = Ta(a.doc, q(c, 0), q(e, x(a.doc, e).text.length)); 1 < b.length && 1 < f.length;) if (D(b) == D(f)) b.pop(), f.pop(), e--;else if (b[0] == f[0]) b.shift(), f.shift(), c++;else break;for (var h = 0, g = 0, k = b[0], l = f[0], m = Math.min(k.length, l.length); h < m && k.charCodeAt(h) == l.charCodeAt(h);) ++h;k = D(b);l = D(f);for (m = Math.min(k.length - (1 == b.length ? h : 0), l.length - (1 == f.length ? h : 0)); g < m && k.charCodeAt(k.length - g - 1) == l.charCodeAt(l.length - g - 1);) ++g;if (1 == b.length && 1 == f.length && c == d.line) for (; h && h > d.ch && k.charCodeAt(k.length - g - 1) == l.charCodeAt(l.length - g - 1);) h--, g++;b[b.length - 1] = k.slice(0, k.length - g).replace(/^\u200b+/, "");b[0] = b[0].slice(h).replace(/\u200b+$/, "");d = q(c, h);c = q(e, f.length ? D(f).length - g : 0);if (1 < b.length || b[0] || A(d, c)) return xb(a.doc, b, d, c, "+input"), !0;
      };E.prototype.ensurePolled = function () {
        this.forceCompositionEnd();
      };E.prototype.reset = function () {
        this.forceCompositionEnd();
      };E.prototype.forceCompositionEnd = function () {
        this.composing && (clearTimeout(this.readDOMTimeout), this.composing = null, this.updateFromDOM(), this.div.blur(), this.div.focus());
      };E.prototype.readFromDOMSoon = function () {
        var a = this;null == this.readDOMTimeout && (this.readDOMTimeout = setTimeout(function () {
          a.readDOMTimeout = null;if (a.composing) if (a.composing.done) a.composing = null;else return;a.updateFromDOM();
        }, 80));
      };E.prototype.updateFromDOM = function () {
        var a = this;!this.cm.isReadOnly() && this.pollContent() || ea(this.cm, function () {
          return aa(a.cm);
        });
      };E.prototype.setUneditable = function (a) {
        a.contentEditable = "false";
      };E.prototype.onKeyPress = function (a) {
        0 == a.charCode || this.composing || (a.preventDefault(), this.cm.isReadOnly() || P(this.cm, Yd)(this.cm, String.fromCharCode(null == a.charCode ? a.keyCode : a.charCode), 0));
      };E.prototype.readOnlyChanged = function (a) {
        this.div.contentEditable = String("nocursor" != a);
      };E.prototype.onContextMenu = function () {};E.prototype.resetPosition = function () {};E.prototype.needsContentAttribute = !0;var L = function (a) {
        this.cm = a;this.prevInput = "";this.pollingFast = !1;this.polling = new Oa();this.hasSelection = !1;this.composing = null;
      };L.prototype.init = function (a) {
        function b(a) {
          if (!F(e, a)) {
            if (e.somethingSelected()) ia = { lineWise: !1, text: e.getSelections() };else if (e.options.lineWiseCopyCut) {
              var b = $f(e);ia = { lineWise: !0, text: b.text };"cut" == a.type ? e.setSelections(b.ranges, null, xa) : (d.prevInput = "", f.value = b.text.join("\n"), ic(f));
            } else return;"cut" == a.type && (e.state.cutIncoming = +new Date());
          }
        }var c = this,
            d = this,
            e = this.cm;this.createField(a);var f = this.textarea;a.wrapper.insertBefore(this.wrapper, a.wrapper.firstChild);
        gc && (f.style.width = "0px");y(f, "input", function () {
          B && 9 <= H && c.hasSelection && (c.hasSelection = null);d.poll();
        });y(f, "paste", function (a) {
          F(e, a) || Zf(a, e) || (e.state.pasteIncoming = +new Date(), d.fastPoll());
        });y(f, "cut", b);y(f, "copy", b);y(a.scroller, "paste", function (b) {
          if (!Da(a, b) && !F(e, b)) if (f.dispatchEvent) {
            var c = new Event("paste");c.clipboardData = b.clipboardData;f.dispatchEvent(c);
          } else e.state.pasteIncoming = +new Date(), d.focus();
        });y(a.lineSpace, "selectstart", function (b) {
          Da(a, b) || Z(b);
        });y(f, "compositionstart", function () {
          var a = e.getCursor("from");d.composing && d.composing.range.clear();d.composing = { start: a, range: e.markText(a, e.getCursor("to"), { className: "CodeMirror-composing" }) };
        });y(f, "compositionend", function () {
          d.composing && (d.poll(), d.composing.range.clear(), d.composing = null);
        });
      };L.prototype.createField = function (a) {
        this.wrapper = bg();this.textarea = this.wrapper.firstChild;
      };L.prototype.screenReaderLabelChanged = function (a) {
        a ? this.textarea.setAttribute("aria-label", a) : this.textarea.removeAttribute("aria-label");
      };
      L.prototype.prepareSelection = function () {
        var a = this.cm,
            b = a.display,
            c = a.doc,
            d = Oe(a);if (a.options.moveInputWithCursor) {
          var a = oa(a, c.sel.primary().head, "div"),
              c = b.wrapper.getBoundingClientRect(),
              e = b.lineDiv.getBoundingClientRect();d.teTop = Math.max(0, Math.min(b.wrapper.clientHeight - 10, a.top + e.top - c.top));d.teLeft = Math.max(0, Math.min(b.wrapper.clientWidth - 10, a.left + e.left - c.left));
        }return d;
      };L.prototype.showSelection = function (a) {
        var b = this.cm.display;Y(b.cursorDiv, a.cursors);Y(b.selectionDiv, a.selection);
        null != a.teTop && (this.wrapper.style.top = a.teTop + "px", this.wrapper.style.left = a.teLeft + "px");
      };L.prototype.reset = function (a) {
        if (!this.contextMenuPending && !this.composing) {
          var b = this.cm;b.somethingSelected() ? (this.prevInput = "", a = b.getSelection(), this.textarea.value = a, b.state.focused && ic(this.textarea), B && 9 <= H && (this.hasSelection = a)) : a || (this.prevInput = this.textarea.value = "", B && 9 <= H && (this.hasSelection = null));
        }
      };L.prototype.getField = function () {
        return this.textarea;
      };L.prototype.supportsTouch = function () {
        return !1;
      };
      L.prototype.focus = function () {
        if ("nocursor" != this.cm.options.readOnly && (!Tb || fa() != this.textarea)) try {
          this.textarea.focus();
        } catch (a) {}
      };L.prototype.blur = function () {
        this.textarea.blur();
      };L.prototype.resetPosition = function () {
        this.wrapper.style.top = this.wrapper.style.left = 0;
      };L.prototype.receivedFocus = function () {
        this.slowPoll();
      };L.prototype.slowPoll = function () {
        var a = this;this.pollingFast || this.polling.set(this.cm.options.pollInterval, function () {
          a.poll();a.cm.state.focused && a.slowPoll();
        });
      };L.prototype.fastPoll = function () {
        function a() {
          c.poll() || b ? (c.pollingFast = !1, c.slowPoll()) : (b = !0, c.polling.set(60, a));
        }var b = !1,
            c = this;c.pollingFast = !0;c.polling.set(20, a);
      };L.prototype.poll = function () {
        var a = this,
            b = this.cm,
            c = this.textarea,
            d = this.prevInput;if (this.contextMenuPending || !b.state.focused || ph(c) && !d && !this.composing || b.isReadOnly() || b.options.disableInput || b.state.keySeq) return !1;var e = c.value;if (e == d && !b.somethingSelected()) return !1;if (B && 9 <= H && this.hasSelection === e || la && /[\uf700-\uf7ff]/.test(e)) return b.display.input.reset(), !1;if (b.doc.sel == b.display.selForContextMenu) {
          var f = e.charCodeAt(0);8203 != f || d || (d = "​");if (8666 == f) return this.reset(), this.cm.execCommand("undo");
        }for (var g = 0, f = Math.min(d.length, e.length); g < f && d.charCodeAt(g) == e.charCodeAt(g);) ++g;ea(b, function () {
          Yd(b, e.slice(g), d.length - g, null, a.composing ? "*compose" : null);1E3 < e.length || -1 < e.indexOf("\n") ? c.value = a.prevInput = "" : a.prevInput = e;a.composing && (a.composing.range.clear(), a.composing.range = b.markText(a.composing.start, b.getCursor("to"), { className: "CodeMirror-composing" }));
        });
        return !0;
      };L.prototype.ensurePolled = function () {
        this.pollingFast && this.poll() && (this.pollingFast = !1);
      };L.prototype.onKeyPress = function () {
        B && 9 <= H && (this.hasSelection = null);this.fastPoll();
      };L.prototype.onContextMenu = function (a) {
        function b() {
          if (null != g.selectionStart) {
            var a = e.somethingSelected(),
                b = "​" + (a ? g.value : "");g.value = "⇚";g.value = b;d.prevInput = a ? "" : "​";g.selectionStart = 1;g.selectionEnd = b.length;f.selForContextMenu = e.doc.sel;
          }
        }function c() {
          if (d.contextMenuPending == c && (d.contextMenuPending = !1, d.wrapper.style.cssText = m, g.style.cssText = l, B && 9 > H && f.scrollbars.setScrollTop(f.scroller.scrollTop = k), null != g.selectionStart)) {
            (!B || B && 9 > H) && b();var a = 0,
                h = function () {
              f.selForContextMenu == e.doc.sel && 0 == g.selectionStart && 0 < g.selectionEnd && "​" == d.prevInput ? P(e, tf)(e) : 10 > a++ ? f.detectingSelectAll = setTimeout(h, 500) : (f.selForContextMenu = null, f.input.reset());
            };f.detectingSelectAll = setTimeout(h, 200);
          }
        }var d = this,
            e = d.cm,
            f = e.display,
            g = d.textarea;d.contextMenuPending && d.contextMenuPending();var h = Za(e, a),
            k = f.scroller.scrollTop;if (h && !pa) {
          e.options.resetSelectionOnContextMenu && -1 == e.doc.sel.contains(h) && P(e, S)(e.doc, Fa(h), xa);var l = g.style.cssText,
              m = d.wrapper.style.cssText,
              h = d.wrapper.offsetParent.getBoundingClientRect();d.wrapper.style.cssText = "position: static";g.style.cssText = "position: absolute; width: 30px; height: 30px;\n      top: " + (a.clientY - h.top - 5) + "px; left: " + (a.clientX - h.left - 5) + "px;\n      z-index: 1000; background: " + (B ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity\x3d5);";
          var n;V && (n = window.scrollY);f.input.focus();V && window.scrollTo(null, n);f.input.reset();e.somethingSelected() || (g.value = d.prevInput = " ");d.contextMenuPending = c;f.selForContextMenu = e.doc.sel;clearTimeout(f.detectingSelectAll);B && 9 <= H && b();if (Ud) {
            Fb(a);var p = function () {
              u(window, "mouseup", p);setTimeout(c, 20);
            };y(window, "mouseup", p);
          } else setTimeout(c, 50);
        }
      };L.prototype.readOnlyChanged = function (a) {
        a || this.reset();this.textarea.disabled = "nocursor" == a;this.textarea.readOnly = !!a;
      };L.prototype.setUneditable = function () {};
      L.prototype.needsContentAttribute = !1;(function (a) {
        function b(b, e, f, g) {
          a.defaults[b] = e;f && (c[b] = g ? function (a, b, c) {
            c != Bb && f(a, b, c);
          } : f);
        }var c = a.optionHandlers;a.defineOption = b;a.Init = Bb;b("value", "", function (a, b) {
          return a.setValue(b);
        }, !0);b("mode", null, function (a, b) {
          a.doc.modeOption = b;Kd(a);
        }, !0);b("indentUnit", 2, Kd, !0);b("indentWithTabs", !1);b("smartIndent", !0);b("tabSize", 4, function (a) {
          Ub(a);Mb(a);aa(a);
        }, !0);b("lineSeparator", null, function (a, b) {
          if (a.doc.lineSep = b) {
            var c = [],
                g = a.doc.first;a.doc.iter(function (a) {
              for (var d = 0;;) {
                var h = a.text.indexOf(b, d);if (-1 == h) break;d = h + b.length;c.push(q(g, h));
              }g++;
            });for (var h = c.length - 1; 0 <= h; h--) xb(a.doc, b, c[h], q(c[h].line, c[h].ch + b.length));
          }
        });b("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (a, b, c) {
          a.state.specialChars = new RegExp(b.source + (b.test("\t") ? "" : "|\t"), "g");c != Bb && a.refresh();
        });b("specialCharPlaceholder", ug, function (a) {
          return a.refresh();
        }, !0);b("electricChars", !0);b("inputStyle", Tb ? "contenteditable" : "textarea", function () {
          throw Error("inputStyle can not (yet) be changed in a running editor");
        }, !0);b("spellcheck", !1, function (a, b) {
          return a.getInputField().spellcheck = b;
        }, !0);b("autocorrect", !1, function (a, b) {
          return a.getInputField().autocorrect = b;
        }, !0);b("autocapitalize", !1, function (a, b) {
          return a.getInputField().autocapitalize = b;
        }, !0);b("rtlMoveVisually", !oh);b("wholeLineUpdateBefore", !0);b("theme", "default", function (a) {
          Uf(a);Sb(a);
        }, !0);b("keyMap", "default", function (a, b, c) {
          b = Qc(b);(c = c != Bb && Qc(c)) && c.detach && c.detach(a, b);b.attach && b.attach(a, c || null);
        });b("extraKeys", null);b("configureMouse", null);b("lineWrapping", !1, hh, !0);b("gutters", [], function (a, b) {
          a.display.gutterSpecs = Id(b, a.options.lineNumbers);Sb(a);
        }, !0);b("fixedGutter", !0, function (a, b) {
          a.display.gutters.style.left = b ? zd(a.display) + "px" : "0";a.refresh();
        }, !0);b("coverGutterNextToScrollbar", !1, function (a) {
          return sb(a);
        }, !0);b("scrollbarStyle", "native", function (a) {
          Xe(a);sb(a);a.display.scrollbars.setScrollTop(a.doc.scrollTop);a.display.scrollbars.setScrollLeft(a.doc.scrollLeft);
        }, !0);b("lineNumbers", !1, function (a, b) {
          a.display.gutterSpecs = Id(a.options.gutters, b);Sb(a);
        }, !0);b("firstLineNumber", 1, Sb, !0);b("lineNumberFormatter", function (a) {
          return a;
        }, Sb, !0);b("showCursorWhenSelecting", !1, Nb, !0);b("resetSelectionOnContextMenu", !0);b("lineWiseCopyCut", !0);b("pasteLinesPerSelection", !0);b("selectionsMayTouch", !1);b("readOnly", !1, function (a, b) {
          "nocursor" == b && (qb(a), a.display.input.blur());a.display.input.readOnlyChanged(b);
        });b("screenReaderLabel", null, function (a, b) {
          a.display.input.screenReaderLabelChanged("" === b ? null : b);
        });b("disableInput", !1, function (a, b) {
          b || a.display.input.reset();
        }, !0);b("dragDrop", !0, gh);b("allowDropFileTypes", null);b("cursorBlinkRate", 530);b("cursorScrollMargin", 0);b("cursorHeight", 1, Nb, !0);b("singleCursorHeightPerLine", !0, Nb, !0);b("workTime", 100);b("workDelay", 100);b("flattenSpans", !0, Ub, !0);b("addModeClass", !1, Ub, !0);b("pollInterval", 100);b("undoDepth", 200, function (a, b) {
          return a.doc.history.undoDepth = b;
        });b("historyEventDelay", 1250);b("viewportMargin", 10, function (a) {
          return a.refresh();
        }, !0);b("maxHighlightLength", 1E4, Ub, !0);b("moveInputWithCursor", !0, function (a, b) {
          b || a.display.input.resetPosition();
        });b("tabindex", null, function (a, b) {
          return a.display.input.getField().tabIndex = b || "";
        });b("autofocus", null);b("direction", "ltr", function (a, b) {
          return a.doc.setDirection(b);
        }, !0);b("phrases", null);
      })(I);(function (a) {
        var b = a.optionHandlers,
            c = a.helpers = {};a.prototype = { constructor: a, focus: function () {
            window.focus();this.display.input.focus();
          }, setOption: function (a, c) {
            var f = this.options,
                g = f[a];if (f[a] != c || "mode" == a) f[a] = c, b.hasOwnProperty(a) && P(this, b[a])(this, c, g), t(this, "optionChange", this, a);
          }, getOption: function (a) {
            return this.options[a];
          }, getDoc: function () {
            return this.doc;
          }, addKeyMap: function (a, b) {
            this.state.keyMaps[b ? "push" : "unshift"](Qc(a));
          }, removeKeyMap: function (a) {
            for (var b = this.state.keyMaps, c = 0; c < b.length; ++c) if (b[c] == a || b[c].name == a) return b.splice(c, 1), !0;
          }, addOverlay: W(function (b, c) {
            var f = b.token ? b : a.getMode(this.options, b);if (f.startState) throw Error("Overlays may not be stateful.");pc(this.state.overlays, { mode: f, modeSpec: b, opaque: c && c.opaque, priority: c && c.priority || 0 }, function (a) {
              return a.priority;
            });this.state.modeGen++;aa(this);
          }), removeOverlay: W(function (a) {
            for (var b = this.state.overlays, c = 0; c < b.length; ++c) {
              var g = b[c].modeSpec;if (g == a || "string" == typeof a && g.name == a) {
                b.splice(c, 1);this.state.modeGen++;aa(this);break;
              }
            }
          }), indentLine: W(function (a, b, c) {
            "string" != typeof b && "number" != typeof b && (b = null == b ? this.options.smartIndent ? "smart" : "prev" : b ? "add" : "subtract");Gb(this.doc, a) && fc(this, a, b, c);
          }), indentSelection: W(function (a) {
            for (var b = this.doc.sel.ranges, c = -1, g = 0; g < b.length; g++) {
              var h = b[g];if (h.empty()) h.head.line > c && (fc(this, h.head.line, a, !0), c = h.head.line, g == this.doc.sel.primIndex && rb(this));else {
                for (var k = h.from(), h = h.to(), l = Math.max(c, k.line), c = Math.min(this.lastLine(), h.line - (h.ch ? 0 : 1)) + 1, h = l; h < c; ++h) fc(this, h, a);h = this.doc.sel.ranges;0 == k.ch && b.length == h.length && 0 < h[g].from().ch && Od(this.doc, g, new C(k, h[g].to()), xa);
              }
            }
          }), getTokenAt: function (a, b) {
            return je(this, a, b);
          }, getLineTokens: function (a, b) {
            return je(this, q(a), b, !0);
          }, getTokenTypeAt: function (a) {
            a = z(this.doc, a);var b = he(this, x(this.doc, a.line)),
                c = 0,
                g = (b.length - 1) / 2;a = a.ch;if (0 == a) b = b[2];else for (;;) {
              var h = c + g >> 1;if ((h ? b[2 * h - 1] : 0) >= a) g = h;else if (b[2 * h + 1] < a) c = h + 1;else {
                b = b[2 * h + 2];break;
              }
            }c = b ? b.indexOf("overlay ") : -1;return 0 > c ? b : 0 == c ? null : b.slice(0, c - 1);
          }, getModeAt: function (b) {
            var c = this.doc.mode;return c.innerMode ? a.innerMode(c, this.getTokenAt(b).state).mode : c;
          }, getHelper: function (a, b) {
            return this.getHelpers(a, b)[0];
          }, getHelpers: function (a, b) {
            var f = [];if (!c.hasOwnProperty(b)) return f;var g = c[b],
                h = this.getModeAt(a);if ("string" == typeof h[b]) g[h[b]] && f.push(g[h[b]]);else if (h[b]) for (var k = 0; k < h[b].length; k++) {
              var l = g[h[b][k]];l && f.push(l);
            } else h.helperType && g[h.helperType] ? f.push(g[h.helperType]) : g[h.name] && f.push(g[h.name]);for (k = 0; k < g._global.length; k++) l = g._global[k], l.pred(h, this) && -1 == O(f, l.val) && f.push(l.val);return f;
          }, getStateAfter: function (a, b) {
            var c = this.doc;a = Math.max(c.first, Math.min(null == a ? c.first + c.size - 1 : a, c.first + c.size - 1));return Hb(this, a + 1, b).state;
          }, cursorCoords: function (a, b) {
            var c = this.doc.sel.primary();c = null == a ? c.head : "object" == typeof a ? z(this.doc, a) : a ? c.from() : c.to();return oa(this, c, b || "page");
          }, charCoords: function (a, b) {
            return vd(this, z(this.doc, a), b || "page");
          }, coordsChar: function (a, b) {
            a = Ie(this, a, b || "page");return xd(this, a.left, a.top);
          }, lineAtHeight: function (a, b) {
            a = Ie(this, { top: a, left: 0 }, b || "page").top;return Ua(this.doc, a + this.display.viewOffset);
          }, heightAtLine: function (a, b, c) {
            var g = !1;if ("number" == typeof a) {
              var h = this.doc.first + this.doc.size - 1;a < this.doc.first ? a = this.doc.first : a > h && (a = h, g = !0);a = x(this.doc, a);
            }return Bc(this, a, { top: 0, left: 0 }, b || "page", c || g).top + (g ? this.doc.height - va(a) : 0);
          }, defaultTextHeight: function () {
            return pb(this.display);
          }, defaultCharWidth: function () {
            return ob(this.display);
          }, getViewport: function () {
            return { from: this.display.viewFrom, to: this.display.viewTo };
          }, addWidget: function (a, b, c, g, h) {
            var k = this.display;a = oa(this, z(this.doc, a));var l = a.bottom,
                m = a.left;b.style.position = "absolute";b.setAttribute("cm-ignore-events", "true");this.display.input.setUneditable(b);
            k.sizer.appendChild(b);if ("over" == g) l = a.top;else if ("above" == g || "near" == g) {
              var n = Math.max(k.wrapper.clientHeight, this.doc.height),
                  p = Math.max(k.sizer.clientWidth, k.lineSpace.clientWidth);("above" == g || a.bottom + b.offsetHeight > n) && a.top > b.offsetHeight ? l = a.top - b.offsetHeight : a.bottom + b.offsetHeight <= n && (l = a.bottom);m + b.offsetWidth > p && (m = p - b.offsetWidth);
            }b.style.top = l + "px";b.style.left = b.style.right = "";"right" == h ? (m = k.sizer.clientWidth - b.offsetWidth, b.style.right = "0px") : ("left" == h ? m = 0 : "middle" == h && (m = (k.sizer.clientWidth - b.offsetWidth) / 2), b.style.left = m + "px");c && (a = Dd(this, { left: m, top: l, right: m + b.offsetWidth, bottom: l + b.offsetHeight }), null != a.scrollTop && Pb(this, a.scrollTop), null != a.scrollLeft && ab(this, a.scrollLeft));
          }, triggerOnKeyDown: W(Of), triggerOnKeyPress: W(Qf), triggerOnKeyUp: Pf, triggerOnMouseDown: W(Rf), execCommand: function (a) {
            if (bc.hasOwnProperty(a)) return bc[a].call(null, this);
          }, triggerElectric: W(function (a) {
            Yf(this, a);
          }), findPosH: function (a, b, c, g) {
            var h = 1;0 > b && (h = -1, b = -b);a = z(this.doc, a);for (var k = 0; k < b && (a = $d(this.doc, a, h, c, g), !a.hitSide); ++k);return a;
          }, moveH: W(function (a, b) {
            var c = this;this.extendSelectionsBy(function (g) {
              return c.display.shift || c.doc.extend || g.empty() ? $d(c.doc, g.head, a, b, c.options.rtlMoveVisually) : 0 > a ? g.from() : g.to();
            }, jc);
          }), deleteH: W(function (a, b) {
            var c = this.doc;this.doc.sel.somethingSelected() ? c.replaceSelection("", null, "+delete") : Ab(this, function (g) {
              var h = $d(c, g.head, a, b, !1);return 0 > a ? { from: h, to: g.head } : { from: g.head, to: h };
            });
          }), findPosV: function (a, b, c, g) {
            var h = 1;0 > b && (h = -1, b = -b);var k = z(this.doc, a);for (a = 0; a < b && (k = oa(this, k, "div"), null == g ? g = k.left : k.left = g, k = cg(this, k, h, c), !k.hitSide); ++a);return k;
          }, moveV: W(function (a, b) {
            var c = this,
                g = this.doc,
                h = [],
                k = !this.display.shift && !g.extend && g.sel.somethingSelected();g.extendSelectionsBy(function (l) {
              if (k) return 0 > a ? l.from() : l.to();var n = oa(c, l.head, "div");null != l.goalColumn && (n.left = l.goalColumn);h.push(n.left);var p = cg(c, n, a, b);"page" == b && l == g.sel.primary() && Gc(c, vd(c, p, "div").top - n.top);return p;
            }, jc);if (h.length) for (var l = 0; l < g.sel.ranges.length; l++) g.sel.ranges[l].goalColumn = h[l];
          }), findWordAt: function (a) {
            var b = x(this.doc, a.line).text,
                c = a.ch,
                g = a.ch;if (b) {
              var h = this.getHelper(a, "wordChars");"before" != a.sticky && g != b.length || !c ? ++g : --c;for (var k = b.charAt(c), k = Ra(k, h) ? function (a) {
                return Ra(a, h);
              } : /\s/.test(k) ? function (a) {
                return (/\s/.test(a)
                );
              } : function (a) {
                return !/\s/.test(a) && !Ra(a);
              }; 0 < c && k(b.charAt(c - 1));) --c;for (; g < b.length && k(b.charAt(g));) ++g;
            }return new C(q(a.line, c), q(a.line, g));
          }, toggleOverwrite: function (a) {
            if (null == a || a != this.state.overwrite) (this.state.overwrite = !this.state.overwrite) ? ya(this.display.cursorDiv, "CodeMirror-overwrite") : $a(this.display.cursorDiv, "CodeMirror-overwrite"), t(this, "overwriteToggle", this, this.state.overwrite);
          }, hasFocus: function () {
            return this.display.input.getField() == fa();
          }, isReadOnly: function () {
            return !(!this.options.readOnly && !this.doc.cantEdit);
          }, scrollTo: W(function (a, b) {
            Ob(this, a, b);
          }), getScrollInfo: function () {
            var a = this.display.scroller;return { left: a.scrollLeft, top: a.scrollTop, height: a.scrollHeight - wa(this) - this.display.barHeight, width: a.scrollWidth - wa(this) - this.display.barWidth, clientHeight: qd(this), clientWidth: Va(this) };
          }, scrollIntoView: W(function (a, b) {
            null == a ? (a = { from: this.doc.sel.primary().head, to: null }, null == b && (b = this.options.cursorScrollMargin)) : "number" == typeof a ? a = { from: q(a, 0), to: null } : null == a.from && (a = { from: a, to: null });a.to || (a.to = a.from);a.margin = b || 0;if (null != a.from.line) {
              var c = a;Hc(this);this.curOp.scrollToPos = c;
            } else Te(this, a.from, a.to, a.margin);
          }), setSize: W(function (a, b) {
            var c = this,
                g = function (a) {
              return "number" == typeof a || /^\d+$/.test(String(a)) ? a + "px" : a;
            };null != a && (this.display.wrapper.style.width = g(a));null != b && (this.display.wrapper.style.height = g(b));this.options.lineWrapping && Fe(this);var h = this.display.viewFrom;this.doc.iter(h, this.display.viewTo, function (a) {
              if (a.widgets) for (var b = 0; b < a.widgets.length; b++) if (a.widgets[b].noHScroll) {
                Ja(c, h, "widget");break;
              }++h;
            });this.curOp.forceUpdate = !0;t(this, "refresh", this);
          }), operation: function (a) {
            return ea(this, a);
          }, startOperation: function () {
            return bb(this);
          }, endOperation: function () {
            return cb(this);
          },
          refresh: W(function () {
            var a = this.display.cachedTextHeight;aa(this);this.curOp.forceUpdate = !0;Mb(this);Ob(this, this.doc.scrollLeft, this.doc.scrollTop);Hd(this.display);(null == a || .5 < Math.abs(a - pb(this.display)) || this.options.lineWrapping) && Ad(this);t(this, "refresh", this);
          }), swapDoc: W(function (a) {
            var b = this.doc;b.cm = null;this.state.selectingText && this.state.selectingText();gf(this, a);Mb(this);this.display.input.reset();Ob(this, a.scrollLeft, a.scrollTop);this.curOp.forceScroll = !0;R(this, "swapDoc", this, b);
            return b;
          }), phrase: function (a) {
            var b = this.options.phrases;return b && Object.prototype.hasOwnProperty.call(b, a) ? b[a] : a;
          }, getInputField: function () {
            return this.display.input.getField();
          }, getWrapperElement: function () {
            return this.display.wrapper;
          }, getScrollerElement: function () {
            return this.display.scroller;
          }, getGutterElement: function () {
            return this.display.gutters;
          } };ib(a);a.registerHelper = function (b, e, f) {
          c.hasOwnProperty(b) || (c[b] = a[b] = { _global: [] });c[b][e] = f;
        };a.registerGlobalHelper = function (b, e, f, g) {
          a.registerHelper(b, e, g);c[b]._global.push({ pred: f, val: g });
        };
      })(I);var rh = "iter insert remove copy getEditor constructor".split(" "),
          nc;for (nc in ba.prototype) ba.prototype.hasOwnProperty(nc) && 0 > O(rh, nc) && (I.prototype[nc] = function (a) {
        return function () {
          return a.apply(this.doc, arguments);
        };
      }(ba.prototype[nc]));ib(ba);I.inputStyles = { textarea: L, contenteditable: E };I.defineMode = function (a) {
        I.defaults.mode || "null" == a || (I.defaults.mode = a);lg.apply(this, arguments);
      };I.defineMIME = function (a, b) {
        jb[a] = b;
      };I.defineMode("null", function () {
        return { token: function (a) {
            return a.skipToEnd();
          } };
      });
      I.defineMIME("text/plain", "null");I.defineExtension = function (a, b) {
        I.prototype[a] = b;
      };I.defineDocExtension = function (a, b) {
        ba.prototype[a] = b;
      };I.fromTextArea = function (a, b) {
        function c() {
          a.value = k.getValue();
        }b = b ? za(b) : {};b.value = a.value;!b.tabindex && a.tabIndex && (b.tabindex = a.tabIndex);!b.placeholder && a.placeholder && (b.placeholder = a.placeholder);if (null == b.autofocus) {
          var d = fa();b.autofocus = d == a || null != a.getAttribute("autofocus") && d == document.body;
        }var e;if (a.form && (y(a.form, "submit", c), !b.leaveSubmitMethodAlone)) {
          var f = a.form;e = f.submit;try {
            var g = f.submit = function () {
              c();f.submit = e;f.submit();f.submit = g;
            };
          } catch (h) {}
        }b.finishInit = function (d) {
          d.save = c;d.getTextArea = function () {
            return a;
          };d.toTextArea = function () {
            d.toTextArea = isNaN;c();a.parentNode.removeChild(d.getWrapperElement());a.style.display = "";a.form && (u(a.form, "submit", c), b.leaveSubmitMethodAlone || "function" != typeof a.form.submit || (a.form.submit = e));
          };
        };a.style.display = "none";var k = I(function (b) {
          return a.parentNode.insertBefore(b, a.nextSibling);
        }, b);return k;
      };(function (a) {
        a.off = u;a.on = y;a.wheelEventPixels = Hg;a.Doc = ba;a.splitLines = Zd;a.countColumn = U;a.findColumn = Aa;a.isWordChar = gb;a.Pass = Sc;a.signal = t;a.Line = tb;a.changeEnd = Ka;a.scrollbarModel = Ye;a.Pos = q;a.cmpPos = A;a.modes = Zc;a.mimeModes = jb;a.resolveMode = sc;a.getMode = $c;a.modeExtensions = kb;a.extendMode = mg;a.copyState = Sa;a.startState = de;a.innerMode = ad;a.commands = bc;a.keyMap = ac;a.keyName = Jf;a.isModifierKey = Gf;a.lookupKey = zb;a.normalizeKeyMap = Tg;a.StringStream = N;a.SharedTextMarker = $b;a.TextMarker = Ma;a.LineWidget = Zb;a.e_preventDefault = Z;a.e_stopPropagation = be;a.e_stop = Fb;a.addClass = ya;a.contains = T;a.rmClass = $a;a.keyNames = Na;
      })(I);I.version = "5.58.2";return I;
    });
    (function (M) {
      "object" == typeof exports && "object" == typeof module ? M(require("../../lib/codemirror")) : "function" == typeof __define_disabled__ && define.amd ? define(["../../lib/codemirror"], M) : M(CodeMirror);
    })(function (M) {
      var ca = { autoSelfClosers: { area: !0, base: !0, br: !0, col: !0, command: !0, embed: !0, frame: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0, menuitem: !0 }, implicitlyClosed: { dd: !0, li: !0, optgroup: !0, option: !0, p: !0, rp: !0, rt: !0, tbody: !0, td: !0, tfoot: !0, th: !0, tr: !0 }, contextGrabbers: { dd: { dd: !0,
            dt: !0 }, dt: { dd: !0, dt: !0 }, li: { li: !0 }, option: { option: !0, optgroup: !0 }, optgroup: { optgroup: !0 }, p: { address: !0, article: !0, aside: !0, blockquote: !0, dir: !0, div: !0, dl: !0, fieldset: !0, footer: !0, form: !0, h1: !0, h2: !0, h3: !0, h4: !0, h5: !0, h6: !0, header: !0, hgroup: !0, hr: !0, menu: !0, nav: !0, ol: !0, p: !0, pre: !0, section: !0, table: !0, ul: !0 }, rp: { rp: !0, rt: !0 }, rt: { rp: !0, rt: !0 }, tbody: { tbody: !0, tfoot: !0 }, td: { td: !0, th: !0 }, tfoot: { tbody: !0 }, th: { td: !0, th: !0 }, thead: { tbody: !0, tfoot: !0 }, tr: { tr: !0 } }, doNotIndent: { pre: !0 }, allowUnquoted: !0, allowMissing: !0,
        caseFold: !0 },
          Y = { autoSelfClosers: {}, implicitlyClosed: {}, contextGrabbers: {}, doNotIndent: {}, allowUnquoted: !1, allowMissing: !1, allowMissingTagName: !1, caseFold: !1 };M.defineMode("xml", function (w, ra) {
        function T(n, u) {
          function t(t) {
            u.tokenize = t;return t(n, u);
          }var w = n.next();if ("\x3c" == w) {
            if (n.eat("!")) return n.eat("[") ? n.match("CDATA[") ? t(Pa("atom", "]]\x3e")) : null : n.match("--") ? t(Pa("comment", "--\x3e")) : n.match("DOCTYPE", !0, !0) ? (n.eatWhile(/[\w\._\-]/), t(Qa(1))) : null;if (n.eat("?")) return n.eatWhile(/[\w\._\-]/), u.tokenize = Pa("meta", "?\x3e"), "meta";Ga = n.eat("/") ? "closeTag" : "openTag";u.tokenize = fa;return "tag bracket";
          }if ("\x26" == w) return (n.eat("#") ? n.eat("x") ? n.eatWhile(/[a-fA-F\d]/) && n.eat(";") : n.eatWhile(/[\d]/) && n.eat(";") : n.eatWhile(/[\w\.\-:]/) && n.eat(";")) ? "atom" : "error";n.eatWhile(/[^&<]/);return null;
        }function fa(n, u) {
          var t = n.next();if ("\x3e" == t || "/" == t && n.eat("\x3e")) return u.tokenize = T, Ga = "\x3e" == t ? "endTag" : "selfcloseTag", "tag bracket";if ("\x3d" == t) return Ga = "equals", null;if ("\x3c" == t) return u.tokenize = T, u.state = Aa, u.tagName = u.tagStart = null, (t = u.tokenize(n, u)) ? t + " tag error" : "tag error";if (/[\'\"]/.test(t)) return u.tokenize = ya(t), u.stringStartCol = n.column(), u.tokenize(n, u);n.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return "word";
        }function ya(n) {
          var u = function (t, u) {
            for (; !t.eol();) if (t.next() == n) {
              u.tokenize = fa;break;
            }return "string";
          };u.isInAttribute = !0;return u;
        }function Pa(n, u) {
          return function (t, w) {
            for (; !t.eol();) {
              if (t.match(u)) {
                w.tokenize = T;break;
              }t.next();
            }return n;
          };
        }function Qa(n) {
          return function (u, t) {
            for (var w; null != (w = u.next());) {
              if ("\x3c" == w) return t.tokenize = Qa(n + 1), t.tokenize(u, t);if ("\x3e" == w) if (1 == n) {
                t.tokenize = T;break;
              } else return t.tokenize = Qa(n - 1), t.tokenize(u, t);
            }return "meta";
          };
        }function za(n, u, t) {
          this.prev = n.context;this.tagName = u;this.indent = n.indented;this.startOfLine = t;if (K.doNotIndent.hasOwnProperty(u) || n.context && n.context.noIndent) this.noIndent = !0;
        }function U(n) {
          n.context && (n.context = n.context.prev);
        }function O(n, u) {
          for (var t; n.context;) {
            t = n.context.tagName;if (!K.contextGrabbers.hasOwnProperty(t) || !K.contextGrabbers[t].hasOwnProperty(u)) break;U(n);
          }
        }function Aa(n, u, t) {
          return "openTag" == n ? (t.tagStart = u.column(), fb) : "closeTag" == n ? D : Aa;
        }function fb(n, u, t) {
          if ("word" == n) return t.tagName = u.current(), J = "tag", ma;if (K.allowMissingTagName && "endTag" == n) return J = "tag bracket", ma(n, u, t);J = "error";return fb;
        }function D(n, u, t) {
          if ("word" == n) {
            n = u.current();t.context && t.context.tagName != n && K.implicitlyClosed.hasOwnProperty(t.context.tagName) && U(t);if (t.context && t.context.tagName == n || !1 === K.matchClosing) return J = "tag", Ba;J = "tag error";return pc;
          }if (K.allowMissingTagName && "endTag" == n) return J = "tag bracket", Ba(n, u, t);J = "error";return pc;
        }function Ba(n, u, t) {
          if ("endTag" != n) return J = "error", Ba;U(t);return Aa;
        }function pc(n, u, t) {
          J = "error";return Ba(n, u, t);
        }function ma(n, u, t) {
          if ("word" == n) return J = "attribute", qc;if ("endTag" == n || "selfcloseTag" == n) {
            u = t.tagName;var w = t.tagStart;t.tagName = t.tagStart = null;"selfcloseTag" == n || K.autoSelfClosers.hasOwnProperty(u) ? O(t, u) : (O(t, u), t.context = new za(t, u, w == t.indented));return Aa;
          }J = "error";return ma;
        }function qc(n, u, t) {
          if ("equals" == n) return gb;K.allowMissing || (J = "error");return ma(n, u, t);
        }function gb(n, u, t) {
          if ("string" == n) return Ra;if ("word" == n && K.allowUnquoted) return J = "string", ma;J = "error";return ma(n, u, t);
        }function Ra(n, u, t) {
          return "string" == n ? Ra : ma(n, u, t);
        }var hb = w.indentUnit,
            K = {},
            Db = ra.htmlMode ? ca : Y,
            ja;for (ja in Db) K[ja] = Db[ja];for (ja in ra) K[ja] = ra[ja];var Ga, J;T.isInText = !0;return { startState: function (n) {
            var u = { tokenize: T, state: Aa, indented: n || 0, tagName: null, tagStart: null, context: null };
            null != n && (u.baseIndent = n);return u;
          }, token: function (n, u) {
            !u.tagName && n.sol() && (u.indented = n.indentation());if (n.eatSpace()) return null;Ga = null;var t = u.tokenize(n, u);(t || Ga) && "comment" != t && (J = null, u.state = u.state(Ga || t, n, u), J && (t = "error" == J ? t + " error" : J));return t;
          }, indent: function (n, u, t) {
            var w = n.context;if (n.tokenize.isInAttribute) return n.tagStart == n.indented ? n.stringStartCol + 1 : n.indented + hb;if (w && w.noIndent) return M.Pass;if (n.tokenize != fa && n.tokenize != T) return t ? t.match(/^(\s*)/)[0].length : 0;if (n.tagName) return !1 !== K.multilineTagIndentPastTag ? n.tagStart + n.tagName.length + 2 : n.tagStart + hb * (K.multilineTagIndentFactor || 1);if (K.alignCDATA && /<!\[CDATA\[/.test(u)) return 0;if ((u = u && /^<(\/)?([\w_:\.-]*)/.exec(u)) && u[1]) {
              for (; w;) if (w.tagName == u[2]) {
                w = w.prev;break;
              } else if (K.implicitlyClosed.hasOwnProperty(w.tagName)) w = w.prev;else break;
            } else if (u) for (; w;) if ((t = K.contextGrabbers[w.tagName]) && t.hasOwnProperty(u[2])) w = w.prev;else break;for (; w && w.prev && !w.startOfLine;) w = w.prev;return w ? w.indent + hb : n.baseIndent || 0;
          }, electricInput: /<\/[\s\w:]+>$/,
          blockCommentStart: "\x3c!--", blockCommentEnd: "--\x3e", configuration: K.htmlMode ? "html" : "xml", helperType: K.htmlMode ? "html" : "xml", skipAttribute: function (n) {
            n.state == gb && (n.state = ma);
          }, xmlCurrentTag: function (n) {
            return n.tagName ? { name: n.tagName, close: "closeTag" == n.type } : null;
          }, xmlCurrentContext: function (n) {
            var u = [];for (n = n.context; n; n = n.prev) n.tagName && u.push(n.tagName);return u.reverse();
          } };
      });M.defineMIME("text/xml", "xml");M.defineMIME("application/xml", "xml");M.mimeModes.hasOwnProperty("text/html") || M.defineMIME("text/html", { name: "xml", htmlMode: !0 });
    });
  }
});
//# sourceMappingURL=vendors.js.map