const grapes_min$1 = "";
const app = "";
const pageInjection = "";
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs(x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
}
var grapes_min = { exports: {} };
/*! grapesjs - 0.21.2 */
(function(module, exports) {
!function(t, e) {
module.exports = e();
}("undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : commonjsGlobal, () => (() => {
var t = { 410: (t2, e2, n2) => {
var o2, r, i;
r = [n2(50), n2(316)], void 0 === (i = "function" == typeof (o2 = function(t3, e3) {
var n3 = Array.prototype.slice;
function o3(t4, e4, n4) {
return n4.length <= 4 ? t4.call(e4, n4[0], n4[1], n4[2], n4[3]) : t4.apply(e4, n4);
}
function r2(t4, e4) {
return n3.call(t4, e4);
}
function i2(e4, n4) {
return null != e4 && (t3.isArray(n4) || (n4 = r2(arguments, 1)), t3.all(n4, function(t4) {
return t4 in e4;
}));
}
var s = function() {
var e4 = false, n4 = -1;
function o4() {
n4++, e4 = true, t3.defer(function() {
e4 = false;
});
}
return function() {
return e4 || o4(), n4;
};
}();
function a() {
this.registeredObjects = [], this.cidIndexes = [];
}
function l(e4, n4, o4, r3) {
for (var i3, s2 = 0, a2 = n4.length; s2 < a2; s2++)
if (i3 = n4[s2]) {
if ("on" === e4) {
if (!r3.objectRegistry.register(i3))
continue;
} else if (!r3.objectRegistry.unregister(i3))
continue;
t3.isFunction(i3[e4]) && i3[e4]("all", o4, r3);
}
}
function c(e4, n4) {
var o4 = n4.type, r3 = n4.undoTypes, i3 = !r3[o4] || r3[o4][e4];
t3.isFunction(i3) && i3(n4.object, n4.before, n4.after, n4.options);
}
function u(e4, o4, r3, i3, s2) {
if (!(r3.isCurrentlyUndoRedoing || "undo" === e4 && -1 === r3.pointer || "redo" === e4 && r3.pointer === r3.length - 1)) {
r3.isCurrentlyUndoRedoing = true;
var a2, l2, c2 = "undo" === e4;
for (s2 ? l2 = c2 && r3.pointer === r3.length - 1 || !c2 && -1 === r3.pointer ? t3.clone(r3.models) : n3.apply(r3.models, c2 ? [0, r3.pointer] : [r3.pointer, r3.length - 1]) : (a2 = r3.at(c2 ? r3.pointer : r3.pointer + 1), l2 = i3 ? r3.where({ magicFusionIndex: a2.get("magicFusionIndex") }) : [a2]), r3.pointer += (c2 ? -1 : 1) * l2.length; a2 = c2 ? l2.pop() : l2.shift(); )
a2[e4]();
r3.isCurrentlyUndoRedoing = false, o4.trigger(e4, o4);
}
}
function p(t4, e4) {
var n4 = t4.condition, r3 = typeof n4;
return "function" === r3 ? !!o3(n4, t4, e4) : "boolean" !== r3 || n4;
}
function d(t4, e4, n4, r3) {
if (t4.track && !t4.isCurrentlyUndoRedoing && e4 in r3 && p(r3[e4], n4)) {
var a2 = o3(r3[e4]["on"], r3[e4], n4);
if (i2(a2, "object", "before", "after")) {
if (a2.type = e4, a2.magicFusionIndex = s(), a2.undoTypes = r3, t4.pointer < t4.length - 1)
for (var l2 = t4.length - t4.pointer - 1; l2--; )
t4.pop();
t4.pointer = t4.length, t4.add(a2), t4.length > t4.maximumStackLength && (t4.shift(), t4.pointer--);
}
}
}
a.prototype = { isRegistered: function(e4) {
return e4 && e4.cid ? this.registeredObjects[e4.cid] : t3.contains(this.registeredObjects, e4);
}, register: function(t4) {
return !this.isRegistered(t4) && (t4 && t4.cid ? (this.registeredObjects[t4.cid] = t4, this.cidIndexes.push(t4.cid)) : this.registeredObjects.push(t4), true);
}, unregister: function(e4) {
if (this.isRegistered(e4)) {
if (e4 && e4.cid)
delete this.registeredObjects[e4.cid], this.cidIndexes.splice(t3.indexOf(this.cidIndexes, e4.cid), 1);
else {
var n4 = t3.indexOf(this.registeredObjects, e4);
this.registeredObjects.splice(n4, 1);
}
return true;
}
return false;
}, get: function() {
return t3.map(this.cidIndexes, function(t4) {
return this.registeredObjects[t4];
}, this).concat(this.registeredObjects);
} };
var f = { add: { undo: function(t4, e4, n4, o4) {
t4.remove(n4, o4);
}, redo: function(t4, e4, n4, o4) {
o4.index && (o4.at = o4.index), t4.add(n4, o4);
}, on: function(e4, n4, o4) {
return { object: n4, before: void 0, after: e4, options: t3.clone(o4) };
} }, remove: { undo: function(t4, e4, n4, o4) {
"index" in o4 && (o4.at = o4.index), t4.add(e4, o4);
}, redo: function(t4, e4, n4, o4) {
t4.remove(e4, o4);
}, on: function(e4, n4, o4) {
return { object: n4, before: e4, after: void 0, options: t3.clone(o4) };
} }, change: { undo: function(e4, n4, o4, r3) {
t3.isEmpty(n4) ? t3.each(t3.keys(o4), e4.unset, e4) : (e4.set(n4), r3 && r3.unsetData && r3.unsetData.before && r3.unsetData.before.length && t3.each(r3.unsetData.before, e4.unset, e4));
}, redo: function(e4, n4, o4, r3) {
t3.isEmpty(o4) ? t3.each(t3.keys(n4), e4.unset, e4) : (e4.set(o4), r3 && r3.unsetData && r3.unsetData.after && r3.unsetData.after.length && t3.each(r3.unsetData.after, e4.unset, e4));
}, on: function(e4, n4) {
var o4 = e4.changedAttributes(), r3 = t3.keys(o4), i3 = t3.pick(e4.previousAttributes(), r3), s2 = t3.keys(i3), a2 = (n4 || (n4 = {})).unsetData = { after: [], before: [] };
return r3.length != s2.length && (r3.length > s2.length ? t3.each(r3, function(t4) {
t4 in i3 || a2.before.push(t4);
}, this) : t3.each(s2, function(t4) {
t4 in o4 || a2.after.push(t4);
})), { object: e4, before: i3, after: o4, options: t3.clone(n4) };
} }, reset: { undo: function(t4, e4, n4) {
t4.reset(e4);
}, redo: function(t4, e4, n4) {
t4.reset(n4);
}, on: function(e4, n4) {
return { object: e4, before: n4.previousModels, after: t3.clone(e4.models) };
} } };
function h() {
}
function g(e4, n4, o4, r3) {
if ("object" == typeof n4)
return t3.each(n4, function(t4, n5) {
2 === e4 ? g(e4, t4, o4, r3) : g(e4, n5, t4, o4);
});
switch (e4) {
case 0:
i2(o4, "undo", "redo", "on") && t3.all(t3.pick(o4, "undo", "redo", "on"), t3.isFunction) && (r3[n4] = o4);
break;
case 1:
r3[n4] && t3.isObject(o4) && (r3[n4] = t3.extend({}, r3[n4], o4));
break;
case 2:
delete r3[n4];
}
return this;
}
h.prototype = f;
var v = e3.Model.extend({ defaults: { type: null, object: null, before: null, after: null, magicFusionIndex: null }, undo: function(t4) {
c("undo", this.attributes);
}, redo: function(t4) {
c("redo", this.attributes);
} }), y = e3.Collection.extend({ model: v, pointer: -1, track: false, isCurrentlyUndoRedoing: false, maximumStackLength: 1 / 0, setMaxLength: function(t4) {
this.maximumStackLength = t4;
} }), m = e3.Model.extend({ defaults: { maximumStackLength: 1 / 0, track: false }, initialize: function(e4) {
this.stack = new y(), this.objectRegistry = new a(), this.undoTypes = new h(), this.stack.setMaxLength(this.get("maximumStackLength")), this.on("change:maximumStackLength", function(t4, e5) {
this.stack.setMaxLength(e5);
}, this), e4 && e4.track && this.startTracking(), e4 && e4.register && (t3.isArray(e4.register) || t3.isArguments(e4.register) ? o3(this.register, this, e4.register) : this.register(e4.register));
}, startTracking: function() {
this.set("track", true), this.stack.track = true;
}, stopTracking: function() {
this.set("track", false), this.stack.track = false;
}, isTracking: function() {
return this.get("track");
}, _addToStack: function(t4) {
d(this.stack, t4, r2(arguments, 1), this.undoTypes);
}, register: function() {
l("on", arguments, this._addToStack, this);
}, unregister: function() {
l("off", arguments, this._addToStack, this);
}, unregisterAll: function() {
o3(this.unregister, this, this.objectRegistry.get());
}, undo: function(t4) {
u("undo", this, this.stack, t4);
}, undoAll: function() {
u("undo", this, this.stack, false, true);
}, redo: function(t4) {
u("redo", this, this.stack, t4);
}, redoAll: function() {
u("redo", this, this.stack, false, true);
}, isAvailable: function(t4) {
var e4 = this.stack, n4 = e4.length;
switch (t4) {
case "undo":
return n4 > 0 && e4.pointer > -1;
case "redo":
return n4 > 0 && e4.pointer < n4 - 1;
default:
return false;
}
}, merge: function(e4) {
for (var n4, o4 = t3.isArray(e4) ? e4 : r2(arguments); n4 = o4.pop(); )
n4 instanceof m && n4.stack instanceof y && (n4.stack = this.stack);
}, addUndoType: function(t4, e4) {
g(0, t4, e4, this.undoTypes);
}, changeUndoType: function(t4, e4) {
g(1, t4, e4, this.undoTypes);
}, removeUndoType: function(t4) {
g(2, t4, void 0, this.undoTypes);
}, clear: function() {
this.stack.reset(), this.stack.pointer = -1;
} });
return t3.extend(m, { defaults: function(e4) {
t3.extend(m.prototype.defaults, e4);
}, addUndoType: function(t4, e4) {
g(0, t4, e4, f);
}, changeUndoType: function(t4, e4) {
g(1, t4, e4, f);
}, removeUndoType: function(t4) {
g(2, t4, void 0, f);
} }), e3.UndoManager = m;
}) ? o2.apply(e2, r) : o2) || (t2.exports = i);
}, 316: (t2, e2, n2) => {
var o2, r;
!function(i) {
var s = "object" == typeof self && self.self === self && self || "object" == typeof n2.g && n2.g.global === n2.g && n2.g;
o2 = [n2(50), n2(895), e2], r = function(t3, e3, n3) {
s.Backbone = function(t4, e4, n4, o3) {
var r2 = t4.Backbone, i2 = Array.prototype.slice;
e4.VERSION = "1.4.1", e4.$ = o3, e4.noConflict = function() {
return t4.Backbone = r2, this;
}, e4.emulateHTTP = false, e4.emulateJSON = false;
var s2, a = e4.Events = {}, l = /\s+/, c = function(t5, e5, o4, r3, i3) {
var s3, a2 = 0;
if (o4 && "object" == typeof o4) {
void 0 !== r3 && "context" in i3 && void 0 === i3.context && (i3.context = r3);
for (s3 = n4.keys(o4); a2 < s3.length; a2++)
e5 = c(t5, e5, s3[a2], o4[s3[a2]], i3);
} else if (o4 && l.test(o4))
for (s3 = o4.split(l); a2 < s3.length; a2++)
e5 = t5(e5, s3[a2], r3, i3);
else
e5 = t5(e5, o4, r3, i3);
return e5;
};
a.on = function(t5, e5, n5) {
(this._events = c(u, this._events || {}, t5, e5, { context: n5, ctx: this, listening: s2 }), s2) && ((this._listeners || (this._listeners = {}))[s2.id] = s2, s2.interop = false);
return this;
}, a.listenTo = function(t5, e5, o4) {
if (!t5)
return this;
var r3 = t5._listenId || (t5._listenId = n4.uniqueId("l")), i3 = this._listeningTo || (this._listeningTo = {}), a2 = s2 = i3[r3];
a2 || (this._listenId || (this._listenId = n4.uniqueId("l")), a2 = s2 = i3[r3] = new v(this, t5));
var l2 = p(t5, e5, o4, this);
if (s2 = void 0, l2)
throw l2;
return a2.interop && a2.on(e5, o4), this;
};
var u = function(t5, e5, n5, o4) {
if (n5) {
var r3 = t5[e5] || (t5[e5] = []), i3 = o4.context, s3 = o4.ctx, a2 = o4.listening;
a2 && a2.count++, r3.push({ callback: n5, context: i3, ctx: i3 || s3, listening: a2 });
}
return t5;
}, p = function(t5, e5, n5, o4) {
try {
t5.on(e5, n5, o4);
} catch (t6) {
return t6;
}
};
a.off = function(t5, e5, n5) {
return this._events ? (this._events = c(d, this._events, t5, e5, { context: n5, listeners: this._listeners }), this) : this;
}, a.stopListening = function(t5, e5, o4) {
var r3 = this._listeningTo;
if (!r3)
return this;
for (var i3 = t5 ? [t5._listenId] : n4.keys(r3), s3 = 0; s3 < i3.length; s3++) {
var a2 = r3[i3[s3]];
if (!a2)
break;
a2.obj.off(e5, o4, this), a2.interop && a2.off(e5, o4);
}
return n4.isEmpty(r3) && (this._listeningTo = void 0), this;
};
var d = function(t5, e5, o4, r3) {
if (t5) {
var i3, s3 = r3.context, a2 = r3.listeners, l2 = 0;
if (e5 || s3 || o4) {
for (i3 = e5 ? [e5] : n4.keys(t5); l2 < i3.length; l2++) {
var c2 = t5[e5 = i3[l2]];
if (!c2)
break;
for (var u2 = [], p2 = 0; p2 < c2.length; p2++) {
var d2 = c2[p2];
if (o4 && o4 !== d2.callback && o4 !== d2.callback._callback || s3 && s3 !== d2.context)
u2.push(d2);
else {
var f2 = d2.listening;
f2 && f2.off(e5, o4);
}
}
u2.length ? t5[e5] = u2 : delete t5[e5];
}
return t5;
}
for (i3 = n4.keys(a2); l2 < i3.length; l2++)
a2[i3[l2]].cleanup();
}
};
a.once = function(t5, e5, n5) {
var o4 = c(f, {}, t5, e5, this.off.bind(this));
return "string" == typeof t5 && null == n5 && (e5 = void 0), this.on(o4, e5, n5);
}, a.listenToOnce = function(t5, e5, n5) {
var o4 = c(f, {}, e5, n5, this.stopListening.bind(this, t5));
return this.listenTo(t5, o4);
};
var f = function(t5, e5, o4, r3) {
if (o4) {
var i3 = t5[e5] = n4.once(function() {
r3(e5, i3), o4.apply(this, arguments);
});
i3._callback = o4;
}
return t5;
};
a.trigger = function(t5) {
if (!this._events)
return this;
for (var e5 = Math.max(0, arguments.length - 1), n5 = Array(e5), o4 = 0; o4 < e5; o4++)
n5[o4] = arguments[o4 + 1];
return c(h, this._events, t5, void 0, n5), this;
};
var h = function(t5, e5, n5, o4) {
if (t5) {
var r3 = t5[e5], i3 = t5.all;
r3 && i3 && (i3 = i3.slice()), r3 && g(r3, o4), i3 && g(i3, [e5].concat(o4));
}
return t5;
}, g = function(t5, e5) {
var n5, o4 = -1, r3 = t5.length, i3 = e5[0], s3 = e5[1], a2 = e5[2];
switch (e5.length) {
case 0:
for (; ++o4 < r3; )
(n5 = t5[o4]).callback.call(n5.ctx);
return;
case 1:
for (; ++o4 < r3; )
(n5 = t5[o4]).callback.call(n5.ctx, i3);
return;
case 2:
for (; ++o4 < r3; )
(n5 = t5[o4]).callback.call(n5.ctx, i3, s3);
return;
case 3:
for (; ++o4 < r3; )
(n5 = t5[o4]).callback.call(n5.ctx, i3, s3, a2);
return;
default:
for (; ++o4 < r3; )
(n5 = t5[o4]).callback.apply(n5.ctx, e5);
return;
}
}, v = function(t5, e5) {
this.id = t5._listenId, this.listener = t5, this.obj = e5, this.interop = true, this.count = 0, this._events = void 0;
};
v.prototype.on = a.on, v.prototype.off = function(t5, e5) {
var n5;
this.interop ? (this._events = c(d, this._events, t5, e5, { context: void 0, listeners: void 0 }), n5 = !this._events) : (this.count--, n5 = 0 === this.count), n5 && this.cleanup();
}, v.prototype.cleanup = function() {
delete this.listener._listeningTo[this.obj._listenId], this.interop || delete this.obj._listeners[this.id];
}, a.bind = a.on, a.unbind = a.off, n4.extend(e4, a);
var y = e4.Model = function(t5, e5) {
var o4 = t5 || {};
e5 || (e5 = {}), this.preinitialize.apply(this, arguments), this.cid = n4.uniqueId(this.cidPrefix), this.attributes = {}, e5.collection && (this.collection = e5.collection), e5.parse && (o4 = this.parse(o4, e5) || {});
var r3 = n4.result(this, "defaults");
o4 = n4.defaults(n4.extend({}, r3, o4), r3), this.set(o4, e5), this.changed = {}, this.initialize.apply(this, arguments);
};
n4.extend(y.prototype, a, { changed: null, validationError: null, idAttribute: "id", cidPrefix: "c", preinitialize: function() {
}, initialize: function() {
}, toJSON: function(t5) {
return n4.clone(this.attributes);
}, sync: function() {
return e4.sync.apply(this, arguments);
}, get: function(t5) {
return this.attributes[t5];
}, escape: function(t5) {
return n4.escape(this.get(t5));
}, has: function(t5) {
return null != this.get(t5);
}, matches: function(t5) {
return !!n4.iteratee(t5, this)(this.attributes);
}, set: function(t5, e5, o4) {
if (null == t5)
return this;
var r3;
if ("object" == typeof t5 ? (r3 = t5, o4 = e5) : (r3 = {})[t5] = e5, o4 || (o4 = {}), !this._validate(r3, o4))
return false;
var i3 = o4.unset, s3 = o4.silent, a2 = [], l2 = this._changing;
this._changing = true, l2 || (this._previousAttributes = n4.clone(this.attributes), this.changed = {});
var c2 = this.attributes, u2 = this.changed, p2 = this._previousAttributes;
for (var d2 in r3)
e5 = r3[d2], n4.isEqual(c2[d2], e5) || a2.push(d2), n4.isEqual(p2[d2], e5) ? delete u2[d2] : u2[d2] = e5, i3 ? delete c2[d2] : c2[d2] = e5;
if (this.idAttribute in r3) {
var f2 = this.id;
this.id = this.get(this.idAttribute), this.trigger("changeId", this, f2, o4);
}
if (!s3) {
a2.length && (this._pending = o4);
for (var h2 = 0; h2 < a2.length; h2++)
this.trigger("change:" + a2[h2], this, c2[a2[h2]], o4);
}
if (l2)
return this;
if (!s3)
for (; this._pending; )
o4 = this._pending, this._pending = false, this.trigger("change", this, o4);
return this._pending = false, this._changing = false, this;
}, unset: function(t5, e5) {
return this.set(t5, void 0, n4.extend({}, e5, { unset: true }));
}, clear: function(t5) {
var e5 = {};
for (var o4 in this.attributes)
e5[o4] = void 0;
return this.set(e5, n4.extend({}, t5, { unset: true }));
}, hasChanged: function(t5) {
return null == t5 ? !n4.isEmpty(this.changed) : n4.has(this.changed, t5);
}, changedAttributes: function(t5) {
if (!t5)
return !!this.hasChanged() && n4.clone(this.changed);
var e5, o4 = this._changing ? this._previousAttributes : this.attributes, r3 = {};
for (var i3 in t5) {
var s3 = t5[i3];
n4.isEqual(o4[i3], s3) || (r3[i3] = s3, e5 = true);
}
return !!e5 && r3;
}, previous: function(t5) {
return null != t5 && this._previousAttributes ? this._previousAttributes[t5] : null;
}, previousAttributes: function() {
return n4.clone(this._previousAttributes);
}, fetch: function(t5) {
t5 = n4.extend({ parse: true }, t5);
var e5 = this, o4 = t5.success;
return t5.success = function(n5) {
var r3 = t5.parse ? e5.parse(n5, t5) : n5;
if (!e5.set(r3, t5))
return false;
o4 && o4.call(t5.context, e5, n5, t5), e5.trigger("sync", e5, n5, t5);
}, K(this, t5), this.sync("read", this, t5);
}, save: function(t5, e5, o4) {
var r3;
null == t5 || "object" == typeof t5 ? (r3 = t5, o4 = e5) : (r3 = {})[t5] = e5;
var i3 = (o4 = n4.extend({ validate: true, parse: true }, o4)).wait;
if (r3 && !i3) {
if (!this.set(r3, o4))
return false;
} else if (!this._validate(r3, o4))
return false;
var s3 = this, a2 = o4.success, l2 = this.attributes;
o4.success = function(t6) {
s3.attributes = l2;
var e6 = o4.parse ? s3.parse(t6, o4) : t6;
if (i3 && (e6 = n4.extend({}, r3, e6)), e6 && !s3.set(e6, o4))
return false;
a2 && a2.call(o4.context, s3, t6, o4), s3.trigger("sync", s3, t6, o4);
}, K(this, o4), r3 && i3 && (this.attributes = n4.extend({}, l2, r3));
var c2 = this.isNew() ? "create" : o4.patch ? "patch" : "update";
"patch" !== c2 || o4.attrs || (o4.attrs = r3);
var u2 = this.sync(c2, this, o4);
return this.attributes = l2, u2;
}, destroy: function(t5) {
t5 = t5 ? n4.clone(t5) : {};
var e5 = this, o4 = t5.success, r3 = t5.wait, i3 = function() {
e5.stopListening(), e5.trigger("destroy", e5, e5.collection, t5);
};
t5.success = function(n5) {
r3 && i3(), o4 && o4.call(t5.context, e5, n5, t5), e5.isNew() || e5.trigger("sync", e5, n5, t5);
};
var s3 = false;
return this.isNew() ? n4.defer(t5.success) : (K(this, t5), s3 = this.sync("delete", this, t5)), r3 || i3(), s3;
}, url: function() {
var t5 = n4.result(this, "urlRoot") || n4.result(this.collection, "url") || G();
if (this.isNew())
return t5;
var e5 = this.get(this.idAttribute);
return t5.replace(/[^\/]$/, "$&/") + encodeURIComponent(e5);
}, parse: function(t5, e5) {
return t5;
}, clone: function() {
return new this.constructor(this.attributes);
}, isNew: function() {
return !this.has(this.idAttribute);
}, isValid: function(t5) {
return this._validate({}, n4.extend({}, t5, { validate: true }));
}, _validate: function(t5, e5) {
if (!e5.validate || !this.validate)
return true;
t5 = n4.extend({}, this.attributes, t5);
var o4 = this.validationError = this.validate(t5, e5) || null;
return !o4 || (this.trigger("invalid", this, o4, n4.extend(e5, { validationError: o4 })), false);
} });
var m = e4.Collection = function(t5, e5) {
e5 || (e5 = {}), this.preinitialize.apply(this, arguments), e5.model && (this.model = e5.model), void 0 !== e5.comparator && (this.comparator = e5.comparator), this._reset(), this.initialize.apply(this, arguments), t5 && this.reset(t5, n4.extend({ silent: true }, e5));
}, b = { add: true, remove: true, merge: true }, _ = { add: true, remove: false }, w = function(t5, e5, n5) {
n5 = Math.min(Math.max(n5, 0), t5.length);
var o4, r3 = Array(t5.length - n5), i3 = e5.length;
for (o4 = 0; o4 < r3.length; o4++)
r3[o4] = t5[o4 + n5];
for (o4 = 0; o4 < i3; o4++)
t5[o4 + n5] = e5[o4];
for (o4 = 0; o4 < r3.length; o4++)
t5[o4 + i3 + n5] = r3[o4];
};
n4.extend(m.prototype, a, { model: y, preinitialize: function() {
}, initialize: function() {
}, toJSON: function(t5) {
return this.map(function(e5) {
return e5.toJSON(t5);
});
}, sync: function() {
return e4.sync.apply(this, arguments);
}, add: function(t5, e5) {
return this.set(t5, n4.extend({ merge: false }, e5, _));
}, remove: function(t5, e5) {
e5 = n4.extend({}, e5);
var o4 = !n4.isArray(t5);
t5 = o4 ? [t5] : t5.slice();
var r3 = this._removeModels(t5, e5);
return !e5.silent && r3.length && (e5.changes = { added: [], merged: [], removed: r3 }, this.trigger("update", this, e5)), o4 ? r3[0] : r3;
}, set: function(t5, e5) {
if (null != t5) {
(e5 = n4.extend({}, b, e5)).parse && !this._isModel(t5) && (t5 = this.parse(t5, e5) || []);
var o4 = !n4.isArray(t5);
t5 = o4 ? [t5] : t5.slice();
var r3 = e5.at;
null != r3 && (r3 = +r3), r3 > this.length && (r3 = this.length), r3 < 0 && (r3 += this.length + 1);
var i3, s3, a2 = [], l2 = [], c2 = [], u2 = [], p2 = {}, d2 = e5.add, f2 = e5.merge, h2 = e5.remove, g2 = false, v2 = this.comparator && null == r3 && false !== e5.sort, y2 = n4.isString(this.comparator) ? this.comparator : null;
for (s3 = 0; s3 < t5.length; s3++) {
i3 = t5[s3];
var m2 = this.get(i3);
if (m2) {
if (f2 && i3 !== m2) {
var _2 = this._isModel(i3) ? i3.attributes : i3;
e5.parse && (_2 = m2.parse(_2, e5)), m2.set(_2, e5), c2.push(m2), v2 && !g2 && (g2 = m2.hasChanged(y2));
}
p2[m2.cid] || (p2[m2.cid] = true, a2.push(m2)), t5[s3] = m2;
} else
d2 && (i3 = t5[s3] = this._prepareModel(i3, e5)) && (l2.push(i3), this._addReference(i3, e5), p2[i3.cid] = true, a2.push(i3));
}
if (h2) {
for (s3 = 0; s3 < this.length; s3++)
p2[(i3 = this.models[s3]).cid] || u2.push(i3);
u2.length && this._removeModels(u2, e5);
}
var x2 = false, C2 = !v2 && d2 && h2;
if (a2.length && C2 ? (x2 = this.length !== a2.length || n4.some(this.models, function(t6, e6) {
return t6 !== a2[e6];
}), this.models.length = 0, w(this.models, a2, 0), this.length = this.models.length) : l2.length && (v2 && (g2 = true), w(this.models, l2, null == r3 ? this.length : r3), this.length = this.models.length), g2 && this.sort({ silent: true }), !e5.silent) {
for (s3 = 0; s3 < l2.length; s3++)
null != r3 && (e5.index = r3 + s3), (i3 = l2[s3]).trigger("add", i3, this, e5);
(g2 || x2) && this.trigger("sort", this, e5), (l2.length || u2.length || c2.length) && (e5.changes = { added: l2, removed: u2, merged: c2 }, this.trigger("update", this, e5));
}
return o4 ? t5[0] : t5;
}
}, reset: function(t5, e5) {
e5 = e5 ? n4.clone(e5) : {};
for (var o4 = 0; o4 < this.models.length; o4++)
this._removeReference(this.models[o4], e5);
return e5.previousModels = this.models, this._reset(), t5 = this.add(t5, n4.extend({ silent: true }, e5)), e5.silent || this.trigger("reset", this, e5), t5;
}, push: function(t5, e5) {
return this.add(t5, n4.extend({ at: this.length }, e5));
}, pop: function(t5) {
var e5 = this.at(this.length - 1);
return this.remove(e5, t5);
}, unshift: function(t5, e5) {
return this.add(t5, n4.extend({ at: 0 }, e5));
}, shift: function(t5) {
var e5 = this.at(0);
return this.remove(e5, t5);
}, slice: function() {
return i2.apply(this.models, arguments);
}, get: function(t5) {
if (null != t5)
return this._byId[t5] || this._byId[this.modelId(this._isModel(t5) ? t5.attributes : t5, t5.idAttribute)] || t5.cid && this._byId[t5.cid];
}, has: function(t5) {
return null != this.get(t5);
}, at: function(t5) {
return t5 < 0 && (t5 += this.length), this.models[t5];
}, where: function(t5, e5) {
return this[e5 ? "find" : "filter"](t5);
}, findWhere: function(t5) {
return this.where(t5, true);
}, sort: function(t5) {
var e5 = this.comparator;
if (!e5)
throw new Error("Cannot sort a set without a comparator");
t5 || (t5 = {});
var o4 = e5.length;
return n4.isFunction(e5) && (e5 = e5.bind(this)), 1 === o4 || n4.isString(e5) ? this.models = this.sortBy(e5) : this.models.sort(e5), t5.silent || this.trigger("sort", this, t5), this;
}, pluck: function(t5) {
return this.map(t5 + "");
}, fetch: function(t5) {
var e5 = (t5 = n4.extend({ parse: true }, t5)).success, o4 = this;
return t5.success = function(n5) {
var r3 = t5.reset ? "reset" : "set";
o4[r3](n5, t5), e5 && e5.call(t5.context, o4, n5, t5), o4.trigger("sync", o4, n5, t5);
}, K(this, t5), this.sync("read", this, t5);
}, create: function(t5, e5) {
var o4 = (e5 = e5 ? n4.clone(e5) : {}).wait;
if (!(t5 = this._prepareModel(t5, e5)))
return false;
o4 || this.add(t5, e5);
var r3 = this, i3 = e5.success;
return e5.success = function(t6, e6, n5) {
o4 && r3.add(t6, n5), i3 && i3.call(n5.context, t6, e6, n5);
}, t5.save(null, e5), t5;
}, parse: function(t5, e5) {
return t5;
}, clone: function() {
return new this.constructor(this.models, { model: this.model, comparator: this.comparator });
}, modelId: function(t5, e5) {
return t5[e5 || this.model.prototype.idAttribute || "id"];
}, values: function() {
return new C(this, S);
}, keys: function() {
return new C(this, O);
}, entries: function() {
return new C(this, T);
}, _reset: function() {
this.length = 0, this.models = [], this._byId = {};
}, _prepareModel: function(t5, e5) {
return this._isModel(t5) ? (t5.collection || (t5.collection = this), t5) : ((e5 = e5 ? n4.clone(e5) : {}).collection = this, (o4 = this.model.prototype ? new this.model(t5, e5) : this.model(t5, e5)).validationError ? (this.trigger("invalid", this, o4.validationError, e5), false) : o4);
var o4;
}, _removeModels: function(t5, e5) {
for (var n5 = [], o4 = 0; o4 < t5.length; o4++) {
var r3 = this.get(t5[o4]);
if (r3) {
var i3 = this.indexOf(r3);
this.models.splice(i3, 1), this.length--, delete this._byId[r3.cid];
var s3 = this.modelId(r3.attributes, r3.idAttribute);
null != s3 && delete this._byId[s3], e5.silent || (e5.index = i3, r3.trigger("remove", r3, this, e5)), n5.push(r3), this._removeReference(r3, e5);
}
}
return n5;
}, _isModel: function(t5) {
return t5 instanceof y;
}, _addReference: function(t5, e5) {
this._byId[t5.cid] = t5;
var n5 = this.modelId(t5.attributes, t5.idAttribute);
null != n5 && (this._byId[n5] = t5), t5.on("all", this._onModelEvent, this);
}, _removeReference: function(t5, e5) {
delete this._byId[t5.cid];
var n5 = this.modelId(t5.attributes, t5.idAttribute);
null != n5 && delete this._byId[n5], this === t5.collection && delete t5.collection, t5.off("all", this._onModelEvent, this);
}, _onModelEvent: function(t5, e5, n5, o4) {
if (e5) {
if (("add" === t5 || "remove" === t5) && n5 !== this)
return;
if ("destroy" === t5 && this.remove(e5, o4), "changeId" === t5) {
var r3 = this.modelId(e5.previousAttributes(), e5.idAttribute), i3 = this.modelId(e5.attributes, e5.idAttribute);
null != r3 && delete this._byId[r3], null != i3 && (this._byId[i3] = e5);
}
}
this.trigger.apply(this, arguments);
} });
var x = "function" == typeof Symbol && Symbol.iterator;
x && (m.prototype[x] = m.prototype.values);
var C = function(t5, e5) {
this._collection = t5, this._kind = e5, this._index = 0;
}, S = 1, O = 2, T = 3;
x && (C.prototype[x] = function() {
return this;
});
C.prototype.next = function() {
if (this._collection) {
if (this._index < this._collection.length) {
var t5, e5 = this._collection.at(this._index);
if (this._index++, this._kind === S)
t5 = e5;
else {
var n5 = this._collection.modelId(e5.attributes, e5.idAttribute);
t5 = this._kind === O ? n5 : [n5, e5];
}
return { value: t5, done: false };
}
this._collection = void 0;
}
return { value: void 0, done: true };
};
var k = e4.View = function(t5) {
this.cid = n4.uniqueId("view"), this.preinitialize.apply(this, arguments), n4.extend(this, n4.pick(t5, E)), this._ensureElement(), this.initialize.apply(this, arguments);
}, P = /^(\S+)\s*(.*)$/, E = ["model", "collection", "el", "id", "attributes", "className", "tagName", "events"];
n4.extend(k.prototype, a, { tagName: "div", $: function(t5) {
return this.$el.find(t5);
}, preinitialize: function() {
}, initialize: function() {
}, render: function() {
return this;
}, remove: function() {
return this._removeElement(), this.stopListening(), this;
}, _removeElement: function() {
this.$el.remove();
}, setElement: function(t5) {
return this.undelegateEvents(), this._setElement(t5), this.delegateEvents(), this;
}, _setElement: function(t5) {
this.$el = t5 instanceof e4.$ ? t5 : e4.$(t5), this.el = this.$el[0];
}, delegateEvents: function(t5) {
if (t5 || (t5 = n4.result(this, "events")), !t5)
return this;
for (var e5 in this.undelegateEvents(), t5) {
var o4 = t5[e5];
if (n4.isFunction(o4) || (o4 = this[o4]), o4) {
var r3 = e5.match(P);
this.delegate(r3[1], r3[2], o4.bind(this));
}
}
return this;
}, delegate: function(t5, e5, n5) {
return this.$el.on(t5 + ".delegateEvents" + this.cid, e5, n5), this;
}, undelegateEvents: function() {
return this.$el && this.$el.off(".delegateEvents" + this.cid), this;
}, undelegate: function(t5, e5, n5) {
return this.$el.off(t5 + ".delegateEvents" + this.cid, e5, n5), this;
}, _createElement: function(t5) {
return document.createElement(t5);
}, _ensureElement: function() {
if (this.el)
this.setElement(n4.result(this, "el"));
else {
var t5 = n4.extend({}, n4.result(this, "attributes"));
this.id && (t5.id = n4.result(this, "id")), this.className && (t5["class"] = n4.result(this, "className")), this.setElement(this._createElement(n4.result(this, "tagName"))), this._setAttributes(t5);
}
}, _setAttributes: function(t5) {
this.$el.attr(t5);
} });
var A = function(t5, e5, n5, o4) {
switch (e5) {
case 1:
return function() {
return t5[n5](this[o4]);
};
case 2:
return function(e6) {
return t5[n5](this[o4], e6);
};
case 3:
return function(e6, r3) {
return t5[n5](this[o4], M(e6, this), r3);
};
case 4:
return function(e6, r3, i3) {
return t5[n5](this[o4], M(e6, this), r3, i3);
};
default:
return function() {
var e6 = i2.call(arguments);
return e6.unshift(this[o4]), t5[n5].apply(t5, e6);
};
}
}, j = function(t5, e5, o4, r3) {
n4.each(o4, function(n5, o5) {
e5[o5] && (t5.prototype[o5] = A(e5, n5, o5, r3));
});
}, M = function(t5, e5) {
return n4.isFunction(t5) ? t5 : n4.isObject(t5) && !e5._isModel(t5) ? L(t5) : n4.isString(t5) ? function(e6) {
return e6.get(t5);
} : t5;
}, L = function(t5) {
var e5 = n4.matches(t5);
return function(t6) {
return e5(t6.attributes);
};
}, D = { forEach: 3, each: 3, map: 3, collect: 3, reduce: 0, foldl: 0, inject: 0, reduceRight: 0, foldr: 0, find: 3, detect: 3, filter: 3, select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 3, includes: 3, contains: 3, invoke: 0, max: 3, min: 3, toArray: 1, size: 1, first: 3, head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3, without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3, isEmpty: 1, chain: 1, sample: 3, partition: 3, groupBy: 3, countBy: 3, sortBy: 3, indexBy: 3, findIndex: 3, findLastIndex: 3 }, N = { keys: 1, values: 1, pairs: 1, invert: 1, pick: 0, omit: 0, chain: 1, isEmpty: 1 };
n4.each([[m, D, "models"], [y, N, "attributes"]], function(t5) {
var e5 = t5[0], o4 = t5[1], r3 = t5[2];
e5.mixin = function(t6) {
var o5 = n4.reduce(n4.functions(t6), function(t7, e6) {
return t7[e6] = 0, t7;
}, {});
j(e5, t6, o5, r3);
}, j(e5, n4, o4, r3);
}), e4.sync = function(t5, o4, r3) {
var i3 = I[t5];
n4.defaults(r3 || (r3 = {}), { emulateHTTP: e4.emulateHTTP, emulateJSON: e4.emulateJSON });
var s3 = { type: i3, dataType: "json" };
if (r3.url || (s3.url = n4.result(o4, "url") || G()), null != r3.data || !o4 || "create" !== t5 && "update" !== t5 && "patch" !== t5 || (s3.contentType = "application/json", s3.data = JSON.stringify(r3.attrs || o4.toJSON(r3))), r3.emulateJSON && (s3.contentType = "application/x-www-form-urlencoded", s3.data = s3.data ? { model: s3.data } : {}), r3.emulateHTTP && ("PUT" === i3 || "DELETE" === i3 || "PATCH" === i3)) {
s3.type = "POST", r3.emulateJSON && (s3.data._method = i3);
var a2 = r3.beforeSend;
r3.beforeSend = function(t6) {
if (t6.setRequestHeader("X-HTTP-Method-Override", i3), a2)
return a2.apply(this, arguments);
};
}
"GET" === s3.type || r3.emulateJSON || (s3.processData = false);
var l2 = r3.error;
r3.error = function(t6, e5, n5) {
r3.textStatus = e5, r3.errorThrown = n5, l2 && l2.call(r3.context, t6, e5, n5);
};
var c2 = r3.xhr = e4.ajax(n4.extend(s3, r3));
return o4.trigger("request", o4, c2, r3), c2;
};
var I = { create: "POST", update: "PUT", patch: "PATCH", delete: "DELETE", read: "GET" };
e4.ajax = function() {
return e4.$.ajax.apply(e4.$, arguments);
};
var F = e4.Router = function(t5) {
t5 || (t5 = {}), this.preinitialize.apply(this, arguments), t5.routes && (this.routes = t5.routes), this._bindRoutes(), this.initialize.apply(this, arguments);
}, V = /\((.*?)\)/g, R = /(\(\?)?:\w+/g, H = /\*\w+/g, z = /[\-{}\[\]+?.,\\\^$|#\s]/g;
n4.extend(F.prototype, a, { preinitialize: function() {
}, initialize: function() {
}, route: function(t5, o4, r3) {
n4.isRegExp(t5) || (t5 = this._routeToRegExp(t5)), n4.isFunction(o4) && (r3 = o4, o4 = ""), r3 || (r3 = this[o4]);
var i3 = this;
return e4.history.route(t5, function(n5) {
var s3 = i3._extractParameters(t5, n5);
false !== i3.execute(r3, s3, o4) && (i3.trigger.apply(i3, ["route:" + o4].concat(s3)), i3.trigger("route", o4, s3), e4.history.trigger("route", i3, o4, s3));
}), this;
}, execute: function(t5, e5, n5) {
t5 && t5.apply(this, e5);
}, navigate: function(t5, n5) {
return e4.history.navigate(t5, n5), this;
}, _bindRoutes: function() {
if (this.routes) {
this.routes = n4.result(this, "routes");
for (var t5, e5 = n4.keys(this.routes); null != (t5 = e5.pop()); )
this.route(t5, this.routes[t5]);
}
}, _routeToRegExp: function(t5) {
return t5 = t5.replace(z, "\\$&").replace(V, "(?:$1)?").replace(R, function(t6, e5) {
return e5 ? t6 : "([^/?]+)";
}).replace(H, "([^?]*?)"), new RegExp("^" + t5 + "(?:\\?([\\s\\S]*))?$");
}, _extractParameters: function(t5, e5) {
var o4 = t5.exec(e5).slice(1);
return n4.map(o4, function(t6, e6) {
return e6 === o4.length - 1 ? t6 || null : t6 ? decodeURIComponent(t6) : null;
});
} });
var B = e4.History = function() {
this.handlers = [], this.checkUrl = this.checkUrl.bind(this), "undefined" != typeof window && (this.location = window.location, this.history = window.history);
}, U = /^[#\/]|\s+$/g, W = /^\/+|\/+$/g, $ = /#.*$/;
B.started = false, n4.extend(B.prototype, a, { interval: 50, atRoot: function() {
return this.location.pathname.replace(/[^\/]$/, "$&/") === this.root && !this.getSearch();
}, matchRoot: function() {
return this.decodeFragment(this.location.pathname).slice(0, this.root.length - 1) + "/" === this.root;
}, decodeFragment: function(t5) {
return decodeURI(t5.replace(/%25/g, "%2525"));
}, getSearch: function() {
var t5 = this.location.href.replace(/#.*/, "").match(/\?.+/);
return t5 ? t5[0] : "";
}, getHash: function(t5) {
var e5 = (t5 || this).location.href.match(/#(.*)$/);
return e5 ? e5[1] : "";
}, getPath: function() {
var t5 = this.decodeFragment(this.location.pathname + this.getSearch()).slice(this.root.length - 1);
return "/" === t5.charAt(0) ? t5.slice(1) : t5;
}, getFragment: function(t5) {
return null == t5 && (t5 = this._usePushState || !this._wantsHashChange ? this.getPath() : this.getHash()), t5.replace(U, "");
}, start: function(t5) {
if (B.started)
throw new Error("Backbone.history has already been started");
if (B.started = true, this.options = n4.extend({ root: "/" }, this.options, t5), this.root = this.options.root, this._wantsHashChange = false !== this.options.hashChange, this._hasHashChange = "onhashchange" in window && (void 0 === document.documentMode || document.documentMode > 7), this._useHashChange = this._wantsHashChange && this._hasHashChange, this._wantsPushState = !!this.options.pushState, this._hasPushState = !(!this.history || !this.history.pushState), this._usePushState = this._wantsPushState && this._hasPushState, this.fragment = this.getFragment(), this.root = ("/" + this.root + "/").replace(W, "/"), this._wantsHashChange && this._wantsPushState) {
if (!this._hasPushState && !this.atRoot()) {
var e5 = this.root.slice(0, -1) || "/";
return this.location.replace(e5 + "#" + this.getPath()), true;
}
this._hasPushState && this.atRoot() && this.navigate(this.getHash(), { replace: true });
}
if (!this._hasHashChange && this._wantsHashChange && !this._usePushState) {
this.iframe = document.createElement("iframe"), this.iframe.src = "javascript:0", this.iframe.style.display = "none", this.iframe.tabIndex = -1;
var o4 = document.body, r3 = o4.insertBefore(this.iframe, o4.firstChild).contentWindow;
r3.document.open(), r3.document.close(), r3.location.hash = "#" + this.fragment;
}
var i3 = window.addEventListener || function(t6, e6) {
return attachEvent("on" + t6, e6);
};
if (this._usePushState ? i3("popstate", this.checkUrl, false) : this._useHashChange && !this.iframe ? i3("hashchange", this.checkUrl, false) : this._wantsHashChange && (this._checkUrlInterval = setInterval(this.checkUrl, this.interval)), !this.options.silent)
return this.loadUrl();
}, stop: function() {
var t5 = window.removeEventListener || function(t6, e5) {
return detachEvent("on" + t6, e5);
};
this._usePushState ? t5("popstate", this.checkUrl, false) : this._useHashChange && !this.iframe && t5("hashchange", this.checkUrl, false), this.iframe && (document.body.removeChild(this.iframe), this.iframe = null), this._checkUrlInterval && clearInterval(this._checkUrlInterval), B.started = false;
}, route: function(t5, e5) {
this.handlers.unshift({ route: t5, callback: e5 });
}, checkUrl: function(t5) {
var e5 = this.getFragment();
if (e5 === this.fragment && this.iframe && (e5 = this.getHash(this.iframe.contentWindow)), e5 === this.fragment)
return false;
this.iframe && this.navigate(e5), this.loadUrl();
}, loadUrl: function(t5) {
return !!this.matchRoot() && (t5 = this.fragment = this.getFragment(t5), n4.some(this.handlers, function(e5) {
if (e5.route.test(t5))
return e5.callback(t5), true;
}));
}, navigate: function(t5, e5) {
if (!B.started)
return false;
e5 && true !== e5 || (e5 = { trigger: !!e5 }), t5 = this.getFragment(t5 || "");
var n5 = this.root;
"" !== t5 && "?" !== t5.charAt(0) || (n5 = n5.slice(0, -1) || "/");
var o4 = n5 + t5;
t5 = t5.replace($, "");
var r3 = this.decodeFragment(t5);
if (this.fragment !== r3) {
if (this.fragment = r3, this._usePushState)
this.history[e5.replace ? "replaceState" : "pushState"]({}, document.title, o4);
else {
if (!this._wantsHashChange)
return this.location.assign(o4);
if (this._updateHash(this.location, t5, e5.replace), this.iframe && t5 !== this.getHash(this.iframe.contentWindow)) {
var i3 = this.iframe.contentWindow;
e5.replace || (i3.document.open(), i3.document.close()), this._updateHash(i3.location, t5, e5.replace);
}
}
return e5.trigger ? this.loadUrl(t5) : void 0;
}
}, _updateHash: function(t5, e5, n5) {
if (n5) {
var o4 = t5.href.replace(/(javascript:|#).*$/, "");
t5.replace(o4 + "#" + e5);
} else
t5.hash = "#" + e5;
} }), e4.history = new B();
var q = function(t5, e5) {
var o4, r3 = this;
return o4 = t5 && n4.has(t5, "constructor") ? t5.constructor : function() {
return r3.apply(this, arguments);
}, n4.extend(o4, r3, e5), o4.prototype = n4.create(r3.prototype, t5), o4.prototype.constructor = o4, o4.__super__ = r3.prototype, o4;
};
y.extend = m.extend = F.extend = k.extend = B.extend = q;
var G = function() {
throw new Error('A "url" property or function must be specified');
}, K = function(t5, e5) {
var n5 = e5.error;
e5.error = function(o4) {
n5 && n5.call(e5.context, t5, o4, e5), t5.trigger("error", t5, o4, e5);
};
};
return e4;
}(s, n3, t3, e3);
}.apply(e2, o2), void 0 === r || (t2.exports = r);
}();
}, 210: (t2, e2, n2) => {
(function(t3) {
t3.extendMode("css", { commentStart: "/*", commentEnd: "*/", newlineAfterToken: function(t4, e4) {
return /^[;{}]$/.test(e4);
} }), t3.extendMode("javascript", { commentStart: "/*", commentEnd: "*/", newlineAfterToken: function(t4, e4, n3, o2) {
return this.jsonMode ? /^[\[,{]$/.test(e4) || /^}/.test(n3) : (";" != e4 || !o2.lexical || ")" != o2.lexical.type) && /^[;{}]$/.test(e4) && !/^;/.test(n3);
} });
var e3 = /^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;
t3.extendMode("xml", { commentStart: "", newlineAfterToken: function(t4, n3, o2, r) {
var i = false;
return "html" == this.configuration && (i = !!r.context && e3.test(r.context.tagName)), !i && ("tag" == t4 && />$/.test(n3) && r.context || /^ -1 && a > -1 && a > s && (t4 = t4.substr(0, s) + t4.substring(s + i.commentStart.length, a) + t4.substr(a + i.commentEnd.length)), r.replaceRange(t4, n3, o2);
}
});
}), t3.defineExtension("autoIndentRange", function(t4, e4) {
var n3 = this;
this.operation(function() {
for (var o2 = t4.line; o2 <= e4.line; o2++)
n3.indentLine(o2, "smart");
});
}), t3.defineExtension("autoFormatRange", function(e4, n3) {
var o2 = this, r = o2.getMode(), i = o2.getRange(e4, n3).split("\n"), s = t3.copyState(r, o2.getTokenAt(e4).state), a = o2.getOption("tabSize"), l = "", c = 0, u = 0 === e4.ch;
function p() {
l += "\n", u = true, ++c;
}
for (var d = 0; d < i.length; ++d) {
for (var f = new t3.StringStream(i[d], a); !f.eol(); ) {
var h = t3.innerMode(r, s), g = r.token(f, s), v = f.current();
f.start = f.pos, u && !/\S/.test(v) || (l += v, u = false), !u && h.mode.newlineAfterToken && h.mode.newlineAfterToken(g, v, f.string.slice(f.pos) || i[d + 1] || "", h.state) && p();
}
!f.pos && r.blankLine && r.blankLine(s), !u && d < i.length - 1 && p();
}
o2.operation(function() {
o2.replaceRange(l, e4, n3);
for (var t4 = e4.line + 1, r2 = e4.line + c; t4 <= r2; ++t4)
o2.indentLine(t4, "smart");
o2.setSelection(e4, o2.getCursor(false));
});
});
})(n2(631));
}, 631: function(t2) {
t2.exports = function() {
var t3 = navigator.userAgent, e2 = navigator.platform, n2 = /gecko\/\d/i.test(t3), o2 = /MSIE \d/.test(t3), r = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t3), i = /Edge\/(\d+)/.exec(t3), s = o2 || r || i, a = s && (o2 ? document.documentMode || 6 : +(i || r)[1]), l = !i && /WebKit\//.test(t3), c = l && /Qt\/\d+\.\d+/.test(t3), u = !i && /Chrome\/(\d+)/.exec(t3), p = u && +u[1], d = /Opera\//.test(t3), f = /Apple Computer/.test(navigator.vendor), h = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t3), g = /PhantomJS/.test(t3), v = f && (/Mobile\/\w+/.test(t3) || navigator.maxTouchPoints > 2), y = /Android/.test(t3), m = v || y || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t3), b = v || /Mac/.test(e2), _ = /\bCrOS\b/.test(t3), w = /win/i.test(e2), x = d && t3.match(/Version\/(\d*\.\d*)/);
x && (x = Number(x[1])), x && x >= 15 && (d = false, l = true);
var C = b && (c || d && (null == x || x < 12.11)), S = n2 || s && a >= 9;
function O(t4) {
return new RegExp("(^|\\s)" + t4 + "(?:$|\\s)\\s*");
}
var T, k = function(t4, e3) {
var n3 = t4.className, o3 = O(e3).exec(n3);
if (o3) {
var r2 = n3.slice(o3.index + o3[0].length);
t4.className = n3.slice(0, o3.index) + (r2 ? o3[1] + r2 : "");
}
};
function P(t4) {
for (var e3 = t4.childNodes.length; e3 > 0; --e3)
t4.removeChild(t4.firstChild);
return t4;
}
function E(t4, e3) {
return P(t4).appendChild(e3);
}
function A(t4, e3, n3, o3) {
var r2 = document.createElement(t4);
if (n3 && (r2.className = n3), o3 && (r2.style.cssText = o3), "string" == typeof e3)
r2.appendChild(document.createTextNode(e3));
else if (e3)
for (var i2 = 0; i2 < e3.length; ++i2)
r2.appendChild(e3[i2]);
return r2;
}
function j(t4, e3, n3, o3) {
var r2 = A(t4, e3, n3, o3);
return r2.setAttribute("role", "presentation"), r2;
}
function M(t4, e3) {
if (3 == e3.nodeType && (e3 = e3.parentNode), t4.contains)
return t4.contains(e3);
do {
if (11 == e3.nodeType && (e3 = e3.host), e3 == t4)
return true;
} while (e3 = e3.parentNode);
}
function L() {
var t4;
try {
t4 = document.activeElement;
} catch (e3) {
t4 = document.body || null;
}
for (; t4 && t4.shadowRoot && t4.shadowRoot.activeElement; )
t4 = t4.shadowRoot.activeElement;
return t4;
}
function D(t4, e3) {
var n3 = t4.className;
O(e3).test(n3) || (t4.className += (n3 ? " " : "") + e3);
}
function N(t4, e3) {
for (var n3 = t4.split(" "), o3 = 0; o3 < n3.length; o3++)
n3[o3] && !O(n3[o3]).test(e3) && (e3 += " " + n3[o3]);
return e3;
}
T = document.createRange ? function(t4, e3, n3, o3) {
var r2 = document.createRange();
return r2.setEnd(o3 || t4, n3), r2.setStart(t4, e3), r2;
} : function(t4, e3, n3) {
var o3 = document.body.createTextRange();
try {
o3.moveToElementText(t4.parentNode);
} catch (t5) {
return o3;
}
return o3.collapse(true), o3.moveEnd("character", n3), o3.moveStart("character", e3), o3;
};
var I = function(t4) {
t4.select();
};
function F(t4) {
var e3 = Array.prototype.slice.call(arguments, 1);
return function() {
return t4.apply(null, e3);
};
}
function V(t4, e3, n3) {
for (var o3 in e3 || (e3 = {}), t4)
!t4.hasOwnProperty(o3) || false === n3 && e3.hasOwnProperty(o3) || (e3[o3] = t4[o3]);
return e3;
}
function R(t4, e3, n3, o3, r2) {
null == e3 && -1 == (e3 = t4.search(/[^\s\u00a0]/)) && (e3 = t4.length);
for (var i2 = o3 || 0, s2 = r2 || 0; ; ) {
var a2 = t4.indexOf(" ", i2);
if (a2 < 0 || a2 >= e3)
return s2 + (e3 - i2);
s2 += a2 - i2, s2 += n3 - s2 % n3, i2 = a2 + 1;
}
}
v ? I = function(t4) {
t4.selectionStart = 0, t4.selectionEnd = t4.value.length;
} : s && (I = function(t4) {
try {
t4.select();
} catch (t5) {
}
});
var H = function() {
this.id = null, this.f = null, this.time = 0, this.handler = F(this.onTimeout, this);
};
function z(t4, e3) {
for (var n3 = 0; n3 < t4.length; ++n3)
if (t4[n3] == e3)
return n3;
return -1;
}
H.prototype.onTimeout = function(t4) {
t4.id = 0, t4.time <= +/* @__PURE__ */ new Date() ? t4.f() : setTimeout(t4.handler, t4.time - +/* @__PURE__ */ new Date());
}, H.prototype.set = function(t4, e3) {
this.f = e3;
var n3 = +/* @__PURE__ */ new Date() + t4;
(!this.id || n3 < this.time) && (clearTimeout(this.id), this.id = setTimeout(this.handler, t4), this.time = n3);
};
var B = 50, U = { toString: function() {
return "CodeMirror.Pass";
} }, W = { scroll: false }, $ = { origin: "*mouse" }, q = { origin: "+move" };
function G(t4, e3, n3) {
for (var o3 = 0, r2 = 0; ; ) {
var i2 = t4.indexOf(" ", o3);
-1 == i2 && (i2 = t4.length);
var s2 = i2 - o3;
if (i2 == t4.length || r2 + s2 >= e3)
return o3 + Math.min(s2, e3 - r2);
if (r2 += i2 - o3, o3 = i2 + 1, (r2 += n3 - r2 % n3) >= e3)
return o3;
}
}
var K = [""];
function Y(t4) {
for (; K.length <= t4; )
K.push(X(K) + " ");
return K[t4];
}
function X(t4) {
return t4[t4.length - 1];
}
function J(t4, e3) {
for (var n3 = [], o3 = 0; o3 < t4.length; o3++)
n3[o3] = e3(t4[o3], o3);
return n3;
}
function Z(t4, e3, n3) {
for (var o3 = 0, r2 = n3(e3); o3 < t4.length && n3(t4[o3]) <= r2; )
o3++;
t4.splice(o3, 0, e3);
}
function Q() {
}
function tt(t4, e3) {
var n3;
return Object.create ? n3 = Object.create(t4) : (Q.prototype = t4, n3 = new Q()), e3 && V(e3, n3), n3;
}
var et = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;
function nt(t4) {
return /\w/.test(t4) || t4 > "" && (t4.toUpperCase() != t4.toLowerCase() || et.test(t4));
}
function ot(t4, e3) {
return e3 ? !!(e3.source.indexOf("\\w") > -1 && nt(t4)) || e3.test(t4) : nt(t4);
}
function rt(t4) {
for (var e3 in t4)
if (t4.hasOwnProperty(e3) && t4[e3])
return false;
return true;
}
var it = /[\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]/;
function st(t4) {
return t4.charCodeAt(0) >= 768 && it.test(t4);
}
function at(t4, e3, n3) {
for (; (n3 < 0 ? e3 > 0 : e3 < t4.length) && st(t4.charAt(e3)); )
e3 += n3;
return e3;
}
function lt(t4, e3, n3) {
for (var o3 = e3 > n3 ? -1 : 1; ; ) {
if (e3 == n3)
return e3;
var r2 = (e3 + n3) / 2, i2 = o3 < 0 ? Math.ceil(r2) : Math.floor(r2);
if (i2 == e3)
return t4(i2) ? e3 : n3;
t4(i2) ? n3 = i2 : e3 = i2 + o3;
}
}
function ct(t4, e3, n3, o3) {
if (!t4)
return o3(e3, n3, "ltr", 0);
for (var r2 = false, i2 = 0; i2 < t4.length; ++i2) {
var s2 = t4[i2];
(s2.from < n3 && s2.to > e3 || e3 == n3 && s2.to == e3) && (o3(Math.max(s2.from, e3), Math.min(s2.to, n3), 1 == s2.level ? "rtl" : "ltr", i2), r2 = true);
}
r2 || o3(e3, n3, "ltr");
}
var ut = null;
function pt(t4, e3, n3) {
var o3;
ut = null;
for (var r2 = 0; r2 < t4.length; ++r2) {
var i2 = t4[r2];
if (i2.from < e3 && i2.to > e3)
return r2;
i2.to == e3 && (i2.from != i2.to && "before" == n3 ? o3 = r2 : ut = r2), i2.from == e3 && (i2.from != i2.to && "before" != n3 ? o3 = r2 : ut = r2);
}
return null != o3 ? o3 : ut;
}
var dt = function() {
var t4 = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN", e3 = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";
function n3(n4) {
return n4 <= 247 ? t4.charAt(n4) : 1424 <= n4 && n4 <= 1524 ? "R" : 1536 <= n4 && n4 <= 1785 ? e3.charAt(n4 - 1536) : 1774 <= n4 && n4 <= 2220 ? "r" : 8192 <= n4 && n4 <= 8203 ? "w" : 8204 == n4 ? "b" : "L";
}
var o3 = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/, r2 = /[stwN]/, i2 = /[LRr]/, s2 = /[Lb1n]/, a2 = /[1n]/;
function l2(t5, e4, n4) {
this.level = t5, this.from = e4, this.to = n4;
}
return function(t5, e4) {
var c2 = "ltr" == e4 ? "L" : "R";
if (0 == t5.length || "ltr" == e4 && !o3.test(t5))
return false;
for (var u2 = t5.length, p2 = [], d2 = 0; d2 < u2; ++d2)
p2.push(n3(t5.charCodeAt(d2)));
for (var f2 = 0, h2 = c2; f2 < u2; ++f2) {
var g2 = p2[f2];
"m" == g2 ? p2[f2] = h2 : h2 = g2;
}
for (var v2 = 0, y2 = c2; v2 < u2; ++v2) {
var m2 = p2[v2];
"1" == m2 && "r" == y2 ? p2[v2] = "n" : i2.test(m2) && (y2 = m2, "r" == m2 && (p2[v2] = "R"));
}
for (var b2 = 1, _2 = p2[0]; b2 < u2 - 1; ++b2) {
var w2 = p2[b2];
"+" == w2 && "1" == _2 && "1" == p2[b2 + 1] ? p2[b2] = "1" : "," != w2 || _2 != p2[b2 + 1] || "1" != _2 && "n" != _2 || (p2[b2] = _2), _2 = w2;
}
for (var x2 = 0; x2 < u2; ++x2) {
var C2 = p2[x2];
if ("," == C2)
p2[x2] = "N";
else if ("%" == C2) {
var S2 = void 0;
for (S2 = x2 + 1; S2 < u2 && "%" == p2[S2]; ++S2)
;
for (var O2 = x2 && "!" == p2[x2 - 1] || S2 < u2 && "1" == p2[S2] ? "1" : "N", T2 = x2; T2 < S2; ++T2)
p2[T2] = O2;
x2 = S2 - 1;
}
}
for (var k2 = 0, P2 = c2; k2 < u2; ++k2) {
var E2 = p2[k2];
"L" == P2 && "1" == E2 ? p2[k2] = "L" : i2.test(E2) && (P2 = E2);
}
for (var A2 = 0; A2 < u2; ++A2)
if (r2.test(p2[A2])) {
var j2 = void 0;
for (j2 = A2 + 1; j2 < u2 && r2.test(p2[j2]); ++j2)
;
for (var M2 = "L" == (A2 ? p2[A2 - 1] : c2), L2 = M2 == ("L" == (j2 < u2 ? p2[j2] : c2)) ? M2 ? "L" : "R" : c2, D2 = A2; D2 < j2; ++D2)
p2[D2] = L2;
A2 = j2 - 1;
}
for (var N2, I2 = [], F2 = 0; F2 < u2; )
if (s2.test(p2[F2])) {
var V2 = F2;
for (++F2; F2 < u2 && s2.test(p2[F2]); ++F2)
;
I2.push(new l2(0, V2, F2));
} else {
var R2 = F2, H2 = I2.length, z2 = "rtl" == e4 ? 1 : 0;
for (++F2; F2 < u2 && "L" != p2[F2]; ++F2)
;
for (var B2 = R2; B2 < F2; )
if (a2.test(p2[B2])) {
R2 < B2 && (I2.splice(H2, 0, new l2(1, R2, B2)), H2 += z2);
var U2 = B2;
for (++B2; B2 < F2 && a2.test(p2[B2]); ++B2)
;
I2.splice(H2, 0, new l2(2, U2, B2)), H2 += z2, R2 = B2;
} else
++B2;
R2 < F2 && I2.splice(H2, 0, new l2(1, R2, F2));
}
return "ltr" == e4 && (1 == I2[0].level && (N2 = t5.match(/^\s+/)) && (I2[0].from = N2[0].length, I2.unshift(new l2(0, 0, N2[0].length))), 1 == X(I2).level && (N2 = t5.match(/\s+$/)) && (X(I2).to -= N2[0].length, I2.push(new l2(0, u2 - N2[0].length, u2)))), "rtl" == e4 ? I2.reverse() : I2;
};
}();
function ft(t4, e3) {
var n3 = t4.order;
return null == n3 && (n3 = t4.order = dt(t4.text, e3)), n3;
}
var ht = [], gt = function(t4, e3, n3) {
if (t4.addEventListener)
t4.addEventListener(e3, n3, false);
else if (t4.attachEvent)
t4.attachEvent("on" + e3, n3);
else {
var o3 = t4._handlers || (t4._handlers = {});
o3[e3] = (o3[e3] || ht).concat(n3);
}
};
function vt(t4, e3) {
return t4._handlers && t4._handlers[e3] || ht;
}
function yt(t4, e3, n3) {
if (t4.removeEventListener)
t4.removeEventListener(e3, n3, false);
else if (t4.detachEvent)
t4.detachEvent("on" + e3, n3);
else {
var o3 = t4._handlers, r2 = o3 && o3[e3];
if (r2) {
var i2 = z(r2, n3);
i2 > -1 && (o3[e3] = r2.slice(0, i2).concat(r2.slice(i2 + 1)));
}
}
}
function mt(t4, e3) {
var n3 = vt(t4, e3);
if (n3.length)
for (var o3 = Array.prototype.slice.call(arguments, 2), r2 = 0; r2 < n3.length; ++r2)
n3[r2].apply(null, o3);
}
function bt(t4, e3, n3) {
return "string" == typeof e3 && (e3 = { type: e3, preventDefault: function() {
this.defaultPrevented = true;
} }), mt(t4, n3 || e3.type, t4, e3), Ot(e3) || e3.codemirrorIgnore;
}
function _t(t4) {
var e3 = t4._handlers && t4._handlers.cursorActivity;
if (e3)
for (var n3 = t4.curOp.cursorActivityHandlers || (t4.curOp.cursorActivityHandlers = []), o3 = 0; o3 < e3.length; ++o3)
-1 == z(n3, e3[o3]) && n3.push(e3[o3]);
}
function wt(t4, e3) {
return vt(t4, e3).length > 0;
}
function xt(t4) {
t4.prototype.on = function(t5, e3) {
gt(this, t5, e3);
}, t4.prototype.off = function(t5, e3) {
yt(this, t5, e3);
};
}
function Ct(t4) {
t4.preventDefault ? t4.preventDefault() : t4.returnValue = false;
}
function St(t4) {
t4.stopPropagation ? t4.stopPropagation() : t4.cancelBubble = true;
}
function Ot(t4) {
return null != t4.defaultPrevented ? t4.defaultPrevented : 0 == t4.returnValue;
}
function Tt(t4) {
Ct(t4), St(t4);
}
function kt(t4) {
return t4.target || t4.srcElement;
}
function Pt(t4) {
var e3 = t4.which;
return null == e3 && (1 & t4.button ? e3 = 1 : 2 & t4.button ? e3 = 3 : 4 & t4.button && (e3 = 2)), b && t4.ctrlKey && 1 == e3 && (e3 = 3), e3;
}
var Et, At, jt = function() {
if (s && a < 9)
return false;
var t4 = A("div");
return "draggable" in t4 || "dragDrop" in t4;
}();
function Mt(t4) {
if (null == Et) {
var e3 = A("span", "");
E(t4, A("span", [e3, document.createTextNode("x")])), 0 != t4.firstChild.offsetHeight && (Et = e3.offsetWidth <= 1 && e3.offsetHeight > 2 && !(s && a < 8));
}
var n3 = Et ? A("span", "") : A("span", " ", null, "display: inline-block; width: 1px; margin-right: -1px");
return n3.setAttribute("cm-text", ""), n3;
}
function Lt(t4) {
if (null != At)
return At;
var e3 = E(t4, document.createTextNode("AخA")), n3 = T(e3, 0, 1).getBoundingClientRect(), o3 = T(e3, 1, 2).getBoundingClientRect();
return P(t4), !(!n3 || n3.left == n3.right) && (At = o3.right - n3.right < 3);
}
var Dt, Nt = 3 != "\n\nb".split(/\n/).length ? function(t4) {
for (var e3 = 0, n3 = [], o3 = t4.length; e3 <= o3; ) {
var r2 = t4.indexOf("\n", e3);
-1 == r2 && (r2 = t4.length);
var i2 = t4.slice(e3, "\r" == t4.charAt(r2 - 1) ? r2 - 1 : r2), s2 = i2.indexOf("\r");
-1 != s2 ? (n3.push(i2.slice(0, s2)), e3 += s2 + 1) : (n3.push(i2), e3 = r2 + 1);
}
return n3;
} : function(t4) {
return t4.split(/\r\n?|\n/);
}, It = window.getSelection ? function(t4) {
try {
return t4.selectionStart != t4.selectionEnd;
} catch (t5) {
return false;
}
} : function(t4) {
var e3;
try {
e3 = t4.ownerDocument.selection.createRange();
} catch (t5) {
}
return !(!e3 || e3.parentElement() != t4) && 0 != e3.compareEndPoints("StartToEnd", e3);
}, Ft = "oncopy" in (Dt = A("div")) || (Dt.setAttribute("oncopy", "return;"), "function" == typeof Dt.oncopy), Vt = null;
function Rt(t4) {
if (null != Vt)
return Vt;
var e3 = E(t4, A("span", "x")), n3 = e3.getBoundingClientRect(), o3 = T(e3, 0, 1).getBoundingClientRect();
return Vt = Math.abs(n3.left - o3.left) > 1;
}
var Ht = {}, zt = {};
function Bt(t4, e3) {
arguments.length > 2 && (e3.dependencies = Array.prototype.slice.call(arguments, 2)), Ht[t4] = e3;
}
function Ut(t4, e3) {
zt[t4] = e3;
}
function Wt(t4) {
if ("string" == typeof t4 && zt.hasOwnProperty(t4))
t4 = zt[t4];
else if (t4 && "string" == typeof t4.name && zt.hasOwnProperty(t4.name)) {
var e3 = zt[t4.name];
"string" == typeof e3 && (e3 = { name: e3 }), (t4 = tt(e3, t4)).name = e3.name;
} else {
if ("string" == typeof t4 && /^[\w\-]+\/[\w\-]+\+xml$/.test(t4))
return Wt("application/xml");
if ("string" == typeof t4 && /^[\w\-]+\/[\w\-]+\+json$/.test(t4))
return Wt("application/json");
}
return "string" == typeof t4 ? { name: t4 } : t4 || { name: "null" };
}
function $t(t4, e3) {
e3 = Wt(e3);
var n3 = Ht[e3.name];
if (!n3)
return $t(t4, "text/plain");
var o3 = n3(t4, e3);
if (qt.hasOwnProperty(e3.name)) {
var r2 = qt[e3.name];
for (var i2 in r2)
r2.hasOwnProperty(i2) && (o3.hasOwnProperty(i2) && (o3["_" + i2] = o3[i2]), o3[i2] = r2[i2]);
}
if (o3.name = e3.name, e3.helperType && (o3.helperType = e3.helperType), e3.modeProps)
for (var s2 in e3.modeProps)
o3[s2] = e3.modeProps[s2];
return o3;
}
var qt = {};
function Gt(t4, e3) {
V(e3, qt.hasOwnProperty(t4) ? qt[t4] : qt[t4] = {});
}
function Kt(t4, e3) {
if (true === e3)
return e3;
if (t4.copyState)
return t4.copyState(e3);
var n3 = {};
for (var o3 in e3) {
var r2 = e3[o3];
r2 instanceof Array && (r2 = r2.concat([])), n3[o3] = r2;
}
return n3;
}
function Yt(t4, e3) {
for (var n3; t4.innerMode && (n3 = t4.innerMode(e3)) && n3.mode != t4; )
e3 = n3.state, t4 = n3.mode;
return n3 || { mode: t4, state: e3 };
}
function Xt(t4, e3, n3) {
return !t4.startState || t4.startState(e3, n3);
}
var Jt = function(t4, e3, n3) {
this.pos = this.start = 0, this.string = t4, this.tabSize = e3 || 8, this.lastColumnPos = this.lastColumnValue = 0, this.lineStart = 0, this.lineOracle = n3;
};
function Zt(t4, e3) {
if ((e3 -= t4.first) < 0 || e3 >= t4.size)
throw new Error("There is no line " + (e3 + t4.first) + " in the document.");
for (var n3 = t4; !n3.lines; )
for (var o3 = 0; ; ++o3) {
var r2 = n3.children[o3], i2 = r2.chunkSize();
if (e3 < i2) {
n3 = r2;
break;
}
e3 -= i2;
}
return n3.lines[e3];
}
function Qt(t4, e3, n3) {
var o3 = [], r2 = e3.line;
return t4.iter(e3.line, n3.line + 1, function(t5) {
var i2 = t5.text;
r2 == n3.line && (i2 = i2.slice(0, n3.ch)), r2 == e3.line && (i2 = i2.slice(e3.ch)), o3.push(i2), ++r2;
}), o3;
}
function te(t4, e3, n3) {
var o3 = [];
return t4.iter(e3, n3, function(t5) {
o3.push(t5.text);
}), o3;
}
function ee(t4, e3) {
var n3 = e3 - t4.height;
if (n3)
for (var o3 = t4; o3; o3 = o3.parent)
o3.height += n3;
}
function ne(t4) {
if (null == t4.parent)
return null;
for (var e3 = t4.parent, n3 = z(e3.lines, t4), o3 = e3.parent; o3; e3 = o3, o3 = o3.parent)
for (var r2 = 0; o3.children[r2] != e3; ++r2)
n3 += o3.children[r2].chunkSize();
return n3 + e3.first;
}
function oe(t4, e3) {
var n3 = t4.first;
t:
do {
for (var o3 = 0; o3 < t4.children.length; ++o3) {
var r2 = t4.children[o3], i2 = r2.height;
if (e3 < i2) {
t4 = r2;
continue t;
}
e3 -= i2, n3 += r2.chunkSize();
}
return n3;
} while (!t4.lines);
for (var s2 = 0; s2 < t4.lines.length; ++s2) {
var a2 = t4.lines[s2].height;
if (e3 < a2)
break;
e3 -= a2;
}
return n3 + s2;
}
function re(t4, e3) {
return e3 >= t4.first && e3 < t4.first + t4.size;
}
function ie(t4, e3) {
return String(t4.lineNumberFormatter(e3 + t4.firstLineNumber));
}
function se(t4, e3, n3) {
if (void 0 === n3 && (n3 = null), !(this instanceof se))
return new se(t4, e3, n3);
this.line = t4, this.ch = e3, this.sticky = n3;
}
function ae(t4, e3) {
return t4.line - e3.line || t4.ch - e3.ch;
}
function le(t4, e3) {
return t4.sticky == e3.sticky && 0 == ae(t4, e3);
}
function ce(t4) {
return se(t4.line, t4.ch);
}
function ue(t4, e3) {
return ae(t4, e3) < 0 ? e3 : t4;
}
function pe(t4, e3) {
return ae(t4, e3) < 0 ? t4 : e3;
}
function de(t4, e3) {
return Math.max(t4.first, Math.min(e3, t4.first + t4.size - 1));
}
function fe(t4, e3) {
if (e3.line < t4.first)
return se(t4.first, 0);
var n3 = t4.first + t4.size - 1;
return e3.line > n3 ? se(n3, Zt(t4, n3).text.length) : he(e3, Zt(t4, e3.line).text.length);
}
function he(t4, e3) {
var n3 = t4.ch;
return null == n3 || n3 > e3 ? se(t4.line, e3) : n3 < 0 ? se(t4.line, 0) : t4;
}
function ge(t4, e3) {
for (var n3 = [], o3 = 0; o3 < e3.length; o3++)
n3[o3] = fe(t4, e3[o3]);
return n3;
}
Jt.prototype.eol = function() {
return this.pos >= this.string.length;
}, Jt.prototype.sol = function() {
return this.pos == this.lineStart;
}, Jt.prototype.peek = function() {
return this.string.charAt(this.pos) || void 0;
}, Jt.prototype.next = function() {
if (this.pos < this.string.length)
return this.string.charAt(this.pos++);
}, Jt.prototype.eat = function(t4) {
var e3 = this.string.charAt(this.pos);
if ("string" == typeof t4 ? e3 == t4 : e3 && (t4.test ? t4.test(e3) : t4(e3)))
return ++this.pos, e3;
}, Jt.prototype.eatWhile = function(t4) {
for (var e3 = this.pos; this.eat(t4); )
;
return this.pos > e3;
}, Jt.prototype.eatSpace = function() {
for (var t4 = this.pos; /[\s\u00a0]/.test(this.string.charAt(this.pos)); )
++this.pos;
return this.pos > t4;
}, Jt.prototype.skipToEnd = function() {
this.pos = this.string.length;
}, Jt.prototype.skipTo = function(t4) {
var e3 = this.string.indexOf(t4, this.pos);
if (e3 > -1)
return this.pos = e3, true;
}, Jt.prototype.backUp = function(t4) {
this.pos -= t4;
}, Jt.prototype.column = function() {
return this.lastColumnPos < this.start && (this.lastColumnValue = R(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue), this.lastColumnPos = this.start), this.lastColumnValue - (this.lineStart ? R(this.string, this.lineStart, this.tabSize) : 0);
}, Jt.prototype.indentation = function() {
return R(this.string, null, this.tabSize) - (this.lineStart ? R(this.string, this.lineStart, this.tabSize) : 0);
}, Jt.prototype.match = function(t4, e3, n3) {
if ("string" != typeof t4) {
var o3 = this.string.slice(this.pos).match(t4);
return o3 && o3.index > 0 ? null : (o3 && false !== e3 && (this.pos += o3[0].length), o3);
}
var r2 = function(t5) {
return n3 ? t5.toLowerCase() : t5;
};
if (r2(this.string.substr(this.pos, t4.length)) == r2(t4))
return false !== e3 && (this.pos += t4.length), true;
}, Jt.prototype.current = function() {
return this.string.slice(this.start, this.pos);
}, Jt.prototype.hideFirstChars = function(t4, e3) {
this.lineStart += t4;
try {
return e3();
} finally {
this.lineStart -= t4;
}
}, Jt.prototype.lookAhead = function(t4) {
var e3 = this.lineOracle;
return e3 && e3.lookAhead(t4);
}, Jt.prototype.baseToken = function() {
var t4 = this.lineOracle;
return t4 && t4.baseToken(this.pos);
};
var ve = function(t4, e3) {
this.state = t4, this.lookAhead = e3;
}, ye = function(t4, e3, n3, o3) {
this.state = e3, this.doc = t4, this.line = n3, this.maxLookAhead = o3 || 0, this.baseTokens = null, this.baseTokenPos = 1;
};
function me(t4, e3, n3, o3) {
var r2 = [t4.state.modeGen], i2 = {};
ke(t4, e3.text, t4.doc.mode, n3, function(t5, e4) {
return r2.push(t5, e4);
}, i2, o3);
for (var s2 = n3.state, a2 = function(o4) {
n3.baseTokens = r2;
var a3 = t4.state.overlays[o4], l3 = 1, c2 = 0;
n3.state = true, ke(t4, e3.text, a3.mode, n3, function(t5, e4) {
for (var n4 = l3; c2 < t5; ) {
var o5 = r2[l3];
o5 > t5 && r2.splice(l3, 1, t5, r2[l3 + 1], o5), l3 += 2, c2 = Math.min(t5, o5);
}
if (e4)
if (a3.opaque)
r2.splice(n4, l3 - n4, t5, "overlay " + e4), l3 = n4 + 2;
else
for (; n4 < l3; n4 += 2) {
var i3 = r2[n4 + 1];
r2[n4 + 1] = (i3 ? i3 + " " : "") + "overlay " + e4;
}
}, i2), n3.state = s2, n3.baseTokens = null, n3.baseTokenPos = 1;
}, l2 = 0; l2 < t4.state.overlays.length; ++l2)
a2(l2);
return { styles: r2, classes: i2.bgClass || i2.textClass ? i2 : null };
}
function be(t4, e3, n3) {
if (!e3.styles || e3.styles[0] != t4.state.modeGen) {
var o3 = _e(t4, ne(e3)), r2 = e3.text.length > t4.options.maxHighlightLength && Kt(t4.doc.mode, o3.state), i2 = me(t4, e3, o3);
r2 && (o3.state = r2), e3.stateAfter = o3.save(!r2), e3.styles = i2.styles, i2.classes ? e3.styleClasses = i2.classes : e3.styleClasses && (e3.styleClasses = null), n3 === t4.doc.highlightFrontier && (t4.doc.modeFrontier = Math.max(t4.doc.modeFrontier, ++t4.doc.highlightFrontier));
}
return e3.styles;
}
function _e(t4, e3, n3) {
var o3 = t4.doc, r2 = t4.display;
if (!o3.mode.startState)
return new ye(o3, true, e3);
var i2 = Pe(t4, e3, n3), s2 = i2 > o3.first && Zt(o3, i2 - 1).stateAfter, a2 = s2 ? ye.fromSaved(o3, s2, i2) : new ye(o3, Xt(o3.mode), i2);
return o3.iter(i2, e3, function(n4) {
we(t4, n4.text, a2);
var o4 = a2.line;
n4.stateAfter = o4 == e3 - 1 || o4 % 5 == 0 || o4 >= r2.viewFrom && o4 < r2.viewTo ? a2.save() : null, a2.nextLine();
}), n3 && (o3.modeFrontier = a2.line), a2;
}
function we(t4, e3, n3, o3) {
var r2 = t4.doc.mode, i2 = new Jt(e3, t4.options.tabSize, n3);
for (i2.start = i2.pos = o3 || 0, "" == e3 && xe(r2, n3.state); !i2.eol(); )
Ce(r2, i2, n3.state), i2.start = i2.pos;
}
function xe(t4, e3) {
if (t4.blankLine)
return t4.blankLine(e3);
if (t4.innerMode) {
var n3 = Yt(t4, e3);
return n3.mode.blankLine ? n3.mode.blankLine(n3.state) : void 0;
}
}
function Ce(t4, e3, n3, o3) {
for (var r2 = 0; r2 < 10; r2++) {
o3 && (o3[0] = Yt(t4, n3).mode);
var i2 = t4.token(e3, n3);
if (e3.pos > e3.start)
return i2;
}
throw new Error("Mode " + t4.name + " failed to advance stream.");
}
ye.prototype.lookAhead = function(t4) {
var e3 = this.doc.getLine(this.line + t4);
return null != e3 && t4 > this.maxLookAhead && (this.maxLookAhead = t4), e3;
}, ye.prototype.baseToken = function(t4) {
if (!this.baseTokens)
return null;
for (; this.baseTokens[this.baseTokenPos] <= t4; )
this.baseTokenPos += 2;
var e3 = this.baseTokens[this.baseTokenPos + 1];
return { type: e3 && e3.replace(/( |^)overlay .*/, ""), size: this.baseTokens[this.baseTokenPos] - t4 };
}, ye.prototype.nextLine = function() {
this.line++, this.maxLookAhead > 0 && this.maxLookAhead--;
}, ye.fromSaved = function(t4, e3, n3) {
return e3 instanceof ve ? new ye(t4, Kt(t4.mode, e3.state), n3, e3.lookAhead) : new ye(t4, Kt(t4.mode, e3), n3);
}, ye.prototype.save = function(t4) {
var e3 = false !== t4 ? Kt(this.doc.mode, this.state) : this.state;
return this.maxLookAhead > 0 ? new ve(e3, this.maxLookAhead) : e3;
};
var Se = function(t4, e3, n3) {
this.start = t4.start, this.end = t4.pos, this.string = t4.current(), this.type = e3 || null, this.state = n3;
};
function Oe(t4, e3, n3, o3) {
var r2, i2, s2 = t4.doc, a2 = s2.mode, l2 = Zt(s2, (e3 = fe(s2, e3)).line), c2 = _e(t4, e3.line, n3), u2 = new Jt(l2.text, t4.options.tabSize, c2);
for (o3 && (i2 = []); (o3 || u2.pos < e3.ch) && !u2.eol(); )
u2.start = u2.pos, r2 = Ce(a2, u2, c2.state), o3 && i2.push(new Se(u2, r2, Kt(s2.mode, c2.state)));
return o3 ? i2 : new Se(u2, r2, c2.state);
}
function Te(t4, e3) {
if (t4)
for (; ; ) {
var n3 = t4.match(/(?:^|\s+)line-(background-)?(\S+)/);
if (!n3)
break;
t4 = t4.slice(0, n3.index) + t4.slice(n3.index + n3[0].length);
var o3 = n3[1] ? "bgClass" : "textClass";
null == e3[o3] ? e3[o3] = n3[2] : new RegExp("(?:^|\\s)" + n3[2] + "(?:$|\\s)").test(e3[o3]) || (e3[o3] += " " + n3[2]);
}
return t4;
}
function ke(t4, e3, n3, o3, r2, i2, s2) {
var a2 = n3.flattenSpans;
null == a2 && (a2 = t4.options.flattenSpans);
var l2, c2 = 0, u2 = null, p2 = new Jt(e3, t4.options.tabSize, o3), d2 = t4.options.addModeClass && [null];
for ("" == e3 && Te(xe(n3, o3.state), i2); !p2.eol(); ) {
if (p2.pos > t4.options.maxHighlightLength ? (a2 = false, s2 && we(t4, e3, o3, p2.pos), p2.pos = e3.length, l2 = null) : l2 = Te(Ce(n3, p2, o3.state, d2), i2), d2) {
var f2 = d2[0].name;
f2 && (l2 = "m-" + (l2 ? f2 + " " + l2 : f2));
}
if (!a2 || u2 != l2) {
for (; c2 < p2.start; )
r2(c2 = Math.min(p2.start, c2 + 5e3), u2);
u2 = l2;
}
p2.start = p2.pos;
}
for (; c2 < p2.pos; ) {
var h2 = Math.min(p2.pos, c2 + 5e3);
r2(h2, u2), c2 = h2;
}
}
function Pe(t4, e3, n3) {
for (var o3, r2, i2 = t4.doc, s2 = n3 ? -1 : e3 - (t4.doc.mode.innerMode ? 1e3 : 100), a2 = e3; a2 > s2; --a2) {
if (a2 <= i2.first)
return i2.first;
var l2 = Zt(i2, a2 - 1), c2 = l2.stateAfter;
if (c2 && (!n3 || a2 + (c2 instanceof ve ? c2.lookAhead : 0) <= i2.modeFrontier))
return a2;
var u2 = R(l2.text, null, t4.options.tabSize);
(null == r2 || o3 > u2) && (r2 = a2 - 1, o3 = u2);
}
return r2;
}
function Ee(t4, e3) {
if (t4.modeFrontier = Math.min(t4.modeFrontier, e3), !(t4.highlightFrontier < e3 - 10)) {
for (var n3 = t4.first, o3 = e3 - 1; o3 > n3; o3--) {
var r2 = Zt(t4, o3).stateAfter;
if (r2 && (!(r2 instanceof ve) || o3 + r2.lookAhead < e3)) {
n3 = o3 + 1;
break;
}
}
t4.highlightFrontier = Math.min(t4.highlightFrontier, n3);
}
}
var Ae = false, je = false;
function Me() {
Ae = true;
}
function Le() {
je = true;
}
function De(t4, e3, n3) {
this.marker = t4, this.from = e3, this.to = n3;
}
function Ne(t4, e3) {
if (t4)
for (var n3 = 0; n3 < t4.length; ++n3) {
var o3 = t4[n3];
if (o3.marker == e3)
return o3;
}
}
function Ie(t4, e3) {
for (var n3, o3 = 0; o3 < t4.length; ++o3)
t4[o3] != e3 && (n3 || (n3 = [])).push(t4[o3]);
return n3;
}
function Fe(t4, e3, n3) {
var o3 = n3 && window.WeakSet && (n3.markedSpans || (n3.markedSpans = /* @__PURE__ */ new WeakSet()));
o3 && t4.markedSpans && o3.has(t4.markedSpans) ? t4.markedSpans.push(e3) : (t4.markedSpans = t4.markedSpans ? t4.markedSpans.concat([e3]) : [e3], o3 && o3.add(t4.markedSpans)), e3.marker.attachLine(t4);
}
function Ve(t4, e3, n3) {
var o3;
if (t4)
for (var r2 = 0; r2 < t4.length; ++r2) {
var i2 = t4[r2], s2 = i2.marker;
if (null == i2.from || (s2.inclusiveLeft ? i2.from <= e3 : i2.from < e3) || i2.from == e3 && "bookmark" == s2.type && (!n3 || !i2.marker.insertLeft)) {
var a2 = null == i2.to || (s2.inclusiveRight ? i2.to >= e3 : i2.to > e3);
(o3 || (o3 = [])).push(new De(s2, i2.from, a2 ? null : i2.to));
}
}
return o3;
}
function Re(t4, e3, n3) {
var o3;
if (t4)
for (var r2 = 0; r2 < t4.length; ++r2) {
var i2 = t4[r2], s2 = i2.marker;
if (null == i2.to || (s2.inclusiveRight ? i2.to >= e3 : i2.to > e3) || i2.from == e3 && "bookmark" == s2.type && (!n3 || i2.marker.insertLeft)) {
var a2 = null == i2.from || (s2.inclusiveLeft ? i2.from <= e3 : i2.from < e3);
(o3 || (o3 = [])).push(new De(s2, a2 ? null : i2.from - e3, null == i2.to ? null : i2.to - e3));
}
}
return o3;
}
function He(t4, e3) {
if (e3.full)
return null;
var n3 = re(t4, e3.from.line) && Zt(t4, e3.from.line).markedSpans, o3 = re(t4, e3.to.line) && Zt(t4, e3.to.line).markedSpans;
if (!n3 && !o3)
return null;
var r2 = e3.from.ch, i2 = e3.to.ch, s2 = 0 == ae(e3.from, e3.to), a2 = Ve(n3, r2, s2), l2 = Re(o3, i2, s2), c2 = 1 == e3.text.length, u2 = X(e3.text).length + (c2 ? r2 : 0);
if (a2)
for (var p2 = 0; p2 < a2.length; ++p2) {
var d2 = a2[p2];
if (null == d2.to) {
var f2 = Ne(l2, d2.marker);
f2 ? c2 && (d2.to = null == f2.to ? null : f2.to + u2) : d2.to = r2;
}
}
if (l2)
for (var h2 = 0; h2 < l2.length; ++h2) {
var g2 = l2[h2];
null != g2.to && (g2.to += u2), null == g2.from ? Ne(a2, g2.marker) || (g2.from = u2, c2 && (a2 || (a2 = [])).push(g2)) : (g2.from += u2, c2 && (a2 || (a2 = [])).push(g2));
}
a2 && (a2 = ze(a2)), l2 && l2 != a2 && (l2 = ze(l2));
var v2 = [a2];
if (!c2) {
var y2, m2 = e3.text.length - 2;
if (m2 > 0 && a2)
for (var b2 = 0; b2 < a2.length; ++b2)
null == a2[b2].to && (y2 || (y2 = [])).push(new De(a2[b2].marker, null, null));
for (var _2 = 0; _2 < m2; ++_2)
v2.push(y2);
v2.push(l2);
}
return v2;
}
function ze(t4) {
for (var e3 = 0; e3 < t4.length; ++e3) {
var n3 = t4[e3];
null != n3.from && n3.from == n3.to && false !== n3.marker.clearWhenEmpty && t4.splice(e3--, 1);
}
return t4.length ? t4 : null;
}
function Be(t4, e3, n3) {
var o3 = null;
if (t4.iter(e3.line, n3.line + 1, function(t5) {
if (t5.markedSpans)
for (var e4 = 0; e4 < t5.markedSpans.length; ++e4) {
var n4 = t5.markedSpans[e4].marker;
!n4.readOnly || o3 && -1 != z(o3, n4) || (o3 || (o3 = [])).push(n4);
}
}), !o3)
return null;
for (var r2 = [{ from: e3, to: n3 }], i2 = 0; i2 < o3.length; ++i2)
for (var s2 = o3[i2], a2 = s2.find(0), l2 = 0; l2 < r2.length; ++l2) {
var c2 = r2[l2];
if (!(ae(c2.to, a2.from) < 0 || ae(c2.from, a2.to) > 0)) {
var u2 = [l2, 1], p2 = ae(c2.from, a2.from), d2 = ae(c2.to, a2.to);
(p2 < 0 || !s2.inclusiveLeft && !p2) && u2.push({ from: c2.from, to: a2.from }), (d2 > 0 || !s2.inclusiveRight && !d2) && u2.push({ from: a2.to, to: c2.to }), r2.splice.apply(r2, u2), l2 += u2.length - 3;
}
}
return r2;
}
function Ue(t4) {
var e3 = t4.markedSpans;
if (e3) {
for (var n3 = 0; n3 < e3.length; ++n3)
e3[n3].marker.detachLine(t4);
t4.markedSpans = null;
}
}
function We(t4, e3) {
if (e3) {
for (var n3 = 0; n3 < e3.length; ++n3)
e3[n3].marker.attachLine(t4);
t4.markedSpans = e3;
}
}
function $e(t4) {
return t4.inclusiveLeft ? -1 : 0;
}
function qe(t4) {
return t4.inclusiveRight ? 1 : 0;
}
function Ge(t4, e3) {
var n3 = t4.lines.length - e3.lines.length;
if (0 != n3)
return n3;
var o3 = t4.find(), r2 = e3.find(), i2 = ae(o3.from, r2.from) || $e(t4) - $e(e3);
if (i2)
return -i2;
var s2 = ae(o3.to, r2.to) || qe(t4) - qe(e3);
return s2 || e3.id - t4.id;
}
function Ke(t4, e3) {
var n3, o3 = je && t4.markedSpans;
if (o3)
for (var r2 = void 0, i2 = 0; i2 < o3.length; ++i2)
(r2 = o3[i2]).marker.collapsed && null == (e3 ? r2.from : r2.to) && (!n3 || Ge(n3, r2.marker) < 0) && (n3 = r2.marker);
return n3;
}
function Ye(t4) {
return Ke(t4, true);
}
function Xe(t4) {
return Ke(t4, false);
}
function Je(t4, e3) {
var n3, o3 = je && t4.markedSpans;
if (o3)
for (var r2 = 0; r2 < o3.length; ++r2) {
var i2 = o3[r2];
i2.marker.collapsed && (null == i2.from || i2.from < e3) && (null == i2.to || i2.to > e3) && (!n3 || Ge(n3, i2.marker) < 0) && (n3 = i2.marker);
}
return n3;
}
function Ze(t4, e3, n3, o3, r2) {
var i2 = Zt(t4, e3), s2 = je && i2.markedSpans;
if (s2)
for (var a2 = 0; a2 < s2.length; ++a2) {
var l2 = s2[a2];
if (l2.marker.collapsed) {
var c2 = l2.marker.find(0), u2 = ae(c2.from, n3) || $e(l2.marker) - $e(r2), p2 = ae(c2.to, o3) || qe(l2.marker) - qe(r2);
if (!(u2 >= 0 && p2 <= 0 || u2 <= 0 && p2 >= 0) && (u2 <= 0 && (l2.marker.inclusiveRight && r2.inclusiveLeft ? ae(c2.to, n3) >= 0 : ae(c2.to, n3) > 0) || u2 >= 0 && (l2.marker.inclusiveRight && r2.inclusiveLeft ? ae(c2.from, o3) <= 0 : ae(c2.from, o3) < 0)))
return true;
}
}
}
function Qe(t4) {
for (var e3; e3 = Ye(t4); )
t4 = e3.find(-1, true).line;
return t4;
}
function tn(t4) {
for (var e3; e3 = Xe(t4); )
t4 = e3.find(1, true).line;
return t4;
}
function en(t4) {
for (var e3, n3; e3 = Xe(t4); )
t4 = e3.find(1, true).line, (n3 || (n3 = [])).push(t4);
return n3;
}
function nn(t4, e3) {
var n3 = Zt(t4, e3), o3 = Qe(n3);
return n3 == o3 ? e3 : ne(o3);
}
function on(t4, e3) {
if (e3 > t4.lastLine())
return e3;
var n3, o3 = Zt(t4, e3);
if (!rn(t4, o3))
return e3;
for (; n3 = Xe(o3); )
o3 = n3.find(1, true).line;
return ne(o3) + 1;
}
function rn(t4, e3) {
var n3 = je && e3.markedSpans;
if (n3) {
for (var o3 = void 0, r2 = 0; r2 < n3.length; ++r2)
if ((o3 = n3[r2]).marker.collapsed) {
if (null == o3.from)
return true;
if (!o3.marker.widgetNode && 0 == o3.from && o3.marker.inclusiveLeft && sn(t4, e3, o3))
return true;
}
}
}
function sn(t4, e3, n3) {
if (null == n3.to) {
var o3 = n3.marker.find(1, true);
return sn(t4, o3.line, Ne(o3.line.markedSpans, n3.marker));
}
if (n3.marker.inclusiveRight && n3.to == e3.text.length)
return true;
for (var r2 = void 0, i2 = 0; i2 < e3.markedSpans.length; ++i2)
if ((r2 = e3.markedSpans[i2]).marker.collapsed && !r2.marker.widgetNode && r2.from == n3.to && (null == r2.to || r2.to != n3.from) && (r2.marker.inclusiveLeft || n3.marker.inclusiveRight) && sn(t4, e3, r2))
return true;
}
function an(t4) {
for (var e3 = 0, n3 = (t4 = Qe(t4)).parent, o3 = 0; o3 < n3.lines.length; ++o3) {
var r2 = n3.lines[o3];
if (r2 == t4)
break;
e3 += r2.height;
}
for (var i2 = n3.parent; i2; i2 = (n3 = i2).parent)
for (var s2 = 0; s2 < i2.children.length; ++s2) {
var a2 = i2.children[s2];
if (a2 == n3)
break;
e3 += a2.height;
}
return e3;
}
function ln(t4) {
if (0 == t4.height)
return 0;
for (var e3, n3 = t4.text.length, o3 = t4; e3 = Ye(o3); ) {
var r2 = e3.find(0, true);
o3 = r2.from.line, n3 += r2.from.ch - r2.to.ch;
}
for (o3 = t4; e3 = Xe(o3); ) {
var i2 = e3.find(0, true);
n3 -= o3.text.length - i2.from.ch, n3 += (o3 = i2.to.line).text.length - i2.to.ch;
}
return n3;
}
function cn(t4) {
var e3 = t4.display, n3 = t4.doc;
e3.maxLine = Zt(n3, n3.first), e3.maxLineLength = ln(e3.maxLine), e3.maxLineChanged = true, n3.iter(function(t5) {
var n4 = ln(t5);
n4 > e3.maxLineLength && (e3.maxLineLength = n4, e3.maxLine = t5);
});
}
var un = function(t4, e3, n3) {
this.text = t4, We(this, e3), this.height = n3 ? n3(this) : 1;
};
function pn(t4, e3, n3, o3) {
t4.text = e3, t4.stateAfter && (t4.stateAfter = null), t4.styles && (t4.styles = null), null != t4.order && (t4.order = null), Ue(t4), We(t4, n3);
var r2 = o3 ? o3(t4) : 1;
r2 != t4.height && ee(t4, r2);
}
function dn(t4) {
t4.parent = null, Ue(t4);
}
un.prototype.lineNo = function() {
return ne(this);
}, xt(un);
var fn = {}, hn = {};
function gn(t4, e3) {
if (!t4 || /^\s*$/.test(t4))
return null;
var n3 = e3.addModeClass ? hn : fn;
return n3[t4] || (n3[t4] = t4.replace(/\S+/g, "cm-$&"));
}
function vn(t4, e3) {
var n3 = j("span", null, null, l ? "padding-right: .1px" : null), o3 = { pre: j("pre", [n3], "CodeMirror-line"), content: n3, col: 0, pos: 0, cm: t4, trailingSpace: false, splitSpaces: t4.getOption("lineWrapping") };
e3.measure = {};
for (var r2 = 0; r2 <= (e3.rest ? e3.rest.length : 0); r2++) {
var i2 = r2 ? e3.rest[r2 - 1] : e3.line, s2 = void 0;
o3.pos = 0, o3.addToken = mn, Lt(t4.display.measure) && (s2 = ft(i2, t4.doc.direction)) && (o3.addToken = _n(o3.addToken, s2)), o3.map = [], xn(i2, o3, be(t4, i2, e3 != t4.display.externalMeasured && ne(i2))), i2.styleClasses && (i2.styleClasses.bgClass && (o3.bgClass = N(i2.styleClasses.bgClass, o3.bgClass || "")), i2.styleClasses.textClass && (o3.textClass = N(i2.styleClasses.textClass, o3.textClass || ""))), 0 == o3.map.length && o3.map.push(0, 0, o3.content.appendChild(Mt(t4.display.measure))), 0 == r2 ? (e3.measure.map = o3.map, e3.measure.cache = {}) : ((e3.measure.maps || (e3.measure.maps = [])).push(o3.map), (e3.measure.caches || (e3.measure.caches = [])).push({}));
}
if (l) {
var a2 = o3.content.lastChild;
(/\bcm-tab\b/.test(a2.className) || a2.querySelector && a2.querySelector(".cm-tab")) && (o3.content.className = "cm-tab-wrap-hack");
}
return mt(t4, "renderLine", t4, e3.line, o3.pre), o3.pre.className && (o3.textClass = N(o3.pre.className, o3.textClass || "")), o3;
}
function yn(t4) {
var e3 = A("span", "•", "cm-invalidchar");
return e3.title = "\\u" + t4.charCodeAt(0).toString(16), e3.setAttribute("aria-label", e3.title), e3;
}
function mn(t4, e3, n3, o3, r2, i2, l2) {
if (e3) {
var c2, u2 = t4.splitSpaces ? bn(e3, t4.trailingSpace) : e3, p2 = t4.cm.state.specialChars, d2 = false;
if (p2.test(e3)) {
c2 = document.createDocumentFragment();
for (var f2 = 0; 1; ) {
p2.lastIndex = f2;
var h2 = p2.exec(e3), g2 = h2 ? h2.index - f2 : e3.length - f2;
if (g2) {
var v2 = document.createTextNode(u2.slice(f2, f2 + g2));
s && a < 9 ? c2.appendChild(A("span", [v2])) : c2.appendChild(v2), t4.map.push(t4.pos, t4.pos + g2, v2), t4.col += g2, t4.pos += g2;
}
if (!h2)
break;
f2 += g2 + 1;
var y2 = void 0;
if (" " == h2[0]) {
var m2 = t4.cm.options.tabSize, b2 = m2 - t4.col % m2;
(y2 = c2.appendChild(A("span", Y(b2), "cm-tab"))).setAttribute("role", "presentation"), y2.setAttribute("cm-text", " "), t4.col += b2;
} else
"\r" == h2[0] || "\n" == h2[0] ? ((y2 = c2.appendChild(A("span", "\r" == h2[0] ? "␍" : "", "cm-invalidchar"))).setAttribute("cm-text", h2[0]), t4.col += 1) : ((y2 = t4.cm.options.specialCharPlaceholder(h2[0])).setAttribute("cm-text", h2[0]), s && a < 9 ? c2.appendChild(A("span", [y2])) : c2.appendChild(y2), t4.col += 1);
t4.map.push(t4.pos, t4.pos + 1, y2), t4.pos++;
}
} else
t4.col += e3.length, c2 = document.createTextNode(u2), t4.map.push(t4.pos, t4.pos + e3.length, c2), s && a < 9 && (d2 = true), t4.pos += e3.length;
if (t4.trailingSpace = 32 == u2.charCodeAt(e3.length - 1), n3 || o3 || r2 || d2 || i2 || l2) {
var _2 = n3 || "";
o3 && (_2 += o3), r2 && (_2 += r2);
var w2 = A("span", [c2], _2, i2);
if (l2)
for (var x2 in l2)
l2.hasOwnProperty(x2) && "style" != x2 && "class" != x2 && w2.setAttribute(x2, l2[x2]);
return t4.content.appendChild(w2);
}
t4.content.appendChild(c2);
}
}
function bn(t4, e3) {
if (t4.length > 1 && !/ /.test(t4))
return t4;
for (var n3 = e3, o3 = "", r2 = 0; r2 < t4.length; r2++) {
var i2 = t4.charAt(r2);
" " != i2 || !n3 || r2 != t4.length - 1 && 32 != t4.charCodeAt(r2 + 1) || (i2 = " "), o3 += i2, n3 = " " == i2;
}
return o3;
}
function _n(t4, e3) {
return function(n3, o3, r2, i2, s2, a2, l2) {
r2 = r2 ? r2 + " cm-force-border" : "cm-force-border";
for (var c2 = n3.pos, u2 = c2 + o3.length; ; ) {
for (var p2 = void 0, d2 = 0; d2 < e3.length && !((p2 = e3[d2]).to > c2 && p2.from <= c2); d2++)
;
if (p2.to >= u2)
return t4(n3, o3, r2, i2, s2, a2, l2);
t4(n3, o3.slice(0, p2.to - c2), r2, i2, null, a2, l2), i2 = null, o3 = o3.slice(p2.to - c2), c2 = p2.to;
}
};
}
function wn(t4, e3, n3, o3) {
var r2 = !o3 && n3.widgetNode;
r2 && t4.map.push(t4.pos, t4.pos + e3, r2), !o3 && t4.cm.display.input.needsContentAttribute && (r2 || (r2 = t4.content.appendChild(document.createElement("span"))), r2.setAttribute("cm-marker", n3.id)), r2 && (t4.cm.display.input.setUneditable(r2), t4.content.appendChild(r2)), t4.pos += e3, t4.trailingSpace = false;
}
function xn(t4, e3, n3) {
var o3 = t4.markedSpans, r2 = t4.text, i2 = 0;
if (o3)
for (var s2, a2, l2, c2, u2, p2, d2, f2 = r2.length, h2 = 0, g2 = 1, v2 = "", y2 = 0; ; ) {
if (y2 == h2) {
l2 = c2 = u2 = a2 = "", d2 = null, p2 = null, y2 = 1 / 0;
for (var m2 = [], b2 = void 0, _2 = 0; _2 < o3.length; ++_2) {
var w2 = o3[_2], x2 = w2.marker;
if ("bookmark" == x2.type && w2.from == h2 && x2.widgetNode)
m2.push(x2);
else if (w2.from <= h2 && (null == w2.to || w2.to > h2 || x2.collapsed && w2.to == h2 && w2.from == h2)) {
if (null != w2.to && w2.to != h2 && y2 > w2.to && (y2 = w2.to, c2 = ""), x2.className && (l2 += " " + x2.className), x2.css && (a2 = (a2 ? a2 + ";" : "") + x2.css), x2.startStyle && w2.from == h2 && (u2 += " " + x2.startStyle), x2.endStyle && w2.to == y2 && (b2 || (b2 = [])).push(x2.endStyle, w2.to), x2.title && ((d2 || (d2 = {})).title = x2.title), x2.attributes)
for (var C2 in x2.attributes)
(d2 || (d2 = {}))[C2] = x2.attributes[C2];
x2.collapsed && (!p2 || Ge(p2.marker, x2) < 0) && (p2 = w2);
} else
w2.from > h2 && y2 > w2.from && (y2 = w2.from);
}
if (b2)
for (var S2 = 0; S2 < b2.length; S2 += 2)
b2[S2 + 1] == y2 && (c2 += " " + b2[S2]);
if (!p2 || p2.from == h2)
for (var O2 = 0; O2 < m2.length; ++O2)
wn(e3, 0, m2[O2]);
if (p2 && (p2.from || 0) == h2) {
if (wn(e3, (null == p2.to ? f2 + 1 : p2.to) - h2, p2.marker, null == p2.from), null == p2.to)
return;
p2.to == h2 && (p2 = false);
}
}
if (h2 >= f2)
break;
for (var T2 = Math.min(f2, y2); 1; ) {
if (v2) {
var k2 = h2 + v2.length;
if (!p2) {
var P2 = k2 > T2 ? v2.slice(0, T2 - h2) : v2;
e3.addToken(e3, P2, s2 ? s2 + l2 : l2, u2, h2 + P2.length == y2 ? c2 : "", a2, d2);
}
if (k2 >= T2) {
v2 = v2.slice(T2 - h2), h2 = T2;
break;
}
h2 = k2, u2 = "";
}
v2 = r2.slice(i2, i2 = n3[g2++]), s2 = gn(n3[g2++], e3.cm.options);
}
}
else
for (var E2 = 1; E2 < n3.length; E2 += 2)
e3.addToken(e3, r2.slice(i2, i2 = n3[E2]), gn(n3[E2 + 1], e3.cm.options));
}
function Cn(t4, e3, n3) {
this.line = e3, this.rest = en(e3), this.size = this.rest ? ne(X(this.rest)) - n3 + 1 : 1, this.node = this.text = null, this.hidden = rn(t4, e3);
}
function Sn(t4, e3, n3) {
for (var o3, r2 = [], i2 = e3; i2 < n3; i2 = o3) {
var s2 = new Cn(t4.doc, Zt(t4.doc, i2), i2);
o3 = i2 + s2.size, r2.push(s2);
}
return r2;
}
var On = null;
function Tn(t4) {
On ? On.ops.push(t4) : t4.ownsGroup = On = { ops: [t4], delayedCallbacks: [] };
}
function kn(t4) {
var e3 = t4.delayedCallbacks, n3 = 0;
do {
for (; n3 < e3.length; n3++)
e3[n3].call(null);
for (var o3 = 0; o3 < t4.ops.length; o3++) {
var r2 = t4.ops[o3];
if (r2.cursorActivityHandlers)
for (; r2.cursorActivityCalled < r2.cursorActivityHandlers.length; )
r2.cursorActivityHandlers[r2.cursorActivityCalled++].call(null, r2.cm);
}
} while (n3 < e3.length);
}
function Pn(t4, e3) {
var n3 = t4.ownsGroup;
if (n3)
try {
kn(n3);
} finally {
On = null, e3(n3);
}
}
var En = null;
function An(t4, e3) {
var n3 = vt(t4, e3);
if (n3.length) {
var o3, r2 = Array.prototype.slice.call(arguments, 2);
On ? o3 = On.delayedCallbacks : En ? o3 = En : (o3 = En = [], setTimeout(jn, 0));
for (var i2 = function(t5) {
o3.push(function() {
return n3[t5].apply(null, r2);
});
}, s2 = 0; s2 < n3.length; ++s2)
i2(s2);
}
}
function jn() {
var t4 = En;
En = null;
for (var e3 = 0; e3 < t4.length; ++e3)
t4[e3]();
}
function Mn(t4, e3, n3, o3) {
for (var r2 = 0; r2 < e3.changes.length; r2++) {
var i2 = e3.changes[r2];
"text" == i2 ? In(t4, e3) : "gutter" == i2 ? Vn(t4, e3, n3, o3) : "class" == i2 ? Fn(t4, e3) : "widget" == i2 && Rn(t4, e3, o3);
}
e3.changes = null;
}
function Ln(t4) {
return t4.node == t4.text && (t4.node = A("div", null, null, "position: relative"), t4.text.parentNode && t4.text.parentNode.replaceChild(t4.node, t4.text), t4.node.appendChild(t4.text), s && a < 8 && (t4.node.style.zIndex = 2)), t4.node;
}
function Dn(t4, e3) {
var n3 = e3.bgClass ? e3.bgClass + " " + (e3.line.bgClass || "") : e3.line.bgClass;
if (n3 && (n3 += " CodeMirror-linebackground"), e3.background)
n3 ? e3.background.className = n3 : (e3.background.parentNode.removeChild(e3.background), e3.background = null);
else if (n3) {
var o3 = Ln(e3);
e3.background = o3.insertBefore(A("div", null, n3), o3.firstChild), t4.display.input.setUneditable(e3.background);
}
}
function Nn(t4, e3) {
var n3 = t4.display.externalMeasured;
return n3 && n3.line == e3.line ? (t4.display.externalMeasured = null, e3.measure = n3.measure, n3.built) : vn(t4, e3);
}
function In(t4, e3) {
var n3 = e3.text.className, o3 = Nn(t4, e3);
e3.text == e3.node && (e3.node = o3.pre), e3.text.parentNode.replaceChild(o3.pre, e3.text), e3.text = o3.pre, o3.bgClass != e3.bgClass || o3.textClass != e3.textClass ? (e3.bgClass = o3.bgClass, e3.textClass = o3.textClass, Fn(t4, e3)) : n3 && (e3.text.className = n3);
}
function Fn(t4, e3) {
Dn(t4, e3), e3.line.wrapClass ? Ln(e3).className = e3.line.wrapClass : e3.node != e3.text && (e3.node.className = "");
var n3 = e3.textClass ? e3.textClass + " " + (e3.line.textClass || "") : e3.line.textClass;
e3.text.className = n3 || "";
}
function Vn(t4, e3, n3, o3) {
if (e3.gutter && (e3.node.removeChild(e3.gutter), e3.gutter = null), e3.gutterBackground && (e3.node.removeChild(e3.gutterBackground), e3.gutterBackground = null), e3.line.gutterClass) {
var r2 = Ln(e3);
e3.gutterBackground = A("div", null, "CodeMirror-gutter-background " + e3.line.gutterClass, "left: " + (t4.options.fixedGutter ? o3.fixedPos : -o3.gutterTotalWidth) + "px; width: " + o3.gutterTotalWidth + "px"), t4.display.input.setUneditable(e3.gutterBackground), r2.insertBefore(e3.gutterBackground, e3.text);
}
var i2 = e3.line.gutterMarkers;
if (t4.options.lineNumbers || i2) {
var s2 = Ln(e3), a2 = e3.gutter = A("div", null, "CodeMirror-gutter-wrapper", "left: " + (t4.options.fixedGutter ? o3.fixedPos : -o3.gutterTotalWidth) + "px");
if (a2.setAttribute("aria-hidden", "true"), t4.display.input.setUneditable(a2), s2.insertBefore(a2, e3.text), e3.line.gutterClass && (a2.className += " " + e3.line.gutterClass), !t4.options.lineNumbers || i2 && i2["CodeMirror-linenumbers"] || (e3.lineNumber = a2.appendChild(A("div", ie(t4.options, n3), "CodeMirror-linenumber CodeMirror-gutter-elt", "left: " + o3.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + t4.display.lineNumInnerWidth + "px"))), i2)
for (var l2 = 0; l2 < t4.display.gutterSpecs.length; ++l2) {
var c2 = t4.display.gutterSpecs[l2].className, u2 = i2.hasOwnProperty(c2) && i2[c2];
u2 && a2.appendChild(A("div", [u2], "CodeMirror-gutter-elt", "left: " + o3.gutterLeft[c2] + "px; width: " + o3.gutterWidth[c2] + "px"));
}
}
}
function Rn(t4, e3, n3) {
e3.alignable && (e3.alignable = null);
for (var o3 = O("CodeMirror-linewidget"), r2 = e3.node.firstChild, i2 = void 0; r2; r2 = i2)
i2 = r2.nextSibling, o3.test(r2.className) && e3.node.removeChild(r2);
zn(t4, e3, n3);
}
function Hn(t4, e3, n3, o3) {
var r2 = Nn(t4, e3);
return e3.text = e3.node = r2.pre, r2.bgClass && (e3.bgClass = r2.bgClass), r2.textClass && (e3.textClass = r2.textClass), Fn(t4, e3), Vn(t4, e3, n3, o3), zn(t4, e3, o3), e3.node;
}
function zn(t4, e3, n3) {
if (Bn(t4, e3.line, e3, n3, true), e3.rest)
for (var o3 = 0; o3 < e3.rest.length; o3++)
Bn(t4, e3.rest[o3], e3, n3, false);
}
function Bn(t4, e3, n3, o3, r2) {
if (e3.widgets)
for (var i2 = Ln(n3), s2 = 0, a2 = e3.widgets; s2 < a2.length; ++s2) {
var l2 = a2[s2], c2 = A("div", [l2.node], "CodeMirror-linewidget" + (l2.className ? " " + l2.className : ""));
l2.handleMouseEvents || c2.setAttribute("cm-ignore-events", "true"), Un(l2, c2, n3, o3), t4.display.input.setUneditable(c2), r2 && l2.above ? i2.insertBefore(c2, n3.gutter || n3.text) : i2.appendChild(c2), An(l2, "redraw");
}
}
function Un(t4, e3, n3, o3) {
if (t4.noHScroll) {
(n3.alignable || (n3.alignable = [])).push(e3);
var r2 = o3.wrapperWidth;
e3.style.left = o3.fixedPos + "px", t4.coverGutter || (r2 -= o3.gutterTotalWidth, e3.style.paddingLeft = o3.gutterTotalWidth + "px"), e3.style.width = r2 + "px";
}
t4.coverGutter && (e3.style.zIndex = 5, e3.style.position = "relative", t4.noHScroll || (e3.style.marginLeft = -o3.gutterTotalWidth + "px"));
}
function Wn(t4) {
if (null != t4.height)
return t4.height;
var e3 = t4.doc.cm;
if (!e3)
return 0;
if (!M(document.body, t4.node)) {
var n3 = "position: relative;";
t4.coverGutter && (n3 += "margin-left: -" + e3.display.gutters.offsetWidth + "px;"), t4.noHScroll && (n3 += "width: " + e3.display.wrapper.clientWidth + "px;"), E(e3.display.measure, A("div", [t4.node], null, n3));
}
return t4.height = t4.node.parentNode.offsetHeight;
}
function $n(t4, e3) {
for (var n3 = kt(e3); n3 != t4.wrapper; n3 = n3.parentNode)
if (!n3 || 1 == n3.nodeType && "true" == n3.getAttribute("cm-ignore-events") || n3.parentNode == t4.sizer && n3 != t4.mover)
return true;
}
function qn(t4) {
return t4.lineSpace.offsetTop;
}
function Gn(t4) {
return t4.mover.offsetHeight - t4.lineSpace.offsetHeight;
}
function Kn(t4) {
if (t4.cachedPaddingH)
return t4.cachedPaddingH;
var e3 = E(t4.measure, A("pre", "x", "CodeMirror-line-like")), n3 = window.getComputedStyle ? window.getComputedStyle(e3) : e3.currentStyle, o3 = { left: parseInt(n3.paddingLeft), right: parseInt(n3.paddingRight) };
return isNaN(o3.left) || isNaN(o3.right) || (t4.cachedPaddingH = o3), o3;
}
function Yn(t4) {
return B - t4.display.nativeBarWidth;
}
function Xn(t4) {
return t4.display.scroller.clientWidth - Yn(t4) - t4.display.barWidth;
}
function Jn(t4) {
return t4.display.scroller.clientHeight - Yn(t4) - t4.display.barHeight;
}
function Zn(t4, e3, n3) {
var o3 = t4.options.lineWrapping, r2 = o3 && Xn(t4);
if (!e3.measure.heights || o3 && e3.measure.width != r2) {
var i2 = e3.measure.heights = [];
if (o3) {
e3.measure.width = r2;
for (var s2 = e3.text.firstChild.getClientRects(), a2 = 0; a2 < s2.length - 1; a2++) {
var l2 = s2[a2], c2 = s2[a2 + 1];
Math.abs(l2.bottom - c2.bottom) > 2 && i2.push((l2.bottom + c2.top) / 2 - n3.top);
}
}
i2.push(n3.bottom - n3.top);
}
}
function Qn(t4, e3, n3) {
if (t4.line == e3)
return { map: t4.measure.map, cache: t4.measure.cache };
if (t4.rest) {
for (var o3 = 0; o3 < t4.rest.length; o3++)
if (t4.rest[o3] == e3)
return { map: t4.measure.maps[o3], cache: t4.measure.caches[o3] };
for (var r2 = 0; r2 < t4.rest.length; r2++)
if (ne(t4.rest[r2]) > n3)
return { map: t4.measure.maps[r2], cache: t4.measure.caches[r2], before: true };
}
}
function to(t4, e3) {
var n3 = ne(e3 = Qe(e3)), o3 = t4.display.externalMeasured = new Cn(t4.doc, e3, n3);
o3.lineN = n3;
var r2 = o3.built = vn(t4, o3);
return o3.text = r2.pre, E(t4.display.lineMeasure, r2.pre), o3;
}
function eo(t4, e3, n3, o3) {
return ro(t4, oo(t4, e3), n3, o3);
}
function no(t4, e3) {
if (e3 >= t4.display.viewFrom && e3 < t4.display.viewTo)
return t4.display.view[Vo(t4, e3)];
var n3 = t4.display.externalMeasured;
return n3 && e3 >= n3.lineN && e3 < n3.lineN + n3.size ? n3 : void 0;
}
function oo(t4, e3) {
var n3 = ne(e3), o3 = no(t4, n3);
o3 && !o3.text ? o3 = null : o3 && o3.changes && (Mn(t4, o3, n3, Lo(t4)), t4.curOp.forceUpdate = true), o3 || (o3 = to(t4, e3));
var r2 = Qn(o3, e3, n3);
return { line: e3, view: o3, rect: null, map: r2.map, cache: r2.cache, before: r2.before, hasHeights: false };
}
function ro(t4, e3, n3, o3, r2) {
e3.before && (n3 = -1);
var i2, s2 = n3 + (o3 || "");
return e3.cache.hasOwnProperty(s2) ? i2 = e3.cache[s2] : (e3.rect || (e3.rect = e3.view.text.getBoundingClientRect()), e3.hasHeights || (Zn(t4, e3.view, e3.rect), e3.hasHeights = true), (i2 = co(t4, e3, n3, o3)).bogus || (e3.cache[s2] = i2)), { left: i2.left, right: i2.right, top: r2 ? i2.rtop : i2.top, bottom: r2 ? i2.rbottom : i2.bottom };
}
var io, so = { left: 0, right: 0, top: 0, bottom: 0 };
function ao(t4, e3, n3) {
for (var o3, r2, i2, s2, a2, l2, c2 = 0; c2 < t4.length; c2 += 3)
if (a2 = t4[c2], l2 = t4[c2 + 1], e3 < a2 ? (r2 = 0, i2 = 1, s2 = "left") : e3 < l2 ? i2 = (r2 = e3 - a2) + 1 : (c2 == t4.length - 3 || e3 == l2 && t4[c2 + 3] > e3) && (r2 = (i2 = l2 - a2) - 1, e3 >= l2 && (s2 = "right")), null != r2) {
if (o3 = t4[c2 + 2], a2 == l2 && n3 == (o3.insertLeft ? "left" : "right") && (s2 = n3), "left" == n3 && 0 == r2)
for (; c2 && t4[c2 - 2] == t4[c2 - 3] && t4[c2 - 1].insertLeft; )
o3 = t4[(c2 -= 3) + 2], s2 = "left";
if ("right" == n3 && r2 == l2 - a2)
for (; c2 < t4.length - 3 && t4[c2 + 3] == t4[c2 + 4] && !t4[c2 + 5].insertLeft; )
o3 = t4[(c2 += 3) + 2], s2 = "right";
break;
}
return { node: o3, start: r2, end: i2, collapse: s2, coverStart: a2, coverEnd: l2 };
}
function lo(t4, e3) {
var n3 = so;
if ("left" == e3)
for (var o3 = 0; o3 < t4.length && (n3 = t4[o3]).left == n3.right; o3++)
;
else
for (var r2 = t4.length - 1; r2 >= 0 && (n3 = t4[r2]).left == n3.right; r2--)
;
return n3;
}
function co(t4, e3, n3, o3) {
var r2, i2 = ao(e3.map, n3, o3), l2 = i2.node, c2 = i2.start, u2 = i2.end, p2 = i2.collapse;
if (3 == l2.nodeType) {
for (var d2 = 0; d2 < 4; d2++) {
for (; c2 && st(e3.line.text.charAt(i2.coverStart + c2)); )
--c2;
for (; i2.coverStart + u2 < i2.coverEnd && st(e3.line.text.charAt(i2.coverStart + u2)); )
++u2;
if ((r2 = s && a < 9 && 0 == c2 && u2 == i2.coverEnd - i2.coverStart ? l2.parentNode.getBoundingClientRect() : lo(T(l2, c2, u2).getClientRects(), o3)).left || r2.right || 0 == c2)
break;
u2 = c2, c2 -= 1, p2 = "right";
}
s && a < 11 && (r2 = uo(t4.display.measure, r2));
} else {
var f2;
c2 > 0 && (p2 = o3 = "right"), r2 = t4.options.lineWrapping && (f2 = l2.getClientRects()).length > 1 ? f2["right" == o3 ? f2.length - 1 : 0] : l2.getBoundingClientRect();
}
if (s && a < 9 && !c2 && (!r2 || !r2.left && !r2.right)) {
var h2 = l2.parentNode.getClientRects()[0];
r2 = h2 ? { left: h2.left, right: h2.left + Mo(t4.display), top: h2.top, bottom: h2.bottom } : so;
}
for (var g2 = r2.top - e3.rect.top, v2 = r2.bottom - e3.rect.top, y2 = (g2 + v2) / 2, m2 = e3.view.measure.heights, b2 = 0; b2 < m2.length - 1 && !(y2 < m2[b2]); b2++)
;
var _2 = b2 ? m2[b2 - 1] : 0, w2 = m2[b2], x2 = { left: ("right" == p2 ? r2.right : r2.left) - e3.rect.left, right: ("left" == p2 ? r2.left : r2.right) - e3.rect.left, top: _2, bottom: w2 };
return r2.left || r2.right || (x2.bogus = true), t4.options.singleCursorHeightPerLine || (x2.rtop = g2, x2.rbottom = v2), x2;
}
function uo(t4, e3) {
if (!window.screen || null == screen.logicalXDPI || screen.logicalXDPI == screen.deviceXDPI || !Rt(t4))
return e3;
var n3 = screen.logicalXDPI / screen.deviceXDPI, o3 = screen.logicalYDPI / screen.deviceYDPI;
return { left: e3.left * n3, right: e3.right * n3, top: e3.top * o3, bottom: e3.bottom * o3 };
}
function po(t4) {
if (t4.measure && (t4.measure.cache = {}, t4.measure.heights = null, t4.rest))
for (var e3 = 0; e3 < t4.rest.length; e3++)
t4.measure.caches[e3] = {};
}
function fo(t4) {
t4.display.externalMeasure = null, P(t4.display.lineMeasure);
for (var e3 = 0; e3 < t4.display.view.length; e3++)
po(t4.display.view[e3]);
}
function ho(t4) {
fo(t4), t4.display.cachedCharWidth = t4.display.cachedTextHeight = t4.display.cachedPaddingH = null, t4.options.lineWrapping || (t4.display.maxLineChanged = true), t4.display.lineNumChars = null;
}
function go() {
return u && y ? -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) : window.pageXOffset || (document.documentElement || document.body).scrollLeft;
}
function vo() {
return u && y ? -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) : window.pageYOffset || (document.documentElement || document.body).scrollTop;
}
function yo(t4) {
var e3 = Qe(t4).widgets, n3 = 0;
if (e3)
for (var o3 = 0; o3 < e3.length; ++o3)
e3[o3].above && (n3 += Wn(e3[o3]));
return n3;
}
function mo(t4, e3, n3, o3, r2) {
if (!r2) {
var i2 = yo(e3);
n3.top += i2, n3.bottom += i2;
}
if ("line" == o3)
return n3;
o3 || (o3 = "local");
var s2 = an(e3);
if ("local" == o3 ? s2 += qn(t4.display) : s2 -= t4.display.viewOffset, "page" == o3 || "window" == o3) {
var a2 = t4.display.lineSpace.getBoundingClientRect();
s2 += a2.top + ("window" == o3 ? 0 : vo());
var l2 = a2.left + ("window" == o3 ? 0 : go());
n3.left += l2, n3.right += l2;
}
return n3.top += s2, n3.bottom += s2, n3;
}
function bo(t4, e3, n3) {
if ("div" == n3)
return e3;
var o3 = e3.left, r2 = e3.top;
if ("page" == n3)
o3 -= go(), r2 -= vo();
else if ("local" == n3 || !n3) {
var i2 = t4.display.sizer.getBoundingClientRect();
o3 += i2.left, r2 += i2.top;
}
var s2 = t4.display.lineSpace.getBoundingClientRect();
return { left: o3 - s2.left, top: r2 - s2.top };
}
function _o(t4, e3, n3, o3, r2) {
return o3 || (o3 = Zt(t4.doc, e3.line)), mo(t4, o3, eo(t4, o3, e3.ch, r2), n3);
}
function wo(t4, e3, n3, o3, r2, i2) {
function s2(e4, s3) {
var a3 = ro(t4, r2, e4, s3 ? "right" : "left", i2);
return s3 ? a3.left = a3.right : a3.right = a3.left, mo(t4, o3, a3, n3);
}
o3 = o3 || Zt(t4.doc, e3.line), r2 || (r2 = oo(t4, o3));
var a2 = ft(o3, t4.doc.direction), l2 = e3.ch, c2 = e3.sticky;
if (l2 >= o3.text.length ? (l2 = o3.text.length, c2 = "before") : l2 <= 0 && (l2 = 0, c2 = "after"), !a2)
return s2("before" == c2 ? l2 - 1 : l2, "before" == c2);
function u2(t5, e4, n4) {
return s2(n4 ? t5 - 1 : t5, 1 == a2[e4].level != n4);
}
var p2 = pt(a2, l2, c2), d2 = ut, f2 = u2(l2, p2, "before" == c2);
return null != d2 && (f2.other = u2(l2, d2, "before" != c2)), f2;
}
function xo(t4, e3) {
var n3 = 0;
e3 = fe(t4.doc, e3), t4.options.lineWrapping || (n3 = Mo(t4.display) * e3.ch);
var o3 = Zt(t4.doc, e3.line), r2 = an(o3) + qn(t4.display);
return { left: n3, right: n3, top: r2, bottom: r2 + o3.height };
}
function Co(t4, e3, n3, o3, r2) {
var i2 = se(t4, e3, n3);
return i2.xRel = r2, o3 && (i2.outside = o3), i2;
}
function So(t4, e3, n3) {
var o3 = t4.doc;
if ((n3 += t4.display.viewOffset) < 0)
return Co(o3.first, 0, null, -1, -1);
var r2 = oe(o3, n3), i2 = o3.first + o3.size - 1;
if (r2 > i2)
return Co(o3.first + o3.size - 1, Zt(o3, i2).text.length, null, 1, 1);
e3 < 0 && (e3 = 0);
for (var s2 = Zt(o3, r2); ; ) {
var a2 = Po(t4, s2, r2, e3, n3), l2 = Je(s2, a2.ch + (a2.xRel > 0 || a2.outside > 0 ? 1 : 0));
if (!l2)
return a2;
var c2 = l2.find(1);
if (c2.line == r2)
return c2;
s2 = Zt(o3, r2 = c2.line);
}
}
function Oo(t4, e3, n3, o3) {
o3 -= yo(e3);
var r2 = e3.text.length, i2 = lt(function(e4) {
return ro(t4, n3, e4 - 1).bottom <= o3;
}, r2, 0);
return { begin: i2, end: r2 = lt(function(e4) {
return ro(t4, n3, e4).top > o3;
}, i2, r2) };
}
function To(t4, e3, n3, o3) {
return n3 || (n3 = oo(t4, e3)), Oo(t4, e3, n3, mo(t4, e3, ro(t4, n3, o3), "line").top);
}
function ko(t4, e3, n3, o3) {
return !(t4.bottom <= n3) && (t4.top > n3 || (o3 ? t4.left : t4.right) > e3);
}
function Po(t4, e3, n3, o3, r2) {
r2 -= an(e3);
var i2 = oo(t4, e3), s2 = yo(e3), a2 = 0, l2 = e3.text.length, c2 = true, u2 = ft(e3, t4.doc.direction);
if (u2) {
var p2 = (t4.options.lineWrapping ? Ao : Eo)(t4, e3, n3, i2, u2, o3, r2);
a2 = (c2 = 1 != p2.level) ? p2.from : p2.to - 1, l2 = c2 ? p2.to : p2.from - 1;
}
var d2, f2, h2 = null, g2 = null, v2 = lt(function(e4) {
var n4 = ro(t4, i2, e4);
return n4.top += s2, n4.bottom += s2, !!ko(n4, o3, r2, false) && (n4.top <= r2 && n4.left <= o3 && (h2 = e4, g2 = n4), true);
}, a2, l2), y2 = false;
if (g2) {
var m2 = o3 - g2.left < g2.right - o3, b2 = m2 == c2;
v2 = h2 + (b2 ? 0 : 1), f2 = b2 ? "after" : "before", d2 = m2 ? g2.left : g2.right;
} else {
c2 || v2 != l2 && v2 != a2 || v2++, f2 = 0 == v2 ? "after" : v2 == e3.text.length ? "before" : ro(t4, i2, v2 - (c2 ? 1 : 0)).bottom + s2 <= r2 == c2 ? "after" : "before";
var _2 = wo(t4, se(n3, v2, f2), "line", e3, i2);
d2 = _2.left, y2 = r2 < _2.top ? -1 : r2 >= _2.bottom ? 1 : 0;
}
return Co(n3, v2 = at(e3.text, v2, 1), f2, y2, o3 - d2);
}
function Eo(t4, e3, n3, o3, r2, i2, s2) {
var a2 = lt(function(a3) {
var l3 = r2[a3], c3 = 1 != l3.level;
return ko(wo(t4, se(n3, c3 ? l3.to : l3.from, c3 ? "before" : "after"), "line", e3, o3), i2, s2, true);
}, 0, r2.length - 1), l2 = r2[a2];
if (a2 > 0) {
var c2 = 1 != l2.level, u2 = wo(t4, se(n3, c2 ? l2.from : l2.to, c2 ? "after" : "before"), "line", e3, o3);
ko(u2, i2, s2, true) && u2.top > s2 && (l2 = r2[a2 - 1]);
}
return l2;
}
function Ao(t4, e3, n3, o3, r2, i2, s2) {
var a2 = Oo(t4, e3, o3, s2), l2 = a2.begin, c2 = a2.end;
/\s/.test(e3.text.charAt(c2 - 1)) && c2--;
for (var u2 = null, p2 = null, d2 = 0; d2 < r2.length; d2++) {
var f2 = r2[d2];
if (!(f2.from >= c2 || f2.to <= l2)) {
var h2 = ro(t4, o3, 1 != f2.level ? Math.min(c2, f2.to) - 1 : Math.max(l2, f2.from)).right, g2 = h2 < i2 ? i2 - h2 + 1e9 : h2 - i2;
(!u2 || p2 > g2) && (u2 = f2, p2 = g2);
}
}
return u2 || (u2 = r2[r2.length - 1]), u2.from < l2 && (u2 = { from: l2, to: u2.to, level: u2.level }), u2.to > c2 && (u2 = { from: u2.from, to: c2, level: u2.level }), u2;
}
function jo(t4) {
if (null != t4.cachedTextHeight)
return t4.cachedTextHeight;
if (null == io) {
io = A("pre", null, "CodeMirror-line-like");
for (var e3 = 0; e3 < 49; ++e3)
io.appendChild(document.createTextNode("x")), io.appendChild(A("br"));
io.appendChild(document.createTextNode("x"));
}
E(t4.measure, io);
var n3 = io.offsetHeight / 50;
return n3 > 3 && (t4.cachedTextHeight = n3), P(t4.measure), n3 || 1;
}
function Mo(t4) {
if (null != t4.cachedCharWidth)
return t4.cachedCharWidth;
var e3 = A("span", "xxxxxxxxxx"), n3 = A("pre", [e3], "CodeMirror-line-like");
E(t4.measure, n3);
var o3 = e3.getBoundingClientRect(), r2 = (o3.right - o3.left) / 10;
return r2 > 2 && (t4.cachedCharWidth = r2), r2 || 10;
}
function Lo(t4) {
for (var e3 = t4.display, n3 = {}, o3 = {}, r2 = e3.gutters.clientLeft, i2 = e3.gutters.firstChild, s2 = 0; i2; i2 = i2.nextSibling, ++s2) {
var a2 = t4.display.gutterSpecs[s2].className;
n3[a2] = i2.offsetLeft + i2.clientLeft + r2, o3[a2] = i2.clientWidth;
}
return { fixedPos: Do(e3), gutterTotalWidth: e3.gutters.offsetWidth, gutterLeft: n3, gutterWidth: o3, wrapperWidth: e3.wrapper.clientWidth };
}
function Do(t4) {
return t4.scroller.getBoundingClientRect().left - t4.sizer.getBoundingClientRect().left;
}
function No(t4) {
var e3 = jo(t4.display), n3 = t4.options.lineWrapping, o3 = n3 && Math.max(5, t4.display.scroller.clientWidth / Mo(t4.display) - 3);
return function(r2) {
if (rn(t4.doc, r2))
return 0;
var i2 = 0;
if (r2.widgets)
for (var s2 = 0; s2 < r2.widgets.length; s2++)
r2.widgets[s2].height && (i2 += r2.widgets[s2].height);
return n3 ? i2 + (Math.ceil(r2.text.length / o3) || 1) * e3 : i2 + e3;
};
}
function Io(t4) {
var e3 = t4.doc, n3 = No(t4);
e3.iter(function(t5) {
var e4 = n3(t5);
e4 != t5.height && ee(t5, e4);
});
}
function Fo(t4, e3, n3, o3) {
var r2 = t4.display;
if (!n3 && "true" == kt(e3).getAttribute("cm-not-content"))
return null;
var i2, s2, a2 = r2.lineSpace.getBoundingClientRect();
try {
i2 = e3.clientX - a2.left, s2 = e3.clientY - a2.top;
} catch (t5) {
return null;
}
var l2, c2 = So(t4, i2, s2);
if (o3 && c2.xRel > 0 && (l2 = Zt(t4.doc, c2.line).text).length == c2.ch) {
var u2 = R(l2, l2.length, t4.options.tabSize) - l2.length;
c2 = se(c2.line, Math.max(0, Math.round((i2 - Kn(t4.display).left) / Mo(t4.display)) - u2));
}
return c2;
}
function Vo(t4, e3) {
if (e3 >= t4.display.viewTo)
return null;
if ((e3 -= t4.display.viewFrom) < 0)
return null;
for (var n3 = t4.display.view, o3 = 0; o3 < n3.length; o3++)
if ((e3 -= n3[o3].size) < 0)
return o3;
}
function Ro(t4, e3, n3, o3) {
null == e3 && (e3 = t4.doc.first), null == n3 && (n3 = t4.doc.first + t4.doc.size), o3 || (o3 = 0);
var r2 = t4.display;
if (o3 && n3 < r2.viewTo && (null == r2.updateLineNumbers || r2.updateLineNumbers > e3) && (r2.updateLineNumbers = e3), t4.curOp.viewChanged = true, e3 >= r2.viewTo)
je && nn(t4.doc, e3) < r2.viewTo && zo(t4);
else if (n3 <= r2.viewFrom)
je && on(t4.doc, n3 + o3) > r2.viewFrom ? zo(t4) : (r2.viewFrom += o3, r2.viewTo += o3);
else if (e3 <= r2.viewFrom && n3 >= r2.viewTo)
zo(t4);
else if (e3 <= r2.viewFrom) {
var i2 = Bo(t4, n3, n3 + o3, 1);
i2 ? (r2.view = r2.view.slice(i2.index), r2.viewFrom = i2.lineN, r2.viewTo += o3) : zo(t4);
} else if (n3 >= r2.viewTo) {
var s2 = Bo(t4, e3, e3, -1);
s2 ? (r2.view = r2.view.slice(0, s2.index), r2.viewTo = s2.lineN) : zo(t4);
} else {
var a2 = Bo(t4, e3, e3, -1), l2 = Bo(t4, n3, n3 + o3, 1);
a2 && l2 ? (r2.view = r2.view.slice(0, a2.index).concat(Sn(t4, a2.lineN, l2.lineN)).concat(r2.view.slice(l2.index)), r2.viewTo += o3) : zo(t4);
}
var c2 = r2.externalMeasured;
c2 && (n3 < c2.lineN ? c2.lineN += o3 : e3 < c2.lineN + c2.size && (r2.externalMeasured = null));
}
function Ho(t4, e3, n3) {
t4.curOp.viewChanged = true;
var o3 = t4.display, r2 = t4.display.externalMeasured;
if (r2 && e3 >= r2.lineN && e3 < r2.lineN + r2.size && (o3.externalMeasured = null), !(e3 < o3.viewFrom || e3 >= o3.viewTo)) {
var i2 = o3.view[Vo(t4, e3)];
if (null != i2.node) {
var s2 = i2.changes || (i2.changes = []);
-1 == z(s2, n3) && s2.push(n3);
}
}
}
function zo(t4) {
t4.display.viewFrom = t4.display.viewTo = t4.doc.first, t4.display.view = [], t4.display.viewOffset = 0;
}
function Bo(t4, e3, n3, o3) {
var r2, i2 = Vo(t4, e3), s2 = t4.display.view;
if (!je || n3 == t4.doc.first + t4.doc.size)
return { index: i2, lineN: n3 };
for (var a2 = t4.display.viewFrom, l2 = 0; l2 < i2; l2++)
a2 += s2[l2].size;
if (a2 != e3) {
if (o3 > 0) {
if (i2 == s2.length - 1)
return null;
r2 = a2 + s2[i2].size - e3, i2++;
} else
r2 = a2 - e3;
e3 += r2, n3 += r2;
}
for (; nn(t4.doc, n3) != n3; ) {
if (i2 == (o3 < 0 ? 0 : s2.length - 1))
return null;
n3 += o3 * s2[i2 - (o3 < 0 ? 1 : 0)].size, i2 += o3;
}
return { index: i2, lineN: n3 };
}
function Uo(t4, e3, n3) {
var o3 = t4.display;
0 == o3.view.length || e3 >= o3.viewTo || n3 <= o3.viewFrom ? (o3.view = Sn(t4, e3, n3), o3.viewFrom = e3) : (o3.viewFrom > e3 ? o3.view = Sn(t4, e3, o3.viewFrom).concat(o3.view) : o3.viewFrom < e3 && (o3.view = o3.view.slice(Vo(t4, e3))), o3.viewFrom = e3, o3.viewTo < n3 ? o3.view = o3.view.concat(Sn(t4, o3.viewTo, n3)) : o3.viewTo > n3 && (o3.view = o3.view.slice(0, Vo(t4, n3)))), o3.viewTo = n3;
}
function Wo(t4) {
for (var e3 = t4.display.view, n3 = 0, o3 = 0; o3 < e3.length; o3++) {
var r2 = e3[o3];
r2.hidden || r2.node && !r2.changes || ++n3;
}
return n3;
}
function $o(t4) {
t4.display.input.showSelection(t4.display.input.prepareSelection());
}
function qo(t4, e3) {
void 0 === e3 && (e3 = true);
var n3 = t4.doc, o3 = {}, r2 = o3.cursors = document.createDocumentFragment(), i2 = o3.selection = document.createDocumentFragment(), s2 = t4.options.$customCursor;
s2 && (e3 = true);
for (var a2 = 0; a2 < n3.sel.ranges.length; a2++)
if (e3 || a2 != n3.sel.primIndex) {
var l2 = n3.sel.ranges[a2];
if (!(l2.from().line >= t4.display.viewTo || l2.to().line < t4.display.viewFrom)) {
var c2 = l2.empty();
if (s2) {
var u2 = s2(t4, l2);
u2 && Go(t4, u2, r2);
} else
(c2 || t4.options.showCursorWhenSelecting) && Go(t4, l2.head, r2);
c2 || Yo(t4, l2, i2);
}
}
return o3;
}
function Go(t4, e3, n3) {
var o3 = wo(t4, e3, "div", null, null, !t4.options.singleCursorHeightPerLine), r2 = n3.appendChild(A("div", " ", "CodeMirror-cursor"));
if (r2.style.left = o3.left + "px", r2.style.top = o3.top + "px", r2.style.height = Math.max(0, o3.bottom - o3.top) * t4.options.cursorHeight + "px", /\bcm-fat-cursor\b/.test(t4.getWrapperElement().className)) {
var i2 = _o(t4, e3, "div", null, null), s2 = i2.right - i2.left;
r2.style.width = (s2 > 0 ? s2 : t4.defaultCharWidth()) + "px";
}
if (o3.other) {
var a2 = n3.appendChild(A("div", " ", "CodeMirror-cursor CodeMirror-secondarycursor"));
a2.style.display = "", a2.style.left = o3.other.left + "px", a2.style.top = o3.other.top + "px", a2.style.height = 0.85 * (o3.other.bottom - o3.other.top) + "px";
}
}
function Ko(t4, e3) {
return t4.top - e3.top || t4.left - e3.left;
}
function Yo(t4, e3, n3) {
var o3 = t4.display, r2 = t4.doc, i2 = document.createDocumentFragment(), s2 = Kn(t4.display), a2 = s2.left, l2 = Math.max(o3.sizerWidth, Xn(t4) - o3.sizer.offsetLeft) - s2.right, c2 = "ltr" == r2.direction;
function u2(t5, e4, n4, o4) {
e4 < 0 && (e4 = 0), e4 = Math.round(e4), o4 = Math.round(o4), i2.appendChild(A("div", null, "CodeMirror-selected", "position: absolute; left: " + t5 + "px;\n top: " + e4 + "px; width: " + (null == n4 ? l2 - t5 : n4) + "px;\n height: " + (o4 - e4) + "px"));
}
function p2(e4, n4, o4) {
var i3, s3, p3 = Zt(r2, e4), d3 = p3.text.length;
function f3(n5, o5) {
return _o(t4, se(e4, n5), "div", p3, o5);
}
function h3(e5, n5, o5) {
var r3 = To(t4, p3, null, e5), i4 = "ltr" == n5 == ("after" == o5) ? "left" : "right";
return f3("after" == o5 ? r3.begin : r3.end - (/\s/.test(p3.text.charAt(r3.end - 1)) ? 2 : 1), i4)[i4];
}
var g3 = ft(p3, r2.direction);
return ct(g3, n4 || 0, null == o4 ? d3 : o4, function(t5, e5, r3, p4) {
var v3 = "ltr" == r3, y3 = f3(t5, v3 ? "left" : "right"), m3 = f3(e5 - 1, v3 ? "right" : "left"), b2 = null == n4 && 0 == t5, _2 = null == o4 && e5 == d3, w2 = 0 == p4, x2 = !g3 || p4 == g3.length - 1;
if (m3.top - y3.top <= 3) {
var C2 = (c2 ? _2 : b2) && x2, S2 = (c2 ? b2 : _2) && w2 ? a2 : (v3 ? y3 : m3).left, O2 = C2 ? l2 : (v3 ? m3 : y3).right;
u2(S2, y3.top, O2 - S2, y3.bottom);
} else {
var T2, k2, P2, E2;
v3 ? (T2 = c2 && b2 && w2 ? a2 : y3.left, k2 = c2 ? l2 : h3(t5, r3, "before"), P2 = c2 ? a2 : h3(e5, r3, "after"), E2 = c2 && _2 && x2 ? l2 : m3.right) : (T2 = c2 ? h3(t5, r3, "before") : a2, k2 = !c2 && b2 && w2 ? l2 : y3.right, P2 = !c2 && _2 && x2 ? a2 : m3.left, E2 = c2 ? h3(e5, r3, "after") : l2), u2(T2, y3.top, k2 - T2, y3.bottom), y3.bottom < m3.top && u2(a2, y3.bottom, null, m3.top), u2(P2, m3.top, E2 - P2, m3.bottom);
}
(!i3 || Ko(y3, i3) < 0) && (i3 = y3), Ko(m3, i3) < 0 && (i3 = m3), (!s3 || Ko(y3, s3) < 0) && (s3 = y3), Ko(m3, s3) < 0 && (s3 = m3);
}), { start: i3, end: s3 };
}
var d2 = e3.from(), f2 = e3.to();
if (d2.line == f2.line)
p2(d2.line, d2.ch, f2.ch);
else {
var h2 = Zt(r2, d2.line), g2 = Zt(r2, f2.line), v2 = Qe(h2) == Qe(g2), y2 = p2(d2.line, d2.ch, v2 ? h2.text.length + 1 : null).end, m2 = p2(f2.line, v2 ? 0 : null, f2.ch).start;
v2 && (y2.top < m2.top - 2 ? (u2(y2.right, y2.top, null, y2.bottom), u2(a2, m2.top, m2.left, m2.bottom)) : u2(y2.right, y2.top, m2.left - y2.right, y2.bottom)), y2.bottom < m2.top && u2(a2, y2.bottom, null, m2.top);
}
n3.appendChild(i2);
}
function Xo(t4) {
if (t4.state.focused) {
var e3 = t4.display;
clearInterval(e3.blinker);
var n3 = true;
e3.cursorDiv.style.visibility = "", t4.options.cursorBlinkRate > 0 ? e3.blinker = setInterval(function() {
t4.hasFocus() || tr(t4), e3.cursorDiv.style.visibility = (n3 = !n3) ? "" : "hidden";
}, t4.options.cursorBlinkRate) : t4.options.cursorBlinkRate < 0 && (e3.cursorDiv.style.visibility = "hidden");
}
}
function Jo(t4) {
t4.hasFocus() || (t4.display.input.focus(), t4.state.focused || Qo(t4));
}
function Zo(t4) {
t4.state.delayingBlurEvent = true, setTimeout(function() {
t4.state.delayingBlurEvent && (t4.state.delayingBlurEvent = false, t4.state.focused && tr(t4));
}, 100);
}
function Qo(t4, e3) {
t4.state.delayingBlurEvent && !t4.state.draggingText && (t4.state.delayingBlurEvent = false), "nocursor" != t4.options.readOnly && (t4.state.focused || (mt(t4, "focus", t4, e3), t4.state.focused = true, D(t4.display.wrapper, "CodeMirror-focused"), t4.curOp || t4.display.selForContextMenu == t4.doc.sel || (t4.display.input.reset(), l && setTimeout(function() {
return t4.display.input.reset(true);
}, 20)), t4.display.input.receivedFocus()), Xo(t4));
}
function tr(t4, e3) {
t4.state.delayingBlurEvent || (t4.state.focused && (mt(t4, "blur", t4, e3), t4.state.focused = false, k(t4.display.wrapper, "CodeMirror-focused")), clearInterval(t4.display.blinker), setTimeout(function() {
t4.state.focused || (t4.display.shift = false);
}, 150));
}
function er(t4) {
for (var e3 = t4.display, n3 = e3.lineDiv.offsetTop, o3 = Math.max(0, e3.scroller.getBoundingClientRect().top), r2 = e3.lineDiv.getBoundingClientRect().top, i2 = 0, l2 = 0; l2 < e3.view.length; l2++) {
var c2 = e3.view[l2], u2 = t4.options.lineWrapping, p2 = void 0, d2 = 0;
if (!c2.hidden) {
if (r2 += c2.line.height, s && a < 8) {
var f2 = c2.node.offsetTop + c2.node.offsetHeight;
p2 = f2 - n3, n3 = f2;
} else {
var h2 = c2.node.getBoundingClientRect();
p2 = h2.bottom - h2.top, !u2 && c2.text.firstChild && (d2 = c2.text.firstChild.getBoundingClientRect().right - h2.left - 1);
}
var g2 = c2.line.height - p2;
if ((g2 > 5e-3 || g2 < -5e-3) && (r2 < o3 && (i2 -= g2), ee(c2.line, p2), nr(c2.line), c2.rest))
for (var v2 = 0; v2 < c2.rest.length; v2++)
nr(c2.rest[v2]);
if (d2 > t4.display.sizerWidth) {
var y2 = Math.ceil(d2 / Mo(t4.display));
y2 > t4.display.maxLineLength && (t4.display.maxLineLength = y2, t4.display.maxLine = c2.line, t4.display.maxLineChanged = true);
}
}
}
Math.abs(i2) > 2 && (e3.scroller.scrollTop += i2);
}
function nr(t4) {
if (t4.widgets)
for (var e3 = 0; e3 < t4.widgets.length; ++e3) {
var n3 = t4.widgets[e3], o3 = n3.node.parentNode;
o3 && (n3.height = o3.offsetHeight);
}
}
function or(t4, e3, n3) {
var o3 = n3 && null != n3.top ? Math.max(0, n3.top) : t4.scroller.scrollTop;
o3 = Math.floor(o3 - qn(t4));
var r2 = n3 && null != n3.bottom ? n3.bottom : o3 + t4.wrapper.clientHeight, i2 = oe(e3, o3), s2 = oe(e3, r2);
if (n3 && n3.ensure) {
var a2 = n3.ensure.from.line, l2 = n3.ensure.to.line;
a2 < i2 ? (i2 = a2, s2 = oe(e3, an(Zt(e3, a2)) + t4.wrapper.clientHeight)) : Math.min(l2, e3.lastLine()) >= s2 && (i2 = oe(e3, an(Zt(e3, l2)) - t4.wrapper.clientHeight), s2 = l2);
}
return { from: i2, to: Math.max(s2, i2 + 1) };
}
function rr(t4, e3) {
if (!bt(t4, "scrollCursorIntoView")) {
var n3 = t4.display, o3 = n3.sizer.getBoundingClientRect(), r2 = null;
if (e3.top + o3.top < 0 ? r2 = true : e3.bottom + o3.top > (window.innerHeight || document.documentElement.clientHeight) && (r2 = false), null != r2 && !g) {
var i2 = A("div", "", null, "position: absolute;\n top: " + (e3.top - n3.viewOffset - qn(t4.display)) + "px;\n height: " + (e3.bottom - e3.top + Yn(t4) + n3.barHeight) + "px;\n left: " + e3.left + "px; width: " + Math.max(2, e3.right - e3.left) + "px;");
t4.display.lineSpace.appendChild(i2), i2.scrollIntoView(r2), t4.display.lineSpace.removeChild(i2);
}
}
}
function ir(t4, e3, n3, o3) {
var r2;
null == o3 && (o3 = 0), t4.options.lineWrapping || e3 != n3 || (n3 = "before" == e3.sticky ? se(e3.line, e3.ch + 1, "before") : e3, e3 = e3.ch ? se(e3.line, "before" == e3.sticky ? e3.ch - 1 : e3.ch, "after") : e3);
for (var i2 = 0; i2 < 5; i2++) {
var s2 = false, a2 = wo(t4, e3), l2 = n3 && n3 != e3 ? wo(t4, n3) : a2, c2 = ar(t4, r2 = { left: Math.min(a2.left, l2.left), top: Math.min(a2.top, l2.top) - o3, right: Math.max(a2.left, l2.left), bottom: Math.max(a2.bottom, l2.bottom) + o3 }), u2 = t4.doc.scrollTop, p2 = t4.doc.scrollLeft;
if (null != c2.scrollTop && (hr(t4, c2.scrollTop), Math.abs(t4.doc.scrollTop - u2) > 1 && (s2 = true)), null != c2.scrollLeft && (vr(t4, c2.scrollLeft), Math.abs(t4.doc.scrollLeft - p2) > 1 && (s2 = true)), !s2)
break;
}
return r2;
}
function sr(t4, e3) {
var n3 = ar(t4, e3);
null != n3.scrollTop && hr(t4, n3.scrollTop), null != n3.scrollLeft && vr(t4, n3.scrollLeft);
}
function ar(t4, e3) {
var n3 = t4.display, o3 = jo(t4.display);
e3.top < 0 && (e3.top = 0);
var r2 = t4.curOp && null != t4.curOp.scrollTop ? t4.curOp.scrollTop : n3.scroller.scrollTop, i2 = Jn(t4), s2 = {};
e3.bottom - e3.top > i2 && (e3.bottom = e3.top + i2);
var a2 = t4.doc.height + Gn(n3), l2 = e3.top < o3, c2 = e3.bottom > a2 - o3;
if (e3.top < r2)
s2.scrollTop = l2 ? 0 : e3.top;
else if (e3.bottom > r2 + i2) {
var u2 = Math.min(e3.top, (c2 ? a2 : e3.bottom) - i2);
u2 != r2 && (s2.scrollTop = u2);
}
var p2 = t4.options.fixedGutter ? 0 : n3.gutters.offsetWidth, d2 = t4.curOp && null != t4.curOp.scrollLeft ? t4.curOp.scrollLeft : n3.scroller.scrollLeft - p2, f2 = Xn(t4) - n3.gutters.offsetWidth, h2 = e3.right - e3.left > f2;
return h2 && (e3.right = e3.left + f2), e3.left < 10 ? s2.scrollLeft = 0 : e3.left < d2 ? s2.scrollLeft = Math.max(0, e3.left + p2 - (h2 ? 0 : 10)) : e3.right > f2 + d2 - 3 && (s2.scrollLeft = e3.right + (h2 ? 0 : 10) - f2), s2;
}
function lr(t4, e3) {
null != e3 && (dr(t4), t4.curOp.scrollTop = (null == t4.curOp.scrollTop ? t4.doc.scrollTop : t4.curOp.scrollTop) + e3);
}
function cr(t4) {
dr(t4);
var e3 = t4.getCursor();
t4.curOp.scrollToPos = { from: e3, to: e3, margin: t4.options.cursorScrollMargin };
}
function ur(t4, e3, n3) {
null == e3 && null == n3 || dr(t4), null != e3 && (t4.curOp.scrollLeft = e3), null != n3 && (t4.curOp.scrollTop = n3);
}
function pr(t4, e3) {
dr(t4), t4.curOp.scrollToPos = e3;
}
function dr(t4) {
var e3 = t4.curOp.scrollToPos;
e3 && (t4.curOp.scrollToPos = null, fr(t4, xo(t4, e3.from), xo(t4, e3.to), e3.margin));
}
function fr(t4, e3, n3, o3) {
var r2 = ar(t4, { left: Math.min(e3.left, n3.left), top: Math.min(e3.top, n3.top) - o3, right: Math.max(e3.right, n3.right), bottom: Math.max(e3.bottom, n3.bottom) + o3 });
ur(t4, r2.scrollLeft, r2.scrollTop);
}
function hr(t4, e3) {
Math.abs(t4.doc.scrollTop - e3) < 2 || (n2 || $r(t4, { top: e3 }), gr(t4, e3, true), n2 && $r(t4), Fr(t4, 100));
}
function gr(t4, e3, n3) {
e3 = Math.max(0, Math.min(t4.display.scroller.scrollHeight - t4.display.scroller.clientHeight, e3)), (t4.display.scroller.scrollTop != e3 || n3) && (t4.doc.scrollTop = e3, t4.display.scrollbars.setScrollTop(e3), t4.display.scroller.scrollTop != e3 && (t4.display.scroller.scrollTop = e3));
}
function vr(t4, e3, n3, o3) {
e3 = Math.max(0, Math.min(e3, t4.display.scroller.scrollWidth - t4.display.scroller.clientWidth)), (n3 ? e3 == t4.doc.scrollLeft : Math.abs(t4.doc.scrollLeft - e3) < 2) && !o3 || (t4.doc.scrollLeft = e3, Yr(t4), t4.display.scroller.scrollLeft != e3 && (t4.display.scroller.scrollLeft = e3), t4.display.scrollbars.setScrollLeft(e3));
}
function yr(t4) {
var e3 = t4.display, n3 = e3.gutters.offsetWidth, o3 = Math.round(t4.doc.height + Gn(t4.display));
return { clientHeight: e3.scroller.clientHeight, viewHeight: e3.wrapper.clientHeight, scrollWidth: e3.scroller.scrollWidth, clientWidth: e3.scroller.clientWidth, viewWidth: e3.wrapper.clientWidth, barLeft: t4.options.fixedGutter ? n3 : 0, docHeight: o3, scrollHeight: o3 + Yn(t4) + e3.barHeight, nativeBarWidth: e3.nativeBarWidth, gutterWidth: n3 };
}
var mr = function(t4, e3, n3) {
this.cm = n3;
var o3 = this.vert = A("div", [A("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"), r2 = this.horiz = A("div", [A("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar");
o3.tabIndex = r2.tabIndex = -1, t4(o3), t4(r2), gt(o3, "scroll", function() {
o3.clientHeight && e3(o3.scrollTop, "vertical");
}), gt(r2, "scroll", function() {
r2.clientWidth && e3(r2.scrollLeft, "horizontal");
}), this.checkedZeroWidth = false, s && a < 8 && (this.horiz.style.minHeight = this.vert.style.minWidth = "18px");
};
mr.prototype.update = function(t4) {
var e3 = t4.scrollWidth > t4.clientWidth + 1, n3 = t4.scrollHeight > t4.clientHeight + 1, o3 = t4.nativeBarWidth;
if (n3) {
this.vert.style.display = "block", this.vert.style.bottom = e3 ? o3 + "px" : "0";
var r2 = t4.viewHeight - (e3 ? o3 : 0);
this.vert.firstChild.style.height = Math.max(0, t4.scrollHeight - t4.clientHeight + r2) + "px";
} else
this.vert.scrollTop = 0, this.vert.style.display = "", this.vert.firstChild.style.height = "0";
if (e3) {
this.horiz.style.display = "block", this.horiz.style.right = n3 ? o3 + "px" : "0", this.horiz.style.left = t4.barLeft + "px";
var i2 = t4.viewWidth - t4.barLeft - (n3 ? o3 : 0);
this.horiz.firstChild.style.width = Math.max(0, t4.scrollWidth - t4.clientWidth + i2) + "px";
} else
this.horiz.style.display = "", this.horiz.firstChild.style.width = "0";
return !this.checkedZeroWidth && t4.clientHeight > 0 && (0 == o3 && this.zeroWidthHack(), this.checkedZeroWidth = true), { right: n3 ? o3 : 0, bottom: e3 ? o3 : 0 };
}, mr.prototype.setScrollLeft = function(t4) {
this.horiz.scrollLeft != t4 && (this.horiz.scrollLeft = t4), this.disableHoriz && this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz");
}, mr.prototype.setScrollTop = function(t4) {
this.vert.scrollTop != t4 && (this.vert.scrollTop = t4), this.disableVert && this.enableZeroWidthBar(this.vert, this.disableVert, "vert");
}, mr.prototype.zeroWidthHack = function() {
var t4 = b && !h ? "12px" : "18px";
this.horiz.style.height = this.vert.style.width = t4, this.horiz.style.visibility = this.vert.style.visibility = "hidden", this.disableHoriz = new H(), this.disableVert = new H();
}, mr.prototype.enableZeroWidthBar = function(t4, e3, n3) {
function o3() {
var r2 = t4.getBoundingClientRect();
("vert" == n3 ? document.elementFromPoint(r2.right - 1, (r2.top + r2.bottom) / 2) : document.elementFromPoint((r2.right + r2.left) / 2, r2.bottom - 1)) != t4 ? t4.style.visibility = "hidden" : e3.set(1e3, o3);
}
t4.style.visibility = "", e3.set(1e3, o3);
}, mr.prototype.clear = function() {
var t4 = this.horiz.parentNode;
t4.removeChild(this.horiz), t4.removeChild(this.vert);
};
var br = function() {
};
function _r(t4, e3) {
e3 || (e3 = yr(t4));
var n3 = t4.display.barWidth, o3 = t4.display.barHeight;
wr(t4, e3);
for (var r2 = 0; r2 < 4 && n3 != t4.display.barWidth || o3 != t4.display.barHeight; r2++)
n3 != t4.display.barWidth && t4.options.lineWrapping && er(t4), wr(t4, yr(t4)), n3 = t4.display.barWidth, o3 = t4.display.barHeight;
}
function wr(t4, e3) {
var n3 = t4.display, o3 = n3.scrollbars.update(e3);
n3.sizer.style.paddingRight = (n3.barWidth = o3.right) + "px", n3.sizer.style.paddingBottom = (n3.barHeight = o3.bottom) + "px", n3.heightForcer.style.borderBottom = o3.bottom + "px solid transparent", o3.right && o3.bottom ? (n3.scrollbarFiller.style.display = "block", n3.scrollbarFiller.style.height = o3.bottom + "px", n3.scrollbarFiller.style.width = o3.right + "px") : n3.scrollbarFiller.style.display = "", o3.bottom && t4.options.coverGutterNextToScrollbar && t4.options.fixedGutter ? (n3.gutterFiller.style.display = "block", n3.gutterFiller.style.height = o3.bottom + "px", n3.gutterFiller.style.width = e3.gutterWidth + "px") : n3.gutterFiller.style.display = "";
}
br.prototype.update = function() {
return { bottom: 0, right: 0 };
}, br.prototype.setScrollLeft = function() {
}, br.prototype.setScrollTop = function() {
}, br.prototype.clear = function() {
};
var xr = { native: mr, null: br };
function Cr(t4) {
t4.display.scrollbars && (t4.display.scrollbars.clear(), t4.display.scrollbars.addClass && k(t4.display.wrapper, t4.display.scrollbars.addClass)), t4.display.scrollbars = new xr[t4.options.scrollbarStyle](function(e3) {
t4.display.wrapper.insertBefore(e3, t4.display.scrollbarFiller), gt(e3, "mousedown", function() {
t4.state.focused && setTimeout(function() {
return t4.display.input.focus();
}, 0);
}), e3.setAttribute("cm-not-content", "true");
}, function(e3, n3) {
"horizontal" == n3 ? vr(t4, e3) : hr(t4, e3);
}, t4), t4.display.scrollbars.addClass && D(t4.display.wrapper, t4.display.scrollbars.addClass);
}
var Sr = 0;
function Or(t4) {
t4.curOp = { cm: t4, viewChanged: false, startHeight: t4.doc.height, forceUpdate: false, updateInput: 0, typing: false, changeObjs: null, cursorActivityHandlers: null, cursorActivityCalled: 0, selectionChanged: false, updateMaxLine: false, scrollLeft: null, scrollTop: null, scrollToPos: null, focus: false, id: ++Sr, markArrays: null }, Tn(t4.curOp);
}
function Tr(t4) {
var e3 = t4.curOp;
e3 && Pn(e3, function(t5) {
for (var e4 = 0; e4 < t5.ops.length; e4++)
t5.ops[e4].cm.curOp = null;
kr(t5);
});
}
function kr(t4) {
for (var e3 = t4.ops, n3 = 0; n3 < e3.length; n3++)
Pr(e3[n3]);
for (var o3 = 0; o3 < e3.length; o3++)
Er(e3[o3]);
for (var r2 = 0; r2 < e3.length; r2++)
Ar(e3[r2]);
for (var i2 = 0; i2 < e3.length; i2++)
jr(e3[i2]);
for (var s2 = 0; s2 < e3.length; s2++)
Mr(e3[s2]);
}
function Pr(t4) {
var e3 = t4.cm, n3 = e3.display;
Hr(e3), t4.updateMaxLine && cn(e3), t4.mustUpdate = t4.viewChanged || t4.forceUpdate || null != t4.scrollTop || t4.scrollToPos && (t4.scrollToPos.from.line < n3.viewFrom || t4.scrollToPos.to.line >= n3.viewTo) || n3.maxLineChanged && e3.options.lineWrapping, t4.update = t4.mustUpdate && new Rr(e3, t4.mustUpdate && { top: t4.scrollTop, ensure: t4.scrollToPos }, t4.forceUpdate);
}
function Er(t4) {
t4.updatedDisplay = t4.mustUpdate && Ur(t4.cm, t4.update);
}
function Ar(t4) {
var e3 = t4.cm, n3 = e3.display;
t4.updatedDisplay && er(e3), t4.barMeasure = yr(e3), n3.maxLineChanged && !e3.options.lineWrapping && (t4.adjustWidthTo = eo(e3, n3.maxLine, n3.maxLine.text.length).left + 3, e3.display.sizerWidth = t4.adjustWidthTo, t4.barMeasure.scrollWidth = Math.max(n3.scroller.clientWidth, n3.sizer.offsetLeft + t4.adjustWidthTo + Yn(e3) + e3.display.barWidth), t4.maxScrollLeft = Math.max(0, n3.sizer.offsetLeft + t4.adjustWidthTo - Xn(e3))), (t4.updatedDisplay || t4.selectionChanged) && (t4.preparedSelection = n3.input.prepareSelection());
}
function jr(t4) {
var e3 = t4.cm;
null != t4.adjustWidthTo && (e3.display.sizer.style.minWidth = t4.adjustWidthTo + "px", t4.maxScrollLeft < e3.doc.scrollLeft && vr(e3, Math.min(e3.display.scroller.scrollLeft, t4.maxScrollLeft), true), e3.display.maxLineChanged = false);
var n3 = t4.focus && t4.focus == L();
t4.preparedSelection && e3.display.input.showSelection(t4.preparedSelection, n3), (t4.updatedDisplay || t4.startHeight != e3.doc.height) && _r(e3, t4.barMeasure), t4.updatedDisplay && Kr(e3, t4.barMeasure), t4.selectionChanged && Xo(e3), e3.state.focused && t4.updateInput && e3.display.input.reset(t4.typing), n3 && Jo(t4.cm);
}
function Mr(t4) {
var e3 = t4.cm, n3 = e3.display, o3 = e3.doc;
t4.updatedDisplay && Wr(e3, t4.update), null == n3.wheelStartX || null == t4.scrollTop && null == t4.scrollLeft && !t4.scrollToPos || (n3.wheelStartX = n3.wheelStartY = null), null != t4.scrollTop && gr(e3, t4.scrollTop, t4.forceScroll), null != t4.scrollLeft && vr(e3, t4.scrollLeft, true, true), t4.scrollToPos && rr(e3, ir(e3, fe(o3, t4.scrollToPos.from), fe(o3, t4.scrollToPos.to), t4.scrollToPos.margin));
var r2 = t4.maybeHiddenMarkers, i2 = t4.maybeUnhiddenMarkers;
if (r2)
for (var s2 = 0; s2 < r2.length; ++s2)
r2[s2].lines.length || mt(r2[s2], "hide");
if (i2)
for (var a2 = 0; a2 < i2.length; ++a2)
i2[a2].lines.length && mt(i2[a2], "unhide");
n3.wrapper.offsetHeight && (o3.scrollTop = e3.display.scroller.scrollTop), t4.changeObjs && mt(e3, "changes", e3, t4.changeObjs), t4.update && t4.update.finish();
}
function Lr(t4, e3) {
if (t4.curOp)
return e3();
Or(t4);
try {
return e3();
} finally {
Tr(t4);
}
}
function Dr(t4, e3) {
return function() {
if (t4.curOp)
return e3.apply(t4, arguments);
Or(t4);
try {
return e3.apply(t4, arguments);
} finally {
Tr(t4);
}
};
}
function Nr(t4) {
return function() {
if (this.curOp)
return t4.apply(this, arguments);
Or(this);
try {
return t4.apply(this, arguments);
} finally {
Tr(this);
}
};
}
function Ir(t4) {
return function() {
var e3 = this.cm;
if (!e3 || e3.curOp)
return t4.apply(this, arguments);
Or(e3);
try {
return t4.apply(this, arguments);
} finally {
Tr(e3);
}
};
}
function Fr(t4, e3) {
t4.doc.highlightFrontier < t4.display.viewTo && t4.state.highlight.set(e3, F(Vr, t4));
}
function Vr(t4) {
var e3 = t4.doc;
if (!(e3.highlightFrontier >= t4.display.viewTo)) {
var n3 = +/* @__PURE__ */ new Date() + t4.options.workTime, o3 = _e(t4, e3.highlightFrontier), r2 = [];
e3.iter(o3.line, Math.min(e3.first + e3.size, t4.display.viewTo + 500), function(i2) {
if (o3.line >= t4.display.viewFrom) {
var s2 = i2.styles, a2 = i2.text.length > t4.options.maxHighlightLength ? Kt(e3.mode, o3.state) : null, l2 = me(t4, i2, o3, true);
a2 && (o3.state = a2), i2.styles = l2.styles;
var c2 = i2.styleClasses, u2 = l2.classes;
u2 ? i2.styleClasses = u2 : c2 && (i2.styleClasses = null);
for (var p2 = !s2 || s2.length != i2.styles.length || c2 != u2 && (!c2 || !u2 || c2.bgClass != u2.bgClass || c2.textClass != u2.textClass), d2 = 0; !p2 && d2 < s2.length; ++d2)
p2 = s2[d2] != i2.styles[d2];
p2 && r2.push(o3.line), i2.stateAfter = o3.save(), o3.nextLine();
} else
i2.text.length <= t4.options.maxHighlightLength && we(t4, i2.text, o3), i2.stateAfter = o3.line % 5 == 0 ? o3.save() : null, o3.nextLine();
if (+/* @__PURE__ */ new Date() > n3)
return Fr(t4, t4.options.workDelay), true;
}), e3.highlightFrontier = o3.line, e3.modeFrontier = Math.max(e3.modeFrontier, o3.line), r2.length && Lr(t4, function() {
for (var e4 = 0; e4 < r2.length; e4++)
Ho(t4, r2[e4], "text");
});
}
}
var Rr = function(t4, e3, n3) {
var o3 = t4.display;
this.viewport = e3, this.visible = or(o3, t4.doc, e3), this.editorIsHidden = !o3.wrapper.offsetWidth, this.wrapperHeight = o3.wrapper.clientHeight, this.wrapperWidth = o3.wrapper.clientWidth, this.oldDisplayWidth = Xn(t4), this.force = n3, this.dims = Lo(t4), this.events = [];
};
function Hr(t4) {
var e3 = t4.display;
!e3.scrollbarsClipped && e3.scroller.offsetWidth && (e3.nativeBarWidth = e3.scroller.offsetWidth - e3.scroller.clientWidth, e3.heightForcer.style.height = Yn(t4) + "px", e3.sizer.style.marginBottom = -e3.nativeBarWidth + "px", e3.sizer.style.borderRightWidth = Yn(t4) + "px", e3.scrollbarsClipped = true);
}
function zr(t4) {
if (t4.hasFocus())
return null;
var e3 = L();
if (!e3 || !M(t4.display.lineDiv, e3))
return null;
var n3 = { activeElt: e3 };
if (window.getSelection) {
var o3 = window.getSelection();
o3.anchorNode && o3.extend && M(t4.display.lineDiv, o3.anchorNode) && (n3.anchorNode = o3.anchorNode, n3.anchorOffset = o3.anchorOffset, n3.focusNode = o3.focusNode, n3.focusOffset = o3.focusOffset);
}
return n3;
}
function Br(t4) {
if (t4 && t4.activeElt && t4.activeElt != L() && (t4.activeElt.focus(), !/^(INPUT|TEXTAREA)$/.test(t4.activeElt.nodeName) && t4.anchorNode && M(document.body, t4.anchorNode) && M(document.body, t4.focusNode))) {
var e3 = window.getSelection(), n3 = document.createRange();
n3.setEnd(t4.anchorNode, t4.anchorOffset), n3.collapse(false), e3.removeAllRanges(), e3.addRange(n3), e3.extend(t4.focusNode, t4.focusOffset);
}
}
function Ur(t4, e3) {
var n3 = t4.display, o3 = t4.doc;
if (e3.editorIsHidden)
return zo(t4), false;
if (!e3.force && e3.visible.from >= n3.viewFrom && e3.visible.to <= n3.viewTo && (null == n3.updateLineNumbers || n3.updateLineNumbers >= n3.viewTo) && n3.renderedView == n3.view && 0 == Wo(t4))
return false;
Xr(t4) && (zo(t4), e3.dims = Lo(t4));
var r2 = o3.first + o3.size, i2 = Math.max(e3.visible.from - t4.options.viewportMargin, o3.first), s2 = Math.min(r2, e3.visible.to + t4.options.viewportMargin);
n3.viewFrom < i2 && i2 - n3.viewFrom < 20 && (i2 = Math.max(o3.first, n3.viewFrom)), n3.viewTo > s2 && n3.viewTo - s2 < 20 && (s2 = Math.min(r2, n3.viewTo)), je && (i2 = nn(t4.doc, i2), s2 = on(t4.doc, s2));
var a2 = i2 != n3.viewFrom || s2 != n3.viewTo || n3.lastWrapHeight != e3.wrapperHeight || n3.lastWrapWidth != e3.wrapperWidth;
Uo(t4, i2, s2), n3.viewOffset = an(Zt(t4.doc, n3.viewFrom)), t4.display.mover.style.top = n3.viewOffset + "px";
var l2 = Wo(t4);
if (!a2 && 0 == l2 && !e3.force && n3.renderedView == n3.view && (null == n3.updateLineNumbers || n3.updateLineNumbers >= n3.viewTo))
return false;
var c2 = zr(t4);
return l2 > 4 && (n3.lineDiv.style.display = "none"), qr(t4, n3.updateLineNumbers, e3.dims), l2 > 4 && (n3.lineDiv.style.display = ""), n3.renderedView = n3.view, Br(c2), P(n3.cursorDiv), P(n3.selectionDiv), n3.gutters.style.height = n3.sizer.style.minHeight = 0, a2 && (n3.lastWrapHeight = e3.wrapperHeight, n3.lastWrapWidth = e3.wrapperWidth, Fr(t4, 400)), n3.updateLineNumbers = null, true;
}
function Wr(t4, e3) {
for (var n3 = e3.viewport, o3 = true; ; o3 = false) {
if (o3 && t4.options.lineWrapping && e3.oldDisplayWidth != Xn(t4))
o3 && (e3.visible = or(t4.display, t4.doc, n3));
else if (n3 && null != n3.top && (n3 = { top: Math.min(t4.doc.height + Gn(t4.display) - Jn(t4), n3.top) }), e3.visible = or(t4.display, t4.doc, n3), e3.visible.from >= t4.display.viewFrom && e3.visible.to <= t4.display.viewTo)
break;
if (!Ur(t4, e3))
break;
er(t4);
var r2 = yr(t4);
$o(t4), _r(t4, r2), Kr(t4, r2), e3.force = false;
}
e3.signal(t4, "update", t4), t4.display.viewFrom == t4.display.reportedViewFrom && t4.display.viewTo == t4.display.reportedViewTo || (e3.signal(t4, "viewportChange", t4, t4.display.viewFrom, t4.display.viewTo), t4.display.reportedViewFrom = t4.display.viewFrom, t4.display.reportedViewTo = t4.display.viewTo);
}
function $r(t4, e3) {
var n3 = new Rr(t4, e3);
if (Ur(t4, n3)) {
er(t4), Wr(t4, n3);
var o3 = yr(t4);
$o(t4), _r(t4, o3), Kr(t4, o3), n3.finish();
}
}
function qr(t4, e3, n3) {
var o3 = t4.display, r2 = t4.options.lineNumbers, i2 = o3.lineDiv, s2 = i2.firstChild;
function a2(e4) {
var n4 = e4.nextSibling;
return l && b && t4.display.currentWheelTarget == e4 ? e4.style.display = "none" : e4.parentNode.removeChild(e4), n4;
}
for (var c2 = o3.view, u2 = o3.viewFrom, p2 = 0; p2 < c2.length; p2++) {
var d2 = c2[p2];
if (d2.hidden)
;
else if (d2.node && d2.node.parentNode == i2) {
for (; s2 != d2.node; )
s2 = a2(s2);
var f2 = r2 && null != e3 && e3 <= u2 && d2.lineNumber;
d2.changes && (z(d2.changes, "gutter") > -1 && (f2 = false), Mn(t4, d2, u2, n3)), f2 && (P(d2.lineNumber), d2.lineNumber.appendChild(document.createTextNode(ie(t4.options, u2)))), s2 = d2.node.nextSibling;
} else {
var h2 = Hn(t4, d2, u2, n3);
i2.insertBefore(h2, s2);
}
u2 += d2.size;
}
for (; s2; )
s2 = a2(s2);
}
function Gr(t4) {
var e3 = t4.gutters.offsetWidth;
t4.sizer.style.marginLeft = e3 + "px", An(t4, "gutterChanged", t4);
}
function Kr(t4, e3) {
t4.display.sizer.style.minHeight = e3.docHeight + "px", t4.display.heightForcer.style.top = e3.docHeight + "px", t4.display.gutters.style.height = e3.docHeight + t4.display.barHeight + Yn(t4) + "px";
}
function Yr(t4) {
var e3 = t4.display, n3 = e3.view;
if (e3.alignWidgets || e3.gutters.firstChild && t4.options.fixedGutter) {
for (var o3 = Do(e3) - e3.scroller.scrollLeft + t4.doc.scrollLeft, r2 = e3.gutters.offsetWidth, i2 = o3 + "px", s2 = 0; s2 < n3.length; s2++)
if (!n3[s2].hidden) {
t4.options.fixedGutter && (n3[s2].gutter && (n3[s2].gutter.style.left = i2), n3[s2].gutterBackground && (n3[s2].gutterBackground.style.left = i2));
var a2 = n3[s2].alignable;
if (a2)
for (var l2 = 0; l2 < a2.length; l2++)
a2[l2].style.left = i2;
}
t4.options.fixedGutter && (e3.gutters.style.left = o3 + r2 + "px");
}
}
function Xr(t4) {
if (!t4.options.lineNumbers)
return false;
var e3 = t4.doc, n3 = ie(t4.options, e3.first + e3.size - 1), o3 = t4.display;
if (n3.length != o3.lineNumChars) {
var r2 = o3.measure.appendChild(A("div", [A("div", n3)], "CodeMirror-linenumber CodeMirror-gutter-elt")), i2 = r2.firstChild.offsetWidth, s2 = r2.offsetWidth - i2;
return o3.lineGutter.style.width = "", o3.lineNumInnerWidth = Math.max(i2, o3.lineGutter.offsetWidth - s2) + 1, o3.lineNumWidth = o3.lineNumInnerWidth + s2, o3.lineNumChars = o3.lineNumInnerWidth ? n3.length : -1, o3.lineGutter.style.width = o3.lineNumWidth + "px", Gr(t4.display), true;
}
return false;
}
function Jr(t4, e3) {
for (var n3 = [], o3 = false, r2 = 0; r2 < t4.length; r2++) {
var i2 = t4[r2], s2 = null;
if ("string" != typeof i2 && (s2 = i2.style, i2 = i2.className), "CodeMirror-linenumbers" == i2) {
if (!e3)
continue;
o3 = true;
}
n3.push({ className: i2, style: s2 });
}
return e3 && !o3 && n3.push({ className: "CodeMirror-linenumbers", style: null }), n3;
}
function Zr(t4) {
var e3 = t4.gutters, n3 = t4.gutterSpecs;
P(e3), t4.lineGutter = null;
for (var o3 = 0; o3 < n3.length; ++o3) {
var r2 = n3[o3], i2 = r2.className, s2 = r2.style, a2 = e3.appendChild(A("div", null, "CodeMirror-gutter " + i2));
s2 && (a2.style.cssText = s2), "CodeMirror-linenumbers" == i2 && (t4.lineGutter = a2, a2.style.width = (t4.lineNumWidth || 1) + "px");
}
e3.style.display = n3.length ? "" : "none", Gr(t4);
}
function Qr(t4) {
Zr(t4.display), Ro(t4), Yr(t4);
}
function ti(t4, e3, o3, r2) {
var i2 = this;
this.input = o3, i2.scrollbarFiller = A("div", null, "CodeMirror-scrollbar-filler"), i2.scrollbarFiller.setAttribute("cm-not-content", "true"), i2.gutterFiller = A("div", null, "CodeMirror-gutter-filler"), i2.gutterFiller.setAttribute("cm-not-content", "true"), i2.lineDiv = j("div", null, "CodeMirror-code"), i2.selectionDiv = A("div", null, null, "position: relative; z-index: 1"), i2.cursorDiv = A("div", null, "CodeMirror-cursors"), i2.measure = A("div", null, "CodeMirror-measure"), i2.lineMeasure = A("div", null, "CodeMirror-measure"), i2.lineSpace = j("div", [i2.measure, i2.lineMeasure, i2.selectionDiv, i2.cursorDiv, i2.lineDiv], null, "position: relative; outline: none");
var c2 = j("div", [i2.lineSpace], "CodeMirror-lines");
i2.mover = A("div", [c2], null, "position: relative"), i2.sizer = A("div", [i2.mover], "CodeMirror-sizer"), i2.sizerWidth = null, i2.heightForcer = A("div", null, null, "position: absolute; height: " + B + "px; width: 1px;"), i2.gutters = A("div", null, "CodeMirror-gutters"), i2.lineGutter = null, i2.scroller = A("div", [i2.sizer, i2.heightForcer, i2.gutters], "CodeMirror-scroll"), i2.scroller.setAttribute("tabIndex", "-1"), i2.wrapper = A("div", [i2.scrollbarFiller, i2.gutterFiller, i2.scroller], "CodeMirror"), i2.wrapper.setAttribute("translate", "no"), s && a < 8 && (i2.gutters.style.zIndex = -1, i2.scroller.style.paddingRight = 0), l || n2 && m || (i2.scroller.draggable = true), t4 && (t4.appendChild ? t4.appendChild(i2.wrapper) : t4(i2.wrapper)), i2.viewFrom = i2.viewTo = e3.first, i2.reportedViewFrom = i2.reportedViewTo = e3.first, i2.view = [], i2.renderedView = null, i2.externalMeasured = null, i2.viewOffset = 0, i2.lastWrapHeight = i2.lastWrapWidth = 0, i2.updateLineNumbers = null, i2.nativeBarWidth = i2.barHeight = i2.barWidth = 0, i2.scrollbarsClipped = false, i2.lineNumWidth = i2.lineNumInnerWidth = i2.lineNumChars = null, i2.alignWidgets = false, i2.cachedCharWidth = i2.cachedTextHeight = i2.cachedPaddingH = null, i2.maxLine = null, i2.maxLineLength = 0, i2.maxLineChanged = false, i2.wheelDX = i2.wheelDY = i2.wheelStartX = i2.wheelStartY = null, i2.shift = false, i2.selForContextMenu = null, i2.activeTouch = null, i2.gutterSpecs = Jr(r2.gutters, r2.lineNumbers), Zr(i2), o3.init(i2);
}
Rr.prototype.signal = function(t4, e3) {
wt(t4, e3) && this.events.push(arguments);
}, Rr.prototype.finish = function() {
for (var t4 = 0; t4 < this.events.length; t4++)
mt.apply(null, this.events[t4]);
};
var ei = 0, ni = null;
function oi(t4) {
var e3 = t4.wheelDeltaX, n3 = t4.wheelDeltaY;
return null == e3 && t4.detail && t4.axis == t4.HORIZONTAL_AXIS && (e3 = t4.detail), null == n3 && t4.detail && t4.axis == t4.VERTICAL_AXIS ? n3 = t4.detail : null == n3 && (n3 = t4.wheelDelta), { x: e3, y: n3 };
}
function ri(t4) {
var e3 = oi(t4);
return e3.x *= ni, e3.y *= ni, e3;
}
function ii(t4, e3) {
u && p >= 102 && (null == t4.display.chromeScrollHack ? t4.display.sizer.style.pointerEvents = "none" : clearTimeout(t4.display.chromeScrollHack), t4.display.chromeScrollHack = setTimeout(function() {
t4.display.chromeScrollHack = null, t4.display.sizer.style.pointerEvents = "";
}, 100));
var o3 = oi(e3), r2 = o3.x, i2 = o3.y, s2 = ni;
0 === e3.deltaMode && (r2 = e3.deltaX, i2 = e3.deltaY, s2 = 1);
var a2 = t4.display, c2 = a2.scroller, f2 = c2.scrollWidth > c2.clientWidth, h2 = c2.scrollHeight > c2.clientHeight;
if (r2 && f2 || i2 && h2) {
if (i2 && b && l) {
t:
for (var g2 = e3.target, v2 = a2.view; g2 != c2; g2 = g2.parentNode)
for (var y2 = 0; y2 < v2.length; y2++)
if (v2[y2].node == g2) {
t4.display.currentWheelTarget = g2;
break t;
}
}
if (r2 && !n2 && !d && null != s2)
return i2 && h2 && hr(t4, Math.max(0, c2.scrollTop + i2 * s2)), vr(t4, Math.max(0, c2.scrollLeft + r2 * s2)), (!i2 || i2 && h2) && Ct(e3), void (a2.wheelStartX = null);
if (i2 && null != s2) {
var m2 = i2 * s2, _2 = t4.doc.scrollTop, w2 = _2 + a2.wrapper.clientHeight;
m2 < 0 ? _2 = Math.max(0, _2 + m2 - 50) : w2 = Math.min(t4.doc.height, w2 + m2 + 50), $r(t4, { top: _2, bottom: w2 });
}
ei < 20 && 0 !== e3.deltaMode && (null == a2.wheelStartX ? (a2.wheelStartX = c2.scrollLeft, a2.wheelStartY = c2.scrollTop, a2.wheelDX = r2, a2.wheelDY = i2, setTimeout(function() {
if (null != a2.wheelStartX) {
var t5 = c2.scrollLeft - a2.wheelStartX, e4 = c2.scrollTop - a2.wheelStartY, n3 = e4 && a2.wheelDY && e4 / a2.wheelDY || t5 && a2.wheelDX && t5 / a2.wheelDX;
a2.wheelStartX = a2.wheelStartY = null, n3 && (ni = (ni * ei + n3) / (ei + 1), ++ei);
}
}, 200)) : (a2.wheelDX += r2, a2.wheelDY += i2));
}
}
s ? ni = -0.53 : n2 ? ni = 15 : u ? ni = -0.7 : f && (ni = -1 / 3);
var si = function(t4, e3) {
this.ranges = t4, this.primIndex = e3;
};
si.prototype.primary = function() {
return this.ranges[this.primIndex];
}, si.prototype.equals = function(t4) {
if (t4 == this)
return true;
if (t4.primIndex != this.primIndex || t4.ranges.length != this.ranges.length)
return false;
for (var e3 = 0; e3 < this.ranges.length; e3++) {
var n3 = this.ranges[e3], o3 = t4.ranges[e3];
if (!le(n3.anchor, o3.anchor) || !le(n3.head, o3.head))
return false;
}
return true;
}, si.prototype.deepCopy = function() {
for (var t4 = [], e3 = 0; e3 < this.ranges.length; e3++)
t4[e3] = new ai(ce(this.ranges[e3].anchor), ce(this.ranges[e3].head));
return new si(t4, this.primIndex);
}, si.prototype.somethingSelected = function() {
for (var t4 = 0; t4 < this.ranges.length; t4++)
if (!this.ranges[t4].empty())
return true;
return false;
}, si.prototype.contains = function(t4, e3) {
e3 || (e3 = t4);
for (var n3 = 0; n3 < this.ranges.length; n3++) {
var o3 = this.ranges[n3];
if (ae(e3, o3.from()) >= 0 && ae(t4, o3.to()) <= 0)
return n3;
}
return -1;
};
var ai = function(t4, e3) {
this.anchor = t4, this.head = e3;
};
function li(t4, e3, n3) {
var o3 = t4 && t4.options.selectionsMayTouch, r2 = e3[n3];
e3.sort(function(t5, e4) {
return ae(t5.from(), e4.from());
}), n3 = z(e3, r2);
for (var i2 = 1; i2 < e3.length; i2++) {
var s2 = e3[i2], a2 = e3[i2 - 1], l2 = ae(a2.to(), s2.from());
if (o3 && !s2.empty() ? l2 > 0 : l2 >= 0) {
var c2 = pe(a2.from(), s2.from()), u2 = ue(a2.to(), s2.to()), p2 = a2.empty() ? s2.from() == s2.head : a2.from() == a2.head;
i2 <= n3 && --n3, e3.splice(--i2, 2, new ai(p2 ? u2 : c2, p2 ? c2 : u2));
}
}
return new si(e3, n3);
}
function ci(t4, e3) {
return new si([new ai(t4, e3 || t4)], 0);
}
function ui(t4) {
return t4.text ? se(t4.from.line + t4.text.length - 1, X(t4.text).length + (1 == t4.text.length ? t4.from.ch : 0)) : t4.to;
}
function pi(t4, e3) {
if (ae(t4, e3.from) < 0)
return t4;
if (ae(t4, e3.to) <= 0)
return ui(e3);
var n3 = t4.line + e3.text.length - (e3.to.line - e3.from.line) - 1, o3 = t4.ch;
return t4.line == e3.to.line && (o3 += ui(e3).ch - e3.to.ch), se(n3, o3);
}
function di(t4, e3) {
for (var n3 = [], o3 = 0; o3 < t4.sel.ranges.length; o3++) {
var r2 = t4.sel.ranges[o3];
n3.push(new ai(pi(r2.anchor, e3), pi(r2.head, e3)));
}
return li(t4.cm, n3, t4.sel.primIndex);
}
function fi(t4, e3, n3) {
return t4.line == e3.line ? se(n3.line, t4.ch - e3.ch + n3.ch) : se(n3.line + (t4.line - e3.line), t4.ch);
}
function hi(t4, e3, n3) {
for (var o3 = [], r2 = se(t4.first, 0), i2 = r2, s2 = 0; s2 < e3.length; s2++) {
var a2 = e3[s2], l2 = fi(a2.from, r2, i2), c2 = fi(ui(a2), r2, i2);
if (r2 = a2.to, i2 = c2, "around" == n3) {
var u2 = t4.sel.ranges[s2], p2 = ae(u2.head, u2.anchor) < 0;
o3[s2] = new ai(p2 ? c2 : l2, p2 ? l2 : c2);
} else
o3[s2] = new ai(l2, l2);
}
return new si(o3, t4.sel.primIndex);
}
function gi(t4) {
t4.doc.mode = $t(t4.options, t4.doc.modeOption), vi(t4);
}
function vi(t4) {
t4.doc.iter(function(t5) {
t5.stateAfter && (t5.stateAfter = null), t5.styles && (t5.styles = null);
}), t4.doc.modeFrontier = t4.doc.highlightFrontier = t4.doc.first, Fr(t4, 100), t4.state.modeGen++, t4.curOp && Ro(t4);
}
function yi(t4, e3) {
return 0 == e3.from.ch && 0 == e3.to.ch && "" == X(e3.text) && (!t4.cm || t4.cm.options.wholeLineUpdateBefore);
}
function mi(t4, e3, n3, o3) {
function r2(t5) {
return n3 ? n3[t5] : null;
}
function i2(t5, n4, r3) {
pn(t5, n4, r3, o3), An(t5, "change", t5, e3);
}
function s2(t5, e4) {
for (var n4 = [], i3 = t5; i3 < e4; ++i3)
n4.push(new un(c2[i3], r2(i3), o3));
return n4;
}
var a2 = e3.from, l2 = e3.to, c2 = e3.text, u2 = Zt(t4, a2.line), p2 = Zt(t4, l2.line), d2 = X(c2), f2 = r2(c2.length - 1), h2 = l2.line - a2.line;
if (e3.full)
t4.insert(0, s2(0, c2.length)), t4.remove(c2.length, t4.size - c2.length);
else if (yi(t4, e3)) {
var g2 = s2(0, c2.length - 1);
i2(p2, p2.text, f2), h2 && t4.remove(a2.line, h2), g2.length && t4.insert(a2.line, g2);
} else if (u2 == p2)
if (1 == c2.length)
i2(u2, u2.text.slice(0, a2.ch) + d2 + u2.text.slice(l2.ch), f2);
else {
var v2 = s2(1, c2.length - 1);
v2.push(new un(d2 + u2.text.slice(l2.ch), f2, o3)), i2(u2, u2.text.slice(0, a2.ch) + c2[0], r2(0)), t4.insert(a2.line + 1, v2);
}
else if (1 == c2.length)
i2(u2, u2.text.slice(0, a2.ch) + c2[0] + p2.text.slice(l2.ch), r2(0)), t4.remove(a2.line + 1, h2);
else {
i2(u2, u2.text.slice(0, a2.ch) + c2[0], r2(0)), i2(p2, d2 + p2.text.slice(l2.ch), f2);
var y2 = s2(1, c2.length - 1);
h2 > 1 && t4.remove(a2.line + 1, h2 - 1), t4.insert(a2.line + 1, y2);
}
An(t4, "change", t4, e3);
}
function bi(t4, e3, n3) {
function o3(t5, r2, i2) {
if (t5.linked)
for (var s2 = 0; s2 < t5.linked.length; ++s2) {
var a2 = t5.linked[s2];
if (a2.doc != r2) {
var l2 = i2 && a2.sharedHist;
n3 && !l2 || (e3(a2.doc, l2), o3(a2.doc, t5, l2));
}
}
}
o3(t4, null, true);
}
function _i(t4, e3) {
if (e3.cm)
throw new Error("This document is already in use.");
t4.doc = e3, e3.cm = t4, Io(t4), gi(t4), wi(t4), t4.options.direction = e3.direction, t4.options.lineWrapping || cn(t4), t4.options.mode = e3.modeOption, Ro(t4);
}
function wi(t4) {
("rtl" == t4.doc.direction ? D : k)(t4.display.lineDiv, "CodeMirror-rtl");
}
function xi(t4) {
Lr(t4, function() {
wi(t4), Ro(t4);
});
}
function Ci(t4) {
this.done = [], this.undone = [], this.undoDepth = t4 ? t4.undoDepth : 1 / 0, this.lastModTime = this.lastSelTime = 0, this.lastOp = this.lastSelOp = null, this.lastOrigin = this.lastSelOrigin = null, this.generation = this.maxGeneration = t4 ? t4.maxGeneration : 1;
}
function Si(t4, e3) {
var n3 = { from: ce(e3.from), to: ui(e3), text: Qt(t4, e3.from, e3.to) };
return ji(t4, n3, e3.from.line, e3.to.line + 1), bi(t4, function(t5) {
return ji(t5, n3, e3.from.line, e3.to.line + 1);
}, true), n3;
}
function Oi(t4) {
for (; t4.length && X(t4).ranges; )
t4.pop();
}
function Ti(t4, e3) {
return e3 ? (Oi(t4.done), X(t4.done)) : t4.done.length && !X(t4.done).ranges ? X(t4.done) : t4.done.length > 1 && !t4.done[t4.done.length - 2].ranges ? (t4.done.pop(), X(t4.done)) : void 0;
}
function ki(t4, e3, n3, o3) {
var r2 = t4.history;
r2.undone.length = 0;
var i2, s2, a2 = +/* @__PURE__ */ new Date();
if ((r2.lastOp == o3 || r2.lastOrigin == e3.origin && e3.origin && ("+" == e3.origin.charAt(0) && r2.lastModTime > a2 - (t4.cm ? t4.cm.options.historyEventDelay : 500) || "*" == e3.origin.charAt(0))) && (i2 = Ti(r2, r2.lastOp == o3)))
s2 = X(i2.changes), 0 == ae(e3.from, e3.to) && 0 == ae(e3.from, s2.to) ? s2.to = ui(e3) : i2.changes.push(Si(t4, e3));
else {
var l2 = X(r2.done);
for (l2 && l2.ranges || Ai(t4.sel, r2.done), i2 = { changes: [Si(t4, e3)], generation: r2.generation }, r2.done.push(i2); r2.done.length > r2.undoDepth; )
r2.done.shift(), r2.done[0].ranges || r2.done.shift();
}
r2.done.push(n3), r2.generation = ++r2.maxGeneration, r2.lastModTime = r2.lastSelTime = a2, r2.lastOp = r2.lastSelOp = o3, r2.lastOrigin = r2.lastSelOrigin = e3.origin, s2 || mt(t4, "historyAdded");
}
function Pi(t4, e3, n3, o3) {
var r2 = e3.charAt(0);
return "*" == r2 || "+" == r2 && n3.ranges.length == o3.ranges.length && n3.somethingSelected() == o3.somethingSelected() && /* @__PURE__ */ new Date() - t4.history.lastSelTime <= (t4.cm ? t4.cm.options.historyEventDelay : 500);
}
function Ei(t4, e3, n3, o3) {
var r2 = t4.history, i2 = o3 && o3.origin;
n3 == r2.lastSelOp || i2 && r2.lastSelOrigin == i2 && (r2.lastModTime == r2.lastSelTime && r2.lastOrigin == i2 || Pi(t4, i2, X(r2.done), e3)) ? r2.done[r2.done.length - 1] = e3 : Ai(e3, r2.done), r2.lastSelTime = +/* @__PURE__ */ new Date(), r2.lastSelOrigin = i2, r2.lastSelOp = n3, o3 && false !== o3.clearRedo && Oi(r2.undone);
}
function Ai(t4, e3) {
var n3 = X(e3);
n3 && n3.ranges && n3.equals(t4) || e3.push(t4);
}
function ji(t4, e3, n3, o3) {
var r2 = e3["spans_" + t4.id], i2 = 0;
t4.iter(Math.max(t4.first, n3), Math.min(t4.first + t4.size, o3), function(n4) {
n4.markedSpans && ((r2 || (r2 = e3["spans_" + t4.id] = {}))[i2] = n4.markedSpans), ++i2;
});
}
function Mi(t4) {
if (!t4)
return null;
for (var e3, n3 = 0; n3 < t4.length; ++n3)
t4[n3].marker.explicitlyCleared ? e3 || (e3 = t4.slice(0, n3)) : e3 && e3.push(t4[n3]);
return e3 ? e3.length ? e3 : null : t4;
}
function Li(t4, e3) {
var n3 = e3["spans_" + t4.id];
if (!n3)
return null;
for (var o3 = [], r2 = 0; r2 < e3.text.length; ++r2)
o3.push(Mi(n3[r2]));
return o3;
}
function Di(t4, e3) {
var n3 = Li(t4, e3), o3 = He(t4, e3);
if (!n3)
return o3;
if (!o3)
return n3;
for (var r2 = 0; r2 < n3.length; ++r2) {
var i2 = n3[r2], s2 = o3[r2];
if (i2 && s2)
t:
for (var a2 = 0; a2 < s2.length; ++a2) {
for (var l2 = s2[a2], c2 = 0; c2 < i2.length; ++c2)
if (i2[c2].marker == l2.marker)
continue t;
i2.push(l2);
}
else
s2 && (n3[r2] = s2);
}
return n3;
}
function Ni(t4, e3, n3) {
for (var o3 = [], r2 = 0; r2 < t4.length; ++r2) {
var i2 = t4[r2];
if (i2.ranges)
o3.push(n3 ? si.prototype.deepCopy.call(i2) : i2);
else {
var s2 = i2.changes, a2 = [];
o3.push({ changes: a2 });
for (var l2 = 0; l2 < s2.length; ++l2) {
var c2 = s2[l2], u2 = void 0;
if (a2.push({ from: c2.from, to: c2.to, text: c2.text }), e3)
for (var p2 in c2)
(u2 = p2.match(/^spans_(\d+)$/)) && z(e3, Number(u2[1])) > -1 && (X(a2)[p2] = c2[p2], delete c2[p2]);
}
}
}
return o3;
}
function Ii(t4, e3, n3, o3) {
if (o3) {
var r2 = t4.anchor;
if (n3) {
var i2 = ae(e3, r2) < 0;
i2 != ae(n3, r2) < 0 ? (r2 = e3, e3 = n3) : i2 != ae(e3, n3) < 0 && (e3 = n3);
}
return new ai(r2, e3);
}
return new ai(n3 || e3, e3);
}
function Fi(t4, e3, n3, o3, r2) {
null == r2 && (r2 = t4.cm && (t4.cm.display.shift || t4.extend)), Ui(t4, new si([Ii(t4.sel.primary(), e3, n3, r2)], 0), o3);
}
function Vi(t4, e3, n3) {
for (var o3 = [], r2 = t4.cm && (t4.cm.display.shift || t4.extend), i2 = 0; i2 < t4.sel.ranges.length; i2++)
o3[i2] = Ii(t4.sel.ranges[i2], e3[i2], null, r2);
Ui(t4, li(t4.cm, o3, t4.sel.primIndex), n3);
}
function Ri(t4, e3, n3, o3) {
var r2 = t4.sel.ranges.slice(0);
r2[e3] = n3, Ui(t4, li(t4.cm, r2, t4.sel.primIndex), o3);
}
function Hi(t4, e3, n3, o3) {
Ui(t4, ci(e3, n3), o3);
}
function zi(t4, e3, n3) {
var o3 = { ranges: e3.ranges, update: function(e4) {
this.ranges = [];
for (var n4 = 0; n4 < e4.length; n4++)
this.ranges[n4] = new ai(fe(t4, e4[n4].anchor), fe(t4, e4[n4].head));
}, origin: n3 && n3.origin };
return mt(t4, "beforeSelectionChange", t4, o3), t4.cm && mt(t4.cm, "beforeSelectionChange", t4.cm, o3), o3.ranges != e3.ranges ? li(t4.cm, o3.ranges, o3.ranges.length - 1) : e3;
}
function Bi(t4, e3, n3) {
var o3 = t4.history.done, r2 = X(o3);
r2 && r2.ranges ? (o3[o3.length - 1] = e3, Wi(t4, e3, n3)) : Ui(t4, e3, n3);
}
function Ui(t4, e3, n3) {
Wi(t4, e3, n3), Ei(t4, t4.sel, t4.cm ? t4.cm.curOp.id : NaN, n3);
}
function Wi(t4, e3, n3) {
(wt(t4, "beforeSelectionChange") || t4.cm && wt(t4.cm, "beforeSelectionChange")) && (e3 = zi(t4, e3, n3));
var o3 = n3 && n3.bias || (ae(e3.primary().head, t4.sel.primary().head) < 0 ? -1 : 1);
$i(t4, Gi(t4, e3, o3, true)), n3 && false === n3.scroll || !t4.cm || "nocursor" == t4.cm.getOption("readOnly") || cr(t4.cm);
}
function $i(t4, e3) {
e3.equals(t4.sel) || (t4.sel = e3, t4.cm && (t4.cm.curOp.updateInput = 1, t4.cm.curOp.selectionChanged = true, _t(t4.cm)), An(t4, "cursorActivity", t4));
}
function qi(t4) {
$i(t4, Gi(t4, t4.sel, null, false));
}
function Gi(t4, e3, n3, o3) {
for (var r2, i2 = 0; i2 < e3.ranges.length; i2++) {
var s2 = e3.ranges[i2], a2 = e3.ranges.length == t4.sel.ranges.length && t4.sel.ranges[i2], l2 = Yi(t4, s2.anchor, a2 && a2.anchor, n3, o3), c2 = s2.head == s2.anchor ? l2 : Yi(t4, s2.head, a2 && a2.head, n3, o3);
(r2 || l2 != s2.anchor || c2 != s2.head) && (r2 || (r2 = e3.ranges.slice(0, i2)), r2[i2] = new ai(l2, c2));
}
return r2 ? li(t4.cm, r2, e3.primIndex) : e3;
}
function Ki(t4, e3, n3, o3, r2) {
var i2 = Zt(t4, e3.line);
if (i2.markedSpans)
for (var s2 = 0; s2 < i2.markedSpans.length; ++s2) {
var a2 = i2.markedSpans[s2], l2 = a2.marker, c2 = "selectLeft" in l2 ? !l2.selectLeft : l2.inclusiveLeft, u2 = "selectRight" in l2 ? !l2.selectRight : l2.inclusiveRight;
if ((null == a2.from || (c2 ? a2.from <= e3.ch : a2.from < e3.ch)) && (null == a2.to || (u2 ? a2.to >= e3.ch : a2.to > e3.ch))) {
if (r2 && (mt(l2, "beforeCursorEnter"), l2.explicitlyCleared)) {
if (i2.markedSpans) {
--s2;
continue;
}
break;
}
if (!l2.atomic)
continue;
if (n3) {
var p2 = l2.find(o3 < 0 ? 1 : -1), d2 = void 0;
if ((o3 < 0 ? u2 : c2) && (p2 = Xi(t4, p2, -o3, p2 && p2.line == e3.line ? i2 : null)), p2 && p2.line == e3.line && (d2 = ae(p2, n3)) && (o3 < 0 ? d2 < 0 : d2 > 0))
return Ki(t4, p2, e3, o3, r2);
}
var f2 = l2.find(o3 < 0 ? -1 : 1);
return (o3 < 0 ? c2 : u2) && (f2 = Xi(t4, f2, o3, f2.line == e3.line ? i2 : null)), f2 ? Ki(t4, f2, e3, o3, r2) : null;
}
}
return e3;
}
function Yi(t4, e3, n3, o3, r2) {
var i2 = o3 || 1, s2 = Ki(t4, e3, n3, i2, r2) || !r2 && Ki(t4, e3, n3, i2, true) || Ki(t4, e3, n3, -i2, r2) || !r2 && Ki(t4, e3, n3, -i2, true);
return s2 || (t4.cantEdit = true, se(t4.first, 0));
}
function Xi(t4, e3, n3, o3) {
return n3 < 0 && 0 == e3.ch ? e3.line > t4.first ? fe(t4, se(e3.line - 1)) : null : n3 > 0 && e3.ch == (o3 || Zt(t4, e3.line)).text.length ? e3.line < t4.first + t4.size - 1 ? se(e3.line + 1, 0) : null : new se(e3.line, e3.ch + n3);
}
function Ji(t4) {
t4.setSelection(se(t4.firstLine(), 0), se(t4.lastLine()), W);
}
function Zi(t4, e3, n3) {
var o3 = { canceled: false, from: e3.from, to: e3.to, text: e3.text, origin: e3.origin, cancel: function() {
return o3.canceled = true;
} };
return n3 && (o3.update = function(e4, n4, r2, i2) {
e4 && (o3.from = fe(t4, e4)), n4 && (o3.to = fe(t4, n4)), r2 && (o3.text = r2), void 0 !== i2 && (o3.origin = i2);
}), mt(t4, "beforeChange", t4, o3), t4.cm && mt(t4.cm, "beforeChange", t4.cm, o3), o3.canceled ? (t4.cm && (t4.cm.curOp.updateInput = 2), null) : { from: o3.from, to: o3.to, text: o3.text, origin: o3.origin };
}
function Qi(t4, e3, n3) {
if (t4.cm) {
if (!t4.cm.curOp)
return Dr(t4.cm, Qi)(t4, e3, n3);
if (t4.cm.state.suppressEdits)
return;
}
if (!(wt(t4, "beforeChange") || t4.cm && wt(t4.cm, "beforeChange")) || (e3 = Zi(t4, e3, true))) {
var o3 = Ae && !n3 && Be(t4, e3.from, e3.to);
if (o3)
for (var r2 = o3.length - 1; r2 >= 0; --r2)
ts(t4, { from: o3[r2].from, to: o3[r2].to, text: r2 ? [""] : e3.text, origin: e3.origin });
else
ts(t4, e3);
}
}
function ts(t4, e3) {
if (1 != e3.text.length || "" != e3.text[0] || 0 != ae(e3.from, e3.to)) {
var n3 = di(t4, e3);
ki(t4, e3, n3, t4.cm ? t4.cm.curOp.id : NaN), os(t4, e3, n3, He(t4, e3));
var o3 = [];
bi(t4, function(t5, n4) {
n4 || -1 != z(o3, t5.history) || (ls(t5.history, e3), o3.push(t5.history)), os(t5, e3, null, He(t5, e3));
});
}
}
function es(t4, e3, n3) {
var o3 = t4.cm && t4.cm.state.suppressEdits;
if (!o3 || n3) {
for (var r2, i2 = t4.history, s2 = t4.sel, a2 = "undo" == e3 ? i2.done : i2.undone, l2 = "undo" == e3 ? i2.undone : i2.done, c2 = 0; c2 < a2.length && (r2 = a2[c2], n3 ? !r2.ranges || r2.equals(t4.sel) : r2.ranges); c2++)
;
if (c2 != a2.length) {
for (i2.lastOrigin = i2.lastSelOrigin = null; ; ) {
if (!(r2 = a2.pop()).ranges) {
if (o3)
return void a2.push(r2);
break;
}
if (Ai(r2, l2), n3 && !r2.equals(t4.sel))
return void Ui(t4, r2, { clearRedo: false });
s2 = r2;
}
var u2 = [];
Ai(s2, l2), l2.push({ changes: u2, generation: i2.generation }), i2.generation = r2.generation || ++i2.maxGeneration;
for (var p2 = wt(t4, "beforeChange") || t4.cm && wt(t4.cm, "beforeChange"), d2 = function(n4) {
var o4 = r2.changes[n4];
if (o4.origin = e3, p2 && !Zi(t4, o4, false))
return a2.length = 0, {};
u2.push(Si(t4, o4));
var i3 = n4 ? di(t4, o4) : X(a2);
os(t4, o4, i3, Di(t4, o4)), !n4 && t4.cm && t4.cm.scrollIntoView({ from: o4.from, to: ui(o4) });
var s3 = [];
bi(t4, function(t5, e4) {
e4 || -1 != z(s3, t5.history) || (ls(t5.history, o4), s3.push(t5.history)), os(t5, o4, null, Di(t5, o4));
});
}, f2 = r2.changes.length - 1; f2 >= 0; --f2) {
var h2 = d2(f2);
if (h2)
return h2.v;
}
}
}
}
function ns(t4, e3) {
if (0 != e3 && (t4.first += e3, t4.sel = new si(J(t4.sel.ranges, function(t5) {
return new ai(se(t5.anchor.line + e3, t5.anchor.ch), se(t5.head.line + e3, t5.head.ch));
}), t4.sel.primIndex), t4.cm)) {
Ro(t4.cm, t4.first, t4.first - e3, e3);
for (var n3 = t4.cm.display, o3 = n3.viewFrom; o3 < n3.viewTo; o3++)
Ho(t4.cm, o3, "gutter");
}
}
function os(t4, e3, n3, o3) {
if (t4.cm && !t4.cm.curOp)
return Dr(t4.cm, os)(t4, e3, n3, o3);
if (e3.to.line < t4.first)
ns(t4, e3.text.length - 1 - (e3.to.line - e3.from.line));
else if (!(e3.from.line > t4.lastLine())) {
if (e3.from.line < t4.first) {
var r2 = e3.text.length - 1 - (t4.first - e3.from.line);
ns(t4, r2), e3 = { from: se(t4.first, 0), to: se(e3.to.line + r2, e3.to.ch), text: [X(e3.text)], origin: e3.origin };
}
var i2 = t4.lastLine();
e3.to.line > i2 && (e3 = { from: e3.from, to: se(i2, Zt(t4, i2).text.length), text: [e3.text[0]], origin: e3.origin }), e3.removed = Qt(t4, e3.from, e3.to), n3 || (n3 = di(t4, e3)), t4.cm ? rs(t4.cm, e3, o3) : mi(t4, e3, o3), Wi(t4, n3, W), t4.cantEdit && Yi(t4, se(t4.firstLine(), 0)) && (t4.cantEdit = false);
}
}
function rs(t4, e3, n3) {
var o3 = t4.doc, r2 = t4.display, i2 = e3.from, s2 = e3.to, a2 = false, l2 = i2.line;
t4.options.lineWrapping || (l2 = ne(Qe(Zt(o3, i2.line))), o3.iter(l2, s2.line + 1, function(t5) {
if (t5 == r2.maxLine)
return a2 = true, true;
})), o3.sel.contains(e3.from, e3.to) > -1 && _t(t4), mi(o3, e3, n3, No(t4)), t4.options.lineWrapping || (o3.iter(l2, i2.line + e3.text.length, function(t5) {
var e4 = ln(t5);
e4 > r2.maxLineLength && (r2.maxLine = t5, r2.maxLineLength = e4, r2.maxLineChanged = true, a2 = false);
}), a2 && (t4.curOp.updateMaxLine = true)), Ee(o3, i2.line), Fr(t4, 400);
var c2 = e3.text.length - (s2.line - i2.line) - 1;
e3.full ? Ro(t4) : i2.line != s2.line || 1 != e3.text.length || yi(t4.doc, e3) ? Ro(t4, i2.line, s2.line + 1, c2) : Ho(t4, i2.line, "text");
var u2 = wt(t4, "changes"), p2 = wt(t4, "change");
if (p2 || u2) {
var d2 = { from: i2, to: s2, text: e3.text, removed: e3.removed, origin: e3.origin };
p2 && An(t4, "change", t4, d2), u2 && (t4.curOp.changeObjs || (t4.curOp.changeObjs = [])).push(d2);
}
t4.display.selForContextMenu = null;
}
function is(t4, e3, n3, o3, r2) {
var i2;
o3 || (o3 = n3), ae(o3, n3) < 0 && (n3 = (i2 = [o3, n3])[0], o3 = i2[1]), "string" == typeof e3 && (e3 = t4.splitLines(e3)), Qi(t4, { from: n3, to: o3, text: e3, origin: r2 });
}
function ss(t4, e3, n3, o3) {
n3 < t4.line ? t4.line += o3 : e3 < t4.line && (t4.line = e3, t4.ch = 0);
}
function as(t4, e3, n3, o3) {
for (var r2 = 0; r2 < t4.length; ++r2) {
var i2 = t4[r2], s2 = true;
if (i2.ranges) {
i2.copied || ((i2 = t4[r2] = i2.deepCopy()).copied = true);
for (var a2 = 0; a2 < i2.ranges.length; a2++)
ss(i2.ranges[a2].anchor, e3, n3, o3), ss(i2.ranges[a2].head, e3, n3, o3);
} else {
for (var l2 = 0; l2 < i2.changes.length; ++l2) {
var c2 = i2.changes[l2];
if (n3 < c2.from.line)
c2.from = se(c2.from.line + o3, c2.from.ch), c2.to = se(c2.to.line + o3, c2.to.ch);
else if (e3 <= c2.to.line) {
s2 = false;
break;
}
}
s2 || (t4.splice(0, r2 + 1), r2 = 0);
}
}
}
function ls(t4, e3) {
var n3 = e3.from.line, o3 = e3.to.line, r2 = e3.text.length - (o3 - n3) - 1;
as(t4.done, n3, o3, r2), as(t4.undone, n3, o3, r2);
}
function cs(t4, e3, n3, o3) {
var r2 = e3, i2 = e3;
return "number" == typeof e3 ? i2 = Zt(t4, de(t4, e3)) : r2 = ne(e3), null == r2 ? null : (o3(i2, r2) && t4.cm && Ho(t4.cm, r2, n3), i2);
}
function us(t4) {
this.lines = t4, this.parent = null;
for (var e3 = 0, n3 = 0; n3 < t4.length; ++n3)
t4[n3].parent = this, e3 += t4[n3].height;
this.height = e3;
}
function ps(t4) {
this.children = t4;
for (var e3 = 0, n3 = 0, o3 = 0; o3 < t4.length; ++o3) {
var r2 = t4[o3];
e3 += r2.chunkSize(), n3 += r2.height, r2.parent = this;
}
this.size = e3, this.height = n3, this.parent = null;
}
ai.prototype.from = function() {
return pe(this.anchor, this.head);
}, ai.prototype.to = function() {
return ue(this.anchor, this.head);
}, ai.prototype.empty = function() {
return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch;
}, us.prototype = { chunkSize: function() {
return this.lines.length;
}, removeInner: function(t4, e3) {
for (var n3 = t4, o3 = t4 + e3; n3 < o3; ++n3) {
var r2 = this.lines[n3];
this.height -= r2.height, dn(r2), An(r2, "delete");
}
this.lines.splice(t4, e3);
}, collapse: function(t4) {
t4.push.apply(t4, this.lines);
}, insertInner: function(t4, e3, n3) {
this.height += n3, this.lines = this.lines.slice(0, t4).concat(e3).concat(this.lines.slice(t4));
for (var o3 = 0; o3 < e3.length; ++o3)
e3[o3].parent = this;
}, iterN: function(t4, e3, n3) {
for (var o3 = t4 + e3; t4 < o3; ++t4)
if (n3(this.lines[t4]))
return true;
} }, ps.prototype = { chunkSize: function() {
return this.size;
}, removeInner: function(t4, e3) {
this.size -= e3;
for (var n3 = 0; n3 < this.children.length; ++n3) {
var o3 = this.children[n3], r2 = o3.chunkSize();
if (t4 < r2) {
var i2 = Math.min(e3, r2 - t4), s2 = o3.height;
if (o3.removeInner(t4, i2), this.height -= s2 - o3.height, r2 == i2 && (this.children.splice(n3--, 1), o3.parent = null), 0 == (e3 -= i2))
break;
t4 = 0;
} else
t4 -= r2;
}
if (this.size - e3 < 25 && (this.children.length > 1 || !(this.children[0] instanceof us))) {
var a2 = [];
this.collapse(a2), this.children = [new us(a2)], this.children[0].parent = this;
}
}, collapse: function(t4) {
for (var e3 = 0; e3 < this.children.length; ++e3)
this.children[e3].collapse(t4);
}, insertInner: function(t4, e3, n3) {
this.size += e3.length, this.height += n3;
for (var o3 = 0; o3 < this.children.length; ++o3) {
var r2 = this.children[o3], i2 = r2.chunkSize();
if (t4 <= i2) {
if (r2.insertInner(t4, e3, n3), r2.lines && r2.lines.length > 50) {
for (var s2 = r2.lines.length % 25 + 25, a2 = s2; a2 < r2.lines.length; ) {
var l2 = new us(r2.lines.slice(a2, a2 += 25));
r2.height -= l2.height, this.children.splice(++o3, 0, l2), l2.parent = this;
}
r2.lines = r2.lines.slice(0, s2), this.maybeSpill();
}
break;
}
t4 -= i2;
}
}, maybeSpill: function() {
if (!(this.children.length <= 10)) {
var t4 = this;
do {
var e3 = new ps(t4.children.splice(t4.children.length - 5, 5));
if (t4.parent) {
t4.size -= e3.size, t4.height -= e3.height;
var n3 = z(t4.parent.children, t4);
t4.parent.children.splice(n3 + 1, 0, e3);
} else {
var o3 = new ps(t4.children);
o3.parent = t4, t4.children = [o3, e3], t4 = o3;
}
e3.parent = t4.parent;
} while (t4.children.length > 10);
t4.parent.maybeSpill();
}
}, iterN: function(t4, e3, n3) {
for (var o3 = 0; o3 < this.children.length; ++o3) {
var r2 = this.children[o3], i2 = r2.chunkSize();
if (t4 < i2) {
var s2 = Math.min(e3, i2 - t4);
if (r2.iterN(t4, s2, n3))
return true;
if (0 == (e3 -= s2))
break;
t4 = 0;
} else
t4 -= i2;
}
} };
var ds = function(t4, e3, n3) {
if (n3)
for (var o3 in n3)
n3.hasOwnProperty(o3) && (this[o3] = n3[o3]);
this.doc = t4, this.node = e3;
};
function fs(t4, e3, n3) {
an(e3) < (t4.curOp && t4.curOp.scrollTop || t4.doc.scrollTop) && lr(t4, n3);
}
function hs(t4, e3, n3, o3) {
var r2 = new ds(t4, n3, o3), i2 = t4.cm;
return i2 && r2.noHScroll && (i2.display.alignWidgets = true), cs(t4, e3, "widget", function(e4) {
var n4 = e4.widgets || (e4.widgets = []);
if (null == r2.insertAt ? n4.push(r2) : n4.splice(Math.min(n4.length, Math.max(0, r2.insertAt)), 0, r2), r2.line = e4, i2 && !rn(t4, e4)) {
var o4 = an(e4) < t4.scrollTop;
ee(e4, e4.height + Wn(r2)), o4 && lr(i2, r2.height), i2.curOp.forceUpdate = true;
}
return true;
}), i2 && An(i2, "lineWidgetAdded", i2, r2, "number" == typeof e3 ? e3 : ne(e3)), r2;
}
ds.prototype.clear = function() {
var t4 = this.doc.cm, e3 = this.line.widgets, n3 = this.line, o3 = ne(n3);
if (null != o3 && e3) {
for (var r2 = 0; r2 < e3.length; ++r2)
e3[r2] == this && e3.splice(r2--, 1);
e3.length || (n3.widgets = null);
var i2 = Wn(this);
ee(n3, Math.max(0, n3.height - i2)), t4 && (Lr(t4, function() {
fs(t4, n3, -i2), Ho(t4, o3, "widget");
}), An(t4, "lineWidgetCleared", t4, this, o3));
}
}, ds.prototype.changed = function() {
var t4 = this, e3 = this.height, n3 = this.doc.cm, o3 = this.line;
this.height = null;
var r2 = Wn(this) - e3;
r2 && (rn(this.doc, o3) || ee(o3, o3.height + r2), n3 && Lr(n3, function() {
n3.curOp.forceUpdate = true, fs(n3, o3, r2), An(n3, "lineWidgetChanged", n3, t4, ne(o3));
}));
}, xt(ds);
var gs = 0, vs = function(t4, e3) {
this.lines = [], this.type = e3, this.doc = t4, this.id = ++gs;
};
function ys(t4, e3, n3, o3, r2) {
if (o3 && o3.shared)
return bs(t4, e3, n3, o3, r2);
if (t4.cm && !t4.cm.curOp)
return Dr(t4.cm, ys)(t4, e3, n3, o3, r2);
var i2 = new vs(t4, r2), s2 = ae(e3, n3);
if (o3 && V(o3, i2, false), s2 > 0 || 0 == s2 && false !== i2.clearWhenEmpty)
return i2;
if (i2.replacedWith && (i2.collapsed = true, i2.widgetNode = j("span", [i2.replacedWith], "CodeMirror-widget"), o3.handleMouseEvents || i2.widgetNode.setAttribute("cm-ignore-events", "true"), o3.insertLeft && (i2.widgetNode.insertLeft = true)), i2.collapsed) {
if (Ze(t4, e3.line, e3, n3, i2) || e3.line != n3.line && Ze(t4, n3.line, e3, n3, i2))
throw new Error("Inserting collapsed marker partially overlapping an existing one");
Le();
}
i2.addToHistory && ki(t4, { from: e3, to: n3, origin: "markText" }, t4.sel, NaN);
var a2, l2 = e3.line, c2 = t4.cm;
if (t4.iter(l2, n3.line + 1, function(o4) {
c2 && i2.collapsed && !c2.options.lineWrapping && Qe(o4) == c2.display.maxLine && (a2 = true), i2.collapsed && l2 != e3.line && ee(o4, 0), Fe(o4, new De(i2, l2 == e3.line ? e3.ch : null, l2 == n3.line ? n3.ch : null), t4.cm && t4.cm.curOp), ++l2;
}), i2.collapsed && t4.iter(e3.line, n3.line + 1, function(e4) {
rn(t4, e4) && ee(e4, 0);
}), i2.clearOnEnter && gt(i2, "beforeCursorEnter", function() {
return i2.clear();
}), i2.readOnly && (Me(), (t4.history.done.length || t4.history.undone.length) && t4.clearHistory()), i2.collapsed && (i2.id = ++gs, i2.atomic = true), c2) {
if (a2 && (c2.curOp.updateMaxLine = true), i2.collapsed)
Ro(c2, e3.line, n3.line + 1);
else if (i2.className || i2.startStyle || i2.endStyle || i2.css || i2.attributes || i2.title)
for (var u2 = e3.line; u2 <= n3.line; u2++)
Ho(c2, u2, "text");
i2.atomic && qi(c2.doc), An(c2, "markerAdded", c2, i2);
}
return i2;
}
vs.prototype.clear = function() {
if (!this.explicitlyCleared) {
var t4 = this.doc.cm, e3 = t4 && !t4.curOp;
if (e3 && Or(t4), wt(this, "clear")) {
var n3 = this.find();
n3 && An(this, "clear", n3.from, n3.to);
}
for (var o3 = null, r2 = null, i2 = 0; i2 < this.lines.length; ++i2) {
var s2 = this.lines[i2], a2 = Ne(s2.markedSpans, this);
t4 && !this.collapsed ? Ho(t4, ne(s2), "text") : t4 && (null != a2.to && (r2 = ne(s2)), null != a2.from && (o3 = ne(s2))), s2.markedSpans = Ie(s2.markedSpans, a2), null == a2.from && this.collapsed && !rn(this.doc, s2) && t4 && ee(s2, jo(t4.display));
}
if (t4 && this.collapsed && !t4.options.lineWrapping)
for (var l2 = 0; l2 < this.lines.length; ++l2) {
var c2 = Qe(this.lines[l2]), u2 = ln(c2);
u2 > t4.display.maxLineLength && (t4.display.maxLine = c2, t4.display.maxLineLength = u2, t4.display.maxLineChanged = true);
}
null != o3 && t4 && this.collapsed && Ro(t4, o3, r2 + 1), this.lines.length = 0, this.explicitlyCleared = true, this.atomic && this.doc.cantEdit && (this.doc.cantEdit = false, t4 && qi(t4.doc)), t4 && An(t4, "markerCleared", t4, this, o3, r2), e3 && Tr(t4), this.parent && this.parent.clear();
}
}, vs.prototype.find = function(t4, e3) {
var n3, o3;
null == t4 && "bookmark" == this.type && (t4 = 1);
for (var r2 = 0; r2 < this.lines.length; ++r2) {
var i2 = this.lines[r2], s2 = Ne(i2.markedSpans, this);
if (null != s2.from && (n3 = se(e3 ? i2 : ne(i2), s2.from), -1 == t4))
return n3;
if (null != s2.to && (o3 = se(e3 ? i2 : ne(i2), s2.to), 1 == t4))
return o3;
}
return n3 && { from: n3, to: o3 };
}, vs.prototype.changed = function() {
var t4 = this, e3 = this.find(-1, true), n3 = this, o3 = this.doc.cm;
e3 && o3 && Lr(o3, function() {
var r2 = e3.line, i2 = ne(e3.line), s2 = no(o3, i2);
if (s2 && (po(s2), o3.curOp.selectionChanged = o3.curOp.forceUpdate = true), o3.curOp.updateMaxLine = true, !rn(n3.doc, r2) && null != n3.height) {
var a2 = n3.height;
n3.height = null;
var l2 = Wn(n3) - a2;
l2 && ee(r2, r2.height + l2);
}
An(o3, "markerChanged", o3, t4);
});
}, vs.prototype.attachLine = function(t4) {
if (!this.lines.length && this.doc.cm) {
var e3 = this.doc.cm.curOp;
e3.maybeHiddenMarkers && -1 != z(e3.maybeHiddenMarkers, this) || (e3.maybeUnhiddenMarkers || (e3.maybeUnhiddenMarkers = [])).push(this);
}
this.lines.push(t4);
}, vs.prototype.detachLine = function(t4) {
if (this.lines.splice(z(this.lines, t4), 1), !this.lines.length && this.doc.cm) {
var e3 = this.doc.cm.curOp;
(e3.maybeHiddenMarkers || (e3.maybeHiddenMarkers = [])).push(this);
}
}, xt(vs);
var ms = function(t4, e3) {
this.markers = t4, this.primary = e3;
for (var n3 = 0; n3 < t4.length; ++n3)
t4[n3].parent = this;
};
function bs(t4, e3, n3, o3, r2) {
(o3 = V(o3)).shared = false;
var i2 = [ys(t4, e3, n3, o3, r2)], s2 = i2[0], a2 = o3.widgetNode;
return bi(t4, function(t5) {
a2 && (o3.widgetNode = a2.cloneNode(true)), i2.push(ys(t5, fe(t5, e3), fe(t5, n3), o3, r2));
for (var l2 = 0; l2 < t5.linked.length; ++l2)
if (t5.linked[l2].isParent)
return;
s2 = X(i2);
}), new ms(i2, s2);
}
function _s(t4) {
return t4.findMarks(se(t4.first, 0), t4.clipPos(se(t4.lastLine())), function(t5) {
return t5.parent;
});
}
function ws(t4, e3) {
for (var n3 = 0; n3 < e3.length; n3++) {
var o3 = e3[n3], r2 = o3.find(), i2 = t4.clipPos(r2.from), s2 = t4.clipPos(r2.to);
if (ae(i2, s2)) {
var a2 = ys(t4, i2, s2, o3.primary, o3.primary.type);
o3.markers.push(a2), a2.parent = o3;
}
}
}
function xs(t4) {
for (var e3 = function(e4) {
var n4 = t4[e4], o3 = [n4.primary.doc];
bi(n4.primary.doc, function(t5) {
return o3.push(t5);
});
for (var r2 = 0; r2 < n4.markers.length; r2++) {
var i2 = n4.markers[r2];
-1 == z(o3, i2.doc) && (i2.parent = null, n4.markers.splice(r2--, 1));
}
}, n3 = 0; n3 < t4.length; n3++)
e3(n3);
}
ms.prototype.clear = function() {
if (!this.explicitlyCleared) {
this.explicitlyCleared = true;
for (var t4 = 0; t4 < this.markers.length; ++t4)
this.markers[t4].clear();
An(this, "clear");
}
}, ms.prototype.find = function(t4, e3) {
return this.primary.find(t4, e3);
}, xt(ms);
var Cs = 0, Ss = function(t4, e3, n3, o3, r2) {
if (!(this instanceof Ss))
return new Ss(t4, e3, n3, o3, r2);
null == n3 && (n3 = 0), ps.call(this, [new us([new un("", null)])]), this.first = n3, this.scrollTop = this.scrollLeft = 0, this.cantEdit = false, this.cleanGeneration = 1, this.modeFrontier = this.highlightFrontier = n3;
var i2 = se(n3, 0);
this.sel = ci(i2), this.history = new Ci(null), this.id = ++Cs, this.modeOption = e3, this.lineSep = o3, this.direction = "rtl" == r2 ? "rtl" : "ltr", this.extend = false, "string" == typeof t4 && (t4 = this.splitLines(t4)), mi(this, { from: i2, to: i2, text: t4 }), Ui(this, ci(i2), W);
};
Ss.prototype = tt(ps.prototype, { constructor: Ss, iter: function(t4, e3, n3) {
n3 ? this.iterN(t4 - this.first, e3 - t4, n3) : this.iterN(this.first, this.first + this.size, t4);
}, insert: function(t4, e3) {
for (var n3 = 0, o3 = 0; o3 < e3.length; ++o3)
n3 += e3[o3].height;
this.insertInner(t4 - this.first, e3, n3);
}, remove: function(t4, e3) {
this.removeInner(t4 - this.first, e3);
}, getValue: function(t4) {
var e3 = te(this, this.first, this.first + this.size);
return false === t4 ? e3 : e3.join(t4 || this.lineSeparator());
}, setValue: Ir(function(t4) {
var e3 = se(this.first, 0), n3 = this.first + this.size - 1;
Qi(this, { from: e3, to: se(n3, Zt(this, n3).text.length), text: this.splitLines(t4), origin: "setValue", full: true }, true), this.cm && ur(this.cm, 0, 0), Ui(this, ci(e3), W);
}), replaceRange: function(t4, e3, n3, o3) {
is(this, t4, e3 = fe(this, e3), n3 = n3 ? fe(this, n3) : e3, o3);
}, getRange: function(t4, e3, n3) {
var o3 = Qt(this, fe(this, t4), fe(this, e3));
return false === n3 ? o3 : "" === n3 ? o3.join("") : o3.join(n3 || this.lineSeparator());
}, getLine: function(t4) {
var e3 = this.getLineHandle(t4);
return e3 && e3.text;
}, getLineHandle: function(t4) {
if (re(this, t4))
return Zt(this, t4);
}, getLineNumber: function(t4) {
return ne(t4);
}, getLineHandleVisualStart: function(t4) {
return "number" == typeof t4 && (t4 = Zt(this, t4)), Qe(t4);
}, lineCount: function() {
return this.size;
}, firstLine: function() {
return this.first;
}, lastLine: function() {
return this.first + this.size - 1;
}, clipPos: function(t4) {
return fe(this, t4);
}, getCursor: function(t4) {
var e3 = this.sel.primary();
return null == t4 || "head" == t4 ? e3.head : "anchor" == t4 ? e3.anchor : "end" == t4 || "to" == t4 || false === t4 ? e3.to() : e3.from();
}, listSelections: function() {
return this.sel.ranges;
}, somethingSelected: function() {
return this.sel.somethingSelected();
}, setCursor: Ir(function(t4, e3, n3) {
Hi(this, fe(this, "number" == typeof t4 ? se(t4, e3 || 0) : t4), null, n3);
}), setSelection: Ir(function(t4, e3, n3) {
Hi(this, fe(this, t4), fe(this, e3 || t4), n3);
}), extendSelection: Ir(function(t4, e3, n3) {
Fi(this, fe(this, t4), e3 && fe(this, e3), n3);
}), extendSelections: Ir(function(t4, e3) {
Vi(this, ge(this, t4), e3);
}), extendSelectionsBy: Ir(function(t4, e3) {
Vi(this, ge(this, J(this.sel.ranges, t4)), e3);
}), setSelections: Ir(function(t4, e3, n3) {
if (t4.length) {
for (var o3 = [], r2 = 0; r2 < t4.length; r2++)
o3[r2] = new ai(fe(this, t4[r2].anchor), fe(this, t4[r2].head || t4[r2].anchor));
null == e3 && (e3 = Math.min(t4.length - 1, this.sel.primIndex)), Ui(this, li(this.cm, o3, e3), n3);
}
}), addSelection: Ir(function(t4, e3, n3) {
var o3 = this.sel.ranges.slice(0);
o3.push(new ai(fe(this, t4), fe(this, e3 || t4))), Ui(this, li(this.cm, o3, o3.length - 1), n3);
}), getSelection: function(t4) {
for (var e3, n3 = this.sel.ranges, o3 = 0; o3 < n3.length; o3++) {
var r2 = Qt(this, n3[o3].from(), n3[o3].to());
e3 = e3 ? e3.concat(r2) : r2;
}
return false === t4 ? e3 : e3.join(t4 || this.lineSeparator());
}, getSelections: function(t4) {
for (var e3 = [], n3 = this.sel.ranges, o3 = 0; o3 < n3.length; o3++) {
var r2 = Qt(this, n3[o3].from(), n3[o3].to());
false !== t4 && (r2 = r2.join(t4 || this.lineSeparator())), e3[o3] = r2;
}
return e3;
}, replaceSelection: function(t4, e3, n3) {
for (var o3 = [], r2 = 0; r2 < this.sel.ranges.length; r2++)
o3[r2] = t4;
this.replaceSelections(o3, e3, n3 || "+input");
}, replaceSelections: Ir(function(t4, e3, n3) {
for (var o3 = [], r2 = this.sel, i2 = 0; i2 < r2.ranges.length; i2++) {
var s2 = r2.ranges[i2];
o3[i2] = { from: s2.from(), to: s2.to(), text: this.splitLines(t4[i2]), origin: n3 };
}
for (var a2 = e3 && "end" != e3 && hi(this, o3, e3), l2 = o3.length - 1; l2 >= 0; l2--)
Qi(this, o3[l2]);
a2 ? Bi(this, a2) : this.cm && cr(this.cm);
}), undo: Ir(function() {
es(this, "undo");
}), redo: Ir(function() {
es(this, "redo");
}), undoSelection: Ir(function() {
es(this, "undo", true);
}), redoSelection: Ir(function() {
es(this, "redo", true);
}), setExtending: function(t4) {
this.extend = t4;
}, getExtending: function() {
return this.extend;
}, historySize: function() {
for (var t4 = this.history, e3 = 0, n3 = 0, o3 = 0; o3 < t4.done.length; o3++)
t4.done[o3].ranges || ++e3;
for (var r2 = 0; r2 < t4.undone.length; r2++)
t4.undone[r2].ranges || ++n3;
return { undo: e3, redo: n3 };
}, clearHistory: function() {
var t4 = this;
this.history = new Ci(this.history), bi(this, function(e3) {
return e3.history = t4.history;
}, true);
}, markClean: function() {
this.cleanGeneration = this.changeGeneration(true);
}, changeGeneration: function(t4) {
return t4 && (this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null), this.history.generation;
}, isClean: function(t4) {
return this.history.generation == (t4 || this.cleanGeneration);
}, getHistory: function() {
return { done: Ni(this.history.done), undone: Ni(this.history.undone) };
}, setHistory: function(t4) {
var e3 = this.history = new Ci(this.history);
e3.done = Ni(t4.done.slice(0), null, true), e3.undone = Ni(t4.undone.slice(0), null, true);
}, setGutterMarker: Ir(function(t4, e3, n3) {
return cs(this, t4, "gutter", function(t5) {
var o3 = t5.gutterMarkers || (t5.gutterMarkers = {});
return o3[e3] = n3, !n3 && rt(o3) && (t5.gutterMarkers = null), true;
});
}), clearGutter: Ir(function(t4) {
var e3 = this;
this.iter(function(n3) {
n3.gutterMarkers && n3.gutterMarkers[t4] && cs(e3, n3, "gutter", function() {
return n3.gutterMarkers[t4] = null, rt(n3.gutterMarkers) && (n3.gutterMarkers = null), true;
});
});
}), lineInfo: function(t4) {
var e3;
if ("number" == typeof t4) {
if (!re(this, t4))
return null;
if (e3 = t4, !(t4 = Zt(this, t4)))
return null;
} else if (null == (e3 = ne(t4)))
return null;
return { line: e3, handle: t4, text: t4.text, gutterMarkers: t4.gutterMarkers, textClass: t4.textClass, bgClass: t4.bgClass, wrapClass: t4.wrapClass, widgets: t4.widgets };
}, addLineClass: Ir(function(t4, e3, n3) {
return cs(this, t4, "gutter" == e3 ? "gutter" : "class", function(t5) {
var o3 = "text" == e3 ? "textClass" : "background" == e3 ? "bgClass" : "gutter" == e3 ? "gutterClass" : "wrapClass";
if (t5[o3]) {
if (O(n3).test(t5[o3]))
return false;
t5[o3] += " " + n3;
} else
t5[o3] = n3;
return true;
});
}), removeLineClass: Ir(function(t4, e3, n3) {
return cs(this, t4, "gutter" == e3 ? "gutter" : "class", function(t5) {
var o3 = "text" == e3 ? "textClass" : "background" == e3 ? "bgClass" : "gutter" == e3 ? "gutterClass" : "wrapClass", r2 = t5[o3];
if (!r2)
return false;
if (null == n3)
t5[o3] = null;
else {
var i2 = r2.match(O(n3));
if (!i2)
return false;
var s2 = i2.index + i2[0].length;
t5[o3] = r2.slice(0, i2.index) + (i2.index && s2 != r2.length ? " " : "") + r2.slice(s2) || null;
}
return true;
});
}), addLineWidget: Ir(function(t4, e3, n3) {
return hs(this, t4, e3, n3);
}), removeLineWidget: function(t4) {
t4.clear();
}, markText: function(t4, e3, n3) {
return ys(this, fe(this, t4), fe(this, e3), n3, n3 && n3.type || "range");
}, setBookmark: function(t4, e3) {
var n3 = { replacedWith: e3 && (null == e3.nodeType ? e3.widget : e3), insertLeft: e3 && e3.insertLeft, clearWhenEmpty: false, shared: e3 && e3.shared, handleMouseEvents: e3 && e3.handleMouseEvents };
return ys(this, t4 = fe(this, t4), t4, n3, "bookmark");
}, findMarksAt: function(t4) {
var e3 = [], n3 = Zt(this, (t4 = fe(this, t4)).line).markedSpans;
if (n3)
for (var o3 = 0; o3 < n3.length; ++o3) {
var r2 = n3[o3];
(null == r2.from || r2.from <= t4.ch) && (null == r2.to || r2.to >= t4.ch) && e3.push(r2.marker.parent || r2.marker);
}
return e3;
}, findMarks: function(t4, e3, n3) {
t4 = fe(this, t4), e3 = fe(this, e3);
var o3 = [], r2 = t4.line;
return this.iter(t4.line, e3.line + 1, function(i2) {
var s2 = i2.markedSpans;
if (s2)
for (var a2 = 0; a2 < s2.length; a2++) {
var l2 = s2[a2];
null != l2.to && r2 == t4.line && t4.ch >= l2.to || null == l2.from && r2 != t4.line || null != l2.from && r2 == e3.line && l2.from >= e3.ch || n3 && !n3(l2.marker) || o3.push(l2.marker.parent || l2.marker);
}
++r2;
}), o3;
}, getAllMarks: function() {
var t4 = [];
return this.iter(function(e3) {
var n3 = e3.markedSpans;
if (n3)
for (var o3 = 0; o3 < n3.length; ++o3)
null != n3[o3].from && t4.push(n3[o3].marker);
}), t4;
}, posFromIndex: function(t4) {
var e3, n3 = this.first, o3 = this.lineSeparator().length;
return this.iter(function(r2) {
var i2 = r2.text.length + o3;
if (i2 > t4)
return e3 = t4, true;
t4 -= i2, ++n3;
}), fe(this, se(n3, e3));
}, indexFromPos: function(t4) {
var e3 = (t4 = fe(this, t4)).ch;
if (t4.line < this.first || t4.ch < 0)
return 0;
var n3 = this.lineSeparator().length;
return this.iter(this.first, t4.line, function(t5) {
e3 += t5.text.length + n3;
}), e3;
}, copy: function(t4) {
var e3 = new Ss(te(this, this.first, this.first + this.size), this.modeOption, this.first, this.lineSep, this.direction);
return e3.scrollTop = this.scrollTop, e3.scrollLeft = this.scrollLeft, e3.sel = this.sel, e3.extend = false, t4 && (e3.history.undoDepth = this.history.undoDepth, e3.setHistory(this.getHistory())), e3;
}, linkedDoc: function(t4) {
t4 || (t4 = {});
var e3 = this.first, n3 = this.first + this.size;
null != t4.from && t4.from > e3 && (e3 = t4.from), null != t4.to && t4.to < n3 && (n3 = t4.to);
var o3 = new Ss(te(this, e3, n3), t4.mode || this.modeOption, e3, this.lineSep, this.direction);
return t4.sharedHist && (o3.history = this.history), (this.linked || (this.linked = [])).push({ doc: o3, sharedHist: t4.sharedHist }), o3.linked = [{ doc: this, isParent: true, sharedHist: t4.sharedHist }], ws(o3, _s(this)), o3;
}, unlinkDoc: function(t4) {
if (t4 instanceof Va && (t4 = t4.doc), this.linked) {
for (var e3 = 0; e3 < this.linked.length; ++e3)
if (this.linked[e3].doc == t4) {
this.linked.splice(e3, 1), t4.unlinkDoc(this), xs(_s(this));
break;
}
}
if (t4.history == this.history) {
var n3 = [t4.id];
bi(t4, function(t5) {
return n3.push(t5.id);
}, true), t4.history = new Ci(null), t4.history.done = Ni(this.history.done, n3), t4.history.undone = Ni(this.history.undone, n3);
}
}, iterLinkedDocs: function(t4) {
bi(this, t4);
}, getMode: function() {
return this.mode;
}, getEditor: function() {
return this.cm;
}, splitLines: function(t4) {
return this.lineSep ? t4.split(this.lineSep) : Nt(t4);
}, lineSeparator: function() {
return this.lineSep || "\n";
}, setDirection: Ir(function(t4) {
"rtl" != t4 && (t4 = "ltr"), t4 != this.direction && (this.direction = t4, this.iter(function(t5) {
return t5.order = null;
}), this.cm && xi(this.cm));
}) }), Ss.prototype.eachLine = Ss.prototype.iter;
var Os = 0;
function Ts(t4) {
var e3 = this;
if (Es(e3), !bt(e3, t4) && !$n(e3.display, t4)) {
Ct(t4), s && (Os = +/* @__PURE__ */ new Date());
var n3 = Fo(e3, t4, true), o3 = t4.dataTransfer.files;
if (n3 && !e3.isReadOnly())
if (o3 && o3.length && window.FileReader && window.File)
for (var r2 = o3.length, i2 = Array(r2), a2 = 0, l2 = function() {
++a2 == r2 && Dr(e3, function() {
var t5 = { from: n3 = fe(e3.doc, n3), to: n3, text: e3.doc.splitLines(i2.filter(function(t6) {
return null != t6;
}).join(e3.doc.lineSeparator())), origin: "paste" };
Qi(e3.doc, t5), Bi(e3.doc, ci(fe(e3.doc, n3), fe(e3.doc, ui(t5))));
})();
}, c2 = function(t5, n4) {
if (e3.options.allowDropFileTypes && -1 == z(e3.options.allowDropFileTypes, t5.type))
l2();
else {
var o4 = new FileReader();
o4.onerror = function() {
return l2();
}, o4.onload = function() {
var t6 = o4.result;
/[\x00-\x08\x0e-\x1f]{2}/.test(t6) || (i2[n4] = t6), l2();
}, o4.readAsText(t5);
}
}, u2 = 0; u2 < o3.length; u2++)
c2(o3[u2], u2);
else {
if (e3.state.draggingText && e3.doc.sel.contains(n3) > -1)
return e3.state.draggingText(t4), void setTimeout(function() {
return e3.display.input.focus();
}, 20);
try {
var p2 = t4.dataTransfer.getData("Text");
if (p2) {
var d2;
if (e3.state.draggingText && !e3.state.draggingText.copy && (d2 = e3.listSelections()), Wi(e3.doc, ci(n3, n3)), d2)
for (var f2 = 0; f2 < d2.length; ++f2)
is(e3.doc, "", d2[f2].anchor, d2[f2].head, "drag");
e3.replaceSelection(p2, "around", "paste"), e3.display.input.focus();
}
} catch (t5) {
}
}
}
}
function ks(t4, e3) {
if (s && (!t4.state.draggingText || +/* @__PURE__ */ new Date() - Os < 100))
Tt(e3);
else if (!bt(t4, e3) && !$n(t4.display, e3) && (e3.dataTransfer.setData("Text", t4.getSelection()), e3.dataTransfer.effectAllowed = "copyMove", e3.dataTransfer.setDragImage && !f)) {
var n3 = A("img", null, null, "position: fixed; left: 0; top: 0;");
n3.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==", d && (n3.width = n3.height = 1, t4.display.wrapper.appendChild(n3), n3._top = n3.offsetTop), e3.dataTransfer.setDragImage(n3, 0, 0), d && n3.parentNode.removeChild(n3);
}
}
function Ps(t4, e3) {
var n3 = Fo(t4, e3);
if (n3) {
var o3 = document.createDocumentFragment();
Go(t4, n3, o3), t4.display.dragCursor || (t4.display.dragCursor = A("div", null, "CodeMirror-cursors CodeMirror-dragcursors"), t4.display.lineSpace.insertBefore(t4.display.dragCursor, t4.display.cursorDiv)), E(t4.display.dragCursor, o3);
}
}
function Es(t4) {
t4.display.dragCursor && (t4.display.lineSpace.removeChild(t4.display.dragCursor), t4.display.dragCursor = null);
}
function As(t4) {
if (document.getElementsByClassName) {
for (var e3 = document.getElementsByClassName("CodeMirror"), n3 = [], o3 = 0; o3 < e3.length; o3++) {
var r2 = e3[o3].CodeMirror;
r2 && n3.push(r2);
}
n3.length && n3[0].operation(function() {
for (var e4 = 0; e4 < n3.length; e4++)
t4(n3[e4]);
});
}
}
var js = false;
function Ms() {
js || (Ls(), js = true);
}
function Ls() {
var t4;
gt(window, "resize", function() {
null == t4 && (t4 = setTimeout(function() {
t4 = null, As(Ds);
}, 100));
}), gt(window, "blur", function() {
return As(tr);
});
}
function Ds(t4) {
var e3 = t4.display;
e3.cachedCharWidth = e3.cachedTextHeight = e3.cachedPaddingH = null, e3.scrollbarsClipped = false, t4.setSize();
}
for (var Ns = { 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: "=", 91: "Mod", 92: "Mod", 93: "Mod", 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 145: "ScrollLock", 173: "-", 186: ";", 187: "=", 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" }, Is = 0; Is < 10; Is++)
Ns[Is + 48] = Ns[Is + 96] = String(Is);
for (var Fs = 65; Fs <= 90; Fs++)
Ns[Fs] = String.fromCharCode(Fs);
for (var Vs = 1; Vs <= 12; Vs++)
Ns[Vs + 111] = Ns[Vs + 63235] = "F" + Vs;
var Rs = {};
function Hs(t4) {
var e3, n3, o3, r2, i2 = t4.split(/-(?!$)/);
t4 = i2[i2.length - 1];
for (var s2 = 0; s2 < i2.length - 1; s2++) {
var a2 = i2[s2];
if (/^(cmd|meta|m)$/i.test(a2))
r2 = true;
else if (/^a(lt)?$/i.test(a2))
e3 = true;
else if (/^(c|ctrl|control)$/i.test(a2))
n3 = true;
else {
if (!/^s(hift)?$/i.test(a2))
throw new Error("Unrecognized modifier name: " + a2);
o3 = true;
}
}
return e3 && (t4 = "Alt-" + t4), n3 && (t4 = "Ctrl-" + t4), r2 && (t4 = "Cmd-" + t4), o3 && (t4 = "Shift-" + t4), t4;
}
function zs(t4) {
var e3 = {};
for (var n3 in t4)
if (t4.hasOwnProperty(n3)) {
var o3 = t4[n3];
if (/^(name|fallthrough|(de|at)tach)$/.test(n3))
continue;
if ("..." == o3) {
delete t4[n3];
continue;
}
for (var r2 = J(n3.split(" "), Hs), i2 = 0; i2 < r2.length; i2++) {
var s2 = void 0, a2 = void 0;
i2 == r2.length - 1 ? (a2 = r2.join(" "), s2 = o3) : (a2 = r2.slice(0, i2 + 1).join(" "), s2 = "...");
var l2 = e3[a2];
if (l2) {
if (l2 != s2)
throw new Error("Inconsistent bindings for " + a2);
} else
e3[a2] = s2;
}
delete t4[n3];
}
for (var c2 in e3)
t4[c2] = e3[c2];
return t4;
}
function Bs(t4, e3, n3, o3) {
var r2 = (e3 = qs(e3)).call ? e3.call(t4, o3) : e3[t4];
if (false === r2)
return "nothing";
if ("..." === r2)
return "multi";
if (null != r2 && n3(r2))
return "handled";
if (e3.fallthrough) {
if ("[object Array]" != Object.prototype.toString.call(e3.fallthrough))
return Bs(t4, e3.fallthrough, n3, o3);
for (var i2 = 0; i2 < e3.fallthrough.length; i2++) {
var s2 = Bs(t4, e3.fallthrough[i2], n3, o3);
if (s2)
return s2;
}
}
}
function Us(t4) {
var e3 = "string" == typeof t4 ? t4 : Ns[t4.keyCode];
return "Ctrl" == e3 || "Alt" == e3 || "Shift" == e3 || "Mod" == e3;
}
function Ws(t4, e3, n3) {
var o3 = t4;
return e3.altKey && "Alt" != o3 && (t4 = "Alt-" + t4), (C ? e3.metaKey : e3.ctrlKey) && "Ctrl" != o3 && (t4 = "Ctrl-" + t4), (C ? e3.ctrlKey : e3.metaKey) && "Mod" != o3 && (t4 = "Cmd-" + t4), !n3 && e3.shiftKey && "Shift" != o3 && (t4 = "Shift-" + t4), t4;
}
function $s(t4, e3) {
if (d && 34 == t4.keyCode && t4["char"])
return false;
var n3 = Ns[t4.keyCode];
return null != n3 && !t4.altGraphKey && (3 == t4.keyCode && t4.code && (n3 = t4.code), Ws(n3, t4, e3));
}
function qs(t4) {
return "string" == typeof t4 ? Rs[t4] : t4;
}
function Gs(t4, e3) {
for (var n3 = t4.doc.sel.ranges, o3 = [], r2 = 0; r2 < n3.length; r2++) {
for (var i2 = e3(n3[r2]); o3.length && ae(i2.from, X(o3).to) <= 0; ) {
var s2 = o3.pop();
if (ae(s2.from, i2.from) < 0) {
i2.from = s2.from;
break;
}
}
o3.push(i2);
}
Lr(t4, function() {
for (var e4 = o3.length - 1; e4 >= 0; e4--)
is(t4.doc, "", o3[e4].from, o3[e4].to, "+delete");
cr(t4);
});
}
function Ks(t4, e3, n3) {
var o3 = at(t4.text, e3 + n3, n3);
return o3 < 0 || o3 > t4.text.length ? null : o3;
}
function Ys(t4, e3, n3) {
var o3 = Ks(t4, e3.ch, n3);
return null == o3 ? null : new se(e3.line, o3, n3 < 0 ? "after" : "before");
}
function Xs(t4, e3, n3, o3, r2) {
if (t4) {
"rtl" == e3.doc.direction && (r2 = -r2);
var i2 = ft(n3, e3.doc.direction);
if (i2) {
var s2, a2 = r2 < 0 ? X(i2) : i2[0], l2 = r2 < 0 == (1 == a2.level) ? "after" : "before";
if (a2.level > 0 || "rtl" == e3.doc.direction) {
var c2 = oo(e3, n3);
s2 = r2 < 0 ? n3.text.length - 1 : 0;
var u2 = ro(e3, c2, s2).top;
s2 = lt(function(t5) {
return ro(e3, c2, t5).top == u2;
}, r2 < 0 == (1 == a2.level) ? a2.from : a2.to - 1, s2), "before" == l2 && (s2 = Ks(n3, s2, 1));
} else
s2 = r2 < 0 ? a2.to : a2.from;
return new se(o3, s2, l2);
}
}
return new se(o3, r2 < 0 ? n3.text.length : 0, r2 < 0 ? "before" : "after");
}
function Js(t4, e3, n3, o3) {
var r2 = ft(e3, t4.doc.direction);
if (!r2)
return Ys(e3, n3, o3);
n3.ch >= e3.text.length ? (n3.ch = e3.text.length, n3.sticky = "before") : n3.ch <= 0 && (n3.ch = 0, n3.sticky = "after");
var i2 = pt(r2, n3.ch, n3.sticky), s2 = r2[i2];
if ("ltr" == t4.doc.direction && s2.level % 2 == 0 && (o3 > 0 ? s2.to > n3.ch : s2.from < n3.ch))
return Ys(e3, n3, o3);
var a2, l2 = function(t5, n4) {
return Ks(e3, t5 instanceof se ? t5.ch : t5, n4);
}, c2 = function(n4) {
return t4.options.lineWrapping ? (a2 = a2 || oo(t4, e3), To(t4, e3, a2, n4)) : { begin: 0, end: e3.text.length };
}, u2 = c2("before" == n3.sticky ? l2(n3, -1) : n3.ch);
if ("rtl" == t4.doc.direction || 1 == s2.level) {
var p2 = 1 == s2.level == o3 < 0, d2 = l2(n3, p2 ? 1 : -1);
if (null != d2 && (p2 ? d2 <= s2.to && d2 <= u2.end : d2 >= s2.from && d2 >= u2.begin)) {
var f2 = p2 ? "before" : "after";
return new se(n3.line, d2, f2);
}
}
var h2 = function(t5, e4, o4) {
for (var i3 = function(t6, e5) {
return e5 ? new se(n3.line, l2(t6, 1), "before") : new se(n3.line, t6, "after");
}; t5 >= 0 && t5 < r2.length; t5 += e4) {
var s3 = r2[t5], a3 = e4 > 0 == (1 != s3.level), c3 = a3 ? o4.begin : l2(o4.end, -1);
if (s3.from <= c3 && c3 < s3.to)
return i3(c3, a3);
if (c3 = a3 ? s3.from : l2(s3.to, -1), o4.begin <= c3 && c3 < o4.end)
return i3(c3, a3);
}
}, g2 = h2(i2 + o3, o3, u2);
if (g2)
return g2;
var v2 = o3 > 0 ? u2.end : l2(u2.begin, -1);
return null == v2 || o3 > 0 && v2 == e3.text.length || !(g2 = h2(o3 > 0 ? 0 : r2.length - 1, o3, c2(v2))) ? null : g2;
}
Rs.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" }, Rs.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" }, Rs.emacsy = { "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars", "Ctrl-O": "openLine" }, Rs.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"] }, Rs["default"] = b ? Rs.macDefault : Rs.pcDefault;
var Zs = { selectAll: Ji, singleSelection: function(t4) {
return t4.setSelection(t4.getCursor("anchor"), t4.getCursor("head"), W);
}, killLine: function(t4) {
return Gs(t4, function(e3) {
if (e3.empty()) {
var n3 = Zt(t4.doc, e3.head.line).text.length;
return e3.head.ch == n3 && e3.head.line < t4.lastLine() ? { from: e3.head, to: se(e3.head.line + 1, 0) } : { from: e3.head, to: se(e3.head.line, n3) };
}
return { from: e3.from(), to: e3.to() };
});
}, deleteLine: function(t4) {
return Gs(t4, function(e3) {
return { from: se(e3.from().line, 0), to: fe(t4.doc, se(e3.to().line + 1, 0)) };
});
}, delLineLeft: function(t4) {
return Gs(t4, function(t5) {
return { from: se(t5.from().line, 0), to: t5.from() };
});
}, delWrappedLineLeft: function(t4) {
return Gs(t4, function(e3) {
var n3 = t4.charCoords(e3.head, "div").top + 5;
return { from: t4.coordsChar({ left: 0, top: n3 }, "div"), to: e3.from() };
});
}, delWrappedLineRight: function(t4) {
return Gs(t4, function(e3) {
var n3 = t4.charCoords(e3.head, "div").top + 5, o3 = t4.coordsChar({ left: t4.display.lineDiv.offsetWidth + 100, top: n3 }, "div");
return { from: e3.from(), to: o3 };
});
}, undo: function(t4) {
return t4.undo();
}, redo: function(t4) {
return t4.redo();
}, undoSelection: function(t4) {
return t4.undoSelection();
}, redoSelection: function(t4) {
return t4.redoSelection();
}, goDocStart: function(t4) {
return t4.extendSelection(se(t4.firstLine(), 0));
}, goDocEnd: function(t4) {
return t4.extendSelection(se(t4.lastLine()));
}, goLineStart: function(t4) {
return t4.extendSelectionsBy(function(e3) {
return Qs(t4, e3.head.line);
}, { origin: "+move", bias: 1 });
}, goLineStartSmart: function(t4) {
return t4.extendSelectionsBy(function(e3) {
return ea(t4, e3.head);
}, { origin: "+move", bias: 1 });
}, goLineEnd: function(t4) {
return t4.extendSelectionsBy(function(e3) {
return ta(t4, e3.head.line);
}, { origin: "+move", bias: -1 });
}, goLineRight: function(t4) {
return t4.extendSelectionsBy(function(e3) {
var n3 = t4.cursorCoords(e3.head, "div").top + 5;
return t4.coordsChar({ left: t4.display.lineDiv.offsetWidth + 100, top: n3 }, "div");
}, q);
}, goLineLeft: function(t4) {
return t4.extendSelectionsBy(function(e3) {
var n3 = t4.cursorCoords(e3.head, "div").top + 5;
return t4.coordsChar({ left: 0, top: n3 }, "div");
}, q);
}, goLineLeftSmart: function(t4) {
return t4.extendSelectionsBy(function(e3) {
var n3 = t4.cursorCoords(e3.head, "div").top + 5, o3 = t4.coordsChar({ left: 0, top: n3 }, "div");
return o3.ch < t4.getLine(o3.line).search(/\S/) ? ea(t4, e3.head) : o3;
}, q);
}, goLineUp: function(t4) {
return t4.moveV(-1, "line");
}, goLineDown: function(t4) {
return t4.moveV(1, "line");
}, goPageUp: function(t4) {
return t4.moveV(-1, "page");
}, goPageDown: function(t4) {
return t4.moveV(1, "page");
}, goCharLeft: function(t4) {
return t4.moveH(-1, "char");
}, goCharRight: function(t4) {
return t4.moveH(1, "char");
}, goColumnLeft: function(t4) {
return t4.moveH(-1, "column");
}, goColumnRight: function(t4) {
return t4.moveH(1, "column");
}, goWordLeft: function(t4) {
return t4.moveH(-1, "word");
}, goGroupRight: function(t4) {
return t4.moveH(1, "group");
}, goGroupLeft: function(t4) {
return t4.moveH(-1, "group");
}, goWordRight: function(t4) {
return t4.moveH(1, "word");
}, delCharBefore: function(t4) {
return t4.deleteH(-1, "codepoint");
}, delCharAfter: function(t4) {
return t4.deleteH(1, "char");
}, delWordBefore: function(t4) {
return t4.deleteH(-1, "word");
}, delWordAfter: function(t4) {
return t4.deleteH(1, "word");
}, delGroupBefore: function(t4) {
return t4.deleteH(-1, "group");
}, delGroupAfter: function(t4) {
return t4.deleteH(1, "group");
}, indentAuto: function(t4) {
return t4.indentSelection("smart");
}, indentMore: function(t4) {
return t4.indentSelection("add");
}, indentLess: function(t4) {
return t4.indentSelection("subtract");
}, insertTab: function(t4) {
return t4.replaceSelection(" ");
}, insertSoftTab: function(t4) {
for (var e3 = [], n3 = t4.listSelections(), o3 = t4.options.tabSize, r2 = 0; r2 < n3.length; r2++) {
var i2 = n3[r2].from(), s2 = R(t4.getLine(i2.line), i2.ch, o3);
e3.push(Y(o3 - s2 % o3));
}
t4.replaceSelections(e3);
}, defaultTab: function(t4) {
t4.somethingSelected() ? t4.indentSelection("add") : t4.execCommand("insertTab");
}, transposeChars: function(t4) {
return Lr(t4, function() {
for (var e3 = t4.listSelections(), n3 = [], o3 = 0; o3 < e3.length; o3++)
if (e3[o3].empty()) {
var r2 = e3[o3].head, i2 = Zt(t4.doc, r2.line).text;
if (i2) {
if (r2.ch == i2.length && (r2 = new se(r2.line, r2.ch - 1)), r2.ch > 0)
r2 = new se(r2.line, r2.ch + 1), t4.replaceRange(i2.charAt(r2.ch - 1) + i2.charAt(r2.ch - 2), se(r2.line, r2.ch - 2), r2, "+transpose");
else if (r2.line > t4.doc.first) {
var s2 = Zt(t4.doc, r2.line - 1).text;
s2 && (r2 = new se(r2.line, 1), t4.replaceRange(i2.charAt(0) + t4.doc.lineSeparator() + s2.charAt(s2.length - 1), se(r2.line - 1, s2.length - 1), r2, "+transpose"));
}
}
n3.push(new ai(r2, r2));
}
t4.setSelections(n3);
});
}, newlineAndIndent: function(t4) {
return Lr(t4, function() {
for (var e3 = t4.listSelections(), n3 = e3.length - 1; n3 >= 0; n3--)
t4.replaceRange(t4.doc.lineSeparator(), e3[n3].anchor, e3[n3].head, "+input");
e3 = t4.listSelections();
for (var o3 = 0; o3 < e3.length; o3++)
t4.indentLine(e3[o3].from().line, null, true);
cr(t4);
});
}, openLine: function(t4) {
return t4.replaceSelection("\n", "start");
}, toggleOverwrite: function(t4) {
return t4.toggleOverwrite();
} };
function Qs(t4, e3) {
var n3 = Zt(t4.doc, e3), o3 = Qe(n3);
return o3 != n3 && (e3 = ne(o3)), Xs(true, t4, o3, e3, 1);
}
function ta(t4, e3) {
var n3 = Zt(t4.doc, e3), o3 = tn(n3);
return o3 != n3 && (e3 = ne(o3)), Xs(true, t4, n3, e3, -1);
}
function ea(t4, e3) {
var n3 = Qs(t4, e3.line), o3 = Zt(t4.doc, n3.line), r2 = ft(o3, t4.doc.direction);
if (!r2 || 0 == r2[0].level) {
var i2 = Math.max(n3.ch, o3.text.search(/\S/)), s2 = e3.line == n3.line && e3.ch <= i2 && e3.ch;
return se(n3.line, s2 ? 0 : i2, n3.sticky);
}
return n3;
}
function na(t4, e3, n3) {
if ("string" == typeof e3 && !(e3 = Zs[e3]))
return false;
t4.display.input.ensurePolled();
var o3 = t4.display.shift, r2 = false;
try {
t4.isReadOnly() && (t4.state.suppressEdits = true), n3 && (t4.display.shift = false), r2 = e3(t4) != U;
} finally {
t4.display.shift = o3, t4.state.suppressEdits = false;
}
return r2;
}
function oa(t4, e3, n3) {
for (var o3 = 0; o3 < t4.state.keyMaps.length; o3++) {
var r2 = Bs(e3, t4.state.keyMaps[o3], n3, t4);
if (r2)
return r2;
}
return t4.options.extraKeys && Bs(e3, t4.options.extraKeys, n3, t4) || Bs(e3, t4.options.keyMap, n3, t4);
}
var ra = new H();
function ia(t4, e3, n3, o3) {
var r2 = t4.state.keySeq;
if (r2) {
if (Us(e3))
return "handled";
if (/\'$/.test(e3) ? t4.state.keySeq = null : ra.set(50, function() {
t4.state.keySeq == r2 && (t4.state.keySeq = null, t4.display.input.reset());
}), sa(t4, r2 + " " + e3, n3, o3))
return true;
}
return sa(t4, e3, n3, o3);
}
function sa(t4, e3, n3, o3) {
var r2 = oa(t4, e3, o3);
return "multi" == r2 && (t4.state.keySeq = e3), "handled" == r2 && An(t4, "keyHandled", t4, e3, n3), "handled" != r2 && "multi" != r2 || (Ct(n3), Xo(t4)), !!r2;
}
function aa(t4, e3) {
var n3 = $s(e3, true);
return !!n3 && (e3.shiftKey && !t4.state.keySeq ? ia(t4, "Shift-" + n3, e3, function(e4) {
return na(t4, e4, true);
}) || ia(t4, n3, e3, function(e4) {
if ("string" == typeof e4 ? /^go[A-Z]/.test(e4) : e4.motion)
return na(t4, e4);
}) : ia(t4, n3, e3, function(e4) {
return na(t4, e4);
}));
}
function la(t4, e3, n3) {
return ia(t4, "'" + n3 + "'", e3, function(e4) {
return na(t4, e4, true);
});
}
var ca = null;
function ua(t4) {
var e3 = this;
if (!(t4.target && t4.target != e3.display.input.getField() || (e3.curOp.focus = L(), bt(e3, t4)))) {
s && a < 11 && 27 == t4.keyCode && (t4.returnValue = false);
var o3 = t4.keyCode;
e3.display.shift = 16 == o3 || t4.shiftKey;
var r2 = aa(e3, t4);
d && (ca = r2 ? o3 : null, r2 || 88 != o3 || Ft || !(b ? t4.metaKey : t4.ctrlKey) || e3.replaceSelection("", null, "cut")), n2 && !b && !r2 && 46 == o3 && t4.shiftKey && !t4.ctrlKey && document.execCommand && document.execCommand("cut"), 18 != o3 || /\bCodeMirror-crosshair\b/.test(e3.display.lineDiv.className) || pa(e3);
}
}
function pa(t4) {
var e3 = t4.display.lineDiv;
function n3(t5) {
18 != t5.keyCode && t5.altKey || (k(e3, "CodeMirror-crosshair"), yt(document, "keyup", n3), yt(document, "mouseover", n3));
}
D(e3, "CodeMirror-crosshair"), gt(document, "keyup", n3), gt(document, "mouseover", n3);
}
function da(t4) {
16 == t4.keyCode && (this.doc.sel.shift = false), bt(this, t4);
}
function fa(t4) {
var e3 = this;
if (!(t4.target && t4.target != e3.display.input.getField() || $n(e3.display, t4) || bt(e3, t4) || t4.ctrlKey && !t4.altKey || b && t4.metaKey)) {
var n3 = t4.keyCode, o3 = t4.charCode;
if (d && n3 == ca)
return ca = null, void Ct(t4);
if (!d || t4.which && !(t4.which < 10) || !aa(e3, t4)) {
var r2 = String.fromCharCode(null == o3 ? n3 : o3);
"\b" != r2 && (la(e3, t4, r2) || e3.display.input.onKeyPress(t4));
}
}
}
var ha, ga, va = 400, ya = function(t4, e3, n3) {
this.time = t4, this.pos = e3, this.button = n3;
};
function ma(t4, e3) {
var n3 = +/* @__PURE__ */ new Date();
return ga && ga.compare(n3, t4, e3) ? (ha = ga = null, "triple") : ha && ha.compare(n3, t4, e3) ? (ga = new ya(n3, t4, e3), ha = null, "double") : (ha = new ya(n3, t4, e3), ga = null, "single");
}
function ba(t4) {
var e3 = this, n3 = e3.display;
if (!(bt(e3, t4) || n3.activeTouch && n3.input.supportsTouch())) {
if (n3.input.ensurePolled(), n3.shift = t4.shiftKey, $n(n3, t4))
l || (n3.scroller.draggable = false, setTimeout(function() {
return n3.scroller.draggable = true;
}, 100));
else if (!Pa(e3, t4)) {
var o3 = Fo(e3, t4), r2 = Pt(t4), i2 = o3 ? ma(o3, r2) : "single";
window.focus(), 1 == r2 && e3.state.selectingText && e3.state.selectingText(t4), o3 && _a(e3, r2, o3, i2, t4) || (1 == r2 ? o3 ? xa(e3, o3, i2, t4) : kt(t4) == n3.scroller && Ct(t4) : 2 == r2 ? (o3 && Fi(e3.doc, o3), setTimeout(function() {
return n3.input.focus();
}, 20)) : 3 == r2 && (S ? e3.display.input.onContextMenu(t4) : Zo(e3)));
}
}
}
function _a(t4, e3, n3, o3, r2) {
var i2 = "Click";
return "double" == o3 ? i2 = "Double" + i2 : "triple" == o3 && (i2 = "Triple" + i2), ia(t4, Ws(i2 = (1 == e3 ? "Left" : 2 == e3 ? "Middle" : "Right") + i2, r2), r2, function(e4) {
if ("string" == typeof e4 && (e4 = Zs[e4]), !e4)
return false;
var o4 = false;
try {
t4.isReadOnly() && (t4.state.suppressEdits = true), o4 = e4(t4, n3) != U;
} finally {
t4.state.suppressEdits = false;
}
return o4;
});
}
function wa(t4, e3, n3) {
var o3 = t4.getOption("configureMouse"), r2 = o3 ? o3(t4, e3, n3) : {};
if (null == r2.unit) {
var i2 = _ ? n3.shiftKey && n3.metaKey : n3.altKey;
r2.unit = i2 ? "rectangle" : "single" == e3 ? "char" : "double" == e3 ? "word" : "line";
}
return (null == r2.extend || t4.doc.extend) && (r2.extend = t4.doc.extend || n3.shiftKey), null == r2.addNew && (r2.addNew = b ? n3.metaKey : n3.ctrlKey), null == r2.moveOnDrag && (r2.moveOnDrag = !(b ? n3.altKey : n3.ctrlKey)), r2;
}
function xa(t4, e3, n3, o3) {
s ? setTimeout(F(Jo, t4), 0) : t4.curOp.focus = L();
var r2, i2 = wa(t4, n3, o3), a2 = t4.doc.sel;
t4.options.dragDrop && jt && !t4.isReadOnly() && "single" == n3 && (r2 = a2.contains(e3)) > -1 && (ae((r2 = a2.ranges[r2]).from(), e3) < 0 || e3.xRel > 0) && (ae(r2.to(), e3) > 0 || e3.xRel < 0) ? Ca(t4, o3, e3, i2) : Oa(t4, o3, e3, i2);
}
function Ca(t4, e3, n3, o3) {
var r2 = t4.display, i2 = false, c2 = Dr(t4, function(e4) {
l && (r2.scroller.draggable = false), t4.state.draggingText = false, t4.state.delayingBlurEvent && (t4.hasFocus() ? t4.state.delayingBlurEvent = false : Zo(t4)), yt(r2.wrapper.ownerDocument, "mouseup", c2), yt(r2.wrapper.ownerDocument, "mousemove", u2), yt(r2.scroller, "dragstart", p2), yt(r2.scroller, "drop", c2), i2 || (Ct(e4), o3.addNew || Fi(t4.doc, n3, null, null, o3.extend), l && !f || s && 9 == a ? setTimeout(function() {
r2.wrapper.ownerDocument.body.focus({ preventScroll: true }), r2.input.focus();
}, 20) : r2.input.focus());
}), u2 = function(t5) {
i2 = i2 || Math.abs(e3.clientX - t5.clientX) + Math.abs(e3.clientY - t5.clientY) >= 10;
}, p2 = function() {
return i2 = true;
};
l && (r2.scroller.draggable = true), t4.state.draggingText = c2, c2.copy = !o3.moveOnDrag, gt(r2.wrapper.ownerDocument, "mouseup", c2), gt(r2.wrapper.ownerDocument, "mousemove", u2), gt(r2.scroller, "dragstart", p2), gt(r2.scroller, "drop", c2), t4.state.delayingBlurEvent = true, setTimeout(function() {
return r2.input.focus();
}, 20), r2.scroller.dragDrop && r2.scroller.dragDrop();
}
function Sa(t4, e3, n3) {
if ("char" == n3)
return new ai(e3, e3);
if ("word" == n3)
return t4.findWordAt(e3);
if ("line" == n3)
return new ai(se(e3.line, 0), fe(t4.doc, se(e3.line + 1, 0)));
var o3 = n3(t4, e3);
return new ai(o3.from, o3.to);
}
function Oa(t4, e3, n3, o3) {
s && Zo(t4);
var r2 = t4.display, i2 = t4.doc;
Ct(e3);
var a2, l2, c2 = i2.sel, u2 = c2.ranges;
if (o3.addNew && !o3.extend ? (l2 = i2.sel.contains(n3), a2 = l2 > -1 ? u2[l2] : new ai(n3, n3)) : (a2 = i2.sel.primary(), l2 = i2.sel.primIndex), "rectangle" == o3.unit)
o3.addNew || (a2 = new ai(n3, n3)), n3 = Fo(t4, e3, true, true), l2 = -1;
else {
var p2 = Sa(t4, n3, o3.unit);
a2 = o3.extend ? Ii(a2, p2.anchor, p2.head, o3.extend) : p2;
}
o3.addNew ? -1 == l2 ? (l2 = u2.length, Ui(i2, li(t4, u2.concat([a2]), l2), { scroll: false, origin: "*mouse" })) : u2.length > 1 && u2[l2].empty() && "char" == o3.unit && !o3.extend ? (Ui(i2, li(t4, u2.slice(0, l2).concat(u2.slice(l2 + 1)), 0), { scroll: false, origin: "*mouse" }), c2 = i2.sel) : Ri(i2, l2, a2, $) : (l2 = 0, Ui(i2, new si([a2], 0), $), c2 = i2.sel);
var d2 = n3;
function f2(e4) {
if (0 != ae(d2, e4))
if (d2 = e4, "rectangle" == o3.unit) {
for (var r3 = [], s2 = t4.options.tabSize, u3 = R(Zt(i2, n3.line).text, n3.ch, s2), p3 = R(Zt(i2, e4.line).text, e4.ch, s2), f3 = Math.min(u3, p3), h3 = Math.max(u3, p3), g3 = Math.min(n3.line, e4.line), v3 = Math.min(t4.lastLine(), Math.max(n3.line, e4.line)); g3 <= v3; g3++) {
var y3 = Zt(i2, g3).text, m3 = G(y3, f3, s2);
f3 == h3 ? r3.push(new ai(se(g3, m3), se(g3, m3))) : y3.length > m3 && r3.push(new ai(se(g3, m3), se(g3, G(y3, h3, s2))));
}
r3.length || r3.push(new ai(n3, n3)), Ui(i2, li(t4, c2.ranges.slice(0, l2).concat(r3), l2), { origin: "*mouse", scroll: false }), t4.scrollIntoView(e4);
} else {
var b3, _2 = a2, w2 = Sa(t4, e4, o3.unit), x2 = _2.anchor;
ae(w2.anchor, x2) > 0 ? (b3 = w2.head, x2 = pe(_2.from(), w2.anchor)) : (b3 = w2.anchor, x2 = ue(_2.to(), w2.head));
var C2 = c2.ranges.slice(0);
C2[l2] = Ta(t4, new ai(fe(i2, x2), b3)), Ui(i2, li(t4, C2, l2), $);
}
}
var h2 = r2.wrapper.getBoundingClientRect(), g2 = 0;
function v2(e4) {
var n4 = ++g2, s2 = Fo(t4, e4, true, "rectangle" == o3.unit);
if (s2)
if (0 != ae(s2, d2)) {
t4.curOp.focus = L(), f2(s2);
var a3 = or(r2, i2);
(s2.line >= a3.to || s2.line < a3.from) && setTimeout(Dr(t4, function() {
g2 == n4 && v2(e4);
}), 150);
} else {
var l3 = e4.clientY < h2.top ? -20 : e4.clientY > h2.bottom ? 20 : 0;
l3 && setTimeout(Dr(t4, function() {
g2 == n4 && (r2.scroller.scrollTop += l3, v2(e4));
}), 50);
}
}
function y2(e4) {
t4.state.selectingText = false, g2 = 1 / 0, e4 && (Ct(e4), r2.input.focus()), yt(r2.wrapper.ownerDocument, "mousemove", m2), yt(r2.wrapper.ownerDocument, "mouseup", b2), i2.history.lastSelOrigin = null;
}
var m2 = Dr(t4, function(t5) {
0 !== t5.buttons && Pt(t5) ? v2(t5) : y2(t5);
}), b2 = Dr(t4, y2);
t4.state.selectingText = b2, gt(r2.wrapper.ownerDocument, "mousemove", m2), gt(r2.wrapper.ownerDocument, "mouseup", b2);
}
function Ta(t4, e3) {
var n3 = e3.anchor, o3 = e3.head, r2 = Zt(t4.doc, n3.line);
if (0 == ae(n3, o3) && n3.sticky == o3.sticky)
return e3;
var i2 = ft(r2);
if (!i2)
return e3;
var s2 = pt(i2, n3.ch, n3.sticky), a2 = i2[s2];
if (a2.from != n3.ch && a2.to != n3.ch)
return e3;
var l2, c2 = s2 + (a2.from == n3.ch == (1 != a2.level) ? 0 : 1);
if (0 == c2 || c2 == i2.length)
return e3;
if (o3.line != n3.line)
l2 = (o3.line - n3.line) * ("ltr" == t4.doc.direction ? 1 : -1) > 0;
else {
var u2 = pt(i2, o3.ch, o3.sticky), p2 = u2 - s2 || (o3.ch - n3.ch) * (1 == a2.level ? -1 : 1);
l2 = u2 == c2 - 1 || u2 == c2 ? p2 < 0 : p2 > 0;
}
var d2 = i2[c2 + (l2 ? -1 : 0)], f2 = l2 == (1 == d2.level), h2 = f2 ? d2.from : d2.to, g2 = f2 ? "after" : "before";
return n3.ch == h2 && n3.sticky == g2 ? e3 : new ai(new se(n3.line, h2, g2), o3);
}
function ka(t4, e3, n3, o3) {
var r2, i2;
if (e3.touches)
r2 = e3.touches[0].clientX, i2 = e3.touches[0].clientY;
else
try {
r2 = e3.clientX, i2 = e3.clientY;
} catch (t5) {
return false;
}
if (r2 >= Math.floor(t4.display.gutters.getBoundingClientRect().right))
return false;
o3 && Ct(e3);
var s2 = t4.display, a2 = s2.lineDiv.getBoundingClientRect();
if (i2 > a2.bottom || !wt(t4, n3))
return Ot(e3);
i2 -= a2.top - s2.viewOffset;
for (var l2 = 0; l2 < t4.display.gutterSpecs.length; ++l2) {
var c2 = s2.gutters.childNodes[l2];
if (c2 && c2.getBoundingClientRect().right >= r2)
return mt(t4, n3, t4, oe(t4.doc, i2), t4.display.gutterSpecs[l2].className, e3), Ot(e3);
}
}
function Pa(t4, e3) {
return ka(t4, e3, "gutterClick", true);
}
function Ea(t4, e3) {
$n(t4.display, e3) || Aa(t4, e3) || bt(t4, e3, "contextmenu") || S || t4.display.input.onContextMenu(e3);
}
function Aa(t4, e3) {
return !!wt(t4, "gutterContextMenu") && ka(t4, e3, "gutterContextMenu", false);
}
function ja(t4) {
t4.display.wrapper.className = t4.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + t4.options.theme.replace(/(^|\s)\s*/g, " cm-s-"), ho(t4);
}
ya.prototype.compare = function(t4, e3, n3) {
return this.time + va > t4 && 0 == ae(e3, this.pos) && n3 == this.button;
};
var Ma = { toString: function() {
return "CodeMirror.Init";
} }, La = {}, Da = {};
function Na(t4) {
var e3 = t4.optionHandlers;
function n3(n4, o3, r2, i2) {
t4.defaults[n4] = o3, r2 && (e3[n4] = i2 ? function(t5, e4, n5) {
n5 != Ma && r2(t5, e4, n5);
} : r2);
}
t4.defineOption = n3, t4.Init = Ma, n3("value", "", function(t5, e4) {
return t5.setValue(e4);
}, true), n3("mode", null, function(t5, e4) {
t5.doc.modeOption = e4, gi(t5);
}, true), n3("indentUnit", 2, gi, true), n3("indentWithTabs", false), n3("smartIndent", true), n3("tabSize", 4, function(t5) {
vi(t5), ho(t5), Ro(t5);
}, true), n3("lineSeparator", null, function(t5, e4) {
if (t5.doc.lineSep = e4, e4) {
var n4 = [], o3 = t5.doc.first;
t5.doc.iter(function(t6) {
for (var r3 = 0; ; ) {
var i2 = t6.text.indexOf(e4, r3);
if (-1 == i2)
break;
r3 = i2 + e4.length, n4.push(se(o3, i2));
}
o3++;
});
for (var r2 = n4.length - 1; r2 >= 0; r2--)
is(t5.doc, e4, n4[r2], se(n4[r2].line, n4[r2].ch + e4.length));
}
}), n3("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function(t5, e4, n4) {
t5.state.specialChars = new RegExp(e4.source + (e4.test(" ") ? "" : "| "), "g"), n4 != Ma && t5.refresh();
}), n3("specialCharPlaceholder", yn, function(t5) {
return t5.refresh();
}, true), n3("electricChars", true), n3("inputStyle", m ? "contenteditable" : "textarea", function() {
throw new Error("inputStyle can not (yet) be changed in a running editor");
}, true), n3("spellcheck", false, function(t5, e4) {
return t5.getInputField().spellcheck = e4;
}, true), n3("autocorrect", false, function(t5, e4) {
return t5.getInputField().autocorrect = e4;
}, true), n3("autocapitalize", false, function(t5, e4) {
return t5.getInputField().autocapitalize = e4;
}, true), n3("rtlMoveVisually", !w), n3("wholeLineUpdateBefore", true), n3("theme", "default", function(t5) {
ja(t5), Qr(t5);
}, true), n3("keyMap", "default", function(t5, e4, n4) {
var o3 = qs(e4), r2 = n4 != Ma && qs(n4);
r2 && r2.detach && r2.detach(t5, o3), o3.attach && o3.attach(t5, r2 || null);
}), n3("extraKeys", null), n3("configureMouse", null), n3("lineWrapping", false, Fa, true), n3("gutters", [], function(t5, e4) {
t5.display.gutterSpecs = Jr(e4, t5.options.lineNumbers), Qr(t5);
}, true), n3("fixedGutter", true, function(t5, e4) {
t5.display.gutters.style.left = e4 ? Do(t5.display) + "px" : "0", t5.refresh();
}, true), n3("coverGutterNextToScrollbar", false, function(t5) {
return _r(t5);
}, true), n3("scrollbarStyle", "native", function(t5) {
Cr(t5), _r(t5), t5.display.scrollbars.setScrollTop(t5.doc.scrollTop), t5.display.scrollbars.setScrollLeft(t5.doc.scrollLeft);
}, true), n3("lineNumbers", false, function(t5, e4) {
t5.display.gutterSpecs = Jr(t5.options.gutters, e4), Qr(t5);
}, true), n3("firstLineNumber", 1, Qr, true), n3("lineNumberFormatter", function(t5) {
return t5;
}, Qr, true), n3("showCursorWhenSelecting", false, $o, true), n3("resetSelectionOnContextMenu", true), n3("lineWiseCopyCut", true), n3("pasteLinesPerSelection", true), n3("selectionsMayTouch", false), n3("readOnly", false, function(t5, e4) {
"nocursor" == e4 && (tr(t5), t5.display.input.blur()), t5.display.input.readOnlyChanged(e4);
}), n3("screenReaderLabel", null, function(t5, e4) {
e4 = "" === e4 ? null : e4, t5.display.input.screenReaderLabelChanged(e4);
}), n3("disableInput", false, function(t5, e4) {
e4 || t5.display.input.reset();
}, true), n3("dragDrop", true, Ia), n3("allowDropFileTypes", null), n3("cursorBlinkRate", 530), n3("cursorScrollMargin", 0), n3("cursorHeight", 1, $o, true), n3("singleCursorHeightPerLine", true, $o, true), n3("workTime", 100), n3("workDelay", 100), n3("flattenSpans", true, vi, true), n3("addModeClass", false, vi, true), n3("pollInterval", 100), n3("undoDepth", 200, function(t5, e4) {
return t5.doc.history.undoDepth = e4;
}), n3("historyEventDelay", 1250), n3("viewportMargin", 10, function(t5) {
return t5.refresh();
}, true), n3("maxHighlightLength", 1e4, vi, true), n3("moveInputWithCursor", true, function(t5, e4) {
e4 || t5.display.input.resetPosition();
}), n3("tabindex", null, function(t5, e4) {
return t5.display.input.getField().tabIndex = e4 || "";
}), n3("autofocus", null), n3("direction", "ltr", function(t5, e4) {
return t5.doc.setDirection(e4);
}, true), n3("phrases", null);
}
function Ia(t4, e3, n3) {
if (!e3 != !(n3 && n3 != Ma)) {
var o3 = t4.display.dragFunctions, r2 = e3 ? gt : yt;
r2(t4.display.scroller, "dragstart", o3.start), r2(t4.display.scroller, "dragenter", o3.enter), r2(t4.display.scroller, "dragover", o3.over), r2(t4.display.scroller, "dragleave", o3.leave), r2(t4.display.scroller, "drop", o3.drop);
}
}
function Fa(t4) {
t4.options.lineWrapping ? (D(t4.display.wrapper, "CodeMirror-wrap"), t4.display.sizer.style.minWidth = "", t4.display.sizerWidth = null) : (k(t4.display.wrapper, "CodeMirror-wrap"), cn(t4)), Io(t4), Ro(t4), ho(t4), setTimeout(function() {
return _r(t4);
}, 100);
}
function Va(t4, e3) {
var n3 = this;
if (!(this instanceof Va))
return new Va(t4, e3);
this.options = e3 = e3 ? V(e3) : {}, V(La, e3, false);
var o3 = e3.value;
"string" == typeof o3 ? o3 = new Ss(o3, e3.mode, null, e3.lineSeparator, e3.direction) : e3.mode && (o3.modeOption = e3.mode), this.doc = o3;
var r2 = new Va.inputStyles[e3.inputStyle](this), i2 = this.display = new ti(t4, o3, r2, e3);
for (var c2 in i2.wrapper.CodeMirror = this, ja(this), e3.lineWrapping && (this.display.wrapper.className += " CodeMirror-wrap"), Cr(this), this.state = { keyMaps: [], overlays: [], modeGen: 0, overwrite: false, delayingBlurEvent: false, focused: false, suppressEdits: false, pasteIncoming: -1, cutIncoming: -1, selectingText: false, draggingText: false, highlight: new H(), keySeq: null, specialChars: null }, e3.autofocus && !m && i2.input.focus(), s && a < 11 && setTimeout(function() {
return n3.display.input.reset(true);
}, 20), Ra(this), Ms(), Or(this), this.curOp.forceUpdate = true, _i(this, o3), e3.autofocus && !m || this.hasFocus() ? setTimeout(function() {
n3.hasFocus() && !n3.state.focused && Qo(n3);
}, 20) : tr(this), Da)
Da.hasOwnProperty(c2) && Da[c2](this, e3[c2], Ma);
Xr(this), e3.finishInit && e3.finishInit(this);
for (var u2 = 0; u2 < Ha.length; ++u2)
Ha[u2](this);
Tr(this), l && e3.lineWrapping && "optimizelegibility" == getComputedStyle(i2.lineDiv).textRendering && (i2.lineDiv.style.textRendering = "auto");
}
function Ra(t4) {
var e3 = t4.display;
gt(e3.scroller, "mousedown", Dr(t4, ba)), gt(e3.scroller, "dblclick", s && a < 11 ? Dr(t4, function(e4) {
if (!bt(t4, e4)) {
var n4 = Fo(t4, e4);
if (n4 && !Pa(t4, e4) && !$n(t4.display, e4)) {
Ct(e4);
var o4 = t4.findWordAt(n4);
Fi(t4.doc, o4.anchor, o4.head);
}
}
}) : function(e4) {
return bt(t4, e4) || Ct(e4);
}), gt(e3.scroller, "contextmenu", function(e4) {
return Ea(t4, e4);
}), gt(e3.input.getField(), "contextmenu", function(n4) {
e3.scroller.contains(n4.target) || Ea(t4, n4);
});
var n3, o3 = { end: 0 };
function r2() {
e3.activeTouch && (n3 = setTimeout(function() {
return e3.activeTouch = null;
}, 1e3), (o3 = e3.activeTouch).end = +/* @__PURE__ */ new Date());
}
function i2(t5) {
if (1 != t5.touches.length)
return false;
var e4 = t5.touches[0];
return e4.radiusX <= 1 && e4.radiusY <= 1;
}
function l2(t5, e4) {
if (null == e4.left)
return true;
var n4 = e4.left - t5.left, o4 = e4.top - t5.top;
return n4 * n4 + o4 * o4 > 20 * 20;
}
gt(e3.scroller, "touchstart", function(r3) {
if (!bt(t4, r3) && !i2(r3) && !Pa(t4, r3)) {
e3.input.ensurePolled(), clearTimeout(n3);
var s2 = +/* @__PURE__ */ new Date();
e3.activeTouch = { start: s2, moved: false, prev: s2 - o3.end <= 300 ? o3 : null }, 1 == r3.touches.length && (e3.activeTouch.left = r3.touches[0].pageX, e3.activeTouch.top = r3.touches[0].pageY);
}
}), gt(e3.scroller, "touchmove", function() {
e3.activeTouch && (e3.activeTouch.moved = true);
}), gt(e3.scroller, "touchend", function(n4) {
var o4 = e3.activeTouch;
if (o4 && !$n(e3, n4) && null != o4.left && !o4.moved && /* @__PURE__ */ new Date() - o4.start < 300) {
var i3, s2 = t4.coordsChar(e3.activeTouch, "page");
i3 = !o4.prev || l2(o4, o4.prev) ? new ai(s2, s2) : !o4.prev.prev || l2(o4, o4.prev.prev) ? t4.findWordAt(s2) : new ai(se(s2.line, 0), fe(t4.doc, se(s2.line + 1, 0))), t4.setSelection(i3.anchor, i3.head), t4.focus(), Ct(n4);
}
r2();
}), gt(e3.scroller, "touchcancel", r2), gt(e3.scroller, "scroll", function() {
e3.scroller.clientHeight && (hr(t4, e3.scroller.scrollTop), vr(t4, e3.scroller.scrollLeft, true), mt(t4, "scroll", t4));
}), gt(e3.scroller, "mousewheel", function(e4) {
return ii(t4, e4);
}), gt(e3.scroller, "DOMMouseScroll", function(e4) {
return ii(t4, e4);
}), gt(e3.wrapper, "scroll", function() {
return e3.wrapper.scrollTop = e3.wrapper.scrollLeft = 0;
}), e3.dragFunctions = { enter: function(e4) {
bt(t4, e4) || Tt(e4);
}, over: function(e4) {
bt(t4, e4) || (Ps(t4, e4), Tt(e4));
}, start: function(e4) {
return ks(t4, e4);
}, drop: Dr(t4, Ts), leave: function(e4) {
bt(t4, e4) || Es(t4);
} };
var c2 = e3.input.getField();
gt(c2, "keyup", function(e4) {
return da.call(t4, e4);
}), gt(c2, "keydown", Dr(t4, ua)), gt(c2, "keypress", Dr(t4, fa)), gt(c2, "focus", function(e4) {
return Qo(t4, e4);
}), gt(c2, "blur", function(e4) {
return tr(t4, e4);
});
}
Va.defaults = La, Va.optionHandlers = Da;
var Ha = [];
function za(t4, e3, n3, o3) {
var r2, i2 = t4.doc;
null == n3 && (n3 = "add"), "smart" == n3 && (i2.mode.indent ? r2 = _e(t4, e3).state : n3 = "prev");
var s2 = t4.options.tabSize, a2 = Zt(i2, e3), l2 = R(a2.text, null, s2);
a2.stateAfter && (a2.stateAfter = null);
var c2, u2 = a2.text.match(/^\s*/)[0];
if (o3 || /\S/.test(a2.text)) {
if ("smart" == n3 && ((c2 = i2.mode.indent(r2, a2.text.slice(u2.length), a2.text)) == U || c2 > 150)) {
if (!o3)
return;
n3 = "prev";
}
} else
c2 = 0, n3 = "not";
"prev" == n3 ? c2 = e3 > i2.first ? R(Zt(i2, e3 - 1).text, null, s2) : 0 : "add" == n3 ? c2 = l2 + t4.options.indentUnit : "subtract" == n3 ? c2 = l2 - t4.options.indentUnit : "number" == typeof n3 && (c2 = l2 + n3), c2 = Math.max(0, c2);
var p2 = "", d2 = 0;
if (t4.options.indentWithTabs)
for (var f2 = Math.floor(c2 / s2); f2; --f2)
d2 += s2, p2 += " ";
if (d2 < c2 && (p2 += Y(c2 - d2)), p2 != u2)
return is(i2, p2, se(e3, 0), se(e3, u2.length), "+input"), a2.stateAfter = null, true;
for (var h2 = 0; h2 < i2.sel.ranges.length; h2++) {
var g2 = i2.sel.ranges[h2];
if (g2.head.line == e3 && g2.head.ch < u2.length) {
var v2 = se(e3, u2.length);
Ri(i2, h2, new ai(v2, v2));
break;
}
}
}
Va.defineInitHook = function(t4) {
return Ha.push(t4);
};
var Ba = null;
function Ua(t4) {
Ba = t4;
}
function Wa(t4, e3, n3, o3, r2) {
var i2 = t4.doc;
t4.display.shift = false, o3 || (o3 = i2.sel);
var s2 = +/* @__PURE__ */ new Date() - 200, a2 = "paste" == r2 || t4.state.pasteIncoming > s2, l2 = Nt(e3), c2 = null;
if (a2 && o3.ranges.length > 1)
if (Ba && Ba.text.join("\n") == e3) {
if (o3.ranges.length % Ba.text.length == 0) {
c2 = [];
for (var u2 = 0; u2 < Ba.text.length; u2++)
c2.push(i2.splitLines(Ba.text[u2]));
}
} else
l2.length == o3.ranges.length && t4.options.pasteLinesPerSelection && (c2 = J(l2, function(t5) {
return [t5];
}));
for (var p2 = t4.curOp.updateInput, d2 = o3.ranges.length - 1; d2 >= 0; d2--) {
var f2 = o3.ranges[d2], h2 = f2.from(), g2 = f2.to();
f2.empty() && (n3 && n3 > 0 ? h2 = se(h2.line, h2.ch - n3) : t4.state.overwrite && !a2 ? g2 = se(g2.line, Math.min(Zt(i2, g2.line).text.length, g2.ch + X(l2).length)) : a2 && Ba && Ba.lineWise && Ba.text.join("\n") == l2.join("\n") && (h2 = g2 = se(h2.line, 0)));
var v2 = { from: h2, to: g2, text: c2 ? c2[d2 % c2.length] : l2, origin: r2 || (a2 ? "paste" : t4.state.cutIncoming > s2 ? "cut" : "+input") };
Qi(t4.doc, v2), An(t4, "inputRead", t4, v2);
}
e3 && !a2 && qa(t4, e3), cr(t4), t4.curOp.updateInput < 2 && (t4.curOp.updateInput = p2), t4.curOp.typing = true, t4.state.pasteIncoming = t4.state.cutIncoming = -1;
}
function $a(t4, e3) {
var n3 = t4.clipboardData && t4.clipboardData.getData("Text");
if (n3)
return t4.preventDefault(), e3.isReadOnly() || e3.options.disableInput || !e3.hasFocus() || Lr(e3, function() {
return Wa(e3, n3, 0, null, "paste");
}), true;
}
function qa(t4, e3) {
if (t4.options.electricChars && t4.options.smartIndent)
for (var n3 = t4.doc.sel, o3 = n3.ranges.length - 1; o3 >= 0; o3--) {
var r2 = n3.ranges[o3];
if (!(r2.head.ch > 100 || o3 && n3.ranges[o3 - 1].head.line == r2.head.line)) {
var i2 = t4.getModeAt(r2.head), s2 = false;
if (i2.electricChars) {
for (var a2 = 0; a2 < i2.electricChars.length; a2++)
if (e3.indexOf(i2.electricChars.charAt(a2)) > -1) {
s2 = za(t4, r2.head.line, "smart");
break;
}
} else
i2.electricInput && i2.electricInput.test(Zt(t4.doc, r2.head.line).text.slice(0, r2.head.ch)) && (s2 = za(t4, r2.head.line, "smart"));
s2 && An(t4, "electricInput", t4, r2.head.line);
}
}
}
function Ga(t4) {
for (var e3 = [], n3 = [], o3 = 0; o3 < t4.doc.sel.ranges.length; o3++) {
var r2 = t4.doc.sel.ranges[o3].head.line, i2 = { anchor: se(r2, 0), head: se(r2 + 1, 0) };
n3.push(i2), e3.push(t4.getRange(i2.anchor, i2.head));
}
return { text: e3, ranges: n3 };
}
function Ka(t4, e3, n3, o3) {
t4.setAttribute("autocorrect", n3 ? "" : "off"), t4.setAttribute("autocapitalize", o3 ? "" : "off"), t4.setAttribute("spellcheck", !!e3);
}
function Ya() {
var t4 = A("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"), e3 = A("div", [t4], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
return l ? t4.style.width = "1000px" : t4.setAttribute("wrap", "off"), v && (t4.style.border = "1px solid black"), Ka(t4), e3;
}
function Xa(t4) {
var e3 = t4.optionHandlers, n3 = t4.helpers = {};
t4.prototype = { constructor: t4, focus: function() {
window.focus(), this.display.input.focus();
}, setOption: function(t5, n4) {
var o3 = this.options, r2 = o3[t5];
o3[t5] == n4 && "mode" != t5 || (o3[t5] = n4, e3.hasOwnProperty(t5) && Dr(this, e3[t5])(this, n4, r2), mt(this, "optionChange", this, t5));
}, getOption: function(t5) {
return this.options[t5];
}, getDoc: function() {
return this.doc;
}, addKeyMap: function(t5, e4) {
this.state.keyMaps[e4 ? "push" : "unshift"](qs(t5));
}, removeKeyMap: function(t5) {
for (var e4 = this.state.keyMaps, n4 = 0; n4 < e4.length; ++n4)
if (e4[n4] == t5 || e4[n4].name == t5)
return e4.splice(n4, 1), true;
}, addOverlay: Nr(function(e4, n4) {
var o3 = e4.token ? e4 : t4.getMode(this.options, e4);
if (o3.startState)
throw new Error("Overlays may not be stateful.");
Z(this.state.overlays, { mode: o3, modeSpec: e4, opaque: n4 && n4.opaque, priority: n4 && n4.priority || 0 }, function(t5) {
return t5.priority;
}), this.state.modeGen++, Ro(this);
}), removeOverlay: Nr(function(t5) {
for (var e4 = this.state.overlays, n4 = 0; n4 < e4.length; ++n4) {
var o3 = e4[n4].modeSpec;
if (o3 == t5 || "string" == typeof t5 && o3.name == t5)
return e4.splice(n4, 1), this.state.modeGen++, void Ro(this);
}
}), indentLine: Nr(function(t5, e4, n4) {
"string" != typeof e4 && "number" != typeof e4 && (e4 = null == e4 ? this.options.smartIndent ? "smart" : "prev" : e4 ? "add" : "subtract"), re(this.doc, t5) && za(this, t5, e4, n4);
}), indentSelection: Nr(function(t5) {
for (var e4 = this.doc.sel.ranges, n4 = -1, o3 = 0; o3 < e4.length; o3++) {
var r2 = e4[o3];
if (r2.empty())
r2.head.line > n4 && (za(this, r2.head.line, t5, true), n4 = r2.head.line, o3 == this.doc.sel.primIndex && cr(this));
else {
var i2 = r2.from(), s2 = r2.to(), a2 = Math.max(n4, i2.line);
n4 = Math.min(this.lastLine(), s2.line - (s2.ch ? 0 : 1)) + 1;
for (var l2 = a2; l2 < n4; ++l2)
za(this, l2, t5);
var c2 = this.doc.sel.ranges;
0 == i2.ch && e4.length == c2.length && c2[o3].from().ch > 0 && Ri(this.doc, o3, new ai(i2, c2[o3].to()), W);
}
}
}), getTokenAt: function(t5, e4) {
return Oe(this, t5, e4);
}, getLineTokens: function(t5, e4) {
return Oe(this, se(t5), e4, true);
}, getTokenTypeAt: function(t5) {
t5 = fe(this.doc, t5);
var e4, n4 = be(this, Zt(this.doc, t5.line)), o3 = 0, r2 = (n4.length - 1) / 2, i2 = t5.ch;
if (0 == i2)
e4 = n4[2];
else
for (; ; ) {
var s2 = o3 + r2 >> 1;
if ((s2 ? n4[2 * s2 - 1] : 0) >= i2)
r2 = s2;
else {
if (!(n4[2 * s2 + 1] < i2)) {
e4 = n4[2 * s2 + 2];
break;
}
o3 = s2 + 1;
}
}
var a2 = e4 ? e4.indexOf("overlay ") : -1;
return a2 < 0 ? e4 : 0 == a2 ? null : e4.slice(0, a2 - 1);
}, getModeAt: function(e4) {
var n4 = this.doc.mode;
return n4.innerMode ? t4.innerMode(n4, this.getTokenAt(e4).state).mode : n4;
}, getHelper: function(t5, e4) {
return this.getHelpers(t5, e4)[0];
}, getHelpers: function(t5, e4) {
var o3 = [];
if (!n3.hasOwnProperty(e4))
return o3;
var r2 = n3[e4], i2 = this.getModeAt(t5);
if ("string" == typeof i2[e4])
r2[i2[e4]] && o3.push(r2[i2[e4]]);
else if (i2[e4])
for (var s2 = 0; s2 < i2[e4].length; s2++) {
var a2 = r2[i2[e4][s2]];
a2 && o3.push(a2);
}
else
i2.helperType && r2[i2.helperType] ? o3.push(r2[i2.helperType]) : r2[i2.name] && o3.push(r2[i2.name]);
for (var l2 = 0; l2 < r2._global.length; l2++) {
var c2 = r2._global[l2];
c2.pred(i2, this) && -1 == z(o3, c2.val) && o3.push(c2.val);
}
return o3;
}, getStateAfter: function(t5, e4) {
var n4 = this.doc;
return _e(this, (t5 = de(n4, null == t5 ? n4.first + n4.size - 1 : t5)) + 1, e4).state;
}, cursorCoords: function(t5, e4) {
var n4 = this.doc.sel.primary();
return wo(this, null == t5 ? n4.head : "object" == typeof t5 ? fe(this.doc, t5) : t5 ? n4.from() : n4.to(), e4 || "page");
}, charCoords: function(t5, e4) {
return _o(this, fe(this.doc, t5), e4 || "page");
}, coordsChar: function(t5, e4) {
return So(this, (t5 = bo(this, t5, e4 || "page")).left, t5.top);
}, lineAtHeight: function(t5, e4) {
return t5 = bo(this, { top: t5, left: 0 }, e4 || "page").top, oe(this.doc, t5 + this.display.viewOffset);
}, heightAtLine: function(t5, e4, n4) {
var o3, r2 = false;
if ("number" == typeof t5) {
var i2 = this.doc.first + this.doc.size - 1;
t5 < this.doc.first ? t5 = this.doc.first : t5 > i2 && (t5 = i2, r2 = true), o3 = Zt(this.doc, t5);
} else
o3 = t5;
return mo(this, o3, { top: 0, left: 0 }, e4 || "page", n4 || r2).top + (r2 ? this.doc.height - an(o3) : 0);
}, defaultTextHeight: function() {
return jo(this.display);
}, defaultCharWidth: function() {
return Mo(this.display);
}, getViewport: function() {
return { from: this.display.viewFrom, to: this.display.viewTo };
}, addWidget: function(t5, e4, n4, o3, r2) {
var i2 = this.display, s2 = (t5 = wo(this, fe(this.doc, t5))).bottom, a2 = t5.left;
if (e4.style.position = "absolute", e4.setAttribute("cm-ignore-events", "true"), this.display.input.setUneditable(e4), i2.sizer.appendChild(e4), "over" == o3)
s2 = t5.top;
else if ("above" == o3 || "near" == o3) {
var l2 = Math.max(i2.wrapper.clientHeight, this.doc.height), c2 = Math.max(i2.sizer.clientWidth, i2.lineSpace.clientWidth);
("above" == o3 || t5.bottom + e4.offsetHeight > l2) && t5.top > e4.offsetHeight ? s2 = t5.top - e4.offsetHeight : t5.bottom + e4.offsetHeight <= l2 && (s2 = t5.bottom), a2 + e4.offsetWidth > c2 && (a2 = c2 - e4.offsetWidth);
}
e4.style.top = s2 + "px", e4.style.left = e4.style.right = "", "right" == r2 ? (a2 = i2.sizer.clientWidth - e4.offsetWidth, e4.style.right = "0px") : ("left" == r2 ? a2 = 0 : "middle" == r2 && (a2 = (i2.sizer.clientWidth - e4.offsetWidth) / 2), e4.style.left = a2 + "px"), n4 && sr(this, { left: a2, top: s2, right: a2 + e4.offsetWidth, bottom: s2 + e4.offsetHeight });
}, triggerOnKeyDown: Nr(ua), triggerOnKeyPress: Nr(fa), triggerOnKeyUp: da, triggerOnMouseDown: Nr(ba), execCommand: function(t5) {
if (Zs.hasOwnProperty(t5))
return Zs[t5].call(null, this);
}, triggerElectric: Nr(function(t5) {
qa(this, t5);
}), findPosH: function(t5, e4, n4, o3) {
var r2 = 1;
e4 < 0 && (r2 = -1, e4 = -e4);
for (var i2 = fe(this.doc, t5), s2 = 0; s2 < e4 && !(i2 = Ja(this.doc, i2, r2, n4, o3)).hitSide; ++s2)
;
return i2;
}, moveH: Nr(function(t5, e4) {
var n4 = this;
this.extendSelectionsBy(function(o3) {
return n4.display.shift || n4.doc.extend || o3.empty() ? Ja(n4.doc, o3.head, t5, e4, n4.options.rtlMoveVisually) : t5 < 0 ? o3.from() : o3.to();
}, q);
}), deleteH: Nr(function(t5, e4) {
var n4 = this.doc.sel, o3 = this.doc;
n4.somethingSelected() ? o3.replaceSelection("", null, "+delete") : Gs(this, function(n5) {
var r2 = Ja(o3, n5.head, t5, e4, false);
return t5 < 0 ? { from: r2, to: n5.head } : { from: n5.head, to: r2 };
});
}), findPosV: function(t5, e4, n4, o3) {
var r2 = 1, i2 = o3;
e4 < 0 && (r2 = -1, e4 = -e4);
for (var s2 = fe(this.doc, t5), a2 = 0; a2 < e4; ++a2) {
var l2 = wo(this, s2, "div");
if (null == i2 ? i2 = l2.left : l2.left = i2, (s2 = Za(this, l2, r2, n4)).hitSide)
break;
}
return s2;
}, moveV: Nr(function(t5, e4) {
var n4 = this, o3 = this.doc, r2 = [], i2 = !this.display.shift && !o3.extend && o3.sel.somethingSelected();
if (o3.extendSelectionsBy(function(s3) {
if (i2)
return t5 < 0 ? s3.from() : s3.to();
var a2 = wo(n4, s3.head, "div");
null != s3.goalColumn && (a2.left = s3.goalColumn), r2.push(a2.left);
var l2 = Za(n4, a2, t5, e4);
return "page" == e4 && s3 == o3.sel.primary() && lr(n4, _o(n4, l2, "div").top - a2.top), l2;
}, q), r2.length)
for (var s2 = 0; s2 < o3.sel.ranges.length; s2++)
o3.sel.ranges[s2].goalColumn = r2[s2];
}), findWordAt: function(t5) {
var e4 = Zt(this.doc, t5.line).text, n4 = t5.ch, o3 = t5.ch;
if (e4) {
var r2 = this.getHelper(t5, "wordChars");
"before" != t5.sticky && o3 != e4.length || !n4 ? ++o3 : --n4;
for (var i2 = e4.charAt(n4), s2 = ot(i2, r2) ? function(t6) {
return ot(t6, r2);
} : /\s/.test(i2) ? function(t6) {
return /\s/.test(t6);
} : function(t6) {
return !/\s/.test(t6) && !ot(t6);
}; n4 > 0 && s2(e4.charAt(n4 - 1)); )
--n4;
for (; o3 < e4.length && s2(e4.charAt(o3)); )
++o3;
}
return new ai(se(t5.line, n4), se(t5.line, o3));
}, toggleOverwrite: function(t5) {
null != t5 && t5 == this.state.overwrite || ((this.state.overwrite = !this.state.overwrite) ? D(this.display.cursorDiv, "CodeMirror-overwrite") : k(this.display.cursorDiv, "CodeMirror-overwrite"), mt(this, "overwriteToggle", this, this.state.overwrite));
}, hasFocus: function() {
return this.display.input.getField() == L();
}, isReadOnly: function() {
return !(!this.options.readOnly && !this.doc.cantEdit);
}, scrollTo: Nr(function(t5, e4) {
ur(this, t5, e4);
}), getScrollInfo: function() {
var t5 = this.display.scroller;
return { left: t5.scrollLeft, top: t5.scrollTop, height: t5.scrollHeight - Yn(this) - this.display.barHeight, width: t5.scrollWidth - Yn(this) - this.display.barWidth, clientHeight: Jn(this), clientWidth: Xn(this) };
}, scrollIntoView: Nr(function(t5, e4) {
null == t5 ? (t5 = { from: this.doc.sel.primary().head, to: null }, null == e4 && (e4 = this.options.cursorScrollMargin)) : "number" == typeof t5 ? t5 = { from: se(t5, 0), to: null } : null == t5.from && (t5 = { from: t5, to: null }), t5.to || (t5.to = t5.from), t5.margin = e4 || 0, null != t5.from.line ? pr(this, t5) : fr(this, t5.from, t5.to, t5.margin);
}), setSize: Nr(function(t5, e4) {
var n4 = this, o3 = function(t6) {
return "number" == typeof t6 || /^\d+$/.test(String(t6)) ? t6 + "px" : t6;
};
null != t5 && (this.display.wrapper.style.width = o3(t5)), null != e4 && (this.display.wrapper.style.height = o3(e4)), this.options.lineWrapping && fo(this);
var r2 = this.display.viewFrom;
this.doc.iter(r2, this.display.viewTo, function(t6) {
if (t6.widgets) {
for (var e5 = 0; e5 < t6.widgets.length; e5++)
if (t6.widgets[e5].noHScroll) {
Ho(n4, r2, "widget");
break;
}
}
++r2;
}), this.curOp.forceUpdate = true, mt(this, "refresh", this);
}), operation: function(t5) {
return Lr(this, t5);
}, startOperation: function() {
return Or(this);
}, endOperation: function() {
return Tr(this);
}, refresh: Nr(function() {
var t5 = this.display.cachedTextHeight;
Ro(this), this.curOp.forceUpdate = true, ho(this), ur(this, this.doc.scrollLeft, this.doc.scrollTop), Gr(this.display), (null == t5 || Math.abs(t5 - jo(this.display)) > 0.5 || this.options.lineWrapping) && Io(this), mt(this, "refresh", this);
}), swapDoc: Nr(function(t5) {
var e4 = this.doc;
return e4.cm = null, this.state.selectingText && this.state.selectingText(), _i(this, t5), ho(this), this.display.input.reset(), ur(this, t5.scrollLeft, t5.scrollTop), this.curOp.forceScroll = true, An(this, "swapDoc", this, e4), e4;
}), phrase: function(t5) {
var e4 = this.options.phrases;
return e4 && Object.prototype.hasOwnProperty.call(e4, t5) ? e4[t5] : t5;
}, 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;
} }, xt(t4), t4.registerHelper = function(e4, o3, r2) {
n3.hasOwnProperty(e4) || (n3[e4] = t4[e4] = { _global: [] }), n3[e4][o3] = r2;
}, t4.registerGlobalHelper = function(e4, o3, r2, i2) {
t4.registerHelper(e4, o3, i2), n3[e4]._global.push({ pred: r2, val: i2 });
};
}
function Ja(t4, e3, n3, o3, r2) {
var i2 = e3, s2 = n3, a2 = Zt(t4, e3.line), l2 = r2 && "rtl" == t4.direction ? -n3 : n3;
function c2() {
var n4 = e3.line + l2;
return !(n4 < t4.first || n4 >= t4.first + t4.size) && (e3 = new se(n4, e3.ch, e3.sticky), a2 = Zt(t4, n4));
}
function u2(i3) {
var s3;
if ("codepoint" == o3) {
var u3 = a2.text.charCodeAt(e3.ch + (n3 > 0 ? 0 : -1));
if (isNaN(u3))
s3 = null;
else {
var p3 = n3 > 0 ? u3 >= 55296 && u3 < 56320 : u3 >= 56320 && u3 < 57343;
s3 = new se(e3.line, Math.max(0, Math.min(a2.text.length, e3.ch + n3 * (p3 ? 2 : 1))), -n3);
}
} else
s3 = r2 ? Js(t4.cm, a2, e3, n3) : Ys(a2, e3, n3);
if (null == s3) {
if (i3 || !c2())
return false;
e3 = Xs(r2, t4.cm, a2, e3.line, l2);
} else
e3 = s3;
return true;
}
if ("char" == o3 || "codepoint" == o3)
u2();
else if ("column" == o3)
u2(true);
else if ("word" == o3 || "group" == o3)
for (var p2 = null, d2 = "group" == o3, f2 = t4.cm && t4.cm.getHelper(e3, "wordChars"), h2 = true; !(n3 < 0) || u2(!h2); h2 = false) {
var g2 = a2.text.charAt(e3.ch) || "\n", v2 = ot(g2, f2) ? "w" : d2 && "\n" == g2 ? "n" : !d2 || /\s/.test(g2) ? null : "p";
if (!d2 || h2 || v2 || (v2 = "s"), p2 && p2 != v2) {
n3 < 0 && (n3 = 1, u2(), e3.sticky = "after");
break;
}
if (v2 && (p2 = v2), n3 > 0 && !u2(!h2))
break;
}
var y2 = Yi(t4, e3, i2, s2, true);
return le(i2, y2) && (y2.hitSide = true), y2;
}
function Za(t4, e3, n3, o3) {
var r2, i2, s2 = t4.doc, a2 = e3.left;
if ("page" == o3) {
var l2 = Math.min(t4.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight), c2 = Math.max(l2 - 0.5 * jo(t4.display), 3);
r2 = (n3 > 0 ? e3.bottom : e3.top) + n3 * c2;
} else
"line" == o3 && (r2 = n3 > 0 ? e3.bottom + 3 : e3.top - 3);
for (; (i2 = So(t4, a2, r2)).outside; ) {
if (n3 < 0 ? r2 <= 0 : r2 >= s2.height) {
i2.hitSide = true;
break;
}
r2 += 5 * n3;
}
return i2;
}
var Qa = function(t4) {
this.cm = t4, this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null, this.polling = new H(), this.composing = null, this.gracePeriod = false, this.readDOMTimeout = null;
};
function tl(t4, e3) {
var n3 = no(t4, e3.line);
if (!n3 || n3.hidden)
return null;
var o3 = Zt(t4.doc, e3.line), r2 = Qn(n3, o3, e3.line), i2 = ft(o3, t4.doc.direction), s2 = "left";
i2 && (s2 = pt(i2, e3.ch) % 2 ? "right" : "left");
var a2 = ao(r2.map, e3.ch, s2);
return a2.offset = "right" == a2.collapse ? a2.end : a2.start, a2;
}
function el(t4) {
for (var e3 = t4; e3; e3 = e3.parentNode)
if (/CodeMirror-gutter-wrapper/.test(e3.className))
return true;
return false;
}
function nl(t4, e3) {
return e3 && (t4.bad = true), t4;
}
function ol(t4, e3, n3, o3, r2) {
var i2 = "", s2 = false, a2 = t4.doc.lineSeparator(), l2 = false;
function c2(t5) {
return function(e4) {
return e4.id == t5;
};
}
function u2() {
s2 && (i2 += a2, l2 && (i2 += a2), s2 = l2 = false);
}
function p2(t5) {
t5 && (u2(), i2 += t5);
}
function d2(e4) {
if (1 == e4.nodeType) {
var n4 = e4.getAttribute("cm-text");
if (n4)
return void p2(n4);
var i3, f2 = e4.getAttribute("cm-marker");
if (f2) {
var h2 = t4.findMarks(se(o3, 0), se(r2 + 1, 0), c2(+f2));
return void (h2.length && (i3 = h2[0].find(0)) && p2(Qt(t4.doc, i3.from, i3.to).join(a2)));
}
if ("false" == e4.getAttribute("contenteditable"))
return;
var g2 = /^(pre|div|p|li|table|br)$/i.test(e4.nodeName);
if (!/^br$/i.test(e4.nodeName) && 0 == e4.textContent.length)
return;
g2 && u2();
for (var v2 = 0; v2 < e4.childNodes.length; v2++)
d2(e4.childNodes[v2]);
/^(pre|p)$/i.test(e4.nodeName) && (l2 = true), g2 && (s2 = true);
} else
3 == e4.nodeType && p2(e4.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " "));
}
for (; d2(e3), e3 != n3; )
e3 = e3.nextSibling, l2 = false;
return i2;
}
function rl(t4, e3, n3) {
var o3;
if (e3 == t4.display.lineDiv) {
if (!(o3 = t4.display.lineDiv.childNodes[n3]))
return nl(t4.clipPos(se(t4.display.viewTo - 1)), true);
e3 = null, n3 = 0;
} else
for (o3 = e3; ; o3 = o3.parentNode) {
if (!o3 || o3 == t4.display.lineDiv)
return null;
if (o3.parentNode && o3.parentNode == t4.display.lineDiv)
break;
}
for (var r2 = 0; r2 < t4.display.view.length; r2++) {
var i2 = t4.display.view[r2];
if (i2.node == o3)
return il(i2, e3, n3);
}
}
function il(t4, e3, n3) {
var o3 = t4.text.firstChild, r2 = false;
if (!e3 || !M(o3, e3))
return nl(se(ne(t4.line), 0), true);
if (e3 == o3 && (r2 = true, e3 = o3.childNodes[n3], n3 = 0, !e3)) {
var i2 = t4.rest ? X(t4.rest) : t4.line;
return nl(se(ne(i2), i2.text.length), r2);
}
var s2 = 3 == e3.nodeType ? e3 : null, a2 = e3;
for (s2 || 1 != e3.childNodes.length || 3 != e3.firstChild.nodeType || (s2 = e3.firstChild, n3 && (n3 = s2.nodeValue.length)); a2.parentNode != o3; )
a2 = a2.parentNode;
var l2 = t4.measure, c2 = l2.maps;
function u2(e4, n4, o4) {
for (var r3 = -1; r3 < (c2 ? c2.length : 0); r3++)
for (var i3 = r3 < 0 ? l2.map : c2[r3], s3 = 0; s3 < i3.length; s3 += 3) {
var a3 = i3[s3 + 2];
if (a3 == e4 || a3 == n4) {
var u3 = ne(r3 < 0 ? t4.line : t4.rest[r3]), p3 = i3[s3] + o4;
return (o4 < 0 || a3 != e4) && (p3 = i3[s3 + (o4 ? 1 : 0)]), se(u3, p3);
}
}
}
var p2 = u2(s2, a2, n3);
if (p2)
return nl(p2, r2);
for (var d2 = a2.nextSibling, f2 = s2 ? s2.nodeValue.length - n3 : 0; d2; d2 = d2.nextSibling) {
if (p2 = u2(d2, d2.firstChild, 0))
return nl(se(p2.line, p2.ch - f2), r2);
f2 += d2.textContent.length;
}
for (var h2 = a2.previousSibling, g2 = n3; h2; h2 = h2.previousSibling) {
if (p2 = u2(h2, h2.firstChild, -1))
return nl(se(p2.line, p2.ch + g2), r2);
g2 += h2.textContent.length;
}
}
Qa.prototype.init = function(t4) {
var e3 = this, n3 = this, o3 = n3.cm, r2 = n3.div = t4.lineDiv;
function i2(t5) {
for (var e4 = t5.target; e4; e4 = e4.parentNode) {
if (e4 == r2)
return true;
if (/\bCodeMirror-(?:line)?widget\b/.test(e4.className))
break;
}
return false;
}
function s2(t5) {
if (i2(t5) && !bt(o3, t5)) {
if (o3.somethingSelected())
Ua({ lineWise: false, text: o3.getSelections() }), "cut" == t5.type && o3.replaceSelection("", null, "cut");
else {
if (!o3.options.lineWiseCopyCut)
return;
var e4 = Ga(o3);
Ua({ lineWise: true, text: e4.text }), "cut" == t5.type && o3.operation(function() {
o3.setSelections(e4.ranges, 0, W), o3.replaceSelection("", null, "cut");
});
}
if (t5.clipboardData) {
t5.clipboardData.clearData();
var s3 = Ba.text.join("\n");
if (t5.clipboardData.setData("Text", s3), t5.clipboardData.getData("Text") == s3)
return void t5.preventDefault();
}
var a2 = Ya(), l2 = a2.firstChild;
o3.display.lineSpace.insertBefore(a2, o3.display.lineSpace.firstChild), l2.value = Ba.text.join("\n");
var c2 = L();
I(l2), setTimeout(function() {
o3.display.lineSpace.removeChild(a2), c2.focus(), c2 == r2 && n3.showPrimarySelection();
}, 50);
}
}
r2.contentEditable = true, Ka(r2, o3.options.spellcheck, o3.options.autocorrect, o3.options.autocapitalize), gt(r2, "paste", function(t5) {
!i2(t5) || bt(o3, t5) || $a(t5, o3) || a <= 11 && setTimeout(Dr(o3, function() {
return e3.updateFromDOM();
}), 20);
}), gt(r2, "compositionstart", function(t5) {
e3.composing = { data: t5.data, done: false };
}), gt(r2, "compositionupdate", function(t5) {
e3.composing || (e3.composing = { data: t5.data, done: false });
}), gt(r2, "compositionend", function(t5) {
e3.composing && (t5.data != e3.composing.data && e3.readFromDOMSoon(), e3.composing.done = true);
}), gt(r2, "touchstart", function() {
return n3.forceCompositionEnd();
}), gt(r2, "input", function() {
e3.composing || e3.readFromDOMSoon();
}), gt(r2, "copy", s2), gt(r2, "cut", s2);
}, Qa.prototype.screenReaderLabelChanged = function(t4) {
t4 ? this.div.setAttribute("aria-label", t4) : this.div.removeAttribute("aria-label");
}, Qa.prototype.prepareSelection = function() {
var t4 = qo(this.cm, false);
return t4.focus = L() == this.div, t4;
}, Qa.prototype.showSelection = function(t4, e3) {
t4 && this.cm.display.view.length && ((t4.focus || e3) && this.showPrimarySelection(), this.showMultipleSelections(t4));
}, Qa.prototype.getSelection = function() {
return this.cm.display.wrapper.ownerDocument.getSelection();
}, Qa.prototype.showPrimarySelection = function() {
var t4 = this.getSelection(), e3 = this.cm, o3 = e3.doc.sel.primary(), r2 = o3.from(), i2 = o3.to();
if (e3.display.viewTo == e3.display.viewFrom || r2.line >= e3.display.viewTo || i2.line < e3.display.viewFrom)
t4.removeAllRanges();
else {
var s2 = rl(e3, t4.anchorNode, t4.anchorOffset), a2 = rl(e3, t4.focusNode, t4.focusOffset);
if (!s2 || s2.bad || !a2 || a2.bad || 0 != ae(pe(s2, a2), r2) || 0 != ae(ue(s2, a2), i2)) {
var l2 = e3.display.view, c2 = r2.line >= e3.display.viewFrom && tl(e3, r2) || { node: l2[0].measure.map[2], offset: 0 }, u2 = i2.line < e3.display.viewTo && tl(e3, i2);
if (!u2) {
var p2 = l2[l2.length - 1].measure, d2 = p2.maps ? p2.maps[p2.maps.length - 1] : p2.map;
u2 = { node: d2[d2.length - 1], offset: d2[d2.length - 2] - d2[d2.length - 3] };
}
if (c2 && u2) {
var f2, h2 = t4.rangeCount && t4.getRangeAt(0);
try {
f2 = T(c2.node, c2.offset, u2.offset, u2.node);
} catch (t5) {
}
f2 && (!n2 && e3.state.focused ? (t4.collapse(c2.node, c2.offset), f2.collapsed || (t4.removeAllRanges(), t4.addRange(f2))) : (t4.removeAllRanges(), t4.addRange(f2)), h2 && null == t4.anchorNode ? t4.addRange(h2) : n2 && this.startGracePeriod()), this.rememberSelection();
} else
t4.removeAllRanges();
}
}
}, Qa.prototype.startGracePeriod = function() {
var t4 = this;
clearTimeout(this.gracePeriod), this.gracePeriod = setTimeout(function() {
t4.gracePeriod = false, t4.selectionChanged() && t4.cm.operation(function() {
return t4.cm.curOp.selectionChanged = true;
});
}, 20);
}, Qa.prototype.showMultipleSelections = function(t4) {
E(this.cm.display.cursorDiv, t4.cursors), E(this.cm.display.selectionDiv, t4.selection);
}, Qa.prototype.rememberSelection = function() {
var t4 = this.getSelection();
this.lastAnchorNode = t4.anchorNode, this.lastAnchorOffset = t4.anchorOffset, this.lastFocusNode = t4.focusNode, this.lastFocusOffset = t4.focusOffset;
}, Qa.prototype.selectionInEditor = function() {
var t4 = this.getSelection();
if (!t4.rangeCount)
return false;
var e3 = t4.getRangeAt(0).commonAncestorContainer;
return M(this.div, e3);
}, Qa.prototype.focus = function() {
"nocursor" != this.cm.options.readOnly && (this.selectionInEditor() && L() == this.div || this.showSelection(this.prepareSelection(), true), this.div.focus());
}, Qa.prototype.blur = function() {
this.div.blur();
}, Qa.prototype.getField = function() {
return this.div;
}, Qa.prototype.supportsTouch = function() {
return true;
}, Qa.prototype.receivedFocus = function() {
var t4 = this, e3 = this;
function n3() {
e3.cm.state.focused && (e3.pollSelection(), e3.polling.set(e3.cm.options.pollInterval, n3));
}
this.selectionInEditor() ? setTimeout(function() {
return t4.pollSelection();
}, 20) : Lr(this.cm, function() {
return e3.cm.curOp.selectionChanged = true;
}), this.polling.set(this.cm.options.pollInterval, n3);
}, Qa.prototype.selectionChanged = function() {
var t4 = this.getSelection();
return t4.anchorNode != this.lastAnchorNode || t4.anchorOffset != this.lastAnchorOffset || t4.focusNode != this.lastFocusNode || t4.focusOffset != this.lastFocusOffset;
}, Qa.prototype.pollSelection = function() {
if (null == this.readDOMTimeout && !this.gracePeriod && this.selectionChanged()) {
var t4 = this.getSelection(), e3 = this.cm;
if (y && u && this.cm.display.gutterSpecs.length && el(t4.anchorNode))
return this.cm.triggerOnKeyDown({ type: "keydown", keyCode: 8, preventDefault: Math.abs }), this.blur(), void this.focus();
if (!this.composing) {
this.rememberSelection();
var n3 = rl(e3, t4.anchorNode, t4.anchorOffset), o3 = rl(e3, t4.focusNode, t4.focusOffset);
n3 && o3 && Lr(e3, function() {
Ui(e3.doc, ci(n3, o3), W), (n3.bad || o3.bad) && (e3.curOp.selectionChanged = true);
});
}
}
}, Qa.prototype.pollContent = function() {
null != this.readDOMTimeout && (clearTimeout(this.readDOMTimeout), this.readDOMTimeout = null);
var t4, e3, n3, o3 = this.cm, r2 = o3.display, i2 = o3.doc.sel.primary(), s2 = i2.from(), a2 = i2.to();
if (0 == s2.ch && s2.line > o3.firstLine() && (s2 = se(s2.line - 1, Zt(o3.doc, s2.line - 1).length)), a2.ch == Zt(o3.doc, a2.line).text.length && a2.line < o3.lastLine() && (a2 = se(a2.line + 1, 0)), s2.line < r2.viewFrom || a2.line > r2.viewTo - 1)
return false;
s2.line == r2.viewFrom || 0 == (t4 = Vo(o3, s2.line)) ? (e3 = ne(r2.view[0].line), n3 = r2.view[0].node) : (e3 = ne(r2.view[t4].line), n3 = r2.view[t4 - 1].node.nextSibling);
var l2, c2, u2 = Vo(o3, a2.line);
if (u2 == r2.view.length - 1 ? (l2 = r2.viewTo - 1, c2 = r2.lineDiv.lastChild) : (l2 = ne(r2.view[u2 + 1].line) - 1, c2 = r2.view[u2 + 1].node.previousSibling), !n3)
return false;
for (var p2 = o3.doc.splitLines(ol(o3, n3, c2, e3, l2)), d2 = Qt(o3.doc, se(e3, 0), se(l2, Zt(o3.doc, l2).text.length)); p2.length > 1 && d2.length > 1; )
if (X(p2) == X(d2))
p2.pop(), d2.pop(), l2--;
else {
if (p2[0] != d2[0])
break;
p2.shift(), d2.shift(), e3++;
}
for (var f2 = 0, h2 = 0, g2 = p2[0], v2 = d2[0], y2 = Math.min(g2.length, v2.length); f2 < y2 && g2.charCodeAt(f2) == v2.charCodeAt(f2); )
++f2;
for (var m2 = X(p2), b2 = X(d2), _2 = Math.min(m2.length - (1 == p2.length ? f2 : 0), b2.length - (1 == d2.length ? f2 : 0)); h2 < _2 && m2.charCodeAt(m2.length - h2 - 1) == b2.charCodeAt(b2.length - h2 - 1); )
++h2;
if (1 == p2.length && 1 == d2.length && e3 == s2.line)
for (; f2 && f2 > s2.ch && m2.charCodeAt(m2.length - h2 - 1) == b2.charCodeAt(b2.length - h2 - 1); )
f2--, h2++;
p2[p2.length - 1] = m2.slice(0, m2.length - h2).replace(/^\u200b+/, ""), p2[0] = p2[0].slice(f2).replace(/\u200b+$/, "");
var w2 = se(e3, f2), x2 = se(l2, d2.length ? X(d2).length - h2 : 0);
return p2.length > 1 || p2[0] || ae(w2, x2) ? (is(o3.doc, p2, w2, x2, "+input"), true) : void 0;
}, Qa.prototype.ensurePolled = function() {
this.forceCompositionEnd();
}, Qa.prototype.reset = function() {
this.forceCompositionEnd();
}, Qa.prototype.forceCompositionEnd = function() {
this.composing && (clearTimeout(this.readDOMTimeout), this.composing = null, this.updateFromDOM(), this.div.blur(), this.div.focus());
}, Qa.prototype.readFromDOMSoon = function() {
var t4 = this;
null == this.readDOMTimeout && (this.readDOMTimeout = setTimeout(function() {
if (t4.readDOMTimeout = null, t4.composing) {
if (!t4.composing.done)
return;
t4.composing = null;
}
t4.updateFromDOM();
}, 80));
}, Qa.prototype.updateFromDOM = function() {
var t4 = this;
!this.cm.isReadOnly() && this.pollContent() || Lr(this.cm, function() {
return Ro(t4.cm);
});
}, Qa.prototype.setUneditable = function(t4) {
t4.contentEditable = "false";
}, Qa.prototype.onKeyPress = function(t4) {
0 == t4.charCode || this.composing || (t4.preventDefault(), this.cm.isReadOnly() || Dr(this.cm, Wa)(this.cm, String.fromCharCode(null == t4.charCode ? t4.keyCode : t4.charCode), 0));
}, Qa.prototype.readOnlyChanged = function(t4) {
this.div.contentEditable = String("nocursor" != t4);
}, Qa.prototype.onContextMenu = function() {
}, Qa.prototype.resetPosition = function() {
}, Qa.prototype.needsContentAttribute = true;
var sl = function(t4) {
this.cm = t4, this.prevInput = "", this.pollingFast = false, this.polling = new H(), this.hasSelection = false, this.composing = null;
};
function al(t4, e3) {
if ((e3 = e3 ? V(e3) : {}).value = t4.value, !e3.tabindex && t4.tabIndex && (e3.tabindex = t4.tabIndex), !e3.placeholder && t4.placeholder && (e3.placeholder = t4.placeholder), null == e3.autofocus) {
var n3 = L();
e3.autofocus = n3 == t4 || null != t4.getAttribute("autofocus") && n3 == document.body;
}
function o3() {
t4.value = a2.getValue();
}
var r2;
if (t4.form && (gt(t4.form, "submit", o3), !e3.leaveSubmitMethodAlone)) {
var i2 = t4.form;
r2 = i2.submit;
try {
var s2 = i2.submit = function() {
o3(), i2.submit = r2, i2.submit(), i2.submit = s2;
};
} catch (t5) {
}
}
e3.finishInit = function(n4) {
n4.save = o3, n4.getTextArea = function() {
return t4;
}, n4.toTextArea = function() {
n4.toTextArea = isNaN, o3(), t4.parentNode.removeChild(n4.getWrapperElement()), t4.style.display = "", t4.form && (yt(t4.form, "submit", o3), e3.leaveSubmitMethodAlone || "function" != typeof t4.form.submit || (t4.form.submit = r2));
};
}, t4.style.display = "none";
var a2 = Va(function(e4) {
return t4.parentNode.insertBefore(e4, t4.nextSibling);
}, e3);
return a2;
}
function ll(t4) {
t4.off = yt, t4.on = gt, t4.wheelEventPixels = ri, t4.Doc = Ss, t4.splitLines = Nt, t4.countColumn = R, t4.findColumn = G, t4.isWordChar = nt, t4.Pass = U, t4.signal = mt, t4.Line = un, t4.changeEnd = ui, t4.scrollbarModel = xr, t4.Pos = se, t4.cmpPos = ae, t4.modes = Ht, t4.mimeModes = zt, t4.resolveMode = Wt, t4.getMode = $t, t4.modeExtensions = qt, t4.extendMode = Gt, t4.copyState = Kt, t4.startState = Xt, t4.innerMode = Yt, t4.commands = Zs, t4.keyMap = Rs, t4.keyName = $s, t4.isModifierKey = Us, t4.lookupKey = Bs, t4.normalizeKeyMap = zs, t4.StringStream = Jt, t4.SharedTextMarker = ms, t4.TextMarker = vs, t4.LineWidget = ds, t4.e_preventDefault = Ct, t4.e_stopPropagation = St, t4.e_stop = Tt, t4.addClass = D, t4.contains = M, t4.rmClass = k, t4.keyNames = Ns;
}
sl.prototype.init = function(t4) {
var e3 = this, n3 = this, o3 = this.cm;
this.createField(t4);
var r2 = this.textarea;
function i2(t5) {
if (!bt(o3, t5)) {
if (o3.somethingSelected())
Ua({ lineWise: false, text: o3.getSelections() });
else {
if (!o3.options.lineWiseCopyCut)
return;
var e4 = Ga(o3);
Ua({ lineWise: true, text: e4.text }), "cut" == t5.type ? o3.setSelections(e4.ranges, null, W) : (n3.prevInput = "", r2.value = e4.text.join("\n"), I(r2));
}
"cut" == t5.type && (o3.state.cutIncoming = +/* @__PURE__ */ new Date());
}
}
t4.wrapper.insertBefore(this.wrapper, t4.wrapper.firstChild), v && (r2.style.width = "0px"), gt(r2, "input", function() {
s && a >= 9 && e3.hasSelection && (e3.hasSelection = null), n3.poll();
}), gt(r2, "paste", function(t5) {
bt(o3, t5) || $a(t5, o3) || (o3.state.pasteIncoming = +/* @__PURE__ */ new Date(), n3.fastPoll());
}), gt(r2, "cut", i2), gt(r2, "copy", i2), gt(t4.scroller, "paste", function(e4) {
if (!$n(t4, e4) && !bt(o3, e4)) {
if (!r2.dispatchEvent)
return o3.state.pasteIncoming = +/* @__PURE__ */ new Date(), void n3.focus();
var i3 = new Event("paste");
i3.clipboardData = e4.clipboardData, r2.dispatchEvent(i3);
}
}), gt(t4.lineSpace, "selectstart", function(e4) {
$n(t4, e4) || Ct(e4);
}), gt(r2, "compositionstart", function() {
var t5 = o3.getCursor("from");
n3.composing && n3.composing.range.clear(), n3.composing = { start: t5, range: o3.markText(t5, o3.getCursor("to"), { className: "CodeMirror-composing" }) };
}), gt(r2, "compositionend", function() {
n3.composing && (n3.poll(), n3.composing.range.clear(), n3.composing = null);
});
}, sl.prototype.createField = function(t4) {
this.wrapper = Ya(), this.textarea = this.wrapper.firstChild;
}, sl.prototype.screenReaderLabelChanged = function(t4) {
t4 ? this.textarea.setAttribute("aria-label", t4) : this.textarea.removeAttribute("aria-label");
}, sl.prototype.prepareSelection = function() {
var t4 = this.cm, e3 = t4.display, n3 = t4.doc, o3 = qo(t4);
if (t4.options.moveInputWithCursor) {
var r2 = wo(t4, n3.sel.primary().head, "div"), i2 = e3.wrapper.getBoundingClientRect(), s2 = e3.lineDiv.getBoundingClientRect();
o3.teTop = Math.max(0, Math.min(e3.wrapper.clientHeight - 10, r2.top + s2.top - i2.top)), o3.teLeft = Math.max(0, Math.min(e3.wrapper.clientWidth - 10, r2.left + s2.left - i2.left));
}
return o3;
}, sl.prototype.showSelection = function(t4) {
var e3 = this.cm.display;
E(e3.cursorDiv, t4.cursors), E(e3.selectionDiv, t4.selection), null != t4.teTop && (this.wrapper.style.top = t4.teTop + "px", this.wrapper.style.left = t4.teLeft + "px");
}, sl.prototype.reset = function(t4) {
if (!this.contextMenuPending && !this.composing) {
var e3 = this.cm;
if (e3.somethingSelected()) {
this.prevInput = "";
var n3 = e3.getSelection();
this.textarea.value = n3, e3.state.focused && I(this.textarea), s && a >= 9 && (this.hasSelection = n3);
} else
t4 || (this.prevInput = this.textarea.value = "", s && a >= 9 && (this.hasSelection = null));
}
}, sl.prototype.getField = function() {
return this.textarea;
}, sl.prototype.supportsTouch = function() {
return false;
}, sl.prototype.focus = function() {
if ("nocursor" != this.cm.options.readOnly && (!m || L() != this.textarea))
try {
this.textarea.focus();
} catch (t4) {
}
}, sl.prototype.blur = function() {
this.textarea.blur();
}, sl.prototype.resetPosition = function() {
this.wrapper.style.top = this.wrapper.style.left = 0;
}, sl.prototype.receivedFocus = function() {
this.slowPoll();
}, sl.prototype.slowPoll = function() {
var t4 = this;
this.pollingFast || this.polling.set(this.cm.options.pollInterval, function() {
t4.poll(), t4.cm.state.focused && t4.slowPoll();
});
}, sl.prototype.fastPoll = function() {
var t4 = false, e3 = this;
function n3() {
e3.poll() || t4 ? (e3.pollingFast = false, e3.slowPoll()) : (t4 = true, e3.polling.set(60, n3));
}
e3.pollingFast = true, e3.polling.set(20, n3);
}, sl.prototype.poll = function() {
var t4 = this, e3 = this.cm, n3 = this.textarea, o3 = this.prevInput;
if (this.contextMenuPending || !e3.state.focused || It(n3) && !o3 && !this.composing || e3.isReadOnly() || e3.options.disableInput || e3.state.keySeq)
return false;
var r2 = n3.value;
if (r2 == o3 && !e3.somethingSelected())
return false;
if (s && a >= 9 && this.hasSelection === r2 || b && /[\uf700-\uf7ff]/.test(r2))
return e3.display.input.reset(), false;
if (e3.doc.sel == e3.display.selForContextMenu) {
var i2 = r2.charCodeAt(0);
if (8203 != i2 || o3 || (o3 = ""), 8666 == i2)
return this.reset(), this.cm.execCommand("undo");
}
for (var l2 = 0, c2 = Math.min(o3.length, r2.length); l2 < c2 && o3.charCodeAt(l2) == r2.charCodeAt(l2); )
++l2;
return Lr(e3, function() {
Wa(e3, r2.slice(l2), o3.length - l2, null, t4.composing ? "*compose" : null), r2.length > 1e3 || r2.indexOf("\n") > -1 ? n3.value = t4.prevInput = "" : t4.prevInput = r2, t4.composing && (t4.composing.range.clear(), t4.composing.range = e3.markText(t4.composing.start, e3.getCursor("to"), { className: "CodeMirror-composing" }));
}), true;
}, sl.prototype.ensurePolled = function() {
this.pollingFast && this.poll() && (this.pollingFast = false);
}, sl.prototype.onKeyPress = function() {
s && a >= 9 && (this.hasSelection = null), this.fastPoll();
}, sl.prototype.onContextMenu = function(t4) {
var e3 = this, n3 = e3.cm, o3 = n3.display, r2 = e3.textarea;
e3.contextMenuPending && e3.contextMenuPending();
var i2 = Fo(n3, t4), c2 = o3.scroller.scrollTop;
if (i2 && !d) {
n3.options.resetSelectionOnContextMenu && -1 == n3.doc.sel.contains(i2) && Dr(n3, Ui)(n3.doc, ci(i2), W);
var u2, p2 = r2.style.cssText, f2 = e3.wrapper.style.cssText, h2 = e3.wrapper.offsetParent.getBoundingClientRect();
if (e3.wrapper.style.cssText = "position: static", r2.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (t4.clientY - h2.top - 5) + "px; left: " + (t4.clientX - h2.left - 5) + "px;\n z-index: 1000; background: " + (s ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);", l && (u2 = window.scrollY), o3.input.focus(), l && window.scrollTo(null, u2), o3.input.reset(), n3.somethingSelected() || (r2.value = e3.prevInput = " "), e3.contextMenuPending = y2, o3.selForContextMenu = n3.doc.sel, clearTimeout(o3.detectingSelectAll), s && a >= 9 && v2(), S) {
Tt(t4);
var g2 = function() {
yt(window, "mouseup", g2), setTimeout(y2, 20);
};
gt(window, "mouseup", g2);
} else
setTimeout(y2, 50);
}
function v2() {
if (null != r2.selectionStart) {
var t5 = n3.somethingSelected(), i3 = "" + (t5 ? r2.value : "");
r2.value = "⇚", r2.value = i3, e3.prevInput = t5 ? "" : "", r2.selectionStart = 1, r2.selectionEnd = i3.length, o3.selForContextMenu = n3.doc.sel;
}
}
function y2() {
if (e3.contextMenuPending == y2 && (e3.contextMenuPending = false, e3.wrapper.style.cssText = f2, r2.style.cssText = p2, s && a < 9 && o3.scrollbars.setScrollTop(o3.scroller.scrollTop = c2), null != r2.selectionStart)) {
(!s || s && a < 9) && v2();
var t5 = 0, i3 = function() {
o3.selForContextMenu == n3.doc.sel && 0 == r2.selectionStart && r2.selectionEnd > 0 && "" == e3.prevInput ? Dr(n3, Ji)(n3) : t5++ < 10 ? o3.detectingSelectAll = setTimeout(i3, 500) : (o3.selForContextMenu = null, o3.input.reset());
};
o3.detectingSelectAll = setTimeout(i3, 200);
}
}
}, sl.prototype.readOnlyChanged = function(t4) {
t4 || this.reset(), this.textarea.disabled = "nocursor" == t4, this.textarea.readOnly = !!t4;
}, sl.prototype.setUneditable = function() {
}, sl.prototype.needsContentAttribute = false, Na(Va), Xa(Va);
var cl = "iter insert remove copy getEditor constructor".split(" ");
for (var ul in Ss.prototype)
Ss.prototype.hasOwnProperty(ul) && z(cl, ul) < 0 && (Va.prototype[ul] = function(t4) {
return function() {
return t4.apply(this.doc, arguments);
};
}(Ss.prototype[ul]));
return xt(Ss), Va.inputStyles = { textarea: sl, contenteditable: Qa }, Va.defineMode = function(t4) {
Va.defaults.mode || "null" == t4 || (Va.defaults.mode = t4), Bt.apply(this, arguments);
}, Va.defineMIME = Ut, Va.defineMode("null", function() {
return { token: function(t4) {
return t4.skipToEnd();
} };
}), Va.defineMIME("text/plain", "null"), Va.defineExtension = function(t4, e3) {
Va.prototype[t4] = e3;
}, Va.defineDocExtension = function(t4, e3) {
Ss.prototype[t4] = e3;
}, Va.fromTextArea = al, ll(Va), Va.version = "5.65.6", Va;
}();
}, 629: (t2, e2, n2) => {
(function(t3) {
function e3(t4) {
for (var e4 = {}, n4 = 0; n4 < t4.length; ++n4)
e4[t4[n4].toLowerCase()] = true;
return e4;
}
t3.defineMode("css", function(e4, n4) {
var o3 = n4.inline;
n4.propertyKeywords || (n4 = t3.resolveMode("text/css"));
var r2, i2, s2 = e4.indentUnit, a2 = n4.tokenHooks, l2 = n4.documentTypes || {}, c2 = n4.mediaTypes || {}, u2 = n4.mediaFeatures || {}, p2 = n4.mediaValueKeywords || {}, d2 = n4.propertyKeywords || {}, f2 = n4.nonStandardPropertyKeywords || {}, h2 = n4.fontProperties || {}, g2 = n4.counterDescriptors || {}, v2 = n4.colorKeywords || {}, y2 = n4.valueKeywords || {}, m2 = n4.allowNested, b2 = n4.lineComment, _2 = true === n4.supportsAtComponent, w2 = false !== e4.highlightNonStandardPropertyKeywords;
function x(t4, e5) {
return r2 = e5, t4;
}
function C(t4, e5) {
var n5 = t4.next();
if (a2[n5]) {
var o4 = a2[n5](t4, e5);
if (false !== o4)
return o4;
}
return "@" == n5 ? (t4.eatWhile(/[\w\\\-]/), x("def", t4.current())) : "=" == n5 || ("~" == n5 || "|" == n5) && t4.eat("=") ? x(null, "compare") : '"' == n5 || "'" == n5 ? (e5.tokenize = S(n5), e5.tokenize(t4, e5)) : "#" == n5 ? (t4.eatWhile(/[\w\\\-]/), x("atom", "hash")) : "!" == n5 ? (t4.match(/^\s*\w*/), x("keyword", "important")) : /\d/.test(n5) || "." == n5 && t4.eat(/\d/) ? (t4.eatWhile(/[\w.%]/), x("number", "unit")) : "-" !== n5 ? /[,+>*\/]/.test(n5) ? x(null, "select-op") : "." == n5 && t4.match(/^-?[_a-z][_a-z0-9-]*/i) ? x("qualifier", "qualifier") : /[:;{}\[\]\(\)]/.test(n5) ? x(null, n5) : t4.match(/^[\w-.]+(?=\()/) ? (/^(url(-prefix)?|domain|regexp)$/i.test(t4.current()) && (e5.tokenize = O), x("variable callee", "variable")) : /[\w\\\-]/.test(n5) ? (t4.eatWhile(/[\w\\\-]/), x("property", "word")) : x(null, null) : /[\d.]/.test(t4.peek()) ? (t4.eatWhile(/[\w.%]/), x("number", "unit")) : t4.match(/^-[\w\\\-]*/) ? (t4.eatWhile(/[\w\\\-]/), t4.match(/^\s*:/, false) ? x("variable-2", "variable-definition") : x("variable-2", "variable")) : t4.match(/^\w+-/) ? x("meta", "meta") : void 0;
}
function S(t4) {
return function(e5, n5) {
for (var o4, r3 = false; null != (o4 = e5.next()); ) {
if (o4 == t4 && !r3) {
")" == t4 && e5.backUp(1);
break;
}
r3 = !r3 && "\\" == o4;
}
return (o4 == t4 || !r3 && ")" != t4) && (n5.tokenize = null), x("string", "string");
};
}
function O(t4, e5) {
return t4.next(), t4.match(/^\s*[\"\')]/, false) ? e5.tokenize = null : e5.tokenize = S(")"), x(null, "(");
}
function T(t4, e5, n5) {
this.type = t4, this.indent = e5, this.prev = n5;
}
function k(t4, e5, n5, o4) {
return t4.context = new T(n5, e5.indentation() + (false === o4 ? 0 : s2), t4.context), n5;
}
function P(t4) {
return t4.context.prev && (t4.context = t4.context.prev), t4.context.type;
}
function E(t4, e5, n5) {
return M[n5.context.type](t4, e5, n5);
}
function A(t4, e5, n5, o4) {
for (var r3 = o4 || 1; r3 > 0; r3--)
n5.context = n5.context.prev;
return E(t4, e5, n5);
}
function j(t4) {
var e5 = t4.current().toLowerCase();
i2 = y2.hasOwnProperty(e5) ? "atom" : v2.hasOwnProperty(e5) ? "keyword" : "variable";
}
var M = { top: function(t4, e5, n5) {
if ("{" == t4)
return k(n5, e5, "block");
if ("}" == t4 && n5.context.prev)
return P(n5);
if (_2 && /@component/i.test(t4))
return k(n5, e5, "atComponentBlock");
if (/^@(-moz-)?document$/i.test(t4))
return k(n5, e5, "documentTypes");
if (/^@(media|supports|(-moz-)?document|import)$/i.test(t4))
return k(n5, e5, "atBlock");
if (/^@(font-face|counter-style)/i.test(t4))
return n5.stateArg = t4, "restricted_atBlock_before";
if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(t4))
return "keyframes";
if (t4 && "@" == t4.charAt(0))
return k(n5, e5, "at");
if ("hash" == t4)
i2 = "builtin";
else if ("word" == t4)
i2 = "tag";
else {
if ("variable-definition" == t4)
return "maybeprop";
if ("interpolation" == t4)
return k(n5, e5, "interpolation");
if (":" == t4)
return "pseudo";
if (m2 && "(" == t4)
return k(n5, e5, "parens");
}
return n5.context.type;
}, block: function(t4, e5, n5) {
if ("word" == t4) {
var o4 = e5.current().toLowerCase();
return d2.hasOwnProperty(o4) ? (i2 = "property", "maybeprop") : f2.hasOwnProperty(o4) ? (i2 = w2 ? "string-2" : "property", "maybeprop") : m2 ? (i2 = e5.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag", "block") : (i2 += " error", "maybeprop");
}
return "meta" == t4 ? "block" : m2 || "hash" != t4 && "qualifier" != t4 ? M.top(t4, e5, n5) : (i2 = "error", "block");
}, maybeprop: function(t4, e5, n5) {
return ":" == t4 ? k(n5, e5, "prop") : E(t4, e5, n5);
}, prop: function(t4, e5, n5) {
if (";" == t4)
return P(n5);
if ("{" == t4 && m2)
return k(n5, e5, "propBlock");
if ("}" == t4 || "{" == t4)
return A(t4, e5, n5);
if ("(" == t4)
return k(n5, e5, "parens");
if ("hash" != t4 || /^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e5.current())) {
if ("word" == t4)
j(e5);
else if ("interpolation" == t4)
return k(n5, e5, "interpolation");
} else
i2 += " error";
return "prop";
}, propBlock: function(t4, e5, n5) {
return "}" == t4 ? P(n5) : "word" == t4 ? (i2 = "property", "maybeprop") : n5.context.type;
}, parens: function(t4, e5, n5) {
return "{" == t4 || "}" == t4 ? A(t4, e5, n5) : ")" == t4 ? P(n5) : "(" == t4 ? k(n5, e5, "parens") : "interpolation" == t4 ? k(n5, e5, "interpolation") : ("word" == t4 && j(e5), "parens");
}, pseudo: function(t4, e5, n5) {
return "meta" == t4 ? "pseudo" : "word" == t4 ? (i2 = "variable-3", n5.context.type) : E(t4, e5, n5);
}, documentTypes: function(t4, e5, n5) {
return "word" == t4 && l2.hasOwnProperty(e5.current()) ? (i2 = "tag", n5.context.type) : M.atBlock(t4, e5, n5);
}, atBlock: function(t4, e5, n5) {
if ("(" == t4)
return k(n5, e5, "atBlock_parens");
if ("}" == t4 || ";" == t4)
return A(t4, e5, n5);
if ("{" == t4)
return P(n5) && k(n5, e5, m2 ? "block" : "top");
if ("interpolation" == t4)
return k(n5, e5, "interpolation");
if ("word" == t4) {
var o4 = e5.current().toLowerCase();
i2 = "only" == o4 || "not" == o4 || "and" == o4 || "or" == o4 ? "keyword" : c2.hasOwnProperty(o4) ? "attribute" : u2.hasOwnProperty(o4) ? "property" : p2.hasOwnProperty(o4) ? "keyword" : d2.hasOwnProperty(o4) ? "property" : f2.hasOwnProperty(o4) ? w2 ? "string-2" : "property" : y2.hasOwnProperty(o4) ? "atom" : v2.hasOwnProperty(o4) ? "keyword" : "error";
}
return n5.context.type;
}, atComponentBlock: function(t4, e5, n5) {
return "}" == t4 ? A(t4, e5, n5) : "{" == t4 ? P(n5) && k(n5, e5, m2 ? "block" : "top", false) : ("word" == t4 && (i2 = "error"), n5.context.type);
}, atBlock_parens: function(t4, e5, n5) {
return ")" == t4 ? P(n5) : "{" == t4 || "}" == t4 ? A(t4, e5, n5, 2) : M.atBlock(t4, e5, n5);
}, restricted_atBlock_before: function(t4, e5, n5) {
return "{" == t4 ? k(n5, e5, "restricted_atBlock") : "word" == t4 && "@counter-style" == n5.stateArg ? (i2 = "variable", "restricted_atBlock_before") : E(t4, e5, n5);
}, restricted_atBlock: function(t4, e5, n5) {
return "}" == t4 ? (n5.stateArg = null, P(n5)) : "word" == t4 ? (i2 = "@font-face" == n5.stateArg && !h2.hasOwnProperty(e5.current().toLowerCase()) || "@counter-style" == n5.stateArg && !g2.hasOwnProperty(e5.current().toLowerCase()) ? "error" : "property", "maybeprop") : "restricted_atBlock";
}, keyframes: function(t4, e5, n5) {
return "word" == t4 ? (i2 = "variable", "keyframes") : "{" == t4 ? k(n5, e5, "top") : E(t4, e5, n5);
}, at: function(t4, e5, n5) {
return ";" == t4 ? P(n5) : "{" == t4 || "}" == t4 ? A(t4, e5, n5) : ("word" == t4 ? i2 = "tag" : "hash" == t4 && (i2 = "builtin"), "at");
}, interpolation: function(t4, e5, n5) {
return "}" == t4 ? P(n5) : "{" == t4 || ";" == t4 ? A(t4, e5, n5) : ("word" == t4 ? i2 = "variable" : "variable" != t4 && "(" != t4 && ")" != t4 && (i2 = "error"), "interpolation");
} };
return { startState: function(t4) {
return { tokenize: null, state: o3 ? "block" : "top", stateArg: null, context: new T(o3 ? "block" : "top", t4 || 0, null) };
}, token: function(t4, e5) {
if (!e5.tokenize && t4.eatSpace())
return null;
var n5 = (e5.tokenize || C)(t4, e5);
return n5 && "object" == typeof n5 && (r2 = n5[1], n5 = n5[0]), i2 = n5, "comment" != r2 && (e5.state = M[e5.state](r2, t4, e5)), i2;
}, indent: function(t4, e5) {
var n5 = t4.context, o4 = e5 && e5.charAt(0), r3 = n5.indent;
return "prop" != n5.type || "}" != o4 && ")" != o4 || (n5 = n5.prev), n5.prev && ("}" != o4 || "block" != n5.type && "top" != n5.type && "interpolation" != n5.type && "restricted_atBlock" != n5.type ? (")" != o4 || "parens" != n5.type && "atBlock_parens" != n5.type) && ("{" != o4 || "at" != n5.type && "atBlock" != n5.type) || (r3 = Math.max(0, n5.indent - s2)) : r3 = (n5 = n5.prev).indent), r3;
}, electricChars: "}", blockCommentStart: "/*", blockCommentEnd: "*/", blockCommentContinue: " * ", lineComment: b2, fold: "brace" };
});
var n3 = ["domain", "regexp", "url", "url-prefix"], o2 = e3(n3), r = ["all", "aural", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "embossed"], i = e3(r), s = ["width", "min-width", "max-width", "height", "min-height", "max-height", "device-width", "min-device-width", "max-device-width", "device-height", "min-device-height", "max-device-height", "aspect-ratio", "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio", "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color", "max-color", "color-index", "min-color-index", "max-color-index", "monochrome", "min-monochrome", "max-monochrome", "resolution", "min-resolution", "max-resolution", "scan", "grid", "orientation", "device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio", "pointer", "any-pointer", "hover", "any-hover", "prefers-color-scheme", "dynamic-range", "video-dynamic-range"], a = e3(s), l = ["landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover", "interlace", "progressive", "dark", "light", "standard", "high"], c = e3(l), u = ["align-content", "align-items", "align-self", "alignment-adjust", "alignment-baseline", "all", "anchor-point", "animation", "animation-delay", "animation-direction", "animation-duration", "animation-fill-mode", "animation-iteration-count", "animation-name", "animation-play-state", "animation-timing-function", "appearance", "azimuth", "backdrop-filter", "backface-visibility", "background", "background-attachment", "background-blend-mode", "background-clip", "background-color", "background-image", "background-origin", "background-position", "background-position-x", "background-position-y", "background-repeat", "background-size", "baseline-shift", "binding", "bleed", "block-size", "bookmark-label", "bookmark-level", "bookmark-state", "bookmark-target", "border", "border-bottom", "border-bottom-color", "border-bottom-left-radius", "border-bottom-right-radius", "border-bottom-style", "border-bottom-width", "border-collapse", "border-color", "border-image", "border-image-outset", "border-image-repeat", "border-image-slice", "border-image-source", "border-image-width", "border-left", "border-left-color", "border-left-style", "border-left-width", "border-radius", "border-right", "border-right-color", "border-right-style", "border-right-width", "border-spacing", "border-style", "border-top", "border-top-color", "border-top-left-radius", "border-top-right-radius", "border-top-style", "border-top-width", "border-width", "bottom", "box-decoration-break", "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", "caption-side", "caret-color", "clear", "clip", "color", "color-profile", "column-count", "column-fill", "column-gap", "column-rule", "column-rule-color", "column-rule-style", "column-rule-width", "column-span", "column-width", "columns", "contain", "content", "counter-increment", "counter-reset", "crop", "cue", "cue-after", "cue-before", "cursor", "direction", "display", "dominant-baseline", "drop-initial-after-adjust", "drop-initial-after-align", "drop-initial-before-adjust", "drop-initial-before-align", "drop-initial-size", "drop-initial-value", "elevation", "empty-cells", "fit", "fit-content", "fit-position", "flex", "flex-basis", "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", "float", "float-offset", "flow-from", "flow-into", "font", "font-family", "font-feature-settings", "font-kerning", "font-language-override", "font-optical-sizing", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-synthesis", "font-variant", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric", "font-variant-position", "font-variation-settings", "font-weight", "gap", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow", "grid-auto-rows", "grid-column", "grid-column-end", "grid-column-gap", "grid-column-start", "grid-gap", "grid-row", "grid-row-end", "grid-row-gap", "grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns", "grid-template-rows", "hanging-punctuation", "height", "hyphens", "icon", "image-orientation", "image-rendering", "image-resolution", "inline-box-align", "inset", "inset-block", "inset-block-end", "inset-block-start", "inset-inline", "inset-inline-end", "inset-inline-start", "isolation", "justify-content", "justify-items", "justify-self", "left", "letter-spacing", "line-break", "line-height", "line-height-step", "line-stacking", "line-stacking-ruby", "line-stacking-shift", "line-stacking-strategy", "list-style", "list-style-image", "list-style-position", "list-style-type", "margin", "margin-bottom", "margin-left", "margin-right", "margin-top", "marks", "marquee-direction", "marquee-loop", "marquee-play-count", "marquee-speed", "marquee-style", "mask-clip", "mask-composite", "mask-image", "mask-mode", "mask-origin", "mask-position", "mask-repeat", "mask-size", "mask-type", "max-block-size", "max-height", "max-inline-size", "max-width", "min-block-size", "min-height", "min-inline-size", "min-width", "mix-blend-mode", "move-to", "nav-down", "nav-index", "nav-left", "nav-right", "nav-up", "object-fit", "object-position", "offset", "offset-anchor", "offset-distance", "offset-path", "offset-position", "offset-rotate", "opacity", "order", "orphans", "outline", "outline-color", "outline-offset", "outline-style", "outline-width", "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y", "padding", "padding-bottom", "padding-left", "padding-right", "padding-top", "page", "page-break-after", "page-break-before", "page-break-inside", "page-policy", "pause", "pause-after", "pause-before", "perspective", "perspective-origin", "pitch", "pitch-range", "place-content", "place-items", "place-self", "play-during", "position", "presentation-level", "punctuation-trim", "quotes", "region-break-after", "region-break-before", "region-break-inside", "region-fragment", "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness", "right", "rotate", "rotation", "rotation-point", "row-gap", "ruby-align", "ruby-overhang", "ruby-position", "ruby-span", "scale", "scroll-behavior", "scroll-margin", "scroll-margin-block", "scroll-margin-block-end", "scroll-margin-block-start", "scroll-margin-bottom", "scroll-margin-inline", "scroll-margin-inline-end", "scroll-margin-inline-start", "scroll-margin-left", "scroll-margin-right", "scroll-margin-top", "scroll-padding", "scroll-padding-block", "scroll-padding-block-end", "scroll-padding-block-start", "scroll-padding-bottom", "scroll-padding-inline", "scroll-padding-inline-end", "scroll-padding-inline-start", "scroll-padding-left", "scroll-padding-right", "scroll-padding-top", "scroll-snap-align", "scroll-snap-type", "shape-image-threshold", "shape-inside", "shape-margin", "shape-outside", "size", "speak", "speak-as", "speak-header", "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set", "tab-size", "table-layout", "target", "target-name", "target-new", "target-position", "text-align", "text-align-last", "text-combine-upright", "text-decoration", "text-decoration-color", "text-decoration-line", "text-decoration-skip", "text-decoration-skip-ink", "text-decoration-style", "text-emphasis", "text-emphasis-color", "text-emphasis-position", "text-emphasis-style", "text-height", "text-indent", "text-justify", "text-orientation", "text-outline", "text-overflow", "text-rendering", "text-shadow", "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position", "text-wrap", "top", "touch-action", "transform", "transform-origin", "transform-style", "transition", "transition-delay", "transition-duration", "transition-property", "transition-timing-function", "translate", "unicode-bidi", "user-select", "vertical-align", "visibility", "voice-balance", "voice-duration", "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress", "voice-volume", "volume", "white-space", "widows", "width", "will-change", "word-break", "word-spacing", "word-wrap", "writing-mode", "z-index", "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color", "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events", "color-interpolation", "color-interpolation-filters", "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering", "marker", "marker-end", "marker-mid", "marker-start", "paint-order", "shape-rendering", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering", "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal", "glyph-orientation-vertical", "text-anchor", "writing-mode"], p = e3(u), d = ["accent-color", "aspect-ratio", "border-block", "border-block-color", "border-block-end", "border-block-end-color", "border-block-end-style", "border-block-end-width", "border-block-start", "border-block-start-color", "border-block-start-style", "border-block-start-width", "border-block-style", "border-block-width", "border-inline", "border-inline-color", "border-inline-end", "border-inline-end-color", "border-inline-end-style", "border-inline-end-width", "border-inline-start", "border-inline-start-color", "border-inline-start-style", "border-inline-start-width", "border-inline-style", "border-inline-width", "content-visibility", "margin-block", "margin-block-end", "margin-block-start", "margin-inline", "margin-inline-end", "margin-inline-start", "overflow-anchor", "overscroll-behavior", "padding-block", "padding-block-end", "padding-block-start", "padding-inline", "padding-inline-end", "padding-inline-start", "scroll-snap-stop", "scrollbar-3d-light-color", "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color", "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color", "scrollbar-track-color", "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button", "searchfield-results-decoration", "shape-inside", "zoom"], f = e3(d), h = e3(["font-display", "font-family", "src", "unicode-range", "font-variant", "font-feature-settings", "font-stretch", "font-weight", "font-style"]), g = e3(["additive-symbols", "fallback", "negative", "pad", "prefix", "range", "speak-as", "suffix", "symbols", "system"]), v = ["aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen"], y = e3(v), m = ["above", "absolute", "activeborder", "additive", "activecaption", "afar", "after-white-space", "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate", "always", "amharic", "amharic-abegede", "antialiased", "appworkspace", "arabic-indic", "armenian", "asterisks", "attr", "auto", "auto-flow", "avoid", "avoid-column", "avoid-page", "avoid-region", "axis-pan", "background", "backwards", "baseline", "below", "bidi-override", "binary", "bengali", "blink", "block", "block-axis", "blur", "bold", "bolder", "border", "border-box", "both", "bottom", "break", "break-all", "break-word", "brightness", "bullets", "button", "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian", "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch", "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", "col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse", "compact", "condensed", "conic-gradient", "contain", "content", "contents", "content-box", "context-menu", "continuous", "contrast", "copy", "counter", "counters", "cover", "crop", "cross", "crosshair", "cubic-bezier", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal", "decimal-leading-zero", "default", "default-button", "dense", "destination-atop", "destination-in", "destination-out", "destination-over", "devanagari", "difference", "disc", "discard", "disclosure-closed", "disclosure-open", "document", "dot-dash", "dot-dot-dash", "dotted", "double", "down", "drop-shadow", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er", "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et", "ethiopic-halehame-gez", "ethiopic-halehame-om-et", "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig", "ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed", "extra-expanded", "fantasy", "fast", "fill", "fill-box", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes", "forwards", "from", "geometricPrecision", "georgian", "grayscale", "graytext", "grid", "groove", "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew", "help", "hidden", "hide", "higher", "highlight", "highlighttext", "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "hue-rotate", "icon", "ignore", "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", "inline-block", "inline-flex", "inline-grid", "inline-table", "inset", "inside", "intrinsic", "invert", "italic", "japanese-formal", "japanese-informal", "justify", "kannada", "katakana", "katakana-iroha", "keep-all", "khmer", "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal", "landscape", "lao", "large", "larger", "left", "level", "lighter", "lighten", "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem", "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", "lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "manipulation", "match", "matrix", "matrix3d", "media-play-button", "media-slider", "media-sliderthumb", "media-volume-slider", "media-volume-sliderthumb", "medium", "menu", "menulist", "menulist-button", "menutext", "message-box", "middle", "min-intrinsic", "mix", "mongolian", "monospace", "move", "multiple", "multiple_mask_images", "multiply", "myanmar", "n-resize", "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "opacity", "open-quote", "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset", "outside", "outside-shape", "overlay", "overline", "padding", "padding-box", "painted", "page", "paused", "persian", "perspective", "pinch-zoom", "plus-darker", "plus-lighter", "pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button", "radial-gradient", "radio", "read-only", "read-write", "read-write-plaintext-only", "rectangle", "region", "relative", "repeat", "repeating-linear-gradient", "repeating-radial-gradient", "repeating-conic-gradient", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY", "rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running", "s-resize", "sans-serif", "saturate", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen", "scroll", "scrollbar", "scroll-position", "se-resize", "searchfield", "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end", "semi-condensed", "semi-expanded", "separate", "sepia", "serif", "show", "sidama", "simp-chinese-formal", "simp-chinese-informal", "single", "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal", "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali", "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "space-evenly", "spell-out", "square", "square-button", "start", "static", "status-bar", "stretch", "stroke", "stroke-box", "sub", "subpixel-antialiased", "svg_masks", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row", "table-row-group", "tamil", "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight", "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top", "trad-chinese-formal", "trad-chinese-informal", "transform", "translate", "translate3d", "translateX", "translateY", "translateZ", "transparent", "ultra-condensed", "ultra-expanded", "underline", "unidirectional-pan", "unset", "up", "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal", "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", "var", "vertical", "vertical-text", "view-box", "visible", "visibleFill", "visiblePainted", "visibleStroke", "visual", "w-resize", "wait", "wave", "wider", "window", "windowframe", "windowtext", "words", "wrap", "wrap-reverse", "x-large", "x-small", "xor", "xx-large", "xx-small"], b = e3(m), _ = n3.concat(r).concat(s).concat(l).concat(u).concat(d).concat(v).concat(m);
function w(t4, e4) {
for (var n4, o3 = false; null != (n4 = t4.next()); ) {
if (o3 && "/" == n4) {
e4.tokenize = null;
break;
}
o3 = "*" == n4;
}
return ["comment", "comment"];
}
t3.registerHelper("hintWords", "css", _), t3.defineMIME("text/css", { documentTypes: o2, mediaTypes: i, mediaFeatures: a, mediaValueKeywords: c, propertyKeywords: p, nonStandardPropertyKeywords: f, fontProperties: h, counterDescriptors: g, colorKeywords: y, valueKeywords: b, tokenHooks: { "/": function(t4, e4) {
return !!t4.eat("*") && (e4.tokenize = w, w(t4, e4));
} }, name: "css" }), t3.defineMIME("text/x-scss", { mediaTypes: i, mediaFeatures: a, mediaValueKeywords: c, propertyKeywords: p, nonStandardPropertyKeywords: f, colorKeywords: y, valueKeywords: b, fontProperties: h, allowNested: true, lineComment: "//", tokenHooks: { "/": function(t4, e4) {
return t4.eat("/") ? (t4.skipToEnd(), ["comment", "comment"]) : t4.eat("*") ? (e4.tokenize = w, w(t4, e4)) : ["operator", "operator"];
}, ":": function(t4) {
return !!t4.match(/^\s*\{/, false) && [null, null];
}, $: function(t4) {
return t4.match(/^[\w-]+/), t4.match(/^\s*:/, false) ? ["variable-2", "variable-definition"] : ["variable-2", "variable"];
}, "#": function(t4) {
return !!t4.eat("{") && [null, "interpolation"];
} }, name: "css", helperType: "scss" }), t3.defineMIME("text/x-less", { mediaTypes: i, mediaFeatures: a, mediaValueKeywords: c, propertyKeywords: p, nonStandardPropertyKeywords: f, colorKeywords: y, valueKeywords: b, fontProperties: h, allowNested: true, lineComment: "//", tokenHooks: { "/": function(t4, e4) {
return t4.eat("/") ? (t4.skipToEnd(), ["comment", "comment"]) : t4.eat("*") ? (e4.tokenize = w, w(t4, e4)) : ["operator", "operator"];
}, "@": function(t4) {
return t4.eat("{") ? [null, "interpolation"] : !t4.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i, false) && (t4.eatWhile(/[\w\\\-]/), t4.match(/^\s*:/, false) ? ["variable-2", "variable-definition"] : ["variable-2", "variable"]);
}, "&": function() {
return ["atom", "atom"];
} }, name: "css", helperType: "less" }), t3.defineMIME("text/x-gss", { documentTypes: o2, mediaTypes: i, mediaFeatures: a, propertyKeywords: p, nonStandardPropertyKeywords: f, fontProperties: h, counterDescriptors: g, colorKeywords: y, valueKeywords: b, supportsAtComponent: true, tokenHooks: { "/": function(t4, e4) {
return !!t4.eat("*") && (e4.tokenize = w, w(t4, e4));
} }, name: "css", helperType: "gss" });
})(n2(631));
}, 531: (t2, e2, n2) => {
(function(t3) {
var e3 = { script: [["lang", /(javascript|babel)/i, "javascript"], ["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i, "javascript"], ["type", /./, "text/plain"], [null, null, "javascript"]], style: [["lang", /^css$/i, "css"], ["type", /^(text\/)?(x-)?(stylesheet|css)$/i, "css"], ["type", /./, "text/plain"], [null, null, "css"]] };
function n3(t4, e4, n4) {
var o3 = t4.current(), r2 = o3.search(e4);
return r2 > -1 ? t4.backUp(o3.length - r2) : o3.match(/<\/?$/) && (t4.backUp(o3.length), t4.match(e4, false) || t4.match(o3)), n4;
}
var o2 = {};
function r(t4) {
var e4 = o2[t4];
return e4 || (o2[t4] = new RegExp("\\s+" + t4 + `\\s*=\\s*('|")?([^'"]+)('|")?\\s*`));
}
function i(t4, e4) {
var n4 = t4.match(r(e4));
return n4 ? /^\s*(.*?)\s*$/.exec(n4[2])[1] : "";
}
function s(t4, e4) {
return new RegExp((e4 ? "^" : "") + "\\s*" + t4 + "\\s*>", "i");
}
function a(t4, e4) {
for (var n4 in t4)
for (var o3 = e4[n4] || (e4[n4] = []), r2 = t4[n4], i2 = r2.length - 1; i2 >= 0; i2--)
o3.unshift(r2[i2]);
}
function l(t4, e4) {
for (var n4 = 0; n4 < t4.length; n4++) {
var o3 = t4[n4];
if (!o3[0] || o3[1].test(i(e4, o3[0])))
return o3[2];
}
}
t3.defineMode("htmlmixed", function(o3, r2) {
var i2 = t3.getMode(o3, { name: "xml", htmlMode: true, multilineTagIndentFactor: r2.multilineTagIndentFactor, multilineTagIndentPastTag: r2.multilineTagIndentPastTag, allowMissingTagName: r2.allowMissingTagName }), c = {}, u = r2 && r2.tags, p = r2 && r2.scriptTypes;
if (a(e3, c), u && a(u, c), p)
for (var d = p.length - 1; d >= 0; d--)
c.script.unshift(["type", p[d].matches, p[d].mode]);
function f(e4, r3) {
var a2, u2 = i2.token(e4, r3.htmlState), p2 = /\btag\b/.test(u2);
if (p2 && !/[<>\s\/]/.test(e4.current()) && (a2 = r3.htmlState.tagName && r3.htmlState.tagName.toLowerCase()) && c.hasOwnProperty(a2))
r3.inTag = a2 + " ";
else if (r3.inTag && p2 && />$/.test(e4.current())) {
var d2 = /^([\S]+) (.*)/.exec(r3.inTag);
r3.inTag = null;
var h = ">" == e4.current() && l(c[d2[1]], d2[2]), g = t3.getMode(o3, h), v = s(d2[1], true), y = s(d2[1], false);
r3.token = function(t4, e5) {
return t4.match(v, false) ? (e5.token = f, e5.localState = e5.localMode = null, null) : n3(t4, y, e5.localMode.token(t4, e5.localState));
}, r3.localMode = g, r3.localState = t3.startState(g, i2.indent(r3.htmlState, "", ""));
} else
r3.inTag && (r3.inTag += e4.current(), e4.eol() && (r3.inTag += " "));
return u2;
}
return { startState: function() {
return { token: f, inTag: null, localMode: null, localState: null, htmlState: t3.startState(i2) };
}, copyState: function(e4) {
var n4;
return e4.localState && (n4 = t3.copyState(e4.localMode, e4.localState)), { token: e4.token, inTag: e4.inTag, localMode: e4.localMode, localState: n4, htmlState: t3.copyState(i2, e4.htmlState) };
}, token: function(t4, e4) {
return e4.token(t4, e4);
}, indent: function(e4, n4, o4) {
return !e4.localMode || /^\s*<\//.test(n4) ? i2.indent(e4.htmlState, n4, o4) : e4.localMode.indent ? e4.localMode.indent(e4.localState, n4, o4) : t3.Pass;
}, innerMode: function(t4) {
return { state: t4.localState || t4.htmlState, mode: t4.localMode || i2 };
} };
}, "xml", "javascript", "css"), t3.defineMIME("text/html", "htmlmixed");
})(n2(631), n2(589), n2(876), n2(629));
}, 876: (t2, e2, n2) => {
(function(t3) {
t3.defineMode("javascript", function(e3, n3) {
var o2, r, i = e3.indentUnit, s = n3.statementIndent, a = n3.jsonld, l = n3.json || a, c = false !== n3.trackScope, u = n3.typescript, p = n3.wordCharacters || /[\w$\xa1-\uffff]/, d = function() {
function t4(t5) {
return { type: t5, style: "keyword" };
}
var e4 = t4("keyword a"), n4 = t4("keyword b"), o3 = t4("keyword c"), r2 = t4("keyword d"), i2 = t4("operator"), s2 = { type: "atom", style: "atom" };
return { if: t4("if"), while: e4, with: e4, else: n4, do: n4, try: n4, finally: n4, return: r2, break: r2, continue: r2, new: t4("new"), delete: o3, void: o3, throw: o3, debugger: t4("debugger"), var: t4("var"), const: t4("var"), let: t4("var"), function: t4("function"), catch: t4("catch"), for: t4("for"), switch: t4("switch"), case: t4("case"), default: t4("default"), in: i2, typeof: i2, instanceof: i2, true: s2, false: s2, null: s2, undefined: s2, NaN: s2, Infinity: s2, this: t4("this"), class: t4("class"), super: t4("atom"), yield: o3, export: t4("export"), import: t4("import"), extends: o3, await: o3 };
}(), f = /[+\-*&%=<>!?|~^@]/, h = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
function g(t4) {
for (var e4, n4 = false, o3 = false; null != (e4 = t4.next()); ) {
if (!n4) {
if ("/" == e4 && !o3)
return;
"[" == e4 ? o3 = true : o3 && "]" == e4 && (o3 = false);
}
n4 = !n4 && "\\" == e4;
}
}
function v(t4, e4, n4) {
return o2 = t4, r = n4, e4;
}
function y(t4, e4) {
var n4 = t4.next();
if ('"' == n4 || "'" == n4)
return e4.tokenize = m(n4), e4.tokenize(t4, e4);
if ("." == n4 && t4.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))
return v("number", "number");
if ("." == n4 && t4.match(".."))
return v("spread", "meta");
if (/[\[\]{}\(\),;\:\.]/.test(n4))
return v(n4);
if ("=" == n4 && t4.eat(">"))
return v("=>", "operator");
if ("0" == n4 && t4.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))
return v("number", "number");
if (/\d/.test(n4))
return t4.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/), v("number", "number");
if ("/" == n4)
return t4.eat("*") ? (e4.tokenize = b, b(t4, e4)) : t4.eat("/") ? (t4.skipToEnd(), v("comment", "comment")) : re(t4, e4, 1) ? (g(t4), t4.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/), v("regexp", "string-2")) : (t4.eat("="), v("operator", "operator", t4.current()));
if ("`" == n4)
return e4.tokenize = _, _(t4, e4);
if ("#" == n4 && "!" == t4.peek())
return t4.skipToEnd(), v("meta", "meta");
if ("#" == n4 && t4.eatWhile(p))
return v("variable", "property");
if ("<" == n4 && t4.match("!--") || "-" == n4 && t4.match("->") && !/\S/.test(t4.string.slice(0, t4.start)))
return t4.skipToEnd(), v("comment", "comment");
if (f.test(n4))
return ">" == n4 && e4.lexical && ">" == e4.lexical.type || (t4.eat("=") ? "!" != n4 && "=" != n4 || t4.eat("=") : /[<>*+\-|&?]/.test(n4) && (t4.eat(n4), ">" == n4 && t4.eat(n4))), "?" == n4 && t4.eat(".") ? v(".") : v("operator", "operator", t4.current());
if (p.test(n4)) {
t4.eatWhile(p);
var o3 = t4.current();
if ("." != e4.lastType) {
if (d.propertyIsEnumerable(o3)) {
var r2 = d[o3];
return v(r2.type, r2.style, o3);
}
if ("async" == o3 && t4.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false))
return v("async", "keyword", o3);
}
return v("variable", "variable", o3);
}
}
function m(t4) {
return function(e4, n4) {
var o3, r2 = false;
if (a && "@" == e4.peek() && e4.match(h))
return n4.tokenize = y, v("jsonld-keyword", "meta");
for (; null != (o3 = e4.next()) && (o3 != t4 || r2); )
r2 = !r2 && "\\" == o3;
return r2 || (n4.tokenize = y), v("string", "string");
};
}
function b(t4, e4) {
for (var n4, o3 = false; n4 = t4.next(); ) {
if ("/" == n4 && o3) {
e4.tokenize = y;
break;
}
o3 = "*" == n4;
}
return v("comment", "comment");
}
function _(t4, e4) {
for (var n4, o3 = false; null != (n4 = t4.next()); ) {
if (!o3 && ("`" == n4 || "$" == n4 && t4.eat("{"))) {
e4.tokenize = y;
break;
}
o3 = !o3 && "\\" == n4;
}
return v("quasi", "string-2", t4.current());
}
var w = "([{}])";
function x(t4, e4) {
e4.fatArrowAt && (e4.fatArrowAt = null);
var n4 = t4.string.indexOf("=>", t4.start);
if (!(n4 < 0)) {
if (u) {
var o3 = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t4.string.slice(t4.start, n4));
o3 && (n4 = o3.index);
}
for (var r2 = 0, i2 = false, s2 = n4 - 1; s2 >= 0; --s2) {
var a2 = t4.string.charAt(s2), l2 = w.indexOf(a2);
if (l2 >= 0 && l2 < 3) {
if (!r2) {
++s2;
break;
}
if (0 == --r2) {
"(" == a2 && (i2 = true);
break;
}
} else if (l2 >= 3 && l2 < 6)
++r2;
else if (p.test(a2))
i2 = true;
else if (/["'\/`]/.test(a2))
for (; ; --s2) {
if (0 == s2)
return;
if (t4.string.charAt(s2 - 1) == a2 && "\\" != t4.string.charAt(s2 - 2)) {
s2--;
break;
}
}
else if (i2 && !r2) {
++s2;
break;
}
}
i2 && !r2 && (e4.fatArrowAt = s2);
}
}
var C = { atom: true, number: true, variable: true, string: true, regexp: true, this: true, import: true, "jsonld-keyword": true };
function S(t4, e4, n4, o3, r2, i2) {
this.indented = t4, this.column = e4, this.type = n4, this.prev = r2, this.info = i2, null != o3 && (this.align = o3);
}
function O(t4, e4) {
if (!c)
return false;
for (var n4 = t4.localVars; n4; n4 = n4.next)
if (n4.name == e4)
return true;
for (var o3 = t4.context; o3; o3 = o3.prev)
for (n4 = o3.vars; n4; n4 = n4.next)
if (n4.name == e4)
return true;
}
function T(t4, e4, n4, o3, r2) {
var i2 = t4.cc;
for (k.state = t4, k.stream = r2, k.marked = null, k.cc = i2, k.style = e4, t4.lexical.hasOwnProperty("align") || (t4.lexical.align = true); 1; )
if ((i2.length ? i2.pop() : l ? $ : U)(n4, o3)) {
for (; i2.length && i2[i2.length - 1].lex; )
i2.pop()();
return k.marked ? k.marked : "variable" == n4 && O(t4, o3) ? "variable-2" : e4;
}
}
var k = { state: null, column: null, marked: null, cc: null };
function P() {
for (var t4 = arguments.length - 1; t4 >= 0; t4--)
k.cc.push(arguments[t4]);
}
function E() {
return P.apply(null, arguments), true;
}
function A(t4, e4) {
for (var n4 = e4; n4; n4 = n4.next)
if (n4.name == t4)
return true;
return false;
}
function j(t4) {
var e4 = k.state;
if (k.marked = "def", c) {
if (e4.context) {
if ("var" == e4.lexical.info && e4.context && e4.context.block) {
var o3 = M(t4, e4.context);
if (null != o3)
return void (e4.context = o3);
} else if (!A(t4, e4.localVars))
return void (e4.localVars = new N(t4, e4.localVars));
}
n3.globalVars && !A(t4, e4.globalVars) && (e4.globalVars = new N(t4, e4.globalVars));
}
}
function M(t4, e4) {
if (e4) {
if (e4.block) {
var n4 = M(t4, e4.prev);
return n4 ? n4 == e4.prev ? e4 : new D(n4, e4.vars, true) : null;
}
return A(t4, e4.vars) ? e4 : new D(e4.prev, new N(t4, e4.vars), false);
}
return null;
}
function L(t4) {
return "public" == t4 || "private" == t4 || "protected" == t4 || "abstract" == t4 || "readonly" == t4;
}
function D(t4, e4, n4) {
this.prev = t4, this.vars = e4, this.block = n4;
}
function N(t4, e4) {
this.name = t4, this.next = e4;
}
var I = new N("this", new N("arguments", null));
function F() {
k.state.context = new D(k.state.context, k.state.localVars, false), k.state.localVars = I;
}
function V() {
k.state.context = new D(k.state.context, k.state.localVars, true), k.state.localVars = null;
}
function R() {
k.state.localVars = k.state.context.vars, k.state.context = k.state.context.prev;
}
function H(t4, e4) {
var n4 = function() {
var n5 = k.state, o3 = n5.indented;
if ("stat" == n5.lexical.type)
o3 = n5.lexical.indented;
else
for (var r2 = n5.lexical; r2 && ")" == r2.type && r2.align; r2 = r2.prev)
o3 = r2.indented;
n5.lexical = new S(o3, k.stream.column(), t4, null, n5.lexical, e4);
};
return n4.lex = true, n4;
}
function z() {
var t4 = k.state;
t4.lexical.prev && (")" == t4.lexical.type && (t4.indented = t4.lexical.indented), t4.lexical = t4.lexical.prev);
}
function B(t4) {
function e4(n4) {
return n4 == t4 ? E() : ";" == t4 || "}" == n4 || ")" == n4 || "]" == n4 ? P() : E(e4);
}
return e4;
}
function U(t4, e4) {
return "var" == t4 ? E(H("vardef", e4), Pt, B(";"), z) : "keyword a" == t4 ? E(H("form"), G, U, z) : "keyword b" == t4 ? E(H("form"), U, z) : "keyword d" == t4 ? k.stream.match(/^\s*$/, false) ? E() : E(H("stat"), Y, B(";"), z) : "debugger" == t4 ? E(B(";")) : "{" == t4 ? E(H("}"), V, dt, z, R) : ";" == t4 ? E() : "if" == t4 ? ("else" == k.state.lexical.info && k.state.cc[k.state.cc.length - 1] == z && k.state.cc.pop()(), E(H("form"), G, U, z, Dt)) : "function" == t4 ? E(Vt) : "for" == t4 ? E(H("form"), V, Nt, U, R, z) : "class" == t4 || u && "interface" == e4 ? (k.marked = "keyword", E(H("form", "class" == t4 ? t4 : e4), Ut, z)) : "variable" == t4 ? u && "declare" == e4 ? (k.marked = "keyword", E(U)) : u && ("module" == e4 || "enum" == e4 || "type" == e4) && k.stream.match(/^\s*\w/, false) ? (k.marked = "keyword", "enum" == e4 ? E(ee) : "type" == e4 ? E(Ht, B("operator"), yt, B(";")) : E(H("form"), Et, B("{"), H("}"), dt, z, z)) : u && "namespace" == e4 ? (k.marked = "keyword", E(H("form"), $, U, z)) : u && "abstract" == e4 ? (k.marked = "keyword", E(U)) : E(H("stat"), it) : "switch" == t4 ? E(H("form"), G, B("{"), H("}", "switch"), V, dt, z, z, R) : "case" == t4 ? E($, B(":")) : "default" == t4 ? E(B(":")) : "catch" == t4 ? E(H("form"), F, W, U, z, R) : "export" == t4 ? E(H("stat"), Gt, z) : "import" == t4 ? E(H("stat"), Yt, z) : "async" == t4 ? E(U) : "@" == e4 ? E($, U) : P(H("stat"), $, B(";"), z);
}
function W(t4) {
if ("(" == t4)
return E(zt, B(")"));
}
function $(t4, e4) {
return K(t4, e4, false);
}
function q(t4, e4) {
return K(t4, e4, true);
}
function G(t4) {
return "(" != t4 ? P() : E(H(")"), Y, B(")"), z);
}
function K(t4, e4, n4) {
if (k.state.fatArrowAt == k.stream.start) {
var o3 = n4 ? et : tt;
if ("(" == t4)
return E(F, H(")"), ut(zt, ")"), z, B("=>"), o3, R);
if ("variable" == t4)
return P(F, Et, B("=>"), o3, R);
}
var r2 = n4 ? J : X;
return C.hasOwnProperty(t4) ? E(r2) : "function" == t4 ? E(Vt, r2) : "class" == t4 || u && "interface" == e4 ? (k.marked = "keyword", E(H("form"), Bt, z)) : "keyword c" == t4 || "async" == t4 ? E(n4 ? q : $) : "(" == t4 ? E(H(")"), Y, B(")"), z, r2) : "operator" == t4 || "spread" == t4 ? E(n4 ? q : $) : "[" == t4 ? E(H("]"), te, z, r2) : "{" == t4 ? pt(at, "}", null, r2) : "quasi" == t4 ? P(Z, r2) : "new" == t4 ? E(nt(n4)) : E();
}
function Y(t4) {
return t4.match(/[;\}\)\],]/) ? P() : P($);
}
function X(t4, e4) {
return "," == t4 ? E(Y) : J(t4, e4, false);
}
function J(t4, e4, n4) {
var o3 = 0 == n4 ? X : J, r2 = 0 == n4 ? $ : q;
return "=>" == t4 ? E(F, n4 ? et : tt, R) : "operator" == t4 ? /\+\+|--/.test(e4) || u && "!" == e4 ? E(o3) : u && "<" == e4 && k.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false) ? E(H(">"), ut(yt, ">"), z, o3) : "?" == e4 ? E($, B(":"), r2) : E(r2) : "quasi" == t4 ? P(Z, o3) : ";" != t4 ? "(" == t4 ? pt(q, ")", "call", o3) : "." == t4 ? E(st, o3) : "[" == t4 ? E(H("]"), Y, B("]"), z, o3) : u && "as" == e4 ? (k.marked = "keyword", E(yt, o3)) : "regexp" == t4 ? (k.state.lastType = k.marked = "operator", k.stream.backUp(k.stream.pos - k.stream.start - 1), E(r2)) : void 0 : void 0;
}
function Z(t4, e4) {
return "quasi" != t4 ? P() : "${" != e4.slice(e4.length - 2) ? E(Z) : E(Y, Q);
}
function Q(t4) {
if ("}" == t4)
return k.marked = "string-2", k.state.tokenize = _, E(Z);
}
function tt(t4) {
return x(k.stream, k.state), P("{" == t4 ? U : $);
}
function et(t4) {
return x(k.stream, k.state), P("{" == t4 ? U : q);
}
function nt(t4) {
return function(e4) {
return "." == e4 ? E(t4 ? rt : ot) : "variable" == e4 && u ? E(Ot, t4 ? J : X) : P(t4 ? q : $);
};
}
function ot(t4, e4) {
if ("target" == e4)
return k.marked = "keyword", E(X);
}
function rt(t4, e4) {
if ("target" == e4)
return k.marked = "keyword", E(J);
}
function it(t4) {
return ":" == t4 ? E(z, U) : P(X, B(";"), z);
}
function st(t4) {
if ("variable" == t4)
return k.marked = "property", E();
}
function at(t4, e4) {
return "async" == t4 ? (k.marked = "property", E(at)) : "variable" == t4 || "keyword" == k.style ? (k.marked = "property", "get" == e4 || "set" == e4 ? E(lt) : (u && k.state.fatArrowAt == k.stream.start && (n4 = k.stream.match(/^\s*:\s*/, false)) && (k.state.fatArrowAt = k.stream.pos + n4[0].length), E(ct))) : "number" == t4 || "string" == t4 ? (k.marked = a ? "property" : k.style + " property", E(ct)) : "jsonld-keyword" == t4 ? E(ct) : u && L(e4) ? (k.marked = "keyword", E(at)) : "[" == t4 ? E($, ft, B("]"), ct) : "spread" == t4 ? E(q, ct) : "*" == e4 ? (k.marked = "keyword", E(at)) : ":" == t4 ? P(ct) : void 0;
var n4;
}
function lt(t4) {
return "variable" != t4 ? P(ct) : (k.marked = "property", E(Vt));
}
function ct(t4) {
return ":" == t4 ? E(q) : "(" == t4 ? P(Vt) : void 0;
}
function ut(t4, e4, n4) {
function o3(r2, i2) {
if (n4 ? n4.indexOf(r2) > -1 : "," == r2) {
var s2 = k.state.lexical;
return "call" == s2.info && (s2.pos = (s2.pos || 0) + 1), E(function(n5, o4) {
return n5 == e4 || o4 == e4 ? P() : P(t4);
}, o3);
}
return r2 == e4 || i2 == e4 ? E() : n4 && n4.indexOf(";") > -1 ? P(t4) : E(B(e4));
}
return function(n5, r2) {
return n5 == e4 || r2 == e4 ? E() : P(t4, o3);
};
}
function pt(t4, e4, n4) {
for (var o3 = 3; o3 < arguments.length; o3++)
k.cc.push(arguments[o3]);
return E(H(e4, n4), ut(t4, e4), z);
}
function dt(t4) {
return "}" == t4 ? E() : P(U, dt);
}
function ft(t4, e4) {
if (u) {
if (":" == t4)
return E(yt);
if ("?" == e4)
return E(ft);
}
}
function ht(t4, e4) {
if (u && (":" == t4 || "in" == e4))
return E(yt);
}
function gt(t4) {
if (u && ":" == t4)
return k.stream.match(/^\s*\w+\s+is\b/, false) ? E($, vt, yt) : E(yt);
}
function vt(t4, e4) {
if ("is" == e4)
return k.marked = "keyword", E();
}
function yt(t4, e4) {
return "keyof" == e4 || "typeof" == e4 || "infer" == e4 || "readonly" == e4 ? (k.marked = "keyword", E("typeof" == e4 ? q : yt)) : "variable" == t4 || "void" == e4 ? (k.marked = "type", E(St)) : "|" == e4 || "&" == e4 ? E(yt) : "string" == t4 || "number" == t4 || "atom" == t4 ? E(St) : "[" == t4 ? E(H("]"), ut(yt, "]", ","), z, St) : "{" == t4 ? E(H("}"), bt, z, St) : "(" == t4 ? E(ut(Ct, ")"), mt, St) : "<" == t4 ? E(ut(yt, ">"), yt) : "quasi" == t4 ? P(wt, St) : void 0;
}
function mt(t4) {
if ("=>" == t4)
return E(yt);
}
function bt(t4) {
return t4.match(/[\}\)\]]/) ? E() : "," == t4 || ";" == t4 ? E(bt) : P(_t, bt);
}
function _t(t4, e4) {
return "variable" == t4 || "keyword" == k.style ? (k.marked = "property", E(_t)) : "?" == e4 || "number" == t4 || "string" == t4 ? E(_t) : ":" == t4 ? E(yt) : "[" == t4 ? E(B("variable"), ht, B("]"), _t) : "(" == t4 ? P(Rt, _t) : t4.match(/[;\}\)\],]/) ? void 0 : E();
}
function wt(t4, e4) {
return "quasi" != t4 ? P() : "${" != e4.slice(e4.length - 2) ? E(wt) : E(yt, xt);
}
function xt(t4) {
if ("}" == t4)
return k.marked = "string-2", k.state.tokenize = _, E(wt);
}
function Ct(t4, e4) {
return "variable" == t4 && k.stream.match(/^\s*[?:]/, false) || "?" == e4 ? E(Ct) : ":" == t4 ? E(yt) : "spread" == t4 ? E(Ct) : P(yt);
}
function St(t4, e4) {
return "<" == e4 ? E(H(">"), ut(yt, ">"), z, St) : "|" == e4 || "." == t4 || "&" == e4 ? E(yt) : "[" == t4 ? E(yt, B("]"), St) : "extends" == e4 || "implements" == e4 ? (k.marked = "keyword", E(yt)) : "?" == e4 ? E(yt, B(":"), yt) : void 0;
}
function Ot(t4, e4) {
if ("<" == e4)
return E(H(">"), ut(yt, ">"), z, St);
}
function Tt() {
return P(yt, kt);
}
function kt(t4, e4) {
if ("=" == e4)
return E(yt);
}
function Pt(t4, e4) {
return "enum" == e4 ? (k.marked = "keyword", E(ee)) : P(Et, ft, Mt, Lt);
}
function Et(t4, e4) {
return u && L(e4) ? (k.marked = "keyword", E(Et)) : "variable" == t4 ? (j(e4), E()) : "spread" == t4 ? E(Et) : "[" == t4 ? pt(jt, "]") : "{" == t4 ? pt(At, "}") : void 0;
}
function At(t4, e4) {
return "variable" != t4 || k.stream.match(/^\s*:/, false) ? ("variable" == t4 && (k.marked = "property"), "spread" == t4 ? E(Et) : "}" == t4 ? P() : "[" == t4 ? E($, B("]"), B(":"), At) : E(B(":"), Et, Mt)) : (j(e4), E(Mt));
}
function jt() {
return P(Et, Mt);
}
function Mt(t4, e4) {
if ("=" == e4)
return E(q);
}
function Lt(t4) {
if ("," == t4)
return E(Pt);
}
function Dt(t4, e4) {
if ("keyword b" == t4 && "else" == e4)
return E(H("form", "else"), U, z);
}
function Nt(t4, e4) {
return "await" == e4 ? E(Nt) : "(" == t4 ? E(H(")"), It, z) : void 0;
}
function It(t4) {
return "var" == t4 ? E(Pt, Ft) : "variable" == t4 ? E(Ft) : P(Ft);
}
function Ft(t4, e4) {
return ")" == t4 ? E() : ";" == t4 ? E(Ft) : "in" == e4 || "of" == e4 ? (k.marked = "keyword", E($, Ft)) : P($, Ft);
}
function Vt(t4, e4) {
return "*" == e4 ? (k.marked = "keyword", E(Vt)) : "variable" == t4 ? (j(e4), E(Vt)) : "(" == t4 ? E(F, H(")"), ut(zt, ")"), z, gt, U, R) : u && "<" == e4 ? E(H(">"), ut(Tt, ">"), z, Vt) : void 0;
}
function Rt(t4, e4) {
return "*" == e4 ? (k.marked = "keyword", E(Rt)) : "variable" == t4 ? (j(e4), E(Rt)) : "(" == t4 ? E(F, H(")"), ut(zt, ")"), z, gt, R) : u && "<" == e4 ? E(H(">"), ut(Tt, ">"), z, Rt) : void 0;
}
function Ht(t4, e4) {
return "keyword" == t4 || "variable" == t4 ? (k.marked = "type", E(Ht)) : "<" == e4 ? E(H(">"), ut(Tt, ">"), z) : void 0;
}
function zt(t4, e4) {
return "@" == e4 && E($, zt), "spread" == t4 ? E(zt) : u && L(e4) ? (k.marked = "keyword", E(zt)) : u && "this" == t4 ? E(ft, Mt) : P(Et, ft, Mt);
}
function Bt(t4, e4) {
return "variable" == t4 ? Ut(t4, e4) : Wt(t4, e4);
}
function Ut(t4, e4) {
if ("variable" == t4)
return j(e4), E(Wt);
}
function Wt(t4, e4) {
return "<" == e4 ? E(H(">"), ut(Tt, ">"), z, Wt) : "extends" == e4 || "implements" == e4 || u && "," == t4 ? ("implements" == e4 && (k.marked = "keyword"), E(u ? yt : $, Wt)) : "{" == t4 ? E(H("}"), $t, z) : void 0;
}
function $t(t4, e4) {
return "async" == t4 || "variable" == t4 && ("static" == e4 || "get" == e4 || "set" == e4 || u && L(e4)) && k.stream.match(/^\s+[\w$\xa1-\uffff]/, false) ? (k.marked = "keyword", E($t)) : "variable" == t4 || "keyword" == k.style ? (k.marked = "property", E(qt, $t)) : "number" == t4 || "string" == t4 ? E(qt, $t) : "[" == t4 ? E($, ft, B("]"), qt, $t) : "*" == e4 ? (k.marked = "keyword", E($t)) : u && "(" == t4 ? P(Rt, $t) : ";" == t4 || "," == t4 ? E($t) : "}" == t4 ? E() : "@" == e4 ? E($, $t) : void 0;
}
function qt(t4, e4) {
if ("!" == e4)
return E(qt);
if ("?" == e4)
return E(qt);
if (":" == t4)
return E(yt, Mt);
if ("=" == e4)
return E(q);
var n4 = k.state.lexical.prev;
return P(n4 && "interface" == n4.info ? Rt : Vt);
}
function Gt(t4, e4) {
return "*" == e4 ? (k.marked = "keyword", E(Qt, B(";"))) : "default" == e4 ? (k.marked = "keyword", E($, B(";"))) : "{" == t4 ? E(ut(Kt, "}"), Qt, B(";")) : P(U);
}
function Kt(t4, e4) {
return "as" == e4 ? (k.marked = "keyword", E(B("variable"))) : "variable" == t4 ? P(q, Kt) : void 0;
}
function Yt(t4) {
return "string" == t4 ? E() : "(" == t4 ? P($) : "." == t4 ? P(X) : P(Xt, Jt, Qt);
}
function Xt(t4, e4) {
return "{" == t4 ? pt(Xt, "}") : ("variable" == t4 && j(e4), "*" == e4 && (k.marked = "keyword"), E(Zt));
}
function Jt(t4) {
if ("," == t4)
return E(Xt, Jt);
}
function Zt(t4, e4) {
if ("as" == e4)
return k.marked = "keyword", E(Xt);
}
function Qt(t4, e4) {
if ("from" == e4)
return k.marked = "keyword", E($);
}
function te(t4) {
return "]" == t4 ? E() : P(ut(q, "]"));
}
function ee() {
return P(H("form"), Et, B("{"), H("}"), ut(ne, "}"), z, z);
}
function ne() {
return P(Et, Mt);
}
function oe(t4, e4) {
return "operator" == t4.lastType || "," == t4.lastType || f.test(e4.charAt(0)) || /[,.]/.test(e4.charAt(0));
}
function re(t4, e4, n4) {
return e4.tokenize == y && /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e4.lastType) || "quasi" == e4.lastType && /\{\s*$/.test(t4.string.slice(0, t4.pos - (n4 || 0)));
}
return F.lex = V.lex = true, R.lex = true, z.lex = true, { startState: function(t4) {
var e4 = { tokenize: y, lastType: "sof", cc: [], lexical: new S((t4 || 0) - i, 0, "block", false), localVars: n3.localVars, context: n3.localVars && new D(null, null, false), indented: t4 || 0 };
return n3.globalVars && "object" == typeof n3.globalVars && (e4.globalVars = n3.globalVars), e4;
}, token: function(t4, e4) {
if (t4.sol() && (e4.lexical.hasOwnProperty("align") || (e4.lexical.align = false), e4.indented = t4.indentation(), x(t4, e4)), e4.tokenize != b && t4.eatSpace())
return null;
var n4 = e4.tokenize(t4, e4);
return "comment" == o2 ? n4 : (e4.lastType = "operator" != o2 || "++" != r && "--" != r ? o2 : "incdec", T(e4, n4, o2, r, t4));
}, indent: function(e4, o3) {
if (e4.tokenize == b || e4.tokenize == _)
return t3.Pass;
if (e4.tokenize != y)
return 0;
var r2, a2 = o3 && o3.charAt(0), l2 = e4.lexical;
if (!/^\s*else\b/.test(o3))
for (var c2 = e4.cc.length - 1; c2 >= 0; --c2) {
var u2 = e4.cc[c2];
if (u2 == z)
l2 = l2.prev;
else if (u2 != Dt && u2 != R)
break;
}
for (; ("stat" == l2.type || "form" == l2.type) && ("}" == a2 || (r2 = e4.cc[e4.cc.length - 1]) && (r2 == X || r2 == J) && !/^[,\.=+\-*:?[\(]/.test(o3)); )
l2 = l2.prev;
s && ")" == l2.type && "stat" == l2.prev.type && (l2 = l2.prev);
var p2 = l2.type, d2 = a2 == p2;
return "vardef" == p2 ? l2.indented + ("operator" == e4.lastType || "," == e4.lastType ? l2.info.length + 1 : 0) : "form" == p2 && "{" == a2 ? l2.indented : "form" == p2 ? l2.indented + i : "stat" == p2 ? l2.indented + (oe(e4, o3) ? s || i : 0) : "switch" != l2.info || d2 || 0 == n3.doubleIndentSwitch ? l2.align ? l2.column + (d2 ? 0 : 1) : l2.indented + (d2 ? 0 : i) : l2.indented + (/^(?:case|default)\b/.test(o3) ? i : 2 * i);
}, electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, blockCommentStart: l ? null : "/*", blockCommentEnd: l ? null : "*/", blockCommentContinue: l ? null : " * ", lineComment: l ? null : "//", fold: "brace", closeBrackets: "()[]{}''\"\"``", helperType: l ? "json" : "javascript", jsonldMode: a, jsonMode: l, expressionAllowed: re, skipExpression: function(e4) {
T(e4, "atom", "atom", "true", new t3.StringStream("", 2, null));
} };
}), t3.registerHelper("wordChars", "javascript", /[\w$]/), t3.defineMIME("text/javascript", "javascript"), t3.defineMIME("text/ecmascript", "javascript"), t3.defineMIME("application/javascript", "javascript"), t3.defineMIME("application/x-javascript", "javascript"), t3.defineMIME("application/ecmascript", "javascript"), t3.defineMIME("application/json", { name: "javascript", json: true }), t3.defineMIME("application/x-json", { name: "javascript", json: true }), t3.defineMIME("application/manifest+json", { name: "javascript", json: true }), t3.defineMIME("application/ld+json", { name: "javascript", jsonld: true }), t3.defineMIME("text/typescript", { name: "javascript", typescript: true }), t3.defineMIME("application/typescript", { name: "javascript", typescript: true });
})(n2(631));
}, 589: (t2, e2, n2) => {
(function(t3) {
var e3 = { autoSelfClosers: { area: true, base: true, br: true, col: true, command: true, embed: true, frame: true, hr: true, img: true, input: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true, menuitem: true }, implicitlyClosed: { dd: true, li: true, optgroup: true, option: true, p: true, rp: true, rt: true, tbody: true, td: true, tfoot: true, th: true, tr: true }, contextGrabbers: { dd: { dd: true, dt: true }, dt: { dd: true, dt: true }, li: { li: true }, option: { option: true, optgroup: true }, optgroup: { optgroup: true }, p: { address: true, article: true, aside: true, blockquote: true, dir: true, div: true, dl: true, fieldset: true, footer: true, form: true, h1: true, h2: true, h3: true, h4: true, h5: true, h6: true, header: true, hgroup: true, hr: true, menu: true, nav: true, ol: true, p: true, pre: true, section: true, table: true, ul: true }, rp: { rp: true, rt: true }, rt: { rp: true, rt: true }, tbody: { tbody: true, tfoot: true }, td: { td: true, th: true }, tfoot: { tbody: true }, th: { td: true, th: true }, thead: { tbody: true, tfoot: true }, tr: { tr: true } }, doNotIndent: { pre: true }, allowUnquoted: true, allowMissing: true, caseFold: true }, n3 = { autoSelfClosers: {}, implicitlyClosed: {}, contextGrabbers: {}, doNotIndent: {}, allowUnquoted: false, allowMissing: false, allowMissingTagName: false, caseFold: false };
t3.defineMode("xml", function(o2, r) {
var i, s, a = o2.indentUnit, l = {}, c = r.htmlMode ? e3 : n3;
for (var u in c)
l[u] = c[u];
for (var u in r)
l[u] = r[u];
function p(t4, e4) {
function n4(n5) {
return e4.tokenize = n5, n5(t4, e4);
}
var o3 = t4.next();
return "<" == o3 ? t4.eat("!") ? t4.eat("[") ? t4.match("CDATA[") ? n4(h("atom", "]]>")) : null : t4.match("--") ? n4(h("comment", "-->")) : t4.match("DOCTYPE", true, true) ? (t4.eatWhile(/[\w\._\-]/), n4(g(1))) : null : t4.eat("?") ? (t4.eatWhile(/[\w\._\-]/), e4.tokenize = h("meta", "?>"), "meta") : (i = t4.eat("/") ? "closeTag" : "openTag", e4.tokenize = d, "tag bracket") : "&" == o3 ? (t4.eat("#") ? t4.eat("x") ? t4.eatWhile(/[a-fA-F\d]/) && t4.eat(";") : t4.eatWhile(/[\d]/) && t4.eat(";") : t4.eatWhile(/[\w\.\-:]/) && t4.eat(";")) ? "atom" : "error" : (t4.eatWhile(/[^&<]/), null);
}
function d(t4, e4) {
var n4 = t4.next();
if (">" == n4 || "/" == n4 && t4.eat(">"))
return e4.tokenize = p, i = ">" == n4 ? "endTag" : "selfcloseTag", "tag bracket";
if ("=" == n4)
return i = "equals", null;
if ("<" == n4) {
e4.tokenize = p, e4.state = _, e4.tagName = e4.tagStart = null;
var o3 = e4.tokenize(t4, e4);
return o3 ? o3 + " tag error" : "tag error";
}
return /[\'\"]/.test(n4) ? (e4.tokenize = f(n4), e4.stringStartCol = t4.column(), e4.tokenize(t4, e4)) : (t4.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/), "word");
}
function f(t4) {
var e4 = function(e5, n4) {
for (; !e5.eol(); )
if (e5.next() == t4) {
n4.tokenize = d;
break;
}
return "string";
};
return e4.isInAttribute = true, e4;
}
function h(t4, e4) {
return function(n4, o3) {
for (; !n4.eol(); ) {
if (n4.match(e4)) {
o3.tokenize = p;
break;
}
n4.next();
}
return t4;
};
}
function g(t4) {
return function(e4, n4) {
for (var o3; null != (o3 = e4.next()); ) {
if ("<" == o3)
return n4.tokenize = g(t4 + 1), n4.tokenize(e4, n4);
if (">" == o3) {
if (1 == t4) {
n4.tokenize = p;
break;
}
return n4.tokenize = g(t4 - 1), n4.tokenize(e4, n4);
}
}
return "meta";
};
}
function v(t4) {
return t4 && t4.toLowerCase();
}
function y(t4, e4, n4) {
this.prev = t4.context, this.tagName = e4 || "", this.indent = t4.indented, this.startOfLine = n4, (l.doNotIndent.hasOwnProperty(e4) || t4.context && t4.context.noIndent) && (this.noIndent = true);
}
function m(t4) {
t4.context && (t4.context = t4.context.prev);
}
function b(t4, e4) {
for (var n4; 1; ) {
if (!t4.context)
return;
if (n4 = t4.context.tagName, !l.contextGrabbers.hasOwnProperty(v(n4)) || !l.contextGrabbers[v(n4)].hasOwnProperty(v(e4)))
return;
m(t4);
}
}
function _(t4, e4, n4) {
return "openTag" == t4 ? (n4.tagStart = e4.column(), w) : "closeTag" == t4 ? x : _;
}
function w(t4, e4, n4) {
return "word" == t4 ? (n4.tagName = e4.current(), s = "tag", O) : l.allowMissingTagName && "endTag" == t4 ? (s = "tag bracket", O(t4, e4, n4)) : (s = "error", w);
}
function x(t4, e4, n4) {
if ("word" == t4) {
var o3 = e4.current();
return n4.context && n4.context.tagName != o3 && l.implicitlyClosed.hasOwnProperty(v(n4.context.tagName)) && m(n4), n4.context && n4.context.tagName == o3 || false === l.matchClosing ? (s = "tag", C) : (s = "tag error", S);
}
return l.allowMissingTagName && "endTag" == t4 ? (s = "tag bracket", C(t4, e4, n4)) : (s = "error", S);
}
function C(t4, e4, n4) {
return "endTag" != t4 ? (s = "error", C) : (m(n4), _);
}
function S(t4, e4, n4) {
return s = "error", C(t4, e4, n4);
}
function O(t4, e4, n4) {
if ("word" == t4)
return s = "attribute", T;
if ("endTag" == t4 || "selfcloseTag" == t4) {
var o3 = n4.tagName, r2 = n4.tagStart;
return n4.tagName = n4.tagStart = null, "selfcloseTag" == t4 || l.autoSelfClosers.hasOwnProperty(v(o3)) ? b(n4, o3) : (b(n4, o3), n4.context = new y(n4, o3, r2 == n4.indented)), _;
}
return s = "error", O;
}
function T(t4, e4, n4) {
return "equals" == t4 ? k : (l.allowMissing || (s = "error"), O(t4, e4, n4));
}
function k(t4, e4, n4) {
return "string" == t4 ? P : "word" == t4 && l.allowUnquoted ? (s = "string", O) : (s = "error", O(t4, e4, n4));
}
function P(t4, e4, n4) {
return "string" == t4 ? P : O(t4, e4, n4);
}
return p.isInText = true, { startState: function(t4) {
var e4 = { tokenize: p, state: _, indented: t4 || 0, tagName: null, tagStart: null, context: null };
return null != t4 && (e4.baseIndent = t4), e4;
}, token: function(t4, e4) {
if (!e4.tagName && t4.sol() && (e4.indented = t4.indentation()), t4.eatSpace())
return null;
i = null;
var n4 = e4.tokenize(t4, e4);
return (n4 || i) && "comment" != n4 && (s = null, e4.state = e4.state(i || n4, t4, e4), s && (n4 = "error" == s ? n4 + " error" : s)), n4;
}, indent: function(e4, n4, o3) {
var r2 = e4.context;
if (e4.tokenize.isInAttribute)
return e4.tagStart == e4.indented ? e4.stringStartCol + 1 : e4.indented + a;
if (r2 && r2.noIndent)
return t3.Pass;
if (e4.tokenize != d && e4.tokenize != p)
return o3 ? o3.match(/^(\s*)/)[0].length : 0;
if (e4.tagName)
return false !== l.multilineTagIndentPastTag ? e4.tagStart + e4.tagName.length + 2 : e4.tagStart + a * (l.multilineTagIndentFactor || 1);
if (l.alignCDATA && /$/, blockCommentStart: "", configuration: l.htmlMode ? "html" : "xml", helperType: l.htmlMode ? "html" : "xml", skipAttribute: function(t4) {
t4.state == k && (t4.state = O);
}, xmlCurrentTag: function(t4) {
return t4.tagName ? { name: t4.tagName, close: "closeTag" == t4.type } : null;
}, xmlCurrentContext: function(t4) {
for (var e4 = [], n4 = t4.context; n4; n4 = n4.prev)
e4.push(n4.tagName);
return e4.reverse();
} };
}), t3.defineMIME("text/xml", "xml"), t3.defineMIME("application/xml", "xml"), t3.mimeModes.hasOwnProperty("text/html") || t3.defineMIME("text/html", { name: "xml", htmlMode: true });
})(n2(631));
}, 858: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => o2 });
const o2 = { run: function(t3) {
t3.DomComponents.clear(), t3.CssComposer.clear();
} };
}, 884: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => s });
var o2 = n2(50), r = n2(163), i = n2(668);
const s = { run: function(t3) {
(0, o2.bindAll)(this, "onKeyUp", "enableDragger", "disableDragger"), this.editor = t3, this.canvasModel = this.canvas.getCanvasView().model, this.toggleMove(1);
}, stop: function(t3) {
this.toggleMove(), this.disableDragger();
}, onKeyUp: function(t3) {
" " === (0, r.getKeyChar)(t3) && this.editor.stopCommand(this.id);
}, enableDragger: function(t3) {
this.toggleDragger(1, t3);
}, disableDragger: function(t3) {
this.toggleDragger(0, t3);
}, toggleDragger: function(t3, e3) {
var n3 = this.canvasModel, o3 = this.em, r2 = this.dragger, s2 = t3 ? "add" : "remove";
this.getCanvas().classList[s2]("".concat(this.ppfx, "is__grabbing")), r2 || (r2 = new i.Z({ getPosition: function() {
return { x: n3.get("x"), y: n3.get("y") };
}, setPosition: function(t4) {
var e4 = t4.x, o4 = t4.y;
n3.set({ x: e4, y: o4 });
}, onStart: function(t4, e4) {
o3.trigger("canvas:move:start", e4);
}, onDrag: function(t4, e4) {
o3.trigger("canvas:move", e4);
}, onEnd: function(t4, e4) {
o3.trigger("canvas:move:end", e4);
} }), this.dragger = r2), t3 ? r2.start(e3) : r2.stop();
}, toggleMove: function(t3) {
var e3 = this.ppfx, n3 = t3 ? "add" : "remove", o3 = t3 ? "on" : "off", i2 = { on: r.on, off: r.off }, s2 = this.getCanvas(), a = ["".concat(e3, "is__grab")];
!t3 && a.push("".concat(e3, "is__grabbing")), a.forEach(function(t4) {
return s2.classList[n3](t4);
}), i2[o3](document, "keyup", this.onKeyUp), i2[o3](s2, "mousedown", this.enableDragger), i2[o3](document, "mouseup", this.disableDragger);
} };
}, 790: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => a, defineCommand: () => s });
var o2, r = n2(346), i = (o2 = function(t3, e3) {
return o2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) {
t4.__proto__ = e4;
} || function(t4, e4) {
for (var n3 in e4)
Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]);
}, o2(t3, e3);
}, function(t3, e3) {
if ("function" != typeof e3 && null !== e3)
throw new TypeError("Class extends value " + String(e3) + " is not a constructor or null");
function n3() {
this.constructor = t3;
}
o2(t3, e3), t3.prototype = null === e3 ? Object.create(e3) : (n3.prototype = e3.prototype, new n3());
});
function s(t3) {
return t3;
}
const a = function(t3) {
function e3(e4) {
var n3 = t3.call(this, 0) || this;
n3.config = e4 || {}, n3.em = n3.config.em || {};
var o3 = n3.config.stylePrefix;
return n3.pfx = o3, n3.ppfx = n3.config.pStylePrefix, n3.hoverClass = "".concat(o3, "hover"), n3.badgeClass = "".concat(o3, "badge"), n3.plhClass = "".concat(o3, "placeholder"), n3.freezClass = "".concat(n3.ppfx, "freezed"), n3.canvas = n3.em.Canvas, n3.init(n3.config), n3;
}
return i(e3, t3), e3.prototype.onFrameScroll = function(t4) {
}, e3.prototype.getCanvas = function() {
return this.canvas.getElement();
}, e3.prototype.getCanvasBody = function() {
return this.canvas.getBody();
}, e3.prototype.getCanvasTools = function() {
return this.canvas.getToolsEl();
}, e3.prototype.offset = function(t4) {
var e4 = t4.getBoundingClientRect();
return { top: e4.top + t4.ownerDocument.body.scrollTop, left: e4.left + t4.ownerDocument.body.scrollLeft };
}, e3.prototype.init = function(t4) {
}, e3.prototype.callRun = function(t4, e4) {
void 0 === e4 && (e4 = {});
var n3 = this.id;
if (t4.trigger("run:".concat(n3, ":before"), e4), !e4 || !e4.abort) {
var o3 = e4.sender || t4, r2 = this.run(t4, o3, e4);
return t4.trigger("run:".concat(n3), r2, e4), t4.trigger("run", n3, r2, e4), r2;
}
t4.trigger("abort:".concat(n3), e4);
}, e3.prototype.callStop = function(t4, e4) {
void 0 === e4 && (e4 = {});
var n3 = this.id, o3 = e4.sender || t4;
t4.trigger("stop:".concat(n3, ":before"), e4);
var r2 = this.stop(t4, o3, e4);
return t4.trigger("stop:".concat(n3), r2, e4), t4.trigger("stop", n3, r2, e4), r2;
}, e3.prototype.stopCommand = function(t4) {
this.em.Commands.stop(this.id, t4);
}, e3.prototype.run = function(t4, e4, n3) {
}, e3.prototype.stop = function(t4, e4, n3) {
}, e3;
}(r.Hn);
}, 180: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => i });
var o2 = n2(50), r = function(t3, e3, n3) {
if (n3 || 2 === arguments.length)
for (var o3, r2 = 0, i2 = e3.length; r2 < i2; r2++)
!o3 && r2 in e3 || (o3 || (o3 = Array.prototype.slice.call(e3, 0, r2)), o3[r2] = e3[r2]);
return t3.concat(o3 || Array.prototype.slice.call(e3));
};
const i = { run: function(t3, e3, n3) {
var i2 = this;
void 0 === n3 && (n3 = {});
var s = [], a = n3.component || t3.getSelectedAll();
return (a = (0, o2.isArray)(a) ? r([], a, true) : [a]).filter(Boolean).forEach(function(t4) {
if (!t4.get("removable"))
return s.push(t4), i2.em.logWarning("The element is not removable", { component: t4 });
t4.remove();
}), t3.select(s), a;
} };
}, 544: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => a });
var o2 = n2(50), r = n2(668), i = function() {
return i = Object.assign || function(t3) {
for (var e3, n3 = 1, o3 = arguments.length; n3 < o3; n3++)
for (var r2 in e3 = arguments[n3])
Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]);
return t3;
}, i.apply(this, arguments);
}, s = "dmode";
const a = { run: function(t3, e3, n3) {
var a2 = this;
void 0 === n3 && (n3 = {}), (0, o2.bindAll)(this, "setPosition", "onStart", "onDrag", "onEnd", "getPosition", "getGuidesStatic", "renderGuide", "getGuidesTarget");
var l = n3.target, c = n3.event, u = n3.mode, p = n3.dragger, d = void 0 === p ? {} : p, f = l.getEl(), h = i({ doc: f.ownerDocument, onStart: this.onStart, onEnd: this.onEnd, onDrag: this.onDrag, getPosition: this.getPosition, setPosition: this.setPosition, guidesStatic: function() {
return a2.guidesStatic;
}, guidesTarget: function() {
return a2.guidesTarget;
} }, d);
this.setupGuides(), this.opts = n3, this.editor = t3, this.em = t3.getModel(), this.target = l, this.isTran = "translate" == u, this.guidesContainer = this.getGuidesContainer(), this.guidesTarget = this.getGuidesTarget(), this.guidesStatic = this.getGuidesStatic();
var g = this.dragger;
return g ? g.setOptions(h) : (g = new r.Z(h), this.dragger = g), c && g.start(c), this.toggleDrag(1), this.em.trigger("".concat(s, ":start"), this.getEventOpts()), g;
}, getEventOpts: function() {
return { mode: this.opts.mode, target: this.target, guidesTarget: this.guidesTarget, guidesStatic: this.guidesStatic };
}, stop: function() {
this.toggleDrag();
}, setupGuides: function() {
(this.guides || []).forEach(function(t3) {
var e3 = t3.guide;
e3 && e3.parentNode.removeChild(e3);
}), this.guides = [];
}, getGuidesContainer: function() {
var t3 = this, e3 = this.guidesEl;
if (!e3) {
var n3 = this, r2 = n3.editor, i2 = n3.em, s2 = n3.opts, a2 = r2.getConfig().stylePrefix, l = document.createElement("div"), c = document.createElement("div"), u = '
');
(e3 = document.createElement("div")).className = "".concat(a2, "guides"), l.className = "".concat(a2, "guide-info ").concat(a2, "guide-info__x"), c.className = "".concat(a2, "guide-info ").concat(a2, "guide-info__y"), l.innerHTML = u, c.innerHTML = u, e3.appendChild(l), e3.appendChild(c), r2.Canvas.getGlobalToolsEl().appendChild(e3), this.guidesEl = e3, this.elGuideInfoX = l, this.elGuideInfoY = c, this.elGuideInfoContentX = l.querySelector(".".concat(a2, "guide-info__content")), this.elGuideInfoContentY = c.querySelector(".".concat(a2, "guide-info__content")), i2.on("canvas:update frame:scroll", (0, o2.debounce)(function() {
var e4;
t3.updateGuides(), s2.debug && (null === (e4 = t3.guides) || void 0 === e4 || e4.forEach(function(e5) {
return t3.renderGuide(e5);
}));
}, 200));
}
return e3;
}, getGuidesStatic: function() {
var t3 = this, e3 = [], n3 = this.target.getEl(), r2 = n3.parentNode, i2 = void 0 === r2 ? {} : r2;
return (0, o2.each)(i2.children, function(o3) {
return e3 = e3.concat(n3 !== o3 ? t3.getElementGuides(o3) : []);
}), e3.concat(this.getElementGuides(i2));
}, getGuidesTarget: function() {
return this.getElementGuides(this.target.getEl());
}, updateGuides: function(t3) {
var e3, n3, r2 = this;
(t3 || this.guides).forEach(function(t4) {
var i2 = t4.origin, s2 = e3 === i2 ? n3 : r2.getElementPos(i2);
e3 = i2, n3 = s2, (0, o2.each)(r2.getGuidePosUpdate(t4, s2), function(e4, n4) {
return t4[n4] = e4;
}), t4.originRect = s2;
});
}, getGuidePosUpdate: function(t3, e3) {
var n3 = {}, o3 = e3.top, r2 = e3.height, i2 = e3.left, s2 = e3.width;
switch (t3.type) {
case "t":
n3.y = o3;
break;
case "b":
n3.y = o3 + r2;
break;
case "l":
n3.x = i2;
break;
case "r":
n3.x = i2 + s2;
break;
case "x":
n3.x = i2 + s2 / 2;
break;
case "y":
n3.y = o3 + r2 / 2;
}
return n3;
}, renderGuide: function(t3) {
void 0 === t3 && (t3 = {});
var e3 = t3.guide || document.createElement("div"), n3 = "px", o3 = t3.active ? 2 : 1, r2 = e3.children[0];
return e3.style = "position: absolute; background-color: ".concat(t3.active ? "green" : "red", ";"), e3.children.length || ((r2 = document.createElement("div")).style = "position: absolute; color: red; padding: 5px; top: 0; left: 0;", e3.appendChild(r2)), t3.y ? (e3.style.width = "100%", e3.style.height = "".concat(o3).concat(n3), e3.style.top = "".concat(t3.y).concat(n3), e3.style.left = 0) : (e3.style.width = "".concat(o3).concat(n3), e3.style.height = "100%", e3.style.left = "".concat(t3.x).concat(n3), e3.style.top = "0".concat(n3)), !t3.guide && this.guidesContainer.appendChild(e3), e3;
}, getElementPos: function(t3) {
return this.editor.Canvas.getElementPos(t3, { noScroll: 1 });
}, getElementGuides: function(t3) {
var e3 = this, n3 = this.opts, o3 = this.getElementPos(t3), r2 = o3.top, s2 = o3.height, a2 = o3.left, l = o3.width, c = [{ type: "t", y: r2 }, { type: "b", y: r2 + s2 }, { type: "l", x: a2 }, { type: "r", x: a2 + l }, { type: "x", x: a2 + l / 2 }, { type: "y", y: r2 + s2 / 2 }].map(function(r3) {
return i(i({}, r3), { origin: t3, originRect: o3, guide: n3.debug && e3.renderGuide(r3) });
});
return c.forEach(function(t4) {
var n4;
return null === (n4 = e3.guides) || void 0 === n4 ? void 0 : n4.push(t4);
}), c;
}, getTranslate: function(t3, e3) {
void 0 === e3 && (e3 = "x");
var n3 = 0;
return (t3 || "").split(" ").forEach(function(t4) {
var o3 = t4.trim(), r2 = "translate".concat(e3.toUpperCase(), "(");
0 === o3.indexOf(r2) && (n3 = parseFloat(o3.replace(r2, "")));
}), n3;
}, setTranslate: function(t3, e3, n3) {
var o3 = "translate".concat(e3.toUpperCase(), "("), r2 = "".concat(o3).concat(n3, ")"), i2 = (t3 || "").split(" ").map(function(t4) {
return 0 === t4.trim().indexOf(o3) && (t4 = r2), t4;
}).join(" ");
return i2.indexOf(o3) < 0 && (i2 += " ".concat(r2)), i2;
}, getPosition: function() {
var t3 = this.target, e3 = this.isTran, n3 = t3.getStyle(), o3 = n3.left, r2 = n3.top, i2 = n3.transform, s2 = 0, a2 = 0;
return e3 ? (s2 = this.getTranslate(i2), a2 = this.getTranslate(i2, "y")) : (s2 = parseFloat(o3 || 0), a2 = parseFloat(r2 || 0)), { x: s2, y: a2 };
}, setPosition: function(t3) {
var e3 = t3.x, n3 = t3.y, r2 = t3.end, i2 = t3.position, s2 = t3.width, a2 = t3.height, l = this, c = l.target, u = l.isTran, p = l.em, d = "px", f = !r2, h = "".concat(parseInt(e3, 10)).concat(d), g = "".concat(parseInt(n3, 10)).concat(d), v = {};
if (u) {
var y = c.getStyle()["transform"] || "";
y = this.setTranslate(y, "x", h), v = { transform: y = this.setTranslate(y, "y", g), __p: f }, c.addStyle(v, { avoidStore: !r2 });
} else {
var m = { position: i2, width: s2, height: a2 }, b = { left: h, top: g, __p: f };
(0, o2.keys)(m).forEach(function(t4) {
var e4 = m[t4];
e4 && (b[t4] = e4);
}), v = b, c.addStyle(v, { avoidStore: !r2 });
}
null == p || p.Styles.__emitCmpStyleUpdate(v, { components: p.getSelected() });
}, _getDragData: function() {
var t3 = this.target;
return { target: t3, parent: t3.parent(), index: t3.index() };
}, onStart: function(t3) {
var e3 = this, n3 = e3.target, o3 = e3.editor, r2 = e3.isTran, i2 = e3.opts, s2 = i2.center, a2 = i2.onStart, l = o3.Canvas, c = n3.getStyle(), u = "absolute", p = [u, "relative"];
if (a2 && a2(this._getDragData()), !r2 && c.position !== u) {
var d = l.offset(n3.getEl()), f = d.left, h = d.top, g = d.width, v = d.height, y = n3.parent(), m = void 0;
do {
var b = y.getStyle();
m = p.indexOf(b.position) >= 0 ? y : null, y = y.parent();
} while (y && !m);
if (s2) {
var _ = l.getMouseRelativeCanvas(t3);
f = _.x, h = _.y;
} else if (m) {
var w = l.offset(m.getEl());
f -= w.left, h -= w.top;
}
this.setPosition({ x: f, y: h, width: "".concat(g, "px"), height: "".concat(v, "px"), position: u });
}
}, onDrag: function() {
for (var t3 = this, e3 = [], n3 = 0; n3 < arguments.length; n3++)
e3[n3] = arguments[n3];
var o3 = this, r2 = o3.guidesTarget, i2 = o3.opts, s2 = i2.onDrag;
this.updateGuides(r2), i2.debug && r2.forEach(function(e4) {
return t3.renderGuide(e4);
}), i2.guidesInfo && this.renderGuideInfo(r2.filter(function(t4) {
return t4.active;
})), s2 && s2(this._getDragData());
}, onEnd: function(t3, e3, n3) {
void 0 === n3 && (n3 = {});
var o3 = this, r2 = o3.editor, a2 = o3.opts, l = o3.id, c = a2.onEnd;
c && c(t3, n3, i(i({ event: t3 }, n3), this._getDragData())), r2.stopCommand(l), this.hideGuidesInfo(), this.em.trigger("".concat(s, ":end"), this.getEventOpts());
}, hideGuidesInfo: function() {
var t3 = this;
["X", "Y"].forEach(function(e3) {
var n3 = t3["elGuideInfo".concat(e3)];
n3 && (n3.style.display = "none");
});
}, renderGuideInfo: function(t3) {
var e3 = this;
void 0 === t3 && (t3 = []);
var n3 = this.guidesStatic;
this.hideGuidesInfo(), t3.forEach(function(t4) {
var r2 = t4.origin, a2 = t4.x, l = e3.getElementPos(r2), c = (0, o2.isUndefined)(a2) ? "y" : "x", u = "y" === c, p = l[u ? "left" : "top"], d = l.rect[u ? "left" : "top"], f = u ? p + l.width : p + l.height, h = u ? d + l.rect.width : d + l.rect.height, g = e3["elGuideInfo".concat(c.toUpperCase())], v = e3["elGuideInfoContent".concat(c.toUpperCase())], y = g.style, m = null == n3 ? void 0 : n3.filter(function(e4) {
return e4.type === t4.type;
}).map(function(t5) {
var e4 = t5.originRect, n4 = e4.left, o3 = e4.width, r3 = e4.top, i2 = e4.height, s2 = u ? n4 + o3 : r3 + i2;
return { gap: s2 < p ? p - s2 : (u ? n4 : r3) - f, guide: t5 };
}).filter(function(t5) {
return t5.gap > 0;
}).sort(function(t5, e4) {
return t5.gap - e4.gap;
}).map(function(t5) {
return t5.guide;
})[0];
if (m) {
var b = m.originRect, _ = b.left, w = b.width, x = b.top, C = b.height, S = b.rect, O = u ? _ < l.left : x < l.top, T = u ? _ : x, k = u ? S.left : S.top, P = u ? _ + w : x + C, E = u ? S.left + S.width : S.top + S.height, A = u ? t4.y : t4.x, j = O ? P : f, M = "".concat(A, "px"), L = O ? p - P : T - f, D = O ? d - E : k - h;
y.display = "", y[u ? "top" : "left"] = M, y[u ? "left" : "top"] = "".concat(j, "px"), y[u ? "width" : "height"] = "".concat(L, "px"), v.innerHTML = "".concat(Math.round(D), "px"), e3.em.trigger("".concat(s, ":active"), i(i({}, e3.getEventOpts()), { guide: t4, guidesStatic: n3, matched: m, posFirst: A, posSecond: j, size: L, sizeRaw: D, elGuideInfo: g, elGuideInfoCnt: v }));
}
});
}, toggleDrag: function(t3) {
var e3 = this.ppfx, n3 = this.editor, o3 = t3 ? "add" : "remove", r2 = ["".concat(e3, "is__grabbing")], i2 = n3.Canvas, s2 = i2.getBody();
r2.forEach(function(t4) {
return s2.classList[o3](t4);
}), i2[t3 ? "startAutoscroll" : "stopAutoscroll"]();
} };
}, 236: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => o2 });
const o2 = { run: function(t3) {
if (t3.Canvas.hasFocus()) {
var e3 = [];
t3.getSelectedAll().forEach(function(t4) {
var n3 = t4.components(), o3 = n3 && n3.filter(function(t5) {
return t5.get("selectable");
})[0];
o3 && e3.push(o3);
}), e3.length && t3.select(e3);
}
} };
}, 368: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => o2 });
const o2 = { run: function(t3, e3, n3) {
if (void 0 === n3 && (n3 = {}), t3.Canvas.hasFocus() || n3.force) {
var o3 = [];
t3.getSelectedAll().forEach(function(t4) {
for (var e4 = t4.parent(); e4 && !e4.get("selectable"); )
e4 = e4.parent();
e4 && o3.push(e4);
}), o3.length && t3.select(o3);
}
} };
}, 243: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => o2 });
const o2 = { run: function(t3) {
if (t3.Canvas.hasFocus()) {
var e3 = [];
t3.getSelectedAll().forEach(function(t4) {
var n3 = t4.parent();
if (n3) {
var o3, r = n3.components().length, i = 0, s = 0;
do {
i++, o3 = (s = t4.index() + i) <= r ? n3.getChildAt(s) : null;
} while (o3 && !o3.get("selectable"));
e3.push(o3 || t4);
}
}), e3.length && t3.select(e3);
}
} };
}, 400: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => o2 });
const o2 = { run: function(t3) {
if (t3.Canvas.hasFocus()) {
var e3 = [];
t3.getSelectedAll().forEach(function(t4) {
var n3 = t4.parent();
if (n3) {
var o3, r = 0, i = 0;
do {
r++, o3 = (i = t4.index() - r) >= 0 ? n3.getChildAt(i) : null;
} while (o3 && !o3.get("selectable"));
e3.push(o3 || t4);
}
}), e3.length && t3.select(e3);
}
} };
}, 910: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => r });
var o2 = n2(50);
const r = { run: function(t3, e3, n3) {
void 0 === n3 && (n3 = {});
var r2 = n3.target, i = [];
if (!r2.get("styles"))
return i;
var s = r2.get("type"), a = t3.Pages.getAllWrappers();
if (!(0, o2.flatten)(a.map(function(t4) {
return t4.findType(s);
})).length) {
var l = t3.CssComposer.getAll();
i = l.filter(function(t4) {
return t4.get("group") === "cmp:".concat(s);
}), l.remove(i);
}
return i;
} };
}, 744: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => r });
var o2 = function(t3, e3, n3) {
if (n3 || 2 === arguments.length)
for (var o3, r2 = 0, i = e3.length; r2 < i; r2++)
!o3 && r2 in e3 || (o3 || (o3 = Array.prototype.slice.call(e3, 0, r2)), o3[r2] = e3[r2]);
return t3.concat(o3 || Array.prototype.slice.call(e3));
};
const r = { run: function(t3) {
var e3 = t3.getModel(), n3 = o2([], t3.getSelectedAll(), true);
n3.length && e3.set("clipboard", n3);
} };
}, 517: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => s });
var o2 = n2(50), r = n2(895), i = n2(407);
const s = (0, o2.extend)({}, i["default"], { init: function() {
(0, o2.bindAll)(this, "startDelete", "stopDelete", "onDelete"), this.hoverClass = this.pfx + "hover-delete", this.badgeClass = this.pfx + "badge-red";
}, enable: function() {
this.$el.find("*").mouseover(this.startDelete).mouseout(this.stopDelete).click(this.onDelete);
}, startDelete: function(t3) {
t3.stopPropagation();
var e3 = (0, r["default"])(t3.target);
e3.data("model").get("removable") && (e3.addClass(this.hoverClass), this.attachBadge(e3.get(0)));
}, stopDelete: function(t3) {
t3.stopPropagation(), (0, r["default"])(t3.target).removeClass(this.hoverClass), this.badge && this.badge.css({ left: -1e3, top: -1e3 });
}, onDelete: function(t3) {
t3.stopPropagation();
var e3 = (0, r["default"])(t3.target);
e3.data("model").get("removable") && (e3.data("model").destroy(), this.removeBadge(), this.clean());
}, updateBadgeLabel: function(t3) {
this.badge.html("Remove " + t3.getName());
} });
}, 457: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => r });
var o2 = n2(895);
const r = { run: function(t3, e3, n3) {
var r2 = this;
void 0 === n3 && (n3 = {}), e3 && e3.set && e3.set("active", 0);
var i = t3.getConfig(), s = t3.Modal, a = i.stylePrefix;
if (this.cm = t3.CodeManager || null, !this.$editors) {
var l = this.buildEditor("htmlmixed", "hopscotch", "HTML"), c = this.buildEditor("css", "hopscotch", "CSS");
this.htmlEditor = l.el, this.cssEditor = c.el;
var u = (0, o2["default"])(''));
u.append(l.$el).append(c.$el), this.$editors = u;
}
s.open({ title: i.textViewCode, content: this.$editors }).getModel().once("change:open", function() {
return t3.stopCommand("".concat(r2.id));
}), this.htmlEditor.setContent(t3.getHtml(n3.optsHtml)), this.cssEditor.setContent(t3.getCss(n3.optsCss));
}, stop: function(t3) {
var e3 = t3.Modal;
e3 && e3.close();
}, buildEditor: function(t3, e3, n3) {
var o3 = document.createElement("textarea");
!this.codeMirror && (this.codeMirror = this.cm.getViewer("CodeMirror"));
var r2 = this.codeMirror.clone().set({ label: n3, codeName: t3, theme: e3, input: o3 }), i = new this.cm.EditorView({ model: r2, config: this.cm.getConfig() }).render().$el;
return r2.init(o3), { el: r2, $el: i };
} };
}, 975: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => r });
var o2 = n2(50);
const r = { isEnabled: function() {
var t3 = document;
return !!(t3.fullscreenElement || t3.webkitFullscreenElement || t3.mozFullScreenElement);
}, enable: function(t3) {
var e3 = "";
return t3.requestFullscreen ? t3.requestFullscreen() : t3.webkitRequestFullscreen ? (e3 = "webkit", t3.webkitRequestFullscreen()) : t3.mozRequestFullScreen ? (e3 = "moz", t3.mozRequestFullScreen()) : t3.msRequestFullscreen && t3.msRequestFullscreen(), e3;
}, disable: function() {
var t3 = document;
this.isEnabled() && (t3.exitFullscreen ? t3.exitFullscreen() : t3.webkitExitFullscreen ? t3.webkitExitFullscreen() : t3.mozCancelFullScreen ? t3.mozCancelFullScreen() : t3.msExitFullscreen && t3.msExitFullscreen());
}, fsChanged: function(t3) {
this.isEnabled() || (this.stopCommand({ sender: this.sender }), document.removeEventListener("".concat(t3 || "", "fullscreenchange"), this.fsChanged));
}, run: function(t3, e3, n3) {
void 0 === n3 && (n3 = {}), this.sender = e3;
var r2 = n3.target, i = (0, o2.isElement)(r2) ? r2 : document.querySelector(r2), s = this.enable(i || t3.getContainer());
this.fsChanged = this.fsChanged.bind(this, s), document.addEventListener(s + "fullscreenchange", this.fsChanged), t3.trigger("change:canvasOffset");
}, stop: function(t3, e3) {
e3 && e3.set && e3.set("active", false), this.disable(), t3 && t3.trigger("change:canvasOffset");
} };
}, 191: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => l });
var o2 = n2(50), r = n2(895), i = n2(163), s = n2(407), a = n2(189);
const l = (0, o2.extend)({}, a["default"], s["default"], { init: function(t3) {
s["default"].init.apply(this, arguments), (0, o2.bindAll)(this, "initSorter", "rollback", "onEndMove"), this.opt = t3, this.hoverClass = this.ppfx + "highlighter-warning", this.badgeClass = this.ppfx + "badge-warning", this.noSelClass = this.ppfx + "no-select";
}, enable: function() {
for (var t3 = [], e3 = 0; e3 < arguments.length; e3++)
t3[e3] = arguments[e3];
s["default"].enable.apply(this, t3), this.getBadgeEl().addClass(this.badgeClass), this.getHighlighterEl().addClass(this.hoverClass);
var n3 = this.$wrapper;
n3.css("cursor", "move"), n3.on("mousedown", this.initSorter), n3.addClass(this.noSelClass);
}, toggleClipboard: function() {
}, initSorter: function(t3) {
var e3 = (0, r["default"])(t3.target).data("model").get("draggable");
e3 && (this.cacheEl = null, this.startSelectPosition(t3.target, this.frameEl.contentDocument), this.sorter.draggable = e3, this.sorter.onEndMove = this.onEndMove.bind(this), this.stopSelectComponent(), this.$wrapper.off("mousedown", this.initSorter), (0, i.on)(this.getContentWindow(), "keydown", this.rollback));
}, initSorterFromModel: function(t3) {
var e3 = t3.get("draggable");
if (e3) {
this.cacheEl = null;
var n3 = t3.view.el;
this.startSelectPosition(n3, this.frameEl.contentDocument), this.sorter.draggable = e3, this.sorter.onEndMove = this.onEndMoveFromModel.bind(this), this.stopSelectComponent(), (0, i.on)(this.getContentWindow(), "keydown", this.rollback);
}
}, initSorterFromModels: function(t3) {
this.cacheEl = null;
var e3 = t3[t3.length - 1], n3 = (this.em.get("currentFrame") || {}).model, o3 = e3.getEl(n3), r2 = o3.ownerDocument;
this.startSelectPosition(o3, r2, { onStart: this.onStart }), this.sorter.draggable = e3.get("draggable"), this.sorter.toMove = t3, this.sorter.onMoveClb = this.onDrag, this.sorter.onEndMove = this.onEndMoveFromModel.bind(this), this.stopSelectComponent(), (0, i.on)(this.getContentWindow(), "keydown", this.rollback);
}, onEndMoveFromModel: function() {
(0, i.off)(this.getContentWindow(), "keydown", this.rollback);
}, onEndMove: function() {
this.enable(), (0, i.off)(this.getContentWindow(), "keydown", this.rollback);
}, onSelect: function(t3, e3) {
}, rollback: function(t3, e3) {
(27 == (t3.which || t3.keyCode) || e3) && (this.sorter.moved = false, this.sorter.endMove());
}, getBadgeEl: function() {
return this.$badge || (this.$badge = (0, r["default"])(this.getBadge())), this.$badge;
}, getHighlighterEl: function() {
return this.$hl || (this.$hl = (0, r["default"])(this.canvas.getHighlighter())), this.$hl;
}, stop: function() {
for (var t3 = [], e3 = 0; e3 < arguments.length; e3++)
t3[e3] = arguments[e3];
s["default"].stop.apply(this, t3), this.getBadgeEl().removeClass(this.badgeClass), this.getHighlighterEl().removeClass(this.hoverClass);
var n3 = this.$wrapper;
n3.css("cursor", "").unbind().removeClass(this.noSelClass);
} });
}, 912: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => i });
var o2 = n2(50), r = n2(491);
const i = { open: function(t3) {
var e3 = this, n3 = this, r2 = n3.editor, i2 = n3.title, s = n3.config, a = n3.am, l = s.custom;
if ((0, o2.isFunction)(l.open))
return l.open(a.__customData());
r2.Modal.open({ title: i2, content: t3 }).onceClose(function() {
return r2.stopCommand(e3.id);
});
}, close: function() {
var t3 = this.config.custom;
if ((0, o2.isFunction)(t3.close))
return t3.close(this.am.__customData());
var e3 = this.editor.Modal;
e3 && e3.close();
}, run: function(t3, e3, n3) {
void 0 === n3 && (n3 = {});
var o3 = t3.AssetManager, i2 = o3.getConfig(), s = n3.types, a = void 0 === s ? [] : s, l = n3.accept, c = n3.select;
if (this.title = n3.modalTitle || t3.t("assetManager.modalTitle") || "", this.editor = t3, this.config = i2, this.am = o3, o3.setTarget(n3.target), o3.onClick(n3.onClick), o3.onDblClick(n3.onDblClick), o3.onSelect(n3.onSelect), o3.__behaviour({ select: c, types: a, options: n3 }), i2.custom)
this.rendered = this.rendered || (0, r.ut)("div"), this.rendered.className = "".concat(i2.stylePrefix, "custom-wrp"), o3.__behaviour({ container: this.rendered }), o3.__trgCustom();
else {
if (!this.rendered || a) {
var u = o3.getAll().filter(function(t4) {
return t4;
});
a && a.length && (u = u.filter(function(t4) {
return -1 !== a.indexOf(t4.get("type"));
})), o3.render(u), this.rendered = o3.getContainer();
}
if (l) {
var p = this.rendered.querySelector("input#".concat(i2.stylePrefix, "uploadFile"));
p && p.setAttribute("accept", l);
}
}
return this.open(this.rendered), this;
}, stop: function(t3) {
this.editor = t3, this.close(this.rendered);
} };
}, 117: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => i });
var o2 = n2(50), r = n2(491);
const i = { open: function() {
var t3 = this, e3 = t3.container, n3 = t3.editor, r2 = t3.bm, i2 = t3.config, s = i2.custom, a = i2.appendTo;
if ((0, o2.isFunction)(s.open))
return s.open(r2.__customData());
if (this.firstRender && !a) {
var l = "views-container", c = n3.Panels;
(c.getPanel(l) || c.addPanel({ id: l })).set("appendContent", e3).trigger("change:appendContent"), s || e3.appendChild(r2.render());
}
e3 && (e3.style.display = "block");
}, close: function() {
var t3 = this.container, e3 = this.config.custom;
if ((0, o2.isFunction)(e3.close))
return e3.close(this.bm.__customData());
t3 && (t3.style.display = "none");
}, run: function(t3) {
var e3 = t3.Blocks;
this.config = e3.getConfig(), this.firstRender = !this.container, this.container = this.container || (0, r.ut)("div"), this.editor = t3, this.bm = e3;
var n3 = this.container;
e3.__behaviour({ container: n3 }), this.config.custom && e3.__trgCustom(), this.open();
}, stop: function() {
this.close();
} };
}, 614: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => o2 });
const o2 = { run: function(t3) {
var e3 = t3.LayerManager, n3 = t3.Panels, o3 = e3.getConfig();
if (!o3.appendTo) {
if (!this.layers) {
var r = "views-container", i = document.createElement("div"), s = n3.getPanel(r) || n3.addPanel({ id: r });
o3.custom ? e3.__trgCustom({ container: i }) : i.appendChild(e3.render()), s.set("appendContent", i).trigger("change:appendContent"), this.layers = i;
}
this.layers.style.display = "block";
}
}, stop: function() {
var t3 = this.layers;
t3 && (t3.style.display = "none");
} };
}, 801: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => r });
var o2 = n2(895);
const r = { run: function(t3, e3) {
if (this.sender = e3, !this.$cn) {
var n3 = t3.getConfig(), r2 = t3.Panels, i = "change:appendContent";
this.$cn = (0, o2["default"])(""), this.$cn2 = (0, o2["default"])(""), this.$cn.append(this.$cn2);
var s = t3.DeviceManager;
if (s && n3.showDevices) {
var a = r2.addPanel({ id: "devices-c" }), l = s.render();
a.set("appendContent", l).trigger(i);
}
var c = t3.SelectorManager;
this.slm = c;
var u = c.getConfig();
u.custom ? c.__trgCustom({ container: this.$cn2.get(0) }) : u.appendTo || this.$cn2.append(c.render([]));
var p = t3.StyleManager;
this.sm = p;
var d = p.getConfig(), f = d.stylePrefix;
this.$header = (0, o2["default"])('")), this.$cn.append(this.$header), d.custom ? p.__trgCustom({ container: this.$cn2.get(0) }) : d.appendTo || this.$cn2.append(p.render());
var h = "views-container";
this.panel = r2.getPanel(h), this.panel || (this.panel = r2.addPanel({ id: h })), this.panel.set("appendContent", this.$cn).trigger(i), this.em = t3.getModel(), this.listenTo(this.em, p.events.target, this.toggleSm);
}
this.toggleSm();
}, toggleSm: function() {
var t3, e3, n3, o3, r2 = this.sender, i = this.sm;
r2 && r2.get && !r2.get("active") || !i || (i.getSelected() ? (null === (t3 = this.$cn2) || void 0 === t3 || t3.show(), null === (e3 = this.$header) || void 0 === e3 || e3.hide()) : (null === (n3 = this.$cn2) || void 0 === n3 || n3.hide(), null === (o3 = this.$header) || void 0 === o3 || o3.show()));
}, stop: function() {
var t3, e3;
null === (t3 = this.$cn2) || void 0 === t3 || t3.hide(), null === (e3 = this.$header) || void 0 === e3 || e3.hide();
} };
}, 395: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => r });
var o2 = n2(895);
const r = { run: function(t3, e3) {
this.sender = e3;
var n3, r2 = t3.getModel(), i = t3.Config.stylePrefix, s = t3.TraitManager, a = s.getConfig();
if (!a.appendTo) {
if (!this.$cn) {
this.$cn = (0, o2["default"])(""), this.$cn2 = (0, o2["default"])(""), this.$cn.append(this.$cn2), this.$header = (0, o2["default"])("").append('")), this.$cn.append(this.$header), this.$cn2.append('
').concat(r2.t("traitManager.label"), "
")), this.$cn2.append(s.render());
var l = t3.Panels;
null == (n3 = l.getPanel("views-container") ? l.getPanel("views-container") : l.addPanel({ id: "views-container" })) || n3.set("appendContent", this.$cn.get(0)).trigger("change:appendContent"), this.target = t3.getModel(), this.listenTo(this.target, "component:toggled", this.toggleTm);
}
this.toggleTm();
}
}, toggleTm: function() {
var t3 = this.sender;
t3 && t3.get && !t3.get("active") || (1 === this.target.getSelectedAll().length ? (this.$cn2.show(), this.$header.hide()) : (this.$cn2.hide(), this.$header.show()));
}, stop: function() {
this.$cn2 && this.$cn2.hide(), this.$header && this.$header.hide();
} };
}, 98: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => r });
var o2 = n2(50);
const r = { run: function(t3, e3, n3) {
void 0 === n3 && (n3 = {});
var r2 = t3.getModel().get("clipboard"), i = t3.getSelected();
r2 && i && (t3.getSelectedAll().forEach(function(e4) {
var i2 = e4.collection;
if (i2) {
var s, a = { at: e4.index() + 1, action: n3.action || "paste-component" };
if ((0, o2.contains)(r2, e4) && e4.get("copyable"))
s = i2.add(e4.clone(), a);
else {
var l = r2.filter(function(t4) {
return t4.get("copyable");
}).filter(function(n4) {
return t3.Components.canMove(e4.parent(), n4).result;
});
s = i2.add(l.map(function(t4) {
return t4.clone();
}), a);
}
(s = (0, o2.isArray)(s) ? s : [s]).forEach(function(e5) {
return t3.trigger("component:paste", e5);
});
}
}), i.emitUpdate());
} };
}, 129: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => s });
var o2 = n2(50), r = function(t3, e3, n3) {
if (n3 || 2 === arguments.length)
for (var o3, r2 = 0, i2 = e3.length; r2 < i2; r2++)
!o3 && r2 in e3 || (o3 || (o3 = Array.prototype.slice.call(e3, 0, r2)), o3[r2] = e3[r2]);
return t3.concat(o3 || Array.prototype.slice.call(e3));
}, i = "core:component-outline";
const s = { getPanels: function(t3) {
return this.panels || (this.panels = t3.Panels.getPanels()), this.panels;
}, preventDrag: function(t3) {
t3.abort = 1;
}, tglEffects: function(t3) {
var e3 = this.em, n3 = t3 ? "on" : "off";
if (e3) {
var r2 = e3.Canvas, i2 = r2.getBody(), s2 = r2.getToolbarEl();
s2 && (s2.style.display = t3 ? "none" : "");
var a = i2.querySelectorAll(".".concat(this.ppfx, "no-pointer"));
(0, o2.each)(a, function(e4) {
return e4.style.pointerEvents = t3 ? "all" : "";
}), e3[n3]("run:tlb-move:before", this.preventDrag);
}
}, run: function(t3, e3) {
var n3 = this;
this.sender = e3, this.selected = r([], t3.getSelectedAll(), true), t3.select(), this.shouldRunSwVisibility || (this.shouldRunSwVisibility = t3.Commands.isActive(i)), this.shouldRunSwVisibility && t3.stopCommand(i), t3.getModel().stopDefault();
var o3 = this.getPanels(t3), s2 = t3.Canvas.getElement(), a = t3.getEl(), l = t3.Config.stylePrefix;
if (!this.helper) {
var c = document.createElement("span");
c.className = "".concat(l, "off-prv fa fa-eye-slash"), a.appendChild(c), c.onclick = function() {
return n3.stopCommand();
}, this.helper = c;
}
this.helper.style.display = "inline-block", o3.forEach(function(t4) {
return t4.set("visible", false);
});
var u = s2.style;
u.width = "100%", u.height = "100%", u.top = "0", u.left = "0", u.padding = "0", u.margin = "0", t3.refresh(), this.tglEffects(1);
}, stop: function(t3) {
var e3 = this.sender, n3 = void 0 === e3 ? {} : e3, o3 = this.selected;
n3.set && n3.set("active", 0);
var r2 = this.getPanels(t3);
this.shouldRunSwVisibility && (t3.runCommand(i), this.shouldRunSwVisibility = false), t3.getModel().runDefault(), r2.forEach(function(t4) {
return t4.set("visible", true);
}), t3.Canvas.getElement().setAttribute("style", ""), o3 && t3.select(o3), delete this.selected, this.helper && (this.helper.style.display = "none"), t3.refresh(), this.tglEffects();
} };
}, 116: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => r });
var o2 = function() {
return o2 = Object.assign || function(t3) {
for (var e3, n3 = 1, o3 = arguments.length; n3 < o3; n3++)
for (var r2 in e3 = arguments[n3])
Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]);
return t3;
}, o2.apply(this, arguments);
};
const r = { run: function(t3, e3, n3) {
var r2 = n3 || {}, i = t3.Canvas, s = i.getCanvasView(), a = o2({ appendTo: i.getResizerEl(), prefix: t3.getConfig().stylePrefix, posFetcher: s.getElementPos.bind(s), mousePosFetcher: i.getMouseRelativePos }, r2.options || {}), l = this.canvasResizer;
return l && !r2.forceNew || (this.canvasResizer = new t3.Utils.Resizer(a), l = this.canvasResizer), l.setOptions(a, true), l.blur(), l.focus(r2.el), l;
}, stop: function() {
var t3;
null === (t3 = this.canvasResizer) || void 0 === t3 || t3.blur();
} };
}, 407: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => C });
var o2, r = n2(50), i = n2(895), s = n2(346), a = (o2 = function(t3, e3) {
return o2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) {
t4.__proto__ = e4;
} || function(t4, e4) {
for (var n3 in e4)
Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]);
}, o2(t3, e3);
}, function(t3, e3) {
if ("function" != typeof e3 && null !== e3)
throw new TypeError("Class extends value " + String(e3) + " is not a constructor or null");
function n3() {
this.constructor = t3;
}
o2(t3, e3), t3.prototype = null === e3 ? Object.create(e3) : (n3.prototype = e3.prototype, new n3());
});
const l = function(t3) {
function e3() {
return null !== t3 && t3.apply(this, arguments) || this;
}
return a(e3, t3), e3.prototype.defaults = function() {
return { command: "", attributes: {} };
}, e3;
}(s.Hn);
var c = function() {
var t3 = function(e3, n3) {
return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) {
t4.__proto__ = e4;
} || function(t4, e4) {
for (var n4 in e4)
Object.prototype.hasOwnProperty.call(e4, n4) && (t4[n4] = e4[n4]);
}, t3(e3, n3);
};
return function(e3, n3) {
if ("function" != typeof n3 && null !== n3)
throw new TypeError("Class extends value " + String(n3) + " is not a constructor or null");
function o3() {
this.constructor = e3;
}
t3(e3, n3), e3.prototype = null === n3 ? Object.create(n3) : (o3.prototype = n3.prototype, new o3());
};
}(), u = function(t3) {
function e3() {
return null !== t3 && t3.apply(this, arguments) || this;
}
return c(e3, t3), e3;
}(s.FE);
const p = u;
u.prototype.model = l;
var d = n2(330), f = function() {
var t3 = function(e3, n3) {
return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) {
t4.__proto__ = e4;
} || function(t4, e4) {
for (var n4 in e4)
Object.prototype.hasOwnProperty.call(e4, n4) && (t4[n4] = e4[n4]);
}, t3(e3, n3);
};
return function(e3, n3) {
if ("function" != typeof n3 && null !== n3)
throw new TypeError("Class extends value " + String(n3) + " is not a constructor or null");
function o3() {
this.constructor = e3;
}
t3(e3, n3), e3.prototype = null === n3 ? Object.create(n3) : (o3.prototype = n3.prototype, new o3());
};
}(), h = function() {
return h = Object.assign || function(t3) {
for (var e3, n3 = 1, o3 = arguments.length; n3 < o3; n3++)
for (var r2 in e3 = arguments[n3])
Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]);
return t3;
}, h.apply(this, arguments);
};
const g = function(t3) {
function e3(e4) {
var n3 = t3.call(this, e4) || this;
return n3.em = e4.config.em, n3;
}
return f(e3, t3), e3.prototype.events = function() {
return this.model.get("events") || { mousedown: "handleClick" };
}, e3.prototype.attributes = function() {
return this.model.get("attributes");
}, e3.prototype.handleClick = function(t4) {
t4.preventDefault(), t4.stopPropagation();
var e4 = this.em, n3 = e4.Canvas.getFrameEl().getBoundingClientRect(), o3 = n3.left, r2 = n3.top, i2 = h(h({}, t4), { clientX: t4.clientX - o3, clientY: t4.clientY - r2 });
e4.trigger("toolbar:run:before", { event: i2 }), this.execCommand(i2);
}, e3.prototype.execCommand = function(t4) {
var e4 = this.em, n3 = { event: t4 }, o3 = this.model.get("command"), i2 = e4.Editor;
(0, r.isFunction)(o3) && o3(i2, null, n3), (0, r.isString)(o3) && i2.runCommand(o3, n3);
}, e3.prototype.render = function() {
var t4 = this, e4 = t4.em, n3 = t4.$el, o3 = t4.model, r2 = o3.get("id"), i2 = o3.get("label"), s2 = e4.getConfig().stylePrefix;
return n3.addClass("".concat(s2, "toolbar-item")), r2 && n3.addClass("".concat(s2, "toolbar-item__").concat(r2)), i2 && n3.append(i2), this;
}, e3;
}(s.G7);
var v = function() {
var t3 = function(e3, n3) {
return t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) {
t4.__proto__ = e4;
} || function(t4, e4) {
for (var n4 in e4)
Object.prototype.hasOwnProperty.call(e4, n4) && (t4[n4] = e4[n4]);
}, t3(e3, n3);
};
return function(e3, n3) {
if ("function" != typeof n3 && null !== n3)
throw new TypeError("Class extends value " + String(n3) + " is not a constructor or null");
function o3() {
this.constructor = e3;
}
t3(e3, n3), e3.prototype = null === n3 ? Object.create(n3) : (o3.prototype = n3.prototype, new o3());
};
}(), y = function(t3) {
function e3(e4) {
var n3 = t3.call(this, e4) || this, o3 = e4.em;
return n3.em = o3, n3.config = { em: o3 }, n3.listenTo(n3.collection, "reset", n3.render), n3;
}
return v(e3, t3), e3.prototype.onRender = function() {
var t4 = this.em.config.stylePrefix;
this.el.className = "".concat(t4, "toolbar-items");
}, e3;
}(d.Z);
const m = y;
y.prototype.itemView = g;
var b, _ = n2(491), w = n2(163), x = function() {
return x = Object.assign || function(t3) {
for (var e3, n3 = 1, o3 = arguments.length; n3 < o3; n3++)
for (var r2 in e3 = arguments[n3])
Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]);
return t3;
}, x.apply(this, arguments);
};
const C = { init: function(t3) {
(0, r.bindAll)(this, "onHover", "onOut", "onClick", "onFrameScroll", "onFrameUpdated", "onContainerChange");
}, enable: function() {
this.frameOff = this.canvasOff = this.adjScroll = null, this.startSelectComponent(), b = true;
}, startSelectComponent: function() {
this.toggleSelectComponent(1), this.em.getSelected() && this.onSelect();
}, stopSelectComponent: function() {
this.toggleSelectComponent();
}, toggleSelectComponent: function(t3) {
var e3 = this, n3 = this.em, o3 = n3.getConfig().listenToEl, r2 = n3.getContainer().parentNode, i2 = t3 ? "on" : "off", s2 = { on: w.on, off: w.off };
!o3.length && r2 && o3.push(r2);
s2[i2](window, "resize", this.onFrameUpdated), s2[i2](o3, "scroll", this.onContainerChange), n3[i2]("component:toggled component:update undo redo", this.onSelect, this), n3[i2]("change:componentHovered", this.onHovered, this), n3[i2]("component:resize styleable:change component:input", this.updateGlobalPos, this), n3[i2]("component:update:toolbar", this._upToolbar, this), n3[i2]("change:canvasOffset", this.updateAttached, this), n3[i2]("frame:updated", this.onFrameUpdated, this), n3[i2]("canvas:updateTools", this.onFrameUpdated, this), n3.Canvas.getFrames().forEach(function(t4) {
var n4 = t4.view, o4 = null == n4 ? void 0 : n4.getWindow();
o4 && function(t5, n5) {
s2[i2](n5, "mouseover", e3.onHover), s2[i2](n5, "mouseleave", e3.onOut), s2[i2](n5, "click", e3.onClick), s2[i2](t5, "scroll", e3.onFrameScroll, true);
}(o4, null == n4 ? void 0 : n4.getBody());
});
}, onHover: function(t3) {
t3.stopPropagation();
var e3 = this.em, n3 = t3.target, o3 = (0, w.getViewEl)(n3), r2 = o3 && o3._getFrame(), s2 = (0, i["default"])(n3), a2 = s2.data("model");
if (!a2)
for (var l2 = s2.parent(); !a2 && l2.length && !(0, _.Mx)(l2[0]); )
a2 = l2.data("model"), l2 = l2.parent();
this.currentDoc = n3.ownerDocument, e3.setHovered(a2, { useValid: true }), r2 && e3.set("currentFrame", r2);
}, onFrameUpdated: function() {
this.updateLocalPos(), this.updateGlobalPos();
}, onHovered: function(t3, e3) {
var n3, o3 = this, r2 = {};
e3 ? null === (n3 = e3.views) || void 0 === n3 || n3.forEach(function(t4) {
var n4 = t4.el, i2 = o3.getElementPos(n4);
r2 = { el: n4, pos: i2, component: e3, view: (0, w.getViewEl)(n4) }, o3.updateToolsLocal(r2), n4.ownerDocument === o3.currentDoc && (o3.elHovered = r2);
}) : (this.currentDoc = null, this.elHovered = 0, this.updateToolsLocal(), this.canvas.getFrames().forEach(function(t4) {
var e4 = t4.view, n4 = e4 && e4.getToolsEl();
n4 && o3.toggleToolsEl(0, 0, { el: n4 });
}));
}, onSelect: (0, r.debounce)(function() {
var t3 = this.em, e3 = t3.getSelected(), n3 = t3.get("currentFrame") || {}, o3 = e3 && e3.getView(n3.model), r2 = o3 && o3.el, i2 = {};
r2 && (0, _.pn)(r2) && (i2 = { el: r2, pos: this.getElementPos(r2), component: e3, view: (0, w.getViewEl)(r2) });
this.elSelected = i2, this.updateToolsGlobal(), this.updateLocalPos(i2), this.initResize(e3);
}, 0), updateGlobalPos: function() {
var t3 = this.getElSelected();
t3.el && (t3.pos = this.getElementPos(t3.el), this.updateToolsGlobal());
}, updateLocalPos: function(t3) {
var e3 = this.getElHovered();
e3.el && (e3.pos = this.getElementPos(e3.el), this.updateToolsLocal(t3));
}, getElHovered: function() {
return this.elHovered || {};
}, getElSelected: function() {
return this.elSelected || {};
}, onOut: function() {
this.em.setHovered(0);
}, toggleToolsEl: function(t3, e3, n3) {
void 0 === n3 && (n3 = {});
var o3 = n3.el || this.canvas.getToolsEl(e3);
return o3 && (o3.style.display = t3 ? "" : "none"), o3 || {};
}, showElementOffset: function(t3, e3, n3) {
void 0 === n3 && (n3 = {}), b && this.editor.runCommand("show-offset", { el: t3, elPos: e3, view: n3.view, force: 1, top: 0, left: 0 });
}, hideElementOffset: function(t3) {
this.editor.stopCommand("show-offset", { view: t3 });
}, showFixedElementOffset: function(t3, e3) {
this.editor.runCommand("show-offset", { el: t3, elPos: e3, state: "Fixed" });
}, hideFixedElementOffset: function() {
this.editor && this.editor.stopCommand("show-offset", { state: "Fixed" });
}, hideHighlighter: function(t3) {
this.canvas.getHighlighter(t3).style.opacity = 0;
}, onClick: function(t3) {
t3.stopPropagation(), t3.preventDefault();
var e3 = this.em;
if (e3.get("_cmpDrag"))
return e3.set("_cmpDrag");
var n3 = (0, i["default"])(t3.target), o3 = n3.data("model");
if (!o3)
for (var r2 = n3.parent(); !o3 && r2.length && !(0, _.Mx)(r2[0]); )
o3 = r2.data("model"), r2 = r2.parent();
if (o3) {
if (e3.isEditing() && !o3.get("textable") && o3.isChildOf("text"))
return;
this.select(o3, t3);
}
}, select: function(t3, e3) {
void 0 === e3 && (e3 = {}), t3 && (this.editor.select(t3, { event: e3, useValid: true }), this.initResize(t3));
}, updateBadge: function(t3, e3, n3) {
void 0 === n3 && (n3 = {});
var o3 = this.canvas, r2 = (0, i["default"])(t3).data("model");
if (r2 && r2.get("badgable")) {
var s2 = this.getBadge(n3);
if (!n3.posOnly) {
var a2 = this.canvas.getConfig(), l2 = r2.getIcon(), c2 = a2.pStylePrefix || "", u2 = "".concat(c2, "badge"), p2 = a2.customBadgeLabel, d2 = "".concat(l2 ? '
').concat(l2, "
") : "", '\n
').concat(r2.getName(), "
");
s2.innerHTML = p2 ? p2(r2) : d2;
}
var f2 = "px", h2 = s2.style;
h2.display = "block";
var g2 = o3.getTargetToElementFixed(t3, s2, { pos: e3 }).top, v2 = n3.leftOff < 0 ? -n3.leftOff : 0;
h2.top = g2 + f2, h2.left = v2 + f2;
}
}, showHighlighter: function(t3) {
this.canvas.getHighlighter(t3).style.opacity = "";
}, initResize: function(t3) {
var e3, n3 = this.em, o3 = this.canvas, i2 = null == n3 ? void 0 : n3.Editor, s2 = (null == n3 ? void 0 : n3.config).stylePrefix || "", a2 = "".concat(s2, "resizing"), l2 = !(0, r.isElement)(t3) && (0, w.isTaggableNode)(t3) ? t3 : n3.getSelected(), c2 = l2 && l2.get("resizable"), u2 = {}, p2 = function(t4, e4, n4) {
var o4 = n4.docs;
o4 && o4.forEach(function(e5) {
var n5 = e5.body, o5 = n5.className || "";
n5.className = ("add" == t4 ? "".concat(o5, " ").concat(a2) : o5.replace(a2, "")).trim();
});
};
if (i2 && c2) {
var d2 = (0, r.isElement)(t3) ? t3 : l2.getEl();
u2 = { onStart: function(t4, r2) {
void 0 === r2 && (r2 = {});
var i3 = r2.el, s3 = r2.config, a3 = r2.resizer, c3 = s3.keyHeight, u3 = s3.keyWidth, d3 = s3.currentUnit, f2 = s3.keepAutoHeight, h2 = s3.keepAutoWidth;
p2("add", 0, r2), e3 = n3.Styles.getModelToStyle(l2), o3.toggleFramesEvents(false);
var g2 = getComputedStyle(i3), v2 = e3.getStyle(), y2 = v2[u3];
s3.autoWidth = h2 && "auto" === y2, isNaN(parseFloat(y2)) && (y2 = g2[u3]);
var m2 = v2[c3];
s3.autoHeight = f2 && "auto" === m2, isNaN(parseFloat(m2)) && (m2 = g2[c3]), a3.startDim.w = parseFloat(y2), a3.startDim.h = parseFloat(m2), b = false, d3 && (s3.unitHeight = (0, w.getUnitFromValue)(m2), s3.unitWidth = (0, w.getUnitFromValue)(y2));
}, onMove: function() {
i2.trigger("component:resize");
}, onEnd: function(t4, e4) {
p2("remove", 0, e4), i2.trigger("component:resize"), o3.toggleFramesEvents(true), b = true;
}, updateTarget: function(t4, r2, i3) {
if (void 0 === i3 && (i3 = {}), e3) {
var s3 = i3.store, a3 = i3.selectedHandler, c3 = i3.config, u3 = c3.keyHeight, p3 = c3.keyWidth, d3 = c3.autoHeight, f2 = c3.autoWidth, h2 = c3.unitWidth, g2 = c3.unitHeight, v2 = ["tc", "bc"].indexOf(a3) >= 0, y2 = ["cl", "cr"].indexOf(a3) >= 0, m2 = {};
if (!v2) {
var b2 = o3.getBody().offsetWidth, _2 = r2.w < b2 ? r2.w : b2;
m2[p3] = f2 ? "auto" : "".concat(_2).concat(h2);
}
y2 || (m2[u3] = d3 ? "auto" : "".concat(r2.h).concat(g2)), n3.getDragMode(l2) && (m2.top = "".concat(r2.t).concat(g2), m2.left = "".concat(r2.l).concat(h2));
var w2 = x(x({}, m2), { __p: !s3 });
e3.addStyle(w2, { avoidStore: !s3 }), n3.Styles.__emitCmpStyleUpdate(w2, { components: n3.getSelected() });
}
} }, "object" == typeof c2 && (u2 = x(x(x({}, u2), c2), { parent: u2 })), this.resizer = i2.runCommand("resize", { el: d2, options: u2, force: 1 });
} else
i2.stopCommand("resize"), this.resizer = null;
}, updateToolbar: function(t3) {
var e3 = this.config.em, n3 = t3 == e3 ? e3.getSelected() : t3, o3 = this.canvas.getToolbarEl(), r2 = o3.style, i2 = n3.get("toolbar"), s2 = e3.config.showToolbar;
if (n3 && s2 && i2 && i2.length) {
if (r2.display = "", !this.toolbar) {
o3.innerHTML = "", this.toolbar = new p(i2);
var a2 = new m({ collection: this.toolbar, em: e3 });
o3.appendChild(a2.render().el);
}
this.toolbar.reset(i2), r2.top = "-100px", r2.left = "0";
} else
r2.display = "none";
}, updateToolbarPos: function(t3) {
var e3 = "px", n3 = this.canvas.getToolbarEl().style;
n3.top = "".concat(t3.top).concat(e3), n3.left = "".concat(t3.left).concat(e3), n3.opacity = "";
}, getCanvasPosition: function() {
return this.canvas.getCanvasView().getPosition();
}, getBadge: function(t3) {
return void 0 === t3 && (t3 = {}), this.canvas.getBadgeEl(t3.view);
}, onFrameScroll: function() {
this.updateTools();
}, updateTools: function() {
this.updateLocalPos(), this.updateGlobalPos();
}, isCompSelected: function(t3) {
return t3 && "selected" === t3.get("status");
}, updateToolsLocal: function(t3) {
var e3 = this.em.getConfig(), n3 = t3 || this.getElHovered(), o3 = n3.el, r2 = n3.pos, i2 = n3.view, s2 = n3.component;
if (o3) {
var a2 = s2.get("hoverable"), l2 = this.lastHovered !== o3, c2 = l2 ? {} : { posOnly: 1 };
l2 && a2 && (this.lastHovered = o3, this.showHighlighter(i2), this.showElementOffset(o3, r2, { view: i2 })), this.isCompSelected(s2) && (this.hideHighlighter(i2), !e3.showOffsetsSelected && this.hideElementOffset(i2));
var u2 = "px", p2 = this.toggleToolsEl(1, i2), d2 = p2.style, f2 = this.canvas.canvasRectOffset(o3, r2), h2 = f2.top, g2 = f2.left;
this.updateBadge(o3, r2, x(x({}, c2), { view: i2, topOff: h2, leftOff: g2 })), d2.top = h2 + u2, d2.left = g2 + u2, d2.width = r2.width + u2, d2.height = r2.height + u2, this._trgToolUp("local", { component: s2, el: p2, top: h2, left: g2, width: r2.width, height: r2.height });
} else
this.lastHovered = 0;
}, _upToolbar: (0, r.debounce)(function() {
this.updateToolsGlobal({ force: 1 });
}, 0), _trgToolUp: function(t3, e3) {
void 0 === e3 && (e3 = {}), this.em.trigger("canvas:tools:update", x({ type: t3 }, e3));
}, updateToolsGlobal: function(t3) {
void 0 === t3 && (t3 = {});
var e3 = this.getElSelected(), n3 = e3.el, o3 = e3.pos, r2 = e3.component;
if (!n3)
return this.toggleToolsEl(), void (this.lastSelected = 0);
var i2 = this.canvas;
(this.lastSelected !== n3 || t3.force) && (this.lastSelected = n3, this.updateToolbar(r2));
var s2 = "px", a2 = this.toggleToolsEl(1), l2 = a2.style, c2 = i2.getTargetToElementFixed(n3, i2.getToolbarEl(), { pos: o3 }), u2 = c2.canvasOffsetTop, p2 = c2.canvasOffsetLeft;
l2.top = u2 + s2, l2.left = p2 + s2, l2.width = o3.width + s2, l2.height = o3.height + s2, this.updateToolbarPos({ top: c2.top, left: c2.left }), this._trgToolUp("global", { component: r2, el: a2, top: u2, left: p2, width: o3.width, height: o3.height });
}, updateAttached: (0, r.debounce)(function() {
this.updateGlobalPos();
}, 0), onContainerChange: (0, r.debounce)(function() {
this.em.refreshCanvas();
}, 150), getElementPos: function(t3) {
return this.canvas.getCanvasView().getElementPos(t3, { noScroll: true });
}, hideBadge: function() {
this.getBadge().style.display = "none";
}, cleanPrevious: function(t3) {
t3 && t3.set({ status: "", state: "" });
}, getContentWindow: function() {
return this.canvas.getWindow();
}, run: function(t3) {
(0, w.hasWin)() && (this.editor = t3 && t3.get("Editor"), this.enable());
}, stop: function(t3, e3, n3) {
if (void 0 === n3 && (n3 = {}), (0, w.hasWin)()) {
var o3 = this.em, r2 = this.editor;
this.onHovered(), this.stopSelectComponent(), !n3.preserveSelected && o3.setSelected(), this.toggleToolsEl(), r2 && r2.stopCommand("resize");
}
} };
}, 189: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => r });
var o2 = n2(895);
const r = { startSelectPosition: function(t3, e3, n3) {
var o3 = this;
void 0 === n3 && (n3 = {}), this.isPointed = false;
var r2 = this.em.Utils, i = t3.ownerDocument.body;
r2 && !this.sorter && (this.sorter = new r2.Sorter({ container: i, placer: this.canvas.getPlacerEl(), containerSel: "*", itemSel: "*", pfx: this.ppfx, direction: "a", document: e3, wmargin: 1, nested: 1, em: this.em, canvasRelative: 1, scale: function() {
return o3.em.getZoomDecimal();
} })), n3.onStart && (this.sorter.onStart = n3.onStart), t3 && this.sorter.startSort(t3, { container: i });
}, getOffsetDim: function() {
var t3 = this.offset(this.canvas.getFrameEl()), e3 = this.offset(this.canvas.getElement());
return { top: t3.top - e3.top, left: t3.left - e3.left };
}, stopSelectPosition: function() {
this.posTargetCollection = null, this.posIndex = "after" == this.posMethod && 0 !== this.cDim.length ? this.posIndex + 1 : this.posIndex, this.sorter && (this.sorter.moved = 0, this.sorter.endMove()), this.cDim && (this.posIsLastEl = 0 !== this.cDim.length && "after" == this.posMethod && this.posIndex == this.cDim.length, this.posTargetEl = 0 === this.cDim.length ? (0, o2["default"])(this.outsideElem) : !this.posIsLastEl && this.cDim[this.posIndex] ? (0, o2["default"])(this.cDim[this.posIndex][5]).parent() : (0, o2["default"])(this.outsideElem), this.posTargetModel = this.posTargetEl.data("model"), this.posTargetCollection = this.posTargetEl.data("model-comp"));
}, enable: function() {
this.startSelectPosition();
}, nearFloat: function(t3, e3, n3) {
var o3 = t3 || 0, r2 = e3 || "before", i = n3.length, s = 0 !== i && "after" == r2 && o3 == i;
return 0 !== i && (!s && !n3[o3][4] || n3[o3 - 1] && !n3[o3 - 1][4] || s && !n3[o3 - 1][4]) ? 1 : 0;
}, run: function() {
this.enable();
}, stop: function() {
this.stopSelectPosition(), this.$wrapper.css("cursor", ""), this.$wrapper.unbind();
} };
}, 804: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => a });
var o2 = n2(50), r = n2(895), i = n2(163), s = function() {
return s = Object.assign || function(t3) {
for (var e3, n3 = 1, o3 = arguments.length; n3 < o3; n3++)
for (var r2 in e3 = arguments[n3])
Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]);
return t3;
}, s.apply(this, arguments);
};
const a = { getOffsetMethod: function(t3) {
return "get" + (t3 || "") + "OffsetViewerEl";
}, run: function(t3, e3, n3) {
var a2 = n3 || {}, l = a2.state || "", c = t3.getConfig(), u = this.em.getZoomDecimal(), p = a2.el || "";
if (!c.showOffsets || (0, i.isTextNode)(p) || !c.showOffsetsSelected && "Fixed" == l)
t3.stopCommand("".concat(this.id), n3);
else {
var d = t3.Canvas, f = s({}, a2.elPos || d.getElementPos(p));
(0, o2.isUndefined)(a2.top) || (f.top = a2.top), (0, o2.isUndefined)(a2.left) || (f.left = a2.left);
var h = window.getComputedStyle(p), g = this.ppfx, v = l + "State", y = d[this.getOffsetMethod(l)](n3.view);
y.style.opacity = "";
var m = this["marginT" + l], b = this["marginB" + l], _ = this["marginL" + l], w = this["marginR" + l], x = this["padT" + l], C = this["padB" + l], S = this["padL" + l], O = this["padR" + l];
if (y.childNodes.length && (this[v] = "1", m = y.querySelector("[data-offset-m-t]"), b = y.querySelector("[data-offset-m-b]"), _ = y.querySelector("[data-offset-m-l]"), w = y.querySelector("[data-offset-m-r]"), x = y.querySelector("[data-offset-p-t]"), C = y.querySelector("[data-offset-p-b]"), S = y.querySelector("[data-offset-p-l]"), O = y.querySelector("[data-offset-p-r]")), !this[v]) {
var T = l.toLowerCase(), k = T + "margin-v", P = T + "padding-v", E = (0, r["default"])('
')).get(0), A = (0, r["default"])('
')).get(0), j = g + P + "-el", M = "".concat(g + k + "-el", " ").concat(g + k), L = "".concat(j, " ").concat(g + P);
m = (0, r["default"])('
')).get(0), b = (0, r["default"])('
')).get(0), _ = (0, r["default"])('
')).get(0), w = (0, r["default"])('
')).get(0), x = (0, r["default"])('
')).get(0), C = (0, r["default"])('
')).get(0), S = (0, r["default"])('
')).get(0), O = (0, r["default"])('
')).get(0), this["marginT" + l] = m, this["marginB" + l] = b, this["marginL" + l] = _, this["marginR" + l] = w, this["padT" + l] = x, this["padB" + l] = C, this["padL" + l] = S, this["padR" + l] = O, E.appendChild(m), E.appendChild(b), E.appendChild(_), E.appendChild(w), A.appendChild(x), A.appendChild(C), A.appendChild(S), A.appendChild(O), y.appendChild(E), y.appendChild(A), this[v] = "1";
}
var D = "px", N = parseFloat(h.marginLeft.replace(D, "")) * u, I = parseFloat(h.marginRight.replace(D, "")) * u, F = parseFloat(h.marginTop.replace(D, "")) * u, V = parseFloat(h.marginBottom.replace(D, "")) * u, R = m.style, H = b.style, z = _.style, B = w.style, U = x.style, W = C.style, $ = S.style, q = O.style, G = parseFloat(f.left), K = parseFloat(h.width) * u + D;
R.height = F + D, R.width = K, R.top = f.top - F + D, R.left = G + D, H.height = V + D, H.width = K, H.top = f.top + f.height + D, H.left = G + D;
var Y = f.height + F + V + D, X = f.top - F + D;
z.height = Y, z.width = N + D, z.top = X, z.left = G - N + D, B.height = Y, B.width = I + D, B.top = X, B.left = G + f.width + D;
var J = parseFloat(h.paddingTop) * u;
U.height = J + D;
var Z = parseFloat(h.paddingBottom) * u;
W.height = Z + D;
var Q = f.height - Z - J + D, tt = f.top + J + D;
$.height = Q, $.width = parseFloat(h.paddingLeft) * u + D, $.top = tt;
var et = parseFloat(h.paddingRight) * u;
q.height = Q, q.width = et + D, q.top = tt;
}
}, stop: function(t3, e3, n3) {
void 0 === n3 && (n3 = {});
var o3 = (n3 || {}).state || "", r2 = this.getOffsetMethod(o3);
t3.Canvas[r2](n3.view).style.opacity = 0;
} };
}, 434: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => r });
var o2 = n2(50);
const r = { init: function() {
(0, o2.bindAll)(this, "_onFramesChange");
}, run: function(t3) {
this.toggleVis(t3);
}, stop: function(t3) {
this.toggleVis(t3, 0);
}, toggleVis: function(t3, e3) {
var n3 = this;
if (void 0 === e3 && (e3 = 1), !t3.Commands.isActive("preview")) {
var o3 = t3.Canvas, r2 = e3 ? "on" : "off";
o3.getFrames().forEach(function(t4) {
return n3._upFrame(t4, e3);
}), o3.getModel()[r2]("change:frames", this._onFramesChange);
}
}, _onFramesChange: function(t3, e3) {
var n3 = this;
e3.forEach(function(t4) {
return t4.once("loaded", function() {
return n3._upFrame(t4, true);
});
});
}, _upFrame: function(t3, e3) {
var n3, o3 = e3 ? "add" : "remove";
null === (n3 = t3.view) || void 0 === n3 || n3.getBody().classList[o3]("".concat(this.ppfx, "dashed"));
} };
}, 346: (t2, e2, n2) => {
n2.d(e2, { FE: () => l, G7: () => c, Hn: () => a });
var o2, r = n2(316), i = n2.n(r), s = (o2 = function(t3, e3) {
return o2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) {
t4.__proto__ = e4;
} || function(t4, e4) {
for (var n3 in e4)
Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]);
}, o2(t3, e3);
}, function(t3, e3) {
if ("function" != typeof e3 && null !== e3)
throw new TypeError("Class extends value " + String(e3) + " is not a constructor or null");
function n3() {
this.constructor = t3;
}
o2(t3, e3), t3.prototype = null === e3 ? Object.create(e3) : (n3.prototype = e3.prototype, new n3());
}), a = function(t3) {
function e3() {
return null !== t3 && t3.apply(this, arguments) || this;
}
return s(e3, t3), e3;
}(i().Model), l = function(t3) {
function e3() {
return null !== t3 && t3.apply(this, arguments) || this;
}
return s(e3, t3), e3;
}(i().Collection), c = function(t3) {
function e3() {
return null !== t3 && t3.apply(this, arguments) || this;
}
return s(e3, t3), e3;
}(i().View);
}, 330: (t2, e2, n2) => {
n2.d(e2, { Z: () => l });
var o2, r = n2(50), i = n2(346), s = (o2 = function(t3, e3) {
return o2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e4) {
t4.__proto__ = e4;
} || function(t4, e4) {
for (var n3 in e4)
Object.prototype.hasOwnProperty.call(e4, n3) && (t4[n3] = e4[n3]);
}, o2(t3, e3);
}, function(t3, e3) {
if ("function" != typeof e3 && null !== e3)
throw new TypeError("Class extends value " + String(e3) + " is not a constructor or null");
function n3() {
this.constructor = t3;
}
o2(t3, e3), t3.prototype = null === e3 ? Object.create(e3) : (n3.prototype = e3.prototype, new n3());
}), a = function(t3) {
function e3(e4, n3, o3) {
void 0 === e4 && (e4 = {}), void 0 === o3 && (o3 = false);
var r2 = t3.call(this, e4) || this;
return r2.itemsView = "", r2.itemType = "type", r2.reuseView = false, r2.config = n3 || e4.config || {}, o3 && r2.listenTo(r2.collection, "add", r2.addTo), r2.items = [], r2;
}
return s(e3, t3), e3.prototype.addTo = function(t4) {
this.add(t4);
}, e3.prototype.itemViewNotFound = function(t4) {
var e4 = this.config, n3 = this.ns, o3 = e4.em, r2 = "".concat(n3 ? "[".concat(n3, "]: ") : "", "'").concat(t4, "' type not found");
o3 && o3.logWarning(r2);
}, e3.prototype.add = function(t4, e4) {
var n3, o3 = this, i2 = o3.config, s2 = o3.reuseView, a2 = o3.items, l2 = this.itemsView || {}, c = e4 || null, u = this.itemView, p = t4.get(this.itemType);
l2[p] ? u = l2[p] : !p || l2[p] || (0, r.includes)(["button", "checkbox", "color", "date", "datetime-local", "email", "file", "hidden", "image", "month", "number", "password", "radio", "range", "reset", "search", "submit", "tel", "text", "time", "url", "week"], p) || this.itemViewNotFound(p), n3 = t4.view && s2 ? t4.view : new u({ model: t4, config: i2 }, i2), a2 && a2.push(n3);
var d = n3.render().el;
c ? c.appendChild(d) : this.$el.append(d);
}, e3.prototype.render = function() {
var t4 = document.createDocumentFragment();
return this.clearItems(), this.$el.empty(), this.collection.length && this.collection.each(function(e4) {
this.add(e4, t4);
}, this), this.$el.append(t4), this.onRender(), this;
}, e3.prototype.onRender = function() {
}, e3.prototype.onRemoveBefore = function(t4, e4) {
}, e3.prototype.onRemove = function(t4, e4) {
}, e3.prototype.remove = function(e4) {
void 0 === e4 && (e4 = {});
var n3 = this.items;
return this.onRemoveBefore(n3, e4), this.clearItems(), t3.prototype.remove.call(this), this.onRemove(n3, e4), this;
}, e3.prototype.clearItems = function() {
this.items;
}, e3;
}(i.G7);
const l = a;
a.prototype.itemView = "";
}, 668: (t2, e2, n2) => {
n2.d(e2, { Z: () => a });
var o2 = n2(50), r = n2(163), i = function() {
return i = Object.assign || function(t3) {
for (var e3, n3 = 1, o3 = arguments.length; n3 < o3; n3++)
for (var r2 in e3 = arguments[n3])
Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]);
return t3;
}, i.apply(this, arguments);
}, s = ["x", "y"];
const a = function() {
function t3(t4) {
return void 0 === t4 && (t4 = {}), this.opts = { snapOffset: 5, scale: 1 }, (0, o2.bindAll)(this, "drag", "stop", "keyHandle", "handleScroll"), this.setOptions(t4), this.delta = { x: 0, y: 0 }, this.lastScroll = { x: 0, y: 0 }, this.lastScrollDiff = { x: 0, y: 0 }, this.startPointer = { x: 0, y: 0 }, this.startPosition = { x: 0, y: 0 }, this.globScrollDiff = { x: 0, y: 0 }, this.currentPointer = { x: 0, y: 0 }, this.position = { x: 0, y: 0 }, this.guidesStatic = [], this.guidesTarget = [], this.docs = [], this;
}
return t3.prototype.setOptions = function(t4) {
void 0 === t4 && (t4 = {}), this.opts = i(i({}, this.opts), t4);
}, t3.prototype.toggleDrag = function(t4) {
var e3 = this.getDocumentEl(), n3 = this.getContainerEl(), o3 = this.getWindowEl(), i2 = t4 ? "on" : "off", s2 = { on: r.on, off: r.off };
s2[i2](n3, "mousemove dragover", this.drag), s2[i2](e3, "mouseup dragend touchend", this.stop), s2[i2](e3, "keydown", this.keyHandle), s2[i2](o3, "scroll", this.handleScroll);
}, t3.prototype.handleScroll = function() {
var t4 = this.lastScroll, e3 = this.delta, n3 = this.getScrollInfo(), o3 = { x: n3.x - t4.x, y: n3.y - t4.y };
this.move(e3.x + o3.x, e3.y + o3.y), this.lastScrollDiff = o3;
}, t3.prototype.start = function(t4) {
var e3 = this.opts, n3 = e3.onStart;
this.toggleDrag(true), this.startPointer = this.getPointerPos(t4), this.guidesStatic = (0, o2.result)(e3, "guidesStatic") || [], this.guidesTarget = (0, o2.result)(e3, "guidesTarget") || [], (0, o2.isFunction)(n3) && n3(t4, this), this.startPosition = this.getStartPosition(), this.lastScrollDiff = { x: 0, y: 0 }, this.globScrollDiff = { x: 0, y: 0 }, this.drag(t4);
}, t3.prototype.drag = function(t4) {
var e3 = this, n3 = this, r2 = n3.opts, a2 = n3.lastScrollDiff, l = n3.globScrollDiff, c = r2.onDrag, u = this.startPointer, p = this.getPointerPos(t4), d = { x: l.x + a2.x, y: l.y + a2.y };
this.globScrollDiff = d;
var f = { x: p.x - u.x + d.x, y: p.y - u.y + d.y };
this.lastScrollDiff = { x: 0, y: 0 };
var h = this.lockedAxis;
"x" === (h = t4.shiftKey ? !h && this.detectAxisLock(f.x, f.y) : null) ? f.x = u.x : "y" === h && (f.y = u.y);
var g = function(n4) {
s.forEach(function(t5) {
return n4[t5] = n4[t5] * (0, o2.result)(r2, "scale");
}), e3.delta = n4, e3.move(n4.x, n4.y), (0, o2.isFunction)(c) && c(t4, e3);
}, v = i({}, f);
if (this.currentPointer = p, this.lockedAxis = h, this.lastScroll = this.getScrollInfo(), g(f), this.guidesTarget.length) {
var y = this.snapGuides(v), m = y.newDelta, b = y.trgX, _ = y.trgY;
(b || _) && g(m);
}
0 === t4.which && this.stop(t4);
}, t3.prototype.snapGuides = function(t4) {
var e3 = this, n3 = t4, r2 = this.trgX, i2 = this.trgY;
return this.guidesTarget.forEach(function(n4) {
n4.x && e3.trgX || n4.y && e3.trgY || (n4.active = false, e3.guidesStatic.forEach(function(s2) {
if (!(n4.y && s2.x || n4.x && s2.y)) {
var a2 = n4.y && s2.y, l = a2 ? "y" : "x", c = n4[l], u = s2[l], p = t4[l], d = a2 ? i2 : r2;
if (e3.isPointIn(c, u) && (0, o2.isUndefined)(d)) {
var f = p - (c - u);
e3.setGuideLock(n4, f);
}
}
}));
}), r2 = this.trgX, i2 = this.trgY, s.forEach(function(r3) {
var i3 = r3.toUpperCase(), s2 = e3["trg".concat(i3)];
s2 && !e3.isPointIn(t4[r3], s2.lock) && (e3.setGuideLock(s2, null), s2 = null), s2 && !(0, o2.isUndefined)(s2.lock) && (n3[r3] = s2.lock);
}), { newDelta: n3, trgX: this.trgX, trgY: this.trgY };
}, t3.prototype.isPointIn = function(t4, e3, n3) {
var o3 = (void 0 === n3 ? {} : n3).offset || this.opts.snapOffset || 0;
return t4 >= e3 && t4 <= e3 + o3 || t4 <= e3 && t4 >= e3 - o3;
}, t3.prototype.setGuideLock = function(t4, e3) {
var n3 = (0, o2.isUndefined)(t4.x) ? "Y" : "X", r2 = "trg".concat(n3);
return null !== e3 ? (t4.active = true, t4.lock = e3, this[r2] = t4) : (delete t4.active, delete t4.lock, delete this[r2]), t4;
}, t3.prototype.stop = function(t4, e3) {
void 0 === e3 && (e3 = {});
var n3 = this.delta, r2 = !!e3.cancel, i2 = r2 ? 0 : n3.x, s2 = r2 ? 0 : n3.y;
this.toggleDrag(), this.lockedAxis = null, this.move(i2, s2, true);
var a2 = this.opts.onEnd;
(0, o2.isFunction)(a2) && a2(t4, this, { cancelled: r2 });
}, t3.prototype.keyHandle = function(t4) {
(0, r.isEscKey)(t4) && this.stop(t4, { cancel: true });
}, t3.prototype.move = function(t4, e3, n3) {
var r2 = this.el, i2 = this.opts, s2 = this.startPosition;
if (s2) {
var a2 = i2.setPosition, l = s2.x + t4, c = s2.y + e3;
this.position = { x: l, y: c, end: n3 }, (0, o2.isFunction)(a2) && a2(this.position), r2 && (r2.style.left = "".concat(l, "px"), r2.style.top = "".concat(c, "px"));
}
}, t3.prototype.getContainerEl = function() {
var t4 = this.opts.container;
return t4 ? [t4] : this.getDocumentEl();
}, t3.prototype.getWindowEl = function() {
return this.getContainerEl().map(function(t4) {
var e3 = t4.ownerDocument || t4;
return e3.defaultView || e3.parentWindow;
});
}, t3.prototype.getDocumentEl = function(t4) {
var e3 = this.opts.doc;
if (t4 = t4 || this.el, !this.docs.length) {
var n3 = [document];
t4 && n3.push(t4.ownerDocument), e3 && n3.push(e3), this.docs = n3;
}
return this.docs;
}, t3.prototype.getPointerPos = function(t4) {
var e3 = this.opts.getPointerPosition, n3 = (0, r.getPointerEvent)(t4);
return e3 ? e3(t4) : { x: n3.clientX, y: n3.clientY };
}, t3.prototype.getStartPosition = function() {
var t4 = this.el, e3 = this.opts.getPosition, n3 = { x: 0, y: 0 };
return (0, o2.isFunction)(e3) ? n3 = e3() : t4 && (n3 = { x: parseFloat(t4.style.left), y: parseFloat(t4.style.top) }), n3;
}, t3.prototype.getScrollInfo = function() {
var t4 = this.opts.doc, e3 = t4 && t4.body;
return { y: e3 ? e3.scrollTop : 0, x: e3 ? e3.scrollLeft : 0 };
}, t3.prototype.detectAxisLock = function(t4, e3) {
var n3 = t4, o3 = e3, r2 = Math.abs(n3), i2 = Math.abs(o3);
return o3 >= r2 || o3 <= -r2 ? "x" : n3 > i2 || n3 < -i2 ? "y" : void 0;
}, t3;
}();
}, 895: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { default: () => vt });
var o2 = "undefined" != typeof document ? document : null, r = "undefined" != typeof window ? window : null, i = Array.prototype, s = i.filter, a = i.indexOf, l = i.map, c = i.push, u = i.reverse, p = i.slice, d = i.splice, f = /^#[\w-]*$/, h = /^\.[\w-]*$/, g = /<.+>/, v = /^\w+$/;
function y(t3, e3) {
return void 0 === e3 && (e3 = o2), h.test(t3) ? e3.getElementsByClassName(t3.slice(1)) : v.test(t3) ? e3.getElementsByTagName(t3) : e3.querySelectorAll(t3);
}
function m(t3, e3) {
if (void 0 === e3 && (e3 = o2), t3) {
if (t3.__cash)
return t3;
var n3 = t3;
if (P(t3)) {
if (e3.__cash && (e3 = e3[0]), !(n3 = f.test(t3) ? e3.getElementById(t3.slice(1)) : g.test(t3) ? ft(t3) : y(t3, e3)))
return;
} else if (k(t3))
return this.ready(t3);
(n3.nodeType || n3 === r) && (n3 = [n3]), this.length = n3.length;
for (var i2 = 0, s2 = this.length; i2 < s2; i2++)
this[i2] = n3[i2];
}
}
function b(t3, e3) {
return new m(t3, e3);
}
var _ = b.fn = b.prototype = m.prototype = { constructor: b, __cash: true, length: 0, splice: d };
_.get = function(t3) {
return void 0 === t3 ? p.call(this) : this[t3 < 0 ? t3 + this.length : t3];
}, _.eq = function(t3) {
return b(this.get(t3));
}, _.first = function() {
return this.eq(0);
}, _.last = function() {
return this.eq(-1);
}, _.map = function(t3) {
return b(l.call(this, function(e3, n3) {
return t3.call(e3, n3, e3);
}));
}, _.slice = function() {
return b(p.apply(this, arguments));
};
var w = /(?:^\w|[A-Z]|\b\w)/g, x = /[\s-_]+/g;
function C(t3) {
return t3.replace(w, function(t4, e3) {
return t4[e3 ? "toUpperCase" : "toLowerCase"]();
}).replace(x, "");
}
function S(t3, e3) {
for (var n3 = 0, o3 = t3.length; n3 < o3 && false !== e3.call(t3[n3], t3[n3], n3, t3); n3++)
;
}
b.camelCase = C, b.each = S, _.each = function(t3) {
return S(this, function(e3, n3) {
return t3.call(e3, n3, e3);
}), this;
}, _.removeProp = function(t3) {
return this.each(function(e3, n3) {
delete n3[t3];
});
}, b.extend = _.extend = function(t3) {
void 0 === t3 && (t3 = this);
for (var e3 = arguments, n3 = e3.length, o3 = n3 < 2 ? 0 : 1; o3 < n3; o3++)
for (var r2 in e3[o3])
t3[r2] = e3[o3][r2];
return t3;
};
var O = 1;
function T(t3, e3) {
var n3 = t3 && (t3.matches || t3.webkitMatchesSelector || t3.mozMatchesSelector || t3.msMatchesSelector || t3.oMatchesSelector);
return !!n3 && n3.call(t3, e3);
}
function k(t3) {
return "function" == typeof t3;
}
function P(t3) {
return "string" == typeof t3;
}
function E(t3) {
return !isNaN(parseFloat(t3)) && isFinite(t3);
}
b.guid = O, b.matches = T, b.isFunction = k, b.isString = P, b.isNumeric = E;
var A = Array.isArray;
function j(t3) {
return P(t3) ? function(e3, n3) {
return T(n3, t3);
} : t3.__cash ? function(e3, n3) {
return t3.is(n3);
} : function(t4, e3, n3) {
return e3 === n3;
};
}
b.isArray = A, _.prop = function(t3, e3) {
if (t3) {
if (P(t3))
return arguments.length < 2 ? this[0] && this[0][t3] : this.each(function(n4, o3) {
o3[t3] = e3;
});
for (var n3 in t3)
this.prop(n3, t3[n3]);
return this;
}
}, _.filter = function(t3) {
if (!t3)
return b();
var e3 = k(t3) ? t3 : j(t3);
return b(s.call(this, function(n3, o3) {
return e3.call(n3, o3, n3, t3);
}));
};
var M = /\S+/g;
function L(t3) {
return P(t3) && t3.match(M) || [];
}
function D(t3) {
return t3.filter(function(t4, e3, n3) {
return n3.indexOf(t4) === e3;
});
}
function N(t3, e3, n3) {
if (1 === t3.nodeType) {
var o3 = r.getComputedStyle(t3, null);
return e3 ? n3 ? o3.getPropertyValue(e3) : o3[e3] : o3;
}
}
function I(t3, e3) {
return parseInt(N(t3, e3), 10) || 0;
}
_.hasClass = function(t3) {
var e3 = L(t3), n3 = false;
return e3.length && this.each(function(t4, o3) {
return !(n3 = o3.classList.contains(e3[0]));
}), n3;
}, _.removeAttr = function(t3) {
var e3 = L(t3);
return e3.length ? this.each(function(t4, n3) {
S(e3, function(t5) {
n3.removeAttribute(t5);
});
}) : this;
}, _.attr = function(t3, e3) {
if (t3) {
if (P(t3)) {
if (arguments.length < 2) {
if (!this[0])
return;
var n3 = this[0].getAttribute(t3);
return null === n3 ? void 0 : n3;
}
return null === e3 ? this.removeAttr(t3) : this.each(function(n4, o4) {
o4.setAttribute(t3, e3);
});
}
for (var o3 in t3)
this.attr(o3, t3[o3]);
return this;
}
}, _.toggleClass = function(t3, e3) {
var n3 = L(t3), o3 = void 0 !== e3;
return n3.length ? this.each(function(t4, r2) {
S(n3, function(t5) {
o3 ? e3 ? r2.classList.add(t5) : r2.classList.remove(t5) : r2.classList.toggle(t5);
});
}) : this;
}, _.addClass = function(t3) {
return this.toggleClass(t3, true);
}, _.removeClass = function(t3) {
return arguments.length ? this.toggleClass(t3, false) : this.attr("class", "");
}, b.unique = D, _.add = function(t3, e3) {
return b(D(this.get().concat(b(t3, e3).get())));
};
var F = /^--/;
function V(t3) {
return F.test(t3);
}
var R = {}, H = o2 && o2.createElement("div"), z = H ? H.style : {}, B = ["webkit", "moz", "ms", "o"];
function U(t3, e3) {
if (void 0 === e3 && (e3 = V(t3)), e3)
return t3;
if (!R[t3]) {
var n3 = C(t3), o3 = "" + n3.charAt(0).toUpperCase() + n3.slice(1);
S((n3 + " " + B.join(o3 + " ") + o3).split(" "), function(e4) {
if (e4 in z)
return R[t3] = e4, false;
});
}
return R[t3];
}
b.prefixedProp = U;
var W = { animationIterationCount: true, columnCount: true, flexGrow: true, flexShrink: true, fontWeight: true, lineHeight: true, opacity: true, order: true, orphans: true, widows: true, zIndex: true };
function $(t3, e3, n3) {
return void 0 === n3 && (n3 = V(t3)), n3 || W[t3] || !E(e3) ? e3 : e3 + "px";
}
_.css = function(t3, e3) {
if (P(t3)) {
var n3 = V(t3);
return t3 = U(t3, n3), arguments.length < 2 ? this[0] && N(this[0], t3, n3) : t3 ? (e3 = $(t3, e3, n3), this.each(function(o4, r2) {
1 === r2.nodeType && (n3 ? r2.style.setProperty(t3, e3) : r2.style[t3] = e3);
})) : this;
}
for (var o3 in t3)
this.css(o3, t3[o3]);
return this;
};
var q = "__cashData", G = /^data-(.*)/;
function K(t3) {
return t3[q] = t3[q] || {};
}
function Y(t3, e3) {
var n3 = K(t3);
if (e3) {
if (!(e3 in n3)) {
var o3 = t3.dataset ? t3.dataset[e3] || t3.dataset[C(e3)] : b(t3).attr("data-" + e3);
if (void 0 !== o3) {
try {
o3 = JSON.parse(o3);
} catch (t4) {
}
n3[e3] = o3;
}
}
return n3[e3];
}
return n3;
}
function X(t3, e3) {
return I(t3, "border" + (e3 ? "Left" : "Top") + "Width") + I(t3, "padding" + (e3 ? "Left" : "Top")) + I(t3, "padding" + (e3 ? "Right" : "Bottom")) + I(t3, "border" + (e3 ? "Right" : "Bottom") + "Width");
}
function J(t3, e3) {
for (var n3 = 0, o3 = e3.length; n3 < o3; n3++)
if (t3.indexOf(e3[n3]) < 0)
return false;
return true;
}
function Z(t3, e3, n3) {
S(t3[n3], function(t4) {
t4[0];
var o3 = t4[1];
e3.removeEventListener(n3, o3);
}), delete t3[n3];
}
b.hasData = function(t3) {
return q in t3;
}, _.data = function(t3, e3) {
var n3 = this;
if (!t3) {
if (!this[0])
return;
return S(this[0].attributes, function(t4) {
var e4 = t4.name.match(G);
e4 && n3.data(e4[1]);
}), Y(this[0]);
}
if (P(t3))
return void 0 === e3 ? this[0] && Y(this[0], t3) : this.each(function(n4, o4) {
return function(t4, e4, n5) {
K(t4)[e4] = n5;
}(o4, t3, e3);
});
for (var o3 in t3)
this.data(o3, t3[o3]);
return this;
}, _.removeData = function(t3) {
return this.each(function(e3, n3) {
return function(t4, e4) {
void 0 === e4 ? delete t4[q] : delete K(t4)[e4];
}(n3, t3);
});
}, S(["Width", "Height"], function(t3) {
_["inner" + t3] = function() {
if (this[0])
return this[0] === r ? r["inner" + t3] : this[0]["client" + t3];
};
}), S(["width", "height"], function(t3, e3) {
_[t3] = function(n3) {
return this[0] ? arguments.length ? (n3 = parseInt(n3, 10), this.each(function(o3, r2) {
if (1 === r2.nodeType) {
var i2 = N(r2, "boxSizing");
r2.style[t3] = $(t3, n3 + ("border-box" === i2 ? X(r2, !e3) : 0));
}
})) : this[0] === r ? this[0][C("outer-" + t3)] : this[0].getBoundingClientRect()[t3] - X(this[0], !e3) : void 0 === n3 ? void 0 : this;
};
}), S(["Width", "Height"], function(t3, e3) {
_["outer" + t3] = function(n3) {
if (this[0])
return this[0] === r ? r["outer" + t3] : this[0]["offset" + t3] + (n3 ? I(this[0], "margin" + (e3 ? "Top" : "Left")) + I(this[0], "margin" + (e3 ? "Bottom" : "Right")) : 0);
};
});
var Q = "__cashEvents", tt = ".";
function et(t3) {
return t3[Q] = t3[Q] || {};
}
function nt(t3) {
var e3 = t3.split(tt);
return [e3[0], e3.slice(1).sort()];
}
function ot(t3, e3, n3, o3) {
var r2 = et(t3);
if (e3) {
var i2 = r2[e3];
if (!i2)
return;
o3 && (o3.guid = o3.guid || O++), r2[e3] = i2.filter(function(r3) {
var i3 = r3[0], s2 = r3[1];
if (o3 && s2.guid !== o3.guid || !J(i3, n3))
return true;
t3.removeEventListener(e3, s2);
});
} else if (n3 && n3.length)
for (e3 in r2)
ot(t3, e3, n3, o3);
else
for (e3 in r2)
Z(r2, t3, e3);
}
_.off = function(t3, e3) {
var n3 = this;
return void 0 === t3 ? this.each(function(t4, e4) {
return ot(e4);
}) : S(L(t3), function(t4) {
var o3 = nt(t4), r2 = o3[0], i2 = o3[1];
n3.each(function(t5, n4) {
return ot(n4, r2, i2, e3);
});
}), this;
}, _.on = function(t3, e3, n3, o3) {
var r2 = this;
if (!P(t3)) {
for (var i2 in t3)
this.on(i2, e3, t3[i2]);
return this;
}
return k(e3) && (n3 = e3, e3 = false), S(L(t3), function(t4) {
var i3 = nt(t4), s2 = i3[0], a2 = i3[1];
r2.each(function(t5, r3) {
var i4 = function t6(i5) {
if (!i5.namespace || J(a2, i5.namespace.split(tt))) {
var l2 = r3;
if (e3) {
for (var c2 = i5.target; !T(c2, e3); ) {
if (c2 === r3)
return;
if (!(c2 = c2.parentNode))
return;
}
l2 = c2;
}
i5.namespace = i5.namespace || "";
var u2 = n3.call(l2, i5, i5.data);
o3 && ot(r3, s2, a2, t6), false === u2 && (i5.preventDefault(), i5.stopPropagation());
}
};
i4.guid = n3.guid = n3.guid || O++, function(t6, e4, n4, o4) {
o4.guid = o4.guid || O++;
var r4 = et(t6);
r4[e4] = r4[e4] || [], r4[e4].push([n4, o4]), t6.addEventListener(e4, o4);
}(r3, s2, a2, i4);
});
}), this;
}, _.one = function(t3, e3, n3) {
return this.on(t3, e3, n3, true);
}, _.ready = function(t3) {
var e3 = function() {
return t3(b);
};
return "loading" !== o2.readyState ? setTimeout(e3) : o2.addEventListener("DOMContentLoaded", e3), this;
}, _.trigger = function(t3, e3) {
var n3 = t3;
if (P(t3)) {
var r2 = nt(t3), i2 = r2[0], s2 = r2[1];
(n3 = o2.createEvent("HTMLEvents")).initEvent(i2, true, true), n3.namespace = s2.join(tt);
}
return n3.data = e3, this.each(function(t4, e4) {
e4.dispatchEvent(n3);
});
};
var rt = /select-one/i, it = /select-multiple/i;
function st(t3) {
var e3 = t3.type;
return rt.test(e3) ? function(t4) {
return t4.selectedIndex < 0 ? null : t4.options[t4.selectedIndex].value;
}(t3) : it.test(e3) ? function(t4) {
var e4 = [];
return S(t4.options, function(t5) {
!t5.selected || t5.disabled || t5.parentNode.disabled || e4.push(t5.value);
}), e4;
}(t3) : t3.value;
}
var at = /%20/g;
var lt = /file|reset|submit|button|image/i, ct = /radio|checkbox/i;
_.serialize = function() {
var t3 = "";
return this.each(function(e3, n3) {
S(n3.elements || [n3], function(e4) {
if (!e4.disabled && e4.name && "FIELDSET" !== e4.tagName && !lt.test(e4.type) && (!ct.test(e4.type) || e4.checked)) {
var n4 = st(e4);
if (void 0 !== n4)
S(A(n4) ? n4 : [n4], function(n5) {
t3 += function(t4, e5) {
return "&" + encodeURIComponent(t4) + "=" + encodeURIComponent(e5).replace(at, "+");
}(e4.name, n5);
});
}
});
}), t3.substr(1);
}, _.val = function(t3) {
return void 0 === t3 ? this[0] && st(this[0]) : this.each(function(e3, n3) {
var o3 = it.test(n3.type), r2 = null === t3 ? o3 ? [] : "" : t3;
o3 && A(r2) ? S(n3.options, function(t4) {
t4.selected = r2.indexOf(t4.value) >= 0;
}) : n3.value = r2;
});
}, _.clone = function() {
return this.map(function(t3, e3) {
return e3.cloneNode(true);
});
}, _.detach = function() {
return this.each(function(t3, e3) {
e3.parentNode && e3.parentNode.removeChild(e3);
});
};
var ut, pt = /^\s*<(\w+)[^>]*>/, dt = /^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;
function ft(t3) {
if (function() {
if (!ut) {
var t4 = o2.createElement("table"), e4 = o2.createElement("tr");
ut = { "*": o2.createElement("div"), tr: o2.createElement("tbody"), td: e4, th: e4, thead: t4, tbody: t4, tfoot: t4 };
}
}(), !P(t3))
return [];
if (dt.test(t3))
return [o2.createElement(RegExp.$1)];
var e3 = pt.test(t3) && RegExp.$1, n3 = ut[e3] || ut["*"];
return n3.innerHTML = t3, b(n3.childNodes).detach().get();
}
function ht(t3, e3, n3) {
if (void 0 !== e3) {
var o3 = P(e3);
!o3 && e3.length ? S(e3, function(e4) {
return ht(t3, e4, n3);
}) : S(t3, o3 ? function(t4) {
t4.insertAdjacentHTML(n3 ? "afterbegin" : "beforeend", e3);
} : function(t4, o4) {
return function(t5, e4, n4) {
n4 ? t5.insertBefore(e4, t5.childNodes[0]) : t5.appendChild(e4);
}(t4, o4 ? e3.cloneNode(true) : e3, n3);
});
}
}
b.parseHTML = ft, _.empty = function() {
var t3 = this[0];
if (t3)
for (; t3.firstChild; )
t3.removeChild(t3.firstChild);
return this;
}, _.append = function() {
var t3 = this;
return S(arguments, function(e3) {
ht(t3, e3);
}), this;
}, _.appendTo = function(t3) {
return ht(b(t3), this), this;
}, _.html = function(t3) {
if (void 0 === t3)
return this[0] && this[0].innerHTML;
var e3 = t3.nodeType ? t3[0].outerHTML : t3;
return this.each(function(t4, n3) {
n3.innerHTML = e3;
});
}, _.insertAfter = function(t3) {
var e3 = this;
return b(t3).each(function(t4, n3) {
var o3 = n3.parentNode;
e3.each(function(e4, r2) {
o3.insertBefore(t4 ? r2.cloneNode(true) : r2, n3.nextSibling);
});
}), this;
}, _.after = function() {
var t3 = this;
return S(u.apply(arguments), function(e3) {
u.apply(b(e3).slice()).insertAfter(t3);
}), this;
}, _.insertBefore = function(t3) {
var e3 = this;
return b(t3).each(function(t4, n3) {
var o3 = n3.parentNode;
e3.each(function(e4, r2) {
o3.insertBefore(t4 ? r2.cloneNode(true) : r2, n3);
});
}), this;
}, _.before = function() {
var t3 = this;
return S(arguments, function(e3) {
b(e3).insertBefore(t3);
}), this;
}, _.prepend = function() {
var t3 = this;
return S(arguments, function(e3) {
ht(t3, e3, true);
}), this;
}, _.prependTo = function(t3) {
return ht(b(t3), u.apply(this.slice()), true), this;
}, _.remove = function() {
return this.detach().off();
}, _.replaceWith = function(t3) {
var e3 = this;
return this.each(function(n3, o3) {
var r2 = o3.parentNode;
if (r2) {
var i2 = n3 ? b(t3).clone() : b(t3);
if (!i2[0])
return e3.remove(), false;
r2.replaceChild(i2[0], o3), b(i2[0]).after(i2.slice(1));
}
});
}, _.replaceAll = function(t3) {
return b(t3).replaceWith(this), this;
}, _.text = function(t3) {
return void 0 === t3 ? this[0] ? this[0].textContent : "" : this.each(function(e3, n3) {
n3.textContent = t3;
});
};
var gt = o2 && o2.documentElement;
_.offset = function() {
var t3 = this[0];
if (t3) {
var e3 = t3.getBoundingClientRect();
return { top: e3.top + r.pageYOffset - gt.clientTop, left: e3.left + r.pageXOffset - gt.clientLeft };
}
}, _.offsetParent = function() {
return b(this[0] && this[0].offsetParent);
}, _.position = function() {
var t3 = this[0];
if (t3)
return { left: t3.offsetLeft, top: t3.offsetTop };
}, _.children = function(t3) {
var e3 = [];
return this.each(function(t4, n3) {
c.apply(e3, n3.children);
}), e3 = b(D(e3)), t3 ? e3.filter(function(e4, n3) {
return T(n3, t3);
}) : e3;
}, _.contents = function() {
var t3 = [];
return this.each(function(e3, n3) {
c.apply(t3, "IFRAME" === n3.tagName ? [n3.contentDocument] : n3.childNodes);
}), b(t3.length && D(t3));
}, _.find = function(t3) {
for (var e3 = [], n3 = 0, o3 = this.length; n3 < o3; n3++) {
var r2 = y(t3, this[n3]);
r2.length && c.apply(e3, r2);
}
return b(e3.length && D(e3));
}, _.has = function(t3) {
var e3 = P(t3) ? function(e4, n3) {
return !!y(t3, n3).length;
} : function(e4, n3) {
return n3.contains(t3);
};
return this.filter(e3);
}, _.is = function(t3) {
if (!t3 || !this[0])
return false;
var e3 = j(t3), n3 = false;
return this.each(function(o3, r2) {
return !(n3 = e3(o3, r2, t3));
}), n3;
}, _.next = function() {
return b(this[0] && this[0].nextElementSibling);
}, _.not = function(t3) {
if (!t3 || !this[0])
return this;
var e3 = j(t3);
return this.filter(function(n3, o3) {
return !e3(n3, o3, t3);
});
}, _.parent = function() {
var t3 = [];
return this.each(function(e3, n3) {
n3 && n3.parentNode && t3.push(n3.parentNode);
}), b(D(t3));
}, _.index = function(t3) {
var e3 = t3 ? b(t3)[0] : this[0], n3 = t3 ? this : b(e3).parent().children();
return a.call(n3, e3);
}, _.closest = function(t3) {
return t3 && this[0] ? this.is(t3) ? this.filter(t3) : this.parent().closest(t3) : b();
}, _.parents = function(t3) {
var e3, n3 = [];
return this.each(function(r2, i2) {
for (e3 = i2; e3 && e3.parentNode && e3 !== o2.body.parentNode; )
e3 = e3.parentNode, (!t3 || t3 && T(e3, t3)) && n3.push(e3);
}), b(D(n3));
}, _.prev = function() {
return b(this[0] && this[0].previousElementSibling);
}, _.siblings = function() {
var t3 = this[0];
return this.parent().children().filter(function(e3, n3) {
return n3 !== t3;
});
};
const vt = b;
}, 491: (t2, e2, n2) => {
n2.d(e2, { $Q: () => g, FW: () => d, G1: () => a, GX: () => w, L_: () => c, Mx: () => l, R3: () => v, SJ: () => _, cx: () => u, dL: () => h, pn: () => f, rw: () => m, sE: () => p, t3: () => b, ut: () => y });
var o2 = n2(50), r = function(t3, e3, n3) {
if (n3 || 2 === arguments.length)
for (var o3, r2 = 0, i2 = e3.length; r2 < i2; r2++)
!o3 && r2 in e3 || (o3 || (o3 = Array.prototype.slice.call(e3, 0, r2)), o3[r2] = e3[r2]);
return t3.concat(o3 || Array.prototype.slice.call(e3));
}, i = "tag", s = "attributes", a = "transitionend oTransitionEnd transitionend webkitTransitionEnd", l = function(t3) {
return t3 && 9 === t3.nodeType;
}, c = function(t3) {
var e3 = t3 && t3.parentNode;
e3 && e3.removeChild(t3);
};
function u() {
for (var t3 = [], e3 = 0; e3 < arguments.length; e3++)
t3[e3] = arguments[e3];
var n3 = Array.isArray(t3[0]) ? t3[0] : r([], t3, true);
return n3.filter(Boolean).join(" ");
}
var p = function(t3, e3) {
return t3.querySelectorAll(e3);
}, d = function(t3, e3) {
return void 0 === e3 && (e3 = {}), t3 && t3.setAttribute && (0, o2.each)(e3, function(e4, n3) {
return t3.setAttribute(n3, e4);
});
}, f = function(t3) {
return t3 && !!(t3.offsetWidth || t3.offsetHeight || t3.getClientRects().length);
}, h = function(t3, e3) {
var n3;
null === (n3 = t3.parentNode) || void 0 === n3 || n3.replaceChild(e3, t3);
}, g = function(t3, e3, n3) {
var r2 = t3.childNodes, i2 = r2.length, s2 = (0, o2.isUndefined)(n3) ? i2 : n3;
(0, o2.isString)(e3) && (t3.insertAdjacentHTML("beforeEnd", e3), e3 = t3.lastChild, t3.removeChild(e3)), s2 >= i2 ? t3.appendChild(e3) : t3.insertBefore(e3, r2[s2]);
}, v = function(t3, e3) {
return g(t3, e3);
}, y = function(t3, e3, n3) {
void 0 === e3 && (e3 = {});
var r2 = document.createElement(t3);
return e3 && (0, o2.each)(e3, function(t4, e4) {
return r2.setAttribute(e4, t4);
}), n3 && ((0, o2.isString)(n3) ? r2.innerHTML = n3 : r2.appendChild(n3)), r2;
}, m = function(t3) {
return document.createTextNode(t3);
}, b = function(t3, e3) {
var n3, o3 = t3.type;
try {
n3 = new window[e3](o3, t3);
} catch (t4) {
(n3 = document.createEvent(e3)).initEvent(o3, true, true);
}
return n3._parentEvent = t3, 0 === o3.indexOf("key") && (n3.keyCodeVal = t3.keyCode, ["keyCode", "which"].forEach(function(t4) {
Object.defineProperty(n3, t4, { get: function() {
return this.keyCodeVal;
} });
})), n3;
}, _ = function(t3, e3) {
void 0 === e3 && (e3 = []), (Array.isArray(e3) ? e3 : [e3]).forEach(function(e4) {
var n3 = e4[i] || "div", r2 = e4[s] || {}, a2 = document.createElement(n3);
(0, o2.each)(r2, function(t4, e5) {
a2.setAttribute(e5, t4);
}), t3.appendChild(a2);
});
}, w = function(t3) {
var e3 = (null == t3 ? void 0 : t3.ownerDocument) || document, n3 = e3.documentElement, o3 = e3.defaultView || window;
return { x: (o3.pageXOffset || n3.scrollLeft || 0) - (n3.clientLeft || 0), y: (o3.pageYOffset || n3.scrollTop || 0) - (n3.clientTop || 0) };
};
}, 163: (t2, e2, n2) => {
n2.r(e2), n2.d(e2, { appendStyles: () => f, buildBase64UrlFromSvg: () => $, camelCase: () => b, capitalize: () => R, createId: () => W, deepMerge: () => E, escape: () => k, escapeNodeContent: () => P, find: () => T, getElRect: () => j, getElement: () => x, getGlobal: () => l, getKeyChar: () => D, getKeyCode: () => L, getModel: () => A, getPointerEvent: () => M, getUiClass: () => d, getUnitFromValue: () => y, getViewEl: () => B, hasDnd: () => w, hasWin: () => a, isCommentNode: () => S, isComponent: () => H, isDef: () => s, isEmptyObj: () => V, isEnterKey: () => I, isEscKey: () => N, isObject: () => F, isRule: () => z, isTaggableNode: () => O, isTextNode: () => C, matches: () => p, normalizeFloat: () => _, off: () => v, on: () => g, setViewEl: () => U, shallowDiff: () => h, toLowerCase: () => c, upFirst: () => m });
var o2 = n2(50), r = function() {
return r = Object.assign || function(t3) {
for (var e3, n3 = 1, o3 = arguments.length; n3 < o3; n3++)
for (var r2 in e3 = arguments[n3])
Object.prototype.hasOwnProperty.call(e3, r2) && (t3[r2] = e3[r2]);
return t3;
}, r.apply(this, arguments);
}, i = function(t3, e3, n3) {
if (n3 || 2 === arguments.length)
for (var o3, r2 = 0, i2 = e3.length; r2 < i2; r2++)
!o3 && r2 in e3 || (o3 || (o3 = Array.prototype.slice.call(e3, 0, r2)), o3[r2] = e3[r2]);
return t3.concat(o3 || Array.prototype.slice.call(e3));
}, s = function(t3) {
return void 0 !== t3;
}, a = function() {
return "undefined" != typeof window;
}, l = function() {
return "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : n2.g;
}, c = function(t3) {
return (t3 || "").toLowerCase();
}, u = a() ? window.Element.prototype : {}, p = u.matches || u.webkitMatchesSelector || u.mozMatchesSelector || u.msMatchesSelector, d = function(t3, e3) {
var n3 = t3.getConfig(), o3 = n3.stylePrefix;
return [n3.customUI && "".concat(o3, "cui"), e3].filter(function(t4) {
return t4;
}).join(" ");
}, f = function(t3, e3) {
void 0 === e3 && (e3 = {});
var n3 = (0, o2.isArray)(t3) ? i([], t3, true) : [t3];
if (n3.length) {
var r2 = n3.shift();
if (r2 && (!e3.unique || !document.querySelector('link[href="'.concat(r2, '"]')))) {
var s2 = document.head, a2 = document.createElement("link");
a2.href = r2, a2.rel = "stylesheet", e3.prepand ? s2.insertBefore(a2, s2.firstChild) : s2.appendChild(a2);
}
f(n3);
}
}, h = function(t3, e3) {
var n3 = {}, r2 = (0, o2.keys)(e3);
for (var i2 in t3)
if (t3.hasOwnProperty(i2)) {
var s2 = t3[i2], a2 = e3[i2];
r2.indexOf(i2) >= 0 ? s2 !== a2 && (n3[i2] = a2) : n3[i2] = null;
}
for (var i2 in e3)
e3.hasOwnProperty(i2) && (0, o2.isUndefined)(t3[i2]) && (n3[i2] = e3[i2]);
return n3;
}, g = function(t3, e3, n3, o3) {
var r2 = e3.split(/\s+/);
t3 = t3 instanceof Array ? t3 : [t3];
for (var i2 = function(e4) {
t3.forEach(function(t4) {
return t4 && t4.addEventListener(r2[e4], n3, o3);
});
}, s2 = 0; s2 < r2.length; ++s2)
i2(s2);
}, v = function(t3, e3, n3, o3) {
var r2 = e3.split(/\s+/);
t3 = t3 instanceof Array ? t3 : [t3];
for (var i2 = function(e4) {
t3.forEach(function(t4) {
return t4 && t4.removeEventListener(r2[e4], n3, o3);
});
}, s2 = 0; s2 < r2.length; ++s2)
i2(s2);
}, y = function(t3) {
return t3.replace(parseFloat(t3), "");
}, m = function(t3) {
return t3[0].toUpperCase() + t3.toLowerCase().slice(1);
}, b = function(t3) {
return t3.replace(/-./g, function(t4) {
return t4[1].toUpperCase();
});
}, _ = function(t3, e3, n3) {
void 0 === e3 && (e3 = 1), void 0 === n3 && (n3 = 0);
var o3 = 0;
if (isNaN(t3))
return n3;
if (t3 = parseFloat(t3), Math.floor(t3) !== t3) {
var r2 = e3.toString().split(".")[1];
o3 = r2 ? r2.length : 0;
}
return o3 ? parseFloat(t3.toFixed(o3)) : t3;
}, w = function(t3) {
return "draggable" in document.createElement("i") && (!t3 || t3.config.nativeDnD);
}, x = function(t3) {
return (0, o2.isElement)(t3) || C(t3) ? t3 : t3 && t3.getEl ? t3.getEl() : void 0;
}, C = function(t3) {
return t3 && 3 === t3.nodeType;
}, S = function(t3) {
return t3 && 8 === t3.nodeType;
}, O = function(t3) {
return t3 && !C(t3) && !S(t3);
}, T = function(t3, e3) {
var n3 = null;
return t3.some(function(o3, r2) {
return e3(o3, r2, t3) ? (n3 = o3, 1) : 0;
}), n3;
}, k = function(t3) {
return void 0 === t3 && (t3 = ""), "".concat(t3).replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/`/g, "`");
}, P = function(t3) {
return void 0 === t3 && (t3 = ""), "".concat(t3).replace(/&/g, "&").replace(//g, ">");
}, E = function() {
for (var t3 = [], e3 = 0; e3 < arguments.length; e3++)
t3[e3] = arguments[e3];
for (var n3 = r({}, t3[0]), o3 = 1; o3 < t3.length; o3++) {
var i2 = r({}, t3[o3]);
for (var s2 in i2) {
var a2 = n3[s2], l2 = i2[s2];
F(a2) && F(l2) ? n3[s2] = E(a2, l2) : n3[s2] = l2;
}
}
return n3;
}, A = function(t3, e3) {
var n3 = t3;
return !e3 && t3 && t3.__cashData ? n3 = t3.__cashData.model : (0, o2.isElement)(t3) && (n3 = e3(t3).data("model")), n3;
}, j = function(t3) {
var e3, n3 = { top: 0, left: 0, width: 0, height: 0 };
if (!t3)
return n3;
if (C(t3)) {
var o3 = document.createRange();
o3.selectNode(t3), e3 = o3.getBoundingClientRect(), o3.detach();
}
return e3 || (t3.getBoundingClientRect ? t3.getBoundingClientRect() : n3);
}, M = function(t3) {
return t3.touches && t3.touches[0] ? t3.touches[0] : t3;
}, L = function(t3) {
return t3.which || t3.keyCode;
}, D = function(t3) {
return String.fromCharCode(L(t3));
}, N = function(t3) {
return 27 === L(t3);
}, I = function(t3) {
return 13 === L(t3);
}, F = function(t3) {
return null !== t3 && !Array.isArray(t3) && "object" == typeof t3;
}, V = function(t3) {
return Object.keys(t3).length <= 0;
}, R = function(t3) {
return void 0 === t3 && (t3 = ""), t3 && t3.charAt(0).toUpperCase() + t3.substring(1);
}, H = function(t3) {
return t3 && t3.toHTML;
}, z = function(t3) {
return t3 && t3.toCSS;
}, B = function(t3) {
return t3.__gjsv;
}, U = function(t3, e3) {
t3.__gjsv = e3;
}, W = function(t3) {
void 0 === t3 && (t3 = 16);
for (var e3 = "", n3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", o3 = n3.length, r2 = 0; r2 < t3; r2++)
e3 += n3.charAt(Math.floor(Math.random() * o3));
return e3;
}, $ = function(t3) {
if (t3 && "