var Ic = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Em(Ls) {
return Ls && Ls.__esModule && Object.prototype.hasOwnProperty.call(Ls, "default") ? Ls.default : Ls;
}
var Yd = { exports: {} };
/*! grapesjs - 0.21.2 */
(function(Ls, Mm) {
(function(Uf, Fc) {
Ls.exports = Fc();
})(typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : Ic, () => (() => {
var Uf = { 410: (S, H, pt) => {
var at, _t, J;
_t = [pt(50), pt(316)], (J = typeof (at = function(W, z) {
var k = Array.prototype.slice;
function P(j, V, Y) {
return Y.length <= 4 ? j.call(V, Y[0], Y[1], Y[2], Y[3]) : j.apply(V, Y);
}
function E(j, V) {
return k.call(j, V);
}
function M(j, V) {
return j != null && (W.isArray(V) || (V = E(arguments, 1)), W.all(V, function(Y) {
return Y in j;
}));
}
var D = function() {
var j = !1, V = -1;
function Y() {
V++, j = !0, W.defer(function() {
j = !1;
});
}
return function() {
return j || Y(), V;
};
}();
function ot() {
this.registeredObjects = [], this.cidIndexes = [];
}
function it(j, V, Y, nt) {
for (var wt, rt = 0, gt = V.length; rt < gt; rt++)
if (wt = V[rt]) {
if (j === "on") {
if (!nt.objectRegistry.register(wt))
continue;
} else if (!nt.objectRegistry.unregister(wt))
continue;
W.isFunction(wt[j]) && wt[j]("all", Y, nt);
}
}
function Et(j, V) {
var Y = V.type, nt = V.undoTypes, wt = !nt[Y] || nt[Y][j];
W.isFunction(wt) && wt(V.object, V.before, V.after, V.options);
}
function jt(j, V, Y, nt, wt) {
if (!(Y.isCurrentlyUndoRedoing || j === "undo" && Y.pointer === -1 || j === "redo" && Y.pointer === Y.length - 1)) {
Y.isCurrentlyUndoRedoing = !0;
var rt, gt, N = j === "undo";
for (wt ? gt = N && Y.pointer === Y.length - 1 || !N && Y.pointer === -1 ? W.clone(Y.models) : k.apply(Y.models, N ? [0, Y.pointer] : [Y.pointer, Y.length - 1]) : (rt = Y.at(N ? Y.pointer : Y.pointer + 1), gt = nt ? Y.where({ magicFusionIndex: rt.get("magicFusionIndex") }) : [rt]), Y.pointer += (N ? -1 : 1) * gt.length; rt = N ? gt.pop() : gt.shift(); )
rt[j]();
Y.isCurrentlyUndoRedoing = !1, V.trigger(j, V);
}
}
function Dt(j, V) {
var Y = j.condition, nt = typeof Y;
return nt === "function" ? !!P(Y, j, V) : nt !== "boolean" || Y;
}
function ee(j, V, Y, nt) {
if (j.track && !j.isCurrentlyUndoRedoing && V in nt && Dt(nt[V], Y)) {
var wt = P(nt[V].on, nt[V], Y);
if (M(wt, "object", "before", "after")) {
if (wt.type = V, wt.magicFusionIndex = D(), wt.undoTypes = nt, j.pointer < j.length - 1)
for (var rt = j.length - j.pointer - 1; rt--; )
j.pop();
j.pointer = j.length, j.add(wt), j.length > j.maximumStackLength && (j.shift(), j.pointer--);
}
}
}
ot.prototype = { isRegistered: function(j) {
return j && j.cid ? this.registeredObjects[j.cid] : W.contains(this.registeredObjects, j);
}, register: function(j) {
return !this.isRegistered(j) && (j && j.cid ? (this.registeredObjects[j.cid] = j, this.cidIndexes.push(j.cid)) : this.registeredObjects.push(j), !0);
}, unregister: function(j) {
if (this.isRegistered(j)) {
if (j && j.cid)
delete this.registeredObjects[j.cid], this.cidIndexes.splice(W.indexOf(this.cidIndexes, j.cid), 1);
else {
var V = W.indexOf(this.registeredObjects, j);
this.registeredObjects.splice(V, 1);
}
return !0;
}
return !1;
}, get: function() {
return W.map(this.cidIndexes, function(j) {
return this.registeredObjects[j];
}, this).concat(this.registeredObjects);
} };
var xt = { add: { undo: function(j, V, Y, nt) {
j.remove(Y, nt);
}, redo: function(j, V, Y, nt) {
nt.index && (nt.at = nt.index), j.add(Y, nt);
}, on: function(j, V, Y) {
return { object: V, before: void 0, after: j, options: W.clone(Y) };
} }, remove: { undo: function(j, V, Y, nt) {
"index" in nt && (nt.at = nt.index), j.add(V, nt);
}, redo: function(j, V, Y, nt) {
j.remove(V, nt);
}, on: function(j, V, Y) {
return { object: V, before: j, after: void 0, options: W.clone(Y) };
} }, change: { undo: function(j, V, Y, nt) {
W.isEmpty(V) ? W.each(W.keys(Y), j.unset, j) : (j.set(V), nt && nt.unsetData && nt.unsetData.before && nt.unsetData.before.length && W.each(nt.unsetData.before, j.unset, j));
}, redo: function(j, V, Y, nt) {
W.isEmpty(Y) ? W.each(W.keys(V), j.unset, j) : (j.set(Y), nt && nt.unsetData && nt.unsetData.after && nt.unsetData.after.length && W.each(nt.unsetData.after, j.unset, j));
}, on: function(j, V) {
var Y = j.changedAttributes(), nt = W.keys(Y), wt = W.pick(j.previousAttributes(), nt), rt = W.keys(wt), gt = (V || (V = {})).unsetData = { after: [], before: [] };
return nt.length != rt.length && (nt.length > rt.length ? W.each(nt, function(N) {
N in wt || gt.before.push(N);
}, this) : W.each(rt, function(N) {
N in Y || gt.after.push(N);
})), { object: j, before: wt, after: Y, options: W.clone(V) };
} }, reset: { undo: function(j, V, Y) {
j.reset(V);
}, redo: function(j, V, Y) {
j.reset(Y);
}, on: function(j, V) {
return { object: j, before: V.previousModels, after: W.clone(j.models) };
} } };
function bt() {
}
function Wt(j, V, Y, nt) {
if (typeof V == "object")
return W.each(V, function(wt, rt) {
j === 2 ? Wt(j, wt, Y, nt) : Wt(j, rt, wt, Y);
});
switch (j) {
case 0:
M(Y, "undo", "redo", "on") && W.all(W.pick(Y, "undo", "redo", "on"), W.isFunction) && (nt[V] = Y);
break;
case 1:
nt[V] && W.isObject(Y) && (nt[V] = W.extend({}, nt[V], Y));
break;
case 2:
delete nt[V];
}
return this;
}
bt.prototype = xt;
var Ft = z.Model.extend({ defaults: { type: null, object: null, before: null, after: null, magicFusionIndex: null }, undo: function(j) {
Et("undo", this.attributes);
}, redo: function(j) {
Et("redo", this.attributes);
} }), Ht = z.Collection.extend({ model: Ft, pointer: -1, track: !1, isCurrentlyUndoRedoing: !1, maximumStackLength: 1 / 0, setMaxLength: function(j) {
this.maximumStackLength = j;
} }), Q = z.Model.extend({ defaults: { maximumStackLength: 1 / 0, track: !1 }, initialize: function(j) {
this.stack = new Ht(), this.objectRegistry = new ot(), this.undoTypes = new bt(), this.stack.setMaxLength(this.get("maximumStackLength")), this.on("change:maximumStackLength", function(V, Y) {
this.stack.setMaxLength(Y);
}, this), j && j.track && this.startTracking(), j && j.register && (W.isArray(j.register) || W.isArguments(j.register) ? P(this.register, this, j.register) : this.register(j.register));
}, startTracking: function() {
this.set("track", !0), this.stack.track = !0;
}, stopTracking: function() {
this.set("track", !1), this.stack.track = !1;
}, isTracking: function() {
return this.get("track");
}, _addToStack: function(j) {
ee(this.stack, j, E(arguments, 1), this.undoTypes);
}, register: function() {
it("on", arguments, this._addToStack, this);
}, unregister: function() {
it("off", arguments, this._addToStack, this);
}, unregisterAll: function() {
P(this.unregister, this, this.objectRegistry.get());
}, undo: function(j) {
jt("undo", this, this.stack, j);
}, undoAll: function() {
jt("undo", this, this.stack, !1, !0);
}, redo: function(j) {
jt("redo", this, this.stack, j);
}, redoAll: function() {
jt("redo", this, this.stack, !1, !0);
}, isAvailable: function(j) {
var V = this.stack, Y = V.length;
switch (j) {
case "undo":
return Y > 0 && V.pointer > -1;
case "redo":
return Y > 0 && V.pointer < Y - 1;
default:
return !1;
}
}, merge: function(j) {
for (var V, Y = W.isArray(j) ? j : E(arguments); V = Y.pop(); )
V instanceof Q && V.stack instanceof Ht && (V.stack = this.stack);
}, addUndoType: function(j, V) {
Wt(0, j, V, this.undoTypes);
}, changeUndoType: function(j, V) {
Wt(1, j, V, this.undoTypes);
}, removeUndoType: function(j) {
Wt(2, j, void 0, this.undoTypes);
}, clear: function() {
this.stack.reset(), this.stack.pointer = -1;
} });
return W.extend(Q, { defaults: function(j) {
W.extend(Q.prototype.defaults, j);
}, addUndoType: function(j, V) {
Wt(0, j, V, xt);
}, changeUndoType: function(j, V) {
Wt(1, j, V, xt);
}, removeUndoType: function(j) {
Wt(2, j, void 0, xt);
} }), z.UndoManager = Q;
}) == "function" ? at.apply(H, _t) : at) === void 0 || (S.exports = J);
}, 316: (S, H, pt) => {
var at, _t;
(function(J) {
var W = typeof self == "object" && self.self === self && self || typeof pt.g == "object" && pt.g.global === pt.g && pt.g;
at = [pt(50), pt(895), H], _t = function(z, k, P) {
W.Backbone = function(E, M, D, ot) {
var it = E.Backbone, Et = Array.prototype.slice;
M.VERSION = "1.4.1", M.$ = ot, M.noConflict = function() {
return E.Backbone = it, this;
}, M.emulateHTTP = !1, M.emulateJSON = !1;
var jt, Dt = M.Events = {}, ee = /\s+/, xt = function(b, I, U, ht, kt) {
var Ot, fe = 0;
if (U && typeof U == "object")
for (ht !== void 0 && ("context" in kt) && kt.context === void 0 && (kt.context = ht), Ot = D.keys(U); fe < Ot.length; fe++)
I = xt(b, I, Ot[fe], U[Ot[fe]], kt);
else if (U && ee.test(U))
for (Ot = U.split(ee); fe < Ot.length; fe++)
I = b(I, Ot[fe], ht, kt);
else
I = b(I, U, ht, kt);
return I;
};
Dt.on = function(b, I, U) {
return this._events = xt(bt, this._events || {}, b, I, { context: U, ctx: this, listening: jt }), jt && ((this._listeners || (this._listeners = {}))[jt.id] = jt, jt.interop = !1), this;
}, Dt.listenTo = function(b, I, U) {
if (!b)
return this;
var ht = b._listenId || (b._listenId = D.uniqueId("l")), kt = this._listeningTo || (this._listeningTo = {}), Ot = jt = kt[ht];
Ot || (this._listenId || (this._listenId = D.uniqueId("l")), Ot = jt = kt[ht] = new V(this, b));
var fe = Wt(b, I, U, this);
if (jt = void 0, fe)
throw fe;
return Ot.interop && Ot.on(I, U), this;
};
var bt = function(b, I, U, ht) {
if (U) {
var kt = b[I] || (b[I] = []), Ot = ht.context, fe = ht.ctx, ke = ht.listening;
ke && ke.count++, kt.push({ callback: U, context: Ot, ctx: Ot || fe, listening: ke });
}
return b;
}, Wt = function(b, I, U, ht) {
try {
b.on(I, U, ht);
} catch (kt) {
return kt;
}
};
Dt.off = function(b, I, U) {
return this._events ? (this._events = xt(Ft, this._events, b, I, { context: U, listeners: this._listeners }), this) : this;
}, Dt.stopListening = function(b, I, U) {
var ht = this._listeningTo;
if (!ht)
return this;
for (var kt = b ? [b._listenId] : D.keys(ht), Ot = 0; Ot < kt.length; Ot++) {
var fe = ht[kt[Ot]];
if (!fe)
break;
fe.obj.off(I, U, this), fe.interop && fe.off(I, U);
}
return D.isEmpty(ht) && (this._listeningTo = void 0), this;
};
var Ft = function(b, I, U, ht) {
if (b) {
var kt, Ot = ht.context, fe = ht.listeners, ke = 0;
if (I || Ot || U) {
for (kt = I ? [I] : D.keys(b); ke < kt.length; ke++) {
var Ve = b[I = kt[ke]];
if (!Ve)
break;
for (var ze = [], Qe = 0; Qe < Ve.length; Qe++) {
var Kt = Ve[Qe];
if (U && U !== Kt.callback && U !== Kt.callback._callback || Ot && Ot !== Kt.context)
ze.push(Kt);
else {
var R = Kt.listening;
R && R.off(I, U);
}
}
ze.length ? b[I] = ze : delete b[I];
}
return b;
}
for (kt = D.keys(fe); ke < kt.length; ke++)
fe[kt[ke]].cleanup();
}
};
Dt.once = function(b, I, U) {
var ht = xt(Ht, {}, b, I, this.off.bind(this));
return typeof b == "string" && U == null && (I = void 0), this.on(ht, I, U);
}, Dt.listenToOnce = function(b, I, U) {
var ht = xt(Ht, {}, I, U, this.stopListening.bind(this, b));
return this.listenTo(b, ht);
};
var Ht = function(b, I, U, ht) {
if (U) {
var kt = b[I] = D.once(function() {
ht(I, kt), U.apply(this, arguments);
});
kt._callback = U;
}
return b;
};
Dt.trigger = function(b) {
if (!this._events)
return this;
for (var I = Math.max(0, arguments.length - 1), U = Array(I), ht = 0; ht < I; ht++)
U[ht] = arguments[ht + 1];
return xt(Q, this._events, b, void 0, U), this;
};
var Q = function(b, I, U, ht) {
if (b) {
var kt = b[I], Ot = b.all;
kt && Ot && (Ot = Ot.slice()), kt && j(kt, ht), Ot && j(Ot, [I].concat(ht));
}
return b;
}, j = function(b, I) {
var U, ht = -1, kt = b.length, Ot = I[0], fe = I[1], ke = I[2];
switch (I.length) {
case 0:
for (; ++ht < kt; )
(U = b[ht]).callback.call(U.ctx);
return;
case 1:
for (; ++ht < kt; )
(U = b[ht]).callback.call(U.ctx, Ot);
return;
case 2:
for (; ++ht < kt; )
(U = b[ht]).callback.call(U.ctx, Ot, fe);
return;
case 3:
for (; ++ht < kt; )
(U = b[ht]).callback.call(U.ctx, Ot, fe, ke);
return;
default:
for (; ++ht < kt; )
(U = b[ht]).callback.apply(U.ctx, I);
return;
}
}, V = function(b, I) {
this.id = b._listenId, this.listener = b, this.obj = I, this.interop = !0, this.count = 0, this._events = void 0;
};
V.prototype.on = Dt.on, V.prototype.off = function(b, I) {
var U;
this.interop ? (this._events = xt(Ft, this._events, b, I, { context: void 0, listeners: void 0 }), U = !this._events) : (this.count--, U = this.count === 0), U && this.cleanup();
}, V.prototype.cleanup = function() {
delete this.listener._listeningTo[this.obj._listenId], this.interop || delete this.obj._listeners[this.id];
}, Dt.bind = Dt.on, Dt.unbind = Dt.off, D.extend(M, Dt);
var Y = M.Model = function(b, I) {
var U = b || {};
I || (I = {}), this.preinitialize.apply(this, arguments), this.cid = D.uniqueId(this.cidPrefix), this.attributes = {}, I.collection && (this.collection = I.collection), I.parse && (U = this.parse(U, I) || {});
var ht = D.result(this, "defaults");
U = D.defaults(D.extend({}, ht, U), ht), this.set(U, I), this.changed = {}, this.initialize.apply(this, arguments);
};
D.extend(Y.prototype, Dt, { changed: null, validationError: null, idAttribute: "id", cidPrefix: "c", preinitialize: function() {
}, initialize: function() {
}, toJSON: function(b) {
return D.clone(this.attributes);
}, sync: function() {
return M.sync.apply(this, arguments);
}, get: function(b) {
return this.attributes[b];
}, escape: function(b) {
return D.escape(this.get(b));
}, has: function(b) {
return this.get(b) != null;
}, matches: function(b) {
return !!D.iteratee(b, this)(this.attributes);
}, set: function(b, I, U) {
if (b == null)
return this;
var ht;
if (typeof b == "object" ? (ht = b, U = I) : (ht = {})[b] = I, U || (U = {}), !this._validate(ht, U))
return !1;
var kt = U.unset, Ot = U.silent, fe = [], ke = this._changing;
this._changing = !0, ke || (this._previousAttributes = D.clone(this.attributes), this.changed = {});
var Ve = this.attributes, ze = this.changed, Qe = this._previousAttributes;
for (var Kt in ht)
I = ht[Kt], D.isEqual(Ve[Kt], I) || fe.push(Kt), D.isEqual(Qe[Kt], I) ? delete ze[Kt] : ze[Kt] = I, kt ? delete Ve[Kt] : Ve[Kt] = I;
if (this.idAttribute in ht) {
var R = this.id;
this.id = this.get(this.idAttribute), this.trigger("changeId", this, R, U);
}
if (!Ot) {
fe.length && (this._pending = U);
for (var tt = 0; tt < fe.length; tt++)
this.trigger("change:" + fe[tt], this, Ve[fe[tt]], U);
}
if (ke)
return this;
if (!Ot)
for (; this._pending; )
U = this._pending, this._pending = !1, this.trigger("change", this, U);
return this._pending = !1, this._changing = !1, this;
}, unset: function(b, I) {
return this.set(b, void 0, D.extend({}, I, { unset: !0 }));
}, clear: function(b) {
var I = {};
for (var U in this.attributes)
I[U] = void 0;
return this.set(I, D.extend({}, b, { unset: !0 }));
}, hasChanged: function(b) {
return b == null ? !D.isEmpty(this.changed) : D.has(this.changed, b);
}, changedAttributes: function(b) {
if (!b)
return !!this.hasChanged() && D.clone(this.changed);
var I, U = this._changing ? this._previousAttributes : this.attributes, ht = {};
for (var kt in b) {
var Ot = b[kt];
D.isEqual(U[kt], Ot) || (ht[kt] = Ot, I = !0);
}
return !!I && ht;
}, previous: function(b) {
return b != null && this._previousAttributes ? this._previousAttributes[b] : null;
}, previousAttributes: function() {
return D.clone(this._previousAttributes);
}, fetch: function(b) {
b = D.extend({ parse: !0 }, b);
var I = this, U = b.success;
return b.success = function(ht) {
var kt = b.parse ? I.parse(ht, b) : ht;
if (!I.set(kt, b))
return !1;
U && U.call(b.context, I, ht, b), I.trigger("sync", I, ht, b);
}, zt(this, b), this.sync("read", this, b);
}, save: function(b, I, U) {
var ht;
b == null || typeof b == "object" ? (ht = b, U = I) : (ht = {})[b] = I;
var kt = (U = D.extend({ validate: !0, parse: !0 }, U)).wait;
if (ht && !kt) {
if (!this.set(ht, U))
return !1;
} else if (!this._validate(ht, U))
return !1;
var Ot = this, fe = U.success, ke = this.attributes;
U.success = function(Qe) {
Ot.attributes = ke;
var Kt = U.parse ? Ot.parse(Qe, U) : Qe;
if (kt && (Kt = D.extend({}, ht, Kt)), Kt && !Ot.set(Kt, U))
return !1;
fe && fe.call(U.context, Ot, Qe, U), Ot.trigger("sync", Ot, Qe, U);
}, zt(this, U), ht && kt && (this.attributes = D.extend({}, ke, ht));
var Ve = this.isNew() ? "create" : U.patch ? "patch" : "update";
Ve !== "patch" || U.attrs || (U.attrs = ht);
var ze = this.sync(Ve, this, U);
return this.attributes = ke, ze;
}, destroy: function(b) {
b = b ? D.clone(b) : {};
var I = this, U = b.success, ht = b.wait, kt = function() {
I.stopListening(), I.trigger("destroy", I, I.collection, b);
};
b.success = function(fe) {
ht && kt(), U && U.call(b.context, I, fe, b), I.isNew() || I.trigger("sync", I, fe, b);
};
var Ot = !1;
return this.isNew() ? D.defer(b.success) : (zt(this, b), Ot = this.sync("delete", this, b)), ht || kt(), Ot;
}, url: function() {
var b = D.result(this, "urlRoot") || D.result(this.collection, "url") || mt();
if (this.isNew())
return b;
var I = this.get(this.idAttribute);
return b.replace(/[^\/]$/, "$&/") + encodeURIComponent(I);
}, parse: function(b, I) {
return b;
}, clone: function() {
return new this.constructor(this.attributes);
}, isNew: function() {
return !this.has(this.idAttribute);
}, isValid: function(b) {
return this._validate({}, D.extend({}, b, { validate: !0 }));
}, _validate: function(b, I) {
if (!I.validate || !this.validate)
return !0;
b = D.extend({}, this.attributes, b);
var U = this.validationError = this.validate(b, I) || null;
return !U || (this.trigger("invalid", this, U, D.extend(I, { validationError: U })), !1);
} });
var nt = M.Collection = function(b, I) {
I || (I = {}), this.preinitialize.apply(this, arguments), I.model && (this.model = I.model), I.comparator !== void 0 && (this.comparator = I.comparator), this._reset(), this.initialize.apply(this, arguments), b && this.reset(b, D.extend({ silent: !0 }, I));
}, wt = { add: !0, remove: !0, merge: !0 }, rt = { add: !0, remove: !1 }, gt = function(b, I, U) {
U = Math.min(Math.max(U, 0), b.length);
var ht, kt = Array(b.length - U), Ot = I.length;
for (ht = 0; ht < kt.length; ht++)
kt[ht] = b[ht + U];
for (ht = 0; ht < Ot; ht++)
b[ht + U] = I[ht];
for (ht = 0; ht < kt.length; ht++)
b[ht + Ot + U] = kt[ht];
};
D.extend(nt.prototype, Dt, { model: Y, preinitialize: function() {
}, initialize: function() {
}, toJSON: function(b) {
return this.map(function(I) {
return I.toJSON(b);
});
}, sync: function() {
return M.sync.apply(this, arguments);
}, add: function(b, I) {
return this.set(b, D.extend({ merge: !1 }, I, rt));
}, remove: function(b, I) {
I = D.extend({}, I);
var U = !D.isArray(b);
b = U ? [b] : b.slice();
var ht = this._removeModels(b, I);
return !I.silent && ht.length && (I.changes = { added: [], merged: [], removed: ht }, this.trigger("update", this, I)), U ? ht[0] : ht;
}, set: function(b, I) {
if (b != null) {
(I = D.extend({}, wt, I)).parse && !this._isModel(b) && (b = this.parse(b, I) || []);
var U = !D.isArray(b);
b = U ? [b] : b.slice();
var ht = I.at;
ht != null && (ht = +ht), ht > this.length && (ht = this.length), ht < 0 && (ht += this.length + 1);
var kt, Ot, fe = [], ke = [], Ve = [], ze = [], Qe = {}, Kt = I.add, R = I.merge, tt = I.remove, ut = !1, yt = this.comparator && ht == null && I.sort !== !1, Yt = D.isString(this.comparator) ? this.comparator : null;
for (Ot = 0; Ot < b.length; Ot++) {
kt = b[Ot];
var he = this.get(kt);
if (he) {
if (R && kt !== he) {
var Re = this._isModel(kt) ? kt.attributes : kt;
I.parse && (Re = he.parse(Re, I)), he.set(Re, I), Ve.push(he), yt && !ut && (ut = he.hasChanged(Yt));
}
Qe[he.cid] || (Qe[he.cid] = !0, fe.push(he)), b[Ot] = he;
} else
Kt && (kt = b[Ot] = this._prepareModel(kt, I)) && (ke.push(kt), this._addReference(kt, I), Qe[kt.cid] = !0, fe.push(kt));
}
if (tt) {
for (Ot = 0; Ot < this.length; Ot++)
Qe[(kt = this.models[Ot]).cid] || ze.push(kt);
ze.length && this._removeModels(ze, I);
}
var We = !1, Ln = !yt && Kt && tt;
if (fe.length && Ln ? (We = this.length !== fe.length || D.some(this.models, function(pn, Ne) {
return pn !== fe[Ne];
}), this.models.length = 0, gt(this.models, fe, 0), this.length = this.models.length) : ke.length && (yt && (ut = !0), gt(this.models, ke, ht ?? this.length), this.length = this.models.length), ut && this.sort({ silent: !0 }), !I.silent) {
for (Ot = 0; Ot < ke.length; Ot++)
ht != null && (I.index = ht + Ot), (kt = ke[Ot]).trigger("add", kt, this, I);
(ut || We) && this.trigger("sort", this, I), (ke.length || ze.length || Ve.length) && (I.changes = { added: ke, removed: ze, merged: Ve }, this.trigger("update", this, I));
}
return U ? b[0] : b;
}
}, reset: function(b, I) {
I = I ? D.clone(I) : {};
for (var U = 0; U < this.models.length; U++)
this._removeReference(this.models[U], I);
return I.previousModels = this.models, this._reset(), b = this.add(b, D.extend({ silent: !0 }, I)), I.silent || this.trigger("reset", this, I), b;
}, push: function(b, I) {
return this.add(b, D.extend({ at: this.length }, I));
}, pop: function(b) {
var I = this.at(this.length - 1);
return this.remove(I, b);
}, unshift: function(b, I) {
return this.add(b, D.extend({ at: 0 }, I));
}, shift: function(b) {
var I = this.at(0);
return this.remove(I, b);
}, slice: function() {
return Et.apply(this.models, arguments);
}, get: function(b) {
if (b != null)
return this._byId[b] || this._byId[this.modelId(this._isModel(b) ? b.attributes : b, b.idAttribute)] || b.cid && this._byId[b.cid];
}, has: function(b) {
return this.get(b) != null;
}, at: function(b) {
return b < 0 && (b += this.length), this.models[b];
}, where: function(b, I) {
return this[I ? "find" : "filter"](b);
}, findWhere: function(b) {
return this.where(b, !0);
}, sort: function(b) {
var I = this.comparator;
if (!I)
throw new Error("Cannot sort a set without a comparator");
b || (b = {});
var U = I.length;
return D.isFunction(I) && (I = I.bind(this)), U === 1 || D.isString(I) ? this.models = this.sortBy(I) : this.models.sort(I), b.silent || this.trigger("sort", this, b), this;
}, pluck: function(b) {
return this.map(b + "");
}, fetch: function(b) {
var I = (b = D.extend({ parse: !0 }, b)).success, U = this;
return b.success = function(ht) {
var kt = b.reset ? "reset" : "set";
U[kt](ht, b), I && I.call(b.context, U, ht, b), U.trigger("sync", U, ht, b);
}, zt(this, b), this.sync("read", this, b);
}, create: function(b, I) {
var U = (I = I ? D.clone(I) : {}).wait;
if (!(b = this._prepareModel(b, I)))
return !1;
U || this.add(b, I);
var ht = this, kt = I.success;
return I.success = function(Ot, fe, ke) {
U && ht.add(Ot, ke), kt && kt.call(ke.context, Ot, fe, ke);
}, b.save(null, I), b;
}, parse: function(b, I) {
return b;
}, clone: function() {
return new this.constructor(this.models, { model: this.model, comparator: this.comparator });
}, modelId: function(b, I) {
return b[I || this.model.prototype.idAttribute || "id"];
}, values: function() {
return new Lt(this, Tt);
}, keys: function() {
return new Lt(this, Qt);
}, entries: function() {
return new Lt(this, Oe);
}, _reset: function() {
this.length = 0, this.models = [], this._byId = {};
}, _prepareModel: function(b, I) {
return this._isModel(b) ? (b.collection || (b.collection = this), b) : ((I = I ? D.clone(I) : {}).collection = this, (U = this.model.prototype ? new this.model(b, I) : this.model(b, I)).validationError ? (this.trigger("invalid", this, U.validationError, I), !1) : U);
var U;
}, _removeModels: function(b, I) {
for (var U = [], ht = 0; ht < b.length; ht++) {
var kt = this.get(b[ht]);
if (kt) {
var Ot = this.indexOf(kt);
this.models.splice(Ot, 1), this.length--, delete this._byId[kt.cid];
var fe = this.modelId(kt.attributes, kt.idAttribute);
fe != null && delete this._byId[fe], I.silent || (I.index = Ot, kt.trigger("remove", kt, this, I)), U.push(kt), this._removeReference(kt, I);
}
}
return U;
}, _isModel: function(b) {
return b instanceof Y;
}, _addReference: function(b, I) {
this._byId[b.cid] = b;
var U = this.modelId(b.attributes, b.idAttribute);
U != null && (this._byId[U] = b), b.on("all", this._onModelEvent, this);
}, _removeReference: function(b, I) {
delete this._byId[b.cid];
var U = this.modelId(b.attributes, b.idAttribute);
U != null && delete this._byId[U], this === b.collection && delete b.collection, b.off("all", this._onModelEvent, this);
}, _onModelEvent: function(b, I, U, ht) {
if (I) {
if ((b === "add" || b === "remove") && U !== this)
return;
if (b === "destroy" && this.remove(I, ht), b === "changeId") {
var kt = this.modelId(I.previousAttributes(), I.idAttribute), Ot = this.modelId(I.attributes, I.idAttribute);
kt != null && delete this._byId[kt], Ot != null && (this._byId[Ot] = I);
}
}
this.trigger.apply(this, arguments);
} });
var N = typeof Symbol == "function" && Symbol.iterator;
N && (nt.prototype[N] = nt.prototype.values);
var Lt = function(b, I) {
this._collection = b, this._kind = I, this._index = 0;
}, Tt = 1, Qt = 2, Oe = 3;
N && (Lt.prototype[N] = function() {
return this;
}), Lt.prototype.next = function() {
if (this._collection) {
if (this._index < this._collection.length) {
var b, I = this._collection.at(this._index);
if (this._index++, this._kind === Tt)
b = I;
else {
var U = this._collection.modelId(I.attributes, I.idAttribute);
b = this._kind === Qt ? U : [U, I];
}
return { value: b, done: !1 };
}
this._collection = void 0;
}
return { value: void 0, done: !0 };
};
var Se = M.View = function(b) {
this.cid = D.uniqueId("view"), this.preinitialize.apply(this, arguments), D.extend(this, D.pick(b, De)), this._ensureElement(), this.initialize.apply(this, arguments);
}, _e = /^(\S+)\s*(.*)$/, De = ["model", "collection", "el", "id", "attributes", "className", "tagName", "events"];
D.extend(Se.prototype, Dt, { tagName: "div", $: function(b) {
return this.$el.find(b);
}, preinitialize: function() {
}, initialize: function() {
}, render: function() {
return this;
}, remove: function() {
return this._removeElement(), this.stopListening(), this;
}, _removeElement: function() {
this.$el.remove();
}, setElement: function(b) {
return this.undelegateEvents(), this._setElement(b), this.delegateEvents(), this;
}, _setElement: function(b) {
this.$el = b instanceof M.$ ? b : M.$(b), this.el = this.$el[0];
}, delegateEvents: function(b) {
if (b || (b = D.result(this, "events")), !b)
return this;
for (var I in this.undelegateEvents(), b) {
var U = b[I];
if (D.isFunction(U) || (U = this[U]), U) {
var ht = I.match(_e);
this.delegate(ht[1], ht[2], U.bind(this));
}
}
return this;
}, delegate: function(b, I, U) {
return this.$el.on(b + ".delegateEvents" + this.cid, I, U), this;
}, undelegateEvents: function() {
return this.$el && this.$el.off(".delegateEvents" + this.cid), this;
}, undelegate: function(b, I, U) {
return this.$el.off(b + ".delegateEvents" + this.cid, I, U), this;
}, _createElement: function(b) {
return document.createElement(b);
}, _ensureElement: function() {
if (this.el)
this.setElement(D.result(this, "el"));
else {
var b = D.extend({}, D.result(this, "attributes"));
this.id && (b.id = D.result(this, "id")), this.className && (b.class = D.result(this, "className")), this.setElement(this._createElement(D.result(this, "tagName"))), this._setAttributes(b);
}
}, _setAttributes: function(b) {
this.$el.attr(b);
} });
var xe = function(b, I, U, ht) {
switch (I) {
case 1:
return function() {
return b[U](this[ht]);
};
case 2:
return function(kt) {
return b[U](this[ht], kt);
};
case 3:
return function(kt, Ot) {
return b[U](this[ht], be(kt, this), Ot);
};
case 4:
return function(kt, Ot, fe) {
return b[U](this[ht], be(kt, this), Ot, fe);
};
default:
return function() {
var kt = Et.call(arguments);
return kt.unshift(this[ht]), b[U].apply(b, kt);
};
}
}, Te = function(b, I, U, ht) {
D.each(U, function(kt, Ot) {
I[Ot] && (b.prototype[Ot] = xe(I, kt, Ot, ht));
});
}, be = function(b, I) {
return D.isFunction(b) ? b : D.isObject(b) && !I._isModel(b) ? ge(b) : D.isString(b) ? function(U) {
return U.get(b);
} : b;
}, ge = function(b) {
var I = D.matches(b);
return function(U) {
return I(U.attributes);
};
}, pe = { 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 }, ce = { keys: 1, values: 1, pairs: 1, invert: 1, pick: 0, omit: 0, chain: 1, isEmpty: 1 };
D.each([[nt, pe, "models"], [Y, ce, "attributes"]], function(b) {
var I = b[0], U = b[1], ht = b[2];
I.mixin = function(kt) {
var Ot = D.reduce(D.functions(kt), function(fe, ke) {
return fe[ke] = 0, fe;
}, {});
Te(I, kt, Ot, ht);
}, Te(I, D, U, ht);
}), M.sync = function(b, I, U) {
var ht = st[b];
D.defaults(U || (U = {}), { emulateHTTP: M.emulateHTTP, emulateJSON: M.emulateJSON });
var kt = { type: ht, dataType: "json" };
if (U.url || (kt.url = D.result(I, "url") || mt()), U.data != null || !I || b !== "create" && b !== "update" && b !== "patch" || (kt.contentType = "application/json", kt.data = JSON.stringify(U.attrs || I.toJSON(U))), U.emulateJSON && (kt.contentType = "application/x-www-form-urlencoded", kt.data = kt.data ? { model: kt.data } : {}), U.emulateHTTP && (ht === "PUT" || ht === "DELETE" || ht === "PATCH")) {
kt.type = "POST", U.emulateJSON && (kt.data._method = ht);
var Ot = U.beforeSend;
U.beforeSend = function(Ve) {
if (Ve.setRequestHeader("X-HTTP-Method-Override", ht), Ot)
return Ot.apply(this, arguments);
};
}
kt.type === "GET" || U.emulateJSON || (kt.processData = !1);
var fe = U.error;
U.error = function(Ve, ze, Qe) {
U.textStatus = ze, U.errorThrown = Qe, fe && fe.call(U.context, Ve, ze, Qe);
};
var ke = U.xhr = M.ajax(D.extend(kt, U));
return I.trigger("request", I, ke, U), ke;
};
var st = { create: "POST", update: "PUT", patch: "PATCH", delete: "DELETE", read: "GET" };
M.ajax = function() {
return M.$.ajax.apply(M.$, arguments);
};
var Xt = M.Router = function(b) {
b || (b = {}), this.preinitialize.apply(this, arguments), b.routes && (this.routes = b.routes), this._bindRoutes(), this.initialize.apply(this, arguments);
}, qt = /\((.*?)\)/g, ne = /(\(\?)?:\w+/g, ae = /\*\w+/g, Zt = /[\-{}\[\]+?.,\\\^$|#\s]/g;
D.extend(Xt.prototype, Dt, { preinitialize: function() {
}, initialize: function() {
}, route: function(b, I, U) {
D.isRegExp(b) || (b = this._routeToRegExp(b)), D.isFunction(I) && (U = I, I = ""), U || (U = this[I]);
var ht = this;
return M.history.route(b, function(kt) {
var Ot = ht._extractParameters(b, kt);
ht.execute(U, Ot, I) !== !1 && (ht.trigger.apply(ht, ["route:" + I].concat(Ot)), ht.trigger("route", I, Ot), M.history.trigger("route", ht, I, Ot));
}), this;
}, execute: function(b, I, U) {
b && b.apply(this, I);
}, navigate: function(b, I) {
return M.history.navigate(b, I), this;
}, _bindRoutes: function() {
if (this.routes) {
this.routes = D.result(this, "routes");
for (var b, I = D.keys(this.routes); (b = I.pop()) != null; )
this.route(b, this.routes[b]);
}
}, _routeToRegExp: function(b) {
return b = b.replace(Zt, "\\$&").replace(qt, "(?:$1)?").replace(ne, function(I, U) {
return U ? I : "([^/?]+)";
}).replace(ae, "([^?]*?)"), new RegExp("^" + b + "(?:\\?([\\s\\S]*))?$");
}, _extractParameters: function(b, I) {
var U = b.exec(I).slice(1);
return D.map(U, function(ht, kt) {
return kt === U.length - 1 ? ht || null : ht ? decodeURIComponent(ht) : null;
});
} });
var Ae = M.History = function() {
this.handlers = [], this.checkUrl = this.checkUrl.bind(this), typeof window < "u" && (this.location = window.location, this.history = window.history);
}, Ke = /^[#\/]|\s+$/g, Xe = /^\/+|\/+$/g, vn = /#.*$/;
Ae.started = !1, D.extend(Ae.prototype, Dt, { 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(b) {
return decodeURI(b.replace(/%25/g, "%2525"));
}, getSearch: function() {
var b = this.location.href.replace(/#.*/, "").match(/\?.+/);
return b ? b[0] : "";
}, getHash: function(b) {
var I = (b || this).location.href.match(/#(.*)$/);
return I ? I[1] : "";
}, getPath: function() {
var b = this.decodeFragment(this.location.pathname + this.getSearch()).slice(this.root.length - 1);
return b.charAt(0) === "/" ? b.slice(1) : b;
}, getFragment: function(b) {
return b == null && (b = this._usePushState || !this._wantsHashChange ? this.getPath() : this.getHash()), b.replace(Ke, "");
}, start: function(b) {
if (Ae.started)
throw new Error("Backbone.history has already been started");
if (Ae.started = !0, this.options = D.extend({ root: "/" }, this.options, b), this.root = this.options.root, this._wantsHashChange = this.options.hashChange !== !1, this._hasHashChange = "onhashchange" in window && (document.documentMode === void 0 || 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(Xe, "/"), this._wantsHashChange && this._wantsPushState) {
if (!this._hasPushState && !this.atRoot()) {
var I = this.root.slice(0, -1) || "/";
return this.location.replace(I + "#" + this.getPath()), !0;
}
this._hasPushState && this.atRoot() && this.navigate(this.getHash(), { replace: !0 });
}
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 U = document.body, ht = U.insertBefore(this.iframe, U.firstChild).contentWindow;
ht.document.open(), ht.document.close(), ht.location.hash = "#" + this.fragment;
}
var kt = window.addEventListener || function(Ot, fe) {
return attachEvent("on" + Ot, fe);
};
if (this._usePushState ? kt("popstate", this.checkUrl, !1) : this._useHashChange && !this.iframe ? kt("hashchange", this.checkUrl, !1) : this._wantsHashChange && (this._checkUrlInterval = setInterval(this.checkUrl, this.interval)), !this.options.silent)
return this.loadUrl();
}, stop: function() {
var b = window.removeEventListener || function(I, U) {
return detachEvent("on" + I, U);
};
this._usePushState ? b("popstate", this.checkUrl, !1) : this._useHashChange && !this.iframe && b("hashchange", this.checkUrl, !1), this.iframe && (document.body.removeChild(this.iframe), this.iframe = null), this._checkUrlInterval && clearInterval(this._checkUrlInterval), Ae.started = !1;
}, route: function(b, I) {
this.handlers.unshift({ route: b, callback: I });
}, checkUrl: function(b) {
var I = this.getFragment();
if (I === this.fragment && this.iframe && (I = this.getHash(this.iframe.contentWindow)), I === this.fragment)
return !1;
this.iframe && this.navigate(I), this.loadUrl();
}, loadUrl: function(b) {
return !!this.matchRoot() && (b = this.fragment = this.getFragment(b), D.some(this.handlers, function(I) {
if (I.route.test(b))
return I.callback(b), !0;
}));
}, navigate: function(b, I) {
if (!Ae.started)
return !1;
I && I !== !0 || (I = { trigger: !!I }), b = this.getFragment(b || "");
var U = this.root;
b !== "" && b.charAt(0) !== "?" || (U = U.slice(0, -1) || "/");
var ht = U + b;
b = b.replace(vn, "");
var kt = this.decodeFragment(b);
if (this.fragment !== kt) {
if (this.fragment = kt, this._usePushState)
this.history[I.replace ? "replaceState" : "pushState"]({}, document.title, ht);
else {
if (!this._wantsHashChange)
return this.location.assign(ht);
if (this._updateHash(this.location, b, I.replace), this.iframe && b !== this.getHash(this.iframe.contentWindow)) {
var Ot = this.iframe.contentWindow;
I.replace || (Ot.document.open(), Ot.document.close()), this._updateHash(Ot.location, b, I.replace);
}
}
return I.trigger ? this.loadUrl(b) : void 0;
}
}, _updateHash: function(b, I, U) {
if (U) {
var ht = b.href.replace(/(javascript:|#).*$/, "");
b.replace(ht + "#" + I);
} else
b.hash = "#" + I;
} }), M.history = new Ae();
var Rn = function(b, I) {
var U, ht = this;
return U = b && D.has(b, "constructor") ? b.constructor : function() {
return ht.apply(this, arguments);
}, D.extend(U, ht, I), U.prototype = D.create(ht.prototype, b), U.prototype.constructor = U, U.__super__ = ht.prototype, U;
};
Y.extend = nt.extend = Xt.extend = Se.extend = Ae.extend = Rn;
var mt = function() {
throw new Error('A "url" property or function must be specified');
}, zt = function(b, I) {
var U = I.error;
I.error = function(ht) {
U && U.call(I.context, b, ht, I), b.trigger("error", b, ht, I);
};
};
return M;
}(W, P, z, k);
}.apply(H, at), _t === void 0 || (S.exports = _t);
})();
}, 210: (S, H, pt) => {
(function(at) {
at.extendMode("css", { commentStart: "/*", commentEnd: "*/", newlineAfterToken: function(J, W) {
return /^[;{}]$/.test(W);
} }), at.extendMode("javascript", { commentStart: "/*", commentEnd: "*/", newlineAfterToken: function(J, W, z, k) {
return this.jsonMode ? /^[\[,{]$/.test(W) || /^}/.test(z) : (W != ";" || !k.lexical || k.lexical.type != ")") && /^[;{}]$/.test(W) && !/^;/.test(z);
} });
var _t = /^(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)$/;
at.extendMode("xml", { commentStart: "", newlineAfterToken: function(J, W, z, k) {
var P = !1;
return this.configuration == "html" && (P = !!k.context && _t.test(k.context.tagName)), !P && (J == "tag" && />$/.test(W) && k.context || /^ -1 && D > -1 && D > M && (E = E.substr(0, M) + E.substring(M + P.commentStart.length, D) + E.substr(D + P.commentEnd.length)), k.replaceRange(E, W, z);
}
});
}), at.defineExtension("autoIndentRange", function(J, W) {
var z = this;
this.operation(function() {
for (var k = J.line; k <= W.line; k++)
z.indentLine(k, "smart");
});
}), at.defineExtension("autoFormatRange", function(J, W) {
var z = this, k = z.getMode(), P = z.getRange(J, W).split(`
`), E = at.copyState(k, z.getTokenAt(J).state), M = z.getOption("tabSize"), D = "", ot = 0, it = J.ch === 0;
function Et() {
D += `
`, it = !0, ++ot;
}
for (var jt = 0; jt < P.length; ++jt) {
for (var Dt = new at.StringStream(P[jt], M); !Dt.eol(); ) {
var ee = at.innerMode(k, E), xt = k.token(Dt, E), bt = Dt.current();
Dt.start = Dt.pos, it && !/\S/.test(bt) || (D += bt, it = !1), !it && ee.mode.newlineAfterToken && ee.mode.newlineAfterToken(xt, bt, Dt.string.slice(Dt.pos) || P[jt + 1] || "", ee.state) && Et();
}
!Dt.pos && k.blankLine && k.blankLine(E), !it && jt < P.length - 1 && Et();
}
z.operation(function() {
z.replaceRange(D, J, W);
for (var Wt = J.line + 1, Ft = J.line + ot; Wt <= Ft; ++Wt)
z.indentLine(Wt, "smart");
z.setSelection(J, z.getCursor(!1));
});
});
})(pt(631));
}, 631: function(S) {
S.exports = function() {
var H = navigator.userAgent, pt = navigator.platform, at = /gecko\/\d/i.test(H), _t = /MSIE \d/.test(H), J = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(H), W = /Edge\/(\d+)/.exec(H), z = _t || J || W, k = z && (_t ? document.documentMode || 6 : +(W || J)[1]), P = !W && /WebKit\//.test(H), E = P && /Qt\/\d+\.\d+/.test(H), M = !W && /Chrome\/(\d+)/.exec(H), D = M && +M[1], ot = /Opera\//.test(H), it = /Apple Computer/.test(navigator.vendor), Et = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(H), jt = /PhantomJS/.test(H), Dt = it && (/Mobile\/\w+/.test(H) || navigator.maxTouchPoints > 2), ee = /Android/.test(H), xt = Dt || ee || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(H), bt = Dt || /Mac/.test(pt), Wt = /\bCrOS\b/.test(H), Ft = /win/i.test(pt), Ht = ot && H.match(/Version\/(\d*\.\d*)/);
Ht && (Ht = Number(Ht[1])), Ht && Ht >= 15 && (ot = !1, P = !0);
var Q = bt && (E || ot && (Ht == null || Ht < 12.11)), j = at || z && k >= 9;
function V(o) {
return new RegExp("(^|\\s)" + o + "(?:$|\\s)\\s*");
}
var Y, nt = function(o, s) {
var u = o.className, c = V(s).exec(u);
if (c) {
var p = u.slice(c.index + c[0].length);
o.className = u.slice(0, c.index) + (p ? c[1] + p : "");
}
};
function wt(o) {
for (var s = o.childNodes.length; s > 0; --s)
o.removeChild(o.firstChild);
return o;
}
function rt(o, s) {
return wt(o).appendChild(s);
}
function gt(o, s, u, c) {
var p = document.createElement(o);
if (u && (p.className = u), c && (p.style.cssText = c), typeof s == "string")
p.appendChild(document.createTextNode(s));
else if (s)
for (var g = 0; g < s.length; ++g)
p.appendChild(s[g]);
return p;
}
function N(o, s, u, c) {
var p = gt(o, s, u, c);
return p.setAttribute("role", "presentation"), p;
}
function Lt(o, s) {
if (s.nodeType == 3 && (s = s.parentNode), o.contains)
return o.contains(s);
do
if (s.nodeType == 11 && (s = s.host), s == o)
return !0;
while (s = s.parentNode);
}
function Tt() {
var o;
try {
o = document.activeElement;
} catch {
o = document.body || null;
}
for (; o && o.shadowRoot && o.shadowRoot.activeElement; )
o = o.shadowRoot.activeElement;
return o;
}
function Qt(o, s) {
var u = o.className;
V(s).test(u) || (o.className += (u ? " " : "") + s);
}
function Oe(o, s) {
for (var u = o.split(" "), c = 0; c < u.length; c++)
u[c] && !V(u[c]).test(s) && (s += " " + u[c]);
return s;
}
Y = document.createRange ? function(o, s, u, c) {
var p = document.createRange();
return p.setEnd(c || o, u), p.setStart(o, s), p;
} : function(o, s, u) {
var c = document.body.createTextRange();
try {
c.moveToElementText(o.parentNode);
} catch {
return c;
}
return c.collapse(!0), c.moveEnd("character", u), c.moveStart("character", s), c;
};
var Se = function(o) {
o.select();
};
function _e(o) {
var s = Array.prototype.slice.call(arguments, 1);
return function() {
return o.apply(null, s);
};
}
function De(o, s, u) {
for (var c in s || (s = {}), o)
!o.hasOwnProperty(c) || u === !1 && s.hasOwnProperty(c) || (s[c] = o[c]);
return s;
}
function xe(o, s, u, c, p) {
s == null && (s = o.search(/[^\s\u00a0]/)) == -1 && (s = o.length);
for (var g = c || 0, m = p || 0; ; ) {
var y = o.indexOf(" ", g);
if (y < 0 || y >= s)
return m + (s - g);
m += y - g, m += u - m % u, g = y + 1;
}
}
Dt ? Se = function(o) {
o.selectionStart = 0, o.selectionEnd = o.value.length;
} : z && (Se = function(o) {
try {
o.select();
} catch {
}
});
var Te = function() {
this.id = null, this.f = null, this.time = 0, this.handler = _e(this.onTimeout, this);
};
function be(o, s) {
for (var u = 0; u < o.length; ++u)
if (o[u] == s)
return u;
return -1;
}
Te.prototype.onTimeout = function(o) {
o.id = 0, o.time <= +/* @__PURE__ */ new Date() ? o.f() : setTimeout(o.handler, o.time - +/* @__PURE__ */ new Date());
}, Te.prototype.set = function(o, s) {
this.f = s;
var u = +/* @__PURE__ */ new Date() + o;
(!this.id || u < this.time) && (clearTimeout(this.id), this.id = setTimeout(this.handler, o), this.time = u);
};
var ge = 50, pe = { toString: function() {
return "CodeMirror.Pass";
} }, ce = { scroll: !1 }, st = { origin: "*mouse" }, Xt = { origin: "+move" };
function qt(o, s, u) {
for (var c = 0, p = 0; ; ) {
var g = o.indexOf(" ", c);
g == -1 && (g = o.length);
var m = g - c;
if (g == o.length || p + m >= s)
return c + Math.min(m, s - p);
if (p += g - c, c = g + 1, (p += u - p % u) >= s)
return c;
}
}
var ne = [""];
function ae(o) {
for (; ne.length <= o; )
ne.push(Zt(ne) + " ");
return ne[o];
}
function Zt(o) {
return o[o.length - 1];
}
function Ae(o, s) {
for (var u = [], c = 0; c < o.length; c++)
u[c] = s(o[c], c);
return u;
}
function Ke(o, s, u) {
for (var c = 0, p = u(s); c < o.length && u(o[c]) <= p; )
c++;
o.splice(c, 0, s);
}
function Xe() {
}
function vn(o, s) {
var u;
return Object.create ? u = Object.create(o) : (Xe.prototype = o, u = new Xe()), s && De(s, u), u;
}
var Rn = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;
function mt(o) {
return /\w/.test(o) || o > "" && (o.toUpperCase() != o.toLowerCase() || Rn.test(o));
}
function zt(o, s) {
return s ? !!(s.source.indexOf("\\w") > -1 && mt(o)) || s.test(o) : mt(o);
}
function b(o) {
for (var s in o)
if (o.hasOwnProperty(s) && o[s])
return !1;
return !0;
}
var I = /[\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 U(o) {
return o.charCodeAt(0) >= 768 && I.test(o);
}
function ht(o, s, u) {
for (; (u < 0 ? s > 0 : s < o.length) && U(o.charAt(s)); )
s += u;
return s;
}
function kt(o, s, u) {
for (var c = s > u ? -1 : 1; ; ) {
if (s == u)
return s;
var p = (s + u) / 2, g = c < 0 ? Math.ceil(p) : Math.floor(p);
if (g == s)
return o(g) ? s : u;
o(g) ? u = g : s = g + c;
}
}
function Ot(o, s, u, c) {
if (!o)
return c(s, u, "ltr", 0);
for (var p = !1, g = 0; g < o.length; ++g) {
var m = o[g];
(m.from < u && m.to > s || s == u && m.to == s) && (c(Math.max(m.from, s), Math.min(m.to, u), m.level == 1 ? "rtl" : "ltr", g), p = !0);
}
p || c(s, u, "ltr");
}
var fe = null;
function ke(o, s, u) {
var c;
fe = null;
for (var p = 0; p < o.length; ++p) {
var g = o[p];
if (g.from < s && g.to > s)
return p;
g.to == s && (g.from != g.to && u == "before" ? c = p : fe = p), g.from == s && (g.from != g.to && u != "before" ? c = p : fe = p);
}
return c ?? fe;
}
var Ve = function() {
var o = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN", s = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";
function u(O) {
return O <= 247 ? o.charAt(O) : 1424 <= O && O <= 1524 ? "R" : 1536 <= O && O <= 1785 ? s.charAt(O - 1536) : 1774 <= O && O <= 2220 ? "r" : 8192 <= O && O <= 8203 ? "w" : O == 8204 ? "b" : "L";
}
var c = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/, p = /[stwN]/, g = /[LRr]/, m = /[Lb1n]/, y = /[1n]/;
function x(O, B, $) {
this.level = O, this.from = B, this.to = $;
}
return function(O, B) {
var $ = B == "ltr" ? "L" : "R";
if (O.length == 0 || B == "ltr" && !c.test(O))
return !1;
for (var ft = O.length, dt = [], Ct = 0; Ct < ft; ++Ct)
dt.push(u(O.charCodeAt(Ct)));
for (var Rt = 0, $t = $; Rt < ft; ++Rt) {
var re = dt[Rt];
re == "m" ? dt[Rt] = $t : $t = re;
}
for (var le = 0, Jt = $; le < ft; ++le) {
var ye = dt[le];
ye == "1" && Jt == "r" ? dt[le] = "n" : g.test(ye) && (Jt = ye, ye == "r" && (dt[le] = "R"));
}
for (var me = 1, Ce = dt[0]; me < ft - 1; ++me) {
var sn = dt[me];
sn == "+" && Ce == "1" && dt[me + 1] == "1" ? dt[me] = "1" : sn != "," || Ce != dt[me + 1] || Ce != "1" && Ce != "n" || (dt[me] = Ce), Ce = sn;
}
for (var an = 0; an < ft; ++an) {
var gr = dt[an];
if (gr == ",")
dt[an] = "N";
else if (gr == "%") {
var hn = void 0;
for (hn = an + 1; hn < ft && dt[hn] == "%"; ++hn)
;
for (var sr = an && dt[an - 1] == "!" || hn < ft && dt[hn] == "1" ? "1" : "N", vr = an; vr < hn; ++vr)
dt[vr] = sr;
an = hn - 1;
}
}
for (var xn = 0, En = $; xn < ft; ++xn) {
var dr = dt[xn];
En == "L" && dr == "1" ? dt[xn] = "L" : g.test(dr) && (En = dr);
}
for (var Vn = 0; Vn < ft; ++Vn)
if (p.test(dt[Vn])) {
var An = void 0;
for (An = Vn + 1; An < ft && p.test(dt[An]); ++An)
;
for (var jn = (Vn ? dt[Vn - 1] : $) == "L", mr = jn == ((An < ft ? dt[An] : $) == "L") ? jn ? "L" : "R" : $, ri = Vn; ri < An; ++ri)
dt[ri] = mr;
Vn = An - 1;
}
for (var fo, ar = [], Cn = 0; Cn < ft; )
if (m.test(dt[Cn])) {
var bc = Cn;
for (++Cn; Cn < ft && m.test(dt[Cn]); ++Cn)
;
ar.push(new x(0, bc, Cn));
} else {
var Fo = Cn, Li = ar.length, Di = B == "rtl" ? 1 : 0;
for (++Cn; Cn < ft && dt[Cn] != "L"; ++Cn)
;
for (var zn = Fo; zn < Cn; )
if (y.test(dt[zn])) {
Fo < zn && (ar.splice(Li, 0, new x(1, Fo, zn)), Li += Di);
var Cs = zn;
for (++zn; zn < Cn && y.test(dt[zn]); ++zn)
;
ar.splice(Li, 0, new x(2, Cs, zn)), Li += Di, Fo = zn;
} else
++zn;
Fo < Cn && ar.splice(Li, 0, new x(1, Fo, Cn));
}
return B == "ltr" && (ar[0].level == 1 && (fo = O.match(/^\s+/)) && (ar[0].from = fo[0].length, ar.unshift(new x(0, 0, fo[0].length))), Zt(ar).level == 1 && (fo = O.match(/\s+$/)) && (Zt(ar).to -= fo[0].length, ar.push(new x(0, ft - fo[0].length, ft)))), B == "rtl" ? ar.reverse() : ar;
};
}();
function ze(o, s) {
var u = o.order;
return u == null && (u = o.order = Ve(o.text, s)), u;
}
var Qe = [], Kt = function(o, s, u) {
if (o.addEventListener)
o.addEventListener(s, u, !1);
else if (o.attachEvent)
o.attachEvent("on" + s, u);
else {
var c = o._handlers || (o._handlers = {});
c[s] = (c[s] || Qe).concat(u);
}
};
function R(o, s) {
return o._handlers && o._handlers[s] || Qe;
}
function tt(o, s, u) {
if (o.removeEventListener)
o.removeEventListener(s, u, !1);
else if (o.detachEvent)
o.detachEvent("on" + s, u);
else {
var c = o._handlers, p = c && c[s];
if (p) {
var g = be(p, u);
g > -1 && (c[s] = p.slice(0, g).concat(p.slice(g + 1)));
}
}
}
function ut(o, s) {
var u = R(o, s);
if (u.length)
for (var c = Array.prototype.slice.call(arguments, 2), p = 0; p < u.length; ++p)
u[p].apply(null, c);
}
function yt(o, s, u) {
return typeof s == "string" && (s = { type: s, preventDefault: function() {
this.defaultPrevented = !0;
} }), ut(o, u || s.type, o, s), pn(s) || s.codemirrorIgnore;
}
function Yt(o) {
var s = o._handlers && o._handlers.cursorActivity;
if (s)
for (var u = o.curOp.cursorActivityHandlers || (o.curOp.cursorActivityHandlers = []), c = 0; c < s.length; ++c)
be(u, s[c]) == -1 && u.push(s[c]);
}
function he(o, s) {
return R(o, s).length > 0;
}
function Re(o) {
o.prototype.on = function(s, u) {
Kt(this, s, u);
}, o.prototype.off = function(s, u) {
tt(this, s, u);
};
}
function We(o) {
o.preventDefault ? o.preventDefault() : o.returnValue = !1;
}
function Ln(o) {
o.stopPropagation ? o.stopPropagation() : o.cancelBubble = !0;
}
function pn(o) {
return o.defaultPrevented != null ? o.defaultPrevented : o.returnValue == 0;
}
function Ne(o) {
We(o), Ln(o);
}
function Ar(o) {
return o.target || o.srcElement;
}
function Yn(o) {
var s = o.which;
return s == null && (1 & o.button ? s = 1 : 2 & o.button ? s = 3 : 4 & o.button && (s = 2)), bt && o.ctrlKey && s == 1 && (s = 3), s;
}
var jr, fn, _n = function() {
if (z && k < 9)
return !1;
var o = gt("div");
return "draggable" in o || "dragDrop" in o;
}();
function Bn(o) {
if (jr == null) {
var s = gt("span", "");
rt(o, gt("span", [s, document.createTextNode("x")])), o.firstChild.offsetHeight != 0 && (jr = s.offsetWidth <= 1 && s.offsetHeight > 2 && !(z && k < 8));
}
var u = jr ? gt("span", "") : gt("span", " ", null, "display: inline-block; width: 1px; margin-right: -1px");
return u.setAttribute("cm-text", ""), u;
}
function Mr(o) {
if (fn != null)
return fn;
var s = rt(o, document.createTextNode("AخA")), u = Y(s, 0, 1).getBoundingClientRect(), c = Y(s, 1, 2).getBoundingClientRect();
return wt(o), !(!u || u.left == u.right) && (fn = c.right - u.right < 3);
}
var Dn, _o = `
b`.split(/\n/).length != 3 ? function(o) {
for (var s = 0, u = [], c = o.length; s <= c; ) {
var p = o.indexOf(`
`, s);
p == -1 && (p = o.length);
var g = o.slice(s, o.charAt(p - 1) == "\r" ? p - 1 : p), m = g.indexOf("\r");
m != -1 ? (u.push(g.slice(0, m)), s += m + 1) : (u.push(g), s = p + 1);
}
return u;
} : function(o) {
return o.split(/\r\n?|\n/);
}, Vo = window.getSelection ? function(o) {
try {
return o.selectionStart != o.selectionEnd;
} catch {
return !1;
}
} : function(o) {
var s;
try {
s = o.ownerDocument.selection.createRange();
} catch {
}
return !(!s || s.parentElement() != o) && s.compareEndPoints("StartToEnd", s) != 0;
}, xo = "oncopy" in (Dn = gt("div")) || (Dn.setAttribute("oncopy", "return;"), typeof Dn.oncopy == "function"), Ro = null;
function ro(o) {
if (Ro != null)
return Ro;
var s = rt(o, gt("span", "x")), u = s.getBoundingClientRect(), c = Y(s, 0, 1).getBoundingClientRect();
return Ro = Math.abs(u.left - c.left) > 1;
}
var ur = {}, ln = {};
function Ho(o, s) {
arguments.length > 2 && (s.dependencies = Array.prototype.slice.call(arguments, 2)), ur[o] = s;
}
function Lr(o, s) {
ln[o] = s;
}
function Co(o) {
if (typeof o == "string" && ln.hasOwnProperty(o))
o = ln[o];
else if (o && typeof o.name == "string" && ln.hasOwnProperty(o.name)) {
var s = ln[o.name];
typeof s == "string" && (s = { name: s }), (o = vn(s, o)).name = s.name;
} else {
if (typeof o == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(o))
return Co("application/xml");
if (typeof o == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(o))
return Co("application/json");
}
return typeof o == "string" ? { name: o } : o || { name: "null" };
}
function Jr(o, s) {
s = Co(s);
var u = ur[s.name];
if (!u)
return Jr(o, "text/plain");
var c = u(o, s);
if (Wn.hasOwnProperty(s.name)) {
var p = Wn[s.name];
for (var g in p)
p.hasOwnProperty(g) && (c.hasOwnProperty(g) && (c["_" + g] = c[g]), c[g] = p[g]);
}
if (c.name = s.name, s.helperType && (c.helperType = s.helperType), s.modeProps)
for (var m in s.modeProps)
c[m] = s.modeProps[m];
return c;
}
var Wn = {};
function Nn(o, s) {
De(s, Wn.hasOwnProperty(o) ? Wn[o] : Wn[o] = {});
}
function $n(o, s) {
if (s === !0)
return s;
if (o.copyState)
return o.copyState(s);
var u = {};
for (var c in s) {
var p = s[c];
p instanceof Array && (p = p.concat([])), u[c] = p;
}
return u;
}
function zo(o, s) {
for (var u; o.innerMode && (u = o.innerMode(s)) && u.mode != o; )
s = u.state, o = u.mode;
return u || { mode: o, state: s };
}
function mo(o, s, u) {
return !o.startState || o.startState(s, u);
}
var qe = function(o, s, u) {
this.pos = this.start = 0, this.string = o, this.tabSize = s || 8, this.lastColumnPos = this.lastColumnValue = 0, this.lineStart = 0, this.lineOracle = u;
};
function ve(o, s) {
if ((s -= o.first) < 0 || s >= o.size)
throw new Error("There is no line " + (s + o.first) + " in the document.");
for (var u = o; !u.lines; )
for (var c = 0; ; ++c) {
var p = u.children[c], g = p.chunkSize();
if (s < g) {
u = p;
break;
}
s -= g;
}
return u.lines[s];
}
function rr(o, s, u) {
var c = [], p = s.line;
return o.iter(s.line, u.line + 1, function(g) {
var m = g.text;
p == u.line && (m = m.slice(0, u.ch)), p == s.line && (m = m.slice(s.ch)), c.push(m), ++p;
}), c;
}
function Uo(o, s, u) {
var c = [];
return o.iter(s, u, function(p) {
c.push(p.text);
}), c;
}
function or(o, s) {
var u = s - o.height;
if (u)
for (var c = o; c; c = c.parent)
c.height += u;
}
function Ye(o) {
if (o.parent == null)
return null;
for (var s = o.parent, u = be(s.lines, o), c = s.parent; c; s = c, c = c.parent)
for (var p = 0; c.children[p] != s; ++p)
u += c.children[p].chunkSize();
return u + s.first;
}
function In(o, s) {
var u = o.first;
t:
do {
for (var c = 0; c < o.children.length; ++c) {
var p = o.children[c], g = p.height;
if (s < g) {
o = p;
continue t;
}
s -= g, u += p.chunkSize();
}
return u;
} while (!o.lines);
for (var m = 0; m < o.lines.length; ++m) {
var y = o.lines[m].height;
if (s < y)
break;
s -= y;
}
return u + m;
}
function yo(o, s) {
return s >= o.first && s < o.first + o.size;
}
function Bo(o, s) {
return String(o.lineNumberFormatter(s + o.firstLineNumber));
}
function Bt(o, s, u) {
if (u === void 0 && (u = null), !(this instanceof Bt))
return new Bt(o, s, u);
this.line = o, this.ch = s, this.sticky = u;
}
function T(o, s) {
return o.line - s.line || o.ch - s.ch;
}
function G(o, s) {
return o.sticky == s.sticky && T(o, s) == 0;
}
function Mt(o) {
return Bt(o.line, o.ch);
}
function te(o, s) {
return T(o, s) < 0 ? s : o;
}
function de(o, s) {
return T(o, s) < 0 ? o : s;
}
function $e(o, s) {
return Math.max(o.first, Math.min(s, o.first + o.size - 1));
}
function oe(o, s) {
if (s.line < o.first)
return Bt(o.first, 0);
var u = o.first + o.size - 1;
return s.line > u ? Bt(u, ve(o, u).text.length) : Hn(s, ve(o, s.line).text.length);
}
function Hn(o, s) {
var u = o.ch;
return u == null || u > s ? Bt(o.line, s) : u < 0 ? Bt(o.line, 0) : o;
}
function Tn(o, s) {
for (var u = [], c = 0; c < s.length; c++)
u[c] = oe(o, s[c]);
return u;
}
qe.prototype.eol = function() {
return this.pos >= this.string.length;
}, qe.prototype.sol = function() {
return this.pos == this.lineStart;
}, qe.prototype.peek = function() {
return this.string.charAt(this.pos) || void 0;
}, qe.prototype.next = function() {
if (this.pos < this.string.length)
return this.string.charAt(this.pos++);
}, qe.prototype.eat = function(o) {
var s = this.string.charAt(this.pos);
if (typeof o == "string" ? s == o : s && (o.test ? o.test(s) : o(s)))
return ++this.pos, s;
}, qe.prototype.eatWhile = function(o) {
for (var s = this.pos; this.eat(o); )
;
return this.pos > s;
}, qe.prototype.eatSpace = function() {
for (var o = this.pos; /[\s\u00a0]/.test(this.string.charAt(this.pos)); )
++this.pos;
return this.pos > o;
}, qe.prototype.skipToEnd = function() {
this.pos = this.string.length;
}, qe.prototype.skipTo = function(o) {
var s = this.string.indexOf(o, this.pos);
if (s > -1)
return this.pos = s, !0;
}, qe.prototype.backUp = function(o) {
this.pos -= o;
}, qe.prototype.column = function() {
return this.lastColumnPos < this.start && (this.lastColumnValue = xe(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue), this.lastColumnPos = this.start), this.lastColumnValue - (this.lineStart ? xe(this.string, this.lineStart, this.tabSize) : 0);
}, qe.prototype.indentation = function() {
return xe(this.string, null, this.tabSize) - (this.lineStart ? xe(this.string, this.lineStart, this.tabSize) : 0);
}, qe.prototype.match = function(o, s, u) {
if (typeof o != "string") {
var c = this.string.slice(this.pos).match(o);
return c && c.index > 0 ? null : (c && s !== !1 && (this.pos += c[0].length), c);
}
var p = function(g) {
return u ? g.toLowerCase() : g;
};
if (p(this.string.substr(this.pos, o.length)) == p(o))
return s !== !1 && (this.pos += o.length), !0;
}, qe.prototype.current = function() {
return this.string.slice(this.start, this.pos);
}, qe.prototype.hideFirstChars = function(o, s) {
this.lineStart += o;
try {
return s();
} finally {
this.lineStart -= o;
}
}, qe.prototype.lookAhead = function(o) {
var s = this.lineOracle;
return s && s.lookAhead(o);
}, qe.prototype.baseToken = function() {
var o = this.lineOracle;
return o && o.baseToken(this.pos);
};
var Hi = function(o, s) {
this.state = o, this.lookAhead = s;
}, _r = function(o, s, u, c) {
this.state = s, this.doc = o, this.line = u, this.maxLookAhead = c || 0, this.baseTokens = null, this.baseTokenPos = 1;
};
function Ds(o, s, u, c) {
var p = [o.state.modeGen], g = {};
So(o, s.text, o.doc.mode, u, function(O, B) {
return p.push(O, B);
}, g, c);
for (var m = u.state, y = function(O) {
u.baseTokens = p;
var B = o.state.overlays[O], $ = 1, ft = 0;
u.state = !0, So(o, s.text, B.mode, u, function(dt, Ct) {
for (var Rt = $; ft < dt; ) {
var $t = p[$];
$t > dt && p.splice($, 1, dt, p[$ + 1], $t), $ += 2, ft = Math.min(dt, $t);
}
if (Ct)
if (B.opaque)
p.splice(Rt, $ - Rt, dt, "overlay " + Ct), $ = Rt + 2;
else
for (; Rt < $; Rt += 2) {
var re = p[Rt + 1];
p[Rt + 1] = (re ? re + " " : "") + "overlay " + Ct;
}
}, g), u.state = m, u.baseTokens = null, u.baseTokenPos = 1;
}, x = 0; x < o.state.overlays.length; ++x)
y(x);
return { styles: p, classes: g.bgClass || g.textClass ? g : null };
}
function xr(o, s, u) {
if (!s.styles || s.styles[0] != o.state.modeGen) {
var c = bo(o, Ye(s)), p = s.text.length > o.options.maxHighlightLength && $n(o.doc.mode, c.state), g = Ds(o, s, c);
p && (c.state = p), s.stateAfter = c.save(!p), s.styles = g.styles, g.classes ? s.styleClasses = g.classes : s.styleClasses && (s.styleClasses = null), u === o.doc.highlightFrontier && (o.doc.modeFrontier = Math.max(o.doc.modeFrontier, ++o.doc.highlightFrontier));
}
return s.styles;
}
function bo(o, s, u) {
var c = o.doc, p = o.display;
if (!c.mode.startState)
return new _r(c, !0, s);
var g = zi(o, s, u), m = g > c.first && ve(c, g - 1).stateAfter, y = m ? _r.fromSaved(c, m, g) : new _r(c, mo(c.mode), g);
return c.iter(g, s, function(x) {
oo(o, x.text, y);
var O = y.line;
x.stateAfter = O == s - 1 || O % 5 == 0 || O >= p.viewFrom && O < p.viewTo ? y.save() : null, y.nextLine();
}), u && (c.modeFrontier = y.line), y;
}
function oo(o, s, u, c) {
var p = o.doc.mode, g = new qe(s, o.options.tabSize, u);
for (g.start = g.pos = c || 0, s == "" && io(p, u.state); !g.eol(); )
Xn(p, g, u.state), g.start = g.pos;
}
function io(o, s) {
if (o.blankLine)
return o.blankLine(s);
if (o.innerMode) {
var u = zo(o, s);
return u.mode.blankLine ? u.mode.blankLine(u.state) : void 0;
}
}
function Xn(o, s, u, c) {
for (var p = 0; p < 10; p++) {
c && (c[0] = zo(o, u).mode);
var g = o.token(s, u);
if (s.pos > s.start)
return g;
}
throw new Error("Mode " + o.name + " failed to advance stream.");
}
_r.prototype.lookAhead = function(o) {
var s = this.doc.getLine(this.line + o);
return s != null && o > this.maxLookAhead && (this.maxLookAhead = o), s;
}, _r.prototype.baseToken = function(o) {
if (!this.baseTokens)
return null;
for (; this.baseTokens[this.baseTokenPos] <= o; )
this.baseTokenPos += 2;
var s = this.baseTokens[this.baseTokenPos + 1];
return { type: s && s.replace(/( |^)overlay .*/, ""), size: this.baseTokens[this.baseTokenPos] - o };
}, _r.prototype.nextLine = function() {
this.line++, this.maxLookAhead > 0 && this.maxLookAhead--;
}, _r.fromSaved = function(o, s, u) {
return s instanceof Hi ? new _r(o, $n(o.mode, s.state), u, s.lookAhead) : new _r(o, $n(o.mode, s), u);
}, _r.prototype.save = function(o) {
var s = o !== !1 ? $n(this.doc.mode, this.state) : this.state;
return this.maxLookAhead > 0 ? new Hi(s, this.maxLookAhead) : s;
};
var wo = function(o, s, u) {
this.start = o.start, this.end = o.pos, this.string = o.current(), this.type = s || null, this.state = u;
};
function Wo(o, s, u, c) {
var p, g, m = o.doc, y = m.mode, x = ve(m, (s = oe(m, s)).line), O = bo(o, s.line, u), B = new qe(x.text, o.options.tabSize, O);
for (c && (g = []); (c || B.pos < s.ch) && !B.eol(); )
B.start = B.pos, p = Xn(y, B, O.state), c && g.push(new wo(B, p, $n(m.mode, O.state)));
return c ? g : new wo(B, p, O.state);
}
function Ns(o, s) {
if (o)
for (; ; ) {
var u = o.match(/(?:^|\s+)line-(background-)?(\S+)/);
if (!u)
break;
o = o.slice(0, u.index) + o.slice(u.index + u[0].length);
var c = u[1] ? "bgClass" : "textClass";
s[c] == null ? s[c] = u[2] : new RegExp("(?:^|\\s)" + u[2] + "(?:$|\\s)").test(s[c]) || (s[c] += " " + u[2]);
}
return o;
}
function So(o, s, u, c, p, g, m) {
var y = u.flattenSpans;
y == null && (y = o.options.flattenSpans);
var x, O = 0, B = null, $ = new qe(s, o.options.tabSize, c), ft = o.options.addModeClass && [null];
for (s == "" && Ns(io(u, c.state), g); !$.eol(); ) {
if ($.pos > o.options.maxHighlightLength ? (y = !1, m && oo(o, s, c, $.pos), $.pos = s.length, x = null) : x = Ns(Xn(u, $, c.state, ft), g), ft) {
var dt = ft[0].name;
dt && (x = "m-" + (x ? dt + " " + x : dt));
}
if (!y || B != x) {
for (; O < $.start; )
p(O = Math.min($.start, O + 5e3), B);
B = x;
}
$.start = $.pos;
}
for (; O < $.pos; ) {
var Ct = Math.min($.pos, O + 5e3);
p(Ct, B), O = Ct;
}
}
function zi(o, s, u) {
for (var c, p, g = o.doc, m = u ? -1 : s - (o.doc.mode.innerMode ? 1e3 : 100), y = s; y > m; --y) {
if (y <= g.first)
return g.first;
var x = ve(g, y - 1), O = x.stateAfter;
if (O && (!u || y + (O instanceof Hi ? O.lookAhead : 0) <= g.modeFrontier))
return y;
var B = xe(x.text, null, o.options.tabSize);
(p == null || c > B) && (p = y - 1, c = B);
}
return p;
}
function Is(o, s) {
if (o.modeFrontier = Math.min(o.modeFrontier, s), !(o.highlightFrontier < s - 10)) {
for (var u = o.first, c = s - 1; c > u; c--) {
var p = ve(o, c).stateAfter;
if (p && (!(p instanceof Hi) || c + p.lookAhead < s)) {
u = c + 1;
break;
}
}
o.highlightFrontier = Math.min(o.highlightFrontier, u);
}
}
var Jn = !1, Zr = !1;
function fi() {
Jn = !0;
}
function Fs() {
Zr = !0;
}
function Cr(o, s, u) {
this.marker = o, this.from = s, this.to = u;
}
function Oo(o, s) {
if (o)
for (var u = 0; u < o.length; ++u) {
var c = o[u];
if (c.marker == s)
return c;
}
}
function di(o, s) {
for (var u, c = 0; c < o.length; ++c)
o[c] != s && (u || (u = [])).push(o[c]);
return u;
}
function Vs(o, s, u) {
var c = u && window.WeakSet && (u.markedSpans || (u.markedSpans = /* @__PURE__ */ new WeakSet()));
c && o.markedSpans && c.has(o.markedSpans) ? o.markedSpans.push(s) : (o.markedSpans = o.markedSpans ? o.markedSpans.concat([s]) : [s], c && c.add(o.markedSpans)), s.marker.attachLine(o);
}
function Aa(o, s, u) {
var c;
if (o)
for (var p = 0; p < o.length; ++p) {
var g = o[p], m = g.marker;
if (g.from == null || (m.inclusiveLeft ? g.from <= s : g.from < s) || g.from == s && m.type == "bookmark" && (!u || !g.marker.insertLeft)) {
var y = g.to == null || (m.inclusiveRight ? g.to >= s : g.to > s);
(c || (c = [])).push(new Cr(m, g.from, y ? null : g.to));
}
}
return c;
}
function hi(o, s, u) {
var c;
if (o)
for (var p = 0; p < o.length; ++p) {
var g = o[p], m = g.marker;
if (g.to == null || (m.inclusiveRight ? g.to >= s : g.to > s) || g.from == s && m.type == "bookmark" && (!u || g.marker.insertLeft)) {
var y = g.from == null || (m.inclusiveLeft ? g.from <= s : g.from < s);
(c || (c = [])).push(new Cr(m, y ? null : g.from - s, g.to == null ? null : g.to - s));
}
}
return c;
}
function $o(o, s) {
if (s.full)
return null;
var u = yo(o, s.from.line) && ve(o, s.from.line).markedSpans, c = yo(o, s.to.line) && ve(o, s.to.line).markedSpans;
if (!u && !c)
return null;
var p = s.from.ch, g = s.to.ch, m = T(s.from, s.to) == 0, y = Aa(u, p, m), x = hi(c, g, m), O = s.text.length == 1, B = Zt(s.text).length + (O ? p : 0);
if (y)
for (var $ = 0; $ < y.length; ++$) {
var ft = y[$];
if (ft.to == null) {
var dt = Oo(x, ft.marker);
dt ? O && (ft.to = dt.to == null ? null : dt.to + B) : ft.to = p;
}
}
if (x)
for (var Ct = 0; Ct < x.length; ++Ct) {
var Rt = x[Ct];
Rt.to != null && (Rt.to += B), Rt.from == null ? Oo(y, Rt.marker) || (Rt.from = B, O && (y || (y = [])).push(Rt)) : (Rt.from += B, O && (y || (y = [])).push(Rt));
}
y && (y = Ui(y)), x && x != y && (x = Ui(x));
var $t = [y];
if (!O) {
var re, le = s.text.length - 2;
if (le > 0 && y)
for (var Jt = 0; Jt < y.length; ++Jt)
y[Jt].to == null && (re || (re = [])).push(new Cr(y[Jt].marker, null, null));
for (var ye = 0; ye < le; ++ye)
$t.push(re);
$t.push(x);
}
return $t;
}
function Ui(o) {
for (var s = 0; s < o.length; ++s) {
var u = o[s];
u.from != null && u.from == u.to && u.marker.clearWhenEmpty !== !1 && o.splice(s--, 1);
}
return o.length ? o : null;
}
function Be(o, s, u) {
var c = null;
if (o.iter(s.line, u.line + 1, function(dt) {
if (dt.markedSpans)
for (var Ct = 0; Ct < dt.markedSpans.length; ++Ct) {
var Rt = dt.markedSpans[Ct].marker;
!Rt.readOnly || c && be(c, Rt) != -1 || (c || (c = [])).push(Rt);
}
}), !c)
return null;
for (var p = [{ from: s, to: u }], g = 0; g < c.length; ++g)
for (var m = c[g], y = m.find(0), x = 0; x < p.length; ++x) {
var O = p[x];
if (!(T(O.to, y.from) < 0 || T(O.from, y.to) > 0)) {
var B = [x, 1], $ = T(O.from, y.from), ft = T(O.to, y.to);
($ < 0 || !m.inclusiveLeft && !$) && B.push({ from: O.from, to: y.from }), (ft > 0 || !m.inclusiveRight && !ft) && B.push({ from: y.to, to: O.to }), p.splice.apply(p, B), x += B.length - 3;
}
}
return p;
}
function Zn(o) {
var s = o.markedSpans;
if (s) {
for (var u = 0; u < s.length; ++u)
s[u].marker.detachLine(o);
o.markedSpans = null;
}
}
function Bi(o, s) {
if (s) {
for (var u = 0; u < s.length; ++u)
s[u].marker.attachLine(o);
o.markedSpans = s;
}
}
function hr(o) {
return o.inclusiveLeft ? -1 : 0;
}
function qn(o) {
return o.inclusiveRight ? 1 : 0;
}
function mn(o, s) {
var u = o.lines.length - s.lines.length;
if (u != 0)
return u;
var c = o.find(), p = s.find(), g = T(c.from, p.from) || hr(o) - hr(s);
if (g)
return -g;
var m = T(c.to, p.to) || qn(o) - qn(s);
return m || s.id - o.id;
}
function Sr(o, s) {
var u, c = Zr && o.markedSpans;
if (c)
for (var p = void 0, g = 0; g < c.length; ++g)
(p = c[g]).marker.collapsed && (s ? p.from : p.to) == null && (!u || mn(u, p.marker) < 0) && (u = p.marker);
return u;
}
function qo(o) {
return Sr(o, !0);
}
function Dr(o) {
return Sr(o, !1);
}
function Wi(o, s) {
var u, c = Zr && o.markedSpans;
if (c)
for (var p = 0; p < c.length; ++p) {
var g = c[p];
g.marker.collapsed && (g.from == null || g.from < s) && (g.to == null || g.to > s) && (!u || mn(u, g.marker) < 0) && (u = g.marker);
}
return u;
}
function yn(o, s, u, c, p) {
var g = ve(o, s), m = Zr && g.markedSpans;
if (m)
for (var y = 0; y < m.length; ++y) {
var x = m[y];
if (x.marker.collapsed) {
var O = x.marker.find(0), B = T(O.from, u) || hr(x.marker) - hr(p), $ = T(O.to, c) || qn(x.marker) - qn(p);
if (!(B >= 0 && $ <= 0 || B <= 0 && $ >= 0) && (B <= 0 && (x.marker.inclusiveRight && p.inclusiveLeft ? T(O.to, u) >= 0 : T(O.to, u) > 0) || B >= 0 && (x.marker.inclusiveRight && p.inclusiveLeft ? T(O.from, c) <= 0 : T(O.from, c) < 0)))
return !0;
}
}
}
function Or(o) {
for (var s; s = qo(o); )
o = s.find(-1, !0).line;
return o;
}
function $i(o) {
for (var s; s = Dr(o); )
o = s.find(1, !0).line;
return o;
}
function gi(o) {
for (var s, u; s = Dr(o); )
o = s.find(1, !0).line, (u || (u = [])).push(o);
return u;
}
function pr(o, s) {
var u = ve(o, s), c = Or(u);
return u == c ? s : Ye(c);
}
function Nr(o, s) {
if (s > o.lastLine())
return s;
var u, c = ve(o, s);
if (!Ir(o, c))
return s;
for (; u = Dr(c); )
c = u.find(1, !0).line;
return Ye(c) + 1;
}
function Ir(o, s) {
var u = Zr && s.markedSpans;
if (u) {
for (var c = void 0, p = 0; p < u.length; ++p)
if ((c = u[p]).marker.collapsed && (c.from == null || !c.marker.widgetNode && c.from == 0 && c.marker.inclusiveLeft && kn(o, s, c)))
return !0;
}
}
function kn(o, s, u) {
if (u.to == null) {
var c = u.marker.find(1, !0);
return kn(o, c.line, Oo(c.line.markedSpans, u.marker));
}
if (u.marker.inclusiveRight && u.to == s.text.length)
return !0;
for (var p = void 0, g = 0; g < s.markedSpans.length; ++g)
if ((p = s.markedSpans[g]).marker.collapsed && !p.marker.widgetNode && p.from == u.to && (p.to == null || p.to != u.from) && (p.marker.inclusiveLeft || u.marker.inclusiveRight) && kn(o, s, p))
return !0;
}
function Fr(o) {
for (var s = 0, u = (o = Or(o)).parent, c = 0; c < u.lines.length; ++c) {
var p = u.lines[c];
if (p == o)
break;
s += p.height;
}
for (var g = u.parent; g; g = (u = g).parent)
for (var m = 0; m < g.children.length; ++m) {
var y = g.children[m];
if (y == u)
break;
s += y.height;
}
return s;
}
function vi(o) {
if (o.height == 0)
return 0;
for (var s, u = o.text.length, c = o; s = qo(c); ) {
var p = s.find(0, !0);
c = p.from.line, u += p.from.ch - p.to.ch;
}
for (c = o; s = Dr(c); ) {
var g = s.find(0, !0);
u -= c.text.length - g.from.ch, u += (c = g.to.line).text.length - g.to.ch;
}
return u;
}
function Rs(o) {
var s = o.display, u = o.doc;
s.maxLine = ve(u, u.first), s.maxLineLength = vi(s.maxLine), s.maxLineChanged = !0, u.iter(function(c) {
var p = vi(c);
p > s.maxLineLength && (s.maxLineLength = p, s.maxLine = c);
});
}
var Vr = function(o, s, u) {
this.text = o, Bi(this, s), this.height = u ? u(this) : 1;
};
function Hs(o, s, u, c) {
o.text = s, o.stateAfter && (o.stateAfter = null), o.styles && (o.styles = null), o.order != null && (o.order = null), Zn(o), Bi(o, u);
var p = c ? c(o) : 1;
p != o.height && or(o, p);
}
function ja(o) {
o.parent = null, Zn(o);
}
Vr.prototype.lineNo = function() {
return Ye(this);
}, Re(Vr);
var Ma = {}, qi = {};
function Go(o, s) {
if (!o || /^\s*$/.test(o))
return null;
var u = s.addModeClass ? qi : Ma;
return u[o] || (u[o] = o.replace(/\S+/g, "cm-$&"));
}
function Gi(o, s) {
var u = N("span", null, null, P ? "padding-right: .1px" : null), c = { pre: N("pre", [u], "CodeMirror-line"), content: u, col: 0, pos: 0, cm: o, trailingSpace: !1, splitSpaces: o.getOption("lineWrapping") };
s.measure = {};
for (var p = 0; p <= (s.rest ? s.rest.length : 0); p++) {
var g = p ? s.rest[p - 1] : s.line, m = void 0;
c.pos = 0, c.addToken = Da, Mr(o.display.measure) && (m = ze(g, o.doc.direction)) && (c.addToken = El(c.addToken, m)), c.map = [], Ki(g, c, xr(o, g, s != o.display.externalMeasured && Ye(g))), g.styleClasses && (g.styleClasses.bgClass && (c.bgClass = Oe(g.styleClasses.bgClass, c.bgClass || "")), g.styleClasses.textClass && (c.textClass = Oe(g.styleClasses.textClass, c.textClass || ""))), c.map.length == 0 && c.map.push(0, 0, c.content.appendChild(Bn(o.display.measure))), p == 0 ? (s.measure.map = c.map, s.measure.cache = {}) : ((s.measure.maps || (s.measure.maps = [])).push(c.map), (s.measure.caches || (s.measure.caches = [])).push({}));
}
if (P) {
var y = c.content.lastChild;
(/\bcm-tab\b/.test(y.className) || y.querySelector && y.querySelector(".cm-tab")) && (c.content.className = "cm-tab-wrap-hack");
}
return ut(o, "renderLine", o, s.line, c.pre), c.pre.className && (c.textClass = Oe(c.pre.className, c.textClass || "")), c;
}
function La(o) {
var s = gt("span", "•", "cm-invalidchar");
return s.title = "\\u" + o.charCodeAt(0).toString(16), s.setAttribute("aria-label", s.title), s;
}
function Da(o, s, u, c, p, g, m) {
if (s) {
var y, x = o.splitSpaces ? Na(s, o.trailingSpace) : s, O = o.cm.state.specialChars, B = !1;
if (O.test(s)) {
y = document.createDocumentFragment();
for (var $ = 0; ; ) {
O.lastIndex = $;
var ft = O.exec(s), dt = ft ? ft.index - $ : s.length - $;
if (dt) {
var Ct = document.createTextNode(x.slice($, $ + dt));
z && k < 9 ? y.appendChild(gt("span", [Ct])) : y.appendChild(Ct), o.map.push(o.pos, o.pos + dt, Ct), o.col += dt, o.pos += dt;
}
if (!ft)
break;
$ += dt + 1;
var Rt = void 0;
if (ft[0] == " ") {
var $t = o.cm.options.tabSize, re = $t - o.col % $t;
(Rt = y.appendChild(gt("span", ae(re), "cm-tab"))).setAttribute("role", "presentation"), Rt.setAttribute("cm-text", " "), o.col += re;
} else
ft[0] == "\r" || ft[0] == `
` ? ((Rt = y.appendChild(gt("span", ft[0] == "\r" ? "␍" : "", "cm-invalidchar"))).setAttribute("cm-text", ft[0]), o.col += 1) : ((Rt = o.cm.options.specialCharPlaceholder(ft[0])).setAttribute("cm-text", ft[0]), z && k < 9 ? y.appendChild(gt("span", [Rt])) : y.appendChild(Rt), o.col += 1);
o.map.push(o.pos, o.pos + 1, Rt), o.pos++;
}
} else
o.col += s.length, y = document.createTextNode(x), o.map.push(o.pos, o.pos + s.length, y), z && k < 9 && (B = !0), o.pos += s.length;
if (o.trailingSpace = x.charCodeAt(s.length - 1) == 32, u || c || p || B || g || m) {
var le = u || "";
c && (le += c), p && (le += p);
var Jt = gt("span", [y], le, g);
if (m)
for (var ye in m)
m.hasOwnProperty(ye) && ye != "style" && ye != "class" && Jt.setAttribute(ye, m[ye]);
return o.content.appendChild(Jt);
}
o.content.appendChild(y);
}
}
function Na(o, s) {
if (o.length > 1 && !/ /.test(o))
return o;
for (var u = s, c = "", p = 0; p < o.length; p++) {
var g = o.charAt(p);
g != " " || !u || p != o.length - 1 && o.charCodeAt(p + 1) != 32 || (g = " "), c += g, u = g == " ";
}
return c;
}
function El(o, s) {
return function(u, c, p, g, m, y, x) {
p = p ? p + " cm-force-border" : "cm-force-border";
for (var O = u.pos, B = O + c.length; ; ) {
for (var $ = void 0, ft = 0; ft < s.length && !(($ = s[ft]).to > O && $.from <= O); ft++)
;
if ($.to >= B)
return o(u, c, p, g, m, y, x);
o(u, c.slice(0, $.to - O), p, g, null, y, x), g = null, c = c.slice($.to - O), O = $.to;
}
};
}
function To(o, s, u, c) {
var p = !c && u.widgetNode;
p && o.map.push(o.pos, o.pos + s, p), !c && o.cm.display.input.needsContentAttribute && (p || (p = o.content.appendChild(document.createElement("span"))), p.setAttribute("cm-marker", u.id)), p && (o.cm.display.input.setUneditable(p), o.content.appendChild(p)), o.pos += s, o.trailingSpace = !1;
}
function Ki(o, s, u) {
var c = o.markedSpans, p = o.text, g = 0;
if (c)
for (var m, y, x, O, B, $, ft, dt = p.length, Ct = 0, Rt = 1, $t = "", re = 0; ; ) {
if (re == Ct) {
x = O = B = y = "", ft = null, $ = null, re = 1 / 0;
for (var le = [], Jt = void 0, ye = 0; ye < c.length; ++ye) {
var me = c[ye], Ce = me.marker;
if (Ce.type == "bookmark" && me.from == Ct && Ce.widgetNode)
le.push(Ce);
else if (me.from <= Ct && (me.to == null || me.to > Ct || Ce.collapsed && me.to == Ct && me.from == Ct)) {
if (me.to != null && me.to != Ct && re > me.to && (re = me.to, O = ""), Ce.className && (x += " " + Ce.className), Ce.css && (y = (y ? y + ";" : "") + Ce.css), Ce.startStyle && me.from == Ct && (B += " " + Ce.startStyle), Ce.endStyle && me.to == re && (Jt || (Jt = [])).push(Ce.endStyle, me.to), Ce.title && ((ft || (ft = {})).title = Ce.title), Ce.attributes)
for (var sn in Ce.attributes)
(ft || (ft = {}))[sn] = Ce.attributes[sn];
Ce.collapsed && (!$ || mn($.marker, Ce) < 0) && ($ = me);
} else
me.from > Ct && re > me.from && (re = me.from);
}
if (Jt)
for (var an = 0; an < Jt.length; an += 2)
Jt[an + 1] == re && (O += " " + Jt[an]);
if (!$ || $.from == Ct)
for (var gr = 0; gr < le.length; ++gr)
To(s, 0, le[gr]);
if ($ && ($.from || 0) == Ct) {
if (To(s, ($.to == null ? dt + 1 : $.to) - Ct, $.marker, $.from == null), $.to == null)
return;
$.to == Ct && ($ = !1);
}
}
if (Ct >= dt)
break;
for (var hn = Math.min(dt, re); ; ) {
if ($t) {
var sr = Ct + $t.length;
if (!$) {
var vr = sr > hn ? $t.slice(0, hn - Ct) : $t;
s.addToken(s, vr, m ? m + x : x, B, Ct + vr.length == re ? O : "", y, ft);
}
if (sr >= hn) {
$t = $t.slice(hn - Ct), Ct = hn;
break;
}
Ct = sr, B = "";
}
$t = p.slice(g, g = u[Rt++]), m = Go(u[Rt++], s.cm.options);
}
}
else
for (var xn = 1; xn < u.length; xn += 2)
s.addToken(s, p.slice(g, g = u[xn]), Go(u[xn + 1], s.cm.options));
}
function Yi(o, s, u) {
this.line = s, this.rest = gi(s), this.size = this.rest ? Ye(Zt(this.rest)) - u + 1 : 1, this.node = this.text = null, this.hidden = Ir(o, s);
}
function so(o, s, u) {
for (var c, p = [], g = s; g < u; g = c) {
var m = new Yi(o.doc, ve(o.doc, g), g);
c = g + m.size, p.push(m);
}
return p;
}
var Tr = null;
function mi(o) {
Tr ? Tr.ops.push(o) : o.ownsGroup = Tr = { ops: [o], delayedCallbacks: [] };
}
function Xi(o) {
var s = o.delayedCallbacks, u = 0;
do {
for (; u < s.length; u++)
s[u].call(null);
for (var c = 0; c < o.ops.length; c++) {
var p = o.ops[c];
if (p.cursorActivityHandlers)
for (; p.cursorActivityCalled < p.cursorActivityHandlers.length; )
p.cursorActivityHandlers[p.cursorActivityCalled++].call(null, p.cm);
}
} while (u < s.length);
}
function Ji(o, s) {
var u = o.ownsGroup;
if (u)
try {
Xi(u);
} finally {
Tr = null, s(u);
}
}
var ko = null;
function bn(o, s) {
var u = R(o, s);
if (u.length) {
var c, p = Array.prototype.slice.call(arguments, 2);
Tr ? c = Tr.delayedCallbacks : ko ? c = ko : (c = ko = [], setTimeout(Po, 0));
for (var g = function(y) {
c.push(function() {
return u[y].apply(null, p);
});
}, m = 0; m < u.length; ++m)
g(m);
}
}
function Po() {
var o = ko;
ko = null;
for (var s = 0; s < o.length; ++s)
o[s]();
}
function zs(o, s, u, c) {
for (var p = 0; p < s.changes.length; p++) {
var g = s.changes[p];
g == "text" ? Ia(o, s) : g == "gutter" ? Yo(o, s, u, c) : g == "class" ? Zi(o, s) : g == "widget" && bi(o, s, c);
}
s.changes = null;
}
function Ko(o) {
return o.node == o.text && (o.node = gt("div", null, null, "position: relative"), o.text.parentNode && o.text.parentNode.replaceChild(o.node, o.text), o.node.appendChild(o.text), z && k < 8 && (o.node.style.zIndex = 2)), o.node;
}
function yi(o, s) {
var u = s.bgClass ? s.bgClass + " " + (s.line.bgClass || "") : s.line.bgClass;
if (u && (u += " CodeMirror-linebackground"), s.background)
u ? s.background.className = u : (s.background.parentNode.removeChild(s.background), s.background = null);
else if (u) {
var c = Ko(s);
s.background = c.insertBefore(gt("div", null, u), c.firstChild), o.display.input.setUneditable(s.background);
}
}
function Us(o, s) {
var u = o.display.externalMeasured;
return u && u.line == s.line ? (o.display.externalMeasured = null, s.measure = u.measure, u.built) : Gi(o, s);
}
function Ia(o, s) {
var u = s.text.className, c = Us(o, s);
s.text == s.node && (s.node = c.pre), s.text.parentNode.replaceChild(c.pre, s.text), s.text = c.pre, c.bgClass != s.bgClass || c.textClass != s.textClass ? (s.bgClass = c.bgClass, s.textClass = c.textClass, Zi(o, s)) : u && (s.text.className = u);
}
function Zi(o, s) {
yi(o, s), s.line.wrapClass ? Ko(s).className = s.line.wrapClass : s.node != s.text && (s.node.className = "");
var u = s.textClass ? s.textClass + " " + (s.line.textClass || "") : s.line.textClass;
s.text.className = u || "";
}
function Yo(o, s, u, c) {
if (s.gutter && (s.node.removeChild(s.gutter), s.gutter = null), s.gutterBackground && (s.node.removeChild(s.gutterBackground), s.gutterBackground = null), s.line.gutterClass) {
var p = Ko(s);
s.gutterBackground = gt("div", null, "CodeMirror-gutter-background " + s.line.gutterClass, "left: " + (o.options.fixedGutter ? c.fixedPos : -c.gutterTotalWidth) + "px; width: " + c.gutterTotalWidth + "px"), o.display.input.setUneditable(s.gutterBackground), p.insertBefore(s.gutterBackground, s.text);
}
var g = s.line.gutterMarkers;
if (o.options.lineNumbers || g) {
var m = Ko(s), y = s.gutter = gt("div", null, "CodeMirror-gutter-wrapper", "left: " + (o.options.fixedGutter ? c.fixedPos : -c.gutterTotalWidth) + "px");
if (y.setAttribute("aria-hidden", "true"), o.display.input.setUneditable(y), m.insertBefore(y, s.text), s.line.gutterClass && (y.className += " " + s.line.gutterClass), !o.options.lineNumbers || g && g["CodeMirror-linenumbers"] || (s.lineNumber = y.appendChild(gt("div", Bo(o.options, u), "CodeMirror-linenumber CodeMirror-gutter-elt", "left: " + c.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + o.display.lineNumInnerWidth + "px"))), g)
for (var x = 0; x < o.display.gutterSpecs.length; ++x) {
var O = o.display.gutterSpecs[x].className, B = g.hasOwnProperty(O) && g[O];
B && y.appendChild(gt("div", [B], "CodeMirror-gutter-elt", "left: " + c.gutterLeft[O] + "px; width: " + c.gutterWidth[O] + "px"));
}
}
}
function bi(o, s, u) {
s.alignable && (s.alignable = null);
for (var c = V("CodeMirror-linewidget"), p = s.node.firstChild, g = void 0; p; p = g)
g = p.nextSibling, c.test(p.className) && s.node.removeChild(p);
Fa(o, s, u);
}
function Bs(o, s, u, c) {
var p = Us(o, s);
return s.text = s.node = p.pre, p.bgClass && (s.bgClass = p.bgClass), p.textClass && (s.textClass = p.textClass), Zi(o, s), Yo(o, s, u, c), Fa(o, s, c), s.node;
}
function Fa(o, s, u) {
if (Qi(o, s.line, s, u, !0), s.rest)
for (var c = 0; c < s.rest.length; c++)
Qi(o, s.rest[c], s, u, !1);
}
function Qi(o, s, u, c, p) {
if (s.widgets)
for (var g = Ko(u), m = 0, y = s.widgets; m < y.length; ++m) {
var x = y[m], O = gt("div", [x.node], "CodeMirror-linewidget" + (x.className ? " " + x.className : ""));
x.handleMouseEvents || O.setAttribute("cm-ignore-events", "true"), Al(x, O, u, c), o.display.input.setUneditable(O), p && x.above ? g.insertBefore(O, u.gutter || u.text) : g.appendChild(O), bn(x, "redraw");
}
}
function Al(o, s, u, c) {
if (o.noHScroll) {
(u.alignable || (u.alignable = [])).push(s);
var p = c.wrapperWidth;
s.style.left = c.fixedPos + "px", o.coverGutter || (p -= c.gutterTotalWidth, s.style.paddingLeft = c.gutterTotalWidth + "px"), s.style.width = p + "px";
}
o.coverGutter && (s.style.zIndex = 5, s.style.position = "relative", o.noHScroll || (s.style.marginLeft = -c.gutterTotalWidth + "px"));
}
function _(o) {
if (o.height != null)
return o.height;
var s = o.doc.cm;
if (!s)
return 0;
if (!Lt(document.body, o.node)) {
var u = "position: relative;";
o.coverGutter && (u += "margin-left: -" + s.display.gutters.offsetWidth + "px;"), o.noHScroll && (u += "width: " + s.display.wrapper.clientWidth + "px;"), rt(s.display.measure, gt("div", [o.node], null, u));
}
return o.height = o.node.parentNode.offsetHeight;
}
function A(o, s) {
for (var u = Ar(s); u != o.wrapper; u = u.parentNode)
if (!u || u.nodeType == 1 && u.getAttribute("cm-ignore-events") == "true" || u.parentNode == o.sizer && u != o.mover)
return !0;
}
function K(o) {
return o.lineSpace.offsetTop;
}
function Z(o) {
return o.mover.offsetHeight - o.lineSpace.offsetHeight;
}
function vt(o) {
if (o.cachedPaddingH)
return o.cachedPaddingH;
var s = rt(o.measure, gt("pre", "x", "CodeMirror-line-like")), u = window.getComputedStyle ? window.getComputedStyle(s) : s.currentStyle, c = { left: parseInt(u.paddingLeft), right: parseInt(u.paddingRight) };
return isNaN(c.left) || isNaN(c.right) || (o.cachedPaddingH = c), c;
}
function lt(o) {
return ge - o.display.nativeBarWidth;
}
function Nt(o) {
return o.display.scroller.clientWidth - lt(o) - o.display.barWidth;
}
function Gt(o) {
return o.display.scroller.clientHeight - lt(o) - o.display.barHeight;
}
function je(o, s, u) {
var c = o.options.lineWrapping, p = c && Nt(o);
if (!s.measure.heights || c && s.measure.width != p) {
var g = s.measure.heights = [];
if (c) {
s.measure.width = p;
for (var m = s.text.firstChild.getClientRects(), y = 0; y < m.length - 1; y++) {
var x = m[y], O = m[y + 1];
Math.abs(x.bottom - O.bottom) > 2 && g.push((x.bottom + O.top) / 2 - u.top);
}
}
g.push(u.bottom - u.top);
}
}
function He(o, s, u) {
if (o.line == s)
return { map: o.measure.map, cache: o.measure.cache };
if (o.rest) {
for (var c = 0; c < o.rest.length; c++)
if (o.rest[c] == s)
return { map: o.measure.maps[c], cache: o.measure.caches[c] };
for (var p = 0; p < o.rest.length; p++)
if (Ye(o.rest[p]) > u)
return { map: o.measure.maps[p], cache: o.measure.caches[p], before: !0 };
}
}
function cn(o, s) {
var u = Ye(s = Or(s)), c = o.display.externalMeasured = new Yi(o.doc, s, u);
c.lineN = u;
var p = c.built = Gi(o, c);
return c.text = p.pre, rt(o.display.lineMeasure, p.pre), c;
}
function Rr(o, s, u, c) {
return Hr(o, Eo(o, s), u, c);
}
function ts(o, s) {
if (s >= o.display.viewFrom && s < o.display.viewTo)
return o.display.view[_i(o, s)];
var u = o.display.externalMeasured;
return u && s >= u.lineN && s < u.lineN + u.size ? u : void 0;
}
function Eo(o, s) {
var u = Ye(s), c = ts(o, u);
c && !c.text ? c = null : c && c.changes && (zs(o, c, u, Nl(o)), o.curOp.forceUpdate = !0), c || (c = cn(o, s));
var p = He(c, s, u);
return { line: s, view: c, rect: null, map: p.map, cache: p.cache, before: p.before, hasHeights: !1 };
}
function Hr(o, s, u, c, p) {
s.before && (u = -1);
var g, m = u + (c || "");
return s.cache.hasOwnProperty(m) ? g = s.cache[m] : (s.rect || (s.rect = s.view.text.getBoundingClientRect()), s.hasHeights || (je(o, s.view, s.rect), s.hasHeights = !0), (g = yp(o, s, u, c)).bogus || (s.cache[m] = g)), { left: g.left, right: g.right, top: p ? g.rtop : g.top, bottom: p ? g.rbottom : g.bottom };
}
var Ao, Vc = { left: 0, right: 0, top: 0, bottom: 0 };
function Ws(o, s, u) {
for (var c, p, g, m, y, x, O = 0; O < o.length; O += 3)
if (y = o[O], x = o[O + 1], s < y ? (p = 0, g = 1, m = "left") : s < x ? g = (p = s - y) + 1 : (O == o.length - 3 || s == x && o[O + 3] > s) && (p = (g = x - y) - 1, s >= x && (m = "right")), p != null) {
if (c = o[O + 2], y == x && u == (c.insertLeft ? "left" : "right") && (m = u), u == "left" && p == 0)
for (; O && o[O - 2] == o[O - 3] && o[O - 1].insertLeft; )
c = o[(O -= 3) + 2], m = "left";
if (u == "right" && p == x - y)
for (; O < o.length - 3 && o[O + 3] == o[O + 4] && !o[O + 5].insertLeft; )
c = o[(O += 3) + 2], m = "right";
break;
}
return { node: c, start: p, end: g, collapse: m, coverStart: y, coverEnd: x };
}
function Rc(o, s) {
var u = Vc;
if (s == "left")
for (var c = 0; c < o.length && (u = o[c]).left == u.right; c++)
;
else
for (var p = o.length - 1; p >= 0 && (u = o[p]).left == u.right; p--)
;
return u;
}
function yp(o, s, u, c) {
var p, g = Ws(s.map, u, c), m = g.node, y = g.start, x = g.end, O = g.collapse;
if (m.nodeType == 3) {
for (var B = 0; B < 4; B++) {
for (; y && U(s.line.text.charAt(g.coverStart + y)); )
--y;
for (; g.coverStart + x < g.coverEnd && U(s.line.text.charAt(g.coverStart + x)); )
++x;
if ((p = z && k < 9 && y == 0 && x == g.coverEnd - g.coverStart ? m.parentNode.getBoundingClientRect() : Rc(Y(m, y, x).getClientRects(), c)).left || p.right || y == 0)
break;
x = y, y -= 1, O = "right";
}
z && k < 11 && (p = bp(o.display.measure, p));
} else {
var $;
y > 0 && (O = c = "right"), p = o.options.lineWrapping && ($ = m.getClientRects()).length > 1 ? $[c == "right" ? $.length - 1 : 0] : m.getBoundingClientRect();
}
if (z && k < 9 && !y && (!p || !p.left && !p.right)) {
var ft = m.parentNode.getClientRects()[0];
p = ft ? { left: ft.left, right: ft.left + Jo(o.display), top: ft.top, bottom: ft.bottom } : Vc;
}
for (var dt = p.top - s.rect.top, Ct = p.bottom - s.rect.top, Rt = (dt + Ct) / 2, $t = s.view.measure.heights, re = 0; re < $t.length - 1 && !(Rt < $t[re]); re++)
;
var le = re ? $t[re - 1] : 0, Jt = $t[re], ye = { left: (O == "right" ? p.right : p.left) - s.rect.left, right: (O == "left" ? p.left : p.right) - s.rect.left, top: le, bottom: Jt };
return p.left || p.right || (ye.bogus = !0), o.options.singleCursorHeightPerLine || (ye.rtop = dt, ye.rbottom = Ct), ye;
}
function bp(o, s) {
if (!window.screen || screen.logicalXDPI == null || screen.logicalXDPI == screen.deviceXDPI || !ro(o))
return s;
var u = screen.logicalXDPI / screen.deviceXDPI, c = screen.logicalYDPI / screen.deviceYDPI;
return { left: s.left * u, right: s.right * u, top: s.top * c, bottom: s.bottom * c };
}
function Hc(o) {
if (o.measure && (o.measure.cache = {}, o.measure.heights = null, o.rest))
for (var s = 0; s < o.rest.length; s++)
o.measure.caches[s] = {};
}
function es(o) {
o.display.externalMeasure = null, wt(o.display.lineMeasure);
for (var s = 0; s < o.display.view.length; s++)
Hc(o.display.view[s]);
}
function Xo(o) {
es(o), o.display.cachedCharWidth = o.display.cachedTextHeight = o.display.cachedPaddingH = null, o.options.lineWrapping || (o.display.maxLineChanged = !0), o.display.lineNumChars = null;
}
function $s() {
return M && ee ? -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) : window.pageXOffset || (document.documentElement || document.body).scrollLeft;
}
function zc() {
return M && ee ? -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) : window.pageYOffset || (document.documentElement || document.body).scrollTop;
}
function Va(o) {
var s = Or(o).widgets, u = 0;
if (s)
for (var c = 0; c < s.length; ++c)
s[c].above && (u += _(s[c]));
return u;
}
function Ra(o, s, u, c, p) {
if (!p) {
var g = Va(s);
u.top += g, u.bottom += g;
}
if (c == "line")
return u;
c || (c = "local");
var m = Fr(s);
if (c == "local" ? m += K(o.display) : m -= o.display.viewOffset, c == "page" || c == "window") {
var y = o.display.lineSpace.getBoundingClientRect();
m += y.top + (c == "window" ? 0 : zc());
var x = y.left + (c == "window" ? 0 : $s());
u.left += x, u.right += x;
}
return u.top += m, u.bottom += m, u;
}
function jl(o, s, u) {
if (u == "div")
return s;
var c = s.left, p = s.top;
if (u == "page")
c -= $s(), p -= zc();
else if (u == "local" || !u) {
var g = o.display.sizer.getBoundingClientRect();
c += g.left, p += g.top;
}
var m = o.display.lineSpace.getBoundingClientRect();
return { left: c - m.left, top: p - m.top };
}
function Ha(o, s, u, c, p) {
return c || (c = ve(o.doc, s.line)), Ra(o, c, Rr(o, c, s.ch, p), u);
}
function kr(o, s, u, c, p, g) {
function m(Ct, Rt) {
var $t = Hr(o, p, Ct, Rt ? "right" : "left", g);
return Rt ? $t.left = $t.right : $t.right = $t.left, Ra(o, c, $t, u);
}
c = c || ve(o.doc, s.line), p || (p = Eo(o, c));
var y = ze(c, o.doc.direction), x = s.ch, O = s.sticky;
if (x >= c.text.length ? (x = c.text.length, O = "before") : x <= 0 && (x = 0, O = "after"), !y)
return m(O == "before" ? x - 1 : x, O == "before");
function B(Ct, Rt, $t) {
return m($t ? Ct - 1 : Ct, y[Rt].level == 1 != $t);
}
var $ = ke(y, x, O), ft = fe, dt = B(x, $, O == "before");
return ft != null && (dt.other = B(x, ft, O != "before")), dt;
}
function za(o, s) {
var u = 0;
s = oe(o.doc, s), o.options.lineWrapping || (u = Jo(o.display) * s.ch);
var c = ve(o.doc, s.line), p = Fr(c) + K(o.display);
return { left: u, right: u, top: p, bottom: p + c.height };
}
function Ml(o, s, u, c, p) {
var g = Bt(o, s, u);
return g.xRel = p, c && (g.outside = c), g;
}
function Ll(o, s, u) {
var c = o.doc;
if ((u += o.display.viewOffset) < 0)
return Ml(c.first, 0, null, -1, -1);
var p = In(c, u), g = c.first + c.size - 1;
if (p > g)
return Ml(c.first + c.size - 1, ve(c, g).text.length, null, 1, 1);
s < 0 && (s = 0);
for (var m = ve(c, p); ; ) {
var y = Dl(o, m, p, s, u), x = Wi(m, y.ch + (y.xRel > 0 || y.outside > 0 ? 1 : 0));
if (!x)
return y;
var O = x.find(1);
if (O.line == p)
return O;
m = ve(c, p = O.line);
}
}
function Uc(o, s, u, c) {
c -= Va(s);
var p = s.text.length, g = kt(function(m) {
return Hr(o, u, m - 1).bottom <= c;
}, p, 0);
return { begin: g, end: p = kt(function(m) {
return Hr(o, u, m).top > c;
}, g, p) };
}
function Bc(o, s, u, c) {
return u || (u = Eo(o, s)), Uc(o, s, u, Ra(o, s, Hr(o, u, c), "line").top);
}
function ns(o, s, u, c) {
return !(o.bottom <= u) && (o.top > u || (c ? o.left : o.right) > s);
}
function Dl(o, s, u, c, p) {
p -= Fr(s);
var g = Eo(o, s), m = Va(s), y = 0, x = s.text.length, O = !0, B = ze(s, o.doc.direction);
if (B) {
var $ = (o.options.lineWrapping ? os : rs)(o, s, u, g, B, c, p);
y = (O = $.level != 1) ? $.from : $.to - 1, x = O ? $.to : $.from - 1;
}
var ft, dt, Ct = null, Rt = null, $t = kt(function(me) {
var Ce = Hr(o, g, me);
return Ce.top += m, Ce.bottom += m, !!ns(Ce, c, p, !1) && (Ce.top <= p && Ce.left <= c && (Ct = me, Rt = Ce), !0);
}, y, x), re = !1;
if (Rt) {
var le = c - Rt.left < Rt.right - c, Jt = le == O;
$t = Ct + (Jt ? 0 : 1), dt = Jt ? "after" : "before", ft = le ? Rt.left : Rt.right;
} else {
O || $t != x && $t != y || $t++, dt = $t == 0 ? "after" : $t == s.text.length ? "before" : Hr(o, g, $t - (O ? 1 : 0)).bottom + m <= p == O ? "after" : "before";
var ye = kr(o, Bt(u, $t, dt), "line", s, g);
ft = ye.left, re = p < ye.top ? -1 : p >= ye.bottom ? 1 : 0;
}
return Ml(u, $t = ht(s.text, $t, 1), dt, re, c - ft);
}
function rs(o, s, u, c, p, g, m) {
var y = kt(function($) {
var ft = p[$], dt = ft.level != 1;
return ns(kr(o, Bt(u, dt ? ft.to : ft.from, dt ? "before" : "after"), "line", s, c), g, m, !0);
}, 0, p.length - 1), x = p[y];
if (y > 0) {
var O = x.level != 1, B = kr(o, Bt(u, O ? x.from : x.to, O ? "after" : "before"), "line", s, c);
ns(B, g, m, !0) && B.top > m && (x = p[y - 1]);
}
return x;
}
function os(o, s, u, c, p, g, m) {
var y = Uc(o, s, c, m), x = y.begin, O = y.end;
/\s/.test(s.text.charAt(O - 1)) && O--;
for (var B = null, $ = null, ft = 0; ft < p.length; ft++) {
var dt = p[ft];
if (!(dt.from >= O || dt.to <= x)) {
var Ct = Hr(o, c, dt.level != 1 ? Math.min(O, dt.to) - 1 : Math.max(x, dt.from)).right, Rt = Ct < g ? g - Ct + 1e9 : Ct - g;
(!B || $ > Rt) && (B = dt, $ = Rt);
}
}
return B || (B = p[p.length - 1]), B.from < x && (B = { from: x, to: B.to, level: B.level }), B.to > O && (B = { from: B.from, to: O, level: B.level }), B;
}
function ao(o) {
if (o.cachedTextHeight != null)
return o.cachedTextHeight;
if (Ao == null) {
Ao = gt("pre", null, "CodeMirror-line-like");
for (var s = 0; s < 49; ++s)
Ao.appendChild(document.createTextNode("x")), Ao.appendChild(gt("br"));
Ao.appendChild(document.createTextNode("x"));
}
rt(o.measure, Ao);
var u = Ao.offsetHeight / 50;
return u > 3 && (o.cachedTextHeight = u), wt(o.measure), u || 1;
}
function Jo(o) {
if (o.cachedCharWidth != null)
return o.cachedCharWidth;
var s = gt("span", "xxxxxxxxxx"), u = gt("pre", [s], "CodeMirror-line-like");
rt(o.measure, u);
var c = s.getBoundingClientRect(), p = (c.right - c.left) / 10;
return p > 2 && (o.cachedCharWidth = p), p || 10;
}
function Nl(o) {
for (var s = o.display, u = {}, c = {}, p = s.gutters.clientLeft, g = s.gutters.firstChild, m = 0; g; g = g.nextSibling, ++m) {
var y = o.display.gutterSpecs[m].className;
u[y] = g.offsetLeft + g.clientLeft + p, c[y] = g.clientWidth;
}
return { fixedPos: Il(s), gutterTotalWidth: s.gutters.offsetWidth, gutterLeft: u, gutterWidth: c, wrapperWidth: s.wrapper.clientWidth };
}
function Il(o) {
return o.scroller.getBoundingClientRect().left - o.sizer.getBoundingClientRect().left;
}
function Wc(o) {
var s = ao(o.display), u = o.options.lineWrapping, c = u && Math.max(5, o.display.scroller.clientWidth / Jo(o.display) - 3);
return function(p) {
if (Ir(o.doc, p))
return 0;
var g = 0;
if (p.widgets)
for (var m = 0; m < p.widgets.length; m++)
p.widgets[m].height && (g += p.widgets[m].height);
return u ? g + (Math.ceil(p.text.length / c) || 1) * s : g + s;
};
}
function Fl(o) {
var s = o.doc, u = Wc(o);
s.iter(function(c) {
var p = u(c);
p != c.height && or(c, p);
});
}
function wi(o, s, u, c) {
var p = o.display;
if (!u && Ar(s).getAttribute("cm-not-content") == "true")
return null;
var g, m, y = p.lineSpace.getBoundingClientRect();
try {
g = s.clientX - y.left, m = s.clientY - y.top;
} catch {
return null;
}
var x, O = Ll(o, g, m);
if (c && O.xRel > 0 && (x = ve(o.doc, O.line).text).length == O.ch) {
var B = xe(x, x.length, o.options.tabSize) - x.length;
O = Bt(O.line, Math.max(0, Math.round((g - vt(o.display).left) / Jo(o.display)) - B));
}
return O;
}
function _i(o, s) {
if (s >= o.display.viewTo || (s -= o.display.viewFrom) < 0)
return null;
for (var u = o.display.view, c = 0; c < u.length; c++)
if ((s -= u[c].size) < 0)
return c;
}
function Qn(o, s, u, c) {
s == null && (s = o.doc.first), u == null && (u = o.doc.first + o.doc.size), c || (c = 0);
var p = o.display;
if (c && u < p.viewTo && (p.updateLineNumbers == null || p.updateLineNumbers > s) && (p.updateLineNumbers = s), o.curOp.viewChanged = !0, s >= p.viewTo)
Zr && pr(o.doc, s) < p.viewTo && Zo(o);
else if (u <= p.viewFrom)
Zr && Nr(o.doc, u + c) > p.viewFrom ? Zo(o) : (p.viewFrom += c, p.viewTo += c);
else if (s <= p.viewFrom && u >= p.viewTo)
Zo(o);
else if (s <= p.viewFrom) {
var g = Ua(o, u, u + c, 1);
g ? (p.view = p.view.slice(g.index), p.viewFrom = g.lineN, p.viewTo += c) : Zo(o);
} else if (u >= p.viewTo) {
var m = Ua(o, s, s, -1);
m ? (p.view = p.view.slice(0, m.index), p.viewTo = m.lineN) : Zo(o);
} else {
var y = Ua(o, s, s, -1), x = Ua(o, u, u + c, 1);
y && x ? (p.view = p.view.slice(0, y.index).concat(so(o, y.lineN, x.lineN)).concat(p.view.slice(x.index)), p.viewTo += c) : Zo(o);
}
var O = p.externalMeasured;
O && (u < O.lineN ? O.lineN += c : s < O.lineN + O.size && (p.externalMeasured = null));
}
function lo(o, s, u) {
o.curOp.viewChanged = !0;
var c = o.display, p = o.display.externalMeasured;
if (p && s >= p.lineN && s < p.lineN + p.size && (c.externalMeasured = null), !(s < c.viewFrom || s >= c.viewTo)) {
var g = c.view[_i(o, s)];
if (g.node != null) {
var m = g.changes || (g.changes = []);
be(m, u) == -1 && m.push(u);
}
}
}
function Zo(o) {
o.display.viewFrom = o.display.viewTo = o.doc.first, o.display.view = [], o.display.viewOffset = 0;
}
function Ua(o, s, u, c) {
var p, g = _i(o, s), m = o.display.view;
if (!Zr || u == o.doc.first + o.doc.size)
return { index: g, lineN: u };
for (var y = o.display.viewFrom, x = 0; x < g; x++)
y += m[x].size;
if (y != s) {
if (c > 0) {
if (g == m.length - 1)
return null;
p = y + m[g].size - s, g++;
} else
p = y - s;
s += p, u += p;
}
for (; pr(o.doc, u) != u; ) {
if (g == (c < 0 ? 0 : m.length - 1))
return null;
u += c * m[g - (c < 0 ? 1 : 0)].size, g += c;
}
return { index: g, lineN: u };
}
function wp(o, s, u) {
var c = o.display;
c.view.length == 0 || s >= c.viewTo || u <= c.viewFrom ? (c.view = so(o, s, u), c.viewFrom = s) : (c.viewFrom > s ? c.view = so(o, s, c.viewFrom).concat(c.view) : c.viewFrom < s && (c.view = c.view.slice(_i(o, s))), c.viewFrom = s, c.viewTo < u ? c.view = c.view.concat(so(o, c.viewTo, u)) : c.viewTo > u && (c.view = c.view.slice(0, _i(o, u)))), c.viewTo = u;
}
function $c(o) {
for (var s = o.display.view, u = 0, c = 0; c < s.length; c++) {
var p = s[c];
p.hidden || p.node && !p.changes || ++u;
}
return u;
}
function qs(o) {
o.display.input.showSelection(o.display.input.prepareSelection());
}
function Gs(o, s) {
s === void 0 && (s = !0);
var u = o.doc, c = {}, p = c.cursors = document.createDocumentFragment(), g = c.selection = document.createDocumentFragment(), m = o.options.$customCursor;
m && (s = !0);
for (var y = 0; y < u.sel.ranges.length; y++)
if (s || y != u.sel.primIndex) {
var x = u.sel.ranges[y];
if (!(x.from().line >= o.display.viewTo || x.to().line < o.display.viewFrom)) {
var O = x.empty();
if (m) {
var B = m(o, x);
B && Ks(o, B, p);
} else
(O || o.options.showCursorWhenSelecting) && Ks(o, x.head, p);
O || _p(o, x, g);
}
}
return c;
}
function Ks(o, s, u) {
var c = kr(o, s, "div", null, null, !o.options.singleCursorHeightPerLine), p = u.appendChild(gt("div", " ", "CodeMirror-cursor"));
if (p.style.left = c.left + "px", p.style.top = c.top + "px", p.style.height = Math.max(0, c.bottom - c.top) * o.options.cursorHeight + "px", /\bcm-fat-cursor\b/.test(o.getWrapperElement().className)) {
var g = Ha(o, s, "div", null, null), m = g.right - g.left;
p.style.width = (m > 0 ? m : o.defaultCharWidth()) + "px";
}
if (c.other) {
var y = u.appendChild(gt("div", " ", "CodeMirror-cursor CodeMirror-secondarycursor"));
y.style.display = "", y.style.left = c.other.left + "px", y.style.top = c.other.top + "px", y.style.height = 0.85 * (c.other.bottom - c.other.top) + "px";
}
}
function Ys(o, s) {
return o.top - s.top || o.left - s.left;
}
function _p(o, s, u) {
var c = o.display, p = o.doc, g = document.createDocumentFragment(), m = vt(o.display), y = m.left, x = Math.max(c.sizerWidth, Nt(o) - c.sizer.offsetLeft) - m.right, O = p.direction == "ltr";
function B(Jt, ye, me, Ce) {
ye < 0 && (ye = 0), ye = Math.round(ye), Ce = Math.round(Ce), g.appendChild(gt("div", null, "CodeMirror-selected", "position: absolute; left: " + Jt + `px;
top: ` + ye + "px; width: " + (me ?? x - Jt) + `px;
height: ` + (Ce - ye) + "px"));
}
function $(Jt, ye, me) {
var Ce, sn, an = ve(p, Jt), gr = an.text.length;
function hn(xn, En) {
return Ha(o, Bt(Jt, xn), "div", an, En);
}
function sr(xn, En, dr) {
var Vn = Bc(o, an, null, xn), An = En == "ltr" == (dr == "after") ? "left" : "right";
return hn(dr == "after" ? Vn.begin : Vn.end - (/\s/.test(an.text.charAt(Vn.end - 1)) ? 2 : 1), An)[An];
}
var vr = ze(an, p.direction);
return Ot(vr, ye || 0, me ?? gr, function(xn, En, dr, Vn) {
var An = dr == "ltr", jn = hn(xn, An ? "left" : "right"), mr = hn(En - 1, An ? "right" : "left"), ri = ye == null && xn == 0, fo = me == null && En == gr, ar = Vn == 0, Cn = !vr || Vn == vr.length - 1;
if (mr.top - jn.top <= 3) {
var bc = (O ? fo : ri) && Cn, Fo = (O ? ri : fo) && ar ? y : (An ? jn : mr).left, Li = bc ? x : (An ? mr : jn).right;
B(Fo, jn.top, Li - Fo, jn.bottom);
} else {
var Di, zn, Cs, wc;
An ? (Di = O && ri && ar ? y : jn.left, zn = O ? x : sr(xn, dr, "before"), Cs = O ? y : sr(En, dr, "after"), wc = O && fo && Cn ? x : mr.right) : (Di = O ? sr(xn, dr, "before") : y, zn = !O && ri && ar ? x : jn.right, Cs = !O && fo && Cn ? y : mr.left, wc = O ? sr(En, dr, "after") : x), B(Di, jn.top, zn - Di, jn.bottom), jn.bottom < mr.top && B(y, jn.bottom, null, mr.top), B(Cs, mr.top, wc - Cs, mr.bottom);
}
(!Ce || Ys(jn, Ce) < 0) && (Ce = jn), Ys(mr, Ce) < 0 && (Ce = mr), (!sn || Ys(jn, sn) < 0) && (sn = jn), Ys(mr, sn) < 0 && (sn = mr);
}), { start: Ce, end: sn };
}
var ft = s.from(), dt = s.to();
if (ft.line == dt.line)
$(ft.line, ft.ch, dt.ch);
else {
var Ct = ve(p, ft.line), Rt = ve(p, dt.line), $t = Or(Ct) == Or(Rt), re = $(ft.line, ft.ch, $t ? Ct.text.length + 1 : null).end, le = $(dt.line, $t ? 0 : null, dt.ch).start;
$t && (re.top < le.top - 2 ? (B(re.right, re.top, null, re.bottom), B(y, le.top, le.left, le.bottom)) : B(re.right, re.top, le.left - re.right, re.bottom)), re.bottom < le.top && B(y, re.bottom, null, le.top);
}
u.appendChild(g);
}
function is(o) {
if (o.state.focused) {
var s = o.display;
clearInterval(s.blinker);
var u = !0;
s.cursorDiv.style.visibility = "", o.options.cursorBlinkRate > 0 ? s.blinker = setInterval(function() {
o.hasFocus() || xi(o), s.cursorDiv.style.visibility = (u = !u) ? "" : "hidden";
}, o.options.cursorBlinkRate) : o.options.cursorBlinkRate < 0 && (s.cursorDiv.style.visibility = "hidden");
}
}
function qc(o) {
o.hasFocus() || (o.display.input.focus(), o.state.focused || Rl(o));
}
function Vl(o) {
o.state.delayingBlurEvent = !0, setTimeout(function() {
o.state.delayingBlurEvent && (o.state.delayingBlurEvent = !1, o.state.focused && xi(o));
}, 100);
}
function Rl(o, s) {
o.state.delayingBlurEvent && !o.state.draggingText && (o.state.delayingBlurEvent = !1), o.options.readOnly != "nocursor" && (o.state.focused || (ut(o, "focus", o, s), o.state.focused = !0, Qt(o.display.wrapper, "CodeMirror-focused"), o.curOp || o.display.selForContextMenu == o.doc.sel || (o.display.input.reset(), P && setTimeout(function() {
return o.display.input.reset(!0);
}, 20)), o.display.input.receivedFocus()), is(o));
}
function xi(o, s) {
o.state.delayingBlurEvent || (o.state.focused && (ut(o, "blur", o, s), o.state.focused = !1, nt(o.display.wrapper, "CodeMirror-focused")), clearInterval(o.display.blinker), setTimeout(function() {
o.state.focused || (o.display.shift = !1);
}, 150));
}
function Ba(o) {
for (var s = o.display, u = s.lineDiv.offsetTop, c = Math.max(0, s.scroller.getBoundingClientRect().top), p = s.lineDiv.getBoundingClientRect().top, g = 0, m = 0; m < s.view.length; m++) {
var y = s.view[m], x = o.options.lineWrapping, O = void 0, B = 0;
if (!y.hidden) {
if (p += y.line.height, z && k < 8) {
var $ = y.node.offsetTop + y.node.offsetHeight;
O = $ - u, u = $;
} else {
var ft = y.node.getBoundingClientRect();
O = ft.bottom - ft.top, !x && y.text.firstChild && (B = y.text.firstChild.getBoundingClientRect().right - ft.left - 1);
}
var dt = y.line.height - O;
if ((dt > 5e-3 || dt < -5e-3) && (p < c && (g -= dt), or(y.line, O), Xs(y.line), y.rest))
for (var Ct = 0; Ct < y.rest.length; Ct++)
Xs(y.rest[Ct]);
if (B > o.display.sizerWidth) {
var Rt = Math.ceil(B / Jo(o.display));
Rt > o.display.maxLineLength && (o.display.maxLineLength = Rt, o.display.maxLine = y.line, o.display.maxLineChanged = !0);
}
}
}
Math.abs(g) > 2 && (s.scroller.scrollTop += g);
}
function Xs(o) {
if (o.widgets)
for (var s = 0; s < o.widgets.length; ++s) {
var u = o.widgets[s], c = u.node.parentNode;
c && (u.height = c.offsetHeight);
}
}
function Js(o, s, u) {
var c = u && u.top != null ? Math.max(0, u.top) : o.scroller.scrollTop;
c = Math.floor(c - K(o));
var p = u && u.bottom != null ? u.bottom : c + o.wrapper.clientHeight, g = In(s, c), m = In(s, p);
if (u && u.ensure) {
var y = u.ensure.from.line, x = u.ensure.to.line;
y < g ? (g = y, m = In(s, Fr(ve(s, y)) + o.wrapper.clientHeight)) : Math.min(x, s.lastLine()) >= m && (g = In(s, Fr(ve(s, x)) - o.wrapper.clientHeight), m = x);
}
return { from: g, to: Math.max(m, g + 1) };
}
function xp(o, s) {
if (!yt(o, "scrollCursorIntoView")) {
var u = o.display, c = u.sizer.getBoundingClientRect(), p = null;
if (s.top + c.top < 0 ? p = !0 : s.bottom + c.top > (window.innerHeight || document.documentElement.clientHeight) && (p = !1), p != null && !jt) {
var g = gt("div", "", null, `position: absolute;
top: ` + (s.top - u.viewOffset - K(o.display)) + `px;
height: ` + (s.bottom - s.top + lt(o) + u.barHeight) + `px;
left: ` + s.left + "px; width: " + Math.max(2, s.right - s.left) + "px;");
o.display.lineSpace.appendChild(g), g.scrollIntoView(p), o.display.lineSpace.removeChild(g);
}
}
}
function Hl(o, s, u, c) {
var p;
c == null && (c = 0), o.options.lineWrapping || s != u || (u = s.sticky == "before" ? Bt(s.line, s.ch + 1, "before") : s, s = s.ch ? Bt(s.line, s.sticky == "before" ? s.ch - 1 : s.ch, "after") : s);
for (var g = 0; g < 5; g++) {
var m = !1, y = kr(o, s), x = u && u != s ? kr(o, u) : y, O = zl(o, p = { left: Math.min(y.left, x.left), top: Math.min(y.top, x.top) - c, right: Math.max(y.left, x.left), bottom: Math.max(y.bottom, x.bottom) + c }), B = o.doc.scrollTop, $ = o.doc.scrollLeft;
if (O.scrollTop != null && (Qs(o, O.scrollTop), Math.abs(o.doc.scrollTop - B) > 1 && (m = !0)), O.scrollLeft != null && (jo(o, O.scrollLeft), Math.abs(o.doc.scrollLeft - $) > 1 && (m = !0)), !m)
break;
}
return p;
}
function Cp(o, s) {
var u = zl(o, s);
u.scrollTop != null && Qs(o, u.scrollTop), u.scrollLeft != null && jo(o, u.scrollLeft);
}
function zl(o, s) {
var u = o.display, c = ao(o.display);
s.top < 0 && (s.top = 0);
var p = o.curOp && o.curOp.scrollTop != null ? o.curOp.scrollTop : u.scroller.scrollTop, g = Gt(o), m = {};
s.bottom - s.top > g && (s.bottom = s.top + g);
var y = o.doc.height + Z(u), x = s.top < c, O = s.bottom > y - c;
if (s.top < p)
m.scrollTop = x ? 0 : s.top;
else if (s.bottom > p + g) {
var B = Math.min(s.top, (O ? y : s.bottom) - g);
B != p && (m.scrollTop = B);
}
var $ = o.options.fixedGutter ? 0 : u.gutters.offsetWidth, ft = o.curOp && o.curOp.scrollLeft != null ? o.curOp.scrollLeft : u.scroller.scrollLeft - $, dt = Nt(o) - u.gutters.offsetWidth, Ct = s.right - s.left > dt;
return Ct && (s.right = s.left + dt), s.left < 10 ? m.scrollLeft = 0 : s.left < ft ? m.scrollLeft = Math.max(0, s.left + $ - (Ct ? 0 : 10)) : s.right > dt + ft - 3 && (m.scrollLeft = s.right + (Ct ? 0 : 10) - dt), m;
}
function Wa(o, s) {
s != null && (Ci(o), o.curOp.scrollTop = (o.curOp.scrollTop == null ? o.doc.scrollTop : o.curOp.scrollTop) + s);
}
function ss(o) {
Ci(o);
var s = o.getCursor();
o.curOp.scrollToPos = { from: s, to: s, margin: o.options.cursorScrollMargin };
}
function Zs(o, s, u) {
s == null && u == null || Ci(o), s != null && (o.curOp.scrollLeft = s), u != null && (o.curOp.scrollTop = u);
}
function Sp(o, s) {
Ci(o), o.curOp.scrollToPos = s;
}
function Ci(o) {
var s = o.curOp.scrollToPos;
s && (o.curOp.scrollToPos = null, Gc(o, za(o, s.from), za(o, s.to), s.margin));
}
function Gc(o, s, u, c) {
var p = zl(o, { left: Math.min(s.left, u.left), top: Math.min(s.top, u.top) - c, right: Math.max(s.right, u.right), bottom: Math.max(s.bottom, u.bottom) + c });
Zs(o, p.scrollLeft, p.scrollTop);
}
function Qs(o, s) {
Math.abs(o.doc.scrollTop - s) < 2 || (at || Bl(o, { top: s }), ta(o, s, !0), at && Bl(o), ls(o, 100));
}
function ta(o, s, u) {
s = Math.max(0, Math.min(o.display.scroller.scrollHeight - o.display.scroller.clientHeight, s)), (o.display.scroller.scrollTop != s || u) && (o.doc.scrollTop = s, o.display.scrollbars.setScrollTop(s), o.display.scroller.scrollTop != s && (o.display.scroller.scrollTop = s));
}
function jo(o, s, u, c) {
s = Math.max(0, Math.min(s, o.display.scroller.scrollWidth - o.display.scroller.clientWidth)), (u ? s == o.doc.scrollLeft : Math.abs(o.doc.scrollLeft - s) < 2) && !c || (o.doc.scrollLeft = s, oa(o), o.display.scroller.scrollLeft != s && (o.display.scroller.scrollLeft = s), o.display.scrollbars.setScrollLeft(s));
}
function ea(o) {
var s = o.display, u = s.gutters.offsetWidth, c = Math.round(o.doc.height + Z(o.display));
return { clientHeight: s.scroller.clientHeight, viewHeight: s.wrapper.clientHeight, scrollWidth: s.scroller.scrollWidth, clientWidth: s.scroller.clientWidth, viewWidth: s.wrapper.clientWidth, barLeft: o.options.fixedGutter ? u : 0, docHeight: c, scrollHeight: c + lt(o) + s.barHeight, nativeBarWidth: s.nativeBarWidth, gutterWidth: u };
}
var Si = function(o, s, u) {
this.cm = u;
var c = this.vert = gt("div", [gt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"), p = this.horiz = gt("div", [gt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar");
c.tabIndex = p.tabIndex = -1, o(c), o(p), Kt(c, "scroll", function() {
c.clientHeight && s(c.scrollTop, "vertical");
}), Kt(p, "scroll", function() {
p.clientWidth && s(p.scrollLeft, "horizontal");
}), this.checkedZeroWidth = !1, z && k < 8 && (this.horiz.style.minHeight = this.vert.style.minWidth = "18px");
};
Si.prototype.update = function(o) {
var s = o.scrollWidth > o.clientWidth + 1, u = o.scrollHeight > o.clientHeight + 1, c = o.nativeBarWidth;
if (u) {
this.vert.style.display = "block", this.vert.style.bottom = s ? c + "px" : "0";
var p = o.viewHeight - (s ? c : 0);
this.vert.firstChild.style.height = Math.max(0, o.scrollHeight - o.clientHeight + p) + "px";
} else
this.vert.scrollTop = 0, this.vert.style.display = "", this.vert.firstChild.style.height = "0";
if (s) {
this.horiz.style.display = "block", this.horiz.style.right = u ? c + "px" : "0", this.horiz.style.left = o.barLeft + "px";
var g = o.viewWidth - o.barLeft - (u ? c : 0);
this.horiz.firstChild.style.width = Math.max(0, o.scrollWidth - o.clientWidth + g) + "px";
} else
this.horiz.style.display = "", this.horiz.firstChild.style.width = "0";
return !this.checkedZeroWidth && o.clientHeight > 0 && (c == 0 && this.zeroWidthHack(), this.checkedZeroWidth = !0), { right: u ? c : 0, bottom: s ? c : 0 };
}, Si.prototype.setScrollLeft = function(o) {
this.horiz.scrollLeft != o && (this.horiz.scrollLeft = o), this.disableHoriz && this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz");
}, Si.prototype.setScrollTop = function(o) {
this.vert.scrollTop != o && (this.vert.scrollTop = o), this.disableVert && this.enableZeroWidthBar(this.vert, this.disableVert, "vert");
}, Si.prototype.zeroWidthHack = function() {
var o = bt && !Et ? "12px" : "18px";
this.horiz.style.height = this.vert.style.width = o, this.horiz.style.visibility = this.vert.style.visibility = "hidden", this.disableHoriz = new Te(), this.disableVert = new Te();
}, Si.prototype.enableZeroWidthBar = function(o, s, u) {
function c() {
var p = o.getBoundingClientRect();
(u == "vert" ? document.elementFromPoint(p.right - 1, (p.top + p.bottom) / 2) : document.elementFromPoint((p.right + p.left) / 2, p.bottom - 1)) != o ? o.style.visibility = "hidden" : s.set(1e3, c);
}
o.style.visibility = "", s.set(1e3, c);
}, Si.prototype.clear = function() {
var o = this.horiz.parentNode;
o.removeChild(this.horiz), o.removeChild(this.vert);
};
var na = function() {
};
function as(o, s) {
s || (s = ea(o));
var u = o.display.barWidth, c = o.display.barHeight;
zr(o, s);
for (var p = 0; p < 4 && u != o.display.barWidth || c != o.display.barHeight; p++)
u != o.display.barWidth && o.options.lineWrapping && Ba(o), zr(o, ea(o)), u = o.display.barWidth, c = o.display.barHeight;
}
function zr(o, s) {
var u = o.display, c = u.scrollbars.update(s);
u.sizer.style.paddingRight = (u.barWidth = c.right) + "px", u.sizer.style.paddingBottom = (u.barHeight = c.bottom) + "px", u.heightForcer.style.borderBottom = c.bottom + "px solid transparent", c.right && c.bottom ? (u.scrollbarFiller.style.display = "block", u.scrollbarFiller.style.height = c.bottom + "px", u.scrollbarFiller.style.width = c.right + "px") : u.scrollbarFiller.style.display = "", c.bottom && o.options.coverGutterNextToScrollbar && o.options.fixedGutter ? (u.gutterFiller.style.display = "block", u.gutterFiller.style.height = c.bottom + "px", u.gutterFiller.style.width = s.gutterWidth + "px") : u.gutterFiller.style.display = "";
}
na.prototype.update = function() {
return { bottom: 0, right: 0 };
}, na.prototype.setScrollLeft = function() {
}, na.prototype.setScrollTop = function() {
}, na.prototype.clear = function() {
};
var Kc = { native: Si, null: na };
function Yc(o) {
o.display.scrollbars && (o.display.scrollbars.clear(), o.display.scrollbars.addClass && nt(o.display.wrapper, o.display.scrollbars.addClass)), o.display.scrollbars = new Kc[o.options.scrollbarStyle](function(s) {
o.display.wrapper.insertBefore(s, o.display.scrollbarFiller), Kt(s, "mousedown", function() {
o.state.focused && setTimeout(function() {
return o.display.input.focus();
}, 0);
}), s.setAttribute("cm-not-content", "true");
}, function(s, u) {
u == "horizontal" ? jo(o, s) : Qs(o, s);
}, o), o.display.scrollbars.addClass && Qt(o.display.wrapper, o.display.scrollbars.addClass);
}
var Op = 0;
function Oi(o) {
o.curOp = { cm: o, viewChanged: !1, startHeight: o.doc.height, forceUpdate: !1, updateInput: 0, typing: !1, changeObjs: null, cursorActivityHandlers: null, cursorActivityCalled: 0, selectionChanged: !1, updateMaxLine: !1, scrollLeft: null, scrollTop: null, scrollToPos: null, focus: !1, id: ++Op, markArrays: null }, mi(o.curOp);
}
function Ti(o) {
var s = o.curOp;
s && Ji(s, function(u) {
for (var c = 0; c < u.ops.length; c++)
u.ops[c].cm.curOp = null;
Tp(u);
});
}
function Tp(o) {
for (var s = o.ops, u = 0; u < s.length; u++)
kp(s[u]);
for (var c = 0; c < s.length; c++)
Pp(s[c]);
for (var p = 0; p < s.length; p++)
Ep(s[p]);
for (var g = 0; g < s.length; g++)
ra(s[g]);
for (var m = 0; m < s.length; m++)
Ap(s[m]);
}
function kp(o) {
var s = o.cm, u = s.display;
ki(s), o.updateMaxLine && Rs(s), o.mustUpdate = o.viewChanged || o.forceUpdate || o.scrollTop != null || o.scrollToPos && (o.scrollToPos.from.line < u.viewFrom || o.scrollToPos.to.line >= u.viewTo) || u.maxLineChanged && s.options.lineWrapping, o.update = o.mustUpdate && new $a(s, o.mustUpdate && { top: o.scrollTop, ensure: o.scrollToPos }, o.forceUpdate);
}
function Pp(o) {
o.updatedDisplay = o.mustUpdate && Ul(o.cm, o.update);
}
function Ep(o) {
var s = o.cm, u = s.display;
o.updatedDisplay && Ba(s), o.barMeasure = ea(s), u.maxLineChanged && !s.options.lineWrapping && (o.adjustWidthTo = Rr(s, u.maxLine, u.maxLine.text.length).left + 3, s.display.sizerWidth = o.adjustWidthTo, o.barMeasure.scrollWidth = Math.max(u.scroller.clientWidth, u.sizer.offsetLeft + o.adjustWidthTo + lt(s) + s.display.barWidth), o.maxScrollLeft = Math.max(0, u.sizer.offsetLeft + o.adjustWidthTo - Nt(s))), (o.updatedDisplay || o.selectionChanged) && (o.preparedSelection = u.input.prepareSelection());
}
function ra(o) {
var s = o.cm;
o.adjustWidthTo != null && (s.display.sizer.style.minWidth = o.adjustWidthTo + "px", o.maxScrollLeft < s.doc.scrollLeft && jo(s, Math.min(s.display.scroller.scrollLeft, o.maxScrollLeft), !0), s.display.maxLineChanged = !1);
var u = o.focus && o.focus == Tt();
o.preparedSelection && s.display.input.showSelection(o.preparedSelection, u), (o.updatedDisplay || o.startHeight != s.doc.height) && as(s, o.barMeasure), o.updatedDisplay && qa(s, o.barMeasure), o.selectionChanged && is(s), s.state.focused && o.updateInput && s.display.input.reset(o.typing), u && qc(o.cm);
}
function Ap(o) {
var s = o.cm, u = s.display, c = s.doc;
o.updatedDisplay && Xc(s, o.update), u.wheelStartX == null || o.scrollTop == null && o.scrollLeft == null && !o.scrollToPos || (u.wheelStartX = u.wheelStartY = null), o.scrollTop != null && ta(s, o.scrollTop, o.forceScroll), o.scrollLeft != null && jo(s, o.scrollLeft, !0, !0), o.scrollToPos && xp(s, Hl(s, oe(c, o.scrollToPos.from), oe(c, o.scrollToPos.to), o.scrollToPos.margin));
var p = o.maybeHiddenMarkers, g = o.maybeUnhiddenMarkers;
if (p)
for (var m = 0; m < p.length; ++m)
p[m].lines.length || ut(p[m], "hide");
if (g)
for (var y = 0; y < g.length; ++y)
g[y].lines.length && ut(g[y], "unhide");
u.wrapper.offsetHeight && (c.scrollTop = s.display.scroller.scrollTop), o.changeObjs && ut(s, "changes", s, o.changeObjs), o.update && o.update.finish();
}
function fr(o, s) {
if (o.curOp)
return s();
Oi(o);
try {
return s();
} finally {
Ti(o);
}
}
function Gn(o, s) {
return function() {
if (o.curOp)
return s.apply(o, arguments);
Oi(o);
try {
return s.apply(o, arguments);
} finally {
Ti(o);
}
};
}
function ir(o) {
return function() {
if (this.curOp)
return o.apply(this, arguments);
Oi(this);
try {
return o.apply(this, arguments);
} finally {
Ti(this);
}
};
}
function Kn(o) {
return function() {
var s = this.cm;
if (!s || s.curOp)
return o.apply(this, arguments);
Oi(s);
try {
return o.apply(this, arguments);
} finally {
Ti(s);
}
};
}
function ls(o, s) {
o.doc.highlightFrontier < o.display.viewTo && o.state.highlight.set(s, _e(jp, o));
}
function jp(o) {
var s = o.doc;
if (!(s.highlightFrontier >= o.display.viewTo)) {
var u = +/* @__PURE__ */ new Date() + o.options.workTime, c = bo(o, s.highlightFrontier), p = [];
s.iter(c.line, Math.min(s.first + s.size, o.display.viewTo + 500), function(g) {
if (c.line >= o.display.viewFrom) {
var m = g.styles, y = g.text.length > o.options.maxHighlightLength ? $n(s.mode, c.state) : null, x = Ds(o, g, c, !0);
y && (c.state = y), g.styles = x.styles;
var O = g.styleClasses, B = x.classes;
B ? g.styleClasses = B : O && (g.styleClasses = null);
for (var $ = !m || m.length != g.styles.length || O != B && (!O || !B || O.bgClass != B.bgClass || O.textClass != B.textClass), ft = 0; !$ && ft < m.length; ++ft)
$ = m[ft] != g.styles[ft];
$ && p.push(c.line), g.stateAfter = c.save(), c.nextLine();
} else
g.text.length <= o.options.maxHighlightLength && oo(o, g.text, c), g.stateAfter = c.line % 5 == 0 ? c.save() : null, c.nextLine();
if (+/* @__PURE__ */ new Date() > u)
return ls(o, o.options.workDelay), !0;
}), s.highlightFrontier = c.line, s.modeFrontier = Math.max(s.modeFrontier, c.line), p.length && fr(o, function() {
for (var g = 0; g < p.length; g++)
lo(o, p[g], "text");
});
}
}
var $a = function(o, s, u) {
var c = o.display;
this.viewport = s, this.visible = Js(c, o.doc, s), this.editorIsHidden = !c.wrapper.offsetWidth, this.wrapperHeight = c.wrapper.clientHeight, this.wrapperWidth = c.wrapper.clientWidth, this.oldDisplayWidth = Nt(o), this.force = u, this.dims = Nl(o), this.events = [];
};
function ki(o) {
var s = o.display;
!s.scrollbarsClipped && s.scroller.offsetWidth && (s.nativeBarWidth = s.scroller.offsetWidth - s.scroller.clientWidth, s.heightForcer.style.height = lt(o) + "px", s.sizer.style.marginBottom = -s.nativeBarWidth + "px", s.sizer.style.borderRightWidth = lt(o) + "px", s.scrollbarsClipped = !0);
}
function Mp(o) {
if (o.hasFocus())
return null;
var s = Tt();
if (!s || !Lt(o.display.lineDiv, s))
return null;
var u = { activeElt: s };
if (window.getSelection) {
var c = window.getSelection();
c.anchorNode && c.extend && Lt(o.display.lineDiv, c.anchorNode) && (u.anchorNode = c.anchorNode, u.anchorOffset = c.anchorOffset, u.focusNode = c.focusNode, u.focusOffset = c.focusOffset);
}
return u;
}
function Lp(o) {
if (o && o.activeElt && o.activeElt != Tt() && (o.activeElt.focus(), !/^(INPUT|TEXTAREA)$/.test(o.activeElt.nodeName) && o.anchorNode && Lt(document.body, o.anchorNode) && Lt(document.body, o.focusNode))) {
var s = window.getSelection(), u = document.createRange();
u.setEnd(o.anchorNode, o.anchorOffset), u.collapse(!1), s.removeAllRanges(), s.addRange(u), s.extend(o.focusNode, o.focusOffset);
}
}
function Ul(o, s) {
var u = o.display, c = o.doc;
if (s.editorIsHidden)
return Zo(o), !1;
if (!s.force && s.visible.from >= u.viewFrom && s.visible.to <= u.viewTo && (u.updateLineNumbers == null || u.updateLineNumbers >= u.viewTo) && u.renderedView == u.view && $c(o) == 0)
return !1;
Zc(o) && (Zo(o), s.dims = Nl(o));
var p = c.first + c.size, g = Math.max(s.visible.from - o.options.viewportMargin, c.first), m = Math.min(p, s.visible.to + o.options.viewportMargin);
u.viewFrom < g && g - u.viewFrom < 20 && (g = Math.max(c.first, u.viewFrom)), u.viewTo > m && u.viewTo - m < 20 && (m = Math.min(p, u.viewTo)), Zr && (g = pr(o.doc, g), m = Nr(o.doc, m));
var y = g != u.viewFrom || m != u.viewTo || u.lastWrapHeight != s.wrapperHeight || u.lastWrapWidth != s.wrapperWidth;
wp(o, g, m), u.viewOffset = Fr(ve(o.doc, u.viewFrom)), o.display.mover.style.top = u.viewOffset + "px";
var x = $c(o);
if (!y && x == 0 && !s.force && u.renderedView == u.view && (u.updateLineNumbers == null || u.updateLineNumbers >= u.viewTo))
return !1;
var O = Mp(o);
return x > 4 && (u.lineDiv.style.display = "none"), Jc(o, u.updateLineNumbers, s.dims), x > 4 && (u.lineDiv.style.display = ""), u.renderedView = u.view, Lp(O), wt(u.cursorDiv), wt(u.selectionDiv), u.gutters.style.height = u.sizer.style.minHeight = 0, y && (u.lastWrapHeight = s.wrapperHeight, u.lastWrapWidth = s.wrapperWidth, ls(o, 400)), u.updateLineNumbers = null, !0;
}
function Xc(o, s) {
for (var u = s.viewport, c = !0; ; c = !1) {
if (c && o.options.lineWrapping && s.oldDisplayWidth != Nt(o))
c && (s.visible = Js(o.display, o.doc, u));
else if (u && u.top != null && (u = { top: Math.min(o.doc.height + Z(o.display) - Gt(o), u.top) }), s.visible = Js(o.display, o.doc, u), s.visible.from >= o.display.viewFrom && s.visible.to <= o.display.viewTo)
break;
if (!Ul(o, s))
break;
Ba(o);
var p = ea(o);
qs(o), as(o, p), qa(o, p), s.force = !1;
}
s.signal(o, "update", o), o.display.viewFrom == o.display.reportedViewFrom && o.display.viewTo == o.display.reportedViewTo || (s.signal(o, "viewportChange", o, o.display.viewFrom, o.display.viewTo), o.display.reportedViewFrom = o.display.viewFrom, o.display.reportedViewTo = o.display.viewTo);
}
function Bl(o, s) {
var u = new $a(o, s);
if (Ul(o, u)) {
Ba(o), Xc(o, u);
var c = ea(o);
qs(o), as(o, c), qa(o, c), u.finish();
}
}
function Jc(o, s, u) {
var c = o.display, p = o.options.lineNumbers, g = c.lineDiv, m = g.firstChild;
function y(Ct) {
var Rt = Ct.nextSibling;
return P && bt && o.display.currentWheelTarget == Ct ? Ct.style.display = "none" : Ct.parentNode.removeChild(Ct), Rt;
}
for (var x = c.view, O = c.viewFrom, B = 0; B < x.length; B++) {
var $ = x[B];
if (!$.hidden)
if ($.node && $.node.parentNode == g) {
for (; m != $.node; )
m = y(m);
var ft = p && s != null && s <= O && $.lineNumber;
$.changes && (be($.changes, "gutter") > -1 && (ft = !1), zs(o, $, O, u)), ft && (wt($.lineNumber), $.lineNumber.appendChild(document.createTextNode(Bo(o.options, O)))), m = $.node.nextSibling;
} else {
var dt = Bs(o, $, O, u);
g.insertBefore(dt, m);
}
O += $.size;
}
for (; m; )
m = y(m);
}
function Wl(o) {
var s = o.gutters.offsetWidth;
o.sizer.style.marginLeft = s + "px", bn(o, "gutterChanged", o);
}
function qa(o, s) {
o.display.sizer.style.minHeight = s.docHeight + "px", o.display.heightForcer.style.top = s.docHeight + "px", o.display.gutters.style.height = s.docHeight + o.display.barHeight + lt(o) + "px";
}
function oa(o) {
var s = o.display, u = s.view;
if (s.alignWidgets || s.gutters.firstChild && o.options.fixedGutter) {
for (var c = Il(s) - s.scroller.scrollLeft + o.doc.scrollLeft, p = s.gutters.offsetWidth, g = c + "px", m = 0; m < u.length; m++)
if (!u[m].hidden) {
o.options.fixedGutter && (u[m].gutter && (u[m].gutter.style.left = g), u[m].gutterBackground && (u[m].gutterBackground.style.left = g));
var y = u[m].alignable;
if (y)
for (var x = 0; x < y.length; x++)
y[x].style.left = g;
}
o.options.fixedGutter && (s.gutters.style.left = c + p + "px");
}
}
function Zc(o) {
if (!o.options.lineNumbers)
return !1;
var s = o.doc, u = Bo(o.options, s.first + s.size - 1), c = o.display;
if (u.length != c.lineNumChars) {
var p = c.measure.appendChild(gt("div", [gt("div", u)], "CodeMirror-linenumber CodeMirror-gutter-elt")), g = p.firstChild.offsetWidth, m = p.offsetWidth - g;
return c.lineGutter.style.width = "", c.lineNumInnerWidth = Math.max(g, c.lineGutter.offsetWidth - m) + 1, c.lineNumWidth = c.lineNumInnerWidth + m, c.lineNumChars = c.lineNumInnerWidth ? u.length : -1, c.lineGutter.style.width = c.lineNumWidth + "px", Wl(o.display), !0;
}
return !1;
}
function Ga(o, s) {
for (var u = [], c = !1, p = 0; p < o.length; p++) {
var g = o[p], m = null;
if (typeof g != "string" && (m = g.style, g = g.className), g == "CodeMirror-linenumbers") {
if (!s)
continue;
c = !0;
}
u.push({ className: g, style: m });
}
return s && !c && u.push({ className: "CodeMirror-linenumbers", style: null }), u;
}
function Qc(o) {
var s = o.gutters, u = o.gutterSpecs;
wt(s), o.lineGutter = null;
for (var c = 0; c < u.length; ++c) {
var p = u[c], g = p.className, m = p.style, y = s.appendChild(gt("div", null, "CodeMirror-gutter " + g));
m && (y.style.cssText = m), g == "CodeMirror-linenumbers" && (o.lineGutter = y, y.style.width = (o.lineNumWidth || 1) + "px");
}
s.style.display = u.length ? "" : "none", Wl(o);
}
function cs(o) {
Qc(o.display), Qn(o), oa(o);
}
function tu(o, s, u, c) {
var p = this;
this.input = u, p.scrollbarFiller = gt("div", null, "CodeMirror-scrollbar-filler"), p.scrollbarFiller.setAttribute("cm-not-content", "true"), p.gutterFiller = gt("div", null, "CodeMirror-gutter-filler"), p.gutterFiller.setAttribute("cm-not-content", "true"), p.lineDiv = N("div", null, "CodeMirror-code"), p.selectionDiv = gt("div", null, null, "position: relative; z-index: 1"), p.cursorDiv = gt("div", null, "CodeMirror-cursors"), p.measure = gt("div", null, "CodeMirror-measure"), p.lineMeasure = gt("div", null, "CodeMirror-measure"), p.lineSpace = N("div", [p.measure, p.lineMeasure, p.selectionDiv, p.cursorDiv, p.lineDiv], null, "position: relative; outline: none");
var g = N("div", [p.lineSpace], "CodeMirror-lines");
p.mover = gt("div", [g], null, "position: relative"), p.sizer = gt("div", [p.mover], "CodeMirror-sizer"), p.sizerWidth = null, p.heightForcer = gt("div", null, null, "position: absolute; height: " + ge + "px; width: 1px;"), p.gutters = gt("div", null, "CodeMirror-gutters"), p.lineGutter = null, p.scroller = gt("div", [p.sizer, p.heightForcer, p.gutters], "CodeMirror-scroll"), p.scroller.setAttribute("tabIndex", "-1"), p.wrapper = gt("div", [p.scrollbarFiller, p.gutterFiller, p.scroller], "CodeMirror"), p.wrapper.setAttribute("translate", "no"), z && k < 8 && (p.gutters.style.zIndex = -1, p.scroller.style.paddingRight = 0), P || at && xt || (p.scroller.draggable = !0), o && (o.appendChild ? o.appendChild(p.wrapper) : o(p.wrapper)), p.viewFrom = p.viewTo = s.first, p.reportedViewFrom = p.reportedViewTo = s.first, p.view = [], p.renderedView = null, p.externalMeasured = null, p.viewOffset = 0, p.lastWrapHeight = p.lastWrapWidth = 0, p.updateLineNumbers = null, p.nativeBarWidth = p.barHeight = p.barWidth = 0, p.scrollbarsClipped = !1, p.lineNumWidth = p.lineNumInnerWidth = p.lineNumChars = null, p.alignWidgets = !1, p.cachedCharWidth = p.cachedTextHeight = p.cachedPaddingH = null, p.maxLine = null, p.maxLineLength = 0, p.maxLineChanged = !1, p.wheelDX = p.wheelDY = p.wheelStartX = p.wheelStartY = null, p.shift = !1, p.selForContextMenu = null, p.activeTouch = null, p.gutterSpecs = Ga(c.gutters, c.lineNumbers), Qc(p), u.init(p);
}
$a.prototype.signal = function(o, s) {
he(o, s) && this.events.push(arguments);
}, $a.prototype.finish = function() {
for (var o = 0; o < this.events.length; o++)
ut.apply(null, this.events[o]);
};
var Ka = 0, Mo = null;
function eu(o) {
var s = o.wheelDeltaX, u = o.wheelDeltaY;
return s == null && o.detail && o.axis == o.HORIZONTAL_AXIS && (s = o.detail), u == null && o.detail && o.axis == o.VERTICAL_AXIS ? u = o.detail : u == null && (u = o.wheelDelta), { x: s, y: u };
}
function Dp(o) {
var s = eu(o);
return s.x *= Mo, s.y *= Mo, s;
}
function nu(o, s) {
M && D >= 102 && (o.display.chromeScrollHack == null ? o.display.sizer.style.pointerEvents = "none" : clearTimeout(o.display.chromeScrollHack), o.display.chromeScrollHack = setTimeout(function() {
o.display.chromeScrollHack = null, o.display.sizer.style.pointerEvents = "";
}, 100));
var u = eu(s), c = u.x, p = u.y, g = Mo;
s.deltaMode === 0 && (c = s.deltaX, p = s.deltaY, g = 1);
var m = o.display, y = m.scroller, x = y.scrollWidth > y.clientWidth, O = y.scrollHeight > y.clientHeight;
if (c && x || p && O) {
if (p && bt && P) {
t:
for (var B = s.target, $ = m.view; B != y; B = B.parentNode)
for (var ft = 0; ft < $.length; ft++)
if ($[ft].node == B) {
o.display.currentWheelTarget = B;
break t;
}
}
if (c && !at && !ot && g != null)
return p && O && Qs(o, Math.max(0, y.scrollTop + p * g)), jo(o, Math.max(0, y.scrollLeft + c * g)), (!p || p && O) && We(s), void (m.wheelStartX = null);
if (p && g != null) {
var dt = p * g, Ct = o.doc.scrollTop, Rt = Ct + m.wrapper.clientHeight;
dt < 0 ? Ct = Math.max(0, Ct + dt - 50) : Rt = Math.min(o.doc.height, Rt + dt + 50), Bl(o, { top: Ct, bottom: Rt });
}
Ka < 20 && s.deltaMode !== 0 && (m.wheelStartX == null ? (m.wheelStartX = y.scrollLeft, m.wheelStartY = y.scrollTop, m.wheelDX = c, m.wheelDY = p, setTimeout(function() {
if (m.wheelStartX != null) {
var $t = y.scrollLeft - m.wheelStartX, re = y.scrollTop - m.wheelStartY, le = re && m.wheelDY && re / m.wheelDY || $t && m.wheelDX && $t / m.wheelDX;
m.wheelStartX = m.wheelStartY = null, le && (Mo = (Mo * Ka + le) / (Ka + 1), ++Ka);
}
}, 200)) : (m.wheelDX += c, m.wheelDY += p));
}
}
z ? Mo = -0.53 : at ? Mo = 15 : M ? Mo = -0.7 : it && (Mo = -0.3333333333333333);
var Ur = function(o, s) {
this.ranges = o, this.primIndex = s;
};
Ur.prototype.primary = function() {
return this.ranges[this.primIndex];
}, Ur.prototype.equals = function(o) {
if (o == this)
return !0;
if (o.primIndex != this.primIndex || o.ranges.length != this.ranges.length)
return !1;
for (var s = 0; s < this.ranges.length; s++) {
var u = this.ranges[s], c = o.ranges[s];
if (!G(u.anchor, c.anchor) || !G(u.head, c.head))
return !1;
}
return !0;
}, Ur.prototype.deepCopy = function() {
for (var o = [], s = 0; s < this.ranges.length; s++)
o[s] = new tn(Mt(this.ranges[s].anchor), Mt(this.ranges[s].head));
return new Ur(o, this.primIndex);
}, Ur.prototype.somethingSelected = function() {
for (var o = 0; o < this.ranges.length; o++)
if (!this.ranges[o].empty())
return !0;
return !1;
}, Ur.prototype.contains = function(o, s) {
s || (s = o);
for (var u = 0; u < this.ranges.length; u++) {
var c = this.ranges[u];
if (T(s, c.from()) >= 0 && T(o, c.to()) <= 0)
return u;
}
return -1;
};
var tn = function(o, s) {
this.anchor = o, this.head = s;
};
function Qr(o, s, u) {
var c = o && o.options.selectionsMayTouch, p = s[u];
s.sort(function(ft, dt) {
return T(ft.from(), dt.from());
}), u = be(s, p);
for (var g = 1; g < s.length; g++) {
var m = s[g], y = s[g - 1], x = T(y.to(), m.from());
if (c && !m.empty() ? x > 0 : x >= 0) {
var O = de(y.from(), m.from()), B = te(y.to(), m.to()), $ = y.empty() ? m.from() == m.head : y.from() == y.head;
g <= u && --u, s.splice(--g, 2, new tn($ ? B : O, $ ? O : B));
}
}
return new Ur(s, u);
}
function Qo(o, s) {
return new Ur([new tn(o, s || o)], 0);
}
function co(o) {
return o.text ? Bt(o.from.line + o.text.length - 1, Zt(o.text).length + (o.text.length == 1 ? o.from.ch : 0)) : o.to;
}
function ru(o, s) {
if (T(o, s.from) < 0)
return o;
if (T(o, s.to) <= 0)
return co(s);
var u = o.line + s.text.length - (s.to.line - s.from.line) - 1, c = o.ch;
return o.line == s.to.line && (c += co(s).ch - s.to.ch), Bt(u, c);
}
function Ya(o, s) {
for (var u = [], c = 0; c < o.sel.ranges.length; c++) {
var p = o.sel.ranges[c];
u.push(new tn(ru(p.anchor, s), ru(p.head, s)));
}
return Qr(o.cm, u, o.sel.primIndex);
}
function ou(o, s, u) {
return o.line == s.line ? Bt(u.line, o.ch - s.ch + u.ch) : Bt(u.line + (o.line - s.line), o.ch);
}
function ti(o, s, u) {
for (var c = [], p = Bt(o.first, 0), g = p, m = 0; m < s.length; m++) {
var y = s[m], x = ou(y.from, p, g), O = ou(co(y), p, g);
if (p = y.to, g = O, u == "around") {
var B = o.sel.ranges[m], $ = T(B.head, B.anchor) < 0;
c[m] = new tn($ ? O : x, $ ? x : O);
} else
c[m] = new tn(x, x);
}
return new Ur(c, o.sel.primIndex);
}
function Xa(o) {
o.doc.mode = Jr(o.options, o.doc.modeOption), Lo(o);
}
function Lo(o) {
o.doc.iter(function(s) {
s.stateAfter && (s.stateAfter = null), s.styles && (s.styles = null);
}), o.doc.modeFrontier = o.doc.highlightFrontier = o.doc.first, ls(o, 100), o.state.modeGen++, o.curOp && Qn(o);
}
function iu(o, s) {
return s.from.ch == 0 && s.to.ch == 0 && Zt(s.text) == "" && (!o.cm || o.cm.options.wholeLineUpdateBefore);
}
function $l(o, s, u, c) {
function p(le) {
return u ? u[le] : null;
}
function g(le, Jt, ye) {
Hs(le, Jt, ye, c), bn(le, "change", le, s);
}
function m(le, Jt) {
for (var ye = [], me = le; me < Jt; ++me)
ye.push(new Vr(O[me], p(me), c));
return ye;
}
var y = s.from, x = s.to, O = s.text, B = ve(o, y.line), $ = ve(o, x.line), ft = Zt(O), dt = p(O.length - 1), Ct = x.line - y.line;
if (s.full)
o.insert(0, m(0, O.length)), o.remove(O.length, o.size - O.length);
else if (iu(o, s)) {
var Rt = m(0, O.length - 1);
g($, $.text, dt), Ct && o.remove(y.line, Ct), Rt.length && o.insert(y.line, Rt);
} else if (B == $)
if (O.length == 1)
g(B, B.text.slice(0, y.ch) + ft + B.text.slice(x.ch), dt);
else {
var $t = m(1, O.length - 1);
$t.push(new Vr(ft + B.text.slice(x.ch), dt, c)), g(B, B.text.slice(0, y.ch) + O[0], p(0)), o.insert(y.line + 1, $t);
}
else if (O.length == 1)
g(B, B.text.slice(0, y.ch) + O[0] + $.text.slice(x.ch), p(0)), o.remove(y.line + 1, Ct);
else {
g(B, B.text.slice(0, y.ch) + O[0], p(0)), g($, ft + $.text.slice(x.ch), dt);
var re = m(1, O.length - 1);
Ct > 1 && o.remove(y.line + 1, Ct - 1), o.insert(y.line + 1, re);
}
bn(o, "change", o, s);
}
function Do(o, s, u) {
function c(p, g, m) {
if (p.linked)
for (var y = 0; y < p.linked.length; ++y) {
var x = p.linked[y];
if (x.doc != g) {
var O = m && x.sharedHist;
u && !O || (s(x.doc, O), c(x.doc, p, O));
}
}
}
c(o, null, !0);
}
function su(o, s) {
if (s.cm)
throw new Error("This document is already in use.");
o.doc = s, s.cm = o, Fl(o), Xa(o), Ja(o), o.options.direction = s.direction, o.options.lineWrapping || Rs(o), o.options.mode = s.modeOption, Qn(o);
}
function Ja(o) {
(o.doc.direction == "rtl" ? Qt : nt)(o.display.lineDiv, "CodeMirror-rtl");
}
function Np(o) {
fr(o, function() {
Ja(o), Qn(o);
});
}
function Za(o) {
this.done = [], this.undone = [], this.undoDepth = o ? o.undoDepth : 1 / 0, this.lastModTime = this.lastSelTime = 0, this.lastOp = this.lastSelOp = null, this.lastOrigin = this.lastSelOrigin = null, this.generation = this.maxGeneration = o ? o.maxGeneration : 1;
}
function ql(o, s) {
var u = { from: Mt(s.from), to: co(s), text: rr(o, s.from, s.to) };
return Yl(o, u, s.from.line, s.to.line + 1), Do(o, function(c) {
return Yl(c, u, s.from.line, s.to.line + 1);
}, !0), u;
}
function au(o) {
for (; o.length && Zt(o).ranges; )
o.pop();
}
function Ip(o, s) {
return s ? (au(o.done), Zt(o.done)) : o.done.length && !Zt(o.done).ranges ? Zt(o.done) : o.done.length > 1 && !o.done[o.done.length - 2].ranges ? (o.done.pop(), Zt(o.done)) : void 0;
}
function Gl(o, s, u, c) {
var p = o.history;
p.undone.length = 0;
var g, m, y = +/* @__PURE__ */ new Date();
if ((p.lastOp == c || p.lastOrigin == s.origin && s.origin && (s.origin.charAt(0) == "+" && p.lastModTime > y - (o.cm ? o.cm.options.historyEventDelay : 500) || s.origin.charAt(0) == "*")) && (g = Ip(p, p.lastOp == c)))
m = Zt(g.changes), T(s.from, s.to) == 0 && T(s.from, m.to) == 0 ? m.to = co(s) : g.changes.push(ql(o, s));
else {
var x = Zt(p.done);
for (x && x.ranges || Qa(o.sel, p.done), g = { changes: [ql(o, s)], generation: p.generation }, p.done.push(g); p.done.length > p.undoDepth; )
p.done.shift(), p.done[0].ranges || p.done.shift();
}
p.done.push(u), p.generation = ++p.maxGeneration, p.lastModTime = p.lastSelTime = y, p.lastOp = p.lastSelOp = c, p.lastOrigin = p.lastSelOrigin = s.origin, m || ut(o, "historyAdded");
}
function Kl(o, s, u, c) {
var p = s.charAt(0);
return p == "*" || p == "+" && u.ranges.length == c.ranges.length && u.somethingSelected() == c.somethingSelected() && /* @__PURE__ */ new Date() - o.history.lastSelTime <= (o.cm ? o.cm.options.historyEventDelay : 500);
}
function Fp(o, s, u, c) {
var p = o.history, g = c && c.origin;
u == p.lastSelOp || g && p.lastSelOrigin == g && (p.lastModTime == p.lastSelTime && p.lastOrigin == g || Kl(o, g, Zt(p.done), s)) ? p.done[p.done.length - 1] = s : Qa(s, p.done), p.lastSelTime = +/* @__PURE__ */ new Date(), p.lastSelOrigin = g, p.lastSelOp = u, c && c.clearRedo !== !1 && au(p.undone);
}
function Qa(o, s) {
var u = Zt(s);
u && u.ranges && u.equals(o) || s.push(o);
}
function Yl(o, s, u, c) {
var p = s["spans_" + o.id], g = 0;
o.iter(Math.max(o.first, u), Math.min(o.first + o.size, c), function(m) {
m.markedSpans && ((p || (p = s["spans_" + o.id] = {}))[g] = m.markedSpans), ++g;
});
}
function Vp(o) {
if (!o)
return null;
for (var s, u = 0; u < o.length; ++u)
o[u].marker.explicitlyCleared ? s || (s = o.slice(0, u)) : s && s.push(o[u]);
return s ? s.length ? s : null : o;
}
function Rp(o, s) {
var u = s["spans_" + o.id];
if (!u)
return null;
for (var c = [], p = 0; p < s.text.length; ++p)
c.push(Vp(u[p]));
return c;
}
function Xl(o, s) {
var u = Rp(o, s), c = $o(o, s);
if (!u)
return c;
if (!c)
return u;
for (var p = 0; p < u.length; ++p) {
var g = u[p], m = c[p];
if (g && m)
t:
for (var y = 0; y < m.length; ++y) {
for (var x = m[y], O = 0; O < g.length; ++O)
if (g[O].marker == x.marker)
continue t;
g.push(x);
}
else
m && (u[p] = m);
}
return u;
}
function us(o, s, u) {
for (var c = [], p = 0; p < o.length; ++p) {
var g = o[p];
if (g.ranges)
c.push(u ? Ur.prototype.deepCopy.call(g) : g);
else {
var m = g.changes, y = [];
c.push({ changes: y });
for (var x = 0; x < m.length; ++x) {
var O = m[x], B = void 0;
if (y.push({ from: O.from, to: O.to, text: O.text }), s)
for (var $ in O)
(B = $.match(/^spans_(\d+)$/)) && be(s, Number(B[1])) > -1 && (Zt(y)[$] = O[$], delete O[$]);
}
}
}
return c;
}
function Pi(o, s, u, c) {
if (c) {
var p = o.anchor;
if (u) {
var g = T(s, p) < 0;
g != T(u, p) < 0 ? (p = s, s = u) : g != T(s, u) < 0 && (s = u);
}
return new tn(p, s);
}
return new tn(u || s, s);
}
function tl(o, s, u, c, p) {
p == null && (p = o.cm && (o.cm.display.shift || o.extend)), tr(o, new Ur([Pi(o.sel.primary(), s, u, p)], 0), c);
}
function lu(o, s, u) {
for (var c = [], p = o.cm && (o.cm.display.shift || o.extend), g = 0; g < o.sel.ranges.length; g++)
c[g] = Pi(o.sel.ranges[g], s[g], null, p);
tr(o, Qr(o.cm, c, o.sel.primIndex), u);
}
function el(o, s, u, c) {
var p = o.sel.ranges.slice(0);
p[s] = u, tr(o, Qr(o.cm, p, o.sel.primIndex), c);
}
function Jl(o, s, u, c) {
tr(o, Qo(s, u), c);
}
function cu(o, s, u) {
var c = { ranges: s.ranges, update: function(p) {
this.ranges = [];
for (var g = 0; g < p.length; g++)
this.ranges[g] = new tn(oe(o, p[g].anchor), oe(o, p[g].head));
}, origin: u && u.origin };
return ut(o, "beforeSelectionChange", o, c), o.cm && ut(o.cm, "beforeSelectionChange", o.cm, c), c.ranges != s.ranges ? Qr(o.cm, c.ranges, c.ranges.length - 1) : s;
}
function Zl(o, s, u) {
var c = o.history.done, p = Zt(c);
p && p.ranges ? (c[c.length - 1] = s, nl(o, s, u)) : tr(o, s, u);
}
function tr(o, s, u) {
nl(o, s, u), Fp(o, o.sel, o.cm ? o.cm.curOp.id : NaN, u);
}
function nl(o, s, u) {
(he(o, "beforeSelectionChange") || o.cm && he(o.cm, "beforeSelectionChange")) && (s = cu(o, s, u));
var c = u && u.bias || (T(s.primary().head, o.sel.primary().head) < 0 ? -1 : 1);
ps(o, Ql(o, s, c, !0)), u && u.scroll === !1 || !o.cm || o.cm.getOption("readOnly") == "nocursor" || ss(o.cm);
}
function ps(o, s) {
s.equals(o.sel) || (o.sel = s, o.cm && (o.cm.curOp.updateInput = 1, o.cm.curOp.selectionChanged = !0, Yt(o.cm)), bn(o, "cursorActivity", o));
}
function rl(o) {
ps(o, Ql(o, o.sel, null, !1));
}
function Ql(o, s, u, c) {
for (var p, g = 0; g < s.ranges.length; g++) {
var m = s.ranges[g], y = s.ranges.length == o.sel.ranges.length && o.sel.ranges[g], x = ia(o, m.anchor, y && y.anchor, u, c), O = m.head == m.anchor ? x : ia(o, m.head, y && y.head, u, c);
(p || x != m.anchor || O != m.head) && (p || (p = s.ranges.slice(0, g)), p[g] = new tn(x, O));
}
return p ? Qr(o.cm, p, s.primIndex) : s;
}
function Ei(o, s, u, c, p) {
var g = ve(o, s.line);
if (g.markedSpans)
for (var m = 0; m < g.markedSpans.length; ++m) {
var y = g.markedSpans[m], x = y.marker, O = "selectLeft" in x ? !x.selectLeft : x.inclusiveLeft, B = "selectRight" in x ? !x.selectRight : x.inclusiveRight;
if ((y.from == null || (O ? y.from <= s.ch : y.from < s.ch)) && (y.to == null || (B ? y.to >= s.ch : y.to > s.ch))) {
if (p && (ut(x, "beforeCursorEnter"), x.explicitlyCleared)) {
if (g.markedSpans) {
--m;
continue;
}
break;
}
if (!x.atomic)
continue;
if (u) {
var $ = x.find(c < 0 ? 1 : -1), ft = void 0;
if ((c < 0 ? B : O) && ($ = fs(o, $, -c, $ && $.line == s.line ? g : null)), $ && $.line == s.line && (ft = T($, u)) && (c < 0 ? ft < 0 : ft > 0))
return Ei(o, $, s, c, p);
}
var dt = x.find(c < 0 ? -1 : 1);
return (c < 0 ? O : B) && (dt = fs(o, dt, c, dt.line == s.line ? g : null)), dt ? Ei(o, dt, s, c, p) : null;
}
}
return s;
}
function ia(o, s, u, c, p) {
var g = c || 1, m = Ei(o, s, u, g, p) || !p && Ei(o, s, u, g, !0) || Ei(o, s, u, -g, p) || !p && Ei(o, s, u, -g, !0);
return m || (o.cantEdit = !0, Bt(o.first, 0));
}
function fs(o, s, u, c) {
return u < 0 && s.ch == 0 ? s.line > o.first ? oe(o, Bt(s.line - 1)) : null : u > 0 && s.ch == (c || ve(o, s.line)).text.length ? s.line < o.first + o.size - 1 ? Bt(s.line + 1, 0) : null : new Bt(s.line, s.ch + u);
}
function uu(o) {
o.setSelection(Bt(o.firstLine(), 0), Bt(o.lastLine()), ce);
}
function pu(o, s, u) {
var c = { canceled: !1, from: s.from, to: s.to, text: s.text, origin: s.origin, cancel: function() {
return c.canceled = !0;
} };
return u && (c.update = function(p, g, m, y) {
p && (c.from = oe(o, p)), g && (c.to = oe(o, g)), m && (c.text = m), y !== void 0 && (c.origin = y);
}), ut(o, "beforeChange", o, c), o.cm && ut(o.cm, "beforeChange", o.cm, c), c.canceled ? (o.cm && (o.cm.curOp.updateInput = 2), null) : { from: c.from, to: c.to, text: c.text, origin: c.origin };
}
function Ai(o, s, u) {
if (o.cm) {
if (!o.cm.curOp)
return Gn(o.cm, Ai)(o, s, u);
if (o.cm.state.suppressEdits)
return;
}
if (!(he(o, "beforeChange") || o.cm && he(o.cm, "beforeChange")) || (s = pu(o, s, !0))) {
var c = Jn && !u && Be(o, s.from, s.to);
if (c)
for (var p = c.length - 1; p >= 0; --p)
fu(o, { from: c[p].from, to: c[p].to, text: p ? [""] : s.text, origin: s.origin });
else
fu(o, s);
}
}
function fu(o, s) {
if (s.text.length != 1 || s.text[0] != "" || T(s.from, s.to) != 0) {
var u = Ya(o, s);
Gl(o, s, u, o.cm ? o.cm.curOp.id : NaN), sa(o, s, u, $o(o, s));
var c = [];
Do(o, function(p, g) {
g || be(c, p.history) != -1 || (hu(p.history, s), c.push(p.history)), sa(p, s, null, $o(p, s));
});
}
}
function ol(o, s, u) {
var c = o.cm && o.cm.state.suppressEdits;
if (!c || u) {
for (var p, g = o.history, m = o.sel, y = s == "undo" ? g.done : g.undone, x = s == "undo" ? g.undone : g.done, O = 0; O < y.length && (p = y[O], u ? !p.ranges || p.equals(o.sel) : p.ranges); O++)
;
if (O != y.length) {
for (g.lastOrigin = g.lastSelOrigin = null; ; ) {
if (!(p = y.pop()).ranges) {
if (c)
return void y.push(p);
break;
}
if (Qa(p, x), u && !p.equals(o.sel))
return void tr(o, p, { clearRedo: !1 });
m = p;
}
var B = [];
Qa(m, x), x.push({ changes: B, generation: g.generation }), g.generation = p.generation || ++g.maxGeneration;
for (var $ = he(o, "beforeChange") || o.cm && he(o.cm, "beforeChange"), ft = function(Rt) {
var $t = p.changes[Rt];
if ($t.origin = s, $ && !pu(o, $t, !1))
return y.length = 0, {};
B.push(ql(o, $t));
var re = Rt ? Ya(o, $t) : Zt(y);
sa(o, $t, re, Xl(o, $t)), !Rt && o.cm && o.cm.scrollIntoView({ from: $t.from, to: co($t) });
var le = [];
Do(o, function(Jt, ye) {
ye || be(le, Jt.history) != -1 || (hu(Jt.history, $t), le.push(Jt.history)), sa(Jt, $t, null, Xl(Jt, $t));
});
}, dt = p.changes.length - 1; dt >= 0; --dt) {
var Ct = ft(dt);
if (Ct)
return Ct.v;
}
}
}
}
function tc(o, s) {
if (s != 0 && (o.first += s, o.sel = new Ur(Ae(o.sel.ranges, function(p) {
return new tn(Bt(p.anchor.line + s, p.anchor.ch), Bt(p.head.line + s, p.head.ch));
}), o.sel.primIndex), o.cm)) {
Qn(o.cm, o.first, o.first - s, s);
for (var u = o.cm.display, c = u.viewFrom; c < u.viewTo; c++)
lo(o.cm, c, "gutter");
}
}
function sa(o, s, u, c) {
if (o.cm && !o.cm.curOp)
return Gn(o.cm, sa)(o, s, u, c);
if (s.to.line < o.first)
tc(o, s.text.length - 1 - (s.to.line - s.from.line));
else if (!(s.from.line > o.lastLine())) {
if (s.from.line < o.first) {
var p = s.text.length - 1 - (o.first - s.from.line);
tc(o, p), s = { from: Bt(o.first, 0), to: Bt(s.to.line + p, s.to.ch), text: [Zt(s.text)], origin: s.origin };
}
var g = o.lastLine();
s.to.line > g && (s = { from: s.from, to: Bt(g, ve(o, g).text.length), text: [s.text[0]], origin: s.origin }), s.removed = rr(o, s.from, s.to), u || (u = Ya(o, s)), o.cm ? Hp(o.cm, s, c) : $l(o, s, c), nl(o, u, ce), o.cantEdit && ia(o, Bt(o.firstLine(), 0)) && (o.cantEdit = !1);
}
}
function Hp(o, s, u) {
var c = o.doc, p = o.display, g = s.from, m = s.to, y = !1, x = g.line;
o.options.lineWrapping || (x = Ye(Or(ve(c, g.line))), c.iter(x, m.line + 1, function(dt) {
if (dt == p.maxLine)
return y = !0, !0;
})), c.sel.contains(s.from, s.to) > -1 && Yt(o), $l(c, s, u, Wc(o)), o.options.lineWrapping || (c.iter(x, g.line + s.text.length, function(dt) {
var Ct = vi(dt);
Ct > p.maxLineLength && (p.maxLine = dt, p.maxLineLength = Ct, p.maxLineChanged = !0, y = !1);
}), y && (o.curOp.updateMaxLine = !0)), Is(c, g.line), ls(o, 400);
var O = s.text.length - (m.line - g.line) - 1;
s.full ? Qn(o) : g.line != m.line || s.text.length != 1 || iu(o.doc, s) ? Qn(o, g.line, m.line + 1, O) : lo(o, g.line, "text");
var B = he(o, "changes"), $ = he(o, "change");
if ($ || B) {
var ft = { from: g, to: m, text: s.text, removed: s.removed, origin: s.origin };
$ && bn(o, "change", o, ft), B && (o.curOp.changeObjs || (o.curOp.changeObjs = [])).push(ft);
}
o.display.selForContextMenu = null;
}
function ds(o, s, u, c, p) {
var g;
c || (c = u), T(c, u) < 0 && (u = (g = [c, u])[0], c = g[1]), typeof s == "string" && (s = o.splitLines(s)), Ai(o, { from: u, to: c, text: s, origin: p });
}
function du(o, s, u, c) {
u < o.line ? o.line += c : s < o.line && (o.line = s, o.ch = 0);
}
function aa(o, s, u, c) {
for (var p = 0; p < o.length; ++p) {
var g = o[p], m = !0;
if (g.ranges) {
g.copied || ((g = o[p] = g.deepCopy()).copied = !0);
for (var y = 0; y < g.ranges.length; y++)
du(g.ranges[y].anchor, s, u, c), du(g.ranges[y].head, s, u, c);
} else {
for (var x = 0; x < g.changes.length; ++x) {
var O = g.changes[x];
if (u < O.from.line)
O.from = Bt(O.from.line + c, O.from.ch), O.to = Bt(O.to.line + c, O.to.ch);
else if (s <= O.to.line) {
m = !1;
break;
}
}
m || (o.splice(0, p + 1), p = 0);
}
}
}
function hu(o, s) {
var u = s.from.line, c = s.to.line, p = s.text.length - (c - u) - 1;
aa(o.done, u, c, p), aa(o.undone, u, c, p);
}
function la(o, s, u, c) {
var p = s, g = s;
return typeof s == "number" ? g = ve(o, $e(o, s)) : p = Ye(s), p == null ? null : (c(g, p) && o.cm && lo(o.cm, p, u), g);
}
function ca(o) {
this.lines = o, this.parent = null;
for (var s = 0, u = 0; u < o.length; ++u)
o[u].parent = this, s += o[u].height;
this.height = s;
}
function hs(o) {
this.children = o;
for (var s = 0, u = 0, c = 0; c < o.length; ++c) {
var p = o[c];
s += p.chunkSize(), u += p.height, p.parent = this;
}
this.size = s, this.height = u, this.parent = null;
}
tn.prototype.from = function() {
return de(this.anchor, this.head);
}, tn.prototype.to = function() {
return te(this.anchor, this.head);
}, tn.prototype.empty = function() {
return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch;
}, ca.prototype = { chunkSize: function() {
return this.lines.length;
}, removeInner: function(o, s) {
for (var u = o, c = o + s; u < c; ++u) {
var p = this.lines[u];
this.height -= p.height, ja(p), bn(p, "delete");
}
this.lines.splice(o, s);
}, collapse: function(o) {
o.push.apply(o, this.lines);
}, insertInner: function(o, s, u) {
this.height += u, this.lines = this.lines.slice(0, o).concat(s).concat(this.lines.slice(o));
for (var c = 0; c < s.length; ++c)
s[c].parent = this;
}, iterN: function(o, s, u) {
for (var c = o + s; o < c; ++o)
if (u(this.lines[o]))
return !0;
} }, hs.prototype = { chunkSize: function() {
return this.size;
}, removeInner: function(o, s) {
this.size -= s;
for (var u = 0; u < this.children.length; ++u) {
var c = this.children[u], p = c.chunkSize();
if (o < p) {
var g = Math.min(s, p - o), m = c.height;
if (c.removeInner(o, g), this.height -= m - c.height, p == g && (this.children.splice(u--, 1), c.parent = null), (s -= g) == 0)
break;
o = 0;
} else
o -= p;
}
if (this.size - s < 25 && (this.children.length > 1 || !(this.children[0] instanceof ca))) {
var y = [];
this.collapse(y), this.children = [new ca(y)], this.children[0].parent = this;
}
}, collapse: function(o) {
for (var s = 0; s < this.children.length; ++s)
this.children[s].collapse(o);
}, insertInner: function(o, s, u) {
this.size += s.length, this.height += u;
for (var c = 0; c < this.children.length; ++c) {
var p = this.children[c], g = p.chunkSize();
if (o <= g) {
if (p.insertInner(o, s, u), p.lines && p.lines.length > 50) {
for (var m = p.lines.length % 25 + 25, y = m; y < p.lines.length; ) {
var x = new ca(p.lines.slice(y, y += 25));
p.height -= x.height, this.children.splice(++c, 0, x), x.parent = this;
}
p.lines = p.lines.slice(0, m), this.maybeSpill();
}
break;
}
o -= g;
}
}, maybeSpill: function() {
if (!(this.children.length <= 10)) {
var o = this;
do {
var s = new hs(o.children.splice(o.children.length - 5, 5));
if (o.parent) {
o.size -= s.size, o.height -= s.height;
var u = be(o.parent.children, o);
o.parent.children.splice(u + 1, 0, s);
} else {
var c = new hs(o.children);
c.parent = o, o.children = [c, s], o = c;
}
s.parent = o.parent;
} while (o.children.length > 10);
o.parent.maybeSpill();
}
}, iterN: function(o, s, u) {
for (var c = 0; c < this.children.length; ++c) {
var p = this.children[c], g = p.chunkSize();
if (o < g) {
var m = Math.min(s, g - o);
if (p.iterN(o, m, u))
return !0;
if ((s -= m) == 0)
break;
o = 0;
} else
o -= g;
}
} };
var ua = function(o, s, u) {
if (u)
for (var c in u)
u.hasOwnProperty(c) && (this[c] = u[c]);
this.doc = o, this.node = s;
};
function ec(o, s, u) {
Fr(s) < (o.curOp && o.curOp.scrollTop || o.doc.scrollTop) && Wa(o, u);
}
function nc(o, s, u, c) {
var p = new ua(o, u, c), g = o.cm;
return g && p.noHScroll && (g.display.alignWidgets = !0), la(o, s, "widget", function(m) {
var y = m.widgets || (m.widgets = []);
if (p.insertAt == null ? y.push(p) : y.splice(Math.min(y.length, Math.max(0, p.insertAt)), 0, p), p.line = m, g && !Ir(o, m)) {
var x = Fr(m) < o.scrollTop;
or(m, m.height + _(p)), x && Wa(g, p.height), g.curOp.forceUpdate = !0;
}
return !0;
}), g && bn(g, "lineWidgetAdded", g, p, typeof s == "number" ? s : Ye(s)), p;
}
ua.prototype.clear = function() {
var o = this.doc.cm, s = this.line.widgets, u = this.line, c = Ye(u);
if (c != null && s) {
for (var p = 0; p < s.length; ++p)
s[p] == this && s.splice(p--, 1);
s.length || (u.widgets = null);
var g = _(this);
or(u, Math.max(0, u.height - g)), o && (fr(o, function() {
ec(o, u, -g), lo(o, c, "widget");
}), bn(o, "lineWidgetCleared", o, this, c));
}
}, ua.prototype.changed = function() {
var o = this, s = this.height, u = this.doc.cm, c = this.line;
this.height = null;
var p = _(this) - s;
p && (Ir(this.doc, c) || or(c, c.height + p), u && fr(u, function() {
u.curOp.forceUpdate = !0, ec(u, c, p), bn(u, "lineWidgetChanged", u, o, Ye(c));
}));
}, Re(ua);
var rc = 0, ei = function(o, s) {
this.lines = [], this.type = s, this.doc = o, this.id = ++rc;
};
function gs(o, s, u, c, p) {
if (c && c.shared)
return zp(o, s, u, c, p);
if (o.cm && !o.cm.curOp)
return Gn(o.cm, gs)(o, s, u, c, p);
var g = new ei(o, p), m = T(s, u);
if (c && De(c, g, !1), m > 0 || m == 0 && g.clearWhenEmpty !== !1)
return g;
if (g.replacedWith && (g.collapsed = !0, g.widgetNode = N("span", [g.replacedWith], "CodeMirror-widget"), c.handleMouseEvents || g.widgetNode.setAttribute("cm-ignore-events", "true"), c.insertLeft && (g.widgetNode.insertLeft = !0)), g.collapsed) {
if (yn(o, s.line, s, u, g) || s.line != u.line && yn(o, u.line, s, u, g))
throw new Error("Inserting collapsed marker partially overlapping an existing one");
Fs();
}
g.addToHistory && Gl(o, { from: s, to: u, origin: "markText" }, o.sel, NaN);
var y, x = s.line, O = o.cm;
if (o.iter(x, u.line + 1, function($) {
O && g.collapsed && !O.options.lineWrapping && Or($) == O.display.maxLine && (y = !0), g.collapsed && x != s.line && or($, 0), Vs($, new Cr(g, x == s.line ? s.ch : null, x == u.line ? u.ch : null), o.cm && o.cm.curOp), ++x;
}), g.collapsed && o.iter(s.line, u.line + 1, function($) {
Ir(o, $) && or($, 0);
}), g.clearOnEnter && Kt(g, "beforeCursorEnter", function() {
return g.clear();
}), g.readOnly && (fi(), (o.history.done.length || o.history.undone.length) && o.clearHistory()), g.collapsed && (g.id = ++rc, g.atomic = !0), O) {
if (y && (O.curOp.updateMaxLine = !0), g.collapsed)
Qn(O, s.line, u.line + 1);
else if (g.className || g.startStyle || g.endStyle || g.css || g.attributes || g.title)
for (var B = s.line; B <= u.line; B++)
lo(O, B, "text");
g.atomic && rl(O.doc), bn(O, "markerAdded", O, g);
}
return g;
}
ei.prototype.clear = function() {
if (!this.explicitlyCleared) {
var o = this.doc.cm, s = o && !o.curOp;
if (s && Oi(o), he(this, "clear")) {
var u = this.find();
u && bn(this, "clear", u.from, u.to);
}
for (var c = null, p = null, g = 0; g < this.lines.length; ++g) {
var m = this.lines[g], y = Oo(m.markedSpans, this);
o && !this.collapsed ? lo(o, Ye(m), "text") : o && (y.to != null && (p = Ye(m)), y.from != null && (c = Ye(m))), m.markedSpans = di(m.markedSpans, y), y.from == null && this.collapsed && !Ir(this.doc, m) && o && or(m, ao(o.display));
}
if (o && this.collapsed && !o.options.lineWrapping)
for (var x = 0; x < this.lines.length; ++x) {
var O = Or(this.lines[x]), B = vi(O);
B > o.display.maxLineLength && (o.display.maxLine = O, o.display.maxLineLength = B, o.display.maxLineChanged = !0);
}
c != null && o && this.collapsed && Qn(o, c, p + 1), this.lines.length = 0, this.explicitlyCleared = !0, this.atomic && this.doc.cantEdit && (this.doc.cantEdit = !1, o && rl(o.doc)), o && bn(o, "markerCleared", o, this, c, p), s && Ti(o), this.parent && this.parent.clear();
}
}, ei.prototype.find = function(o, s) {
var u, c;
o == null && this.type == "bookmark" && (o = 1);
for (var p = 0; p < this.lines.length; ++p) {
var g = this.lines[p], m = Oo(g.markedSpans, this);
if (m.from != null && (u = Bt(s ? g : Ye(g), m.from), o == -1))
return u;
if (m.to != null && (c = Bt(s ? g : Ye(g), m.to), o == 1))
return c;
}
return u && { from: u, to: c };
}, ei.prototype.changed = function() {
var o = this, s = this.find(-1, !0), u = this, c = this.doc.cm;
s && c && fr(c, function() {
var p = s.line, g = Ye(s.line), m = ts(c, g);
if (m && (Hc(m), c.curOp.selectionChanged = c.curOp.forceUpdate = !0), c.curOp.updateMaxLine = !0, !Ir(u.doc, p) && u.height != null) {
var y = u.height;
u.height = null;
var x = _(u) - y;
x && or(p, p.height + x);
}
bn(c, "markerChanged", c, o);
});
}, ei.prototype.attachLine = function(o) {
if (!this.lines.length && this.doc.cm) {
var s = this.doc.cm.curOp;
s.maybeHiddenMarkers && be(s.maybeHiddenMarkers, this) != -1 || (s.maybeUnhiddenMarkers || (s.maybeUnhiddenMarkers = [])).push(this);
}
this.lines.push(o);
}, ei.prototype.detachLine = function(o) {
if (this.lines.splice(be(this.lines, o), 1), !this.lines.length && this.doc.cm) {
var s = this.doc.cm.curOp;
(s.maybeHiddenMarkers || (s.maybeHiddenMarkers = [])).push(this);
}
}, Re(ei);
var pa = function(o, s) {
this.markers = o, this.primary = s;
for (var u = 0; u < o.length; ++u)
o[u].parent = this;
};
function zp(o, s, u, c, p) {
(c = De(c)).shared = !1;
var g = [gs(o, s, u, c, p)], m = g[0], y = c.widgetNode;
return Do(o, function(x) {
y && (c.widgetNode = y.cloneNode(!0)), g.push(gs(x, oe(x, s), oe(x, u), c, p));
for (var O = 0; O < x.linked.length; ++O)
if (x.linked[O].isParent)
return;
m = Zt(g);
}), new pa(g, m);
}
function gu(o) {
return o.findMarks(Bt(o.first, 0), o.clipPos(Bt(o.lastLine())), function(s) {
return s.parent;
});
}
function vu(o, s) {
for (var u = 0; u < s.length; u++) {
var c = s[u], p = c.find(), g = o.clipPos(p.from), m = o.clipPos(p.to);
if (T(g, m)) {
var y = gs(o, g, m, c.primary, c.primary.type);
c.markers.push(y), y.parent = c;
}
}
}
function mu(o) {
for (var s = function(c) {
var p = o[c], g = [p.primary.doc];
Do(p.primary.doc, function(x) {
return g.push(x);
});
for (var m = 0; m < p.markers.length; m++) {
var y = p.markers[m];
be(g, y.doc) == -1 && (y.parent = null, p.markers.splice(m--, 1));
}
}, u = 0; u < o.length; u++)
s(u);
}
pa.prototype.clear = function() {
if (!this.explicitlyCleared) {
this.explicitlyCleared = !0;
for (var o = 0; o < this.markers.length; ++o)
this.markers[o].clear();
bn(this, "clear");
}
}, pa.prototype.find = function(o, s) {
return this.primary.find(o, s);
}, Re(pa);
var Up = 0, Fn = function(o, s, u, c, p) {
if (!(this instanceof Fn))
return new Fn(o, s, u, c, p);
u == null && (u = 0), hs.call(this, [new ca([new Vr("", null)])]), this.first = u, this.scrollTop = this.scrollLeft = 0, this.cantEdit = !1, this.cleanGeneration = 1, this.modeFrontier = this.highlightFrontier = u;
var g = Bt(u, 0);
this.sel = Qo(g), this.history = new Za(null), this.id = ++Up, this.modeOption = s, this.lineSep = c, this.direction = p == "rtl" ? "rtl" : "ltr", this.extend = !1, typeof o == "string" && (o = this.splitLines(o)), $l(this, { from: g, to: g, text: o }), tr(this, Qo(g), ce);
};
Fn.prototype = vn(hs.prototype, { constructor: Fn, iter: function(o, s, u) {
u ? this.iterN(o - this.first, s - o, u) : this.iterN(this.first, this.first + this.size, o);
}, insert: function(o, s) {
for (var u = 0, c = 0; c < s.length; ++c)
u += s[c].height;
this.insertInner(o - this.first, s, u);
}, remove: function(o, s) {
this.removeInner(o - this.first, s);
}, getValue: function(o) {
var s = Uo(this, this.first, this.first + this.size);
return o === !1 ? s : s.join(o || this.lineSeparator());
}, setValue: Kn(function(o) {
var s = Bt(this.first, 0), u = this.first + this.size - 1;
Ai(this, { from: s, to: Bt(u, ve(this, u).text.length), text: this.splitLines(o), origin: "setValue", full: !0 }, !0), this.cm && Zs(this.cm, 0, 0), tr(this, Qo(s), ce);
}), replaceRange: function(o, s, u, c) {
ds(this, o, s = oe(this, s), u = u ? oe(this, u) : s, c);
}, getRange: function(o, s, u) {
var c = rr(this, oe(this, o), oe(this, s));
return u === !1 ? c : u === "" ? c.join("") : c.join(u || this.lineSeparator());
}, getLine: function(o) {
var s = this.getLineHandle(o);
return s && s.text;
}, getLineHandle: function(o) {
if (yo(this, o))
return ve(this, o);
}, getLineNumber: function(o) {
return Ye(o);
}, getLineHandleVisualStart: function(o) {
return typeof o == "number" && (o = ve(this, o)), Or(o);
}, lineCount: function() {
return this.size;
}, firstLine: function() {
return this.first;
}, lastLine: function() {
return this.first + this.size - 1;
}, clipPos: function(o) {
return oe(this, o);
}, getCursor: function(o) {
var s = this.sel.primary();
return o == null || o == "head" ? s.head : o == "anchor" ? s.anchor : o == "end" || o == "to" || o === !1 ? s.to() : s.from();
}, listSelections: function() {
return this.sel.ranges;
}, somethingSelected: function() {
return this.sel.somethingSelected();
}, setCursor: Kn(function(o, s, u) {
Jl(this, oe(this, typeof o == "number" ? Bt(o, s || 0) : o), null, u);
}), setSelection: Kn(function(o, s, u) {
Jl(this, oe(this, o), oe(this, s || o), u);
}), extendSelection: Kn(function(o, s, u) {
tl(this, oe(this, o), s && oe(this, s), u);
}), extendSelections: Kn(function(o, s) {
lu(this, Tn(this, o), s);
}), extendSelectionsBy: Kn(function(o, s) {
lu(this, Tn(this, Ae(this.sel.ranges, o)), s);
}), setSelections: Kn(function(o, s, u) {
if (o.length) {
for (var c = [], p = 0; p < o.length; p++)
c[p] = new tn(oe(this, o[p].anchor), oe(this, o[p].head || o[p].anchor));
s == null && (s = Math.min(o.length - 1, this.sel.primIndex)), tr(this, Qr(this.cm, c, s), u);
}
}), addSelection: Kn(function(o, s, u) {
var c = this.sel.ranges.slice(0);
c.push(new tn(oe(this, o), oe(this, s || o))), tr(this, Qr(this.cm, c, c.length - 1), u);
}), getSelection: function(o) {
for (var s, u = this.sel.ranges, c = 0; c < u.length; c++) {
var p = rr(this, u[c].from(), u[c].to());
s = s ? s.concat(p) : p;
}
return o === !1 ? s : s.join(o || this.lineSeparator());
}, getSelections: function(o) {
for (var s = [], u = this.sel.ranges, c = 0; c < u.length; c++) {
var p = rr(this, u[c].from(), u[c].to());
o !== !1 && (p = p.join(o || this.lineSeparator())), s[c] = p;
}
return s;
}, replaceSelection: function(o, s, u) {
for (var c = [], p = 0; p < this.sel.ranges.length; p++)
c[p] = o;
this.replaceSelections(c, s, u || "+input");
}, replaceSelections: Kn(function(o, s, u) {
for (var c = [], p = this.sel, g = 0; g < p.ranges.length; g++) {
var m = p.ranges[g];
c[g] = { from: m.from(), to: m.to(), text: this.splitLines(o[g]), origin: u };
}
for (var y = s && s != "end" && ti(this, c, s), x = c.length - 1; x >= 0; x--)
Ai(this, c[x]);
y ? Zl(this, y) : this.cm && ss(this.cm);
}), undo: Kn(function() {
ol(this, "undo");
}), redo: Kn(function() {
ol(this, "redo");
}), undoSelection: Kn(function() {
ol(this, "undo", !0);
}), redoSelection: Kn(function() {
ol(this, "redo", !0);
}), setExtending: function(o) {
this.extend = o;
}, getExtending: function() {
return this.extend;
}, historySize: function() {
for (var o = this.history, s = 0, u = 0, c = 0; c < o.done.length; c++)
o.done[c].ranges || ++s;
for (var p = 0; p < o.undone.length; p++)
o.undone[p].ranges || ++u;
return { undo: s, redo: u };
}, clearHistory: function() {
var o = this;
this.history = new Za(this.history), Do(this, function(s) {
return s.history = o.history;
}, !0);
}, markClean: function() {
this.cleanGeneration = this.changeGeneration(!0);
}, changeGeneration: function(o) {
return o && (this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null), this.history.generation;
}, isClean: function(o) {
return this.history.generation == (o || this.cleanGeneration);
}, getHistory: function() {
return { done: us(this.history.done), undone: us(this.history.undone) };
}, setHistory: function(o) {
var s = this.history = new Za(this.history);
s.done = us(o.done.slice(0), null, !0), s.undone = us(o.undone.slice(0), null, !0);
}, setGutterMarker: Kn(function(o, s, u) {
return la(this, o, "gutter", function(c) {
var p = c.gutterMarkers || (c.gutterMarkers = {});
return p[s] = u, !u && b(p) && (c.gutterMarkers = null), !0;
});
}), clearGutter: Kn(function(o) {
var s = this;
this.iter(function(u) {
u.gutterMarkers && u.gutterMarkers[o] && la(s, u, "gutter", function() {
return u.gutterMarkers[o] = null, b(u.gutterMarkers) && (u.gutterMarkers = null), !0;
});
});
}), lineInfo: function(o) {
var s;
if (typeof o == "number") {
if (!yo(this, o) || (s = o, !(o = ve(this, o))))
return null;
} else if ((s = Ye(o)) == null)
return null;
return { line: s, handle: o, text: o.text, gutterMarkers: o.gutterMarkers, textClass: o.textClass, bgClass: o.bgClass, wrapClass: o.wrapClass, widgets: o.widgets };
}, addLineClass: Kn(function(o, s, u) {
return la(this, o, s == "gutter" ? "gutter" : "class", function(c) {
var p = s == "text" ? "textClass" : s == "background" ? "bgClass" : s == "gutter" ? "gutterClass" : "wrapClass";
if (c[p]) {
if (V(u).test(c[p]))
return !1;
c[p] += " " + u;
} else
c[p] = u;
return !0;
});
}), removeLineClass: Kn(function(o, s, u) {
return la(this, o, s == "gutter" ? "gutter" : "class", function(c) {
var p = s == "text" ? "textClass" : s == "background" ? "bgClass" : s == "gutter" ? "gutterClass" : "wrapClass", g = c[p];
if (!g)
return !1;
if (u == null)
c[p] = null;
else {
var m = g.match(V(u));
if (!m)
return !1;
var y = m.index + m[0].length;
c[p] = g.slice(0, m.index) + (m.index && y != g.length ? " " : "") + g.slice(y) || null;
}
return !0;
});
}), addLineWidget: Kn(function(o, s, u) {
return nc(this, o, s, u);
}), removeLineWidget: function(o) {
o.clear();
}, markText: function(o, s, u) {
return gs(this, oe(this, o), oe(this, s), u, u && u.type || "range");
}, setBookmark: function(o, s) {
var u = { replacedWith: s && (s.nodeType == null ? s.widget : s), insertLeft: s && s.insertLeft, clearWhenEmpty: !1, shared: s && s.shared, handleMouseEvents: s && s.handleMouseEvents };
return gs(this, o = oe(this, o), o, u, "bookmark");
}, findMarksAt: function(o) {
var s = [], u = ve(this, (o = oe(this, o)).line).markedSpans;
if (u)
for (var c = 0; c < u.length; ++c) {
var p = u[c];
(p.from == null || p.from <= o.ch) && (p.to == null || p.to >= o.ch) && s.push(p.marker.parent || p.marker);
}
return s;
}, findMarks: function(o, s, u) {
o = oe(this, o), s = oe(this, s);
var c = [], p = o.line;
return this.iter(o.line, s.line + 1, function(g) {
var m = g.markedSpans;
if (m)
for (var y = 0; y < m.length; y++) {
var x = m[y];
x.to != null && p == o.line && o.ch >= x.to || x.from == null && p != o.line || x.from != null && p == s.line && x.from >= s.ch || u && !u(x.marker) || c.push(x.marker.parent || x.marker);
}
++p;
}), c;
}, getAllMarks: function() {
var o = [];
return this.iter(function(s) {
var u = s.markedSpans;
if (u)
for (var c = 0; c < u.length; ++c)
u[c].from != null && o.push(u[c].marker);
}), o;
}, posFromIndex: function(o) {
var s, u = this.first, c = this.lineSeparator().length;
return this.iter(function(p) {
var g = p.text.length + c;
if (g > o)
return s = o, !0;
o -= g, ++u;
}), oe(this, Bt(u, s));
}, indexFromPos: function(o) {
var s = (o = oe(this, o)).ch;
if (o.line < this.first || o.ch < 0)
return 0;
var u = this.lineSeparator().length;
return this.iter(this.first, o.line, function(c) {
s += c.text.length + u;
}), s;
}, copy: function(o) {
var s = new Fn(Uo(this, this.first, this.first + this.size), this.modeOption, this.first, this.lineSep, this.direction);
return s.scrollTop = this.scrollTop, s.scrollLeft = this.scrollLeft, s.sel = this.sel, s.extend = !1, o && (s.history.undoDepth = this.history.undoDepth, s.setHistory(this.getHistory())), s;
}, linkedDoc: function(o) {
o || (o = {});
var s = this.first, u = this.first + this.size;
o.from != null && o.from > s && (s = o.from), o.to != null && o.to < u && (u = o.to);
var c = new Fn(Uo(this, s, u), o.mode || this.modeOption, s, this.lineSep, this.direction);
return o.sharedHist && (c.history = this.history), (this.linked || (this.linked = [])).push({ doc: c, sharedHist: o.sharedHist }), c.linked = [{ doc: this, isParent: !0, sharedHist: o.sharedHist }], vu(c, gu(this)), c;
}, unlinkDoc: function(o) {
if (o instanceof wn && (o = o.doc), this.linked) {
for (var s = 0; s < this.linked.length; ++s)
if (this.linked[s].doc == o) {
this.linked.splice(s, 1), o.unlinkDoc(this), mu(gu(this));
break;
}
}
if (o.history == this.history) {
var u = [o.id];
Do(o, function(c) {
return u.push(c.id);
}, !0), o.history = new Za(null), o.history.done = us(this.history.done, u), o.history.undone = us(this.history.undone, u);
}
}, iterLinkedDocs: function(o) {
Do(this, o);
}, getMode: function() {
return this.mode;
}, getEditor: function() {
return this.cm;
}, splitLines: function(o) {
return this.lineSep ? o.split(this.lineSep) : _o(o);
}, lineSeparator: function() {
return this.lineSep || `
`;
}, setDirection: Kn(function(o) {
o != "rtl" && (o = "ltr"), o != this.direction && (this.direction = o, this.iter(function(s) {
return s.order = null;
}), this.cm && Np(this.cm));
}) }), Fn.prototype.eachLine = Fn.prototype.iter;
var yu = 0;
function Bp(o) {
var s = this;
if (wu(s), !yt(s, o) && !A(s.display, o)) {
We(o), z && (yu = +/* @__PURE__ */ new Date());
var u = wi(s, o, !0), c = o.dataTransfer.files;
if (u && !s.isReadOnly())
if (c && c.length && window.FileReader && window.File)
for (var p = c.length, g = Array(p), m = 0, y = function() {
++m == p && Gn(s, function() {
var dt = { from: u = oe(s.doc, u), to: u, text: s.doc.splitLines(g.filter(function(Ct) {
return Ct != null;
}).join(s.doc.lineSeparator())), origin: "paste" };
Ai(s.doc, dt), Zl(s.doc, Qo(oe(s.doc, u), oe(s.doc, co(dt))));
})();
}, x = function(dt, Ct) {
if (s.options.allowDropFileTypes && be(s.options.allowDropFileTypes, dt.type) == -1)
y();
else {
var Rt = new FileReader();
Rt.onerror = function() {
return y();
}, Rt.onload = function() {
var $t = Rt.result;
/[\x00-\x08\x0e-\x1f]{2}/.test($t) || (g[Ct] = $t), y();
}, Rt.readAsText(dt);
}
}, O = 0; O < c.length; O++)
x(c[O], O);
else {
if (s.state.draggingText && s.doc.sel.contains(u) > -1)
return s.state.draggingText(o), void setTimeout(function() {
return s.display.input.focus();
}, 20);
try {
var B = o.dataTransfer.getData("Text");
if (B) {
var $;
if (s.state.draggingText && !s.state.draggingText.copy && ($ = s.listSelections()), nl(s.doc, Qo(u, u)), $)
for (var ft = 0; ft < $.length; ++ft)
ds(s.doc, "", $[ft].anchor, $[ft].head, "drag");
s.replaceSelection(B, "around", "paste"), s.display.input.focus();
}
} catch {
}
}
}
}
function bu(o, s) {
if (z && (!o.state.draggingText || +/* @__PURE__ */ new Date() - yu < 100))
Ne(s);
else if (!yt(o, s) && !A(o.display, s) && (s.dataTransfer.setData("Text", o.getSelection()), s.dataTransfer.effectAllowed = "copyMove", s.dataTransfer.setDragImage && !it)) {
var u = gt("img", null, null, "position: fixed; left: 0; top: 0;");
u.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==", ot && (u.width = u.height = 1, o.display.wrapper.appendChild(u), u._top = u.offsetTop), s.dataTransfer.setDragImage(u, 0, 0), ot && u.parentNode.removeChild(u);
}
}
function Wp(o, s) {
var u = wi(o, s);
if (u) {
var c = document.createDocumentFragment();
Ks(o, u, c), o.display.dragCursor || (o.display.dragCursor = gt("div", null, "CodeMirror-cursors CodeMirror-dragcursors"), o.display.lineSpace.insertBefore(o.display.dragCursor, o.display.cursorDiv)), rt(o.display.dragCursor, c);
}
}
function wu(o) {
o.display.dragCursor && (o.display.lineSpace.removeChild(o.display.dragCursor), o.display.dragCursor = null);
}
function oc(o) {
if (document.getElementsByClassName) {
for (var s = document.getElementsByClassName("CodeMirror"), u = [], c = 0; c < s.length; c++) {
var p = s[c].CodeMirror;
p && u.push(p);
}
u.length && u[0].operation(function() {
for (var g = 0; g < u.length; g++)
o(u[g]);
});
}
}
var _u = !1;
function Sn() {
_u || (xu(), _u = !0);
}
function xu() {
var o;
Kt(window, "resize", function() {
o == null && (o = setTimeout(function() {
o = null, oc(ic);
}, 100));
}), Kt(window, "blur", function() {
return oc(xi);
});
}
function ic(o) {
var s = o.display;
s.cachedCharWidth = s.cachedTextHeight = s.cachedPaddingH = null, s.scrollbarsClipped = !1, o.setSize();
}
for (var to = { 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" }, ji = 0; ji < 10; ji++)
to[ji + 48] = to[ji + 96] = String(ji);
for (var il = 65; il <= 90; il++)
to[il] = String.fromCharCode(il);
for (var vs = 1; vs <= 12; vs++)
to[vs + 111] = to[vs + 63235] = "F" + vs;
var uo = {};
function Cu(o) {
var s, u, c, p, g = o.split(/-(?!$)/);
o = g[g.length - 1];
for (var m = 0; m < g.length - 1; m++) {
var y = g[m];
if (/^(cmd|meta|m)$/i.test(y))
p = !0;
else if (/^a(lt)?$/i.test(y))
s = !0;
else if (/^(c|ctrl|control)$/i.test(y))
u = !0;
else {
if (!/^s(hift)?$/i.test(y))
throw new Error("Unrecognized modifier name: " + y);
c = !0;
}
}
return s && (o = "Alt-" + o), u && (o = "Ctrl-" + o), p && (o = "Cmd-" + o), c && (o = "Shift-" + o), o;
}
function sl(o) {
var s = {};
for (var u in o)
if (o.hasOwnProperty(u)) {
var c = o[u];
if (/^(name|fallthrough|(de|at)tach)$/.test(u))
continue;
if (c == "...") {
delete o[u];
continue;
}
for (var p = Ae(u.split(" "), Cu), g = 0; g < p.length; g++) {
var m = void 0, y = void 0;
g == p.length - 1 ? (y = p.join(" "), m = c) : (y = p.slice(0, g + 1).join(" "), m = "...");
var x = s[y];
if (x) {
if (x != m)
throw new Error("Inconsistent bindings for " + y);
} else
s[y] = m;
}
delete o[u];
}
for (var O in s)
o[O] = s[O];
return o;
}
function Mi(o, s, u, c) {
var p = (s = No(s)).call ? s.call(o, c) : s[o];
if (p === !1)
return "nothing";
if (p === "...")
return "multi";
if (p != null && u(p))
return "handled";
if (s.fallthrough) {
if (Object.prototype.toString.call(s.fallthrough) != "[object Array]")
return Mi(o, s.fallthrough, u, c);
for (var g = 0; g < s.fallthrough.length; g++) {
var m = Mi(o, s.fallthrough[g], u, c);
if (m)
return m;
}
}
}
function sc(o) {
var s = typeof o == "string" ? o : to[o.keyCode];
return s == "Ctrl" || s == "Alt" || s == "Shift" || s == "Mod";
}
function Su(o, s, u) {
var c = o;
return s.altKey && c != "Alt" && (o = "Alt-" + o), (Q ? s.metaKey : s.ctrlKey) && c != "Ctrl" && (o = "Ctrl-" + o), (Q ? s.ctrlKey : s.metaKey) && c != "Mod" && (o = "Cmd-" + o), !u && s.shiftKey && c != "Shift" && (o = "Shift-" + o), o;
}
function Ou(o, s) {
if (ot && o.keyCode == 34 && o.char)
return !1;
var u = to[o.keyCode];
return u != null && !o.altGraphKey && (o.keyCode == 3 && o.code && (u = o.code), Su(u, o, s));
}
function No(o) {
return typeof o == "string" ? uo[o] : o;
}
function ni(o, s) {
for (var u = o.doc.sel.ranges, c = [], p = 0; p < u.length; p++) {
for (var g = s(u[p]); c.length && T(g.from, Zt(c).to) <= 0; ) {
var m = c.pop();
if (T(m.from, g.from) < 0) {
g.from = m.from;
break;
}
}
c.push(g);
}
fr(o, function() {
for (var y = c.length - 1; y >= 0; y--)
ds(o.doc, "", c[y].from, c[y].to, "+delete");
ss(o);
});
}
function fa(o, s, u) {
var c = ht(o.text, s + u, u);
return c < 0 || c > o.text.length ? null : c;
}
function al(o, s, u) {
var c = fa(o, s.ch, u);
return c == null ? null : new Bt(s.line, c, u < 0 ? "after" : "before");
}
function ll(o, s, u, c, p) {
if (o) {
s.doc.direction == "rtl" && (p = -p);
var g = ze(u, s.doc.direction);
if (g) {
var m, y = p < 0 ? Zt(g) : g[0], x = p < 0 == (y.level == 1) ? "after" : "before";
if (y.level > 0 || s.doc.direction == "rtl") {
var O = Eo(s, u);
m = p < 0 ? u.text.length - 1 : 0;
var B = Hr(s, O, m).top;
m = kt(function($) {
return Hr(s, O, $).top == B;
}, p < 0 == (y.level == 1) ? y.from : y.to - 1, m), x == "before" && (m = fa(u, m, 1));
} else
m = p < 0 ? y.to : y.from;
return new Bt(c, m, x);
}
}
return new Bt(c, p < 0 ? u.text.length : 0, p < 0 ? "before" : "after");
}
function Tu(o, s, u, c) {
var p = ze(s, o.doc.direction);
if (!p)
return al(s, u, c);
u.ch >= s.text.length ? (u.ch = s.text.length, u.sticky = "before") : u.ch <= 0 && (u.ch = 0, u.sticky = "after");
var g = ke(p, u.ch, u.sticky), m = p[g];
if (o.doc.direction == "ltr" && m.level % 2 == 0 && (c > 0 ? m.to > u.ch : m.from < u.ch))
return al(s, u, c);
var y, x = function(re, le) {
return fa(s, re instanceof Bt ? re.ch : re, le);
}, O = function(re) {
return o.options.lineWrapping ? (y = y || Eo(o, s), Bc(o, s, y, re)) : { begin: 0, end: s.text.length };
}, B = O(u.sticky == "before" ? x(u, -1) : u.ch);
if (o.doc.direction == "rtl" || m.level == 1) {
var $ = m.level == 1 == c < 0, ft = x(u, $ ? 1 : -1);
if (ft != null && ($ ? ft <= m.to && ft <= B.end : ft >= m.from && ft >= B.begin)) {
var dt = $ ? "before" : "after";
return new Bt(u.line, ft, dt);
}
}
var Ct = function(re, le, Jt) {
for (var ye = function(an, gr) {
return gr ? new Bt(u.line, x(an, 1), "before") : new Bt(u.line, an, "after");
}; re >= 0 && re < p.length; re += le) {
var me = p[re], Ce = le > 0 == (me.level != 1), sn = Ce ? Jt.begin : x(Jt.end, -1);
if (me.from <= sn && sn < me.to || (sn = Ce ? me.from : x(me.to, -1), Jt.begin <= sn && sn < Jt.end))
return ye(sn, Ce);
}
}, Rt = Ct(g + c, c, B);
if (Rt)
return Rt;
var $t = c > 0 ? B.end : x(B.begin, -1);
return $t == null || c > 0 && $t == s.text.length || !(Rt = Ct(c > 0 ? 0 : p.length - 1, c, O($t))) ? null : Rt;
}
uo.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" }, uo.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" }, uo.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" }, uo.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"] }, uo.default = bt ? uo.macDefault : uo.pcDefault;
var ms = { selectAll: uu, singleSelection: function(o) {
return o.setSelection(o.getCursor("anchor"), o.getCursor("head"), ce);
}, killLine: function(o) {
return ni(o, function(s) {
if (s.empty()) {
var u = ve(o.doc, s.head.line).text.length;
return s.head.ch == u && s.head.line < o.lastLine() ? { from: s.head, to: Bt(s.head.line + 1, 0) } : { from: s.head, to: Bt(s.head.line, u) };
}
return { from: s.from(), to: s.to() };
});
}, deleteLine: function(o) {
return ni(o, function(s) {
return { from: Bt(s.from().line, 0), to: oe(o.doc, Bt(s.to().line + 1, 0)) };
});
}, delLineLeft: function(o) {
return ni(o, function(s) {
return { from: Bt(s.from().line, 0), to: s.from() };
});
}, delWrappedLineLeft: function(o) {
return ni(o, function(s) {
var u = o.charCoords(s.head, "div").top + 5;
return { from: o.coordsChar({ left: 0, top: u }, "div"), to: s.from() };
});
}, delWrappedLineRight: function(o) {
return ni(o, function(s) {
var u = o.charCoords(s.head, "div").top + 5, c = o.coordsChar({ left: o.display.lineDiv.offsetWidth + 100, top: u }, "div");
return { from: s.from(), to: c };
});
}, undo: function(o) {
return o.undo();
}, redo: function(o) {
return o.redo();
}, undoSelection: function(o) {
return o.undoSelection();
}, redoSelection: function(o) {
return o.redoSelection();
}, goDocStart: function(o) {
return o.extendSelection(Bt(o.firstLine(), 0));
}, goDocEnd: function(o) {
return o.extendSelection(Bt(o.lastLine()));
}, goLineStart: function(o) {
return o.extendSelectionsBy(function(s) {
return da(o, s.head.line);
}, { origin: "+move", bias: 1 });
}, goLineStartSmart: function(o) {
return o.extendSelectionsBy(function(s) {
return Pu(o, s.head);
}, { origin: "+move", bias: 1 });
}, goLineEnd: function(o) {
return o.extendSelectionsBy(function(s) {
return ku(o, s.head.line);
}, { origin: "+move", bias: -1 });
}, goLineRight: function(o) {
return o.extendSelectionsBy(function(s) {
var u = o.cursorCoords(s.head, "div").top + 5;
return o.coordsChar({ left: o.display.lineDiv.offsetWidth + 100, top: u }, "div");
}, Xt);
}, goLineLeft: function(o) {
return o.extendSelectionsBy(function(s) {
var u = o.cursorCoords(s.head, "div").top + 5;
return o.coordsChar({ left: 0, top: u }, "div");
}, Xt);
}, goLineLeftSmart: function(o) {
return o.extendSelectionsBy(function(s) {
var u = o.cursorCoords(s.head, "div").top + 5, c = o.coordsChar({ left: 0, top: u }, "div");
return c.ch < o.getLine(c.line).search(/\S/) ? Pu(o, s.head) : c;
}, Xt);
}, goLineUp: function(o) {
return o.moveV(-1, "line");
}, goLineDown: function(o) {
return o.moveV(1, "line");
}, goPageUp: function(o) {
return o.moveV(-1, "page");
}, goPageDown: function(o) {
return o.moveV(1, "page");
}, goCharLeft: function(o) {
return o.moveH(-1, "char");
}, goCharRight: function(o) {
return o.moveH(1, "char");
}, goColumnLeft: function(o) {
return o.moveH(-1, "column");
}, goColumnRight: function(o) {
return o.moveH(1, "column");
}, goWordLeft: function(o) {
return o.moveH(-1, "word");
}, goGroupRight: function(o) {
return o.moveH(1, "group");
}, goGroupLeft: function(o) {
return o.moveH(-1, "group");
}, goWordRight: function(o) {
return o.moveH(1, "word");
}, delCharBefore: function(o) {
return o.deleteH(-1, "codepoint");
}, delCharAfter: function(o) {
return o.deleteH(1, "char");
}, delWordBefore: function(o) {
return o.deleteH(-1, "word");
}, delWordAfter: function(o) {
return o.deleteH(1, "word");
}, delGroupBefore: function(o) {
return o.deleteH(-1, "group");
}, delGroupAfter: function(o) {
return o.deleteH(1, "group");
}, indentAuto: function(o) {
return o.indentSelection("smart");
}, indentMore: function(o) {
return o.indentSelection("add");
}, indentLess: function(o) {
return o.indentSelection("subtract");
}, insertTab: function(o) {
return o.replaceSelection(" ");
}, insertSoftTab: function(o) {
for (var s = [], u = o.listSelections(), c = o.options.tabSize, p = 0; p < u.length; p++) {
var g = u[p].from(), m = xe(o.getLine(g.line), g.ch, c);
s.push(ae(c - m % c));
}
o.replaceSelections(s);
}, defaultTab: function(o) {
o.somethingSelected() ? o.indentSelection("add") : o.execCommand("insertTab");
}, transposeChars: function(o) {
return fr(o, function() {
for (var s = o.listSelections(), u = [], c = 0; c < s.length; c++)
if (s[c].empty()) {
var p = s[c].head, g = ve(o.doc, p.line).text;
if (g) {
if (p.ch == g.length && (p = new Bt(p.line, p.ch - 1)), p.ch > 0)
p = new Bt(p.line, p.ch + 1), o.replaceRange(g.charAt(p.ch - 1) + g.charAt(p.ch - 2), Bt(p.line, p.ch - 2), p, "+transpose");
else if (p.line > o.doc.first) {
var m = ve(o.doc, p.line - 1).text;
m && (p = new Bt(p.line, 1), o.replaceRange(g.charAt(0) + o.doc.lineSeparator() + m.charAt(m.length - 1), Bt(p.line - 1, m.length - 1), p, "+transpose"));
}
}
u.push(new tn(p, p));
}
o.setSelections(u);
});
}, newlineAndIndent: function(o) {
return fr(o, function() {
for (var s = o.listSelections(), u = s.length - 1; u >= 0; u--)
o.replaceRange(o.doc.lineSeparator(), s[u].anchor, s[u].head, "+input");
s = o.listSelections();
for (var c = 0; c < s.length; c++)
o.indentLine(s[c].from().line, null, !0);
ss(o);
});
}, openLine: function(o) {
return o.replaceSelection(`
`, "start");
}, toggleOverwrite: function(o) {
return o.toggleOverwrite();
} };
function da(o, s) {
var u = ve(o.doc, s), c = Or(u);
return c != u && (s = Ye(c)), ll(!0, o, c, s, 1);
}
function ku(o, s) {
var u = ve(o.doc, s), c = $i(u);
return c != u && (s = Ye(c)), ll(!0, o, u, s, -1);
}
function Pu(o, s) {
var u = da(o, s.line), c = ve(o.doc, u.line), p = ze(c, o.doc.direction);
if (!p || p[0].level == 0) {
var g = Math.max(u.ch, c.text.search(/\S/)), m = s.line == u.line && s.ch <= g && s.ch;
return Bt(u.line, m ? 0 : g, u.sticky);
}
return u;
}
function cl(o, s, u) {
if (typeof s == "string" && !(s = ms[s]))
return !1;
o.display.input.ensurePolled();
var c = o.display.shift, p = !1;
try {
o.isReadOnly() && (o.state.suppressEdits = !0), u && (o.display.shift = !1), p = s(o) != pe;
} finally {
o.display.shift = c, o.state.suppressEdits = !1;
}
return p;
}
function $p(o, s, u) {
for (var c = 0; c < o.state.keyMaps.length; c++) {
var p = Mi(s, o.state.keyMaps[c], u, o);
if (p)
return p;
}
return o.options.extraKeys && Mi(s, o.options.extraKeys, u, o) || Mi(s, o.options.keyMap, u, o);
}
var qp = new Te();
function ha(o, s, u, c) {
var p = o.state.keySeq;
if (p) {
if (sc(s))
return "handled";
if (/\'$/.test(s) ? o.state.keySeq = null : qp.set(50, function() {
o.state.keySeq == p && (o.state.keySeq = null, o.display.input.reset());
}), ys(o, p + " " + s, u, c))
return !0;
}
return ys(o, s, u, c);
}
function ys(o, s, u, c) {
var p = $p(o, s, c);
return p == "multi" && (o.state.keySeq = s), p == "handled" && bn(o, "keyHandled", o, s, u), p != "handled" && p != "multi" || (We(u), is(o)), !!p;
}
function ac(o, s) {
var u = Ou(s, !0);
return !!u && (s.shiftKey && !o.state.keySeq ? ha(o, "Shift-" + u, s, function(c) {
return cl(o, c, !0);
}) || ha(o, u, s, function(c) {
if (typeof c == "string" ? /^go[A-Z]/.test(c) : c.motion)
return cl(o, c);
}) : ha(o, u, s, function(c) {
return cl(o, c);
}));
}
function Io(o, s, u) {
return ha(o, "'" + u + "'", s, function(c) {
return cl(o, c, !0);
});
}
var lc = null;
function cc(o) {
var s = this;
if (!(o.target && o.target != s.display.input.getField() || (s.curOp.focus = Tt(), yt(s, o)))) {
z && k < 11 && o.keyCode == 27 && (o.returnValue = !1);
var u = o.keyCode;
s.display.shift = u == 16 || o.shiftKey;
var c = ac(s, o);
ot && (lc = c ? u : null, c || u != 88 || xo || !(bt ? o.metaKey : o.ctrlKey) || s.replaceSelection("", null, "cut")), at && !bt && !c && u == 46 && o.shiftKey && !o.ctrlKey && document.execCommand && document.execCommand("cut"), u != 18 || /\bCodeMirror-crosshair\b/.test(s.display.lineDiv.className) || Eu(s);
}
}
function Eu(o) {
var s = o.display.lineDiv;
function u(c) {
c.keyCode != 18 && c.altKey || (nt(s, "CodeMirror-crosshair"), tt(document, "keyup", u), tt(document, "mouseover", u));
}
Qt(s, "CodeMirror-crosshair"), Kt(document, "keyup", u), Kt(document, "mouseover", u);
}
function Au(o) {
o.keyCode == 16 && (this.doc.sel.shift = !1), yt(this, o);
}
function ju(o) {
var s = this;
if (!(o.target && o.target != s.display.input.getField() || A(s.display, o) || yt(s, o) || o.ctrlKey && !o.altKey || bt && o.metaKey)) {
var u = o.keyCode, c = o.charCode;
if (ot && u == lc)
return lc = null, void We(o);
if (!ot || o.which && !(o.which < 10) || !ac(s, o)) {
var p = String.fromCharCode(c ?? u);
p != "\b" && (Io(s, o, p) || s.display.input.onKeyPress(o));
}
}
}
var ga, va, Gp = 400, ul = function(o, s, u) {
this.time = o, this.pos = s, this.button = u;
};
function pl(o, s) {
var u = +/* @__PURE__ */ new Date();
return va && va.compare(u, o, s) ? (ga = va = null, "triple") : ga && ga.compare(u, o, s) ? (va = new ul(u, o, s), ga = null, "double") : (ga = new ul(u, o, s), va = null, "single");
}
function Mu(o) {
var s = this, u = s.display;
if (!(yt(s, o) || u.activeTouch && u.input.supportsTouch())) {
if (u.input.ensurePolled(), u.shift = o.shiftKey, A(u, o))
P || (u.scroller.draggable = !1, setTimeout(function() {
return u.scroller.draggable = !0;
}, 100));
else if (!pc(s, o)) {
var c = wi(s, o), p = Yn(o), g = c ? pl(c, p) : "single";
window.focus(), p == 1 && s.state.selectingText && s.state.selectingText(o), c && Lu(s, p, c, g, o) || (p == 1 ? c ? Kp(s, c, g, o) : Ar(o) == u.scroller && We(o) : p == 2 ? (c && tl(s.doc, c), setTimeout(function() {
return u.input.focus();
}, 20)) : p == 3 && (j ? s.display.input.onContextMenu(o) : Vl(s)));
}
}
}
function Lu(o, s, u, c, p) {
var g = "Click";
return c == "double" ? g = "Double" + g : c == "triple" && (g = "Triple" + g), ha(o, Su(g = (s == 1 ? "Left" : s == 2 ? "Middle" : "Right") + g, p), p, function(m) {
if (typeof m == "string" && (m = ms[m]), !m)
return !1;
var y = !1;
try {
o.isReadOnly() && (o.state.suppressEdits = !0), y = m(o, u) != pe;
} finally {
o.state.suppressEdits = !1;
}
return y;
});
}
function Du(o, s, u) {
var c = o.getOption("configureMouse"), p = c ? c(o, s, u) : {};
if (p.unit == null) {
var g = Wt ? u.shiftKey && u.metaKey : u.altKey;
p.unit = g ? "rectangle" : s == "single" ? "char" : s == "double" ? "word" : "line";
}
return (p.extend == null || o.doc.extend) && (p.extend = o.doc.extend || u.shiftKey), p.addNew == null && (p.addNew = bt ? u.metaKey : u.ctrlKey), p.moveOnDrag == null && (p.moveOnDrag = !(bt ? u.altKey : u.ctrlKey)), p;
}
function Kp(o, s, u, c) {
z ? setTimeout(_e(qc, o), 0) : o.curOp.focus = Tt();
var p, g = Du(o, u, c), m = o.doc.sel;
o.options.dragDrop && _n && !o.isReadOnly() && u == "single" && (p = m.contains(s)) > -1 && (T((p = m.ranges[p]).from(), s) < 0 || s.xRel > 0) && (T(p.to(), s) > 0 || s.xRel < 0) ? Yp(o, c, s, g) : ma(o, c, s, g);
}
function Yp(o, s, u, c) {
var p = o.display, g = !1, m = Gn(o, function(O) {
P && (p.scroller.draggable = !1), o.state.draggingText = !1, o.state.delayingBlurEvent && (o.hasFocus() ? o.state.delayingBlurEvent = !1 : Vl(o)), tt(p.wrapper.ownerDocument, "mouseup", m), tt(p.wrapper.ownerDocument, "mousemove", y), tt(p.scroller, "dragstart", x), tt(p.scroller, "drop", m), g || (We(O), c.addNew || tl(o.doc, u, null, null, c.extend), P && !it || z && k == 9 ? setTimeout(function() {
p.wrapper.ownerDocument.body.focus({ preventScroll: !0 }), p.input.focus();
}, 20) : p.input.focus());
}), y = function(O) {
g = g || Math.abs(s.clientX - O.clientX) + Math.abs(s.clientY - O.clientY) >= 10;
}, x = function() {
return g = !0;
};
P && (p.scroller.draggable = !0), o.state.draggingText = m, m.copy = !c.moveOnDrag, Kt(p.wrapper.ownerDocument, "mouseup", m), Kt(p.wrapper.ownerDocument, "mousemove", y), Kt(p.scroller, "dragstart", x), Kt(p.scroller, "drop", m), o.state.delayingBlurEvent = !0, setTimeout(function() {
return p.input.focus();
}, 20), p.scroller.dragDrop && p.scroller.dragDrop();
}
function Nu(o, s, u) {
if (u == "char")
return new tn(s, s);
if (u == "word")
return o.findWordAt(s);
if (u == "line")
return new tn(Bt(s.line, 0), oe(o.doc, Bt(s.line + 1, 0)));
var c = u(o, s);
return new tn(c.from, c.to);
}
function ma(o, s, u, c) {
z && Vl(o);
var p = o.display, g = o.doc;
We(s);
var m, y, x = g.sel, O = x.ranges;
if (c.addNew && !c.extend ? (y = g.sel.contains(u), m = y > -1 ? O[y] : new tn(u, u)) : (m = g.sel.primary(), y = g.sel.primIndex), c.unit == "rectangle")
c.addNew || (m = new tn(u, u)), u = wi(o, s, !0, !0), y = -1;
else {
var B = Nu(o, u, c.unit);
m = c.extend ? Pi(m, B.anchor, B.head, c.extend) : B;
}
c.addNew ? y == -1 ? (y = O.length, tr(g, Qr(o, O.concat([m]), y), { scroll: !1, origin: "*mouse" })) : O.length > 1 && O[y].empty() && c.unit == "char" && !c.extend ? (tr(g, Qr(o, O.slice(0, y).concat(O.slice(y + 1)), 0), { scroll: !1, origin: "*mouse" }), x = g.sel) : el(g, y, m, st) : (y = 0, tr(g, new Ur([m], 0), st), x = g.sel);
var $ = u;
function ft(Jt) {
if (T($, Jt) != 0)
if ($ = Jt, c.unit == "rectangle") {
for (var ye = [], me = o.options.tabSize, Ce = xe(ve(g, u.line).text, u.ch, me), sn = xe(ve(g, Jt.line).text, Jt.ch, me), an = Math.min(Ce, sn), gr = Math.max(Ce, sn), hn = Math.min(u.line, Jt.line), sr = Math.min(o.lastLine(), Math.max(u.line, Jt.line)); hn <= sr; hn++) {
var vr = ve(g, hn).text, xn = qt(vr, an, me);
an == gr ? ye.push(new tn(Bt(hn, xn), Bt(hn, xn))) : vr.length > xn && ye.push(new tn(Bt(hn, xn), Bt(hn, qt(vr, gr, me))));
}
ye.length || ye.push(new tn(u, u)), tr(g, Qr(o, x.ranges.slice(0, y).concat(ye), y), { origin: "*mouse", scroll: !1 }), o.scrollIntoView(Jt);
} else {
var En, dr = m, Vn = Nu(o, Jt, c.unit), An = dr.anchor;
T(Vn.anchor, An) > 0 ? (En = Vn.head, An = de(dr.from(), Vn.anchor)) : (En = Vn.anchor, An = te(dr.to(), Vn.head));
var jn = x.ranges.slice(0);
jn[y] = fl(o, new tn(oe(g, An), En)), tr(g, Qr(o, jn, y), st);
}
}
var dt = p.wrapper.getBoundingClientRect(), Ct = 0;
function Rt(Jt) {
var ye = ++Ct, me = wi(o, Jt, !0, c.unit == "rectangle");
if (me)
if (T(me, $) != 0) {
o.curOp.focus = Tt(), ft(me);
var Ce = Js(p, g);
(me.line >= Ce.to || me.line < Ce.from) && setTimeout(Gn(o, function() {
Ct == ye && Rt(Jt);
}), 150);
} else {
var sn = Jt.clientY < dt.top ? -20 : Jt.clientY > dt.bottom ? 20 : 0;
sn && setTimeout(Gn(o, function() {
Ct == ye && (p.scroller.scrollTop += sn, Rt(Jt));
}), 50);
}
}
function $t(Jt) {
o.state.selectingText = !1, Ct = 1 / 0, Jt && (We(Jt), p.input.focus()), tt(p.wrapper.ownerDocument, "mousemove", re), tt(p.wrapper.ownerDocument, "mouseup", le), g.history.lastSelOrigin = null;
}
var re = Gn(o, function(Jt) {
Jt.buttons !== 0 && Yn(Jt) ? Rt(Jt) : $t(Jt);
}), le = Gn(o, $t);
o.state.selectingText = le, Kt(p.wrapper.ownerDocument, "mousemove", re), Kt(p.wrapper.ownerDocument, "mouseup", le);
}
function fl(o, s) {
var u = s.anchor, c = s.head, p = ve(o.doc, u.line);
if (T(u, c) == 0 && u.sticky == c.sticky)
return s;
var g = ze(p);
if (!g)
return s;
var m = ke(g, u.ch, u.sticky), y = g[m];
if (y.from != u.ch && y.to != u.ch)
return s;
var x, O = m + (y.from == u.ch == (y.level != 1) ? 0 : 1);
if (O == 0 || O == g.length)
return s;
if (c.line != u.line)
x = (c.line - u.line) * (o.doc.direction == "ltr" ? 1 : -1) > 0;
else {
var B = ke(g, c.ch, c.sticky), $ = B - m || (c.ch - u.ch) * (y.level == 1 ? -1 : 1);
x = B == O - 1 || B == O ? $ < 0 : $ > 0;
}
var ft = g[O + (x ? -1 : 0)], dt = x == (ft.level == 1), Ct = dt ? ft.from : ft.to, Rt = dt ? "after" : "before";
return u.ch == Ct && u.sticky == Rt ? s : new tn(new Bt(u.line, Ct, Rt), c);
}
function uc(o, s, u, c) {
var p, g;
if (s.touches)
p = s.touches[0].clientX, g = s.touches[0].clientY;
else
try {
p = s.clientX, g = s.clientY;
} catch {
return !1;
}
if (p >= Math.floor(o.display.gutters.getBoundingClientRect().right))
return !1;
c && We(s);
var m = o.display, y = m.lineDiv.getBoundingClientRect();
if (g > y.bottom || !he(o, u))
return pn(s);
g -= y.top - m.viewOffset;
for (var x = 0; x < o.display.gutterSpecs.length; ++x) {
var O = m.gutters.childNodes[x];
if (O && O.getBoundingClientRect().right >= p)
return ut(o, u, o, In(o.doc, g), o.display.gutterSpecs[x].className, s), pn(s);
}
}
function pc(o, s) {
return uc(o, s, "gutterClick", !0);
}
function Iu(o, s) {
A(o.display, s) || Xp(o, s) || yt(o, s, "contextmenu") || j || o.display.input.onContextMenu(s);
}
function Xp(o, s) {
return !!he(o, "gutterContextMenu") && uc(o, s, "gutterContextMenu", !1);
}
function fc(o) {
o.display.wrapper.className = o.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + o.options.theme.replace(/(^|\s)\s*/g, " cm-s-"), Xo(o);
}
ul.prototype.compare = function(o, s, u) {
return this.time + Gp > o && T(s, this.pos) == 0 && u == this.button;
};
var bs = { toString: function() {
return "CodeMirror.Init";
} }, Fu = {}, ws = {};
function Vu(o) {
var s = o.optionHandlers;
function u(c, p, g, m) {
o.defaults[c] = p, g && (s[c] = m ? function(y, x, O) {
O != bs && g(y, x, O);
} : g);
}
o.defineOption = u, o.Init = bs, u("value", "", function(c, p) {
return c.setValue(p);
}, !0), u("mode", null, function(c, p) {
c.doc.modeOption = p, Xa(c);
}, !0), u("indentUnit", 2, Xa, !0), u("indentWithTabs", !1), u("smartIndent", !0), u("tabSize", 4, function(c) {
Lo(c), Xo(c), Qn(c);
}, !0), u("lineSeparator", null, function(c, p) {
if (c.doc.lineSep = p, p) {
var g = [], m = c.doc.first;
c.doc.iter(function(x) {
for (var O = 0; ; ) {
var B = x.text.indexOf(p, O);
if (B == -1)
break;
O = B + p.length, g.push(Bt(m, B));
}
m++;
});
for (var y = g.length - 1; y >= 0; y--)
ds(c.doc, p, g[y], Bt(g[y].line, g[y].ch + p.length));
}
}), u("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function(c, p, g) {
c.state.specialChars = new RegExp(p.source + (p.test(" ") ? "" : "| "), "g"), g != bs && c.refresh();
}), u("specialCharPlaceholder", La, function(c) {
return c.refresh();
}, !0), u("electricChars", !0), u("inputStyle", xt ? "contenteditable" : "textarea", function() {
throw new Error("inputStyle can not (yet) be changed in a running editor");
}, !0), u("spellcheck", !1, function(c, p) {
return c.getInputField().spellcheck = p;
}, !0), u("autocorrect", !1, function(c, p) {
return c.getInputField().autocorrect = p;
}, !0), u("autocapitalize", !1, function(c, p) {
return c.getInputField().autocapitalize = p;
}, !0), u("rtlMoveVisually", !Ft), u("wholeLineUpdateBefore", !0), u("theme", "default", function(c) {
fc(c), cs(c);
}, !0), u("keyMap", "default", function(c, p, g) {
var m = No(p), y = g != bs && No(g);
y && y.detach && y.detach(c, m), m.attach && m.attach(c, y || null);
}), u("extraKeys", null), u("configureMouse", null), u("lineWrapping", !1, Zp, !0), u("gutters", [], function(c, p) {
c.display.gutterSpecs = Ga(p, c.options.lineNumbers), cs(c);
}, !0), u("fixedGutter", !0, function(c, p) {
c.display.gutters.style.left = p ? Il(c.display) + "px" : "0", c.refresh();
}, !0), u("coverGutterNextToScrollbar", !1, function(c) {
return as(c);
}, !0), u("scrollbarStyle", "native", function(c) {
Yc(c), as(c), c.display.scrollbars.setScrollTop(c.doc.scrollTop), c.display.scrollbars.setScrollLeft(c.doc.scrollLeft);
}, !0), u("lineNumbers", !1, function(c, p) {
c.display.gutterSpecs = Ga(c.options.gutters, p), cs(c);
}, !0), u("firstLineNumber", 1, cs, !0), u("lineNumberFormatter", function(c) {
return c;
}, cs, !0), u("showCursorWhenSelecting", !1, qs, !0), u("resetSelectionOnContextMenu", !0), u("lineWiseCopyCut", !0), u("pasteLinesPerSelection", !0), u("selectionsMayTouch", !1), u("readOnly", !1, function(c, p) {
p == "nocursor" && (xi(c), c.display.input.blur()), c.display.input.readOnlyChanged(p);
}), u("screenReaderLabel", null, function(c, p) {
p = p === "" ? null : p, c.display.input.screenReaderLabelChanged(p);
}), u("disableInput", !1, function(c, p) {
p || c.display.input.reset();
}, !0), u("dragDrop", !0, Jp), u("allowDropFileTypes", null), u("cursorBlinkRate", 530), u("cursorScrollMargin", 0), u("cursorHeight", 1, qs, !0), u("singleCursorHeightPerLine", !0, qs, !0), u("workTime", 100), u("workDelay", 100), u("flattenSpans", !0, Lo, !0), u("addModeClass", !1, Lo, !0), u("pollInterval", 100), u("undoDepth", 200, function(c, p) {
return c.doc.history.undoDepth = p;
}), u("historyEventDelay", 1250), u("viewportMargin", 10, function(c) {
return c.refresh();
}, !0), u("maxHighlightLength", 1e4, Lo, !0), u("moveInputWithCursor", !0, function(c, p) {
p || c.display.input.resetPosition();
}), u("tabindex", null, function(c, p) {
return c.display.input.getField().tabIndex = p || "";
}), u("autofocus", null), u("direction", "ltr", function(c, p) {
return c.doc.setDirection(p);
}, !0), u("phrases", null);
}
function Jp(o, s, u) {
if (!s != !(u && u != bs)) {
var c = o.display.dragFunctions, p = s ? Kt : tt;
p(o.display.scroller, "dragstart", c.start), p(o.display.scroller, "dragenter", c.enter), p(o.display.scroller, "dragover", c.over), p(o.display.scroller, "dragleave", c.leave), p(o.display.scroller, "drop", c.drop);
}
}
function Zp(o) {
o.options.lineWrapping ? (Qt(o.display.wrapper, "CodeMirror-wrap"), o.display.sizer.style.minWidth = "", o.display.sizerWidth = null) : (nt(o.display.wrapper, "CodeMirror-wrap"), Rs(o)), Fl(o), Qn(o), Xo(o), setTimeout(function() {
return as(o);
}, 100);
}
function wn(o, s) {
var u = this;
if (!(this instanceof wn))
return new wn(o, s);
this.options = s = s ? De(s) : {}, De(Fu, s, !1);
var c = s.value;
typeof c == "string" ? c = new Fn(c, s.mode, null, s.lineSeparator, s.direction) : s.mode && (c.modeOption = s.mode), this.doc = c;
var p = new wn.inputStyles[s.inputStyle](this), g = this.display = new tu(o, c, p, s);
for (var m in g.wrapper.CodeMirror = this, fc(this), s.lineWrapping && (this.display.wrapper.className += " CodeMirror-wrap"), Yc(this), this.state = { keyMaps: [], overlays: [], modeGen: 0, overwrite: !1, delayingBlurEvent: !1, focused: !1, suppressEdits: !1, pasteIncoming: -1, cutIncoming: -1, selectingText: !1, draggingText: !1, highlight: new Te(), keySeq: null, specialChars: null }, s.autofocus && !xt && g.input.focus(), z && k < 11 && setTimeout(function() {
return u.display.input.reset(!0);
}, 20), Qp(this), Sn(), Oi(this), this.curOp.forceUpdate = !0, su(this, c), s.autofocus && !xt || this.hasFocus() ? setTimeout(function() {
u.hasFocus() && !u.state.focused && Rl(u);
}, 20) : xi(this), ws)
ws.hasOwnProperty(m) && ws[m](this, s[m], bs);
Zc(this), s.finishInit && s.finishInit(this);
for (var y = 0; y < dc.length; ++y)
dc[y](this);
Ti(this), P && s.lineWrapping && getComputedStyle(g.lineDiv).textRendering == "optimizelegibility" && (g.lineDiv.style.textRendering = "auto");
}
function Qp(o) {
var s = o.display;
Kt(s.scroller, "mousedown", Gn(o, Mu)), Kt(s.scroller, "dblclick", z && k < 11 ? Gn(o, function(x) {
if (!yt(o, x)) {
var O = wi(o, x);
if (O && !pc(o, x) && !A(o.display, x)) {
We(x);
var B = o.findWordAt(O);
tl(o.doc, B.anchor, B.head);
}
}
}) : function(x) {
return yt(o, x) || We(x);
}), Kt(s.scroller, "contextmenu", function(x) {
return Iu(o, x);
}), Kt(s.input.getField(), "contextmenu", function(x) {
s.scroller.contains(x.target) || Iu(o, x);
});
var u, c = { end: 0 };
function p() {
s.activeTouch && (u = setTimeout(function() {
return s.activeTouch = null;
}, 1e3), (c = s.activeTouch).end = +/* @__PURE__ */ new Date());
}
function g(x) {
if (x.touches.length != 1)
return !1;
var O = x.touches[0];
return O.radiusX <= 1 && O.radiusY <= 1;
}
function m(x, O) {
if (O.left == null)
return !0;
var B = O.left - x.left, $ = O.top - x.top;
return B * B + $ * $ > 400;
}
Kt(s.scroller, "touchstart", function(x) {
if (!yt(o, x) && !g(x) && !pc(o, x)) {
s.input.ensurePolled(), clearTimeout(u);
var O = +/* @__PURE__ */ new Date();
s.activeTouch = { start: O, moved: !1, prev: O - c.end <= 300 ? c : null }, x.touches.length == 1 && (s.activeTouch.left = x.touches[0].pageX, s.activeTouch.top = x.touches[0].pageY);
}
}), Kt(s.scroller, "touchmove", function() {
s.activeTouch && (s.activeTouch.moved = !0);
}), Kt(s.scroller, "touchend", function(x) {
var O = s.activeTouch;
if (O && !A(s, x) && O.left != null && !O.moved && /* @__PURE__ */ new Date() - O.start < 300) {
var B, $ = o.coordsChar(s.activeTouch, "page");
B = !O.prev || m(O, O.prev) ? new tn($, $) : !O.prev.prev || m(O, O.prev.prev) ? o.findWordAt($) : new tn(Bt($.line, 0), oe(o.doc, Bt($.line + 1, 0))), o.setSelection(B.anchor, B.head), o.focus(), We(x);
}
p();
}), Kt(s.scroller, "touchcancel", p), Kt(s.scroller, "scroll", function() {
s.scroller.clientHeight && (Qs(o, s.scroller.scrollTop), jo(o, s.scroller.scrollLeft, !0), ut(o, "scroll", o));
}), Kt(s.scroller, "mousewheel", function(x) {
return nu(o, x);
}), Kt(s.scroller, "DOMMouseScroll", function(x) {
return nu(o, x);
}), Kt(s.wrapper, "scroll", function() {
return s.wrapper.scrollTop = s.wrapper.scrollLeft = 0;
}), s.dragFunctions = { enter: function(x) {
yt(o, x) || Ne(x);
}, over: function(x) {
yt(o, x) || (Wp(o, x), Ne(x));
}, start: function(x) {
return bu(o, x);
}, drop: Gn(o, Bp), leave: function(x) {
yt(o, x) || wu(o);
} };
var y = s.input.getField();
Kt(y, "keyup", function(x) {
return Au.call(o, x);
}), Kt(y, "keydown", Gn(o, cc)), Kt(y, "keypress", Gn(o, ju)), Kt(y, "focus", function(x) {
return Rl(o, x);
}), Kt(y, "blur", function(x) {
return xi(o, x);
});
}
wn.defaults = Fu, wn.optionHandlers = ws;
var dc = [];
function ya(o, s, u, c) {
var p, g = o.doc;
u == null && (u = "add"), u == "smart" && (g.mode.indent ? p = bo(o, s).state : u = "prev");
var m = o.options.tabSize, y = ve(g, s), x = xe(y.text, null, m);
y.stateAfter && (y.stateAfter = null);
var O, B = y.text.match(/^\s*/)[0];
if (c || /\S/.test(y.text)) {
if (u == "smart" && ((O = g.mode.indent(p, y.text.slice(B.length), y.text)) == pe || O > 150)) {
if (!c)
return;
u = "prev";
}
} else
O = 0, u = "not";
u == "prev" ? O = s > g.first ? xe(ve(g, s - 1).text, null, m) : 0 : u == "add" ? O = x + o.options.indentUnit : u == "subtract" ? O = x - o.options.indentUnit : typeof u == "number" && (O = x + u), O = Math.max(0, O);
var $ = "", ft = 0;
if (o.options.indentWithTabs)
for (var dt = Math.floor(O / m); dt; --dt)
ft += m, $ += " ";
if (ft < O && ($ += ae(O - ft)), $ != B)
return ds(g, $, Bt(s, 0), Bt(s, B.length), "+input"), y.stateAfter = null, !0;
for (var Ct = 0; Ct < g.sel.ranges.length; Ct++) {
var Rt = g.sel.ranges[Ct];
if (Rt.head.line == s && Rt.head.ch < B.length) {
var $t = Bt(s, B.length);
el(g, Ct, new tn($t, $t));
break;
}
}
}
wn.defineInitHook = function(o) {
return dc.push(o);
};
var po = null;
function dl(o) {
po = o;
}
function hc(o, s, u, c, p) {
var g = o.doc;
o.display.shift = !1, c || (c = g.sel);
var m = +/* @__PURE__ */ new Date() - 200, y = p == "paste" || o.state.pasteIncoming > m, x = _o(s), O = null;
if (y && c.ranges.length > 1)
if (po && po.text.join(`
`) == s) {
if (c.ranges.length % po.text.length == 0) {
O = [];
for (var B = 0; B < po.text.length; B++)
O.push(g.splitLines(po.text[B]));
}
} else
x.length == c.ranges.length && o.options.pasteLinesPerSelection && (O = Ae(x, function(re) {
return [re];
}));
for (var $ = o.curOp.updateInput, ft = c.ranges.length - 1; ft >= 0; ft--) {
var dt = c.ranges[ft], Ct = dt.from(), Rt = dt.to();
dt.empty() && (u && u > 0 ? Ct = Bt(Ct.line, Ct.ch - u) : o.state.overwrite && !y ? Rt = Bt(Rt.line, Math.min(ve(g, Rt.line).text.length, Rt.ch + Zt(x).length)) : y && po && po.lineWise && po.text.join(`
`) == x.join(`
`) && (Ct = Rt = Bt(Ct.line, 0)));
var $t = { from: Ct, to: Rt, text: O ? O[ft % O.length] : x, origin: p || (y ? "paste" : o.state.cutIncoming > m ? "cut" : "+input") };
Ai(o.doc, $t), bn(o, "inputRead", o, $t);
}
s && !y && gc(o, s), ss(o), o.curOp.updateInput < 2 && (o.curOp.updateInput = $), o.curOp.typing = !0, o.state.pasteIncoming = o.state.cutIncoming = -1;
}
function Ru(o, s) {
var u = o.clipboardData && o.clipboardData.getData("Text");
if (u)
return o.preventDefault(), s.isReadOnly() || s.options.disableInput || !s.hasFocus() || fr(s, function() {
return hc(s, u, 0, null, "paste");
}), !0;
}
function gc(o, s) {
if (o.options.electricChars && o.options.smartIndent)
for (var u = o.doc.sel, c = u.ranges.length - 1; c >= 0; c--) {
var p = u.ranges[c];
if (!(p.head.ch > 100 || c && u.ranges[c - 1].head.line == p.head.line)) {
var g = o.getModeAt(p.head), m = !1;
if (g.electricChars) {
for (var y = 0; y < g.electricChars.length; y++)
if (s.indexOf(g.electricChars.charAt(y)) > -1) {
m = ya(o, p.head.line, "smart");
break;
}
} else
g.electricInput && g.electricInput.test(ve(o.doc, p.head.line).text.slice(0, p.head.ch)) && (m = ya(o, p.head.line, "smart"));
m && bn(o, "electricInput", o, p.head.line);
}
}
}
function Hu(o) {
for (var s = [], u = [], c = 0; c < o.doc.sel.ranges.length; c++) {
var p = o.doc.sel.ranges[c].head.line, g = { anchor: Bt(p, 0), head: Bt(p + 1, 0) };
u.push(g), s.push(o.getRange(g.anchor, g.head));
}
return { text: s, ranges: u };
}
function zu(o, s, u, c) {
o.setAttribute("autocorrect", u ? "" : "off"), o.setAttribute("autocapitalize", c ? "" : "off"), o.setAttribute("spellcheck", !!s);
}
function Uu() {
var o = gt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"), s = gt("div", [o], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
return P ? o.style.width = "1000px" : o.setAttribute("wrap", "off"), Dt && (o.style.border = "1px solid black"), zu(o), s;
}
function vc(o) {
var s = o.optionHandlers, u = o.helpers = {};
o.prototype = { constructor: o, focus: function() {
window.focus(), this.display.input.focus();
}, setOption: function(c, p) {
var g = this.options, m = g[c];
g[c] == p && c != "mode" || (g[c] = p, s.hasOwnProperty(c) && Gn(this, s[c])(this, p, m), ut(this, "optionChange", this, c));
}, getOption: function(c) {
return this.options[c];
}, getDoc: function() {
return this.doc;
}, addKeyMap: function(c, p) {
this.state.keyMaps[p ? "push" : "unshift"](No(c));
}, removeKeyMap: function(c) {
for (var p = this.state.keyMaps, g = 0; g < p.length; ++g)
if (p[g] == c || p[g].name == c)
return p.splice(g, 1), !0;
}, addOverlay: ir(function(c, p) {
var g = c.token ? c : o.getMode(this.options, c);
if (g.startState)
throw new Error("Overlays may not be stateful.");
Ke(this.state.overlays, { mode: g, modeSpec: c, opaque: p && p.opaque, priority: p && p.priority || 0 }, function(m) {
return m.priority;
}), this.state.modeGen++, Qn(this);
}), removeOverlay: ir(function(c) {
for (var p = this.state.overlays, g = 0; g < p.length; ++g) {
var m = p[g].modeSpec;
if (m == c || typeof c == "string" && m.name == c)
return p.splice(g, 1), this.state.modeGen++, void Qn(this);
}
}), indentLine: ir(function(c, p, g) {
typeof p != "string" && typeof p != "number" && (p = p == null ? this.options.smartIndent ? "smart" : "prev" : p ? "add" : "subtract"), yo(this.doc, c) && ya(this, c, p, g);
}), indentSelection: ir(function(c) {
for (var p = this.doc.sel.ranges, g = -1, m = 0; m < p.length; m++) {
var y = p[m];
if (y.empty())
y.head.line > g && (ya(this, y.head.line, c, !0), g = y.head.line, m == this.doc.sel.primIndex && ss(this));
else {
var x = y.from(), O = y.to(), B = Math.max(g, x.line);
g = Math.min(this.lastLine(), O.line - (O.ch ? 0 : 1)) + 1;
for (var $ = B; $ < g; ++$)
ya(this, $, c);
var ft = this.doc.sel.ranges;
x.ch == 0 && p.length == ft.length && ft[m].from().ch > 0 && el(this.doc, m, new tn(x, ft[m].to()), ce);
}
}
}), getTokenAt: function(c, p) {
return Wo(this, c, p);
}, getLineTokens: function(c, p) {
return Wo(this, Bt(c), p, !0);
}, getTokenTypeAt: function(c) {
c = oe(this.doc, c);
var p, g = xr(this, ve(this.doc, c.line)), m = 0, y = (g.length - 1) / 2, x = c.ch;
if (x == 0)
p = g[2];
else
for (; ; ) {
var O = m + y >> 1;
if ((O ? g[2 * O - 1] : 0) >= x)
y = O;
else {
if (!(g[2 * O + 1] < x)) {
p = g[2 * O + 2];
break;
}
m = O + 1;
}
}
var B = p ? p.indexOf("overlay ") : -1;
return B < 0 ? p : B == 0 ? null : p.slice(0, B - 1);
}, getModeAt: function(c) {
var p = this.doc.mode;
return p.innerMode ? o.innerMode(p, this.getTokenAt(c).state).mode : p;
}, getHelper: function(c, p) {
return this.getHelpers(c, p)[0];
}, getHelpers: function(c, p) {
var g = [];
if (!u.hasOwnProperty(p))
return g;
var m = u[p], y = this.getModeAt(c);
if (typeof y[p] == "string")
m[y[p]] && g.push(m[y[p]]);
else if (y[p])
for (var x = 0; x < y[p].length; x++) {
var O = m[y[p][x]];
O && g.push(O);
}
else
y.helperType && m[y.helperType] ? g.push(m[y.helperType]) : m[y.name] && g.push(m[y.name]);
for (var B = 0; B < m._global.length; B++) {
var $ = m._global[B];
$.pred(y, this) && be(g, $.val) == -1 && g.push($.val);
}
return g;
}, getStateAfter: function(c, p) {
var g = this.doc;
return bo(this, (c = $e(g, c ?? g.first + g.size - 1)) + 1, p).state;
}, cursorCoords: function(c, p) {
var g = this.doc.sel.primary();
return kr(this, c == null ? g.head : typeof c == "object" ? oe(this.doc, c) : c ? g.from() : g.to(), p || "page");
}, charCoords: function(c, p) {
return Ha(this, oe(this.doc, c), p || "page");
}, coordsChar: function(c, p) {
return Ll(this, (c = jl(this, c, p || "page")).left, c.top);
}, lineAtHeight: function(c, p) {
return c = jl(this, { top: c, left: 0 }, p || "page").top, In(this.doc, c + this.display.viewOffset);
}, heightAtLine: function(c, p, g) {
var m, y = !1;
if (typeof c == "number") {
var x = this.doc.first + this.doc.size - 1;
c < this.doc.first ? c = this.doc.first : c > x && (c = x, y = !0), m = ve(this.doc, c);
} else
m = c;
return Ra(this, m, { top: 0, left: 0 }, p || "page", g || y).top + (y ? this.doc.height - Fr(m) : 0);
}, defaultTextHeight: function() {
return ao(this.display);
}, defaultCharWidth: function() {
return Jo(this.display);
}, getViewport: function() {
return { from: this.display.viewFrom, to: this.display.viewTo };
}, addWidget: function(c, p, g, m, y) {
var x = this.display, O = (c = kr(this, oe(this.doc, c))).bottom, B = c.left;
if (p.style.position = "absolute", p.setAttribute("cm-ignore-events", "true"), this.display.input.setUneditable(p), x.sizer.appendChild(p), m == "over")
O = c.top;
else if (m == "above" || m == "near") {
var $ = Math.max(x.wrapper.clientHeight, this.doc.height), ft = Math.max(x.sizer.clientWidth, x.lineSpace.clientWidth);
(m == "above" || c.bottom + p.offsetHeight > $) && c.top > p.offsetHeight ? O = c.top - p.offsetHeight : c.bottom + p.offsetHeight <= $ && (O = c.bottom), B + p.offsetWidth > ft && (B = ft - p.offsetWidth);
}
p.style.top = O + "px", p.style.left = p.style.right = "", y == "right" ? (B = x.sizer.clientWidth - p.offsetWidth, p.style.right = "0px") : (y == "left" ? B = 0 : y == "middle" && (B = (x.sizer.clientWidth - p.offsetWidth) / 2), p.style.left = B + "px"), g && Cp(this, { left: B, top: O, right: B + p.offsetWidth, bottom: O + p.offsetHeight });
}, triggerOnKeyDown: ir(cc), triggerOnKeyPress: ir(ju), triggerOnKeyUp: Au, triggerOnMouseDown: ir(Mu), execCommand: function(c) {
if (ms.hasOwnProperty(c))
return ms[c].call(null, this);
}, triggerElectric: ir(function(c) {
gc(this, c);
}), findPosH: function(c, p, g, m) {
var y = 1;
p < 0 && (y = -1, p = -p);
for (var x = oe(this.doc, c), O = 0; O < p && !(x = hl(this.doc, x, y, g, m)).hitSide; ++O)
;
return x;
}, moveH: ir(function(c, p) {
var g = this;
this.extendSelectionsBy(function(m) {
return g.display.shift || g.doc.extend || m.empty() ? hl(g.doc, m.head, c, p, g.options.rtlMoveVisually) : c < 0 ? m.from() : m.to();
}, Xt);
}), deleteH: ir(function(c, p) {
var g = this.doc.sel, m = this.doc;
g.somethingSelected() ? m.replaceSelection("", null, "+delete") : ni(this, function(y) {
var x = hl(m, y.head, c, p, !1);
return c < 0 ? { from: x, to: y.head } : { from: y.head, to: x };
});
}), findPosV: function(c, p, g, m) {
var y = 1, x = m;
p < 0 && (y = -1, p = -p);
for (var O = oe(this.doc, c), B = 0; B < p; ++B) {
var $ = kr(this, O, "div");
if (x == null ? x = $.left : $.left = x, (O = gl(this, $, y, g)).hitSide)
break;
}
return O;
}, moveV: ir(function(c, p) {
var g = this, m = this.doc, y = [], x = !this.display.shift && !m.extend && m.sel.somethingSelected();
if (m.extendSelectionsBy(function(B) {
if (x)
return c < 0 ? B.from() : B.to();
var $ = kr(g, B.head, "div");
B.goalColumn != null && ($.left = B.goalColumn), y.push($.left);
var ft = gl(g, $, c, p);
return p == "page" && B == m.sel.primary() && Wa(g, Ha(g, ft, "div").top - $.top), ft;
}, Xt), y.length)
for (var O = 0; O < m.sel.ranges.length; O++)
m.sel.ranges[O].goalColumn = y[O];
}), findWordAt: function(c) {
var p = ve(this.doc, c.line).text, g = c.ch, m = c.ch;
if (p) {
var y = this.getHelper(c, "wordChars");
c.sticky != "before" && m != p.length || !g ? ++m : --g;
for (var x = p.charAt(g), O = zt(x, y) ? function(B) {
return zt(B, y);
} : /\s/.test(x) ? function(B) {
return /\s/.test(B);
} : function(B) {
return !/\s/.test(B) && !zt(B);
}; g > 0 && O(p.charAt(g - 1)); )
--g;
for (; m < p.length && O(p.charAt(m)); )
++m;
}
return new tn(Bt(c.line, g), Bt(c.line, m));
}, toggleOverwrite: function(c) {
c != null && c == this.state.overwrite || ((this.state.overwrite = !this.state.overwrite) ? Qt(this.display.cursorDiv, "CodeMirror-overwrite") : nt(this.display.cursorDiv, "CodeMirror-overwrite"), ut(this, "overwriteToggle", this, this.state.overwrite));
}, hasFocus: function() {
return this.display.input.getField() == Tt();
}, isReadOnly: function() {
return !(!this.options.readOnly && !this.doc.cantEdit);
}, scrollTo: ir(function(c, p) {
Zs(this, c, p);
}), getScrollInfo: function() {
var c = this.display.scroller;
return { left: c.scrollLeft, top: c.scrollTop, height: c.scrollHeight - lt(this) - this.display.barHeight, width: c.scrollWidth - lt(this) - this.display.barWidth, clientHeight: Gt(this), clientWidth: Nt(this) };
}, scrollIntoView: ir(function(c, p) {
c == null ? (c = { from: this.doc.sel.primary().head, to: null }, p == null && (p = this.options.cursorScrollMargin)) : typeof c == "number" ? c = { from: Bt(c, 0), to: null } : c.from == null && (c = { from: c, to: null }), c.to || (c.to = c.from), c.margin = p || 0, c.from.line != null ? Sp(this, c) : Gc(this, c.from, c.to, c.margin);
}), setSize: ir(function(c, p) {
var g = this, m = function(x) {
return typeof x == "number" || /^\d+$/.test(String(x)) ? x + "px" : x;
};
c != null && (this.display.wrapper.style.width = m(c)), p != null && (this.display.wrapper.style.height = m(p)), this.options.lineWrapping && es(this);
var y = this.display.viewFrom;
this.doc.iter(y, this.display.viewTo, function(x) {
if (x.widgets) {
for (var O = 0; O < x.widgets.length; O++)
if (x.widgets[O].noHScroll) {
lo(g, y, "widget");
break;
}
}
++y;
}), this.curOp.forceUpdate = !0, ut(this, "refresh", this);
}), operation: function(c) {
return fr(this, c);
}, startOperation: function() {
return Oi(this);
}, endOperation: function() {
return Ti(this);
}, refresh: ir(function() {
var c = this.display.cachedTextHeight;
Qn(this), this.curOp.forceUpdate = !0, Xo(this), Zs(this, this.doc.scrollLeft, this.doc.scrollTop), Wl(this.display), (c == null || Math.abs(c - ao(this.display)) > 0.5 || this.options.lineWrapping) && Fl(this), ut(this, "refresh", this);
}), swapDoc: ir(function(c) {
var p = this.doc;
return p.cm = null, this.state.selectingText && this.state.selectingText(), su(this, c), Xo(this), this.display.input.reset(), Zs(this, c.scrollLeft, c.scrollTop), this.curOp.forceScroll = !0, bn(this, "swapDoc", this, p), p;
}), phrase: function(c) {
var p = this.options.phrases;
return p && Object.prototype.hasOwnProperty.call(p, c) ? p[c] : c;
}, 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;
} }, Re(o), o.registerHelper = function(c, p, g) {
u.hasOwnProperty(c) || (u[c] = o[c] = { _global: [] }), u[c][p] = g;
}, o.registerGlobalHelper = function(c, p, g, m) {
o.registerHelper(c, p, m), u[c]._global.push({ pred: g, val: m });
};
}
function hl(o, s, u, c, p) {
var g = s, m = u, y = ve(o, s.line), x = p && o.direction == "rtl" ? -u : u;
function O() {
var le = s.line + x;
return !(le < o.first || le >= o.first + o.size) && (s = new Bt(le, s.ch, s.sticky), y = ve(o, le));
}
function B(le) {
var Jt;
if (c == "codepoint") {
var ye = y.text.charCodeAt(s.ch + (u > 0 ? 0 : -1));
if (isNaN(ye))
Jt = null;
else {
var me = u > 0 ? ye >= 55296 && ye < 56320 : ye >= 56320 && ye < 57343;
Jt = new Bt(s.line, Math.max(0, Math.min(y.text.length, s.ch + u * (me ? 2 : 1))), -u);
}
} else
Jt = p ? Tu(o.cm, y, s, u) : al(y, s, u);
if (Jt == null) {
if (le || !O())
return !1;
s = ll(p, o.cm, y, s.line, x);
} else
s = Jt;
return !0;
}
if (c == "char" || c == "codepoint")
B();
else if (c == "column")
B(!0);
else if (c == "word" || c == "group")
for (var $ = null, ft = c == "group", dt = o.cm && o.cm.getHelper(s, "wordChars"), Ct = !0; !(u < 0) || B(!Ct); Ct = !1) {
var Rt = y.text.charAt(s.ch) || `
`, $t = zt(Rt, dt) ? "w" : ft && Rt == `
` ? "n" : !ft || /\s/.test(Rt) ? null : "p";
if (!ft || Ct || $t || ($t = "s"), $ && $ != $t) {
u < 0 && (u = 1, B(), s.sticky = "after");
break;
}
if ($t && ($ = $t), u > 0 && !B(!Ct))
break;
}
var re = ia(o, s, g, m, !0);
return G(g, re) && (re.hitSide = !0), re;
}
function gl(o, s, u, c) {
var p, g, m = o.doc, y = s.left;
if (c == "page") {
var x = Math.min(o.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight), O = Math.max(x - 0.5 * ao(o.display), 3);
p = (u > 0 ? s.bottom : s.top) + u * O;
} else
c == "line" && (p = u > 0 ? s.bottom + 3 : s.top - 3);
for (; (g = Ll(o, y, p)).outside; ) {
if (u < 0 ? p <= 0 : p >= m.height) {
g.hitSide = !0;
break;
}
p += 5 * u;
}
return g;
}
var rn = function(o) {
this.cm = o, this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null, this.polling = new Te(), this.composing = null, this.gracePeriod = !1, this.readDOMTimeout = null;
};
function mc(o, s) {
var u = ts(o, s.line);
if (!u || u.hidden)
return null;
var c = ve(o.doc, s.line), p = He(u, c, s.line), g = ze(c, o.doc.direction), m = "left";
g && (m = ke(g, s.ch) % 2 ? "right" : "left");
var y = Ws(p.map, s.ch, m);
return y.offset = y.collapse == "right" ? y.end : y.start, y;
}
function tf(o) {
for (var s = o; s; s = s.parentNode)
if (/CodeMirror-gutter-wrapper/.test(s.className))
return !0;
return !1;
}
function _s(o, s) {
return s && (o.bad = !0), o;
}
function yc(o, s, u, c, p) {
var g = "", m = !1, y = o.doc.lineSeparator(), x = !1;
function O(dt) {
return function(Ct) {
return Ct.id == dt;
};
}
function B() {
m && (g += y, x && (g += y), m = x = !1);
}
function $(dt) {
dt && (B(), g += dt);
}
function ft(dt) {
if (dt.nodeType == 1) {
var Ct = dt.getAttribute("cm-text");
if (Ct)
return void $(Ct);
var Rt, $t = dt.getAttribute("cm-marker");
if ($t) {
var re = o.findMarks(Bt(c, 0), Bt(p + 1, 0), O(+$t));
return void (re.length && (Rt = re[0].find(0)) && $(rr(o.doc, Rt.from, Rt.to).join(y)));
}
if (dt.getAttribute("contenteditable") == "false")
return;
var le = /^(pre|div|p|li|table|br)$/i.test(dt.nodeName);
if (!/^br$/i.test(dt.nodeName) && dt.textContent.length == 0)
return;
le && B();
for (var Jt = 0; Jt < dt.childNodes.length; Jt++)
ft(dt.childNodes[Jt]);
/^(pre|p)$/i.test(dt.nodeName) && (x = !0), le && (m = !0);
} else
dt.nodeType == 3 && $(dt.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " "));
}
for (; ft(s), s != u; )
s = s.nextSibling, x = !1;
return g;
}
function vl(o, s, u) {
var c;
if (s == o.display.lineDiv) {
if (!(c = o.display.lineDiv.childNodes[u]))
return _s(o.clipPos(Bt(o.display.viewTo - 1)), !0);
s = null, u = 0;
} else
for (c = s; ; c = c.parentNode) {
if (!c || c == o.display.lineDiv)
return null;
if (c.parentNode && c.parentNode == o.display.lineDiv)
break;
}
for (var p = 0; p < o.display.view.length; p++) {
var g = o.display.view[p];
if (g.node == c)
return ef(g, s, u);
}
}
function ef(o, s, u) {
var c = o.text.firstChild, p = !1;
if (!s || !Lt(c, s))
return _s(Bt(Ye(o.line), 0), !0);
if (s == c && (p = !0, s = c.childNodes[u], u = 0, !s)) {
var g = o.rest ? Zt(o.rest) : o.line;
return _s(Bt(Ye(g), g.text.length), p);
}
var m = s.nodeType == 3 ? s : null, y = s;
for (m || s.childNodes.length != 1 || s.firstChild.nodeType != 3 || (m = s.firstChild, u && (u = m.nodeValue.length)); y.parentNode != c; )
y = y.parentNode;
var x = o.measure, O = x.maps;
function B($t, re, le) {
for (var Jt = -1; Jt < (O ? O.length : 0); Jt++)
for (var ye = Jt < 0 ? x.map : O[Jt], me = 0; me < ye.length; me += 3) {
var Ce = ye[me + 2];
if (Ce == $t || Ce == re) {
var sn = Ye(Jt < 0 ? o.line : o.rest[Jt]), an = ye[me] + le;
return (le < 0 || Ce != $t) && (an = ye[me + (le ? 1 : 0)]), Bt(sn, an);
}
}
}
var $ = B(m, y, u);
if ($)
return _s($, p);
for (var ft = y.nextSibling, dt = m ? m.nodeValue.length - u : 0; ft; ft = ft.nextSibling) {
if ($ = B(ft, ft.firstChild, 0))
return _s(Bt($.line, $.ch - dt), p);
dt += ft.textContent.length;
}
for (var Ct = y.previousSibling, Rt = u; Ct; Ct = Ct.previousSibling) {
if ($ = B(Ct, Ct.firstChild, -1))
return _s(Bt($.line, $.ch + Rt), p);
Rt += Ct.textContent.length;
}
}
rn.prototype.init = function(o) {
var s = this, u = this, c = u.cm, p = u.div = o.lineDiv;
function g(y) {
for (var x = y.target; x; x = x.parentNode) {
if (x == p)
return !0;
if (/\bCodeMirror-(?:line)?widget\b/.test(x.className))
break;
}
return !1;
}
function m(y) {
if (g(y) && !yt(c, y)) {
if (c.somethingSelected())
dl({ lineWise: !1, text: c.getSelections() }), y.type == "cut" && c.replaceSelection("", null, "cut");
else {
if (!c.options.lineWiseCopyCut)
return;
var x = Hu(c);
dl({ lineWise: !0, text: x.text }), y.type == "cut" && c.operation(function() {
c.setSelections(x.ranges, 0, ce), c.replaceSelection("", null, "cut");
});
}
if (y.clipboardData) {
y.clipboardData.clearData();
var O = po.text.join(`
`);
if (y.clipboardData.setData("Text", O), y.clipboardData.getData("Text") == O)
return void y.preventDefault();
}
var B = Uu(), $ = B.firstChild;
c.display.lineSpace.insertBefore(B, c.display.lineSpace.firstChild), $.value = po.text.join(`
`);
var ft = Tt();
Se($), setTimeout(function() {
c.display.lineSpace.removeChild(B), ft.focus(), ft == p && u.showPrimarySelection();
}, 50);
}
}
p.contentEditable = !0, zu(p, c.options.spellcheck, c.options.autocorrect, c.options.autocapitalize), Kt(p, "paste", function(y) {
!g(y) || yt(c, y) || Ru(y, c) || k <= 11 && setTimeout(Gn(c, function() {
return s.updateFromDOM();
}), 20);
}), Kt(p, "compositionstart", function(y) {
s.composing = { data: y.data, done: !1 };
}), Kt(p, "compositionupdate", function(y) {
s.composing || (s.composing = { data: y.data, done: !1 });
}), Kt(p, "compositionend", function(y) {
s.composing && (y.data != s.composing.data && s.readFromDOMSoon(), s.composing.done = !0);
}), Kt(p, "touchstart", function() {
return u.forceCompositionEnd();
}), Kt(p, "input", function() {
s.composing || s.readFromDOMSoon();
}), Kt(p, "copy", m), Kt(p, "cut", m);
}, rn.prototype.screenReaderLabelChanged = function(o) {
o ? this.div.setAttribute("aria-label", o) : this.div.removeAttribute("aria-label");
}, rn.prototype.prepareSelection = function() {
var o = Gs(this.cm, !1);
return o.focus = Tt() == this.div, o;
}, rn.prototype.showSelection = function(o, s) {
o && this.cm.display.view.length && ((o.focus || s) && this.showPrimarySelection(), this.showMultipleSelections(o));
}, rn.prototype.getSelection = function() {
return this.cm.display.wrapper.ownerDocument.getSelection();
}, rn.prototype.showPrimarySelection = function() {
var o = this.getSelection(), s = this.cm, u = s.doc.sel.primary(), c = u.from(), p = u.to();
if (s.display.viewTo == s.display.viewFrom || c.line >= s.display.viewTo || p.line < s.display.viewFrom)
o.removeAllRanges();
else {
var g = vl(s, o.anchorNode, o.anchorOffset), m = vl(s, o.focusNode, o.focusOffset);
if (!g || g.bad || !m || m.bad || T(de(g, m), c) != 0 || T(te(g, m), p) != 0) {
var y = s.display.view, x = c.line >= s.display.viewFrom && mc(s, c) || { node: y[0].measure.map[2], offset: 0 }, O = p.line < s.display.viewTo && mc(s, p);
if (!O) {
var B = y[y.length - 1].measure, $ = B.maps ? B.maps[B.maps.length - 1] : B.map;
O = { node: $[$.length - 1], offset: $[$.length - 2] - $[$.length - 3] };
}
if (x && O) {
var ft, dt = o.rangeCount && o.getRangeAt(0);
try {
ft = Y(x.node, x.offset, O.offset, O.node);
} catch {
}
ft && (!at && s.state.focused ? (o.collapse(x.node, x.offset), ft.collapsed || (o.removeAllRanges(), o.addRange(ft))) : (o.removeAllRanges(), o.addRange(ft)), dt && o.anchorNode == null ? o.addRange(dt) : at && this.startGracePeriod()), this.rememberSelection();
} else
o.removeAllRanges();
}
}
}, rn.prototype.startGracePeriod = function() {
var o = this;
clearTimeout(this.gracePeriod), this.gracePeriod = setTimeout(function() {
o.gracePeriod = !1, o.selectionChanged() && o.cm.operation(function() {
return o.cm.curOp.selectionChanged = !0;
});
}, 20);
}, rn.prototype.showMultipleSelections = function(o) {
rt(this.cm.display.cursorDiv, o.cursors), rt(this.cm.display.selectionDiv, o.selection);
}, rn.prototype.rememberSelection = function() {
var o = this.getSelection();
this.lastAnchorNode = o.anchorNode, this.lastAnchorOffset = o.anchorOffset, this.lastFocusNode = o.focusNode, this.lastFocusOffset = o.focusOffset;
}, rn.prototype.selectionInEditor = function() {
var o = this.getSelection();
if (!o.rangeCount)
return !1;
var s = o.getRangeAt(0).commonAncestorContainer;
return Lt(this.div, s);
}, rn.prototype.focus = function() {
this.cm.options.readOnly != "nocursor" && (this.selectionInEditor() && Tt() == this.div || this.showSelection(this.prepareSelection(), !0), this.div.focus());
}, rn.prototype.blur = function() {
this.div.blur();
}, rn.prototype.getField = function() {
return this.div;
}, rn.prototype.supportsTouch = function() {
return !0;
}, rn.prototype.receivedFocus = function() {
var o = this, s = this;
function u() {
s.cm.state.focused && (s.pollSelection(), s.polling.set(s.cm.options.pollInterval, u));
}
this.selectionInEditor() ? setTimeout(function() {
return o.pollSelection();
}, 20) : fr(this.cm, function() {
return s.cm.curOp.selectionChanged = !0;
}), this.polling.set(this.cm.options.pollInterval, u);
}, rn.prototype.selectionChanged = function() {
var o = this.getSelection();
return o.anchorNode != this.lastAnchorNode || o.anchorOffset != this.lastAnchorOffset || o.focusNode != this.lastFocusNode || o.focusOffset != this.lastFocusOffset;
}, rn.prototype.pollSelection = function() {
if (this.readDOMTimeout == null && !this.gracePeriod && this.selectionChanged()) {
var o = this.getSelection(), s = this.cm;
if (ee && M && this.cm.display.gutterSpecs.length && tf(o.anchorNode))
return this.cm.triggerOnKeyDown({ type: "keydown", keyCode: 8, preventDefault: Math.abs }), this.blur(), void this.focus();
if (!this.composing) {
this.rememberSelection();
var u = vl(s, o.anchorNode, o.anchorOffset), c = vl(s, o.focusNode, o.focusOffset);
u && c && fr(s, function() {
tr(s.doc, Qo(u, c), ce), (u.bad || c.bad) && (s.curOp.selectionChanged = !0);
});
}
}
}, rn.prototype.pollContent = function() {
this.readDOMTimeout != null && (clearTimeout(this.readDOMTimeout), this.readDOMTimeout = null);
var o, s, u, c = this.cm, p = c.display, g = c.doc.sel.primary(), m = g.from(), y = g.to();
if (m.ch == 0 && m.line > c.firstLine() && (m = Bt(m.line - 1, ve(c.doc, m.line - 1).length)), y.ch == ve(c.doc, y.line).text.length && y.line < c.lastLine() && (y = Bt(y.line + 1, 0)), m.line < p.viewFrom || y.line > p.viewTo - 1)
return !1;
m.line == p.viewFrom || (o = _i(c, m.line)) == 0 ? (s = Ye(p.view[0].line), u = p.view[0].node) : (s = Ye(p.view[o].line), u = p.view[o - 1].node.nextSibling);
var x, O, B = _i(c, y.line);
if (B == p.view.length - 1 ? (x = p.viewTo - 1, O = p.lineDiv.lastChild) : (x = Ye(p.view[B + 1].line) - 1, O = p.view[B + 1].node.previousSibling), !u)
return !1;
for (var $ = c.doc.splitLines(yc(c, u, O, s, x)), ft = rr(c.doc, Bt(s, 0), Bt(x, ve(c.doc, x).text.length)); $.length > 1 && ft.length > 1; )
if (Zt($) == Zt(ft))
$.pop(), ft.pop(), x--;
else {
if ($[0] != ft[0])
break;
$.shift(), ft.shift(), s++;
}
for (var dt = 0, Ct = 0, Rt = $[0], $t = ft[0], re = Math.min(Rt.length, $t.length); dt < re && Rt.charCodeAt(dt) == $t.charCodeAt(dt); )
++dt;
for (var le = Zt($), Jt = Zt(ft), ye = Math.min(le.length - ($.length == 1 ? dt : 0), Jt.length - (ft.length == 1 ? dt : 0)); Ct < ye && le.charCodeAt(le.length - Ct - 1) == Jt.charCodeAt(Jt.length - Ct - 1); )
++Ct;
if ($.length == 1 && ft.length == 1 && s == m.line)
for (; dt && dt > m.ch && le.charCodeAt(le.length - Ct - 1) == Jt.charCodeAt(Jt.length - Ct - 1); )
dt--, Ct++;
$[$.length - 1] = le.slice(0, le.length - Ct).replace(/^\u200b+/, ""), $[0] = $[0].slice(dt).replace(/\u200b+$/, "");
var me = Bt(s, dt), Ce = Bt(x, ft.length ? Zt(ft).length - Ct : 0);
return $.length > 1 || $[0] || T(me, Ce) ? (ds(c.doc, $, me, Ce, "+input"), !0) : void 0;
}, rn.prototype.ensurePolled = function() {
this.forceCompositionEnd();
}, rn.prototype.reset = function() {
this.forceCompositionEnd();
}, rn.prototype.forceCompositionEnd = function() {
this.composing && (clearTimeout(this.readDOMTimeout), this.composing = null, this.updateFromDOM(), this.div.blur(), this.div.focus());
}, rn.prototype.readFromDOMSoon = function() {
var o = this;
this.readDOMTimeout == null && (this.readDOMTimeout = setTimeout(function() {
if (o.readDOMTimeout = null, o.composing) {
if (!o.composing.done)
return;
o.composing = null;
}
o.updateFromDOM();
}, 80));
}, rn.prototype.updateFromDOM = function() {
var o = this;
!this.cm.isReadOnly() && this.pollContent() || fr(this.cm, function() {
return Qn(o.cm);
});
}, rn.prototype.setUneditable = function(o) {
o.contentEditable = "false";
}, rn.prototype.onKeyPress = function(o) {
o.charCode == 0 || this.composing || (o.preventDefault(), this.cm.isReadOnly() || Gn(this.cm, hc)(this.cm, String.fromCharCode(o.charCode == null ? o.keyCode : o.charCode), 0));
}, rn.prototype.readOnlyChanged = function(o) {
this.div.contentEditable = String(o != "nocursor");
}, rn.prototype.onContextMenu = function() {
}, rn.prototype.resetPosition = function() {
}, rn.prototype.needsContentAttribute = !0;
var Pn = function(o) {
this.cm = o, this.prevInput = "", this.pollingFast = !1, this.polling = new Te(), this.hasSelection = !1, this.composing = null;
};
function nf(o, s) {
if ((s = s ? De(s) : {}).value = o.value, !s.tabindex && o.tabIndex && (s.tabindex = o.tabIndex), !s.placeholder && o.placeholder && (s.placeholder = o.placeholder), s.autofocus == null) {
var u = Tt();
s.autofocus = u == o || o.getAttribute("autofocus") != null && u == document.body;
}
function c() {
o.value = y.getValue();
}
var p;
if (o.form && (Kt(o.form, "submit", c), !s.leaveSubmitMethodAlone)) {
var g = o.form;
p = g.submit;
try {
var m = g.submit = function() {
c(), g.submit = p, g.submit(), g.submit = m;
};
} catch {
}
}
s.finishInit = function(x) {
x.save = c, x.getTextArea = function() {
return o;
}, x.toTextArea = function() {
x.toTextArea = isNaN, c(), o.parentNode.removeChild(x.getWrapperElement()), o.style.display = "", o.form && (tt(o.form, "submit", c), s.leaveSubmitMethodAlone || typeof o.form.submit != "function" || (o.form.submit = p));
};
}, o.style.display = "none";
var y = wn(function(x) {
return o.parentNode.insertBefore(x, o.nextSibling);
}, s);
return y;
}
function rf(o) {
o.off = tt, o.on = Kt, o.wheelEventPixels = Dp, o.Doc = Fn, o.splitLines = _o, o.countColumn = xe, o.findColumn = qt, o.isWordChar = mt, o.Pass = pe, o.signal = ut, o.Line = Vr, o.changeEnd = co, o.scrollbarModel = Kc, o.Pos = Bt, o.cmpPos = T, o.modes = ur, o.mimeModes = ln, o.resolveMode = Co, o.getMode = Jr, o.modeExtensions = Wn, o.extendMode = Nn, o.copyState = $n, o.startState = mo, o.innerMode = zo, o.commands = ms, o.keyMap = uo, o.keyName = Ou, o.isModifierKey = sc, o.lookupKey = Mi, o.normalizeKeyMap = sl, o.StringStream = qe, o.SharedTextMarker = pa, o.TextMarker = ei, o.LineWidget = ua, o.e_preventDefault = We, o.e_stopPropagation = Ln, o.e_stop = Ne, o.addClass = Qt, o.contains = Lt, o.rmClass = nt, o.keyNames = to;
}
Pn.prototype.init = function(o) {
var s = this, u = this, c = this.cm;
this.createField(o);
var p = this.textarea;
function g(m) {
if (!yt(c, m)) {
if (c.somethingSelected())
dl({ lineWise: !1, text: c.getSelections() });
else {
if (!c.options.lineWiseCopyCut)
return;
var y = Hu(c);
dl({ lineWise: !0, text: y.text }), m.type == "cut" ? c.setSelections(y.ranges, null, ce) : (u.prevInput = "", p.value = y.text.join(`
`), Se(p));
}
m.type == "cut" && (c.state.cutIncoming = +/* @__PURE__ */ new Date());
}
}
o.wrapper.insertBefore(this.wrapper, o.wrapper.firstChild), Dt && (p.style.width = "0px"), Kt(p, "input", function() {
z && k >= 9 && s.hasSelection && (s.hasSelection = null), u.poll();
}), Kt(p, "paste", function(m) {
yt(c, m) || Ru(m, c) || (c.state.pasteIncoming = +/* @__PURE__ */ new Date(), u.fastPoll());
}), Kt(p, "cut", g), Kt(p, "copy", g), Kt(o.scroller, "paste", function(m) {
if (!A(o, m) && !yt(c, m)) {
if (!p.dispatchEvent)
return c.state.pasteIncoming = +/* @__PURE__ */ new Date(), void u.focus();
var y = new Event("paste");
y.clipboardData = m.clipboardData, p.dispatchEvent(y);
}
}), Kt(o.lineSpace, "selectstart", function(m) {
A(o, m) || We(m);
}), Kt(p, "compositionstart", function() {
var m = c.getCursor("from");
u.composing && u.composing.range.clear(), u.composing = { start: m, range: c.markText(m, c.getCursor("to"), { className: "CodeMirror-composing" }) };
}), Kt(p, "compositionend", function() {
u.composing && (u.poll(), u.composing.range.clear(), u.composing = null);
});
}, Pn.prototype.createField = function(o) {
this.wrapper = Uu(), this.textarea = this.wrapper.firstChild;
}, Pn.prototype.screenReaderLabelChanged = function(o) {
o ? this.textarea.setAttribute("aria-label", o) : this.textarea.removeAttribute("aria-label");
}, Pn.prototype.prepareSelection = function() {
var o = this.cm, s = o.display, u = o.doc, c = Gs(o);
if (o.options.moveInputWithCursor) {
var p = kr(o, u.sel.primary().head, "div"), g = s.wrapper.getBoundingClientRect(), m = s.lineDiv.getBoundingClientRect();
c.teTop = Math.max(0, Math.min(s.wrapper.clientHeight - 10, p.top + m.top - g.top)), c.teLeft = Math.max(0, Math.min(s.wrapper.clientWidth - 10, p.left + m.left - g.left));
}
return c;
}, Pn.prototype.showSelection = function(o) {
var s = this.cm.display;
rt(s.cursorDiv, o.cursors), rt(s.selectionDiv, o.selection), o.teTop != null && (this.wrapper.style.top = o.teTop + "px", this.wrapper.style.left = o.teLeft + "px");
}, Pn.prototype.reset = function(o) {
if (!this.contextMenuPending && !this.composing) {
var s = this.cm;
if (s.somethingSelected()) {
this.prevInput = "";
var u = s.getSelection();
this.textarea.value = u, s.state.focused && Se(this.textarea), z && k >= 9 && (this.hasSelection = u);
} else
o || (this.prevInput = this.textarea.value = "", z && k >= 9 && (this.hasSelection = null));
}
}, Pn.prototype.getField = function() {
return this.textarea;
}, Pn.prototype.supportsTouch = function() {
return !1;
}, Pn.prototype.focus = function() {
if (this.cm.options.readOnly != "nocursor" && (!xt || Tt() != this.textarea))
try {
this.textarea.focus();
} catch {
}
}, Pn.prototype.blur = function() {
this.textarea.blur();
}, Pn.prototype.resetPosition = function() {
this.wrapper.style.top = this.wrapper.style.left = 0;
}, Pn.prototype.receivedFocus = function() {
this.slowPoll();
}, Pn.prototype.slowPoll = function() {
var o = this;
this.pollingFast || this.polling.set(this.cm.options.pollInterval, function() {
o.poll(), o.cm.state.focused && o.slowPoll();
});
}, Pn.prototype.fastPoll = function() {
var o = !1, s = this;
function u() {
s.poll() || o ? (s.pollingFast = !1, s.slowPoll()) : (o = !0, s.polling.set(60, u));
}
s.pollingFast = !0, s.polling.set(20, u);
}, Pn.prototype.poll = function() {
var o = this, s = this.cm, u = this.textarea, c = this.prevInput;
if (this.contextMenuPending || !s.state.focused || Vo(u) && !c && !this.composing || s.isReadOnly() || s.options.disableInput || s.state.keySeq)
return !1;
var p = u.value;
if (p == c && !s.somethingSelected())
return !1;
if (z && k >= 9 && this.hasSelection === p || bt && /[\uf700-\uf7ff]/.test(p))
return s.display.input.reset(), !1;
if (s.doc.sel == s.display.selForContextMenu) {
var g = p.charCodeAt(0);
if (g != 8203 || c || (c = ""), g == 8666)
return this.reset(), this.cm.execCommand("undo");
}
for (var m = 0, y = Math.min(c.length, p.length); m < y && c.charCodeAt(m) == p.charCodeAt(m); )
++m;
return fr(s, function() {
hc(s, p.slice(m), c.length - m, null, o.composing ? "*compose" : null), p.length > 1e3 || p.indexOf(`
`) > -1 ? u.value = o.prevInput = "" : o.prevInput = p, o.composing && (o.composing.range.clear(), o.composing.range = s.markText(o.composing.start, s.getCursor("to"), { className: "CodeMirror-composing" }));
}), !0;
}, Pn.prototype.ensurePolled = function() {
this.pollingFast && this.poll() && (this.pollingFast = !1);
}, Pn.prototype.onKeyPress = function() {
z && k >= 9 && (this.hasSelection = null), this.fastPoll();
}, Pn.prototype.onContextMenu = function(o) {
var s = this, u = s.cm, c = u.display, p = s.textarea;
s.contextMenuPending && s.contextMenuPending();
var g = wi(u, o), m = c.scroller.scrollTop;
if (g && !ot) {
u.options.resetSelectionOnContextMenu && u.doc.sel.contains(g) == -1 && Gn(u, tr)(u.doc, Qo(g), ce);
var y, x = p.style.cssText, O = s.wrapper.style.cssText, B = s.wrapper.offsetParent.getBoundingClientRect();
if (s.wrapper.style.cssText = "position: static", p.style.cssText = `position: absolute; width: 30px; height: 30px;
top: ` + (o.clientY - B.top - 5) + "px; left: " + (o.clientX - B.left - 5) + `px;
z-index: 1000; background: ` + (z ? "rgba(255, 255, 255, .05)" : "transparent") + `;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`, P && (y = window.scrollY), c.input.focus(), P && window.scrollTo(null, y), c.input.reset(), u.somethingSelected() || (p.value = s.prevInput = " "), s.contextMenuPending = dt, c.selForContextMenu = u.doc.sel, clearTimeout(c.detectingSelectAll), z && k >= 9 && ft(), j) {
Ne(o);
var $ = function() {
tt(window, "mouseup", $), setTimeout(dt, 20);
};
Kt(window, "mouseup", $);
} else
setTimeout(dt, 50);
}
function ft() {
if (p.selectionStart != null) {
var Ct = u.somethingSelected(), Rt = "" + (Ct ? p.value : "");
p.value = "⇚", p.value = Rt, s.prevInput = Ct ? "" : "", p.selectionStart = 1, p.selectionEnd = Rt.length, c.selForContextMenu = u.doc.sel;
}
}
function dt() {
if (s.contextMenuPending == dt && (s.contextMenuPending = !1, s.wrapper.style.cssText = O, p.style.cssText = x, z && k < 9 && c.scrollbars.setScrollTop(c.scroller.scrollTop = m), p.selectionStart != null)) {
(!z || z && k < 9) && ft();
var Ct = 0, Rt = function() {
c.selForContextMenu == u.doc.sel && p.selectionStart == 0 && p.selectionEnd > 0 && s.prevInput == "" ? Gn(u, uu)(u) : Ct++ < 10 ? c.detectingSelectAll = setTimeout(Rt, 500) : (c.selForContextMenu = null, c.input.reset());
};
c.detectingSelectAll = setTimeout(Rt, 200);
}
}
}, Pn.prototype.readOnlyChanged = function(o) {
o || this.reset(), this.textarea.disabled = o == "nocursor", this.textarea.readOnly = !!o;
}, Pn.prototype.setUneditable = function() {
}, Pn.prototype.needsContentAttribute = !1, Vu(wn), vc(wn);
var Bu = "iter insert remove copy getEditor constructor".split(" ");
for (var xs in Fn.prototype)
Fn.prototype.hasOwnProperty(xs) && be(Bu, xs) < 0 && (wn.prototype[xs] = function(o) {
return function() {
return o.apply(this.doc, arguments);
};
}(Fn.prototype[xs]));
return Re(Fn), wn.inputStyles = { textarea: Pn, contenteditable: rn }, wn.defineMode = function(o) {
wn.defaults.mode || o == "null" || (wn.defaults.mode = o), Ho.apply(this, arguments);
}, wn.defineMIME = Lr, wn.defineMode("null", function() {
return { token: function(o) {
return o.skipToEnd();
} };
}), wn.defineMIME("text/plain", "null"), wn.defineExtension = function(o, s) {
wn.prototype[o] = s;
}, wn.defineDocExtension = function(o, s) {
Fn.prototype[o] = s;
}, wn.fromTextArea = nf, rf(wn), wn.version = "5.65.6", wn;
}();
}, 629: (S, H, pt) => {
(function(at) {
function _t(j) {
for (var V = {}, Y = 0; Y < j.length; ++Y)
V[j[Y].toLowerCase()] = !0;
return V;
}
at.defineMode("css", function(j, V) {
var Y = V.inline;
V.propertyKeywords || (V = at.resolveMode("text/css"));
var nt, wt, rt = j.indentUnit, gt = V.tokenHooks, N = V.documentTypes || {}, Lt = V.mediaTypes || {}, Tt = V.mediaFeatures || {}, Qt = V.mediaValueKeywords || {}, Oe = V.propertyKeywords || {}, Se = V.nonStandardPropertyKeywords || {}, _e = V.fontProperties || {}, De = V.counterDescriptors || {}, xe = V.colorKeywords || {}, Te = V.valueKeywords || {}, be = V.allowNested, ge = V.lineComment, pe = V.supportsAtComponent === !0, ce = j.highlightNonStandardPropertyKeywords !== !1;
function st(mt, zt) {
return nt = zt, mt;
}
function Xt(mt, zt) {
var b = mt.next();
if (gt[b]) {
var I = gt[b](mt, zt);
if (I !== !1)
return I;
}
return b == "@" ? (mt.eatWhile(/[\w\\\-]/), st("def", mt.current())) : b == "=" || (b == "~" || b == "|") && mt.eat("=") ? st(null, "compare") : b == '"' || b == "'" ? (zt.tokenize = qt(b), zt.tokenize(mt, zt)) : b == "#" ? (mt.eatWhile(/[\w\\\-]/), st("atom", "hash")) : b == "!" ? (mt.match(/^\s*\w*/), st("keyword", "important")) : /\d/.test(b) || b == "." && mt.eat(/\d/) ? (mt.eatWhile(/[\w.%]/), st("number", "unit")) : b !== "-" ? /[,+>*\/]/.test(b) ? st(null, "select-op") : b == "." && mt.match(/^-?[_a-z][_a-z0-9-]*/i) ? st("qualifier", "qualifier") : /[:;{}\[\]\(\)]/.test(b) ? st(null, b) : mt.match(/^[\w-.]+(?=\()/) ? (/^(url(-prefix)?|domain|regexp)$/i.test(mt.current()) && (zt.tokenize = ne), st("variable callee", "variable")) : /[\w\\\-]/.test(b) ? (mt.eatWhile(/[\w\\\-]/), st("property", "word")) : st(null, null) : /[\d.]/.test(mt.peek()) ? (mt.eatWhile(/[\w.%]/), st("number", "unit")) : mt.match(/^-[\w\\\-]*/) ? (mt.eatWhile(/[\w\\\-]/), mt.match(/^\s*:/, !1) ? st("variable-2", "variable-definition") : st("variable-2", "variable")) : mt.match(/^\w+-/) ? st("meta", "meta") : void 0;
}
function qt(mt) {
return function(zt, b) {
for (var I, U = !1; (I = zt.next()) != null; ) {
if (I == mt && !U) {
mt == ")" && zt.backUp(1);
break;
}
U = !U && I == "\\";
}
return (I == mt || !U && mt != ")") && (b.tokenize = null), st("string", "string");
};
}
function ne(mt, zt) {
return mt.next(), mt.match(/^\s*[\"\')]/, !1) ? zt.tokenize = null : zt.tokenize = qt(")"), st(null, "(");
}
function ae(mt, zt, b) {
this.type = mt, this.indent = zt, this.prev = b;
}
function Zt(mt, zt, b, I) {
return mt.context = new ae(b, zt.indentation() + (I === !1 ? 0 : rt), mt.context), b;
}
function Ae(mt) {
return mt.context.prev && (mt.context = mt.context.prev), mt.context.type;
}
function Ke(mt, zt, b) {
return Rn[b.context.type](mt, zt, b);
}
function Xe(mt, zt, b, I) {
for (var U = I || 1; U > 0; U--)
b.context = b.context.prev;
return Ke(mt, zt, b);
}
function vn(mt) {
var zt = mt.current().toLowerCase();
wt = Te.hasOwnProperty(zt) ? "atom" : xe.hasOwnProperty(zt) ? "keyword" : "variable";
}
var Rn = { top: function(mt, zt, b) {
if (mt == "{")
return Zt(b, zt, "block");
if (mt == "}" && b.context.prev)
return Ae(b);
if (pe && /@component/i.test(mt))
return Zt(b, zt, "atComponentBlock");
if (/^@(-moz-)?document$/i.test(mt))
return Zt(b, zt, "documentTypes");
if (/^@(media|supports|(-moz-)?document|import)$/i.test(mt))
return Zt(b, zt, "atBlock");
if (/^@(font-face|counter-style)/i.test(mt))
return b.stateArg = mt, "restricted_atBlock_before";
if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(mt))
return "keyframes";
if (mt && mt.charAt(0) == "@")
return Zt(b, zt, "at");
if (mt == "hash")
wt = "builtin";
else if (mt == "word")
wt = "tag";
else {
if (mt == "variable-definition")
return "maybeprop";
if (mt == "interpolation")
return Zt(b, zt, "interpolation");
if (mt == ":")
return "pseudo";
if (be && mt == "(")
return Zt(b, zt, "parens");
}
return b.context.type;
}, block: function(mt, zt, b) {
if (mt == "word") {
var I = zt.current().toLowerCase();
return Oe.hasOwnProperty(I) ? (wt = "property", "maybeprop") : Se.hasOwnProperty(I) ? (wt = ce ? "string-2" : "property", "maybeprop") : be ? (wt = zt.match(/^\s*:(?:\s|$)/, !1) ? "property" : "tag", "block") : (wt += " error", "maybeprop");
}
return mt == "meta" ? "block" : be || mt != "hash" && mt != "qualifier" ? Rn.top(mt, zt, b) : (wt = "error", "block");
}, maybeprop: function(mt, zt, b) {
return mt == ":" ? Zt(b, zt, "prop") : Ke(mt, zt, b);
}, prop: function(mt, zt, b) {
if (mt == ";")
return Ae(b);
if (mt == "{" && be)
return Zt(b, zt, "propBlock");
if (mt == "}" || mt == "{")
return Xe(mt, zt, b);
if (mt == "(")
return Zt(b, zt, "parens");
if (mt != "hash" || /^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(zt.current())) {
if (mt == "word")
vn(zt);
else if (mt == "interpolation")
return Zt(b, zt, "interpolation");
} else
wt += " error";
return "prop";
}, propBlock: function(mt, zt, b) {
return mt == "}" ? Ae(b) : mt == "word" ? (wt = "property", "maybeprop") : b.context.type;
}, parens: function(mt, zt, b) {
return mt == "{" || mt == "}" ? Xe(mt, zt, b) : mt == ")" ? Ae(b) : mt == "(" ? Zt(b, zt, "parens") : mt == "interpolation" ? Zt(b, zt, "interpolation") : (mt == "word" && vn(zt), "parens");
}, pseudo: function(mt, zt, b) {
return mt == "meta" ? "pseudo" : mt == "word" ? (wt = "variable-3", b.context.type) : Ke(mt, zt, b);
}, documentTypes: function(mt, zt, b) {
return mt == "word" && N.hasOwnProperty(zt.current()) ? (wt = "tag", b.context.type) : Rn.atBlock(mt, zt, b);
}, atBlock: function(mt, zt, b) {
if (mt == "(")
return Zt(b, zt, "atBlock_parens");
if (mt == "}" || mt == ";")
return Xe(mt, zt, b);
if (mt == "{")
return Ae(b) && Zt(b, zt, be ? "block" : "top");
if (mt == "interpolation")
return Zt(b, zt, "interpolation");
if (mt == "word") {
var I = zt.current().toLowerCase();
wt = I == "only" || I == "not" || I == "and" || I == "or" ? "keyword" : Lt.hasOwnProperty(I) ? "attribute" : Tt.hasOwnProperty(I) ? "property" : Qt.hasOwnProperty(I) ? "keyword" : Oe.hasOwnProperty(I) ? "property" : Se.hasOwnProperty(I) ? ce ? "string-2" : "property" : Te.hasOwnProperty(I) ? "atom" : xe.hasOwnProperty(I) ? "keyword" : "error";
}
return b.context.type;
}, atComponentBlock: function(mt, zt, b) {
return mt == "}" ? Xe(mt, zt, b) : mt == "{" ? Ae(b) && Zt(b, zt, be ? "block" : "top", !1) : (mt == "word" && (wt = "error"), b.context.type);
}, atBlock_parens: function(mt, zt, b) {
return mt == ")" ? Ae(b) : mt == "{" || mt == "}" ? Xe(mt, zt, b, 2) : Rn.atBlock(mt, zt, b);
}, restricted_atBlock_before: function(mt, zt, b) {
return mt == "{" ? Zt(b, zt, "restricted_atBlock") : mt == "word" && b.stateArg == "@counter-style" ? (wt = "variable", "restricted_atBlock_before") : Ke(mt, zt, b);
}, restricted_atBlock: function(mt, zt, b) {
return mt == "}" ? (b.stateArg = null, Ae(b)) : mt == "word" ? (wt = b.stateArg == "@font-face" && !_e.hasOwnProperty(zt.current().toLowerCase()) || b.stateArg == "@counter-style" && !De.hasOwnProperty(zt.current().toLowerCase()) ? "error" : "property", "maybeprop") : "restricted_atBlock";
}, keyframes: function(mt, zt, b) {
return mt == "word" ? (wt = "variable", "keyframes") : mt == "{" ? Zt(b, zt, "top") : Ke(mt, zt, b);
}, at: function(mt, zt, b) {
return mt == ";" ? Ae(b) : mt == "{" || mt == "}" ? Xe(mt, zt, b) : (mt == "word" ? wt = "tag" : mt == "hash" && (wt = "builtin"), "at");
}, interpolation: function(mt, zt, b) {
return mt == "}" ? Ae(b) : mt == "{" || mt == ";" ? Xe(mt, zt, b) : (mt == "word" ? wt = "variable" : mt != "variable" && mt != "(" && mt != ")" && (wt = "error"), "interpolation");
} };
return { startState: function(mt) {
return { tokenize: null, state: Y ? "block" : "top", stateArg: null, context: new ae(Y ? "block" : "top", mt || 0, null) };
}, token: function(mt, zt) {
if (!zt.tokenize && mt.eatSpace())
return null;
var b = (zt.tokenize || Xt)(mt, zt);
return b && typeof b == "object" && (nt = b[1], b = b[0]), wt = b, nt != "comment" && (zt.state = Rn[zt.state](nt, mt, zt)), wt;
}, indent: function(mt, zt) {
var b = mt.context, I = zt && zt.charAt(0), U = b.indent;
return b.type != "prop" || I != "}" && I != ")" || (b = b.prev), b.prev && (I != "}" || b.type != "block" && b.type != "top" && b.type != "interpolation" && b.type != "restricted_atBlock" ? (I != ")" || b.type != "parens" && b.type != "atBlock_parens") && (I != "{" || b.type != "at" && b.type != "atBlock") || (U = Math.max(0, b.indent - rt)) : U = (b = b.prev).indent), U;
}, electricChars: "}", blockCommentStart: "/*", blockCommentEnd: "*/", blockCommentContinue: " * ", lineComment: ge, fold: "brace" };
});
var J = ["domain", "regexp", "url", "url-prefix"], W = _t(J), z = ["all", "aural", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "embossed"], k = _t(z), P = ["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"], E = _t(P), M = ["landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover", "interlace", "progressive", "dark", "light", "standard", "high"], D = _t(M), ot = ["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"], it = _t(ot), Et = ["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"], jt = _t(Et), Dt = _t(["font-display", "font-family", "src", "unicode-range", "font-variant", "font-feature-settings", "font-stretch", "font-weight", "font-style"]), ee = _t(["additive-symbols", "fallback", "negative", "pad", "prefix", "range", "speak-as", "suffix", "symbols", "system"]), xt = ["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"], bt = _t(xt), Wt = ["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"], Ft = _t(Wt), Ht = J.concat(z).concat(P).concat(M).concat(ot).concat(Et).concat(xt).concat(Wt);
function Q(j, V) {
for (var Y, nt = !1; (Y = j.next()) != null; ) {
if (nt && Y == "/") {
V.tokenize = null;
break;
}
nt = Y == "*";
}
return ["comment", "comment"];
}
at.registerHelper("hintWords", "css", Ht), at.defineMIME("text/css", { documentTypes: W, mediaTypes: k, mediaFeatures: E, mediaValueKeywords: D, propertyKeywords: it, nonStandardPropertyKeywords: jt, fontProperties: Dt, counterDescriptors: ee, colorKeywords: bt, valueKeywords: Ft, tokenHooks: { "/": function(j, V) {
return !!j.eat("*") && (V.tokenize = Q, Q(j, V));
} }, name: "css" }), at.defineMIME("text/x-scss", { mediaTypes: k, mediaFeatures: E, mediaValueKeywords: D, propertyKeywords: it, nonStandardPropertyKeywords: jt, colorKeywords: bt, valueKeywords: Ft, fontProperties: Dt, allowNested: !0, lineComment: "//", tokenHooks: { "/": function(j, V) {
return j.eat("/") ? (j.skipToEnd(), ["comment", "comment"]) : j.eat("*") ? (V.tokenize = Q, Q(j, V)) : ["operator", "operator"];
}, ":": function(j) {
return !!j.match(/^\s*\{/, !1) && [null, null];
}, $: function(j) {
return j.match(/^[\w-]+/), j.match(/^\s*:/, !1) ? ["variable-2", "variable-definition"] : ["variable-2", "variable"];
}, "#": function(j) {
return !!j.eat("{") && [null, "interpolation"];
} }, name: "css", helperType: "scss" }), at.defineMIME("text/x-less", { mediaTypes: k, mediaFeatures: E, mediaValueKeywords: D, propertyKeywords: it, nonStandardPropertyKeywords: jt, colorKeywords: bt, valueKeywords: Ft, fontProperties: Dt, allowNested: !0, lineComment: "//", tokenHooks: { "/": function(j, V) {
return j.eat("/") ? (j.skipToEnd(), ["comment", "comment"]) : j.eat("*") ? (V.tokenize = Q, Q(j, V)) : ["operator", "operator"];
}, "@": function(j) {
return j.eat("{") ? [null, "interpolation"] : !j.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i, !1) && (j.eatWhile(/[\w\\\-]/), j.match(/^\s*:/, !1) ? ["variable-2", "variable-definition"] : ["variable-2", "variable"]);
}, "&": function() {
return ["atom", "atom"];
} }, name: "css", helperType: "less" }), at.defineMIME("text/x-gss", { documentTypes: W, mediaTypes: k, mediaFeatures: E, propertyKeywords: it, nonStandardPropertyKeywords: jt, fontProperties: Dt, counterDescriptors: ee, colorKeywords: bt, valueKeywords: Ft, supportsAtComponent: !0, tokenHooks: { "/": function(j, V) {
return !!j.eat("*") && (V.tokenize = Q, Q(j, V));
} }, name: "css", helperType: "gss" });
})(pt(631));
}, 531: (S, H, pt) => {
(function(at) {
var _t = { 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 J(D, ot, it) {
var Et = D.current(), jt = Et.search(ot);
return jt > -1 ? D.backUp(Et.length - jt) : Et.match(/<\/?$/) && (D.backUp(Et.length), D.match(ot, !1) || D.match(Et)), it;
}
var W = {};
function z(D) {
var ot = W[D];
return ot || (W[D] = new RegExp("\\s+" + D + `\\s*=\\s*('|")?([^'"]+)('|")?\\s*`));
}
function k(D, ot) {
var it = D.match(z(ot));
return it ? /^\s*(.*?)\s*$/.exec(it[2])[1] : "";
}
function P(D, ot) {
return new RegExp((ot ? "^" : "") + "\\s*" + D + "\\s*>", "i");
}
function E(D, ot) {
for (var it in D)
for (var Et = ot[it] || (ot[it] = []), jt = D[it], Dt = jt.length - 1; Dt >= 0; Dt--)
Et.unshift(jt[Dt]);
}
function M(D, ot) {
for (var it = 0; it < D.length; it++) {
var Et = D[it];
if (!Et[0] || Et[1].test(k(ot, Et[0])))
return Et[2];
}
}
at.defineMode("htmlmixed", function(D, ot) {
var it = at.getMode(D, { name: "xml", htmlMode: !0, multilineTagIndentFactor: ot.multilineTagIndentFactor, multilineTagIndentPastTag: ot.multilineTagIndentPastTag, allowMissingTagName: ot.allowMissingTagName }), Et = {}, jt = ot && ot.tags, Dt = ot && ot.scriptTypes;
if (E(_t, Et), jt && E(jt, Et), Dt)
for (var ee = Dt.length - 1; ee >= 0; ee--)
Et.script.unshift(["type", Dt[ee].matches, Dt[ee].mode]);
function xt(bt, Wt) {
var Ft, Ht = it.token(bt, Wt.htmlState), Q = /\btag\b/.test(Ht);
if (Q && !/[<>\s\/]/.test(bt.current()) && (Ft = Wt.htmlState.tagName && Wt.htmlState.tagName.toLowerCase()) && Et.hasOwnProperty(Ft))
Wt.inTag = Ft + " ";
else if (Wt.inTag && Q && />$/.test(bt.current())) {
var j = /^([\S]+) (.*)/.exec(Wt.inTag);
Wt.inTag = null;
var V = bt.current() == ">" && M(Et[j[1]], j[2]), Y = at.getMode(D, V), nt = P(j[1], !0), wt = P(j[1], !1);
Wt.token = function(rt, gt) {
return rt.match(nt, !1) ? (gt.token = xt, gt.localState = gt.localMode = null, null) : J(rt, wt, gt.localMode.token(rt, gt.localState));
}, Wt.localMode = Y, Wt.localState = at.startState(Y, it.indent(Wt.htmlState, "", ""));
} else
Wt.inTag && (Wt.inTag += bt.current(), bt.eol() && (Wt.inTag += " "));
return Ht;
}
return { startState: function() {
return { token: xt, inTag: null, localMode: null, localState: null, htmlState: at.startState(it) };
}, copyState: function(bt) {
var Wt;
return bt.localState && (Wt = at.copyState(bt.localMode, bt.localState)), { token: bt.token, inTag: bt.inTag, localMode: bt.localMode, localState: Wt, htmlState: at.copyState(it, bt.htmlState) };
}, token: function(bt, Wt) {
return Wt.token(bt, Wt);
}, indent: function(bt, Wt, Ft) {
return !bt.localMode || /^\s*<\//.test(Wt) ? it.indent(bt.htmlState, Wt, Ft) : bt.localMode.indent ? bt.localMode.indent(bt.localState, Wt, Ft) : at.Pass;
}, innerMode: function(bt) {
return { state: bt.localState || bt.htmlState, mode: bt.localMode || it };
} };
}, "xml", "javascript", "css"), at.defineMIME("text/html", "htmlmixed");
})(pt(631), pt(589), pt(876), pt(629));
}, 876: (S, H, pt) => {
(function(at) {
at.defineMode("javascript", function(_t, J) {
var W, z, k = _t.indentUnit, P = J.statementIndent, E = J.jsonld, M = J.json || E, D = J.trackScope !== !1, ot = J.typescript, it = J.wordCharacters || /[\w$\xa1-\uffff]/, Et = function() {
function T(Hn) {
return { type: Hn, style: "keyword" };
}
var G = T("keyword a"), Mt = T("keyword b"), te = T("keyword c"), de = T("keyword d"), $e = T("operator"), oe = { type: "atom", style: "atom" };
return { if: T("if"), while: G, with: G, else: Mt, do: Mt, try: Mt, finally: Mt, return: de, break: de, continue: de, new: T("new"), delete: te, void: te, throw: te, debugger: T("debugger"), var: T("var"), const: T("var"), let: T("var"), function: T("function"), catch: T("catch"), for: T("for"), switch: T("switch"), case: T("case"), default: T("default"), in: $e, typeof: $e, instanceof: $e, true: oe, false: oe, null: oe, undefined: oe, NaN: oe, Infinity: oe, this: T("this"), class: T("class"), super: T("atom"), yield: te, export: T("export"), import: T("import"), extends: te, await: te };
}(), jt = /[+\-*&%=<>!?|~^@]/, Dt = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
function ee(T) {
for (var G, Mt = !1, te = !1; (G = T.next()) != null; ) {
if (!Mt) {
if (G == "/" && !te)
return;
G == "[" ? te = !0 : te && G == "]" && (te = !1);
}
Mt = !Mt && G == "\\";
}
}
function xt(T, G, Mt) {
return W = T, z = Mt, G;
}
function bt(T, G) {
var Mt = T.next();
if (Mt == '"' || Mt == "'")
return G.tokenize = Wt(Mt), G.tokenize(T, G);
if (Mt == "." && T.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))
return xt("number", "number");
if (Mt == "." && T.match(".."))
return xt("spread", "meta");
if (/[\[\]{}\(\),;\:\.]/.test(Mt))
return xt(Mt);
if (Mt == "=" && T.eat(">"))
return xt("=>", "operator");
if (Mt == "0" && T.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))
return xt("number", "number");
if (/\d/.test(Mt))
return T.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/), xt("number", "number");
if (Mt == "/")
return T.eat("*") ? (G.tokenize = Ft, Ft(T, G)) : T.eat("/") ? (T.skipToEnd(), xt("comment", "comment")) : Bt(T, G, 1) ? (ee(T), T.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/), xt("regexp", "string-2")) : (T.eat("="), xt("operator", "operator", T.current()));
if (Mt == "`")
return G.tokenize = Ht, Ht(T, G);
if (Mt == "#" && T.peek() == "!")
return T.skipToEnd(), xt("meta", "meta");
if (Mt == "#" && T.eatWhile(it))
return xt("variable", "property");
if (Mt == "<" && T.match("!--") || Mt == "-" && T.match("->") && !/\S/.test(T.string.slice(0, T.start)))
return T.skipToEnd(), xt("comment", "comment");
if (jt.test(Mt))
return Mt == ">" && G.lexical && G.lexical.type == ">" || (T.eat("=") ? Mt != "!" && Mt != "=" || T.eat("=") : /[<>*+\-|&?]/.test(Mt) && (T.eat(Mt), Mt == ">" && T.eat(Mt))), Mt == "?" && T.eat(".") ? xt(".") : xt("operator", "operator", T.current());
if (it.test(Mt)) {
T.eatWhile(it);
var te = T.current();
if (G.lastType != ".") {
if (Et.propertyIsEnumerable(te)) {
var de = Et[te];
return xt(de.type, de.style, te);
}
if (te == "async" && T.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, !1))
return xt("async", "keyword", te);
}
return xt("variable", "variable", te);
}
}
function Wt(T) {
return function(G, Mt) {
var te, de = !1;
if (E && G.peek() == "@" && G.match(Dt))
return Mt.tokenize = bt, xt("jsonld-keyword", "meta");
for (; (te = G.next()) != null && (te != T || de); )
de = !de && te == "\\";
return de || (Mt.tokenize = bt), xt("string", "string");
};
}
function Ft(T, G) {
for (var Mt, te = !1; Mt = T.next(); ) {
if (Mt == "/" && te) {
G.tokenize = bt;
break;
}
te = Mt == "*";
}
return xt("comment", "comment");
}
function Ht(T, G) {
for (var Mt, te = !1; (Mt = T.next()) != null; ) {
if (!te && (Mt == "`" || Mt == "$" && T.eat("{"))) {
G.tokenize = bt;
break;
}
te = !te && Mt == "\\";
}
return xt("quasi", "string-2", T.current());
}
var Q = "([{}])";
function j(T, G) {
G.fatArrowAt && (G.fatArrowAt = null);
var Mt = T.string.indexOf("=>", T.start);
if (!(Mt < 0)) {
if (ot) {
var te = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(T.string.slice(T.start, Mt));
te && (Mt = te.index);
}
for (var de = 0, $e = !1, oe = Mt - 1; oe >= 0; --oe) {
var Hn = T.string.charAt(oe), Tn = Q.indexOf(Hn);
if (Tn >= 0 && Tn < 3) {
if (!de) {
++oe;
break;
}
if (--de == 0) {
Hn == "(" && ($e = !0);
break;
}
} else if (Tn >= 3 && Tn < 6)
++de;
else if (it.test(Hn))
$e = !0;
else if (/["'\/`]/.test(Hn))
for (; ; --oe) {
if (oe == 0)
return;
if (T.string.charAt(oe - 1) == Hn && T.string.charAt(oe - 2) != "\\") {
oe--;
break;
}
}
else if ($e && !de) {
++oe;
break;
}
}
$e && !de && (G.fatArrowAt = oe);
}
}
var V = { atom: !0, number: !0, variable: !0, string: !0, regexp: !0, this: !0, import: !0, "jsonld-keyword": !0 };
function Y(T, G, Mt, te, de, $e) {
this.indented = T, this.column = G, this.type = Mt, this.prev = de, this.info = $e, te != null && (this.align = te);
}
function nt(T, G) {
if (!D)
return !1;
for (var Mt = T.localVars; Mt; Mt = Mt.next)
if (Mt.name == G)
return !0;
for (var te = T.context; te; te = te.prev)
for (Mt = te.vars; Mt; Mt = Mt.next)
if (Mt.name == G)
return !0;
}
function wt(T, G, Mt, te, de) {
var $e = T.cc;
for (rt.state = T, rt.stream = de, rt.marked = null, rt.cc = $e, rt.style = G, T.lexical.hasOwnProperty("align") || (T.lexical.align = !0); ; )
if (($e.length ? $e.pop() : M ? qt : st)(Mt, te)) {
for (; $e.length && $e[$e.length - 1].lex; )
$e.pop()();
return rt.marked ? rt.marked : Mt == "variable" && nt(T, te) ? "variable-2" : G;
}
}
var rt = { state: null, column: null, marked: null, cc: null };
function gt() {
for (var T = arguments.length - 1; T >= 0; T--)
rt.cc.push(arguments[T]);
}
function N() {
return gt.apply(null, arguments), !0;
}
function Lt(T, G) {
for (var Mt = G; Mt; Mt = Mt.next)
if (Mt.name == T)
return !0;
return !1;
}
function Tt(T) {
var G = rt.state;
if (rt.marked = "def", D) {
if (G.context) {
if (G.lexical.info == "var" && G.context && G.context.block) {
var Mt = Qt(T, G.context);
if (Mt != null)
return void (G.context = Mt);
} else if (!Lt(T, G.localVars))
return void (G.localVars = new _e(T, G.localVars));
}
J.globalVars && !Lt(T, G.globalVars) && (G.globalVars = new _e(T, G.globalVars));
}
}
function Qt(T, G) {
if (G) {
if (G.block) {
var Mt = Qt(T, G.prev);
return Mt ? Mt == G.prev ? G : new Se(Mt, G.vars, !0) : null;
}
return Lt(T, G.vars) ? G : new Se(G.prev, new _e(T, G.vars), !1);
}
return null;
}
function Oe(T) {
return T == "public" || T == "private" || T == "protected" || T == "abstract" || T == "readonly";
}
function Se(T, G, Mt) {
this.prev = T, this.vars = G, this.block = Mt;
}
function _e(T, G) {
this.name = T, this.next = G;
}
var De = new _e("this", new _e("arguments", null));
function xe() {
rt.state.context = new Se(rt.state.context, rt.state.localVars, !1), rt.state.localVars = De;
}
function Te() {
rt.state.context = new Se(rt.state.context, rt.state.localVars, !0), rt.state.localVars = null;
}
function be() {
rt.state.localVars = rt.state.context.vars, rt.state.context = rt.state.context.prev;
}
function ge(T, G) {
var Mt = function() {
var te = rt.state, de = te.indented;
if (te.lexical.type == "stat")
de = te.lexical.indented;
else
for (var $e = te.lexical; $e && $e.type == ")" && $e.align; $e = $e.prev)
de = $e.indented;
te.lexical = new Y(de, rt.stream.column(), T, null, te.lexical, G);
};
return Mt.lex = !0, Mt;
}
function pe() {
var T = rt.state;
T.lexical.prev && (T.lexical.type == ")" && (T.indented = T.lexical.indented), T.lexical = T.lexical.prev);
}
function ce(T) {
function G(Mt) {
return Mt == T ? N() : T == ";" || Mt == "}" || Mt == ")" || Mt == "]" ? gt() : N(G);
}
return G;
}
function st(T, G) {
return T == "var" ? N(ge("vardef", G), fn, ce(";"), pe) : T == "keyword a" ? N(ge("form"), ae, st, pe) : T == "keyword b" ? N(ge("form"), st, pe) : T == "keyword d" ? rt.stream.match(/^\s*$/, !1) ? N() : N(ge("stat"), Ae, ce(";"), pe) : T == "debugger" ? N(ce(";")) : T == "{" ? N(ge("}"), Te, Qe, pe, be) : T == ";" ? N() : T == "if" ? (rt.state.lexical.info == "else" && rt.state.cc[rt.state.cc.length - 1] == pe && rt.state.cc.pop()(), N(ge("form"), ae, st, pe, Vo)) : T == "function" ? N(ur) : T == "for" ? N(ge("form"), Te, xo, st, be, pe) : T == "class" || ot && G == "interface" ? (rt.marked = "keyword", N(ge("form", T == "class" ? T : G), Jr, pe)) : T == "variable" ? ot && G == "declare" ? (rt.marked = "keyword", N(st)) : ot && (G == "module" || G == "enum" || G == "type") && rt.stream.match(/^\s*\w/, !1) ? (rt.marked = "keyword", G == "enum" ? N(In) : G == "type" ? N(Ho, ce("operator"), yt, ce(";")) : N(ge("form"), _n, ce("{"), ge("}"), Qe, pe, pe)) : ot && G == "namespace" ? (rt.marked = "keyword", N(ge("form"), qt, st, pe)) : ot && G == "abstract" ? (rt.marked = "keyword", N(st)) : N(ge("stat"), ht) : T == "switch" ? N(ge("form"), ae, ce("{"), ge("}", "switch"), Te, Qe, pe, pe, be) : T == "case" ? N(qt, ce(":")) : T == "default" ? N(ce(":")) : T == "catch" ? N(ge("form"), xe, Xt, st, pe, be) : T == "export" ? N(ge("stat"), zo, pe) : T == "import" ? N(ge("stat"), qe, pe) : T == "async" ? N(st) : G == "@" ? N(qt, st) : gt(ge("stat"), qt, ce(";"), pe);
}
function Xt(T) {
if (T == "(")
return N(Lr, ce(")"));
}
function qt(T, G) {
return Zt(T, G, !1);
}
function ne(T, G) {
return Zt(T, G, !0);
}
function ae(T) {
return T != "(" ? gt() : N(ge(")"), Ae, ce(")"), pe);
}
function Zt(T, G, Mt) {
if (rt.state.fatArrowAt == rt.stream.start) {
var te = Mt ? zt : mt;
if (T == "(")
return N(xe, ge(")"), Ve(Lr, ")"), pe, ce("=>"), te, be);
if (T == "variable")
return gt(xe, _n, ce("=>"), te, be);
}
var de = Mt ? Xe : Ke;
return V.hasOwnProperty(T) ? N(de) : T == "function" ? N(ur, de) : T == "class" || ot && G == "interface" ? (rt.marked = "keyword", N(ge("form"), Co, pe)) : T == "keyword c" || T == "async" ? N(Mt ? ne : qt) : T == "(" ? N(ge(")"), Ae, ce(")"), pe, de) : T == "operator" || T == "spread" ? N(Mt ? ne : qt) : T == "[" ? N(ge("]"), Ye, pe, de) : T == "{" ? ze(Ot, "}", null, de) : T == "quasi" ? gt(vn, de) : T == "new" ? N(b(Mt)) : N();
}
function Ae(T) {
return T.match(/[;\}\)\],]/) ? gt() : gt(qt);
}
function Ke(T, G) {
return T == "," ? N(Ae) : Xe(T, G, !1);
}
function Xe(T, G, Mt) {
var te = Mt == 0 ? Ke : Xe, de = Mt == 0 ? qt : ne;
return T == "=>" ? N(xe, Mt ? zt : mt, be) : T == "operator" ? /\+\+|--/.test(G) || ot && G == "!" ? N(te) : ot && G == "<" && rt.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, !1) ? N(ge(">"), Ve(yt, ">"), pe, te) : G == "?" ? N(qt, ce(":"), de) : N(de) : T == "quasi" ? gt(vn, te) : T != ";" ? T == "(" ? ze(ne, ")", "call", te) : T == "." ? N(kt, te) : T == "[" ? N(ge("]"), Ae, ce("]"), pe, te) : ot && G == "as" ? (rt.marked = "keyword", N(yt, te)) : T == "regexp" ? (rt.state.lastType = rt.marked = "operator", rt.stream.backUp(rt.stream.pos - rt.stream.start - 1), N(de)) : void 0 : void 0;
}
function vn(T, G) {
return T != "quasi" ? gt() : G.slice(G.length - 2) != "${" ? N(vn) : N(Ae, Rn);
}
function Rn(T) {
if (T == "}")
return rt.marked = "string-2", rt.state.tokenize = Ht, N(vn);
}
function mt(T) {
return j(rt.stream, rt.state), gt(T == "{" ? st : qt);
}
function zt(T) {
return j(rt.stream, rt.state), gt(T == "{" ? st : ne);
}
function b(T) {
return function(G) {
return G == "." ? N(T ? U : I) : G == "variable" && ot ? N(Ar, T ? Xe : Ke) : gt(T ? ne : qt);
};
}
function I(T, G) {
if (G == "target")
return rt.marked = "keyword", N(Ke);
}
function U(T, G) {
if (G == "target")
return rt.marked = "keyword", N(Xe);
}
function ht(T) {
return T == ":" ? N(pe, st) : gt(Ke, ce(";"), pe);
}
function kt(T) {
if (T == "variable")
return rt.marked = "property", N();
}
function Ot(T, G) {
return T == "async" ? (rt.marked = "property", N(Ot)) : T == "variable" || rt.style == "keyword" ? (rt.marked = "property", G == "get" || G == "set" ? N(fe) : (ot && rt.state.fatArrowAt == rt.stream.start && (Mt = rt.stream.match(/^\s*:\s*/, !1)) && (rt.state.fatArrowAt = rt.stream.pos + Mt[0].length), N(ke))) : T == "number" || T == "string" ? (rt.marked = E ? "property" : rt.style + " property", N(ke)) : T == "jsonld-keyword" ? N(ke) : ot && Oe(G) ? (rt.marked = "keyword", N(Ot)) : T == "[" ? N(qt, Kt, ce("]"), ke) : T == "spread" ? N(ne, ke) : G == "*" ? (rt.marked = "keyword", N(Ot)) : T == ":" ? gt(ke) : void 0;
var Mt;
}
function fe(T) {
return T != "variable" ? gt(ke) : (rt.marked = "property", N(ur));
}
function ke(T) {
return T == ":" ? N(ne) : T == "(" ? gt(ur) : void 0;
}
function Ve(T, G, Mt) {
function te(de, $e) {
if (Mt ? Mt.indexOf(de) > -1 : de == ",") {
var oe = rt.state.lexical;
return oe.info == "call" && (oe.pos = (oe.pos || 0) + 1), N(function(Hn, Tn) {
return Hn == G || Tn == G ? gt() : gt(T);
}, te);
}
return de == G || $e == G ? N() : Mt && Mt.indexOf(";") > -1 ? gt(T) : N(ce(G));
}
return function(de, $e) {
return de == G || $e == G ? N() : gt(T, te);
};
}
function ze(T, G, Mt) {
for (var te = 3; te < arguments.length; te++)
rt.cc.push(arguments[te]);
return N(ge(G, Mt), Ve(T, G), pe);
}
function Qe(T) {
return T == "}" ? N() : gt(st, Qe);
}
function Kt(T, G) {
if (ot) {
if (T == ":")
return N(yt);
if (G == "?")
return N(Kt);
}
}
function R(T, G) {
if (ot && (T == ":" || G == "in"))
return N(yt);
}
function tt(T) {
if (ot && T == ":")
return rt.stream.match(/^\s*\w+\s+is\b/, !1) ? N(qt, ut, yt) : N(yt);
}
function ut(T, G) {
if (G == "is")
return rt.marked = "keyword", N();
}
function yt(T, G) {
return G == "keyof" || G == "typeof" || G == "infer" || G == "readonly" ? (rt.marked = "keyword", N(G == "typeof" ? ne : yt)) : T == "variable" || G == "void" ? (rt.marked = "type", N(Ne)) : G == "|" || G == "&" ? N(yt) : T == "string" || T == "number" || T == "atom" ? N(Ne) : T == "[" ? N(ge("]"), Ve(yt, "]", ","), pe, Ne) : T == "{" ? N(ge("}"), he, pe, Ne) : T == "(" ? N(Ve(pn, ")"), Yt, Ne) : T == "<" ? N(Ve(yt, ">"), yt) : T == "quasi" ? gt(We, Ne) : void 0;
}
function Yt(T) {
if (T == "=>")
return N(yt);
}
function he(T) {
return T.match(/[\}\)\]]/) ? N() : T == "," || T == ";" ? N(he) : gt(Re, he);
}
function Re(T, G) {
return T == "variable" || rt.style == "keyword" ? (rt.marked = "property", N(Re)) : G == "?" || T == "number" || T == "string" ? N(Re) : T == ":" ? N(yt) : T == "[" ? N(ce("variable"), R, ce("]"), Re) : T == "(" ? gt(ln, Re) : T.match(/[;\}\)\],]/) ? void 0 : N();
}
function We(T, G) {
return T != "quasi" ? gt() : G.slice(G.length - 2) != "${" ? N(We) : N(yt, Ln);
}
function Ln(T) {
if (T == "}")
return rt.marked = "string-2", rt.state.tokenize = Ht, N(We);
}
function pn(T, G) {
return T == "variable" && rt.stream.match(/^\s*[?:]/, !1) || G == "?" ? N(pn) : T == ":" ? N(yt) : T == "spread" ? N(pn) : gt(yt);
}
function Ne(T, G) {
return G == "<" ? N(ge(">"), Ve(yt, ">"), pe, Ne) : G == "|" || T == "." || G == "&" ? N(yt) : T == "[" ? N(yt, ce("]"), Ne) : G == "extends" || G == "implements" ? (rt.marked = "keyword", N(yt)) : G == "?" ? N(yt, ce(":"), yt) : void 0;
}
function Ar(T, G) {
if (G == "<")
return N(ge(">"), Ve(yt, ">"), pe, Ne);
}
function Yn() {
return gt(yt, jr);
}
function jr(T, G) {
if (G == "=")
return N(yt);
}
function fn(T, G) {
return G == "enum" ? (rt.marked = "keyword", N(In)) : gt(_n, Kt, Dn, _o);
}
function _n(T, G) {
return ot && Oe(G) ? (rt.marked = "keyword", N(_n)) : T == "variable" ? (Tt(G), N()) : T == "spread" ? N(_n) : T == "[" ? ze(Mr, "]") : T == "{" ? ze(Bn, "}") : void 0;
}
function Bn(T, G) {
return T != "variable" || rt.stream.match(/^\s*:/, !1) ? (T == "variable" && (rt.marked = "property"), T == "spread" ? N(_n) : T == "}" ? gt() : T == "[" ? N(qt, ce("]"), ce(":"), Bn) : N(ce(":"), _n, Dn)) : (Tt(G), N(Dn));
}
function Mr() {
return gt(_n, Dn);
}
function Dn(T, G) {
if (G == "=")
return N(ne);
}
function _o(T) {
if (T == ",")
return N(fn);
}
function Vo(T, G) {
if (T == "keyword b" && G == "else")
return N(ge("form", "else"), st, pe);
}
function xo(T, G) {
return G == "await" ? N(xo) : T == "(" ? N(ge(")"), Ro, pe) : void 0;
}
function Ro(T) {
return T == "var" ? N(fn, ro) : T == "variable" ? N(ro) : gt(ro);
}
function ro(T, G) {
return T == ")" ? N() : T == ";" ? N(ro) : G == "in" || G == "of" ? (rt.marked = "keyword", N(qt, ro)) : gt(qt, ro);
}
function ur(T, G) {
return G == "*" ? (rt.marked = "keyword", N(ur)) : T == "variable" ? (Tt(G), N(ur)) : T == "(" ? N(xe, ge(")"), Ve(Lr, ")"), pe, tt, st, be) : ot && G == "<" ? N(ge(">"), Ve(Yn, ">"), pe, ur) : void 0;
}
function ln(T, G) {
return G == "*" ? (rt.marked = "keyword", N(ln)) : T == "variable" ? (Tt(G), N(ln)) : T == "(" ? N(xe, ge(")"), Ve(Lr, ")"), pe, tt, be) : ot && G == "<" ? N(ge(">"), Ve(Yn, ">"), pe, ln) : void 0;
}
function Ho(T, G) {
return T == "keyword" || T == "variable" ? (rt.marked = "type", N(Ho)) : G == "<" ? N(ge(">"), Ve(Yn, ">"), pe) : void 0;
}
function Lr(T, G) {
return G == "@" && N(qt, Lr), T == "spread" ? N(Lr) : ot && Oe(G) ? (rt.marked = "keyword", N(Lr)) : ot && T == "this" ? N(Kt, Dn) : gt(_n, Kt, Dn);
}
function Co(T, G) {
return T == "variable" ? Jr(T, G) : Wn(T, G);
}
function Jr(T, G) {
if (T == "variable")
return Tt(G), N(Wn);
}
function Wn(T, G) {
return G == "<" ? N(ge(">"), Ve(Yn, ">"), pe, Wn) : G == "extends" || G == "implements" || ot && T == "," ? (G == "implements" && (rt.marked = "keyword"), N(ot ? yt : qt, Wn)) : T == "{" ? N(ge("}"), Nn, pe) : void 0;
}
function Nn(T, G) {
return T == "async" || T == "variable" && (G == "static" || G == "get" || G == "set" || ot && Oe(G)) && rt.stream.match(/^\s+[\w$\xa1-\uffff]/, !1) ? (rt.marked = "keyword", N(Nn)) : T == "variable" || rt.style == "keyword" ? (rt.marked = "property", N($n, Nn)) : T == "number" || T == "string" ? N($n, Nn) : T == "[" ? N(qt, Kt, ce("]"), $n, Nn) : G == "*" ? (rt.marked = "keyword", N(Nn)) : ot && T == "(" ? gt(ln, Nn) : T == ";" || T == "," ? N(Nn) : T == "}" ? N() : G == "@" ? N(qt, Nn) : void 0;
}
function $n(T, G) {
if (G == "!" || G == "?")
return N($n);
if (T == ":")
return N(yt, Dn);
if (G == "=")
return N(ne);
var Mt = rt.state.lexical.prev;
return gt(Mt && Mt.info == "interface" ? ln : ur);
}
function zo(T, G) {
return G == "*" ? (rt.marked = "keyword", N(or, ce(";"))) : G == "default" ? (rt.marked = "keyword", N(qt, ce(";"))) : T == "{" ? N(Ve(mo, "}"), or, ce(";")) : gt(st);
}
function mo(T, G) {
return G == "as" ? (rt.marked = "keyword", N(ce("variable"))) : T == "variable" ? gt(ne, mo) : void 0;
}
function qe(T) {
return T == "string" ? N() : T == "(" ? gt(qt) : T == "." ? gt(Ke) : gt(ve, rr, or);
}
function ve(T, G) {
return T == "{" ? ze(ve, "}") : (T == "variable" && Tt(G), G == "*" && (rt.marked = "keyword"), N(Uo));
}
function rr(T) {
if (T == ",")
return N(ve, rr);
}
function Uo(T, G) {
if (G == "as")
return rt.marked = "keyword", N(ve);
}
function or(T, G) {
if (G == "from")
return rt.marked = "keyword", N(qt);
}
function Ye(T) {
return T == "]" ? N() : gt(Ve(ne, "]"));
}
function In() {
return gt(ge("form"), _n, ce("{"), ge("}"), Ve(yo, "}"), pe, pe);
}
function yo() {
return gt(_n, Dn);
}
function Bo(T, G) {
return T.lastType == "operator" || T.lastType == "," || jt.test(G.charAt(0)) || /[,.]/.test(G.charAt(0));
}
function Bt(T, G, Mt) {
return G.tokenize == bt && /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(G.lastType) || G.lastType == "quasi" && /\{\s*$/.test(T.string.slice(0, T.pos - (Mt || 0)));
}
return xe.lex = Te.lex = !0, be.lex = !0, pe.lex = !0, { startState: function(T) {
var G = { tokenize: bt, lastType: "sof", cc: [], lexical: new Y((T || 0) - k, 0, "block", !1), localVars: J.localVars, context: J.localVars && new Se(null, null, !1), indented: T || 0 };
return J.globalVars && typeof J.globalVars == "object" && (G.globalVars = J.globalVars), G;
}, token: function(T, G) {
if (T.sol() && (G.lexical.hasOwnProperty("align") || (G.lexical.align = !1), G.indented = T.indentation(), j(T, G)), G.tokenize != Ft && T.eatSpace())
return null;
var Mt = G.tokenize(T, G);
return W == "comment" ? Mt : (G.lastType = W != "operator" || z != "++" && z != "--" ? W : "incdec", wt(G, Mt, W, z, T));
}, indent: function(T, G) {
if (T.tokenize == Ft || T.tokenize == Ht)
return at.Pass;
if (T.tokenize != bt)
return 0;
var Mt, te = G && G.charAt(0), de = T.lexical;
if (!/^\s*else\b/.test(G))
for (var $e = T.cc.length - 1; $e >= 0; --$e) {
var oe = T.cc[$e];
if (oe == pe)
de = de.prev;
else if (oe != Vo && oe != be)
break;
}
for (; (de.type == "stat" || de.type == "form") && (te == "}" || (Mt = T.cc[T.cc.length - 1]) && (Mt == Ke || Mt == Xe) && !/^[,\.=+\-*:?[\(]/.test(G)); )
de = de.prev;
P && de.type == ")" && de.prev.type == "stat" && (de = de.prev);
var Hn = de.type, Tn = te == Hn;
return Hn == "vardef" ? de.indented + (T.lastType == "operator" || T.lastType == "," ? de.info.length + 1 : 0) : Hn == "form" && te == "{" ? de.indented : Hn == "form" ? de.indented + k : Hn == "stat" ? de.indented + (Bo(T, G) ? P || k : 0) : de.info != "switch" || Tn || J.doubleIndentSwitch == 0 ? de.align ? de.column + (Tn ? 0 : 1) : de.indented + (Tn ? 0 : k) : de.indented + (/^(?:case|default)\b/.test(G) ? k : 2 * k);
}, electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, blockCommentStart: M ? null : "/*", blockCommentEnd: M ? null : "*/", blockCommentContinue: M ? null : " * ", lineComment: M ? null : "//", fold: "brace", closeBrackets: "()[]{}''\"\"``", helperType: M ? "json" : "javascript", jsonldMode: E, jsonMode: M, expressionAllowed: Bt, skipExpression: function(T) {
wt(T, "atom", "atom", "true", new at.StringStream("", 2, null));
} };
}), at.registerHelper("wordChars", "javascript", /[\w$]/), at.defineMIME("text/javascript", "javascript"), at.defineMIME("text/ecmascript", "javascript"), at.defineMIME("application/javascript", "javascript"), at.defineMIME("application/x-javascript", "javascript"), at.defineMIME("application/ecmascript", "javascript"), at.defineMIME("application/json", { name: "javascript", json: !0 }), at.defineMIME("application/x-json", { name: "javascript", json: !0 }), at.defineMIME("application/manifest+json", { name: "javascript", json: !0 }), at.defineMIME("application/ld+json", { name: "javascript", jsonld: !0 }), at.defineMIME("text/typescript", { name: "javascript", typescript: !0 }), at.defineMIME("application/typescript", { name: "javascript", typescript: !0 });
})(pt(631));
}, 589: (S, H, pt) => {
(function(at) {
var _t = { autoSelfClosers: { area: !0, base: !0, br: !0, col: !0, command: !0, embed: !0, frame: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0, menuitem: !0 }, implicitlyClosed: { dd: !0, li: !0, optgroup: !0, option: !0, p: !0, rp: !0, rt: !0, tbody: !0, td: !0, tfoot: !0, th: !0, tr: !0 }, contextGrabbers: { dd: { dd: !0, dt: !0 }, dt: { dd: !0, dt: !0 }, li: { li: !0 }, option: { option: !0, optgroup: !0 }, optgroup: { optgroup: !0 }, p: { address: !0, article: !0, aside: !0, blockquote: !0, dir: !0, div: !0, dl: !0, fieldset: !0, footer: !0, form: !0, h1: !0, h2: !0, h3: !0, h4: !0, h5: !0, h6: !0, header: !0, hgroup: !0, hr: !0, menu: !0, nav: !0, ol: !0, p: !0, pre: !0, section: !0, table: !0, ul: !0 }, rp: { rp: !0, rt: !0 }, rt: { rp: !0, rt: !0 }, tbody: { tbody: !0, tfoot: !0 }, td: { td: !0, th: !0 }, tfoot: { tbody: !0 }, th: { td: !0, th: !0 }, thead: { tbody: !0, tfoot: !0 }, tr: { tr: !0 } }, doNotIndent: { pre: !0 }, allowUnquoted: !0, allowMissing: !0, caseFold: !0 }, J = { autoSelfClosers: {}, implicitlyClosed: {}, contextGrabbers: {}, doNotIndent: {}, allowUnquoted: !1, allowMissing: !1, allowMissingTagName: !1, caseFold: !1 };
at.defineMode("xml", function(W, z) {
var k, P, E = W.indentUnit, M = {}, D = z.htmlMode ? _t : J;
for (var ot in D)
M[ot] = D[ot];
for (var ot in z)
M[ot] = z[ot];
function it(N, Lt) {
function Tt(Oe) {
return Lt.tokenize = Oe, Oe(N, Lt);
}
var Qt = N.next();
return Qt == "<" ? N.eat("!") ? N.eat("[") ? N.match("CDATA[") ? Tt(Dt("atom", "]]>")) : null : N.match("--") ? Tt(Dt("comment", "-->")) : N.match("DOCTYPE", !0, !0) ? (N.eatWhile(/[\w\._\-]/), Tt(ee(1))) : null : N.eat("?") ? (N.eatWhile(/[\w\._\-]/), Lt.tokenize = Dt("meta", "?>"), "meta") : (k = N.eat("/") ? "closeTag" : "openTag", Lt.tokenize = Et, "tag bracket") : Qt == "&" ? (N.eat("#") ? N.eat("x") ? N.eatWhile(/[a-fA-F\d]/) && N.eat(";") : N.eatWhile(/[\d]/) && N.eat(";") : N.eatWhile(/[\w\.\-:]/) && N.eat(";")) ? "atom" : "error" : (N.eatWhile(/[^&<]/), null);
}
function Et(N, Lt) {
var Tt = N.next();
if (Tt == ">" || Tt == "/" && N.eat(">"))
return Lt.tokenize = it, k = Tt == ">" ? "endTag" : "selfcloseTag", "tag bracket";
if (Tt == "=")
return k = "equals", null;
if (Tt == "<") {
Lt.tokenize = it, Lt.state = Ht, Lt.tagName = Lt.tagStart = null;
var Qt = Lt.tokenize(N, Lt);
return Qt ? Qt + " tag error" : "tag error";
}
return /[\'\"]/.test(Tt) ? (Lt.tokenize = jt(Tt), Lt.stringStartCol = N.column(), Lt.tokenize(N, Lt)) : (N.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/), "word");
}
function jt(N) {
var Lt = function(Tt, Qt) {
for (; !Tt.eol(); )
if (Tt.next() == N) {
Qt.tokenize = Et;
break;
}
return "string";
};
return Lt.isInAttribute = !0, Lt;
}
function Dt(N, Lt) {
return function(Tt, Qt) {
for (; !Tt.eol(); ) {
if (Tt.match(Lt)) {
Qt.tokenize = it;
break;
}
Tt.next();
}
return N;
};
}
function ee(N) {
return function(Lt, Tt) {
for (var Qt; (Qt = Lt.next()) != null; ) {
if (Qt == "<")
return Tt.tokenize = ee(N + 1), Tt.tokenize(Lt, Tt);
if (Qt == ">") {
if (N == 1) {
Tt.tokenize = it;
break;
}
return Tt.tokenize = ee(N - 1), Tt.tokenize(Lt, Tt);
}
}
return "meta";
};
}
function xt(N) {
return N && N.toLowerCase();
}
function bt(N, Lt, Tt) {
this.prev = N.context, this.tagName = Lt || "", this.indent = N.indented, this.startOfLine = Tt, (M.doNotIndent.hasOwnProperty(Lt) || N.context && N.context.noIndent) && (this.noIndent = !0);
}
function Wt(N) {
N.context && (N.context = N.context.prev);
}
function Ft(N, Lt) {
for (var Tt; ; ) {
if (!N.context || (Tt = N.context.tagName, !M.contextGrabbers.hasOwnProperty(xt(Tt)) || !M.contextGrabbers[xt(Tt)].hasOwnProperty(xt(Lt))))
return;
Wt(N);
}
}
function Ht(N, Lt, Tt) {
return N == "openTag" ? (Tt.tagStart = Lt.column(), Q) : N == "closeTag" ? j : Ht;
}
function Q(N, Lt, Tt) {
return N == "word" ? (Tt.tagName = Lt.current(), P = "tag", nt) : M.allowMissingTagName && N == "endTag" ? (P = "tag bracket", nt(N, Lt, Tt)) : (P = "error", Q);
}
function j(N, Lt, Tt) {
if (N == "word") {
var Qt = Lt.current();
return Tt.context && Tt.context.tagName != Qt && M.implicitlyClosed.hasOwnProperty(xt(Tt.context.tagName)) && Wt(Tt), Tt.context && Tt.context.tagName == Qt || M.matchClosing === !1 ? (P = "tag", V) : (P = "tag error", Y);
}
return M.allowMissingTagName && N == "endTag" ? (P = "tag bracket", V(N, Lt, Tt)) : (P = "error", Y);
}
function V(N, Lt, Tt) {
return N != "endTag" ? (P = "error", V) : (Wt(Tt), Ht);
}
function Y(N, Lt, Tt) {
return P = "error", V(N, Lt, Tt);
}
function nt(N, Lt, Tt) {
if (N == "word")
return P = "attribute", wt;
if (N == "endTag" || N == "selfcloseTag") {
var Qt = Tt.tagName, Oe = Tt.tagStart;
return Tt.tagName = Tt.tagStart = null, N == "selfcloseTag" || M.autoSelfClosers.hasOwnProperty(xt(Qt)) ? Ft(Tt, Qt) : (Ft(Tt, Qt), Tt.context = new bt(Tt, Qt, Oe == Tt.indented)), Ht;
}
return P = "error", nt;
}
function wt(N, Lt, Tt) {
return N == "equals" ? rt : (M.allowMissing || (P = "error"), nt(N, Lt, Tt));
}
function rt(N, Lt, Tt) {
return N == "string" ? gt : N == "word" && M.allowUnquoted ? (P = "string", nt) : (P = "error", nt(N, Lt, Tt));
}
function gt(N, Lt, Tt) {
return N == "string" ? gt : nt(N, Lt, Tt);
}
return it.isInText = !0, { startState: function(N) {
var Lt = { tokenize: it, state: Ht, indented: N || 0, tagName: null, tagStart: null, context: null };
return N != null && (Lt.baseIndent = N), Lt;
}, token: function(N, Lt) {
if (!Lt.tagName && N.sol() && (Lt.indented = N.indentation()), N.eatSpace())
return null;
k = null;
var Tt = Lt.tokenize(N, Lt);
return (Tt || k) && Tt != "comment" && (P = null, Lt.state = Lt.state(k || Tt, N, Lt), P && (Tt = P == "error" ? Tt + " error" : P)), Tt;
}, indent: function(N, Lt, Tt) {
var Qt = N.context;
if (N.tokenize.isInAttribute)
return N.tagStart == N.indented ? N.stringStartCol + 1 : N.indented + E;
if (Qt && Qt.noIndent)
return at.Pass;
if (N.tokenize != Et && N.tokenize != it)
return Tt ? Tt.match(/^(\s*)/)[0].length : 0;
if (N.tagName)
return M.multilineTagIndentPastTag !== !1 ? N.tagStart + N.tagName.length + 2 : N.tagStart + E * (M.multilineTagIndentFactor || 1);
if (M.alignCDATA && /$/, blockCommentStart: "", configuration: M.htmlMode ? "html" : "xml", helperType: M.htmlMode ? "html" : "xml", skipAttribute: function(N) {
N.state == rt && (N.state = nt);
}, xmlCurrentTag: function(N) {
return N.tagName ? { name: N.tagName, close: N.type == "closeTag" } : null;
}, xmlCurrentContext: function(N) {
for (var Lt = [], Tt = N.context; Tt; Tt = Tt.prev)
Lt.push(Tt.tagName);
return Lt.reverse();
} };
}), at.defineMIME("text/xml", "xml"), at.defineMIME("application/xml", "xml"), at.mimeModes.hasOwnProperty("text/html") || at.defineMIME("text/html", { name: "xml", htmlMode: !0 });
})(pt(631));
}, 858: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => at });
const at = { run: function(_t) {
_t.DomComponents.clear(), _t.CssComposer.clear();
} };
}, 884: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => W });
var at = pt(50), _t = pt(163), J = pt(668);
const W = { run: function(z) {
(0, at.bindAll)(this, "onKeyUp", "enableDragger", "disableDragger"), this.editor = z, this.canvasModel = this.canvas.getCanvasView().model, this.toggleMove(1);
}, stop: function(z) {
this.toggleMove(), this.disableDragger();
}, onKeyUp: function(z) {
(0, _t.getKeyChar)(z) === " " && this.editor.stopCommand(this.id);
}, enableDragger: function(z) {
this.toggleDragger(1, z);
}, disableDragger: function(z) {
this.toggleDragger(0, z);
}, toggleDragger: function(z, k) {
var P = this.canvasModel, E = this.em, M = this.dragger, D = z ? "add" : "remove";
this.getCanvas().classList[D]("".concat(this.ppfx, "is__grabbing")), M || (M = new J.Z({ getPosition: function() {
return { x: P.get("x"), y: P.get("y") };
}, setPosition: function(ot) {
var it = ot.x, Et = ot.y;
P.set({ x: it, y: Et });
}, onStart: function(ot, it) {
E.trigger("canvas:move:start", it);
}, onDrag: function(ot, it) {
E.trigger("canvas:move", it);
}, onEnd: function(ot, it) {
E.trigger("canvas:move:end", it);
} }), this.dragger = M), z ? M.start(k) : M.stop();
}, toggleMove: function(z) {
var k = this.ppfx, P = z ? "add" : "remove", E = z ? "on" : "off", M = { on: _t.on, off: _t.off }, D = this.getCanvas(), ot = ["".concat(k, "is__grab")];
!z && ot.push("".concat(k, "is__grabbing")), ot.forEach(function(it) {
return D.classList[P](it);
}), M[E](document, "keyup", this.onKeyUp), M[E](D, "mousedown", this.enableDragger), M[E](document, "mouseup", this.disableDragger);
} };
}, 790: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => z, defineCommand: () => W });
var at, _t = pt(346), J = (at = function(k, P) {
return at = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(E, M) {
E.__proto__ = M;
} || function(E, M) {
for (var D in M)
Object.prototype.hasOwnProperty.call(M, D) && (E[D] = M[D]);
}, at(k, P);
}, function(k, P) {
if (typeof P != "function" && P !== null)
throw new TypeError("Class extends value " + String(P) + " is not a constructor or null");
function E() {
this.constructor = k;
}
at(k, P), k.prototype = P === null ? Object.create(P) : (E.prototype = P.prototype, new E());
});
function W(k) {
return k;
}
const z = function(k) {
function P(E) {
var M = k.call(this, 0) || this;
M.config = E || {}, M.em = M.config.em || {};
var D = M.config.stylePrefix;
return M.pfx = D, M.ppfx = M.config.pStylePrefix, M.hoverClass = "".concat(D, "hover"), M.badgeClass = "".concat(D, "badge"), M.plhClass = "".concat(D, "placeholder"), M.freezClass = "".concat(M.ppfx, "freezed"), M.canvas = M.em.Canvas, M.init(M.config), M;
}
return J(P, k), P.prototype.onFrameScroll = function(E) {
}, P.prototype.getCanvas = function() {
return this.canvas.getElement();
}, P.prototype.getCanvasBody = function() {
return this.canvas.getBody();
}, P.prototype.getCanvasTools = function() {
return this.canvas.getToolsEl();
}, P.prototype.offset = function(E) {
var M = E.getBoundingClientRect();
return { top: M.top + E.ownerDocument.body.scrollTop, left: M.left + E.ownerDocument.body.scrollLeft };
}, P.prototype.init = function(E) {
}, P.prototype.callRun = function(E, M) {
M === void 0 && (M = {});
var D = this.id;
if (E.trigger("run:".concat(D, ":before"), M), !M || !M.abort) {
var ot = M.sender || E, it = this.run(E, ot, M);
return E.trigger("run:".concat(D), it, M), E.trigger("run", D, it, M), it;
}
E.trigger("abort:".concat(D), M);
}, P.prototype.callStop = function(E, M) {
M === void 0 && (M = {});
var D = this.id, ot = M.sender || E;
E.trigger("stop:".concat(D, ":before"), M);
var it = this.stop(E, ot, M);
return E.trigger("stop:".concat(D), it, M), E.trigger("stop", D, it, M), it;
}, P.prototype.stopCommand = function(E) {
this.em.Commands.stop(this.id, E);
}, P.prototype.run = function(E, M, D) {
}, P.prototype.stop = function(E, M, D) {
}, P;
}(_t.Hn);
}, 180: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => J });
var at = pt(50), _t = function(W, z, k) {
if (k || arguments.length === 2)
for (var P, E = 0, M = z.length; E < M; E++)
!P && E in z || (P || (P = Array.prototype.slice.call(z, 0, E)), P[E] = z[E]);
return W.concat(P || Array.prototype.slice.call(z));
};
const J = { run: function(W, z, k) {
var P = this;
k === void 0 && (k = {});
var E = [], M = k.component || W.getSelectedAll();
return (M = (0, at.isArray)(M) ? _t([], M, !0) : [M]).filter(Boolean).forEach(function(D) {
if (!D.get("removable"))
return E.push(D), P.em.logWarning("The element is not removable", { component: D });
D.remove();
}), W.select(E), M;
} };
}, 544: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => z });
var at = pt(50), _t = pt(668), J = function() {
return J = Object.assign || function(k) {
for (var P, E = 1, M = arguments.length; E < M; E++)
for (var D in P = arguments[E])
Object.prototype.hasOwnProperty.call(P, D) && (k[D] = P[D]);
return k;
}, J.apply(this, arguments);
}, W = "dmode";
const z = { run: function(k, P, E) {
var M = this;
E === void 0 && (E = {}), (0, at.bindAll)(this, "setPosition", "onStart", "onDrag", "onEnd", "getPosition", "getGuidesStatic", "renderGuide", "getGuidesTarget");
var D = E.target, ot = E.event, it = E.mode, Et = E.dragger, jt = Et === void 0 ? {} : Et, Dt = D.getEl(), ee = J({ doc: Dt.ownerDocument, onStart: this.onStart, onEnd: this.onEnd, onDrag: this.onDrag, getPosition: this.getPosition, setPosition: this.setPosition, guidesStatic: function() {
return M.guidesStatic;
}, guidesTarget: function() {
return M.guidesTarget;
} }, jt);
this.setupGuides(), this.opts = E, this.editor = k, this.em = k.getModel(), this.target = D, this.isTran = it == "translate", this.guidesContainer = this.getGuidesContainer(), this.guidesTarget = this.getGuidesTarget(), this.guidesStatic = this.getGuidesStatic();
var xt = this.dragger;
return xt ? xt.setOptions(ee) : (xt = new _t.Z(ee), this.dragger = xt), ot && xt.start(ot), this.toggleDrag(1), this.em.trigger("".concat(W, ":start"), this.getEventOpts()), xt;
}, 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(k) {
var P = k.guide;
P && P.parentNode.removeChild(P);
}), this.guides = [];
}, getGuidesContainer: function() {
var k = this, P = this.guidesEl;
if (!P) {
var E = this, M = E.editor, D = E.em, ot = E.opts, it = M.getConfig().stylePrefix, Et = document.createElement("div"), jt = document.createElement("div"), Dt = '
`);
(P = document.createElement("div")).className = "".concat(it, "guides"), Et.className = "".concat(it, "guide-info ").concat(it, "guide-info__x"), jt.className = "".concat(it, "guide-info ").concat(it, "guide-info__y"), Et.innerHTML = Dt, jt.innerHTML = Dt, P.appendChild(Et), P.appendChild(jt), M.Canvas.getGlobalToolsEl().appendChild(P), this.guidesEl = P, this.elGuideInfoX = Et, this.elGuideInfoY = jt, this.elGuideInfoContentX = Et.querySelector(".".concat(it, "guide-info__content")), this.elGuideInfoContentY = jt.querySelector(".".concat(it, "guide-info__content")), D.on("canvas:update frame:scroll", (0, at.debounce)(function() {
var ee;
k.updateGuides(), ot.debug && ((ee = k.guides) === null || ee === void 0 || ee.forEach(function(xt) {
return k.renderGuide(xt);
}));
}, 200));
}
return P;
}, getGuidesStatic: function() {
var k = this, P = [], E = this.target.getEl(), M = E.parentNode, D = M === void 0 ? {} : M;
return (0, at.each)(D.children, function(ot) {
return P = P.concat(E !== ot ? k.getElementGuides(ot) : []);
}), P.concat(this.getElementGuides(D));
}, getGuidesTarget: function() {
return this.getElementGuides(this.target.getEl());
}, updateGuides: function(k) {
var P, E, M = this;
(k || this.guides).forEach(function(D) {
var ot = D.origin, it = P === ot ? E : M.getElementPos(ot);
P = ot, E = it, (0, at.each)(M.getGuidePosUpdate(D, it), function(Et, jt) {
return D[jt] = Et;
}), D.originRect = it;
});
}, getGuidePosUpdate: function(k, P) {
var E = {}, M = P.top, D = P.height, ot = P.left, it = P.width;
switch (k.type) {
case "t":
E.y = M;
break;
case "b":
E.y = M + D;
break;
case "l":
E.x = ot;
break;
case "r":
E.x = ot + it;
break;
case "x":
E.x = ot + it / 2;
break;
case "y":
E.y = M + D / 2;
}
return E;
}, renderGuide: function(k) {
k === void 0 && (k = {});
var P = k.guide || document.createElement("div"), E = "px", M = k.active ? 2 : 1, D = P.children[0];
return P.style = "position: absolute; background-color: ".concat(k.active ? "green" : "red", ";"), P.children.length || ((D = document.createElement("div")).style = "position: absolute; color: red; padding: 5px; top: 0; left: 0;", P.appendChild(D)), k.y ? (P.style.width = "100%", P.style.height = "".concat(M).concat(E), P.style.top = "".concat(k.y).concat(E), P.style.left = 0) : (P.style.width = "".concat(M).concat(E), P.style.height = "100%", P.style.left = "".concat(k.x).concat(E), P.style.top = "0".concat(E)), !k.guide && this.guidesContainer.appendChild(P), P;
}, getElementPos: function(k) {
return this.editor.Canvas.getElementPos(k, { noScroll: 1 });
}, getElementGuides: function(k) {
var P = this, E = this.opts, M = this.getElementPos(k), D = M.top, ot = M.height, it = M.left, Et = M.width, jt = [{ type: "t", y: D }, { type: "b", y: D + ot }, { type: "l", x: it }, { type: "r", x: it + Et }, { type: "x", x: it + Et / 2 }, { type: "y", y: D + ot / 2 }].map(function(Dt) {
return J(J({}, Dt), { origin: k, originRect: M, guide: E.debug && P.renderGuide(Dt) });
});
return jt.forEach(function(Dt) {
var ee;
return (ee = P.guides) === null || ee === void 0 ? void 0 : ee.push(Dt);
}), jt;
}, getTranslate: function(k, P) {
P === void 0 && (P = "x");
var E = 0;
return (k || "").split(" ").forEach(function(M) {
var D = M.trim(), ot = "translate".concat(P.toUpperCase(), "(");
D.indexOf(ot) === 0 && (E = parseFloat(D.replace(ot, "")));
}), E;
}, setTranslate: function(k, P, E) {
var M = "translate".concat(P.toUpperCase(), "("), D = "".concat(M).concat(E, ")"), ot = (k || "").split(" ").map(function(it) {
return it.trim().indexOf(M) === 0 && (it = D), it;
}).join(" ");
return ot.indexOf(M) < 0 && (ot += " ".concat(D)), ot;
}, getPosition: function() {
var k = this.target, P = this.isTran, E = k.getStyle(), M = E.left, D = E.top, ot = E.transform, it = 0, Et = 0;
return P ? (it = this.getTranslate(ot), Et = this.getTranslate(ot, "y")) : (it = parseFloat(M || 0), Et = parseFloat(D || 0)), { x: it, y: Et };
}, setPosition: function(k) {
var P = k.x, E = k.y, M = k.end, D = k.position, ot = k.width, it = k.height, Et = this, jt = Et.target, Dt = Et.isTran, ee = Et.em, xt = "px", bt = !M, Wt = "".concat(parseInt(P, 10)).concat(xt), Ft = "".concat(parseInt(E, 10)).concat(xt), Ht = {};
if (Dt) {
var Q = jt.getStyle().transform || "";
Q = this.setTranslate(Q, "x", Wt), Ht = { transform: Q = this.setTranslate(Q, "y", Ft), __p: bt }, jt.addStyle(Ht, { avoidStore: !M });
} else {
var j = { position: D, width: ot, height: it }, V = { left: Wt, top: Ft, __p: bt };
(0, at.keys)(j).forEach(function(Y) {
var nt = j[Y];
nt && (V[Y] = nt);
}), Ht = V, jt.addStyle(Ht, { avoidStore: !M });
}
ee == null || ee.Styles.__emitCmpStyleUpdate(Ht, { components: ee.getSelected() });
}, _getDragData: function() {
var k = this.target;
return { target: k, parent: k.parent(), index: k.index() };
}, onStart: function(k) {
var P = this, E = P.target, M = P.editor, D = P.isTran, ot = P.opts, it = ot.center, Et = ot.onStart, jt = M.Canvas, Dt = E.getStyle(), ee = "absolute", xt = [ee, "relative"];
if (Et && Et(this._getDragData()), !D && Dt.position !== ee) {
var bt = jt.offset(E.getEl()), Wt = bt.left, Ft = bt.top, Ht = bt.width, Q = bt.height, j = E.parent(), V = void 0;
do {
var Y = j.getStyle();
V = xt.indexOf(Y.position) >= 0 ? j : null, j = j.parent();
} while (j && !V);
if (it) {
var nt = jt.getMouseRelativeCanvas(k);
Wt = nt.x, Ft = nt.y;
} else if (V) {
var wt = jt.offset(V.getEl());
Wt -= wt.left, Ft -= wt.top;
}
this.setPosition({ x: Wt, y: Ft, width: "".concat(Ht, "px"), height: "".concat(Q, "px"), position: ee });
}
}, onDrag: function() {
for (var k = this, P = [], E = 0; E < arguments.length; E++)
P[E] = arguments[E];
var M = this, D = M.guidesTarget, ot = M.opts, it = ot.onDrag;
this.updateGuides(D), ot.debug && D.forEach(function(Et) {
return k.renderGuide(Et);
}), ot.guidesInfo && this.renderGuideInfo(D.filter(function(Et) {
return Et.active;
})), it && it(this._getDragData());
}, onEnd: function(k, P, E) {
E === void 0 && (E = {});
var M = this, D = M.editor, ot = M.opts, it = M.id, Et = ot.onEnd;
Et && Et(k, E, J(J({ event: k }, E), this._getDragData())), D.stopCommand(it), this.hideGuidesInfo(), this.em.trigger("".concat(W, ":end"), this.getEventOpts());
}, hideGuidesInfo: function() {
var k = this;
["X", "Y"].forEach(function(P) {
var E = k["elGuideInfo".concat(P)];
E && (E.style.display = "none");
});
}, renderGuideInfo: function(k) {
var P = this;
k === void 0 && (k = []);
var E = this.guidesStatic;
this.hideGuidesInfo(), k.forEach(function(M) {
var D = M.origin, ot = M.x, it = P.getElementPos(D), Et = (0, at.isUndefined)(ot) ? "y" : "x", jt = Et === "y", Dt = it[jt ? "left" : "top"], ee = it.rect[jt ? "left" : "top"], xt = jt ? Dt + it.width : Dt + it.height, bt = jt ? ee + it.rect.width : ee + it.rect.height, Wt = P["elGuideInfo".concat(Et.toUpperCase())], Ft = P["elGuideInfoContent".concat(Et.toUpperCase())], Ht = Wt.style, Q = E == null ? void 0 : E.filter(function(Te) {
return Te.type === M.type;
}).map(function(Te) {
var be = Te.originRect, ge = be.left, pe = be.width, ce = be.top, st = be.height, Xt = jt ? ge + pe : ce + st;
return { gap: Xt < Dt ? Dt - Xt : (jt ? ge : ce) - xt, guide: Te };
}).filter(function(Te) {
return Te.gap > 0;
}).sort(function(Te, be) {
return Te.gap - be.gap;
}).map(function(Te) {
return Te.guide;
})[0];
if (Q) {
var j = Q.originRect, V = j.left, Y = j.width, nt = j.top, wt = j.height, rt = j.rect, gt = jt ? V < it.left : nt < it.top, N = jt ? V : nt, Lt = jt ? rt.left : rt.top, Tt = jt ? V + Y : nt + wt, Qt = jt ? rt.left + rt.width : rt.top + rt.height, Oe = jt ? M.y : M.x, Se = gt ? Tt : xt, _e = "".concat(Oe, "px"), De = gt ? Dt - Tt : N - xt, xe = gt ? ee - Qt : Lt - bt;
Ht.display = "", Ht[jt ? "top" : "left"] = _e, Ht[jt ? "left" : "top"] = "".concat(Se, "px"), Ht[jt ? "width" : "height"] = "".concat(De, "px"), Ft.innerHTML = "".concat(Math.round(xe), "px"), P.em.trigger("".concat(W, ":active"), J(J({}, P.getEventOpts()), { guide: M, guidesStatic: E, matched: Q, posFirst: Oe, posSecond: Se, size: De, sizeRaw: xe, elGuideInfo: Wt, elGuideInfoCnt: Ft }));
}
});
}, toggleDrag: function(k) {
var P = this.ppfx, E = this.editor, M = k ? "add" : "remove", D = ["".concat(P, "is__grabbing")], ot = E.Canvas, it = ot.getBody();
D.forEach(function(Et) {
return it.classList[M](Et);
}), ot[k ? "startAutoscroll" : "stopAutoscroll"]();
} };
}, 236: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => at });
const at = { run: function(_t) {
if (_t.Canvas.hasFocus()) {
var J = [];
_t.getSelectedAll().forEach(function(W) {
var z = W.components(), k = z && z.filter(function(P) {
return P.get("selectable");
})[0];
k && J.push(k);
}), J.length && _t.select(J);
}
} };
}, 368: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => at });
const at = { run: function(_t, J, W) {
if (W === void 0 && (W = {}), _t.Canvas.hasFocus() || W.force) {
var z = [];
_t.getSelectedAll().forEach(function(k) {
for (var P = k.parent(); P && !P.get("selectable"); )
P = P.parent();
P && z.push(P);
}), z.length && _t.select(z);
}
} };
}, 243: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => at });
const at = { run: function(_t) {
if (_t.Canvas.hasFocus()) {
var J = [];
_t.getSelectedAll().forEach(function(W) {
var z = W.parent();
if (z) {
var k, P = z.components().length, E = 0, M = 0;
do
E++, k = (M = W.index() + E) <= P ? z.getChildAt(M) : null;
while (k && !k.get("selectable"));
J.push(k || W);
}
}), J.length && _t.select(J);
}
} };
}, 400: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => at });
const at = { run: function(_t) {
if (_t.Canvas.hasFocus()) {
var J = [];
_t.getSelectedAll().forEach(function(W) {
var z = W.parent();
if (z) {
var k, P = 0, E = 0;
do
P++, k = (E = W.index() - P) >= 0 ? z.getChildAt(E) : null;
while (k && !k.get("selectable"));
J.push(k || W);
}
}), J.length && _t.select(J);
}
} };
}, 910: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => _t });
var at = pt(50);
const _t = { run: function(J, W, z) {
z === void 0 && (z = {});
var k = z.target, P = [];
if (!k.get("styles"))
return P;
var E = k.get("type"), M = J.Pages.getAllWrappers();
if (!(0, at.flatten)(M.map(function(ot) {
return ot.findType(E);
})).length) {
var D = J.CssComposer.getAll();
P = D.filter(function(ot) {
return ot.get("group") === "cmp:".concat(E);
}), D.remove(P);
}
return P;
} };
}, 744: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => _t });
var at = function(J, W, z) {
if (z || arguments.length === 2)
for (var k, P = 0, E = W.length; P < E; P++)
!k && P in W || (k || (k = Array.prototype.slice.call(W, 0, P)), k[P] = W[P]);
return J.concat(k || Array.prototype.slice.call(W));
};
const _t = { run: function(J) {
var W = J.getModel(), z = at([], J.getSelectedAll(), !0);
z.length && W.set("clipboard", z);
} };
}, 517: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => W });
var at = pt(50), _t = pt(895), J = pt(407);
const W = (0, at.extend)({}, J.default, { init: function() {
(0, at.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(z) {
z.stopPropagation();
var k = (0, _t.default)(z.target);
k.data("model").get("removable") && (k.addClass(this.hoverClass), this.attachBadge(k.get(0)));
}, stopDelete: function(z) {
z.stopPropagation(), (0, _t.default)(z.target).removeClass(this.hoverClass), this.badge && this.badge.css({ left: -1e3, top: -1e3 });
}, onDelete: function(z) {
z.stopPropagation();
var k = (0, _t.default)(z.target);
k.data("model").get("removable") && (k.data("model").destroy(), this.removeBadge(), this.clean());
}, updateBadgeLabel: function(z) {
this.badge.html("Remove " + z.getName());
} });
}, 457: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => _t });
var at = pt(895);
const _t = { run: function(J, W, z) {
var k = this;
z === void 0 && (z = {}), W && W.set && W.set("active", 0);
var P = J.getConfig(), E = J.Modal, M = P.stylePrefix;
if (this.cm = J.CodeManager || null, !this.$editors) {
var D = this.buildEditor("htmlmixed", "hopscotch", "HTML"), ot = this.buildEditor("css", "hopscotch", "CSS");
this.htmlEditor = D.el, this.cssEditor = ot.el;
var it = (0, at.default)(''));
it.append(D.$el).append(ot.$el), this.$editors = it;
}
E.open({ title: P.textViewCode, content: this.$editors }).getModel().once("change:open", function() {
return J.stopCommand("".concat(k.id));
}), this.htmlEditor.setContent(J.getHtml(z.optsHtml)), this.cssEditor.setContent(J.getCss(z.optsCss));
}, stop: function(J) {
var W = J.Modal;
W && W.close();
}, buildEditor: function(J, W, z) {
var k = document.createElement("textarea");
!this.codeMirror && (this.codeMirror = this.cm.getViewer("CodeMirror"));
var P = this.codeMirror.clone().set({ label: z, codeName: J, theme: W, input: k }), E = new this.cm.EditorView({ model: P, config: this.cm.getConfig() }).render().$el;
return P.init(k), { el: P, $el: E };
} };
}, 975: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => _t });
var at = pt(50);
const _t = { isEnabled: function() {
var J = document;
return !!(J.fullscreenElement || J.webkitFullscreenElement || J.mozFullScreenElement);
}, enable: function(J) {
var W = "";
return J.requestFullscreen ? J.requestFullscreen() : J.webkitRequestFullscreen ? (W = "webkit", J.webkitRequestFullscreen()) : J.mozRequestFullScreen ? (W = "moz", J.mozRequestFullScreen()) : J.msRequestFullscreen && J.msRequestFullscreen(), W;
}, disable: function() {
var J = document;
this.isEnabled() && (J.exitFullscreen ? J.exitFullscreen() : J.webkitExitFullscreen ? J.webkitExitFullscreen() : J.mozCancelFullScreen ? J.mozCancelFullScreen() : J.msExitFullscreen && J.msExitFullscreen());
}, fsChanged: function(J) {
this.isEnabled() || (this.stopCommand({ sender: this.sender }), document.removeEventListener("".concat(J || "", "fullscreenchange"), this.fsChanged));
}, run: function(J, W, z) {
z === void 0 && (z = {}), this.sender = W;
var k = z.target, P = (0, at.isElement)(k) ? k : document.querySelector(k), E = this.enable(P || J.getContainer());
this.fsChanged = this.fsChanged.bind(this, E), document.addEventListener(E + "fullscreenchange", this.fsChanged), J.trigger("change:canvasOffset");
}, stop: function(J, W) {
W && W.set && W.set("active", !1), this.disable(), J && J.trigger("change:canvasOffset");
} };
}, 191: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => k });
var at = pt(50), _t = pt(895), J = pt(163), W = pt(407), z = pt(189);
const k = (0, at.extend)({}, z.default, W.default, { init: function(P) {
W.default.init.apply(this, arguments), (0, at.bindAll)(this, "initSorter", "rollback", "onEndMove"), this.opt = P, this.hoverClass = this.ppfx + "highlighter-warning", this.badgeClass = this.ppfx + "badge-warning", this.noSelClass = this.ppfx + "no-select";
}, enable: function() {
for (var P = [], E = 0; E < arguments.length; E++)
P[E] = arguments[E];
W.default.enable.apply(this, P), this.getBadgeEl().addClass(this.badgeClass), this.getHighlighterEl().addClass(this.hoverClass);
var M = this.$wrapper;
M.css("cursor", "move"), M.on("mousedown", this.initSorter), M.addClass(this.noSelClass);
}, toggleClipboard: function() {
}, initSorter: function(P) {
var E = (0, _t.default)(P.target).data("model").get("draggable");
E && (this.cacheEl = null, this.startSelectPosition(P.target, this.frameEl.contentDocument), this.sorter.draggable = E, this.sorter.onEndMove = this.onEndMove.bind(this), this.stopSelectComponent(), this.$wrapper.off("mousedown", this.initSorter), (0, J.on)(this.getContentWindow(), "keydown", this.rollback));
}, initSorterFromModel: function(P) {
var E = P.get("draggable");
if (E) {
this.cacheEl = null;
var M = P.view.el;
this.startSelectPosition(M, this.frameEl.contentDocument), this.sorter.draggable = E, this.sorter.onEndMove = this.onEndMoveFromModel.bind(this), this.stopSelectComponent(), (0, J.on)(this.getContentWindow(), "keydown", this.rollback);
}
}, initSorterFromModels: function(P) {
this.cacheEl = null;
var E = P[P.length - 1], M = (this.em.get("currentFrame") || {}).model, D = E.getEl(M), ot = D.ownerDocument;
this.startSelectPosition(D, ot, { onStart: this.onStart }), this.sorter.draggable = E.get("draggable"), this.sorter.toMove = P, this.sorter.onMoveClb = this.onDrag, this.sorter.onEndMove = this.onEndMoveFromModel.bind(this), this.stopSelectComponent(), (0, J.on)(this.getContentWindow(), "keydown", this.rollback);
}, onEndMoveFromModel: function() {
(0, J.off)(this.getContentWindow(), "keydown", this.rollback);
}, onEndMove: function() {
this.enable(), (0, J.off)(this.getContentWindow(), "keydown", this.rollback);
}, onSelect: function(P, E) {
}, rollback: function(P, E) {
((P.which || P.keyCode) == 27 || E) && (this.sorter.moved = !1, this.sorter.endMove());
}, getBadgeEl: function() {
return this.$badge || (this.$badge = (0, _t.default)(this.getBadge())), this.$badge;
}, getHighlighterEl: function() {
return this.$hl || (this.$hl = (0, _t.default)(this.canvas.getHighlighter())), this.$hl;
}, stop: function() {
for (var P = [], E = 0; E < arguments.length; E++)
P[E] = arguments[E];
W.default.stop.apply(this, P), this.getBadgeEl().removeClass(this.badgeClass), this.getHighlighterEl().removeClass(this.hoverClass);
var M = this.$wrapper;
M.css("cursor", "").unbind().removeClass(this.noSelClass);
} });
}, 912: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => J });
var at = pt(50), _t = pt(491);
const J = { open: function(W) {
var z = this, k = this, P = k.editor, E = k.title, M = k.config, D = k.am, ot = M.custom;
if ((0, at.isFunction)(ot.open))
return ot.open(D.__customData());
P.Modal.open({ title: E, content: W }).onceClose(function() {
return P.stopCommand(z.id);
});
}, close: function() {
var W = this.config.custom;
if ((0, at.isFunction)(W.close))
return W.close(this.am.__customData());
var z = this.editor.Modal;
z && z.close();
}, run: function(W, z, k) {
k === void 0 && (k = {});
var P = W.AssetManager, E = P.getConfig(), M = k.types, D = M === void 0 ? [] : M, ot = k.accept, it = k.select;
if (this.title = k.modalTitle || W.t("assetManager.modalTitle") || "", this.editor = W, this.config = E, this.am = P, P.setTarget(k.target), P.onClick(k.onClick), P.onDblClick(k.onDblClick), P.onSelect(k.onSelect), P.__behaviour({ select: it, types: D, options: k }), E.custom)
this.rendered = this.rendered || (0, _t.ut)("div"), this.rendered.className = "".concat(E.stylePrefix, "custom-wrp"), P.__behaviour({ container: this.rendered }), P.__trgCustom();
else {
if (!this.rendered || D) {
var Et = P.getAll().filter(function(Dt) {
return Dt;
});
D && D.length && (Et = Et.filter(function(Dt) {
return D.indexOf(Dt.get("type")) !== -1;
})), P.render(Et), this.rendered = P.getContainer();
}
if (ot) {
var jt = this.rendered.querySelector("input#".concat(E.stylePrefix, "uploadFile"));
jt && jt.setAttribute("accept", ot);
}
}
return this.open(this.rendered), this;
}, stop: function(W) {
this.editor = W, this.close(this.rendered);
} };
}, 117: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => J });
var at = pt(50), _t = pt(491);
const J = { open: function() {
var W = this, z = W.container, k = W.editor, P = W.bm, E = W.config, M = E.custom, D = E.appendTo;
if ((0, at.isFunction)(M.open))
return M.open(P.__customData());
if (this.firstRender && !D) {
var ot = "views-container", it = k.Panels;
(it.getPanel(ot) || it.addPanel({ id: ot })).set("appendContent", z).trigger("change:appendContent"), M || z.appendChild(P.render());
}
z && (z.style.display = "block");
}, close: function() {
var W = this.container, z = this.config.custom;
if ((0, at.isFunction)(z.close))
return z.close(this.bm.__customData());
W && (W.style.display = "none");
}, run: function(W) {
var z = W.Blocks;
this.config = z.getConfig(), this.firstRender = !this.container, this.container = this.container || (0, _t.ut)("div"), this.editor = W, this.bm = z;
var k = this.container;
z.__behaviour({ container: k }), this.config.custom && z.__trgCustom(), this.open();
}, stop: function() {
this.close();
} };
}, 614: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => at });
const at = { run: function(_t) {
var J = _t.LayerManager, W = _t.Panels, z = J.getConfig();
if (!z.appendTo) {
if (!this.layers) {
var k = "views-container", P = document.createElement("div"), E = W.getPanel(k) || W.addPanel({ id: k });
z.custom ? J.__trgCustom({ container: P }) : P.appendChild(J.render()), E.set("appendContent", P).trigger("change:appendContent"), this.layers = P;
}
this.layers.style.display = "block";
}
}, stop: function() {
var _t = this.layers;
_t && (_t.style.display = "none");
} };
}, 801: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => _t });
var at = pt(895);
const _t = { run: function(J, W) {
if (this.sender = W, !this.$cn) {
var z = J.getConfig(), k = J.Panels, P = "change:appendContent";
this.$cn = (0, at.default)(""), this.$cn2 = (0, at.default)(""), this.$cn.append(this.$cn2);
var E = J.DeviceManager;
if (E && z.showDevices) {
var M = k.addPanel({ id: "devices-c" }), D = E.render();
M.set("appendContent", D).trigger(P);
}
var ot = J.SelectorManager;
this.slm = ot;
var it = ot.getConfig();
it.custom ? ot.__trgCustom({ container: this.$cn2.get(0) }) : it.appendTo || this.$cn2.append(ot.render([]));
var Et = J.StyleManager;
this.sm = Et;
var jt = Et.getConfig(), Dt = jt.stylePrefix;
this.$header = (0, at.default)('")), this.$cn.append(this.$header), jt.custom ? Et.__trgCustom({ container: this.$cn2.get(0) }) : jt.appendTo || this.$cn2.append(Et.render());
var ee = "views-container";
this.panel = k.getPanel(ee), this.panel || (this.panel = k.addPanel({ id: ee })), this.panel.set("appendContent", this.$cn).trigger(P), this.em = J.getModel(), this.listenTo(this.em, Et.events.target, this.toggleSm);
}
this.toggleSm();
}, toggleSm: function() {
var J, W, z, k, P = this.sender, E = this.sm;
P && P.get && !P.get("active") || !E || (E.getSelected() ? ((J = this.$cn2) === null || J === void 0 || J.show(), (W = this.$header) === null || W === void 0 || W.hide()) : ((z = this.$cn2) === null || z === void 0 || z.hide(), (k = this.$header) === null || k === void 0 || k.show()));
}, stop: function() {
var J, W;
(J = this.$cn2) === null || J === void 0 || J.hide(), (W = this.$header) === null || W === void 0 || W.hide();
} };
}, 395: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => _t });
var at = pt(895);
const _t = { run: function(J, W) {
this.sender = W;
var z, k = J.getModel(), P = J.Config.stylePrefix, E = J.TraitManager, M = E.getConfig();
if (!M.appendTo) {
if (!this.$cn) {
this.$cn = (0, at.default)(""), this.$cn2 = (0, at.default)(""), this.$cn.append(this.$cn2), this.$header = (0, at.default)("").append('")), this.$cn.append(this.$header), this.$cn2.append('
').concat(k.t("traitManager.label"), "
")), this.$cn2.append(E.render());
var D = J.Panels;
(z = D.getPanel("views-container") ? D.getPanel("views-container") : D.addPanel({ id: "views-container" })) == null || z.set("appendContent", this.$cn.get(0)).trigger("change:appendContent"), this.target = J.getModel(), this.listenTo(this.target, "component:toggled", this.toggleTm);
}
this.toggleTm();
}
}, toggleTm: function() {
var J = this.sender;
J && J.get && !J.get("active") || (this.target.getSelectedAll().length === 1 ? (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: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => _t });
var at = pt(50);
const _t = { run: function(J, W, z) {
z === void 0 && (z = {});
var k = J.getModel().get("clipboard"), P = J.getSelected();
k && P && (J.getSelectedAll().forEach(function(E) {
var M = E.collection;
if (M) {
var D, ot = { at: E.index() + 1, action: z.action || "paste-component" };
if ((0, at.contains)(k, E) && E.get("copyable"))
D = M.add(E.clone(), ot);
else {
var it = k.filter(function(Et) {
return Et.get("copyable");
}).filter(function(Et) {
return J.Components.canMove(E.parent(), Et).result;
});
D = M.add(it.map(function(Et) {
return Et.clone();
}), ot);
}
(D = (0, at.isArray)(D) ? D : [D]).forEach(function(Et) {
return J.trigger("component:paste", Et);
});
}
}), P.emitUpdate());
} };
}, 129: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => W });
var at = pt(50), _t = function(z, k, P) {
if (P || arguments.length === 2)
for (var E, M = 0, D = k.length; M < D; M++)
!E && M in k || (E || (E = Array.prototype.slice.call(k, 0, M)), E[M] = k[M]);
return z.concat(E || Array.prototype.slice.call(k));
}, J = "core:component-outline";
const W = { getPanels: function(z) {
return this.panels || (this.panels = z.Panels.getPanels()), this.panels;
}, preventDrag: function(z) {
z.abort = 1;
}, tglEffects: function(z) {
var k = this.em, P = z ? "on" : "off";
if (k) {
var E = k.Canvas, M = E.getBody(), D = E.getToolbarEl();
D && (D.style.display = z ? "none" : "");
var ot = M.querySelectorAll(".".concat(this.ppfx, "no-pointer"));
(0, at.each)(ot, function(it) {
return it.style.pointerEvents = z ? "all" : "";
}), k[P]("run:tlb-move:before", this.preventDrag);
}
}, run: function(z, k) {
var P = this;
this.sender = k, this.selected = _t([], z.getSelectedAll(), !0), z.select(), this.shouldRunSwVisibility || (this.shouldRunSwVisibility = z.Commands.isActive(J)), this.shouldRunSwVisibility && z.stopCommand(J), z.getModel().stopDefault();
var E = this.getPanels(z), M = z.Canvas.getElement(), D = z.getEl(), ot = z.Config.stylePrefix;
if (!this.helper) {
var it = document.createElement("span");
it.className = "".concat(ot, "off-prv fa fa-eye-slash"), D.appendChild(it), it.onclick = function() {
return P.stopCommand();
}, this.helper = it;
}
this.helper.style.display = "inline-block", E.forEach(function(jt) {
return jt.set("visible", !1);
});
var Et = M.style;
Et.width = "100%", Et.height = "100%", Et.top = "0", Et.left = "0", Et.padding = "0", Et.margin = "0", z.refresh(), this.tglEffects(1);
}, stop: function(z) {
var k = this.sender, P = k === void 0 ? {} : k, E = this.selected;
P.set && P.set("active", 0);
var M = this.getPanels(z);
this.shouldRunSwVisibility && (z.runCommand(J), this.shouldRunSwVisibility = !1), z.getModel().runDefault(), M.forEach(function(D) {
return D.set("visible", !0);
}), z.Canvas.getElement().setAttribute("style", ""), E && z.select(E), delete this.selected, this.helper && (this.helper.style.display = "none"), z.refresh(), this.tglEffects();
} };
}, 116: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => _t });
var at = function() {
return at = Object.assign || function(J) {
for (var W, z = 1, k = arguments.length; z < k; z++)
for (var P in W = arguments[z])
Object.prototype.hasOwnProperty.call(W, P) && (J[P] = W[P]);
return J;
}, at.apply(this, arguments);
};
const _t = { run: function(J, W, z) {
var k = z || {}, P = J.Canvas, E = P.getCanvasView(), M = at({ appendTo: P.getResizerEl(), prefix: J.getConfig().stylePrefix, posFetcher: E.getElementPos.bind(E), mousePosFetcher: P.getMouseRelativePos }, k.options || {}), D = this.canvasResizer;
return D && !k.forceNew || (this.canvasResizer = new J.Utils.Resizer(M), D = this.canvasResizer), D.setOptions(M, !0), D.blur(), D.focus(k.el), D;
}, stop: function() {
var J;
(J = this.canvasResizer) === null || J === void 0 || J.blur();
} };
}, 407: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => Ht });
var at, _t = pt(50), J = pt(895), W = pt(346), z = (at = function(Q, j) {
return at = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(V, Y) {
V.__proto__ = Y;
} || function(V, Y) {
for (var nt in Y)
Object.prototype.hasOwnProperty.call(Y, nt) && (V[nt] = Y[nt]);
}, at(Q, j);
}, function(Q, j) {
if (typeof j != "function" && j !== null)
throw new TypeError("Class extends value " + String(j) + " is not a constructor or null");
function V() {
this.constructor = Q;
}
at(Q, j), Q.prototype = j === null ? Object.create(j) : (V.prototype = j.prototype, new V());
});
const k = function(Q) {
function j() {
return Q !== null && Q.apply(this, arguments) || this;
}
return z(j, Q), j.prototype.defaults = function() {
return { command: "", attributes: {} };
}, j;
}(W.Hn);
var P = function() {
var Q = function(j, V) {
return Q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(Y, nt) {
Y.__proto__ = nt;
} || function(Y, nt) {
for (var wt in nt)
Object.prototype.hasOwnProperty.call(nt, wt) && (Y[wt] = nt[wt]);
}, Q(j, V);
};
return function(j, V) {
if (typeof V != "function" && V !== null)
throw new TypeError("Class extends value " + String(V) + " is not a constructor or null");
function Y() {
this.constructor = j;
}
Q(j, V), j.prototype = V === null ? Object.create(V) : (Y.prototype = V.prototype, new Y());
};
}(), E = function(Q) {
function j() {
return Q !== null && Q.apply(this, arguments) || this;
}
return P(j, Q), j;
}(W.FE);
const M = E;
E.prototype.model = k;
var D = pt(330), ot = function() {
var Q = function(j, V) {
return Q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(Y, nt) {
Y.__proto__ = nt;
} || function(Y, nt) {
for (var wt in nt)
Object.prototype.hasOwnProperty.call(nt, wt) && (Y[wt] = nt[wt]);
}, Q(j, V);
};
return function(j, V) {
if (typeof V != "function" && V !== null)
throw new TypeError("Class extends value " + String(V) + " is not a constructor or null");
function Y() {
this.constructor = j;
}
Q(j, V), j.prototype = V === null ? Object.create(V) : (Y.prototype = V.prototype, new Y());
};
}(), it = function() {
return it = Object.assign || function(Q) {
for (var j, V = 1, Y = arguments.length; V < Y; V++)
for (var nt in j = arguments[V])
Object.prototype.hasOwnProperty.call(j, nt) && (Q[nt] = j[nt]);
return Q;
}, it.apply(this, arguments);
};
const Et = function(Q) {
function j(V) {
var Y = Q.call(this, V) || this;
return Y.em = V.config.em, Y;
}
return ot(j, Q), j.prototype.events = function() {
return this.model.get("events") || { mousedown: "handleClick" };
}, j.prototype.attributes = function() {
return this.model.get("attributes");
}, j.prototype.handleClick = function(V) {
V.preventDefault(), V.stopPropagation();
var Y = this.em, nt = Y.Canvas.getFrameEl().getBoundingClientRect(), wt = nt.left, rt = nt.top, gt = it(it({}, V), { clientX: V.clientX - wt, clientY: V.clientY - rt });
Y.trigger("toolbar:run:before", { event: gt }), this.execCommand(gt);
}, j.prototype.execCommand = function(V) {
var Y = this.em, nt = { event: V }, wt = this.model.get("command"), rt = Y.Editor;
(0, _t.isFunction)(wt) && wt(rt, null, nt), (0, _t.isString)(wt) && rt.runCommand(wt, nt);
}, j.prototype.render = function() {
var V = this, Y = V.em, nt = V.$el, wt = V.model, rt = wt.get("id"), gt = wt.get("label"), N = Y.getConfig().stylePrefix;
return nt.addClass("".concat(N, "toolbar-item")), rt && nt.addClass("".concat(N, "toolbar-item__").concat(rt)), gt && nt.append(gt), this;
}, j;
}(W.G7);
var jt = function() {
var Q = function(j, V) {
return Q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(Y, nt) {
Y.__proto__ = nt;
} || function(Y, nt) {
for (var wt in nt)
Object.prototype.hasOwnProperty.call(nt, wt) && (Y[wt] = nt[wt]);
}, Q(j, V);
};
return function(j, V) {
if (typeof V != "function" && V !== null)
throw new TypeError("Class extends value " + String(V) + " is not a constructor or null");
function Y() {
this.constructor = j;
}
Q(j, V), j.prototype = V === null ? Object.create(V) : (Y.prototype = V.prototype, new Y());
};
}(), Dt = function(Q) {
function j(V) {
var Y = Q.call(this, V) || this, nt = V.em;
return Y.em = nt, Y.config = { em: nt }, Y.listenTo(Y.collection, "reset", Y.render), Y;
}
return jt(j, Q), j.prototype.onRender = function() {
var V = this.em.config.stylePrefix;
this.el.className = "".concat(V, "toolbar-items");
}, j;
}(D.Z);
const ee = Dt;
Dt.prototype.itemView = Et;
var xt, bt = pt(491), Wt = pt(163), Ft = function() {
return Ft = Object.assign || function(Q) {
for (var j, V = 1, Y = arguments.length; V < Y; V++)
for (var nt in j = arguments[V])
Object.prototype.hasOwnProperty.call(j, nt) && (Q[nt] = j[nt]);
return Q;
}, Ft.apply(this, arguments);
};
const Ht = { init: function(Q) {
(0, _t.bindAll)(this, "onHover", "onOut", "onClick", "onFrameScroll", "onFrameUpdated", "onContainerChange");
}, enable: function() {
this.frameOff = this.canvasOff = this.adjScroll = null, this.startSelectComponent(), xt = !0;
}, startSelectComponent: function() {
this.toggleSelectComponent(1), this.em.getSelected() && this.onSelect();
}, stopSelectComponent: function() {
this.toggleSelectComponent();
}, toggleSelectComponent: function(Q) {
var j = this, V = this.em, Y = V.getConfig().listenToEl, nt = V.getContainer().parentNode, wt = Q ? "on" : "off", rt = { on: Wt.on, off: Wt.off };
!Y.length && nt && Y.push(nt), rt[wt](window, "resize", this.onFrameUpdated), rt[wt](Y, "scroll", this.onContainerChange), V[wt]("component:toggled component:update undo redo", this.onSelect, this), V[wt]("change:componentHovered", this.onHovered, this), V[wt]("component:resize styleable:change component:input", this.updateGlobalPos, this), V[wt]("component:update:toolbar", this._upToolbar, this), V[wt]("change:canvasOffset", this.updateAttached, this), V[wt]("frame:updated", this.onFrameUpdated, this), V[wt]("canvas:updateTools", this.onFrameUpdated, this), V.Canvas.getFrames().forEach(function(gt) {
var N = gt.view, Lt = N == null ? void 0 : N.getWindow();
Lt && function(Tt, Qt) {
rt[wt](Qt, "mouseover", j.onHover), rt[wt](Qt, "mouseleave", j.onOut), rt[wt](Qt, "click", j.onClick), rt[wt](Tt, "scroll", j.onFrameScroll, !0);
}(Lt, N == null ? void 0 : N.getBody());
});
}, onHover: function(Q) {
Q.stopPropagation();
var j = this.em, V = Q.target, Y = (0, Wt.getViewEl)(V), nt = Y && Y._getFrame(), wt = (0, J.default)(V), rt = wt.data("model");
if (!rt)
for (var gt = wt.parent(); !rt && gt.length && !(0, bt.Mx)(gt[0]); )
rt = gt.data("model"), gt = gt.parent();
this.currentDoc = V.ownerDocument, j.setHovered(rt, { useValid: !0 }), nt && j.set("currentFrame", nt);
}, onFrameUpdated: function() {
this.updateLocalPos(), this.updateGlobalPos();
}, onHovered: function(Q, j) {
var V, Y = this, nt = {};
j ? (V = j.views) === null || V === void 0 || V.forEach(function(wt) {
var rt = wt.el, gt = Y.getElementPos(rt);
nt = { el: rt, pos: gt, component: j, view: (0, Wt.getViewEl)(rt) }, Y.updateToolsLocal(nt), rt.ownerDocument === Y.currentDoc && (Y.elHovered = nt);
}) : (this.currentDoc = null, this.elHovered = 0, this.updateToolsLocal(), this.canvas.getFrames().forEach(function(wt) {
var rt = wt.view, gt = rt && rt.getToolsEl();
gt && Y.toggleToolsEl(0, 0, { el: gt });
}));
}, onSelect: (0, _t.debounce)(function() {
var Q = this.em, j = Q.getSelected(), V = Q.get("currentFrame") || {}, Y = j && j.getView(V.model), nt = Y && Y.el, wt = {};
nt && (0, bt.pn)(nt) && (wt = { el: nt, pos: this.getElementPos(nt), component: j, view: (0, Wt.getViewEl)(nt) }), this.elSelected = wt, this.updateToolsGlobal(), this.updateLocalPos(wt), this.initResize(j);
}, 0), updateGlobalPos: function() {
var Q = this.getElSelected();
Q.el && (Q.pos = this.getElementPos(Q.el), this.updateToolsGlobal());
}, updateLocalPos: function(Q) {
var j = this.getElHovered();
j.el && (j.pos = this.getElementPos(j.el), this.updateToolsLocal(Q));
}, getElHovered: function() {
return this.elHovered || {};
}, getElSelected: function() {
return this.elSelected || {};
}, onOut: function() {
this.em.setHovered(0);
}, toggleToolsEl: function(Q, j, V) {
V === void 0 && (V = {});
var Y = V.el || this.canvas.getToolsEl(j);
return Y && (Y.style.display = Q ? "" : "none"), Y || {};
}, showElementOffset: function(Q, j, V) {
V === void 0 && (V = {}), xt && this.editor.runCommand("show-offset", { el: Q, elPos: j, view: V.view, force: 1, top: 0, left: 0 });
}, hideElementOffset: function(Q) {
this.editor.stopCommand("show-offset", { view: Q });
}, showFixedElementOffset: function(Q, j) {
this.editor.runCommand("show-offset", { el: Q, elPos: j, state: "Fixed" });
}, hideFixedElementOffset: function() {
this.editor && this.editor.stopCommand("show-offset", { state: "Fixed" });
}, hideHighlighter: function(Q) {
this.canvas.getHighlighter(Q).style.opacity = 0;
}, onClick: function(Q) {
Q.stopPropagation(), Q.preventDefault();
var j = this.em;
if (j.get("_cmpDrag"))
return j.set("_cmpDrag");
var V = (0, J.default)(Q.target), Y = V.data("model");
if (!Y)
for (var nt = V.parent(); !Y && nt.length && !(0, bt.Mx)(nt[0]); )
Y = nt.data("model"), nt = nt.parent();
if (Y) {
if (j.isEditing() && !Y.get("textable") && Y.isChildOf("text"))
return;
this.select(Y, Q);
}
}, select: function(Q, j) {
j === void 0 && (j = {}), Q && (this.editor.select(Q, { event: j, useValid: !0 }), this.initResize(Q));
}, updateBadge: function(Q, j, V) {
V === void 0 && (V = {});
var Y = this.canvas, nt = (0, J.default)(Q).data("model");
if (nt && nt.get("badgable")) {
var wt = this.getBadge(V);
if (!V.posOnly) {
var rt = this.canvas.getConfig(), gt = nt.getIcon(), N = rt.pStylePrefix || "", Lt = "".concat(N, "badge"), Tt = rt.customBadgeLabel, Qt = "".concat(gt ? '
').concat(gt, "
") : "", `
').concat(nt.getName(), "
");
wt.innerHTML = Tt ? Tt(nt) : Qt;
}
var Oe = "px", Se = wt.style;
Se.display = "block";
var _e = Y.getTargetToElementFixed(Q, wt, { pos: j }).top, De = V.leftOff < 0 ? -V.leftOff : 0;
Se.top = _e + Oe, Se.left = De + Oe;
}
}, showHighlighter: function(Q) {
this.canvas.getHighlighter(Q).style.opacity = "";
}, initResize: function(Q) {
var j, V = this.em, Y = this.canvas, nt = V == null ? void 0 : V.Editor, wt = (V == null ? void 0 : V.config).stylePrefix || "", rt = "".concat(wt, "resizing"), gt = !(0, _t.isElement)(Q) && (0, Wt.isTaggableNode)(Q) ? Q : V.getSelected(), N = gt && gt.get("resizable"), Lt = {}, Tt = function(Oe, Se, _e) {
var De = _e.docs;
De && De.forEach(function(xe) {
var Te = xe.body, be = Te.className || "";
Te.className = (Oe == "add" ? "".concat(be, " ").concat(rt) : be.replace(rt, "")).trim();
});
};
if (nt && N) {
var Qt = (0, _t.isElement)(Q) ? Q : gt.getEl();
Lt = { onStart: function(Oe, Se) {
Se === void 0 && (Se = {});
var _e = Se.el, De = Se.config, xe = Se.resizer, Te = De.keyHeight, be = De.keyWidth, ge = De.currentUnit, pe = De.keepAutoHeight, ce = De.keepAutoWidth;
Tt("add", 0, Se), j = V.Styles.getModelToStyle(gt), Y.toggleFramesEvents(!1);
var st = getComputedStyle(_e), Xt = j.getStyle(), qt = Xt[be];
De.autoWidth = ce && qt === "auto", isNaN(parseFloat(qt)) && (qt = st[be]);
var ne = Xt[Te];
De.autoHeight = pe && ne === "auto", isNaN(parseFloat(ne)) && (ne = st[Te]), xe.startDim.w = parseFloat(qt), xe.startDim.h = parseFloat(ne), xt = !1, ge && (De.unitHeight = (0, Wt.getUnitFromValue)(ne), De.unitWidth = (0, Wt.getUnitFromValue)(qt));
}, onMove: function() {
nt.trigger("component:resize");
}, onEnd: function(Oe, Se) {
Tt("remove", 0, Se), nt.trigger("component:resize"), Y.toggleFramesEvents(!0), xt = !0;
}, updateTarget: function(Oe, Se, _e) {
if (_e === void 0 && (_e = {}), j) {
var De = _e.store, xe = _e.selectedHandler, Te = _e.config, be = Te.keyHeight, ge = Te.keyWidth, pe = Te.autoHeight, ce = Te.autoWidth, st = Te.unitWidth, Xt = Te.unitHeight, qt = ["tc", "bc"].indexOf(xe) >= 0, ne = ["cl", "cr"].indexOf(xe) >= 0, ae = {};
if (!qt) {
var Zt = Y.getBody().offsetWidth, Ae = Se.w < Zt ? Se.w : Zt;
ae[ge] = ce ? "auto" : "".concat(Ae).concat(st);
}
ne || (ae[be] = pe ? "auto" : "".concat(Se.h).concat(Xt)), V.getDragMode(gt) && (ae.top = "".concat(Se.t).concat(Xt), ae.left = "".concat(Se.l).concat(st));
var Ke = Ft(Ft({}, ae), { __p: !De });
j.addStyle(Ke, { avoidStore: !De }), V.Styles.__emitCmpStyleUpdate(Ke, { components: V.getSelected() });
}
} }, typeof N == "object" && (Lt = Ft(Ft(Ft({}, Lt), N), { parent: Lt })), this.resizer = nt.runCommand("resize", { el: Qt, options: Lt, force: 1 });
} else
nt.stopCommand("resize"), this.resizer = null;
}, updateToolbar: function(Q) {
var j = this.config.em, V = Q == j ? j.getSelected() : Q, Y = this.canvas.getToolbarEl(), nt = Y.style, wt = V.get("toolbar"), rt = j.config.showToolbar;
if (V && rt && wt && wt.length) {
if (nt.display = "", !this.toolbar) {
Y.innerHTML = "", this.toolbar = new M(wt);
var gt = new ee({ collection: this.toolbar, em: j });
Y.appendChild(gt.render().el);
}
this.toolbar.reset(wt), nt.top = "-100px", nt.left = "0";
} else
nt.display = "none";
}, updateToolbarPos: function(Q) {
var j = "px", V = this.canvas.getToolbarEl().style;
V.top = "".concat(Q.top).concat(j), V.left = "".concat(Q.left).concat(j), V.opacity = "";
}, getCanvasPosition: function() {
return this.canvas.getCanvasView().getPosition();
}, getBadge: function(Q) {
return Q === void 0 && (Q = {}), this.canvas.getBadgeEl(Q.view);
}, onFrameScroll: function() {
this.updateTools();
}, updateTools: function() {
this.updateLocalPos(), this.updateGlobalPos();
}, isCompSelected: function(Q) {
return Q && Q.get("status") === "selected";
}, updateToolsLocal: function(Q) {
var j = this.em.getConfig(), V = Q || this.getElHovered(), Y = V.el, nt = V.pos, wt = V.view, rt = V.component;
if (Y) {
var gt = rt.get("hoverable"), N = this.lastHovered !== Y, Lt = N ? {} : { posOnly: 1 };
N && gt && (this.lastHovered = Y, this.showHighlighter(wt), this.showElementOffset(Y, nt, { view: wt })), this.isCompSelected(rt) && (this.hideHighlighter(wt), !j.showOffsetsSelected && this.hideElementOffset(wt));
var Tt = "px", Qt = this.toggleToolsEl(1, wt), Oe = Qt.style, Se = this.canvas.canvasRectOffset(Y, nt), _e = Se.top, De = Se.left;
this.updateBadge(Y, nt, Ft(Ft({}, Lt), { view: wt, topOff: _e, leftOff: De })), Oe.top = _e + Tt, Oe.left = De + Tt, Oe.width = nt.width + Tt, Oe.height = nt.height + Tt, this._trgToolUp("local", { component: rt, el: Qt, top: _e, left: De, width: nt.width, height: nt.height });
} else
this.lastHovered = 0;
}, _upToolbar: (0, _t.debounce)(function() {
this.updateToolsGlobal({ force: 1 });
}, 0), _trgToolUp: function(Q, j) {
j === void 0 && (j = {}), this.em.trigger("canvas:tools:update", Ft({ type: Q }, j));
}, updateToolsGlobal: function(Q) {
Q === void 0 && (Q = {});
var j = this.getElSelected(), V = j.el, Y = j.pos, nt = j.component;
if (!V)
return this.toggleToolsEl(), void (this.lastSelected = 0);
var wt = this.canvas;
(this.lastSelected !== V || Q.force) && (this.lastSelected = V, this.updateToolbar(nt));
var rt = "px", gt = this.toggleToolsEl(1), N = gt.style, Lt = wt.getTargetToElementFixed(V, wt.getToolbarEl(), { pos: Y }), Tt = Lt.canvasOffsetTop, Qt = Lt.canvasOffsetLeft;
N.top = Tt + rt, N.left = Qt + rt, N.width = Y.width + rt, N.height = Y.height + rt, this.updateToolbarPos({ top: Lt.top, left: Lt.left }), this._trgToolUp("global", { component: nt, el: gt, top: Tt, left: Qt, width: Y.width, height: Y.height });
}, updateAttached: (0, _t.debounce)(function() {
this.updateGlobalPos();
}, 0), onContainerChange: (0, _t.debounce)(function() {
this.em.refreshCanvas();
}, 150), getElementPos: function(Q) {
return this.canvas.getCanvasView().getElementPos(Q, { noScroll: !0 });
}, hideBadge: function() {
this.getBadge().style.display = "none";
}, cleanPrevious: function(Q) {
Q && Q.set({ status: "", state: "" });
}, getContentWindow: function() {
return this.canvas.getWindow();
}, run: function(Q) {
(0, Wt.hasWin)() && (this.editor = Q && Q.get("Editor"), this.enable());
}, stop: function(Q, j, V) {
if (V === void 0 && (V = {}), (0, Wt.hasWin)()) {
var Y = this.em, nt = this.editor;
this.onHovered(), this.stopSelectComponent(), !V.preserveSelected && Y.setSelected(), this.toggleToolsEl(), nt && nt.stopCommand("resize");
}
} };
}, 189: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => _t });
var at = pt(895);
const _t = { startSelectPosition: function(J, W, z) {
var k = this;
z === void 0 && (z = {}), this.isPointed = !1;
var P = this.em.Utils, E = J.ownerDocument.body;
P && !this.sorter && (this.sorter = new P.Sorter({ container: E, placer: this.canvas.getPlacerEl(), containerSel: "*", itemSel: "*", pfx: this.ppfx, direction: "a", document: W, wmargin: 1, nested: 1, em: this.em, canvasRelative: 1, scale: function() {
return k.em.getZoomDecimal();
} })), z.onStart && (this.sorter.onStart = z.onStart), J && this.sorter.startSort(J, { container: E });
}, getOffsetDim: function() {
var J = this.offset(this.canvas.getFrameEl()), W = this.offset(this.canvas.getElement());
return { top: J.top - W.top, left: J.left - W.left };
}, stopSelectPosition: function() {
this.posTargetCollection = null, this.posIndex = this.posMethod == "after" && this.cDim.length !== 0 ? this.posIndex + 1 : this.posIndex, this.sorter && (this.sorter.moved = 0, this.sorter.endMove()), this.cDim && (this.posIsLastEl = this.cDim.length !== 0 && this.posMethod == "after" && this.posIndex == this.cDim.length, this.posTargetEl = this.cDim.length === 0 ? (0, at.default)(this.outsideElem) : !this.posIsLastEl && this.cDim[this.posIndex] ? (0, at.default)(this.cDim[this.posIndex][5]).parent() : (0, at.default)(this.outsideElem), this.posTargetModel = this.posTargetEl.data("model"), this.posTargetCollection = this.posTargetEl.data("model-comp"));
}, enable: function() {
this.startSelectPosition();
}, nearFloat: function(J, W, z) {
var k = J || 0, P = W || "before", E = z.length, M = E !== 0 && P == "after" && k == E;
return E !== 0 && (!M && !z[k][4] || z[k - 1] && !z[k - 1][4] || M && !z[k - 1][4]) ? 1 : 0;
}, run: function() {
this.enable();
}, stop: function() {
this.stopSelectPosition(), this.$wrapper.css("cursor", ""), this.$wrapper.unbind();
} };
}, 804: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => z });
var at = pt(50), _t = pt(895), J = pt(163), W = function() {
return W = Object.assign || function(k) {
for (var P, E = 1, M = arguments.length; E < M; E++)
for (var D in P = arguments[E])
Object.prototype.hasOwnProperty.call(P, D) && (k[D] = P[D]);
return k;
}, W.apply(this, arguments);
};
const z = { getOffsetMethod: function(k) {
return "get" + (k || "") + "OffsetViewerEl";
}, run: function(k, P, E) {
var M = E || {}, D = M.state || "", ot = k.getConfig(), it = this.em.getZoomDecimal(), Et = M.el || "";
if (!ot.showOffsets || (0, J.isTextNode)(Et) || !ot.showOffsetsSelected && D == "Fixed")
k.stopCommand("".concat(this.id), E);
else {
var jt = k.Canvas, Dt = W({}, M.elPos || jt.getElementPos(Et));
(0, at.isUndefined)(M.top) || (Dt.top = M.top), (0, at.isUndefined)(M.left) || (Dt.left = M.left);
var ee = window.getComputedStyle(Et), xt = this.ppfx, bt = D + "State", Wt = jt[this.getOffsetMethod(D)](E.view);
Wt.style.opacity = "";
var Ft = this["marginT" + D], Ht = this["marginB" + D], Q = this["marginL" + D], j = this["marginR" + D], V = this["padT" + D], Y = this["padB" + D], nt = this["padL" + D], wt = this["padR" + D];
if (Wt.childNodes.length && (this[bt] = "1", Ft = Wt.querySelector("[data-offset-m-t]"), Ht = Wt.querySelector("[data-offset-m-b]"), Q = Wt.querySelector("[data-offset-m-l]"), j = Wt.querySelector("[data-offset-m-r]"), V = Wt.querySelector("[data-offset-p-t]"), Y = Wt.querySelector("[data-offset-p-b]"), nt = Wt.querySelector("[data-offset-p-l]"), wt = Wt.querySelector("[data-offset-p-r]")), !this[bt]) {
var rt = D.toLowerCase(), gt = rt + "margin-v", N = rt + "padding-v", Lt = (0, _t.default)('
')).get(0), Tt = (0, _t.default)('
')).get(0), Qt = xt + N + "-el", Oe = "".concat(xt + gt + "-el", " ").concat(xt + gt), Se = "".concat(Qt, " ").concat(xt + N);
Ft = (0, _t.default)('
')).get(0), Ht = (0, _t.default)('
')).get(0), Q = (0, _t.default)('
')).get(0), j = (0, _t.default)('
')).get(0), V = (0, _t.default)('
')).get(0), Y = (0, _t.default)('
')).get(0), nt = (0, _t.default)('
')).get(0), wt = (0, _t.default)('
')).get(0), this["marginT" + D] = Ft, this["marginB" + D] = Ht, this["marginL" + D] = Q, this["marginR" + D] = j, this["padT" + D] = V, this["padB" + D] = Y, this["padL" + D] = nt, this["padR" + D] = wt, Lt.appendChild(Ft), Lt.appendChild(Ht), Lt.appendChild(Q), Lt.appendChild(j), Tt.appendChild(V), Tt.appendChild(Y), Tt.appendChild(nt), Tt.appendChild(wt), Wt.appendChild(Lt), Wt.appendChild(Tt), this[bt] = "1";
}
var _e = "px", De = parseFloat(ee.marginLeft.replace(_e, "")) * it, xe = parseFloat(ee.marginRight.replace(_e, "")) * it, Te = parseFloat(ee.marginTop.replace(_e, "")) * it, be = parseFloat(ee.marginBottom.replace(_e, "")) * it, ge = Ft.style, pe = Ht.style, ce = Q.style, st = j.style, Xt = V.style, qt = Y.style, ne = nt.style, ae = wt.style, Zt = parseFloat(Dt.left), Ae = parseFloat(ee.width) * it + _e;
ge.height = Te + _e, ge.width = Ae, ge.top = Dt.top - Te + _e, ge.left = Zt + _e, pe.height = be + _e, pe.width = Ae, pe.top = Dt.top + Dt.height + _e, pe.left = Zt + _e;
var Ke = Dt.height + Te + be + _e, Xe = Dt.top - Te + _e;
ce.height = Ke, ce.width = De + _e, ce.top = Xe, ce.left = Zt - De + _e, st.height = Ke, st.width = xe + _e, st.top = Xe, st.left = Zt + Dt.width + _e;
var vn = parseFloat(ee.paddingTop) * it;
Xt.height = vn + _e;
var Rn = parseFloat(ee.paddingBottom) * it;
qt.height = Rn + _e;
var mt = Dt.height - Rn - vn + _e, zt = Dt.top + vn + _e;
ne.height = mt, ne.width = parseFloat(ee.paddingLeft) * it + _e, ne.top = zt;
var b = parseFloat(ee.paddingRight) * it;
ae.height = mt, ae.width = b + _e, ae.top = zt;
}
}, stop: function(k, P, E) {
E === void 0 && (E = {});
var M = (E || {}).state || "", D = this.getOffsetMethod(M);
k.Canvas[D](E.view).style.opacity = 0;
} };
}, 434: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => _t });
var at = pt(50);
const _t = { init: function() {
(0, at.bindAll)(this, "_onFramesChange");
}, run: function(J) {
this.toggleVis(J);
}, stop: function(J) {
this.toggleVis(J, 0);
}, toggleVis: function(J, W) {
var z = this;
if (W === void 0 && (W = 1), !J.Commands.isActive("preview")) {
var k = J.Canvas, P = W ? "on" : "off";
k.getFrames().forEach(function(E) {
return z._upFrame(E, W);
}), k.getModel()[P]("change:frames", this._onFramesChange);
}
}, _onFramesChange: function(J, W) {
var z = this;
W.forEach(function(k) {
return k.once("loaded", function() {
return z._upFrame(k, !0);
});
});
}, _upFrame: function(J, W) {
var z, k = W ? "add" : "remove";
(z = J.view) === null || z === void 0 || z.getBody().classList[k]("".concat(this.ppfx, "dashed"));
} };
}, 346: (S, H, pt) => {
pt.d(H, { FE: () => k, G7: () => P, Hn: () => z });
var at, _t = pt(316), J = pt.n(_t), W = (at = function(E, M) {
return at = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(D, ot) {
D.__proto__ = ot;
} || function(D, ot) {
for (var it in ot)
Object.prototype.hasOwnProperty.call(ot, it) && (D[it] = ot[it]);
}, at(E, M);
}, function(E, M) {
if (typeof M != "function" && M !== null)
throw new TypeError("Class extends value " + String(M) + " is not a constructor or null");
function D() {
this.constructor = E;
}
at(E, M), E.prototype = M === null ? Object.create(M) : (D.prototype = M.prototype, new D());
}), z = function(E) {
function M() {
return E !== null && E.apply(this, arguments) || this;
}
return W(M, E), M;
}(J().Model), k = function(E) {
function M() {
return E !== null && E.apply(this, arguments) || this;
}
return W(M, E), M;
}(J().Collection), P = function(E) {
function M() {
return E !== null && E.apply(this, arguments) || this;
}
return W(M, E), M;
}(J().View);
}, 330: (S, H, pt) => {
pt.d(H, { Z: () => k });
var at, _t = pt(50), J = pt(346), W = (at = function(P, E) {
return at = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(M, D) {
M.__proto__ = D;
} || function(M, D) {
for (var ot in D)
Object.prototype.hasOwnProperty.call(D, ot) && (M[ot] = D[ot]);
}, at(P, E);
}, function(P, E) {
if (typeof E != "function" && E !== null)
throw new TypeError("Class extends value " + String(E) + " is not a constructor or null");
function M() {
this.constructor = P;
}
at(P, E), P.prototype = E === null ? Object.create(E) : (M.prototype = E.prototype, new M());
}), z = function(P) {
function E(M, D, ot) {
M === void 0 && (M = {}), ot === void 0 && (ot = !1);
var it = P.call(this, M) || this;
return it.itemsView = "", it.itemType = "type", it.reuseView = !1, it.config = D || M.config || {}, ot && it.listenTo(it.collection, "add", it.addTo), it.items = [], it;
}
return W(E, P), E.prototype.addTo = function(M) {
this.add(M);
}, E.prototype.itemViewNotFound = function(M) {
var D = this.config, ot = this.ns, it = D.em, Et = "".concat(ot ? "[".concat(ot, "]: ") : "", "'").concat(M, "' type not found");
it && it.logWarning(Et);
}, E.prototype.add = function(M, D) {
var ot, it = this, Et = it.config, jt = it.reuseView, Dt = it.items, ee = this.itemsView || {}, xt = D || null, bt = this.itemView, Wt = M.get(this.itemType);
ee[Wt] ? bt = ee[Wt] : !Wt || ee[Wt] || (0, _t.includes)(["button", "checkbox", "color", "date", "datetime-local", "email", "file", "hidden", "image", "month", "number", "password", "radio", "range", "reset", "search", "submit", "tel", "text", "time", "url", "week"], Wt) || this.itemViewNotFound(Wt), ot = M.view && jt ? M.view : new bt({ model: M, config: Et }, Et), Dt && Dt.push(ot);
var Ft = ot.render().el;
xt ? xt.appendChild(Ft) : this.$el.append(Ft);
}, E.prototype.render = function() {
var M = document.createDocumentFragment();
return this.clearItems(), this.$el.empty(), this.collection.length && this.collection.each(function(D) {
this.add(D, M);
}, this), this.$el.append(M), this.onRender(), this;
}, E.prototype.onRender = function() {
}, E.prototype.onRemoveBefore = function(M, D) {
}, E.prototype.onRemove = function(M, D) {
}, E.prototype.remove = function(M) {
M === void 0 && (M = {});
var D = this.items;
return this.onRemoveBefore(D, M), this.clearItems(), P.prototype.remove.call(this), this.onRemove(D, M), this;
}, E.prototype.clearItems = function() {
this.items;
}, E;
}(J.G7);
const k = z;
z.prototype.itemView = "";
}, 668: (S, H, pt) => {
pt.d(H, { Z: () => z });
var at = pt(50), _t = pt(163), J = function() {
return J = Object.assign || function(k) {
for (var P, E = 1, M = arguments.length; E < M; E++)
for (var D in P = arguments[E])
Object.prototype.hasOwnProperty.call(P, D) && (k[D] = P[D]);
return k;
}, J.apply(this, arguments);
}, W = ["x", "y"];
const z = function() {
function k(P) {
return P === void 0 && (P = {}), this.opts = { snapOffset: 5, scale: 1 }, (0, at.bindAll)(this, "drag", "stop", "keyHandle", "handleScroll"), this.setOptions(P), 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 k.prototype.setOptions = function(P) {
P === void 0 && (P = {}), this.opts = J(J({}, this.opts), P);
}, k.prototype.toggleDrag = function(P) {
var E = this.getDocumentEl(), M = this.getContainerEl(), D = this.getWindowEl(), ot = P ? "on" : "off", it = { on: _t.on, off: _t.off };
it[ot](M, "mousemove dragover", this.drag), it[ot](E, "mouseup dragend touchend", this.stop), it[ot](E, "keydown", this.keyHandle), it[ot](D, "scroll", this.handleScroll);
}, k.prototype.handleScroll = function() {
var P = this.lastScroll, E = this.delta, M = this.getScrollInfo(), D = { x: M.x - P.x, y: M.y - P.y };
this.move(E.x + D.x, E.y + D.y), this.lastScrollDiff = D;
}, k.prototype.start = function(P) {
var E = this.opts, M = E.onStart;
this.toggleDrag(!0), this.startPointer = this.getPointerPos(P), this.guidesStatic = (0, at.result)(E, "guidesStatic") || [], this.guidesTarget = (0, at.result)(E, "guidesTarget") || [], (0, at.isFunction)(M) && M(P, this), this.startPosition = this.getStartPosition(), this.lastScrollDiff = { x: 0, y: 0 }, this.globScrollDiff = { x: 0, y: 0 }, this.drag(P);
}, k.prototype.drag = function(P) {
var E = this, M = this, D = M.opts, ot = M.lastScrollDiff, it = M.globScrollDiff, Et = D.onDrag, jt = this.startPointer, Dt = this.getPointerPos(P), ee = { x: it.x + ot.x, y: it.y + ot.y };
this.globScrollDiff = ee;
var xt = { x: Dt.x - jt.x + ee.x, y: Dt.y - jt.y + ee.y };
this.lastScrollDiff = { x: 0, y: 0 };
var bt = this.lockedAxis;
(bt = P.shiftKey ? !bt && this.detectAxisLock(xt.x, xt.y) : null) === "x" ? xt.x = jt.x : bt === "y" && (xt.y = jt.y);
var Wt = function(Y) {
W.forEach(function(nt) {
return Y[nt] = Y[nt] * (0, at.result)(D, "scale");
}), E.delta = Y, E.move(Y.x, Y.y), (0, at.isFunction)(Et) && Et(P, E);
}, Ft = J({}, xt);
if (this.currentPointer = Dt, this.lockedAxis = bt, this.lastScroll = this.getScrollInfo(), Wt(xt), this.guidesTarget.length) {
var Ht = this.snapGuides(Ft), Q = Ht.newDelta, j = Ht.trgX, V = Ht.trgY;
(j || V) && Wt(Q);
}
P.which === 0 && this.stop(P);
}, k.prototype.snapGuides = function(P) {
var E = this, M = P, D = this.trgX, ot = this.trgY;
return this.guidesTarget.forEach(function(it) {
it.x && E.trgX || it.y && E.trgY || (it.active = !1, E.guidesStatic.forEach(function(Et) {
if (!(it.y && Et.x || it.x && Et.y)) {
var jt = it.y && Et.y, Dt = jt ? "y" : "x", ee = it[Dt], xt = Et[Dt], bt = P[Dt], Wt = jt ? ot : D;
if (E.isPointIn(ee, xt) && (0, at.isUndefined)(Wt)) {
var Ft = bt - (ee - xt);
E.setGuideLock(it, Ft);
}
}
}));
}), D = this.trgX, ot = this.trgY, W.forEach(function(it) {
var Et = it.toUpperCase(), jt = E["trg".concat(Et)];
jt && !E.isPointIn(P[it], jt.lock) && (E.setGuideLock(jt, null), jt = null), jt && !(0, at.isUndefined)(jt.lock) && (M[it] = jt.lock);
}), { newDelta: M, trgX: this.trgX, trgY: this.trgY };
}, k.prototype.isPointIn = function(P, E, M) {
var D = (M === void 0 ? {} : M).offset || this.opts.snapOffset || 0;
return P >= E && P <= E + D || P <= E && P >= E - D;
}, k.prototype.setGuideLock = function(P, E) {
var M = (0, at.isUndefined)(P.x) ? "Y" : "X", D = "trg".concat(M);
return E !== null ? (P.active = !0, P.lock = E, this[D] = P) : (delete P.active, delete P.lock, delete this[D]), P;
}, k.prototype.stop = function(P, E) {
E === void 0 && (E = {});
var M = this.delta, D = !!E.cancel, ot = D ? 0 : M.x, it = D ? 0 : M.y;
this.toggleDrag(), this.lockedAxis = null, this.move(ot, it, !0);
var Et = this.opts.onEnd;
(0, at.isFunction)(Et) && Et(P, this, { cancelled: D });
}, k.prototype.keyHandle = function(P) {
(0, _t.isEscKey)(P) && this.stop(P, { cancel: !0 });
}, k.prototype.move = function(P, E, M) {
var D = this.el, ot = this.opts, it = this.startPosition;
if (it) {
var Et = ot.setPosition, jt = it.x + P, Dt = it.y + E;
this.position = { x: jt, y: Dt, end: M }, (0, at.isFunction)(Et) && Et(this.position), D && (D.style.left = "".concat(jt, "px"), D.style.top = "".concat(Dt, "px"));
}
}, k.prototype.getContainerEl = function() {
var P = this.opts.container;
return P ? [P] : this.getDocumentEl();
}, k.prototype.getWindowEl = function() {
return this.getContainerEl().map(function(P) {
var E = P.ownerDocument || P;
return E.defaultView || E.parentWindow;
});
}, k.prototype.getDocumentEl = function(P) {
var E = this.opts.doc;
if (P = P || this.el, !this.docs.length) {
var M = [document];
P && M.push(P.ownerDocument), E && M.push(E), this.docs = M;
}
return this.docs;
}, k.prototype.getPointerPos = function(P) {
var E = this.opts.getPointerPosition, M = (0, _t.getPointerEvent)(P);
return E ? E(P) : { x: M.clientX, y: M.clientY };
}, k.prototype.getStartPosition = function() {
var P = this.el, E = this.opts.getPosition, M = { x: 0, y: 0 };
return (0, at.isFunction)(E) ? M = E() : P && (M = { x: parseFloat(P.style.left), y: parseFloat(P.style.top) }), M;
}, k.prototype.getScrollInfo = function() {
var P = this.opts.doc, E = P && P.body;
return { y: E ? E.scrollTop : 0, x: E ? E.scrollLeft : 0 };
}, k.prototype.detectAxisLock = function(P, E) {
var M = P, D = E, ot = Math.abs(M), it = Math.abs(D);
return D >= ot || D <= -ot ? "x" : M > it || M < -it ? "y" : void 0;
}, k;
}();
}, 895: (S, H, pt) => {
pt.r(H), pt.d(H, { default: () => Kt });
var at = typeof document < "u" ? document : null, _t = typeof window < "u" ? window : null, J = Array.prototype, W = J.filter, z = J.indexOf, k = J.map, P = J.push, E = J.reverse, M = J.slice, D = J.splice, ot = /^#[\w-]*$/, it = /^\.[\w-]*$/, Et = /<.+>/, jt = /^\w+$/;
function Dt(R, tt) {
return tt === void 0 && (tt = at), it.test(R) ? tt.getElementsByClassName(R.slice(1)) : jt.test(R) ? tt.getElementsByTagName(R) : tt.querySelectorAll(R);
}
function ee(R, tt) {
if (tt === void 0 && (tt = at), R) {
if (R.__cash)
return R;
var ut = R;
if (nt(R)) {
if (tt.__cash && (tt = tt[0]), !(ut = ot.test(R) ? tt.getElementById(R.slice(1)) : Et.test(R) ? Ve(R) : Dt(R, tt)))
return;
} else if (Y(R))
return this.ready(R);
(ut.nodeType || ut === _t) && (ut = [ut]), this.length = ut.length;
for (var yt = 0, Yt = this.length; yt < Yt; yt++)
this[yt] = ut[yt];
}
}
function xt(R, tt) {
return new ee(R, tt);
}
var bt = xt.fn = xt.prototype = ee.prototype = { constructor: xt, __cash: !0, length: 0, splice: D };
bt.get = function(R) {
return R === void 0 ? M.call(this) : this[R < 0 ? R + this.length : R];
}, bt.eq = function(R) {
return xt(this.get(R));
}, bt.first = function() {
return this.eq(0);
}, bt.last = function() {
return this.eq(-1);
}, bt.map = function(R) {
return xt(k.call(this, function(tt, ut) {
return R.call(tt, ut, tt);
}));
}, bt.slice = function() {
return xt(M.apply(this, arguments));
};
var Wt = /(?:^\w|[A-Z]|\b\w)/g, Ft = /[\s-_]+/g;
function Ht(R) {
return R.replace(Wt, function(tt, ut) {
return tt[ut ? "toUpperCase" : "toLowerCase"]();
}).replace(Ft, "");
}
function Q(R, tt) {
for (var ut = 0, yt = R.length; ut < yt && tt.call(R[ut], R[ut], ut, R) !== !1; ut++)
;
}
xt.camelCase = Ht, xt.each = Q, bt.each = function(R) {
return Q(this, function(tt, ut) {
return R.call(tt, ut, tt);
}), this;
}, bt.removeProp = function(R) {
return this.each(function(tt, ut) {
delete ut[R];
});
}, xt.extend = bt.extend = function(R) {
R === void 0 && (R = this);
for (var tt = arguments, ut = tt.length, yt = ut < 2 ? 0 : 1; yt < ut; yt++)
for (var Yt in tt[yt])
R[Yt] = tt[yt][Yt];
return R;
};
var j = 1;
function V(R, tt) {
var ut = R && (R.matches || R.webkitMatchesSelector || R.mozMatchesSelector || R.msMatchesSelector || R.oMatchesSelector);
return !!ut && ut.call(R, tt);
}
function Y(R) {
return typeof R == "function";
}
function nt(R) {
return typeof R == "string";
}
function wt(R) {
return !isNaN(parseFloat(R)) && isFinite(R);
}
xt.guid = j, xt.matches = V, xt.isFunction = Y, xt.isString = nt, xt.isNumeric = wt;
var rt = Array.isArray;
function gt(R) {
return nt(R) ? function(tt, ut) {
return V(ut, R);
} : R.__cash ? function(tt, ut) {
return R.is(ut);
} : function(tt, ut, yt) {
return ut === yt;
};
}
xt.isArray = rt, bt.prop = function(R, tt) {
if (R) {
if (nt(R))
return arguments.length < 2 ? this[0] && this[0][R] : this.each(function(yt, Yt) {
Yt[R] = tt;
});
for (var ut in R)
this.prop(ut, R[ut]);
return this;
}
}, bt.filter = function(R) {
if (!R)
return xt();
var tt = Y(R) ? R : gt(R);
return xt(W.call(this, function(ut, yt) {
return tt.call(ut, yt, ut, R);
}));
};
var N = /\S+/g;
function Lt(R) {
return nt(R) && R.match(N) || [];
}
function Tt(R) {
return R.filter(function(tt, ut, yt) {
return yt.indexOf(tt) === ut;
});
}
function Qt(R, tt, ut) {
if (R.nodeType === 1) {
var yt = _t.getComputedStyle(R, null);
return tt ? ut ? yt.getPropertyValue(tt) : yt[tt] : yt;
}
}
function Oe(R, tt) {
return parseInt(Qt(R, tt), 10) || 0;
}
bt.hasClass = function(R) {
var tt = Lt(R), ut = !1;
return tt.length && this.each(function(yt, Yt) {
return !(ut = Yt.classList.contains(tt[0]));
}), ut;
}, bt.removeAttr = function(R) {
var tt = Lt(R);
return tt.length ? this.each(function(ut, yt) {
Q(tt, function(Yt) {
yt.removeAttribute(Yt);
});
}) : this;
}, bt.attr = function(R, tt) {
if (R) {
if (nt(R)) {
if (arguments.length < 2) {
if (!this[0])
return;
var ut = this[0].getAttribute(R);
return ut === null ? void 0 : ut;
}
return tt === null ? this.removeAttr(R) : this.each(function(Yt, he) {
he.setAttribute(R, tt);
});
}
for (var yt in R)
this.attr(yt, R[yt]);
return this;
}
}, bt.toggleClass = function(R, tt) {
var ut = Lt(R), yt = tt !== void 0;
return ut.length ? this.each(function(Yt, he) {
Q(ut, function(Re) {
yt ? tt ? he.classList.add(Re) : he.classList.remove(Re) : he.classList.toggle(Re);
});
}) : this;
}, bt.addClass = function(R) {
return this.toggleClass(R, !0);
}, bt.removeClass = function(R) {
return arguments.length ? this.toggleClass(R, !1) : this.attr("class", "");
}, xt.unique = Tt, bt.add = function(R, tt) {
return xt(Tt(this.get().concat(xt(R, tt).get())));
};
var Se = /^--/;
function _e(R) {
return Se.test(R);
}
var De = {}, xe = at && at.createElement("div"), Te = xe ? xe.style : {}, be = ["webkit", "moz", "ms", "o"];
function ge(R, tt) {
if (tt === void 0 && (tt = _e(R)), tt)
return R;
if (!De[R]) {
var ut = Ht(R), yt = "" + ut.charAt(0).toUpperCase() + ut.slice(1);
Q((ut + " " + be.join(yt + " ") + yt).split(" "), function(Yt) {
if (Yt in Te)
return De[R] = Yt, !1;
});
}
return De[R];
}
xt.prefixedProp = ge;
var pe = { animationIterationCount: !0, columnCount: !0, flexGrow: !0, flexShrink: !0, fontWeight: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0 };
function ce(R, tt, ut) {
return ut === void 0 && (ut = _e(R)), ut || pe[R] || !wt(tt) ? tt : tt + "px";
}
bt.css = function(R, tt) {
if (nt(R)) {
var ut = _e(R);
return R = ge(R, ut), arguments.length < 2 ? this[0] && Qt(this[0], R, ut) : R ? (tt = ce(R, tt, ut), this.each(function(Yt, he) {
he.nodeType === 1 && (ut ? he.style.setProperty(R, tt) : he.style[R] = tt);
})) : this;
}
for (var yt in R)
this.css(yt, R[yt]);
return this;
};
var st = "__cashData", Xt = /^data-(.*)/;
function qt(R) {
return R[st] = R[st] || {};
}
function ne(R, tt) {
var ut = qt(R);
if (tt) {
if (!(tt in ut)) {
var yt = R.dataset ? R.dataset[tt] || R.dataset[Ht(tt)] : xt(R).attr("data-" + tt);
if (yt !== void 0) {
try {
yt = JSON.parse(yt);
} catch {
}
ut[tt] = yt;
}
}
return ut[tt];
}
return ut;
}
function ae(R, tt) {
return Oe(R, "border" + (tt ? "Left" : "Top") + "Width") + Oe(R, "padding" + (tt ? "Left" : "Top")) + Oe(R, "padding" + (tt ? "Right" : "Bottom")) + Oe(R, "border" + (tt ? "Right" : "Bottom") + "Width");
}
function Zt(R, tt) {
for (var ut = 0, yt = tt.length; ut < yt; ut++)
if (R.indexOf(tt[ut]) < 0)
return !1;
return !0;
}
function Ae(R, tt, ut) {
Q(R[ut], function(yt) {
yt[0];
var Yt = yt[1];
tt.removeEventListener(ut, Yt);
}), delete R[ut];
}
xt.hasData = function(R) {
return st in R;
}, bt.data = function(R, tt) {
var ut = this;
if (!R)
return this[0] ? (Q(this[0].attributes, function(Yt) {
var he = Yt.name.match(Xt);
he && ut.data(he[1]);
}), ne(this[0])) : void 0;
if (nt(R))
return tt === void 0 ? this[0] && ne(this[0], R) : this.each(function(Yt, he) {
return function(Re, We, Ln) {
qt(Re)[We] = Ln;
}(he, R, tt);
});
for (var yt in R)
this.data(yt, R[yt]);
return this;
}, bt.removeData = function(R) {
return this.each(function(tt, ut) {
return function(yt, Yt) {
Yt === void 0 ? delete yt[st] : delete qt(yt)[Yt];
}(ut, R);
});
}, Q(["Width", "Height"], function(R) {
bt["inner" + R] = function() {
if (this[0])
return this[0] === _t ? _t["inner" + R] : this[0]["client" + R];
};
}), Q(["width", "height"], function(R, tt) {
bt[R] = function(ut) {
return this[0] ? arguments.length ? (ut = parseInt(ut, 10), this.each(function(yt, Yt) {
if (Yt.nodeType === 1) {
var he = Qt(Yt, "boxSizing");
Yt.style[R] = ce(R, ut + (he === "border-box" ? ae(Yt, !tt) : 0));
}
})) : this[0] === _t ? this[0][Ht("outer-" + R)] : this[0].getBoundingClientRect()[R] - ae(this[0], !tt) : ut === void 0 ? void 0 : this;
};
}), Q(["Width", "Height"], function(R, tt) {
bt["outer" + R] = function(ut) {
if (this[0])
return this[0] === _t ? _t["outer" + R] : this[0]["offset" + R] + (ut ? Oe(this[0], "margin" + (tt ? "Top" : "Left")) + Oe(this[0], "margin" + (tt ? "Bottom" : "Right")) : 0);
};
});
var Ke = "__cashEvents", Xe = ".";
function vn(R) {
return R[Ke] = R[Ke] || {};
}
function Rn(R) {
var tt = R.split(Xe);
return [tt[0], tt.slice(1).sort()];
}
function mt(R, tt, ut, yt) {
var Yt = vn(R);
if (tt) {
var he = Yt[tt];
if (!he)
return;
yt && (yt.guid = yt.guid || j++), Yt[tt] = he.filter(function(Re) {
var We = Re[0], Ln = Re[1];
if (yt && Ln.guid !== yt.guid || !Zt(We, ut))
return !0;
R.removeEventListener(tt, Ln);
});
} else if (ut && ut.length)
for (tt in Yt)
mt(R, tt, ut, yt);
else
for (tt in Yt)
Ae(Yt, R, tt);
}
bt.off = function(R, tt) {
var ut = this;
return R === void 0 ? this.each(function(yt, Yt) {
return mt(Yt);
}) : Q(Lt(R), function(yt) {
var Yt = Rn(yt), he = Yt[0], Re = Yt[1];
ut.each(function(We, Ln) {
return mt(Ln, he, Re, tt);
});
}), this;
}, bt.on = function(R, tt, ut, yt) {
var Yt = this;
if (!nt(R)) {
for (var he in R)
this.on(he, tt, R[he]);
return this;
}
return Y(tt) && (ut = tt, tt = !1), Q(Lt(R), function(Re) {
var We = Rn(Re), Ln = We[0], pn = We[1];
Yt.each(function(Ne, Ar) {
var Yn = function jr(fn) {
if (!fn.namespace || Zt(pn, fn.namespace.split(Xe))) {
var _n = Ar;
if (tt) {
for (var Bn = fn.target; !V(Bn, tt); )
if (Bn === Ar || !(Bn = Bn.parentNode))
return;
_n = Bn;
}
fn.namespace = fn.namespace || "";
var Mr = ut.call(_n, fn, fn.data);
yt && mt(Ar, Ln, pn, jr), Mr === !1 && (fn.preventDefault(), fn.stopPropagation());
}
};
Yn.guid = ut.guid = ut.guid || j++, function(jr, fn, _n, Bn) {
Bn.guid = Bn.guid || j++;
var Mr = vn(jr);
Mr[fn] = Mr[fn] || [], Mr[fn].push([_n, Bn]), jr.addEventListener(fn, Bn);
}(Ar, Ln, pn, Yn);
});
}), this;
}, bt.one = function(R, tt, ut) {
return this.on(R, tt, ut, !0);
}, bt.ready = function(R) {
var tt = function() {
return R(xt);
};
return at.readyState !== "loading" ? setTimeout(tt) : at.addEventListener("DOMContentLoaded", tt), this;
}, bt.trigger = function(R, tt) {
var ut = R;
if (nt(R)) {
var yt = Rn(R), Yt = yt[0], he = yt[1];
(ut = at.createEvent("HTMLEvents")).initEvent(Yt, !0, !0), ut.namespace = he.join(Xe);
}
return ut.data = tt, this.each(function(Re, We) {
We.dispatchEvent(ut);
});
};
var zt = /select-one/i, b = /select-multiple/i;
function I(R) {
var tt = R.type;
return zt.test(tt) ? function(ut) {
return ut.selectedIndex < 0 ? null : ut.options[ut.selectedIndex].value;
}(R) : b.test(tt) ? function(ut) {
var yt = [];
return Q(ut.options, function(Yt) {
!Yt.selected || Yt.disabled || Yt.parentNode.disabled || yt.push(Yt.value);
}), yt;
}(R) : R.value;
}
var U = /%20/g, ht = /file|reset|submit|button|image/i, kt = /radio|checkbox/i;
bt.serialize = function() {
var R = "";
return this.each(function(tt, ut) {
Q(ut.elements || [ut], function(yt) {
if (!yt.disabled && yt.name && yt.tagName !== "FIELDSET" && !ht.test(yt.type) && (!kt.test(yt.type) || yt.checked)) {
var Yt = I(yt);
Yt !== void 0 && Q(rt(Yt) ? Yt : [Yt], function(he) {
R += function(Re, We) {
return "&" + encodeURIComponent(Re) + "=" + encodeURIComponent(We).replace(U, "+");
}(yt.name, he);
});
}
});
}), R.substr(1);
}, bt.val = function(R) {
return R === void 0 ? this[0] && I(this[0]) : this.each(function(tt, ut) {
var yt = b.test(ut.type), Yt = R === null ? yt ? [] : "" : R;
yt && rt(Yt) ? Q(ut.options, function(he) {
he.selected = Yt.indexOf(he.value) >= 0;
}) : ut.value = Yt;
});
}, bt.clone = function() {
return this.map(function(R, tt) {
return tt.cloneNode(!0);
});
}, bt.detach = function() {
return this.each(function(R, tt) {
tt.parentNode && tt.parentNode.removeChild(tt);
});
};
var Ot, fe = /^\s*<(\w+)[^>]*>/, ke = /^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;
function Ve(R) {
if (function() {
if (!Ot) {
var yt = at.createElement("table"), Yt = at.createElement("tr");
Ot = { "*": at.createElement("div"), tr: at.createElement("tbody"), td: Yt, th: Yt, thead: yt, tbody: yt, tfoot: yt };
}
}(), !nt(R))
return [];
if (ke.test(R))
return [at.createElement(RegExp.$1)];
var tt = fe.test(R) && RegExp.$1, ut = Ot[tt] || Ot["*"];
return ut.innerHTML = R, xt(ut.childNodes).detach().get();
}
function ze(R, tt, ut) {
if (tt !== void 0) {
var yt = nt(tt);
!yt && tt.length ? Q(tt, function(Yt) {
return ze(R, Yt, ut);
}) : Q(R, yt ? function(Yt) {
Yt.insertAdjacentHTML(ut ? "afterbegin" : "beforeend", tt);
} : function(Yt, he) {
return function(Re, We, Ln) {
Ln ? Re.insertBefore(We, Re.childNodes[0]) : Re.appendChild(We);
}(Yt, he ? tt.cloneNode(!0) : tt, ut);
});
}
}
xt.parseHTML = Ve, bt.empty = function() {
var R = this[0];
if (R)
for (; R.firstChild; )
R.removeChild(R.firstChild);
return this;
}, bt.append = function() {
var R = this;
return Q(arguments, function(tt) {
ze(R, tt);
}), this;
}, bt.appendTo = function(R) {
return ze(xt(R), this), this;
}, bt.html = function(R) {
if (R === void 0)
return this[0] && this[0].innerHTML;
var tt = R.nodeType ? R[0].outerHTML : R;
return this.each(function(ut, yt) {
yt.innerHTML = tt;
});
}, bt.insertAfter = function(R) {
var tt = this;
return xt(R).each(function(ut, yt) {
var Yt = yt.parentNode;
tt.each(function(he, Re) {
Yt.insertBefore(ut ? Re.cloneNode(!0) : Re, yt.nextSibling);
});
}), this;
}, bt.after = function() {
var R = this;
return Q(E.apply(arguments), function(tt) {
E.apply(xt(tt).slice()).insertAfter(R);
}), this;
}, bt.insertBefore = function(R) {
var tt = this;
return xt(R).each(function(ut, yt) {
var Yt = yt.parentNode;
tt.each(function(he, Re) {
Yt.insertBefore(ut ? Re.cloneNode(!0) : Re, yt);
});
}), this;
}, bt.before = function() {
var R = this;
return Q(arguments, function(tt) {
xt(tt).insertBefore(R);
}), this;
}, bt.prepend = function() {
var R = this;
return Q(arguments, function(tt) {
ze(R, tt, !0);
}), this;
}, bt.prependTo = function(R) {
return ze(xt(R), E.apply(this.slice()), !0), this;
}, bt.remove = function() {
return this.detach().off();
}, bt.replaceWith = function(R) {
var tt = this;
return this.each(function(ut, yt) {
var Yt = yt.parentNode;
if (Yt) {
var he = ut ? xt(R).clone() : xt(R);
if (!he[0])
return tt.remove(), !1;
Yt.replaceChild(he[0], yt), xt(he[0]).after(he.slice(1));
}
});
}, bt.replaceAll = function(R) {
return xt(R).replaceWith(this), this;
}, bt.text = function(R) {
return R === void 0 ? this[0] ? this[0].textContent : "" : this.each(function(tt, ut) {
ut.textContent = R;
});
};
var Qe = at && at.documentElement;
bt.offset = function() {
var R = this[0];
if (R) {
var tt = R.getBoundingClientRect();
return { top: tt.top + _t.pageYOffset - Qe.clientTop, left: tt.left + _t.pageXOffset - Qe.clientLeft };
}
}, bt.offsetParent = function() {
return xt(this[0] && this[0].offsetParent);
}, bt.position = function() {
var R = this[0];
if (R)
return { left: R.offsetLeft, top: R.offsetTop };
}, bt.children = function(R) {
var tt = [];
return this.each(function(ut, yt) {
P.apply(tt, yt.children);
}), tt = xt(Tt(tt)), R ? tt.filter(function(ut, yt) {
return V(yt, R);
}) : tt;
}, bt.contents = function() {
var R = [];
return this.each(function(tt, ut) {
P.apply(R, ut.tagName === "IFRAME" ? [ut.contentDocument] : ut.childNodes);
}), xt(R.length && Tt(R));
}, bt.find = function(R) {
for (var tt = [], ut = 0, yt = this.length; ut < yt; ut++) {
var Yt = Dt(R, this[ut]);
Yt.length && P.apply(tt, Yt);
}
return xt(tt.length && Tt(tt));
}, bt.has = function(R) {
var tt = nt(R) ? function(ut, yt) {
return !!Dt(R, yt).length;
} : function(ut, yt) {
return yt.contains(R);
};
return this.filter(tt);
}, bt.is = function(R) {
if (!R || !this[0])
return !1;
var tt = gt(R), ut = !1;
return this.each(function(yt, Yt) {
return !(ut = tt(yt, Yt, R));
}), ut;
}, bt.next = function() {
return xt(this[0] && this[0].nextElementSibling);
}, bt.not = function(R) {
if (!R || !this[0])
return this;
var tt = gt(R);
return this.filter(function(ut, yt) {
return !tt(ut, yt, R);
});
}, bt.parent = function() {
var R = [];
return this.each(function(tt, ut) {
ut && ut.parentNode && R.push(ut.parentNode);
}), xt(Tt(R));
}, bt.index = function(R) {
var tt = R ? xt(R)[0] : this[0], ut = R ? this : xt(tt).parent().children();
return z.call(ut, tt);
}, bt.closest = function(R) {
return R && this[0] ? this.is(R) ? this.filter(R) : this.parent().closest(R) : xt();
}, bt.parents = function(R) {
var tt, ut = [];
return this.each(function(yt, Yt) {
for (tt = Yt; tt && tt.parentNode && tt !== at.body.parentNode; )
tt = tt.parentNode, (!R || R && V(tt, R)) && ut.push(tt);
}), xt(Tt(ut));
}, bt.prev = function() {
return xt(this[0] && this[0].previousElementSibling);
}, bt.siblings = function() {
var R = this[0];
return this.parent().children().filter(function(tt, ut) {
return ut !== R;
});
};
const Kt = xt;
}, 491: (S, H, pt) => {
pt.d(H, { $Q: () => Et, FW: () => D, G1: () => z, GX: () => Wt, L_: () => P, Mx: () => k, R3: () => jt, SJ: () => bt, cx: () => E, dL: () => it, pn: () => ot, rw: () => ee, sE: () => M, t3: () => xt, ut: () => Dt });
var at = pt(50), _t = function(Ft, Ht, Q) {
if (Q || arguments.length === 2)
for (var j, V = 0, Y = Ht.length; V < Y; V++)
!j && V in Ht || (j || (j = Array.prototype.slice.call(Ht, 0, V)), j[V] = Ht[V]);
return Ft.concat(j || Array.prototype.slice.call(Ht));
}, J = "tag", W = "attributes", z = "transitionend oTransitionEnd transitionend webkitTransitionEnd", k = function(Ft) {
return Ft && Ft.nodeType === 9;
}, P = function(Ft) {
var Ht = Ft && Ft.parentNode;
Ht && Ht.removeChild(Ft);
};
function E() {
for (var Ft = [], Ht = 0; Ht < arguments.length; Ht++)
Ft[Ht] = arguments[Ht];
var Q = Array.isArray(Ft[0]) ? Ft[0] : _t([], Ft, !0);
return Q.filter(Boolean).join(" ");
}
var M = function(Ft, Ht) {
return Ft.querySelectorAll(Ht);
}, D = function(Ft, Ht) {
return Ht === void 0 && (Ht = {}), Ft && Ft.setAttribute && (0, at.each)(Ht, function(Q, j) {
return Ft.setAttribute(j, Q);
});
}, ot = function(Ft) {
return Ft && !!(Ft.offsetWidth || Ft.offsetHeight || Ft.getClientRects().length);
}, it = function(Ft, Ht) {
var Q;
(Q = Ft.parentNode) === null || Q === void 0 || Q.replaceChild(Ht, Ft);
}, Et = function(Ft, Ht, Q) {
var j = Ft.childNodes, V = j.length, Y = (0, at.isUndefined)(Q) ? V : Q;
(0, at.isString)(Ht) && (Ft.insertAdjacentHTML("beforeEnd", Ht), Ht = Ft.lastChild, Ft.removeChild(Ht)), Y >= V ? Ft.appendChild(Ht) : Ft.insertBefore(Ht, j[Y]);
}, jt = function(Ft, Ht) {
return Et(Ft, Ht);
}, Dt = function(Ft, Ht, Q) {
Ht === void 0 && (Ht = {});
var j = document.createElement(Ft);
return Ht && (0, at.each)(Ht, function(V, Y) {
return j.setAttribute(Y, V);
}), Q && ((0, at.isString)(Q) ? j.innerHTML = Q : j.appendChild(Q)), j;
}, ee = function(Ft) {
return document.createTextNode(Ft);
}, xt = function(Ft, Ht) {
var Q, j = Ft.type;
try {
Q = new window[Ht](j, Ft);
} catch {
(Q = document.createEvent(Ht)).initEvent(j, !0, !0);
}
return Q._parentEvent = Ft, j.indexOf("key") === 0 && (Q.keyCodeVal = Ft.keyCode, ["keyCode", "which"].forEach(function(V) {
Object.defineProperty(Q, V, { get: function() {
return this.keyCodeVal;
} });
})), Q;
}, bt = function(Ft, Ht) {
Ht === void 0 && (Ht = []), (Array.isArray(Ht) ? Ht : [Ht]).forEach(function(Q) {
var j = Q[J] || "div", V = Q[W] || {}, Y = document.createElement(j);
(0, at.each)(V, function(nt, wt) {
Y.setAttribute(wt, nt);
}), Ft.appendChild(Y);
});
}, Wt = function(Ft) {
var Ht = (Ft == null ? void 0 : Ft.ownerDocument) || document, Q = Ht.documentElement, j = Ht.defaultView || window;
return { x: (j.pageXOffset || Q.scrollLeft || 0) - (Q.clientLeft || 0), y: (j.pageYOffset || Q.scrollTop || 0) - (Q.clientTop || 0) };
};
}, 163: (S, H, pt) => {
pt.r(H), pt.d(H, { appendStyles: () => ot, buildBase64UrlFromSvg: () => ce, camelCase: () => xt, capitalize: () => De, createId: () => pe, deepMerge: () => wt, escape: () => Y, escapeNodeContent: () => nt, find: () => V, getElRect: () => gt, getElement: () => Ft, getGlobal: () => k, getKeyChar: () => Tt, getKeyCode: () => Lt, getModel: () => rt, getPointerEvent: () => N, getUiClass: () => D, getUnitFromValue: () => Dt, getViewEl: () => be, hasDnd: () => Wt, hasWin: () => z, isCommentNode: () => Q, isComponent: () => xe, isDef: () => W, isEmptyObj: () => _e, isEnterKey: () => Oe, isEscKey: () => Qt, isObject: () => Se, isRule: () => Te, isTaggableNode: () => j, isTextNode: () => Ht, matches: () => M, normalizeFloat: () => bt, off: () => jt, on: () => Et, setViewEl: () => ge, shallowDiff: () => it, toLowerCase: () => P, upFirst: () => ee });
var at = pt(50), _t = function() {
return _t = Object.assign || function(st) {
for (var Xt, qt = 1, ne = arguments.length; qt < ne; qt++)
for (var ae in Xt = arguments[qt])
Object.prototype.hasOwnProperty.call(Xt, ae) && (st[ae] = Xt[ae]);
return st;
}, _t.apply(this, arguments);
}, J = function(st, Xt, qt) {
if (qt || arguments.length === 2)
for (var ne, ae = 0, Zt = Xt.length; ae < Zt; ae++)
!ne && ae in Xt || (ne || (ne = Array.prototype.slice.call(Xt, 0, ae)), ne[ae] = Xt[ae]);
return st.concat(ne || Array.prototype.slice.call(Xt));
}, W = function(st) {
return st !== void 0;
}, z = function() {
return typeof window < "u";
}, k = function() {
return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : pt.g;
}, P = function(st) {
return (st || "").toLowerCase();
}, E = z() ? window.Element.prototype : {}, M = E.matches || E.webkitMatchesSelector || E.mozMatchesSelector || E.msMatchesSelector, D = function(st, Xt) {
var qt = st.getConfig(), ne = qt.stylePrefix;
return [qt.customUI && "".concat(ne, "cui"), Xt].filter(function(ae) {
return ae;
}).join(" ");
}, ot = function(st, Xt) {
Xt === void 0 && (Xt = {});
var qt = (0, at.isArray)(st) ? J([], st, !0) : [st];
if (qt.length) {
var ne = qt.shift();
if (ne && (!Xt.unique || !document.querySelector('link[href="'.concat(ne, '"]')))) {
var ae = document.head, Zt = document.createElement("link");
Zt.href = ne, Zt.rel = "stylesheet", Xt.prepand ? ae.insertBefore(Zt, ae.firstChild) : ae.appendChild(Zt);
}
ot(qt);
}
}, it = function(st, Xt) {
var qt = {}, ne = (0, at.keys)(Xt);
for (var ae in st)
if (st.hasOwnProperty(ae)) {
var Zt = st[ae], Ae = Xt[ae];
ne.indexOf(ae) >= 0 ? Zt !== Ae && (qt[ae] = Ae) : qt[ae] = null;
}
for (var ae in Xt)
Xt.hasOwnProperty(ae) && (0, at.isUndefined)(st[ae]) && (qt[ae] = Xt[ae]);
return qt;
}, Et = function(st, Xt, qt, ne) {
var ae = Xt.split(/\s+/);
st = st instanceof Array ? st : [st];
for (var Zt = function(Ke) {
st.forEach(function(Xe) {
return Xe && Xe.addEventListener(ae[Ke], qt, ne);
});
}, Ae = 0; Ae < ae.length; ++Ae)
Zt(Ae);
}, jt = function(st, Xt, qt, ne) {
var ae = Xt.split(/\s+/);
st = st instanceof Array ? st : [st];
for (var Zt = function(Ke) {
st.forEach(function(Xe) {
return Xe && Xe.removeEventListener(ae[Ke], qt, ne);
});
}, Ae = 0; Ae < ae.length; ++Ae)
Zt(Ae);
}, Dt = function(st) {
return st.replace(parseFloat(st), "");
}, ee = function(st) {
return st[0].toUpperCase() + st.toLowerCase().slice(1);
}, xt = function(st) {
return st.replace(/-./g, function(Xt) {
return Xt[1].toUpperCase();
});
}, bt = function(st, Xt, qt) {
Xt === void 0 && (Xt = 1), qt === void 0 && (qt = 0);
var ne = 0;
if (isNaN(st))
return qt;
if (st = parseFloat(st), Math.floor(st) !== st) {
var ae = Xt.toString().split(".")[1];
ne = ae ? ae.length : 0;
}
return ne ? parseFloat(st.toFixed(ne)) : st;
}, Wt = function(st) {
return "draggable" in document.createElement("i") && (!st || st.config.nativeDnD);
}, Ft = function(st) {
return (0, at.isElement)(st) || Ht(st) ? st : st && st.getEl ? st.getEl() : void 0;
}, Ht = function(st) {
return st && st.nodeType === 3;
}, Q = function(st) {
return st && st.nodeType === 8;
}, j = function(st) {
return st && !Ht(st) && !Q(st);
}, V = function(st, Xt) {
var qt = null;
return st.some(function(ne, ae) {
return Xt(ne, ae, st) ? (qt = ne, 1) : 0;
}), qt;
}, Y = function(st) {
return st === void 0 && (st = ""), "".concat(st).replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/`/g, "`");
}, nt = function(st) {
return st === void 0 && (st = ""), "".concat(st).replace(/&/g, "&").replace(//g, ">");
}, wt = function() {
for (var st = [], Xt = 0; Xt < arguments.length; Xt++)
st[Xt] = arguments[Xt];
for (var qt = _t({}, st[0]), ne = 1; ne < st.length; ne++) {
var ae = _t({}, st[ne]);
for (var Zt in ae) {
var Ae = qt[Zt], Ke = ae[Zt];
Se(Ae) && Se(Ke) ? qt[Zt] = wt(Ae, Ke) : qt[Zt] = Ke;
}
}
return qt;
}, rt = function(st, Xt) {
var qt = st;
return !Xt && st && st.__cashData ? qt = st.__cashData.model : (0, at.isElement)(st) && (qt = Xt(st).data("model")), qt;
}, gt = function(st) {
var Xt, qt = { top: 0, left: 0, width: 0, height: 0 };
if (!st)
return qt;
if (Ht(st)) {
var ne = document.createRange();
ne.selectNode(st), Xt = ne.getBoundingClientRect(), ne.detach();
}
return Xt || (st.getBoundingClientRect ? st.getBoundingClientRect() : qt);
}, N = function(st) {
return st.touches && st.touches[0] ? st.touches[0] : st;
}, Lt = function(st) {
return st.which || st.keyCode;
}, Tt = function(st) {
return String.fromCharCode(Lt(st));
}, Qt = function(st) {
return Lt(st) === 27;
}, Oe = function(st) {
return Lt(st) === 13;
}, Se = function(st) {
return st !== null && !Array.isArray(st) && typeof st == "object";
}, _e = function(st) {
return Object.keys(st).length <= 0;
}, De = function(st) {
return st === void 0 && (st = ""), st && st.charAt(0).toUpperCase() + st.substring(1);
}, xe = function(st) {
return st && st.toHTML;
}, Te = function(st) {
return st && st.toCSS;
}, be = function(st) {
return st.__gjsv;
}, ge = function(st, Xt) {
st.__gjsv = Xt;
}, pe = function(st) {
st === void 0 && (st = 16);
for (var Xt = "", qt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", ne = qt.length, ae = 0; ae < st; ae++)
Xt += qt.charAt(Math.floor(Math.random() * ne));
return Xt;
}, ce = function(st) {
if (st && st.substr(0, 4) === "