import {
e
} from "./chunk-KVKFRDRF.js";
import {
ge
} from "./chunk-O6L55DMN.js";
import "./chunk-FNDTTSSL.js";
import "./chunk-KE6WE6IM.js";
import "./chunk-KRMUJIEJ.js";
import "./chunk-YFT6OQ5R.js";
import {
B
} from "./chunk-USOO7D3G.js";
import "./chunk-F73GDDKZ.js";
import "./chunk-LK7GAOJV.js";
import "./chunk-GCDLWRBO.js";
import {
createBaseVNode,
createCommentVNode,
createElementBlock,
defineComponent,
getCurrentInstance,
onMounted,
openBlock,
reactive,
ref,
toDisplayString,
watch
} from "./chunk-YI6SOFIT.js";
import "./chunk-PLDDJCW6.js";
// node_modules/@fast-crud/fast-extends/dist/fs-json-editor-985ed0b5.mjs
var bt = { exports: {} };
(function(Je, it) {
(function(Ye, ot) {
Je.exports = ot();
})(self, function() {
return ot = { 897: function(le, m, D) {
D.d(m, { x: function() {
return Y;
} });
var U = D(2602), x = D(9791), H = D(7907);
function z(P) {
return (z = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(N) {
return typeof N;
} : function(N) {
return N && typeof Symbol == "function" && N.constructor === Symbol && N !== Symbol.prototype ? "symbol" : typeof N;
})(P);
}
function j(P, N) {
for (var A = 0; A < N.length; A++) {
var f = N[A];
f.enumerable = f.enumerable || false, f.configurable = true, "value" in f && (f.writable = true), Object.defineProperty(P, function(R) {
return R = function(y, C) {
if (z(y) !== "object" || y === null)
return y;
var d = y[Symbol.toPrimitive];
if (d === void 0)
return (C === "string" ? String : Number)(y);
if (d = d.call(y, C || "default"), z(d) !== "object")
return d;
throw new TypeError("@@toPrimitive must return a primitive value.");
}(R, "string"), z(R) === "symbol" ? R : String(R);
}(f.key), f);
}
}
var Y = function() {
function P(f, C) {
if (!(this instanceof P))
throw new TypeError("Cannot call a class as a function");
this.dom = {};
var y = this, h = this.dom, C = (this.anchor = void 0, this.items = f, this.eventListeners = {}, this.selection = void 0, this.onClose = C ? C.close : void 0, this.limitHeight = !!C && C.limitHeight, document.createElement("div")), d = (C.className = "jsoneditor-contextmenu-root", h.root = C, document.createElement("div")), C = (d.className = "jsoneditor-contextmenu", h.menu = d, C.appendChild(d), document.createElement("ul")), d = (C.className = "jsoneditor-menu", d.appendChild(C), h.list = C, h.items = [], document.createElement("button")), h = (d.type = "button", h.focusButton = d, document.createElement("li"));
h.style.overflow = "hidden", h.style.height = "0", h.appendChild(d), C.appendChild(h), function l(n, o, i) {
i.forEach(function(a) {
var r, e2, t, s, c, p;
a.type === "separator" ? ((c = document.createElement("div")).className = "jsoneditor-separator", (e2 = document.createElement("li")).appendChild(c), n.appendChild(e2)) : (r = {}, c = document.createElement("li"), n.appendChild(c), (e2 = document.createElement("button")).type = "button", e2.className = a.className, r.button = e2, a.title && (e2.title = a.title), a.click && (e2.onclick = function(g) {
g.preventDefault(), y.hide(), a.click();
}), c.appendChild(e2), a.submenu ? ((s = document.createElement("div")).className = "jsoneditor-icon", e2.appendChild(s), (s = document.createElement("div")).className = "jsoneditor-text" + (a.click ? "" : " jsoneditor-right-margin"), s.appendChild(document.createTextNode(a.text)), e2.appendChild(s), (t = a.click ? (e2.className += " jsoneditor-default", (s = document.createElement("button")).type = "button", (r.buttonExpand = s).className = "jsoneditor-expand", (p = document.createElement("div")).className = "jsoneditor-expand", s.appendChild(p), c.appendChild(s), a.submenuTitle && (s.title = a.submenuTitle), s) : ((p = document.createElement("div")).className = "jsoneditor-expand", e2.appendChild(p), e2)).onclick = function(g) {
g.preventDefault(), y._onExpandItem(r), t.focus();
}, r.subItems = s = [], p = document.createElement("ul"), (r.ul = p).className = "jsoneditor-menu", p.style.height = "0", c.appendChild(p), l(p, s, a.submenu)) : ((c = document.createElement("div")).className = "jsoneditor-icon", e2.appendChild(c), (p = document.createElement("div")).className = "jsoneditor-text", p.appendChild(document.createTextNode((0, H.Iu)(a.text))), e2.appendChild(p)), o.push(r));
});
}(C, this.dom.items, f), this.maxHeight = 0, f.forEach(function(l) {
l = 24 * (f.length + (l.submenu ? l.submenu.length : 0)), y.maxHeight = Math.max(y.maxHeight, l);
});
}
var N, A;
return N = P, (A = [{ key: "_getVisibleButtons", value: function() {
var f = [], R = this;
return this.dom.items.forEach(function(y) {
f.push(y.button), y.buttonExpand && f.push(y.buttonExpand), y.subItems && y === R.expandedItem && y.subItems.forEach(function(C) {
f.push(C.button), C.buttonExpand && f.push(C.buttonExpand);
});
}), f;
} }, { key: "show", value: function(f, o, y) {
this.hide();
var C = true, h = f.parentNode, d = f.getBoundingClientRect(), h = h.getBoundingClientRect(), l = o.getBoundingClientRect(), n = this, o = (this.dom.absoluteAnchor = (0, U.w)(f, o, function() {
n.hide();
}), d.bottom + this.maxHeight < l.bottom || d.top - this.maxHeight > l.top && (C = false), y ? 0 : d.top - h.top);
C ? (y = f.offsetHeight, this.dom.menu.style.left = "0", this.dom.menu.style.top = o + y + "px", this.dom.menu.style.bottom = "") : (this.dom.menu.style.left = "0", this.dom.menu.style.top = "", this.dom.menu.style.bottom = "0px"), this.limitHeight && (h = C ? l.bottom - d.bottom - 10 : d.top - l.top - 10, this.dom.list.style.maxHeight = h + "px", this.dom.list.style.overflowY = "auto"), this.dom.absoluteAnchor.appendChild(this.dom.root), this.selection = (0, x.getSelection)(), this.anchor = f, setTimeout(function() {
n.dom.focusButton.focus();
}, 0), P.visibleMenu && P.visibleMenu.hide(), P.visibleMenu = this;
} }, { key: "hide", value: function() {
this.dom.absoluteAnchor && (this.dom.absoluteAnchor.destroy(), delete this.dom.absoluteAnchor), this.dom.root.parentNode && (this.dom.root.parentNode.removeChild(this.dom.root), this.onClose) && this.onClose(), P.visibleMenu === this && (P.visibleMenu = void 0);
} }, { key: "_onExpandItem", value: function(f) {
var R, y = this, C = f === this.expandedItem, d = this.expandedItem;
d && (d.ul.style.height = "0", d.ul.style.padding = "", setTimeout(function() {
y.expandedItem !== d && (d.ul.style.display = "", x.removeClassName)(d.ul.parentNode, "jsoneditor-selected");
}, 300), this.expandedItem = void 0), C || ((R = f.ul).style.display = "block", R.clientHeight, setTimeout(function() {
if (y.expandedItem === f) {
for (var h = 0, l = 0; l < R.childNodes.length; l++)
h += R.childNodes[l].clientHeight;
R.style.height = h + "px", R.style.padding = "5px 10px";
}
}, 0), (0, x.addClassName)(R.parentNode, "jsoneditor-selected"), this.expandedItem = f);
} }, { key: "_onKeyDown", value: function(f) {
var R, y, C, d, h = f.target, l = f.which, n = false;
l === 27 ? (this.selection && (0, x.setSelection)(this.selection), this.anchor && this.anchor.focus(), this.hide(), n = true) : l === 9 ? f.shiftKey ? (y = (R = this._getVisibleButtons()).indexOf(h)) === 0 && (R[R.length - 1].focus(), n = true) : (y = (R = this._getVisibleButtons()).indexOf(h)) === R.length - 1 && (R[0].focus(), n = true) : l === 37 ? (h.className === "jsoneditor-expand" && (y = (R = this._getVisibleButtons()).indexOf(h), C = R[y - 1]) && C.focus(), n = true) : l === 38 ? (y = (R = this._getVisibleButtons()).indexOf(h), (C = (C = (C = R[y - 1]) && C.className === "jsoneditor-expand" ? R[y - 2] : C) || R[R.length - 1]) && C.focus(), n = true) : l === 39 ? (y = (R = this._getVisibleButtons()).indexOf(h), (d = R[y + 1]) && d.className === "jsoneditor-expand" && d.focus(), n = true) : l === 40 && (y = (R = this._getVisibleButtons()).indexOf(h), (d = (d = (d = R[y + 1]) && d.className === "jsoneditor-expand" ? R[y + 2] : d) || R[0]) && (d.focus(), n = true), n = true), n && (f.stopPropagation(), f.preventDefault());
} }]) && j(N.prototype, A), Object.defineProperty(N, "prototype", { writable: false }), P;
}();
Y.visibleMenu = void 0;
}, 6436: function(le, m, D) {
function U(z) {
return (U = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(j) {
return typeof j;
} : function(j) {
return j && typeof Symbol == "function" && j.constructor === Symbol && j !== Symbol.prototype ? "symbol" : typeof j;
})(z);
}
function x(z, j) {
for (var Y = 0; Y < j.length; Y++) {
var P = j[Y];
P.enumerable = P.enumerable || false, P.configurable = true, "value" in P && (P.writable = true), Object.defineProperty(z, function(N) {
return N = function(A, f) {
if (U(A) !== "object" || A === null)
return A;
var R = A[Symbol.toPrimitive];
if (R === void 0)
return (f === "string" ? String : Number)(A);
if (R = R.call(A, f || "default"), U(R) !== "object")
return R;
throw new TypeError("@@toPrimitive must return a primitive value.");
}(N, "string"), U(N) === "symbol" ? N : String(N);
}(P.key), P);
}
}
D.d(m, { Q: function() {
return H;
} });
var H = function() {
function z(N) {
if (!(this instanceof z))
throw new TypeError("Cannot call a class as a function");
this.errorTableVisible = N.errorTableVisible, this.onToggleVisibility = N.onToggleVisibility, this.onFocusLine = N.onFocusLine || function() {
}, this.onChangeHeight = N.onChangeHeight, this.dom = {};
var N = document.createElement("div"), A = (N.className = "jsoneditor-validation-errors-container", this.dom.validationErrorsContainer = N, document.createElement("div")), N = (A.style.display = "none", A.className = "jsoneditor-additional-errors fadein", A.textContent = "Scroll for more ▿", this.dom.additionalErrorsIndication = A, N.appendChild(A), document.createElement("span")), A = (N.className = "jsoneditor-validation-error-icon", N.style.display = "none", this.dom.validationErrorIcon = N, document.createElement("span"));
A.className = "jsoneditor-validation-error-count", A.style.display = "none", this.dom.validationErrorCount = A, this.dom.parseErrorIndication = document.createElement("span"), this.dom.parseErrorIndication.className = "jsoneditor-parse-error-icon", this.dom.parseErrorIndication.style.display = "none";
}
var j, Y;
return j = z, (Y = [{ key: "getErrorTable", value: function() {
return this.dom.validationErrorsContainer;
} }, { key: "getErrorCounter", value: function() {
return this.dom.validationErrorCount;
} }, { key: "getWarningIcon", value: function() {
return this.dom.validationErrorIcon;
} }, { key: "getErrorIcon", value: function() {
return this.dom.parseErrorIndication;
} }, { key: "toggleTableVisibility", value: function() {
this.errorTableVisible = !this.errorTableVisible, this.onToggleVisibility(this.errorTableVisible);
} }, { key: "setErrors", value: function(P, N) {
var A, f, R = this, y = (this.dom.validationErrors && (this.dom.validationErrors.parentNode.removeChild(this.dom.validationErrors), this.dom.validationErrors = null, this.dom.additionalErrorsIndication.style.display = "none"), this.errorTableVisible && 0 < P.length ? ((y = document.createElement("div")).className = "jsoneditor-validation-errors", (f = document.createElement("table")).className = "jsoneditor-text-errors", y.appendChild(f), A = document.createElement("tbody"), f.appendChild(A), P.forEach(function(C) {
isNaN(C.line) ? C.dataPath && (h = N.find(function(o) {
return o.path === C.dataPath;
})) && (d = h.line + 1) : d = C.line;
var d, h = document.createElement("tr"), l = (h.className = isNaN(d) ? "" : "jump-to-line", C.type === "error" ? h.className += " parse-error" : h.className += " validation-error", document.createElement("td")), n = document.createElement("button"), n = (n.className = "jsoneditor-schema-error", l.appendChild(n), h.appendChild(l), document.createElement("td"));
n.style = "white-space: nowrap;", n.textContent = isNaN(d) ? "" : "Ln " + d, h.appendChild(n), typeof C == "string" ? ((l = document.createElement("td")).colSpan = 2, (n = document.createElement("pre")).appendChild(document.createTextNode(C)), l.appendChild(n), h.appendChild(l)) : ((n = document.createElement("td")).appendChild(document.createTextNode(C.dataPath || "")), h.appendChild(n), l = document.createElement("td"), (n = document.createElement("pre")).appendChild(document.createTextNode(C.message.replace(/ /gi, `
`))), l.appendChild(n), h.appendChild(l)), h.onclick = function() {
R.onFocusLine(d);
}, A.appendChild(h);
}), this.dom.validationErrors = y, this.dom.validationErrorsContainer.appendChild(y), this.dom.additionalErrorsIndication.title = P.length + " errors total", this.dom.validationErrorsContainer.clientHeight < this.dom.validationErrorsContainer.scrollHeight ? (this.dom.additionalErrorsIndication.style.display = "block", this.dom.validationErrorsContainer.onscroll = function() {
R.dom.additionalErrorsIndication.style.display = 0 < R.dom.validationErrorsContainer.clientHeight && R.dom.validationErrorsContainer.scrollTop === 0 ? "block" : "none";
}) : this.dom.validationErrorsContainer.onscroll = void 0, f = this.dom.validationErrorsContainer.clientHeight + (this.dom.statusBar ? this.dom.statusBar.clientHeight : 0), this.onChangeHeight(f)) : this.onChangeHeight(0), P.filter(function(C) {
return C.type !== "error";
}).length);
0 < y ? (this.dom.validationErrorCount.style.display = "inline", this.dom.validationErrorCount.innerText = y, this.dom.validationErrorCount.onclick = this.toggleTableVisibility.bind(this), this.dom.validationErrorIcon.style.display = "inline", this.dom.validationErrorIcon.title = y + " schema validation error(s) found", this.dom.validationErrorIcon.onclick = this.toggleTableVisibility.bind(this)) : (this.dom.validationErrorCount.style.display = "none", this.dom.validationErrorIcon.style.display = "none"), P.some(function(C) {
return C.type === "error";
}) ? (f = P[0].line, this.dom.parseErrorIndication.style.display = "block", this.dom.parseErrorIndication.title = isNaN(f) ? "parse error - check that the json is valid" : "parse error on line " + f, this.dom.parseErrorIndication.onclick = this.toggleTableVisibility.bind(this)) : this.dom.parseErrorIndication.style.display = "none";
} }]) && x(j.prototype, Y), Object.defineProperty(j, "prototype", { writable: false }), z;
}();
}, 2474: function(le, m, D) {
function U(z) {
return (U = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(j) {
return typeof j;
} : function(j) {
return j && typeof Symbol == "function" && j.constructor === Symbol && j !== Symbol.prototype ? "symbol" : typeof j;
})(z);
}
function x(z, j) {
for (var Y = 0; Y < j.length; Y++) {
var P = j[Y];
P.enumerable = P.enumerable || false, P.configurable = true, "value" in P && (P.writable = true), Object.defineProperty(z, function(N) {
return N = function(A, f) {
if (U(A) !== "object" || A === null)
return A;
var R = A[Symbol.toPrimitive];
if (R === void 0)
return (f === "string" ? String : Number)(A);
if (R = R.call(A, f || "default"), U(R) !== "object")
return R;
throw new TypeError("@@toPrimitive must return a primitive value.");
}(N, "string"), U(N) === "symbol" ? N : String(N);
}(P.key), P);
}
}
D.d(m, { R: function() {
return H;
} });
var H = function() {
function z(P) {
if (!(this instanceof z))
throw new TypeError("Cannot call a class as a function");
if (this.target = P.target || null, !this.target)
throw new Error('FocusTracker constructor called without a "target" to track.');
this.onFocus = typeof P.onFocus == "function" ? P.onFocus : null, this.onBlur = typeof P.onBlur == "function" ? P.onBlur : null, this._onClick = this._onEvent.bind(this), this._onKeyUp = (function(N) {
N.which !== 9 && N.keyCode !== 9 || this._onEvent(N);
}).bind(this), this._onBlur = this._onEvent.bind(this), this.focusFlag = false, this.firstEventFlag = true, (this.onFocus || this.onBlur) && (document.addEventListener("click", this._onClick), document.addEventListener("keyup", this._onKeyUp), document.addEventListener("blur", this._onBlur));
}
var j, Y;
return j = z, (Y = [{ key: "destroy", value: function() {
document.removeEventListener("click", this._onClick), document.removeEventListener("keyup", this._onKeyUp), document.removeEventListener("blur", this._onBlur), this._onEvent({ target: document.body });
} }, { key: "_onEvent", value: function(P) {
P = P.target, P = P === this.target || !(!this.target.contains(P) && !this.target.contains(document.activeElement)), P ? this.focusFlag || (this.onFocus && this.onFocus({ type: "focus", target: this.target }), this.focusFlag = true) : (this.focusFlag || this.firstEventFlag) && (this.onBlur && this.onBlur({ type: "blur", target: this.target }), this.focusFlag = false, this.firstEventFlag) && (this.firstEventFlag = false);
} }]) && x(j.prototype, Y), Object.defineProperty(j, "prototype", { writable: false }), z;
}();
}, 3161: function(le, m, D) {
var U = D(8170), x = D(8037), H = D(8038).treeModeMixins, z = D(8458).textModeMixins, j = D(341).previewModeMixins, R = D(9791), Y = R.clear, P = R.extend, N = R.getInnerText, A = R.getInternetExplorerVersion, f = R.parse, R = D(2744).tryRequireAjv, y = D(2558).showTransformModal, C = D(6210).showSortModal, d = R();
function h(l, n, o) {
if (!(this instanceof h))
throw new Error('JSONEditor constructor called without "new".');
var i = A();
if (i !== -1 && i < 9)
throw new Error("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");
n && (n.error && (n.onError = n.error, delete n.error), n.change && (n.onChange = n.change, delete n.change), n.editable && (n.onEditable = n.editable, delete n.editable), n.onChangeJSON && (n.mode === "text" || n.mode === "code" || n.modes && (n.modes.indexOf("text") !== -1 || n.modes.indexOf("code"))), n) && Object.keys(n).forEach(function(a) {
h.VALID_OPTIONS.indexOf(a);
}), arguments.length && this._create(l, n, o);
}
h.modes = {}, h.prototype.DEBOUNCE_INTERVAL = 150, h.VALID_OPTIONS = ["ajv", "schema", "schemaRefs", "templates", "ace", "theme", "autocomplete", "onChange", "onChangeJSON", "onChangeText", "onExpand", "onEditable", "onError", "onEvent", "onModeChange", "onNodeName", "onValidate", "onCreateMenu", "onSelectionChange", "onTextSelectionChange", "onClassName", "onFocus", "onBlur", "colorPicker", "onColorPicker", "timestampTag", "timestampFormat", "escapeUnicode", "history", "search", "mode", "modes", "name", "indentation", "sortObjectKeys", "navigationBar", "statusBar", "mainMenuBar", "languages", "language", "enableSort", "enableTransform", "limitDragging", "maxVisibleChilds", "onValidationError", "modalAnchor", "popupAnchor", "createQuery", "executeQuery", "queryDescription", "allowSchemaSuggestions", "showErrorTable"], h.prototype._create = function(l, n, o) {
this.container = l, this.options = n || {}, this.json = o || {}, l = this.options.mode || this.options.modes && this.options.modes[0] || "tree", this.setMode(l);
}, h.prototype.destroy = function() {
}, h.prototype.set = function(l) {
this.json = l;
}, h.prototype.get = function() {
return this.json;
}, h.prototype.setText = function(l) {
this.json = f(l);
}, h.prototype.getText = function() {
return JSON.stringify(this.json);
}, h.prototype.setName = function(l) {
this.options || (this.options = {}), this.options.name = l;
}, h.prototype.getName = function() {
return this.options && this.options.name;
}, h.prototype.setMode = function(l) {
if (l !== this.options.mode || !this.create) {
var n = this.container, o = P({}, this.options), i = o.mode, a = (o.mode = l, h.modes[l]);
if (!a)
throw new Error('Unknown mode "' + o.mode + '"');
var r = a.data === "text", e2 = this.getName(), t = this[r ? "getText" : "get"]();
if (this.destroy(), Y(this), P(this, a.mixin), this.create(n, o), this.setName(e2), this[r ? "setText" : "set"](t), typeof a.load == "function")
try {
a.load.call(this);
} catch {
}
if (typeof o.onModeChange == "function" && l !== i)
try {
o.onModeChange(l, i);
} catch {
}
}
}, h.prototype.getMode = function() {
return this.options.mode;
}, h.prototype._onError = function(l) {
this.options && typeof this.options.onError == "function" ? this.options.onError(l) : window.alert(l.toString());
}, h.prototype.setSchema = function(l, n) {
if (l) {
var o;
try {
this.options.ajv ? o = this.options.ajv : ((o = d({ allErrors: true, verbose: true, schemaId: "auto", $data: true })).addMetaSchema(D(7171)), o.addMetaSchema(D(6273)));
} catch {
}
if (o) {
if (n) {
for (var i in n)
o.removeSchema(i), n[i] && o.addSchema(n[i], i);
this.options.schemaRefs = n;
}
this.validateSchema = o.compile(l), this.options.schema = l, this.options.schemaRefs = n, this.validate();
}
} else
this.validateSchema = null, this.options.schema = null, this.options.schemaRefs = null, this.validate();
this.refresh(), typeof this._onSchemaChange == "function" && this._onSchemaChange(l, n);
}, h.prototype.validate = function() {
}, h.prototype.refresh = function() {
}, (h.registerMode = function(l) {
var n;
if (Array.isArray(l))
for (a = 0; a < l.length; a++)
h.registerMode(l[a]);
else {
if (!("mode" in l))
throw new Error('Property "mode" missing');
if (!("mixin" in l))
throw new Error('Property "mixin" missing');
if (!("data" in l))
throw new Error('Property "data" missing');
var o = l.mode;
if (o in h.modes)
throw new Error('Mode "' + o + '" already registered');
if (typeof l.mixin.create != "function")
throw new Error('Required function "create" missing on mixin');
for (var i = ["setMode", "registerMode", "modes"], a = 0; a < i.length; a++)
if ((n = i[a]) in l.mixin)
throw new Error('Reserved property "' + n + '" not allowed in mixin');
h.modes[o] = l;
}
})(H), h.registerMode(z), h.registerMode(j), h.ace = U, h.Ajv = d, h.VanillaPicker = x, h.showTransformModal = y, h.showSortModal = C, h.getInnerText = N, le.exports = h.default = h;
}, 6617: function(le, m, D) {
D.d(m, { x: function() {
return j;
} });
var U = D(897), x = D(7907);
function H(Y) {
return (H = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(P) {
return typeof P;
} : function(P) {
return P && typeof Symbol == "function" && P.constructor === Symbol && P !== Symbol.prototype ? "symbol" : typeof P;
})(Y);
}
function z(Y, P) {
for (var N = 0; N < P.length; N++) {
var A = P[N];
A.enumerable = A.enumerable || false, A.configurable = true, "value" in A && (A.writable = true), Object.defineProperty(Y, function(f) {
return f = function(R, y) {
if (H(R) !== "object" || R === null)
return R;
var C = R[Symbol.toPrimitive];
if (C === void 0)
return (y === "string" ? String : Number)(R);
if (C = C.call(R, y || "default"), H(C) !== "object")
return C;
throw new TypeError("@@toPrimitive must return a primitive value.");
}(f, "string"), H(f) === "symbol" ? f : String(f);
}(A.key), A);
}
}
var j = function() {
function Y(A, f, R, y) {
if (!(this instanceof Y))
throw new TypeError("Cannot call a class as a function");
for (var C = { code: { text: (0, x.Iu)("modeCodeText"), title: (0, x.Iu)("modeCodeTitle"), click: function() {
y("code");
} }, form: { text: (0, x.Iu)("modeFormText"), title: (0, x.Iu)("modeFormTitle"), click: function() {
y("form");
} }, text: { text: (0, x.Iu)("modeTextText"), title: (0, x.Iu)("modeTextTitle"), click: function() {
y("text");
} }, tree: { text: (0, x.Iu)("modeTreeText"), title: (0, x.Iu)("modeTreeTitle"), click: function() {
y("tree");
} }, view: { text: (0, x.Iu)("modeViewText"), title: (0, x.Iu)("modeViewTitle"), click: function() {
y("view");
} }, preview: { text: (0, x.Iu)("modePreviewText"), title: (0, x.Iu)("modePreviewTitle"), click: function() {
y("preview");
} } }, d = [], h = 0; h < f.length; h++) {
var l = f[h], n = C[l];
if (!n)
throw new Error('Unknown mode "' + l + '"');
n.className = "jsoneditor-type-modes" + (R === l ? " jsoneditor-selected" : ""), d.push(n);
}
var i = C[R];
if (!i)
throw new Error('Unknown mode "' + R + '"');
var i = i.text, o = document.createElement("button"), i = (o.type = "button", o.className = "jsoneditor-modes jsoneditor-separator", o.textContent = i + " ▾", o.title = (0, x.Iu)("modeEditorTitle"), o.onclick = function() {
new U.x(d).show(o, A);
}, document.createElement("div"));
i.className = "jsoneditor-modes", i.style.position = "relative", i.appendChild(o), A.appendChild(i), this.dom = { container: A, box: o, frame: i };
}
var P, N;
return P = Y, (N = [{ key: "focus", value: function() {
this.dom.box.focus();
} }, { key: "destroy", value: function() {
this.dom && this.dom.frame && this.dom.frame.parentNode && this.dom.frame.parentNode.removeChild(this.dom.frame), this.dom = null;
} }]) && z(P.prototype, N), Object.defineProperty(P, "prototype", { writable: false }), Y;
}();
}, 8170: function(le, m, D) {
var U;
if (window.ace)
U = window.ace;
else
try {
U = D(6225), D(4091), D(3330), D(4317);
var x = D(7923);
U.config.setModuleUrl("ace/mode/json_worker", x);
} catch {
}
le.exports = U;
}, 4864: function() {
window.ace.define("ace/theme/jsoneditor", ["require", "exports", "module", "ace/lib/dom"], function(le, m, D) {
m.isDark = false, m.cssClass = "ace-jsoneditor", m.cssText = `.ace-jsoneditor .ace_gutter {
background: #ebebeb;
color: #333
}
.ace-jsoneditor.ace_editor {
line-height: 1.3;
background-color: #fff;
}
.ace-jsoneditor .ace_print-margin {
width: 1px;
background: #e8e8e8
}
.ace-jsoneditor .ace_scroller {
background-color: #FFFFFF
}
.ace-jsoneditor .ace_text-layer {
color: gray
}
.ace-jsoneditor .ace_variable {
color: #1a1a1a
}
.ace-jsoneditor .ace_cursor {
border-left: 2px solid #000000
}
.ace-jsoneditor .ace_overwrite-cursors .ace_cursor {
border-left: 0px;
border-bottom: 1px solid #000000
}
.ace-jsoneditor .ace_marker-layer .ace_selection {
background: lightgray
}
.ace-jsoneditor.ace_multiselect .ace_selection.ace_start {
box-shadow: 0 0 3px 0px #FFFFFF;
border-radius: 2px
}
.ace-jsoneditor .ace_marker-layer .ace_step {
background: rgb(255, 255, 0)
}
.ace-jsoneditor .ace_marker-layer .ace_bracket {
margin: -1px 0 0 -1px;
border: 1px solid #BFBFBF
}
.ace-jsoneditor .ace_marker-layer .ace_active-line {
background: #FFFBD1
}
.ace-jsoneditor .ace_gutter-active-line {
background-color : #dcdcdc
}
.ace-jsoneditor .ace_marker-layer .ace_selected-word {
border: 1px solid lightgray
}
.ace-jsoneditor .ace_invisible {
color: #BFBFBF
}
.ace-jsoneditor .ace_keyword,
.ace-jsoneditor .ace_meta,
.ace-jsoneditor .ace_support.ace_constant.ace_property-value {
color: #AF956F
}
.ace-jsoneditor .ace_keyword.ace_operator {
color: #484848
}
.ace-jsoneditor .ace_keyword.ace_other.ace_unit {
color: #96DC5F
}
.ace-jsoneditor .ace_constant.ace_language {
color: darkorange
}
.ace-jsoneditor .ace_constant.ace_numeric {
color: red
}
.ace-jsoneditor .ace_constant.ace_character.ace_entity {
color: #BF78CC
}
.ace-jsoneditor .ace_invalid {
color: #FFFFFF;
background-color: #FF002A;
}
.ace-jsoneditor .ace_fold {
background-color: #AF956F;
border-color: #000000
}
.ace-jsoneditor .ace_storage,
.ace-jsoneditor .ace_support.ace_class,
.ace-jsoneditor .ace_support.ace_function,
.ace-jsoneditor .ace_support.ace_other,
.ace-jsoneditor .ace_support.ace_type {
color: #C52727
}
.ace-jsoneditor .ace_string {
color: green
}
.ace-jsoneditor .ace_comment {
color: #BCC8BA
}
.ace-jsoneditor .ace_entity.ace_name.ace_tag,
.ace-jsoneditor .ace_entity.ace_other.ace_attribute-name {
color: #606060
}
.ace-jsoneditor .ace_markup.ace_underline {
text-decoration: underline
}
.ace-jsoneditor .ace_indent-guide {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y
}`, le("../lib/dom").importCssString(m.cssText, m.cssClass);
});
}, 6589: function(le, m) {
(D = { trace: function() {
}, yy: {}, symbols_: { error: 2, JSONString: 3, STRING: 4, JSONNumber: 5, NUMBER: 6, JSONNullLiteral: 7, NULL: 8, JSONBooleanLiteral: 9, TRUE: 10, FALSE: 11, JSONText: 12, JSONValue: 13, EOF: 14, JSONObject: 15, JSONArray: 16, "{": 17, "}": 18, JSONMemberList: 19, JSONMember: 20, ":": 21, ",": 22, "[": 23, "]": 24, JSONElementList: 25, $accept: 0, $end: 1 }, terminals_: { 2: "error", 4: "STRING", 6: "NUMBER", 8: "NULL", 10: "TRUE", 11: "FALSE", 14: "EOF", 17: "{", 18: "}", 21: ":", 22: ",", 23: "[", 24: "]" }, productions_: [0, [3, 1], [5, 1], [7, 1], [9, 1], [9, 1], [12, 2], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [15, 2], [15, 3], [20, 3], [19, 1], [19, 3], [16, 2], [16, 3], [25, 1], [25, 3]], performAction: function(U, x, H, z, j, Y, P) {
var N = Y.length - 1;
switch (j) {
case 1:
this.$ = U.replace(/\\(\\|")/g, "$1").replace(/\\n/g, `
`).replace(/\\r/g, "\r").replace(/\\t/g, " ").replace(/\\v/g, "\v").replace(/\\f/g, "\f").replace(/\\b/g, "\b");
break;
case 2:
this.$ = Number(U);
break;
case 3:
this.$ = null;
break;
case 4:
this.$ = true;
break;
case 5:
this.$ = false;
break;
case 6:
return this.$ = Y[N - 1];
case 13:
this.$ = {};
break;
case 14:
this.$ = Y[N - 1];
break;
case 15:
this.$ = [Y[N - 2], Y[N]];
break;
case 16:
this.$ = {}, this.$[Y[N][0]] = Y[N][1];
break;
case 17:
this.$ = Y[N - 2], Y[N - 2][Y[N][0]] = Y[N][1];
break;
case 18:
this.$ = [];
break;
case 19:
this.$ = Y[N - 1];
break;
case 20:
this.$ = [Y[N]];
break;
case 21:
this.$ = Y[N - 2], Y[N - 2].push(Y[N]);
}
}, table: [{ 3: 5, 4: [1, 12], 5: 6, 6: [1, 13], 7: 3, 8: [1, 9], 9: 4, 10: [1, 10], 11: [1, 11], 12: 1, 13: 2, 15: 7, 16: 8, 17: [1, 14], 23: [1, 15] }, { 1: [3] }, { 14: [1, 16] }, { 14: [2, 7], 18: [2, 7], 22: [2, 7], 24: [2, 7] }, { 14: [2, 8], 18: [2, 8], 22: [2, 8], 24: [2, 8] }, { 14: [2, 9], 18: [2, 9], 22: [2, 9], 24: [2, 9] }, { 14: [2, 10], 18: [2, 10], 22: [2, 10], 24: [2, 10] }, { 14: [2, 11], 18: [2, 11], 22: [2, 11], 24: [2, 11] }, { 14: [2, 12], 18: [2, 12], 22: [2, 12], 24: [2, 12] }, { 14: [2, 3], 18: [2, 3], 22: [2, 3], 24: [2, 3] }, { 14: [2, 4], 18: [2, 4], 22: [2, 4], 24: [2, 4] }, { 14: [2, 5], 18: [2, 5], 22: [2, 5], 24: [2, 5] }, { 14: [2, 1], 18: [2, 1], 21: [2, 1], 22: [2, 1], 24: [2, 1] }, { 14: [2, 2], 18: [2, 2], 22: [2, 2], 24: [2, 2] }, { 3: 20, 4: [1, 12], 18: [1, 17], 19: 18, 20: 19 }, { 3: 5, 4: [1, 12], 5: 6, 6: [1, 13], 7: 3, 8: [1, 9], 9: 4, 10: [1, 10], 11: [1, 11], 13: 23, 15: 7, 16: 8, 17: [1, 14], 23: [1, 15], 24: [1, 21], 25: 22 }, { 1: [2, 6] }, { 14: [2, 13], 18: [2, 13], 22: [2, 13], 24: [2, 13] }, { 18: [1, 24], 22: [1, 25] }, { 18: [2, 16], 22: [2, 16] }, { 21: [1, 26] }, { 14: [2, 18], 18: [2, 18], 22: [2, 18], 24: [2, 18] }, { 22: [1, 28], 24: [1, 27] }, { 22: [2, 20], 24: [2, 20] }, { 14: [2, 14], 18: [2, 14], 22: [2, 14], 24: [2, 14] }, { 3: 20, 4: [1, 12], 20: 29 }, { 3: 5, 4: [1, 12], 5: 6, 6: [1, 13], 7: 3, 8: [1, 9], 9: 4, 10: [1, 10], 11: [1, 11], 13: 30, 15: 7, 16: 8, 17: [1, 14], 23: [1, 15] }, { 14: [2, 19], 18: [2, 19], 22: [2, 19], 24: [2, 19] }, { 3: 5, 4: [1, 12], 5: 6, 6: [1, 13], 7: 3, 8: [1, 9], 9: 4, 10: [1, 10], 11: [1, 11], 13: 31, 15: 7, 16: 8, 17: [1, 14], 23: [1, 15] }, { 18: [2, 17], 22: [2, 17] }, { 18: [2, 15], 22: [2, 15] }, { 22: [2, 21], 24: [2, 21] }], defaultActions: { 16: [2, 6] }, parseError: function(U, x) {
throw new Error(U);
}, parse: function(U) {
var x = this, H = [0], z = [null], j = [], Y = this.table, P = "", N = 0, A = 0, f = 0, R = (this.lexer.setInput(U), this.lexer.yy = this.yy, this.yy.lexer = this.lexer, this.lexer.yylloc === void 0 && (this.lexer.yylloc = {}), this.lexer.yylloc);
function y() {
var s = x.lexer.lex() || 1;
return s = typeof s != "number" && x.symbols_[s] || s;
}
j.push(R), typeof this.yy.parseError == "function" && (this.parseError = this.yy.parseError);
for (var C, d, h, l, n, o, i, a, r, e2 = {}; ; ) {
if (h = H[H.length - 1], (l = this.defaultActions[h] || (C == null && (C = y()), Y[h] && Y[h][C])) === void 0 || !l.length || !l[0]) {
if (!f) {
for (n in a = [], Y[h])
this.terminals_[n] && 2 < n && a.push("'" + this.terminals_[n] + "'");
var t = "", t = this.lexer.showPosition ? "Parse error on line " + (N + 1) + `:
` + this.lexer.showPosition() + `
Expecting ` + a.join(", ") + ", got '" + this.terminals_[C] + "'" : "Parse error on line " + (N + 1) + ": Unexpected " + (C == 1 ? "end of input" : "'" + (this.terminals_[C] || C) + "'");
this.parseError(t, { text: this.lexer.match, token: this.terminals_[C] || C, line: this.lexer.yylineno, loc: R, expected: a });
}
if (f == 3) {
if (C == 1)
throw new Error(t || "Parsing halted.");
A = this.lexer.yyleng, P = this.lexer.yytext, N = this.lexer.yylineno, R = this.lexer.yylloc, C = y();
}
for (; !(2 .toString() in Y[h]); ) {
if (h == 0)
throw new Error(t || "Parsing halted.");
r = 1, H.length = H.length - 2 * r, z.length = z.length - r, j.length = j.length - r, h = H[H.length - 1];
}
d = C, C = 2, l = Y[h = H[H.length - 1]] && Y[h][2], f = 3;
}
if (l[0] instanceof Array && 1 < l.length)
throw new Error("Parse Error: multiple actions possible at state: " + h + ", token: " + C);
switch (l[0]) {
case 1:
H.push(C), z.push(this.lexer.yytext), j.push(this.lexer.yylloc), H.push(l[1]), C = null, d ? (C = d, d = null) : (A = this.lexer.yyleng, P = this.lexer.yytext, N = this.lexer.yylineno, R = this.lexer.yylloc, 0 < f && f--);
break;
case 2:
if (o = this.productions_[l[1]][1], e2.$ = z[z.length - o], e2._$ = { first_line: j[j.length - (o || 1)].first_line, last_line: j[j.length - 1].last_line, first_column: j[j.length - (o || 1)].first_column, last_column: j[j.length - 1].last_column }, (i = this.performAction.call(e2, P, A, N, this.yy, l[1], z, j)) !== void 0)
return i;
o && (H = H.slice(0, -1 * o * 2), z = z.slice(0, -1 * o), j = j.slice(0, -1 * o)), H.push(this.productions_[l[1]][0]), z.push(e2.$), j.push(e2._$), i = Y[H[H.length - 2]][H[H.length - 1]], H.push(i);
break;
case 3:
return true;
}
}
return true;
} }).lexer = { EOF: 1, parseError: function(U, x) {
if (!this.yy.parseError)
throw new Error(U);
this.yy.parseError(U, x);
}, setInput: function(U) {
return this._input = U, this._more = this._less = this.done = false, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this;
}, input: function() {
var U = this._input[0];
return this.yytext += U, this.yyleng++, this.match += U, this.matched += U, U.match(/\n/) && this.yylineno++, this._input = this._input.slice(1), U;
}, unput: function(U) {
return this._input = U + this._input, this;
}, more: function() {
return this._more = true, this;
}, less: function(U) {
this._input = this.match.slice(U) + this._input;
}, pastInput: function() {
var U = this.matched.substr(0, this.matched.length - this.match.length);
return (20 < U.length ? "..." : "") + U.substr(-20).replace(/\n/g, "");
}, upcomingInput: function() {
var U = this.match;
return U.length < 20 && (U += this._input.substr(0, 20 - U.length)), (U.substr(0, 20) + (20 < U.length ? "..." : "")).replace(/\n/g, "");
}, showPosition: function() {
var U = this.pastInput(), x = new Array(U.length + 1).join("-");
return U + this.upcomingInput() + `
` + x + "^";
}, next: function() {
if (this.done)
return this.EOF;
this._input || (this.done = true), this._more || (this.yytext = "", this.match = "");
for (var U, x, H, z, j = this._currentRules(), Y = 0; Y < j.length && (!(x = this._input.match(this.rules[j[Y]])) || U && !(x[0].length > U[0].length) || (U = x, H = Y, this.options.flex)); Y++)
;
return U ? ((z = U[0].match(/\n.*/g)) && (this.yylineno += z.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: z ? z[z.length - 1].length - 1 : this.yylloc.last_column + U[0].length }, this.yytext += U[0], this.match += U[0], this.yyleng = this.yytext.length, this._more = false, this._input = this._input.slice(U[0].length), this.matched += U[0], z = this.performAction.call(this, this.yy, this, j[H], this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = false), z || void 0) : this._input === "" ? this.EOF : void this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
` + this.showPosition(), { text: "", token: null, line: this.yylineno });
}, lex: function() {
var U = this.next();
return U !== void 0 ? U : this.lex();
}, begin: function(U) {
this.conditionStack.push(U);
}, popState: function() {
return this.conditionStack.pop();
}, _currentRules: function() {
return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
}, topState: function() {
return this.conditionStack[this.conditionStack.length - 2];
}, pushState: function(U) {
this.begin(U);
}, options: {}, performAction: function(U, x, H, z) {
switch (H) {
case 0:
break;
case 1:
return 6;
case 2:
return x.yytext = x.yytext.substr(1, x.yyleng - 2), 4;
case 3:
return 17;
case 4:
return 18;
case 5:
return 23;
case 6:
return 24;
case 7:
return 22;
case 8:
return 21;
case 9:
return 10;
case 10:
return 11;
case 11:
return 8;
case 12:
return 14;
case 13:
return "INVALID";
}
}, rules: [/^(?:\s+)/, /^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/, /^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/, /^(?:\{)/, /^(?:\})/, /^(?:\[)/, /^(?:\])/, /^(?:,)/, /^(?::)/, /^(?:true\b)/, /^(?:false\b)/, /^(?:null\b)/, /^(?:$)/, /^(?:.)/], conditions: { INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], inclusive: true } } };
var D;
m.parser = D, m.parse = D.parse.bind(D);
}, 3879: function(le) {
function m() {
}
m.prototype = { on: function(N, A) {
this._events = this._events || {}, this._events[N] = this._events[N] || [], this._events[N].push(A);
}, off: function(N, A) {
this._events = this._events || {}, N in this._events && this._events[N].splice(this._events[N].indexOf(A), 1);
}, emit: function(N) {
if (this._events = this._events || {}, N in this._events)
for (var A = 0; A < this._events[N].length; A++)
this._events[N][A].apply(this, Array.prototype.slice.call(arguments, 1));
} }, m.mixin = function(N) {
for (var A = ["on", "off", "emit"], f = 0; f < A.length; f++)
typeof N == "function" ? N.prototype[A[f]] = m.prototype[A[f]] : N[A[f]] = m.prototype[A[f]];
return N;
};
var D = { escapeRegExp: function(N) {
var A = /[\\^$.*+?()[\]{}|]/g, f = new RegExp(A.source);
return N && f.test(N) ? N.replace(A, "\\$&") : N;
}, extend: function(N, A) {
for (var f in A) {
var R;
A.hasOwnProperty(f) && ((R = A[f]) && Object.prototype.toString.call(R) === "[object Object]" ? (N[f] = N[f] || {}, D.extend(N[f], R)) : N[f] = R);
}
return N;
}, each: function(N, A, f) {
if (Object.prototype.toString.call(N) === "[object Object]")
for (var R in N)
Object.prototype.hasOwnProperty.call(N, R) && A.call(f, R, N[R], N);
else
for (var y = 0, C = N.length; y < C; y++)
A.call(f, y, N[y], N);
}, createElement: function(N, A) {
var f, R = document.createElement(N);
if (A && Object.prototype.toString.call(A) === "[object Object]")
for (f in A)
f in R ? R[f] = A[f] : f === "html" ? R.innerHTML = A[f] : R.setAttribute(f, A[f]);
return R;
}, hasClass: function(N, A) {
if (N)
return N.classList ? N.classList.contains(A) : !!N.className && !!N.className.match(new RegExp("(\\s|^)" + A + "(\\s|$)"));
}, addClass: function(N, A) {
D.hasClass(N, A) || (N.classList ? N.classList.add(A) : N.className = N.className.trim() + " " + A);
}, removeClass: function(N, A) {
D.hasClass(N, A) && (N.classList ? N.classList.remove(A) : N.className = N.className.replace(new RegExp("(^|\\s)" + A.split(" ").join("|") + "(\\s|$)", "gi"), " "));
}, closest: function(N, A) {
return N && N !== document.body && (A(N) ? N : D.closest(N.parentNode, A));
}, isInt: function(N) {
return typeof N == "number" && isFinite(N) && Math.floor(N) === N;
}, debounce: function(N, A, f) {
var R;
return function() {
var y = this, C = arguments, d = f && !R;
clearTimeout(R), R = setTimeout(function() {
R = null, f || N.apply(y, C);
}, A), d && N.apply(y, C);
};
}, rect: function(R, C) {
var f = window, R = R.getBoundingClientRect(), y = C ? f.pageXOffset : 0, C = C ? f.pageYOffset : 0;
return { bottom: R.bottom + C, height: R.height, left: R.left + y, right: R.right + y, top: R.top + C, width: R.width };
}, includes: function(N, A) {
return -1 < N.indexOf(A);
}, startsWith: function(N, A) {
return N.substr(0, A.length) === A;
}, truncate: function(N) {
for (; N.firstChild; )
N.removeChild(N.firstChild);
} };
function U(N, A) {
return N.hasOwnProperty(A) && (N[A] === true || N[A].length);
}
function x(N, A, f) {
N.parentNode ? N.parentNode.parentNode || A.appendChild(N.parentNode) : A.appendChild(N), D.removeClass(N, "excluded"), f || (N.textContent = N.textContent);
}
function H() {
var N, A;
this.items.length && (N = document.createDocumentFragment(), this.config.pagination ? (A = this.pages.slice(0, this.pageIndex), D.each(A, function(f, R) {
D.each(R, function(y, C) {
x(C, N, this.customOption);
}, this);
}, this)) : D.each(this.items, function(f, R) {
x(R, N, this.customOption);
}, this), N.childElementCount && (D.removeClass(this.items[this.navIndex], "active"), this.navIndex = (N.querySelector(".selectr-option.selected") || N.querySelector(".selectr-option")).idx, D.addClass(this.items[this.navIndex], "active")), this.tree.appendChild(N));
}
function z(N, A) {
A = A || N;
var f = { class: "selectr-option", role: "treeitem", "aria-selected": false };
return this.customOption ? f.html = this.config.renderOption(A) : f.textContent = N.textContent, (A = D.createElement("li", f)).idx = N.idx, this.items.push(A), N.defaultSelected && this.defaultSelected.push(N.idx), N.disabled && (A.disabled = true, D.addClass(A, "disabled")), A;
}
function j() {
var N, A = this.tree, f = A.scrollTop;
A.scrollHeight - A.offsetHeight <= f && this.pageIndex < this.pages.length && (N = document.createDocumentFragment(), D.each(this.pages[this.pageIndex], function(R, y) {
x(y, N, this.customOption);
}, this), A.appendChild(N), this.pageIndex++, this.emit("selectr.paginate", { items: this.items.length, total: this.data.length, page: this.pageIndex, pages: this.pages.length }));
}
function Y() {
(this.config.searchable || this.config.taggable) && (this.input.value = null, this.searching = false, this.config.searchable && D.removeClass(this.inputContainer, "active"), D.hasClass(this.container, "notice") && (D.removeClass(this.container, "notice"), D.addClass(this.container, "open"), this.input.focus()), D.each(this.items, function(N, A) {
D.removeClass(A, "excluded"), this.customOption || (A.textContent = A.textContent);
}, this));
}
function P(N, A) {
if (!N)
throw new Error("You must supply either a HTMLSelectElement or a CSS3 selector string.");
if (typeof (this.el = N) == "string" && (this.el = document.querySelector(N)), this.el === null)
throw new Error("The element you passed to Selectr can not be found.");
if (this.el.nodeName.toLowerCase() !== "select")
throw new Error("The element you passed to Selectr is not a HTMLSelectElement.");
this.render(A);
}
P.prototype.render = function(N) {
var A;
this.rendered || ((this.el.selectr = this).config = D.extend({ defaultSelected: true, width: "auto", disabled: false, disabledMobile: false, searchable: true, clearable: false, sortSelected: false, allowDeselect: false, closeOnScroll: false, nativeDropdown: false, nativeKeyboard: false, placeholder: "Select an option...", taggable: false, tagPlaceholder: "Enter a tag...", messages: { noResults: "No results.", noOptions: "No options available.", maxSelections: "A maximum of {max} items can be selected.", tagDuplicate: "That tag is already in use.", searchPlaceholder: "Search options..." } }, N), this.originalType = this.el.type, this.originalIndex = this.el.tabIndex, this.defaultSelected = [], this.originalOptionCount = this.el.options.length, (this.config.multiple || this.config.taggable) && (this.el.multiple = true), this.disabled = U(this.config, "disabled"), this.opened = false, this.config.taggable && (this.config.searchable = false), this.navigating = false, this.mobileDevice = false, !this.config.disabledMobile && /Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(navigator.userAgent) && (this.mobileDevice = true), this.customOption = this.config.hasOwnProperty("renderOption") && typeof this.config.renderOption == "function", this.customSelected = this.config.hasOwnProperty("renderSelection") && typeof this.config.renderSelection == "function", this.supportsEventPassiveOption = this.detectEventPassiveOption(), m.mixin(this), (function() {
this.requiresPagination = this.config.pagination && 0 < this.config.pagination, U(this.config, "width") && (D.isInt(this.config.width) ? this.width = this.config.width + "px" : this.config.width === "auto" ? this.width = "100%" : D.includes(this.config.width, "%") && (this.width = this.config.width)), this.container = D.createElement("div", { class: "selectr-container" }), this.config.customClass && D.addClass(this.container, this.config.customClass), this.mobileDevice ? D.addClass(this.container, "selectr-mobile") : D.addClass(this.container, "selectr-desktop"), this.el.tabIndex = -1, this.config.nativeDropdown || this.mobileDevice ? D.addClass(this.el, "selectr-visible") : D.addClass(this.el, "selectr-hidden"), this.selected = D.createElement("div", { class: "selectr-selected", disabled: this.disabled, tabIndex: 0, "aria-expanded": false }), this.label = D.createElement(this.el.multiple ? "ul" : "span", { class: "selectr-label" });
var f = D.createElement("div", { class: "selectr-options-container" });
if (this.tree = D.createElement("ul", { class: "selectr-options", role: "tree", "aria-hidden": true, "aria-expanded": false }), this.notice = D.createElement("div", { class: "selectr-notice" }), this.el.setAttribute("aria-hidden", true), this.disabled && (this.el.disabled = true), this.el.multiple ? (D.addClass(this.label, "selectr-tags"), D.addClass(this.container, "multiple"), this.tags = [], this.selectedValues = this.config.defaultSelected ? this.getSelectedProperties("value") : [], this.selectedIndexes = this.getSelectedProperties("idx")) : (this.selectedValue = null, this.selectedIndex = -1), this.selected.appendChild(this.label), this.config.clearable && (this.selectClear = D.createElement("button", { class: "selectr-clear", type: "button" }), this.container.appendChild(this.selectClear), D.addClass(this.container, "clearable")), this.config.taggable) {
var R = D.createElement("li", { class: "input-tag" });
if (this.input = D.createElement("input", { class: "selectr-tag-input", placeholder: this.config.tagPlaceholder, tagIndex: 0, autocomplete: "off", autocorrect: "off", autocapitalize: "off", spellcheck: "false", role: "textbox", type: "search" }), R.appendChild(this.input), this.label.appendChild(R), D.addClass(this.container, "taggable"), this.tagSeperators = [","], this.config.tagSeperators) {
this.tagSeperators = this.tagSeperators.concat(this.config.tagSeperators);
for (var y = [], C = 0; C < this.tagSeperators.length; C++)
y.push(D.escapeRegExp(this.tagSeperators[C]));
this.tagSeperatorsRegex = new RegExp(y.join("|"), "i");
} else
this.tagSeperatorsRegex = new RegExp(",", "i");
}
this.config.searchable && (this.input = D.createElement("input", { class: "selectr-input", tagIndex: -1, autocomplete: "off", autocorrect: "off", autocapitalize: "off", spellcheck: "false", role: "textbox", type: "search", placeholder: this.config.messages.searchPlaceholder }), this.inputClear = D.createElement("button", { class: "selectr-input-clear", type: "button" }), this.inputContainer = D.createElement("div", { class: "selectr-input-container" }), this.inputContainer.appendChild(this.input), this.inputContainer.appendChild(this.inputClear), f.appendChild(this.inputContainer)), f.appendChild(this.notice), f.appendChild(this.tree), this.items = [], this.options = [], this.el.options.length && (this.options = [].slice.call(this.el.options));
var d, h, l, n = false, o = 0;
this.el.children.length && D.each(this.el.children, function(a, r) {
r.nodeName === "OPTGROUP" ? (n = D.createElement("ul", { class: "selectr-optgroup", role: "group", html: "
" + r.label + " " }), D.each(r.children, function(e2, t) {
t.idx = o, n.appendChild(z.call(this, t, n)), o++;
}, this)) : (r.idx = o, z.call(this, r), o++);
}, this), this.config.data && Array.isArray(this.config.data) && (d = !(this.data = []), n = false, o = 0, D.each(this.config.data, function(a, r) {
U(r, "children") ? (d = D.createElement("optgroup", { label: r.text }), n = D.createElement("ul", { class: "selectr-optgroup", role: "group", html: "" + r.text + " " }), D.each(r.children, function(e2, t) {
(h = new Option(t.text, t.value, false, t.hasOwnProperty("selected") && t.selected === true)).disabled = U(t, "disabled"), this.options.push(h), d.appendChild(h), h.idx = o, n.appendChild(z.call(this, h, t)), this.data[o] = t, o++;
}, this), this.el.appendChild(d)) : ((h = new Option(r.text, r.value, false, r.hasOwnProperty("selected") && r.selected === true)).disabled = U(r, "disabled"), this.options.push(h), h.idx = o, z.call(this, h, r), this.data[o] = r, o++);
}, this)), this.setSelected(true);
for (var i = this.navIndex = 0; i < this.items.length; i++)
if (l = this.items[i], !D.hasClass(l, "disabled")) {
D.addClass(l, "active"), this.navIndex = i;
break;
}
this.requiresPagination && (this.pageIndex = 1, this.paginate()), this.container.appendChild(this.selected), this.container.appendChild(f), this.placeEl = D.createElement("div", { class: "selectr-placeholder" }), this.setPlaceholder(), this.selected.appendChild(this.placeEl), this.disabled && this.disable(), this.el.parentNode.insertBefore(this.container, this.el), this.container.appendChild(this.el);
}).call(this), this.bindEvents(), this.update(), this.optsRect = D.rect(this.tree), this.rendered = true, this.el.multiple || (this.el.selectedIndex = this.selectedIndex), A = this, setTimeout(function() {
A.emit("selectr.init");
}, 20));
}, P.prototype.getSelected = function() {
return this.el.querySelectorAll("option:checked");
}, P.prototype.getSelectedProperties = function(N) {
var A = this.getSelected();
return [].slice.call(A).map(function(f) {
return f[N];
}).filter(function(f) {
return f != null;
});
}, P.prototype.detectEventPassiveOption = function() {
var N = false;
try {
var A = Object.defineProperty({}, "passive", { get: function() {
N = true;
} });
window.addEventListener("test", null, A);
} catch {
}
return N;
}, P.prototype.bindEvents = function() {
var N, A = this;
this.events = {}, this.events.dismiss = (function(f) {
f = f.target, this.container.contains(f) || !this.opened && !D.hasClass(this.container, "notice") || this.close();
}).bind(this), this.events.navigate = (function(f) {
if (f = f || window.event, this.items.length && this.opened && D.includes([13, 38, 40], f.which)) {
if (f.preventDefault(), f.which === 13)
return !(this.noResults || this.config.taggable && 0 < this.input.value.length) && this.change(this.navIndex);
var R, y = this.items[this.navIndex], C = this.navIndex;
switch (f.which) {
case 38:
(R = 0) < this.navIndex && this.navIndex--;
break;
case 40:
this.navIndex < this.items.length - (R = 1) && this.navIndex++;
}
for (this.navigating = true; D.hasClass(this.items[this.navIndex], "disabled") || D.hasClass(this.items[this.navIndex], "excluded"); ) {
if (!(0 < this.navIndex && this.navIndex < this.items.length - 1)) {
this.navIndex = C;
break;
}
if (R ? this.navIndex++ : this.navIndex--, this.searching) {
if (this.navIndex > this.tree.lastElementChild.idx) {
this.navIndex = this.tree.lastElementChild.idx;
break;
}
if (this.navIndex < this.tree.firstElementChild.idx) {
this.navIndex = this.tree.firstElementChild.idx;
break;
}
}
}
f = D.rect(this.items[this.navIndex]), R ? (this.navIndex === 0 ? this.tree.scrollTop = 0 : f.top + f.height > this.optsRect.top + this.optsRect.height && (this.tree.scrollTop = this.tree.scrollTop + (f.top + f.height - (this.optsRect.top + this.optsRect.height))), this.navIndex === this.tree.childElementCount - 1 && this.requiresPagination && j.call(this)) : this.navIndex === 0 ? this.tree.scrollTop = 0 : f.top - this.optsRect.top < 0 && (this.tree.scrollTop = this.tree.scrollTop + (f.top - this.optsRect.top)), y && D.removeClass(y, "active"), D.addClass(this.items[this.navIndex], "active");
} else
this.navigating = false;
}).bind(this), this.events.reset = this.reset.bind(this), (this.config.nativeDropdown || this.mobileDevice) && (this.container.addEventListener("touchstart", function(f) {
f.changedTouches[0].target === A.el && A.toggle();
}, !!this.supportsEventPassiveOption && { passive: true }), this.container.addEventListener("click", function(f) {
f.target === A.el && A.toggle();
}), this.el.addEventListener("change", function(f) {
f.__selfTriggered || (A.el.multiple ? (f = A.getSelectedProperties("idx"), f = function(R, y) {
for (var C, d = [], h = R.slice(0), l = 0; l < y.length; l++)
-1 < (C = h.indexOf(y[l])) ? h.splice(C, 1) : d.push(y[l]);
return [d, h];
}(A.selectedIndexes, f), D.each(f[0], function(R, y) {
A.select(y);
}, A), D.each(f[1], function(R, y) {
A.deselect(y);
}, A)) : -1 < A.el.selectedIndex && A.select(A.el.selectedIndex));
})), this.config.nativeDropdown && this.container.addEventListener("keydown", function(f) {
f.key === "Enter" && A.selected === document.activeElement && (A.toggle(), setTimeout(function() {
A.el.focus();
}, 200));
}), this.selected.addEventListener("click", function(f) {
A.disabled || A.toggle(), f.preventDefault();
}), this.config.nativeKeyboard && (N = "", this.selected.addEventListener("keydown", function(f) {
var R;
A.disabled || A.selected !== document.activeElement || f.altKey || f.ctrlKey || f.metaKey || (f.key === " " || !A.opened && -1 < ["Enter", "ArrowUp", "ArrowDown"].indexOf(f.key) ? (A.toggle(), f.preventDefault(), f.stopPropagation()) : f.key.length <= 2 && String[String.fromCodePoint ? "fromCodePoint" : "fromCharCode"](f.key[String.codePointAt ? "codePointAt" : "charCodeAt"](0)) === f.key && (A.config.multiple ? (A.open(), A.config.searchable && (A.input.value = f.key, A.input.focus(), A.search(null, true))) : (N += f.key, (R = A.search(N, true)) && R.length && (A.clear(), A.setValue(R[0].value)), setTimeout(function() {
N = "";
}, 1e3)), f.preventDefault(), f.stopPropagation()));
}), this.container.addEventListener("keyup", function(f) {
A.opened && f.key === "Escape" && (A.close(), f.stopPropagation(), A.selected.focus());
})), this.label.addEventListener("click", function(f) {
D.hasClass(f.target, "selectr-tag-remove") && A.deselect(f.target.parentNode.idx);
}), this.selectClear && this.selectClear.addEventListener("click", this.clear.bind(this)), this.tree.addEventListener("mousedown", function(f) {
f.preventDefault();
}), this.tree.addEventListener("click", function(f) {
var R = D.closest(f.target, function(y) {
return y && D.hasClass(y, "selectr-option");
});
R && !D.hasClass(R, "disabled") && (D.hasClass(R, "selected") ? (A.el.multiple || !A.el.multiple && A.config.allowDeselect) && A.deselect(R.idx) : A.select(R.idx), A.opened && !A.el.multiple) && A.close(), f.preventDefault(), f.stopPropagation();
}), this.tree.addEventListener("mouseover", function(f) {
!D.hasClass(f.target, "selectr-option") || D.hasClass(f.target, "disabled") || (D.removeClass(A.items[A.navIndex], "active"), D.addClass(f.target, "active"), A.navIndex = [].slice.call(A.items).indexOf(f.target));
}), this.config.searchable && (this.input.addEventListener("focus", function(f) {
A.searching = true;
}), this.input.addEventListener("blur", function(f) {
A.searching = false;
}), this.input.addEventListener("keyup", function(f) {
A.search(), A.config.taggable || (this.value.length ? D.addClass(this.parentNode, "active") : D.removeClass(this.parentNode, "active"));
}), this.inputClear.addEventListener("click", function(f) {
A.input.value = null, Y.call(A), A.tree.childElementCount || H.call(A);
})), this.config.taggable && this.input.addEventListener("keyup", function(f) {
var R, y;
A.search(), A.config.taggable && this.value.length && (R = this.value.trim()).length && (f.which === 13 || A.tagSeperatorsRegex.test(R)) && (f = R.replace(A.tagSeperatorsRegex, ""), (y = (f = (f = D.escapeRegExp(f)).trim()).length ? A.add({ value: f, textContent: f, selected: true }, true) : y) ? (A.close(), Y.call(A)) : (this.value = "", A.setMessage(A.config.messages.tagDuplicate)));
}), this.update = D.debounce(function() {
A.opened && A.config.closeOnScroll && A.close(), A.width && (A.container.style.width = A.width), A.invert();
}, 50), this.requiresPagination && (this.paginateItems = D.debounce(function() {
j.call(this);
}, 50), this.tree.addEventListener("scroll", this.paginateItems.bind(this))), document.addEventListener("click", this.events.dismiss), window.addEventListener("keydown", this.events.navigate), window.addEventListener("resize", this.update), window.addEventListener("scroll", this.update), this.on("selectr.destroy", function() {
document.removeEventListener("click", this.events.dismiss), window.removeEventListener("keydown", this.events.navigate), window.removeEventListener("resize", this.update), window.removeEventListener("scroll", this.update);
}), this.el.form && (this.el.form.addEventListener("reset", this.events.reset), this.on("selectr.destroy", function() {
this.el.form.removeEventListener("reset", this.events.reset);
}));
}, P.prototype.setSelected = function(N) {
var A;
this.config.data || this.el.multiple || !this.el.options.length || (this.el.selectedIndex !== 0 || this.el.options[0].defaultSelected || this.config.defaultSelected || (this.el.selectedIndex = -1), this.selectedIndex = this.el.selectedIndex, -1 < this.selectedIndex && this.select(this.selectedIndex)), this.config.multiple && this.originalType === "select-one" && !this.config.data && this.el.options[0].selected && !this.el.options[0].defaultSelected && (this.el.options[0].selected = false), D.each(this.options, function(f, R) {
R.selected && R.defaultSelected && this.select(R.idx);
}, this), this.config.selectedValue && this.setValue(this.config.selectedValue), this.config.data && (!this.el.multiple && this.config.defaultSelected && this.el.selectedIndex < 0 && 0 < this.config.data.length && this.select(0), A = 0, D.each(this.config.data, function(f, R) {
U(R, "children") ? D.each(R.children, function(y, C) {
C.hasOwnProperty("selected") && C.selected === true && this.select(A), A++;
}, this) : (R.hasOwnProperty("selected") && R.selected === true && this.select(A), A++);
}, this));
}, P.prototype.destroy = function() {
this.rendered && (this.emit("selectr.destroy"), this.originalType === "select-one" && (this.el.multiple = false), this.config.data && (this.el.innerHTML = ""), D.removeClass(this.el, "selectr-hidden"), this.container.parentNode.replaceChild(this.el, this.container), this.rendered = false, delete this.el.selectr);
}, P.prototype.change = function(N) {
var A = this.items[N], f = this.options[N];
f.disabled || (f.selected && D.hasClass(A, "selected") ? this.deselect(N) : this.select(N), this.opened && !this.el.multiple && this.close());
}, P.prototype.select = function(N) {
var A = this.items[N], f = [].slice.call(this.el.options), R = this.options[N];
if (this.el.multiple) {
if (D.includes(this.selectedIndexes, N))
return false;
if (this.config.maxSelections && this.tags.length === this.config.maxSelections)
return this.setMessage(this.config.messages.maxSelections.replace("{max}", this.config.maxSelections), true), false;
this.selectedValues.push(R.value), this.selectedIndexes.push(N), (function(C) {
var d, h = this, l = document.createDocumentFragment(), n = this.options[C.idx], o = this.data ? this.data[C.idx] : n, i = { class: "selectr-tag" }, o = (this.customSelected ? i.html = this.config.renderSelection(o) : i.textContent = n.textContent, D.createElement("li", i)), i = D.createElement("button", { class: "selectr-tag-remove", type: "button" });
o.appendChild(i), o.idx = C.idx, o.tag = n.value, this.tags.push(o), this.config.sortSelected ? (i = this.tags.slice(), d = function(a, r) {
a.replace(/(\d+)|(\D+)/g, function(e2, t, s) {
r.push([t || 1 / 0, s || ""]);
});
}, i.sort(function(a, r) {
var e2, t, s = [], c = [];
for (h.config.sortSelected === true ? (e2 = a.tag, t = r.tag) : h.config.sortSelected === "text" && (e2 = a.textContent, t = r.textContent), d(e2, s), d(t, c); s.length && c.length; ) {
var g = s.shift(), p = c.shift(), g = g[0] - p[0] || g[1].localeCompare(p[1]);
if (g)
return g;
}
return s.length - c.length;
}), D.each(i, function(a, r) {
l.appendChild(r);
}), this.label.innerHTML = "") : l.appendChild(o), this.config.taggable ? this.label.insertBefore(l, this.input.parentNode) : this.label.appendChild(l);
}).call(this, A);
} else {
var y = this.data ? this.data[N] : R;
this.customSelected ? this.label.innerHTML = this.config.renderSelection(y) : this.label.textContent = R.textContent, this.selectedValue = R.value, this.selectedIndex = N, D.each(this.options, function(C, d) {
var h = this.items[C];
C !== N && (h && D.removeClass(h, "selected"), d.selected = false, d.removeAttribute("selected"));
}, this);
}
D.includes(f, R) || this.el.add(R), A.setAttribute("aria-selected", true), D.addClass(A, "selected"), D.addClass(this.container, "has-selected"), R.selected = true, R.setAttribute("selected", ""), this.emit("selectr.change", R), this.emit("selectr.select", R), "createEvent" in document ? ((y = document.createEvent("HTMLEvents")).initEvent("change", true, true), y.__selfTriggered = true, this.el.dispatchEvent(y)) : this.el.fireEvent("onchange");
}, P.prototype.deselect = function(N, A) {
var f = this.items[N], R = this.options[N];
if (this.el.multiple) {
var y = this.selectedIndexes.indexOf(N), y = (this.selectedIndexes.splice(y, 1), this.selectedValues.indexOf(R.value));
this.selectedValues.splice(y, 1), (function(C) {
var d = false;
D.each(this.tags, function(h, l) {
l.idx === C.idx && (d = l);
}, this), d && (this.label.removeChild(d), this.tags.splice(this.tags.indexOf(d), 1));
}).call(this, f), this.tags.length || D.removeClass(this.container, "has-selected");
} else {
if (!A && !this.config.clearable && !this.config.allowDeselect)
return false;
this.label.innerHTML = "", this.selectedValue = null, this.el.selectedIndex = this.selectedIndex = -1, D.removeClass(this.container, "has-selected");
}
this.items[N].setAttribute("aria-selected", false), D.removeClass(this.items[N], "selected"), R.selected = false, R.removeAttribute("selected"), this.emit("selectr.change", null), this.emit("selectr.deselect", R), "createEvent" in document ? ((y = document.createEvent("HTMLEvents")).initEvent("change", true, true), y.__selfTriggered = true, this.el.dispatchEvent(y)) : this.el.fireEvent("onchange");
}, P.prototype.setValue = function(N) {
var A = Array.isArray(N);
if (A || (N = N.toString().trim()), !this.el.multiple && A)
return false;
D.each(this.options, function(f, R) {
(A && -1 < N.indexOf(R.value) || R.value === N) && this.change(R.idx);
}, this);
}, P.prototype.getValue = function(N, A) {
var f, R;
return this.el.multiple ? N ? this.selectedIndexes.length && (R = { values: [] }, D.each(this.selectedIndexes, function(y, C) {
C = this.options[C], R.values[y] = { value: C.value, text: C.textContent };
}, this)) : R = this.selectedValues.slice() : R = N ? { value: (f = this.options[this.selectedIndex]).value, text: f.textContent } : this.selectedValue, R = N && A ? JSON.stringify(R) : R;
}, P.prototype.add = function(N, A) {
if (N) {
if (this.data = this.data || [], this.items = this.items || [], this.options = this.options || [], Array.isArray(N))
D.each(N, function(y, C) {
this.add(C, A);
}, this);
else if (Object.prototype.toString.call(N) === "[object Object]") {
if (A) {
var f = false;
if (D.each(this.options, function(y, C) {
C.value.toLowerCase() === N.value.toLowerCase() && (f = true);
}), f)
return false;
}
var R = D.createElement("option", N);
return this.data.push(N), this.mobileDevice && this.el.add(R), this.options.push(R), R.idx = 0 < this.options.length ? this.options.length - 1 : 0, z.call(this, R), N.selected && this.select(R.idx), this.setPlaceholder(), R;
}
return this.config.pagination && this.paginate(), true;
}
}, P.prototype.remove = function(N) {
var A, f = [];
Array.isArray(N) ? D.each(N, function(R, y) {
D.isInt(y) ? f.push(this.getOptionByIndex(y)) : typeof y == "string" && f.push(this.getOptionByValue(y));
}, this) : D.isInt(N) ? f.push(this.getOptionByIndex(N)) : typeof N == "string" && f.push(this.getOptionByValue(N)), f.length && (D.each(f, function(R, y) {
A = y.idx, this.el.remove(y), this.options.splice(A, 1), y = this.items[A].parentNode, y && y.removeChild(this.items[A]), this.items.splice(A, 1), D.each(this.options, function(C, d) {
d.idx = C, this.items[C].idx = C;
}, this);
}, this), this.setPlaceholder(), this.config.pagination) && this.paginate();
}, P.prototype.removeAll = function() {
this.clear(true), D.each(this.el.options, function(N, A) {
this.el.remove(A);
}, this), D.truncate(this.tree), this.items = [], this.options = [], this.data = [], this.navIndex = 0, this.requiresPagination && (this.requiresPagination = false, this.pageIndex = 1, this.pages = []), this.setPlaceholder();
}, P.prototype.search = function(N, A) {
var f, R, y, C, d;
if (!this.navigating)
return f = false, N || (N = this.input.value, f = true, this.removeMessage(), D.truncate(this.tree)), R = [], y = document.createDocumentFragment(), 0 < (N = N.trim().toLowerCase()).length ? (C = A ? D.startsWith : D.includes, D.each(this.options, function(h, l) {
var n, o, i, a, r = this.items[l.idx];
C(l.textContent.trim().toLowerCase(), N) && !l.disabled ? (R.push({ text: l.textContent, value: l.value }), f && (x(r, y, this.customOption), D.removeClass(r, "excluded"), !this.customOption) && (n = N, i = (l = l).textContent, n = new RegExp(n, "ig"), a = n.exec(i)) && (l.innerHTML = "", (o = document.createElement("span")).classList.add("selectr-match"), o.textContent = a[0], l.appendChild(document.createTextNode(i.substring(0, a.index))), l.appendChild(o), l.appendChild(document.createTextNode(i.substring(n.lastIndex))))) : f && D.addClass(r, "excluded");
}, this), f && (y.childElementCount ? (A = this.items[this.navIndex], d = y.querySelector(".selectr-option:not(.excluded)"), this.noResults = false, D.removeClass(A, "active"), this.navIndex = d.idx, D.addClass(d, "active")) : this.config.taggable || (this.noResults = true, this.setMessage(this.config.messages.noResults)), this.tree.appendChild(y))) : H.call(this), R;
}, P.prototype.toggle = function() {
this.disabled || (this.opened ? this.close() : this.open());
}, P.prototype.open = function() {
var N = this;
if (!this.options.length)
return false;
this.opened || this.emit("selectr.open"), this.opened = true, this.mobileDevice || this.config.nativeDropdown ? (D.addClass(this.container, "native-open"), this.config.data && D.each(this.options, function(A, f) {
this.el.add(f);
}, this)) : (D.addClass(this.container, "open"), H.call(this), this.invert(), this.tree.scrollTop = 0, D.removeClass(this.container, "notice"), this.selected.setAttribute("aria-expanded", true), this.tree.setAttribute("aria-hidden", false), this.tree.setAttribute("aria-expanded", true), this.config.searchable && !this.config.taggable && setTimeout(function() {
N.input.focus(), N.input.tabIndex = 0;
}, 10));
}, P.prototype.close = function() {
var N;
this.opened && this.emit("selectr.close"), this.opened = false, this.navigating = false, this.mobileDevice || this.config.nativeDropdown ? D.removeClass(this.container, "native-open") : (N = D.hasClass(this.container, "notice"), this.config.searchable && !N && (this.input.blur(), this.input.tabIndex = -1, this.searching = false), N && (D.removeClass(this.container, "notice"), this.notice.textContent = ""), D.removeClass(this.container, "open"), D.removeClass(this.container, "native-open"), this.selected.setAttribute("aria-expanded", false), this.tree.setAttribute("aria-hidden", true), this.tree.setAttribute("aria-expanded", false), D.truncate(this.tree), Y.call(this));
}, P.prototype.enable = function() {
this.disabled = false, this.el.disabled = false, this.selected.tabIndex = this.originalIndex, this.el.multiple && D.each(this.tags, function(N, A) {
A.lastElementChild.tabIndex = 0;
}), D.removeClass(this.container, "selectr-disabled");
}, P.prototype.disable = function(N) {
N || (this.el.disabled = true), this.selected.tabIndex = -1, this.el.multiple && D.each(this.tags, function(A, f) {
f.lastElementChild.tabIndex = -1;
}), this.disabled = true, D.addClass(this.container, "selectr-disabled");
}, P.prototype.reset = function() {
this.disabled || (this.clear(), this.setSelected(true), D.each(this.defaultSelected, function(N, A) {
this.select(A);
}, this), this.emit("selectr.reset"));
}, P.prototype.clear = function(N, A) {
var f;
this.el.multiple ? this.selectedIndexes.length && (f = this.selectedIndexes.slice(), A ? this.deselect(f.slice(-1)[0]) : D.each(f, function(R, y) {
this.deselect(y);
}, this)) : -1 < this.selectedIndex && this.deselect(this.selectedIndex, N), this.emit("selectr.clear");
}, P.prototype.serialise = function(N) {
var A = [];
return D.each(this.options, function(f, R) {
var y = { value: R.value, text: R.textContent };
R.selected && (y.selected = true), R.disabled && (y.disabled = true), A[f] = y;
}), N ? JSON.stringify(A) : A;
}, P.prototype.serialize = function(N) {
return this.serialise(N);
}, P.prototype.setPlaceholder = function(N) {
N = N || this.config.placeholder || this.el.getAttribute("placeholder"), this.options.length || (N = this.config.messages.noOptions), this.placeEl.innerHTML = N;
}, P.prototype.paginate = function() {
var N;
if (this.items.length)
return (N = this).pages = this.items.map(function(A, f) {
return f % N.config.pagination == 0 ? N.items.slice(f, f + N.config.pagination) : null;
}).filter(function(A) {
return A;
}), this.pages;
}, P.prototype.setMessage = function(N, A) {
A && this.close(), D.addClass(this.container, "notice"), this.notice.textContent = N;
}, P.prototype.removeMessage = function() {
D.removeClass(this.container, "notice"), this.notice.innerHTML = "";
}, P.prototype.invert = function() {
var N = D.rect(this.selected), A = this.tree.parentNode.offsetHeight, f = window.innerHeight;
N.top + N.height + A > f ? (D.addClass(this.container, "inverted"), this.isInverted = true) : (D.removeClass(this.container, "inverted"), this.isInverted = false), this.optsRect = D.rect(this.tree);
}, P.prototype.getOptionByIndex = function(N) {
return this.options[N];
}, P.prototype.getOptionByValue = function(N) {
for (var A = false, f = 0, R = this.options.length; f < R; f++)
if (this.options[f].value.trim() === N.toString().trim()) {
A = this.options[f];
break;
}
return A;
}, le.exports = P;
}, 4188: function(le, m, D) {
D.d(m, { EX: function() {
return x;
}, WF: function() {
return H;
}, oW: function() {
return z;
}, qD: function() {
return U;
} });
var U = document.body, x = 10485760, H = 2e4, z = 2147483648;
}, 2602: function(le, m, D) {
D.d(m, { w: function() {
return x;
} });
var U = D(9791);
function x(H, z, j) {
var Y, P = 3 < arguments.length && arguments[3] !== void 0 && arguments[3], N = typeof (f = H).getRootNode == "function" ? f.getRootNode() : window, A = {}, f = H.getBoundingClientRect(), R = z.getBoundingClientRect(), y = document.createElement("div");
function C() {
if (y && y.parentNode) {
for (var h in y.parentNode.removeChild(y), A)
l = h, Object.prototype.hasOwnProperty.call(A, l) && ((l = A[h]) && (0, U.removeEventListener)(N, h, l), delete A[h]);
typeof j == "function" && j(H);
}
var l;
}
function d(h) {
(h = h.target) === y || (0, U.isChildOf)(h, y) || C();
}
return y.className = "jsoneditor-anchor", y.style.position = "absolute", y.style.left = f.left - R.left + "px", y.style.top = f.top - R.top + "px", y.style.width = f.width - 2 + "px", y.style.height = f.height - 2 + "px", y.style.boxSizing = "border-box", z.appendChild(y), A.mousedown = (0, U.addEventListener)(N, "mousedown", d), A.mousewheel = (0, U.addEventListener)(N, "mousewheel", d), P && (Y = null, y.onmouseover = function() {
clearTimeout(Y), Y = null;
}, y.onmouseout = function() {
Y = Y || setTimeout(C, 200);
}), y.destroy = C, y;
}
}, 7923: function(le) {
le.exports = "data:application/javascript;base64,Im5vIHVzZSBzdHJpY3QiOwohKGZ1bmN0aW9uKHdpbmRvdykgewppZiAodHlwZW9mIHdpbmRvdy53aW5kb3cgIT0gInVuZGVmaW5lZCIgJiYgd2luZG93LmRvY3VtZW50KQogICAgcmV0dXJuOwppZiAod2luZG93LnJlcXVpcmUgJiYgd2luZG93LmRlZmluZSkKICAgIHJldHVybjsKCmlmICghd2luZG93LmNvbnNvbGUpIHsKICAgIHdpbmRvdy5jb25zb2xlID0gZnVuY3Rpb24oKSB7CiAgICAgICAgdmFyIG1zZ3MgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMsIDApOwogICAgICAgIHBvc3RNZXNzYWdlKHt0eXBlOiAibG9nIiwgZGF0YTogbXNnc30pOwogICAgfTsKICAgIHdpbmRvdy5jb25zb2xlLmVycm9yID0KICAgIHdpbmRvdy5jb25zb2xlLndhcm4gPSAKICAgIHdpbmRvdy5jb25zb2xlLmxvZyA9CiAgICB3aW5kb3cuY29uc29sZS50cmFjZSA9IHdpbmRvdy5jb25zb2xlOwp9CndpbmRvdy53aW5kb3cgPSB3aW5kb3c7CndpbmRvdy5hY2UgPSB3aW5kb3c7Cgp3aW5kb3cub25lcnJvciA9IGZ1bmN0aW9uKG1lc3NhZ2UsIGZpbGUsIGxpbmUsIGNvbCwgZXJyKSB7CiAgICBwb3N0TWVzc2FnZSh7dHlwZTogImVycm9yIiwgZGF0YTogewogICAgICAgIG1lc3NhZ2U6IG1lc3NhZ2UsCiAgICAgICAgZGF0YTogZXJyICYmIGVyci5kYXRhLAogICAgICAgIGZpbGU6IGZpbGUsCiAgICAgICAgbGluZTogbGluZSwgCiAgICAgICAgY29sOiBjb2wsCiAgICAgICAgc3RhY2s6IGVyciAmJiBlcnIuc3RhY2sKICAgIH19KTsKfTsKCndpbmRvdy5ub3JtYWxpemVNb2R1bGUgPSBmdW5jdGlvbihwYXJlbnRJZCwgbW9kdWxlTmFtZSkgewogICAgLy8gbm9ybWFsaXplIHBsdWdpbiByZXF1aXJlcwogICAgaWYgKG1vZHVsZU5hbWUuaW5kZXhPZigiISIpICE9PSAtMSkgewogICAgICAgIHZhciBjaHVua3MgPSBtb2R1bGVOYW1lLnNwbGl0KCIhIik7CiAgICAgICAgcmV0dXJuIHdpbmRvdy5ub3JtYWxpemVNb2R1bGUocGFyZW50SWQsIGNodW5rc1swXSkgKyAiISIgKyB3aW5kb3cubm9ybWFsaXplTW9kdWxlKHBhcmVudElkLCBjaHVua3NbMV0pOwogICAgfQogICAgLy8gbm9ybWFsaXplIHJlbGF0aXZlIHJlcXVpcmVzCiAgICBpZiAobW9kdWxlTmFtZS5jaGFyQXQoMCkgPT0gIi4iKSB7CiAgICAgICAgdmFyIGJhc2UgPSBwYXJlbnRJZC5zcGxpdCgiLyIpLnNsaWNlKDAsIC0xKS5qb2luKCIvIik7CiAgICAgICAgbW9kdWxlTmFtZSA9IChiYXNlID8gYmFzZSArICIvIiA6ICIiKSArIG1vZHVsZU5hbWU7CiAgICAgICAgCiAgICAgICAgd2hpbGUgKG1vZHVsZU5hbWUuaW5kZXhPZigiLiIpICE9PSAtMSAmJiBwcmV2aW91cyAhPSBtb2R1bGVOYW1lKSB7CiAgICAgICAgICAgIHZhciBwcmV2aW91cyA9IG1vZHVsZU5hbWU7CiAgICAgICAgICAgIG1vZHVsZU5hbWUgPSBtb2R1bGVOYW1lLnJlcGxhY2UoL15cLlwvLywgIiIpLnJlcGxhY2UoL1wvXC5cLy8sICIvIikucmVwbGFjZSgvW15cL10rXC9cLlwuXC8vLCAiIik7CiAgICAgICAgfQogICAgfQogICAgCiAgICByZXR1cm4gbW9kdWxlTmFtZTsKfTsKCndpbmRvdy5yZXF1aXJlID0gZnVuY3Rpb24gcmVxdWlyZShwYXJlbnRJZCwgaWQpIHsKICAgIGlmICghaWQpIHsKICAgICAgICBpZCA9IHBhcmVudElkOwogICAgICAgIHBhcmVudElkID0gbnVsbDsKICAgIH0KICAgIGlmICghaWQuY2hhckF0KQogICAgICAgIHRocm93IG5ldyBFcnJvcigid29ya2VyLmpzIHJlcXVpcmUoKSBhY2NlcHRzIG9ubHkgKHBhcmVudElkLCBpZCkgYXMgYXJndW1lbnRzIik7CgogICAgaWQgPSB3aW5kb3cubm9ybWFsaXplTW9kdWxlKHBhcmVudElkLCBpZCk7CgogICAgdmFyIG1vZHVsZSA9IHdpbmRvdy5yZXF1aXJlLm1vZHVsZXNbaWRdOwogICAgaWYgKG1vZHVsZSkgewogICAgICAgIGlmICghbW9kdWxlLmluaXRpYWxpemVkKSB7CiAgICAgICAgICAgIG1vZHVsZS5pbml0aWFsaXplZCA9IHRydWU7CiAgICAgICAgICAgIG1vZHVsZS5leHBvcnRzID0gbW9kdWxlLmZhY3RvcnkoKS5leHBvcnRzOwogICAgICAgIH0KICAgICAgICByZXR1cm4gbW9kdWxlLmV4cG9ydHM7CiAgICB9CiAgIAogICAgaWYgKCF3aW5kb3cucmVxdWlyZS50bG5zKQogICAgICAgIHJldHVybiBjb25zb2xlLmxvZygidW5hYmxlIHRvIGxvYWQgIiArIGlkKTsKICAgIAogICAgdmFyIHBhdGggPSByZXNvbHZlTW9kdWxlSWQoaWQsIHdpbmRvdy5yZXF1aXJlLnRsbnMpOwogICAgaWYgKHBhdGguc2xpY2UoLTMpICE9ICIuanMiKSBwYXRoICs9ICIuanMiOwogICAgCiAgICB3aW5kb3cucmVxdWlyZS5pZCA9IGlkOwogICAgd2luZG93LnJlcXVpcmUubW9kdWxlc1tpZF0gPSB7fTsgLy8gcHJldmVudCBpbmZpbml0ZSBsb29wIG9uIGJyb2tlbiBtb2R1bGVzCiAgICBpbXBvcnRTY3JpcHRzKHBhdGgpOwogICAgcmV0dXJuIHdpbmRvdy5yZXF1aXJlKHBhcmVudElkLCBpZCk7Cn07CmZ1bmN0aW9uIHJlc29sdmVNb2R1bGVJZChpZCwgcGF0aHMpIHsKICAgIHZhciB0ZXN0UGF0aCA9IGlkLCB0YWlsID0gIiI7CiAgICB3aGlsZSAodGVzdFBhdGgpIHsKICAgICAgICB2YXIgYWxpYXMgPSBwYXRoc1t0ZXN0UGF0aF07CiAgICAgICAgaWYgKHR5cGVvZiBhbGlhcyA9PSAic3RyaW5nIikgewogICAgICAgICAgICByZXR1cm4gYWxpYXMgKyB0YWlsOwogICAgICAgIH0gZWxzZSBpZiAoYWxpYXMpIHsKICAgICAgICAgICAgcmV0dXJuICBhbGlhcy5sb2NhdGlvbi5yZXBsYWNlKC9cLyokLywgIi8iKSArICh0YWlsIHx8IGFsaWFzLm1haW4gfHwgYWxpYXMubmFtZSk7CiAgICAgICAgfSBlbHNlIGlmIChhbGlhcyA9PT0gZmFsc2UpIHsKICAgICAgICAgICAgcmV0dXJuICIiOwogICAgICAgIH0KICAgICAgICB2YXIgaSA9IHRlc3RQYXRoLmxhc3RJbmRleE9mKCIvIik7CiAgICAgICAgaWYgKGkgPT09IC0xKSBicmVhazsKICAgICAgICB0YWlsID0gdGVzdFBhdGguc3Vic3RyKGkpICsgdGFpbDsKICAgICAgICB0ZXN0UGF0aCA9IHRlc3RQYXRoLnNsaWNlKDAsIGkpOwogICAgfQogICAgcmV0dXJuIGlkOwp9CndpbmRvdy5yZXF1aXJlLm1vZHVsZXMgPSB7fTsKd2luZG93LnJlcXVpcmUudGxucyA9IHt9OwoKd2luZG93LmRlZmluZSA9IGZ1bmN0aW9uKGlkLCBkZXBzLCBmYWN0b3J5KSB7CiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PSAyKSB7CiAgICAgICAgZmFjdG9yeSA9IGRlcHM7CiAgICAgICAgaWYgKHR5cGVvZiBpZCAhPSAic3RyaW5nIikgewogICAgICAgICAgICBkZXBzID0gaWQ7CiAgICAgICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICAgICAgfQogICAgfSBlbHNlIGlmIChhcmd1bWVudHMubGVuZ3RoID09IDEpIHsKICAgICAgICBmYWN0b3J5ID0gaWQ7CiAgICAgICAgZGVwcyA9IFtdOwogICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICB9CiAgICAKICAgIGlmICh0eXBlb2YgZmFjdG9yeSAhPSAiZnVuY3Rpb24iKSB7CiAgICAgICAgd2luZG93LnJlcXVpcmUubW9kdWxlc1tpZF0gPSB7CiAgICAgICAgICAgIGV4cG9ydHM6IGZhY3RvcnksCiAgICAgICAgICAgIGluaXRpYWxpemVkOiB0cnVlCiAgICAgICAgfTsKICAgICAgICByZXR1cm47CiAgICB9CgogICAgaWYgKCFkZXBzLmxlbmd0aCkKICAgICAgICAvLyBJZiB0aGVyZSBpcyBubyBkZXBlbmRlbmNpZXMsIHdlIGluamVjdCAicmVxdWlyZSIsICJleHBvcnRzIiBhbmQKICAgICAgICAvLyAibW9kdWxlIiBhcyBkZXBlbmRlbmNpZXMsIHRvIHByb3ZpZGUgQ29tbW9uSlMgY29tcGF0aWJpbGl0eS4KICAgICAgICBkZXBzID0gWyJyZXF1aXJlIiwgImV4cG9ydHMiLCAibW9kdWxlIl07CgogICAgdmFyIHJlcSA9IGZ1bmN0aW9uKGNoaWxkSWQpIHsKICAgICAgICByZXR1cm4gd2luZG93LnJlcXVpcmUoaWQsIGNoaWxkSWQpOwogICAgfTsKCiAgICB3aW5kb3cucmVxdWlyZS5tb2R1bGVzW2lkXSA9IHsKICAgICAgICBleHBvcnRzOiB7fSwKICAgICAgICBmYWN0b3J5OiBmdW5jdGlvbigpIHsKICAgICAgICAgICAgdmFyIG1vZHVsZSA9IHRoaXM7CiAgICAgICAgICAgIHZhciByZXR1cm5FeHBvcnRzID0gZmFjdG9yeS5hcHBseSh0aGlzLCBkZXBzLnNsaWNlKDAsIGZhY3RvcnkubGVuZ3RoKS5tYXAoZnVuY3Rpb24oZGVwKSB7CiAgICAgICAgICAgICAgICBzd2l0Y2ggKGRlcCkgewogICAgICAgICAgICAgICAgICAgIC8vIEJlY2F1c2UgInJlcXVpcmUiLCAiZXhwb3J0cyIgYW5kICJtb2R1bGUiIGFyZW4ndCBhY3R1YWwKICAgICAgICAgICAgICAgICAgICAvLyBkZXBlbmRlbmNpZXMsIHdlIG11c3QgaGFuZGxlIHRoZW0gc2VwZXJhdGVseS4KICAgICAgICAgICAgICAgICAgICBjYXNlICJyZXF1aXJlIjogcmV0dXJuIHJlcTsKICAgICAgICAgICAgICAgICAgICBjYXNlICJleHBvcnRzIjogcmV0dXJuIG1vZHVsZS5leHBvcnRzOwogICAgICAgICAgICAgICAgICAgIGNhc2UgIm1vZHVsZSI6ICByZXR1cm4gbW9kdWxlOwogICAgICAgICAgICAgICAgICAgIC8vIEJ1dCBmb3IgYWxsIG90aGVyIGRlcGVuZGVuY2llcywgd2UgY2FuIGp1c3QgZ28gYWhlYWQgYW5kCiAgICAgICAgICAgICAgICAgICAgLy8gcmVxdWlyZSB0aGVtLgogICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6ICAgICAgICByZXR1cm4gcmVxKGRlcCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pKTsKICAgICAgICAgICAgaWYgKHJldHVybkV4cG9ydHMpCiAgICAgICAgICAgICAgICBtb2R1bGUuZXhwb3J0cyA9IHJldHVybkV4cG9ydHM7CiAgICAgICAgICAgIHJldHVybiBtb2R1bGU7CiAgICAgICAgfQogICAgfTsKfTsKd2luZG93LmRlZmluZS5hbWQgPSB7fTsKd2luZG93LnJlcXVpcmUudGxucyA9IHt9Owp3aW5kb3cuaW5pdEJhc2VVcmxzICA9IGZ1bmN0aW9uIGluaXRCYXNlVXJscyh0b3BMZXZlbE5hbWVzcGFjZXMpIHsKICAgIGZvciAodmFyIGkgaW4gdG9wTGV2ZWxOYW1lc3BhY2VzKQogICAgICAgIHRoaXMucmVxdWlyZS50bG5zW2ldID0gdG9wTGV2ZWxOYW1lc3BhY2VzW2ldOwp9OwoKd2luZG93LmluaXRTZW5kZXIgPSBmdW5jdGlvbiBpbml0U2VuZGVyKCkgewoKICAgIHZhciBFdmVudEVtaXR0ZXIgPSB3aW5kb3cucmVxdWlyZSgiYWNlL2xpYi9ldmVudF9lbWl0dGVyIikuRXZlbnRFbWl0dGVyOwogICAgdmFyIG9vcCA9IHdpbmRvdy5yZXF1aXJlKCJhY2UvbGliL29vcCIpOwogICAgCiAgICB2YXIgU2VuZGVyID0gZnVuY3Rpb24oKSB7fTsKICAgIAogICAgKGZ1bmN0aW9uKCkgewogICAgICAgIAogICAgICAgIG9vcC5pbXBsZW1lbnQodGhpcywgRXZlbnRFbWl0dGVyKTsKICAgICAgICAgICAgICAgIAogICAgICAgIHRoaXMuY2FsbGJhY2sgPSBmdW5jdGlvbihkYXRhLCBjYWxsYmFja0lkKSB7CiAgICAgICAgICAgIHBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgIHR5cGU6ICJjYWxsIiwKICAgICAgICAgICAgICAgIGlkOiBjYWxsYmFja0lkLAogICAgICAgICAgICAgICAgZGF0YTogZGF0YQogICAgICAgICAgICB9KTsKICAgICAgICB9OwogICAgCiAgICAgICAgdGhpcy5lbWl0ID0gZnVuY3Rpb24obmFtZSwgZGF0YSkgewogICAgICAgICAgICBwb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgICB0eXBlOiAiZXZlbnQiLAogICAgICAgICAgICAgICAgbmFtZTogbmFtZSwKICAgICAgICAgICAgICAgIGRhdGE6IGRhdGEKICAgICAgICAgICAgfSk7CiAgICAgICAgfTsKICAgICAgICAKICAgIH0pLmNhbGwoU2VuZGVyLnByb3RvdHlwZSk7CiAgICAKICAgIHJldHVybiBuZXcgU2VuZGVyKCk7Cn07Cgp2YXIgbWFpbiA9IHdpbmRvdy5tYWluID0gbnVsbDsKdmFyIHNlbmRlciA9IHdpbmRvdy5zZW5kZXIgPSBudWxsOwoKd2luZG93Lm9ubWVzc2FnZSA9IGZ1bmN0aW9uKGUpIHsKICAgIHZhciBtc2cgPSBlLmRhdGE7CiAgICBpZiAobXNnLmV2ZW50ICYmIHNlbmRlcikgewogICAgICAgIHNlbmRlci5fc2lnbmFsKG1zZy5ldmVudCwgbXNnLmRhdGEpOwogICAgfQogICAgZWxzZSBpZiAobXNnLmNvbW1hbmQpIHsKICAgICAgICBpZiAobWFpblttc2cuY29tbWFuZF0pCiAgICAgICAgICAgIG1haW5bbXNnLmNvbW1hbmRdLmFwcGx5KG1haW4sIG1zZy5hcmdzKTsKICAgICAgICBlbHNlIGlmICh3aW5kb3dbbXNnLmNvbW1hbmRdKQogICAgICAgICAgICB3aW5kb3dbbXNnLmNvbW1hbmRdLmFwcGx5KHdpbmRvdywgbXNnLmFyZ3MpOwogICAgICAgIGVsc2UKICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJVbmtub3duIGNvbW1hbmQ6IiArIG1zZy5jb21tYW5kKTsKICAgIH0KICAgIGVsc2UgaWYgKG1zZy5pbml0KSB7CiAgICAgICAgd2luZG93LmluaXRCYXNlVXJscyhtc2cudGxucyk7CiAgICAgICAgc2VuZGVyID0gd2luZG93LnNlbmRlciA9IHdpbmRvdy5pbml0U2VuZGVyKCk7CiAgICAgICAgdmFyIGNsYXp6ID0gdGhpcy5yZXF1aXJlKG1zZy5tb2R1bGUpW21zZy5jbGFzc25hbWVdOwogICAgICAgIG1haW4gPSB3aW5kb3cubWFpbiA9IG5ldyBjbGF6eihzZW5kZXIpOwogICAgfQp9Owp9KSh0aGlzKTsKCmFjZS5kZWZpbmUoImFjZS9saWIvb29wIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CmV4cG9ydHMuaW5oZXJpdHMgPSBmdW5jdGlvbiAoY3Rvciwgc3VwZXJDdG9yKSB7CiAgICBjdG9yLnN1cGVyXyA9IHN1cGVyQ3RvcjsKICAgIGN0b3IucHJvdG90eXBlID0gT2JqZWN0LmNyZWF0ZShzdXBlckN0b3IucHJvdG90eXBlLCB7CiAgICAgICAgY29uc3RydWN0b3I6IHsKICAgICAgICAgICAgdmFsdWU6IGN0b3IsCiAgICAgICAgICAgIGVudW1lcmFibGU6IGZhbHNlLAogICAgICAgICAgICB3cml0YWJsZTogdHJ1ZSwKICAgICAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlCiAgICAgICAgfQogICAgfSk7Cn07CmV4cG9ydHMubWl4aW4gPSBmdW5jdGlvbiAob2JqLCBtaXhpbikgewogICAgZm9yICh2YXIga2V5IGluIG1peGluKSB7CiAgICAgICAgb2JqW2tleV0gPSBtaXhpbltrZXldOwogICAgfQogICAgcmV0dXJuIG9iajsKfTsKZXhwb3J0cy5pbXBsZW1lbnQgPSBmdW5jdGlvbiAocHJvdG8sIG1peGluKSB7CiAgICBleHBvcnRzLm1peGluKHByb3RvLCBtaXhpbik7Cn07Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9hcHBseV9kZWx0YSIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwpmdW5jdGlvbiB0aHJvd0RlbHRhRXJyb3IoZGVsdGEsIGVycm9yVGV4dCkgewogICAgY29uc29sZS5sb2coIkludmFsaWQgRGVsdGE6IiwgZGVsdGEpOwogICAgdGhyb3cgIkludmFsaWQgRGVsdGE6ICIgKyBlcnJvclRleHQ7Cn0KZnVuY3Rpb24gcG9zaXRpb25JbkRvY3VtZW50KGRvY0xpbmVzLCBwb3NpdGlvbikgewogICAgcmV0dXJuIHBvc2l0aW9uLnJvdyA+PSAwICYmIHBvc2l0aW9uLnJvdyA8IGRvY0xpbmVzLmxlbmd0aCAmJgogICAgICAgIHBvc2l0aW9uLmNvbHVtbiA+PSAwICYmIHBvc2l0aW9uLmNvbHVtbiA8PSBkb2NMaW5lc1twb3NpdGlvbi5yb3ddLmxlbmd0aDsKfQpmdW5jdGlvbiB2YWxpZGF0ZURlbHRhKGRvY0xpbmVzLCBkZWx0YSkgewogICAgaWYgKGRlbHRhLmFjdGlvbiAhPSAiaW5zZXJ0IiAmJiBkZWx0YS5hY3Rpb24gIT0gInJlbW92ZSIpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuYWN0aW9uIG11c3QgYmUgJ2luc2VydCcgb3IgJ3JlbW92ZSciKTsKICAgIGlmICghKGRlbHRhLmxpbmVzIGluc3RhbmNlb2YgQXJyYXkpKQogICAgICAgIHRocm93RGVsdGFFcnJvcihkZWx0YSwgImRlbHRhLmxpbmVzIG11c3QgYmUgYW4gQXJyYXkiKTsKICAgIGlmICghZGVsdGEuc3RhcnQgfHwgIWRlbHRhLmVuZCkKICAgICAgICB0aHJvd0RlbHRhRXJyb3IoZGVsdGEsICJkZWx0YS5zdGFydC9lbmQgbXVzdCBiZSBhbiBwcmVzZW50Iik7CiAgICB2YXIgc3RhcnQgPSBkZWx0YS5zdGFydDsKICAgIGlmICghcG9zaXRpb25JbkRvY3VtZW50KGRvY0xpbmVzLCBkZWx0YS5zdGFydCkpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuc3RhcnQgbXVzdCBiZSBjb250YWluZWQgaW4gZG9jdW1lbnQiKTsKICAgIHZhciBlbmQgPSBkZWx0YS5lbmQ7CiAgICBpZiAoZGVsdGEuYWN0aW9uID09ICJyZW1vdmUiICYmICFwb3NpdGlvbkluRG9jdW1lbnQoZG9jTGluZXMsIGVuZCkpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuZW5kIG11c3QgY29udGFpbmVkIGluIGRvY3VtZW50IGZvciAncmVtb3ZlJyBhY3Rpb25zIik7CiAgICB2YXIgbnVtUmFuZ2VSb3dzID0gZW5kLnJvdyAtIHN0YXJ0LnJvdzsKICAgIHZhciBudW1SYW5nZUxhc3RMaW5lQ2hhcnMgPSAoZW5kLmNvbHVtbiAtIChudW1SYW5nZVJvd3MgPT0gMCA/IHN0YXJ0LmNvbHVtbiA6IDApKTsKICAgIGlmIChudW1SYW5nZVJvd3MgIT0gZGVsdGEubGluZXMubGVuZ3RoIC0gMSB8fCBkZWx0YS5saW5lc1tudW1SYW5nZVJvd3NdLmxlbmd0aCAhPSBudW1SYW5nZUxhc3RMaW5lQ2hhcnMpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEucmFuZ2UgbXVzdCBtYXRjaCBkZWx0YSBsaW5lcyIpOwp9CmV4cG9ydHMuYXBwbHlEZWx0YSA9IGZ1bmN0aW9uIChkb2NMaW5lcywgZGVsdGEsIGRvTm90VmFsaWRhdGUpIHsKICAgIHZhciByb3cgPSBkZWx0YS5zdGFydC5yb3c7CiAgICB2YXIgc3RhcnRDb2x1bW4gPSBkZWx0YS5zdGFydC5jb2x1bW47CiAgICB2YXIgbGluZSA9IGRvY0xpbmVzW3Jvd10gfHwgIiI7CiAgICBzd2l0Y2ggKGRlbHRhLmFjdGlvbikgewogICAgICAgIGNhc2UgImluc2VydCI6CiAgICAgICAgICAgIHZhciBsaW5lcyA9IGRlbHRhLmxpbmVzOwogICAgICAgICAgICBpZiAobGluZXMubGVuZ3RoID09PSAxKSB7CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3ddID0gbGluZS5zdWJzdHJpbmcoMCwgc3RhcnRDb2x1bW4pICsgZGVsdGEubGluZXNbMF0gKyBsaW5lLnN1YnN0cmluZyhzdGFydENvbHVtbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICB2YXIgYXJncyA9IFtyb3csIDFdLmNvbmNhdChkZWx0YS5saW5lcyk7CiAgICAgICAgICAgICAgICBkb2NMaW5lcy5zcGxpY2UuYXBwbHkoZG9jTGluZXMsIGFyZ3MpOwogICAgICAgICAgICAgICAgZG9jTGluZXNbcm93XSA9IGxpbmUuc3Vic3RyaW5nKDAsIHN0YXJ0Q29sdW1uKSArIGRvY0xpbmVzW3Jvd107CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3cgKyBkZWx0YS5saW5lcy5sZW5ndGggLSAxXSArPSBsaW5lLnN1YnN0cmluZyhzdGFydENvbHVtbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAicmVtb3ZlIjoKICAgICAgICAgICAgdmFyIGVuZENvbHVtbiA9IGRlbHRhLmVuZC5jb2x1bW47CiAgICAgICAgICAgIHZhciBlbmRSb3cgPSBkZWx0YS5lbmQucm93OwogICAgICAgICAgICBpZiAocm93ID09PSBlbmRSb3cpIHsKICAgICAgICAgICAgICAgIGRvY0xpbmVzW3Jvd10gPSBsaW5lLnN1YnN0cmluZygwLCBzdGFydENvbHVtbikgKyBsaW5lLnN1YnN0cmluZyhlbmRDb2x1bW4pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgZG9jTGluZXMuc3BsaWNlKHJvdywgZW5kUm93IC0gcm93ICsgMSwgbGluZS5zdWJzdHJpbmcoMCwgc3RhcnRDb2x1bW4pICsgZG9jTGluZXNbZW5kUm93XS5zdWJzdHJpbmcoZW5kQ29sdW1uKSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICB9Cn07Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9saWIvZXZlbnRfZW1pdHRlciIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgRXZlbnRFbWl0dGVyID0ge307CnZhciBzdG9wUHJvcGFnYXRpb24gPSBmdW5jdGlvbiAoKSB7IHRoaXMucHJvcGFnYXRpb25TdG9wcGVkID0gdHJ1ZTsgfTsKdmFyIHByZXZlbnREZWZhdWx0ID0gZnVuY3Rpb24gKCkgeyB0aGlzLmRlZmF1bHRQcmV2ZW50ZWQgPSB0cnVlOyB9OwpFdmVudEVtaXR0ZXIuX2VtaXQgPQogICAgRXZlbnRFbWl0dGVyLl9kaXNwYXRjaEV2ZW50ID0gZnVuY3Rpb24gKGV2ZW50TmFtZSwgZSkgewogICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwgKHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB7fSk7CiAgICAgICAgdGhpcy5fZGVmYXVsdEhhbmRsZXJzIHx8ICh0aGlzLl9kZWZhdWx0SGFuZGxlcnMgPSB7fSk7CiAgICAgICAgdmFyIGxpc3RlbmVycyA9IHRoaXMuX2V2ZW50UmVnaXN0cnlbZXZlbnROYW1lXSB8fCBbXTsKICAgICAgICB2YXIgZGVmYXVsdEhhbmRsZXIgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnNbZXZlbnROYW1lXTsKICAgICAgICBpZiAoIWxpc3RlbmVycy5sZW5ndGggJiYgIWRlZmF1bHRIYW5kbGVyKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgaWYgKHR5cGVvZiBlICE9ICJvYmplY3QiIHx8ICFlKQogICAgICAgICAgICBlID0ge307CiAgICAgICAgaWYgKCFlLnR5cGUpCiAgICAgICAgICAgIGUudHlwZSA9IGV2ZW50TmFtZTsKICAgICAgICBpZiAoIWUuc3RvcFByb3BhZ2F0aW9uKQogICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbiA9IHN0b3BQcm9wYWdhdGlvbjsKICAgICAgICBpZiAoIWUucHJldmVudERlZmF1bHQpCiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQgPSBwcmV2ZW50RGVmYXVsdDsKICAgICAgICBsaXN0ZW5lcnMgPSBsaXN0ZW5lcnMuc2xpY2UoKTsKICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxpc3RlbmVycy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBsaXN0ZW5lcnNbaV0oZSwgdGhpcyk7CiAgICAgICAgICAgIGlmIChlLnByb3BhZ2F0aW9uU3RvcHBlZCkKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICBpZiAoZGVmYXVsdEhhbmRsZXIgJiYgIWUuZGVmYXVsdFByZXZlbnRlZCkKICAgICAgICAgICAgcmV0dXJuIGRlZmF1bHRIYW5kbGVyKGUsIHRoaXMpOwogICAgfTsKRXZlbnRFbWl0dGVyLl9zaWduYWwgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBlKSB7CiAgICB2YXIgbGlzdGVuZXJzID0gKHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwge30pW2V2ZW50TmFtZV07CiAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICByZXR1cm47CiAgICBsaXN0ZW5lcnMgPSBsaXN0ZW5lcnMuc2xpY2UoKTsKICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGlzdGVuZXJzLmxlbmd0aDsgaSsrKQogICAgICAgIGxpc3RlbmVyc1tpXShlLCB0aGlzKTsKfTsKRXZlbnRFbWl0dGVyLm9uY2UgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaykgewogICAgdmFyIF9zZWxmID0gdGhpczsKICAgIHRoaXMub24oZXZlbnROYW1lLCBmdW5jdGlvbiBuZXdDYWxsYmFjaygpIHsKICAgICAgICBfc2VsZi5vZmYoZXZlbnROYW1lLCBuZXdDYWxsYmFjayk7CiAgICAgICAgY2FsbGJhY2suYXBwbHkobnVsbCwgYXJndW1lbnRzKTsKICAgIH0pOwogICAgaWYgKCFjYWxsYmFjaykgewogICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbiAocmVzb2x2ZSkgewogICAgICAgICAgICBjYWxsYmFjayA9IHJlc29sdmU7CiAgICAgICAgfSk7CiAgICB9Cn07CkV2ZW50RW1pdHRlci5zZXREZWZhdWx0SGFuZGxlciA9IGZ1bmN0aW9uIChldmVudE5hbWUsIGNhbGxiYWNrKSB7CiAgICB2YXIgaGFuZGxlcnMgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnM7CiAgICBpZiAoIWhhbmRsZXJzKQogICAgICAgIGhhbmRsZXJzID0gdGhpcy5fZGVmYXVsdEhhbmRsZXJzID0geyBfZGlzYWJsZWRfOiB7fSB9OwogICAgaWYgKGhhbmRsZXJzW2V2ZW50TmFtZV0pIHsKICAgICAgICB2YXIgb2xkID0gaGFuZGxlcnNbZXZlbnROYW1lXTsKICAgICAgICB2YXIgZGlzYWJsZWQgPSBoYW5kbGVycy5fZGlzYWJsZWRfW2V2ZW50TmFtZV07CiAgICAgICAgaWYgKCFkaXNhYmxlZCkKICAgICAgICAgICAgaGFuZGxlcnMuX2Rpc2FibGVkX1tldmVudE5hbWVdID0gZGlzYWJsZWQgPSBbXTsKICAgICAgICBkaXNhYmxlZC5wdXNoKG9sZCk7CiAgICAgICAgdmFyIGkgPSBkaXNhYmxlZC5pbmRleE9mKGNhbGxiYWNrKTsKICAgICAgICBpZiAoaSAhPSAtMSkKICAgICAgICAgICAgZGlzYWJsZWQuc3BsaWNlKGksIDEpOwogICAgfQogICAgaGFuZGxlcnNbZXZlbnROYW1lXSA9IGNhbGxiYWNrOwp9OwpFdmVudEVtaXR0ZXIucmVtb3ZlRGVmYXVsdEhhbmRsZXIgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaykgewogICAgdmFyIGhhbmRsZXJzID0gdGhpcy5fZGVmYXVsdEhhbmRsZXJzOwogICAgaWYgKCFoYW5kbGVycykKICAgICAgICByZXR1cm47CiAgICB2YXIgZGlzYWJsZWQgPSBoYW5kbGVycy5fZGlzYWJsZWRfW2V2ZW50TmFtZV07CiAgICBpZiAoaGFuZGxlcnNbZXZlbnROYW1lXSA9PSBjYWxsYmFjaykgewogICAgICAgIGlmIChkaXNhYmxlZCkKICAgICAgICAgICAgdGhpcy5zZXREZWZhdWx0SGFuZGxlcihldmVudE5hbWUsIGRpc2FibGVkLnBvcCgpKTsKICAgIH0KICAgIGVsc2UgaWYgKGRpc2FibGVkKSB7CiAgICAgICAgdmFyIGkgPSBkaXNhYmxlZC5pbmRleE9mKGNhbGxiYWNrKTsKICAgICAgICBpZiAoaSAhPSAtMSkKICAgICAgICAgICAgZGlzYWJsZWQuc3BsaWNlKGksIDEpOwogICAgfQp9OwpFdmVudEVtaXR0ZXIub24gPQogICAgRXZlbnRFbWl0dGVyLmFkZEV2ZW50TGlzdGVuZXIgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaywgY2FwdHVyaW5nKSB7CiAgICAgICAgdGhpcy5fZXZlbnRSZWdpc3RyeSA9IHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwge307CiAgICAgICAgdmFyIGxpc3RlbmVycyA9IHRoaXMuX2V2ZW50UmVnaXN0cnlbZXZlbnROYW1lXTsKICAgICAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICAgICAgbGlzdGVuZXJzID0gdGhpcy5fZXZlbnRSZWdpc3RyeVtldmVudE5hbWVdID0gW107CiAgICAgICAgaWYgKGxpc3RlbmVycy5pbmRleE9mKGNhbGxiYWNrKSA9PSAtMSkKICAgICAgICAgICAgbGlzdGVuZXJzW2NhcHR1cmluZyA/ICJ1bnNoaWZ0IiA6ICJwdXNoIl0oY2FsbGJhY2spOwogICAgICAgIHJldHVybiBjYWxsYmFjazsKICAgIH07CkV2ZW50RW1pdHRlci5vZmYgPQogICAgRXZlbnRFbWl0dGVyLnJlbW92ZUxpc3RlbmVyID0KICAgICAgICBFdmVudEVtaXR0ZXIucmVtb3ZlRXZlbnRMaXN0ZW5lciA9IGZ1bmN0aW9uIChldmVudE5hbWUsIGNhbGxiYWNrKSB7CiAgICAgICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9ldmVudFJlZ2lzdHJ5IHx8IHt9OwogICAgICAgICAgICB2YXIgbGlzdGVuZXJzID0gdGhpcy5fZXZlbnRSZWdpc3RyeVtldmVudE5hbWVdOwogICAgICAgICAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgdmFyIGluZGV4ID0gbGlzdGVuZXJzLmluZGV4T2YoY2FsbGJhY2spOwogICAgICAgICAgICBpZiAoaW5kZXggIT09IC0xKQogICAgICAgICAgICAgICAgbGlzdGVuZXJzLnNwbGljZShpbmRleCwgMSk7CiAgICAgICAgfTsKRXZlbnRFbWl0dGVyLnJlbW92ZUFsbExpc3RlbmVycyA9IGZ1bmN0aW9uIChldmVudE5hbWUpIHsKICAgIGlmICghZXZlbnROYW1lKQogICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnMgPSB1bmRlZmluZWQ7CiAgICBpZiAodGhpcy5fZXZlbnRSZWdpc3RyeSkKICAgICAgICB0aGlzLl9ldmVudFJlZ2lzdHJ5W2V2ZW50TmFtZV0gPSB1bmRlZmluZWQ7CiAgICBpZiAodGhpcy5fZGVmYXVsdEhhbmRsZXJzKQogICAgICAgIHRoaXMuX2RlZmF1bHRIYW5kbGVyc1tldmVudE5hbWVdID0gdW5kZWZpbmVkOwp9OwpleHBvcnRzLkV2ZW50RW1pdHRlciA9IEV2ZW50RW1pdHRlcjsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL3JhbmdlIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBjb21wYXJlUG9pbnRzID0gZnVuY3Rpb24gKHAxLCBwMikgewogICAgcmV0dXJuIHAxLnJvdyAtIHAyLnJvdyB8fCBwMS5jb2x1bW4gLSBwMi5jb2x1bW47Cn07CnZhciBSYW5nZSA9IC8qKiBAY2xhc3MgKi8gKGZ1bmN0aW9uICgpIHsKICAgIGZ1bmN0aW9uIFJhbmdlKHN0YXJ0Um93LCBzdGFydENvbHVtbiwgZW5kUm93LCBlbmRDb2x1bW4pIHsKICAgICAgICB0aGlzLnN0YXJ0ID0gewogICAgICAgICAgICByb3c6IHN0YXJ0Um93LAogICAgICAgICAgICBjb2x1bW46IHN0YXJ0Q29sdW1uCiAgICAgICAgfTsKICAgICAgICB0aGlzLmVuZCA9IHsKICAgICAgICAgICAgcm93OiBlbmRSb3csCiAgICAgICAgICAgIGNvbHVtbjogZW5kQ29sdW1uCiAgICAgICAgfTsKICAgIH0KICAgIFJhbmdlLnByb3RvdHlwZS5pc0VxdWFsID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuc3RhcnQucm93ID09PSByYW5nZS5zdGFydC5yb3cgJiYKICAgICAgICAgICAgdGhpcy5lbmQucm93ID09PSByYW5nZS5lbmQucm93ICYmCiAgICAgICAgICAgIHRoaXMuc3RhcnQuY29sdW1uID09PSByYW5nZS5zdGFydC5jb2x1bW4gJiYKICAgICAgICAgICAgdGhpcy5lbmQuY29sdW1uID09PSByYW5nZS5lbmQuY29sdW1uOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS50b1N0cmluZyA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gKCJSYW5nZTogWyIgKyB0aGlzLnN0YXJ0LnJvdyArICIvIiArIHRoaXMuc3RhcnQuY29sdW1uICsKICAgICAgICAgICAgIl0gLT4gWyIgKyB0aGlzLmVuZC5yb3cgKyAiLyIgKyB0aGlzLmVuZC5jb2x1bW4gKyAiXSIpOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jb250YWlucyA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pID09IDA7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNvbXBhcmVSYW5nZSA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAsIGVuZCA9IHJhbmdlLmVuZCwgc3RhcnQgPSByYW5nZS5zdGFydDsKICAgICAgICBjbXAgPSB0aGlzLmNvbXBhcmUoZW5kLnJvdywgZW5kLmNvbHVtbik7CiAgICAgICAgaWYgKGNtcCA9PSAxKSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSBpZiAoY21wID09IDApIHsKICAgICAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoY21wID09IC0xKSB7CiAgICAgICAgICAgIHJldHVybiAtMjsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gLTEpIHsKICAgICAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDQyOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNvbXBhcmVQb2ludCA9IGZ1bmN0aW9uIChwKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShwLnJvdywgcC5jb2x1bW4pOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jb250YWluc1JhbmdlID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZVBvaW50KHJhbmdlLnN0YXJ0KSA9PSAwICYmIHRoaXMuY29tcGFyZVBvaW50KHJhbmdlLmVuZCkgPT0gMDsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuaW50ZXJzZWN0cyA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAgPSB0aGlzLmNvbXBhcmVSYW5nZShyYW5nZSk7CiAgICAgICAgcmV0dXJuIChjbXAgPT0gLTEgfHwgY21wID09IDAgfHwgY21wID09IDEpOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5pc0VuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW47CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmlzU3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4gdGhpcy5zdGFydC5yb3cgPT0gcm93ICYmIHRoaXMuc3RhcnQuY29sdW1uID09IGNvbHVtbjsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuc2V0U3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodHlwZW9mIHJvdyA9PSAib2JqZWN0IikgewogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IHJvdy5jb2x1bW47CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93LnJvdzsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93OwogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB9CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLnNldEVuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0eXBlb2Ygcm93ID09ICJvYmplY3QiKSB7CiAgICAgICAgICAgIHRoaXMuZW5kLmNvbHVtbiA9IHJvdy5jb2x1bW47CiAgICAgICAgICAgIHRoaXMuZW5kLnJvdyA9IHJvdy5yb3c7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICB0aGlzLmVuZC5yb3cgPSByb3c7CiAgICAgICAgICAgIHRoaXMuZW5kLmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB9CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmluc2lkZSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pID09IDApIHsKICAgICAgICAgICAgaWYgKHRoaXMuaXNFbmQocm93LCBjb2x1bW4pIHx8IHRoaXMuaXNTdGFydChyb3csIGNvbHVtbikpIHsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJldHVybiBmYWxzZTsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuaW5zaWRlU3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodGhpcy5jb21wYXJlKHJvdywgY29sdW1uKSA9PSAwKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmlzRW5kKHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5pbnNpZGVFbmQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodGhpcy5jb21wYXJlKHJvdywgY29sdW1uKSA9PSAwKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmlzU3RhcnQocm93LCBjb2x1bW4pKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gZmFsc2U7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNvbXBhcmUgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAoIXRoaXMuaXNNdWx0aUxpbmUoKSkgewogICAgICAgICAgICBpZiAocm93ID09PSB0aGlzLnN0YXJ0LnJvdykgewogICAgICAgICAgICAgICAgcmV0dXJuIGNvbHVtbiA8IHRoaXMuc3RhcnQuY29sdW1uID8gLTEgOiAoY29sdW1uID4gdGhpcy5lbmQuY29sdW1uID8gMSA6IDApOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmIChyb3cgPCB0aGlzLnN0YXJ0LnJvdykKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIGlmIChyb3cgPiB0aGlzLmVuZC5yb3cpCiAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgIGlmICh0aGlzLnN0YXJ0LnJvdyA9PT0gcm93KQogICAgICAgICAgICByZXR1cm4gY29sdW1uID49IHRoaXMuc3RhcnQuY29sdW1uID8gMCA6IC0xOwogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT09IHJvdykKICAgICAgICAgICAgcmV0dXJuIGNvbHVtbiA8PSB0aGlzLmVuZC5jb2x1bW4gPyAwIDogMTsKICAgICAgICByZXR1cm4gMDsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuY29tcGFyZVN0YXJ0ID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID09IHJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbik7CiAgICAgICAgfQogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jb21wYXJlRW5kID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuZW5kLnJvdyA9PSByb3cgJiYgdGhpcy5lbmQuY29sdW1uID09IGNvbHVtbikgewogICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHJldHVybiB0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pOwogICAgICAgIH0KICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuY29tcGFyZUluc2lkZSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHRoaXMuc3RhcnQucm93ID09IHJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbik7CiAgICAgICAgfQogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jbGlwUm93cyA9IGZ1bmN0aW9uIChmaXJzdFJvdywgbGFzdFJvdykgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPiBsYXN0Um93KQogICAgICAgICAgICB2YXIgZW5kID0geyByb3c6IGxhc3RSb3cgKyAxLCBjb2x1bW46IDAgfTsKICAgICAgICBlbHNlIGlmICh0aGlzLmVuZC5yb3cgPCBmaXJzdFJvdykKICAgICAgICAgICAgdmFyIGVuZCA9IHsgcm93OiBmaXJzdFJvdywgY29sdW1uOiAwIH07CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID4gbGFzdFJvdykKICAgICAgICAgICAgdmFyIHN0YXJ0ID0geyByb3c6IGxhc3RSb3cgKyAxLCBjb2x1bW46IDAgfTsKICAgICAgICBlbHNlIGlmICh0aGlzLnN0YXJ0LnJvdyA8IGZpcnN0Um93KQogICAgICAgICAgICB2YXIgc3RhcnQgPSB7IHJvdzogZmlyc3RSb3csIGNvbHVtbjogMCB9OwogICAgICAgIHJldHVybiBSYW5nZS5mcm9tUG9pbnRzKHN0YXJ0IHx8IHRoaXMuc3RhcnQsIGVuZCB8fCB0aGlzLmVuZCk7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmV4dGVuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHZhciBjbXAgPSB0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pOwogICAgICAgIGlmIChjbXAgPT0gMCkKICAgICAgICAgICAgcmV0dXJuIHRoaXM7CiAgICAgICAgZWxzZSBpZiAoY21wID09IC0xKQogICAgICAgICAgICB2YXIgc3RhcnQgPSB7IHJvdzogcm93LCBjb2x1bW46IGNvbHVtbiB9OwogICAgICAgIGVsc2UKICAgICAgICAgICAgdmFyIGVuZCA9IHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH07CiAgICAgICAgcmV0dXJuIFJhbmdlLmZyb21Qb2ludHMoc3RhcnQgfHwgdGhpcy5zdGFydCwgZW5kIHx8IHRoaXMuZW5kKTsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuaXNFbXB0eSA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gKHRoaXMuc3RhcnQucm93ID09PSB0aGlzLmVuZC5yb3cgJiYgdGhpcy5zdGFydC5jb2x1bW4gPT09IHRoaXMuZW5kLmNvbHVtbik7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmlzTXVsdGlMaW5lID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiAodGhpcy5zdGFydC5yb3cgIT09IHRoaXMuZW5kLnJvdyk7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNsb25lID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiBSYW5nZS5mcm9tUG9pbnRzKHRoaXMuc3RhcnQsIHRoaXMuZW5kKTsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuY29sbGFwc2VSb3dzID0gZnVuY3Rpb24gKCkgewogICAgICAgIGlmICh0aGlzLmVuZC5jb2x1bW4gPT0gMCkKICAgICAgICAgICAgcmV0dXJuIG5ldyBSYW5nZSh0aGlzLnN0YXJ0LnJvdywgMCwgTWF0aC5tYXgodGhpcy5zdGFydC5yb3csIHRoaXMuZW5kLnJvdyAtIDEpLCAwKTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIHJldHVybiBuZXcgUmFuZ2UodGhpcy5zdGFydC5yb3csIDAsIHRoaXMuZW5kLnJvdywgMCk7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLnRvU2NyZWVuUmFuZ2UgPSBmdW5jdGlvbiAoc2Vzc2lvbikgewogICAgICAgIHZhciBzY3JlZW5Qb3NTdGFydCA9IHNlc3Npb24uZG9jdW1lbnRUb1NjcmVlblBvc2l0aW9uKHRoaXMuc3RhcnQpOwogICAgICAgIHZhciBzY3JlZW5Qb3NFbmQgPSBzZXNzaW9uLmRvY3VtZW50VG9TY3JlZW5Qb3NpdGlvbih0aGlzLmVuZCk7CiAgICAgICAgcmV0dXJuIG5ldyBSYW5nZShzY3JlZW5Qb3NTdGFydC5yb3csIHNjcmVlblBvc1N0YXJ0LmNvbHVtbiwgc2NyZWVuUG9zRW5kLnJvdywgc2NyZWVuUG9zRW5kLmNvbHVtbik7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLm1vdmVCeSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHRoaXMuc3RhcnQucm93ICs9IHJvdzsKICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiArPSBjb2x1bW47CiAgICAgICAgdGhpcy5lbmQucm93ICs9IHJvdzsKICAgICAgICB0aGlzLmVuZC5jb2x1bW4gKz0gY29sdW1uOwogICAgfTsKICAgIHJldHVybiBSYW5nZTsKfSgpKTsKUmFuZ2UuZnJvbVBvaW50cyA9IGZ1bmN0aW9uIChzdGFydCwgZW5kKSB7CiAgICByZXR1cm4gbmV3IFJhbmdlKHN0YXJ0LnJvdywgc3RhcnQuY29sdW1uLCBlbmQucm93LCBlbmQuY29sdW1uKTsKfTsKUmFuZ2UuY29tcGFyZVBvaW50cyA9IGNvbXBhcmVQb2ludHM7ClJhbmdlLmNvbXBhcmVQb2ludHMgPSBmdW5jdGlvbiAocDEsIHAyKSB7CiAgICByZXR1cm4gcDEucm93IC0gcDIucm93IHx8IHAxLmNvbHVtbiAtIHAyLmNvbHVtbjsKfTsKZXhwb3J0cy5SYW5nZSA9IFJhbmdlOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvYW5jaG9yIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBvb3AgPSByZXF1aXJlKCIuL2xpYi9vb3AiKTsKdmFyIEV2ZW50RW1pdHRlciA9IHJlcXVpcmUoIi4vbGliL2V2ZW50X2VtaXR0ZXIiKS5FdmVudEVtaXR0ZXI7CnZhciBBbmNob3IgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7CiAgICBmdW5jdGlvbiBBbmNob3IoZG9jLCByb3csIGNvbHVtbikgewogICAgICAgIHRoaXMuJG9uQ2hhbmdlID0gdGhpcy5vbkNoYW5nZS5iaW5kKHRoaXMpOwogICAgICAgIHRoaXMuYXR0YWNoKGRvYyk7CiAgICAgICAgaWYgKHR5cGVvZiBjb2x1bW4gPT0gInVuZGVmaW5lZCIpCiAgICAgICAgICAgIHRoaXMuc2V0UG9zaXRpb24ocm93LnJvdywgcm93LmNvbHVtbik7CiAgICAgICAgZWxzZQogICAgICAgICAgICB0aGlzLnNldFBvc2l0aW9uKHJvdywgY29sdW1uKTsKICAgIH0KICAgIEFuY2hvci5wcm90b3R5cGUuZ2V0UG9zaXRpb24gPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuJGNsaXBQb3NpdGlvblRvRG9jdW1lbnQodGhpcy5yb3csIHRoaXMuY29sdW1uKTsKICAgIH07CiAgICBBbmNob3IucHJvdG90eXBlLmdldERvY3VtZW50ID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLmRvY3VtZW50OwogICAgfTsKICAgIEFuY2hvci5wcm90b3R5cGUub25DaGFuZ2UgPSBmdW5jdGlvbiAoZGVsdGEpIHsKICAgICAgICBpZiAoZGVsdGEuc3RhcnQucm93ID09IGRlbHRhLmVuZC5yb3cgJiYgZGVsdGEuc3RhcnQucm93ICE9IHRoaXMucm93KQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgaWYgKGRlbHRhLnN0YXJ0LnJvdyA+IHRoaXMucm93KQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdmFyIHBvaW50ID0gJGdldFRyYW5zZm9ybWVkUG9pbnQoZGVsdGEsIHsgcm93OiB0aGlzLnJvdywgY29sdW1uOiB0aGlzLmNvbHVtbiB9LCB0aGlzLiRpbnNlcnRSaWdodCk7CiAgICAgICAgdGhpcy5zZXRQb3NpdGlvbihwb2ludC5yb3csIHBvaW50LmNvbHVtbiwgdHJ1ZSk7CiAgICB9OwogICAgQW5jaG9yLnByb3RvdHlwZS5zZXRQb3NpdGlvbiA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbiwgbm9DbGlwKSB7CiAgICAgICAgdmFyIHBvczsKICAgICAgICBpZiAobm9DbGlwKSB7CiAgICAgICAgICAgIHBvcyA9IHsKICAgICAgICAgICAgICAgIHJvdzogcm93LAogICAgICAgICAgICAgICAgY29sdW1uOiBjb2x1bW4KICAgICAgICAgICAgfTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHBvcyA9IHRoaXMuJGNsaXBQb3NpdGlvblRvRG9jdW1lbnQocm93LCBjb2x1bW4pOwogICAgICAgIH0KICAgICAgICBpZiAodGhpcy5yb3cgPT0gcG9zLnJvdyAmJiB0aGlzLmNvbHVtbiA9PSBwb3MuY29sdW1uKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdmFyIG9sZCA9IHsKICAgICAgICAgICAgcm93OiB0aGlzLnJvdywKICAgICAgICAgICAgY29sdW1uOiB0aGlzLmNvbHVtbgogICAgICAgIH07CiAgICAgICAgdGhpcy5yb3cgPSBwb3Mucm93OwogICAgICAgIHRoaXMuY29sdW1uID0gcG9zLmNvbHVtbjsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZSIsIHsKICAgICAgICAgICAgb2xkOiBvbGQsCiAgICAgICAgICAgIHZhbHVlOiBwb3MKICAgICAgICB9KTsKICAgIH07CiAgICBBbmNob3IucHJvdG90eXBlLmRldGFjaCA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aGlzLmRvY3VtZW50Lm9mZigiY2hhbmdlIiwgdGhpcy4kb25DaGFuZ2UpOwogICAgfTsKICAgIEFuY2hvci5wcm90b3R5cGUuYXR0YWNoID0gZnVuY3Rpb24gKGRvYykgewogICAgICAgIHRoaXMuZG9jdW1lbnQgPSBkb2MgfHwgdGhpcy5kb2N1bWVudDsKICAgICAgICB0aGlzLmRvY3VtZW50Lm9uKCJjaGFuZ2UiLCB0aGlzLiRvbkNoYW5nZSk7CiAgICB9OwogICAgQW5jaG9yLnByb3RvdHlwZS4kY2xpcFBvc2l0aW9uVG9Eb2N1bWVudCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHZhciBwb3MgPSB7fTsKICAgICAgICBpZiAocm93ID49IHRoaXMuZG9jdW1lbnQuZ2V0TGVuZ3RoKCkpIHsKICAgICAgICAgICAgcG9zLnJvdyA9IE1hdGgubWF4KDAsIHRoaXMuZG9jdW1lbnQuZ2V0TGVuZ3RoKCkgLSAxKTsKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IHRoaXMuZG9jdW1lbnQuZ2V0TGluZShwb3Mucm93KS5sZW5ndGg7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHJvdyA8IDApIHsKICAgICAgICAgICAgcG9zLnJvdyA9IDA7CiAgICAgICAgICAgIHBvcy5jb2x1bW4gPSAwOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcG9zLnJvdyA9IHJvdzsKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IE1hdGgubWluKHRoaXMuZG9jdW1lbnQuZ2V0TGluZShwb3Mucm93KS5sZW5ndGgsIE1hdGgubWF4KDAsIGNvbHVtbikpOwogICAgICAgIH0KICAgICAgICBpZiAoY29sdW1uIDwgMCkKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IDA7CiAgICAgICAgcmV0dXJuIHBvczsKICAgIH07CiAgICByZXR1cm4gQW5jaG9yOwp9KCkpOwpBbmNob3IucHJvdG90eXBlLiRpbnNlcnRSaWdodCA9IGZhbHNlOwpvb3AuaW1wbGVtZW50KEFuY2hvci5wcm90b3R5cGUsIEV2ZW50RW1pdHRlcik7CmZ1bmN0aW9uICRwb2ludHNJbk9yZGVyKHBvaW50MSwgcG9pbnQyLCBlcXVhbFBvaW50c0luT3JkZXIpIHsKICAgIHZhciBiQ29sSXNBZnRlciA9IGVxdWFsUG9pbnRzSW5PcmRlciA/IHBvaW50MS5jb2x1bW4gPD0gcG9pbnQyLmNvbHVtbiA6IHBvaW50MS5jb2x1bW4gPCBwb2ludDIuY29sdW1uOwogICAgcmV0dXJuIChwb2ludDEucm93IDwgcG9pbnQyLnJvdykgfHwgKHBvaW50MS5yb3cgPT0gcG9pbnQyLnJvdyAmJiBiQ29sSXNBZnRlcik7Cn0KZnVuY3Rpb24gJGdldFRyYW5zZm9ybWVkUG9pbnQoZGVsdGEsIHBvaW50LCBtb3ZlSWZFcXVhbCkgewogICAgdmFyIGRlbHRhSXNJbnNlcnQgPSBkZWx0YS5hY3Rpb24gPT0gImluc2VydCI7CiAgICB2YXIgZGVsdGFSb3dTaGlmdCA9IChkZWx0YUlzSW5zZXJ0ID8gMSA6IC0xKSAqIChkZWx0YS5lbmQucm93IC0gZGVsdGEuc3RhcnQucm93KTsKICAgIHZhciBkZWx0YUNvbFNoaWZ0ID0gKGRlbHRhSXNJbnNlcnQgPyAxIDogLTEpICogKGRlbHRhLmVuZC5jb2x1bW4gLSBkZWx0YS5zdGFydC5jb2x1bW4pOwogICAgdmFyIGRlbHRhU3RhcnQgPSBkZWx0YS5zdGFydDsKICAgIHZhciBkZWx0YUVuZCA9IGRlbHRhSXNJbnNlcnQgPyBkZWx0YVN0YXJ0IDogZGVsdGEuZW5kOyAvLyBDb2xsYXBzZSBpbnNlcnQgcmFuZ2UuCiAgICBpZiAoJHBvaW50c0luT3JkZXIocG9pbnQsIGRlbHRhU3RhcnQsIG1vdmVJZkVxdWFsKSkgewogICAgICAgIHJldHVybiB7CiAgICAgICAgICAgIHJvdzogcG9pbnQucm93LAogICAgICAgICAgICBjb2x1bW46IHBvaW50LmNvbHVtbgogICAgICAgIH07CiAgICB9CiAgICBpZiAoJHBvaW50c0luT3JkZXIoZGVsdGFFbmQsIHBvaW50LCAhbW92ZUlmRXF1YWwpKSB7CiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgcm93OiBwb2ludC5yb3cgKyBkZWx0YVJvd1NoaWZ0LAogICAgICAgICAgICBjb2x1bW46IHBvaW50LmNvbHVtbiArIChwb2ludC5yb3cgPT0gZGVsdGFFbmQucm93ID8gZGVsdGFDb2xTaGlmdCA6IDApCiAgICAgICAgfTsKICAgIH0KICAgIHJldHVybiB7CiAgICAgICAgcm93OiBkZWx0YVN0YXJ0LnJvdywKICAgICAgICBjb2x1bW46IGRlbHRhU3RhcnQuY29sdW1uCiAgICB9Owp9CmV4cG9ydHMuQW5jaG9yID0gQW5jaG9yOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvZG9jdW1lbnQiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpeyJ1c2Ugc3RyaWN0IjsKdmFyIG9vcCA9IHJlcXVpcmUoIi4vbGliL29vcCIpOwp2YXIgYXBwbHlEZWx0YSA9IHJlcXVpcmUoIi4vYXBwbHlfZGVsdGEiKS5hcHBseURlbHRhOwp2YXIgRXZlbnRFbWl0dGVyID0gcmVxdWlyZSgiLi9saWIvZXZlbnRfZW1pdHRlciIpLkV2ZW50RW1pdHRlcjsKdmFyIFJhbmdlID0gcmVxdWlyZSgiLi9yYW5nZSIpLlJhbmdlOwp2YXIgQW5jaG9yID0gcmVxdWlyZSgiLi9hbmNob3IiKS5BbmNob3I7CnZhciBEb2N1bWVudCA9IC8qKiBAY2xhc3MgKi8gKGZ1bmN0aW9uICgpIHsKICAgIGZ1bmN0aW9uIERvY3VtZW50KHRleHRPckxpbmVzKSB7CiAgICAgICAgdGhpcy4kbGluZXMgPSBbIiJdOwogICAgICAgIGlmICh0ZXh0T3JMaW5lcy5sZW5ndGggPT09IDApIHsKICAgICAgICAgICAgdGhpcy4kbGluZXMgPSBbIiJdOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChBcnJheS5pc0FycmF5KHRleHRPckxpbmVzKSkgewogICAgICAgICAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzKHsgcm93OiAwLCBjb2x1bW46IDAgfSwgdGV4dE9yTGluZXMpOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgdGhpcy5pbnNlcnQoeyByb3c6IDAsIGNvbHVtbjogMCB9LCB0ZXh0T3JMaW5lcyk7CiAgICAgICAgfQogICAgfQogICAgRG9jdW1lbnQucHJvdG90eXBlLnNldFZhbHVlID0gZnVuY3Rpb24gKHRleHQpIHsKICAgICAgICB2YXIgbGVuID0gdGhpcy5nZXRMZW5ndGgoKSAtIDE7CiAgICAgICAgdGhpcy5yZW1vdmUobmV3IFJhbmdlKDAsIDAsIGxlbiwgdGhpcy5nZXRMaW5lKGxlbikubGVuZ3RoKSk7CiAgICAgICAgdGhpcy5pbnNlcnQoeyByb3c6IDAsIGNvbHVtbjogMCB9LCB0ZXh0IHx8ICIiKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuZ2V0VmFsdWUgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuZ2V0QWxsTGluZXMoKS5qb2luKHRoaXMuZ2V0TmV3TGluZUNoYXJhY3RlcigpKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuY3JlYXRlQW5jaG9yID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgcmV0dXJuIG5ldyBBbmNob3IodGhpcywgcm93LCBjb2x1bW4pOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS4kZGV0ZWN0TmV3TGluZSA9IGZ1bmN0aW9uICh0ZXh0KSB7CiAgICAgICAgdmFyIG1hdGNoID0gdGV4dC5tYXRjaCgvXi4qPyhcclxufFxyfFxuKS9tKTsKICAgICAgICB0aGlzLiRhdXRvTmV3TGluZSA9IG1hdGNoID8gbWF0Y2hbMV0gOiAiXG4iOwogICAgICAgIHRoaXMuX3NpZ25hbCgiY2hhbmdlTmV3TGluZU1vZGUiKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuZ2V0TmV3TGluZUNoYXJhY3RlciA9IGZ1bmN0aW9uICgpIHsKICAgICAgICBzd2l0Y2ggKHRoaXMuJG5ld0xpbmVNb2RlKSB7CiAgICAgICAgICAgIGNhc2UgIndpbmRvd3MiOgogICAgICAgICAgICAgICAgcmV0dXJuICJcclxuIjsKICAgICAgICAgICAgY2FzZSAidW5peCI6CiAgICAgICAgICAgICAgICByZXR1cm4gIlxuIjsKICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLiRhdXRvTmV3TGluZSB8fCAiXG4iOwogICAgICAgIH0KICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuc2V0TmV3TGluZU1vZGUgPSBmdW5jdGlvbiAobmV3TGluZU1vZGUpIHsKICAgICAgICBpZiAodGhpcy4kbmV3TGluZU1vZGUgPT09IG5ld0xpbmVNb2RlKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdGhpcy4kbmV3TGluZU1vZGUgPSBuZXdMaW5lTW9kZTsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZU5ld0xpbmVNb2RlIik7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmdldE5ld0xpbmVNb2RlID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLiRuZXdMaW5lTW9kZTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuaXNOZXdMaW5lID0gZnVuY3Rpb24gKHRleHQpIHsKICAgICAgICByZXR1cm4gKHRleHQgPT0gIlxyXG4iIHx8IHRleHQgPT0gIlxyIiB8fCB0ZXh0ID09ICJcbiIpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5nZXRMaW5lID0gZnVuY3Rpb24gKHJvdykgewogICAgICAgIHJldHVybiB0aGlzLiRsaW5lc1tyb3ddIHx8ICIiOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5nZXRMaW5lcyA9IGZ1bmN0aW9uIChmaXJzdFJvdywgbGFzdFJvdykgewogICAgICAgIHJldHVybiB0aGlzLiRsaW5lcy5zbGljZShmaXJzdFJvdywgbGFzdFJvdyArIDEpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5nZXRBbGxMaW5lcyA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gdGhpcy5nZXRMaW5lcygwLCB0aGlzLmdldExlbmd0aCgpKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuZ2V0TGVuZ3RoID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLiRsaW5lcy5sZW5ndGg7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmdldFRleHRSYW5nZSA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHJldHVybiB0aGlzLmdldExpbmVzRm9yUmFuZ2UocmFuZ2UpLmpvaW4odGhpcy5nZXROZXdMaW5lQ2hhcmFjdGVyKCkpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5nZXRMaW5lc0ZvclJhbmdlID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgdmFyIGxpbmVzOwogICAgICAgIGlmIChyYW5nZS5zdGFydC5yb3cgPT09IHJhbmdlLmVuZC5yb3cpIHsKICAgICAgICAgICAgbGluZXMgPSBbdGhpcy5nZXRMaW5lKHJhbmdlLnN0YXJ0LnJvdykuc3Vic3RyaW5nKHJhbmdlLnN0YXJ0LmNvbHVtbiwgcmFuZ2UuZW5kLmNvbHVtbildOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgbGluZXMgPSB0aGlzLmdldExpbmVzKHJhbmdlLnN0YXJ0LnJvdywgcmFuZ2UuZW5kLnJvdyk7CiAgICAgICAgICAgIGxpbmVzWzBdID0gKGxpbmVzWzBdIHx8ICIiKS5zdWJzdHJpbmcocmFuZ2Uuc3RhcnQuY29sdW1uKTsKICAgICAgICAgICAgdmFyIGwgPSBsaW5lcy5sZW5ndGggLSAxOwogICAgICAgICAgICBpZiAocmFuZ2UuZW5kLnJvdyAtIHJhbmdlLnN0YXJ0LnJvdyA9PSBsKQogICAgICAgICAgICAgICAgbGluZXNbbF0gPSBsaW5lc1tsXS5zdWJzdHJpbmcoMCwgcmFuZ2UuZW5kLmNvbHVtbik7CiAgICAgICAgfQogICAgICAgIHJldHVybiBsaW5lczsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuaW5zZXJ0TGluZXMgPSBmdW5jdGlvbiAocm93LCBsaW5lcykgewogICAgICAgIGNvbnNvbGUud2FybigiVXNlIG9mIGRvY3VtZW50Lmluc2VydExpbmVzIGlzIGRlcHJlY2F0ZWQuIFVzZSB0aGUgaW5zZXJ0RnVsbExpbmVzIG1ldGhvZCBpbnN0ZWFkLiIpOwogICAgICAgIHJldHVybiB0aGlzLmluc2VydEZ1bGxMaW5lcyhyb3csIGxpbmVzKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucmVtb3ZlTGluZXMgPSBmdW5jdGlvbiAoZmlyc3RSb3csIGxhc3RSb3cpIHsKICAgICAgICBjb25zb2xlLndhcm4oIlVzZSBvZiBkb2N1bWVudC5yZW1vdmVMaW5lcyBpcyBkZXByZWNhdGVkLiBVc2UgdGhlIHJlbW92ZUZ1bGxMaW5lcyBtZXRob2QgaW5zdGVhZC4iKTsKICAgICAgICByZXR1cm4gdGhpcy5yZW1vdmVGdWxsTGluZXMoZmlyc3RSb3csIGxhc3RSb3cpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5pbnNlcnROZXdMaW5lID0gZnVuY3Rpb24gKHBvc2l0aW9uKSB7CiAgICAgICAgY29uc29sZS53YXJuKCJVc2Ugb2YgZG9jdW1lbnQuaW5zZXJ0TmV3TGluZSBpcyBkZXByZWNhdGVkLiBVc2UgaW5zZXJ0TWVyZ2VkTGluZXMocG9zaXRpb24sIFsnJywgJyddKSBpbnN0ZWFkLiIpOwogICAgICAgIHJldHVybiB0aGlzLmluc2VydE1lcmdlZExpbmVzKHBvc2l0aW9uLCBbIiIsICIiXSk7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmluc2VydCA9IGZ1bmN0aW9uIChwb3NpdGlvbiwgdGV4dCkgewogICAgICAgIGlmICh0aGlzLmdldExlbmd0aCgpIDw9IDEpCiAgICAgICAgICAgIHRoaXMuJGRldGVjdE5ld0xpbmUodGV4dCk7CiAgICAgICAgcmV0dXJuIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMocG9zaXRpb24sIHRoaXMuJHNwbGl0KHRleHQpKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuaW5zZXJ0SW5MaW5lID0gZnVuY3Rpb24gKHBvc2l0aW9uLCB0ZXh0KSB7CiAgICAgICAgdmFyIHN0YXJ0ID0gdGhpcy5jbGlwcGVkUG9zKHBvc2l0aW9uLnJvdywgcG9zaXRpb24uY29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gdGhpcy5wb3MocG9zaXRpb24ucm93LCBwb3NpdGlvbi5jb2x1bW4gKyB0ZXh0Lmxlbmd0aCk7CiAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgc3RhcnQ6IHN0YXJ0LAogICAgICAgICAgICBlbmQ6IGVuZCwKICAgICAgICAgICAgYWN0aW9uOiAiaW5zZXJ0IiwKICAgICAgICAgICAgbGluZXM6IFt0ZXh0XQogICAgICAgIH0sIHRydWUpOwogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKGVuZCk7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmNsaXBwZWRQb3MgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICB2YXIgbGVuZ3RoID0gdGhpcy5nZXRMZW5ndGgoKTsKICAgICAgICBpZiAocm93ID09PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgcm93ID0gbGVuZ3RoOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChyb3cgPCAwKSB7CiAgICAgICAgICAgIHJvdyA9IDA7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHJvdyA+PSBsZW5ndGgpIHsKICAgICAgICAgICAgcm93ID0gbGVuZ3RoIC0gMTsKICAgICAgICAgICAgY29sdW1uID0gdW5kZWZpbmVkOwogICAgICAgIH0KICAgICAgICB2YXIgbGluZSA9IHRoaXMuZ2V0TGluZShyb3cpOwogICAgICAgIGlmIChjb2x1bW4gPT0gdW5kZWZpbmVkKQogICAgICAgICAgICBjb2x1bW4gPSBsaW5lLmxlbmd0aDsKICAgICAgICBjb2x1bW4gPSBNYXRoLm1pbihNYXRoLm1heChjb2x1bW4sIDApLCBsaW5lLmxlbmd0aCk7CiAgICAgICAgcmV0dXJuIHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH07CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmNsb25lUG9zID0gZnVuY3Rpb24gKHBvcykgewogICAgICAgIHJldHVybiB7IHJvdzogcG9zLnJvdywgY29sdW1uOiBwb3MuY29sdW1uIH07CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLnBvcyA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB7IHJvdzogcm93LCBjb2x1bW46IGNvbHVtbiB9OwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS4kY2xpcFBvc2l0aW9uID0gZnVuY3Rpb24gKHBvc2l0aW9uKSB7CiAgICAgICAgdmFyIGxlbmd0aCA9IHRoaXMuZ2V0TGVuZ3RoKCk7CiAgICAgICAgaWYgKHBvc2l0aW9uLnJvdyA+PSBsZW5ndGgpIHsKICAgICAgICAgICAgcG9zaXRpb24ucm93ID0gTWF0aC5tYXgoMCwgbGVuZ3RoIC0gMSk7CiAgICAgICAgICAgIHBvc2l0aW9uLmNvbHVtbiA9IHRoaXMuZ2V0TGluZShsZW5ndGggLSAxKS5sZW5ndGg7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBwb3NpdGlvbi5yb3cgPSBNYXRoLm1heCgwLCBwb3NpdGlvbi5yb3cpOwogICAgICAgICAgICBwb3NpdGlvbi5jb2x1bW4gPSBNYXRoLm1pbihNYXRoLm1heChwb3NpdGlvbi5jb2x1bW4sIDApLCB0aGlzLmdldExpbmUocG9zaXRpb24ucm93KS5sZW5ndGgpOwogICAgICAgIH0KICAgICAgICByZXR1cm4gcG9zaXRpb247CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmluc2VydEZ1bGxMaW5lcyA9IGZ1bmN0aW9uIChyb3csIGxpbmVzKSB7CiAgICAgICAgcm93ID0gTWF0aC5taW4oTWF0aC5tYXgocm93LCAwKSwgdGhpcy5nZXRMZW5ndGgoKSk7CiAgICAgICAgdmFyIGNvbHVtbiA9IDA7CiAgICAgICAgaWYgKHJvdyA8IHRoaXMuZ2V0TGVuZ3RoKCkpIHsKICAgICAgICAgICAgbGluZXMgPSBsaW5lcy5jb25jYXQoWyIiXSk7CiAgICAgICAgICAgIGNvbHVtbiA9IDA7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBsaW5lcyA9IFsiIl0uY29uY2F0KGxpbmVzKTsKICAgICAgICAgICAgcm93LS07CiAgICAgICAgICAgIGNvbHVtbiA9IHRoaXMuJGxpbmVzW3Jvd10ubGVuZ3RoOwogICAgICAgIH0KICAgICAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzKHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH0sIGxpbmVzKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuaW5zZXJ0TWVyZ2VkTGluZXMgPSBmdW5jdGlvbiAocG9zaXRpb24sIGxpbmVzKSB7CiAgICAgICAgdmFyIHN0YXJ0ID0gdGhpcy5jbGlwcGVkUG9zKHBvc2l0aW9uLnJvdywgcG9zaXRpb24uY29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gewogICAgICAgICAgICByb3c6IHN0YXJ0LnJvdyArIGxpbmVzLmxlbmd0aCAtIDEsCiAgICAgICAgICAgIGNvbHVtbjogKGxpbmVzLmxlbmd0aCA9PSAxID8gc3RhcnQuY29sdW1uIDogMCkgKyBsaW5lc1tsaW5lcy5sZW5ndGggLSAxXS5sZW5ndGgKICAgICAgICB9OwogICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCwKICAgICAgICAgICAgZW5kOiBlbmQsCiAgICAgICAgICAgIGFjdGlvbjogImluc2VydCIsCiAgICAgICAgICAgIGxpbmVzOiBsaW5lcwogICAgICAgIH0pOwogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKGVuZCk7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLnJlbW92ZSA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhyYW5nZS5zdGFydC5yb3csIHJhbmdlLnN0YXJ0LmNvbHVtbik7CiAgICAgICAgdmFyIGVuZCA9IHRoaXMuY2xpcHBlZFBvcyhyYW5nZS5lbmQucm93LCByYW5nZS5lbmQuY29sdW1uKTsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogc3RhcnQsCiAgICAgICAgICAgIGVuZDogZW5kLAogICAgICAgICAgICBhY3Rpb246ICJyZW1vdmUiLAogICAgICAgICAgICBsaW5lczogdGhpcy5nZXRMaW5lc0ZvclJhbmdlKHsgc3RhcnQ6IHN0YXJ0LCBlbmQ6IGVuZCB9KQogICAgICAgIH0pOwogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKHN0YXJ0KTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucmVtb3ZlSW5MaW5lID0gZnVuY3Rpb24gKHJvdywgc3RhcnRDb2x1bW4sIGVuZENvbHVtbikgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhyb3csIHN0YXJ0Q29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gdGhpcy5jbGlwcGVkUG9zKHJvdywgZW5kQ29sdW1uKTsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogc3RhcnQsCiAgICAgICAgICAgIGVuZDogZW5kLAogICAgICAgICAgICBhY3Rpb246ICJyZW1vdmUiLAogICAgICAgICAgICBsaW5lczogdGhpcy5nZXRMaW5lc0ZvclJhbmdlKHsgc3RhcnQ6IHN0YXJ0LCBlbmQ6IGVuZCB9KQogICAgICAgIH0sIHRydWUpOwogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKHN0YXJ0KTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucmVtb3ZlRnVsbExpbmVzID0gZnVuY3Rpb24gKGZpcnN0Um93LCBsYXN0Um93KSB7CiAgICAgICAgZmlyc3RSb3cgPSBNYXRoLm1pbihNYXRoLm1heCgwLCBmaXJzdFJvdyksIHRoaXMuZ2V0TGVuZ3RoKCkgLSAxKTsKICAgICAgICBsYXN0Um93ID0gTWF0aC5taW4oTWF0aC5tYXgoMCwgbGFzdFJvdyksIHRoaXMuZ2V0TGVuZ3RoKCkgLSAxKTsKICAgICAgICB2YXIgZGVsZXRlRmlyc3ROZXdMaW5lID0gbGFzdFJvdyA9PSB0aGlzLmdldExlbmd0aCgpIC0gMSAmJiBmaXJzdFJvdyA+IDA7CiAgICAgICAgdmFyIGRlbGV0ZUxhc3ROZXdMaW5lID0gbGFzdFJvdyA8IHRoaXMuZ2V0TGVuZ3RoKCkgLSAxOwogICAgICAgIHZhciBzdGFydFJvdyA9IChkZWxldGVGaXJzdE5ld0xpbmUgPyBmaXJzdFJvdyAtIDEgOiBmaXJzdFJvdyk7CiAgICAgICAgdmFyIHN0YXJ0Q29sID0gKGRlbGV0ZUZpcnN0TmV3TGluZSA/IHRoaXMuZ2V0TGluZShzdGFydFJvdykubGVuZ3RoIDogMCk7CiAgICAgICAgdmFyIGVuZFJvdyA9IChkZWxldGVMYXN0TmV3TGluZSA/IGxhc3RSb3cgKyAxIDogbGFzdFJvdyk7CiAgICAgICAgdmFyIGVuZENvbCA9IChkZWxldGVMYXN0TmV3TGluZSA/IDAgOiB0aGlzLmdldExpbmUoZW5kUm93KS5sZW5ndGgpOwogICAgICAgIHZhciByYW5nZSA9IG5ldyBSYW5nZShzdGFydFJvdywgc3RhcnRDb2wsIGVuZFJvdywgZW5kQ29sKTsKICAgICAgICB2YXIgZGVsZXRlZExpbmVzID0gdGhpcy4kbGluZXMuc2xpY2UoZmlyc3RSb3csIGxhc3RSb3cgKyAxKTsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogcmFuZ2Uuc3RhcnQsCiAgICAgICAgICAgIGVuZDogcmFuZ2UuZW5kLAogICAgICAgICAgICBhY3Rpb246ICJyZW1vdmUiLAogICAgICAgICAgICBsaW5lczogdGhpcy5nZXRMaW5lc0ZvclJhbmdlKHJhbmdlKQogICAgICAgIH0pOwogICAgICAgIHJldHVybiBkZWxldGVkTGluZXM7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLnJlbW92ZU5ld0xpbmUgPSBmdW5jdGlvbiAocm93KSB7CiAgICAgICAgaWYgKHJvdyA8IHRoaXMuZ2V0TGVuZ3RoKCkgLSAxICYmIHJvdyA+PSAwKSB7CiAgICAgICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgICAgICBzdGFydDogdGhpcy5wb3Mocm93LCB0aGlzLmdldExpbmUocm93KS5sZW5ndGgpLAogICAgICAgICAgICAgICAgZW5kOiB0aGlzLnBvcyhyb3cgKyAxLCAwKSwKICAgICAgICAgICAgICAgIGFjdGlvbjogInJlbW92ZSIsCiAgICAgICAgICAgICAgICBsaW5lczogWyIiLCAiIl0KICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5yZXBsYWNlID0gZnVuY3Rpb24gKHJhbmdlLCB0ZXh0KSB7CiAgICAgICAgaWYgKCEocmFuZ2UgaW5zdGFuY2VvZiBSYW5nZSkpCiAgICAgICAgICAgIHJhbmdlID0gUmFuZ2UuZnJvbVBvaW50cyhyYW5nZS5zdGFydCwgcmFuZ2UuZW5kKTsKICAgICAgICBpZiAodGV4dC5sZW5ndGggPT09IDAgJiYgcmFuZ2UuaXNFbXB0eSgpKQogICAgICAgICAgICByZXR1cm4gcmFuZ2Uuc3RhcnQ7CiAgICAgICAgaWYgKHRleHQgPT0gdGhpcy5nZXRUZXh0UmFuZ2UocmFuZ2UpKQogICAgICAgICAgICByZXR1cm4gcmFuZ2UuZW5kOwogICAgICAgIHRoaXMucmVtb3ZlKHJhbmdlKTsKICAgICAgICB2YXIgZW5kOwogICAgICAgIGlmICh0ZXh0KSB7CiAgICAgICAgICAgIGVuZCA9IHRoaXMuaW5zZXJ0KHJhbmdlLnN0YXJ0LCB0ZXh0KTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGVuZCA9IHJhbmdlLnN0YXJ0OwogICAgICAgIH0KICAgICAgICByZXR1cm4gZW5kOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5hcHBseURlbHRhcyA9IGZ1bmN0aW9uIChkZWx0YXMpIHsKICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGRlbHRhcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICB0aGlzLmFwcGx5RGVsdGEoZGVsdGFzW2ldKTsKICAgICAgICB9CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLnJldmVydERlbHRhcyA9IGZ1bmN0aW9uIChkZWx0YXMpIHsKICAgICAgICBmb3IgKHZhciBpID0gZGVsdGFzLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tKSB7CiAgICAgICAgICAgIHRoaXMucmV2ZXJ0RGVsdGEoZGVsdGFzW2ldKTsKICAgICAgICB9CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmFwcGx5RGVsdGEgPSBmdW5jdGlvbiAoZGVsdGEsIGRvTm90VmFsaWRhdGUpIHsKICAgICAgICB2YXIgaXNJbnNlcnQgPSBkZWx0YS5hY3Rpb24gPT0gImluc2VydCI7CiAgICAgICAgaWYgKGlzSW5zZXJ0ID8gZGVsdGEubGluZXMubGVuZ3RoIDw9IDEgJiYgIWRlbHRhLmxpbmVzWzBdCiAgICAgICAgICAgIDogIVJhbmdlLmNvbXBhcmVQb2ludHMoZGVsdGEuc3RhcnQsIGRlbHRhLmVuZCkpIHsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgICAgICBpZiAoaXNJbnNlcnQgJiYgZGVsdGEubGluZXMubGVuZ3RoID4gMjAwMDApIHsKICAgICAgICAgICAgdGhpcy4kc3BsaXRBbmRhcHBseUxhcmdlRGVsdGEoZGVsdGEsIDIwMDAwKTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGFwcGx5RGVsdGEodGhpcy4kbGluZXMsIGRlbHRhLCBkb05vdFZhbGlkYXRlKTsKICAgICAgICAgICAgdGhpcy5fc2lnbmFsKCJjaGFuZ2UiLCBkZWx0YSk7CiAgICAgICAgfQogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS4kc2FmZUFwcGx5RGVsdGEgPSBmdW5jdGlvbiAoZGVsdGEpIHsKICAgICAgICB2YXIgZG9jTGVuZ3RoID0gdGhpcy4kbGluZXMubGVuZ3RoOwogICAgICAgIGlmIChkZWx0YS5hY3Rpb24gPT0gInJlbW92ZSIgJiYgZGVsdGEuc3RhcnQucm93IDwgZG9jTGVuZ3RoICYmIGRlbHRhLmVuZC5yb3cgPCBkb2NMZW5ndGgKICAgICAgICAgICAgfHwgZGVsdGEuYWN0aW9uID09ICJpbnNlcnQiICYmIGRlbHRhLnN0YXJ0LnJvdyA8PSBkb2NMZW5ndGgpIHsKICAgICAgICAgICAgdGhpcy5hcHBseURlbHRhKGRlbHRhKTsKICAgICAgICB9CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLiRzcGxpdEFuZGFwcGx5TGFyZ2VEZWx0YSA9IGZ1bmN0aW9uIChkZWx0YSwgTUFYKSB7CiAgICAgICAgdmFyIGxpbmVzID0gZGVsdGEubGluZXM7CiAgICAgICAgdmFyIGwgPSBsaW5lcy5sZW5ndGggLSBNQVggKyAxOwogICAgICAgIHZhciByb3cgPSBkZWx0YS5zdGFydC5yb3c7CiAgICAgICAgdmFyIGNvbHVtbiA9IGRlbHRhLnN0YXJ0LmNvbHVtbjsKICAgICAgICBmb3IgKHZhciBmcm9tID0gMCwgdG8gPSAwOyBmcm9tIDwgbDsgZnJvbSA9IHRvKSB7CiAgICAgICAgICAgIHRvICs9IE1BWCAtIDE7CiAgICAgICAgICAgIHZhciBjaHVuayA9IGxpbmVzLnNsaWNlKGZyb20sIHRvKTsKICAgICAgICAgICAgY2h1bmsucHVzaCgiIik7CiAgICAgICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgICAgICBzdGFydDogdGhpcy5wb3Mocm93ICsgZnJvbSwgY29sdW1uKSwKICAgICAgICAgICAgICAgIGVuZDogdGhpcy5wb3Mocm93ICsgdG8sIGNvbHVtbiA9IDApLAogICAgICAgICAgICAgICAgYWN0aW9uOiBkZWx0YS5hY3Rpb24sCiAgICAgICAgICAgICAgICBsaW5lczogY2h1bmsKICAgICAgICAgICAgfSwgdHJ1ZSk7CiAgICAgICAgfQogICAgICAgIGRlbHRhLmxpbmVzID0gbGluZXMuc2xpY2UoZnJvbSk7CiAgICAgICAgZGVsdGEuc3RhcnQucm93ID0gcm93ICsgZnJvbTsKICAgICAgICBkZWx0YS5zdGFydC5jb2x1bW4gPSBjb2x1bW47CiAgICAgICAgdGhpcy5hcHBseURlbHRhKGRlbHRhLCB0cnVlKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucmV2ZXJ0RGVsdGEgPSBmdW5jdGlvbiAoZGVsdGEpIHsKICAgICAgICB0aGlzLiRzYWZlQXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiB0aGlzLmNsb25lUG9zKGRlbHRhLnN0YXJ0KSwKICAgICAgICAgICAgZW5kOiB0aGlzLmNsb25lUG9zKGRlbHRhLmVuZCksCiAgICAgICAgICAgIGFjdGlvbjogKGRlbHRhLmFjdGlvbiA9PSAiaW5zZXJ0IiA/ICJyZW1vdmUiIDogImluc2VydCIpLAogICAgICAgICAgICBsaW5lczogZGVsdGEubGluZXMuc2xpY2UoKQogICAgICAgIH0pOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5pbmRleFRvUG9zaXRpb24gPSBmdW5jdGlvbiAoaW5kZXgsIHN0YXJ0Um93KSB7CiAgICAgICAgdmFyIGxpbmVzID0gdGhpcy4kbGluZXMgfHwgdGhpcy5nZXRBbGxMaW5lcygpOwogICAgICAgIHZhciBuZXdsaW5lTGVuZ3RoID0gdGhpcy5nZXROZXdMaW5lQ2hhcmFjdGVyKCkubGVuZ3RoOwogICAgICAgIGZvciAodmFyIGkgPSBzdGFydFJvdyB8fCAwLCBsID0gbGluZXMubGVuZ3RoOyBpIDwgbDsgaSsrKSB7CiAgICAgICAgICAgIGluZGV4IC09IGxpbmVzW2ldLmxlbmd0aCArIG5ld2xpbmVMZW5ndGg7CiAgICAgICAgICAgIGlmIChpbmRleCA8IDApCiAgICAgICAgICAgICAgICByZXR1cm4geyByb3c6IGksIGNvbHVtbjogaW5kZXggKyBsaW5lc1tpXS5sZW5ndGggKyBuZXdsaW5lTGVuZ3RoIH07CiAgICAgICAgfQogICAgICAgIHJldHVybiB7IHJvdzogbCAtIDEsIGNvbHVtbjogaW5kZXggKyBsaW5lc1tsIC0gMV0ubGVuZ3RoICsgbmV3bGluZUxlbmd0aCB9OwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5wb3NpdGlvblRvSW5kZXggPSBmdW5jdGlvbiAocG9zLCBzdGFydFJvdykgewogICAgICAgIHZhciBsaW5lcyA9IHRoaXMuJGxpbmVzIHx8IHRoaXMuZ2V0QWxsTGluZXMoKTsKICAgICAgICB2YXIgbmV3bGluZUxlbmd0aCA9IHRoaXMuZ2V0TmV3TGluZUNoYXJhY3RlcigpLmxlbmd0aDsKICAgICAgICB2YXIgaW5kZXggPSAwOwogICAgICAgIHZhciByb3cgPSBNYXRoLm1pbihwb3Mucm93LCBsaW5lcy5sZW5ndGgpOwogICAgICAgIGZvciAodmFyIGkgPSBzdGFydFJvdyB8fCAwOyBpIDwgcm93OyArK2kpCiAgICAgICAgICAgIGluZGV4ICs9IGxpbmVzW2ldLmxlbmd0aCArIG5ld2xpbmVMZW5ndGg7CiAgICAgICAgcmV0dXJuIGluZGV4ICsgcG9zLmNvbHVtbjsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuJHNwbGl0ID0gZnVuY3Rpb24gKHRleHQpIHsKICAgICAgICByZXR1cm4gdGV4dC5zcGxpdCgvXHJcbnxccnxcbi8pOwogICAgfTsKICAgIHJldHVybiBEb2N1bWVudDsKfSgpKTsKRG9jdW1lbnQucHJvdG90eXBlLiRhdXRvTmV3TGluZSA9ICIiOwpEb2N1bWVudC5wcm90b3R5cGUuJG5ld0xpbmVNb2RlID0gImF1dG8iOwpvb3AuaW1wbGVtZW50KERvY3VtZW50LnByb3RvdHlwZSwgRXZlbnRFbWl0dGVyKTsKZXhwb3J0cy5Eb2N1bWVudCA9IERvY3VtZW50OwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvbGliL2RlZXBfY29weSIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7ZXhwb3J0cy5kZWVwQ29weSA9IGZ1bmN0aW9uIGRlZXBDb3B5KG9iaikgewogICAgaWYgKHR5cGVvZiBvYmogIT09ICJvYmplY3QiIHx8ICFvYmopCiAgICAgICAgcmV0dXJuIG9iajsKICAgIHZhciBjb3B5OwogICAgaWYgKEFycmF5LmlzQXJyYXkob2JqKSkgewogICAgICAgIGNvcHkgPSBbXTsKICAgICAgICBmb3IgKHZhciBrZXkgPSAwOyBrZXkgPCBvYmoubGVuZ3RoOyBrZXkrKykgewogICAgICAgICAgICBjb3B5W2tleV0gPSBkZWVwQ29weShvYmpba2V5XSk7CiAgICAgICAgfQogICAgICAgIHJldHVybiBjb3B5OwogICAgfQogICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvYmopICE9PSAiW29iamVjdCBPYmplY3RdIikKICAgICAgICByZXR1cm4gb2JqOwogICAgY29weSA9IHt9OwogICAgZm9yICh2YXIga2V5IGluIG9iaikKICAgICAgICBjb3B5W2tleV0gPSBkZWVwQ29weShvYmpba2V5XSk7CiAgICByZXR1cm4gY29weTsKfTsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL2xpYi9sYW5nIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CmV4cG9ydHMubGFzdCA9IGZ1bmN0aW9uIChhKSB7CiAgICByZXR1cm4gYVthLmxlbmd0aCAtIDFdOwp9OwpleHBvcnRzLnN0cmluZ1JldmVyc2UgPSBmdW5jdGlvbiAoc3RyaW5nKSB7CiAgICByZXR1cm4gc3RyaW5nLnNwbGl0KCIiKS5yZXZlcnNlKCkuam9pbigiIik7Cn07CmV4cG9ydHMuc3RyaW5nUmVwZWF0ID0gZnVuY3Rpb24gKHN0cmluZywgY291bnQpIHsKICAgIHZhciByZXN1bHQgPSAnJzsKICAgIHdoaWxlIChjb3VudCA+IDApIHsKICAgICAgICBpZiAoY291bnQgJiAxKQogICAgICAgICAgICByZXN1bHQgKz0gc3RyaW5nOwogICAgICAgIGlmIChjb3VudCA+Pj0gMSkKICAgICAgICAgICAgc3RyaW5nICs9IHN0cmluZzsKICAgIH0KICAgIHJldHVybiByZXN1bHQ7Cn07CnZhciB0cmltQmVnaW5SZWdleHAgPSAvXlxzXHMqLzsKdmFyIHRyaW1FbmRSZWdleHAgPSAvXHNccyokLzsKZXhwb3J0cy5zdHJpbmdUcmltTGVmdCA9IGZ1bmN0aW9uIChzdHJpbmcpIHsKICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSh0cmltQmVnaW5SZWdleHAsICcnKTsKfTsKZXhwb3J0cy5zdHJpbmdUcmltUmlnaHQgPSBmdW5jdGlvbiAoc3RyaW5nKSB7CiAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UodHJpbUVuZFJlZ2V4cCwgJycpOwp9OwpleHBvcnRzLmNvcHlPYmplY3QgPSBmdW5jdGlvbiAob2JqKSB7CiAgICB2YXIgY29weSA9IHt9OwogICAgZm9yICh2YXIga2V5IGluIG9iaikgewogICAgICAgIGNvcHlba2V5XSA9IG9ialtrZXldOwogICAgfQogICAgcmV0dXJuIGNvcHk7Cn07CmV4cG9ydHMuY29weUFycmF5ID0gZnVuY3Rpb24gKGFycmF5KSB7CiAgICB2YXIgY29weSA9IFtdOwogICAgZm9yICh2YXIgaSA9IDAsIGwgPSBhcnJheS5sZW5ndGg7IGkgPCBsOyBpKyspIHsKICAgICAgICBpZiAoYXJyYXlbaV0gJiYgdHlwZW9mIGFycmF5W2ldID09ICJvYmplY3QiKQogICAgICAgICAgICBjb3B5W2ldID0gdGhpcy5jb3B5T2JqZWN0KGFycmF5W2ldKTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIGNvcHlbaV0gPSBhcnJheVtpXTsKICAgIH0KICAgIHJldHVybiBjb3B5Owp9OwpleHBvcnRzLmRlZXBDb3B5ID0gcmVxdWlyZSgiLi9kZWVwX2NvcHkiKS5kZWVwQ29weTsKZXhwb3J0cy5hcnJheVRvTWFwID0gZnVuY3Rpb24gKGFycikgewogICAgdmFyIG1hcCA9IHt9OwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHsKICAgICAgICBtYXBbYXJyW2ldXSA9IDE7CiAgICB9CiAgICByZXR1cm4gbWFwOwp9OwpleHBvcnRzLmNyZWF0ZU1hcCA9IGZ1bmN0aW9uIChwcm9wcykgewogICAgdmFyIG1hcCA9IE9iamVjdC5jcmVhdGUobnVsbCk7CiAgICBmb3IgKHZhciBpIGluIHByb3BzKSB7CiAgICAgICAgbWFwW2ldID0gcHJvcHNbaV07CiAgICB9CiAgICByZXR1cm4gbWFwOwp9OwpleHBvcnRzLmFycmF5UmVtb3ZlID0gZnVuY3Rpb24gKGFycmF5LCB2YWx1ZSkgewogICAgZm9yICh2YXIgaSA9IDA7IGkgPD0gYXJyYXkubGVuZ3RoOyBpKyspIHsKICAgICAgICBpZiAodmFsdWUgPT09IGFycmF5W2ldKSB7CiAgICAgICAgICAgIGFycmF5LnNwbGljZShpLCAxKTsKICAgICAgICB9CiAgICB9Cn07CmV4cG9ydHMuZXNjYXBlUmVnRXhwID0gZnVuY3Rpb24gKHN0cikgewogICAgcmV0dXJuIHN0ci5yZXBsYWNlKC8oWy4qKz9eJHt9KCl8W1xdXC9cXF0pL2csICdcXCQxJyk7Cn07CmV4cG9ydHMuZXNjYXBlSFRNTCA9IGZ1bmN0aW9uIChzdHIpIHsKICAgIHJldHVybiAoIiIgKyBzdHIpLnJlcGxhY2UoLyYvZywgIiYjMzg7IikucmVwbGFjZSgvIi9nLCAiJiMzNDsiKS5yZXBsYWNlKC8nL2csICImIzM5OyIpLnJlcGxhY2UoLzwvZywgIiYjNjA7Iik7Cn07CmV4cG9ydHMuZ2V0TWF0Y2hPZmZzZXRzID0gZnVuY3Rpb24gKHN0cmluZywgcmVnRXhwKSB7CiAgICB2YXIgbWF0Y2hlcyA9IFtdOwogICAgc3RyaW5nLnJlcGxhY2UocmVnRXhwLCBmdW5jdGlvbiAoc3RyKSB7CiAgICAgICAgbWF0Y2hlcy5wdXNoKHsKICAgICAgICAgICAgb2Zmc2V0OiBhcmd1bWVudHNbYXJndW1lbnRzLmxlbmd0aCAtIDJdLAogICAgICAgICAgICBsZW5ndGg6IHN0ci5sZW5ndGgKICAgICAgICB9KTsKICAgIH0pOwogICAgcmV0dXJuIG1hdGNoZXM7Cn07CmV4cG9ydHMuZGVmZXJyZWRDYWxsID0gZnVuY3Rpb24gKGZjbikgewogICAgdmFyIHRpbWVyID0gbnVsbDsKICAgIHZhciBjYWxsYmFjayA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aW1lciA9IG51bGw7CiAgICAgICAgZmNuKCk7CiAgICB9OwogICAgdmFyIGRlZmVycmVkID0gZnVuY3Rpb24gKHRpbWVvdXQpIHsKICAgICAgICBkZWZlcnJlZC5jYW5jZWwoKTsKICAgICAgICB0aW1lciA9IHNldFRpbWVvdXQoY2FsbGJhY2ssIHRpbWVvdXQgfHwgMCk7CiAgICAgICAgcmV0dXJuIGRlZmVycmVkOwogICAgfTsKICAgIGRlZmVycmVkLnNjaGVkdWxlID0gZGVmZXJyZWQ7CiAgICBkZWZlcnJlZC5jYWxsID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRoaXMuY2FuY2VsKCk7CiAgICAgICAgZmNuKCk7CiAgICAgICAgcmV0dXJuIGRlZmVycmVkOwogICAgfTsKICAgIGRlZmVycmVkLmNhbmNlbCA9IGZ1bmN0aW9uICgpIHsKICAgICAgICBjbGVhclRpbWVvdXQodGltZXIpOwogICAgICAgIHRpbWVyID0gbnVsbDsKICAgICAgICByZXR1cm4gZGVmZXJyZWQ7CiAgICB9OwogICAgZGVmZXJyZWQuaXNQZW5kaW5nID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aW1lcjsKICAgIH07CiAgICByZXR1cm4gZGVmZXJyZWQ7Cn07CmV4cG9ydHMuZGVsYXllZENhbGwgPSBmdW5jdGlvbiAoZmNuLCBkZWZhdWx0VGltZW91dCkgewogICAgdmFyIHRpbWVyID0gbnVsbDsKICAgIHZhciBjYWxsYmFjayA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aW1lciA9IG51bGw7CiAgICAgICAgZmNuKCk7CiAgICB9OwogICAgdmFyIF9zZWxmID0gZnVuY3Rpb24gKHRpbWVvdXQpIHsKICAgICAgICBpZiAodGltZXIgPT0gbnVsbCkKICAgICAgICAgICAgdGltZXIgPSBzZXRUaW1lb3V0KGNhbGxiYWNrLCB0aW1lb3V0IHx8IGRlZmF1bHRUaW1lb3V0KTsKICAgIH07CiAgICBfc2VsZi5kZWxheSA9IGZ1bmN0aW9uICh0aW1lb3V0KSB7CiAgICAgICAgdGltZXIgJiYgY2xlYXJUaW1lb3V0KHRpbWVyKTsKICAgICAgICB0aW1lciA9IHNldFRpbWVvdXQoY2FsbGJhY2ssIHRpbWVvdXQgfHwgZGVmYXVsdFRpbWVvdXQpOwogICAgfTsKICAgIF9zZWxmLnNjaGVkdWxlID0gX3NlbGY7CiAgICBfc2VsZi5jYWxsID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRoaXMuY2FuY2VsKCk7CiAgICAgICAgZmNuKCk7CiAgICB9OwogICAgX3NlbGYuY2FuY2VsID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRpbWVyICYmIGNsZWFyVGltZW91dCh0aW1lcik7CiAgICAgICAgdGltZXIgPSBudWxsOwogICAgfTsKICAgIF9zZWxmLmlzUGVuZGluZyA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gdGltZXI7CiAgICB9OwogICAgcmV0dXJuIF9zZWxmOwp9OwpleHBvcnRzLnN1cHBvcnRzTG9va2JlaGluZCA9IGZ1bmN0aW9uICgpIHsKICAgIHRyeSB7CiAgICAgICAgbmV3IFJlZ0V4cCgnKD88PS4pJyk7CiAgICB9CiAgICBjYXRjaCAoZSkgewogICAgICAgIHJldHVybiBmYWxzZTsKICAgIH0KICAgIHJldHVybiB0cnVlOwp9OwpleHBvcnRzLnN1cHBvcnRzVW5pY29kZUZsYWcgPSBmdW5jdGlvbiAoKSB7CiAgICB0cnkgewogICAgICAgIG5ldyBSZWdFeHAoJ14uJCcsICd1Jyk7CiAgICB9CiAgICBjYXRjaCAoZXJyb3IpIHsKICAgICAgICByZXR1cm4gZmFsc2U7CiAgICB9CiAgICByZXR1cm4gdHJ1ZTsKfTsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL3dvcmtlci9taXJyb3IiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKdmFyIERvY3VtZW50ID0gcmVxdWlyZSgiLi4vZG9jdW1lbnQiKS5Eb2N1bWVudDsKdmFyIGxhbmcgPSByZXF1aXJlKCIuLi9saWIvbGFuZyIpOwogICAgCnZhciBNaXJyb3IgPSBleHBvcnRzLk1pcnJvciA9IGZ1bmN0aW9uKHNlbmRlcikgewogICAgdGhpcy5zZW5kZXIgPSBzZW5kZXI7CiAgICB2YXIgZG9jID0gdGhpcy5kb2MgPSBuZXcgRG9jdW1lbnQoIiIpOwogICAgCiAgICB2YXIgZGVmZXJyZWRVcGRhdGUgPSB0aGlzLmRlZmVycmVkVXBkYXRlID0gbGFuZy5kZWxheWVkQ2FsbCh0aGlzLm9uVXBkYXRlLmJpbmQodGhpcykpOwogICAgCiAgICB2YXIgX3NlbGYgPSB0aGlzOwogICAgc2VuZGVyLm9uKCJjaGFuZ2UiLCBmdW5jdGlvbihlKSB7CiAgICAgICAgdmFyIGRhdGEgPSBlLmRhdGE7CiAgICAgICAgaWYgKGRhdGFbMF0uc3RhcnQpIHsKICAgICAgICAgICAgZG9jLmFwcGx5RGVsdGFzKGRhdGEpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZGF0YS5sZW5ndGg7IGkgKz0gMikgewogICAgICAgICAgICAgICAgdmFyIGQsIGVycjsgCiAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShkYXRhW2krMV0pKSB7CiAgICAgICAgICAgICAgICAgICAgZCA9IHthY3Rpb246ICJpbnNlcnQiLCBzdGFydDogZGF0YVtpXSwgbGluZXM6IGRhdGFbaSsxXX07CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIGQgPSB7YWN0aW9uOiAicmVtb3ZlIiwgc3RhcnQ6IGRhdGFbaV0sIGVuZDogZGF0YVtpKzFdfTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgaWYgKChkLmFjdGlvbiA9PSAiaW5zZXJ0IiA/IGQuc3RhcnQgOiBkLmVuZCkucm93ID49IGRvYy4kbGluZXMubGVuZ3RoKSB7CiAgICAgICAgICAgICAgICAgICAgZXJyID0gbmV3IEVycm9yKCJJbnZhbGlkIGRlbHRhIik7CiAgICAgICAgICAgICAgICAgICAgZXJyLmRhdGEgPSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IF9zZWxmLiRwYXRoLAogICAgICAgICAgICAgICAgICAgICAgICBsaW5lc0xlbmd0aDogZG9jLiRsaW5lcy5sZW5ndGgsCiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0OiBkLnN0YXJ0LAogICAgICAgICAgICAgICAgICAgICAgICBlbmQ6IGQuZW5kCiAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICB0aHJvdyBlcnI7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgZG9jLmFwcGx5RGVsdGEoZCwgdHJ1ZSk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYgKF9zZWxmLiR0aW1lb3V0KQogICAgICAgICAgICByZXR1cm4gZGVmZXJyZWRVcGRhdGUuc2NoZWR1bGUoX3NlbGYuJHRpbWVvdXQpOwogICAgICAgIF9zZWxmLm9uVXBkYXRlKCk7CiAgICB9KTsKfTsKCihmdW5jdGlvbigpIHsKICAgIAogICAgdGhpcy4kdGltZW91dCA9IDUwMDsKICAgIAogICAgdGhpcy5zZXRUaW1lb3V0ID0gZnVuY3Rpb24odGltZW91dCkgewogICAgICAgIHRoaXMuJHRpbWVvdXQgPSB0aW1lb3V0OwogICAgfTsKICAgIAogICAgdGhpcy5zZXRWYWx1ZSA9IGZ1bmN0aW9uKHZhbHVlKSB7CiAgICAgICAgdGhpcy5kb2Muc2V0VmFsdWUodmFsdWUpOwogICAgICAgIHRoaXMuZGVmZXJyZWRVcGRhdGUuc2NoZWR1bGUodGhpcy4kdGltZW91dCk7CiAgICB9OwogICAgCiAgICB0aGlzLmdldFZhbHVlID0gZnVuY3Rpb24oY2FsbGJhY2tJZCkgewogICAgICAgIHRoaXMuc2VuZGVyLmNhbGxiYWNrKHRoaXMuZG9jLmdldFZhbHVlKCksIGNhbGxiYWNrSWQpOwogICAgfTsKICAgIAogICAgdGhpcy5vblVwZGF0ZSA9IGZ1bmN0aW9uKCkgewogICAgfTsKICAgIAogICAgdGhpcy5pc1BlbmRpbmcgPSBmdW5jdGlvbigpIHsKICAgICAgICByZXR1cm4gdGhpcy5kZWZlcnJlZFVwZGF0ZS5pc1BlbmRpbmcoKTsKICAgIH07CiAgICAKfSkuY2FsbChNaXJyb3IucHJvdG90eXBlKTsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL21vZGUvanNvbi9qc29uX3BhcnNlIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKSB7CiJ1c2Ugc3RyaWN0IjsKCiAgICB2YXIgYXQsICAgICAvLyBUaGUgaW5kZXggb2YgdGhlIGN1cnJlbnQgY2hhcmFjdGVyCiAgICAgICAgY2gsICAgICAvLyBUaGUgY3VycmVudCBjaGFyYWN0ZXIKICAgICAgICBlc2NhcGVlID0gewogICAgICAgICAgICAnIic6ICAnIicsCiAgICAgICAgICAgICdcXCc6ICdcXCcsCiAgICAgICAgICAgICcvJzogICcvJywKICAgICAgICAgICAgYjogICAgJ1xiJywKICAgICAgICAgICAgZjogICAgJ1xmJywKICAgICAgICAgICAgbjogICAgJ1xuJywKICAgICAgICAgICAgcjogICAgJ1xyJywKICAgICAgICAgICAgdDogICAgJ1x0JwogICAgICAgIH0sCiAgICAgICAgdGV4dCwKCiAgICAgICAgZXJyb3IgPSBmdW5jdGlvbiAobSkgewoKICAgICAgICAgICAgdGhyb3cgewogICAgICAgICAgICAgICAgbmFtZTogICAgJ1N5bnRheEVycm9yJywKICAgICAgICAgICAgICAgIG1lc3NhZ2U6IG0sCiAgICAgICAgICAgICAgICBhdDogICAgICBhdCwKICAgICAgICAgICAgICAgIHRleHQ6ICAgIHRleHQKICAgICAgICAgICAgfTsKICAgICAgICB9LAoKICAgICAgICBuZXh0ID0gZnVuY3Rpb24gKGMpIHsKCiAgICAgICAgICAgIGlmIChjICYmIGMgIT09IGNoKSB7CiAgICAgICAgICAgICAgICBlcnJvcigiRXhwZWN0ZWQgJyIgKyBjICsgIicgaW5zdGVhZCBvZiAnIiArIGNoICsgIiciKTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgY2ggPSB0ZXh0LmNoYXJBdChhdCk7CiAgICAgICAgICAgIGF0ICs9IDE7CiAgICAgICAgICAgIHJldHVybiBjaDsKICAgICAgICB9LAoKICAgICAgICBudW1iZXIgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICB2YXIgbnVtYmVyLAogICAgICAgICAgICAgICAgc3RyaW5nID0gJyc7CgogICAgICAgICAgICBpZiAoY2ggPT09ICctJykgewogICAgICAgICAgICAgICAgc3RyaW5nID0gJy0nOwogICAgICAgICAgICAgICAgbmV4dCgnLScpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHdoaWxlIChjaCA+PSAnMCcgJiYgY2ggPD0gJzknKSB7CiAgICAgICAgICAgICAgICBzdHJpbmcgKz0gY2g7CiAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGNoID09PSAnLicpIHsKICAgICAgICAgICAgICAgIHN0cmluZyArPSAnLic7CiAgICAgICAgICAgICAgICB3aGlsZSAobmV4dCgpICYmIGNoID49ICcwJyAmJiBjaCA8PSAnOScpIHsKICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gY2g7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGNoID09PSAnZScgfHwgY2ggPT09ICdFJykgewogICAgICAgICAgICAgICAgc3RyaW5nICs9IGNoOwogICAgICAgICAgICAgICAgbmV4dCgpOwogICAgICAgICAgICAgICAgaWYgKGNoID09PSAnLScgfHwgY2ggPT09ICcrJykgewogICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB3aGlsZSAoY2ggPj0gJzAnICYmIGNoIDw9ICc5JykgewogICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgbnVtYmVyID0gK3N0cmluZzsKICAgICAgICAgICAgaWYgKGlzTmFOKG51bWJlcikpIHsKICAgICAgICAgICAgICAgIGVycm9yKCJCYWQgbnVtYmVyIik7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyOwogICAgICAgICAgICB9CiAgICAgICAgfSwKCiAgICAgICAgc3RyaW5nID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgdmFyIGhleCwKICAgICAgICAgICAgICAgIGksCiAgICAgICAgICAgICAgICBzdHJpbmcgPSAnJywKICAgICAgICAgICAgICAgIHVmZmZmOwoKICAgICAgICAgICAgaWYgKGNoID09PSAnIicpIHsKICAgICAgICAgICAgICAgIHdoaWxlIChuZXh0KCkpIHsKICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICciJykgewogICAgICAgICAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHJpbmc7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PT0gJ1xcJykgewogICAgICAgICAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ3UnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZmZmZiA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSArPSAxKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGV4ID0gcGFyc2VJbnQobmV4dCgpLCAxNik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0Zpbml0ZShoZXgpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZmZmZiA9IHVmZmZmICogMTYgKyBoZXg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gU3RyaW5nLmZyb21DaGFyQ29kZSh1ZmZmZik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIGVzY2FwZWVbY2hdID09PSAnc3RyaW5nJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IGVzY2FwZWVbY2hdOwogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09ICJcbiIgfHwgY2ggPT0gIlxyIikgewogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gY2g7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVycm9yKCJCYWQgc3RyaW5nIik7CiAgICAgICAgfSwKCiAgICAgICAgd2hpdGUgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICB3aGlsZSAoY2ggJiYgY2ggPD0gJyAnKSB7CiAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICB3b3JkID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgc3dpdGNoIChjaCkgewogICAgICAgICAgICBjYXNlICd0JzoKICAgICAgICAgICAgICAgIG5leHQoJ3QnKTsKICAgICAgICAgICAgICAgIG5leHQoJ3InKTsKICAgICAgICAgICAgICAgIG5leHQoJ3UnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2UnKTsKICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICBjYXNlICdmJzoKICAgICAgICAgICAgICAgIG5leHQoJ2YnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2EnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2wnKTsKICAgICAgICAgICAgICAgIG5leHQoJ3MnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2UnKTsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgY2FzZSAnbic6CiAgICAgICAgICAgICAgICBuZXh0KCduJyk7CiAgICAgICAgICAgICAgICBuZXh0KCd1Jyk7CiAgICAgICAgICAgICAgICBuZXh0KCdsJyk7CiAgICAgICAgICAgICAgICBuZXh0KCdsJyk7CiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgICAgfQogICAgICAgICAgICBlcnJvcigiVW5leHBlY3RlZCAnIiArIGNoICsgIiciKTsKICAgICAgICB9LAoKICAgICAgICB2YWx1ZSwgIC8vIFBsYWNlIGhvbGRlciBmb3IgdGhlIHZhbHVlIGZ1bmN0aW9uLgoKICAgICAgICBhcnJheSA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHZhciBhcnJheSA9IFtdOwoKICAgICAgICAgICAgaWYgKGNoID09PSAnWycpIHsKICAgICAgICAgICAgICAgIG5leHQoJ1snKTsKICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICddJykgewogICAgICAgICAgICAgICAgICAgIG5leHQoJ10nKTsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXJyYXk7ICAgLy8gZW1wdHkgYXJyYXkKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHdoaWxlIChjaCkgewogICAgICAgICAgICAgICAgICAgIGFycmF5LnB1c2godmFsdWUoKSk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICddJykgewogICAgICAgICAgICAgICAgICAgICAgICBuZXh0KCddJyk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnJheTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnLCcpOwogICAgICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZXJyb3IoIkJhZCBhcnJheSIpOwogICAgICAgIH0sCgogICAgICAgIG9iamVjdCA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHZhciBrZXksCiAgICAgICAgICAgICAgICBvYmplY3QgPSB7fTsKCiAgICAgICAgICAgIGlmIChjaCA9PT0gJ3snKSB7CiAgICAgICAgICAgICAgICBuZXh0KCd7Jyk7CiAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgaWYgKGNoID09PSAnfScpIHsKICAgICAgICAgICAgICAgICAgICBuZXh0KCd9Jyk7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9iamVjdDsgICAvLyBlbXB0eSBvYmplY3QKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHdoaWxlIChjaCkgewogICAgICAgICAgICAgICAgICAgIGtleSA9IHN0cmluZygpOwogICAgICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnOicpOwogICAgICAgICAgICAgICAgICAgIGlmIChPYmplY3QuaGFzT3duUHJvcGVydHkuY2FsbChvYmplY3QsIGtleSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3IoJ0R1cGxpY2F0ZSBrZXkgIicgKyBrZXkgKyAnIicpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBvYmplY3Rba2V5XSA9IHZhbHVlKCk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICd9JykgewogICAgICAgICAgICAgICAgICAgICAgICBuZXh0KCd9Jyk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvYmplY3Q7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIG5leHQoJywnKTsKICAgICAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVycm9yKCJCYWQgb2JqZWN0Iik7CiAgICAgICAgfTsKCiAgICB2YWx1ZSA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgd2hpdGUoKTsKICAgICAgICBzd2l0Y2ggKGNoKSB7CiAgICAgICAgY2FzZSAneyc6CiAgICAgICAgICAgIHJldHVybiBvYmplY3QoKTsKICAgICAgICBjYXNlICdbJzoKICAgICAgICAgICAgcmV0dXJuIGFycmF5KCk7CiAgICAgICAgY2FzZSAnIic6CiAgICAgICAgICAgIHJldHVybiBzdHJpbmcoKTsKICAgICAgICBjYXNlICctJzoKICAgICAgICAgICAgcmV0dXJuIG51bWJlcigpOwogICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgIHJldHVybiBjaCA+PSAnMCcgJiYgY2ggPD0gJzknID8gbnVtYmVyKCkgOiB3b3JkKCk7CiAgICAgICAgfQogICAgfTsKCiAgICByZXR1cm4gZnVuY3Rpb24gKHNvdXJjZSwgcmV2aXZlcikgewogICAgICAgIHZhciByZXN1bHQ7CgogICAgICAgIHRleHQgPSBzb3VyY2U7CiAgICAgICAgYXQgPSAwOwogICAgICAgIGNoID0gJyAnOwogICAgICAgIHJlc3VsdCA9IHZhbHVlKCk7CiAgICAgICAgd2hpdGUoKTsKICAgICAgICBpZiAoY2gpIHsKICAgICAgICAgICAgZXJyb3IoIlN5bnRheCBlcnJvciIpOwogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIHR5cGVvZiByZXZpdmVyID09PSAnZnVuY3Rpb24nID8gZnVuY3Rpb24gd2Fsayhob2xkZXIsIGtleSkgewogICAgICAgICAgICB2YXIgaywgdiwgdmFsdWUgPSBob2xkZXJba2V5XTsKICAgICAgICAgICAgaWYgKHZhbHVlICYmIHR5cGVvZiB2YWx1ZSA9PT0gJ29iamVjdCcpIHsKICAgICAgICAgICAgICAgIGZvciAoayBpbiB2YWx1ZSkgewogICAgICAgICAgICAgICAgICAgIGlmIChPYmplY3QuaGFzT3duUHJvcGVydHkuY2FsbCh2YWx1ZSwgaykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgdiA9IHdhbGsodmFsdWUsIGspOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAodiAhPT0gdW5kZWZpbmVkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZVtrXSA9IHY7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgdmFsdWVba107CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHJldml2ZXIuY2FsbChob2xkZXIsIGtleSwgdmFsdWUpOwogICAgICAgIH0oeycnOiByZXN1bHR9LCAnJykgOiByZXN1bHQ7CiAgICB9Owp9KTsKCmFjZS5kZWZpbmUoImFjZS9tb2RlL2pzb25fd29ya2VyIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKSB7CiJ1c2Ugc3RyaWN0IjsKCnZhciBvb3AgPSByZXF1aXJlKCIuLi9saWIvb29wIik7CnZhciBNaXJyb3IgPSByZXF1aXJlKCIuLi93b3JrZXIvbWlycm9yIikuTWlycm9yOwp2YXIgcGFyc2UgPSByZXF1aXJlKCIuL2pzb24vanNvbl9wYXJzZSIpOwoKdmFyIEpzb25Xb3JrZXIgPSBleHBvcnRzLkpzb25Xb3JrZXIgPSBmdW5jdGlvbihzZW5kZXIpIHsKICAgIE1pcnJvci5jYWxsKHRoaXMsIHNlbmRlcik7CiAgICB0aGlzLnNldFRpbWVvdXQoMjAwKTsKfTsKCm9vcC5pbmhlcml0cyhKc29uV29ya2VyLCBNaXJyb3IpOwoKKGZ1bmN0aW9uKCkgewoKICAgIHRoaXMub25VcGRhdGUgPSBmdW5jdGlvbigpIHsKICAgICAgICB2YXIgdmFsdWUgPSB0aGlzLmRvYy5nZXRWYWx1ZSgpOwogICAgICAgIHZhciBlcnJvcnMgPSBbXTsKICAgICAgICB0cnkgewogICAgICAgICAgICBpZiAodmFsdWUpCiAgICAgICAgICAgICAgICBwYXJzZSh2YWx1ZSk7CiAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICB2YXIgcG9zID0gdGhpcy5kb2MuaW5kZXhUb1Bvc2l0aW9uKGUuYXQtMSk7CiAgICAgICAgICAgIGVycm9ycy5wdXNoKHsKICAgICAgICAgICAgICAgIHJvdzogcG9zLnJvdywKICAgICAgICAgICAgICAgIGNvbHVtbjogcG9zLmNvbHVtbiwKICAgICAgICAgICAgICAgIHRleHQ6IGUubWVzc2FnZSwKICAgICAgICAgICAgICAgIHR5cGU6ICJlcnJvciIKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICAgIHRoaXMuc2VuZGVyLmVtaXQoImFubm90YXRlIiwgZXJyb3JzKTsKICAgIH07Cgp9KS5jYWxsKEpzb25Xb3JrZXIucHJvdG90eXBlKTsKCn0pOwo=";
}, 7907: function(le, m, D) {
D.d(m, { Iu: function() {
return N;
}, cC: function() {
return P;
}, m0: function() {
return Y;
} }), D(4987);
var U = { en: { array: "Array", auto: "Auto", appendText: "Append", appendTitle: "Append a new field with type 'auto' after this field (Ctrl+Shift+Ins)", appendSubmenuTitle: "Select the type of the field to be appended", appendTitleAuto: "Append a new field with type 'auto' (Ctrl+Shift+Ins)", ascending: "Ascending", ascendingTitle: "Sort the childs of this ${type} in ascending order", actionsMenu: "Click to open the actions menu (Ctrl+M)", cannotParseFieldError: "Cannot parse field into JSON", cannotParseValueError: "Cannot parse value into JSON", collapseAll: "Collapse all fields", compactTitle: "Compact JSON data, remove all whitespaces (Ctrl+Shift+I)", descending: "Descending", descendingTitle: "Sort the childs of this ${type} in descending order", drag: "Drag to move this field (Alt+Shift+Arrows)", duplicateKey: "duplicate key", duplicateText: "Duplicate", duplicateTitle: "Duplicate selected fields (Ctrl+D)", duplicateField: "Duplicate this field (Ctrl+D)", duplicateFieldError: "Duplicate field name", empty: "empty", expandAll: "Expand all fields", expandTitle: `Click to expand/collapse this field (Ctrl+E).
Ctrl+Click to expand/collapse including all childs.`, formatTitle: "Format JSON data, with proper indentation and line feeds (Ctrl+I)", insert: "Insert", insertTitle: "Insert a new field with type 'auto' before this field (Ctrl+Ins)", insertSub: "Select the type of the field to be inserted", object: "Object", ok: "Ok", redo: "Redo (Ctrl+Shift+Z)", removeText: "Remove", removeTitle: "Remove selected fields (Ctrl+Del)", removeField: "Remove this field (Ctrl+Del)", repairTitle: "Repair JSON: fix quotes and escape characters, remove comments and JSONP notation, turn JavaScript objects into JSON.", searchTitle: "Search fields and values", searchNextResultTitle: "Next result (Enter)", searchPreviousResultTitle: "Previous result (Shift + Enter)", selectNode: "Select a node...", showAll: "show all", showMore: "show more", showMoreStatus: "displaying ${visibleChilds} of ${totalChilds} items.", sort: "Sort", sortTitle: "Sort the childs of this ${type}", sortTitleShort: "Sort contents", sortFieldLabel: "Field:", sortDirectionLabel: "Direction:", sortFieldTitle: "Select the nested field by which to sort the array or object", sortAscending: "Ascending", sortAscendingTitle: "Sort the selected field in ascending order", sortDescending: "Descending", sortDescendingTitle: "Sort the selected field in descending order", string: "String", transform: "Transform", transformTitle: "Filter, sort, or transform the childs of this ${type}", transformTitleShort: "Filter, sort, or transform contents", extract: "Extract", extractTitle: "Extract this ${type}", transformQueryTitle: "Enter a JMESPath query", transformWizardLabel: "Wizard", transformWizardFilter: "Filter", transformWizardSortBy: "Sort by", transformWizardSelectFields: "Select fields", transformQueryLabel: "Query", transformPreviewLabel: "Preview", type: "Type", typeTitle: "Change the type of this field", openUrl: "Ctrl+Click or Ctrl+Enter to open url in new window", undo: "Undo last action (Ctrl+Z)", validationCannotMove: "Cannot move a field into a child of itself", autoType: 'Field type "auto". The field type is automatically determined from the value and can be a string, number, boolean, or null.', objectType: 'Field type "object". An object contains an unordered set of key/value pairs.', arrayType: 'Field type "array". An array contains an ordered collection of values.', stringType: 'Field type "string". Field type is not determined from the value, but always returned as string.', modeEditorTitle: "Switch Editor Mode", modeCodeText: "Code", modeCodeTitle: "Switch to code highlighter", modeFormText: "Form", modeFormTitle: "Switch to form editor", modeTextText: "Text", modeTextTitle: "Switch to plain text editor", modeTreeText: "Tree", modeTreeTitle: "Switch to tree editor", modeViewText: "View", modeViewTitle: "Switch to tree view", modePreviewText: "Preview", modePreviewTitle: "Switch to preview mode", examples: "Examples", default: "Default", containsInvalidProperties: "Contains invalid properties", containsInvalidItems: "Contains invalid items" }, es: { array: "Matriz", auto: "Auto", appendText: "Agregar", appendTitle: "Agregue un nuevo campo con el tipo 'auto' después de este campo (Ctrl + Shift + Ins)", appendSubmenuTitle: "Seleccione el tipo de campo que se agregará", appendTitleAuto: "Agregue un nuevo campo con el tipo 'auto' (Ctrl + Shift + Ins)", ascending: "Ascendente", ascendingTitle: "Ordene los elementos secundarios de este ${type} en orden ascendente", actionsMenu: "Haga clic para abrir el menú de acciones (Ctrl + M)", cannotParseFieldError: "No se puede parsear el campo en JSON", cannotParseValueError: "No se puede parsear el valor en JSON", collapseAll: "Contraer todos los campos", compactTitle: "Compactar datos JSON, eliminar todos los espacios en blanco (Ctrl + Shift + I)", descending: "Descendente", descendingTitle: "Ordene los hijos de este ${type} en orden descendente", drag: "Arrastre para mover este campo (Alt + Mayús + Flechas)", duplicateKey: "llave duplicada", duplicateText: "Duplicar", duplicateTitle: "Duplicar campos seleccionados (Ctrl + D)", duplicateField: "Duplicar este campo (Ctrl + D)", duplicateFieldError: "Nombre de campo duplicado", empty: "vacio", expandAll: "Expandir todos los campos", expandTitle: `Haga clic para expandir/contraer este campo (Ctrl + E).
Ctrl+Clic para expandir/contraer incluyendo todos los niños.`, formatTitle: "Formatee los datos JSON, con la sangría y los avances de línea adecuados (Ctrl + I)", insert: "Insertar", insertTitle: "Inserte un nuevo campo con el tipo 'auto' antes de este campo (Ctrl + Ins)", insertSub: "Seleccione el tipo de campo a insertar", object: "Objeto", ok: "Ok", redo: "Rehacer (Ctrl+Mayús+Z)", removeText: "Eliminar", removeTitle: "Eliminar campos seleccionados (Ctrl+Supr)", removeField: "Eliminar este campo (Ctrl+Supr)", repairTitle: "Reparar JSON: corrija comillas y caracteres de escape, elimine comentarios y notación JSONP, convierta objetos JavaScript en JSON.", searchTitle: "Campos de búsqueda y valores", searchNextResultTitle: "Siguiente resultado (Entrar)", searchPreviousResultTitle: "Resultado anterior (Shift + Enter)", selectNode: "Seleccione un nodo...", showAll: "mostrar todo", showMore: "mostrar más", showMoreStatus: "mostrando ${visibleChilds} de ${totalChilds} elementos.", sort: "Ordenar", sortTitle: "Ordene los hijos de este ${type}", sortTitleShort: "Ordenar contenidos", sortFieldLabel: "Campo:", sortDirectionLabel: "Dirección:", sortFieldTitle: "Seleccione el campo anidado por el cual ordenar la matriz u objeto", sortAscending: "Ascendente", sortAscendingTitle: "Ordenar el campo seleccionado en orden ascendente", sortDescending: "Descendente", sortDescendingTitle: "Ordenar por el campo seleccionado, en orden descendente", string: "Texto", transform: "Transformar", transformTitle: "Filtrar, ordenar o transformar los hijos de este ${type}", transformTitleShort: "Filtrar, ordenar o transformar contenidos", extract: "Extraer", extractTitle: "Extrae este ${type}", transformQueryTitle: "Ingrese una consulta JMESPath", transformWizardLabel: "Wizard", transformWizardFilter: "Filtro", transformWizardSortBy: "Ordenar por", transformWizardSelectFields: "Seleccione un campo", transformQueryLabel: "Consulta", transformPreviewLabel: "Vista Previa", type: "Tipo", typeTitle: "Cambiar el tipo de campo", openUrl: "Ctrl+Click o Ctrl+Enter para abrir la URL en una nueva ventana", undo: "Deshacer la última acción (Ctrl+Z)", validationCannotMove: "No se puede mover un campo a un hijo de sí mismo.", autoType: 'Field type "auto". The field type is automatically determined from the value and can be a string, number, boolean, or null.', objectType: 'Tipo de campo "objeto". Un objeto contiene un conjunto desordenado de pares clave/valor.', arrayType: 'Tipo de campo "matriz". Una matriz contiene una colección ordenada de valores.', stringType: 'Tipo de campo "cadena". El tipo de campo no se determina a partir del valor, pero siempre se devuelve como una cadena.', modeEditorTitle: "Cambiar modo de editor", modeCodeText: "Codigo", modeCodeTitle: "Cambiar al resaltador de código", modeFormText: "Formulario", modeFormTitle: "Cambiar al editor de formularios", modeTextText: "Texto", modeTextTitle: "Cambiar al editor de texto sin formato", modeTreeText: "Arbol", modeTreeTitle: "Cambiar al editor de árbol", modeViewText: "Vista", modeViewTitle: "Cambiar a la vista de árbol", modePreviewText: "Vista Previa", modePreviewTitle: "Cambiar al modo de vista previa", examples: "Ejemplos", default: "Predeterminado", containsInvalidProperties: "Contiene propiedades no validas", containsInvalidItems: "Contiene items no validos" }, "zh-CN": { array: "数组", auto: "自动", appendText: "追加", appendTitle: "在此字段后追加一个类型为“auto”的新字段 (Ctrl+Shift+Ins)", appendSubmenuTitle: "选择要追加的字段类型", appendTitleAuto: "追加类型为“auto”的新字段 (Ctrl+Shift+Ins)", ascending: "升序", ascendingTitle: "升序排列${type}的子节点", actionsMenu: "点击打开动作菜单(Ctrl+M)", cannotParseFieldError: "无法将字段解析为JSON", cannotParseValueError: "无法将值解析为JSON", collapseAll: "缩进所有字段", compactTitle: "压缩JSON数据,删除所有空格 (Ctrl+Shift+I)", descending: "降序", descendingTitle: "降序排列${type}的子节点", drag: "拖拽移动该节点(Alt+Shift+Arrows)", duplicateKey: "重复键", duplicateText: "复制", duplicateTitle: "复制选中字段(Ctrl+D)", duplicateField: "复制该字段(Ctrl+D)", duplicateFieldError: "重复的字段名称", empty: "清空", expandAll: "展开所有字段", expandTitle: `点击 展开/收缩 该字段(Ctrl+E).
Ctrl+Click 展开/收缩 包含所有子节点.`, formatTitle: "使用适当的缩进和换行符格式化JSON数据 (Ctrl+I)", insert: "插入", insertTitle: "在此字段前插入类型为“auto”的新字段 (Ctrl+Ins)", insertSub: "选择要插入的字段类型", object: "对象", ok: "Ok", redo: "重做 (Ctrl+Shift+Z)", removeText: "移除", removeTitle: "移除选中字段 (Ctrl+Del)", removeField: "移除该字段 (Ctrl+Del)", repairTitle: "修复JSON:修复引号和转义符,删除注释和JSONP表示法,将JavaScript对象转换为JSON。", selectNode: "选择一个节点...", showAll: "展示全部", showMore: "展示更多", showMoreStatus: "显示${totalChilds}的${visibleChilds}项目.", sort: "排序", sortTitle: "排序${type}的子节点", sortTitleShort: "内容排序", sortFieldLabel: "字段:", sortDirectionLabel: "方向:", sortFieldTitle: "选择用于对数组或对象排序的嵌套字段", sortAscending: "升序排序", sortAscendingTitle: "按照该字段升序排序", sortDescending: "降序排序", sortDescendingTitle: "按照该字段降序排序", string: "字符串", transform: "变换", transformTitle: "筛选,排序,或者转换${type}的子节点", transformTitleShort: "筛选,排序,或者转换内容", extract: "提取", extractTitle: "提取这个 ${type}", transformQueryTitle: "输入JMESPath查询", transformWizardLabel: "向导", transformWizardFilter: "筛选", transformWizardSortBy: "排序", transformWizardSelectFields: "选择字段", transformQueryLabel: "查询", transformPreviewLabel: "预览", type: "类型", typeTitle: "更改字段类型", openUrl: "Ctrl+Click 或者 Ctrl+Enter 在新窗口打开链接", undo: "撤销上次动作 (Ctrl+Z)", validationCannotMove: "无法将字段移入其子节点", autoType: '字段类型 "auto". 字段类型由值自动确定 可以为 string,number,boolean,或者 null.', objectType: '字段类型 "object". 对象包含一组无序的键/值对.', arrayType: '字段类型 "array". 数组包含值的有序集合.', stringType: '字段类型 "string". 字段类型由值自动确定,但始终作为字符串返回.', modeCodeText: "代码", modeCodeTitle: "切换至代码高亮", modeFormText: "表单", modeFormTitle: "切换至表单编辑", modeTextText: "文本", modeTextTitle: "切换至文本编辑", modeTreeText: "树", modeTreeTitle: "切换至树编辑", modeViewText: "视图", modeViewTitle: "切换至树视图", modePreviewText: "预览", modePreviewTitle: "切换至预览模式", examples: "例子", default: "缺省", containsInvalidProperties: "包含无效的属性", containsInvalidItems: "包含无效项目" }, "pt-BR": { array: "Lista", auto: "Automatico", appendText: "Adicionar", appendTitle: "Adicionar novo campo com tipo 'auto' depois deste campo (Ctrl+Shift+Ins)", appendSubmenuTitle: "Selecione o tipo do campo a ser adicionado", appendTitleAuto: "Adicionar novo campo com tipo 'auto' (Ctrl+Shift+Ins)", ascending: "Ascendente", ascendingTitle: "Organizar filhor do tipo ${type} em crescente", actionsMenu: "Clique para abrir o menu de ações (Ctrl+M)", cannotParseFieldError: "Não é possível analisar o campo no JSON", cannotParseValueError: "Não é possível analisar o valor em JSON", collapseAll: "Fechar todos campos", compactTitle: "Dados JSON compactos, remova todos os espaços em branco (Ctrl+Shift+I)", descending: "Descendente", descendingTitle: "Organizar o filhos do tipo ${type} em decrescente", duplicateKey: "chave duplicada", drag: "Arraste para mover este campo (Alt+Shift+Arrows)", duplicateText: "Duplicar", duplicateTitle: "Duplicar campos selecionados (Ctrl+D)", duplicateField: "Duplicar este campo (Ctrl+D)", duplicateFieldError: "Nome do campo duplicado", empty: "vazio", expandAll: "Expandir todos campos", expandTitle: `Clique para expandir/encolher este campo (Ctrl+E).
Ctrl+Click para expandir/encolher incluindo todos os filhos.`, formatTitle: "Formate dados JSON, com recuo e feeds de linha adequados (Ctrl+I)", insert: "Inserir", insertTitle: "Inserir um novo campo do tipo 'auto' antes deste campo (Ctrl+Ins)", insertSub: "Selecionar o tipo de campo a ser inserido", object: "Objeto", ok: "Ok", redo: "Refazer (Ctrl+Shift+Z)", removeText: "Remover", removeTitle: "Remover campos selecionados (Ctrl+Del)", removeField: "Remover este campo (Ctrl+Del)", repairTitle: "Repare JSON: corrija aspas e caracteres de escape, remova comentários e notação JSONP, transforme objetos JavaScript em JSON.", selectNode: "Selecione um nódulo...", showAll: "mostrar todos", showMore: "mostrar mais", showMoreStatus: "exibindo ${visibleChilds} de ${totalChilds} itens.", sort: "Organizar", sortTitle: "Organizar os filhos deste ${type}", sortTitleShort: "Organizar os filhos", sortFieldLabel: "Campo:", sortDirectionLabel: "Direção:", sortFieldTitle: "Selecione um campo filho pelo qual ordenar o array ou objeto", sortAscending: "Ascendente", sortAscendingTitle: "Ordenar o campo selecionado por ordem ascendente", sortDescending: "Descendente", sortDescendingTitle: "Ordenar o campo selecionado por ordem descendente", string: "Texto", transform: "Transformar", transformTitle: "Filtrar, ordenar ou transformar os filhos deste ${type}", transformTitleShort: "Filtrar, ordenar ou transformar conteúdos", transformQueryTitle: "Insira uma expressão JMESPath", transformWizardLabel: "Assistente", transformWizardFilter: "Filtro", transformWizardSortBy: "Ordenar por", transformWizardSelectFields: "Selecionar campos", transformQueryLabel: "Expressão", transformPreviewLabel: "Visualizar", type: "Tipo", typeTitle: "Mudar o tipo deste campo", openUrl: "Ctrl+Click ou Ctrl+Enter para abrir link em nova janela", undo: "Desfazer último ação (Ctrl+Z)", validationCannotMove: "Não pode mover um campo como filho dele mesmo", autoType: 'Campo do tipo "auto". O tipo do campo é determinao automaticamente a partir do seu valor e pode ser texto, número, verdade/falso ou nulo.', objectType: 'Campo do tipo "objeto". Um objeto contém uma lista de pares com chave e valor.', arrayType: 'Campo do tipo "lista". Uma lista contem uma coleção de valores ordenados.', stringType: 'Campo do tipo "string". Campo do tipo nao é determinado através do seu valor, mas sempre retornara um texto.', examples: "Exemplos", default: "Revelia", containsInvalidProperties: "Contém propriedades inválidas", containsInvalidItems: "Contém itens inválidos" }, tr: { array: "Dizin", auto: "Otomatik", appendText: "Ekle", appendTitle: "Bu alanın altına 'otomatik' tipinde yeni bir alan ekle (Ctrl+Shift+Ins)", appendSubmenuTitle: "Eklenecek alanın tipini seç", appendTitleAuto: "'Otomatik' tipinde yeni bir alan ekle (Ctrl+Shift+Ins)", ascending: "Artan", ascendingTitle: "${type}'ın alt tiplerini artan düzende sırala", actionsMenu: "Aksiyon menüsünü açmak için tıklayın (Ctrl+M)", collapseAll: "Tüm alanları kapat", descending: "Azalan", descendingTitle: "${type}'ın alt tiplerini azalan düzende sırala", drag: "Bu alanı taşımak için sürükleyin (Alt+Shift+Arrows)", duplicateKey: "Var olan anahtar", duplicateText: "Aşağıya kopyala", duplicateTitle: "Seçili alanlardan bir daha oluştur (Ctrl+D)", duplicateField: "Bu alandan bir daha oluştur (Ctrl+D)", duplicateFieldError: "Duplicate field name", cannotParseFieldError: "Alan JSON'a ayrıştırılamıyor", cannotParseValueError: "JSON'a değer ayrıştırılamıyor", empty: "boş", expandAll: "Tüm alanları aç", expandTitle: `Bu alanı açmak/kapatmak için tıkla (Ctrl+E).
Alt alanlarda dahil tüm alanları açmak için Ctrl+Click `, insert: "Ekle", insertTitle: "Bu alanın üstüne 'otomatik' tipinde yeni bir alan ekle (Ctrl+Ins)", insertSub: "Araya eklenecek alanın tipini seç", object: "Nesne", ok: "Tamam", redo: "Yeniden yap (Ctrl+Shift+Z)", removeText: "Kaldır", removeTitle: "Seçilen alanları kaldır (Ctrl+Del)", removeField: "Bu alanı kaldır (Ctrl+Del)", selectNode: "Bir nesne seç...", showAll: "tümünü göster", showMore: "daha fazla göster", showMoreStatus: "${totalChilds} alanın ${visibleChilds} alt alanları gösteriliyor", sort: "Sırala", sortTitle: "${type}'ın alt alanlarını sırala", sortTitleShort: "İçerikleri sırala", sortFieldLabel: "Alan:", sortDirectionLabel: "Yön:", sortFieldTitle: "Diziyi veya nesneyi sıralamak için iç içe geçmiş alanı seçin", sortAscending: "Artan", sortAscendingTitle: "Seçili alanı artan düzende sırala", sortDescending: "Azalan", sortDescendingTitle: "Seçili alanı azalan düzende sırala", string: "Karakter Dizisi", transform: "Dönüştür", transformTitle: "${type}'ın alt alanlarını filtrele, sırala veya dönüştür", transformTitleShort: "İçerikleri filterele, sırala veya dönüştür", transformQueryTitle: "JMESPath sorgusu gir", transformWizardLabel: "Sihirbaz", transformWizardFilter: "Filtre", transformWizardSortBy: "Sırala", transformWizardSelectFields: "Alanları seç", transformQueryLabel: "Sorgu", transformPreviewLabel: "Önizleme", type: "Tip", typeTitle: "Bu alanın tipini değiştir", openUrl: "URL'i yeni bir pencerede açmak için Ctrl+Click veya Ctrl+Enter", undo: "Son değişikliği geri al (Ctrl+Z)", validationCannotMove: "Alt alan olarak taşınamıyor", autoType: 'Alan tipi "otomatik". Alan türü otomatik olarak değerden belirlenirve bir dize, sayı, boolean veya null olabilir.', objectType: 'Alan tipi "nesne". Bir nesne, sıralanmamış bir anahtar / değer çifti kümesi içerir.', arrayType: 'Alan tipi "dizi". Bir dizi, düzenli değerler koleksiyonu içerir.', stringType: 'Alan tipi "karakter dizisi". Alan türü değerden belirlenmez,ancak her zaman karakter dizisi olarak döndürülür.', modeCodeText: "Kod", modeCodeTitle: "Kod vurgulayıcıya geç", modeFormText: "Form", modeFormTitle: "Form düzenleyiciye geç", modeTextText: "Metin", modeTextTitle: "Düz metin düzenleyiciye geç", modeTreeText: "Ağaç", modeTreeTitle: "Ağaç düzenleyiciye geç", modeViewText: "Görünüm", modeViewTitle: "Ağaç görünümüne geç", examples: "Örnekler", default: "Varsayılan", containsInvalidProperties: "Geçersiz özellikler içeriyor", containsInvalidItems: "Geçersiz öğeler içeriyor" }, ja: { array: "配列", auto: "オート", appendText: "追加", appendTitle: '次のフィールドに"オート"のフィールドを追加 (Ctrl+Shift+Ins)', appendSubmenuTitle: "追加するフィールドの型を選択してください", appendTitleAuto: '"オート"のフィールドを追加 (Ctrl+Shift+Ins)', ascending: "昇順", ascendingTitle: "${type}の子要素を昇順に並べ替え", actionsMenu: "クリックしてアクションメニューを開く (Ctrl+M)", collapseAll: "すべてを折りたたむ", descending: "降順", descendingTitle: "${type}の子要素を降順に並べ替え", drag: "ドラッグして選択中のフィールドを移動 (Alt+Shift+Arrows)", duplicateKey: "複製キー", duplicateText: "複製", duplicateTitle: "選択中のフィールドを複製 (Ctrl+D)", duplicateField: "選択中のフィールドを複製 (Ctrl+D)", duplicateFieldError: "フィールド名が重複しています", cannotParseFieldError: "JSONのフィールドを解析できません", cannotParseValueError: "JSONの値を解析できません", empty: "空", expandAll: "すべてを展開", expandTitle: `クリックしてフィールドを展開/折りたたむ (Ctrl+E).
Ctrl+Click ですべての子要素を展開/折りたたむ`, insert: "挿入", insertTitle: "選択中のフィールドの前に新しいフィールドを挿入 (Ctrl+Ins)", insertSub: "挿入するフィールドの型を選択", object: "オブジェクト", ok: "実行", redo: "やり直す (Ctrl+Shift+Z)", removeText: "削除", removeTitle: "選択中のフィールドを削除 (Ctrl+Del)", removeField: "選択中のフィールドを削除 (Ctrl+Del)", selectNode: "ノードを選択...", showAll: "すべてを表示", showMore: "もっと見る", showMoreStatus: "${totalChilds}個のアイテムのうち ${visibleChilds}個を表示しています。", sort: "並べ替え", sortTitle: "${type}の子要素を並べ替え", sortTitleShort: "並べ替え", sortFieldLabel: "フィールド:", sortDirectionLabel: "順序:", sortFieldTitle: "配列またはオブジェクトを並び替えるためのフィールドを選択", sortAscending: "昇順", sortAscendingTitle: "選択中のフィールドを昇順に並び替え", sortDescending: "降順", sortDescendingTitle: "選択中のフィールドを降順に並び替え", string: "文字列", transform: "変換", transformTitle: "${type}の子要素をフィルター・並び替え・変換する", transformTitleShort: "内容をフィルター・並び替え・変換する", extract: "抽出", extractTitle: "${type}を抽出", transformQueryTitle: "JMESPathクエリを入力", transformWizardLabel: "ウィザード", transformWizardFilter: "フィルター", transformWizardSortBy: "並び替え", transformWizardSelectFields: "フィールドを選択", transformQueryLabel: "クエリ", transformPreviewLabel: "プレビュー", type: "型", typeTitle: "選択中のフィールドの型を変更", openUrl: "Ctrl+Click または Ctrl+Enter で 新規ウィンドウでURLを開く", undo: "元に戻す (Ctrl+Z)", validationCannotMove: "子要素に移動できません ", autoType: "オート: フィールドの型は値から自動的に決定されます。 (文字列・数値・ブール・null)", objectType: "オブジェクト: オブジェクトは順序が決まっていないキーと値のペア組み合わせです。", arrayType: "配列: 配列は順序が決まっている値の集合体です。", stringType: "文字列: フィールド型は値から決定されませんが、常に文字列として返されます。", modeCodeText: "コードモード", modeCodeTitle: "ハイライトモードに切り替え", modeFormText: "フォームモード", modeFormTitle: "フォームモードに切り替え", modeTextText: "テキストモード", modeTextTitle: "テキストモードに切り替え", modeTreeText: "ツリーモード", modeTreeTitle: "ツリーモードに切り替え", modeViewText: "ビューモード", modeViewTitle: "ビューモードに切り替え", modePreviewText: "プレビュー", modePreviewTitle: "プレビューに切り替え", examples: "例", default: "デフォルト", containsInvalidProperties: "無効なプロパティが含まれています", containsInvalidItems: "無効なアイテムが含まれています" }, "fr-FR": { array: "Liste", auto: "Auto", appendText: "Ajouter", appendTitle: "Ajouter un champ de type 'auto' après ce champ (Ctrl+Shift+Ins)", appendSubmenuTitle: "Sélectionner le type du champ à ajouter", appendTitleAuto: "Ajouter un champ de type 'auto' (Ctrl+Shift+Ins)", ascending: "Ascendant", ascendingTitle: "Trier les enfants de ce ${type} par ordre ascendant", actionsMenu: "Ouvrir le menu des actions (Ctrl+M)", collapseAll: "Regrouper", descending: "Descendant", descendingTitle: "Trier les enfants de ce ${type} par ordre descendant", drag: "Déplacer (Alt+Shift+Arrows)", duplicateKey: "Dupliquer la clé", duplicateText: "Dupliquer", duplicateTitle: "Dupliquer les champs sélectionnés (Ctrl+D)", duplicateField: "Dupliquer ce champ (Ctrl+D)", duplicateFieldError: "Dupliquer le nom de champ", cannotParseFieldError: "Champ impossible à parser en JSON", cannotParseValueError: "Valeur impossible à parser en JSON", empty: "vide", expandAll: "Étendre", expandTitle: `Étendre/regrouper ce champ (Ctrl+E).
Ctrl+Click pour étendre/regrouper avec tous les champs.`, insert: "Insérer", insertTitle: "Insérer un champ de type 'auto' avant ce champ (Ctrl+Ins)", insertSub: "Sélectionner le type de champ à insérer", object: "Objet", ok: "Ok", redo: "Rejouer (Ctrl+Shift+Z)", removeText: "Supprimer", removeTitle: "Supprimer les champs sélectionnés (Ctrl+Del)", removeField: "Supprimer ce champ (Ctrl+Del)", searchTitle: "Rechercher champs et valeurs", searchNextResultTitle: "Résultat suivant (Enter)", searchPreviousResultTitle: "Résultat précédent (Shift + Enter)", selectNode: "Sélectionner un nœud...", showAll: "voir tout", showMore: "voir plus", showMoreStatus: "${visibleChilds} éléments affichés de ${totalChilds}.", sort: "Trier", sortTitle: "Trier les champs de ce ${type}", sortTitleShort: "Trier", sortFieldLabel: "Champ:", sortDirectionLabel: "Direction:", sortFieldTitle: "Sélectionner les champs permettant de trier les listes et objet", sortAscending: "Ascendant", sortAscendingTitle: "Trier les champs sélectionnés par ordre ascendant", sortDescending: "Descendant", sortDescendingTitle: "Trier les champs sélectionnés par ordre descendant", string: "Chaîne", transform: "Transformer", transformTitle: "Filtrer, trier, or transformer les enfants de ce ${type}", transformTitleShort: "Filtrer, trier ou transformer le contenu", extract: "Extraire", extractTitle: "Extraire ce ${type}", transformQueryTitle: "Saisir une requête JMESPath", transformWizardLabel: "Assistant", transformWizardFilter: "Filtrer", transformWizardSortBy: "Trier par", transformWizardSelectFields: "Sélectionner les champs", transformQueryLabel: "Requête", transformPreviewLabel: "Prévisualisation", type: "Type", typeTitle: "Changer le type de ce champ", openUrl: "Ctrl+Click ou Ctrl+Enter pour ouvrir l'url dans une autre fenêtre", undo: "Annuler la dernière action (Ctrl+Z)", validationCannotMove: "Cannot move a field into a child of itself", autoType: 'Champe de type "auto". Ce type de champ est automatiquement déterminé en fonction de la valeur et peut être de type "chaîne", "nombre", "booléen" ou null.', objectType: 'Champ de type "objet". Un objet contient un ensemble non ordonné de paires clé/valeur.', arrayType: 'Champ de type "liste". Une liste contient une collection ordonnée de valeurs.', stringType: `Champ de type "chaîne". Ce type de champ n'est pas déterminé en fonction de la valeur, mais retourne systématiquement une chaîne de caractères.`, modeEditorTitle: "Changer mode d'édition", modeCodeText: "Code", modeCodeTitle: "Activer surlignage code", modeFormText: "Formulaire", modeFormTitle: "Activer formulaire", modeTextText: "Texte", modeTextTitle: "Activer éditeur texte", modeTreeText: "Arbre", modeTreeTitle: "Activer éditeur arbre", modeViewText: "Lecture seule", modeViewTitle: "Activer vue arbre", modePreviewText: "Prévisualisation", modePreviewTitle: "Activer mode prévisualiser", examples: "Exemples", default: "Défaut", containsInvalidProperties: "Contient des propriétés non valides", containsInvalidItems: "Contient des éléments invalides" }, de: { array: "Auflistung", auto: "Auto", appendText: "anhängen", appendTitle: "Fügen Sie nach diesem Feld ein neues Feld mit dem Typ 'auto' ein (Strg+Umschalt+Ein)", appendSubmenuTitle: "Wählen Sie den Typ des neuen Feldes", appendTitleAuto: "Ein neues Feld vom Typ 'auto' hinzufügen (Strg+Umschalt+Ein)", ascending: "Aufsteigend", ascendingTitle: "Sortieren Sie die Elemente dieses ${type} in aufsteigender Reihenfolge", actionsMenu: "Klicken Sie zum Öffnen des Aktionsmenüs (Strg+M)", cannotParseFieldError: "Feld kann nicht in JSON geparst werden", cannotParseValueError: "Wert kann nicht in JSON geparst werden", collapseAll: "Alle Felder zuklappen", compactTitle: "JSON-Daten verdichten, alle Leerzeichen entfernen (Strg+Umschalt+\\)", descending: "Absteigend", descendingTitle: "Sortieren Sie die Elemente dieses ${type} in absteigender Reihenfolge", drag: "Ziehen, um dieses Feld zu verschieben (Alt+Umschalt+Pfeile)", duplicateKey: "Doppelter Schlüssel", duplicateText: "Duplikat", duplicateTitle: "Ausgewählte Felder duplizieren (Strg+D)", duplicateField: "Dieses Feld duplizieren (Strg+D)", duplicateFieldError: "Doppelter Feldname", empty: "leer", expandAll: "Alle Felder anzeigen", expandTitle: `Klicken Sie, um dieses Feld zu erweitern/zu kollabieren (Strg+E).
Strg+Klicken Sie, um dieses Feld einschließlich aller Elemente zu erweitern/zu kollabieren.`, formatTitle: "JSON-Daten mit korrekter Einrückung und Zeilenvorschüben formatieren (Strg+\\)", insert: "einfügen", insertTitle: "Fügen Sie vor diesem Feld ein neues Feld mit dem Typ 'auto' ein (Strg+Einfg)", insertSub: "Wählen Sie den Typ des neuen Feldes", object: "Objekt", ok: "Ok", redo: "Wiederholen (Strg+Umschalt+Z)", removeText: "entfernen", removeTitle: "Ausgewählte Felder entfernen (Strg+Entf)", removeField: "Dieses Feld entfernen (Strg+Entf)", repairTitle: "JSON reparieren: Anführungszeichen und Escape-Zeichen korrigieren, Kommentare und JSONP-Notation entfernen, JavaScript-Objekte in JSON umwandeln.", searchTitle: "Suchfelder und Werte", searchNextResultTitle: "Nächstes Ergebnis (Enter)", searchPreviousResultTitle: "Vorheriges Ergebnis (Umschalt + Eingabe)", selectNode: "Wählen Sie einen Knoten aus...", showAll: "alle anzeigen", showMore: "mehr anzeigen", showMoreStatus: "Anzeige von ${visibleChilds} von ${totalChilds}-Elementen.", sort: "Sortieren", sortTitle: "Sortieren Sie die Elemente dieses ${type}", sortTitleShort: "Inhalt sortieren", sortFieldLabel: "Feld:", sortDirectionLabel: "Richtung:", sortFieldTitle: "Wählen Sie das verschachtelte Feld, nach dem das Array oder Objekt sortiert werden soll.", sortAscending: "Aufsteigend", sortAscendingTitle: "Sortieren Sie das ausgewählte Feld in aufsteigender Reihenfolge", sortDescending: "Absteigend", sortDescendingTitle: "Sortieren Sie das ausgewählte Feld in absteigender Reihenfolge", string: "Zeichenfolge", transform: "Verwandeln", transformTitle: "Die Elemente dieses ${type} filtern, sortieren oder transformieren", transformTitleShort: "Inhalte filtern, sortieren oder transformieren", extract: "Auszug", extractTitle: "Extrahieren Sie diesen ${type}", transformQueryTitle: "Eine JMESPath-Abfrage eingeben", transformWizardLabel: "Zauberer", transformWizardFilter: "Filter", transformWizardSortBy: "Sortieren nach", transformWizardSelectFields: "Felder auswählen", transformQueryLabel: "Anfrage", transformPreviewLabel: "Vorschau", type: "Geben Sie ein.", typeTitle: "Ändern Sie den Typ dieses Feldes", openUrl: "Strg+Klicken oder Strg+Eingabe, um die URL in einem neuen Fenster zu öffnen", undo: "Letzte Aktion rückgängig machen (Strg+Z)", validationCannotMove: "Kann ein Feld nicht in ein Kind seiner selbst verschieben", autoType: 'Feldtyp "auto". Der Feldtyp wird automatisch aus dem Wert bestimmt und kann ein String, eine Zahl, boolesch oder null sein.', objectType: 'Feldtyp "Objekt". Ein Objekt enthält eine ungeordnete Menge von Schlüssel/Wert-Paaren.', arrayType: 'Feldtyp "Array". Ein Array enthält eine geordnete Sammlung von Werten.', stringType: 'Feldtyp "Zeichenfolge". Der Feldtyp wird nicht aus dem Wert bestimmt, sondern immer als Zeichenfolge zurückgegeben.', modeEditorTitle: "Editor-Modus umschalten", modeCodeText: "Code", modeCodeTitle: "Umschalten auf Code-Highlighter", modeFormText: "Formular", modeFormTitle: "Zum Formular-Editor wechseln", modeTextText: "Text", modeTextTitle: "Zum Editor für einfachen Text wechseln", modeTreeText: "Baum", modeTreeTitle: "Zum Baum-Editor wechseln", modeViewText: "Siehe", modeViewTitle: "Zur Baumansicht wechseln", modePreviewText: "Vorschau", modePreviewTitle: "In den Vorschau-Modus wechseln", examples: "Beispiele", default: "Standardmäßig", containsInvalidProperties: "Enthält ungültige Eigenschaften", containsInvalidItems: "Enthält ungültige Elemente" }, ru: { array: "Массив", auto: "Авто", appendText: "Добавить", appendTitle: "Добавить новое поле с типом 'авто' после этого поля (Ctrl+Shift+Ins)", appendSubmenuTitle: "Выбрать тип поля для добавления", appendTitleAuto: "Добавить новое поле с типом 'авто' (Ctrl+Shift+Ins)", ascending: "По возрастанию", ascendingTitle: "Сортировать ${type} по возрастанию", actionsMenu: "Нажмите для открытия меню действий (Ctrl+M)", cannotParseFieldError: "Невозможно преобразовать поле в JSON", cannotParseValueError: "Невозможно преобразовать значение в JSON", collapseAll: "Свернуть все", compactTitle: "Минификация JSON (Ctrl+Shift+I)", descending: "По убыванию", descendingTitle: "Сортировать ${type} по убыванию", drag: "Потяните для перемещения этого поля (Alt+Shift+Arrows)", duplicateKey: "повторяющийся ключ", duplicateText: "Дублировать", duplicateTitle: "Дублирование полей (Ctrl+D)", duplicateField: "Дублировать поле (Ctrl+D)", duplicateFieldError: "Дублирование названия поля", empty: "пустой", expandAll: "Развернуть все", expandTitle: `Нажмите для раскрытия/скрытия поля (Ctrl+E)
или Ctrl+Click для раскрытия/скрытия всех потомков.`, formatTitle: "Форматирование JSON (Ctrl+I)", insert: "Вставить", insertTitle: "Вставить новое поле с типом 'авто' перед этим полем (Ctrl+Ins)", insertSub: "Выбрать тип поля для вставки", object: "Объект", ok: "ОК", redo: "Повторить (Ctrl+Shift+Z)", removeText: "Удалить", removeTitle: "Удалить выбранные поля (Ctrl+Del)", removeField: "Удалить поле (Ctrl+Del)", repairTitle: "Восстановите JSON: исправьте кавычки и escape-символы, удалите комментарии и нотацию JSONP, модифицируйте объекты JavaScript в JSON.", searchTitle: "Поиск", searchNextResultTitle: "Следующий результат (Enter)", searchPreviousResultTitle: "Предыдущий результат (Shift + Enter)", selectNode: "Выбор узла...", showAll: "показать все", showMore: "больше", showMoreStatus: "${visibleChilds} из ${totalChilds}", sort: "Сортировка", sortTitle: "Сортировка потомков типа ${type}", sortTitleShort: "Сортировка содержимого", sortFieldLabel: "Поле:", sortDirectionLabel: "Направление:", sortFieldTitle: "Выберите поле для сортировки массива или объекта", sortAscending: "По возрастанию", sortAscendingTitle: "Сортировка выбранного поря по возрастанию", sortDescending: "По убыванию", sortDescendingTitle: "Сортировка выбранного поря по убыванию", string: "Строка", transform: "Модификация", transformTitle: "Фильтрация, сортировка или модификация данных типа ${type}", transformTitleShort: "Фильтрация, сортировка или модификация данных", extract: "Извлечение", extractTitle: "Извлечь тип ${type}", transformQueryTitle: "Введите JMESpath запрос", transformWizardLabel: "Мастер", transformWizardFilter: "Фильтр", transformWizardSortBy: "Сортировка", transformWizardSelectFields: "Поля", transformQueryLabel: "Запрос", transformPreviewLabel: "Просмотр", type: "Тип", typeTitle: "Изменить тип этого поля", openUrl: "Ctrl+Click или Ctrl+Enter для открытия url в новом окне", undo: "Отменить (Ctrl+Z)", validationCannotMove: "Поле не может быть перемещено в потомка", autoType: "Тип поля автоматически определяется по значению и может быть строкой, числом, логическим значением или null.", objectType: "Объект содержит неупорядоченный набор пар ключ/значение.", arrayType: "Массив содержит упорядоченный набор значений.", stringType: "Тип поля не определяется из значения, но всегда возвращается как строка.", modeEditorTitle: "Переключение режима редактора", modeCodeText: "Код", modeCodeTitle: "Переключить в режим редактора кода", modeFormText: "Форма", modeFormTitle: "Переключить в режим формы", modeTextText: "Текст", modeTextTitle: "Переключить в режим редактора текста", modeTreeText: "Дерево", modeTreeTitle: "Переключить в режим редактора дерева", modeViewText: "Просмотр дерева", modeViewTitle: "Переключить в режим просмотра дерева", modePreviewText: "Просмотр", modePreviewTitle: "Переключить в режим просмотра", examples: "Примеры", default: "По умолчанию", containsInvalidProperties: "Содержит недопустимые свойства", containsInvalidItems: "Содержит недопустимые элементы" }, ko: { array: "배열", auto: "자동", appendText: "추가", appendTitle: '선택한 요소 아래에 "자동" 요소를 추가합니다. (Ctrl + Shift + Ins)', appendSubmenuTitle: "추가할 요소의 유형을 선택해주세요.", appendTitleAuto: '"자동" 요소를 추가합니다. (Ctrl + Shift + Ins)', ascending: "오름차순", ascendingTitle: "선택한 ${type}의 하위 요소를 오름차순 정렬합니다.", actionsMenu: "메뉴 열기 (Ctrl + M)", cannotParseFieldError: "JSON의 요소를 해석할 수 없습니다.", cannotParseValueError: "JSON의 값을 해석할 수 없습니다.", collapseAll: "모두 접기", compactTitle: "모든 공백을 제거하여 JSON 데이터를 작게 만듭니다. (Ctrl + Shift + I)", descending: "내림차순", descendingTitle: "선택한 ${type}의 하위 요소를 내림차순으로 정렬", drag: "드래그하여 요소를 이동합니다. (Alt + Shift + Arrows)", duplicateKey: "복제키", duplicateText: "복제", duplicateTitle: "선택한 요소를 복제합니다. (Ctrl + D)", duplicateField: "선택한 요소를 복제합니다. (Ctrl + D)", duplicateFieldError: "요소 이름이 중복되었습니다.", empty: "비어있음", expandAll: "모두 열기", expandTitle: `클릭하여 요소를 열거나 닫습니다. (Ctrl + E)
Ctrl + Click으로 모든 하위 요소를 열거나 닫습니다.`, formatTitle: "적절한 들여쓰기 및 줄바꿈으로 JSON 데이터를 정형화합니다. (Ctrl + I)", insert: "삽입", insertTitle: "선택한 요소 위에 새요소를 삽입합니다. (Ctrl + Ins)", insertSub: "삽입할 요소의 유형을 선택해주세요.", object: "객체", ok: "확인", redo: "다시 실행 (Ctrl + Shift + Z)", removeText: "삭제", removeTitle: "선택한 요소를 삭제합니다. (Ctrl + Del)", removeField: "선택한 요소를 삭제합니다. (Ctrl + Del)", repairTitle: "JSON 교정: JSON 내의 주석과 JSONP 표기법을 지우고 따옴표와 이스케이프 문자를 수정합니다.", searchTitle: "요소 또는 값 찾기", searchNextResultTitle: "다음으로 찾기 (Enter)", searchPreviousResultTitle: "이전으로 찾기 (Shift + Enter)", selectNode: "요소를 선택해주세요...", showAll: "모두보기", showMore: "더보기", showMoreStatus: "${totalChilds} 개의 항목 중 ${visibleChilds} 개를 표시합니다.", sort: "정렬", sortTitle: "선택한 ${type}의 하위 요소를 정렬합니다.", sortTitleShort: "정렬", sortFieldLabel: "요소:", sortDirectionLabel: "순서:", sortFieldTitle: "배열이나 객체를 정렬하는 요소를 선택해주세요.", sortAscending: "오름차순", sortAscendingTitle: "선택한 요소를 오름차순으로 정렬합니다.", sortDescending: "내림차순", sortDescendingTitle: "선택한 요소를 내림차순으로 정렬합니다.", string: "문자", transform: "변환", transformTitle: "선택한 ${type}의 하위 요소를 필터하거나 정렬 또는 변환합니다.", transformTitleShort: "내용을 필터하거나 정렬 또는 변환합니다.", extract: "추출", extractTitle: "선택한 ${type}의 값을 최상위에 위치시킵니다.", transformQueryTitle: "JMESPath 쿼리를 입력해주세요.", transformWizardLabel: "마법사", transformWizardFilter: "필터", transformWizardSortBy: "정렬", transformWizardSelectFields: "요소를 선택해주세요.", transformQueryLabel: "쿼리", transformPreviewLabel: "미리보기", type: "유형", typeTitle: "선택한 요소의 유형을 변경합니다.", openUrl: "Ctrl + Click 또는 Ctrl + Enter로 새 창에서 URL 열기", undo: "실행 취소 (Ctrl + Z)", validationCannotMove: "하위 요소로 이동할 수 없습니다.", autoType: "자동: 요소의 형식이 값의 유형으로 결정됩니다. 문자, 숫자, 부울, 또는 null만 허용됩니다.", objectType: "객체: 순서대로 나열되지 않은 이름/값 쌍으로 이루어진 집합입니다.", arrayType: "배열: 순서대로 나열된 값의 집합입니다.", stringType: "문자: 요소의 유형이 값에서 결정되지 않지만 항상 문자로 반환됩니다.", modeEditorTitle: "편집기 유형 변경", modeCodeText: "코드", modeCodeTitle: "형식 교정을 도와주는 기능이 포함된 문자 편집기", modeFormText: "입력 양식", modeFormTitle: "정해진 요소에 값을 입력하는 편집기", modeTextText: "문자", modeTextTitle: "단순 문자 편집기", modeTreeText: "트리", modeTreeTitle: "트리 구조로 표시되는 편집기", modeViewText: "보기", modeViewTitle: "읽기전용 트리 구조로 JSON을 표시", modePreviewText: "미리보기", modePreviewTitle: "읽기전용 문자로 JSON을 표시", examples: "예제", default: "기본값", containsInvalidProperties: "잘못된 속성이 포함되어 있습니다.", containsInvalidItems: "잘못된 항목이 포함되어 있습니다" } }, x = Object.keys(U), H = "en", z = typeof navigator < "u" ? navigator.language || navigator.userLanguage : void 0, j = x.find(function(A) {
return A === z;
}) || H;
function Y(A) {
var f;
A && ((f = x.find(function(R) {
return R === A;
})) && (j = f));
}
function P(A) {
if (A)
for (var f in A)
(function(R) {
x.find(function(y) {
return y === R;
}) || x.push(R), U[R] = Object.assign({}, U[H], U[R], A[R]);
})(f);
}
function N(A, f, R) {
var y = U[R = R || j][A] || U[H][A] || A;
if (f)
for (var C in f)
y = y.replace("${" + C + "}", f[C]);
return y;
}
}, 6056: function(le, U, D) {
D.d(U, { J: function() {
return j;
}, r: function() {
return z;
} });
var U = D(5156), x = D.n(U), H = D(9791);
function z(Y, R) {
var N, A = R.sort, f = R.filter, R = R.projection, y = "";
return f ? (N = f.field !== "@" ? ["0"].concat((0, H.parsePath)("." + f.field)) : ["0"], N = typeof (0, H.get)(Y, N) == "string" ? f.value : (0, H.parseString)(f.value), y += "[? " + f.field + " " + f.relation + " `" + JSON.stringify(N) + "`]") : y += Array.isArray(Y) ? "[*]" : "@", A && (A.direction === "desc" ? y += " | reverse(sort_by(@, &" + A.field + "))" : y += " | sort_by(@, &" + A.field + ")"), R && (y[y.length - 1] !== "]" && (y += " | [*]"), R.fields.length === 1 ? y += "." + R.fields[0] : 1 < R.fields.length && (y += ".{" + R.fields.map(function(C) {
var d = C.split(".");
return d[d.length - 1] + ": " + C;
}).join(", ") + "}")), y;
}
function j(Y, P) {
return x().search(Y, P);
}
}, 4987: function() {
function le(m) {
m === void 0 || "remove" in m || Object.defineProperty(m, "remove", { configurable: true, enumerable: true, writable: true, value: function() {
this.parentNode !== void 0 && this.parentNode.removeChild(this);
} });
}
typeof Element < "u" && (window.Element !== void 0 && le(window.Element.prototype), window.CharacterData !== void 0 && le(window.CharacterData.prototype), window.DocumentType !== void 0) && le(window.DocumentType.prototype), Array.prototype.findIndex || Object.defineProperty(Array.prototype, "findIndex", { value: function(m) {
for (var D = 0; D < this.length; D++) {
var U = this[D];
if (m.call(this, U, D, this))
return D;
}
return -1;
}, configurable: true, writable: true }), Array.prototype.find || Object.defineProperty(Array.prototype, "find", { value: function(m) {
return m = this.findIndex(m), this[m];
}, configurable: true, writable: true }), String.prototype.trim || (String.prototype.trim = function() {
return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
});
}, 341: function(le, h, d) {
d.r(h), d.d(h, { previewModeMixins: function() {
return l;
} });
var U = d(1262), x = d(4188), H = d(6436), z = d(2474);
function j(n) {
return (j = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o) {
return typeof o;
} : function(o) {
return o && typeof Symbol == "function" && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
})(n);
}
function Y(n, o) {
for (var i = 0; i < o.length; i++) {
var a = o[i];
a.enumerable = a.enumerable || false, a.configurable = true, "value" in a && (a.writable = true), Object.defineProperty(n, function(r) {
return r = function(e2, t) {
if (j(e2) !== "object" || e2 === null)
return e2;
var s = e2[Symbol.toPrimitive];
if (s === void 0)
return (t === "string" ? String : Number)(e2);
if (s = s.call(e2, t || "default"), j(s) !== "object")
return s;
throw new TypeError("@@toPrimitive must return a primitive value.");
}(r, "string"), j(r) === "symbol" ? r : String(r);
}(a.key), a);
}
}
var P = function() {
function n(a, r, e2) {
if (!(this instanceof n))
throw new TypeError("Cannot call a class as a function");
this.onChange = a, this.calculateItemSize = r || function() {
return 1;
}, this.limit = e2, this.items = [], this.index = -1;
}
var o, i;
return o = n, (i = [{ key: "add", value: function(a) {
for (; this._calculateHistorySize() > this.limit && 1 < this.items.length; )
this.items.shift(), this.index--;
this.items = this.items.slice(0, this.index + 1), this.items.push(a), this.index++, this.onChange();
} }, { key: "_calculateHistorySize", value: function() {
var a = this.calculateItemSize, r = 0;
return this.items.forEach(function(e2) {
r += a(e2);
}), r;
} }, { key: "undo", value: function() {
if (this.canUndo())
return this.index--, this.onChange(), this.items[this.index];
} }, { key: "redo", value: function() {
if (this.canRedo())
return this.index++, this.onChange(), this.items[this.index];
} }, { key: "canUndo", value: function() {
return 0 < this.index;
} }, { key: "canRedo", value: function() {
return this.index < this.items.length - 1;
} }, { key: "clear", value: function() {
this.items = [], this.index = -1, this.onChange();
} }]) && Y(o.prototype, i), Object.defineProperty(o, "prototype", { writable: false }), n;
}(), N = d(7907), A = d(6056), f = d(6617), R = d(6210), y = d(2558), h = d(8458), C = d(9791), d = h.textModeMixins[0].mixin, h = { create: function(a) {
var o = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : {}, i = (o.statusBar === void 0 && (o.statusBar = true), o.mainMenuBar = o.mainMenuBar !== false, o.enableSort = o.enableSort !== false, o.enableTransform = o.enableTransform !== false, o.createQuery = o.createQuery || A.r, o.executeQuery = o.executeQuery || A.J, typeof (this.options = o).indentation == "number" ? this.indentation = Number(o.indentation) : this.indentation = 2, (0, N.cC)(this.options.languages), (0, N.m0)(this.options.language), this.mode = "preview", this), a = (this.container = a, this.dom = {}, this.json = void 0, this.text = "", this._debouncedValidate = (0, C.debounce)(this.validate.bind(this), this.DEBOUNCE_INTERVAL), this.width = a.clientWidth, this.height = a.clientHeight, this.frame = document.createElement("div"), this.frame.className = "jsoneditor jsoneditor-mode-preview", this.frame.onclick = function(r) {
r.preventDefault();
}, { target: this.frame, onFocus: this.options.onFocus || null, onBlur: this.options.onBlur || null }), a = (this.frameFocusTracker = new z.R(a), this.content = document.createElement("div"), this.content.className = "jsoneditor-outer", this.dom.busy = document.createElement("div"), this.dom.busy.className = "jsoneditor-busy", this.dom.busyContent = document.createElement("span"), this.dom.busyContent.textContent = "busy...", this.dom.busy.appendChild(this.dom.busyContent), this.content.appendChild(this.dom.busy), this.dom.previewContent = document.createElement("pre"), this.dom.previewContent.className = "jsoneditor-preview", this.dom.previewText = document.createTextNode(""), this.dom.previewContent.appendChild(this.dom.previewText), this.content.appendChild(this.dom.previewContent), this.options.mainMenuBar && ((0, C.addClassName)(this.content, "has-main-menu-bar"), this.menu = document.createElement("div"), this.menu.className = "jsoneditor-menu", this.frame.appendChild(this.menu), (a = document.createElement("button")).type = "button", a.className = "jsoneditor-format", a.title = (0, N.Iu)("formatTitle"), this.menu.appendChild(a), a.onclick = function() {
i.executeWithBusyMessage(function() {
try {
i.format();
} catch (r) {
i._onError(r);
}
}, "formatting...");
}, (a = document.createElement("button")).type = "button", a.className = "jsoneditor-compact", a.title = (0, N.Iu)("compactTitle"), this.menu.appendChild(a), a.onclick = function() {
i.executeWithBusyMessage(function() {
try {
i.compact();
} catch (r) {
i._onError(r);
}
}, "compacting...");
}, this.options.enableSort && ((a = document.createElement("button")).type = "button", a.className = "jsoneditor-sort", a.title = (0, N.Iu)("sortTitleShort"), a.onclick = function() {
i._showSortModal();
}, this.menu.appendChild(a)), this.options.enableTransform && ((a = document.createElement("button")).type = "button", a.title = (0, N.Iu)("transformTitleShort"), a.className = "jsoneditor-transform", a.onclick = function() {
i._showTransformModal();
}, this.dom.transform = a, this.menu.appendChild(a)), (a = document.createElement("button")).type = "button", a.className = "jsoneditor-repair", a.title = (0, N.Iu)("repairTitle"), this.menu.appendChild(a), !(a.onclick = function() {
i.json === void 0 && i.executeWithBusyMessage(function() {
try {
i.repair();
} catch (r) {
i._onError(r);
}
}, "repairing...");
}) !== this.options.history && (this.history = new P(function() {
i.dom.undo.disabled = !i.history.canUndo(), i.dom.redo.disabled = !i.history.canRedo();
}, function(r) {
return 2 * r.text.length;
}, x.oW), (a = document.createElement("button")).type = "button", a.className = "jsoneditor-undo jsoneditor-separator", a.title = (0, N.Iu)("undo"), a.onclick = function() {
var r = i.history.undo();
r && i._applyHistory(r);
}, this.menu.appendChild(a), this.dom.undo = a, (a = document.createElement("button")).type = "button", a.className = "jsoneditor-redo", a.title = (0, N.Iu)("redo"), a.onclick = function() {
var r = i.history.redo();
r && i._applyHistory(r);
}, this.menu.appendChild(a), this.dom.redo = a, this.history.onChange()), this.options) && this.options.modes && this.options.modes.length && (this.modeSwitcher = new f.x(this.menu, this.options.modes, this.options.mode, function(r) {
try {
i.setMode(r), i.modeSwitcher.focus();
} catch (e2) {
i._onError(e2);
}
})), Array.isArray(this.options.showErrorTable) ? this.options.showErrorTable.includes(this.mode) : this.options.showErrorTable === true);
this.errorTable = new H.Q({ errorTableVisible: a, onToggleVisibility: function() {
i.validate();
}, onFocusLine: null, onChangeHeight: function(r) {
r = r + (i.dom.statusBar ? i.dom.statusBar.clientHeight : 0) + 1, i.content.style.marginBottom = -r + "px", i.content.style.paddingBottom = r + "px";
} }), this.frame.appendChild(this.content), this.frame.appendChild(this.errorTable.getErrorTable()), this.container.appendChild(this.frame), o.statusBar && ((0, C.addClassName)(this.content, "has-status-bar"), a = document.createElement("div"), (this.dom.statusBar = a).className = "jsoneditor-statusbar", this.frame.appendChild(a), this.dom.fileSizeInfo = document.createElement("span"), this.dom.fileSizeInfo.className = "jsoneditor-size-info", this.dom.fileSizeInfo.innerText = "", a.appendChild(this.dom.fileSizeInfo), this.dom.arrayInfo = document.createElement("span"), this.dom.arrayInfo.className = "jsoneditor-size-info", this.dom.arrayInfo.innerText = "", a.appendChild(this.dom.arrayInfo), a.appendChild(this.errorTable.getErrorCounter()), a.appendChild(this.errorTable.getWarningIcon()), a.appendChild(this.errorTable.getErrorIcon())), this._renderPreview(), this.setSchema(this.options.schema, this.options.schemaRefs);
}, _renderPreview: function() {
var n = this.getText();
this.dom.previewText.nodeValue = (0, C.limitCharacters)(n, x.WF), this.dom.fileSizeInfo && (this.dom.fileSizeInfo.innerText = "Size: " + (0, C.formatSize)(n.length)), this.dom.arrayInfo && (Array.isArray(this.json) ? this.dom.arrayInfo.innerText = "Array: " + this.json.length + " items" : this.dom.arrayInfo.innerText = "");
}, _onChange: function() {
if (this._debouncedValidate(), this.options.onChange)
try {
this.options.onChange();
} catch {
}
if (this.options.onChangeJSON)
try {
this.options.onChangeJSON(this.get());
} catch {
}
if (this.options.onChangeText)
try {
this.options.onChangeText(this.getText());
} catch {
}
} }, l = (h._showSortModal = function() {
var n = this;
this.executeWithBusyMessage(function() {
var o = n.options.modalAnchor || x.qD, i = n.get();
n._renderPreview(), (0, R.showSortModal)(o, i, function(a) {
n.executeWithBusyMessage(function() {
var r, e2, t;
r = i, e2 = a, Array.isArray(r) && (t = (0, C.sort)(r, e2.path, e2.direction), n.sortedBy = e2, n._setAndFireOnChange(t)), (0, C.isObject)(r) && (t = (0, C.sortObjectKeys)(r, e2.direction), n.sortedBy = e2, n._setAndFireOnChange(t));
}, "sorting...");
}, n.sortedBy);
}, "parsing...");
}, h._showTransformModal = function() {
var n = this;
this.executeWithBusyMessage(function() {
var r = n.options, o = r.createQuery, i = r.executeQuery, a = r.modalAnchor, r = r.queryDescription, e2 = n.get();
n._renderPreview(), (0, y.showTransformModal)({ container: a || x.qD, json: e2, queryDescription: r, createQuery: o, executeQuery: i, onTransform: function(t) {
n.executeWithBusyMessage(function() {
var s = i(e2, t);
n._setAndFireOnChange(s);
}, "transforming...");
} });
}, "parsing...");
}, h.destroy = function() {
this.frame && this.container && this.frame.parentNode === this.container && this.container.removeChild(this.frame), this.modeSwitcher && (this.modeSwitcher.destroy(), this.modeSwitcher = null), this._debouncedValidate = null, this.history && (this.history.clear(), this.history = null), this.frameFocusTracker.destroy();
}, h.compact = function() {
var n = this.get(), o = JSON.stringify(n);
this._setTextAndFireOnChange(o, n);
}, h.format = function() {
var n = this.get(), o = JSON.stringify(n, null, this.indentation);
this._setTextAndFireOnChange(o, n);
}, h.repair = function() {
var n = this.getText();
try {
var o = (0, U.K)(n);
this._setTextAndFireOnChange(o);
} catch {
}
}, h.focus = function() {
this.dom.transform.focus();
}, h.set = function(n) {
this.history && this.history.clear(), this._set(n);
}, h.update = function(n) {
this._set(n);
}, h._set = function(n) {
this.text = void 0, this.json = n, this._renderPreview(), this._pushHistory(), this._debouncedValidate();
}, h._setAndFireOnChange = function(n) {
this._set(n), this._onChange();
}, h.get = function() {
var n;
return this.json === void 0 && (n = this.getText(), this.json = (0, C.parse)(n)), this.json;
}, h.getText = function() {
return this.text === void 0 && (this.text = JSON.stringify(this.json, null, this.indentation), this.options.escapeUnicode === true) && (this.text = (0, C.escapeUnicodeChars)(this.text)), this.text;
}, h.setText = function(n) {
this.history && this.history.clear(), this._setText(n);
}, h.updateText = function(n) {
this.getText() !== n && this._setText(n);
}, h._setText = function(n, o) {
var i;
this.options.escapeUnicode === true ? this.text = (0, C.escapeUnicodeChars)(n) : this.text = n, this.json = o, this._renderPreview(), this.json === void 0 ? (i = this).executeWithBusyMessage(function() {
try {
i.json = i.get(), i._renderPreview(), i._pushHistory();
} catch {
}
}, "parsing...") : this._pushHistory(), this._debouncedValidate();
}, h._setTextAndFireOnChange = function(n, o) {
this._setText(n, o), this._onChange();
}, h._applyHistory = function(n) {
this.json = n.json, this.text = n.text, this._renderPreview(), this._debouncedValidate();
}, h._pushHistory = function() {
var n;
this.history && (n = { text: this.text, json: this.json }, this.history.add(n));
}, h.executeWithBusyMessage = function(n, o) {
var i;
this.getText().length > x.EX ? ((0, C.addClassName)((i = this).frame, "busy"), i.dom.busyContent.innerText = o, setTimeout(function() {
n(), (0, C.removeClassName)(i.frame, "busy"), i.dom.busyContent.innerText = "";
}, 100)) : n();
}, h.validate = d.validate, h._renderErrors = d._renderErrors, [{ mode: "preview", mixin: h, data: "json" }]);
}, 6210: function(le, U, D) {
D.r(U), D.d(U, { showSortModal: function() {
return j;
} });
var U = D(483), x = D.n(U), H = D(7907), z = D(9791);
function j(Y, C, N, A) {
var f = Array.isArray(C) ? (0, z.getChildPaths)(C) : [""], R = A && A.path && (0, z.contains)(f, A.path) ? A.path : f[0], y = A && A.direction || "asc", C = '';
x()({ parent: Y, content: C, overlayClass: "jsoneditor-modal-overlay", overlayStyles: { backgroundColor: "rgb(1,1,1)", opacity: 0.3 }, modalClass: "jsoneditor-modal jsoneditor-modal-sort" }).afterCreate(function(d) {
var h = d.modalElem().querySelector("form"), l = d.modalElem().querySelector("#ok"), n = d.modalElem().querySelector("#field"), o = d.modalElem().querySelector("#direction");
function i(a) {
o.value = a, o.className = "jsoneditor-button-group jsoneditor-button-group-value-" + o.value;
}
f.forEach(function(a) {
var r, e2 = document.createElement("option");
e2.text = (r = a) === "" ? "@" : r[0] === "." ? r.slice(1) : r, e2.value = a, n.appendChild(e2);
}), n.value = R || f[0], i(y || "asc"), o.onclick = function(a) {
i(a.target.getAttribute("data-value"));
}, l.onclick = function(a) {
a.preventDefault(), a.stopPropagation(), d.close(), N({ path: n.value, direction: o.value });
}, h && (h.onsubmit = l.onclick);
}).afterClose(function(d) {
d.destroy();
}).show();
}
}, 2558: function(le, x, D) {
D.r(x), D.d(x, { showTransformModal: function() {
return R;
} });
var x = D(483), U = D.n(x), x = D(3879), H = D.n(x), z = D(7907);
function j(y) {
return (j = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(C) {
return typeof C;
} : function(C) {
return C && typeof Symbol == "function" && C.constructor === Symbol && C !== Symbol.prototype ? "symbol" : typeof C;
})(y);
}
function Y(y, C, d, h) {
if (typeof y == "boolean" || y instanceof Boolean || y === null || typeof y == "number" || y instanceof Number || typeof y == "string" || y instanceof String || y instanceof Date)
return JSON.stringify(y);
if (Array.isArray(y)) {
for (var l = y, n = C, o = d, i = h, a = n ? o + n : void 0, r = n ? `[
` : "[", e2 = 0; e2 < l.length; e2++) {
var t = l[e2];
if (n && (r += a), r += t !== void 0 && typeof t != "function" ? Y(t, n, a, i) : "null", e2 < l.length - 1 && (r += n ? `,
` : ","), r.length > i)
return r + "...";
}
return r += n ? `
` + o + "]" : "]";
}
if (y && j(y) === "object") {
var s, c = y, p = C, o = d, g = h, b = p ? o + p : void 0, w = true, E = p ? `{
` : "{";
if (typeof c.toJSON == "function")
return Y(c.toJSON(), p, o, g);
for (s in c)
if (function(Z, k) {
return Object.prototype.hasOwnProperty.call(Z, k);
}(c, s)) {
var M = c[s];
if (w ? w = false : E += p ? `,
` : ",", (E = (E += p ? b + '"' + s + '": ' : '"' + s + '":') + Y(M, p, b, g)).length > g)
return E + "...";
}
return E += p ? `
` + o + "}" : "}";
}
}
function P(y, C) {
for (var d = ""; 0 < C--; )
d += y;
return d;
}
var N = D(9791), A = D(4188), f = 'Enter a JMESPath query to filter, sort, or transform the JSON data. To learn JMESPath, go to the interactive tutorial .';
function R(a) {
var C = a.container, d = a.json, h = a.queryDescription, h = h === void 0 ? f : h, l = a.createQuery, n = a.executeQuery, o = a.onTransform, i = d, a = '" + h + '
' + (0, z.Iu)("transformWizardLabel") + '
' + (0, z.Iu)("transformWizardFilter") + '
== != < <= > >=
' + (0, z.Iu)("transformWizardSortBy") + '
Ascending Descending
' + (0, z.Iu)("transformWizardSelectFields") + '
' + (0, z.Iu)("transformQueryLabel") + '
' + (0, z.Iu)("transformPreviewLabel") + '
';
U()({ parent: C, content: a, overlayClass: "jsoneditor-modal-overlay", overlayStyles: { backgroundColor: "rgb(1,1,1)", opacity: 0.3 }, modalClass: "jsoneditor-modal jsoneditor-modal-transform", focus: false }).afterCreate(function(r) {
var e2 = r.modalElem(), B2 = e2.querySelector("#wizard"), t = e2.querySelector("#ok"), s = e2.querySelector("#filterField"), c = e2.querySelector("#filterRelation"), p = e2.querySelector("#filterValue"), g = e2.querySelector("#sortField"), b = e2.querySelector("#sortOrder"), w = e2.querySelector("#selectFields"), E = e2.querySelector("#query"), M = e2.querySelector("#preview");
Array.isArray(i) || (B2.style.fontStyle = "italic", B2.textContent = "(wizard not available for objects, only for arrays)"), (0, N.getChildPaths)(d).forEach(function(Q) {
var Q = v(Q), K = document.createElement("option"), K = (K.text = Q, K.value = Q, s.appendChild(K), document.createElement("option"));
K.text = Q, K.value = Q, g.appendChild(K);
});
var B2 = (0, N.getChildPaths)(d, true).filter(function(X) {
return X !== "";
}), B2 = (0 < B2.length ? B2.forEach(function(Q) {
var Q = v(Q), K = document.createElement("option");
K.text = Q, K.value = Q, w.appendChild(K);
}) : (B2 = e2.querySelector("#selectFieldsPart")) && (B2.style.display = "none"), new (H())(s, { defaultSelected: false, clearable: true, allowDeselect: true, placeholder: "field..." })), Z = new (H())(c, { defaultSelected: false, clearable: true, allowDeselect: true, placeholder: "compare..." }), k = new (H())(g, { defaultSelected: false, clearable: true, allowDeselect: true, placeholder: "field..." }), u = new (H())(b, { defaultSelected: false, clearable: true, allowDeselect: true, placeholder: "order..." }), _ = new (H())(w, { multiple: true, clearable: true, defaultSelected: false, placeholder: "select fields..." });
function v(X) {
return X === "" ? "@" : X[0] === "." ? X.slice(1) : X;
}
B2.on("selectr.change", W), Z.on("selectr.change", W), p.oninput = W, k.on("selectr.change", W), u.on("selectr.change", W), _.on("selectr.change", W), e2.querySelector(".pico-modal-contents").onclick = function(X) {
X.target.nodeName !== "A" && X.preventDefault();
};
var $ = (0, N.debounce)(function() {
try {
var X = n(i, E.value);
M.className = "jsoneditor-transform-preview", M.value = (Q = X, K = 2, ne = A.WF, typeof K == "number" ? 10 < K ? T = P(" ", 10) : 1 <= K && (T = P(" ", K)) : typeof K == "string" && K !== "" && (T = K), (K = Y(Q, T, "", ne)).length > ne ? (Q = K, (typeof (T = ne) == "number" ? Q.slice(0, T) : Q) + "...") : K), t.disabled = false;
} catch (V) {
M.className = "jsoneditor-transform-preview jsoneditor-error", M.value = V.toString(), t.disabled = true;
}
var Q, K, ne, T;
}, 300);
function G(X, Q) {
try {
E.value = l(X, Q), t.disabled = false, $();
} catch (K) {
X = 'Error: an error happened when executing "createQuery": ' + (K.message || K.toString()), E.value = "", t.disabled = true, M.className = "jsoneditor-transform-preview jsoneditor-error", M.value = X;
}
}
function W() {
var X = {};
if (s.value && c.value && p.value && (X.filter = { field: s.value, relation: c.value, value: p.value }), g.value && b.value && (X.sort = { field: g.value, direction: b.value }), w.value) {
for (var Q, K = [], ne = 0; ne < w.options.length; ne++)
w.options[ne].selected && (Q = w.options[ne].value, K.push(Q));
X.projection = { fields: K };
}
G(d, X);
}
E.oninput = $, t.onclick = function(X) {
X.preventDefault(), X.stopPropagation(), r.close(), o(E.value);
}, G(d, {}), setTimeout(function() {
E.select(), E.focus(), E.selectionStart = 3, E.selectionEnd = 3;
});
}).afterClose(function(r) {
r.destroy();
}).show();
}
}, 8458: function(le, o, D) {
D.r(o), D.d(o, { textModeMixins: function() {
return r;
} });
var U = D(1262), o = D(8170), x = D.n(o), H = D(4188), z = D(6436), j = D(2474), Y = D(7907), P = D(6056), N = D(6617), A = D(6210), f = D(2558), R = D(9125), y = D(7026), C = D(9791);
function d(e2) {
return (d = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
})(e2);
}
function h(e2, t) {
for (var s = 0; s < t.length; s++) {
var c = t[s];
c.enumerable = c.enumerable || false, c.configurable = true, "value" in c && (c.writable = true), Object.defineProperty(e2, function(p) {
return p = function(g, b) {
if (d(g) !== "object" || g === null)
return g;
var w = g[Symbol.toPrimitive];
if (w === void 0)
return (b === "string" ? String : Number)(g);
if (w = w.call(g, b || "default"), d(w) !== "object")
return w;
throw new TypeError("@@toPrimitive must return a primitive value.");
}(p, "string"), d(p) === "symbol" ? p : String(p);
}(c.key), c);
}
}
var l = function() {
function e2(c, p) {
if (!(this instanceof e2))
throw new TypeError("Cannot call a class as a function");
this.schema = c, this.schemaRefs = p || {}, this.suggestions = {}, this.suggestionsRefs = {}, this._buildSuggestions();
}
var t, s;
return t = e2, (s = [{ key: "_buildSuggestions", value: function() {
for (var c in this._handleSchemaEntry("", this.schema, this.suggestions), this.schemaRefs)
this.suggestionsRefs[c] = {}, this._handleSchemaEntry("", this.schemaRefs[c], this.suggestionsRefs[c]);
} }, { key: "_handleRef", value: function(c, p, g) {
g[c] = g[c] || {}, g[c].refs = g[c].refs || [], g[c].refs = (0, C.uniqueMergeArrays)(g[c].refs, [p]);
} }, { key: "_handleSchemaEntry", value: function(c, p, g) {
if (p)
if (p.$ref)
this._handleRef(c, p.$ref, g);
else {
var b = this._checkOfConditon(p);
if (b)
this._handleOfCondition(c, p[b], g);
else
switch (p.type) {
case "object":
this._handleObject(c, p, g);
break;
case "string":
case "number":
case "integer":
this._handlePrimitive(c, p, g);
break;
case "boolean":
this._handleBoolean(c, p, g);
break;
case "array":
this._handleArray(c, p, g);
}
}
} }, { key: "_handleObject", value: function(c, p, g) {
var b, w = this;
(0, C.isObject)(p.properties) && (b = Object.keys(p.properties), g[c] = g[c] || {}, g[c].props = g[c].props || [], g[c].props = (0, C.uniqueMergeArrays)(g[c].props, b), b.forEach(function(E) {
(0, C.asyncExec)(function() {
w._handleSchemaEntry("".concat(c, "/").concat(E), p.properties[E], g);
});
}));
} }, { key: "_handlePrimitive", value: function(c, p, g) {
g[c] = g[c] || {}, (0, C.isArray)(p.examples) && (g[c].examples = g[c].examples || [], g[c].examples = (0, C.uniqueMergeArrays)(g[c].examples, p.examples)), (0, C.isArray)(p.enum) && (g[c].enum = g[c].enum || [], g[c].enum = (0, C.uniqueMergeArrays)(g[c].enum, p.enum));
} }, { key: "_handleBoolean", value: function(c, p, g) {
g[c] || (g[c] = { bool: [true, false] });
} }, { key: "_handleArray", value: function(c, p, g) {
var b = this;
p.items && (0, C.asyncExec)(function() {
b._handleSchemaEntry("".concat(c, "/\\d+"), p.items, g);
});
} }, { key: "_handleOfCondition", value: function(c, p, g) {
var b = this;
p && p.length && p.forEach(function(w) {
(0, C.asyncExec)(function() {
b._handleSchemaEntry(c, w, g);
});
});
} }, { key: "_checkOfConditon", value: function(c) {
if (c)
return c.oneOf ? "oneOf" : c.anyOf ? "anyOf" : c.allOf ? "allOf" : void 0;
} }, { key: "getCompletions", value: function(c, p, g, b, w) {
var E = this;
try {
var M = y.parse(p.getValue()).pointers || {}, B2 = function(Z) {
function k(v) {
var $, G = { props: "property", enum: "enum", bool: "boolean", examples: "examples" };
Z && ($ = Z[v]) != null && $.length && (u = u.concat(Z[v].map(function(W) {
return { caption: W + "", meta: "schema [".concat(G[v], "]"), score: _++, value: W + "" };
})));
}
var u = [], _ = 0;
k("props"), k("enum"), k("bool"), k("examples"), u.length && w(null, u);
};
Object.keys(M).forEach(function(Z) {
(0, C.asyncExec)(function() {
function k(v, $, G) {
var W, X = Object.keys($).reduce(function(T, V) {
return new RegExp("^".concat(G).concat(V)).test(v) && (!T || T.length < V.length) ? V : T;
});
if (typeof X == "string") {
if ((W = $[X]) != null && (W = W.refs) != null && W.length) {
var Q, K = {};
for (Q in $[X].refs) {
var ne = $[X].refs[Q];
E.suggestionsRefs[ne] && ((ne = k(v, E.suggestionsRefs[ne], "".concat(G).concat(X))) != null && ne.enum && (K.enum = (0, C.uniqueMergeArrays)(K.enum, ne.enum)), ne != null && ne.examples && (K.examples = (0, C.uniqueMergeArrays)(K.examples, ne.examples)), ne != null && ne.bool && (K.bool = (0, C.uniqueMergeArrays)(K.bool, ne.bool)), ne != null) && ne.props && (K.props = (0, C.uniqueMergeArrays)(K.props, ne.props));
}
return K;
}
if (new RegExp("^".concat(G).concat(X, "$")).test(v))
return $[X];
}
}
var u, _;
((_ = M[Z].key) == null ? void 0 : _.line) === g.row && g.column >= M[Z].key.column && g.column <= M[Z].keyEnd.column && (u = Z.slice(0, Z.lastIndexOf("/"))), (u = ((_ = M[Z].value) == null ? void 0 : _.line) === g.row && ((_ = M[Z].value) == null ? void 0 : _.line) === ((_ = M[Z].valueEnd) == null ? void 0 : _.line) && g.column >= M[Z].value.column && g.column <= M[Z].valueEnd.column ? Z : u) && (_ = k(u, E.suggestions, ""), B2(_));
});
});
} catch {
}
} }]) && h(t.prototype, s), Object.defineProperty(t, "prototype", { writable: false }), e2;
}();
function n(e2) {
return (n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
})(e2);
}
var o = {}, i = "ace/theme/jsoneditor";
function a() {
try {
this.format();
} catch {
}
}
o.create = function(w) {
var t, s, c, p = this, g = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : {}, E = (g.statusBar === void 0 && (g.statusBar = true), g.mainMenuBar = g.mainMenuBar !== false, g.enableSort = g.enableSort !== false, g.enableTransform = g.enableTransform !== false, g.createQuery = g.createQuery || P.r, g.executeQuery = g.executeQuery || P.J, g.showErrorTable = g.showErrorTable !== void 0 ? g.showErrorTable : ["text", "preview"], typeof (this.options = g).indentation == "number" ? this.indentation = Number(g.indentation) : this.indentation = 2, (0, Y.cC)(this.options.languages), (0, Y.m0)(this.options.language), g.ace || x()), b = (this.mode = g.mode === "code" ? "code" : "text", this.mode === "code" && E === void 0 && (this.mode = "text"), this.theme = g.theme || i, this.theme === i && E && (0, R.O)(), g.onTextSelectionChange && this.onTextSelectionChange(g.onTextSelectionChange), this), w = (this.container = w, this.dom = {}, this.aceEditor = void 0, this.textarea = void 0, this.validateSchema = null, this.annotations = [], this.lastSchemaErrors = void 0, this._debouncedValidate = (0, C.debounce)(this._validateAndCatch.bind(this), this.DEBOUNCE_INTERVAL), this.width = w.clientWidth, this.height = w.clientHeight, this.frame = document.createElement("div"), this.frame.className = "jsoneditor jsoneditor-mode-" + this.options.mode, this.frame.onclick = function(M) {
M.preventDefault();
}, this.frame.onkeydown = function(M) {
b._onKeyDown(M);
}, { target: this.frame, onFocus: this.options.onFocus || null, onBlur: this.options.onBlur || null }), w = (this.frameFocusTracker = new j.R(w), this.content = document.createElement("div"), this.content.className = "jsoneditor-outer", this.options.mainMenuBar && ((0, C.addClassName)(this.content, "has-main-menu-bar"), this.menu = document.createElement("div"), this.menu.className = "jsoneditor-menu", this.frame.appendChild(this.menu), (w = document.createElement("button")).type = "button", w.className = "jsoneditor-format", w.title = (0, Y.Iu)("formatTitle"), this.menu.appendChild(w), w.onclick = function() {
try {
b.format(), b._onChange();
} catch (M) {
b._onError(M);
}
}, (w = document.createElement("button")).type = "button", w.className = "jsoneditor-compact", w.title = (0, Y.Iu)("compactTitle"), this.menu.appendChild(w), w.onclick = function() {
try {
b.compact(), b._onChange();
} catch (M) {
b._onError(M);
}
}, this.options.enableSort && ((w = document.createElement("button")).type = "button", w.className = "jsoneditor-sort", w.title = (0, Y.Iu)("sortTitleShort"), w.onclick = function() {
b._showSortModal();
}, this.menu.appendChild(w)), this.options.enableTransform && ((w = document.createElement("button")).type = "button", w.title = (0, Y.Iu)("transformTitleShort"), w.className = "jsoneditor-transform", w.onclick = function() {
b._showTransformModal();
}, this.menu.appendChild(w)), (w = document.createElement("button")).type = "button", w.className = "jsoneditor-repair", w.title = (0, Y.Iu)("repairTitle"), this.menu.appendChild(w), w.onclick = function() {
try {
b.repair(), b._onChange();
} catch (M) {
b._onError(M);
}
}, this.mode === "code" && ((w = document.createElement("button")).type = "button", w.className = "jsoneditor-undo jsoneditor-separator", w.title = (0, Y.Iu)("undo"), w.onclick = function() {
p.aceEditor.getSession().getUndoManager().undo();
}, this.menu.appendChild(w), this.dom.undo = w, (w = document.createElement("button")).type = "button", w.className = "jsoneditor-redo", w.title = (0, Y.Iu)("redo"), w.onclick = function() {
p.aceEditor.getSession().getUndoManager().redo();
}, this.menu.appendChild(w), this.dom.redo = w), this.options && this.options.modes && this.options.modes.length && (this.modeSwitcher = new N.x(this.menu, this.options.modes, this.options.mode, function(M) {
try {
b.setMode(M), b.modeSwitcher.focus();
} catch (B2) {
b._onError(B2);
}
})), this.mode === "code") && ((t = document.createElement("a")).appendChild(document.createTextNode("powered by ace")), t.href = "https://ace.c9.io/", t.target = "_blank", t.className = "jsoneditor-poweredBy", t.onclick = function() {
window.open(t.href, t.target, "noreferrer");
}, this.menu.appendChild(t)), this.options.onEditable && n(this.options.onEditable === "function") && !this.options.onEditable({})), E = (this.frame.appendChild(this.content), this.container.appendChild(this.frame), this.mode === "code" ? (this.editorDom = document.createElement("div"), this.editorDom.style.height = "100%", this.editorDom.style.width = "100%", this.content.appendChild(this.editorDom), c = (E = E.edit(this.editorDom)).getSession(), E.$blockScrolling = 1 / 0, E.setTheme(this.theme), E.setOptions({ readOnly: w }), E.setShowPrintMargin(false), E.setFontSize("14px"), c.setMode("ace/mode/json"), c.setTabSize(this.indentation), c.setUseSoftTabs(true), c.setUseWrapMode(true), s = c.setAnnotations, c.setAnnotations = function(M) {
s.call(this, M && M.length ? M : b.annotations);
}, E.commands.bindKey("Ctrl-L", null), E.commands.bindKey("Command-L", null), E.commands.bindKey("Ctrl-\\", null), E.commands.bindKey("Command-\\", null), E.commands.bindKey("Ctrl-Shift-\\", null), E.commands.bindKey("Command-Shift-\\", null), (this.aceEditor = E).on("change", this._onChange.bind(this)), E.on("changeSelection", this._onSelect.bind(this))) : ((c = document.createElement("textarea")).className = "jsoneditor-text", c.spellcheck = false, this.content.appendChild(c), this.textarea = c, this.textarea.readOnly = w, this.textarea.oninput === null ? this.textarea.oninput = this._onChange.bind(this) : this.textarea.onchange = this._onChange.bind(this), c.onselect = this._onSelect.bind(this), c.onmousedown = this._onMouseDown.bind(this), c.onblur = this._onBlur.bind(this)), this._updateHistoryButtons(), Array.isArray(this.options.showErrorTable) ? this.options.showErrorTable.includes(this.mode) : this.options.showErrorTable === true);
this.errorTable = new z.Q({ errorTableVisible: E, onToggleVisibility: function() {
b._validateAndCatch();
}, onFocusLine: function(M) {
b.isFocused = true, isNaN(M) || b.setTextSelection({ row: M, column: 1 }, { row: M, column: 1e3 });
}, onChangeHeight: function(M) {
M = M + (b.dom.statusBar ? b.dom.statusBar.clientHeight : 0) + 1, b.content.style.marginBottom = -M + "px", b.content.style.paddingBottom = M + "px";
} }), this.frame.appendChild(this.errorTable.getErrorTable()), g.statusBar && ((0, C.addClassName)(this.content, "has-status-bar"), this.curserInfoElements = {}, w = document.createElement("div"), (this.dom.statusBar = w).className = "jsoneditor-statusbar", this.frame.appendChild(w), (c = document.createElement("span")).className = "jsoneditor-curserinfo-label", c.innerText = "Ln:", (E = document.createElement("span")).className = "jsoneditor-curserinfo-val", E.innerText = "1", w.appendChild(c), w.appendChild(E), (g = document.createElement("span")).className = "jsoneditor-curserinfo-label", g.innerText = "Col:", (c = document.createElement("span")).className = "jsoneditor-curserinfo-val", c.innerText = "1", w.appendChild(g), w.appendChild(c), this.curserInfoElements.colVal = c, this.curserInfoElements.lnVal = E, (g = document.createElement("span")).className = "jsoneditor-curserinfo-label", g.innerText = "characters selected", g.style.display = "none", (c = document.createElement("span")).className = "jsoneditor-curserinfo-count", c.innerText = "0", c.style.display = "none", this.curserInfoElements.countLabel = g, this.curserInfoElements.countVal = c, w.appendChild(c), w.appendChild(g), w.appendChild(this.errorTable.getErrorCounter()), w.appendChild(this.errorTable.getWarningIcon()), w.appendChild(this.errorTable.getErrorIcon())), this.setSchema(this.options.schema, this.options.schemaRefs);
}, o._onSchemaChange = function(e2, t) {
this.aceEditor && (this.options.allowSchemaSuggestions && e2 ? (this.aceEditor.setOption("enableBasicAutocompletion", [new l(e2, t)]), this.aceEditor.setOption("enableLiveAutocompletion", true)) : (this.aceEditor.setOption("enableBasicAutocompletion", void 0), this.aceEditor.setOption("enableLiveAutocompletion", false)));
}, o._onChange = function() {
var e2 = this;
if (!this.onChangeDisabled) {
if (setTimeout(function() {
e2._updateHistoryButtons && e2._updateHistoryButtons();
}), this._debouncedValidate(), this.options.onChange)
try {
this.options.onChange();
} catch {
}
if (this.options.onChangeText)
try {
this.options.onChangeText(this.getText());
} catch {
}
}
}, o._updateHistoryButtons = function() {
var e2;
this.aceEditor && this.dom.undo && this.dom.redo && (e2 = this.aceEditor.getSession().getUndoManager()) && e2.hasUndo && e2.hasRedo && (this.dom.undo.disabled = !e2.hasUndo(), this.dom.redo.disabled = !e2.hasRedo());
}, o._showSortModal = function() {
try {
var e2 = this, t = this.options.modalAnchor || H.qD, s = this.get();
(0, A.showSortModal)(t, s, function(c) {
var p;
Array.isArray(s) && (p = (0, C.sort)(s, c.path, c.direction), e2.sortedBy = c, e2.update(p)), (0, C.isObject)(s) && (p = (0, C.sortObjectKeys)(s, c.direction), e2.sortedBy = c, e2.update(p));
}, e2.sortedBy);
} catch (c) {
this._onError(c);
}
}, o._showTransformModal = function() {
var e2 = this;
try {
var t = this.options, s = t.modalAnchor, c = t.createQuery, p = t.executeQuery, g = t.queryDescription, b = this.get();
(0, f.showTransformModal)({ container: s || H.qD, json: b, queryDescription: g, createQuery: c, executeQuery: p, onTransform: function(w) {
w = p(b, w), e2.update(w);
} });
} catch (w) {
this._onError(w);
}
}, o._onSelect = function() {
this._updateCursorInfo(), this._emitSelectionChange();
}, o._onKeyDown = function(e2) {
var t = false;
(e2.which || e2.keyCode) === 73 && e2.ctrlKey && (e2.shiftKey ? this.compact() : this.format(), this._onChange(), t = true), t && (e2.preventDefault(), e2.stopPropagation()), this._updateCursorInfo(), this._emitSelectionChange();
}, o._onMouseDown = function() {
this._updateCursorInfo(), this._emitSelectionChange();
}, o._onBlur = function() {
var e2 = this;
setTimeout(function() {
e2.isFocused || (e2._updateCursorInfo(), e2._emitSelectionChange()), e2.isFocused = false;
});
}, o._updateCursorInfo = function() {
var e2, t, s, c, p, g = this;
function b() {
g.curserInfoElements.countVal.innerText !== p && (g.curserInfoElements.countVal.innerText = p, g.curserInfoElements.countVal.style.display = p ? "inline" : "none", g.curserInfoElements.countLabel.style.display = p ? "inline" : "none"), g.curserInfoElements.lnVal.innerText = s, g.curserInfoElements.colVal.innerText = c;
}
this.textarea ? setTimeout(function() {
var w = (0, C.getInputSelection)(g.textarea);
w.startIndex !== w.endIndex && (p = w.endIndex - w.startIndex), c = (p && g.cursorInfo && g.cursorInfo.line === w.end.row && g.cursorInfo.column === w.end.column ? (s = w.start.row, w.start) : (s = w.end.row, w.end)).column, g.cursorInfo = { line: s, column: c, count: p }, g.options.statusBar && b();
}, 0) : this.aceEditor && this.curserInfoElements && (e2 = this.aceEditor.getCursorPosition(), t = this.aceEditor.getSelectedText(), s = e2.row + 1, c = e2.column + 1, p = t.length, g.cursorInfo = { line: s, column: c, count: p }, this.options.statusBar) && b();
}, o._emitSelectionChange = function() {
var e2;
this._selectionChangedHandler && (e2 = this.getTextSelection(), this._selectionChangedHandler(e2.start, e2.end, e2.text));
}, o._refreshAnnotations = function() {
var e2, t = this.aceEditor && this.aceEditor.getSession();
t && (e2 = t.getAnnotations().filter(function(s) {
return s.type === "error";
}), t.setAnnotations(e2));
}, o.destroy = function() {
this.aceEditor && (this.aceEditor.destroy(), this.aceEditor = null), this.frame && this.container && this.frame.parentNode === this.container && this.container.removeChild(this.frame), this.modeSwitcher && (this.modeSwitcher.destroy(), this.modeSwitcher = null), this.textarea = null, this._debouncedValidate = null, this.frameFocusTracker.destroy();
}, o.compact = function() {
var e2 = this.get(), e2 = JSON.stringify(e2);
this.updateText(e2);
}, o.format = function() {
var e2 = this.get(), e2 = JSON.stringify(e2, null, this.indentation);
this.updateText(e2);
}, o.repair = function() {
var e2 = this.getText();
try {
var t = (0, U.K)(e2);
this.updateText(t);
} catch {
}
}, o.focus = function() {
this.textarea && this.textarea.focus(), this.aceEditor && this.aceEditor.focus();
}, o.resize = function() {
this.aceEditor && this.aceEditor.resize(false);
}, o.set = function(e2) {
this.setText(JSON.stringify(e2, null, this.indentation));
}, o.update = function(e2) {
this.updateText(JSON.stringify(e2, null, this.indentation));
}, o.get = function() {
var e2 = this.getText();
return (0, C.parse)(e2);
}, o.getText = function() {
return this.textarea ? this.textarea.value : this.aceEditor ? this.aceEditor.getValue() : "";
}, o._setText = function(p, t) {
var s, c = this, p = this.options.escapeUnicode === true ? (0, C.escapeUnicodeChars)(p) : p;
this.textarea && (this.textarea.value = p), this.aceEditor && (this.onChangeDisabled = true, this.aceEditor.setValue(p, -1), this.onChangeDisabled = false, t && (s = this, setTimeout(function() {
s.aceEditor && s.aceEditor.session.getUndoManager().reset();
})), setTimeout(function() {
c._updateHistoryButtons && c._updateHistoryButtons();
})), this._debouncedValidate();
}, o.setText = function(e2) {
this._setText(e2, true);
}, o.updateText = function(e2) {
this.getText() !== e2 && this._setText(e2, false);
}, o.validate = function() {
var e2, t = this, s = [], c = [];
try {
var p = this.get(), g = (this.validateSchema && !this.validateSchema(p) && (s = this.validateSchema.errors.map(function(w) {
return w.type = "validation", (0, C.improveSchemaError)(w);
})), this.validationSequence = (this.validationSequence || 0) + 1, this), b = this.validationSequence;
return function(w, E) {
if (!E)
return Promise.resolve([]);
try {
var M = E(w);
return ((0, C.isPromise)(M) ? M : Promise.resolve(M)).then(function(B2) {
return Array.isArray(B2) ? B2.filter(function(Z) {
var k = (0, C.isValidValidationError)(Z);
return k;
}).map(function(Z) {
return { dataPath: (0, C.stringifyPath)(Z.path), message: Z.message, type: "customValidation" };
}) : [];
});
} catch (B2) {
return Promise.reject(B2);
}
}(p, this.options.onValidate).then(function(w) {
return b === g.validationSequence && (w = s.concat(c).concat(w), g._renderErrors(w), typeof t.options.onValidationError == "function" && (0, C.isValidationErrorChanged)(w, t.lastSchemaErrors) && t.options.onValidationError.call(t, w), t.lastSchemaErrors = w), t.lastSchemaErrors;
});
} catch (w) {
return this.getText() && ((p = /\w*line\s*(\d+)\w*/g.exec(w.message)) && (e2 = +p[1]), c = [{ type: "error", message: w.message.replace(/\n/g, " "), line: e2 }]), this._renderErrors(c), typeof this.options.onValidationError == "function" && (0, C.isValidationErrorChanged)(c, this.lastSchemaErrors) && this.options.onValidationError.call(this, c), this.lastSchemaErrors = c, Promise.resolve(this.lastSchemaErrors);
}
}, o._validateAndCatch = function() {
this.validate().catch(function(e2) {
});
}, o._renderErrors = function(e2) {
var s = this.getText(), t = [], s = (e2.reduce(function(c, p) {
return typeof p.dataPath == "string" && c.indexOf(p.dataPath) === -1 && c.push(p.dataPath), c;
}, t), (0, C.getPositionForPath)(s, t));
this.aceEditor && (this.annotations = s.map(function(c) {
var p = e2.filter(function(b) {
return b.dataPath === c.path;
}), g = p.map(function(b) {
return b.message;
}).join(`
`);
return g ? { row: c.line, column: c.column, text: "Schema validation error" + (p.length !== 1 ? "s" : "") + `:
` + g, type: "warning", source: "jsoneditor" } : {};
}), this._refreshAnnotations()), this.errorTable.setErrors(e2, s), this.aceEditor && this.aceEditor.resize(false);
}, o.getTextSelection = function() {
var e2, t, s, c = {};
return this.textarea ? (s = (0, C.getInputSelection)(this.textarea), this.cursorInfo && this.cursorInfo.line === s.end.row && this.cursorInfo.column === s.end.column ? (c.start = s.end, c.end = s.start) : c = s, { start: c.start, end: c.end, text: this.textarea.value.substring(s.startIndex, s.endIndex) }) : this.aceEditor ? (s = this.aceEditor.getSelection(), e2 = this.aceEditor.getSelectedText(), t = s.getRange(), (s = s.getSelectionLead()).row === t.end.row && s.column === t.end.column ? c = t : (c.start = t.end, c.end = t.start), { start: { row: c.start.row + 1, column: c.start.column + 1 }, end: { row: c.end.row + 1, column: c.end.column + 1 }, text: e2 }) : void 0;
}, o.onTextSelectionChange = function(e2) {
typeof e2 == "function" && (this._selectionChangedHandler = (0, C.debounce)(e2, this.DEBOUNCE_INTERVAL));
}, o.setTextSelection = function(e2, t) {
var s, c, p;
e2 && t && (this.textarea ? (s = (0, C.getIndexForPosition)(this.textarea, e2.row, e2.column), p = (0, C.getIndexForPosition)(this.textarea, t.row, t.column), -1 < s && -1 < p && (this.textarea.setSelectionRange ? (this.textarea.focus(), this.textarea.setSelectionRange(s, p)) : this.textarea.createTextRange && ((c = this.textarea.createTextRange()).collapse(true), c.moveEnd("character", p), c.moveStart("character", s), c.select()), p = (this.textarea.value.match(/\n/g) || []).length + 1, s = this.textarea.scrollHeight / p, c = e2.row * s, this.textarea.scrollTop = c > this.textarea.clientHeight ? c - this.textarea.clientHeight / 2 : 0)) : this.aceEditor && (p = { start: { row: e2.row - 1, column: e2.column - 1 }, end: { row: t.row - 1, column: t.column - 1 } }, this.aceEditor.selection.setRange(p), this.aceEditor.scrollToLine(e2.row - 1, true)));
};
var r = [{ mode: "text", mixin: o, data: "text", load: a }, { mode: "code", mixin: o, data: "text", load: a }];
}, 8038: function(le, X, K) {
K.r(X), K.d(X, { treeModeMixins: function() {
return ne;
} });
var U = { start: function(T, V, F) {
return V.indexOf(T) === 0;
}, contain: function(T, V, F) {
return -1 < V.indexOf(T);
} }, x = K(897), H = K(2474);
function z(T) {
return (z = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(V) {
return typeof V;
} : function(V) {
return V && typeof Symbol == "function" && V.constructor === Symbol && V !== Symbol.prototype ? "symbol" : typeof V;
})(T);
}
function j(T, V) {
for (var F = 0; F < V.length; F++) {
var I = V[F];
I.enumerable = I.enumerable || false, I.configurable = true, "value" in I && (I.writable = true), Object.defineProperty(T, function(S) {
return S = function(L, O) {
if (z(L) !== "object" || L === null)
return L;
var J = L[Symbol.toPrimitive];
if (J === void 0)
return (O === "string" ? String : Number)(L);
if (J = J.call(L, O || "default"), z(J) !== "object")
return J;
throw new TypeError("@@toPrimitive must return a primitive value.");
}(S, "string"), z(S) === "symbol" ? S : String(S);
}(I.key), I);
}
}
var Y = function() {
function T() {
if (!(this instanceof T))
throw new TypeError("Cannot call a class as a function");
this.locked = false;
}
var V, F;
return V = T, (F = [{ key: "highlight", value: function(I) {
this.locked || (this.node !== I && (this.node && this.node.setHighlight(false), this.node = I, this.node.setHighlight(true)), this._cancelUnhighlight());
} }, { key: "unhighlight", value: function() {
var I;
this.locked || (I = this).node && (this._cancelUnhighlight(), this.unhighlightTimer = setTimeout(function() {
I.node.setHighlight(false), I.node = void 0, I.unhighlightTimer = void 0;
}, 0));
} }, { key: "_cancelUnhighlight", value: function() {
this.unhighlightTimer && (clearTimeout(this.unhighlightTimer), this.unhighlightTimer = void 0);
} }, { key: "lock", value: function() {
this.locked = true;
} }, { key: "unlock", value: function() {
this.locked = false;
} }]) && j(V.prototype, F), Object.defineProperty(V, "prototype", { writable: false }), T;
}(), P = K(7907), N = K(6056), A = K(6617), X = K(233), f = K.n(X), R = K(2602), y = K(9791), C = K(6210), d = K(2558), h = K(4188);
function l(T) {
return function(V) {
if (Array.isArray(V))
return a(V);
}(T) || function(V) {
if (typeof Symbol < "u" && V[Symbol.iterator] != null || V["@@iterator"] != null)
return Array.from(V);
}(T) || i(T) || function() {
throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}();
}
function n(T, V) {
return function(F) {
if (Array.isArray(F))
return F;
}(T) || function(F, I) {
var S = F == null ? null : typeof Symbol < "u" && F[Symbol.iterator] || F["@@iterator"];
if (S != null) {
var L, O, J, re, pe = [], me = true, ye = false;
try {
if (J = (S = S.call(F)).next, I === 0) {
if (Object(S) !== S)
return;
me = false;
} else
for (; !(me = (L = J.call(S)).done) && (pe.push(L.value), pe.length !== I); me = true)
;
} catch (xe) {
ye = true, O = xe;
} finally {
try {
if (!me && S.return != null && (re = S.return(), Object(re) !== re))
return;
} finally {
if (ye)
throw O;
}
}
return pe;
}
}(T, V) || i(T, V) || function() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}();
}
function o(T, V) {
var F, I, S, L, O = typeof Symbol < "u" && T[Symbol.iterator] || T["@@iterator"];
if (O)
return I = !(F = true), { s: function() {
O = O.call(T);
}, n: function() {
var J = O.next();
return F = J.done, J;
}, e: function(J) {
I = true, S = J;
}, f: function() {
try {
F || O.return == null || O.return();
} finally {
if (I)
throw S;
}
} };
if (Array.isArray(T) || (O = i(T)) || V && T && typeof T.length == "number")
return O && (T = O), L = 0, { s: V = function() {
}, n: function() {
return L >= T.length ? { done: true } : { done: false, value: T[L++] };
}, e: function(J) {
throw J;
}, f: V };
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function i(T, V) {
var F;
if (T)
return typeof T == "string" ? a(T, V) : (F = (F = Object.prototype.toString.call(T).slice(8, -1)) === "Object" && T.constructor ? T.constructor.name : F) === "Map" || F === "Set" ? Array.from(T) : F === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F) ? a(T, V) : void 0;
}
function a(T, V) {
(V == null || V > T.length) && (V = T.length);
for (var F = 0, I = new Array(V); F < V; F++)
I[F] = T[F];
return I;
}
function r(T) {
return (r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(V) {
return typeof V;
} : function(V) {
return V && typeof Symbol == "function" && V.constructor === Symbol && V !== Symbol.prototype ? "symbol" : typeof V;
})(T);
}
function e2(T, V) {
for (var F = 0; F < V.length; F++) {
var I = V[F];
I.enumerable = I.enumerable || false, I.configurable = true, "value" in I && (I.writable = true), Object.defineProperty(T, function(S) {
return S = function(L, O) {
if (r(L) !== "object" || L === null)
return L;
var J = L[Symbol.toPrimitive];
if (J === void 0)
return (O === "string" ? String : Number)(L);
if (J = J.call(L, O || "default"), r(J) !== "object")
return J;
throw new TypeError("@@toPrimitive must return a primitive value.");
}(S, "string"), r(S) === "symbol" ? S : String(S);
}(I.key), I);
}
}
var t = function() {
function T(I, S) {
if (!(this instanceof T))
throw new TypeError("Cannot call a class as a function");
this.editor = I, this.dom = {}, this.expanded = false, S && S instanceof Object ? (this.setField(S.field, S.fieldEditable), "value" in S && this.setValue(S.value, S.type), "internalValue" in S && this.setInternalValue(S.internalValue)) : (this.setField(""), this.setValue(null)), this._debouncedOnChangeValue = (0, y.debounce)(this._onChangeValue.bind(this), T.prototype.DEBOUNCE_INTERVAL), this._debouncedOnChangeField = (0, y.debounce)(this._onChangeField.bind(this), T.prototype.DEBOUNCE_INTERVAL), this.visibleChilds = this.getMaxVisibleChilds();
}
var V, F;
return V = T, (F = [{ key: "getMaxVisibleChilds", value: function() {
return this.editor && this.editor.options && this.editor.options.maxVisibleChilds ? this.editor.options.maxVisibleChilds : s;
} }, { key: "_updateEditability", value: function() {
var I, S;
this.editable = { field: true, value: true }, this.editor && (this.editable.field = this.editor.options.mode === "tree", this.editable.value = this.editor.options.mode !== "view", this.editor.options.mode !== "tree" && this.editor.options.mode !== "form" || typeof this.editor.options.onEditable != "function" || (I = this.getValue.bind(this), typeof (S = this.editor.options.onEditable({ field: this.field, get value() {
return I();
}, path: this.getPath() })) == "boolean" ? (this.editable.field = S, this.editable.value = S) : r(S) === "object" && S !== null ? (typeof S.field == "boolean" && (this.editable.field = S.field), typeof S.value == "boolean" && (this.editable.value = S.value)) : (this.editable.field = false, this.editable.value = false)));
} }, { key: "getPath", value: function() {
for (var I = this, S = []; I; ) {
var L = I.getName();
L !== void 0 && S.unshift(L), I = I.parent;
}
return S;
} }, { key: "getInternalPath", value: function() {
for (var I = this, S = []; I; )
I.parent && S.unshift(I.getIndex()), I = I.parent;
return S;
} }, { key: "getName", value: function() {
return this.parent ? this.parent.type !== "array" ? this.field : this.index : void 0;
} }, { key: "findNodeByPath", value: function(I) {
if (I) {
if (I.length === 0)
return this;
if (I.length && this.childs && this.childs.length) {
for (var S = 0; S < this.childs.length; ++S)
if ("" + I[0] == "" + this.childs[S].getName())
return this.childs[S].findNodeByPath(I.slice(1));
}
}
} }, { key: "findNodeByInternalPath", value: function(I) {
if (I) {
for (var O = this, S = 0; S < I.length && O; S++)
var L = I[S], O = O.childs[L];
return O;
}
} }, { key: "serialize", value: function() {
return { value: this.getValue(), path: this.getPath() };
} }, { key: "findNode", value: function(I) {
for (var S = (0, y.parsePath)(I), L = this; L && 0 < S.length; )
(function() {
var O = S.shift();
if (typeof O == "number") {
if (L.type !== "array")
throw new Error("Cannot get child node at index " + O + ": node is no array");
L = L.childs[O];
} else {
if (L.type !== "object")
throw new Error("Cannot get child node " + O + ": node is no object");
L = L.childs.filter(function(J) {
return J.field === O;
})[0];
}
})();
return L;
} }, { key: "findParents", value: function() {
for (var I = [], S = this.parent; S; )
I.unshift(S), S = S.parent;
return I;
} }, { key: "setError", value: function(I, S) {
this.error = I, this.errorChild = S, this.dom && this.dom.tr && this.updateError();
} }, { key: "updateError", value: function() {
var I = this, S = this.fieldError || this.valueError || this.error, L = this.dom.tdError;
if (S && this.dom && this.dom.tr) {
(0, y.addClassName)(this.dom.tr, "jsoneditor-validation-error"), L || (L = document.createElement("td"), this.dom.tdError = L, this.dom.tdValue.parentNode.appendChild(L));
var O = document.createElement("button"), J = (O.type = "button", O.className = "jsoneditor-button jsoneditor-schema-error", function() {
I.dom.popupAnchor && I.dom.popupAnchor.destroy();
}), re = function() {
delete I.dom.popupAnchor;
}, pe = function(be) {
var xe = I.editor.frame, be = (I.dom.popupAnchor = (0, R.w)(O, I.editor.getPopupAnchor(), re, be), O.getBoundingClientRect()), xe = 120 < xe.getBoundingClientRect().width - be.x ? "jsoneditor-above" : "jsoneditor-left", be = document.createElement("div");
be.className = "jsoneditor-popover " + xe, be.appendChild(document.createTextNode(S.message)), I.dom.popupAnchor.appendChild(be);
}, me = (O.onmouseover = function() {
I.dom.popupAnchor || pe(true);
}, O.onfocus = function() {
J(), pe(false);
}, O.onblur = function() {
J();
}, this.errorChild);
for (me && (O.onclick = function() {
me.findParents().forEach(function(ye) {
ye.expand(false);
}), me.scrollTo(function() {
me.focus();
});
}); L.firstChild; )
L.removeChild(L.firstChild);
L.appendChild(O);
} else
this.dom.tr && (0, y.removeClassName)(this.dom.tr, "jsoneditor-validation-error"), L && (this.dom.tdError.parentNode.removeChild(this.dom.tdError), delete this.dom.tdError);
} }, { key: "getIndex", value: function() {
var I;
return this.parent ? (I = this.parent.childs.indexOf(this)) !== -1 ? I : null : -1;
} }, { key: "setParent", value: function(I) {
this.parent = I;
} }, { key: "setField", value: function(I, S) {
this.field = I, this.previousField = I, this.fieldEditable = S === true;
} }, { key: "getField", value: function() {
return this.field === void 0 && this._getDomField(), this.field;
} }, { key: "setValue", value: function(I, S) {
var L, O, J, re, pe, me, ye = this.childs;
if (this.type = this._getType(I), S && S !== this.type) {
if (S !== "string" || this.type !== "auto")
throw new Error('Type mismatch: cannot cast value of type "' + this.type + ' to the specified type "' + S + '"');
this.type = S;
}
if (this.type === "array") {
for (this.childs || (this.childs = []), L = 0; L < I.length; L++)
(pe = I[L]) === void 0 || pe instanceof Function || (L < this.childs.length ? ((J = this.childs[L]).fieldEditable = false, J.index = L, J.setValue(pe)) : (J = new T(this.editor, { value: pe }), re = L < this.getMaxVisibleChilds(), this.appendChild(J, re, false)));
for (O = this.childs.length; O >= I.length; O--)
this.removeChild(this.childs[O], false);
} else if (this.type === "object") {
for (this.childs || (this.childs = []), O = this.childs.length - 1; 0 <= O; O--)
g(I, this.childs[O].field) || this.removeChild(this.childs[O], false);
for (var xe in L = 0, I)
g(I, xe) && ((pe = I[xe]) === void 0 || pe instanceof Function || ((me = this.findChildByProperty(xe)) ? (me.setField(xe, true), me.setValue(pe)) : (me = new T(this.editor, { field: xe, value: pe }), xe = L < this.getMaxVisibleChilds(), this.appendChild(me, xe, false))), L++);
!(this.value = "") === this.editor.options.sortObjectKeys && this.sort([], "asc", false);
} else
this.hideChilds(), delete this.append, delete this.showMore, delete this.expanded, delete this.childs, this.value = I;
Array.isArray(ye) !== Array.isArray(this.childs) && this.recreateDom(), this.updateDom({ updateIndexes: true }), this.previousValue = this.value;
} }, { key: "setInternalValue", value: function(I) {
var S, L, O, J, re, pe = this.childs;
if (this.type = I.type, I.type === "array") {
for (this.childs || (this.childs = []), J = 0; J < I.childs.length; J++)
(S = I.childs[J]) === void 0 || S instanceof Function || (J < this.childs.length ? ((L = this.childs[J]).fieldEditable = false, L.index = J, L.setInternalValue(S)) : (L = new T(this.editor, { internalValue: S }), O = J < this.getMaxVisibleChilds(), this.appendChild(L, O, false)));
for (re = this.childs.length; re >= I.childs.length; re--)
this.removeChild(this.childs[re], false);
} else if (I.type === "object") {
for (this.childs || (this.childs = []), J = 0; J < I.childs.length; J++)
(S = I.childs[J]) === void 0 || S instanceof Function || (J < this.childs.length ? (delete (L = this.childs[J]).index, L.setField(S.field, true), L.setInternalValue(S.value)) : (L = new T(this.editor, { field: S.field, internalValue: S.value }), O = J < this.getMaxVisibleChilds(), this.appendChild(L, O, false)));
for (re = this.childs.length; re >= I.childs.length; re--)
this.removeChild(this.childs[re], false);
} else
this.hideChilds(), delete this.append, delete this.showMore, delete this.expanded, delete this.childs, this.value = I.value;
Array.isArray(pe) !== Array.isArray(this.childs) && this.recreateDom(), this.updateDom({ updateIndexes: true }), this.previousValue = this.value;
} }, { key: "recreateDom", value: function() {
var I;
this.dom && this.dom.tr && this.dom.tr.parentNode ? (I = this._detachFromDom(), this.clearDom(), this._attachToDom(I)) : this.clearDom();
} }, { key: "getValue", value: function() {
var I, S;
return this.type === "array" ? (I = [], this.childs.forEach(function(L) {
I.push(L.getValue());
}), I) : this.type === "object" ? (S = {}, this.childs.forEach(function(L) {
S[L.getField()] = L.getValue();
}), S) : (this.value === void 0 && this._getDomValue(), this.value);
} }, { key: "getInternalValue", value: function() {
return this.type === "array" ? { type: this.type, childs: this.childs.map(function(I) {
return I.getInternalValue();
}) } : this.type === "object" ? { type: this.type, childs: this.childs.map(function(I) {
return { field: I.getField(), value: I.getInternalValue() };
}) } : (this.value === void 0 && this._getDomValue(), { type: this.type, value: this.value });
} }, { key: "getLevel", value: function() {
return this.parent ? this.parent.getLevel() + 1 : 0;
} }, { key: "getNodePath", value: function() {
var I = this.parent ? this.parent.getNodePath() : [];
return I.push(this), I;
} }, { key: "clone", value: function() {
var I, S;
return (I = new T(this.editor)).type = this.type, I.field = this.field, I.fieldInnerText = this.fieldInnerText, I.fieldEditable = this.fieldEditable, I.previousField = this.previousField, I.value = this.value, I.valueInnerText = this.valueInnerText, I.previousValue = this.previousValue, I.expanded = this.expanded, I.visibleChilds = this.visibleChilds, this.childs ? (S = [], this.childs.forEach(function(L) {
L = L.clone(), L.setParent(I), S.push(L);
}), I.childs = S) : I.childs = void 0, I;
} }, { key: "expand", value: function(I) {
this.childs && (this.expanded = true, this.dom.expand && (this.dom.expand.className = "jsoneditor-button jsoneditor-expanded"), this.showChilds(), I !== false && this.childs.forEach(function(S) {
S.expand(I);
}), this.updateDom({ recurse: false }));
} }, { key: "collapse", value: function(I) {
this.childs && (this.hideChilds(), I !== false && this.childs.forEach(function(S) {
S.collapse(I);
}), this.dom.expand && (this.dom.expand.className = "jsoneditor-button jsoneditor-collapsed"), this.expanded = false, this.updateDom({ recurse: false }));
} }, { key: "showChilds", value: function() {
var I = this.childs;
if (I && this.expanded) {
var I = this.dom.tr, S = I ? I.parentNode : void 0;
if (S) {
for (var L = this.getAppendDom(), O = (L.parentNode || ((J = I.nextSibling) ? S.insertBefore(L, J) : S.appendChild(L)), Math.min(this.childs.length, this.visibleChilds)), J = this._getNextTr(), re = 0; re < O; re++) {
var pe = this.childs[re];
pe.getDom().parentNode || S.insertBefore(pe.getDom(), J), pe.showChilds();
}
I = this.getShowMoreDom(), J = this._getNextTr(), I.parentNode || S.insertBefore(I, J), this.showMore.updateDom();
}
}
} }, { key: "_getNextTr", value: function() {
return this.showMore && this.showMore.getDom().parentNode ? this.showMore.getDom() : this.append && this.append.getDom().parentNode ? this.append.getDom() : void 0;
} }, { key: "hide", value: function(I) {
var S = this.dom.tr, L = S ? S.parentNode : void 0;
L && L.removeChild(S), this.dom.popupAnchor && this.dom.popupAnchor.destroy(), this.hideChilds(I);
} }, { key: "hideChilds", value: function(I) {
var S;
this.childs && this.expanded && ((S = this.getAppendDom()).parentNode && S.parentNode.removeChild(S), this.childs.forEach(function(L) {
L.hide();
}), (S = this.getShowMoreDom()).parentNode && S.parentNode.removeChild(S), I && !I.resetVisibleChilds || (this.visibleChilds = this.getMaxVisibleChilds()));
} }, { key: "_updateCssClassName", value: function() {
var I, S;
this.dom.field && this.editor && this.editor.options && typeof this.editor.options.onClassName == "function" && this.dom.tree && ((0, y.removeAllClassNames)(this.dom.tree), I = this.getValue.bind(this), S = this.editor.options.onClassName({ path: this.getPath(), field: this.field, get value() {
return I();
} }) || "", (0, y.addClassName)(this.dom.tree, "jsoneditor-values " + S));
} }, { key: "recursivelyUpdateCssClassesOnNodes", value: function() {
if (this._updateCssClassName(), Array.isArray(this.childs))
for (var I = 0; I < this.childs.length; I++)
this.childs[I].recursivelyUpdateCssClassesOnNodes();
} }, { key: "expandTo", value: function() {
for (var I = this.parent; I; )
I.expanded || I.expand(), I = I.parent;
} }, { key: "appendChild", value: function(I, S, L) {
var O, J;
this._hasChilds() && (I.setParent(this), I.fieldEditable = this.type === "object", this.type === "array" && (I.index = this.childs.length), this.type === "object" && I.field === void 0 && I.setField(""), this.childs.push(I), this.expanded && S !== false && (S = I.getDom(), J = (O = this._getNextTr()) ? O.parentNode : void 0, O && J && J.insertBefore(S, O), I.showChilds(), this.visibleChilds++), L !== false) && (this.updateDom({ updateIndexes: true }), I.updateDom({ recurse: true }));
} }, { key: "moveBefore", value: function(I, S, L) {
var O, J, re;
this._hasChilds() && ((O = this.dom.tr ? this.dom.tr.parentNode : void 0) && ((J = document.createElement("tr")).style.height = O.clientHeight + "px", O.appendChild(J)), I.parent && I.parent.removeChild(I), S instanceof b || !S ? this.childs.length + 1 > this.visibleChilds ? (re = this.childs[this.visibleChilds - 1], this.insertBefore(I, re, L)) : this.appendChild(I, true, L) : this.insertBefore(I, S, L), O) && J && O.removeChild(J);
} }, { key: "insertBefore", value: function(I, S, L) {
if (this._hasChilds()) {
if (this.visibleChilds++, this.type === "object" && I.field === void 0 && I.setField(""), S === this.append)
I.setParent(this), I.fieldEditable = this.type === "object", this.childs.push(I);
else {
var O = this.childs.indexOf(S);
if (O === -1)
throw new Error("Node not found");
I.setParent(this), I.fieldEditable = this.type === "object", this.childs.splice(O, 0, I);
}
var J;
this.expanded && (O = I.getDom(), J = (S = S.getDom()) ? S.parentNode : void 0, S && J && J.insertBefore(O, S), I.showChilds(), this.showChilds()), L !== false && (this.updateDom({ updateIndexes: true }), I.updateDom({ recurse: true }));
}
} }, { key: "insertAfter", value: function(I, S) {
this._hasChilds() && (S = this.childs.indexOf(S), (S = this.childs[S + 1]) ? this.insertBefore(I, S) : this.appendChild(I));
} }, { key: "search", value: function(I, S) {
Array.isArray(S) || (S = []);
var L = I ? I.toLowerCase() : void 0;
return delete this.searchField, delete this.searchValue, this.field !== void 0 && S.length <= this.MAX_SEARCH_RESULTS && (String(this.field).toLowerCase().indexOf(L) !== -1 && (this.searchField = true, S.push({ node: this, elem: "field" })), this._updateDomField()), this._hasChilds() ? this.childs && this.childs.forEach(function(O) {
O.search(I, S);
}) : this.value !== void 0 && S.length <= this.MAX_SEARCH_RESULTS && (String(this.value).toLowerCase().indexOf(L) !== -1 && (this.searchValue = true, S.push({ node: this, elem: "value" })), this._updateDomValue()), S;
} }, { key: "scrollTo", value: function(I) {
this.expandPathToNode(), this.dom.tr && this.dom.tr.parentNode && this.editor.scrollTo(this.dom.tr.offsetTop, I);
} }, { key: "expandPathToNode", value: function() {
for (var I = this; I && I.parent; ) {
for (var S = I.parent.type === "array" ? I.index : I.parent.childs.indexOf(I); I.parent.visibleChilds < S + 1; )
I.parent.visibleChilds += this.getMaxVisibleChilds();
I.parent.expand(false), I = I.parent;
}
} }, { key: "focus", value: function(I) {
if (T.focusElement = I, this.dom.tr && this.dom.tr.parentNode) {
var S = this.dom;
switch (I) {
case "drag":
(S.drag || S.menu).focus();
break;
case "menu":
S.menu.focus();
break;
case "expand":
this._hasChilds() ? S.expand.focus() : S.field && this.fieldEditable ? (S.field.focus(), (0, y.selectContentEditable)(S.field)) : S.value && !this._hasChilds() ? (S.value.focus(), (0, y.selectContentEditable)(S.value)) : S.menu.focus();
break;
case "field":
S.field && this.fieldEditable ? (S.field.focus(), (0, y.selectContentEditable)(S.field)) : S.value && !this._hasChilds() ? (S.value.focus(), (0, y.selectContentEditable)(S.value)) : (this._hasChilds() ? S.expand : S.menu).focus();
break;
default:
S.select ? S.select.focus() : S.value && !this._hasChilds() ? (S.value.focus(), (0, y.selectContentEditable)(S.value)) : S.field && this.fieldEditable ? (S.field.focus(), (0, y.selectContentEditable)(S.field)) : (this._hasChilds() ? S.expand : S.menu).focus();
}
}
} }, { key: "containsNode", value: function(I) {
if (this === I)
return true;
var S = this.childs;
if (S) {
for (var L = 0, O = S.length; L < O; L++)
if (S[L].containsNode(I))
return true;
}
return false;
} }, { key: "removeChild", value: function(I, S) {
if (this.childs) {
var L = this.childs.indexOf(I);
if (L !== -1)
return L < this.visibleChilds && this.expanded && this.visibleChilds--, I.hide(), delete I.searchField, delete I.searchValue, (I = this.childs.splice(L, 1)[0]).parent = null, S !== false && this.updateDom({ updateIndexes: true }), I;
}
} }, { key: "_remove", value: function(I) {
this.removeChild(I);
} }, { key: "changeType", value: function(I) {
var S, L = this.type;
L !== I && (I !== "string" && I !== "auto" || L !== "string" && L !== "auto" ? (S = this._detachFromDom(), this.clearDom(), (this.type = I) === "object" ? (this.childs || (this.childs = []), this.childs.forEach(function(O) {
O.clearDom(), delete O.index, O.fieldEditable = true, O.field === void 0 && (O.field = "");
}), L !== "string" && L !== "auto" || (this.expanded = true)) : I === "array" ? (this.childs || (this.childs = []), this.childs.forEach(function(O, J) {
O.clearDom(), O.fieldEditable = false, O.index = J;
}), L !== "string" && L !== "auto" || (this.expanded = true)) : this.expanded = false, this._attachToDom(S)) : this.type = I, I !== "auto" && I !== "string" || (this.value = I === "string" ? String(this.value) : (0, y.parseString)(String(this.value)), this.focus()), this.updateDom({ updateIndexes: true }));
} }, { key: "deepEqual", value: function(I) {
var S;
if (this.type === "array") {
if (!Array.isArray(I) || this.childs.length !== I.length)
return false;
for (S = 0; S < this.childs.length; S++)
if (!this.childs[S].deepEqual(I[S]))
return false;
} else if (this.type === "object") {
if (r(I) !== "object" || !I)
return false;
var L = Object.keys(I);
if (this.childs.length !== L.length)
return false;
for (S = 0; S < L.length; S++) {
var O = this.childs[S];
if (O.field !== L[S] || !O.deepEqual(I[O.field]))
return false;
}
} else if (this.value !== I)
return false;
return true;
} }, { key: "_getDomValue", value: function() {
if (this._clearValueError(), this.dom.value && this.type !== "array" && this.type !== "object" && (this.valueInnerText = (0, y.getInnerText)(this.dom.value), this.valueInnerText === "") && this.dom.value.innerHTML !== "" && (this.dom.value.textContent = ""), this.valueInnerText !== void 0)
try {
var I, S;
(S = this.type === "string" ? this._unescapeHTML(this.valueInnerText) : (I = this._unescapeHTML(this.valueInnerText), (0, y.parseString)(I))) !== this.value && (this.value = S, this._debouncedOnChangeValue());
} catch {
this._setValueError((0, P.Iu)("cannotParseValueError"));
}
} }, { key: "_setValueError", value: function(I) {
this.valueError = { message: I }, this.updateError();
} }, { key: "_clearValueError", value: function() {
this.valueError && (this.valueError = null, this.updateError());
} }, { key: "_setFieldError", value: function(I) {
this.fieldError = { message: I }, this.updateError();
} }, { key: "_clearFieldError", value: function() {
this.fieldError && (this.fieldError = null, this.updateError());
} }, { key: "_onChangeValue", value: function() {
var I, S = this.editor.getDomSelection(), L = (S.range && (L = (0, y.textDiff)(String(this.value), String(this.previousValue)), S.range.startOffset = L.start, S.range.endOffset = L.end), this.editor.getDomSelection());
L.range && (I = (0, y.textDiff)(String(this.previousValue), String(this.value)), L.range.startOffset = I.start, L.range.endOffset = I.end), this.editor._onAction("editValue", { path: this.getInternalPath(), oldValue: this.previousValue, newValue: this.value, oldSelection: S, newSelection: L }), this.previousValue = this.value;
} }, { key: "_onChangeField", value: function() {
var I = this.editor.getDomSelection(), S = this.previousField || "", L = (I.range && (L = (0, y.textDiff)(this.field, S), I.range.startOffset = L.start, I.range.endOffset = L.end), this.editor.getDomSelection());
L.range && (S = (0, y.textDiff)(S, this.field), L.range.startOffset = S.start, L.range.endOffset = S.end), this.editor._onAction("editField", { parentPath: this.parent.getInternalPath(), index: this.getIndex(), oldValue: this.previousField, newValue: this.field, oldSelection: I, newSelection: L }), this.previousField = this.field;
} }, { key: "_updateDomValue", value: function() {
var I = this.dom.value;
if (I) {
var S = ["jsoneditor-value"], L = this.value, O = this.type === "auto" ? (0, y.getType)(L) : this.type, J = O === "string" && (0, y.isUrl)(L);
if (S.push("jsoneditor-" + O), J && S.push("jsoneditor-url"), String(this.value) === "" && this.type !== "array" && this.type !== "object" && S.push("jsoneditor-empty"), this.searchValueActive && S.push("jsoneditor-highlight-active"), this.searchValue && S.push("jsoneditor-highlight"), I.className = S.join(" "), O === "array" || O === "object" ? (S = this.childs ? this.childs.length : 0, I.title = this.type + " containing " + S + " items") : J && this.editable.value ? I.title = (0, P.Iu)("openUrl") : I.title = "", O === "boolean" && this.editable.value ? (this.dom.checkbox || (this.dom.checkbox = document.createElement("input"), this.dom.checkbox.type = "checkbox", this.dom.tdCheckbox = document.createElement("td"), this.dom.tdCheckbox.className = "jsoneditor-tree", this.dom.tdCheckbox.appendChild(this.dom.checkbox), this.dom.tdValue.parentNode.insertBefore(this.dom.tdCheckbox, this.dom.tdValue)), this.dom.checkbox.checked = this.value) : this.dom.tdCheckbox && (this.dom.tdCheckbox.parentNode.removeChild(this.dom.tdCheckbox), delete this.dom.tdCheckbox, delete this.dom.checkbox), this.enum && this.editable.value ? (this.dom.select || (this.dom.select = document.createElement("select"), this.id = this.field + "_" + (/* @__PURE__ */ new Date()).getUTCMilliseconds(), this.dom.select.id = this.id, this.dom.select.name = this.dom.select.id, (S = document.createElement("option")).value = "", S.textContent = "--", this.dom.select.appendChild(S), this._updateEnumOptions(), this.dom.tdSelect = document.createElement("td"), this.dom.tdSelect.className = "jsoneditor-tree", this.dom.tdSelect.appendChild(this.dom.select), this.dom.tdValue.parentNode.insertBefore(this.dom.tdSelect, this.dom.tdValue)), this.dom.select.value = this.enum.indexOf(this.value) !== -1 ? this.value : "", !this.schema || g(this.schema, "oneOf") || g(this.schema, "anyOf") || g(this.schema, "allOf") ? delete this.valueFieldHTML : (this.valueFieldHTML = this.dom.tdValue.innerHTML, this.dom.tdValue.style.visibility = "hidden", this.dom.tdValue.textContent = "")) : this.dom.tdSelect && (this.dom.tdSelect.parentNode.removeChild(this.dom.tdSelect), delete this.dom.tdSelect, delete this.dom.select, this.dom.tdValue.innerHTML = this.valueFieldHTML, this.dom.tdValue.style.visibility = "", delete this.valueFieldHTML, this.dom.tdValue.appendChild(this.dom.value)), this.editor.options.colorPicker && typeof L == "string" && (0, y.isValidColor)(L) ? (this.dom.color || (this.dom.color = document.createElement("div"), this.dom.color.className = "jsoneditor-color", this.dom.tdColor = document.createElement("td"), this.dom.tdColor.className = "jsoneditor-tree", this.dom.tdColor.appendChild(this.dom.color), this.dom.tdValue.parentNode.insertBefore(this.dom.tdColor, this.dom.tdValue)), (0, y.addClassName)(this.dom.value, "jsoneditor-color-value"), (this.editable.value ? y.removeClassName : y.addClassName)(this.dom.color, "jsoneditor-color-readonly"), this.dom.color.style.backgroundColor = L) : this._deleteDomColor(), this._showTimestampTag()) {
if (this.dom.date || (this.dom.date = document.createElement("div"), this.dom.date.className = "jsoneditor-date", this.dom.value.parentNode.appendChild(this.dom.date)), J = null, J = typeof this.editor.options.timestampFormat == "function" ? this.editor.options.timestampFormat({ field: this.field, value: this.value, path: this.getPath() }) : J) {
for (; this.dom.date.firstChild; )
this.dom.date.removeChild(this.dom.date.firstChild);
this.dom.date.appendChild(document.createTextNode(J));
} else
this.dom.date.textContent = new Date(L).toISOString();
this.dom.date.title = new Date(L).toString();
} else
this.dom.date && (this.dom.date.parentNode.removeChild(this.dom.date), delete this.dom.date);
(0, y.stripFormatting)(I), this._updateDomDefault();
}
} }, { key: "_updateEnumOptions", value: function() {
if (this.enum && this.dom.select) {
this.dom.select.innerHTML = "";
for (var I = 0; I < this.enum.length; I++) {
var S = document.createElement("option");
S.value = this.enum[I], S.textContent = this.enum[I], this.dom.select.appendChild(S);
}
}
} }, { key: "_deleteDomColor", value: function() {
this.dom.color && (this.dom.tdColor.parentNode.removeChild(this.dom.tdColor), delete this.dom.tdColor, delete this.dom.color, (0, y.removeClassName)(this.dom.value, "jsoneditor-color-value"));
} }, { key: "_updateDomField", value: function() {
var I, S = this.dom.field;
S && ((I = (0, y.makeFieldTooltip)(this.schema, this.editor.options.language)) && (S.title = I), (String(this.field) === "" && this.parent && this.parent.type !== "array" ? y.addClassName : y.removeClassName)(S, "jsoneditor-empty"), (this.searchFieldActive ? y.addClassName : y.removeClassName)(S, "jsoneditor-highlight-active"), (this.searchField ? y.addClassName : y.removeClassName)(S, "jsoneditor-highlight"), (0, y.stripFormatting)(S));
} }, { key: "_getDomField", value: function(I) {
if (this._clearFieldError(), this.dom.field && this.fieldEditable && (this.fieldInnerText = (0, y.getInnerText)(this.dom.field), this.fieldInnerText === "") && this.dom.field.innerHTML !== "" && (this.dom.field.textContent = ""), this.fieldInnerText !== void 0)
try {
var S = this._unescapeHTML(this.fieldInnerText), L = this.parent.getFieldNames(this);
L.indexOf(S) !== -1 ? I ? (S = (0, y.findUniqueName)(S, L)) !== this.field && (this.field = S, this._debouncedOnChangeField()) : this._setFieldError((0, P.Iu)("duplicateFieldError")) : S !== this.field && (this.field = S, this._debouncedOnChangeField());
} catch {
this._setFieldError((0, P.Iu)("cannotParseFieldError"));
}
} }, { key: "_updateDomDefault", value: function() {
var I;
this.schema && this.schema.default !== void 0 && !this._hasChilds() && (I = this.dom.select || this.dom.value) && (this.value === this.schema.default ? (I.title = (0, P.Iu)("default"), (0, y.addClassName)(I, "jsoneditor-is-default"), y.removeClassName) : (I.removeAttribute("title"), (0, y.removeClassName)(I, "jsoneditor-is-default"), y.addClassName))(I, "jsoneditor-is-not-default");
} }, { key: "_showTimestampTag", value: function() {
var I, S;
return typeof this.value == "number" && (typeof (I = this.editor.options.timestampTag) == "function" ? typeof (S = I({ field: this.field, value: this.value, path: this.getPath() })) == "boolean" ? S : (0, y.isTimestamp)(this.field, this.value) : I === true && (0, y.isTimestamp)(this.field, this.value));
} }, { key: "clearDom", value: function() {
this.dom = {};
} }, { key: "getDom", value: function() {
var I, S, L = this.dom;
return L.tr || (this._updateEditability(), L.tr = document.createElement("tr"), (L.tr.node = this).editor.options.mode === "tree" && (S = document.createElement("td"), this.editable.field && this.parent && ((I = document.createElement("button")).type = "button", (L.drag = I).className = "jsoneditor-button jsoneditor-dragarea", I.title = (0, P.Iu)("drag"), S.appendChild(I)), L.tr.appendChild(S), I = document.createElement("td"), (S = document.createElement("button")).type = "button", (L.menu = S).className = "jsoneditor-button jsoneditor-contextmenu-button", S.title = (0, P.Iu)("actionsMenu"), I.appendChild(L.menu), L.tr.appendChild(I)), S = document.createElement("td"), L.tr.appendChild(S), L.tree = this._createDomTree(), S.appendChild(L.tree), this.updateDom({ updateIndexes: true })), L.tr;
} }, { key: "isVisible", value: function() {
return this.dom && this.dom.tr && this.dom.tr.parentNode || false;
} }, { key: "isDescendantOf", value: function(I) {
for (var S = this.parent; S; ) {
if (S === I)
return true;
S = S.parent;
}
return false;
} }, { key: "_createDomField", value: function() {
return document.createElement("div");
} }, { key: "setHighlight", value: function(I) {
this.dom.tr && ((I ? y.addClassName : y.removeClassName)(this.dom.tr, "jsoneditor-highlight"), this.append && this.append.setHighlight(I), this.childs) && this.childs.forEach(function(S) {
S.setHighlight(I);
});
} }, { key: "setSelected", value: function(I, S) {
this.selected = I, this.dom.tr && ((I ? y.addClassName : y.removeClassName)(this.dom.tr, "jsoneditor-selected"), (S ? y.addClassName : y.removeClassName)(this.dom.tr, "jsoneditor-first"), this.append && this.append.setSelected(I), this.showMore && this.showMore.setSelected(I), this.childs) && this.childs.forEach(function(L) {
L.setSelected(I);
});
} }, { key: "updateValue", value: function(I) {
this.value = I, this.previousValue = I, this.valueError = void 0, this.updateDom();
} }, { key: "updateField", value: function(I) {
this.field = I, this.previousField = I, this.fieldError = void 0, this.updateDom();
} }, { key: "updateDom", value: function(I) {
var S, L = this.dom.tree, L = (L && (L.style.marginLeft = 24 * this.getLevel() + "px"), this.dom.field), L = (L && (this.fieldEditable ? (L.contentEditable = this.editable.field, L.spellcheck = false, L.className = "jsoneditor-field") : (L.contentEditable = false, L.className = "jsoneditor-readonly"), S = this.index !== void 0 ? this.index : this.field !== void 0 ? this.field : (S = this.editor.options.schema ? T._findSchema(this.editor.options.schema, this.editor.options.schemaRefs || {}, this.getPath()) : void 0) && S.title ? S.title : this._hasChilds() ? this.type : "", S = this._escapeHTML(S), document.activeElement !== L && S !== this._unescapeHTML((0, y.getInnerText)(L)) && (L.innerHTML = S), this._updateSchema(), this._updateEnumOptions()), this.dom.value), L = (L && (this.type === "array" || this.type === "object" ? this.updateNodeName() : (S = this._escapeHTML(this.value), document.activeElement !== L && S !== this._unescapeHTML((0, y.getInnerText)(L)) && (L.innerHTML = S))), this.dom.tr);
L && (this.type === "array" || this.type === "object" ? ((0, y.addClassName)(L, "jsoneditor-expandable"), this.expanded ? ((0, y.addClassName)(L, "jsoneditor-expanded"), (0, y.removeClassName)(L, "jsoneditor-collapsed")) : ((0, y.addClassName)(L, "jsoneditor-collapsed"), (0, y.removeClassName)(L, "jsoneditor-expanded"))) : ((0, y.removeClassName)(L, "jsoneditor-expandable"), (0, y.removeClassName)(L, "jsoneditor-expanded"), (0, y.removeClassName)(L, "jsoneditor-collapsed"))), this._updateDomField(), this._updateDomValue(), I && I.updateIndexes === true && this._updateDomIndexes(), I && I.recurse === true && this.childs && this.childs.forEach(function(O) {
O.updateDom(I);
}), this.error && this.updateError(), this.append && this.append.updateDom(), this.showMore && this.showMore.updateDom(), this._updateCssClassName();
} }, { key: "_updateSchema", value: function() {
this.editor && this.editor.options && (this.schema = this.editor.options.schema ? T._findSchema(this.editor.options.schema, this.editor.options.schemaRefs || {}, this.getPath()) : null, this.schema ? this.enum = T._findEnum(this.schema) : delete this.enum);
} }, { key: "_updateDomIndexes", value: function() {
var I = this.dom.value, S = this.childs;
I && S && (this.type === "array" ? S.forEach(function(L, O) {
L.index = O, L = L.dom.field, L && (L.textContent = O);
}) : this.type === "object" && S.forEach(function(L) {
L.index !== void 0 && (delete L.index, L.field === void 0) && (L.field = "");
}));
} }, { key: "_createDomValue", value: function() {
var I;
return this.type === "array" ? (I = document.createElement("div")).textContent = "[...]" : this.type === "object" ? (I = document.createElement("div")).textContent = "{...}" : (!this.editable.value && (0, y.isUrl)(this.value) ? (I = document.createElement("a")).href = this.value : ((I = document.createElement("div")).contentEditable = this.editable.value, I.spellcheck = false), I.innerHTML = this._escapeHTML(this.value)), I;
} }, { key: "_createDomExpandButton", value: function() {
var I = document.createElement("button");
return I.type = "button", this._hasChilds() ? (I.className = this.expanded ? "jsoneditor-button jsoneditor-expanded" : "jsoneditor-button jsoneditor-collapsed", I.title = (0, P.Iu)("expandTitle")) : (I.className = "jsoneditor-button jsoneditor-invisible", I.title = ""), I;
} }, { key: "_createDomTree", value: function() {
var I = this.dom, S = document.createElement("table"), O = document.createElement("tbody"), L = (S.style.borderCollapse = "collapse", S.className = "jsoneditor-values", S.appendChild(O), document.createElement("tr")), O = (O.appendChild(L), document.createElement("td")), O = (O.className = "jsoneditor-tree", L.appendChild(O), I.expand = this._createDomExpandButton(), O.appendChild(I.expand), I.tdExpand = O, document.createElement("td")), O = (O.className = "jsoneditor-tree", L.appendChild(O), I.field = this._createDomField(), O.appendChild(I.field), I.tdField = O, document.createElement("td")), O = (O.className = "jsoneditor-tree", L.appendChild(O), this.type !== "object" && this.type !== "array" && (O.appendChild(document.createTextNode(":")), O.className = "jsoneditor-separator"), I.tdSeparator = O, document.createElement("td"));
return O.className = "jsoneditor-tree", L.appendChild(O), I.value = this._createDomValue(), O.appendChild(I.value), I.tdValue = O, S;
} }, { key: "onEvent", value: function(I) {
var S, L = I.type, O = I.target || I.srcElement, J = this.dom, re = this, pe = this._hasChilds(), me = (O !== J.drag && O !== J.menu || (L === "mouseover" ? this.editor.highlighter.highlight(this) : L === "mouseout" && this.editor.highlighter.unhighlight()), L === "click" && O === J.menu && ((S = re.editor.highlighter).highlight(re), S.lock(), (0, y.addClassName)(J.menu, "jsoneditor-selected"), this.showContextMenu(J.menu, function() {
(0, y.removeClassName)(J.menu, "jsoneditor-selected"), S.unlock(), S.unhighlight();
})), L === "click" && O === J.expand && pe && (Ae = I.ctrlKey, this._onExpand(Ae)), L !== "click" || I.target !== re.dom.tdColor && I.target !== re.dom.color || !this.editable.value || this._showColorPicker(), L === "change" && O === J.checkbox && (this.dom.value.textContent = String(!this.value), this._getDomValue(), this._updateDomDefault()), L === "change" && O === J.select && (this.dom.value.innerHTML = this._escapeHTML(J.select.value), this._getDomValue(), this._updateDomValue()), J.value);
if (O === me)
switch (L) {
case "blur":
case "change":
this._getDomValue(), this._clearValueError(), this._updateDomValue();
var ye = this._escapeHTML(this.value);
ye !== this._unescapeHTML((0, y.getInnerText)(me)) && (me.innerHTML = ye);
break;
case "input":
this._getDomValue(), this._updateDomValue();
break;
case "keydown":
case "mousedown":
this.editor.selection = this.editor.getDomSelection();
break;
case "click":
I.ctrlKey && this.editable.value && (0, y.isUrl)(this.value) && (I.preventDefault(), window.open(this.value, "_blank", "noreferrer"));
break;
case "keyup":
this._getDomValue(), this._updateDomValue();
break;
case "cut":
case "paste":
setTimeout(function() {
re._getDomValue(), re._updateDomValue();
}, 1);
}
var xe = J.field;
if (O === xe)
switch (L) {
case "blur":
this._getDomField(true), this._updateDomField();
var be = this._escapeHTML(this.field);
be !== this._unescapeHTML((0, y.getInnerText)(xe)) && (xe.innerHTML = be);
break;
case "input":
this._getDomField(), this._updateSchema(), this._updateDomField(), this._updateDomValue();
break;
case "keydown":
case "mousedown":
this.editor.selection = this.editor.getDomSelection();
break;
case "keyup":
this._getDomField(), this._updateDomField();
break;
case "cut":
case "paste":
setTimeout(function() {
re._getDomField(), re._updateDomField();
}, 1);
}
var Ae = J.tree;
Ae && O === Ae.parentNode && L === "click" && !I.hasMoved && ((I.offsetX !== void 0 ? I.offsetX < 24 * (this.getLevel() + 1) : I.pageX < (0, y.getAbsoluteLeft)(J.tdSeparator)) || pe ? xe && ((0, y.setEndOfContentEditable)(xe), xe.focus()) : me && !this.enum && ((0, y.setEndOfContentEditable)(me), me.focus())), (O !== J.tdExpand || pe) && O !== J.tdField && O !== J.tdSeparator || L !== "click" || I.hasMoved || xe && ((0, y.setEndOfContentEditable)(xe), xe.focus()), L === "keydown" && this.onKeyDown(I), typeof this.editor.options.onEvent == "function" && this._onEvent(I);
} }, { key: "_onEvent", value: function(I) {
var L = I.target, S = L === this.dom.field, L = L === this.dom.value || L === this.dom.checkbox || L === this.dom.select;
(S || L) && (S = { field: this.getField(), path: this.getPath() }, L && !this._hasChilds() && (S.value = this.getValue()), this.editor.options.onEvent(S, I));
} }, { key: "onKeyDown", value: function(I) {
var S, L, O, J, re, pe, me, ye, xe, be, Ae, we, Re, Me, Se = I.which || I.keyCode, ve = I.target || I.srcElement, Le = I.ctrlKey, Ge = I.shiftKey, ge2 = I.altKey, te = false, ie = this.editor.options.mode === "tree", ce = 0 < this.editor.multiselection.nodes.length ? this.editor.multiselection.nodes : [this], fe = ce[0], Ie = ce[ce.length - 1];
Se === 13 ? ve === this.dom.value ? this.editable.value && !I.ctrlKey || (0, y.isUrl)(this.value) && (window.open(this.value, "_blank", "noreferrer"), te = true) : ve === this.dom.expand && this._hasChilds() && (Re = I.ctrlKey, this._onExpand(Re), ve.focus(), te = true) : Se === 68 ? Le && ie && (T.onDuplicate(ce), te = true) : Se === 69 ? Le && (this._onExpand(Ge), ve.focus(), te = true) : Se === 77 && ie ? Le && (this.showContextMenu(ve), te = true) : Se === 46 && ie ? Le && (T.onRemove(ce), te = true) : Se === 45 && ie ? Le && !Ge ? (this._onInsertBefore(), te = true) : Le && Ge && (this._onInsertAfter(), te = true) : Se === 35 ? ge2 && ((Re = this._lastNode()) && Re.focus(T.focusElement || this._getElementName(ve)), te = true) : Se === 36 ? ge2 && ((Re = this._firstNode()) && Re.focus(T.focusElement || this._getElementName(ve)), te = true) : Se === 37 ? ge2 && !Ge ? ((Re = this._previousElement(ve)) && this.focus(this._getElementName(Re)), te = true) : ge2 && Ge && ie && (Re = Ie.expanded ? (Re = Ie.getAppendDom()) ? Re.nextSibling : void 0 : Ie.getDom().nextSibling) && (Ae = T.getNodeFromTarget(Re), Re = Re.nextSibling, we = T.getNodeFromTarget(Re), Ae) && Ae instanceof b && Ie.parent.childs.length !== 1 && we && we.parent && (L = this.editor.getDomSelection(), O = (J = fe.parent).childs[Ie.getIndex() + 1] || J.append, re = fe.getIndex(), pe = we.getIndex(), me = J.getInternalPath(), ye = we.parent.getInternalPath(), ce.forEach(function($e) {
we.parent.moveBefore($e, we);
}), this.focus(T.focusElement || this._getElementName(ve)), this.editor._onAction("moveNodes", { count: ce.length, fieldNames: ce.map(p), oldParentPath: J.getInternalPath(), newParentPath: fe.parent.getInternalPath(), oldIndex: O.getIndex(), newIndex: fe.getIndex(), oldIndexRedo: re, newIndexRedo: pe, oldParentPathRedo: me, newParentPathRedo: ye, oldSelection: L, newSelection: this.editor.getDomSelection() })) : Se === 38 ? ge2 && !Ge ? ((S = this._previousNode()) && (this.editor.deselect(true), S.focus(T.focusElement || this._getElementName(ve))), te = true) : !ge2 && Le && Ge && ie ? ((S = this._previousNode()) && ((be = this.editor.multiselection).start = be.start || this, be.end = S, xe = this.editor._findTopLevelNodes(be.start, be.end), this.editor.select(xe), S.focus("field")), te = true) : ge2 && Ge && ie && ((S = fe._previousNode()) && S.parent && (L = this.editor.getDomSelection(), O = (J = fe.parent).childs[Ie.getIndex() + 1] || J.append, re = fe.getIndex(), pe = S.getIndex(), me = J.getInternalPath(), ye = S.parent.getInternalPath(), ce.forEach(function($e) {
S.parent.moveBefore($e, S);
}), this.focus(T.focusElement || this._getElementName(ve)), this.editor._onAction("moveNodes", { count: ce.length, fieldNames: ce.map(p), oldParentPath: J.getInternalPath(), newParentPath: fe.parent.getInternalPath(), oldIndex: O.getIndex(), newIndex: fe.getIndex(), oldIndexRedo: re, newIndexRedo: pe, oldParentPathRedo: me, newParentPathRedo: ye, oldSelection: L, newSelection: this.editor.getDomSelection() })), te = true) : Se === 39 ? ge2 && !Ge ? ((Re = this._nextElement(ve)) && this.focus(this._getElementName(Re)), te = true) : ge2 && Ge && ie && (Re = fe.getDom().previousSibling) && (S = T.getNodeFromTarget(Re)) && S.parent && !S.isVisible() && (L = this.editor.getDomSelection(), O = (J = fe.parent).childs[Ie.getIndex() + 1] || J.append, re = fe.getIndex(), pe = S.getIndex(), me = J.getInternalPath(), ye = S.parent.getInternalPath(), ce.forEach(function($e) {
S.parent.moveBefore($e, S);
}), this.focus(T.focusElement || this._getElementName(ve)), this.editor._onAction("moveNodes", { count: ce.length, fieldNames: ce.map(p), oldParentPath: J.getInternalPath(), newParentPath: fe.parent.getInternalPath(), oldIndex: O.getIndex(), newIndex: fe.getIndex(), oldIndexRedo: re, newIndexRedo: pe, oldParentPathRedo: me, newParentPathRedo: ye, oldSelection: L, newSelection: this.editor.getDomSelection() })) : Se === 40 && (ge2 && !Ge ? ((Ae = this._nextNode()) && (this.editor.deselect(true), Ae.focus(T.focusElement || this._getElementName(ve))), te = true) : !ge2 && Le && Ge && ie ? ((Ae = this._nextNode()) && ((be = this.editor.multiselection).start = be.start || this, be.end = Ae, xe = this.editor._findTopLevelNodes(be.start, be.end), this.editor.select(xe), Ae.focus("field")), te = true) : ge2 && Ge && ie && ((Me = (Ae = (Ae = (Ae = Ie.expanded ? Ie.append ? Ie.append._nextNode() : void 0 : Ie._nextNode()) && !Ae.isVisible() ? Ae.parent.showMore : Ae) && Ae instanceof b ? Ie : Ae) && (Ae._nextNode() || Ae.parent.append)) && Me.parent && (L = this.editor.getDomSelection(), O = (J = fe.parent).childs[Ie.getIndex() + 1] || J.append, re = fe.getIndex(), pe = Me.getIndex(), me = J.getInternalPath(), ye = Me.parent.getInternalPath(), ce.forEach(function($e) {
Me.parent.moveBefore($e, Me);
}), this.focus(T.focusElement || this._getElementName(ve)), this.editor._onAction("moveNodes", { count: ce.length, fieldNames: ce.map(p), oldParentPath: J.getInternalPath(), newParentPath: fe.parent.getInternalPath(), oldParentPathRedo: me, newParentPathRedo: ye, oldIndexRedo: re, newIndexRedo: pe, oldIndex: O.getIndex(), newIndex: fe.getIndex(), oldSelection: L, newSelection: this.editor.getDomSelection() })), te = true)), te && (I.preventDefault(), I.stopPropagation());
} }, { key: "_onExpand", value: function(I) {
var S, L, O;
I && (O = (L = (S = this.dom.tr.parentNode).parentNode).scrollTop, L.removeChild(S)), this.expanded ? this.collapse(I) : this.expand(I), I && (L.appendChild(S), L.scrollTop = O), typeof this.editor.options.onExpand == "function" && this.editor.options.onExpand({ path: this.getPath(), isExpand: this.expanded, recursive: I });
} }, { key: "_showColorPicker", value: function() {
var I, S;
typeof this.editor.options.onColorPicker == "function" && this.dom.color && ((I = this)._deleteDomColor(), I.updateDom(), S = (0, R.w)(this.dom.color, this.editor.getPopupAnchor()), this.editor.options.onColorPicker(S, this.value, function(L) {
typeof L == "string" && L !== I.value && (I._deleteDomColor(), I.value = L, I.updateDom(), I._debouncedOnChangeValue());
}));
} }, { key: "getFieldNames", value: function(I) {
return this.type === "object" ? this.childs.filter(function(S) {
return S !== I;
}).map(function(S) {
return S.field;
}) : [];
} }, { key: "_onInsertBefore", value: function(J, re, pe) {
var O = this.editor.getDomSelection(), J = new T(this.editor, { field: J !== void 0 ? J : "", value: re !== void 0 ? re : "", type: pe }), re = (J.expand(true), this.getInternalPath()), pe = (this.parent.insertBefore(J, this), this.editor.highlighter.unhighlight(), J.focus("field"), this.editor.getDomSelection());
this.editor._onAction("insertBeforeNodes", { nodes: [J], paths: [J.getInternalPath()], beforePath: re, parentPath: this.parent.getInternalPath(), oldSelection: O, newSelection: pe });
} }, { key: "_onInsertAfter", value: function(J, re, L) {
var O = this.editor.getDomSelection(), J = new T(this.editor, { field: J !== void 0 ? J : "", value: re !== void 0 ? re : "", type: L }), re = (J.expand(true), this.parent.insertAfter(J, this), this.editor.highlighter.unhighlight(), J.focus("field"), this.editor.getDomSelection());
this.editor._onAction("insertAfterNodes", { nodes: [J], paths: [J.getInternalPath()], afterPath: this.getInternalPath(), parentPath: this.parent.getInternalPath(), oldSelection: O, newSelection: re });
} }, { key: "_onAppend", value: function(J, re, L) {
var O = this.editor.getDomSelection(), J = new T(this.editor, { field: J !== void 0 ? J : "", value: re !== void 0 ? re : "", type: L }), re = (J.expand(true), this.parent.appendChild(J), this.editor.highlighter.unhighlight(), J.focus("field"), this.editor.getDomSelection());
this.editor._onAction("appendNodes", { nodes: [J], paths: [J.getInternalPath()], parentPath: this.parent.getInternalPath(), oldSelection: O, newSelection: re });
} }, { key: "_onChangeType", value: function(I) {
var S, L, O = this.type;
I !== O && (S = this.editor.getDomSelection(), this.changeType(I), L = this.editor.getDomSelection(), this.editor._onAction("changeType", { path: this.getInternalPath(), oldType: O, newType: I, oldSelection: S, newSelection: L }));
} }, { key: "sort", value: function(I, S) {
var L, O, J = !(2 < arguments.length && arguments[2] !== void 0) || arguments[2];
typeof I == "string" && (I = (0, y.parsePath)(I)), this._hasChilds() && (this.hideChilds(), L = this.childs, this.childs = this.childs.concat(), O = S === "desc" ? -1 : 1, this.type === "object" ? this.childs.sort(function(re, pe) {
return O * f()(re.field, pe.field);
}) : this.childs.sort(function(me, ye) {
var me = me.getNestedChild(I), ye = ye.getNestedChild(I);
return me ? ye ? (me = me.value, ye = ye.value, typeof me != "string" && typeof ye != "string" ? ye < me ? O : me < ye ? -O : 0 : O * f()(me, ye)) : -O : O;
}), this._updateDomIndexes(), this.showChilds(), J === true) && this.editor._onAction("sort", { path: this.getInternalPath(), oldChilds: L, newChilds: this.childs });
} }, { key: "update", value: function(I) {
var S = this.getInternalValue();
this.setValue(I), this.editor._onAction("transform", { path: this.getInternalPath(), oldValue: S, newValue: this.getInternalValue() });
} }, { key: "_detachFromDom", value: function() {
var I = this.dom.tr ? this.dom.tr.parentNode : void 0, S = this.expanded ? this.getAppendDom() : this.getDom(), S = S && S.parentNode ? S.nextSibling : void 0;
return this.hide({ resetVisibleChilds: false }), { table: I, nextTr: S };
} }, { key: "_attachToDom", value: function(I) {
I.table && (I.nextTr ? I.table.insertBefore(this.getDom(), I.nextTr) : I.table.appendChild(this.getDom())), this.expanded && this.showChilds();
} }, { key: "transform", value: function(I) {
if (this._hasChilds()) {
this.hideChilds();
try {
var S = this.getInternalValue(), L = this.getValue(), O = this.editor.options.executeQuery(L, I), J = (this.setValue(O), this.getInternalValue());
this.editor._onAction("transform", { path: this.getInternalPath(), oldValue: S, newValue: J }), this.showChilds();
} catch (re) {
this.showChilds(), this.editor._onError(re);
}
}
} }, { key: "extract", value: function() {
this.editor.node.hideChilds(), this.hideChilds();
try {
var I = this.editor.node.getInternalValue(), S = (this.editor._setRoot(this), this.editor.node.getInternalValue());
this.editor._onAction("transform", { path: this.editor.node.getInternalPath(), oldValue: I, newValue: S });
} catch (L) {
this.editor._onError(L);
} finally {
this.updateDom({ recurse: true }), this.showChilds();
}
} }, { key: "getNestedChild", value: function(I) {
for (var S = 0, L = this; L && S < I.length; )
L = L.findChildByProperty(I[S]), S++;
return L;
} }, { key: "findChildByProperty", value: function(I) {
if (this.type === "object")
return this.childs.find(function(S) {
return S.field === I;
});
} }, { key: "getAppendDom", value: function() {
return this.append || (this.append = new b(this.editor), this.append.setParent(this)), this.append.getDom();
} }, { key: "getShowMoreDom", value: function() {
return this.showMore || (this.showMore = new E(this.editor, this)), this.showMore.getDom();
} }, { key: "nextSibling", value: function() {
var I = this.parent.childs.indexOf(this);
return this.parent.childs[I + 1] || this.parent.append;
} }, { key: "_previousNode", value: function() {
var I = null, S = this.getDom();
if (S && S.parentNode)
for (var L = S; L = L.previousSibling, I = T.getNodeFromTarget(L), L && I && I instanceof b && !I.isVisible(); )
;
return I;
} }, { key: "_nextNode", value: function() {
var I = null, S = this.getDom();
if (S && S.parentNode)
for (var L = S; L = L.nextSibling, I = T.getNodeFromTarget(L), L && I && I instanceof b && !I.isVisible(); )
;
return I;
} }, { key: "_firstNode", value: function() {
var I = null, S = this.getDom();
return S && S.parentNode && (S = S.parentNode.firstChild, I = T.getNodeFromTarget(S)), I;
} }, { key: "_lastNode", value: function() {
var I = null, S = this.getDom();
if (S && S.parentNode)
for (var L = S.parentNode.lastChild, I = T.getNodeFromTarget(L); L && I && !I.isVisible(); )
L = L.previousSibling, I = T.getNodeFromTarget(L);
return I;
} }, { key: "_previousElement", value: function(I) {
var S = this.dom;
switch (I) {
case S.value:
if (this.fieldEditable)
return S.field;
case S.field:
if (this._hasChilds())
return S.expand;
case S.expand:
return S.menu;
case S.menu:
if (S.drag)
return S.drag;
default:
return null;
}
} }, { key: "_nextElement", value: function(I) {
var S = this.dom;
switch (I) {
case S.drag:
return S.menu;
case S.menu:
if (this._hasChilds())
return S.expand;
case S.expand:
if (this.fieldEditable)
return S.field;
case S.field:
if (!this._hasChilds())
return S.value;
default:
return null;
}
} }, { key: "_getElementName", value: function(I) {
var S = this;
return Object.keys(this.dom).find(function(L) {
return S.dom[L] === I;
});
} }, { key: "_hasChilds", value: function() {
return this.type === "array" || this.type === "object";
} }, { key: "addTemplates", value: function(I, S) {
var L = this, O = L.editor.options.templates;
O != null && (O.length && I.push({ type: "separator" }), O.forEach(function(J) {
I.push({ text: J.text, className: J.className || "jsoneditor-type-object", title: J.title, click: (S ? function(re, pe) {
L._onAppend(re, pe);
} : function(re, pe) {
L._onInsertBefore(re, pe);
}).bind(this, J.field, J.value) });
}));
} }, { key: "showContextMenu", value: function(I, S) {
var L, O = this, J = [];
this.editable.value && J.push({ text: (0, P.Iu)("type"), title: (0, P.Iu)("typeTitle"), className: "jsoneditor-type-" + this.type, submenu: [{ text: (0, P.Iu)("auto"), className: "jsoneditor-type-auto" + (this.type === "auto" ? " jsoneditor-selected" : ""), title: (0, P.Iu)("autoType"), click: function() {
O._onChangeType("auto");
} }, { text: (0, P.Iu)("array"), className: "jsoneditor-type-array" + (this.type === "array" ? " jsoneditor-selected" : ""), title: (0, P.Iu)("arrayType"), click: function() {
O._onChangeType("array");
} }, { text: (0, P.Iu)("object"), className: "jsoneditor-type-object" + (this.type === "object" ? " jsoneditor-selected" : ""), title: (0, P.Iu)("objectType"), click: function() {
O._onChangeType("object");
} }, { text: (0, P.Iu)("string"), className: "jsoneditor-type-string" + (this.type === "string" ? " jsoneditor-selected" : ""), title: (0, P.Iu)("stringType"), click: function() {
O._onChangeType("string");
} }] }), this._hasChilds() && (this.editor.options.enableSort && J.push({ text: (0, P.Iu)("sort"), title: (0, P.Iu)("sortTitle", { type: this.type }), className: "jsoneditor-sort-asc", click: function() {
O.showSortModal();
} }), this.editor.options.enableTransform && J.push({ text: (0, P.Iu)("transform"), title: (0, P.Iu)("transformTitle", { type: this.type }), className: "jsoneditor-transform", click: function() {
O.showTransformModal();
} }), this.parent) && J.push({ text: (0, P.Iu)("extract"), title: (0, P.Iu)("extractTitle", { type: this.type }), className: "jsoneditor-extract", click: function() {
O.extract();
} }), this.parent && this.parent._hasChilds() && (J.length && J.push({ type: "separator" }), L = O.parent.childs, O === L[L.length - 1] && (L = [{ text: (0, P.Iu)("auto"), className: "jsoneditor-type-auto", title: (0, P.Iu)("autoType"), click: function() {
O._onAppend("", "", "auto");
} }, { text: (0, P.Iu)("array"), className: "jsoneditor-type-array", title: (0, P.Iu)("arrayType"), click: function() {
O._onAppend("", []);
} }, { text: (0, P.Iu)("object"), className: "jsoneditor-type-object", title: (0, P.Iu)("objectType"), click: function() {
O._onAppend("", {});
} }, { text: (0, P.Iu)("string"), className: "jsoneditor-type-string", title: (0, P.Iu)("stringType"), click: function() {
O._onAppend("", "", "string");
} }], O.addTemplates(L, true), J.push({ text: (0, P.Iu)("appendText"), title: (0, P.Iu)("appendTitle"), submenuTitle: (0, P.Iu)("appendSubmenuTitle"), className: "jsoneditor-append", click: function() {
O._onAppend("", "", "auto");
}, submenu: L })), L = [{ text: (0, P.Iu)("auto"), className: "jsoneditor-type-auto", title: (0, P.Iu)("autoType"), click: function() {
O._onInsertBefore("", "", "auto");
} }, { text: (0, P.Iu)("array"), className: "jsoneditor-type-array", title: (0, P.Iu)("arrayType"), click: function() {
O._onInsertBefore("", []);
} }, { text: (0, P.Iu)("object"), className: "jsoneditor-type-object", title: (0, P.Iu)("objectType"), click: function() {
O._onInsertBefore("", {});
} }, { text: (0, P.Iu)("string"), className: "jsoneditor-type-string", title: (0, P.Iu)("stringType"), click: function() {
O._onInsertBefore("", "", "string");
} }], O.addTemplates(L, false), J.push({ text: (0, P.Iu)("insert"), title: (0, P.Iu)("insertTitle"), submenuTitle: (0, P.Iu)("insertSub"), className: "jsoneditor-insert", click: function() {
O._onInsertBefore("", "", "auto");
}, submenu: L }), this.editable.field) && (J.push({ text: (0, P.Iu)("duplicateText"), title: (0, P.Iu)("duplicateField"), className: "jsoneditor-duplicate", click: function() {
T.onDuplicate(O);
} }), J.push({ text: (0, P.Iu)("removeText"), title: (0, P.Iu)("removeField"), className: "jsoneditor-remove", click: function() {
T.onRemove(O);
} })), this.editor.options.onCreateMenu && (L = O.getPath(), J = this.editor.options.onCreateMenu(J, { type: "single", path: L, paths: [L] })), new x.x(J, { close: S }).show(I, this.editor.getPopupAnchor());
} }, { key: "showSortModal", value: function() {
var I = this, S = this.editor.options.modalAnchor || h.qD, L = this.getValue();
(0, C.showSortModal)(S, L, function(O) {
var J = O.path, J = (0, y.parsePath)(J);
I.sortedBy = O, I.sort(J, O.direction);
}, I.sortedBy);
} }, { key: "showTransformModal", value: function() {
var I = this, J = this.editor.options, S = J.modalAnchor, L = J.createQuery, O = J.executeQuery, J = J.queryDescription, re = this.getValue();
(0, d.showTransformModal)({ container: S || h.qD, json: re, queryDescription: J, createQuery: L, executeQuery: O, onTransform: function(pe) {
I.transform(pe);
} });
} }, { key: "_getType", value: function(I) {
return I instanceof Array ? "array" : I instanceof Object ? "object" : typeof I == "string" && typeof (0, y.parseString)(I) != "string" ? "string" : "auto";
} }, { key: "_escapeHTML", value: function(I) {
return typeof I != "string" ? String(I) : (I = String(I).replace(/&/g, "&").replace(//g, ">").replace(/ {2}/g, " ").replace(/^ /, " ").replace(/ $/, " "), I = (I = JSON.stringify(I)).substring(1, I.length - 1), this.editor.options.escapeUnicode === true ? (0, y.escapeUnicodeChars)(I) : I);
} }, { key: "_unescapeHTML", value: function(I) {
return I = '"' + this._escapeJSON(I) + '"', (0, y.parse)(I).replace(/</g, "<").replace(/>/g, ">").replace(/ |\u00A0/g, " ").replace(/&/g, "&");
} }, { key: "_escapeJSON", value: function(I) {
for (var S = "", L = 0; L < I.length; ) {
var O = I.charAt(L);
O === `
` ? S += "\\n" : O === "\\" ? (S += O, L++, (O = I.charAt(L)) !== "" && '"\\/bfnrtu'.indexOf(O) !== -1 || (S += "\\"), S += O) : S += O === '"' ? '\\"' : O, L++;
}
return S;
} }, { key: "updateNodeName", value: function() {
var I = this.childs ? this.childs.length : 0;
if (this.type === "object" || this.type === "array") {
if (this.editor.options.onNodeName)
try {
var S = this.getValue.bind(this), L = this.editor.options.onNodeName({ path: this.getPath(), size: I, type: this.type, get value() {
return S();
} });
} catch {
}
this.dom.value.textContent = this.type === "object" ? "{" + (L || I) + "}" : "[" + (L || I) + "]";
}
} }, { key: "recursivelyUpdateNodeName", value: function() {
if (this.expanded && (this.updateNodeName(), this.childs !== "undefined"))
for (var I in this.childs)
this.childs[I].recursivelyUpdateNodeName();
} }]) && e2(V.prototype, F), Object.defineProperty(V, "prototype", { writable: false }), T;
}(), s = (t.prototype.DEBOUNCE_INTERVAL = 150, t.prototype.MAX_SEARCH_RESULTS = 999, 100);
function c(T) {
return T.getInternalPath();
}
function p(T) {
return T.getField();
}
function g(T, V) {
return Object.prototype.hasOwnProperty.call(T, V);
}
t.focusElement = void 0, t.select = function(T) {
setTimeout(function() {
(0, y.selectContentEditable)(T);
}, 0);
}, t.onDragStart = function(T, V) {
if (!Array.isArray(T))
return t.onDragStart([T], V);
var F, I, S, L, O;
T.length !== 0 && (F = T[0], I = T[T.length - 1], S = F.parent, O = t.getNodeFromTarget(V.target), L = F.editor, O = (0, y.getAbsoluteTop)(O.dom.tr) - (0, y.getAbsoluteTop)(F.dom.tr), L.mousemove || (L.mousemove = (0, y.addEventListener)(V.view, "mousemove", function(J) {
t.onDrag(T, J);
})), L.mouseup || (L.mouseup = (0, y.addEventListener)(V.view, "mouseup", function(J) {
t.onDragEnd(T, J);
})), L.highlighter.lock(), L.drag = { oldCursor: document.body.style.cursor, oldSelection: L.getDomSelection(), oldPaths: T.map(c), oldParent: S, oldNextNode: S.childs[I.getIndex() + 1] || S.append, oldParentPathRedo: S.getInternalPath(), oldIndexRedo: F.getIndex(), mouseX: V.pageX, offsetY: O, level: F.getLevel() }, document.body.style.cursor = "move", V.preventDefault());
}, t.onDrag = function(T, V) {
if (!Array.isArray(T))
return t.onDrag([T], V);
if (T.length !== 0) {
var F, I, S, L, O, J = T[0].editor, re = V.pageY - J.drag.offsetY, pe = V.pageX, me = false, ye = T[0], xe = ye.dom.tr, be = (0, y.getAbsoluteTop)(xe), Ae = xe.offsetHeight;
if (re < be) {
for (Se = xe; Se = Se.previousSibling, ve = t.getNodeFromTarget(Se), S = Se ? (0, y.getAbsoluteTop)(Se) : 0, Se && re < S; )
;
(ve = ve && !ve.parent ? void 0 : ve) || (Se = (xe = xe.parentNode.firstChild) ? xe.nextSibling : void 0, (ve = t.getNodeFromTarget(Se)) === ye && (ve = void 0)), !(ve = ve && ve.isVisible() && (S = (Se = ve.dom.tr) ? (0, y.getAbsoluteTop)(Se) : 0) + Ae < re ? void 0 : ve) || J.options.limitDragging !== false && ve.parent !== T[0].parent || (T.forEach(function(Ge) {
ve.parent.moveBefore(Ge, ve);
}), me = true);
} else {
var we = T[T.length - 1];
if (Ae = (xe = we.expanded && we.append ? we.append.getDom() : we.dom.tr) ? xe.nextSibling : void 0) {
for (L = (0, y.getAbsoluteTop)(Ae), F = Ae; I = t.getNodeFromTarget(F), F && (O = F.nextSibling ? (0, y.getAbsoluteTop)(F.nextSibling) : 0, O = F ? O - L : 0, I && I.parent.childs.length === T.length && I.parent.childs[T.length - 1] === we && (be += 27), F = F.nextSibling), F && be + O < re; )
;
if (I && I.parent) {
for (var Ae = pe - J.drag.mouseX, Ae = Math.round(Ae / 24 / 2), Re = J.drag.level + Ae, Me = I.getLevel(), Se = I.dom.tr && I.dom.tr.previousSibling; Me < Re && Se; ) {
var ve = t.getNodeFromTarget(Se), Le = T.some(function(ge2) {
return ge2 === ve || ve.isDescendantOf(ge2);
});
if (!Le) {
if (!(ve instanceof b) || (Le = ve.parent.childs, Le.length === T.length && Le[T.length - 1] === we))
break;
Me = (I = t.getNodeFromTarget(Se)).getLevel();
}
Se = Se.previousSibling;
}
(I = I instanceof b && !I.isVisible() && I.parent.showMore.isVisible() ? I._nextNode() : I) && (J.options.limitDragging === false || I.parent === T[0].parent) && I.dom.tr && I.dom.tr !== xe.nextSibling && (T.forEach(function(Ge) {
I.parent.moveBefore(Ge, I);
}), me = true);
}
}
}
me && (J.drag.mouseX = pe, J.drag.level = ye.getLevel()), J.startAutoScroll(re), V.preventDefault();
}
}, t.onDragEnd = function(T, V) {
if (!Array.isArray(T))
return t.onDrag([T], V);
var F, I, S, L, O, J, re, pe, me;
T.length !== 0 && (J = T[0], F = J.editor, J && J.dom.menu && J.dom.menu.focus(), I = F.drag.oldParent.getInternalPath(), S = J.parent.getInternalPath(), L = F.drag.oldParent === J.parent, O = F.drag.oldNextNode.getIndex(), J = J.getIndex(), re = F.drag.oldParentPathRedo, pe = F.drag.oldIndexRedo, me = L && pe < J ? J + T.length : J, L && pe === J || F._onAction("moveNodes", { count: T.length, fieldNames: T.map(p), oldParentPath: I, newParentPath: S, oldIndex: O, newIndex: J, oldIndexRedo: pe, newIndexRedo: me, oldParentPathRedo: re, newParentPathRedo: null, oldSelection: F.drag.oldSelection, newSelection: F.getDomSelection() }), document.body.style.cursor = F.drag.oldCursor, F.highlighter.unlock(), T.forEach(function(ye) {
ye.updateDom(), V.target !== ye.dom.drag && V.target !== ye.dom.menu && F.highlighter.unhighlight();
}), delete F.drag, F.mousemove && ((0, y.removeEventListener)(V.view, "mousemove", F.mousemove), delete F.mousemove), F.mouseup && ((0, y.removeEventListener)(V.view, "mouseup", F.mouseup), delete F.mouseup), F.stopAutoScroll(), V.preventDefault());
}, t._findEnum = function(T) {
return T.enum ? T.enum : (T = T.oneOf || T.anyOf || T.allOf, T && (T = T.filter(function(V) {
return V.enum;
}), 0 < T.length) ? T[0].enum : null);
}, t._findSchema = function(T, V, F) {
for (var I = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : T, S = F.slice(1, F.length), L = F[0], O = [I], J = 0, re = [I.oneOf, I.anyOf, I.allOf]; J < re.length; J++) {
var pe = re[J];
Array.isArray(pe) && (O = O.concat(pe));
}
var me, ye = o(O);
try {
for (ye.s(); !(me = ye.n()).done; ) {
if ("$ref" in (I = me.value) && typeof I.$ref == "string") {
var xe, be = I.$ref;
if (be in V)
I = V[be];
else {
if (!be.startsWith("#/")) {
if (((xe = be.match(/#\//g)) == null ? void 0 : xe.length) === 1) {
var Ae, we, Re, Me = n(be.split("#/"), 2), Se = Me[0], ve = Me[1];
if (Se in V)
return Ae = V[Se], we = { $ref: "#/".concat(ve) }, (Re = []).push(L), 0 < S.length && Re.push.apply(Re, l(S)), t._findSchema(Ae, V, Re, we);
}
throw Error("Unable to resolve reference ".concat(be));
}
var Le, Ge = be.substring(2).split("/"), I = T, ge2 = o(Ge);
try {
for (ge2.s(); !(Le = ge2.n()).done; ) {
var te = Le.value;
if (!(te in I))
throw Error("Unable to resolve reference ".concat(be));
I = I[te];
}
} catch (fe) {
ge2.e(fe);
} finally {
ge2.f();
}
}
}
if (L === void 0)
return I;
if (typeof L == "string") {
if (r(I.properties) === "object" && I.properties !== null && L in I.properties)
return I = I.properties[L], t._findSchema(T, V, S, I);
if (r(I.patternProperties) === "object" && I.patternProperties !== null) {
for (var ie in I.patternProperties)
if (L.match(ie))
return I = I.patternProperties[ie], t._findSchema(T, V, S, I);
}
if (r(I.additionalProperties) === "object")
return I = I.additionalProperties, t._findSchema(T, V, S, I);
} else if (typeof L == "number" && r(I.items) === "object" && I.items !== null)
return I = I.items, t._findSchema(T, V, S, I);
}
} catch (ce) {
ye.e(ce);
} finally {
ye.f();
}
return null;
}, t.onRemove = function(T) {
if (!Array.isArray(T))
return t.onRemove([T]);
var V, F, I, S, L, O;
T && 0 < T.length && (V = (I = T[0]).parent, F = I.editor, I = I.getIndex(), F.highlighter.unhighlight(), S = F.getDomSelection(), t.blurNodes(T), L = F.getDomSelection(), O = T.map(c), T.forEach(function(J) {
J.parent._remove(J);
}), F._onAction("removeNodes", { nodes: T, paths: O, parentPath: V.getInternalPath(), index: I, oldSelection: S, newSelection: L }));
}, t.onDuplicate = function(T) {
if (!Array.isArray(T))
return t.onDuplicate([T]);
var V, F, I, S, L, O, J;
T && 0 < T.length && (V = T[T.length - 1], F = V.parent, (I = V.editor).deselect(I.multiselection.nodes), S = I.getDomSelection(), L = V, O = T.map(function(re) {
var pe, me = re.clone();
return re.parent.type === "object" && (pe = re.parent.getFieldNames(), me.field = (0, y.findUniqueName)(re.field, pe)), F.insertAfter(me, L), L = me;
}), T.length === 1 ? O[0].parent.type === "object" ? (O[0].dom.field.innerHTML = T[0]._escapeHTML(T[0].field), O[0].focus("field")) : O[0].focus() : I.select(O), J = I.getDomSelection(), I._onAction("duplicateNodes", { paths: T.map(c), clonePaths: O.map(c), afterPath: V.getInternalPath(), parentPath: F.getInternalPath(), oldSelection: S, newSelection: J }));
}, t.getNodeFromTarget = function(T) {
for (; T; ) {
if (T.node)
return T.node;
T = T.parentNode;
}
}, t.targetIsColorPicker = function(T) {
var V = t.getNodeFromTarget(T);
if (V)
for (var F = T && T.parentNode; F; ) {
if (F === V.dom.color)
return true;
F = F.parentNode;
}
return false;
}, t.blurNodes = function(T) {
var V, F;
Array.isArray(T) ? (V = (F = T[0]).parent, F = F.getIndex(), (V.childs[F + T.length] ? V.childs[F + T.length] : V.childs[F - 1] || V).focus()) : t.blurNodes([T]);
}, (w.prototype = new t()).getDom = function() {
var T = this.dom;
if (T.tr)
return T.tr;
this._updateEditability();
var V = document.createElement("tr"), F = (V.className = "jsoneditor-append", V.node = this, T.tr = V, this.editor.options.mode === "tree" && (T.tdDrag = document.createElement("td"), I = document.createElement("td"), T.tdMenu = I, (F = document.createElement("button")).type = "button", F.className = "jsoneditor-button jsoneditor-contextmenu-button", F.title = "Click to open the actions menu (Ctrl+M)", T.menu = F, I.appendChild(T.menu)), document.createElement("td")), I = document.createElement("div");
return I.appendChild(document.createTextNode("(" + (0, P.Iu)("empty") + ")")), I.className = "jsoneditor-readonly", F.appendChild(I), T.td = F, T.text = I, this.updateDom(), V;
}, w.prototype.getPath = function() {
return null;
}, w.prototype.getIndex = function() {
return null;
}, w.prototype.updateDom = function(T) {
var V = this.dom, F = V.td, I = (F && (F.style.paddingLeft = 24 * this.getLevel() + 26 + "px"), V.text), I = (I && (I.firstChild.nodeValue = "(" + (0, P.Iu)("empty") + " " + this.parent.type + ")"), V.tr);
this.isVisible() ? V.tr.firstChild || (V.tdDrag && I.appendChild(V.tdDrag), V.tdMenu && I.appendChild(V.tdMenu), I.appendChild(F)) : V.tr.firstChild && (V.tdDrag && I.removeChild(V.tdDrag), V.tdMenu && I.removeChild(V.tdMenu), I.removeChild(F));
}, w.prototype.isVisible = function() {
return this.parent.childs.length === 0;
}, w.prototype.showContextMenu = function(T, V) {
var F, I = this, S = [{ text: (0, P.Iu)("auto"), className: "jsoneditor-type-auto", title: (0, P.Iu)("autoType"), click: function() {
I._onAppend("", "", "auto");
} }, { text: (0, P.Iu)("array"), className: "jsoneditor-type-array", title: (0, P.Iu)("arrayType"), click: function() {
I._onAppend("", []);
} }, { text: (0, P.Iu)("object"), className: "jsoneditor-type-object", title: (0, P.Iu)("objectType"), click: function() {
I._onAppend("", {});
} }, { text: (0, P.Iu)("string"), className: "jsoneditor-type-string", title: (0, P.Iu)("stringType"), click: function() {
I._onAppend("", "", "string");
} }], S = (I.addTemplates(S, true), [{ text: (0, P.Iu)("appendText"), title: (0, P.Iu)("appendTitleAuto"), submenuTitle: (0, P.Iu)("appendSubmenuTitle"), className: "jsoneditor-insert", click: function() {
I._onAppend("", "", "auto");
}, submenu: S }]);
this.editor.options.onCreateMenu && (F = I.parent.getPath(), S = this.editor.options.onCreateMenu(S, { type: "append", path: F, paths: [F] })), new x.x(S, { close: V }).show(T, this.editor.getPopupAnchor());
}, w.prototype.onEvent = function(T) {
var V, F = T.type, I = T.target || T.srcElement, S = this.dom;
I === S.menu && (F === "mouseover" ? this.editor.highlighter.highlight(this.parent) : F === "mouseout" && this.editor.highlighter.unhighlight()), F === "click" && I === S.menu && ((V = this.editor.highlighter).highlight(this.parent), V.lock(), (0, y.addClassName)(S.menu, "jsoneditor-selected"), this.showContextMenu(S.menu, function() {
(0, y.removeClassName)(S.menu, "jsoneditor-selected"), V.unlock(), V.unhighlight();
})), F === "keydown" && this.onKeyDown(T);
};
var b = w;
function w(T) {
this.editor = T, this.dom = {};
}
(M.prototype = new t()).getDom = function() {
var T, V, F, I, S, L;
return this.dom.tr || (this._updateEditability(), this.dom.tr || (V = (T = this).parent, (S = document.createElement("a")).appendChild(document.createTextNode((0, P.Iu)("showMore"))), S.href = "#", S.onclick = function(O) {
return V.visibleChilds = Math.floor(V.visibleChilds / V.getMaxVisibleChilds() + 1) * V.getMaxVisibleChilds(), T.updateDom(), V.showChilds(), O.preventDefault(), false;
}, (L = document.createElement("a")).appendChild(document.createTextNode((0, P.Iu)("showAll"))), L.href = "#", L.onclick = function(O) {
return V.visibleChilds = 1 / 0, T.updateDom(), V.showChilds(), O.preventDefault(), false;
}, F = document.createElement("div"), I = document.createTextNode(this._getShowMoreText()), F.className = "jsoneditor-show-more", F.appendChild(I), F.appendChild(S), F.appendChild(document.createTextNode(". ")), F.appendChild(L), F.appendChild(document.createTextNode(". ")), (S = document.createElement("td")).appendChild(F), L = document.createElement("tr"), this.editor.options.mode === "tree" && (L.appendChild(document.createElement("td")), L.appendChild(document.createElement("td"))), L.appendChild(S), L.className = "jsoneditor-show-more", this.dom.tr = L, this.dom.moreContents = F, this.dom.moreText = I), this.updateDom()), this.dom.tr;
}, M.prototype.updateDom = function(T) {
var V;
this.isVisible() ? (this.dom.tr.node = this.parent.childs[this.parent.visibleChilds], this.dom.tr.parentNode || (V = this.parent._getNextTr()) && V.parentNode.insertBefore(this.dom.tr, V), this.dom.moreText.nodeValue = this._getShowMoreText(), this.dom.moreContents.style.marginLeft = 24 * (this.getLevel() + 1) + "px") : this.dom.tr && this.dom.tr.parentNode && this.dom.tr.parentNode.removeChild(this.dom.tr);
}, M.prototype._getShowMoreText = function() {
return (0, P.Iu)("showMoreStatus", { visibleChilds: this.parent.visibleChilds, totalChilds: this.parent.childs.length }) + " ";
}, M.prototype.isVisible = function() {
return this.parent.expanded && this.parent.childs.length > this.parent.visibleChilds;
}, M.prototype.onEvent = function(T) {
T.type === "keydown" && this.onKeyDown(T);
};
var E = M;
function M(T, V) {
this.editor = T, this.parent = V, this.dom = {};
}
function B2(T) {
return (B2 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(V) {
return typeof V;
} : function(V) {
return V && typeof Symbol == "function" && V.constructor === Symbol && V !== Symbol.prototype ? "symbol" : typeof V;
})(T);
}
function Z(T, V) {
for (var F = 0; F < V.length; F++) {
var I = V[F];
I.enumerable = I.enumerable || false, I.configurable = true, "value" in I && (I.writable = true), Object.defineProperty(T, function(S) {
return S = function(L, O) {
if (B2(L) !== "object" || L === null)
return L;
var J = L[Symbol.toPrimitive];
if (J === void 0)
return (O === "string" ? String : Number)(L);
if (J = J.call(L, O || "default"), B2(J) !== "object")
return J;
throw new TypeError("@@toPrimitive must return a primitive value.");
}(S, "string"), B2(S) === "symbol" ? S : String(S);
}(I.key), I);
}
}
var k = function() {
function T(I) {
if (!(this instanceof T))
throw new TypeError("Cannot call a class as a function");
function S(L) {
return I.node.findNodeByInternalPath(L);
}
this.editor = I, this.history = [], this.index = -1, this.clear(), this.actions = { editField: { undo: function(L) {
S(L.parentPath).childs[L.index].updateField(L.oldValue);
}, redo: function(L) {
S(L.parentPath).childs[L.index].updateField(L.newValue);
} }, editValue: { undo: function(L) {
S(L.path).updateValue(L.oldValue);
}, redo: function(L) {
S(L.path).updateValue(L.newValue);
} }, changeType: { undo: function(L) {
S(L.path).changeType(L.oldType);
}, redo: function(L) {
S(L.path).changeType(L.newType);
} }, appendNodes: { undo: function(L) {
var O = S(L.parentPath);
L.paths.map(S).forEach(function(J) {
O.removeChild(J);
});
}, redo: function(L) {
var O = S(L.parentPath);
L.nodes.forEach(function(J) {
O.appendChild(J);
});
} }, insertBeforeNodes: { undo: function(L) {
var O = S(L.parentPath);
L.paths.map(S).forEach(function(J) {
O.removeChild(J);
});
}, redo: function(L) {
var O = S(L.parentPath), J = S(L.beforePath);
L.nodes.forEach(function(re) {
O.insertBefore(re, J);
});
} }, insertAfterNodes: { undo: function(L) {
var O = S(L.parentPath);
L.paths.map(S).forEach(function(J) {
O.removeChild(J);
});
}, redo: function(L) {
var O = S(L.parentPath), J = S(L.afterPath);
L.nodes.forEach(function(re) {
O.insertAfter(re, J), J = re;
});
} }, removeNodes: { undo: function(L) {
var O = S(L.parentPath), J = O.childs[L.index] || O.append;
L.nodes.forEach(function(re) {
O.insertBefore(re, J);
});
}, redo: function(L) {
var O = S(L.parentPath);
L.paths.map(S).forEach(function(J) {
O.removeChild(J);
});
} }, duplicateNodes: { undo: function(L) {
var O = S(L.parentPath);
L.clonePaths.map(S).forEach(function(J) {
O.removeChild(J);
});
}, redo: function(L) {
var O = S(L.parentPath), J = S(L.afterPath);
L.paths.map(S).forEach(function(re) {
var pe, me = re.clone();
O.type === "object" && (pe = O.getFieldNames(), me.field = (0, y.findUniqueName)(re.field, pe)), O.insertAfter(me, J), J = me;
});
} }, moveNodes: { undo: function(L) {
var O = S(L.oldParentPath), J = S(L.newParentPath), re = O.childs[L.oldIndex] || O.append;
J.childs.slice(L.newIndex, L.newIndex + L.count).forEach(function(pe, me) {
pe.field = L.fieldNames[me], O.moveBefore(pe, re);
}), L.newParentPathRedo === null && (L.newParentPathRedo = J.getInternalPath());
}, redo: function(L) {
var O = S(L.oldParentPathRedo), J = S(L.newParentPathRedo), re = J.childs[L.newIndexRedo] || J.append;
O.childs.slice(L.oldIndexRedo, L.oldIndexRedo + L.count).forEach(function(pe, me) {
pe.field = L.fieldNames[me], J.moveBefore(pe, re);
});
} }, sort: { undo: function(L) {
var O = S(L.path);
O.hideChilds(), O.childs = L.oldChilds, O.updateDom({ updateIndexes: true }), O.showChilds();
}, redo: function(L) {
var O = S(L.path);
O.hideChilds(), O.childs = L.newChilds, O.updateDom({ updateIndexes: true }), O.showChilds();
} }, transform: { undo: function(L) {
S(L.path).setInternalValue(L.oldValue);
}, redo: function(L) {
S(L.path).setInternalValue(L.newValue);
} } };
}
var V, F;
return V = T, (F = [{ key: "onChange", value: function() {
} }, { key: "add", value: function(I, S) {
this.index++, this.history[this.index] = { action: I, params: S, timestamp: /* @__PURE__ */ new Date() }, this.index < this.history.length - 1 && this.history.splice(this.index + 1, this.history.length - this.index - 1), this.onChange();
} }, { key: "clear", value: function() {
this.history = [], this.index = -1, this.onChange();
} }, { key: "canUndo", value: function() {
return 0 <= this.index;
} }, { key: "canRedo", value: function() {
return this.index < this.history.length - 1;
} }, { key: "undo", value: function() {
if (this.canUndo()) {
var I = this.history[this.index];
if (I) {
var S = this.actions[I.action];
if (S && S.undo && (S.undo(I.params), I.params.oldSelection))
try {
this.editor.setDomSelection(I.params.oldSelection);
} catch {
}
}
this.index--, this.onChange();
}
} }, { key: "redo", value: function() {
if (this.canRedo()) {
this.index++;
var I = this.history[this.index];
if (I) {
var S = this.actions[I.action];
if (S && S.redo && (S.redo(I.params), I.params.newSelection))
try {
this.editor.setDomSelection(I.params.newSelection);
} catch {
}
}
this.onChange();
}
} }, { key: "destroy", value: function() {
this.editor = null, this.history = [], this.index = -1;
} }]) && Z(V.prototype, F), Object.defineProperty(V, "prototype", { writable: false }), T;
}();
function u(T) {
return (u = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(V) {
return typeof V;
} : function(V) {
return V && typeof Symbol == "function" && V.constructor === Symbol && V !== Symbol.prototype ? "symbol" : typeof V;
})(T);
}
function _(T, V) {
for (var F = 0; F < V.length; F++) {
var I = V[F];
I.enumerable = I.enumerable || false, I.configurable = true, "value" in I && (I.writable = true), Object.defineProperty(T, function(S) {
return S = function(L, O) {
if (u(L) !== "object" || L === null)
return L;
var J = L[Symbol.toPrimitive];
if (J === void 0)
return (O === "string" ? String : Number)(L);
if (J = J.call(L, O || "default"), u(J) !== "object")
return J;
throw new TypeError("@@toPrimitive must return a primitive value.");
}(S, "string"), u(S) === "symbol" ? S : String(S);
}(I.key), I);
}
}
var v = function() {
function T(re, O) {
if (!(this instanceof T))
throw new TypeError("Cannot call a class as a function");
var L = this, re = (this.editor = re, this.timeout = void 0, this.delay = 200, this.lastText = void 0, this.results = null, this.dom = {}, this.dom.container = O, document.createElement("div")), O = ((this.dom.wrapper = re).className = "jsoneditor-search", O.appendChild(re), document.createElement("div")), O = ((this.dom.results = O).className = "jsoneditor-results", re.appendChild(O), document.createElement("div")), re = ((this.dom.input = O).className = "jsoneditor-frame", O.title = (0, P.Iu)("searchTitle"), re.appendChild(O), document.createElement("button")), J = (re.type = "button", re.className = "jsoneditor-refresh", O.appendChild(re), document.createElement("input")), re = (J.type = "text", (this.dom.search = J).oninput = function(pe) {
L._onDelayedSearch(pe);
}, J.onchange = function(pe) {
L._onSearch();
}, J.onkeydown = function(pe) {
L._onKeyDown(pe);
}, J.onkeyup = function(pe) {
L._onKeyUp(pe);
}, re.onclick = function(pe) {
J.select();
}, O.appendChild(J), document.createElement("button")), re = (re.type = "button", re.title = (0, P.Iu)("searchNextResultTitle"), re.className = "jsoneditor-next", re.onclick = function() {
L.next();
}, O.appendChild(re), document.createElement("button"));
re.type = "button", re.title = (0, P.Iu)("searchPreviousResultTitle"), re.className = "jsoneditor-previous", re.onclick = function() {
L.previous();
}, O.appendChild(re);
}
var V, F;
return V = T, (F = [{ key: "next", value: function(I) {
var S;
this.results && ((S = this.resultIndex !== null ? this.resultIndex + 1 : 0) > this.results.length - 1 && (S = 0), this._setActiveResult(S, I));
} }, { key: "previous", value: function(I) {
var S, L;
this.results && (S = this.results.length - 1, L = this.resultIndex !== null ? this.resultIndex - 1 : S, this._setActiveResult(L = L < 0 ? S : L, I));
} }, { key: "_setActiveResult", value: function(I, S) {
var L, O, J;
this.activeResult && (L = this.activeResult.node, this.activeResult.elem === "field" ? delete L.searchFieldActive : delete L.searchValueActive, L.updateDom()), this.results && this.results[I] ? (this.resultIndex = I, O = this.results[this.resultIndex].node, (J = this.results[this.resultIndex].elem) === "field" ? O.searchFieldActive = true : O.searchValueActive = true, this.activeResult = this.results[this.resultIndex], O.updateDom(), O.scrollTo(function() {
S && O.focus(J);
})) : (this.resultIndex = void 0, this.activeResult = void 0);
} }, { key: "_clearDelay", value: function() {
this.timeout !== void 0 && (clearTimeout(this.timeout), delete this.timeout);
} }, { key: "_onDelayedSearch", value: function(I) {
this._clearDelay();
var S = this;
this.timeout = setTimeout(function(L) {
S._onSearch();
}, this.delay);
} }, { key: "_onSearch", value: function(I) {
this._clearDelay();
var S = this.dom.search.value, S = 0 < S.length ? S : void 0;
if (S !== this.lastText || I) {
this.lastText = S, this.results = this.editor.search(S);
var I = this.results[0] ? this.results[0].node.MAX_SEARCH_RESULTS : 1 / 0, L = 0;
if (this.activeResult) {
for (var O = 0; O < this.results.length; O++)
if (this.results[O].node === this.activeResult.node) {
L = O;
break;
}
}
this._setActiveResult(L, false), S !== void 0 ? (S = this.results.length, this.dom.results.textContent = S === 0 ? "no results" : S === 1 ? "1 result" : I < S ? I + "+ results" : S + " results") : this.dom.results.textContent = "";
}
} }, { key: "_onKeyDown", value: function(I) {
var S = I.which;
S === 27 ? (this.dom.search.value = "", this._onSearch(), I.preventDefault(), I.stopPropagation()) : S === 13 && (I.ctrlKey ? this._onSearch(true) : I.shiftKey ? this.previous() : this.next(), I.preventDefault(), I.stopPropagation());
} }, { key: "_onKeyUp", value: function(I) {
var S = I.keyCode;
S !== 27 && S !== 13 && this._onDelayedSearch(I);
} }, { key: "clear", value: function() {
this.dom.search.value = "", this._onSearch();
} }, { key: "forceSearch", value: function() {
this._onSearch(true);
} }, { key: "isEmpty", value: function() {
return this.dom.search.value === "";
} }, { key: "destroy", value: function() {
this.editor = null, this.dom.container.removeChild(this.dom.wrapper), this.dom = null, this.results = null, this.activeResult = null, this._clearDelay();
} }]) && _(V.prototype, F), Object.defineProperty(V, "prototype", { writable: false }), T;
}();
function $(T) {
return ($ = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(V) {
return typeof V;
} : function(V) {
return V && typeof Symbol == "function" && V.constructor === Symbol && V !== Symbol.prototype ? "symbol" : typeof V;
})(T);
}
function G(T, V) {
for (var F = 0; F < V.length; F++) {
var I = V[F];
I.enumerable = I.enumerable || false, I.configurable = true, "value" in I && (I.writable = true), Object.defineProperty(T, function(S) {
return S = function(L, O) {
if ($(L) !== "object" || L === null)
return L;
var J = L[Symbol.toPrimitive];
if (J === void 0)
return (O === "string" ? String : Number)(L);
if (J = J.call(L, O || "default"), $(J) !== "object")
return J;
throw new TypeError("@@toPrimitive must return a primitive value.");
}(S, "string"), $(S) === "symbol" ? S : String(S);
}(I.key), I);
}
}
var W = function() {
function T(I, S) {
if (!(this instanceof T))
throw new TypeError("Cannot call a class as a function");
I && (this.root = S, this.path = document.createElement("div"), this.path.className = "jsoneditor-treepath", this.path.setAttribute("tabindex", 0), this.contentMenuClicked = false, I.appendChild(this.path), this.reset());
}
var V, F;
return V = T, (F = [{ key: "reset", value: function() {
this.path.textContent = (0, P.Iu)("selectNode");
} }, { key: "setPath", value: function(I) {
var S = this;
this.path.textContent = "", I && I.length && I.forEach(function(L, O) {
var J, re = document.createElement("span");
re.className = "jsoneditor-treepath-element", re.innerText = L.name, re.onclick = (function(pe) {
this.selectionCallback && this.selectionCallback(pe);
}).bind(S, L), S.path.appendChild(re), L.children.length && ((J = document.createElement("span")).className = "jsoneditor-treepath-seperator", J.textContent = "►", J.onclick = function() {
S.contentMenuClicked = true;
var pe = [];
L.children.forEach(function(me) {
pe.push({ text: me.name, className: "jsoneditor-type-modes" + (I[O + 1] + 1 && I[O + 1].name === me.name ? " jsoneditor-selected" : ""), click: (function(ye, xe) {
this.contextMenuCallback && this.contextMenuCallback(ye, xe);
}).bind(S, L, me.name) });
}), new x.x(pe, { limitHeight: true }).show(J, S.root, true);
}, S.path.appendChild(J)), O === I.length - 1 && (re = (J || re).getBoundingClientRect().right, S.path.offsetWidth < re && (S.path.scrollLeft = re), S.path.scrollLeft) && ((re = document.createElement("span")).className = "jsoneditor-treepath-show-all-btn", re.title = "show all path", re.textContent = "...", re.onclick = (function(pe) {
(S.contentMenuClicked = false, y.addClassName)(S.path, "show-all"), S.path.style.width = S.path.parentNode.getBoundingClientRect().width - 10 + "px", S.path.onblur = function() {
S.contentMenuClicked ? (S.contentMenuClicked = false, S.path.focus()) : ((0, y.removeClassName)(S.path, "show-all"), S.path.onblur = void 0, S.path.style.width = "", S.setPath(pe));
};
}).bind(S, I), S.path.insertBefore(re, S.path.firstChild));
});
} }, { key: "onSectionSelected", value: function(I) {
typeof I == "function" && (this.selectionCallback = I);
} }, { key: "onContextMenuItemSelected", value: function(I) {
typeof I == "function" && (this.contextMenuCallback = I);
} }]) && G(V.prototype, F), Object.defineProperty(V, "prototype", { writable: false }), T;
}(), X = K(8037), Q = K.n(X), K = {}, ne = (K.create = function(T, V) {
if (!T)
throw new Error("No container element provided.");
function F(te) {
var ie, ce;
document.createRange ? ((ie = document.createRange()).selectNodeContents(te), ie.collapse(false), (ce = window.getSelection()).removeAllRanges(), ce.addRange(ie)) : document.selection && ((ie = document.body.createTextRange()).moveToElementText(te), ie.collapse(false), ie.select());
}
function I(te) {
return re === void 0 && ((re = document.createElement("span")).style.visibility = "hidden", re.style.position = "fixed", re.style.outline = "0", re.style.margin = "0", re.style.padding = "0", re.style.border = "0", re.style.left = "0", re.style.whiteSpace = "pre", re.style.fontSize = me, re.style.fontFamily = ye, re.style.fontWeight = "normal", document.body.appendChild(re)), re.textContent = te, re.getBoundingClientRect().right;
}
function S() {
this.style.backgroundColor = "#ddd";
}
function L() {
this.style.backgroundColor = "";
}
function O() {
Se.hide(), Se.onmouseselection(this.__hint, Se.rs);
}
var J, re, pe, me, ye, xe, be, Ae, we, Re, Me, Se, ve, Le, Ge, ge2;
this.container = T, this.dom = {}, this.highlighter = new Y(), this.selection = void 0, this.multiselection = { nodes: [] }, this.validateSchema = null, this.validationSequence = 0, this.errorNodes = [], this.lastSchemaErrors = void 0, this.node = null, this.focusTarget = null, this._setOptions(V), V.autocomplete && (this.autocomplete = ((J = (J = V.autocomplete) || {}).filter = J.filter || "start", J.trigger = J.trigger || "keydown", J.confirmKeys = J.confirmKeys || [39, 35, 9], J.caseSensitive = J.caseSensitive || false, ye = me = "", (xe = document.createElement("div")).style.position = "relative", xe.style.outline = "0", xe.style.border = "0", xe.style.margin = "0", xe.style.padding = "0", (be = document.createElement("div")).className = "autocomplete dropdown", be.style.position = "absolute", be.style.visibility = "hidden", Ae = be, we = [], Me = -1, Le = Se = { rs: ve = { onArrowDown: function() {
}, onArrowUp: function() {
}, onEnter: function() {
}, onTab: function() {
}, startFrom: Re = 0, options: [], element: null, elementHint: null, elementStyle: null, wrapper: xe, show: function(te, ie, ce) {
var fe = this;
this.startFrom = ie, this.wrapper.remove(), this.elementHint && (this.elementHint.remove(), this.elementHint = null), me === "" && (me = window.getComputedStyle(te).getPropertyValue("font-size")), ye === "" && (ye = window.getComputedStyle(te).getPropertyValue("font-family")), be.style.marginLeft = "0", be.style.marginTop = te.getBoundingClientRect().height + "px", this.options = ce.map(String), this.element !== te && (this.element = te, this.elementStyle = { zIndex: this.element.style.zIndex, position: this.element.style.position, backgroundColor: this.element.style.backgroundColor, borderColor: this.element.style.borderColor }), this.element.style.zIndex = 3, this.element.style.position = "relative", this.element.style.backgroundColor = "transparent", this.element.style.borderColor = "transparent", this.elementHint = te.cloneNode(), this.elementHint.className = "autocomplete hint", this.elementHint.style.zIndex = 2, this.elementHint.style.position = "absolute", this.elementHint.onfocus = function() {
fe.element.focus();
}, this.element.addEventListener && (this.element.removeEventListener("keydown", Ge), this.element.addEventListener("keydown", Ge, false), this.element.removeEventListener("blur", ge2), this.element.addEventListener("blur", ge2, false)), xe.appendChild(this.elementHint), xe.appendChild(be), te.parentElement.appendChild(xe), this.repaint(te);
}, setText: function(te) {
this.element.innerText = te;
}, getText: function() {
return this.element.innerText;
}, hideDropDown: function() {
this.wrapper.remove(), this.elementHint && (this.elementHint.remove(), this.elementHint = null, Le.hide(), this.element.style.zIndex = this.elementStyle.zIndex, this.element.style.position = this.elementStyle.position, this.element.style.backgroundColor = this.elementStyle.backgroundColor, this.element.style.borderColor = this.elementStyle.borderColor);
}, repaint: function(ie) {
var ie = (ie = ie.innerText).replace(`
`, ""), ce = this.options.length, fe = ie.substring(this.startFrom);
pe = ie.substring(0, this.startFrom);
for (var Ie = 0; Ie < ce; Ie++) {
var $e = this.options[Ie];
if (!J.caseSensitive && $e.toLowerCase().indexOf(fe.toLowerCase()) === 0 || J.caseSensitive && $e.indexOf(fe) === 0) {
this.elementHint.innerText = pe + fe + $e.substring(fe.length), this.elementHint.realInnerText = pe + $e;
break;
}
}
be.style.left = I(pe) + "px", Le.refresh(fe, this.options), this.elementHint.style.width = I(this.elementHint.innerText) + 10 + "px", be.style.visibility !== "hidden" && (this.elementHint.style.width = I(this.elementHint.innerText) + be.clientWidth + "px");
} }, hide: function() {
Ae.style.visibility = "hidden";
}, refresh: function(te, ie) {
Ae.style.visibility = "hidden", Re = 0, Ae.textContent = "";
var fe = window.innerHeight || document.documentElement.clientHeight, $e = Ae.parentNode.getBoundingClientRect(), ce = $e.top - 6, fe = fe - $e.bottom - 6, Ie = (we = [], typeof J.filter == "function" ? J.filter : U[J.filter]), $e = Ie ? ie.filter(function(ee) {
return Ie(J.caseSensitive ? te : te.toLowerCase(), J.caseSensitive ? ee : ee.toLowerCase(), J);
}) : [];
(we = $e.map(function(ee) {
var ae = document.createElement("div"), he = (ae.className = "item", ae.onmouseover = S, ae.onmouseout = L, ae.onmousedown = O, ae.__hint = ee, ae.textContent = "", ae.appendChild(document.createTextNode(ee.substring(0, te.length))), document.createElement("b"));
return he.appendChild(document.createTextNode(ee.substring(te.length))), ae.appendChild(he), Ae.appendChild(ae), ae;
})).length === 0 || we.length === 1 && (te.toLowerCase() === we[0].__hint.toLowerCase() && !J.caseSensitive || te === we[0].__hint && J.caseSensitive) || we.length < 2 || (Se.highlight(0), 3 * fe < ce ? (Ae.style.maxHeight = ce + "px", Ae.style.top = "", Ae.style.bottom = "100%") : (Ae.style.top = "100%", Ae.style.bottom = "", Ae.style.maxHeight = fe + "px"), Ae.style.visibility = "visible");
}, highlight: function(te) {
Me !== -1 && we[Me] && (we[Me].className = "item"), we[te].className = "item hover", Me = te;
}, move: function(te) {
return Ae.style.visibility === "hidden" ? "" : (Re + te !== -1 && Re + te !== we.length && (Re += te, Se.highlight(Re)), we[Re].__hint);
}, onmouseselection: function() {
} }, Ge = (function(te) {
var ie = (te = te || window.event).keyCode;
if (this.elementHint != null && ie !== 33 && ie !== 34)
if (ie === 27)
ve.hideDropDown(), ve.element.focus(), te.preventDefault(), te.stopPropagation();
else {
var ce, fe = (fe = this.element.innerText).replace(`
`, "");
if (0 <= J.confirmKeys.indexOf(ie))
ie === 9 && this.elementHint.innerText.length === 0 && ve.onTab(), 0 < this.elementHint.innerText.length && this.element.innerText !== this.elementHint.realInnerText && (this.element.innerText = this.elementHint.realInnerText, ve.hideDropDown(), F(this.element), ie === 9) && (ve.element.focus(), te.preventDefault(), te.stopPropagation());
else if (ie === 13)
if (this.elementHint.innerText.length === 0)
ve.onEnter();
else {
var Ie = be.style.visibility === "hidden";
if (Le.hide(), Ie)
return ve.hideDropDown(), ve.element.focus(), void ve.onEnter();
this.element.innerText = this.elementHint.realInnerText, ve.hideDropDown(), F(this.element), te.preventDefault(), te.stopPropagation();
}
else
ie === 40 ? (Ie = fe.substring(this.startFrom), (ce = Le.move(1)) === "" && ve.onArrowDown(), this.elementHint.innerText = pe + Ie + ce.substring(Ie.length), this.elementHint.realInnerText = pe + ce, te.preventDefault(), te.stopPropagation()) : ie === 38 && (Ie = fe.substring(this.startFrom), (ce = Le.move(-1)) === "" && ve.onArrowUp(), this.elementHint.innerText = pe + Ie + ce.substring(Ie.length), this.elementHint.realInnerText = pe + ce, te.preventDefault(), te.stopPropagation());
}
}).bind(ve), ge2 = function(te) {
ve.hideDropDown();
}, Le.onmouseselection = function(te, ie) {
ie.element.innerText = ie.elementHint.innerText = pe + te, ie.hideDropDown(), window.setTimeout(function() {
ie.element.focus(), F(ie.element);
}, 1);
}, ve)), this.options.history && this.options.mode !== "view" && (this.history = new k(this)), this._createFrame(), this._createTable();
}, K.destroy = function() {
this.frame && this.container && this.frame.parentNode === this.container && (this.container.removeChild(this.frame), this.frame = null), this.container = null, this.dom = null, this.clear(), this.node = null, this.focusTarget = null, this.selection = null, this.multiselection = null, this.errorNodes = null, this.validateSchema = null, this._debouncedValidate = null, this.history && (this.history.destroy(), this.history = null), this.searchBox && (this.searchBox.destroy(), this.searchBox = null), this.modeSwitcher && (this.modeSwitcher.destroy(), this.modeSwitcher = null), this.frameFocusTracker.destroy();
}, K._setOptions = function(T) {
var V = this;
this.options = { search: true, history: true, mode: "tree", name: void 0, schema: null, schemaRefs: null, autocomplete: null, navigationBar: true, mainMenuBar: true, limitDragging: false, onSelectionChange: null, colorPicker: true, onColorPicker: function(F, I, S) {
var L;
Q() && (L = F.getBoundingClientRect().top, L = (0, y.getWindow)(F).innerHeight - L < 300 && 300 < L, new (Q())({ parent: F, color: I, popup: L ? "top" : "bottom", onDone: function(O) {
O = O.rgba[3] === 1 ? O.hex.substr(0, 7) : O.hex, S(O);
} }).show());
}, timestampTag: true, timestampFormat: null, createQuery: N.r, executeQuery: N.J, onEvent: null, enableSort: true, enableTransform: true }, T && (Object.keys(T).forEach(function(F) {
V.options[F] = T[F];
}), T.limitDragging == null) && T.schema != null && (this.options.limitDragging = true), this.setSchema(this.options.schema, this.options.schemaRefs), this._debouncedValidate = (0, y.debounce)(this._validateAndCatch.bind(this), this.DEBOUNCE_INTERVAL), T.onSelectionChange && this.onSelectionChange(T.onSelectionChange), (0, P.cC)(this.options.languages), (0, P.m0)(this.options.language);
}, K.set = function(T) {
T instanceof Function || T === void 0 ? this.clear() : (this.content.removeChild(this.table), T = { field: this.options.name, value: T }, T = new t(this, T), this._setRoot(T), this._validateAndCatch(), this.node.expand(false), this.content.appendChild(this.table)), this.history && this.history.clear(), this.searchBox && this.searchBox.clear();
}, K.update = function(T) {
var V, F;
this.node.deepEqual(T) || (V = this.getSelection(), this.onChangeDisabled = true, this.node.update(T), this.onChangeDisabled = false, this._validateAndCatch(), this.searchBox && !this.searchBox.isEmpty() && this.searchBox.forceSearch(), V && V.start && V.end && (T = this.node.findNodeByPath(V.start.path), F = this.node.findNodeByPath(V.end.path), T) && F ? this.setSelection(V.start, V.end) : this.setSelection({}, {}));
}, K.get = function() {
if (this.node)
return this.node.getValue();
}, K.getText = function() {
return JSON.stringify(this.get());
}, K.setText = function(T) {
try {
this.set((0, y.parse)(T));
} catch {
T = (0, y.tryJsonRepair)(T), this.set((0, y.parse)(T));
}
}, K.updateText = function(T) {
try {
this.update((0, y.parse)(T));
} catch {
T = (0, y.tryJsonRepair)(T), this.update((0, y.parse)(T));
}
}, K.setName = function(T) {
this.options.name = T, this.node && this.node.updateField(this.options.name);
}, K.getName = function() {
return this.options.name;
}, K.focus = function() {
var T = this.scrollableContent.querySelector("[contenteditable=true]");
T ? T.focus() : this.node.dom.expand ? this.node.dom.expand.focus() : this.node.dom.menu ? this.node.dom.menu.focus() : (T = this.frame.querySelector("button")) && T.focus();
}, K.clear = function() {
this.node && (this.node.hide(), delete this.node), this.treePath && this.treePath.reset();
}, K._setRoot = function(T) {
this.clear(), (this.node = T).setParent(null), T.setField(this.getName(), false), delete T.index, this.tbody.appendChild(T.getDom());
}, K.search = function(T) {
var V;
return this.node ? (this.content.removeChild(this.table), V = this.node.search(T), this.content.appendChild(this.table)) : V = [], V;
}, K.expandAll = function() {
this.node && (this.content.removeChild(this.table), this.node.expand(), this.content.appendChild(this.table));
}, K.collapseAll = function() {
this.node && (this.content.removeChild(this.table), this.node.collapse(), this.content.appendChild(this.table));
}, K.expand = function(T) {
var V;
T && (V = this.node ? this.node.findNodeByPath(T.path) : null) && (T.isExpand ? V.expand(T.recursive) : V.collapse(T.recursive));
}, K._onAction = function(T, V) {
this.history && this.history.add(T, V), this._onChange();
}, K._onChange = function() {
if (!this.onChangeDisabled) {
var T;
if (this.selection = this.getDomSelection(), this._debouncedValidate(), this.treePath && ((T = this.node && this.selection ? this.node.findNodeByInternalPath(this.selection.path) : this.multiselection ? this.multiselection.nodes[0] : void 0) ? this._updateTreePath(T.getNodePath()) : this.treePath.reset()), this.options.onChange)
try {
this.options.onChange();
} catch {
}
if (this.options.onChangeJSON)
try {
this.options.onChangeJSON(this.get());
} catch {
}
if (this.options.onChangeText)
try {
this.options.onChangeText(this.getText());
} catch {
}
if (this.options.onClassName && this.node.recursivelyUpdateCssClassesOnNodes(), this.options.onNodeName && this.node.childs)
try {
this.node.recursivelyUpdateNodeName();
} catch {
}
}
}, K.validate = function() {
var T = this, V = this.node;
if (V) {
var F = V.getValue(), I = [];
this.validateSchema && !this.validateSchema(F) && (I = this.validateSchema.errors.map(function(O) {
return (0, y.improveSchemaError)(O);
}).map(function(O) {
return { node: V.findNode(O.dataPath), error: O, type: "validation" };
}).filter(function(O) {
return O.node != null;
}));
try {
this.validationSequence++;
var S = this, L = this.validationSequence;
return this._validateCustom(F).then(function(O) {
return L === S.validationSequence && (O = [].concat(I, O || []), S._renderValidationErrors(O), typeof T.options.onValidationError == "function" && (0, y.isValidationErrorChanged)(O, T.lastSchemaErrors) && T.options.onValidationError.call(T, O), T.lastSchemaErrors = O), T.lastSchemaErrors;
});
} catch (O) {
return Promise.reject(O);
}
}
}, K._validateAndCatch = function() {
this.validate().catch(function(T) {
});
}, K._renderValidationErrors = function(T) {
this.errorNodes && this.errorNodes.forEach(function(F) {
F.setError(null);
});
var V = T.reduce(function(F, I) {
return I.node.findParents().filter(function(S) {
return !F.some(function(L) {
return L[0] === S;
});
}).map(function(S) {
return [S, I.node];
}).concat(F);
}, []);
this.errorNodes = V.map(function(F) {
return { node: F[0], child: F[1], error: { message: F[0].type === "object" ? (0, P.Iu)("containsInvalidProperties") : (0, P.Iu)("containsInvalidItems") } };
}).concat(T).map(function(F) {
return F.node.setError(F.error, F.child), F.node;
});
}, K._validateCustom = function(T) {
try {
var V, F;
if (this.options.onValidate)
return V = this.node, F = this.options.onValidate(T), ((0, y.isPromise)(F) ? F : Promise.resolve(F)).then(function(I) {
return Array.isArray(I) ? I.filter(function(S) {
var L = (0, y.isValidValidationError)(S);
return L;
}).map(function(S) {
var L;
try {
L = S && S.path ? V.findNodeByPath(S.path) : null;
} catch {
}
return { node: L, error: S, type: "customValidation" };
}).filter(function(S) {
return S && S.node && S.error && S.error.message;
}) : null;
});
} catch (I) {
return Promise.reject(I);
}
return Promise.resolve(null);
}, K.refresh = function() {
this.node && this.node.updateDom({ recurse: true });
}, K.startAutoScroll = function(T) {
var V = this, F = this.scrollableContent, I = (0, y.getAbsoluteTop)(F), S = F.clientHeight, L = I + S;
T < I + 24 && 0 < F.scrollTop ? this.autoScrollStep = (I + 24 - T) / 3 : L - 24 < T && S + F.scrollTop < F.scrollHeight ? this.autoScrollStep = (L - 24 - T) / 3 : this.autoScrollStep = void 0, this.autoScrollStep ? this.autoScrollTimer || (this.autoScrollTimer = setInterval(function() {
V.autoScrollStep ? F.scrollTop -= V.autoScrollStep : V.stopAutoScroll();
}, 50)) : this.stopAutoScroll();
}, K.stopAutoScroll = function() {
this.autoScrollTimer && (clearTimeout(this.autoScrollTimer), delete this.autoScrollTimer), this.autoScrollStep && delete this.autoScrollStep;
}, K.setDomSelection = function(T) {
var V, F, I;
T && ("scrollTop" in T && this.scrollableContent && (this.scrollableContent.scrollTop = T.scrollTop), T.paths ? (V = this, F = T.paths.map(function(S) {
return V.node.findNodeByInternalPath(S);
}), this.select(F)) : (I = (F = T.path ? this.node.findNodeByInternalPath(T.path) : null) && T.domName ? F.dom[T.domName] : null, T.range && I ? (T = Object.assign({}, T.range, { container: I }), (0, y.setSelectionOffset)(T)) : F && F.focus()));
}, K.getDomSelection = function() {
var T = t.getNodeFromTarget(this.focusTarget), V = this.focusTarget, F = T ? Object.keys(T.dom).find(function(S) {
return T.dom[S] === V;
}) : null, I = (0, y.getSelectionOffset)();
return (I = (I = I && I.container.nodeName !== "DIV" ? null : I) && I.container !== V ? null : I) && delete I.container, { path: T ? T.getInternalPath() : null, domName: F, range: I, paths: 0 < this.multiselection.length ? this.multiselection.nodes.map(function(S) {
return S.getInternalPath();
}) : null, scrollTop: this.scrollableContent ? this.scrollableContent.scrollTop : 0 };
}, K.scrollTo = function(T, V) {
var F, I, S, L, O = this.scrollableContent;
O ? ((F = this).animateTimeout && (clearTimeout(F.animateTimeout), delete F.animateTimeout), F.animateCallback && (F.animateCallback(false), delete F.animateCallback), I = O.clientHeight, S = O.scrollHeight - I, L = Math.min(Math.max(T - I / 4, 0), S), function J() {
var re = O.scrollTop, re = L - re;
3 < Math.abs(re) ? (O.scrollTop += re / 3, F.animateCallback = V, F.animateTimeout = setTimeout(J, 50)) : (V && V(true), O.scrollTop = L, delete F.animateTimeout, delete F.animateCallback);
}()) : V && V(false);
}, K._createFrame = function() {
var T = this, V = (this.frame = document.createElement("div"), this.frame.className = "jsoneditor jsoneditor-mode-" + this.options.mode, this.container.appendChild(this.frame), this.contentOuter = document.createElement("div"), this.contentOuter.className = "jsoneditor-outer", this);
function F(J) {
V._onEvent && V._onEvent(J);
}
var I, S, L, O = { target: this.frame, onFocus: this.options.onFocus || null, onBlur: this.options.onBlur || null };
this.frameFocusTracker = new H.R(O), this.frame.onclick = function(J) {
var re = J.target;
F(J), re.nodeName === "BUTTON" && J.preventDefault();
}, this.frame.oninput = F, this.frame.onchange = F, this.frame.onkeydown = F, this.frame.onkeyup = F, this.frame.oncut = F, this.frame.onpaste = F, this.frame.onmousedown = F, this.frame.onmouseup = F, this.frame.onmouseover = F, this.frame.onmouseout = F, (0, y.addEventListener)(this.frame, "focus", F, true), (0, y.addEventListener)(this.frame, "blur", F, true), this.frame.onfocusin = F, this.frame.onfocusout = F, this.options.mainMenuBar && ((0, y.addClassName)(this.contentOuter, "has-main-menu-bar"), this.menu = document.createElement("div"), this.menu.className = "jsoneditor-menu", this.frame.appendChild(this.menu), (O = document.createElement("button")).type = "button", O.className = "jsoneditor-expand-all", O.title = (0, P.Iu)("expandAll"), O.onclick = function() {
V.expandAll(), typeof T.options.onExpand == "function" && T.options.onExpand({ path: [], isExpand: true, recursive: true });
}, this.menu.appendChild(O), (O = document.createElement("button")).type = "button", O.title = (0, P.Iu)("collapseAll"), O.className = "jsoneditor-collapse-all", O.onclick = function() {
V.collapseAll(), typeof T.options.onExpand == "function" && T.options.onExpand({ path: [], isExpand: false, recursive: true });
}, this.menu.appendChild(O), this.options.enableSort && ((O = document.createElement("button")).type = "button", O.className = "jsoneditor-sort", O.title = (0, P.Iu)("sortTitleShort"), O.onclick = function() {
V.node.showSortModal();
}, this.menu.appendChild(O)), this.options.enableTransform && ((O = document.createElement("button")).type = "button", O.title = (0, P.Iu)("transformTitleShort"), O.className = "jsoneditor-transform", O.onclick = function() {
V.node.showTransformModal();
}, this.menu.appendChild(O)), this.history && ((I = document.createElement("button")).type = "button", I.className = "jsoneditor-undo jsoneditor-separator", I.title = (0, P.Iu)("undo"), I.onclick = function() {
V._onUndo();
}, this.menu.appendChild(I), this.dom.undo = I, (S = document.createElement("button")).type = "button", S.className = "jsoneditor-redo", S.title = (0, P.Iu)("redo"), S.onclick = function() {
V._onRedo();
}, this.menu.appendChild(S), this.dom.redo = S, this.history.onChange = function() {
I.disabled = !V.history.canUndo(), S.disabled = !V.history.canRedo();
}, this.history.onChange()), this.options && this.options.modes && this.options.modes.length && ((L = this).modeSwitcher = new A.x(this.menu, this.options.modes, this.options.mode, function(J) {
try {
L.setMode(J), L.modeSwitcher.focus();
} catch (re) {
L._onError(re);
}
})), this.options.search) && (this.searchBox = new v(this, this.menu)), this.options.navigationBar && (this.navBar = document.createElement("div"), this.navBar.className = "jsoneditor-navigation-bar nav-bar-empty", this.frame.appendChild(this.navBar), this.treePath = new W(this.navBar, this.getPopupAnchor()), this.treePath.onSectionSelected(this._onTreePathSectionSelected.bind(this)), this.treePath.onContextMenuItemSelected(this._onTreePathMenuItemSelected.bind(this)));
}, K._onUndo = function() {
this.history && (this.history.undo(), this._onChange());
}, K._onRedo = function() {
this.history && (this.history.redo(), this._onChange());
}, K._onEvent = function(T) {
if (!t.targetIsColorPicker(T.target)) {
var V, F = t.getNodeFromTarget(T.target);
if (T.type === "keydown" && this._onKeyDown(T), F && T.type === "focus" && (this.focusTarget = T.target, this.options.autocomplete) && this.options.autocomplete.trigger === "focus" && this._showAutoComplete(T.target), T.type === "mousedown" && this._startDragDistance(T), T.type !== "mousemove" && T.type !== "mouseup" && T.type !== "click" || this._updateDragDistance(T), F && this.options && this.options.navigationBar && F && (T.type === "keydown" || T.type === "mousedown") && (V = this, setTimeout(function() {
V._updateTreePath(F.getNodePath());
})), F && F.selected) {
if (T.type === "click") {
if (T.target === F.dom.menu)
return void this.showContextMenu(T.target);
T.hasMoved || this.deselect();
}
T.type === "mousedown" && t.onDragStart(this.multiselection.nodes, T);
} else
T.type === "mousedown" && (0, y.hasParentNode)(T.target, this.content) && (this.deselect(), F && T.target === F.dom.drag ? t.onDragStart(F, T) : F && (T.target === F.dom.field || T.target === F.dom.value || T.target === F.dom.select) || this._onMultiSelectStart(T));
F && F.onEvent(T);
}
}, K._updateTreePath = function(T) {
var V;
function F(I) {
return I.parent ? I.parent.type === "array" ? I.index : I.field : I.field || I.type;
}
T && T.length ? ((0, y.removeClassName)(this.navBar, "nav-bar-empty"), V = [], T.forEach(function(I) {
var S = { name: F(I), node: I, children: [] };
I.childs && I.childs.length && I.childs.forEach(function(L) {
S.children.push({ name: F(L), node: L });
}), V.push(S);
}), this.treePath.setPath(V)) : (0, y.addClassName)(this.navBar, "nav-bar-empty");
}, K._onTreePathSectionSelected = function(T) {
T && T.node && (T.node.expandTo(), T.node.focus());
}, K._onTreePathMenuItemSelected = function(T, V) {
T && T.children.length && (T = T.children.find(function(F) {
return F.name === V;
})) && T.node && (this._updateTreePath(T.node.getNodePath()), T.node.expandTo(), T.node.focus());
}, K._startDragDistance = function(T) {
this.dragDistanceEvent = { initialTarget: T.target, initialPageX: T.pageX, initialPageY: T.pageY, dragDistance: 0, hasMoved: false };
}, K._updateDragDistance = function(T) {
this.dragDistanceEvent || this._startDragDistance(T);
var V = T.pageX - this.dragDistanceEvent.initialPageX, F = T.pageY - this.dragDistanceEvent.initialPageY;
return this.dragDistanceEvent.dragDistance = Math.sqrt(V * V + F * F), this.dragDistanceEvent.hasMoved = this.dragDistanceEvent.hasMoved || 10 < this.dragDistanceEvent.dragDistance, T.dragDistance = this.dragDistanceEvent.dragDistance, T.hasMoved = this.dragDistanceEvent.hasMoved, T.dragDistance;
}, K._onMultiSelectStart = function(T) {
var V, F = t.getNodeFromTarget(T.target);
this.options.mode === "tree" && this.options.onEditable === void 0 && (this.multiselection = { start: F || null, end: null, nodes: [] }, this._startDragDistance(T), (V = this).mousemove || (this.mousemove = (0, y.addEventListener)(T.view, "mousemove", function(I) {
V._onMultiSelect(I);
})), this.mouseup || (this.mouseup = (0, y.addEventListener)(T.view, "mouseup", function(I) {
V._onMultiSelectEnd(I);
})), T.preventDefault());
}, K._onMultiSelect = function(T) {
var V;
T.preventDefault(), this._updateDragDistance(T), T.hasMoved && ((T = t.getNodeFromTarget(T.target)) && (this.multiselection.start == null && (this.multiselection.start = T), this.multiselection.end = T), this.deselect(), T = this.multiselection.start, V = this.multiselection.end || this.multiselection.start, T) && V && (this.multiselection.nodes = this._findTopLevelNodes(T, V), this.multiselection.nodes && this.multiselection.nodes.length && (T = this.multiselection.nodes[0], this.multiselection.start === T || this.multiselection.start.isDescendantOf(T) ? this.multiselection.direction = "down" : this.multiselection.direction = "up"), this.select(this.multiselection.nodes));
}, K._onMultiSelectEnd = function(T) {
var V = this.multiselection.nodes[0];
V && V.dom.menu && V.dom.menu.focus(), this.multiselection.start = null, this.multiselection.end = null, this.mousemove && ((0, y.removeEventListener)(T.view, "mousemove", this.mousemove), delete this.mousemove), this.mouseup && ((0, y.removeEventListener)(T.view, "mouseup", this.mouseup), delete this.mouseup);
}, K.deselect = function(T) {
var V = !!this.multiselection.nodes.length;
this.multiselection.nodes.forEach(function(F) {
F.setSelected(false);
}), this.multiselection.nodes = [], T && (this.multiselection.start = null, this.multiselection.end = null), V && this._selectionChangedHandler && this._selectionChangedHandler();
}, K.select = function(T) {
if (!Array.isArray(T))
return this.select([T]);
var V;
T && (this.deselect(), this.multiselection.nodes = T.slice(0), V = T[0], T.forEach(function(F) {
F.expandPathToNode(), F.setSelected(true, F === V);
}), this._selectionChangedHandler) && (T = this.getSelection(), this._selectionChangedHandler(T.start, T.end));
}, K._findTopLevelNodes = function(O, J) {
for (var F = O.getNodePath(), I = J.getNodePath(), S = 0; S < F.length && F[S] === I[S]; )
S++;
var L, O = F[S - 1], J = F[S], re = I[S];
return J && re || (O.parent ? O = (re = J = O).parent : (J = O.childs[0], re = O.childs[O.childs.length - 1])), O && J && re ? (J = O.childs.indexOf(J), re = O.childs.indexOf(re), L = Math.min(J, re), J = Math.max(J, re), O.childs.slice(L, J + 1)) : [];
}, K._showAutoComplete = function(T) {
var V, F = t.getNodeFromTarget(T), I = "";
0 <= T.className.indexOf("jsoneditor-value") && (I = "value"), (I = 0 <= T.className.indexOf("jsoneditor-field") ? "field" : I) !== "" && (V = this, setTimeout(function() {
var S;
!F || !(V.options.autocomplete.trigger === "focus" || 0 < T.innerText.length) || (S = V.options.autocomplete.getOptions(T.innerText, F.getPath(), I, F.editor)) === null ? V.autocomplete.hideDropDown() : typeof S.then == "function" ? S.then(function(L) {
L === null ? V.autocomplete.hideDropDown() : L.options ? V.autocomplete.show(T, L.startFrom, L.options) : V.autocomplete.show(T, 0, L);
}).catch(function(L) {
}) : S.options ? V.autocomplete.show(T, S.startFrom, S.options) : V.autocomplete.show(T, 0, S);
}, 50));
}, K._onKeyDown = function(T) {
var V, F = T.which || T.keyCode, I = T.altKey, S = T.ctrlKey, L = T.metaKey, O = T.shiftKey, J = false, re = this.focusTarget;
F === 9 && (V = this, setTimeout(function() {
V.focusTarget !== re && (0, y.selectContentEditable)(V.focusTarget);
}, 0)), this.searchBox && (S && F === 70 ? (this.searchBox.dom.search.focus(), this.searchBox.dom.search.select(), J = true) : (F === 114 || S && F === 71) && (O ? this.searchBox.previous(true) : this.searchBox.next(true), J = true)), this.history && (S && !O && F === 90 ? (this._onUndo(), J = true) : S && O && F === 90 && (this._onRedo(), J = true)), !this.options.autocomplete || J || S || I || L || T.key.length !== 1 && F !== 8 && F !== 46 || (J = false, this._showAutoComplete(T.target)), J && (T.preventDefault(), T.stopPropagation());
}, K._createTable = function() {
var T;
this.options.navigationBar && (0, y.addClassName)(this.contentOuter, "has-nav-bar"), this.scrollableContent = document.createElement("div"), this.scrollableContent.className = "jsoneditor-tree", this.contentOuter.appendChild(this.scrollableContent), this.content = document.createElement("div"), this.content.className = "jsoneditor-tree-inner", this.scrollableContent.appendChild(this.content), this.table = document.createElement("table"), this.table.className = "jsoneditor-tree", this.content.appendChild(this.table), this.colgroupContent = document.createElement("colgroup"), this.options.mode === "tree" && ((T = document.createElement("col")).width = "24px", this.colgroupContent.appendChild(T)), (T = document.createElement("col")).width = "24px", this.colgroupContent.appendChild(T), T = document.createElement("col"), this.colgroupContent.appendChild(T), this.table.appendChild(this.colgroupContent), this.tbody = document.createElement("tbody"), this.table.appendChild(this.tbody), this.frame.appendChild(this.contentOuter);
}, K.showContextMenu = function(T, V) {
var F, I = [], S = this.multiselection.nodes.slice();
I.push({ text: (0, P.Iu)("duplicateText"), title: (0, P.Iu)("duplicateTitle"), className: "jsoneditor-duplicate", click: function() {
t.onDuplicate(S);
} }), I.push({ text: (0, P.Iu)("remove"), title: (0, P.Iu)("removeTitle"), className: "jsoneditor-remove", click: function() {
t.onRemove(S);
} }), this.options.onCreateMenu && (F = S.map(function(L) {
return L.getPath();
}), I = this.options.onCreateMenu(I, { type: "multiple", path: F[0], paths: F })), new x.x(I, { close: V }).show(T, this.getPopupAnchor());
}, K.getPopupAnchor = function() {
return this.options.popupAnchor || this.frame;
}, K.getSelection = function() {
var T, V, F = { start: null, end: null };
return this.multiselection.nodes && this.multiselection.nodes.length && this.multiselection.nodes.length && (T = this.multiselection.nodes[0], V = this.multiselection.nodes[this.multiselection.nodes.length - 1], this.multiselection.direction === "down" ? (F.start = T.serialize(), F.end = V.serialize()) : (F.start = V.serialize(), F.end = T.serialize())), F;
}, K.onSelectionChange = function(T) {
typeof T == "function" && (this._selectionChangedHandler = (0, y.debounce)(T, this.DEBOUNCE_INTERVAL));
}, K.setSelection = function(T, V) {
T && T.dom && T.range && this.setDomSelection(T), T = this._getNodeInstancesByRange(T, V), T.forEach(function(F) {
F.expandTo();
}), this.select(T);
}, K._getNodeInstancesByRange = function(T, V) {
T && T.path && (F = this.node.findNodeByPath(T.path), V) && V.path && (I = this.node.findNodeByPath(V.path));
var F, I, S = [];
if (F instanceof t)
if (I instanceof t && I !== F)
if (F.parent === I.parent) {
V = F.getIndex() < I.getIndex() ? (T = F, I) : (T = I, F);
var L = T;
for (S.push(L); L = L.nextSibling(), S.push(L), L && L !== V; )
;
} else
S = this._findTopLevelNodes(F, I);
else
S.push(F);
return S;
}, K.getNodesByRange = function(F, V) {
var F = this._getNodeInstancesByRange(F, V), I = [];
return F.forEach(function(S) {
I.push(S.serialize());
}), I;
}, [{ mode: "tree", mixin: K, data: "json" }, { mode: "view", mixin: K, data: "json" }, { mode: "form", mixin: K, data: "json" }]);
}, 2744: function(le, m, D) {
m.tryRequireAjv = function() {
try {
return D(8903);
} catch {
}
};
}, 9125: function(le, m, D) {
m.O = function() {
try {
D(4864);
} catch {
}
};
}, 9791: function(le, U, D) {
D.r(U), D.d(U, { addClassName: function() {
return c;
}, addEventListener: function() {
return X;
}, asyncExec: function() {
return Ie;
}, clear: function() {
return n;
}, compileJSONPointer: function() {
return me;
}, contains: function() {
return ie;
}, debounce: function() {
return L;
}, escapeUnicodeChars: function() {
return d;
}, extend: function() {
return l;
}, findUniqueName: function() {
return we;
}, formatSize: function() {
return Ge;
}, get: function() {
return Ae;
}, getAbsoluteLeft: function() {
return t;
}, getAbsoluteTop: function() {
return s;
}, getChildPaths: function() {
return Re;
}, getColorCSS: function() {
return ye;
}, getIndexForPosition: function() {
return re;
}, getInnerText: function() {
return u;
}, getInputSelection: function() {
return J;
}, getInternetExplorerVersion: function() {
return $;
}, getPositionForPath: function() {
return pe;
}, getSelection: function() {
return M;
}, getSelectionOffset: function() {
return Z;
}, getType: function() {
return o;
}, getWindow: function() {
return e2;
}, hasParentNode: function() {
return v;
}, improveSchemaError: function() {
return V;
}, insideRect: function() {
return S;
}, isArray: function() {
return r;
}, isChildOf: function() {
return K;
}, isFirefox: function() {
return W;
}, isObject: function() {
return te;
}, isPromise: function() {
return F;
}, isTimestamp: function() {
return Le;
}, isUrl: function() {
return a;
}, isValidColor: function() {
return xe;
}, isValidValidationError: function() {
return I;
}, isValidationErrorChanged: function() {
return ce;
}, limitCharacters: function() {
return ge2;
}, makeFieldTooltip: function() {
return be;
}, parse: function() {
return y;
}, parsePath: function() {
return ne;
}, parseString: function() {
return ve;
}, removeAllClassNames: function() {
return p;
}, removeClassName: function() {
return g;
}, removeEventListener: function() {
return Q;
}, removeReturnsAndSurroundingWhitespace: function() {
return _;
}, selectContentEditable: function() {
return E;
}, setEndOfContentEditable: function() {
return w;
}, setSelection: function() {
return B2;
}, setSelectionOffset: function() {
return k;
}, sort: function() {
return Me;
}, sortObjectKeys: function() {
return Se;
}, stringifyPath: function() {
return T;
}, stripFormatting: function() {
return b;
}, textDiff: function() {
return O;
}, tryJsonRepair: function() {
return C;
}, uniqueMergeArrays: function() {
return fe;
}, validate: function() {
return h;
} }), D(4987);
var U = D(233), x = D.n(U), H = D(1262), z = D(6589), j = D(7026), Y = D(7907);
function P(ee) {
return function(ae) {
if (Array.isArray(ae))
return N(ae);
}(ee) || function(ae) {
if (typeof Symbol < "u" && ae[Symbol.iterator] != null || ae["@@iterator"] != null)
return Array.from(ae);
}(ee) || function(ae, he) {
var Ce;
if (ae)
return typeof ae == "string" ? N(ae, he) : (Ce = (Ce = Object.prototype.toString.call(ae).slice(8, -1)) === "Object" && ae.constructor ? ae.constructor.name : Ce) === "Map" || Ce === "Set" ? Array.from(ae) : Ce === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ce) ? N(ae, he) : void 0;
}(ee) || function() {
throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}();
}
function N(ee, ae) {
(ae == null || ae > ee.length) && (ae = ee.length);
for (var he = 0, Ce = new Array(ae); he < ae; he++)
Ce[he] = ee[he];
return Ce;
}
function A(ee) {
return (A = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(ae) {
return typeof ae;
} : function(ae) {
return ae && typeof Symbol == "function" && ae.constructor === Symbol && ae !== Symbol.prototype ? "symbol" : typeof ae;
})(ee);
}
var f = 1e4, R = 9466848e5;
function y(ee) {
try {
return JSON.parse(ee);
} catch (ae) {
throw h(ee), ae;
}
}
function C(ee) {
try {
return (0, H.K)(ee);
} catch {
return ee;
}
}
function d(ee) {
return ee.replace(/[\u007F-\uFFFF]/g, function(ae) {
return "\\u" + ("0000" + ae.charCodeAt(0).toString(16)).slice(-4);
});
}
function h(ee) {
(z !== void 0 ? z : JSON).parse(ee);
}
function l(ee, ae) {
for (var he in ae)
$e(ae, he) && (ee[he] = ae[he]);
return ee;
}
function n(ee) {
for (var ae in ee)
$e(ee, ae) && delete ee[ae];
return ee;
}
function o(ee) {
return ee === null ? "null" : ee === void 0 ? "undefined" : ee instanceof Number || typeof ee == "number" ? "number" : ee instanceof String || typeof ee == "string" ? "string" : ee instanceof Boolean || typeof ee == "boolean" ? "boolean" : ee instanceof RegExp ? "regexp" : r(ee) ? "array" : "object";
}
var i = /^https?:\/\/\S+$/;
function a(ee) {
return (typeof ee == "string" || ee instanceof String) && i.test(ee);
}
function r(ee) {
return Object.prototype.toString.call(ee) === "[object Array]";
}
function e2(ee) {
return ee.ownerDocument.defaultView;
}
function t(ee) {
return ee.getBoundingClientRect().left + window.pageXOffset || document.scrollLeft || 0;
}
function s(ee) {
return ee.getBoundingClientRect().top + window.pageYOffset || document.scrollTop || 0;
}
function c(ee, ae) {
var he = ee.className.split(" ");
he.indexOf(ae) === -1 && (he.push(ae), ee.className = he.join(" "));
}
function p(ee) {
ee.className = "";
}
function g(ee, Ce) {
var he = ee.className.split(" "), Ce = he.indexOf(Ce);
Ce !== -1 && (he.splice(Ce, 1), ee.className = he.join(" "));
}
function b(ee) {
for (var ae = ee.childNodes, he = 0, Ce = ae.length; he < Ce; he++) {
var Te = ae[he], ke = (Te.style && Te.removeAttribute("style"), Te.attributes);
if (ke)
for (var Ne = ke.length - 1; 0 <= Ne; Ne--) {
var Fe = ke[Ne];
Fe.specified === true && Te.removeAttribute(Fe.name);
}
b(Te);
}
}
function w(ee) {
var ae;
document.createRange && ((ae = document.createRange()).selectNodeContents(ee), ae.collapse(false), (ee = window.getSelection()).removeAllRanges(), ee.addRange(ae));
}
function E(ee) {
var ae;
ee && ee.nodeName === "DIV" && window.getSelection && document.createRange && ((ae = document.createRange()).selectNodeContents(ee), (ee = window.getSelection()).removeAllRanges(), ee.addRange(ae));
}
function M() {
if (window.getSelection) {
var ee = window.getSelection();
if (ee.getRangeAt && ee.rangeCount)
return ee.getRangeAt(0);
}
return null;
}
function B2(ee) {
var ae;
ee && window.getSelection && ((ae = window.getSelection()).removeAllRanges(), ae.addRange(ee));
}
function Z() {
var ee = M();
return ee && "startOffset" in ee && "endOffset" in ee && ee.startContainer && ee.startContainer === ee.endContainer ? { startOffset: ee.startOffset, endOffset: ee.endOffset, container: ee.startContainer.parentNode } : null;
}
function k(ee) {
var ae;
document.createRange && window.getSelection && window.getSelection() && (ae = document.createRange(), ee.container.firstChild || ee.container.appendChild(document.createTextNode("")), ae.setStart(ee.container.firstChild, ee.startOffset), ae.setEnd(ee.container.firstChild, ee.endOffset), B2(ae));
}
function u(ee, ae) {
var he;
if (ae === void 0 && (ae = { _text: "", flush: function() {
var Ue = this._text;
return this._text = "", Ue;
}, set: function(Ue) {
this._text = Ue;
} }), ee.nodeValue)
return (he = _(ee.nodeValue)) !== "" ? ae.flush() + he : "";
if (ee.hasChildNodes()) {
for (var Ce = ee.childNodes, Te = "", ke = 0, Ne = Ce.length; ke < Ne; ke++) {
var Fe, Xe = Ce[ke];
Xe.nodeName === "DIV" || Xe.nodeName === "P" ? ((Fe = (Fe = Ce[ke - 1]) ? Fe.nodeName : void 0) && Fe !== "DIV" && Fe !== "P" && Fe !== "BR" && (Te !== "" && (Te += `
`), ae.flush()), Te += u(Xe, ae), ae.set(`
`)) : Xe.nodeName === "BR" ? (Te += ae.flush(), ae.set(`
`)) : Te += u(Xe, ae);
}
return Te;
}
return "";
}
function _(ee) {
return ee.replace(/(\b|^)\s*(\b|$)/g, function(ae) {
return /\n/.exec(ae) ? "" : ae;
});
}
function v(ee, ae) {
for (var he = ee ? ee.parentNode : void 0; he; ) {
if (he === ae)
return true;
he = he.parentNode;
}
return false;
}
function $() {
var ee;
return G === -1 && (ee = -1, typeof navigator < "u" && navigator.appName === "Microsoft Internet Explorer" && /MSIE ([0-9]+[.0-9]+)/.exec(navigator.userAgent) != null && (ee = parseFloat(RegExp.$1)), G = ee), G;
}
var G = -1;
function W() {
return typeof navigator < "u" && navigator.userAgent.indexOf("Firefox") !== -1;
}
function X(ee, ae, he, Ce) {
return ee.addEventListener ? (Ce === void 0 && (Ce = false), ae === "mousewheel" && W() && (ae = "DOMMouseScroll"), ee.addEventListener(ae, he, Ce), he) : ee.attachEvent ? (ee.attachEvent("on" + ae, Ce = function() {
return he.call(ee, window.event);
}), Ce) : void 0;
}
function Q(ee, ae, he, Ce) {
ee.removeEventListener ? (Ce === void 0 && (Ce = false), ae === "mousewheel" && W() && (ae = "DOMMouseScroll"), ee.removeEventListener(ae, he, Ce)) : ee.detachEvent && ee.detachEvent("on" + ae, he);
}
function K(ee, ae) {
for (var he = ee.parentNode; he; ) {
if (he === ae)
return true;
he = he.parentNode;
}
return false;
}
function ne(ee) {
var ae = [], he = 0;
function Ce(ke) {
for (var Ne = ""; ee[he] !== void 0 && ee[he] !== ke; )
Ne += ee[he], he++;
if (ee[he] !== ke)
throw new Error("Invalid JSON path: unexpected end, character " + ke + " expected");
return Ne;
}
for (; ee[he] !== void 0; )
if (ee[he] === ".")
he++, ae.push(function() {
for (var ke = ""; ee[he] !== void 0 && /[\w$]/.test(ee[he]); )
ke += ee[he], he++;
if (ke === "")
throw new Error("Invalid JSON path: property name expected at index " + he);
return ke;
}());
else {
if (ee[he] !== "[")
throw new Error('Invalid JSON path: unexpected character "' + ee[he] + '" at index ' + he);
if (ee[++he] === "'" || ee[he] === '"') {
var Te = ee[he];
if (he++, ae.push(Ce(Te)), ee[he] !== Te)
throw new Error("Invalid JSON path: closing quote ' expected at index " + he);
he++;
} else {
if (Te = Ce("]").trim(), Te.length === 0)
throw new Error("Invalid JSON path: array value expected at index " + he);
Te = Te === "*" ? Te : JSON.parse(Te), ae.push(Te);
}
if (ee[he] !== "]")
throw new Error("Invalid JSON path: closing bracket ] expected at index " + he);
he++;
}
return ae;
}
function T(ee) {
return ee.map(function(ae) {
return typeof ae == "number" ? "[" + ae + "]" : typeof ae == "string" && ae.match(/^[A-Za-z0-9_$]+$/) ? "." + ae : '["' + ae + '"]';
}).join("");
}
function V(ee) {
var ae, he;
return ee.keyword === "enum" && Array.isArray(ee.schema) && (he = ee.schema) && (5 < (he = he.map(function(Ce) {
return JSON.stringify(Ce);
})).length && (ae = ["(" + (he.length - 5) + " more...)"], (he = he.slice(0, 5)).push(ae)), ee.message = "should be equal to one of: " + he.join(", ")), ee.keyword === "additionalProperties" && (ee.message = "should NOT have additional property: " + ee.params.additionalProperty), ee;
}
function F(ee) {
return ee && typeof ee.then == "function" && typeof ee.catch == "function";
}
function I(ee) {
return A(ee) === "object" && Array.isArray(ee.path) && typeof ee.message == "string";
}
function S(ee, ae, he) {
return he = he !== void 0 ? he : 0, ae.left - he >= ee.left && ae.right + he <= ee.right && ae.top - he >= ee.top && ae.bottom + he <= ee.bottom;
}
function L(ee, ae, he) {
var Ce;
return function() {
var Te = this, ke = arguments, Ne = he && !Ce;
clearTimeout(Ce), Ce = setTimeout(function() {
Ce = null, he || ee.apply(Te, ke);
}, ae), Ne && ee.apply(Te, ke);
};
}
function O(ee, ae) {
for (var he = ae.length, Ce = 0, Te = ee.length, ke = ae.length; ae.charAt(Ce) === ee.charAt(Ce) && Ce < he; )
Ce++;
for (; ae.charAt(ke - 1) === ee.charAt(Te - 1) && Ce < ke && 0 < Te; )
ke--, Te--;
return { start: Ce, end: ke };
}
function J(ee) {
var ae, he, Ce, Te, ke = 0, Ne = 0;
return typeof ee.selectionStart == "number" && typeof ee.selectionEnd == "number" ? (ke = ee.selectionStart, Ne = ee.selectionEnd) : (Te = document.selection.createRange()) && Te.parentElement() === ee && (Ce = ee.value.length, ae = ee.value.replace(/\r\n/g, `
`), (he = ee.createTextRange()).moveToBookmark(Te.getBookmark()), (Te = ee.createTextRange()).collapse(false), -1 < he.compareEndPoints("StartToEnd", Te) ? ke = Ne = Ce : (ke = -he.moveStart("character", -Ce), ke += ae.slice(0, ke).split(`
`).length - 1, -1 < he.compareEndPoints("EndToEnd", Te) ? Ne = Ce : (Ne = -he.moveEnd("character", -Ce), Ne += ae.slice(0, Ne).split(`
`).length - 1))), { startIndex: ke, endIndex: Ne, start: Fe(ke), end: Fe(Ne) };
function Fe(Xe) {
return Xe = ee.value.substring(0, Xe), { row: (Xe.match(/\n/g) || []).length + 1, column: Xe.length - Xe.lastIndexOf(`
`) };
}
}
function re(Ce, ae, he) {
var Ce = Ce.value || "";
return 0 < ae && 0 < he ? (Ce = Ce.split(`
`, ae), ae = Math.min(Ce.length, ae), he = Math.min(Ce[ae - 1].length, he - 1), he = ae === 1 ? he : he + 1, Ce.slice(0, ae - 1).join(`
`).length + he) : -1;
}
function pe(ee, ae) {
var he, Ce = [];
if (ae && ae.length) {
try {
he = j.parse(ee);
} catch {
return Ce;
}
ae.forEach(function(Te) {
var ke = me(ne(Te)), ke = he.pointers[ke];
ke && Ce.push({ path: Te, line: ke.key ? ke.key.line : ke.value ? ke.value.line : 0, column: ke.key ? ke.key.column : ke.value ? ke.value.column : 0 });
});
}
return Ce;
}
function me(ee) {
return ee.map(function(ae) {
return "/" + String(ae).replace(/~/g, "~0").replace(/\//g, "~1");
}).join("");
}
function ye(ee) {
var ae = document.createElement("div");
return ae.style.color = ee, ae.style.color.split(/\s+/).join("").toLowerCase() || null;
}
function xe(ee) {
return !!ye(ee);
}
function be(ee, ae) {
var he;
return ee ? (he = "", ee.title && (he += ee.title), ee.description && (0 < he.length && (he += `
`), he += ee.description), ee.default && (0 < he.length && (he += `
`), he = (he += (0, Y.Iu)("default", void 0, ae) + `
`) + JSON.stringify(ee.default, null, 2)), Array.isArray(ee.examples) && 0 < ee.examples.length && (0 < he.length && (he += `
`), he += (0, Y.Iu)("examples", void 0, ae) + `
`, ee.examples.forEach(function(Ce, Te) {
he += JSON.stringify(Ce, null, 2), Te !== ee.examples.length - 1 && (he += `
`);
})), he) : "";
}
function Ae(ee, ae) {
for (var he = ee, Ce = 0; Ce < ae.length && he != null; Ce++)
he = he[ae[Ce]];
return he;
}
function we(ee, ae) {
for (var he = ee.replace(/ \(copy( \d+)?\)$/, ""), Ce = he, Te = 1; ae.indexOf(Ce) !== -1; )
Ce = he + " (" + ("copy" + (1 < Te ? " " + Te : "")) + ")", Te++;
return Ce;
}
function Re(ee, ae) {
var he = {};
if (Array.isArray(ee))
for (var Ce = Math.min(ee.length, f), Te = 0; Te < Ce; Te++)
(function ke(Ne, Fe, Xe, Ue) {
(Array.isArray(Ne) || te(Ne)) && !Ue || (Fe[Xe || ""] = true), te(Ne) && Object.keys(Ne).forEach(function(se) {
ke(Ne[se], Fe, Xe + "." + se, Ue);
});
})(ee[Te], he, "", ae);
else
he[""] = true;
return Object.keys(he).sort();
}
function Me(ee, ke, he) {
var Ce = ke && ke !== "." ? ne(ke) : [], Te = he === "desc" ? -1 : 1, ke = ee.slice();
return ke.sort(function(Ne, Fe) {
return Ne = Ae(Ne, Ce), Fe = Ae(Fe, Ce), Te * (Fe < Ne ? 1 : Ne < Fe ? -1 : 0);
}), ke;
}
function Se(ee, Ce) {
var he = Ce === "desc" ? -1 : 1, Ce = Object.keys(ee).sort(function(ke, Ne) {
return he * x()(ke, Ne);
}), Te = {};
return Ce.forEach(function(ke) {
Te[ke] = ee[ke];
}), Te;
}
function ve(ee) {
var ae, he;
return ee === "" ? "" : (ae = ee.toLowerCase()) === "null" ? null : ae === "true" || ae !== "false" && (/^0\d+$/.test(ee) || (ae = Number(ee), he = parseFloat(ee), isNaN(ae)) || isNaN(he) ? ee : ae);
}
function Le(ee, ae) {
return typeof ae == "number" && R < ae && isFinite(ae) && Math.floor(ae) === ae && !isNaN(new Date(ae).valueOf());
}
function Ge(ee) {
return ee < 900 ? ee.toFixed() + " B" : (ee = ee / 1e3) < 900 ? ee.toFixed(1) + " KB" : (ee = ee / 1e3) < 900 ? ee.toFixed(1) + " MB" : (ee = ee / 1e3) < 900 ? ee.toFixed(1) + " GB" : (ee / 1e3).toFixed(1) + " TB";
}
function ge2(ee, ae) {
return ee.length <= ae ? ee : ee.slice(0, ae) + "...";
}
function te(ee) {
return A(ee) === "object" && ee !== null && !Array.isArray(ee);
}
function ie(ee, ae) {
return ee.indexOf(ae) !== -1;
}
function ce(ee, ae) {
if (ae || ee) {
if (ae && !ee || !ae && ee || ae.length !== ee.length)
return true;
for (var he, Ce = 0; Ce < ee.length; ++Ce)
if (he = function(Te) {
var ke = ee[Te].type === "error" ? ae.find(function(Ne) {
return Ne.line === ee[Te].line;
}) : ae.find(function(Ne) {
return Ne.dataPath === ee[Te].dataPath && Ne.schemaPath === ee[Te].schemaPath;
});
if (!ke)
return { v: true };
}(Ce))
return he.v;
}
return false;
}
function fe(ee, ae) {
return ee = ee != null && ee.length ? ee : [], ae = ae != null && ae.length ? ae : [], P(new Set(ee.concat(ae)));
}
function Ie(ee) {
setTimeout(ee);
}
function $e(ee, ae) {
return Object.prototype.hasOwnProperty.call(ee, ae);
}
}, 8037: function(le, m, D) {
var U;
if (window.Picker)
U = window.Picker;
else
try {
U = D(4049);
} catch {
}
le.exports = U;
}, 6225: function(le, m, D) {
function U(A, f) {
var R, y;
return f = N(A, f), (A = j.modules[f]) || (typeof (A = j.payloads[f]) == "function" && (R = { id: f, uri: "", exports: y = {}, packaged: true }, y = A(function(C, d) {
return Y(f, C, d);
}, y, R) || R.exports, j.modules[f] = y, delete j.payloads[f]), A = j.modules[f] = y || A), A;
}
var x, H, z, j, Y, P, N;
le = D.nmd(le), (z = /* @__PURE__ */ function() {
return this;
}()) || typeof window > "u" || (z = window), (j = function(A, f, R) {
typeof A != "string" ? j.original && j.original.apply(this, arguments) : (arguments.length == 2 && (R = f), j.modules[A] || (j.payloads[A] = R, j.modules[A] = null));
}).modules = {}, j.payloads = {}, Y = function(A, f, R) {
if (typeof f == "string") {
var y = U(A, f);
if (y != null)
return R && R(), y;
} else if (Object.prototype.toString.call(f) === "[object Array]") {
for (var C = [], d = 0, h = f.length; d < h; ++d) {
var l = U(A, f[d]);
if (l == null && P.original)
return;
C.push(l);
}
return R && R.apply(null, C) || true;
}
}, P = function(A, f) {
var R = Y("", A, f);
return R == null && P.original ? P.original.apply(this, arguments) : R;
}, N = function(A, f) {
var R;
if (f.indexOf("!") !== -1)
return R = f.split("!"), N(A, R[0]) + "!" + N(A, R[1]);
if (f.charAt(0) == ".")
for (f = A.split("/").slice(0, -1).join("/") + "/" + f; f.indexOf(".") !== -1 && y != f; ) {
var y = f;
f = f.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
}
return f;
}, H = z, (x = "ace") && (z[x] || (z[x] = {}), H = z[x]), H.define && H.define.packaged || (j.original = H.define, H.define = j, H.define.packaged = true), H.require && H.require.packaged || (P.original = H.require, H.require = P, H.require.packaged = true), ace.define("ace/lib/es6-shim", ["require", "exports", "module"], function(A, f, R) {
function y(C, d, h) {
Object.defineProperty(C, d, { value: h, enumerable: false, writable: true, configurable: true });
}
String.prototype.startsWith || y(String.prototype, "startsWith", function(C, d) {
return this.lastIndexOf(C, d = d || 0) === d;
}), String.prototype.endsWith || y(String.prototype, "endsWith", function(C, d) {
return (d === void 0 || d > this.length) && (d = this.length), d -= C.length, C = this.indexOf(C, d), C !== -1 && C === d;
}), String.prototype.repeat || y(String.prototype, "repeat", function(C) {
for (var d = "", h = this; 0 < C; )
1 & C && (d += h), (C >>= 1) && (h += h);
return d;
}), String.prototype.includes || y(String.prototype, "includes", function(C, d) {
return this.indexOf(C, d) != -1;
}), Object.assign || (Object.assign = function(C) {
if (C == null)
throw new TypeError("Cannot convert undefined or null to object");
for (var d = Object(C), h = 1; h < arguments.length; h++) {
var l = arguments[h];
l != null && Object.keys(l).forEach(function(n) {
d[n] = l[n];
});
}
return d;
}), Object.values || (Object.values = function(C) {
return Object.keys(C).map(function(d) {
return C[d];
});
}), Array.prototype.find || y(Array.prototype, "find", function(C) {
for (var d = this.length, h = arguments[1], l = 0; l < d; l++) {
var n = this[l];
if (C.call(h, n, l, this))
return n;
}
}), Array.prototype.findIndex || y(Array.prototype, "findIndex", function(C) {
for (var d = this.length, h = arguments[1], l = 0; l < d; l++) {
var n = this[l];
if (C.call(h, n, l, this))
return l;
}
}), Array.prototype.includes || y(Array.prototype, "includes", function(C, d) {
return this.indexOf(C, d) != -1;
}), Array.prototype.fill || y(Array.prototype, "fill", function(C) {
for (var d = this.length >>> 0, l = arguments[1] >> 0, h = l < 0 ? Math.max(d + l, 0) : Math.min(l, d), l = arguments[2], l = l === void 0 ? d : l >> 0, n = l < 0 ? Math.max(d + l, 0) : Math.min(l, d); h < n; )
this[h] = C, h++;
return this;
}), Array.of || y(Array, "of", function() {
return Array.prototype.slice.call(arguments);
});
}), ace.define("ace/lib/fixoldbrowsers", ["require", "exports", "module", "ace/lib/es6-shim"], function(A, f, R) {
A("./es6-shim");
}), ace.define("ace/lib/deep_copy", ["require", "exports", "module"], function(A, f, R) {
f.deepCopy = function y(C) {
if (typeof C != "object" || !C)
return C;
if (Array.isArray(C))
for (var d = [], h = 0; h < C.length; h++)
d[h] = y(C[h]);
else {
if (Object.prototype.toString.call(C) !== "[object Object]")
return C;
for (var h in d = {}, C)
d[h] = y(C[h]);
}
return d;
};
}), ace.define("ace/lib/lang", ["require", "exports", "module", "ace/lib/deep_copy"], function(A, f, R) {
f.last = function(d) {
return d[d.length - 1];
}, f.stringReverse = function(d) {
return d.split("").reverse().join("");
}, f.stringRepeat = function(d, h) {
for (var l = ""; 0 < h; )
1 & h && (l += d), (h >>= 1) && (d += d);
return l;
};
var y = /^\s\s*/, C = /\s\s*$/;
f.stringTrimLeft = function(d) {
return d.replace(y, "");
}, f.stringTrimRight = function(d) {
return d.replace(C, "");
}, f.copyObject = function(d) {
var h, l = {};
for (h in d)
l[h] = d[h];
return l;
}, f.copyArray = function(d) {
for (var h = [], l = 0, n = d.length; l < n; l++)
d[l] && typeof d[l] == "object" ? h[l] = this.copyObject(d[l]) : h[l] = d[l];
return h;
}, f.deepCopy = A("./deep_copy").deepCopy, f.arrayToMap = function(d) {
for (var h = {}, l = 0; l < d.length; l++)
h[d[l]] = 1;
return h;
}, f.createMap = function(d) {
var h, l = /* @__PURE__ */ Object.create(null);
for (h in d)
l[h] = d[h];
return l;
}, f.arrayRemove = function(d, h) {
for (var l = 0; l <= d.length; l++)
h === d[l] && d.splice(l, 1);
}, f.escapeRegExp = function(d) {
return d.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1");
}, f.escapeHTML = function(d) {
return ("" + d).replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/ [" + this.end.row + "/" + this.end.column + "]";
}, C.prototype.contains = function(d, h) {
return this.compare(d, h) == 0;
}, C.prototype.compareRange = function(h) {
var l = h.end, h = h.start, l = this.compare(l.row, l.column);
return l == 1 ? (l = this.compare(h.row, h.column)) == 1 ? 2 : l == 0 ? 1 : 0 : l == -1 ? -2 : (l = this.compare(h.row, h.column)) == -1 ? -1 : l == 1 ? 42 : 0;
}, C.prototype.comparePoint = function(d) {
return this.compare(d.row, d.column);
}, C.prototype.containsRange = function(d) {
return this.comparePoint(d.start) == 0 && this.comparePoint(d.end) == 0;
}, C.prototype.intersects = function(d) {
return d = this.compareRange(d), d == -1 || d == 0 || d == 1;
}, C.prototype.isEnd = function(d, h) {
return this.end.row == d && this.end.column == h;
}, C.prototype.isStart = function(d, h) {
return this.start.row == d && this.start.column == h;
}, C.prototype.setStart = function(d, h) {
typeof d == "object" ? (this.start.column = d.column, this.start.row = d.row) : (this.start.row = d, this.start.column = h);
}, C.prototype.setEnd = function(d, h) {
typeof d == "object" ? (this.end.column = d.column, this.end.row = d.row) : (this.end.row = d, this.end.column = h);
}, C.prototype.inside = function(d, h) {
return this.compare(d, h) == 0 && !this.isEnd(d, h) && !this.isStart(d, h);
}, C.prototype.insideStart = function(d, h) {
return this.compare(d, h) == 0 && !this.isEnd(d, h);
}, C.prototype.insideEnd = function(d, h) {
return this.compare(d, h) == 0 && !this.isStart(d, h);
}, C.prototype.compare = function(d, h) {
return this.isMultiLine() || d !== this.start.row ? d < this.start.row ? -1 : d > this.end.row ? 1 : this.start.row === d ? h >= this.start.column ? 0 : -1 : this.end.row !== d || h <= this.end.column ? 0 : 1 : h < this.start.column ? -1 : h > this.end.column ? 1 : 0;
}, C.prototype.compareStart = function(d, h) {
return this.start.row == d && this.start.column == h ? -1 : this.compare(d, h);
}, C.prototype.compareEnd = function(d, h) {
return this.end.row == d && this.end.column == h ? 1 : this.compare(d, h);
}, C.prototype.compareInside = function(d, h) {
return this.end.row == d && this.end.column == h ? 1 : this.start.row == d && this.start.column == h ? -1 : this.compare(d, h);
}, C.prototype.clipRows = function(d, h) {
var l, n;
return this.end.row > h ? l = { row: h + 1, column: 0 } : this.end.row < d && (l = { row: d, column: 0 }), this.start.row > h ? n = { row: h + 1, column: 0 } : this.start.row < d && (n = { row: d, column: 0 }), C.fromPoints(n || this.start, l || this.end);
}, C.prototype.extend = function(d, h) {
var l, n, o = this.compare(d, h);
return o == 0 ? this : (o == -1 ? l = { row: d, column: h } : n = { row: d, column: h }, C.fromPoints(l || this.start, n || this.end));
}, C.prototype.isEmpty = function() {
return this.start.row === this.end.row && this.start.column === this.end.column;
}, C.prototype.isMultiLine = function() {
return this.start.row !== this.end.row;
}, C.prototype.clone = function() {
return C.fromPoints(this.start, this.end);
}, C.prototype.collapseRows = function() {
return this.end.column == 0 ? new C(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0) : new C(this.start.row, 0, this.end.row, 0);
}, C.prototype.toScreenRange = function(l) {
var h = l.documentToScreenPosition(this.start), l = l.documentToScreenPosition(this.end);
return new C(h.row, h.column, l.row, l.column);
}, C.prototype.moveBy = function(d, h) {
this.start.row += d, this.start.column += h, this.end.row += d, this.end.column += h;
};
var y = C;
function C(d, h, l, n) {
this.start = { row: d, column: h }, this.end = { row: l, column: n };
}
y.fromPoints = function(d, h) {
return new y(d.row, d.column, h.row, h.column);
}, y.comparePoints = function(d, h) {
return d.row - h.row || d.column - h.column;
}, y.comparePoints = function(d, h) {
return d.row - h.row || d.column - h.column;
}, f.Range = y;
}), ace.define("ace/lib/keys", ["require", "exports", "module", "ace/lib/oop"], function(A, f, R) {
var y = A("./oop"), C = function() {
var d, h, l = { MODIFIER_KEYS: { 16: "Shift", 17: "Ctrl", 18: "Alt", 224: "Meta", 91: "MetaLeft", 92: "MetaRight", 93: "ContextMenu" }, KEY_MODS: { ctrl: 1, alt: 2, option: 2, shift: 4, super: 8, meta: 8, command: 8, cmd: 8, control: 1 }, FUNCTION_KEYS: { 8: "Backspace", 9: "Tab", 13: "Return", 19: "Pause", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "Print", 45: "Insert", 46: "Delete", 96: "Numpad0", 97: "Numpad1", 98: "Numpad2", 99: "Numpad3", 100: "Numpad4", 101: "Numpad5", 102: "Numpad6", 103: "Numpad7", 104: "Numpad8", 105: "Numpad9", "-13": "NumpadEnter", 112: "F1", 113: "F2", 114: "F3", 115: "F4", 116: "F5", 117: "F6", 118: "F7", 119: "F8", 120: "F9", 121: "F10", 122: "F11", 123: "F12", 144: "Numlock", 145: "Scrolllock" }, PRINTABLE_KEYS: { 32: " ", 48: "0", 49: "1", 50: "2", 51: "3", 52: "4", 53: "5", 54: "6", 55: "7", 56: "8", 57: "9", 59: ";", 61: "=", 65: "a", 66: "b", 67: "c", 68: "d", 69: "e", 70: "f", 71: "g", 72: "h", 73: "i", 74: "j", 75: "k", 76: "l", 77: "m", 78: "n", 79: "o", 80: "p", 81: "q", 82: "r", 83: "s", 84: "t", 85: "u", 86: "v", 87: "w", 88: "x", 89: "y", 90: "z", 107: "+", 109: "-", 110: ".", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", 221: "]", 222: "'", 111: "/", 106: "*" } };
for (h in l.PRINTABLE_KEYS[173] = "-", l.FUNCTION_KEYS)
d = l.FUNCTION_KEYS[h].toLowerCase(), l[d] = parseInt(h, 10);
for (h in l.PRINTABLE_KEYS)
d = l.PRINTABLE_KEYS[h].toLowerCase(), l[d] = parseInt(h, 10);
y.mixin(l, l.MODIFIER_KEYS), y.mixin(l, l.PRINTABLE_KEYS), y.mixin(l, l.FUNCTION_KEYS), l.enter = l.return, l.escape = l.esc, l.del = l.delete;
for (var n = ["cmd", "ctrl", "alt", "shift"], o = Math.pow(2, n.length); o--; )
l.KEY_MODS[o] = n.filter(function(i) {
return o & l.KEY_MODS[i];
}).join("-") + "-";
return l.KEY_MODS[0] = "", l.KEY_MODS[-1] = "input-", l;
}();
y.mixin(f, C), (f.default = f).keyCodeToString = function(d) {
var h = C[d];
return (h = typeof h != "string" ? String.fromCharCode(d) : h).toLowerCase();
};
}), ace.define("ace/lib/event", ["require", "exports", "module", "ace/lib/keys", "ace/lib/useragent"], function(A, f, R) {
var y, C = A("./keys"), d = A("./useragent"), h = null, l = 0;
function n() {
if (y == null) {
y = false;
try {
document.createComment("").addEventListener("test", function() {
}, { get passive() {
y = { passive: false };
} });
} catch {
}
}
return y;
}
function o(c, p, g) {
this.elem = c, this.type = p, this.callback = g;
}
o.prototype.destroy = function() {
e2(this.elem, this.type, this.callback), this.elem = this.type = this.callback = void 0;
};
function i(c) {
return 0 | (c.ctrlKey ? 1 : 0) | (c.altKey ? 2 : 0) | (c.shiftKey ? 4 : 0) | (c.metaKey ? 8 : 0);
}
var a, r = f.addListener = function(c, p, g, b) {
c.addEventListener(p, g, n()), b && b.$toDestroy.push(new o(c, p, g));
}, e2 = f.removeListener = function(c, p, g) {
c.removeEventListener(p, g, n());
};
f.stopEvent = function(c) {
return f.stopPropagation(c), f.preventDefault(c), false;
}, f.stopPropagation = function(c) {
c.stopPropagation && c.stopPropagation();
}, f.preventDefault = function(c) {
c.preventDefault && c.preventDefault();
}, f.getButton = function(c) {
return c.type == "dblclick" ? 0 : c.type == "contextmenu" || d.isMac && c.ctrlKey && !c.altKey && !c.shiftKey ? 2 : c.button;
}, f.capture = function(c, p, g) {
var b = c && c.ownerDocument || document;
function w(E) {
p && p(E), g && g(E), e2(b, "mousemove", p), e2(b, "mouseup", w), e2(b, "dragstart", w);
}
return r(b, "mousemove", p), r(b, "mouseup", w), r(b, "dragstart", w), w;
}, f.addMouseWheelListener = function(c, p, g) {
r(c, "wheel", function(b) {
var w = b.deltaX || 0, E = b.deltaY || 0;
switch (b.deltaMode) {
case b.DOM_DELTA_PIXEL:
b.wheelX = 0.15 * w, b.wheelY = 0.15 * E;
break;
case b.DOM_DELTA_LINE:
b.wheelX = 15 * w, b.wheelY = 15 * E;
break;
case b.DOM_DELTA_PAGE:
b.wheelX = 150 * w, b.wheelY = 150 * E;
}
p(b);
}, g);
}, f.addMultiMouseDownListener = function(c, p, g, b, w) {
var E, M, B2, Z = 0, k = { 2: "dblclick", 3: "tripleclick", 4: "quadclick" };
function u(_) {
var v;
if (f.getButton(_) !== 0 ? Z = 0 : 1 < _.detail && !(4 < ++Z) || (Z = 1), d.isIE && (v = 5 < Math.abs(_.clientX - E) || 5 < Math.abs(_.clientY - M), B2 && !v || (Z = 1), B2 && clearTimeout(B2), B2 = setTimeout(function() {
B2 = null;
}, p[Z - 1] || 600), Z == 1) && (E = _.clientX, M = _.clientY), _._clicks = Z, g[b]("mousedown", _), 4 < Z)
Z = 0;
else if (1 < Z)
return g[b](k[Z], _);
}
(c = Array.isArray(c) ? c : [c]).forEach(function(_) {
r(_, "mousedown", u, w);
});
};
function t(c, p, g) {
var b = i(p);
if (!d.isMac && h) {
if (p.getModifierState && (p.getModifierState("OS") || p.getModifierState("Win")) && (b |= 8), h.altGr) {
if ((3 & b) == 3)
return;
h.altGr = 0;
}
g !== 18 && g !== 17 || (w = "location" in p ? p.location : p.keyLocation, g === 17 && w === 1 ? h[g] == 1 && (l = p.timeStamp) : g === 18 && b === 3 && w === 2 && p.timeStamp - l < 50 && (h.altGr = true));
}
if (g in C.MODIFIER_KEYS && (g = -1), !b && g === 13) {
var w = "location" in p ? p.location : p.keyLocation;
if (w === 3 && (c(p, b, -g), p.defaultPrevented))
return;
}
if (d.isChromeOS && 8 & b) {
if (c(p, b, g), p.defaultPrevented)
return;
b &= -9;
}
return !!(b || g in C.FUNCTION_KEYS || g in C.PRINTABLE_KEYS) && c(p, b, g);
}
function s() {
h = /* @__PURE__ */ Object.create(null);
}
f.getModifierString = function(c) {
return C.KEY_MODS[i(c)];
}, f.addCommandKeyListener = function(c, p, g) {
var b, w;
d.isOldGecko || d.isOpera && !("KeyboardEvent" in window) ? (b = null, r(c, "keydown", function(E) {
b = E.keyCode;
}, g), r(c, "keypress", function(E) {
return t(p, E, b);
}, g)) : (w = null, r(c, "keydown", function(E) {
h[E.keyCode] = (h[E.keyCode] || 0) + 1;
var M = t(p, E, E.keyCode);
return w = E.defaultPrevented, M;
}, g), r(c, "keypress", function(E) {
w && (E.ctrlKey || E.altKey || E.shiftKey || E.metaKey) && (f.stopEvent(E), w = null);
}, g), r(c, "keyup", function(E) {
h[E.keyCode] = null;
}, g), h || (s(), r(window, "focus", s)));
}, typeof window == "object" && window.postMessage && !d.isOldIE && (a = 1, f.nextTick = function(c, p) {
p = p || window;
function g(w) {
w.data == b && (f.stopPropagation(w), e2(p, "message", g), c());
}
var b = "zero-timeout-message-" + a++;
r(p, "message", g), p.postMessage(b, "*");
}), f.$idleBlocked = false, f.onIdle = function(c, p) {
return setTimeout(function g() {
f.$idleBlocked ? setTimeout(g, 100) : c();
}, p);
}, f.$idleBlockId = null, f.blockIdle = function(c) {
f.$idleBlockId && clearTimeout(f.$idleBlockId), f.$idleBlocked = true, f.$idleBlockId = setTimeout(function() {
f.$idleBlocked = false;
}, c || 100);
}, f.nextFrame = typeof window == "object" && (window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame), f.nextFrame ? f.nextFrame = f.nextFrame.bind(window) : f.nextFrame = function(c) {
setTimeout(c, 17);
};
}), ace.define("ace/clipboard", ["require", "exports", "module"], function(A, f, R) {
var y;
R.exports = { lineMode: false, pasteCancelled: function() {
return !!(y && y > Date.now() - 50) || (y = false);
}, cancel: function() {
y = Date.now();
} };
}), ace.define("ace/keyboard/textinput", ["require", "exports", "module", "ace/lib/event", "ace/config", "ace/lib/useragent", "ace/lib/dom", "ace/lib/lang", "ace/clipboard", "ace/lib/keys"], function(A, f, R) {
var y = A("../lib/event"), C = A("../config").nls, d = A("../lib/useragent"), h = A("../lib/dom"), l = A("../lib/lang"), n = A("../clipboard"), o = d.isChrome < 18, i = d.isIE, a = 63 < d.isChrome, r = A("../lib/keys"), e2 = r.KEY_MODS, t = d.isIOS, s = t ? /\s/ : /\n/, c = d.isMobile;
f.TextInput = function(p, g) {
var b = h.createElement("textarea"), w = (b.className = "ace_text-input", b.setAttribute("wrap", "off"), b.setAttribute("autocorrect", "off"), b.setAttribute("autocapitalize", "off"), b.setAttribute("spellcheck", false), b.style.opacity = "0", p.insertBefore(b, p.firstChild), false), E = false, M = false, B2 = false, Z = "", k = (c || (b.style.fontSize = "1px"), false), u = false, _ = "", v = 0, $ = 0, G = 0, W = Number.MAX_SAFE_INTEGER, X = Number.MIN_SAFE_INTEGER, Q = 0;
try {
var K = document.activeElement === b;
} catch {
}
this.setNumberOfExtraLines = function(ge2) {
W = Number.MAX_SAFE_INTEGER, X = Number.MIN_SAFE_INTEGER, Q = ge2 < 0 ? 0 : ge2;
}, this.setAriaOptions = function(ge2) {
ge2.activeDescendant ? (b.setAttribute("aria-haspopup", "true"), b.setAttribute("aria-autocomplete", ge2.inline ? "both" : "list"), b.setAttribute("aria-activedescendant", ge2.activeDescendant)) : (b.setAttribute("aria-haspopup", "false"), b.setAttribute("aria-autocomplete", "both"), b.removeAttribute("aria-activedescendant")), ge2.role && b.setAttribute("role", ge2.role), ge2.setLabel && (b.setAttribute("aria-roledescription", C("editor")), g.session) && (ge2 = g.session.selection.cursor.row, b.setAttribute("aria-label", C("Cursor at row $0", [ge2 + 1])));
}, this.setAriaOptions({ role: "textbox" }), y.addListener(b, "blur", function(ge2) {
u || (g.onBlur(ge2), K = false);
}, g), y.addListener(b, "focus", function(ge2) {
if (!u) {
if (K = true, d.isEdge)
try {
if (!document.hasFocus())
return;
} catch {
}
g.onFocus(ge2), d.isEdge ? setTimeout(I) : I();
}
}, g), this.$focusScroll = false, this.focus = function() {
if (this.setAriaOptions({ setLabel: g.renderer.enableKeyboardAccessibility }), Z || a || this.$focusScroll == "browser")
return b.focus({ preventScroll: true });
var ge2 = b.style.top;
b.style.position = "fixed", b.style.top = "0px";
try {
var te = b.getBoundingClientRect().top != 0;
} catch {
return;
}
var ie = [];
if (te)
for (var ce = b.parentElement; ce && ce.nodeType == 1; )
ie.push(ce), ce.setAttribute("ace_nocontext", true), ce = !ce.parentElement && ce.getRootNode ? ce.getRootNode().host : ce.parentElement;
b.focus({ preventScroll: true }), te && ie.forEach(function(fe) {
fe.removeAttribute("ace_nocontext");
}), setTimeout(function() {
b.style.position = "", b.style.top == "0px" && (b.style.top = ge2);
}, 0);
}, this.blur = function() {
b.blur();
}, this.isFocused = function() {
return K;
}, g.on("beforeEndOperation", function() {
var ge2 = g.curOp, te = ge2 && ge2.command && ge2.command.name;
te != "insertstring" && (te = te && (ge2.docChanged || ge2.selectionChanged), M && te && (_ = b.value = "", xe()), I());
});
function ne(ge2, te) {
for (var ie = te, ce = 1; ce <= ge2 - W && ce < 2 * Q + 1; ce++)
ie += g.session.getLine(ge2 - ce).length + 1;
return ie;
}
function T(ge2) {
me(ge2, true);
}
function V(ge2) {
me(ge2, false);
}
function F(ge2) {
var te = pe(ge2);
n.pasteCancelled() || (typeof te == "string" ? (te && g.onPaste(te, ge2), d.isIE && setTimeout(I), y.preventDefault(ge2)) : (b.value = "", E = true));
}
var I = t ? function(ge2) {
var te;
!K || w && !ge2 || B2 || ((te = `
ab` + (ge2 = ge2 || "") + `cde fg
`) != b.value && (b.value = _ = te), te = 4 + (ge2.length || (g.selection.isEmpty() ? 0 : 1)), v == 4 && $ == te || b.setSelectionRange(4, te), v = 4, $ = te);
} : function() {
if (!M && !B2 && (K || O)) {
M = true;
var ge2 = 0, te = 0, ie = "";
if (g.session) {
for (var ce, Ie = g.selection, fe = Ie.getRange(), Ie = Ie.cursor.row, $e = (Ie === X + 1 ? X = (W = X + 1) + 2 * Q : Ie === W - 1 ? W = (X = W - 1) - 2 * Q : (Ie < W - 1 || X + 1 < Ie) && (W = Q < Ie ? Ie - Q : 0, X = Q < Ie ? Ie + Q : 2 * Q), []), ee = W; ee <= X; ee++)
$e.push(g.session.getLine(ee));
ie = $e.join(`
`), ge2 = ne(fe.start.row, fe.start.column), te = ne(fe.end.row, fe.end.column), fe.start.row < W ? (ce = g.session.getLine(W - 1), ge2 = fe.start.row < W - 1 ? 0 : ge2, te += ce.length + 1, ie = ce + `
` + ie) : fe.end.row > X ? (ce = g.session.getLine(X + 1), te = fe.end.row > X + 1 ? ce.length : fe.end.column, te += ie.length + 1, ie = ie + `
` + ce) : c && 0 < Ie && (ie = `
` + ie, te += 1, ge2 += 1), 400 < ie.length && (ge2 < 400 && te < 400 ? ie = ie.slice(0, 400) : (ie = `
`, ge2 == te ? ge2 = te = 0 : (ge2 = 0, te = 1))), fe = ie + `
`, fe != _ && (b.value = _ = fe, v = $ = fe.length);
}
if (O && (v = b.selectionStart, $ = b.selectionEnd), $ != te || v != ge2 || b.selectionEnd != $)
try {
b.setSelectionRange(ge2, te), v = ge2, $ = te;
} catch {
}
M = false;
}
}, S = (this.resetSelection = I, K && g.onFocus(), function(ge2) {
return ge2.selectionStart === 0 && ge2.selectionEnd >= _.length && ge2.value === _ && _ && ge2.selectionEnd !== $;
}), L = null, O = (this.setInputHandler = function(ge2) {
L = ge2;
}, !(this.getInputHandler = function() {
return L;
})), J = function(ge2, te) {
if (O = O && false, E)
return I(), ge2 && g.onPaste(ge2), E = false, "";
for (var ie = b.selectionStart, ce = b.selectionEnd, fe = v, Ie = _.length - $, $e = ge2, ee = ge2.length - ie, ae = ge2.length - ce, he = 0; 0 < fe && _[he] == ge2[he]; )
he++, fe--;
for ($e = $e.slice(he), he = 1; 0 < Ie && _.length - he > v - 1 && _[_.length - he] == ge2[ge2.length - he]; )
he++, Ie--;
ee -= he - 1, ae -= he - 1;
var Ce = $e.length - he + 1;
return Ce < 0 && (fe = -Ce, Ce = 0), $e = $e.slice(0, Ce), te || $e || ee || fe || Ie || ae ? (Ce = !(B2 = true), d.isAndroid && $e == ". " && ($e = " ", Ce = true), $e && !fe && !Ie && !ee && !ae || k ? g.onTextInput($e) : g.onTextInput($e, { extendLeft: fe, extendRight: Ie, restoreStart: ee, restoreEnd: ae }), B2 = false, _ = ge2, v = ie, $ = ce, G = ae, Ce ? `
` : $e) : "";
}, re = function(te) {
if (M)
return ye();
if (te && te.inputType) {
if (te.inputType == "historyUndo")
return g.execCommand("undo");
if (te.inputType == "historyRedo")
return g.execCommand("redo");
}
var te = b.value, ie = J(te, true);
(500 < te.length || s.test(ie) || c && v < 1 && v == $) && I();
}, pe = function(ge2, te, ie) {
var ce = ge2.clipboardData || window.clipboardData;
if (ce && !o) {
var fe = i || ie ? "Text" : "text/plain";
try {
return te ? ce.setData(fe, te) !== false : ce.getData(fe);
} catch (Ie) {
if (!ie)
return pe(Ie, te, true);
}
}
}, me = function(ge2, te) {
var ie = g.getCopyText();
if (!ie)
return y.preventDefault(ge2);
pe(ge2, ie) ? (t && (I(ie), w = ie, setTimeout(function() {
w = false;
}, 10)), te ? g.onCut() : g.onCopy(), y.preventDefault(ge2)) : (w = true, b.value = ie, b.select(), setTimeout(function() {
w = false, I(), te ? g.onCut() : g.onCopy();
}));
}, ye = (y.addCommandKeyListener(b, g.onCommandKey.bind(g), g), y.addListener(b, "select", function(ge2) {
M || (w ? w = false : S(b) ? (g.selectAll(), I()) : c && b.selectionStart != v && I());
}, g), y.addListener(b, "input", re, g), y.addListener(b, "cut", T, g), y.addListener(b, "copy", V, g), y.addListener(b, "paste", F, g), "oncut" in b && "oncopy" in b && "onpaste" in b || y.addListener(p, "keydown", function(ge2) {
if ((!d.isMac || ge2.metaKey) && ge2.ctrlKey)
switch (ge2.keyCode) {
case 67:
V(ge2);
break;
case 86:
F(ge2);
break;
case 88:
T(ge2);
}
}, g), function() {
var ge2;
if (M && g.onCompositionUpdate && !g.$readOnly)
return k ? be() : void (M.useTextareaForIME ? g.onCompositionUpdate(b.value) : (ge2 = b.value, J(ge2), M.markerRange && (M.context && (M.markerRange.start.column = M.selectionStart = M.context.compositionStartOffset), M.markerRange.end.column = M.markerRange.start.column + $ - M.selectionStart + G)));
}), xe = function(ge2) {
g.onCompositionEnd && !g.$readOnly && (M = false, g.onCompositionEnd(), g.off("mousedown", be), ge2) && re();
};
function be() {
u = true, b.blur(), b.focus(), u = false;
}
var Ae, we = l.delayedCall(ye, 50).schedule.bind(null, null);
function Re() {
clearTimeout(Ae), Ae = setTimeout(function() {
Z && (b.style.cssText = Z, Z = ""), g.renderer.$isMousePressed = false, g.renderer.$keepTextAreaAtCursor && g.renderer.$moveTextAreaToCursor();
}, 0);
}
y.addListener(b, "compositionstart", function(ge2) {
M || !g.onCompositionStart || g.$readOnly || (M = {}, k) || (ge2.data && (M.useTextareaForIME = false), setTimeout(ye, 0), g._signal("compositionStart"), g.on("mousedown", be), (ge2 = g.getSelectionRange()).end.row = ge2.start.row, ge2.end.column = ge2.start.column, M.markerRange = ge2, M.selectionStart = v, g.onCompositionStart(M), M.useTextareaForIME ? (_ = b.value = "", $ = v = 0) : (b.msGetInputContext && (M.context = b.msGetInputContext()), b.getInputContext && (M.context = b.getInputContext())));
}, g), y.addListener(b, "compositionupdate", ye, g), y.addListener(b, "keyup", function(ge2) {
ge2.keyCode == 27 && b.value.length < b.selectionStart && (M || (_ = b.value), v = $ = -1, I()), we();
}, g), y.addListener(b, "keydown", we, g), y.addListener(b, "compositionend", xe, g), this.getElement = function() {
return b;
}, this.setCommandMode = function(ge2) {
k = ge2, b.readOnly = false;
}, this.setReadOnly = function(ge2) {
k || (b.readOnly = ge2);
}, this.setCopyWithEmptySelection = function(ge2) {
}, this.onContextMenu = function(ge2) {
O = true, I(), g._emit("nativecontextmenu", { target: g, domEvent: ge2 }), this.moveToMouse(ge2, true);
}, this.moveToMouse = function(ge2, ce) {
Z = Z || b.style.cssText, b.style.cssText = (ce ? "z-index:100000;" : "") + (d.isIE ? "opacity:0.1;" : "") + "text-indent: -" + (v + $) * g.renderer.characterWidth * 0.5 + "px;";
function ie(ae) {
h.translate(b, ae.clientX - $e - 2, Math.min(ae.clientY - Ie - 2, ee));
}
var ce = g.container.getBoundingClientRect(), fe = h.computedStyle(g.container), Ie = ce.top + (parseInt(fe.borderTopWidth) || 0), $e = ce.left + (parseInt(ce.borderLeftWidth) || 0), ee = ce.bottom - Ie - b.clientHeight - 2;
ie(ge2), ge2.type == "mousedown" && (g.renderer.$isMousePressed = true, clearTimeout(Ae), d.isWin) && y.capture(g.container, ie, Re);
}, this.onContextMenuClose = Re;
function Me(ge2) {
g.textInput.onContextMenu(ge2), Re();
}
if (y.addListener(b, "mouseup", Me, g), y.addListener(b, "mousedown", function(ge2) {
ge2.preventDefault(), Re();
}, g), y.addListener(g.renderer.scroller, "contextmenu", Me, g), y.addListener(b, "contextmenu", Me, g), t) {
let ge2 = function(te) {
var ie, ce, fe, Ie;
document.activeElement !== ve || Ge || M || Se.$mouseHandler.isMousePressed || w || (ie = ve.selectionStart, ce = ve.selectionEnd, fe = null, (Ie = 0) == ie ? fe = r.up : ie == 1 ? fe = r.home : $ < ce && _[ce] == `
` ? fe = r.end : ie < v && _[ie - 1] == " " ? (fe = r.left, Ie = e2.option) : ie < v || ie == v && $ != v && ie == ce ? fe = r.left : $ < ce && 2 < _.slice(0, ce).split(`
`).length ? fe = r.down : $ < ce && _[ce - 1] == " " ? (fe = r.right, Ie = e2.option) : ($ < ce || ce == $ && $ != v && ie == ce) && (fe = r.right), ie !== ce && (Ie |= e2.shift), fe && (!Se.onCommandKey({}, Ie, fe) && Se.commands && (fe = r.keyCodeToString(fe), Ie = Se.commands.findKeyCommand(Ie, fe)) && Se.execCommand(Ie), v = ie, $ = ce, I("")));
};
var Se = g, ve = b, Le = null, Ge = false;
ve.addEventListener("keydown", function(te) {
Le && clearTimeout(Le), Ge = true;
}, true), ve.addEventListener("keyup", function(te) {
Le = setTimeout(function() {
Ge = false;
}, 100);
}, true), document.addEventListener("selectionchange", ge2), Se.on("destroy", function() {
document.removeEventListener("selectionchange", ge2);
});
}
this.destroy = function() {
b.parentElement && b.parentElement.removeChild(b);
};
}, f.$setUserAgentForTests = function(p, g) {
c = p, t = g;
};
}), ace.define("ace/mouse/default_handlers", ["require", "exports", "module", "ace/lib/useragent"], function(C, f, R) {
var y = C("../lib/useragent"), C = (d.prototype.onMouseDown = function(l) {
var n = l.inSelection(), o = l.getDocumentPosition(), i = (this.mousedownEvent = l, this.editor), a = l.getButton();
if (a !== 0)
!i.getSelectionRange().isEmpty() && a != 1 || i.selection.moveToPosition(o), a == 2 && (i.textInput.onContextMenu(l.domEvent), y.isMozilla || l.preventDefault());
else {
if (this.mousedownEvent.time = Date.now(), !n || i.isFocused() || (i.focus(), !this.$focusTimeout) || this.$clickSelection || i.inMultiSelectMode)
return this.captureMouse(l), this.startSelect(o, 1 < l.domEvent._clicks), l.preventDefault();
this.setState("focusWait"), this.captureMouse(l);
}
}, d.prototype.startSelect = function(l, n) {
l = l || this.editor.renderer.screenToTextCoordinates(this.x, this.y);
var o = this.editor;
this.mousedownEvent && (this.mousedownEvent.getShiftKey() ? o.selection.selectToPosition(l) : n || o.selection.moveToPosition(l), n || this.select(), o.setStyle("ace_selecting"), this.setState("select"));
}, d.prototype.select = function() {
var l, n = this.editor, o = n.renderer.screenToTextCoordinates(this.x, this.y);
this.$clickSelection && (l = (l = this.$clickSelection.comparePoint(o)) == -1 ? this.$clickSelection.end : l == 1 ? this.$clickSelection.start : (o = (l = h(this.$clickSelection, o)).cursor, l.anchor), n.selection.setSelectionAnchor(l.row, l.column)), n.selection.selectToPosition(o), n.renderer.scrollCursorIntoView();
}, d.prototype.extendSelectionBy = function(e2) {
var n, o, i, a = this.editor, r = a.renderer.screenToTextCoordinates(this.x, this.y), e2 = a.selection[e2](r.row, r.column);
this.$clickSelection && (o = this.$clickSelection.comparePoint(e2.start), n = this.$clickSelection.comparePoint(e2.end), o == -1 && n <= 0 ? (i = this.$clickSelection.end, e2.end.row == r.row && e2.end.column == r.column || (r = e2.start)) : n == 1 && 0 <= o ? (i = this.$clickSelection.start, e2.start.row == r.row && e2.start.column == r.column || (r = e2.end)) : i = o == -1 && n == 1 ? (r = e2.end, e2.start) : (r = (o = h(this.$clickSelection, r)).cursor, o.anchor), a.selection.setSelectionAnchor(i.row, i.column)), a.selection.selectToPosition(r), a.renderer.scrollCursorIntoView();
}, d.prototype.selectByLinesEnd = function() {
this.$clickSelection = null, this.editor.unsetStyle("ace_selecting");
}, d.prototype.focusWait = function() {
i = this.mousedownEvent.x, l = this.mousedownEvent.y, o = this.x, n = this.y;
var l, n, o = Math.sqrt(Math.pow(o - i, 2) + Math.pow(n - l, 2)), i = Date.now();
(0 < o || i - this.mousedownEvent.time > this.$focusTimeout) && this.startSelect(this.mousedownEvent.getDocumentPosition());
}, d.prototype.onDoubleClick = function(n) {
var n = n.getDocumentPosition(), o = this.editor, i = o.session.getBracketRange(n);
i ? (i.isEmpty() && (i.start.column--, i.end.column++), this.setState("select")) : (i = o.selection.getWordRange(n.row, n.column), this.setState("selectByWords")), this.$clickSelection = i, this.select();
}, d.prototype.onTripleClick = function(n) {
var n = n.getDocumentPosition(), o = this.editor, i = (this.setState("selectByLines"), o.getSelectionRange());
i.isMultiLine() && i.contains(n.row, n.column) ? (this.$clickSelection = o.selection.getLineRange(i.start.row), this.$clickSelection.end = o.selection.getLineRange(i.end.row).end) : this.$clickSelection = o.selection.getLineRange(n.row), this.select();
}, d.prototype.onQuadClick = function(l) {
var n = this.editor;
n.selectAll(), this.$clickSelection = n.getSelectionRange(), this.setState("selectAll");
}, d.prototype.onMouseWheel = function(l) {
var n, o, i, a, r, e2, t;
if (!l.getAccelKey())
return l.getShiftKey() && l.wheelY && !l.wheelX && (l.wheelX = l.wheelY, l.wheelY = 0), n = this.editor, this.$lastScroll || (this.$lastScroll = { t: 0, vx: 0, vy: 0, allowed: 0 }), o = this.$lastScroll, a = (t = (i = l.domEvent.timeStamp) - o.t) ? l.wheelX / t : o.vx, r = t ? l.wheelY / t : o.vy, t < 550 && (a = (a + o.vx) / 2, r = (r + o.vy) / 2), t = false, 1 <= (e2 = Math.abs(a / r)) && n.renderer.isScrollableBy(l.wheelX * l.speed, 0) && (t = true), (t = e2 <= 1 && n.renderer.isScrollableBy(0, l.wheelY * l.speed) ? true : t) ? o.allowed = i : i - o.allowed < 550 && (Math.abs(a) <= 1.5 * Math.abs(o.vx) && Math.abs(r) <= 1.5 * Math.abs(o.vy) ? (t = true, o.allowed = i) : o.allowed = 0), o.t = i, o.vx = a, o.vy = r, t ? (n.renderer.scrollBy(l.wheelX * l.speed, l.wheelY * l.speed), l.stop()) : void 0;
}, d);
function d(l) {
l.$clickSelection = null;
var n = l.editor;
n.setDefaultHandler("mousedown", this.onMouseDown.bind(l)), n.setDefaultHandler("dblclick", this.onDoubleClick.bind(l)), n.setDefaultHandler("tripleclick", this.onTripleClick.bind(l)), n.setDefaultHandler("quadclick", this.onQuadClick.bind(l)), n.setDefaultHandler("mousewheel", this.onMouseWheel.bind(l)), ["select", "startSelect", "selectEnd", "selectAllEnd", "selectByWordsEnd", "selectByLinesEnd", "dragWait", "dragWaitEnd", "focusWait"].forEach(function(o) {
l[o] = this[o];
}, this), l.selectByLines = this.extendSelectionBy.bind(l, "getLineRange"), l.selectByWords = this.extendSelectionBy.bind(l, "getWordRange");
}
function h(l, n) {
return (l.start.row == l.end.row ? 2 * n.column - l.start.column - l.end.column : l.start.row != l.end.row - 1 || l.start.column || l.end.column ? 2 * n.row - l.start.row - l.end.row : n.column - 4) < 0 ? { cursor: l.start, anchor: l.end } : { cursor: l.end, anchor: l.start };
}
C.prototype.selectEnd = C.prototype.selectByLinesEnd, C.prototype.selectAllEnd = C.prototype.selectByLinesEnd, C.prototype.selectByWordsEnd = C.prototype.selectByLinesEnd, f.DefaultHandlers = C;
}), ace.define("ace/tooltip", ["require", "exports", "module", "ace/lib/dom", "ace/range"], function(n, f, R) {
var y, e2 = this && this.__extends || (y = function(s, c) {
return (y = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? function(p, g) {
p.__proto__ = g;
} : function(p, g) {
for (var b in g)
Object.prototype.hasOwnProperty.call(g, b) && (p[b] = g[b]);
}))(s, c);
}, function(s, c) {
if (typeof c != "function" && c !== null)
throw new TypeError("Class extends value " + String(c) + " is not a constructor or null");
function p() {
this.constructor = s;
}
y(s, c), s.prototype = c === null ? Object.create(c) : (p.prototype = c.prototype, new p());
}), C = this && this.__values || function(s) {
var c = typeof Symbol == "function" && Symbol.iterator, p = c && s[c], g = 0;
if (p)
return p.call(s);
if (s && typeof s.length == "number")
return { next: function() {
return { value: (s = s && g >= s.length ? void 0 : s) && s[g++], done: !s };
} };
throw new TypeError(c ? "Object is not iterable." : "Symbol.iterator is not defined.");
}, d = n("./lib/dom"), h = n("./range").Range, l = "ace_tooltip", n = (o.prototype.$init = function() {
return this.$element = d.createElement("div"), this.$element.className = l, this.$element.style.display = "none", this.$parentNode.appendChild(this.$element), this.$element;
}, o.prototype.getElement = function() {
return this.$element || this.$init();
}, o.prototype.setText = function(s) {
this.getElement().textContent = s;
}, o.prototype.setHtml = function(s) {
this.getElement().innerHTML = s;
}, o.prototype.setPosition = function(s, c) {
this.getElement().style.left = s + "px", this.getElement().style.top = c + "px";
}, o.prototype.setClassName = function(s) {
d.addCssClass(this.getElement(), s);
}, o.prototype.setTheme = function(s) {
this.$element.className = l + " " + (s.isDark ? "ace_dark " : "") + (s.cssClass || "");
}, o.prototype.show = function(s, c, p) {
s != null && this.setText(s), c != null && p != null && this.setPosition(c, p), this.isOpen || (this.getElement().style.display = "block", this.isOpen = true);
}, o.prototype.hide = function() {
this.isOpen && (this.getElement().style.display = "none", this.getElement().className = l, this.isOpen = false);
}, o.prototype.getHeight = function() {
return this.getElement().offsetHeight;
}, o.prototype.getWidth = function() {
return this.getElement().offsetWidth;
}, o.prototype.destroy = function() {
this.isOpen = false, this.$element && this.$element.parentNode && this.$element.parentNode.removeChild(this.$element);
}, o);
function o(s) {
this.isOpen = false, this.$element = null, this.$parentNode = s;
}
function i() {
this.popups = [];
}
i.prototype.addPopup = function(s) {
this.popups.push(s), this.updatePopups();
}, i.prototype.removePopup = function(s) {
s = this.popups.indexOf(s), s !== -1 && (this.popups.splice(s, 1), this.updatePopups());
}, i.prototype.updatePopups = function() {
this.popups.sort(function(_, v) {
return v.priority - _.priority;
});
var s, c, p, g, b = [];
try {
for (var w = C(this.popups), E = w.next(); !E.done; E = w.next()) {
var M = E.value, B2 = true;
try {
p = void 0;
for (var Z = C(b), k = Z.next(); !k.done; k = Z.next()) {
var u = k.value;
if (this.doPopupsOverlap(u, M)) {
B2 = false;
break;
}
}
} catch (_) {
p = { error: _ };
} finally {
try {
k && !k.done && (g = Z.return) && g.call(Z);
} finally {
if (p)
throw p.error;
}
}
B2 ? b.push(M) : M.hide();
}
} catch (_) {
s = { error: _ };
} finally {
try {
E && !E.done && (c = w.return) && c.call(w);
} finally {
if (s)
throw s.error;
}
}
}, i.prototype.doPopupsOverlap = function(s, c) {
return s = s.getElement().getBoundingClientRect(), c = c.getElement().getBoundingClientRect(), s.left < c.right && s.right > c.left && s.top < c.bottom && s.bottom > c.top;
};
var a, r = new i(), e2 = (f.popupManager = r, f.Tooltip = n, e2(t, a = n), t.prototype.addToEditor = function(s) {
s.on("mousemove", this.onMouseMove), s.on("mousedown", this.hide), s.renderer.getMouseEventTarget().addEventListener("mouseout", this.onMouseOut, true);
}, t.prototype.removeFromEditor = function(s) {
s.off("mousemove", this.onMouseMove), s.off("mousedown", this.hide), s.renderer.getMouseEventTarget().removeEventListener("mouseout", this.onMouseOut, true), this.timeout && (clearTimeout(this.timeout), this.timeout = null);
}, t.prototype.onMouseMove = function(s, g) {
this.lastEvent = s, this.lastT = Date.now();
var p, g = g.$mouseHandler.isMousePressed;
this.isOpen && (p = this.lastEvent && this.lastEvent.getDocumentPosition(), this.range && this.range.contains(p.row, p.column) && !g && !this.isOutsideOfText(this.lastEvent) || this.hide()), this.timeout || g || (this.lastEvent = s, this.timeout = setTimeout(this.waitForHover, this.idleTime));
}, t.prototype.waitForHover = function() {
this.timeout && clearTimeout(this.timeout);
var s = Date.now() - this.lastT;
10 < this.idleTime - s ? this.timeout = setTimeout(this.waitForHover, this.idleTime - s) : (this.timeout = null, this.lastEvent && !this.isOutsideOfText(this.lastEvent) && this.$gatherData(this.lastEvent, this.lastEvent.editor));
}, t.prototype.isOutsideOfText = function(s) {
var c = s.editor, p = s.getDocumentPosition(), g = c.session.getLine(p.row);
return p.column == g.length && (g = c.renderer.pixelToScreenCoordinates(s.clientX, s.clientY), s = c.session.documentToScreenPosition(p.row, p.column), s.column != g.column || s.row != g.row);
}, t.prototype.setDataProvider = function(s) {
this.$gatherData = s;
}, t.prototype.showForRange = function(s, c, p, g) {
var b, w;
g && g != this.lastEvent || this.isOpen && document.activeElement == this.getElement() || (g = s.renderer, this.isOpen || (r.addPopup(this), this.$registerCloseEvents(), this.setTheme(g.theme)), this.isOpen = true, this.addMarker(c, s.session), this.range = h.fromPoints(c.start, c.end), (s = this.getElement()).innerHTML = "", s.appendChild(p), s.style.display = "block", p = g.textToScreenCoordinates(c.start.row, c.start.column), c = s.clientHeight, b = g.scroller.getBoundingClientRect(), w = true, (w = p.pageY - c < 0 ? false : w) ? p.pageY -= c : p.pageY += g.lineHeight, s.style.maxWidth = b.width - (p.pageX - b.left) + "px", this.setPosition(p.pageX, p.pageY));
}, t.prototype.addMarker = function(s, c) {
this.marker && this.$markerSession.removeMarker(this.marker), this.$markerSession = c, this.marker = c && c.addMarker(s, "ace_highlight-marker", "text");
}, t.prototype.hide = function(s) {
!s && document.activeElement == this.getElement() || s && s.target && (s.type != "keydown" || s.ctrlKey || s.metaKey) && this.$element.contains(s.target) || (this.lastEvent = null, this.timeout && clearTimeout(this.timeout), this.timeout = null, this.addMarker(null), this.isOpen && (this.$removeCloseEvents(), this.getElement().style.display = "none", this.isOpen = false, r.removePopup(this)));
}, t.prototype.$registerCloseEvents = function() {
window.addEventListener("keydown", this.hide, true), window.addEventListener("mousewheel", this.hide, true), window.addEventListener("mousedown", this.hide, true);
}, t.prototype.$removeCloseEvents = function() {
window.removeEventListener("keydown", this.hide, true), window.removeEventListener("mousewheel", this.hide, true), window.removeEventListener("mousedown", this.hide, true);
}, t.prototype.onMouseOut = function(s) {
this.timeout && (clearTimeout(this.timeout), this.timeout = null), this.lastEvent = null, !this.isOpen || !s.relatedTarget || s.relatedTarget == this.getElement() || s && s.currentTarget.contains(s.relatedTarget) || s.relatedTarget.classList.contains("ace_content") || this.hide();
}, t);
function t(c) {
c === void 0 && (c = document.body);
var c = a.call(this, c) || this, p = (c.timeout = void 0, c.lastT = 0, c.idleTime = 350, c.lastEvent = void 0, c.onMouseOut = c.onMouseOut.bind(c), c.onMouseMove = c.onMouseMove.bind(c), c.waitForHover = c.waitForHover.bind(c), c.hide = c.hide.bind(c), c.getElement());
return p.style.whiteSpace = "pre-wrap", p.style.pointerEvents = "auto", p.addEventListener("mouseout", c.onMouseOut), p.tabIndex = -1, p.addEventListener("blur", (function() {
p.contains(document.activeElement) || this.hide();
}).bind(c)), c;
}
f.HoverTooltip = e2;
}), ace.define("ace/mouse/default_gutter_handler", ["require", "exports", "module", "ace/lib/dom", "ace/lib/event", "ace/tooltip", "ace/config"], function(A, f, R) {
var y, C = this && this.__extends || (y = function(e2, t) {
return (y = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? function(s, c) {
s.__proto__ = c;
} : function(s, c) {
for (var p in c)
Object.prototype.hasOwnProperty.call(c, p) && (s[p] = c[p]);
}))(e2, t);
}, function(e2, t) {
if (typeof t != "function" && t !== null)
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
function s() {
this.constructor = e2;
}
y(e2, t), e2.prototype = t === null ? Object.create(t) : (s.prototype = t.prototype, new s());
}), d = this && this.__values || function(e2) {
var t = typeof Symbol == "function" && Symbol.iterator, s = t && e2[t], c = 0;
if (s)
return s.call(e2);
if (e2 && typeof e2.length == "number")
return { next: function() {
return { value: (e2 = e2 && c >= e2.length ? void 0 : e2) && e2[c++], done: !e2 };
} };
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
}, h = A("../lib/dom"), l = A("../lib/event"), n = A("../tooltip").Tooltip, o = A("../config").nls;
f.GutterHandler = function(e2) {
var t, s, c = e2.editor, p = c.renderer.$gutterLayer, g = new a(c);
function b() {
t = t && clearTimeout(t), g.isOpen && (g.hideTooltip(), c.off("mousewheel", b));
}
function w(E) {
g.setPosition(E.x, E.y);
}
e2.editor.setDefaultHandler("guttermousedown", function(E) {
if (c.isFocused() && E.getButton() == 0) {
var M = p.getRegion(E);
if (M != "foldWidgets") {
var M = E.getDocumentPosition().row, B2 = c.session.selection;
if (E.getShiftKey())
B2.selectTo(M, 0);
else {
if (E.domEvent.detail == 2)
return c.selectAll(), E.preventDefault();
e2.$clickSelection = c.selection.getLineRange(M);
}
return e2.setState("selectByLines"), e2.captureMouse(E), E.preventDefault();
}
}
}), e2.editor.setDefaultHandler("guttermousemove", function(E) {
var M = E.domEvent.target || E.domEvent.srcElement;
if (h.hasCssClass(M, "ace_fold-widget"))
return b();
g.isOpen && e2.$tooltipFollowsMouse && w(E), s = E, t = t || setTimeout(function() {
if (t = null, s && !e2.isMousePressed) {
var B2 = s.getDocumentPosition().row;
if (B2 == c.session.getLength()) {
var Z = c.renderer.pixelToScreenCoordinates(0, s.y).row, k = s.$pos;
if (Z > c.session.documentToScreenRow(k.row, k.column))
return void b();
}
g.showTooltip(B2), g.isOpen && (c.on("mousewheel", b), !e2.$tooltipFollowsMouse && (Z = s.getGutterRow(), k = p.$lines.get(Z)) ? (B2 = k.element.querySelector(".ace_gutter_annotation").getBoundingClientRect(), (Z = g.getElement().style).left = B2.right + "px", Z.top = B2.bottom + "px") : w(s));
} else
b();
}, 50);
}), l.addListener(c.renderer.$gutter, "mouseout", function(E) {
s = null, g.isOpen && (t = t || setTimeout(function() {
t = null, b();
}, 50));
}, c), c.on("changeSession", b), c.on("input", b);
}, C(r, i = n), r.prototype.setPosition = function(e2, t) {
var s = window.innerWidth || document.documentElement.clientWidth, c = window.innerHeight || document.documentElement.clientHeight, p = this.getWidth(), g = this.getHeight();
s < (e2 += 15) + p && (e2 -= e2 + p - s), c < (t += 15) + g && (t -= 20 + g), n.prototype.setPosition.call(this, e2, t);
}, Object.defineProperty(r, "annotationLabels", { get: function() {
return { error: { singular: o("error"), plural: o("errors") }, warning: { singular: o("warning"), plural: o("warnings") }, info: { singular: o("information message"), plural: o("information messages") } };
}, enumerable: false, configurable: true }), r.prototype.showTooltip = function(e2) {
var t = this.editor.renderer.$gutterLayer, s = t.$annotations[e2], c = s ? { text: Array.from(s.text), type: Array.from(s.type) } : { text: [], type: [] }, p = t.session.getFoldLine(e2);
if (p && t.$showFoldedAnnotations) {
for (var g, b = { error: [], warning: [], info: [] }, w = e2 + 1; w <= p.end.row; w++)
if (t.$annotations[w])
for (var E = 0; E < t.$annotations[w].text.length; E++) {
var M = t.$annotations[w].type[E];
b[M].push(t.$annotations[w].text[E]), M === "error" ? g = "error_fold" : M === "warning" && (g = "warning_fold");
}
g !== "error_fold" && g !== "warning_fold" || (s = "".concat(r.annotationsToSummaryString(b), " in folded code."), c.text.push(s), c.type.push(g));
}
if (c.text.length === 0)
return this.hide();
for (var B2 = { error: [], warning: [], info: [] }, Z = t.$useSvgGutterIcons ? "ace_icon_svg" : "ace_icon", w = 0; w < c.text.length; w++) {
var k = " ").concat(c.text[w]);
B2[c.type[w].replace("_fold", "")].push(k);
}
e2 = [].concat(B2.error, B2.warning, B2.info).join(" "), this.setHtml(e2), this.$element.setAttribute("aria-live", "polite"), this.isOpen || (this.setTheme(this.editor.renderer.theme), this.setClassName("ace_gutter-tooltip")), this.show(), this.editor._signal("showGutterTooltip", this);
}, r.prototype.hideTooltip = function() {
this.$element.removeAttribute("aria-live"), this.hide(), this.editor._signal("hideGutterTooltip", this);
}, r.annotationsToSummaryString = function(e2) {
var t, s, c = [];
try {
for (var p = d(["error", "warning", "info"]), g = p.next(); !g.done; g = p.next()) {
var b, w = g.value;
e2[w].length && (b = e2[w].length === 1 ? r.annotationLabels[w].singular : r.annotationLabels[w].plural, c.push("".concat(e2[w].length, " ").concat(b)));
}
} catch (E) {
t = { error: E };
} finally {
try {
g && !g.done && (s = p.return) && s.call(p);
} finally {
if (t)
throw t.error;
}
}
return c.join(", ");
};
var i, a = r;
function r(e2) {
var t = i.call(this, e2.container) || this;
return t.editor = e2, t;
}
f.GutterTooltip = a;
}), ace.define("ace/mouse/mouse_event", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent"], function(A, f, R) {
var y = A("../lib/event"), C = A("../lib/useragent");
function d(h, l) {
this.domEvent = h, this.editor = l, this.x = this.clientX = h.clientX, this.y = this.clientY = h.clientY, this.$pos = null, this.$inSelection = null, this.propagationStopped = false, this.defaultPrevented = false;
}
d.prototype.stopPropagation = function() {
y.stopPropagation(this.domEvent), this.propagationStopped = true;
}, d.prototype.preventDefault = function() {
y.preventDefault(this.domEvent), this.defaultPrevented = true;
}, d.prototype.stop = function() {
this.stopPropagation(), this.preventDefault();
}, d.prototype.getDocumentPosition = function() {
return this.$pos || (this.$pos = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY)), this.$pos;
}, d.prototype.getGutterRow = function() {
var h = this.getDocumentPosition().row;
return this.editor.session.documentToScreenRow(h, 0) - this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row, 0);
}, d.prototype.inSelection = function() {
var h, l;
return this.$inSelection === null && ((h = this.editor.getSelectionRange()).isEmpty() ? this.$inSelection = false : (l = this.getDocumentPosition(), this.$inSelection = h.contains(l.row, l.column))), this.$inSelection;
}, d.prototype.getButton = function() {
return y.getButton(this.domEvent);
}, d.prototype.getShiftKey = function() {
return this.domEvent.shiftKey;
}, d.prototype.getAccelKey = function() {
return C.isMac ? this.domEvent.metaKey : this.domEvent.ctrlKey;
}, f.MouseEvent = d;
}), ace.define("ace/mouse/dragdrop_handler", ["require", "exports", "module", "ace/lib/dom", "ace/lib/event", "ace/lib/useragent"], function(A, f, R) {
var y = A("../lib/dom"), C = A("../lib/event"), d = A("../lib/useragent");
function h(n) {
var o, i, a, r, e2, t, s, c, p, g, b, w = n.editor, E = y.createElement("div"), M = (E.style.cssText = "top:-100px;position:absolute;z-index:2147483647;opacity:0.5", E.textContent = " ", ["dragWait", "dragWaitEnd", "startDrag", "dragReadyEnd", "onMouseDrag"].forEach(function(W) {
n[W] = this[W];
}, this), w.on("mousedown", this.onMouseDown.bind(n)), w.container), B2 = 0;
function Z() {
var W, X, Q, K, ne, T, V, F, I = t;
t = w.renderer.screenToTextCoordinates(i, a), Q = t, X = I, K = Date.now(), W = !X || Q.row != X.row, X = !X || Q.column != X.column, !g || W || X ? (w.moveCursorToPosition(Q), g = K, b = { x: i, y: a }) : 5 < l(b.x, b.y, i, a) ? g = null : 200 <= K - g && (w.renderer.scrollCursorIntoView(), g = null), W = t, X = I, Q = Date.now(), K = w.renderer.layerConfig.lineHeight, I = w.renderer.layerConfig.characterWidth, ne = w.renderer.scroller.getBoundingClientRect(), ne = { x: { left: i - ne.left, right: ne.right - i }, y: { top: a - ne.top, bottom: ne.bottom - a } }, T = Math.min(ne.x.left, ne.x.right), V = Math.min(ne.y.top, ne.y.bottom), F = { row: W.row, column: W.column }, T / I <= 2 && (F.column += ne.x.left < ne.x.right ? -3 : 2), V / K <= 1 && (F.row += ne.y.top < ne.y.bottom ? -1 : 1), T = W.row != F.row, I = W.column != F.column, V = !X || W.row != X.row, T || I && !V ? p ? 200 <= Q - p && w.renderer.scrollCursorIntoView(F) : p = Q : p = null;
}
function k() {
e2 = w.selection.toOrientedRange(), o = w.session.addMarker(e2, "ace_selection", w.getSelectionStyle()), w.clearSelection(), w.isFocused() && w.renderer.$cursorLayer.setBlinking(false), clearInterval(r), Z(), r = setInterval(Z, 20), B2 = 0, C.addListener(document, "mousemove", v);
}
function u() {
clearInterval(r), w.session.removeMarker(o), o = null, w.selection.fromOrientedRange(e2), w.isFocused() && !c && w.$resetCursorStyle(), B2 = 0, g = p = t = e2 = null, C.removeListener(document, "mousemove", v);
}
this.onDragStart = function(W) {
var X;
if (this.cancelDrag || !M.draggable)
return X = this, setTimeout(function() {
X.startSelect(), X.captureMouse(W);
}, 0), W.preventDefault();
e2 = w.getSelectionRange();
var Q = W.dataTransfer;
Q.effectAllowed = w.getReadOnly() ? "copy" : "copyMove", w.container.appendChild(E), Q.setDragImage && Q.setDragImage(E, 0, 0), setTimeout(function() {
w.container.removeChild(E);
}), Q.clearData(), Q.setData("Text", w.session.getTextRange()), c = true, this.setState("drag");
}, this.onDragEnd = function(W) {
M.draggable = false, c = false, this.setState(null), w.getReadOnly() || (W = W.dataTransfer.dropEffect, s || W != "move" || w.session.remove(w.getSelectionRange()), w.$resetCursorStyle()), this.editor.unsetStyle("ace_dragging"), this.editor.renderer.setCursorStyle("");
}, this.onDragEnter = function(W) {
if (!w.getReadOnly() && $(W.dataTransfer))
return i = W.clientX, a = W.clientY, o || k(), B2++, W.dataTransfer.dropEffect = s = G(W), C.preventDefault(W);
}, this.onDragOver = function(W) {
if (!w.getReadOnly() && $(W.dataTransfer))
return i = W.clientX, a = W.clientY, o || (k(), B2++), _ !== null && (_ = null), W.dataTransfer.dropEffect = s = G(W), C.preventDefault(W);
}, this.onDragLeave = function(W) {
if (--B2 <= 0 && o)
return u(), s = null, C.preventDefault(W);
}, this.onDrop = function(W) {
if (t) {
var X = W.dataTransfer;
if (c)
switch (s) {
case "move":
e2 = e2.contains(t.row, t.column) ? { start: t, end: t } : w.moveText(e2, t);
break;
case "copy":
e2 = w.moveText(e2, t, true);
}
else
X = X.getData("Text"), e2 = { start: t, end: w.session.insert(t, X) }, w.focus(), s = null;
return u(), C.preventDefault(W);
}
}, C.addListener(M, "dragstart", this.onDragStart.bind(n), w), C.addListener(M, "dragend", this.onDragEnd.bind(n), w), C.addListener(M, "dragenter", this.onDragEnter.bind(n), w), C.addListener(M, "dragover", this.onDragOver.bind(n), w), C.addListener(M, "dragleave", this.onDragLeave.bind(n), w), C.addListener(M, "drop", this.onDrop.bind(n), w);
var _ = null;
function v() {
_ == null && (_ = setTimeout(function() {
_ != null && o && u();
}, 20));
}
function $(W) {
return W = W.types, !W || Array.prototype.some.call(W, function(X) {
return X == "text/plain" || X == "Text";
});
}
function G(W) {
var X = ["copy", "copymove", "all", "uninitialized"], Q = d.isMac ? W.altKey : W.ctrlKey, K = "uninitialized";
try {
K = W.dataTransfer.effectAllowed.toLowerCase();
} catch {
}
var ne = "none";
return Q && 0 <= X.indexOf(K) ? ne = "copy" : 0 <= ["move", "copymove", "linkmove", "all", "uninitialized"].indexOf(K) ? ne = "move" : 0 <= X.indexOf(K) && (ne = "copy"), ne;
}
}
function l(n, o, i, a) {
return Math.sqrt(Math.pow(i - n, 2) + Math.pow(a - o, 2));
}
(function() {
this.dragWait = function() {
Date.now() - this.mousedownEvent.time > this.editor.getDragDelay() && this.startDrag();
}, this.dragWaitEnd = function() {
this.editor.container.draggable = false, this.startSelect(this.mousedownEvent.getDocumentPosition()), this.selectEnd();
}, this.dragReadyEnd = function(n) {
this.editor.$resetCursorStyle(), this.editor.unsetStyle("ace_dragging"), this.editor.renderer.setCursorStyle(""), this.dragWaitEnd();
}, this.startDrag = function() {
this.cancelDrag = false;
var n = this.editor, o = (n.container.draggable = true, n.renderer.$cursorLayer.setBlinking(false), n.setStyle("ace_dragging"), d.isWin ? "default" : "move");
n.renderer.setCursorStyle(o), this.setState("dragReady");
}, this.onMouseDrag = function(n) {
var o = this.editor.container;
d.isIE && this.state == "dragReady" && 3 < l(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y) && o.dragDrop(), this.state === "dragWait" && 0 < l(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y) && (o.draggable = false, this.startSelect(this.mousedownEvent.getDocumentPosition()));
}, this.onMouseDown = function(n) {
var o, i, a;
this.$dragEnabled && (this.mousedownEvent = n, o = this.editor, i = n.inSelection(), a = n.getButton(), (n.domEvent.detail || 1) !== 1 || a !== 0 || !i || n.editor.inMultiSelectMode && (n.getAccelKey() || n.getShiftKey()) || (this.mousedownEvent.time = Date.now(), "unselectable" in (a = n.domEvent.target || n.domEvent.srcElement) && (a.unselectable = "on"), o.getDragDelay() ? (d.isWebKit && (this.cancelDrag = true, o.container.draggable = true), this.setState("dragWait")) : this.startDrag(), this.captureMouse(n, this.onMouseDrag.bind(this)), n.defaultPrevented = true));
};
}).call(h.prototype), f.DragdropHandler = h;
}), ace.define("ace/mouse/touch_handler", ["require", "exports", "module", "ace/mouse/mouse_event", "ace/lib/event", "ace/lib/dom"], function(A, f, R) {
var y = A("./mouse_event").MouseEvent, C = A("../lib/event"), d = A("../lib/dom");
f.addTouchListeners = function(h, l) {
var n, o, i, a, r, e2, t, s, c, p = "scroll", g = 0, b = 0, w = 0, E = 0;
function M() {
function u($) {
var G, W = $.target.getAttribute("action");
W != "more" && v ? (W == "paste" ? _.readText().then(function(X) {
l.execCommand(W, X);
}) : W && (W != "cut" && W != "copy" || (_ ? _.writeText(l.getCopyText()) : document.execCommand("copy")), l.execCommand(W)), c.firstChild.style.display = "none", v = false, W != "openCommandPalette" && l.focus()) : (v = !v, $ = l.getCopyText(), G = l.session.getUndoManager().hasUndo(), c.replaceChild(d.buildDom(v ? ["span", !$ && ["span", { class: "ace_mobile-button", action: "selectall" }, "Select All"], $ && ["span", { class: "ace_mobile-button", action: "copy" }, "Copy"], $ && ["span", { class: "ace_mobile-button", action: "cut" }, "Cut"], _ && ["span", { class: "ace_mobile-button", action: "paste" }, "Paste"], G && ["span", { class: "ace_mobile-button", action: "undo" }, "Undo"], ["span", { class: "ace_mobile-button", action: "find" }, "Find"], ["span", { class: "ace_mobile-button", action: "openCommandPalette" }, "Palette"]] : ["span"]), c.firstChild));
}
var _ = window.navigator && window.navigator.clipboard, v = false;
c = d.buildDom(["div", { class: "ace_mobile-menu", ontouchstart: function($) {
p = "menu", $.stopPropagation(), $.preventDefault(), l.textInput.focus();
}, ontouchend: function($) {
$.stopPropagation(), $.preventDefault(), u($);
}, onclick: u }, ["span"], ["span", { class: "ace_mobile-button", action: "more" }, "..."]], l.container);
}
function B2() {
c || M();
var u = l.selection.cursor, u = l.renderer.textToScreenCoordinates(u.row, u.column), _ = l.renderer.textToScreenCoordinates(0, 0).pageX, v = l.renderer.scrollLeft, $ = l.container.getBoundingClientRect();
c.style.top = u.pageY - $.top - 3 + "px", u.pageX - $.left < $.width - 70 ? (c.style.left = "", c.style.right = "10px") : (c.style.right = "", c.style.left = _ + v - $.left + "px"), c.style.display = "", c.firstChild.style.display = "none", l.on("input", Z);
}
function Z(u) {
c && (c.style.display = "none"), l.off("input", Z);
}
function k() {
r = null, clearTimeout(r);
var u = l.selection.getRange(), _ = u.contains(t.row, t.column);
!u.isEmpty() && _ || (l.selection.moveToPosition(t), l.selection.selectWord()), p = "wait", B2();
}
C.addListener(h, "contextmenu", function(u) {
s && l.textInput.getElement().focus();
}, l), C.addListener(h, "touchstart", function(u) {
var _ = u.touches;
if (r || 1 < _.length)
clearTimeout(r), r = null, i = -1, p = "zoom";
else {
s = l.$mouseHandler.isMousePressed = true;
var v = l.renderer.layerConfig.lineHeight, $ = l.renderer.layerConfig.lineHeight, G = u.timeStamp, W = (a = G, _[0]), X = W.clientX, W = W.clientY, X = (Math.abs(n - X) + Math.abs(o - W) > v && (i = -1), n = u.clientX = X, o = u.clientY = W, w = E = 0, new y(u, l));
if (t = X.getDocumentPosition(), G - i < 500 && _.length == 1 && !g)
b++, u.preventDefault(), u.button = 0, r = null, clearTimeout(r), l.selection.moveToPosition(t), (W = 2 <= b ? l.selection.getLineRange(t.row) : l.session.getBracketRange(t)) && !W.isEmpty() ? l.selection.setRange(W) : l.selection.selectWord(), p = "wait";
else {
b = 0;
var X = l.selection.cursor, _ = l.selection.isEmpty() ? X : l.selection.anchor, W = l.renderer.$cursorLayer.getPixelPosition(X, true), X = l.renderer.$cursorLayer.getPixelPosition(_, true), _ = l.renderer.scroller.getBoundingClientRect(), Q = l.renderer.layerConfig.offset, K = l.renderer.scrollLeft, ne = function(I, S) {
return (I /= $) * I + (S = S / v - 0.75) * S;
};
if (u.clientX < _.left)
return void (p = "zoom");
W = ne(u.clientX - _.left - W.left + K, u.clientY - _.top - W.top + Q), ne = ne(u.clientX - _.left - X.left + K, u.clientY - _.top - X.top + Q), W < 3.5 && ne < 3.5 && (p = ne < W ? "cursor" : "anchor"), p = ne < 3.5 ? "anchor" : W < 3.5 ? "cursor" : "scroll", r = setTimeout(k, 450);
}
i = G;
}
}, l), C.addListener(h, "touchend", function(u) {
s = l.$mouseHandler.isMousePressed = false, e2 && clearInterval(e2), p == "zoom" ? (p = "", g = 0) : (r ? (l.selection.moveToPosition(t), g = 0, B2) : p == "scroll" ? (g += 60, e2 = setInterval(function() {
g-- <= 0 && (clearInterval(e2), e2 = null), Math.abs(w) < 0.01 && (w = 0), Math.abs(E) < 0.01 && (E = 0), g < 20 && (w *= 0.9), g < 20 && (E *= 0.9);
var _ = l.session.getScrollTop();
l.renderer.scrollBy(10 * w, 10 * E), _ == l.session.getScrollTop() && (g = 0);
}, 10), Z) : B2)(), clearTimeout(r), r = null;
}, l), C.addListener(h, "touchmove", function(u) {
r && (clearTimeout(r), r = null);
var _ = u.touches;
if (!(1 < _.length || p == "zoom")) {
var _ = _[0], v = n - _.clientX, $ = o - _.clientY;
if (p == "wait") {
if (!(4 < v * v + $ * $))
return u.preventDefault();
p = "cursor";
}
n = _.clientX, o = _.clientY, u.clientX = _.clientX, u.clientY = _.clientY;
var _ = u.timeStamp, G = _ - a;
a = _, p == "scroll" ? ((_ = new y(u, l)).speed = 1, _.wheelX = v, _.wheelY = $, 10 * Math.abs(v) < Math.abs($) && (v = 0), 10 * Math.abs($) < Math.abs(v) && ($ = 0), G != 0 && (w = v / G, E = $ / G), l._emit("mousewheel", _), _.propagationStopped || (w = E = 0)) : (v = new y(u, l).getDocumentPosition(), p == "cursor" ? l.selection.moveCursorToPosition(v) : p == "anchor" && l.selection.setSelectionAnchor(v.row, v.column), l.renderer.scrollCursorIntoView(v), u.preventDefault());
}
}, l);
};
}), ace.define("ace/mouse/mouse_handler", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent", "ace/mouse/default_handlers", "ace/mouse/default_gutter_handler", "ace/mouse/mouse_event", "ace/mouse/dragdrop_handler", "ace/mouse/touch_handler", "ace/config"], function(i, f, R) {
var y = i("../lib/event"), C = i("../lib/useragent"), d = i("./default_handlers").DefaultHandlers, h = i("./default_gutter_handler").GutterHandler, l = i("./mouse_event").MouseEvent, n = i("./dragdrop_handler").DragdropHandler, o = i("./touch_handler").addTouchListeners, i = i("../config"), a = (r.prototype.onMouseEvent = function(e2, t) {
this.editor.session && this.editor._emit(e2, new l(t, this.editor));
}, r.prototype.onMouseMove = function(e2, t) {
var s = this.editor._eventRegistry && this.editor._eventRegistry.mousemove;
s && s.length && this.editor._emit(e2, new l(t, this.editor));
}, r.prototype.onMouseWheel = function(e2, t) {
var s = new l(t, this.editor);
s.speed = 2 * this.$scrollSpeed, s.wheelX = t.wheelX, s.wheelY = t.wheelY, this.editor._emit(e2, s);
}, r.prototype.setState = function(e2) {
this.state = e2;
}, r.prototype.captureMouse = function(e2, t) {
this.x = e2.x, this.y = e2.y, this.isMousePressed = true;
function s(B2) {
if (B2) {
if (C.isWebKit && !B2.which && w.releaseMouse)
return w.releaseMouse();
w.x = B2.clientX, w.y = B2.clientY, t && t(B2), w.mouseEvent = new l(B2, w.editor), w.$mouseMoved = true;
}
}
function c(B2) {
g.off("beforeEndOperation", E), clearInterval(M), g.session && p(), w[w.state + "End"] && w[w.state + "End"](B2), w.state = "", w.isMousePressed = b.$isMousePressed = false, b.$keepTextAreaAtCursor && b.$moveTextAreaToCursor(), w.$onCaptureMouseMove = w.releaseMouse = null, B2 && w.onMouseEvent("mouseup", B2), g.endOperation();
}
function p() {
w[w.state] && w[w.state](), w.$mouseMoved = false;
}
var g = this.editor, b = this.editor.renderer, w = (b.$isMousePressed = true, this);
if (C.isOldIE && e2.domEvent.type == "dblclick")
return setTimeout(function() {
c(e2);
});
var E = function(B2) {
w.releaseMouse && g.curOp.command.name && g.curOp.selectionChanged && (w[w.state + "End"] && w[w.state + "End"](), w.state = "", w.releaseMouse());
}, M = (g.on("beforeEndOperation", E), g.startOperation({ command: { name: "mouse" } }), w.$onCaptureMouseMove = s, w.releaseMouse = y.capture(this.editor.container, s, c), setInterval(p, 20));
}, r.prototype.cancelContextMenu = function() {
var e2 = (function(t) {
t && t.domEvent && t.domEvent.type != "contextmenu" || (this.editor.off("nativecontextmenu", e2), t && t.domEvent && y.stopEvent(t.domEvent));
}).bind(this);
setTimeout(e2, 10), this.editor.on("nativecontextmenu", e2);
}, r.prototype.destroy = function() {
this.releaseMouse && this.releaseMouse();
}, r);
function r(e2) {
function t(g) {
document.hasFocus && document.hasFocus() && (e2.isFocused() || document.activeElement != (e2.textInput && e2.textInput.getElement())) || window.focus(), e2.focus(), setTimeout(function() {
e2.isFocused() || e2.focus();
});
}
var s = this, c = (this.editor = e2, new d(this), new h(this), new n(this), e2.renderer.getMouseEventTarget()), p = (y.addListener(c, "click", this.onMouseEvent.bind(this, "click"), e2), y.addListener(c, "mousemove", this.onMouseMove.bind(this, "mousemove"), e2), y.addMultiMouseDownListener([c, e2.renderer.scrollBarV && e2.renderer.scrollBarV.inner, e2.renderer.scrollBarH && e2.renderer.scrollBarH.inner, e2.textInput && e2.textInput.getElement()].filter(Boolean), [400, 300, 250], this, "onMouseEvent", e2), y.addMouseWheelListener(e2.container, this.onMouseWheel.bind(this, "mousewheel"), e2), o(e2.container, e2), e2.renderer.$gutter);
y.addListener(p, "mousedown", this.onMouseEvent.bind(this, "guttermousedown"), e2), y.addListener(p, "click", this.onMouseEvent.bind(this, "gutterclick"), e2), y.addListener(p, "dblclick", this.onMouseEvent.bind(this, "gutterdblclick"), e2), y.addListener(p, "mousemove", this.onMouseEvent.bind(this, "guttermousemove"), e2), y.addListener(c, "mousedown", t, e2), y.addListener(p, "mousedown", t, e2), C.isIE && e2.renderer.scrollBarV && (y.addListener(e2.renderer.scrollBarV.element, "mousedown", t, e2), y.addListener(e2.renderer.scrollBarH.element, "mousedown", t, e2)), e2.on("mousemove", function(g) {
var b, w;
s.state || s.$dragDelay || !s.$dragEnabled || (g = e2.renderer.screenToTextCoordinates(g.x, g.y), b = e2.session.selection.getRange(), w = e2.renderer, !b.isEmpty() && b.insideStart(g.row, g.column) ? w.setCursorStyle("default") : w.setCursorStyle(""));
}, e2);
}
a.prototype.releaseMouse = null, i.defineOptions(a.prototype, "mouseHandler", { scrollSpeed: { initialValue: 2 }, dragDelay: { initialValue: C.isMac ? 150 : 0 }, dragEnabled: { initialValue: true }, focusTimeout: { initialValue: 0 }, tooltipFollowsMouse: { initialValue: true } }), f.MouseHandler = a;
}), ace.define("ace/mouse/fold_handler", ["require", "exports", "module", "ace/lib/dom"], function(A, f, R) {
var y = A("../lib/dom");
f.FoldHandler = function(C) {
C.on("click", function(d) {
var l = d.getDocumentPosition(), h = C.session, l = h.getFoldAt(l.row, l.column, 1), l = (l && (d.getAccelKey() ? h.removeFold(l) : h.expandFold(l), d.stop()), d.domEvent && d.domEvent.target);
l && y.hasCssClass(l, "ace_inline_button") && y.hasCssClass(l, "ace_toggle_wrap") && (h.setOption("wrap", !h.getUseWrapMode()), C.renderer.scrollCursorIntoView());
}), C.on("gutterclick", function(d) {
var h, l;
C.renderer.$gutterLayer.getRegion(d) == "foldWidgets" && (h = d.getDocumentPosition().row, (l = C.session).foldWidgets && l.foldWidgets[h] && C.session.onFoldWidgetClick(h, d), C.isFocused() || C.focus(), d.stop());
}), C.on("gutterdblclick", function(d) {
var h, l, n;
C.renderer.$gutterLayer.getRegion(d) == "foldWidgets" && (n = d.getDocumentPosition().row, (l = (l = (h = C.session).getParentFoldRangeData(n, true)).range || l.firstRange) && (n = l.start.row, (n = h.getFoldAt(n, h.getLine(n).length, 1)) ? h.removeFold(n) : (h.addFold("...", l), C.renderer.scrollCursorIntoView({ row: l.start.row, column: 0 }))), d.stop());
});
};
}), ace.define("ace/keyboard/keybinding", ["require", "exports", "module", "ace/lib/keys", "ace/lib/event"], function(A, f, R) {
var y = A("../lib/keys"), C = A("../lib/event");
function d(h) {
this.$editor = h, this.$data = { editor: h }, this.$handlers = [], this.setDefaultHandler(h.commands);
}
d.prototype.setDefaultHandler = function(h) {
this.removeKeyboardHandler(this.$defaultHandler), this.$defaultHandler = h, this.addKeyboardHandler(h, 0);
}, d.prototype.setKeyboardHandler = function(h) {
var l = this.$handlers;
if (l[l.length - 1] != h) {
for (; l[l.length - 1] && l[l.length - 1] != this.$defaultHandler; )
this.removeKeyboardHandler(l[l.length - 1]);
this.addKeyboardHandler(h, 1);
}
}, d.prototype.addKeyboardHandler = function(h, l) {
var n;
h && (typeof h != "function" || h.handleKeyboard || (h.handleKeyboard = h), (n = this.$handlers.indexOf(h)) != -1 && this.$handlers.splice(n, 1), l == null ? this.$handlers.push(h) : this.$handlers.splice(l, 0, h), n == -1) && h.attach && h.attach(this.$editor);
}, d.prototype.removeKeyboardHandler = function(h) {
var l = this.$handlers.indexOf(h);
return l != -1 && (this.$handlers.splice(l, 1), h.detach && h.detach(this.$editor), true);
}, d.prototype.getKeyboardHandler = function() {
return this.$handlers[this.$handlers.length - 1];
}, d.prototype.getStatusText = function() {
var h = this.$data, l = h.editor;
return this.$handlers.map(function(n) {
return n.getStatusText && n.getStatusText(l, h) || "";
}).filter(Boolean).join(" ");
}, d.prototype.$callKeyboardHandlers = function(h, l, n, o) {
for (var i, a = false, r = this.$editor.commands, e2 = this.$handlers.length; e2-- && !((i = this.$handlers[e2].handleKeyboard(this.$data, h, l, n, o)) && i.command && ((a = i.command == "null" || r.exec(i.command, this.$editor, i.args, o)) && o && h != -1 && i.passEvent != 1 && i.command.passEvent != 1 && C.stopEvent(o), a)); )
;
return a || h != -1 || (i = { command: "insertstring" }, a = r.exec("insertstring", this.$editor, l)), a && this.$editor._signal && this.$editor._signal("keyboardActivity", i), a;
}, d.prototype.onCommandKey = function(h, l, n) {
var o = y.keyCodeToString(n);
return this.$callKeyboardHandlers(l, o, n, h);
}, d.prototype.onTextInput = function(h) {
return this.$callKeyboardHandlers(-1, h);
}, f.KeyBinding = d;
}), ace.define("ace/lib/bidiutil", ["require", "exports", "module"], function(A, f, R) {
var y = 0, C = 0, d = false, h = false, l = false, n = [[0, 3, 0, 1, 0, 0, 0], [0, 3, 0, 1, 2, 2, 0], [0, 3, 0, 17, 2, 0, 1], [0, 3, 5, 5, 4, 1, 0], [0, 3, 21, 21, 4, 0, 1], [0, 3, 5, 5, 4, 2, 0]], o = [[2, 0, 1, 1, 0, 1, 0], [2, 0, 1, 1, 0, 2, 0], [2, 0, 2, 1, 3, 2, 0], [2, 0, 2, 33, 3, 1, 1]], i = 0, a = 1, r = 2, e2 = 3, t = 4, s = 5, c = 6, p = 7, g = 8, b = 9, w = 10, E = 11, M = 12, B2 = 13, Z = 14, k = 15, u = 16, _ = 17, v = 18, $ = [v, v, v, v, v, v, v, v, v, c, s, c, g, s, v, v, v, v, v, v, v, v, v, v, v, v, v, v, s, s, s, c, g, t, t, E, E, E, t, t, t, t, t, w, b, w, b, b, r, r, r, r, r, r, r, r, r, r, b, t, t, t, t, t, t, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, t, t, t, t, t, t, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, t, t, t, t, v, v, v, v, v, v, s, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, b, t, E, E, E, E, t, t, t, t, i, t, t, v, t, t, E, E, r, r, t, i, t, t, t, r, i, t, t, t, t, t], G = [g, g, g, g, g, g, g, g, g, g, g, v, v, v, i, a, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, g, s, B2, Z, k, u, _, b, E, E, E, E, E, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, b, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, g];
function W(K, ne, T, V) {
var F, I, S, L = y ? o : n, O = 0, J = -1, re = null, pe = null, me = [];
if (!V)
for (re = 0, V = []; re < T; re++)
V[re] = Q(K[re]);
for (C = y, l = h = d = false, pe = 0; pe < T; pe++) {
if (S = O, me[pe] = F = function(xe, be, Ae, we) {
var Re, Me, Se, ve = be[we];
switch (ve) {
case i:
case a:
d = false;
case t:
case e2:
return ve;
case r:
return d ? e2 : r;
case p:
return d = true, a;
case g:
return t;
case b:
return we < 1 || we + 1 >= be.length || (Re = Ae[we - 1]) != r && Re != e2 || (Le = be[we + 1]) != r && Le != e2 ? t : (Le = d ? e2 : Le) == Re ? Le : t;
case w:
return (Re = 0 < we ? Ae[we - 1] : s) == r && we + 1 < be.length && be[we + 1] == r ? r : t;
case E:
if (0 < we && Ae[we - 1] == r)
return r;
if (d)
return t;
for (Se = we + 1, Me = be.length; Se < Me && be[Se] == E; )
Se++;
return Se < Me && be[Se] == r ? r : t;
case M:
for (Me = be.length, Se = we + 1; Se < Me && be[Se] == M; )
Se++;
if (Se < Me) {
var Le = xe[we], Le = 1425 <= Le && Le <= 2303 || Le == 64286;
if (Re = be[Se], Le && (Re == a || Re == p))
return a;
}
return we < 1 || (Re = be[we - 1]) == s ? t : Ae[we - 1];
case s:
return h = !(d = false), y;
case c:
return l = true, t;
case B2:
case Z:
case u:
case _:
case k:
d = false;
case v:
return t;
}
}(K, V, me, pe), S = 240 & (O = L[S][F]), O &= 15, ne[pe] = I = L[O][5], 0 < S) {
if (S == 16)
for (re = J; re < pe; re++)
ne[re] = 1;
J = -1;
}
if (L[O][6])
J == -1 && (J = pe);
else if (-1 < J) {
for (re = J; re < pe; re++)
ne[re] = I;
J = -1;
}
V[pe] == s && (ne[pe] = 0), C |= I;
}
if (l) {
for (re = 0; re < T; re++)
if (V[re] == c) {
ne[re] = y;
for (var ye = re - 1; 0 <= ye && V[ye] == g; ye--)
ne[ye] = y;
}
}
}
function X(K, ne, T) {
if (!(C < K))
if (K != 1 || y != 1 || h)
for (var V, F, I, S, L = T.length, O = 0; O < L; ) {
if (ne[O] >= K) {
for (V = O + 1; V < L && ne[V] >= K; )
V++;
for (F = O, I = V - 1; F < I; F++, I--)
S = T[F], T[F] = T[I], T[I] = S;
O = V;
}
O++;
}
else
T.reverse();
}
function Q(K) {
var ne = K.charCodeAt(0), T = ne >> 8;
return T == 0 ? 191 < ne ? i : $[ne] : T == 5 ? /[\u0591-\u05f4]/.test(K) ? a : i : T == 6 ? /[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(K) ? M : /[\u0660-\u0669\u066b-\u066c]/.test(K) ? e2 : ne == 1642 ? E : /[\u06f0-\u06f9]/.test(K) ? r : p : T == 32 && ne <= 8287 ? G[255 & ne] : T == 254 && 65136 <= ne ? p : t;
}
f.L = i, f.R = a, f.EN = r, f.ON_R = 3, f.AN = 4, f.R_H = 5, f.B = 6, f.RLE = 7, f.DOT = "·", f.doBidiReorder = function(K, ne, T) {
if (K.length < 2)
return {};
var V = K.split(""), F = new Array(V.length), I = new Array(V.length), S = [];
y = T ? 1 : 0, W(V, S, V.length, ne);
for (var L = 0; L < F.length; F[L] = L, L++)
;
for (X(2, S, F), X(1, S, F), L = 0; L < F.length - 1; L++)
ne[L] === e2 ? S[L] = f.AN : S[L] === a && (ne[L] > p && ne[L] < B2 || ne[L] === t || ne[L] === v) ? S[L] = f.ON_R : 0 < L && V[L - 1] === "ل" && /\u0622|\u0623|\u0625|\u0627/.test(V[L]) && (S[L - 1] = S[L] = f.R_H, L++);
for (V[V.length - 1] === f.DOT && (S[V.length - 1] = f.B), V[0] === "" && (S[0] = f.RLE), L = 0; L < F.length; L++)
I[L] = S[F[L]];
return { logicalFromVisual: F, bidiLevels: I };
}, f.hasBidiCharacters = function(K, ne) {
for (var T = false, V = 0; V < K.length; V++)
ne[V] = Q(K.charAt(V)), T || ne[V] != a && ne[V] != p && ne[V] != e2 || (T = true);
return T;
}, f.getVisualFromLogicalIdx = function(K, ne) {
for (var T = 0; T < ne.logicalFromVisual.length; T++)
if (ne.logicalFromVisual[T] == K)
return T;
return 0;
};
}), ace.define("ace/bidihandler", ["require", "exports", "module", "ace/lib/bidiutil", "ace/lib/lang"], function(A, f, R) {
var y = A("./lib/bidiutil"), C = A("./lib/lang"), d = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/;
function h(l) {
this.session = l, this.bidiMap = {}, this.currentRow = null, this.bidiUtil = y, this.charWidths = [], this.EOL = "¬", this.showInvisibles = true, this.isRtlDir = false, this.$isRtl = false, this.line = "", this.wrapIndent = 0, this.EOF = "¶", this.RLE = "", this.contentWidth = 0, this.fontMetrics = null, this.rtlLineOffset = 0, this.wrapOffset = 0, this.isMoveLeftOperation = false, this.seenBidi = d.test(l.getValue());
}
h.prototype.isBidiRow = function(l, n, o) {
return !!this.seenBidi && (l !== this.currentRow && (this.currentRow = l, this.updateRowLine(n, o), this.updateBidiMap()), this.bidiMap.bidiLevels);
}, h.prototype.onChange = function(l) {
this.seenBidi ? this.currentRow = null : l.action == "insert" && d.test(l.lines.join(`
`)) && (this.seenBidi = true, this.currentRow = null);
}, h.prototype.getDocumentRow = function() {
var l = 0, n = this.session.$screenRowCache;
return l = n.length && 0 <= (n = this.session.$getRowCacheIndex(n, this.currentRow)) ? this.session.$docRowCache[n] : l;
}, h.prototype.getSplitIndex = function() {
var l = 0, n = this.session.$screenRowCache;
if (n.length)
for (var o, i = this.session.$getRowCacheIndex(n, this.currentRow); 0 < this.currentRow - l && (o = this.session.$getRowCacheIndex(n, this.currentRow - l - 1)) === i; )
i = o, l++;
else
l = this.currentRow;
return l;
}, h.prototype.updateRowLine = function(l, n) {
var o, i = (l = l === void 0 ? this.getDocumentRow() : l) === this.session.getLength() - 1 ? this.EOF : this.EOL, a = (this.wrapIndent = 0, this.line = this.session.getLine(l), this.isRtlDir = this.$isRtl || this.line.charAt(0) === this.RLE, (!this.session.$useWrapMode || (l = this.session.$wrapData[l]) && (0 < (n = n === void 0 ? this.getSplitIndex() : n) && l.length ? (this.wrapIndent = l.indent, this.wrapOffset = this.wrapIndent * this.charWidths[y.L], this.line = n < l.length ? this.line.substring(l[n - 1], l[n]) : this.line.substring(l[l.length - 1])) : this.line = this.line.substring(0, l[n]), n == l.length)) && (this.line += this.showInvisibles ? i : y.DOT), this.session), r = 0;
this.line = this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g, function(e2, t) {
return e2 === " " || a.isFullWidth(e2.charCodeAt(0)) ? (o = e2 === " " ? a.getScreenTabSize(t + r) : 2, r += o - 1, C.stringRepeat(y.DOT, o)) : e2;
}), this.isRtlDir && (this.fontMetrics.$main.textContent = this.line.charAt(this.line.length - 1) == y.DOT ? this.line.substr(0, this.line.length - 1) : this.line, this.rtlLineOffset = this.contentWidth - this.fontMetrics.$main.getBoundingClientRect().width);
}, h.prototype.updateBidiMap = function() {
var l = [];
y.hasBidiCharacters(this.line, l) || this.isRtlDir ? this.bidiMap = y.doBidiReorder(this.line, l, this.isRtlDir) : this.bidiMap = {};
}, h.prototype.markAsDirty = function() {
this.currentRow = null;
}, h.prototype.updateCharacterWidths = function(l) {
var n;
this.characterWidth !== l.$characterSize.width && (this.fontMetrics = l, n = this.characterWidth = l.$characterSize.width, l = l.$measureCharWidth("ה"), this.charWidths[y.L] = this.charWidths[y.EN] = this.charWidths[y.ON_R] = n, this.charWidths[y.R] = this.charWidths[y.AN] = l, this.charWidths[y.R_H] = 0.45 * l, this.charWidths[y.B] = this.charWidths[y.RLE] = 0, this.currentRow = null);
}, h.prototype.setShowInvisibles = function(l) {
this.showInvisibles = l, this.currentRow = null;
}, h.prototype.setEolChar = function(l) {
this.EOL = l;
}, h.prototype.setContentWidth = function(l) {
this.contentWidth = l;
}, h.prototype.isRtlLine = function(l) {
return !!this.$isRtl || (l != null ? this.session.getLine(l).charAt(0) == this.RLE : this.isRtlDir);
}, h.prototype.setRtlDirection = function(l, n) {
for (var o = l.getCursorPosition(), i = l.selection.getSelectionAnchor().row; i <= o.row; i++)
n || l.session.getLine(i).charAt(0) !== l.session.$bidiHandler.RLE ? n && l.session.getLine(i).charAt(0) !== l.session.$bidiHandler.RLE && l.session.doc.insert({ column: 0, row: i }, l.session.$bidiHandler.RLE) : l.session.doc.removeInLine(i, 0, 1);
}, h.prototype.getPosLeft = function(l) {
l -= this.wrapIndent;
var n = this.line.charAt(0) === this.RLE ? 1 : 0, o = n < l ? this.session.getOverwrite() ? l : l - 1 : n, i = y.getVisualFromLogicalIdx(o, this.bidiMap), a = this.bidiMap.bidiLevels, r = 0;
!this.session.getOverwrite() && l <= n && a[i] % 2 != 0 && i++;
for (var e2 = 0; e2 < i; e2++)
r += this.charWidths[a[e2]];
return !this.session.getOverwrite() && n < l && a[i] % 2 == 0 && (r += this.charWidths[a[i]]), this.wrapIndent && (r += this.isRtlDir ? -1 * this.wrapOffset : this.wrapOffset), this.isRtlDir && (r += this.rtlLineOffset), r;
}, h.prototype.getSelections = function(l, n) {
var o, i = this.bidiMap, a = i.bidiLevels, r = [], e2 = 0, t = Math.min(l, n) - this.wrapIndent, s = Math.max(l, n) - this.wrapIndent, c = false, p = false, g = 0;
this.wrapIndent && (e2 += this.isRtlDir ? -1 * this.wrapOffset : this.wrapOffset);
for (var b, w = 0; w < a.length; w++)
b = i.logicalFromVisual[w], o = a[w], (c = t <= b && b < s) && !p ? g = e2 : !c && p && r.push({ left: g, width: e2 - g }), e2 += this.charWidths[o], p = c;
if (c && w === a.length && r.push({ left: g, width: e2 - g }), this.isRtlDir)
for (var E = 0; E < r.length; E++)
r[E].left += this.rtlLineOffset;
return r;
}, h.prototype.offsetToCol = function(o) {
this.isRtlDir && (o -= this.rtlLineOffset);
var n = 0, o = Math.max(o, 0), i = 0, a = 0, r = this.bidiMap.bidiLevels, e2 = this.charWidths[r[a]];
for (this.wrapIndent && (o -= this.isRtlDir ? -1 * this.wrapOffset : this.wrapOffset); i + e2 / 2 < o; ) {
if (i += e2, a === r.length - 1) {
e2 = 0;
break;
}
e2 = this.charWidths[r[++a]];
}
return (n = 0 < a && r[a - 1] % 2 != 0 && r[a] % 2 == 0 ? (o < i && a--, this.bidiMap.logicalFromVisual[a]) : 0 < a && r[a - 1] % 2 == 0 && r[a] % 2 != 0 ? 1 + (i < o ? this.bidiMap.logicalFromVisual[a] : this.bidiMap.logicalFromVisual[a - 1]) : this.isRtlDir && a === r.length - 1 && e2 === 0 && r[a - 1] % 2 == 0 || !this.isRtlDir && a === 0 && r[a] % 2 != 0 ? 1 + this.bidiMap.logicalFromVisual[a] : (0 < a && r[a - 1] % 2 != 0 && e2 !== 0 && a--, this.bidiMap.logicalFromVisual[a])) === 0 && this.isRtlDir && n++, n + this.wrapIndent;
}, f.BidiHandler = h;
}), ace.define("ace/selection", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/lib/event_emitter", "ace/range"], function(l, f, R) {
var y = l("./lib/oop"), C = l("./lib/lang"), d = l("./lib/event_emitter").EventEmitter, h = l("./range").Range, l = (n.prototype.isEmpty = function() {
return this.$isEmpty || this.anchor.row == this.lead.row && this.anchor.column == this.lead.column;
}, n.prototype.isMultiLine = function() {
return !this.$isEmpty && this.anchor.row != this.cursor.row;
}, n.prototype.getCursor = function() {
return this.lead.getPosition();
}, n.prototype.setAnchor = function(o, i) {
this.$isEmpty = false, this.anchor.setPosition(o, i);
}, n.prototype.getAnchor = function() {
return this.$isEmpty ? this.getSelectionLead() : this.anchor.getPosition();
}, n.prototype.getSelectionLead = function() {
return this.lead.getPosition();
}, n.prototype.isBackwards = function() {
var o = this.anchor, i = this.lead;
return o.row > i.row || o.row == i.row && o.column > i.column;
}, n.prototype.getRange = function() {
var o = this.anchor, i = this.lead;
return this.$isEmpty ? h.fromPoints(i, i) : this.isBackwards() ? h.fromPoints(i, o) : h.fromPoints(o, i);
}, n.prototype.clearSelection = function() {
this.$isEmpty || (this.$isEmpty = true, this._emit("changeSelection"));
}, n.prototype.selectAll = function() {
this.$setSelection(0, 0, Number.MAX_VALUE, Number.MAX_VALUE);
}, n.prototype.setRange = function(o, r) {
var a = r ? o.end : o.start, r = r ? o.start : o.end;
this.$setSelection(a.row, a.column, r.row, r.column);
}, n.prototype.$setSelection = function(o, i, a, r) {
var e2, t;
!this.$silent && (e2 = this.$isEmpty, t = this.inMultiSelectMode, this.$silent = true, this.$cursorChanged = this.$anchorChanged = false, this.anchor.setPosition(o, i), this.cursor.setPosition(a, r), this.$isEmpty = !h.comparePoints(this.anchor, this.cursor), this.$silent = false, this.$cursorChanged && this._emit("changeCursor"), this.$cursorChanged || this.$anchorChanged || e2 != this.$isEmpty || t) && this._emit("changeSelection");
}, n.prototype.$moveSelection = function(o) {
var i = this.lead;
this.$isEmpty && this.setSelectionAnchor(i.row, i.column), o.call(this);
}, n.prototype.selectTo = function(o, i) {
this.$moveSelection(function() {
this.moveCursorTo(o, i);
});
}, n.prototype.selectToPosition = function(o) {
this.$moveSelection(function() {
this.moveCursorToPosition(o);
});
}, n.prototype.moveTo = function(o, i) {
this.clearSelection(), this.moveCursorTo(o, i);
}, n.prototype.moveToPosition = function(o) {
this.clearSelection(), this.moveCursorToPosition(o);
}, n.prototype.selectUp = function() {
this.$moveSelection(this.moveCursorUp);
}, n.prototype.selectDown = function() {
this.$moveSelection(this.moveCursorDown);
}, n.prototype.selectRight = function() {
this.$moveSelection(this.moveCursorRight);
}, n.prototype.selectLeft = function() {
this.$moveSelection(this.moveCursorLeft);
}, n.prototype.selectLineStart = function() {
this.$moveSelection(this.moveCursorLineStart);
}, n.prototype.selectLineEnd = function() {
this.$moveSelection(this.moveCursorLineEnd);
}, n.prototype.selectFileEnd = function() {
this.$moveSelection(this.moveCursorFileEnd);
}, n.prototype.selectFileStart = function() {
this.$moveSelection(this.moveCursorFileStart);
}, n.prototype.selectWordRight = function() {
this.$moveSelection(this.moveCursorWordRight);
}, n.prototype.selectWordLeft = function() {
this.$moveSelection(this.moveCursorWordLeft);
}, n.prototype.getWordRange = function(o, i) {
var a;
return i === void 0 && (o = (a = o || this.lead).row, i = a.column), this.session.getWordRange(o, i);
}, n.prototype.selectWord = function() {
this.setSelectionRange(this.getWordRange());
}, n.prototype.selectAWord = function() {
var o = this.getCursor(), o = this.session.getAWordRange(o.row, o.column);
this.setSelectionRange(o);
}, n.prototype.getLineRange = function(a, i) {
var a = typeof a == "number" ? a : this.lead.row, r = this.session.getFoldLine(a), r = r ? (a = r.start.row, r.end.row) : a;
return i === true ? new h(a, 0, r, this.session.getLine(r).length) : new h(a, 0, r + 1, 0);
}, n.prototype.selectLine = function() {
this.setSelectionRange(this.getLineRange());
}, n.prototype.moveCursorUp = function() {
this.moveCursorBy(-1, 0);
}, n.prototype.moveCursorDown = function() {
this.moveCursorBy(1, 0);
}, n.prototype.wouldMoveIntoSoftTab = function(o, i, a) {
var r = o.column, e2 = o.column + i;
return a < 0 && (r = o.column - i, e2 = o.column), this.session.isTabStop(o) && this.doc.getLine(o.row).slice(r, e2).split(" ").length - 1 == i;
}, n.prototype.moveCursorLeft = function() {
var o, i = this.lead.getPosition();
(o = this.session.getFoldAt(i.row, i.column, -1)) ? this.moveCursorTo(o.start.row, o.start.column) : i.column === 0 ? 0 < i.row && this.moveCursorTo(i.row - 1, this.doc.getLine(i.row - 1).length) : (o = this.session.getTabSize(), this.wouldMoveIntoSoftTab(i, o, -1) && !this.session.getNavigateWithinSoftTabs() ? this.moveCursorBy(0, -o) : this.moveCursorBy(0, -1));
}, n.prototype.moveCursorRight = function() {
var o, i = this.lead.getPosition();
(o = this.session.getFoldAt(i.row, i.column, 1)) ? this.moveCursorTo(o.end.row, o.end.column) : this.lead.column == this.doc.getLine(this.lead.row).length ? this.lead.row < this.doc.getLength() - 1 && this.moveCursorTo(this.lead.row + 1, 0) : (o = this.session.getTabSize(), i = this.lead, this.wouldMoveIntoSoftTab(i, o, 1) && !this.session.getNavigateWithinSoftTabs() ? this.moveCursorBy(0, o) : this.moveCursorBy(0, 1));
}, n.prototype.moveCursorLineStart = function() {
var a = this.lead.row, o = this.lead.column, i = this.session.documentToScreenRow(a, o), i = this.session.screenToDocumentPosition(i, 0), a = this.session.getDisplayLine(a, null, i.row, i.column).match(/^\s*/);
a[0].length == o || this.session.$useEmacsStyleLineStart || (i.column += a[0].length), this.moveCursorToPosition(i);
}, n.prototype.moveCursorLineEnd = function() {
var o, i = this.lead, i = this.session.getDocumentLastRowColumnPosition(i.row, i.column);
this.lead.column == i.column && (o = this.session.getLine(i.row), i.column == o.length) && 0 < (o = o.search(/\s+$/)) && (i.column = o), this.moveCursorTo(i.row, i.column);
}, n.prototype.moveCursorFileEnd = function() {
var o = this.doc.getLength() - 1, i = this.doc.getLine(o).length;
this.moveCursorTo(o, i);
}, n.prototype.moveCursorFileStart = function() {
this.moveCursorTo(0, 0);
}, n.prototype.moveCursorLongWordRight = function() {
var o = this.lead.row, i = this.lead.column, a = this.doc.getLine(o), r = a.substring(i), e2 = (this.session.nonTokenRe.lastIndex = 0, this.session.tokenRe.lastIndex = 0, this.session.getFoldAt(o, i, 1));
e2 ? this.moveCursorTo(e2.end.row, e2.end.column) : (this.session.nonTokenRe.exec(r) && (i += this.session.nonTokenRe.lastIndex, this.session.nonTokenRe.lastIndex = 0, r = a.substring(i)), i >= a.length ? (this.moveCursorTo(o, a.length), this.moveCursorRight(), o < this.doc.getLength() - 1 && this.moveCursorWordRight()) : (this.session.tokenRe.exec(r) && (i += this.session.tokenRe.lastIndex, this.session.tokenRe.lastIndex = 0), this.moveCursorTo(o, i)));
}, n.prototype.moveCursorLongWordLeft = function() {
var o, i = this.lead.row, a = this.lead.column;
(o = this.session.getFoldAt(i, a, -1)) ? this.moveCursorTo(o.start.row, o.start.column) : ((o = this.session.getFoldStringAt(i, a, -1)) == null && (o = this.doc.getLine(i).substring(0, a)), o = C.stringReverse(o), this.session.nonTokenRe.lastIndex = 0, this.session.tokenRe.lastIndex = 0, this.session.nonTokenRe.exec(o) && (a -= this.session.nonTokenRe.lastIndex, o = o.slice(this.session.nonTokenRe.lastIndex), this.session.nonTokenRe.lastIndex = 0), a <= 0 ? (this.moveCursorTo(i, 0), this.moveCursorLeft(), 0 < i && this.moveCursorWordLeft()) : (this.session.tokenRe.exec(o) && (a -= this.session.tokenRe.lastIndex, this.session.tokenRe.lastIndex = 0), this.moveCursorTo(i, a)));
}, n.prototype.$shortWordEndIndex = function(o) {
var i, a = 0, r = /\s/, e2 = this.session.tokenRe;
if (e2.lastIndex = 0, this.session.tokenRe.exec(o))
a = this.session.tokenRe.lastIndex;
else {
for (; (i = o[a]) && r.test(i); )
a++;
if (a < 1) {
for (e2.lastIndex = 0; (i = o[a]) && !e2.test(i); )
if (e2.lastIndex = 0, a++, r.test(i)) {
if (2 < a) {
a--;
break;
}
for (; (i = o[a]) && r.test(i); )
a++;
if (2 < a)
break;
}
}
}
return e2.lastIndex = 0, a;
}, n.prototype.moveCursorShortWordRight = function() {
var o = this.lead.row, i = this.lead.column, a = this.doc.getLine(o), r = a.substring(i), e2 = this.session.getFoldAt(o, i, 1);
if (e2)
return this.moveCursorTo(e2.end.row, e2.end.column);
if (i == a.length) {
for (var t = this.doc.getLength(); r = this.doc.getLine(++o), o < t && /^\s*$/.test(r); )
;
/^\s+/.test(r) || (r = ""), i = 0;
}
e2 = this.$shortWordEndIndex(r), this.moveCursorTo(o, i + e2);
}, n.prototype.moveCursorShortWordLeft = function() {
var o = this.lead.row, i = this.lead.column;
if (r = this.session.getFoldAt(o, i, -1))
return this.moveCursorTo(r.start.row, r.start.column);
var a = this.session.getLine(o).substring(0, i);
if (i === 0) {
for (; a = this.doc.getLine(--o), 0 < o && /^\s*$/.test(a); )
;
i = a.length, /\s+$/.test(a) || (a = "");
}
var r = C.stringReverse(a), r = this.$shortWordEndIndex(r);
return this.moveCursorTo(o, i - r);
}, n.prototype.moveCursorWordRight = function() {
this.session.$selectLongWords ? this.moveCursorLongWordRight() : this.moveCursorShortWordRight();
}, n.prototype.moveCursorWordLeft = function() {
this.session.$selectLongWords ? this.moveCursorLongWordLeft() : this.moveCursorShortWordLeft();
}, n.prototype.moveCursorBy = function(o, i) {
var a, r = this.session.documentToScreenPosition(this.lead.row, this.lead.column), e2 = (i === 0 && (o !== 0 && (this.session.$bidiHandler.isBidiRow(r.row, this.lead.row) ? (a = this.session.$bidiHandler.getPosLeft(r.column), r.column = Math.round(a / this.session.$bidiHandler.charWidths[0])) : a = r.column * this.session.$bidiHandler.charWidths[0]), this.$desiredColumn ? r.column = this.$desiredColumn : this.$desiredColumn = r.column), o != 0 && this.session.lineWidgets && this.session.lineWidgets[this.lead.row] && (e2 = this.session.lineWidgets[this.lead.row], o < 0 ? o -= e2.rowsAbove || 0 : 0 < o && (o += e2.rowCount - (e2.rowsAbove || 0))), this.session.screenToDocumentPosition(r.row + o, r.column, a));
o !== 0 && i === 0 && e2.row === this.lead.row && (e2.column, this.lead.column), this.moveCursorTo(e2.row, e2.column + i, i === 0);
}, n.prototype.moveCursorToPosition = function(o) {
this.moveCursorTo(o.row, o.column);
}, n.prototype.moveCursorTo = function(o, i, a) {
var r = this.session.getFoldAt(o, i, 1), r = (r && (o = r.start.row, i = r.start.column), this.$keepDesiredColumnOnChange = true, this.session.getLine(o));
/[\uDC00-\uDFFF]/.test(r.charAt(i)) && r.charAt(i - 1) && (this.lead.row == o && this.lead.column == i + 1 ? i -= 1 : i += 1), this.lead.setPosition(o, i), this.$keepDesiredColumnOnChange = false, a || (this.$desiredColumn = null);
}, n.prototype.moveCursorToScreen = function(o, i, a) {
o = this.session.screenToDocumentPosition(o, i), this.moveCursorTo(o.row, o.column, a);
}, n.prototype.detach = function() {
this.lead.detach(), this.anchor.detach();
}, n.prototype.fromOrientedRange = function(o) {
this.setSelectionRange(o, o.cursor == o.start), this.$desiredColumn = o.desiredColumn || this.$desiredColumn;
}, n.prototype.toOrientedRange = function(o) {
var i = this.getRange();
return o ? (o.start.column = i.start.column, o.start.row = i.start.row, o.end.column = i.end.column, o.end.row = i.end.row) : o = i, o.cursor = this.isBackwards() ? o.start : o.end, o.desiredColumn = this.$desiredColumn, o;
}, n.prototype.getRangeOfMovements = function(o) {
var i = this.getCursor();
try {
o(this);
var a = this.getCursor();
return h.fromPoints(i, a);
} catch {
return h.fromPoints(i, i);
} finally {
this.moveCursorToPosition(i);
}
}, n.prototype.toJSON = function() {
var o;
return this.rangeCount ? o = this.ranges.map(function(i) {
var a = i.clone();
return a.isBackwards = i.cursor == i.start, a;
}) : (o = this.getRange()).isBackwards = this.isBackwards(), o;
}, n.prototype.fromJSON = function(o) {
if (o.start == null) {
if (this.rangeList && 1 < o.length) {
this.toSingleRange(o[0]);
for (var i = o.length; i--; ) {
var a = h.fromPoints(o[i].start, o[i].end);
o[i].isBackwards && (a.cursor = a.start), this.addRange(a, true);
}
return;
}
o = o[0];
}
this.rangeList && this.toSingleRange(o), this.setSelectionRange(o, o.isBackwards);
}, n.prototype.isEqual = function(o) {
if ((o.length || this.rangeCount) && o.length != this.rangeCount)
return false;
if (!o.length || !this.ranges)
return this.getRange().isEqual(o);
for (var i = this.ranges.length; i--; )
if (!this.ranges[i].isEqual(o[i]))
return false;
return true;
}, n);
function n(o) {
this.session = o, this.doc = o.getDocument(), this.clearSelection(), this.cursor = this.lead = this.doc.createAnchor(0, 0), this.anchor = this.doc.createAnchor(0, 0), this.$silent = false;
var i = this;
this.cursor.on("change", function(a) {
i.$cursorChanged = true, i.$silent || i._emit("changeCursor"), i.$isEmpty || i.$silent || i._emit("changeSelection"), i.$keepDesiredColumnOnChange || a.old.column == a.value.column || (i.$desiredColumn = null);
}), this.anchor.on("change", function() {
i.$anchorChanged = true, i.$isEmpty || i.$silent || i._emit("changeSelection");
});
}
l.prototype.setSelectionAnchor = l.prototype.setAnchor, l.prototype.getSelectionAnchor = l.prototype.getAnchor, l.prototype.setSelectionRange = l.prototype.setRange, y.implement(l.prototype, d), f.Selection = l;
}), ace.define("ace/tokenizer", ["require", "exports", "module", "ace/lib/report_error"], function(y, f, R) {
var y = y("./lib/report_error").reportError, C = 2e3, d = (h.prototype.$setMaxTokenCount = function(l) {
C = 0 | l;
}, h.prototype.$applyToken = function(l) {
var n = this.splitRegex.exec(l).slice(1), o = this.token.apply(this, n);
if (typeof o == "string")
return [{ type: o, value: l }];
for (var i = [], a = 0, r = o.length; a < r; a++)
n[a] && (i[i.length] = { type: o[a], value: n[a] });
return i;
}, h.prototype.$arrayTokens = function(l) {
if (!l)
return [];
var n = this.splitRegex.exec(l);
if (!n)
return "text";
for (var o = [], i = this.tokenArray, a = 0, r = i.length; a < r; a++)
n[a + 1] && (o[o.length] = { type: i[a], value: n[a + 1] });
return o;
}, h.prototype.removeCapturingGroups = function(l) {
return l.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g, function(n, o) {
return o ? "(?:" : n;
});
}, h.prototype.createSplitterRegexp = function(l, n) {
var o, i, a;
return (l = (l = l.indexOf("(?=") != -1 && (o = 0, i = false, a = {}, l.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function(r, e2, t, s, c, p) {
return i ? i = c != "]" : c ? i = true : s ? (o == a.stack && (a.end = p + 1, a.stack = -1), o--) : t && (o++, t.length != 1) && (a.stack = o, a.start = p), r;
}), a.end != null) && /^\)*$/.test(l.substr(a.end)) ? l.substring(0, a.start) + l.substr(a.end) : l).charAt(0) != "^" ? "^" + l : l).charAt(l.length - 1) != "$" && (l += "$"), new RegExp(l, (n || "").replace("g", ""));
}, h.prototype.getLineTokens = function(l, n) {
n && typeof n != "string" ? (n = (o = n.slice(0))[0]) === "#tmp" && (o.shift(), n = o.shift()) : o = [];
for (var o, i, a = n || "start", r = (r = this.states[a]) || this.states[a = "start"], e2 = this.matchMappings[a], t = this.regExps[a], s = [], c = t.lastIndex = 0, p = 0, g = { type: null, value: "" }; i = t.exec(l); ) {
var b, w = e2.defaultToken, E = null, M = i[0], B2 = t.lastIndex;
B2 - M.length > c && (b = l.substring(c, B2 - M.length), g.type == w ? g.value += b : (g.type && s.push(g), g = { type: w, value: b }));
for (var Z = 0; Z < i.length - 2; Z++)
if (i[Z + 1] !== void 0) {
w = (E = r[e2[Z]]).onMatch ? E.onMatch(M, a, o, l) : E.token, E.next && (a = typeof E.next == "string" ? E.next : E.next(a, o), (r = this.states[a]) || (this.reportError("state doesn't exist", a), r = this.states[a = "start"]), e2 = this.matchMappings[a], (t = this.regExps[a]).lastIndex = c = B2), E.consumeLineEnd && (c = B2);
break;
}
if (M) {
if (typeof w == "string")
E && E.merge === false || g.type !== w ? (g.type && s.push(g), g = { type: w, value: M }) : g.value += M;
else if (w)
for (g.type && s.push(g), g = { type: null, value: "" }, Z = 0; Z < w.length; Z++)
s.push(w[Z]);
}
if (c == l.length)
break;
if (c = B2, p++ > C) {
for (p > 2 * l.length && this.reportError("infinite loop with in ace tokenizer", { startState: n, line: l }); c < l.length; )
g.type && s.push(g), g = { value: l.substring(c, c += 500), type: "overflow" };
a = "start", o = [];
break;
}
}
return g.type && s.push(g), 1 < o.length && o[0] !== a && o.unshift("#tmp", a), { tokens: s, state: o.length ? o : a };
}, h);
function h(l) {
for (var n in this.states = l, this.regExps = {}, this.matchMappings = {}, this.states) {
for (var o = this.states[n], i = [], a = 0, r = this.matchMappings[n] = { defaultToken: "text" }, e2 = "g", t = [], s = 0; s < o.length; s++) {
var c, p, g = o[s];
g.defaultToken && (r.defaultToken = g.defaultToken), g.caseInsensitive && e2.indexOf("i") === -1 && (e2 += "i"), g.unicode && e2.indexOf("u") === -1 && (e2 += "u"), g.regex == null || (g.regex instanceof RegExp && (g.regex = g.regex.toString().slice(1, -1)), c = g.regex, p = new RegExp("(?:(" + c + ")|(.))").exec("a").length - 2, Array.isArray(g.token) ? g.token.length == 1 || p == 1 ? g.token = g.token[0] : p - 1 != g.token.length ? (this.reportError("number of classes and regexp groups doesn't match", { rule: g, groupCount: p - 1 }), g.token = g.token[0]) : (g.tokenArray = g.token, g.token = null, g.onMatch = this.$arrayTokens) : typeof g.token != "function" || g.onMatch || (g.onMatch = 1 < p ? this.$applyToken : g.token), 1 < p && (c = /\\\d/.test(g.regex) ? g.regex.replace(/\\([0-9]+)/g, function(b, w) {
return "\\" + (parseInt(w, 10) + a + 1);
}) : (p = 1, this.removeCapturingGroups(g.regex)), g.splitRegex || typeof g.token == "string" || t.push(g)), r[a] = s, a += p, i.push(c), g.onMatch) || (g.onMatch = null);
}
i.length || (r[0] = 0, i.push("$")), t.forEach(function(b) {
b.splitRegex = this.createSplitterRegexp(b.regex, e2);
}, this), this.regExps[n] = new RegExp("(" + i.join(")|(") + ")|($)", e2);
}
}
d.prototype.reportError = y, f.Tokenizer = d;
}), ace.define("ace/mode/text_highlight_rules", ["require", "exports", "module", "ace/lib/deep_copy"], function(A, f, R) {
function y() {
this.$rules = { start: [{ token: "empty_line", regex: "^$" }, { defaultToken: "text" }] };
}
var C = A("../lib/deep_copy").deepCopy;
(function() {
this.addRules = function(l, n) {
if (n)
for (var o in l) {
for (var i = l[o], a = 0; a < i.length; a++) {
var r = i[a];
(r.next || r.onMatch) && (typeof r.next == "string" && r.next.indexOf(n) !== 0 && (r.next = n + r.next), r.nextState) && r.nextState.indexOf(n) !== 0 && (r.nextState = n + r.nextState);
}
this.$rules[n + o] = i;
}
else
for (var o in l)
this.$rules[o] = l[o];
}, this.getRules = function() {
return this.$rules;
}, this.embedRules = function(l, n, o, i, a) {
if (l = typeof l == "function" ? new l().getRules() : l, i)
for (var r = 0; r < i.length; r++)
i[r] = n + i[r];
else
for (var e2 in i = [], l)
i.push(n + e2);
if (this.addRules(l, n), o)
for (var t = Array.prototype[a ? "push" : "unshift"], r = 0; r < i.length; r++)
t.apply(this.$rules[i[r]], C(o));
this.$embeds || (this.$embeds = []), this.$embeds.push(n);
}, this.getEmbeds = function() {
return this.$embeds;
};
function d(l, n) {
return l == "start" && !n.length || n.unshift(this.nextState, l), this.nextState;
}
function h(l, n) {
return n.shift(), n.shift() || "start";
}
this.normalizeRules = function() {
var l = 0, n = this.$rules;
Object.keys(n).forEach(function o(i) {
var a = n[i];
a.processed = true;
for (var r = 0; r < a.length; r++) {
var e2 = a[r], t = null, s = (Array.isArray(e2) && (t = e2, e2 = {}), !e2.regex && e2.start && (e2.regex = e2.start, e2.next || (e2.next = []), e2.next.push({ defaultToken: e2.token }, { token: e2.token + ".end", regex: e2.end || e2.start, next: "pop" }), e2.token = e2.token + ".start", e2.push = true), e2.next || e2.push);
if (s && Array.isArray(s) ? ((p = e2.stateName) || (typeof (p = e2.token) != "string" && (p = p[0] || ""), n[p] && (p += l++)), n[p] = s, o(e2.next = p)) : s == "pop" && (e2.next = h), e2.push && (e2.nextState = e2.next || e2.push, e2.next = d, delete e2.push), e2.rules)
for (var c in e2.rules)
n[c] ? n[c].push && n[c].push.apply(n[c], e2.rules[c]) : n[c] = e2.rules[c];
var p = typeof e2 == "string" ? e2 : e2.include;
p && (p === "$self" && (p = "start"), t = Array.isArray(p) ? p.map(function(g) {
return n[g];
}) : n[p]), t && (s = [r, 1].concat(t), e2.noEscape && (s = s.filter(function(g) {
return !g.next;
})), a.splice.apply(a, s), r--), e2.keywordMap && (e2.token = this.createKeywordMapper(e2.keywordMap, e2.defaultToken || "text", e2.caseInsensitive), delete e2.defaultToken);
}
}, this);
}, this.createKeywordMapper = function(l, n, o, i) {
var a = /* @__PURE__ */ Object.create(null);
return this.$keywordList = [], Object.keys(l).forEach(function(r) {
for (var e2 = l[r].split(i || "|"), t = e2.length; t--; ) {
var s = e2[t];
this.$keywordList.push(s), o && (s = s.toLowerCase()), a[s] = r;
}
}, this), l = null, o ? function(r) {
return a[r.toLowerCase()] || n;
} : function(r) {
return a[r] || n;
};
}, this.getKeywords = function() {
return this.$keywords;
};
}).call(y.prototype), f.TextHighlightRules = y;
}), ace.define("ace/mode/behaviour", ["require", "exports", "module"], function(A, f, R) {
function y() {
this.$behaviours = {};
}
(function() {
this.add = function(C, d, h) {
switch (void 0) {
case this.$behaviours:
this.$behaviours = {};
case this.$behaviours[C]:
this.$behaviours[C] = {};
}
this.$behaviours[C][d] = h;
}, this.addBehaviours = function(C) {
for (var d in C)
for (var h in C[d])
this.add(d, h, C[d][h]);
}, this.remove = function(C) {
this.$behaviours && this.$behaviours[C] && delete this.$behaviours[C];
}, this.inherit = function(C, d) {
C = (typeof C == "function" ? new C() : C).getBehaviours(d), this.addBehaviours(C);
}, this.getBehaviours = function(C) {
if (C) {
for (var d = {}, h = 0; h < C.length; h++)
this.$behaviours[C[h]] && (d[C[h]] = this.$behaviours[C[h]]);
return d;
}
return this.$behaviours;
};
}).call(y.prototype), f.Behaviour = y;
}), ace.define("ace/token_iterator", ["require", "exports", "module", "ace/range"], function(A, f, R) {
var y = A("./range").Range;
function C(d, h, l) {
this.$session = d, this.$row = h, this.$rowTokens = d.getTokens(h), d = d.getTokenAt(h, l), this.$tokenIndex = d ? d.index : -1;
}
C.prototype.stepBackward = function() {
for (--this.$tokenIndex; this.$tokenIndex < 0; ) {
if (--this.$row, this.$row < 0)
return this.$row = 0, null;
this.$rowTokens = this.$session.getTokens(this.$row), this.$tokenIndex = this.$rowTokens.length - 1;
}
return this.$rowTokens[this.$tokenIndex];
}, C.prototype.stepForward = function() {
var d;
for (this.$tokenIndex += 1; this.$tokenIndex >= this.$rowTokens.length; ) {
if (this.$row += 1, d = d || this.$session.getLength(), this.$row >= d)
return this.$row = d - 1, null;
this.$rowTokens = this.$session.getTokens(this.$row), this.$tokenIndex = 0;
}
return this.$rowTokens[this.$tokenIndex];
}, C.prototype.getCurrentToken = function() {
return this.$rowTokens[this.$tokenIndex];
}, C.prototype.getCurrentTokenRow = function() {
return this.$row;
}, C.prototype.getCurrentTokenColumn = function() {
var d = this.$rowTokens, h = this.$tokenIndex, l = d[h].start;
if (l === void 0)
for (l = 0; 0 < h; )
l += d[--h].value.length;
return l;
}, C.prototype.getCurrentTokenPosition = function() {
return { row: this.$row, column: this.getCurrentTokenColumn() };
}, C.prototype.getCurrentTokenRange = function() {
var d = this.$rowTokens[this.$tokenIndex], h = this.getCurrentTokenColumn();
return new y(this.$row, h, this.$row, h + d.value.length);
}, f.TokenIterator = C;
}), ace.define("ace/mode/behaviour/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function(A, f, R) {
function y(s) {
var c = -1;
if ((e2 = s.multiSelect && (c = s.selection.index, e2.rangeCount != s.multiSelect.rangeCount) ? { rangeCount: s.multiSelect.rangeCount } : e2)[c])
return h = e2[c];
h = e2[c] = { autoInsertedBrackets: 0, autoInsertedRow: -1, autoInsertedLineEnd: "", maybeInsertedBrackets: 0, maybeInsertedRow: -1, maybeInsertedLineStart: "", maybeInsertedLineEnd: "" };
}
function C(s, c, p, g) {
var b = s.end.row - s.start.row;
return { text: p + c + g, selection: [0, s.start.column + 1, b, s.end.column + (b ? 0 : 1)] };
}
function d(s) {
s = s || {}, this.add("braces", "insertion", function(c, p, g, b, w) {
var E = g.getCursorPosition(), M = b.doc.getLine(E.row);
if (w == "{")
return y(g), Z = g.getSelectionRange(), (k = b.doc.getTextRange(Z)) !== "" && k !== "{" && g.getWrapBehavioursEnabled() ? C(Z, k, "{", "}") : d.isSaneInsertion(g, b) ? /[\]\}\)]/.test(M[E.column]) || g.inMultiSelectMode || s.braces ? (d.recordAutoInsert(g, b, "}"), { text: "{}", selection: [1, 1] }) : (d.recordMaybeInsert(g, b, "{"), { text: "{", selection: [1, 1] }) : void 0;
if (w == "}") {
y(g);
var B2 = M.substring(E.column, E.column + 1);
if (B2 == "}" && b.$findOpeningBracket("}", { column: E.column + 1, row: E.row }) !== null && d.isAutoInsertedClosing(E, M, w))
return d.popAutoInsertedClosing(), { text: "", selection: [1, 1] };
} else {
if (w == `
` || w == `\r
`) {
y(g);
var Z = "";
if (d.isMaybeInsertedClosing(E, M) && (Z = i.stringRepeat("}", h.maybeInsertedBrackets), d.clearMaybeInsertedClosing()), (B2 = M.substring(E.column, E.column + 1)) === "}") {
var k = b.findMatchingBracket({ row: E.row, column: E.column + 1 }, "}");
if (!k)
return null;
var u = this.$getIndent(b.getLine(k.row));
} else {
if (!Z)
return void d.clearMaybeInsertedClosing();
u = this.$getIndent(M);
}
return w = u + b.getTabString(), { text: `
` + w + `
` + u + Z, selection: [1, w.length, 1, w.length] };
}
d.clearMaybeInsertedClosing();
}
}), this.add("braces", "deletion", function(c, p, g, b, w) {
var E = b.doc.getTextRange(w);
if (!w.isMultiLine() && E == "{") {
if (y(g), b.doc.getLine(w.start.row).substring(w.end.column, w.end.column + 1) == "}")
return w.end.column++, w;
h.maybeInsertedBrackets--;
}
}), this.add("parens", "insertion", function(c, p, g, b, w) {
if (w == "(")
return y(g), E = g.getSelectionRange(), (M = b.doc.getTextRange(E)) !== "" && g.getWrapBehavioursEnabled() ? C(E, M, "(", ")") : d.isSaneInsertion(g, b) ? (d.recordAutoInsert(g, b, ")"), { text: "()", selection: [1, 1] }) : void 0;
if (w == ")") {
y(g);
var E = g.getCursorPosition(), M = b.doc.getLine(E.row), g = M.substring(E.column, E.column + 1);
if (g == ")" && b.$findOpeningBracket(")", { column: E.column + 1, row: E.row }) !== null && d.isAutoInsertedClosing(E, M, w))
return d.popAutoInsertedClosing(), { text: "", selection: [1, 1] };
}
}), this.add("parens", "deletion", function(c, p, g, b, w) {
var E = b.doc.getTextRange(w);
if (!w.isMultiLine() && E == "(" && (y(g), b.doc.getLine(w.start.row).substring(w.start.column + 1, w.start.column + 2) == ")"))
return w.end.column++, w;
}), this.add("brackets", "insertion", function(c, p, g, b, w) {
if (w == "[")
return y(g), E = g.getSelectionRange(), (M = b.doc.getTextRange(E)) !== "" && g.getWrapBehavioursEnabled() ? C(E, M, "[", "]") : d.isSaneInsertion(g, b) ? (d.recordAutoInsert(g, b, "]"), { text: "[]", selection: [1, 1] }) : void 0;
if (w == "]") {
y(g);
var E = g.getCursorPosition(), M = b.doc.getLine(E.row), g = M.substring(E.column, E.column + 1);
if (g == "]" && b.$findOpeningBracket("]", { column: E.column + 1, row: E.row }) !== null && d.isAutoInsertedClosing(E, M, w))
return d.popAutoInsertedClosing(), { text: "", selection: [1, 1] };
}
}), this.add("brackets", "deletion", function(c, p, g, b, w) {
var E = b.doc.getTextRange(w);
if (!w.isMultiLine() && E == "[" && (y(g), b.doc.getLine(w.start.row).substring(w.start.column + 1, w.start.column + 2) == "]"))
return w.end.column++, w;
}), this.add("string_dquotes", "insertion", function(c, p, g, b, w) {
var E = b.$mode.$quotes || t;
if (w.length == 1 && E[w] && (!this.lineCommentStart || this.lineCommentStart.indexOf(w) == -1)) {
y(g);
var M = g.getSelectionRange(), B2 = b.doc.getTextRange(M);
if (!(B2 === "" || B2.length == 1 && E[B2]) && g.getWrapBehavioursEnabled())
return C(M, B2, w, w);
if (!B2) {
var E = g.getCursorPosition(), M = b.doc.getLine(E.row), B2 = M.substring(E.column - 1, E.column), g = M.substring(E.column, E.column + 1), u = b.getTokenAt(E.row, E.column), Z = b.getTokenAt(E.row, E.column + 1);
if (B2 == "\\" && u && /escape/.test(u.type))
return null;
var k, u = u && /string|escape/.test(u.type), _ = !Z || /string|escape/.test(Z.type);
if (g == w)
(k = u !== _) && /string\.end/.test(Z.type) && (k = false);
else {
if (u && !_ || u && _ || (Z = b.$mode.tokenRe, u = (Z.lastIndex = 0, Z.test(B2)), _ = (Z.lastIndex = 0, Z.test(g)), b = b.$mode.$pairQuotesAfter, !(b && b[w] && b[w].test(B2)) && u || _) || g && !/[\s;,.})\]\\]/.test(g) || (b = M[E.column - 2], B2 == w && (b == w || Z.test(b))))
return null;
k = true;
}
return { text: k ? w + w : "", selection: [1, 1] };
}
}
}), this.add("string_dquotes", "deletion", function(c, p, g, b, w) {
var E = b.$mode.$quotes || t, M = b.doc.getTextRange(w);
if (!w.isMultiLine() && E.hasOwnProperty(M) && (y(g), b.doc.getLine(w.start.row).substring(w.start.column + 1, w.start.column + 2) == M))
return w.end.column++, w;
}), s.closeDocComment !== false && this.add("doc comment end", "insertion", function(c, p, g, b, w) {
var E;
if (c === "doc-start" && (w === `
` || w === `\r
`) && g.selection.isEmpty())
return c = g.getCursorPosition(), g = b.doc.getLine(c.row), b = b.doc.getLine(c.row + 1), E = this.$getIndent(g), /\s*\*/.test(b) ? /^\s*\*/.test(g) ? { text: w + E + "* ", selection: [1, 3 + E.length, 1, 3 + E.length] } : { text: w + E + " * ", selection: [1, 3 + E.length, 1, 3 + E.length] } : /\/\*\*/.test(g.substring(0, c.column)) ? { text: w + E + " * " + w + " " + E + "*/", selection: [1, 4 + E.length, 1, 4 + E.length] } : void 0;
});
}
var h, l = A("../../lib/oop"), n = A("../behaviour").Behaviour, o = A("../../token_iterator").TokenIterator, i = A("../../lib/lang"), a = ["text", "paren.rparen", "rparen", "paren", "punctuation.operator"], r = ["text", "paren.rparen", "rparen", "paren", "punctuation.operator", "comment"], e2 = {}, t = { '"': '"', "'": "'" };
d.isSaneInsertion = function(s, c) {
var p = s.getCursorPosition(), g = new o(c, p.row, p.column);
if (!this.$matchTokenType(g.getCurrentToken() || "text", a)) {
if (/[)}\]]/.test(s.session.getLine(p.row)[p.column]))
return true;
if (s = new o(c, p.row, p.column + 1), !this.$matchTokenType(s.getCurrentToken() || "text", a))
return false;
}
return g.stepForward(), g.getCurrentTokenRow() !== p.row || this.$matchTokenType(g.getCurrentToken() || "text", r);
}, d.$matchTokenType = function(s, c) {
return -1 < c.indexOf(s.type || s);
}, d.recordAutoInsert = function(s, c, p) {
s = s.getCursorPosition(), c = c.doc.getLine(s.row), this.isAutoInsertedClosing(s, c, h.autoInsertedLineEnd[0]) || (h.autoInsertedBrackets = 0), h.autoInsertedRow = s.row, h.autoInsertedLineEnd = p + c.substr(s.column), h.autoInsertedBrackets++;
}, d.recordMaybeInsert = function(s, c, p) {
s = s.getCursorPosition(), c = c.doc.getLine(s.row), this.isMaybeInsertedClosing(s, c) || (h.maybeInsertedBrackets = 0), h.maybeInsertedRow = s.row, h.maybeInsertedLineStart = c.substr(0, s.column) + p, h.maybeInsertedLineEnd = c.substr(s.column), h.maybeInsertedBrackets++;
}, d.isAutoInsertedClosing = function(s, c, p) {
return 0 < h.autoInsertedBrackets && s.row === h.autoInsertedRow && p === h.autoInsertedLineEnd[0] && c.substr(s.column) === h.autoInsertedLineEnd;
}, d.isMaybeInsertedClosing = function(s, c) {
return 0 < h.maybeInsertedBrackets && s.row === h.maybeInsertedRow && c.substr(s.column) === h.maybeInsertedLineEnd && c.substr(0, s.column) == h.maybeInsertedLineStart;
}, d.popAutoInsertedClosing = function() {
h.autoInsertedLineEnd = h.autoInsertedLineEnd.substr(1), h.autoInsertedBrackets--;
}, d.clearMaybeInsertedClosing = function() {
h && (h.maybeInsertedBrackets = 0, h.maybeInsertedRow = -1);
}, l.inherits(d, n), f.CstyleBehaviour = d;
}), ace.define("ace/unicode", ["require", "exports", "module"], function(A, f, R) {
for (var y = [48, 9, 8, 25, 5, 0, 2, 25, 48, 0, 11, 0, 5, 0, 6, 22, 2, 30, 2, 457, 5, 11, 15, 4, 8, 0, 2, 0, 18, 116, 2, 1, 3, 3, 9, 0, 2, 2, 2, 0, 2, 19, 2, 82, 2, 138, 2, 4, 3, 155, 12, 37, 3, 0, 8, 38, 10, 44, 2, 0, 2, 1, 2, 1, 2, 0, 9, 26, 6, 2, 30, 10, 7, 61, 2, 9, 5, 101, 2, 7, 3, 9, 2, 18, 3, 0, 17, 58, 3, 100, 15, 53, 5, 0, 6, 45, 211, 57, 3, 18, 2, 5, 3, 11, 3, 9, 2, 1, 7, 6, 2, 2, 2, 7, 3, 1, 3, 21, 2, 6, 2, 0, 4, 3, 3, 8, 3, 1, 3, 3, 9, 0, 5, 1, 2, 4, 3, 11, 16, 2, 2, 5, 5, 1, 3, 21, 2, 6, 2, 1, 2, 1, 2, 1, 3, 0, 2, 4, 5, 1, 3, 2, 4, 0, 8, 3, 2, 0, 8, 15, 12, 2, 2, 8, 2, 2, 2, 21, 2, 6, 2, 1, 2, 4, 3, 9, 2, 2, 2, 2, 3, 0, 16, 3, 3, 9, 18, 2, 2, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 3, 8, 3, 1, 3, 2, 9, 1, 5, 1, 2, 4, 3, 9, 2, 0, 17, 1, 2, 5, 4, 2, 2, 3, 4, 1, 2, 0, 2, 1, 4, 1, 4, 2, 4, 11, 5, 4, 4, 2, 2, 3, 3, 0, 7, 0, 15, 9, 18, 2, 2, 7, 2, 2, 2, 22, 2, 9, 2, 4, 4, 7, 2, 2, 2, 3, 8, 1, 2, 1, 7, 3, 3, 9, 19, 1, 2, 7, 2, 2, 2, 22, 2, 9, 2, 4, 3, 8, 2, 2, 2, 3, 8, 1, 8, 0, 2, 3, 3, 9, 19, 1, 2, 7, 2, 2, 2, 22, 2, 15, 4, 7, 2, 2, 2, 3, 10, 0, 9, 3, 3, 9, 11, 5, 3, 1, 2, 17, 4, 23, 2, 8, 2, 0, 3, 6, 4, 0, 5, 5, 2, 0, 2, 7, 19, 1, 14, 57, 6, 14, 2, 9, 40, 1, 2, 0, 3, 1, 2, 0, 3, 0, 7, 3, 2, 6, 2, 2, 2, 0, 2, 0, 3, 1, 2, 12, 2, 2, 3, 4, 2, 0, 2, 5, 3, 9, 3, 1, 35, 0, 24, 1, 7, 9, 12, 0, 2, 0, 2, 0, 5, 9, 2, 35, 5, 19, 2, 5, 5, 7, 2, 35, 10, 0, 58, 73, 7, 77, 3, 37, 11, 42, 2, 0, 4, 328, 2, 3, 3, 6, 2, 0, 2, 3, 3, 40, 2, 3, 3, 32, 2, 3, 3, 6, 2, 0, 2, 3, 3, 14, 2, 56, 2, 3, 3, 66, 5, 0, 33, 15, 17, 84, 13, 619, 3, 16, 2, 25, 6, 74, 22, 12, 2, 6, 12, 20, 12, 19, 13, 12, 2, 2, 2, 1, 13, 51, 3, 29, 4, 0, 5, 1, 3, 9, 34, 2, 3, 9, 7, 87, 9, 42, 6, 69, 11, 28, 4, 11, 5, 11, 11, 39, 3, 4, 12, 43, 5, 25, 7, 10, 38, 27, 5, 62, 2, 28, 3, 10, 7, 9, 14, 0, 89, 75, 5, 9, 18, 8, 13, 42, 4, 11, 71, 55, 9, 9, 4, 48, 83, 2, 2, 30, 14, 230, 23, 280, 3, 5, 3, 37, 3, 5, 3, 7, 2, 0, 2, 0, 2, 0, 2, 30, 3, 52, 2, 6, 2, 0, 4, 2, 2, 6, 4, 3, 3, 5, 5, 12, 6, 2, 2, 6, 67, 1, 20, 0, 29, 0, 14, 0, 17, 4, 60, 12, 5, 0, 4, 11, 18, 0, 5, 0, 3, 9, 2, 0, 4, 4, 7, 0, 2, 0, 2, 0, 2, 3, 2, 10, 3, 3, 6, 4, 5, 0, 53, 1, 2684, 46, 2, 46, 2, 132, 7, 6, 15, 37, 11, 53, 10, 0, 17, 22, 10, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 31, 48, 0, 470, 1, 36, 5, 2, 4, 6, 1, 5, 85, 3, 1, 3, 2, 2, 89, 2, 3, 6, 40, 4, 93, 18, 23, 57, 15, 513, 6581, 75, 20939, 53, 1164, 68, 45, 3, 268, 4, 27, 21, 31, 3, 13, 13, 1, 2, 24, 9, 69, 11, 1, 38, 8, 3, 102, 3, 1, 111, 44, 25, 51, 13, 68, 12, 9, 7, 23, 4, 0, 5, 45, 3, 35, 13, 28, 4, 64, 15, 10, 39, 54, 10, 13, 3, 9, 7, 22, 4, 1, 5, 66, 25, 2, 227, 42, 2, 1, 3, 9, 7, 11171, 13, 22, 5, 48, 8453, 301, 3, 61, 3, 105, 39, 6, 13, 4, 6, 11, 2, 12, 2, 4, 2, 0, 2, 1, 2, 1, 2, 107, 34, 362, 19, 63, 3, 53, 41, 11, 5, 15, 17, 6, 13, 1, 25, 2, 33, 4, 2, 134, 20, 9, 8, 25, 5, 0, 2, 25, 12, 88, 4, 5, 3, 5, 3, 5, 3, 2], C = 0, d = [], h = 0; h < y.length; h += 2)
d.push(C += y[h]), y[h + 1] && d.push(45, C += y[h + 1]);
f.wordChars = String.fromCharCode.apply(null, d);
}), ace.define("ace/mode/text", ["require", "exports", "module", "ace/config", "ace/tokenizer", "ace/mode/text_highlight_rules", "ace/mode/behaviour/cstyle", "ace/unicode", "ace/lib/lang", "ace/token_iterator", "ace/range"], function(A, f, R) {
function y() {
this.HighlightRules = h;
}
var C = A("../config"), d = A("../tokenizer").Tokenizer, h = A("./text_highlight_rules").TextHighlightRules, l = A("./behaviour/cstyle").CstyleBehaviour, n = A("../unicode"), o = A("../lib/lang"), i = A("../token_iterator").TokenIterator, a = A("../range").Range;
(function() {
this.$defaultBehaviour = new l(), this.tokenRe = new RegExp("^[" + n.wordChars + "\\$_]+", "g"), this.nonTokenRe = new RegExp("^(?:[^" + n.wordChars + "\\$_]|\\s])+", "g"), this.getTokenizer = function() {
return this.$tokenizer || (this.$highlightRules = this.$highlightRules || new this.HighlightRules(this.$highlightRuleConfig), this.$tokenizer = new d(this.$highlightRules.getRules())), this.$tokenizer;
}, this.lineCommentStart = "", this.blockComment = "", this.toggleCommentLines = function(r, e2, t, s) {
var c = e2.doc, p = true, g = true, b = 1 / 0, w = e2.getTabSize(), E = false;
if (this.lineCommentStart) {
_ = Array.isArray(this.lineCommentStart) ? ($ = this.lineCommentStart.map(o.escapeRegExp).join("|"), this.lineCommentStart[0]) : ($ = o.escapeRegExp(this.lineCommentStart), this.lineCommentStart), $ = new RegExp("^(\\s*)(?:" + $ + ") ?"), E = e2.getUseSoftTabs();
var M = function(Q, K) {
var ne, T, V = Q.match($);
V && (ne = V[1].length, T = V[0].length, u(Q, ne, T) || V[0][T - 1] != " " || T--, c.removeInLine(K, ne, T));
}, B2 = _ + " ", Z = function(Q, K) {
p && !/\S/.test(Q) || (u(Q, b, b) ? c.insertInLine({ row: K, column: b }, B2) : c.insertInLine({ row: K, column: b }, _));
}, k = function(Q, K) {
return $.test(Q);
}, u = function(Q, K, ne) {
for (var T = 0; K-- && Q.charAt(K) == " "; )
T++;
if (T % w != 0)
return false;
for (T = 0; Q.charAt(ne++) == " "; )
T++;
return 2 < w ? T % w != w - 1 : T % w == 0;
};
} else {
if (!this.blockComment)
return false;
var _ = this.blockComment.start, v = this.blockComment.end, $ = new RegExp("^(\\s*)(?:" + o.escapeRegExp(_) + ")"), G = new RegExp("(?:" + o.escapeRegExp(v) + ")\\s*$"), Z = function(T, V) {
k(T, V) || p && !/\S/.test(T) || (c.insertInLine({ row: V, column: T.length }, v), c.insertInLine({ row: V, column: b }, _));
}, M = function(T, V) {
var F;
(F = T.match(G)) && c.removeInLine(V, T.length - F[0].length, T.length), (F = T.match($)) && c.removeInLine(V, F[1].length, F[0].length);
}, k = function(T, V) {
if ($.test(T))
return true;
for (var F = e2.getTokens(V), I = 0; I < F.length; I++)
if (F[I].type === "comment")
return true;
};
}
function W(Q) {
for (var K = t; K <= s; K++)
Q(c.getLine(K), K);
}
var X = 1 / 0;
W(function(Q, K) {
var ne = Q.search(/\S/);
ne !== -1 ? (ne < b && (b = ne), g && !k(Q, K) && (g = false)) : X > Q.length && (X = Q.length);
}), b == 1 / 0 && (b = X, g = p = false), E && b % w != 0 && (b = Math.floor(b / w) * w), W(g ? M : Z);
}, this.toggleBlockComment = function(r, e2, t, s) {
var c = this.blockComment;
if (c) {
!c.start && c[0] && (c = c[0]);
var p, g, b = (Z = new i(e2, s.row, s.column)).getCurrentToken(), w = (e2.selection, e2.selection.toOrientedRange());
if (b && /comment/.test(b.type)) {
for (; b && /comment/.test(b.type); ) {
if ((k = b.value.indexOf(c.start)) != -1) {
var E = Z.getCurrentTokenRow(), M = Z.getCurrentTokenColumn() + k, B2 = new a(E, M, E, M + c.start.length);
break;
}
b = Z.stepBackward();
}
for (var Z, k, b = (Z = new i(e2, s.row, s.column)).getCurrentToken(); b && /comment/.test(b.type); ) {
if ((k = b.value.indexOf(c.end)) != -1) {
var E = Z.getCurrentTokenRow(), M = Z.getCurrentTokenColumn() + k, u = new a(E, M, E, M + c.end.length);
break;
}
b = Z.stepForward();
}
u && e2.remove(u), B2 && (e2.remove(B2), p = B2.start.row, g = -c.start.length);
} else
g = c.start.length, p = t.start.row, e2.insert(t.end, c.end), e2.insert(t.start, c.start);
w.start.row == p && (w.start.column += g), w.end.row == p && (w.end.column += g), e2.selection.fromOrientedRange(w);
}
}, this.getNextLineIndent = function(r, e2, t) {
return this.$getIndent(e2);
}, this.checkOutdent = function(r, e2, t) {
return false;
}, this.autoOutdent = function(r, e2, t) {
}, this.$getIndent = function(r) {
return r.match(/^\s*/)[0];
}, this.createWorker = function(r) {
return null;
}, this.createModeDelegates = function(r) {
for (var e2 in this.$embeds = [], this.$modes = {}, r) {
var t, s, c;
r[e2] && (s = (t = r[e2]).prototype.$id, (c = C.$modes[s]) || (C.$modes[s] = c = new t()), C.$modes[e2] || (C.$modes[e2] = c), this.$embeds.push(e2), this.$modes[e2] = c);
}
for (var p = ["toggleBlockComment", "toggleCommentLines", "getNextLineIndent", "checkOutdent", "autoOutdent", "transformAction", "getCompletions"], e2 = 0; e2 < p.length; e2++)
(function(b) {
var w = p[e2], E = b[w];
b[p[e2]] = function() {
return this.$delegator(w, arguments, E);
};
})(this);
}, this.$delegator = function(r, e2, t) {
var s = e2[0] || "start";
if (typeof s != "string") {
if (Array.isArray(s[2])) {
var c = s[2][s[2].length - 1];
if (g = this.$modes[c])
return g[r].apply(g, [s[1]].concat([].slice.call(e2, 1)));
}
s = s[0] || "start";
}
for (var p = 0; p < this.$embeds.length; p++)
if (this.$modes[this.$embeds[p]]) {
var g, b = s.split(this.$embeds[p]);
if (!b[0] && b[1])
return e2[0] = b[1], (g = this.$modes[this.$embeds[p]])[r].apply(g, e2);
}
return c = t.apply(this, e2), t ? c : void 0;
}, this.transformAction = function(r, e2, t, s, c) {
if (this.$behaviour) {
var p, g = this.$behaviour.getBehaviours();
for (p in g)
if (g[p][e2]) {
var b = g[p][e2].apply(this, arguments);
if (b)
return b;
}
}
}, this.getKeywords = function(r) {
if (!this.completionKeywords) {
var e2 = this.$tokenizer.rules, t = [];
for (g in e2)
for (var s = e2[g], c = 0, p = s.length; c < p; c++)
if (typeof s[c].token == "string")
/keyword|support|storage/.test(s[c].token) && t.push(s[c].regex);
else if (typeof s[c].token == "object")
for (var g, b = 0, w = s[c].token.length; b < w; b++)
/keyword|support|storage/.test(s[c].token[b]) && (g = s[c].regex.match(/\(.+?\)/g)[b], t.push(g.substr(1, g.length - 2)));
this.completionKeywords = t;
}
return r ? t.concat(this.$keywordList || []) : this.$keywordList;
}, this.$createKeywordList = function() {
return this.$highlightRules || this.getTokenizer(), this.$keywordList = this.$highlightRules.$keywordList || [];
}, this.getCompletions = function(r, e2, t, s) {
return (this.$keywordList || this.$createKeywordList()).map(function(c) {
return { name: c, value: c, score: 0, meta: "keyword" };
});
}, this.$id = "ace/mode/text";
}).call(y.prototype), f.Mode = y;
}), ace.define("ace/apply_delta", ["require", "exports", "module"], function(A, f, R) {
f.applyDelta = function(y, C, d) {
var h = C.start.row, l = C.start.column, n = y[h] || "";
switch (C.action) {
case "insert":
C.lines.length === 1 ? y[h] = n.substring(0, l) + C.lines[0] + n.substring(l) : (o = [h, 1].concat(C.lines), y.splice.apply(y, o), y[h] = n.substring(0, l) + y[h], y[h + C.lines.length - 1] += n.substring(l));
break;
case "remove":
var o = C.end.column, i = C.end.row;
h === i ? y[h] = n.substring(0, l) + n.substring(o) : y.splice(h, i - h + 1, n.substring(0, l) + y[i].substring(o));
}
};
}), ace.define("ace/anchor", ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter"], function(C, f, R) {
var y = C("./lib/oop"), C = C("./lib/event_emitter").EventEmitter, d = (h.prototype.getPosition = function() {
return this.$clipPositionToDocument(this.row, this.column);
}, h.prototype.getDocument = function() {
return this.document;
}, h.prototype.onChange = function(n) {
n.start.row == n.end.row && n.start.row != this.row || n.start.row > this.row || (n = function(o, i, a) {
var s = o.action == "insert", r = (s ? 1 : -1) * (o.end.row - o.start.row), e2 = (s ? 1 : -1) * (o.end.column - o.start.column), t = o.start, s = s ? t : o.end;
return l(i, t, a) ? { row: i.row, column: i.column } : l(s, i, !a) ? { row: i.row + r, column: i.column + (i.row == s.row ? e2 : 0) } : { row: t.row, column: t.column };
}(n, { row: this.row, column: this.column }, this.$insertRight), this.setPosition(n.row, n.column, true));
}, h.prototype.setPosition = function(n, o, i) {
i = i ? { row: n, column: o } : this.$clipPositionToDocument(n, o), this.row == i.row && this.column == i.column || (n = { row: this.row, column: this.column }, this.row = i.row, this.column = i.column, this._signal("change", { old: n, value: i }));
}, h.prototype.detach = function() {
this.document.off("change", this.$onChange);
}, h.prototype.attach = function(n) {
this.document = n || this.document, this.document.on("change", this.$onChange);
}, h.prototype.$clipPositionToDocument = function(n, o) {
var i = {};
return n >= this.document.getLength() ? (i.row = Math.max(0, this.document.getLength() - 1), i.column = this.document.getLine(i.row).length) : n < 0 ? (i.row = 0, i.column = 0) : (i.row = n, i.column = Math.min(this.document.getLine(i.row).length, Math.max(0, o))), o < 0 && (i.column = 0), i;
}, h);
function h(n, o, i) {
this.$onChange = this.onChange.bind(this), this.attach(n), i === void 0 ? this.setPosition(o.row, o.column) : this.setPosition(o, i);
}
function l(n, o, i) {
return i = i ? n.column <= o.column : n.column < o.column, n.row < o.row || n.row == o.row && i;
}
d.prototype.$insertRight = false, y.implement(d.prototype, C), f.Anchor = d;
}), ace.define("ace/document", ["require", "exports", "module", "ace/lib/oop", "ace/apply_delta", "ace/lib/event_emitter", "ace/range", "ace/anchor"], function(n, f, R) {
var y = n("./lib/oop"), C = n("./apply_delta").applyDelta, d = n("./lib/event_emitter").EventEmitter, h = n("./range").Range, l = n("./anchor").Anchor, n = (o.prototype.setValue = function(i) {
var a = this.getLength() - 1;
this.remove(new h(0, 0, a, this.getLine(a).length)), this.insert({ row: 0, column: 0 }, i || "");
}, o.prototype.getValue = function() {
return this.getAllLines().join(this.getNewLineCharacter());
}, o.prototype.createAnchor = function(i, a) {
return new l(this, i, a);
}, o.prototype.$detectNewLine = function(i) {
i = i.match(/^.*?(\r\n|\r|\n)/m), this.$autoNewLine = i ? i[1] : `
`, this._signal("changeNewLineMode");
}, o.prototype.getNewLineCharacter = function() {
switch (this.$newLineMode) {
case "windows":
return `\r
`;
case "unix":
return `
`;
default:
return this.$autoNewLine || `
`;
}
}, o.prototype.setNewLineMode = function(i) {
this.$newLineMode !== i && (this.$newLineMode = i, this._signal("changeNewLineMode"));
}, o.prototype.getNewLineMode = function() {
return this.$newLineMode;
}, o.prototype.isNewLine = function(i) {
return i == `\r
` || i == "\r" || i == `
`;
}, o.prototype.getLine = function(i) {
return this.$lines[i] || "";
}, o.prototype.getLines = function(i, a) {
return this.$lines.slice(i, a + 1);
}, o.prototype.getAllLines = function() {
return this.getLines(0, this.getLength());
}, o.prototype.getLength = function() {
return this.$lines.length;
}, o.prototype.getTextRange = function(i) {
return this.getLinesForRange(i).join(this.getNewLineCharacter());
}, o.prototype.getLinesForRange = function(i) {
var a, r;
return i.start.row === i.end.row ? a = [this.getLine(i.start.row).substring(i.start.column, i.end.column)] : ((a = this.getLines(i.start.row, i.end.row))[0] = (a[0] || "").substring(i.start.column), r = a.length - 1, i.end.row - i.start.row == r && (a[r] = a[r].substring(0, i.end.column))), a;
}, o.prototype.insertLines = function(i, a) {
return this.insertFullLines(i, a);
}, o.prototype.removeLines = function(i, a) {
return this.removeFullLines(i, a);
}, o.prototype.insertNewLine = function(i) {
return this.insertMergedLines(i, ["", ""]);
}, o.prototype.insert = function(i, a) {
return this.getLength() <= 1 && this.$detectNewLine(a), this.insertMergedLines(i, this.$split(a));
}, o.prototype.insertInLine = function(e2, a) {
var r = this.clippedPos(e2.row, e2.column), e2 = this.pos(e2.row, e2.column + a.length);
return this.applyDelta({ start: r, end: e2, action: "insert", lines: [a] }, true), this.clonePos(e2);
}, o.prototype.clippedPos = function(i, a) {
var r = this.getLength(), r = (i === void 0 ? i = r : i < 0 ? i = 0 : r <= i && (i = r - 1, a = void 0), this.getLine(i));
return a == null && (a = r.length), { row: i, column: a = Math.min(Math.max(a, 0), r.length) };
}, o.prototype.clonePos = function(i) {
return { row: i.row, column: i.column };
}, o.prototype.pos = function(i, a) {
return { row: i, column: a };
}, o.prototype.$clipPosition = function(i) {
var a = this.getLength();
return i.row >= a ? (i.row = Math.max(0, a - 1), i.column = this.getLine(a - 1).length) : (i.row = Math.max(0, i.row), i.column = Math.min(Math.max(i.column, 0), this.getLine(i.row).length)), i;
}, o.prototype.insertFullLines = function(i, a) {
var r = 0, r = (i = Math.min(Math.max(i, 0), this.getLength())) < this.getLength() ? (a = a.concat([""]), 0) : (a = [""].concat(a), this.$lines[--i].length);
this.insertMergedLines({ row: i, column: r }, a);
}, o.prototype.insertMergedLines = function(r, a) {
var r = this.clippedPos(r.row, r.column), e2 = { row: r.row + a.length - 1, column: (a.length == 1 ? r.column : 0) + a[a.length - 1].length };
return this.applyDelta({ start: r, end: e2, action: "insert", lines: a }), this.clonePos(e2);
}, o.prototype.remove = function(r) {
var a = this.clippedPos(r.start.row, r.start.column), r = this.clippedPos(r.end.row, r.end.column);
return this.applyDelta({ start: a, end: r, action: "remove", lines: this.getLinesForRange({ start: a, end: r }) }), this.clonePos(a);
}, o.prototype.removeInLine = function(i, a, r) {
return a = this.clippedPos(i, a), i = this.clippedPos(i, r), this.applyDelta({ start: a, end: i, action: "remove", lines: this.getLinesForRange({ start: a, end: i }) }, true), this.clonePos(a);
}, o.prototype.removeFullLines = function(i, a) {
i = Math.min(Math.max(0, i), this.getLength() - 1);
var s = (a = Math.min(Math.max(0, a), this.getLength() - 1)) == this.getLength() - 1 && 0 < i, e2 = a < this.getLength() - 1, t = s ? i - 1 : i, s = s ? this.getLine(t).length : 0, r = e2 ? a + 1 : a, e2 = e2 ? 0 : this.getLine(r).length, t = new h(t, s, r, e2), s = this.$lines.slice(i, a + 1);
return this.applyDelta({ start: t.start, end: t.end, action: "remove", lines: this.getLinesForRange(t) }), s;
}, o.prototype.removeNewLine = function(i) {
i < this.getLength() - 1 && 0 <= i && this.applyDelta({ start: this.pos(i, this.getLine(i).length), end: this.pos(i + 1, 0), action: "remove", lines: ["", ""] });
}, o.prototype.replace = function(i, a) {
return i instanceof h || (i = h.fromPoints(i.start, i.end)), a.length === 0 && i.isEmpty() ? i.start : a == this.getTextRange(i) ? i.end : (this.remove(i), a ? this.insert(i.start, a) : i.start);
}, o.prototype.applyDeltas = function(i) {
for (var a = 0; a < i.length; a++)
this.applyDelta(i[a]);
}, o.prototype.revertDeltas = function(i) {
for (var a = i.length - 1; 0 <= a; a--)
this.revertDelta(i[a]);
}, o.prototype.applyDelta = function(i, a) {
var r = i.action == "insert";
(r ? i.lines.length <= 1 && !i.lines[0] : !h.comparePoints(i.start, i.end)) || (r && 2e4 < i.lines.length ? this.$splitAndapplyLargeDelta(i, 2e4) : (C(this.$lines, i, a), this._signal("change", i)));
}, o.prototype.$safeApplyDelta = function(i) {
var a = this.$lines.length;
(i.action == "remove" && i.start.row < a && i.end.row < a || i.action == "insert" && i.start.row <= a) && this.applyDelta(i);
}, o.prototype.$splitAndapplyLargeDelta = function(i, a) {
for (var r = i.lines, e2 = r.length - a + 1, t = i.start.row, s = i.start.column, c = 0, p = 0; c < e2; c = p) {
p += a - 1;
var g = r.slice(c, p);
g.push(""), this.applyDelta({ start: this.pos(t + c, s), end: this.pos(t + p, s = 0), action: i.action, lines: g }, true);
}
i.lines = r.slice(c), i.start.row = t + c, i.start.column = s, this.applyDelta(i, true);
}, o.prototype.revertDelta = function(i) {
this.$safeApplyDelta({ start: this.clonePos(i.start), end: this.clonePos(i.end), action: i.action == "insert" ? "remove" : "insert", lines: i.lines.slice() });
}, o.prototype.indexToPosition = function(i, a) {
for (var r = this.$lines || this.getAllLines(), e2 = this.getNewLineCharacter().length, t = a || 0, s = r.length; t < s; t++)
if ((i -= r[t].length + e2) < 0)
return { row: t, column: i + r[t].length + e2 };
return { row: s - 1, column: i + r[s - 1].length + e2 };
}, o.prototype.positionToIndex = function(i, a) {
for (var r = this.$lines || this.getAllLines(), e2 = this.getNewLineCharacter().length, t = 0, s = Math.min(i.row, r.length), c = a || 0; c < s; ++c)
t += r[c].length + e2;
return t + i.column;
}, o.prototype.$split = function(i) {
return i.split(/\r\n|\r|\n/);
}, o);
function o(i) {
this.$lines = [""], i.length === 0 ? this.$lines = [""] : Array.isArray(i) ? this.insertMergedLines({ row: 0, column: 0 }, i) : this.insert({ row: 0, column: 0 }, i);
}
n.prototype.$autoNewLine = "", n.prototype.$newLineMode = "auto", y.implement(n.prototype, d), f.Document = n;
}), ace.define("ace/background_tokenizer", ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter"], function(C, f, R) {
var y = C("./lib/oop"), C = C("./lib/event_emitter").EventEmitter, d = (h.prototype.setTokenizer = function(l) {
this.tokenizer = l, this.lines = [], this.states = [], this.start(0);
}, h.prototype.setDocument = function(l) {
this.doc = l, this.lines = [], this.states = [], this.stop();
}, h.prototype.fireUpdateEvent = function(l, n) {
this._signal("update", { data: { first: l, last: n } });
}, h.prototype.start = function(l) {
this.currentLine = Math.min(l || 0, this.currentLine, this.doc.getLength()), this.lines.splice(this.currentLine, this.lines.length), this.states.splice(this.currentLine, this.states.length), this.stop(), this.running = setTimeout(this.$worker, 700);
}, h.prototype.scheduleStart = function() {
this.running || (this.running = setTimeout(this.$worker, 700));
}, h.prototype.$updateOnChange = function(l) {
var n = l.start.row, o = l.end.row - n;
o == 0 ? this.lines[n] = null : l.action == "remove" ? (this.lines.splice(n, 1 + o, null), this.states.splice(n, 1 + o, null)) : ((l = Array(1 + o)).unshift(n, 1), this.lines.splice.apply(this.lines, l), this.states.splice.apply(this.states, l)), this.currentLine = Math.min(n, this.currentLine, this.doc.getLength()), this.stop();
}, h.prototype.stop = function() {
this.running && clearTimeout(this.running), this.running = false;
}, h.prototype.getTokens = function(l) {
return this.lines[l] || this.$tokenizeRow(l);
}, h.prototype.getState = function(l) {
return this.currentLine == l && this.$tokenizeRow(l), this.states[l] || "start";
}, h.prototype.$tokenizeRow = function(l) {
var o = this.doc.getLine(l), n = this.states[l - 1], o = this.tokenizer.getLineTokens(o, n, l);
return this.states[l] + "" != o.state + "" ? (this.states[l] = o.state, this.lines[l + 1] = null, this.currentLine > l + 1 && (this.currentLine = l + 1)) : this.currentLine == l && (this.currentLine = l + 1), this.lines[l] = o.tokens;
}, h.prototype.cleanup = function() {
this.running = false, this.lines = [], this.states = [], this.currentLine = 0, this.removeAllListeners();
}, h);
function h(l, n) {
this.running = false, this.lines = [], this.states = [], this.currentLine = 0, this.tokenizer = l;
var o = this;
this.$worker = function() {
if (o.running) {
for (var i = /* @__PURE__ */ new Date(), a = o.currentLine, r = -1, e2 = o.doc, t = a; o.lines[a]; )
a++;
var s = e2.getLength(), c = 0;
for (o.running = false; a < s; ) {
for (o.$tokenizeRow(a), r = a; a++, o.lines[a]; )
;
if (++c % 5 == 0 && 20 < /* @__PURE__ */ new Date() - i) {
o.running = setTimeout(o.$worker, 20);
break;
}
}
o.currentLine = a, t <= (r = r == -1 ? a : r) && o.fireUpdateEvent(t, r);
}
};
}
y.implement(d.prototype, C), f.BackgroundTokenizer = d;
}), ace.define("ace/search_highlight", ["require", "exports", "module", "ace/lib/lang", "ace/range"], function(d, f, R) {
var y = d("./lib/lang"), C = d("./range").Range, d = (h.prototype.setRegexp = function(l) {
this.regExp + "" != l + "" && (this.regExp = l, this.cache = []);
}, h.prototype.update = function(l, n, o, i) {
if (this.regExp)
for (var a = i.firstRow, r = i.lastRow, e2 = {}, t = a; t <= r; t++) {
var s = this.cache[t];
s == null && (s = (s = (s = y.getMatchOffsets(o.getLine(t), this.regExp)).length > this.MAX_RANGES ? s.slice(0, this.MAX_RANGES) : s).map(function(b) {
return new C(t, b.offset, t, b.offset + b.length);
}), this.cache[t] = s.length ? s : "");
for (var c = s.length; c--; ) {
var p = s[c].toScreenRange(o), g = p.toString();
e2[g] || (e2[g] = true, n.drawSingleLineMarker(l, p, this.clazz, i));
}
}
}, h);
function h(l, n, o) {
o === void 0 && (o = "text"), this.setRegexp(l), this.clazz = n, this.type = o;
}
d.prototype.MAX_RANGES = 500, f.SearchHighlight = d;
}), ace.define("ace/undomanager", ["require", "exports", "module", "ace/range"], function(A, f, R) {
C.prototype.addSession = function(t) {
this.$session = t;
}, C.prototype.add = function(t, s, c) {
this.$fromUndo || t != this.$lastDelta && (this.$keepRedoStack || (this.$redoStack.length = 0), s !== false && this.lastDeltas || (this.lastDeltas = [], (s = this.$undoStack.length) > this.$undoDepth - 1 && this.$undoStack.splice(0, s - this.$undoDepth + 1), this.$undoStack.push(this.lastDeltas), t.id = this.$rev = ++this.$maxRev), t.action != "remove" && t.action != "insert" || (this.$lastDelta = t), this.lastDeltas.push(t));
}, C.prototype.addSelection = function(t, s) {
this.selections.push({ value: t, rev: s || this.$rev });
}, C.prototype.startNewGroup = function() {
return this.lastDeltas = null, this.$rev;
}, C.prototype.markIgnored = function(t, s) {
s == null && (s = this.$rev + 1);
for (var c = this.$undoStack, p = c.length; p--; ) {
var g = c[p][0];
if (g.id <= t)
break;
g.id < s && (g.ignore = true);
}
this.lastDeltas = null;
}, C.prototype.getSelection = function(t, s) {
for (var c = this.selections, p = c.length; p--; ) {
var g = c[p];
if (g.rev < t)
return g = s ? c[p + 1] : g;
}
}, C.prototype.getRevision = function() {
return this.$rev;
}, C.prototype.getDeltas = function(t, s) {
s == null && (s = this.$rev + 1);
for (var c = this.$undoStack, p = null, g = 0, b = c.length; b--; ) {
var w = c[b][0];
if (w.id < s && !p && (p = b + 1), w.id <= t) {
g = b + 1;
break;
}
}
return c.slice(g, p);
}, C.prototype.getChangedRanges = function(t, s) {
s == null && this.$rev;
}, C.prototype.getChangedLines = function(t, s) {
s == null && this.$rev;
}, C.prototype.undo = function(t, s) {
this.lastDeltas = null;
var c, p = this.$undoStack;
if (function(g, b) {
for (var w = b; w--; ) {
var E = g[w];
if (E && !E[0].ignore) {
for (; w < b - 1; ) {
var M = function(B2, Z) {
for (var k = B2.length; k--; )
for (var u = 0; u < Z.length; u++)
if (!i(B2[k], Z[u])) {
for (; k < B2.length; ) {
for (; u--; )
i(Z[u], B2[k]);
u = Z.length, k++;
}
return [B2, Z];
}
return B2.selectionBefore = Z.selectionBefore = B2.selectionAfter = Z.selectionAfter = null, [Z, B2];
}(g[w], g[w + 1]);
g[w] = M[0], g[w + 1] = M[1], w++;
}
return 1;
}
}
}(p, p.length))
return t = t || this.$session, this.$redoStackBaseRev !== this.$rev && this.$redoStack.length && (this.$redoStack = []), this.$fromUndo = true, c = null, (p = p.pop()) && (c = t.undoChanges(p, s), this.$redoStack.push(p), this.$syncRev()), this.$fromUndo = false, c;
}, C.prototype.redo = function(t, s) {
if (this.lastDeltas = null, t = t || this.$session, this.$fromUndo = true, this.$redoStackBaseRev != this.$rev) {
for (var _ = this.getDeltas(this.$redoStackBaseRev, this.$rev + 1), c = this.$redoStack, p = _, g = 0; g < p.length; g++)
for (var b = p[g], w = 0; w < b.length; w++) {
E = void 0, M = void 0, B2 = void 0, Z = void 0, k = void 0, u = void 0;
var E = c, M = b[w];
M = function(G) {
return { start: l(G.start), end: l(G.end), action: G.action, lines: G.lines.slice() };
}(M);
for (var B2 = E.length; B2--; ) {
for (var Z = E[B2], k = 0; k < Z.length; k++) {
var u = function(G, W) {
var X, Q, K = G.action == "insert", ne = W.action == "insert";
if (K && ne)
h(G.start, W.start) < 0 ? a(W, G, 1) : a(G, W, 1);
else if (K && !ne)
0 <= h(G.start, W.end) ? a(G, W, -1) : (h(G.start, W.start) <= 0 || a(G, d.fromPoints(W.start, G.start), -1), a(W, G, 1));
else if (!K && ne)
0 <= h(W.start, G.end) ? a(W, G, -1) : (h(W.start, G.start) <= 0 || a(W, d.fromPoints(G.start, W.start), -1), a(G, W, 1));
else if (!K && !ne)
if (0 <= h(W.start, G.end))
a(W, G, -1);
else {
if (!(h(W.end, G.start) <= 0))
return h(G.start, W.start) < 0 && (G = e2(X = G, W.start)), 0 < h(G.end, W.end) && (Q = e2(G, W.end)), r(W.end, G.start, G.end, -1), Q && !X && (G.lines = Q.lines, G.start = Q.start, G.end = Q.end, Q = G), [W, X, Q].filter(Boolean);
a(G, W, -1);
}
return [W, G];
}(Z[k], M);
M = u[0], u.length != 2 && (u[2] ? (Z.splice(k + 1, 1, u[1], u[2]), k++) : u[1] || (Z.splice(k, 1), k--));
}
Z.length || E.splice(B2, 1);
}
}
this.$redoStackBaseRev = this.$rev, this.$redoStack.forEach(function($) {
$[0].id = ++this.$maxRev;
}, this);
}
var _ = this.$redoStack.pop(), v = null;
return _ && (v = t.redoChanges(_, s), this.$undoStack.push(_), this.$syncRev()), this.$fromUndo = false, v;
}, C.prototype.$syncRev = function() {
var t = this.$undoStack, t = t[t.length - 1], t = t && t[0].id || 0;
this.$redoStackBaseRev = t, this.$rev = t;
}, C.prototype.reset = function() {
this.lastDeltas = null, this.$lastDelta = null, this.$undoStack = [], this.$redoStack = [], this.$rev = 0, this.mark = 0, this.$redoStackBaseRev = this.$rev, this.selections = [];
}, C.prototype.canUndo = function() {
return 0 < this.$undoStack.length;
}, C.prototype.canRedo = function() {
return 0 < this.$redoStack.length;
}, C.prototype.bookmark = function(t) {
t == null && (t = this.$rev), this.mark = t;
}, C.prototype.isAtBookmark = function() {
return this.$rev === this.mark;
}, C.prototype.toJSON = function() {
return { $redoStack: this.$redoStack, $undoStack: this.$undoStack };
}, C.prototype.fromJSON = function(t) {
this.reset(), this.$undoStack = t.$undoStack, this.$redoStack = t.$redoStack;
}, C.prototype.$prettyPrint = function(t) {
return t ? n(t) : n(this.$undoStack) + `
---
` + n(this.$redoStack);
};
var y = C;
function C() {
this.$maxRev = 0, this.$fromUndo = false, this.$undoDepth = 1 / 0, this.reset();
}
y.prototype.hasUndo = y.prototype.canUndo, y.prototype.hasRedo = y.prototype.canRedo, y.prototype.isClean = y.prototype.isAtBookmark, y.prototype.markClean = y.prototype.bookmark;
var d = A("./range").Range, h = d.comparePoints;
d.comparePoints;
function l(t) {
return { row: t.row, column: t.column };
}
function n(t) {
var s;
return t = t || this, Array.isArray(t) ? t.map(n).join(`
`) : (s = "", t.action ? (s = t.action == "insert" ? "+" : "-", s += "[" + t.lines + "]") : t.value && (s = Array.isArray(t.value) ? t.value.map(o).join(`
`) : o(t.value)), t.start && (s += o(t)), (t.id || t.rev) && (s += " (" + (t.id || t.rev) + ")"), s);
}
function o(t) {
return t.start.row + ":" + t.start.column + "=>" + t.end.row + ":" + t.end.column;
}
function i(t, s) {
var c = t.action == "insert", p = s.action == "insert";
if (c && p)
if (0 <= h(s.start, t.end))
a(s, t, -1);
else {
if (!(h(s.start, t.start) <= 0))
return;
a(t, s, 1);
}
else if (c && !p)
if (0 <= h(s.start, t.end))
a(s, t, -1);
else {
if (!(h(s.end, t.start) <= 0))
return;
a(t, s, -1);
}
else if (!c && p)
if (0 <= h(s.start, t.start))
a(s, t, 1);
else {
if (!(h(s.start, t.start) <= 0))
return;
a(t, s, 1);
}
else if (!c && !p)
if (0 <= h(s.start, t.start))
a(s, t, 1);
else {
if (!(h(s.end, t.start) <= 0))
return;
a(t, s, -1);
}
return 1;
}
function a(t, s, c) {
r(t.start, s.start, s.end, c), r(t.end, s.start, s.end, c);
}
function r(t, s, c, p) {
t.row == (p == 1 ? s : c).row && (t.column += p * (c.column - s.column)), t.row += p * (c.row - s.row);
}
function e2(t, s) {
var c = t.lines, p = t.end, b = (t.end = l(s), t.end.row - t.start.row), g = c.splice(b, c.length), b = b ? s.column : s.column - t.start.column;
return c.push(g[0].substring(0, b)), g[0] = g[0].substr(b), { start: l(s), end: p, lines: g, action: t.action };
}
f.UndoManager = y;
}), ace.define("ace/edit_session/fold_line", ["require", "exports", "module", "ace/range"], function(A, f, R) {
var y = A("../range").Range;
function C(d, h) {
this.foldData = d, Array.isArray(h) ? this.folds = h : h = this.folds = [h], d = h[h.length - 1], this.range = new y(h[0].start.row, h[0].start.column, d.end.row, d.end.column), this.start = this.range.start, this.end = this.range.end, this.folds.forEach(function(l) {
l.setFoldLine(this);
}, this);
}
C.prototype.shiftRow = function(d) {
this.start.row += d, this.end.row += d, this.folds.forEach(function(h) {
h.start.row += d, h.end.row += d;
});
}, C.prototype.addFold = function(d) {
if (d.sameRow) {
if (d.start.row < this.startRow || d.endRow > this.endRow)
throw new Error("Can't add a fold to this FoldLine as it has no connection");
this.folds.push(d), this.folds.sort(function(h, l) {
return -h.range.compareEnd(l.start.row, l.start.column);
}), 0 < this.range.compareEnd(d.start.row, d.start.column) ? (this.end.row = d.end.row, this.end.column = d.end.column) : this.range.compareStart(d.end.row, d.end.column) < 0 && (this.start.row = d.start.row, this.start.column = d.start.column);
} else if (d.start.row == this.end.row)
this.folds.push(d), this.end.row = d.end.row, this.end.column = d.end.column;
else {
if (d.end.row != this.start.row)
throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");
this.folds.unshift(d), this.start.row = d.start.row, this.start.column = d.start.column;
}
d.foldLine = this;
}, C.prototype.containsRow = function(d) {
return d >= this.start.row && d <= this.end.row;
}, C.prototype.walk = function(d, h, l) {
var n, o, i = 0, a = this.folds, r = true;
h == null && (h = this.end.row, l = this.end.column);
for (var e2 = 0; e2 < a.length; e2++) {
if ((o = (n = a[e2]).range.compareStart(h, l)) == -1)
return void d(null, h, l, i, r);
if (!d(null, n.start.row, n.start.column, i, r) && d(n.placeholder, n.start.row, n.start.column, i) || o === 0)
return;
r = !n.sameRow, i = n.end.column;
}
d(null, h, l, i, r);
}, C.prototype.getNextFoldTo = function(d, h) {
for (var l, n, o = 0; o < this.folds.length; o++) {
if ((n = (l = this.folds[o]).range.compareEnd(d, h)) == -1)
return { fold: l, kind: "after" };
if (n === 0)
return { fold: l, kind: "inside" };
}
return null;
}, C.prototype.addRemoveChars = function(d, h, l) {
var n, o = this.getNextFoldTo(d, h);
if (o) {
if (n = o.fold, o.kind == "inside" && n.start.column != h && n.start.row != d)
window.console && window.console.log(d, h, n);
else if (n.start.row == d) {
var i, a = (i = this.folds).indexOf(n);
for (a === 0 && (this.start.column += l); a < i.length; a++) {
if ((n = i[a]).start.column += l, !n.sameRow)
return;
n.end.column += l;
}
this.end.column += l;
}
}
}, C.prototype.split = function(o, h) {
var l, n, o = this.getNextFoldTo(o, h);
return o && o.kind != "inside" ? (h = o.fold, o = this.folds, l = this.foldData, h = o.indexOf(h), n = o[h - 1], this.end.row = n.end.row, this.end.column = n.end.column, n = new C(l, o = o.splice(h, o.length - h)), l.splice(l.indexOf(this) + 1, 0, n), n) : null;
}, C.prototype.merge = function(d) {
for (var h = d.folds, l = 0; l < h.length; l++)
this.addFold(h[l]);
var n = this.foldData;
n.splice(n.indexOf(d), 1);
}, C.prototype.toString = function() {
var d = [this.range.toString() + ": ["];
return this.folds.forEach(function(h) {
d.push(" " + h.toString());
}), d.push("]"), d.join(`
`);
}, C.prototype.idxToPosition = function(d) {
for (var h = 0, l = 0; l < this.folds.length; l++) {
var n = this.folds[l];
if ((d -= n.start.column - h) < 0)
return { row: n.start.row, column: n.start.column + d };
if ((d -= n.placeholder.length) < 0)
return n.start;
h = n.end.column;
}
return { row: this.end.row, column: this.end.column + d };
}, f.FoldLine = C;
}), ace.define("ace/range_list", ["require", "exports", "module", "ace/range"], function(C, f, R) {
var y = C("./range").Range.comparePoints, C = (d.prototype.pointIndex = function(h, l, n) {
for (var o = this.ranges, i = n || 0; i < o.length; i++) {
var a = o[i], r = y(h, a.end);
if (!(0 < r))
return a = y(h, a.start), r === 0 ? l && a !== 0 ? -i - 2 : i : 0 < a || a === 0 && !l ? i : -i - 1;
}
return -i - 1;
}, d.prototype.add = function(h) {
var n = !h.isEmpty(), l = this.pointIndex(h.start, n), n = this.pointIndex(h.end, n, l = l < 0 ? -l - 1 : l);
return n < 0 ? n = -n - 1 : n++, this.ranges.splice(l, n - l, h);
}, d.prototype.addList = function(h) {
for (var l = [], n = h.length; n--; )
l.push.apply(l, this.add(h[n]));
return l;
}, d.prototype.substractPoint = function(h) {
if (h = this.pointIndex(h), 0 <= h)
return this.ranges.splice(h, 1);
}, d.prototype.merge = function() {
for (var h = [], l = this.ranges, n = (l = l.sort(function(r, e2) {
return y(r.start, e2.start);
}))[0], o = 1; o < l.length; o++) {
var i = n, n = l[o], a = y(i.end, n.start);
a < 0 || (a != 0 || i.isEmpty() || n.isEmpty()) && (y(i.end, n.end) < 0 && (i.end.row = n.end.row, i.end.column = n.end.column), l.splice(o, 1), h.push(n), n = i, o--);
}
return this.ranges = l, h;
}, d.prototype.contains = function(h, l) {
return 0 <= this.pointIndex({ row: h, column: l });
}, d.prototype.containsPoint = function(h) {
return 0 <= this.pointIndex(h);
}, d.prototype.rangeAtPoint = function(h) {
if (h = this.pointIndex(h), 0 <= h)
return this.ranges[h];
}, d.prototype.clipRows = function(h, l) {
var n = this.ranges;
if (n[0].start.row > l || n[n.length - 1].start.row < h)
return [];
for (var h = this.pointIndex({ row: h, column: 0 }), o = this.pointIndex({ row: l, column: 0 }, h = h < 0 ? -h - 1 : h), i = (o < 0 && (o = -o - 1), []), a = h; a < o; a++)
i.push(n[a]);
return i;
}, d.prototype.removeAll = function() {
return this.ranges.splice(0, this.ranges.length);
}, d.prototype.attach = function(h) {
this.session && this.detach(), this.session = h, this.onChange = this.$onChange.bind(this), this.session.on("change", this.onChange);
}, d.prototype.detach = function() {
this.session && (this.session.removeListener("change", this.onChange), this.session = null);
}, d.prototype.$onChange = function(h) {
for (var l = h.start, n = h.end, o = l.row, i = n.row, a = this.ranges, r = 0, e2 = a.length; r < e2 && !((c = a[r]).end.row >= o); r++)
;
if (h.action == "insert")
for (var t = i - o, s = -l.column + n.column; r < e2 && !((c = a[r]).start.row > o); r++)
c.start.row == o && c.start.column >= l.column && (c.start.column == l.column && this.$bias <= 0 || (c.start.column += s, c.start.row += t)), c.end.row == o && c.end.column >= l.column && (c.end.column == l.column && this.$bias < 0 || (c.end.column == l.column && 0 < s && r < e2 - 1 && c.end.column > c.start.column && c.end.column == a[r + 1].start.column && (c.end.column -= s), c.end.column += s, c.end.row += t));
else
for (var c, t = o - i, s = l.column - n.column; r < e2 && !((c = a[r]).start.row > i); r++)
c.end.row < i && (o < c.end.row || o == c.end.row && l.column < c.end.column) ? (c.end.row = o, c.end.column = l.column) : c.end.row == i ? c.end.column <= n.column ? (t || c.end.column > l.column) && (c.end.column = l.column, c.end.row = l.row) : (c.end.column += s, c.end.row += t) : c.end.row > i && (c.end.row += t), c.start.row < i && (o < c.start.row || o == c.start.row && l.column < c.start.column) ? (c.start.row = o, c.start.column = l.column) : c.start.row == i ? c.start.column <= n.column ? (t || c.start.column > l.column) && (c.start.column = l.column, c.start.row = l.row) : (c.start.column += s, c.start.row += t) : c.start.row > i && (c.start.row += t);
if (t != 0 && r < e2)
for (; r < e2; r++)
(c = a[r]).start.row += t, c.end.row += t;
}, d);
function d() {
this.ranges = [], this.$bias = 1;
}
C.prototype.comparePoints = y, f.RangeList = C;
}), ace.define("ace/edit_session/fold", ["require", "exports", "module", "ace/range_list"], function(d, f, R) {
var y, C, h = this && this.__extends || (y = function(i, a) {
return (y = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? function(r, e2) {
r.__proto__ = e2;
} : function(r, e2) {
for (var t in e2)
Object.prototype.hasOwnProperty.call(e2, t) && (r[t] = e2[t]);
}))(i, a);
}, function(i, a) {
if (typeof a != "function" && a !== null)
throw new TypeError("Class extends value " + String(a) + " is not a constructor or null");
function r() {
this.constructor = i;
}
y(i, a), i.prototype = a === null ? Object.create(a) : (r.prototype = a.prototype, new r());
}), d = d("../range_list").RangeList, h = (h(l, C = d), l.prototype.toString = function() {
return '"' + this.placeholder + '" ' + this.range.toString();
}, l.prototype.setFoldLine = function(i) {
this.foldLine = i, this.subFolds.forEach(function(a) {
a.setFoldLine(i);
});
}, l.prototype.clone = function() {
var i = new l(this.range.clone(), this.placeholder);
return this.subFolds.forEach(function(a) {
i.subFolds.push(a.clone());
}), i.collapseChildren = this.collapseChildren, i;
}, l.prototype.addSubFold = function(i) {
if (!this.range.isEqual(i)) {
s = i, c = this.start, n(s.start, c), n(s.end, c);
for (var a = i.start.row, r = i.start.column, e2 = 0, t = -1; e2 < this.subFolds.length && (t = this.subFolds[e2].range.compare(a, r)) == 1; e2++)
;
var s = this.subFolds[e2], c = 0;
if (t == 0) {
if (s.range.containsRange(i))
return s.addSubFold(i);
c = 1;
}
for (var a = i.range.end.row, r = i.range.end.column, p = e2, t = -1; p < this.subFolds.length && (t = this.subFolds[p].range.compare(a, r)) == 1; p++)
;
t == 0 && p++;
for (var g = this.subFolds.splice(e2, p - e2, i), b = t == 0 ? g.length - 1 : g.length, w = c; w < b; w++)
i.addSubFold(g[w]);
return i.setFoldLine(this.foldLine), i;
}
}, l.prototype.restoreRange = function(i) {
return i = i, a = this.start, o(i.start, a), void o(i.end, a);
var a;
}, l);
function l(i, a) {
var r = C.call(this) || this;
return r.foldLine = null, r.placeholder = a, r.range = i, r.start = i.start, r.end = i.end, r.sameRow = i.start.row == i.end.row, r.subFolds = r.ranges = [], r;
}
function n(i, a) {
i.row -= a.row, i.row == 0 && (i.column -= a.column);
}
function o(i, a) {
i.row == 0 && (i.column += a.column), i.row += a.row;
}
f.Fold = h;
}), ace.define("ace/edit_session/folding", ["require", "exports", "module", "ace/range", "ace/edit_session/fold_line", "ace/edit_session/fold", "ace/token_iterator", "ace/mouse/mouse_event"], function(A, f, R) {
var y = A("../range").Range, C = A("./fold_line").FoldLine, d = A("./fold").Fold, h = A("../token_iterator").TokenIterator, l = A("../mouse/mouse_event").MouseEvent;
f.Folding = function() {
this.getFoldAt = function(n, o, i) {
var a = this.getFoldLine(n);
if (!a)
return null;
for (var r = a.folds, e2 = 0; e2 < r.length; e2++) {
var t = r[e2].range;
if (t.contains(n, o) && (i != 1 || !t.isEnd(n, o) || t.isEmpty()) && (i != -1 || !t.isStart(n, o) || t.isEmpty()))
return r[e2];
}
}, this.getFoldsInRange = function(n) {
var o = n.start, i = n.end, a = this.$foldData, r = [];
o.column += 1, --i.column;
for (var e2 = 0; e2 < a.length; e2++) {
var t = a[e2].range.compareRange(n);
if (t != 2) {
if (t == -2)
break;
for (var s = a[e2].folds, c = 0; c < s.length; c++) {
var p = s[c];
if ((t = p.range.compareRange(n)) == -2)
break;
if (t != 2) {
if (t == 42)
break;
r.push(p);
}
}
}
}
return --o.column, i.column += 1, r;
}, this.getFoldsInRangeList = function(n) {
var o;
return Array.isArray(n) ? (o = [], n.forEach(function(i) {
o = o.concat(this.getFoldsInRange(i));
}, this)) : o = this.getFoldsInRange(n), o;
}, this.getAllFolds = function() {
for (var n = [], o = this.$foldData, i = 0; i < o.length; i++)
for (var a = 0; a < o[i].folds.length; a++)
n.push(o[i].folds[a]);
return n;
}, this.getFoldStringAt = function(n, o, i, a) {
if (!(a = a || this.getFoldLine(n)))
return null;
for (var r, e2 = { end: { column: 0 } }, t = 0; t < a.folds.length; t++) {
var s, c = (s = a.folds[t]).range.compareEnd(n, o);
if (c == -1) {
r = this.getLine(s.start.row).substring(e2.end.column, s.start.column);
break;
}
if (c === 0)
return null;
e2 = s;
}
return r = r || this.getLine(s.start.row).substring(e2.end.column), i == -1 ? r.substring(0, o - e2.end.column) : i == 1 ? r.substring(o - e2.end.column) : r;
}, this.getFoldLine = function(n, o) {
var i = this.$foldData, a = 0;
for ((a = o ? i.indexOf(o) : a) == -1 && (a = 0); a < i.length; a++) {
var r = i[a];
if (r.start.row <= n && r.end.row >= n)
return r;
if (r.end.row > n)
return null;
}
return null;
}, this.getNextFoldLine = function(n, o) {
var i = this.$foldData, a = 0;
for ((a = o ? i.indexOf(o) : a) == -1 && (a = 0); a < i.length; a++) {
var r = i[a];
if (r.end.row >= n)
return r;
}
return null;
}, this.getFoldedRowCount = function(n, o) {
for (var i = this.$foldData, a = o - n + 1, r = 0; r < i.length; r++) {
var t = i[r], e2 = t.end.row, t = t.start.row;
if (o <= e2) {
t < o && (n <= t ? a -= o - t : a = 0);
break;
}
n <= e2 && (a -= n <= t ? e2 - t : e2 - n + 1);
}
return a;
}, this.$addFoldLine = function(n) {
return this.$foldData.push(n), this.$foldData.sort(function(o, i) {
return o.start.row - i.start.row;
}), n;
}, this.addFold = function(t, c) {
var i, a = this.$foldData, r = false, e2 = (t instanceof d ? i = t : (i = new d(c, t)).collapseChildren = c.collapseChildren, this.$clipRangeToDocument(i.range), i.start.row), t = i.start.column, s = i.end.row, c = i.end.column, p = this.getFoldAt(e2, t, 1), g = this.getFoldAt(s, c, -1);
if (p && g == p)
return p.addSubFold(i);
p && !p.range.isStart(e2, t) && this.removeFold(p), g && !g.range.isEnd(s, c) && this.removeFold(g), t = this.getFoldsInRange(i.range), 0 < t.length && (this.removeFolds(t), i.collapseChildren || t.forEach(function(M) {
i.addSubFold(M);
}));
for (var b = 0; b < a.length; b++) {
var w = a[b];
if (s == w.start.row) {
w.addFold(i), r = true;
break;
}
if (e2 == w.end.row) {
if (w.addFold(i), r = true, !i.sameRow) {
var E = a[b + 1];
if (E && E.start.row == s) {
w.merge(E);
break;
}
}
break;
}
if (s <= w.start.row)
break;
}
return r || (w = this.$addFoldLine(new C(this.$foldData, i))), this.$useWrapMode ? this.$updateWrapData(w.start.row, w.start.row) : this.$updateRowLengthCache(w.start.row, w.start.row), this.$modified = true, this._signal("changeFold", { data: i, action: "add" }), i;
}, this.addFolds = function(n) {
n.forEach(function(o) {
this.addFold(o);
}, this);
}, this.removeFold = function(n) {
var o = n.foldLine, i = o.start.row, a = o.end.row, r = this.$foldData, e2 = o.folds;
e2.length == 1 ? r.splice(r.indexOf(o), 1) : o.range.isEnd(n.end.row, n.end.column) ? (e2.pop(), o.end.row = e2[e2.length - 1].end.row, o.end.column = e2[e2.length - 1].end.column) : o.range.isStart(n.start.row, n.start.column) ? (e2.shift(), o.start.row = e2[0].start.row, o.start.column = e2[0].start.column) : n.sameRow ? e2.splice(e2.indexOf(n), 1) : ((e2 = (r = o.split(n.start.row, n.start.column)).folds).shift(), r.start.row = e2[0].start.row, r.start.column = e2[0].start.column), this.$updating || (this.$useWrapMode ? this.$updateWrapData(i, a) : this.$updateRowLengthCache(i, a)), this.$modified = true, this._signal("changeFold", { data: n, action: "remove" });
}, this.removeFolds = function(n) {
for (var o = [], i = 0; i < n.length; i++)
o.push(n[i]);
o.forEach(function(a) {
this.removeFold(a);
}, this), this.$modified = true;
}, this.expandFold = function(n) {
this.removeFold(n), n.subFolds.forEach(function(o) {
n.restoreRange(o), this.addFold(o);
}, this), 0 < n.collapseChildren && this.foldAll(n.start.row + 1, n.end.row, n.collapseChildren - 1), n.subFolds = [];
}, this.expandFolds = function(n) {
n.forEach(function(o) {
this.expandFold(o);
}, this);
}, this.unfold = function(n, o) {
var i;
if (n == null)
i = new y(0, 0, this.getLength(), 0), o == null && (o = true);
else if (typeof n == "number")
i = new y(n, 0, n, this.getLine(n).length);
else if ("row" in n)
i = y.fromPoints(n, n);
else {
if (Array.isArray(n))
return a = [], n.forEach(function(r) {
a = a.concat(this.unfold(r));
}, this), a;
i = n;
}
for (var a, n = a = this.getFoldsInRangeList(i); a.length == 1 && y.comparePoints(a[0].start, i.start) < 0 && 0 < y.comparePoints(a[0].end, i.end); )
this.expandFolds(a), a = this.getFoldsInRangeList(i);
if (o != 0 ? this.removeFolds(a) : this.expandFolds(a), n.length)
return n;
}, this.isRowFolded = function(n, o) {
return !!this.getFoldLine(n, o);
}, this.getRowFoldEnd = function(n, o) {
return o = this.getFoldLine(n, o), o ? o.end.row : n;
}, this.getRowFoldStart = function(n, o) {
return o = this.getFoldLine(n, o), o ? o.start.row : n;
}, this.getFoldDisplayLine = function(n, o, i, a, r) {
a == null && (a = n.start.row), r == null && (r = 0), o == null && (o = n.end.row), i == null && (i = this.getLine(o).length);
var e2 = this.doc, t = "";
return n.walk(function(s, c, p, g) {
if (!(c < a)) {
if (c == a) {
if (p < r)
return;
g = Math.max(r, g);
}
t += s ?? e2.getLine(c).substring(g, p);
}
}, o, i), t;
}, this.getDisplayLine = function(n, o, i, a) {
var r = this.getFoldLine(n);
return r ? this.getFoldDisplayLine(r, n, o, i, a) : (r = this.doc.getLine(n)).substring(a || 0, o || r.length);
}, this.$cloneFoldData = function() {
var n = [];
return n = this.$foldData.map(function(o) {
return o = o.folds.map(function(i) {
return i.clone();
}), new C(n, o);
});
}, this.toggleFold = function(n) {
var o = this.selection.getRange();
if (o.isEmpty()) {
var i, a = o.start;
if (i = this.getFoldAt(a.row, a.column))
return void this.expandFold(i);
(r = this.findMatchingBracket(a)) ? o.comparePoint(r) == 1 ? o.end = r : (o.start = r, o.start.column++, o.end.column--) : (r = this.findMatchingBracket({ row: a.row, column: a.column + 1 })) ? (o.comparePoint(r) == 1 ? o.end = r : o.start = r, o.start.column++) : o = this.getCommentFoldRange(a.row, a.column) || o;
} else {
var r = this.getFoldsInRange(o);
if (n && r.length)
return void this.expandFolds(r);
r.length == 1 && (i = r[0]);
}
if ((i = i || this.getFoldAt(o.start.row, o.start.column)) && i.range.toString() == o.toString())
this.expandFold(i);
else {
if (a = "...", !o.isMultiLine()) {
if ((a = this.getTextRange(o)).length < 4)
return;
a = a.trim().substring(0, 2) + "..";
}
this.addFold(a, o);
}
}, this.getCommentFoldRange = function(n, o, i) {
var a = new h(this, n, o), r = a.getCurrentToken(), e2 = r && r.type;
if (r && /^comment|string/.test(e2)) {
(e2 = e2.match(/comment|string/)[0]) == "comment" && (e2 += "|doc-start|\\.doc");
var t = new RegExp(e2), e2 = new y();
if (i != 1) {
for (; (r = a.stepBackward()) && t.test(r.type) && !/^comment.end/.test(r.type); )
;
r = a.stepForward();
}
if (e2.start.row = a.getCurrentTokenRow(), e2.start.column = a.getCurrentTokenColumn() + (/^comment.start/.test(r.type) ? r.value.length : 2), a = new h(this, n, o), i != -1) {
var s = -1;
do
if (r = a.stepForward(), s == -1) {
var c = this.getState(a.$row);
t.test(c) || (s = a.$row);
} else if (a.$row > s)
break;
while (r && t.test(r.type) && !/^comment.start/.test(r.type));
r = a.stepBackward();
} else
r = a.getCurrentToken();
return e2.end.row = a.getCurrentTokenRow(), e2.end.column = a.getCurrentTokenColumn(), /^comment.end/.test(r.type) || (e2.end.column += r.value.length - 2), e2;
}
}, this.foldAll = function(n, o, i, a) {
i == null && (i = 1e5);
var r = this.foldWidgets;
if (r) {
o = o || this.getLength();
for (var e2, t = n = n || 0; t < o; t++)
r[t] == null && (r[t] = this.getFoldWidget(t)), r[t] != "start" || a && !a(t) || (e2 = this.getFoldWidgetRange(t)) && e2.isMultiLine() && e2.end.row <= o && e2.start.row >= n && (t = e2.end.row, e2.collapseChildren = i, this.addFold("...", e2));
}
}, this.foldToLevel = function(n) {
for (this.foldAll(); 0 < n--; )
this.unfold(null, false);
}, this.foldAllComments = function() {
var n = this;
this.foldAll(null, null, null, function(o) {
for (var i = n.getTokens(o), a = 0; a < i.length; a++) {
var r = i[a];
if (r.type != "text" || !/^\s+$/.test(r.value))
return !!/comment/.test(r.type);
}
});
}, this.$foldStyles = { manual: 1, markbegin: 1, markbeginend: 1 }, this.$foldStyle = "markbegin", this.setFoldStyle = function(n) {
if (!this.$foldStyles[n])
throw new Error("invalid fold style: " + n + "[" + Object.keys(this.$foldStyles).join(", ") + "]");
this.$foldStyle != n && ((this.$foldStyle = n) == "manual" && this.unfold(), n = this.$foldMode, this.$setFolding(null), this.$setFolding(n));
}, this.$setFolding = function(n) {
this.$foldMode != n && (this.$foldMode = n, this.off("change", this.$updateFoldWidgets), this.off("tokenizerUpdate", this.$tokenizerUpdateFoldWidgets), this._signal("changeAnnotation"), n && this.$foldStyle != "manual" ? (this.foldWidgets = [], this.getFoldWidget = n.getFoldWidget.bind(n, this, this.$foldStyle), this.getFoldWidgetRange = n.getFoldWidgetRange.bind(n, this, this.$foldStyle), this.$updateFoldWidgets = this.updateFoldWidgets.bind(this), this.$tokenizerUpdateFoldWidgets = this.tokenizerUpdateFoldWidgets.bind(this), this.on("change", this.$updateFoldWidgets), this.on("tokenizerUpdate", this.$tokenizerUpdateFoldWidgets)) : this.foldWidgets = null);
}, this.getParentFoldRangeData = function(n, o) {
var i = this.foldWidgets;
if (!i || o && i[n])
return {};
for (var a = n - 1; 0 <= a; ) {
var r = i[a];
if ((r = r ?? (i[a] = this.getFoldWidget(a))) == "start") {
var e2 = this.getFoldWidgetRange(a), t = t || e2;
if (e2 && e2.end.row >= n)
break;
}
a--;
}
return { range: a !== -1 && e2, firstRange: t };
}, this.onFoldWidgetClick = function(n, o) {
var i = { children: (o = o instanceof l ? o.domEvent : o).shiftKey, all: o.ctrlKey || o.metaKey, siblings: o.altKey };
this.$toggleFoldWidget(n, i) || (n = o.target || o.srcElement) && /ace_fold-widget/.test(n.className) && (n.className += " ace_invalid");
}, this.$toggleFoldWidget = function(n, o) {
var i, a, r, e2;
if (this.getFoldWidget)
return i = this.getFoldWidget(n), a = this.getLine(n), (a = this.getFoldAt(n, (i = i === "end" ? -1 : 1) == -1 ? 0 : a.length, i)) ? (o.children || o.all ? this.removeFold(a) : this.expandFold(a), a) : (i = this.getFoldWidgetRange(n, true)) && !i.isMultiLine() && (a = this.getFoldAt(i.start.row, i.start.column, 1)) && i.isEqual(a.range) ? (this.removeFold(a), a) : (o.siblings ? ((a = this.getParentFoldRangeData(n)).range && (r = a.range.start.row + 1, e2 = a.range.end.row), this.foldAll(r, e2, o.all ? 1e4 : 0)) : o.children ? (e2 = i ? i.end.row : this.getLength(), this.foldAll(n + 1, e2, o.all ? 1e4 : 0)) : i && (o.all && (i.collapseChildren = 1e4), this.addFold("...", i)), i);
}, this.toggleFoldWidget = function(n) {
var o, i = this.selection.getCursor().row;
i = this.getRowFoldStart(i), !this.$toggleFoldWidget(i, {}) && (o = (o = this.getParentFoldRangeData(i, true)).range || o.firstRange) && (i = o.start.row, (i = this.getFoldAt(i, this.getLine(i).length, 1)) ? this.removeFold(i) : this.addFold("...", o));
}, this.updateFoldWidgets = function(n) {
var o = n.start.row, i = n.end.row - o;
i == 0 ? this.foldWidgets[o] = null : n.action == "remove" ? this.foldWidgets.splice(o, 1 + i, null) : ((n = Array(1 + i)).unshift(o, 1), this.foldWidgets.splice.apply(this.foldWidgets, n));
}, this.tokenizerUpdateFoldWidgets = function(n) {
n = n.data, n.first != n.last && this.foldWidgets.length > n.first && this.foldWidgets.splice(n.first, this.foldWidgets.length);
};
};
}), ace.define("ace/edit_session/bracket_match", ["require", "exports", "module", "ace/token_iterator", "ace/range"], function(A, f, R) {
var y = A("../token_iterator").TokenIterator, C = A("../range").Range;
f.BracketMatch = function() {
this.findMatchingBracket = function(d, h) {
return d.column != 0 && (h = h || this.getLine(d.row).charAt(d.column - 1)) != "" && (h = h.match(/([\(\[\{])|([\)\]\}])/)) ? h[1] ? this.$findClosingBracket(h[1], d) : this.$findOpeningBracket(h[2], d) : null;
}, this.getBracketRange = function(d) {
var h, l, n = this.getLine(d.row), o = true, i = n.charAt(d.column - 1), a = i && i.match(/([\(\[\{])|([\)\]\}])/);
if (a || (i = n.charAt(d.column), d = { row: d.row, column: d.column + 1 }, a = i && i.match(/([\(\[\{])|([\)\]\}])/), o = false), !a)
return null;
if (a[1]) {
if (!(l = this.$findClosingBracket(a[1], d)))
return null;
h = C.fromPoints(d, l), o || (h.end.column++, h.start.column--), h.cursor = h.end;
} else {
if (!(l = this.$findOpeningBracket(a[2], d)))
return null;
h = C.fromPoints(l, d), o || (h.start.column++, h.end.column--), h.cursor = h.start;
}
return h;
}, this.getMatchingBracketRanges = function(d, h) {
var l = this.getLine(d.row), n = /([\(\[\{])|([\)\]\}])/, o = !h && l.charAt(d.column - 1), i = o && o.match(n);
return i || (o = (h === void 0 || h) && l.charAt(d.column), d = { row: d.row, column: d.column + 1 }, i = o && o.match(n)), i ? (h = new C(d.row, d.column - 1, d.row, d.column), (l = i[1] ? this.$findClosingBracket(i[1], d) : this.$findOpeningBracket(i[2], d)) ? [h, new C(l.row, l.column, l.row, l.column + 1)] : [h]) : null;
}, this.$brackets = { ")": "(", "(": ")", "]": "[", "[": "]", "{": "}", "}": "{", "<": ">", ">": "<" }, this.$findOpeningBracket = function(d, h, l) {
var n = this.$brackets[d], o = 1, i = new y(this, h.row, h.column), a = i.getCurrentToken();
if (a = a || i.stepForward()) {
l = l || new RegExp("(\\.?" + a.type.replace(".", "\\.").replace("rparen", ".paren").replace(/\b(?:end)\b/, "(?:start|begin|end)").replace(/-close\b/, "-(close|open)") + ")+");
for (var r = h.column - i.getCurrentTokenColumn() - 2, e2 = a.value; ; ) {
for (; 0 <= r; ) {
var t = e2.charAt(r);
if (t == n) {
if (--o == 0)
return { row: i.getCurrentTokenRow(), column: r + i.getCurrentTokenColumn() };
} else
t == d && (o += 1);
--r;
}
for (; (a = i.stepBackward()) && !l.test(a.type); )
;
if (a == null)
break;
r = (e2 = a.value).length - 1;
}
return null;
}
}, this.$findClosingBracket = function(d, h, l) {
var n = this.$brackets[d], o = 1, i = new y(this, h.row, h.column), a = i.getCurrentToken();
if (a = a || i.stepForward()) {
l = l || new RegExp("(\\.?" + a.type.replace(".", "\\.").replace("lparen", ".paren").replace(/\b(?:start|begin)\b/, "(?:start|begin|end)").replace(/-open\b/, "-(close|open)") + ")+");
for (var r = h.column - i.getCurrentTokenColumn(); ; ) {
for (var e2 = a.value, t = e2.length; r < t; ) {
var s = e2.charAt(r);
if (s == n) {
if (--o == 0)
return { row: i.getCurrentTokenRow(), column: r + i.getCurrentTokenColumn() };
} else
s == d && (o += 1);
r += 1;
}
for (; (a = i.stepForward()) && !l.test(a.type); )
;
if (a == null)
break;
r = 0;
}
return null;
}
}, this.getMatchingTags = function(h) {
var h = new y(this, h.row, h.column), l = this.$findTagName(h);
if (l)
return h.stepBackward().value === "<" ? this.$findClosingTag(h, l) : this.$findOpeningTag(h, l);
}, this.$findTagName = function(d) {
var h = d.getCurrentToken(), l = false, n = false;
if (h && h.type.indexOf("tag-name") === -1)
for (; (h = n ? d.stepBackward() : d.stepForward()) && (h.value === "/>" ? n = true : h.type.indexOf("tag-name") !== -1 && (l = true)), h && !l; )
;
return h;
}, this.$findClosingTag = function(d, h) {
var l = h.value, n = h.value, o = 0, i = new C(d.getCurrentTokenRow(), d.getCurrentTokenColumn(), d.getCurrentTokenRow(), d.getCurrentTokenColumn() + 1), a = (h = d.stepForward(), new C(d.getCurrentTokenRow(), d.getCurrentTokenColumn(), d.getCurrentTokenRow(), d.getCurrentTokenColumn() + h.value.length)), r = false;
do {
var e2, t = h;
if (h = d.stepForward())
if (h.value !== ">" || r || (e2 = new C(d.getCurrentTokenRow(), d.getCurrentTokenColumn(), d.getCurrentTokenRow(), d.getCurrentTokenColumn() + 1), r = true), h.type.indexOf("tag-name") !== -1) {
if (n === (l = h.value)) {
if (t.value === "<")
o++;
else if (t.value === "" && --o < 0) {
d.stepBackward();
var s = new C(d.getCurrentTokenRow(), d.getCurrentTokenColumn(), d.getCurrentTokenRow(), d.getCurrentTokenColumn() + 2), c = (h = d.stepForward(), new C(d.getCurrentTokenRow(), d.getCurrentTokenColumn(), d.getCurrentTokenRow(), d.getCurrentTokenColumn() + h.value.length));
if (!(h = d.stepForward()) || h.value !== ">")
return;
var p = new C(d.getCurrentTokenRow(), d.getCurrentTokenColumn(), d.getCurrentTokenRow(), d.getCurrentTokenColumn() + 1);
}
}
} else
n === l && h.value === "/>" && --o < 0 && (p = c = s = new C(d.getCurrentTokenRow(), d.getCurrentTokenColumn(), d.getCurrentTokenRow(), d.getCurrentTokenColumn() + 2), e2 = new C(a.end.row, a.end.column, a.end.row, a.end.column + 1));
} while (h && 0 <= o);
if (i && e2 && s && p && a && c)
return { openTag: new C(i.start.row, i.start.column, e2.end.row, e2.end.column), closeTag: new C(s.start.row, s.start.column, p.end.row, p.end.column), openTagName: a, closeTagName: c };
}, this.$findOpeningTag = function(d, h) {
var l, n = d.getCurrentToken(), o = h.value, i = 0, a = d.getCurrentTokenRow(), r = d.getCurrentTokenColumn(), e2 = new C(a, r, a, r + 2), t = (d.stepForward(), new C(d.getCurrentTokenRow(), d.getCurrentTokenColumn(), d.getCurrentTokenRow(), d.getCurrentTokenColumn() + h.value.length));
if ((h = d.stepForward()) && h.value === ">") {
var s = new C(d.getCurrentTokenRow(), d.getCurrentTokenColumn(), d.getCurrentTokenRow(), d.getCurrentTokenColumn() + 1);
d.stepBackward(), d.stepBackward();
do
if (h = n, a = d.getCurrentTokenRow(), l = (r = d.getCurrentTokenColumn()) + h.value.length, n = d.stepBackward(), h) {
if (h.type.indexOf("tag-name") !== -1) {
if (o === h.value)
if (n.value === "<") {
if (0 < ++i) {
for (var c = new C(a, r, a, l), p = new C(d.getCurrentTokenRow(), d.getCurrentTokenColumn(), d.getCurrentTokenRow(), d.getCurrentTokenColumn() + 1); (h = d.stepForward()) && h.value !== ">"; )
;
var g = new C(d.getCurrentTokenRow(), d.getCurrentTokenColumn(), d.getCurrentTokenRow(), d.getCurrentTokenColumn() + 1);
}
} else
n.value === "" && i--;
} else if (h.value === "/>") {
for (var b = 0, w = n; w; ) {
if (w.type.indexOf("tag-name") !== -1 && w.value === o) {
i--;
break;
}
if (w.value === "<")
break;
w = d.stepBackward(), b++;
}
for (var E = 0; E < b; E++)
d.stepForward();
}
}
while (n && i <= 0);
return p && g && e2 && s && c && t ? { openTag: new C(p.start.row, p.start.column, g.end.row, g.end.column), closeTag: new C(e2.start.row, e2.start.column, s.end.row, s.end.column), openTagName: c, closeTagName: t } : void 0;
}
};
};
}), ace.define("ace/edit_session", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/bidihandler", "ace/config", "ace/lib/event_emitter", "ace/selection", "ace/mode/text", "ace/range", "ace/document", "ace/background_tokenizer", "ace/search_highlight", "ace/undomanager", "ace/edit_session/folding", "ace/edit_session/bracket_match"], function(A, f, R) {
var y = A("./lib/oop"), C = A("./lib/lang"), d = A("./bidihandler").BidiHandler, h = A("./config"), l = A("./lib/event_emitter").EventEmitter, n = A("./selection").Selection, o = A("./mode/text").Mode, i = A("./range").Range, a = A("./document").Document, r = A("./background_tokenizer").BackgroundTokenizer, e2 = A("./search_highlight").SearchHighlight, t = A("./undomanager").UndoManager, s = (c.prototype.setDocument = function(u) {
this.doc && this.doc.off("change", this.$onChange), (this.doc = u).on("change", this.$onChange, true), this.bgTokenizer.setDocument(this.getDocument()), this.resetCaches();
}, c.prototype.getDocument = function() {
return this.doc;
}, c.prototype.$resetRowCache = function(u) {
var _;
u ? (_ = this.$docRowCache.length, (u = this.$getRowCacheIndex(this.$docRowCache, u) + 1) < _ && (this.$docRowCache.splice(u, _), this.$screenRowCache.splice(u, _))) : (this.$docRowCache = [], this.$screenRowCache = []);
}, c.prototype.$getRowCacheIndex = function(u, _) {
for (var v = 0, $ = u.length - 1; v <= $; ) {
var G = v + $ >> 1, W = u[G];
if (W < _)
v = 1 + G;
else {
if (!(_ < W))
return G;
$ = G - 1;
}
}
return v - 1;
}, c.prototype.resetCaches = function() {
this.$modified = true, this.$wrapData = [], this.$rowLengthCache = [], this.$resetRowCache(0), this.destroyed || this.bgTokenizer.start(0);
}, c.prototype.onChangeFold = function(u) {
u = u.data, this.$resetRowCache(u.start.row);
}, c.prototype.onChange = function(u) {
this.$modified = true, this.$bidiHandler.onChange(u), this.$resetRowCache(u.start.row);
var _ = this.$updateInternalDataOnChange(u);
!this.$fromUndo && this.$undoManager && (_ && _.length && (this.$undoManager.add({ action: "removeFolds", folds: _ }, this.mergeUndoDeltas), this.mergeUndoDeltas = true), this.$undoManager.add(u, this.mergeUndoDeltas), this.mergeUndoDeltas = true, this.$informUndoManager.schedule()), this.bgTokenizer.$updateOnChange(u), this._signal("change", u);
}, c.prototype.setValue = function(u) {
this.doc.setValue(u), this.selection.moveTo(0, 0), this.$resetRowCache(0), this.setUndoManager(this.$undoManager), this.getUndoManager().reset();
}, c.fromJSON = function(u) {
u = JSON.parse(u);
var _ = new t(), v = (_.$undoStack = u.history.undo, _.$redoStack = u.history.redo, _.mark = u.history.mark, _.$rev = u.history.rev, new c(u.value));
return u.folds.forEach(function($) {
v.addFold("...", i.fromPoints($.start, $.end));
}), v.setAnnotations(u.annotations), v.setBreakpoints(u.breakpoints), v.setMode(u.mode), v.setScrollLeft(u.scrollLeft), v.setScrollTop(u.scrollTop), v.setUndoManager(_), v.selection.fromJSON(u.selection), v;
}, c.prototype.toJSON = function() {
return { annotations: this.$annotations, breakpoints: this.$breakpoints, folds: this.getAllFolds().map(function(u) {
return u.range;
}), history: this.getUndoManager(), mode: this.$mode.$id, scrollLeft: this.$scrollLeft, scrollTop: this.$scrollTop, selection: this.selection.toJSON(), value: this.doc.getValue() };
}, c.prototype.toString = function() {
return this.doc.getValue();
}, c.prototype.getSelection = function() {
return this.selection;
}, c.prototype.getState = function(u) {
return this.bgTokenizer.getState(u);
}, c.prototype.getTokens = function(u) {
return this.bgTokenizer.getTokens(u);
}, c.prototype.getTokenAt = function(u, _) {
var v = this.bgTokenizer.getTokens(u), G = 0;
if (_ == null)
var $ = v.length - 1, G = this.getLine(u).length;
else
for ($ = 0; $ < v.length && !(_ <= (G += v[$].value.length)); $++)
;
return (u = v[$]) ? (u.index = $, u.start = G - u.value.length, u) : null;
}, c.prototype.setUndoManager = function(u) {
var _;
this.$undoManager = u, this.$informUndoManager && this.$informUndoManager.cancel(), u ? (u.addSession(_ = this), this.$syncInformUndoManager = function() {
_.$informUndoManager.cancel(), _.mergeUndoDeltas = false;
}, this.$informUndoManager = C.delayedCall(this.$syncInformUndoManager)) : this.$syncInformUndoManager = function() {
};
}, c.prototype.markUndoGroup = function() {
this.$syncInformUndoManager && this.$syncInformUndoManager();
}, c.prototype.getUndoManager = function() {
return this.$undoManager || this.$defaultUndoManager;
}, c.prototype.getTabString = function() {
return this.getUseSoftTabs() ? C.stringRepeat(" ", this.getTabSize()) : " ";
}, c.prototype.setUseSoftTabs = function(u) {
this.setOption("useSoftTabs", u);
}, c.prototype.getUseSoftTabs = function() {
return this.$useSoftTabs && !this.$mode.$indentWithTabs;
}, c.prototype.setTabSize = function(u) {
this.setOption("tabSize", u);
}, c.prototype.getTabSize = function() {
return this.$tabSize;
}, c.prototype.isTabStop = function(u) {
return this.$useSoftTabs && u.column % this.$tabSize == 0;
}, c.prototype.setNavigateWithinSoftTabs = function(u) {
this.setOption("navigateWithinSoftTabs", u);
}, c.prototype.getNavigateWithinSoftTabs = function() {
return this.$navigateWithinSoftTabs;
}, c.prototype.setOverwrite = function(u) {
this.setOption("overwrite", u);
}, c.prototype.getOverwrite = function() {
return this.$overwrite;
}, c.prototype.toggleOverwrite = function() {
this.setOverwrite(!this.$overwrite);
}, c.prototype.addGutterDecoration = function(u, _) {
this.$decorations[u] || (this.$decorations[u] = ""), this.$decorations[u] += " " + _, this._signal("changeBreakpoint", {});
}, c.prototype.removeGutterDecoration = function(u, _) {
this.$decorations[u] = (this.$decorations[u] || "").replace(" " + _, ""), this._signal("changeBreakpoint", {});
}, c.prototype.getBreakpoints = function() {
return this.$breakpoints;
}, c.prototype.setBreakpoints = function(u) {
this.$breakpoints = [];
for (var _ = 0; _ < u.length; _++)
this.$breakpoints[u[_]] = "ace_breakpoint";
this._signal("changeBreakpoint", {});
}, c.prototype.clearBreakpoints = function() {
this.$breakpoints = [], this._signal("changeBreakpoint", {});
}, c.prototype.setBreakpoint = function(u, _) {
(_ = _ === void 0 ? "ace_breakpoint" : _) ? this.$breakpoints[u] = _ : delete this.$breakpoints[u], this._signal("changeBreakpoint", {});
}, c.prototype.clearBreakpoint = function(u) {
delete this.$breakpoints[u], this._signal("changeBreakpoint", {});
}, c.prototype.addMarker = function(W, _, v, $) {
var G = this.$markerId++, W = { range: W, type: v || "line", renderer: typeof v == "function" ? v : null, clazz: _, inFront: !!$, id: G };
return $ ? (this.$frontMarkers[G] = W, this._signal("changeFrontMarker")) : (this.$backMarkers[G] = W, this._signal("changeBackMarker")), G;
}, c.prototype.addDynamicMarker = function(u, _) {
var v;
if (u.update)
return v = this.$markerId++, u.id = v, u.inFront = !!_, _ ? (this.$frontMarkers[v] = u, this._signal("changeFrontMarker")) : (this.$backMarkers[v] = u, this._signal("changeBackMarker")), u;
}, c.prototype.removeMarker = function(u) {
var _ = this.$frontMarkers[u] || this.$backMarkers[u];
_ && (delete (_.inFront ? this.$frontMarkers : this.$backMarkers)[u], this._signal(_.inFront ? "changeFrontMarker" : "changeBackMarker"));
}, c.prototype.getMarkers = function(u) {
return u ? this.$frontMarkers : this.$backMarkers;
}, c.prototype.highlight = function(u) {
var _;
this.$searchHighlight || (_ = new e2(null, "ace_selected-word", "text"), this.$searchHighlight = this.addDynamicMarker(_)), this.$searchHighlight.setRegexp(u);
}, c.prototype.highlightLines = function(u, _, v, $) {
return typeof _ != "number" && (v = _, _ = u), v = v || "ace_step", u = new i(u, 0, _, 1 / 0), u.id = this.addMarker(u, v, "fullLine", $), u;
}, c.prototype.setAnnotations = function(u) {
this.$annotations = u, this._signal("changeAnnotation", {});
}, c.prototype.getAnnotations = function() {
return this.$annotations || [];
}, c.prototype.clearAnnotations = function() {
this.setAnnotations([]);
}, c.prototype.$detectNewLine = function(u) {
u = u.match(/^.*?(\r?\n)/m), this.$autoNewLine = u ? u[1] : `
`;
}, c.prototype.getWordRange = function(u, _) {
var v, $ = this.getLine(u), G = false, W = (v = (G = (G = 0 < _ ? !!$.charAt(_ - 1).match(this.tokenRe) : G) || !!$.charAt(_).match(this.tokenRe)) ? this.tokenRe : /^\s+$/.test($.slice(_ - 1, _ + 1)) ? /\s/ : this.nonTokenRe, _);
if (0 < W) {
for (; 0 <= --W && $.charAt(W).match(v); )
;
W++;
}
for (var X = _; X < $.length && $.charAt(X).match(v); )
X++;
return new i(u, W, u, X);
}, c.prototype.getAWordRange = function(u, _) {
for (var v = this.getWordRange(u, _), $ = this.getLine(v.end.row); $.charAt(v.end.column).match(/[ \t]/); )
v.end.column += 1;
return v;
}, c.prototype.setNewLineMode = function(u) {
this.doc.setNewLineMode(u);
}, c.prototype.getNewLineMode = function() {
return this.doc.getNewLineMode();
}, c.prototype.setUseWorker = function(u) {
this.setOption("useWorker", u);
}, c.prototype.getUseWorker = function() {
return this.$useWorker;
}, c.prototype.onReloadTokenizer = function(u) {
var _ = u.data;
this.bgTokenizer.start(_.first), this._signal("tokenizerUpdate", u);
}, c.prototype.setMode = function(u, _) {
if (u && typeof u == "object") {
if (u.getTokenizer)
return this.$onChangeMode(u);
var v = u, $ = v.path;
} else
$ = u || "ace/mode/text";
this.$modes["ace/mode/text"] || (this.$modes["ace/mode/text"] = new o()), this.$modes[$] && !v ? (this.$onChangeMode(this.$modes[$]), _ && _()) : (this.$modeId = $, h.loadModule(["mode", $], (function(G) {
if (this.$modeId !== $)
return _ && _();
this.$modes[$] && !v ? this.$onChangeMode(this.$modes[$]) : G && G.Mode && (G = new G.Mode(v), v || ((this.$modes[$] = G).$id = $), this.$onChangeMode(G)), _ && _();
}).bind(this)), this.$mode || this.$onChangeMode(this.$modes["ace/mode/text"], true));
}, c.prototype.$onChangeMode = function(u, _) {
var v, $, G;
_ || (this.$modeId = u.$id), this.$mode === u || (v = this.$mode, this.$mode = u, this.$stopWorker(), this.$useWorker && this.$startWorker(), ($ = u.getTokenizer()).on !== void 0 && (G = this.onReloadTokenizer.bind(this), $.on("update", G)), this.bgTokenizer.setTokenizer($), this.bgTokenizer.setDocument(this.getDocument()), this.tokenRe = u.tokenRe, this.nonTokenRe = u.nonTokenRe, _) || (u.attachToSession && u.attachToSession(this), this.$options.wrapMethod.set.call(this, this.$wrapMethod), this.$setFolding(u.foldingRules), this.bgTokenizer.start(0), this._emit("changeMode", { oldMode: v, mode: u }));
}, c.prototype.$stopWorker = function() {
this.$worker && (this.$worker.terminate(), this.$worker = null);
}, c.prototype.$startWorker = function() {
try {
this.$worker = this.$mode.createWorker(this);
} catch (u) {
h.warn("Could not load worker", u), this.$worker = null;
}
}, c.prototype.getMode = function() {
return this.$mode;
}, c.prototype.setScrollTop = function(u) {
this.$scrollTop === u || isNaN(u) || (this.$scrollTop = u, this._signal("changeScrollTop", u));
}, c.prototype.getScrollTop = function() {
return this.$scrollTop;
}, c.prototype.setScrollLeft = function(u) {
this.$scrollLeft === u || isNaN(u) || (this.$scrollLeft = u, this._signal("changeScrollLeft", u));
}, c.prototype.getScrollLeft = function() {
return this.$scrollLeft;
}, c.prototype.getScreenWidth = function() {
return this.$computeWidth(), this.lineWidgets ? Math.max(this.getLineWidgetMaxWidth(), this.screenWidth) : this.screenWidth;
}, c.prototype.getLineWidgetMaxWidth = function() {
var u;
return this.lineWidgetsWidth != null ? this.lineWidgetsWidth : (u = 0, this.lineWidgets.forEach(function(_) {
_ && _.screenWidth > u && (u = _.screenWidth);
}), this.lineWidgetWidth = u);
}, c.prototype.$computeWidth = function(u) {
if (this.$modified || u) {
if (this.$modified = false, this.$useWrapMode)
return this.screenWidth = this.$wrapLimit;
for (var _ = this.doc.getAllLines(), v = this.$rowLengthCache, $ = 0, G = 0, W = this.$foldData[G], X = W ? W.start.row : 1 / 0, Q = _.length, K = 0; K < Q; K++) {
if (X < K) {
if (Q <= (K = W.end.row + 1))
break;
X = (W = this.$foldData[G++]) ? W.start.row : 1 / 0;
}
v[K] == null && (v[K] = this.$getStringScreenWidth(_[K])[0]), v[K] > $ && ($ = v[K]);
}
this.screenWidth = $;
}
}, c.prototype.getLine = function(u) {
return this.doc.getLine(u);
}, c.prototype.getLines = function(u, _) {
return this.doc.getLines(u, _);
}, c.prototype.getLength = function() {
return this.doc.getLength();
}, c.prototype.getTextRange = function(u) {
return this.doc.getTextRange(u || this.selection.getRange());
}, c.prototype.insert = function(u, _) {
return this.doc.insert(u, _);
}, c.prototype.remove = function(u) {
return this.doc.remove(u);
}, c.prototype.removeFullLines = function(u, _) {
return this.doc.removeFullLines(u, _);
}, c.prototype.undoChanges = function(u, _) {
if (u.length) {
this.$fromUndo = true;
for (var v = u.length - 1; v != -1; v--) {
var $ = u[v];
$.action == "insert" || $.action == "remove" ? this.doc.revertDelta($) : $.folds && this.addFolds($.folds);
}
!_ && this.$undoSelect && (u.selectionBefore ? this.selection.fromJSON(u.selectionBefore) : this.selection.setRange(this.$getUndoSelection(u, true))), this.$fromUndo = false;
}
}, c.prototype.redoChanges = function(u, _) {
if (u.length) {
this.$fromUndo = true;
for (var v = 0; v < u.length; v++) {
var $ = u[v];
$.action != "insert" && $.action != "remove" || this.doc.$safeApplyDelta($);
}
!_ && this.$undoSelect && (u.selectionAfter ? this.selection.fromJSON(u.selectionAfter) : this.selection.setRange(this.$getUndoSelection(u, false))), this.$fromUndo = false;
}
}, c.prototype.setUndoSelect = function(u) {
this.$undoSelect = u;
}, c.prototype.$getUndoSelection = function(u, _) {
function v(Q) {
return _ ? Q.action !== "insert" : Q.action === "insert";
}
for (var $, G, W = 0; W < u.length; W++) {
var X = u[W];
X.start && ($ ? v(X) ? (G = X.start, $.compare(G.row, G.column) == -1 && $.setStart(G), G = X.end, $.compare(G.row, G.column) == 1 && $.setEnd(G)) : (G = X.start, $.compare(G.row, G.column) == -1 && ($ = i.fromPoints(X.start, X.start))) : $ = v(X) ? i.fromPoints(X.start, X.end) : i.fromPoints(X.start, X.start));
}
return $;
}, c.prototype.replace = function(u, _) {
return this.doc.replace(u, _);
}, c.prototype.moveText = function(u, K, v) {
var $, G, W, X = this.getTextRange(u), Q = this.getFoldsInRange(u), K = i.fromPoints(K, K);
return v || (this.remove(u), G = u.start.row - u.end.row, (W = G ? -u.end.column : u.start.column - u.end.column) && (K.start.row == u.end.row && K.start.column > u.end.column && (K.start.column += W), K.end.row == u.end.row) && K.end.column > u.end.column && (K.end.column += W), G && K.start.row >= u.end.row && (K.start.row += G, K.end.row += G)), K.end = this.insert(K.start, X), Q.length && ($ = u.start, v = K.start, G = v.row - $.row, W = v.column - $.column, this.addFolds(Q.map(function(ne) {
return (ne = ne.clone()).start.row == $.row && (ne.start.column += W), ne.end.row == $.row && (ne.end.column += W), ne.start.row += G, ne.end.row += G, ne;
}))), K;
}, c.prototype.indentRows = function(u, _, v) {
v = v.replace(/\t/g, this.getTabString());
for (var $ = u; $ <= _; $++)
this.doc.insertInLine({ row: $, column: 0 }, v);
}, c.prototype.outdentRows = function(u) {
for (var _ = u.collapseRows(), v = new i(0, 0, 0, 0), $ = this.getTabSize(), G = _.start.row; G <= _.end.row; ++G) {
var W = this.getLine(G);
v.start.row = G, v.end.row = G;
for (var X = 0; X < $ && W.charAt(X) == " "; ++X)
;
X < $ && W.charAt(X) == " " ? (v.start.column = X, v.end.column = X + 1) : (v.start.column = 0, v.end.column = X), this.remove(v);
}
}, c.prototype.$moveLines = function(u, _, W) {
if (u = this.getRowFoldStart(u), _ = this.getRowFoldEnd(_), W < 0) {
if ((G = this.getRowFoldStart(u + W)) < 0)
return 0;
var $ = G - u;
} else if (0 < W) {
if ((G = this.getRowFoldEnd(_ + W)) > this.doc.getLength() - 1)
return 0;
$ = G - _;
} else
u = this.$clipRowToDocument(u), $ = (_ = this.$clipRowToDocument(_)) - u + 1;
var G = new i(u, 0, _, Number.MAX_VALUE), G = this.getFoldsInRange(G).map(function(X) {
return (X = X.clone()).start.row += $, X.end.row += $, X;
}), W = W == 0 ? this.doc.getLines(u, _) : this.doc.removeFullLines(u, _);
return this.doc.insertFullLines(u + $, W), G.length && this.addFolds(G), $;
}, c.prototype.moveLinesUp = function(u, _) {
return this.$moveLines(u, _, -1);
}, c.prototype.moveLinesDown = function(u, _) {
return this.$moveLines(u, _, 1);
}, c.prototype.duplicateLines = function(u, _) {
return this.$moveLines(u, _, 0);
}, c.prototype.$clipRowToDocument = function(u) {
return Math.max(0, Math.min(u, this.doc.getLength() - 1));
}, c.prototype.$clipColumnToRow = function(u, _) {
return _ < 0 ? 0 : Math.min(this.doc.getLine(u).length, _);
}, c.prototype.$clipPositionToDocument = function(u, _) {
var v;
return _ = Math.max(0, _), _ = u < 0 ? u = 0 : (v = this.doc.getLength()) <= u ? this.doc.getLine(u = v - 1).length : Math.min(this.doc.getLine(u).length, _), { row: u, column: _ };
}, c.prototype.$clipRangeToDocument = function(u) {
u.start.row < 0 ? (u.start.row = 0, u.start.column = 0) : u.start.column = this.$clipColumnToRow(u.start.row, u.start.column);
var _ = this.doc.getLength() - 1;
return u.end.row > _ ? (u.end.row = _, u.end.column = this.doc.getLine(_).length) : u.end.column = this.$clipColumnToRow(u.end.row, u.end.column), u;
}, c.prototype.setUseWrapMode = function(u) {
u != this.$useWrapMode && (this.$useWrapMode = u, this.$modified = true, this.$resetRowCache(0), u && (u = this.getLength(), this.$wrapData = Array(u), this.$updateWrapData(0, u - 1)), this._signal("changeWrapMode"));
}, c.prototype.getUseWrapMode = function() {
return this.$useWrapMode;
}, c.prototype.setWrapLimitRange = function(u, _) {
this.$wrapLimitRange.min === u && this.$wrapLimitRange.max === _ || (this.$wrapLimitRange = { min: u, max: _ }, this.$modified = true, this.$bidiHandler.markAsDirty(), this.$useWrapMode && this._signal("changeWrapMode"));
}, c.prototype.adjustWrapLimit = function(u, $) {
var v = this.$wrapLimitRange, $ = (v.max < 0 && (v = { min: $, max: $ }), this.$constrainWrapLimit(u, v.min, v.max));
return $ != this.$wrapLimit && 1 < $ && (this.$wrapLimit = $, this.$modified = true, this.$useWrapMode && (this.$updateWrapData(0, this.getLength() - 1), this.$resetRowCache(0), this._signal("changeWrapLimit")), true);
}, c.prototype.$constrainWrapLimit = function(u, _, v) {
return _ && (u = Math.max(_, u)), u = v ? Math.min(v, u) : u;
}, c.prototype.getWrapLimit = function() {
return this.$wrapLimit;
}, c.prototype.setWrapLimit = function(u) {
this.setWrapLimitRange(u, u);
}, c.prototype.getWrapLimitRange = function() {
return { min: this.$wrapLimitRange.min, max: this.$wrapLimitRange.max };
}, c.prototype.$updateInternalDataOnChange = function(u) {
var _ = this.$useWrapMode, v = u.action, $ = u.start, G = u.end, W = $.row, X = G.row, Q = X - W, K = null;
if (this.$updating = true, Q != 0)
if (v === "remove") {
this[_ ? "$wrapData" : "$rowLengthCache"].splice(W, Q);
var ne = this.$foldData, K = this.getFoldsInRange(u);
this.removeFolds(K);
var T = 0;
for ((I = this.getFoldLine(G.row)) && (I.addRemoveChars(G.row, G.column, $.column - G.column), I.shiftRow(-Q), (V = this.getFoldLine(W)) && V !== I && (V.merge(I), I = V), T = ne.indexOf(I) + 1); T < ne.length; T++)
(I = ne[T]).start.row >= G.row && I.shiftRow(-Q);
X = W;
} else {
var V = Array(Q), F = (V.unshift(W, 0), _ ? this.$wrapData : this.$rowLengthCache), ne = (F.splice.apply(F, V), this.$foldData), T = 0;
for ((I = this.getFoldLine(W)) && ((F = I.range.compareInside($.row, $.column)) == 0 ? (I = I.split($.row, $.column)) && (I.shiftRow(Q), I.addRemoveChars(X, 0, G.column - $.column)) : F == -1 && (I.addRemoveChars(W, 0, G.column - $.column), I.shiftRow(Q)), T = ne.indexOf(I) + 1); T < ne.length; T++)
(I = ne[T]).start.row >= W && I.shiftRow(Q);
}
else {
var I, Q = Math.abs(u.start.column - u.end.column);
v === "remove" && (K = this.getFoldsInRange(u), this.removeFolds(K), Q = -Q), (I = this.getFoldLine(W)) && I.addRemoveChars(W, $.column, Q);
}
return _ && this.$wrapData.length != this.doc.getLength(), this.$updating = false, _ ? this.$updateWrapData(W, X) : this.$updateRowLengthCache(W, X), K;
}, c.prototype.$updateRowLengthCache = function(u, _, v) {
this.$rowLengthCache[u] = null, this.$rowLengthCache[_] = null;
}, c.prototype.$updateWrapData = function(u, _) {
var v, $, G = this.doc.getAllLines(), W = this.getTabSize(), X = this.$wrapData, Q = this.$wrapLimit, K = u;
for (_ = Math.min(_, G.length - 1); K <= _; )
($ = this.getFoldLine(K, $)) ? (v = [], $.walk((function(ne, T, V, F) {
var I;
if (ne != null) {
(I = this.$getDisplayTokens(ne, v.length))[0] = b;
for (var S = 1; S < I.length; S++)
I[S] = w;
} else
I = this.$getDisplayTokens(G[T].substring(F, V), v.length);
v = v.concat(I);
}).bind(this), $.end.row, G[$.end.row].length + 1), X[$.start.row] = this.$computeWrapSplits(v, Q, W), K = $.end.row + 1) : (v = this.$getDisplayTokens(G[K]), X[K] = this.$computeWrapSplits(v, Q, W), K++);
}, c.prototype.$computeWrapSplits = function(u, _, v) {
if (u.length == 0)
return [];
var $ = [], G = u.length, W = 0, X = 0, Q = this.$wrapAsCode, K = this.$indentedSoftWrap, ne = _ <= Math.max(2 * v, 8) || K === false ? 0 : Math.floor(_ / 2);
function T(S) {
for (var L = S - W, O = W; O < S; O++) {
var J = u[O];
J !== 12 && J !== 2 || --L;
}
$.length || (V = function() {
var re = 0;
if (ne === 0)
return re;
if (K)
for (var pe = 0; pe < u.length; pe++) {
var me = u[pe];
if (me == M)
re += 1;
else if (me == B2)
re += v;
else if (me != Z)
break;
}
return Q && K !== false && (re += v), Math.min(re, ne);
}(), $.indent = V), X += L, $.push(X), W = S;
}
for (var V = 0; _ - V < G - W; ) {
var F = W + _ - V;
if (u[F - 1] >= M && u[F] >= M)
T(F);
else if (u[F] == b || u[F] == w) {
for (; F != W - 1 && u[F] != b; F--)
;
if (!(W < F)) {
for (F = W + _; F < u.length && u[F] == w; F++)
;
if (F == u.length)
break;
}
T(F);
} else {
for (var I = Math.max(F - (_ - (_ >> 2)), W - 1); I < F && u[F] < b; )
F--;
if (Q) {
for (; I < F && u[F] < b; )
F--;
for (; I < F && u[F] == E; )
F--;
} else
for (; I < F && u[F] < M; )
F--;
I < F ? T(++F) : (u[F = W + _] == g && F--, T(F - V));
}
}
return $;
}, c.prototype.$getDisplayTokens = function(u, _) {
var v, $ = [];
_ = _ || 0;
for (var G = 0; G < u.length; G++) {
var W = u.charCodeAt(G);
if (W == 9) {
v = this.getScreenTabSize($.length + _), $.push(B2);
for (var X = 1; X < v; X++)
$.push(Z);
} else
W == 32 ? $.push(M) : 39 < W && W < 48 || 57 < W && W < 64 ? $.push(E) : 4352 <= W && k(W) ? $.push(p, g) : $.push(p);
}
return $;
}, c.prototype.$getStringScreenWidth = function(u, _, v) {
if (_ == 0)
return [0, 0];
var $, G;
for (_ == null && (_ = 1 / 0), v = v || 0, G = 0; G < u.length && (($ = u.charCodeAt(G)) == 9 ? v += this.getScreenTabSize(v) : 4352 <= $ && k($) ? v += 2 : v += 1, !(_ < v)); G++)
;
return [v, G];
}, c.prototype.getRowLength = function(u) {
var _ = 1;
return this.lineWidgets && (_ += this.lineWidgets[u] && this.lineWidgets[u].rowCount || 0), this.$useWrapMode && this.$wrapData[u] ? this.$wrapData[u].length + _ : _;
}, c.prototype.getRowLineCount = function(u) {
return this.$useWrapMode && this.$wrapData[u] ? this.$wrapData[u].length + 1 : 1;
}, c.prototype.getRowWrapIndent = function(u) {
var _;
return this.$useWrapMode && (u = this.screenToDocumentPosition(u, Number.MAX_VALUE), (_ = this.$wrapData[u.row]).length) && _[0] < u.column ? _.indent : 0;
}, c.prototype.getScreenLastRowColumn = function(u) {
return u = this.screenToDocumentPosition(u, Number.MAX_VALUE), this.documentToScreenColumn(u.row, u.column);
}, c.prototype.getDocumentLastRowColumn = function(u, _) {
return u = this.documentToScreenRow(u, _), this.getScreenLastRowColumn(u);
}, c.prototype.getDocumentLastRowColumnPosition = function(u, _) {
return u = this.documentToScreenRow(u, _), this.screenToDocumentPosition(u, Number.MAX_VALUE / 10);
}, c.prototype.getRowSplitData = function(u) {
if (this.$useWrapMode)
return this.$wrapData[u];
}, c.prototype.getScreenTabSize = function(u) {
return this.$tabSize - (u % this.$tabSize | 0);
}, c.prototype.screenToDocumentRow = function(u, _) {
return this.screenToDocumentPosition(u, _).row;
}, c.prototype.screenToDocumentColumn = function(u, _) {
return this.screenToDocumentPosition(u, _).column;
}, c.prototype.screenToDocumentPosition = function(u, _, v) {
if (u < 0)
return { row: 0, column: 0 };
for (var $, G, W, X = 0, Q = 0, K = 0, ne = 0, T = this.$screenRowCache, V = this.$getRowCacheIndex(T, u), F = T.length, I = (W = F && 0 <= V ? (K = T[V], X = this.$docRowCache[V], u > T[F - 1]) : !F, this.getLength() - 1), S = this.getNextFoldLine(X), L = S ? S.start.row : 1 / 0; K <= u && !(u < K + (ne = this.getRowLength(X)) || I <= X); )
K += ne, L < ++X && (X = S.end.row + 1, L = (S = this.getNextFoldLine(X, S)) ? S.start.row : 1 / 0), W && (this.$docRowCache.push(X), this.$screenRowCache.push(K));
if (S && S.start.row <= X)
$ = this.getFoldDisplayLine(S), X = S.start.row;
else {
if (K + ne <= u || I < X)
return { row: I, column: this.getLine(I).length };
$ = this.getLine(X), S = null;
}
return V = 0, T = Math.floor(u - K), this.$useWrapMode && (F = this.$wrapData[X]) && (G = F[T], 0 < T) && F.length && (V = F.indent, Q = F[T - 1] || F[F.length - 1], $ = $.substring(Q)), v !== void 0 && this.$bidiHandler.isBidiRow(K + T, X, T) && (_ = this.$bidiHandler.offsetToCol(v)), Q += this.$getStringScreenWidth($, _ - V)[1], this.$useWrapMode && G <= Q && (Q = G - 1), S ? S.idxToPosition(Q) : { row: X, column: Q };
}, c.prototype.documentToScreenPosition = function(u, _) {
var V = _ === void 0 ? this.$clipPositionToDocument(u.row, u.column) : this.$clipPositionToDocument(u, _), v = (u = V.row, _ = V.column, 0), V = null;
(X = this.getFoldAt(u, _, 1)) && (u = X.start.row, _ = X.start.column);
for (var $, G, W = 0, X = this.$docRowCache, F = this.$getRowCacheIndex(X, u), Q = X.length, K = (G = Q && 0 <= F ? (W = X[F], v = this.$screenRowCache[F], u > X[Q - 1]) : !Q, this.getNextFoldLine(W)), ne = K ? K.start.row : 1 / 0; W < u; ) {
if (ne <= W) {
if (u < ($ = K.end.row + 1))
break;
ne = (K = this.getNextFoldLine($, K)) ? K.start.row : 1 / 0;
} else
$ = W + 1;
v += this.getRowLength(W), W = $, G && (this.$docRowCache.push(W), this.$screenRowCache.push(v));
}
var T = "", V = K && ne <= W ? (T = this.getFoldDisplayLine(K, u, _), K.start.row) : (T = this.getLine(u).substring(0, _), u), F = 0;
if (this.$useWrapMode) {
var I = this.$wrapData[V];
if (I) {
for (var S = 0; T.length >= I[S]; )
v++, S++;
T = T.substring(I[S - 1] || 0, T.length), F = 0 < S ? I.indent : 0;
}
}
return this.lineWidgets && this.lineWidgets[W] && this.lineWidgets[W].rowsAbove && (v += this.lineWidgets[W].rowsAbove), { row: v, column: F + this.$getStringScreenWidth(T)[0] };
}, c.prototype.documentToScreenColumn = function(u, _) {
return this.documentToScreenPosition(u, _).column;
}, c.prototype.documentToScreenRow = function(u, _) {
return this.documentToScreenPosition(u, _).row;
}, c.prototype.getScreenLength = function() {
var u = 0, _ = null;
if (this.$useWrapMode)
for (var v = this.$wrapData.length, $ = 0, G = 0, W = (_ = this.$foldData[G++]) ? _.start.row : 1 / 0; $ < v; ) {
var X = this.$wrapData[$];
u += X ? X.length + 1 : 1, W < ++$ && ($ = _.end.row + 1, W = (_ = this.$foldData[G++]) ? _.start.row : 1 / 0);
}
else
for (var u = this.getLength(), Q = this.$foldData, G = 0; G < Q.length; G++)
u -= (_ = Q[G]).end.row - _.start.row;
return this.lineWidgets && (u += this.$getWidgetScreenLength()), u;
}, c.prototype.$setFontMetrics = function(u) {
this.$enableVarChar && (this.$getStringScreenWidth = function(_, v, $) {
if (v === 0)
return [0, 0];
var G, W;
for (v = v || 1 / 0, $ = $ || 0, W = 0; W < _.length && !(v < ($ += (G = _.charAt(W)) === " " ? this.getScreenTabSize($) : u.getCharacterWidth(G))); W++)
;
return [$, W];
});
}, c.prototype.destroy = function() {
this.destroyed || (this.bgTokenizer.setDocument(null), this.bgTokenizer.cleanup(), this.destroyed = true), this.$stopWorker(), this.removeAllListeners(), this.doc && this.doc.off("change", this.$onChange), this.selection.detach();
}, c);
function c(u, _) {
this.$breakpoints = [], this.$decorations = [], this.$frontMarkers = {}, this.$backMarkers = {}, this.$markerId = 1, this.$undoSelect = true, this.$foldData = [], this.id = "session" + ++c.$uid, this.$foldData.toString = function() {
return this.join(`
`);
}, this.bgTokenizer = new r(new o().getTokenizer(), this);
var v = this;
this.bgTokenizer.on("update", function($) {
v._signal("tokenizerUpdate", $);
}), this.on("changeFold", this.onChangeFold.bind(this)), this.$onChange = this.onChange.bind(this), typeof u == "object" && u.getLine || (u = new a(u)), this.setDocument(u), this.selection = new n(this), this.$bidiHandler = new d(this), h.resetOptions(this), this.setMode(_), h._signal("session", this), this.destroyed = false;
}
s.$uid = 0, s.prototype.$modes = h.$modes, s.prototype.getValue = s.prototype.toString, s.prototype.$defaultUndoManager = { undo: function() {
}, redo: function() {
}, hasUndo: function() {
}, hasRedo: function() {
}, reset: function() {
}, add: function() {
}, addSelection: function() {
}, startNewGroup: function() {
}, addSession: function() {
} }, s.prototype.$overwrite = false, s.prototype.$mode = null, s.prototype.$modeId = null, s.prototype.$scrollTop = 0, s.prototype.$scrollLeft = 0, s.prototype.$wrapLimit = 80, s.prototype.$useWrapMode = false, s.prototype.$wrapLimitRange = { min: null, max: null }, s.prototype.lineWidgets = null, s.prototype.isFullWidth = k, y.implement(s.prototype, l);
var p = 1, g = 2, b = 3, w = 4, E = 9, M = 10, B2 = 11, Z = 12;
function k(u) {
return !(u < 4352) && (4352 <= u && u <= 4447 || 4515 <= u && u <= 4519 || 4602 <= u && u <= 4607 || 9001 <= u && u <= 9002 || 11904 <= u && u <= 11929 || 11931 <= u && u <= 12019 || 12032 <= u && u <= 12245 || 12272 <= u && u <= 12283 || 12288 <= u && u <= 12350 || 12353 <= u && u <= 12438 || 12441 <= u && u <= 12543 || 12549 <= u && u <= 12589 || 12593 <= u && u <= 12686 || 12688 <= u && u <= 12730 || 12736 <= u && u <= 12771 || 12784 <= u && u <= 12830 || 12832 <= u && u <= 12871 || 12880 <= u && u <= 13054 || 13056 <= u && u <= 19903 || 19968 <= u && u <= 42124 || 42128 <= u && u <= 42182 || 43360 <= u && u <= 43388 || 44032 <= u && u <= 55203 || 55216 <= u && u <= 55238 || 55243 <= u && u <= 55291 || 63744 <= u && u <= 64255 || 65040 <= u && u <= 65049 || 65072 <= u && u <= 65106 || 65108 <= u && u <= 65126 || 65128 <= u && u <= 65131 || 65281 <= u && u <= 65376 || 65504 <= u && u <= 65510);
}
A("./edit_session/folding").Folding.call(s.prototype), A("./edit_session/bracket_match").BracketMatch.call(s.prototype), h.defineOptions(s.prototype, "session", { wrap: { set: function(u) {
u && u != "off" ? u == "free" ? u = true : u == "printMargin" ? u = -1 : typeof u == "string" && (u = parseInt(u, 10) || false) : u = false, this.$wrap != u && ((this.$wrap = u) ? (this.setWrapLimitRange(u = typeof u == "number" ? u : null, u), this.setUseWrapMode(true)) : this.setUseWrapMode(false));
}, get: function() {
return this.getUseWrapMode() ? this.$wrap == -1 ? "printMargin" : this.getWrapLimitRange().min ? this.$wrap : "free" : "off";
}, handlesSet: true }, wrapMethod: { set: function(u) {
(u = u == "auto" ? this.$mode.type != "text" : u != "text") != this.$wrapAsCode && (this.$wrapAsCode = u, this.$useWrapMode) && (this.$useWrapMode = false, this.setUseWrapMode(true));
}, initialValue: "auto" }, indentedSoftWrap: { set: function() {
this.$useWrapMode && (this.$useWrapMode = false, this.setUseWrapMode(true));
}, initialValue: true }, firstLineNumber: { set: function() {
this._signal("changeBreakpoint");
}, initialValue: 1 }, useWorker: { set: function(u) {
this.$useWorker = u, this.$stopWorker(), u && this.$startWorker();
}, initialValue: true }, useSoftTabs: { initialValue: true }, tabSize: { set: function(u) {
0 < (u = parseInt(u)) && this.$tabSize !== u && (this.$modified = true, this.$rowLengthCache = [], this.$tabSize = u, this._signal("changeTabSize"));
}, initialValue: 4, handlesSet: true }, navigateWithinSoftTabs: { initialValue: false }, foldStyle: { set: function(u) {
this.setFoldStyle(u);
}, handlesSet: true }, overwrite: { set: function(u) {
this._signal("changeOverwrite");
}, initialValue: false }, newLineMode: { set: function(u) {
this.doc.setNewLineMode(u);
}, get: function() {
return this.doc.getNewLineMode();
}, handlesSet: true }, mode: { set: function(u) {
this.setMode(u);
}, get: function() {
return this.$modeId;
}, handlesSet: true } }), f.EditSession = s;
}), ace.define("ace/search", ["require", "exports", "module", "ace/lib/lang", "ace/lib/oop", "ace/range"], function(A, f, R) {
var y = A("./lib/lang"), C = A("./lib/oop"), d = A("./range").Range;
function h() {
this.$options = {};
}
h.prototype.set = function(l) {
return C.mixin(this.$options, l), this;
}, h.prototype.getOptions = function() {
return y.copyObject(this.$options);
}, h.prototype.setOptions = function(l) {
this.$options = l;
}, h.prototype.find = function(i) {
var n, o = this.$options, i = this.$matchIterator(i, o);
return !!i && (n = null, i.forEach(function(a, r, e2, t) {
return n = new d(a, r, e2, t), !(r == t && o.start && o.start.start && o.skipCurrent != 0 && n.isEqual(o.start) && (n = null, 1));
}), n);
}, h.prototype.findAll = function(l) {
var n = this.$options;
if (!n.needle)
return [];
this.$assembleRegExp(n);
var o = n.range, i = o ? l.getLines(o.start.row, o.end.row) : l.doc.getAllLines(), a = [], r = n.re;
if (n.$isMultiLine) {
var e2, t = r.length, s = i.length - t;
e:
for (var c = r.offset || 0; c <= s; c++) {
for (var p = 0; p < t; p++)
if (i[c + p].search(r[p]) == -1)
continue e;
var g = i[c], b = i[c + t - 1], g = g.length - g.match(r[0])[0].length, b = b.match(r[t - 1])[0].length;
e2 && e2.end.row === c && e2.end.column > g || (a.push(e2 = new d(c, g, c + t - 1, b)), 2 < t && (c = c + t - 2));
}
} else
for (var w = 0; w < i.length; w++)
for (var E = y.getMatchOffsets(i[w], r), p = 0; p < E.length; p++) {
var M = E[p];
a.push(new d(w, M.offset, w, M.offset + M.length));
}
if (o) {
for (var B2 = o.start.column, Z = o.end.column, w = 0, p = a.length - 1; w < p && a[w].start.column < B2 && a[w].start.row == 0; )
w++;
for (var k = o.end.row - o.start.row; w < p && a[p].end.column > Z && a[p].end.row == k; )
p--;
for (a = a.slice(w, p + 1), w = 0, p = a.length; w < p; w++)
a[w].start.row += o.start.row, a[w].end.row += o.start.row;
}
return a;
}, h.prototype.replace = function(l, n) {
var o = this.$options, i = this.$assembleRegExp(o);
if (o.$isMultiLine)
return n;
if (i) {
var a = i.exec(l);
if (!a || a[0].length != l.length)
return null;
if (n = l.replace(i, n), o.preserveCase) {
n = n.split("");
for (var r = Math.min(l.length, l.length); r--; ) {
var e2 = l[r];
e2 && e2.toLowerCase() != e2 ? n[r] = n[r].toUpperCase() : n[r] = n[r].toLowerCase();
}
n = n.join("");
}
return n;
}
}, h.prototype.$assembleRegExp = function(l, n) {
if (l.needle instanceof RegExp)
return l.re = l.needle;
var o, i, a, r, e2 = l.needle;
if (!l.needle)
return l.re = false;
l.$supportsUnicodeFlag === void 0 && (l.$supportsUnicodeFlag = y.supportsUnicodeFlag());
try {
new RegExp(e2, "u");
} catch {
l.$supportsUnicodeFlag = false;
}
function t(p, g) {
return g === void 0 && (g = true), (a && i.$supportsUnicodeFlag ? new RegExp("[\\p{L}\\p{N}_]", "u") : new RegExp("\\w")).test(p) || i.regExp ? a && i.$supportsUnicodeFlag ? g ? "(?<=^|[^\\p{L}\\p{N}_])" : "(?=[^\\p{L}\\p{N}_]|$)" : "\\b" : "";
}
l.regExp || (e2 = y.escapeRegExp(e2)), l.wholeWord && (o = e2, i = l, a = y.supportsLookbehind(), r = Array.from(o), s = r[0], r = r[r.length - 1], e2 = t(s) + o + t(r, false));
var s = l.caseSensitive ? "gm" : "gmi";
if (l.$supportsUnicodeFlag && (s += "u"), l.$isMultiLine = !n && /[\n\r]/.test(e2), l.$isMultiLine)
return l.re = this.$assembleMultilineRegExp(e2, s);
try {
var c = new RegExp(e2, s);
} catch {
c = false;
}
return l.re = c;
}, h.prototype.$assembleMultilineRegExp = function(l, n) {
for (var o = l.replace(/\r\n|\r|\n/g, `$
^`).split(`
`), i = [], a = 0; a < o.length; a++)
try {
i.push(new RegExp(o[a], n));
} catch {
return false;
}
return i;
}, h.prototype.$matchIterator = function(l, n) {
var o, i, a, r, e2, t, s, c, p = this.$assembleRegExp(n);
return !!p && (o = n.backwards == 1, i = n.skipCurrent != 0, a = n.range, (r = (r = n.start) || (a ? a[o ? "end" : "start"] : l.selection.getRange())).start && (r = r[i != o ? "end" : "start"]), e2 = a ? a.start.row : 0, t = a ? a.end.row : l.getLength() - 1, c = n.$isMultiLine ? (s = p.length, function(g, b, w) {
var E = o ? g - s + 1 : g;
if (!(E < 0 || E + s > l.getLength())) {
var M = l.getLine(E), g = M.search(p[0]);
if (!(!o && g < b || g === -1)) {
for (var B2 = 1; B2 < s; B2++)
if ((M = l.getLine(E + B2)).search(p[B2]) == -1)
return;
var Z = M.match(p[s - 1])[0].length;
if (!(o && b < Z))
return !!w(E, g, E + s - 1, Z) || void 0;
}
}
}) : o ? function(g, b, w) {
var E, M = l.getLine(g), B2 = [];
for (p.lastIndex = 0; E = p.exec(M); ) {
var Z = E[0].length, k = E.index;
if (!Z) {
if (k >= M.length)
break;
p.lastIndex = k += 1;
}
if (E.index + Z > b)
break;
B2.push(E.index, Z);
}
for (var u = B2.length - 1; 0 <= u; u -= 2) {
var _ = B2[u - 1];
if (w(g, _, g, _ + (Z = B2[u])))
return true;
}
} : function(g, b, w) {
var E = l.getLine(g);
for (p.lastIndex = b; M = p.exec(E); ) {
var M, B2 = M[0].length;
if (w(g, M = M.index, g, M + B2))
return true;
if (!B2 && (p.lastIndex = M += 1, M >= E.length))
return false;
}
}, { forEach: o ? function(g) {
var b = r.row;
if (!c(b, r.column, g)) {
for (b--; e2 <= b; b--)
if (c(b, Number.MAX_VALUE, g))
return;
if (n.wrap != 0) {
for (b = t, e2 = r.row; e2 <= b; b--)
if (c(b, Number.MAX_VALUE, g))
return;
}
}
} : function(g) {
var b = r.row;
if (!c(b, r.column, g)) {
for (b += 1; b <= t; b++)
if (c(b, 0, g))
return;
if (n.wrap != 0) {
for (b = e2, t = r.row; b <= t; b++)
if (c(b, 0, g))
return;
}
}
} });
}, f.Search = h;
}), ace.define("ace/keyboard/hash_handler", ["require", "exports", "module", "ace/lib/keys", "ace/lib/useragent"], function(r, f, R) {
var y, C = this && this.__extends || (y = function(t, s) {
return (y = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? function(c, p) {
c.__proto__ = p;
} : function(c, p) {
for (var g in p)
Object.prototype.hasOwnProperty.call(p, g) && (c[g] = p[g]);
}))(t, s);
}, function(t, s) {
if (typeof s != "function" && s !== null)
throw new TypeError("Class extends value " + String(s) + " is not a constructor or null");
function c() {
this.constructor = t;
}
y(t, s), t.prototype = s === null ? Object.create(s) : (c.prototype = s.prototype, new c());
}), d = r("../lib/keys"), h = r("../lib/useragent"), l = d.KEY_MODS, n = (o.prototype.$init = function(t, s, c) {
this.platform = s || (h.isMac ? "mac" : "win"), this.commands = {}, this.commandKeyBinding = {}, this.addCommands(t), this.$singleCommand = c;
}, o.prototype.addCommand = function(t) {
this.commands[t.name] && this.removeCommand(t), (this.commands[t.name] = t).bindKey && this._buildKeyHash(t);
}, o.prototype.removeCommand = function(t, s) {
var c, p = t && (typeof t == "string" ? t : t.name), g = (t = this.commands[p], s || delete this.commands[p], this.commandKeyBinding);
for (c in g) {
var b, w = g[c];
w == t ? delete g[c] : Array.isArray(w) && (b = w.indexOf(t)) != -1 && (w.splice(b, 1), w.length == 1) && (g[c] = w[0]);
}
}, o.prototype.bindKey = function(t, s, c) {
if (typeof t == "object" && t && (c == null && (c = t.position), t = t[this.platform]), t)
return typeof s == "function" ? this.addCommand({ exec: s, bindKey: t, name: s.name || t }) : void t.split("|").forEach(function(w) {
var g = "", b = (w.indexOf(" ") != -1 && (w = (b = w.split(/\s+/)).pop(), b.forEach(function(E) {
E = this.parseKeys(E), E = l[E.hashId] + E.key, g += (g ? " " : "") + E, this._addCommandToBinding(g, "chainKeys");
}, this), g += " "), this.parseKeys(w)), w = l[b.hashId] + b.key;
this._addCommandToBinding(g + w, s, c);
}, this);
}, o.prototype._addCommandToBinding = function(t, s, c) {
var p = this.commandKeyBinding;
if (s)
if (!p[t] || this.$singleCommand)
p[t] = s;
else {
Array.isArray(p[t]) ? (b = p[t].indexOf(s)) != -1 && p[t].splice(b, 1) : p[t] = [p[t]], typeof c != "number" && (c = i(s));
for (var g = p[t], b = 0; b < g.length && !(c < i(g[b])); b++)
;
g.splice(b, 0, s);
}
else
delete p[t];
}, o.prototype.addCommands = function(t) {
t && Object.keys(t).forEach(function(s) {
var c = t[s];
if (c) {
if (typeof c == "string")
return this.bindKey(c, s);
typeof (c = typeof c == "function" ? { exec: c } : c) == "object" && (c.name || (c.name = s), this.addCommand(c));
}
}, this);
}, o.prototype.removeCommands = function(t) {
Object.keys(t).forEach(function(s) {
this.removeCommand(t[s]);
}, this);
}, o.prototype.bindKeys = function(t) {
Object.keys(t).forEach(function(s) {
this.bindKey(s, t[s]);
}, this);
}, o.prototype._buildKeyHash = function(t) {
this.bindKey(t.bindKey, t);
}, o.prototype.parseKeys = function(t) {
var s = t.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(E) {
return E;
}), c = s.pop(), p = d[c];
if (d.FUNCTION_KEYS[p])
c = d.FUNCTION_KEYS[p].toLowerCase();
else {
if (!s.length)
return { key: c, hashId: -1 };
if (s.length == 1 && s[0] == "shift")
return { key: c.toUpperCase(), hashId: -1 };
}
for (var g = 0, b = s.length; b--; ) {
var w = d.KEY_MODS[s[b]];
if (w == null)
return false;
g |= w;
}
return { key: c, hashId: g };
}, o.prototype.findKeyCommand = function(t, s) {
return t = l[t] + s, this.commandKeyBinding[t];
}, o.prototype.handleKeyboard = function(t, s, c, p) {
var g, b;
if (!(p < 0))
return g = l[s] + c, b = this.commandKeyBinding[g], t.$keyChain && (t.$keyChain += " " + g, b = this.commandKeyBinding[t.$keyChain] || b), !b || b != "chainKeys" && b[b.length - 1] != "chainKeys" ? (t.$keyChain && (s && s != 4 || c.length != 1 ? (s == -1 || 0 < p) && (t.$keyChain = "") : t.$keyChain = t.$keyChain.slice(0, -g.length - 1)), { command: b }) : (t.$keyChain = t.$keyChain || g, { command: "null" });
}, o.prototype.getStatusText = function(t, s) {
return s.$keyChain || "";
}, o);
function o(t, s) {
this.$init(t, s, false);
}
function i(t) {
return typeof t == "object" && t.bindKey && t.bindKey.position || (t.isDefault ? -100 : 0);
}
C(e2, a = n);
var a, r = e2;
function e2(t, s) {
return t = a.call(this, t, s) || this, t.$singleCommand = true, t;
}
r.call = function(t, s, c) {
n.prototype.$init.call(t, s, c, true);
}, n.call = function(t, s, c) {
n.prototype.$init.call(t, s, c, false);
}, f.HashHandler = r, f.MultiHashHandler = n;
}), ace.define("ace/commands/command_manager", ["require", "exports", "module", "ace/lib/oop", "ace/keyboard/hash_handler", "ace/lib/event_emitter"], function(l, f, R) {
var y, C, n = this && this.__extends || (y = function(i, a) {
return (y = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? function(r, e2) {
r.__proto__ = e2;
} : function(r, e2) {
for (var t in e2)
Object.prototype.hasOwnProperty.call(e2, t) && (r[t] = e2[t]);
}))(i, a);
}, function(i, a) {
if (typeof a != "function" && a !== null)
throw new TypeError("Class extends value " + String(a) + " is not a constructor or null");
function r() {
this.constructor = i;
}
y(i, a), i.prototype = a === null ? Object.create(a) : (r.prototype = a.prototype, new r());
}), d = l("../lib/oop"), h = l("../keyboard/hash_handler").MultiHashHandler, l = l("../lib/event_emitter").EventEmitter, n = (n(o, C = h), o.prototype.exec = function(i, a, r) {
if (Array.isArray(i)) {
for (var e2 = i.length; e2--; )
if (this.exec(i[e2], a, r))
return true;
return false;
}
var t;
return !!(i = typeof i == "string" ? this.commands[i] : i) && !(a && a.$readOnly && !i.readOnly || this.$checkCommandState != 0 && i.isAvailable && !i.isAvailable(a) || ((t = { editor: a, command: i, args: r }).returnValue = this._emit("exec", t), this._signal("afterExec", t), t.returnValue === false));
}, o.prototype.toggleRecording = function(i) {
if (!this.$inReplay)
return i && i._emit("changeStatus"), this.recording ? (this.macro.pop(), this.off("exec", this.$addCommandToMacro), this.macro.length || (this.macro = this.oldMacro), this.recording = false) : (this.$addCommandToMacro || (this.$addCommandToMacro = (function(a) {
this.macro.push([a.command, a.args]);
}).bind(this)), this.oldMacro = this.macro, this.macro = [], this.on("exec", this.$addCommandToMacro), this.recording = true);
}, o.prototype.replay = function(i) {
if (!this.$inReplay && this.macro) {
if (this.recording)
return this.toggleRecording(i);
try {
this.$inReplay = true, this.macro.forEach(function(a) {
typeof a == "string" ? this.exec(a, i) : this.exec(a[0], i, a[1]);
}, this);
} finally {
this.$inReplay = false;
}
}
}, o.prototype.trimMacro = function(i) {
return i.map(function(a) {
return typeof a[0] != "string" && (a[0] = a[0].name), a = a[1] ? a : a[0];
});
}, o);
function o(i, a) {
return a = C.call(this, a, i) || this, a.byName = a.commands, a.setDefaultHandler("exec", function(r) {
return r.args ? r.command.exec(r.editor, r.args, r.event, false) : r.command.exec(r.editor, {}, r.event, true);
}), a;
}
d.implement(n.prototype, l), f.CommandManager = n;
}), ace.define("ace/commands/default_commands", ["require", "exports", "module", "ace/lib/lang", "ace/config", "ace/range"], function(A, f, R) {
var y = A("../lib/lang"), C = A("../config"), d = A("../range").Range;
function h(n, o) {
return { win: n, mac: o };
}
f.commands = [{ name: "showSettingsMenu", description: "Show settings menu", bindKey: h("Ctrl-,", "Command-,"), exec: function(n) {
C.loadModule("ace/ext/settings_menu", function(o) {
o.init(n), n.showSettingsMenu();
});
}, readOnly: true }, { name: "goToNextError", description: "Go to next error", bindKey: h("Alt-E", "F4"), exec: function(n) {
C.loadModule("ace/ext/error_marker", function(o) {
o.showErrorMarker(n, 1);
});
}, scrollIntoView: "animate", readOnly: true }, { name: "goToPreviousError", description: "Go to previous error", bindKey: h("Alt-Shift-E", "Shift-F4"), exec: function(n) {
C.loadModule("ace/ext/error_marker", function(o) {
o.showErrorMarker(n, -1);
});
}, scrollIntoView: "animate", readOnly: true }, { name: "selectall", description: "Select all", bindKey: h("Ctrl-A", "Command-A"), exec: function(n) {
n.selectAll();
}, readOnly: true }, { name: "centerselection", description: "Center selection", bindKey: h(null, "Ctrl-L"), exec: function(n) {
n.centerSelection();
}, readOnly: true }, { name: "gotoline", description: "Go to line...", bindKey: h("Ctrl-L", "Command-L"), exec: function(n, o) {
typeof o != "number" || isNaN(o) || n.gotoLine(o), n.prompt({ $type: "gotoLine" });
}, readOnly: true }, { name: "fold", bindKey: h("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"), exec: function(n) {
n.session.toggleFold(false);
}, multiSelectAction: "forEach", scrollIntoView: "center", readOnly: true }, { name: "unfold", bindKey: h("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"), exec: function(n) {
n.session.toggleFold(true);
}, multiSelectAction: "forEach", scrollIntoView: "center", readOnly: true }, { name: "toggleFoldWidget", description: "Toggle fold widget", bindKey: h("F2", "F2"), exec: function(n) {
n.session.toggleFoldWidget();
}, multiSelectAction: "forEach", scrollIntoView: "center", readOnly: true }, { name: "toggleParentFoldWidget", description: "Toggle parent fold widget", bindKey: h("Alt-F2", "Alt-F2"), exec: function(n) {
n.session.toggleFoldWidget(true);
}, multiSelectAction: "forEach", scrollIntoView: "center", readOnly: true }, { name: "foldall", description: "Fold all", bindKey: h(null, "Ctrl-Command-Option-0"), exec: function(n) {
n.session.foldAll();
}, scrollIntoView: "center", readOnly: true }, { name: "foldAllComments", description: "Fold all comments", bindKey: h(null, "Ctrl-Command-Option-0"), exec: function(n) {
n.session.foldAllComments();
}, scrollIntoView: "center", readOnly: true }, { name: "foldOther", description: "Fold other", bindKey: h("Alt-0", "Command-Option-0"), exec: function(n) {
n.session.foldAll(), n.session.unfold(n.selection.getAllRanges());
}, scrollIntoView: "center", readOnly: true }, { name: "unfoldall", description: "Unfold all", bindKey: h("Alt-Shift-0", "Command-Option-Shift-0"), exec: function(n) {
n.session.unfold();
}, scrollIntoView: "center", readOnly: true }, { name: "findnext", description: "Find next", bindKey: h("Ctrl-K", "Command-G"), exec: function(n) {
n.findNext();
}, multiSelectAction: "forEach", scrollIntoView: "center", readOnly: true }, { name: "findprevious", description: "Find previous", bindKey: h("Ctrl-Shift-K", "Command-Shift-G"), exec: function(n) {
n.findPrevious();
}, multiSelectAction: "forEach", scrollIntoView: "center", readOnly: true }, { name: "selectOrFindNext", description: "Select or find next", bindKey: h("Alt-K", "Ctrl-G"), exec: function(n) {
n.selection.isEmpty() ? n.selection.selectWord() : n.findNext();
}, readOnly: true }, { name: "selectOrFindPrevious", description: "Select or find previous", bindKey: h("Alt-Shift-K", "Ctrl-Shift-G"), exec: function(n) {
n.selection.isEmpty() ? n.selection.selectWord() : n.findPrevious();
}, readOnly: true }, { name: "find", description: "Find", bindKey: h("Ctrl-F", "Command-F"), exec: function(n) {
C.loadModule("ace/ext/searchbox", function(o) {
o.Search(n);
});
}, readOnly: true }, { name: "overwrite", description: "Overwrite", bindKey: "Insert", exec: function(n) {
n.toggleOverwrite();
}, readOnly: true }, { name: "selecttostart", description: "Select to start", bindKey: h("Ctrl-Shift-Home", "Command-Shift-Home|Command-Shift-Up"), exec: function(n) {
n.getSelection().selectFileStart();
}, multiSelectAction: "forEach", readOnly: true, scrollIntoView: "animate", aceCommandGroup: "fileJump" }, { name: "gotostart", description: "Go to start", bindKey: h("Ctrl-Home", "Command-Home|Command-Up"), exec: function(n) {
n.navigateFileStart();
}, multiSelectAction: "forEach", readOnly: true, scrollIntoView: "animate", aceCommandGroup: "fileJump" }, { name: "selectup", description: "Select up", bindKey: h("Shift-Up", "Shift-Up|Ctrl-Shift-P"), exec: function(n) {
n.getSelection().selectUp();
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "golineup", description: "Go line up", bindKey: h("Up", "Up|Ctrl-P"), exec: function(n, o) {
n.navigateUp(o.times);
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "selecttoend", description: "Select to end", bindKey: h("Ctrl-Shift-End", "Command-Shift-End|Command-Shift-Down"), exec: function(n) {
n.getSelection().selectFileEnd();
}, multiSelectAction: "forEach", readOnly: true, scrollIntoView: "animate", aceCommandGroup: "fileJump" }, { name: "gotoend", description: "Go to end", bindKey: h("Ctrl-End", "Command-End|Command-Down"), exec: function(n) {
n.navigateFileEnd();
}, multiSelectAction: "forEach", readOnly: true, scrollIntoView: "animate", aceCommandGroup: "fileJump" }, { name: "selectdown", description: "Select down", bindKey: h("Shift-Down", "Shift-Down|Ctrl-Shift-N"), exec: function(n) {
n.getSelection().selectDown();
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "golinedown", description: "Go line down", bindKey: h("Down", "Down|Ctrl-N"), exec: function(n, o) {
n.navigateDown(o.times);
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "selectwordleft", description: "Select word left", bindKey: h("Ctrl-Shift-Left", "Option-Shift-Left"), exec: function(n) {
n.getSelection().selectWordLeft();
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "gotowordleft", description: "Go to word left", bindKey: h("Ctrl-Left", "Option-Left"), exec: function(n) {
n.navigateWordLeft();
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "selecttolinestart", description: "Select to line start", bindKey: h("Alt-Shift-Left", "Command-Shift-Left|Ctrl-Shift-A"), exec: function(n) {
n.getSelection().selectLineStart();
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "gotolinestart", description: "Go to line start", bindKey: h("Alt-Left|Home", "Command-Left|Home|Ctrl-A"), exec: function(n) {
n.navigateLineStart();
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "selectleft", description: "Select left", bindKey: h("Shift-Left", "Shift-Left|Ctrl-Shift-B"), exec: function(n) {
n.getSelection().selectLeft();
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "gotoleft", description: "Go to left", bindKey: h("Left", "Left|Ctrl-B"), exec: function(n, o) {
n.navigateLeft(o.times);
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "selectwordright", description: "Select word right", bindKey: h("Ctrl-Shift-Right", "Option-Shift-Right"), exec: function(n) {
n.getSelection().selectWordRight();
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "gotowordright", description: "Go to word right", bindKey: h("Ctrl-Right", "Option-Right"), exec: function(n) {
n.navigateWordRight();
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "selecttolineend", description: "Select to line end", bindKey: h("Alt-Shift-Right", "Command-Shift-Right|Shift-End|Ctrl-Shift-E"), exec: function(n) {
n.getSelection().selectLineEnd();
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "gotolineend", description: "Go to line end", bindKey: h("Alt-Right|End", "Command-Right|End|Ctrl-E"), exec: function(n) {
n.navigateLineEnd();
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "selectright", description: "Select right", bindKey: h("Shift-Right", "Shift-Right"), exec: function(n) {
n.getSelection().selectRight();
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "gotoright", description: "Go to right", bindKey: h("Right", "Right|Ctrl-F"), exec: function(n, o) {
n.navigateRight(o.times);
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "selectpagedown", description: "Select page down", bindKey: "Shift-PageDown", exec: function(n) {
n.selectPageDown();
}, readOnly: true }, { name: "pagedown", description: "Page down", bindKey: h(null, "Option-PageDown"), exec: function(n) {
n.scrollPageDown();
}, readOnly: true }, { name: "gotopagedown", description: "Go to page down", bindKey: h("PageDown", "PageDown|Ctrl-V"), exec: function(n) {
n.gotoPageDown();
}, readOnly: true }, { name: "selectpageup", description: "Select page up", bindKey: "Shift-PageUp", exec: function(n) {
n.selectPageUp();
}, readOnly: true }, { name: "pageup", description: "Page up", bindKey: h(null, "Option-PageUp"), exec: function(n) {
n.scrollPageUp();
}, readOnly: true }, { name: "gotopageup", description: "Go to page up", bindKey: "PageUp", exec: function(n) {
n.gotoPageUp();
}, readOnly: true }, { name: "scrollup", description: "Scroll up", bindKey: h("Ctrl-Up", null), exec: function(n) {
n.renderer.scrollBy(0, -2 * n.renderer.layerConfig.lineHeight);
}, readOnly: true }, { name: "scrolldown", description: "Scroll down", bindKey: h("Ctrl-Down", null), exec: function(n) {
n.renderer.scrollBy(0, 2 * n.renderer.layerConfig.lineHeight);
}, readOnly: true }, { name: "selectlinestart", description: "Select line start", bindKey: "Shift-Home", exec: function(n) {
n.getSelection().selectLineStart();
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "selectlineend", description: "Select line end", bindKey: "Shift-End", exec: function(n) {
n.getSelection().selectLineEnd();
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "togglerecording", description: "Toggle recording", bindKey: h("Ctrl-Alt-E", "Command-Option-E"), exec: function(n) {
n.commands.toggleRecording(n);
}, readOnly: true }, { name: "replaymacro", description: "Replay macro", bindKey: h("Ctrl-Shift-E", "Command-Shift-E"), exec: function(n) {
n.commands.replay(n);
}, readOnly: true }, { name: "jumptomatching", description: "Jump to matching", bindKey: h("Ctrl-\\|Ctrl-P", "Command-\\"), exec: function(n) {
n.jumpToMatching();
}, multiSelectAction: "forEach", scrollIntoView: "animate", readOnly: true }, { name: "selecttomatching", description: "Select to matching", bindKey: h("Ctrl-Shift-\\|Ctrl-Shift-P", "Command-Shift-\\"), exec: function(n) {
n.jumpToMatching(true);
}, multiSelectAction: "forEach", scrollIntoView: "animate", readOnly: true }, { name: "expandToMatching", description: "Expand to matching", bindKey: h("Ctrl-Shift-M", "Ctrl-Shift-M"), exec: function(n) {
n.jumpToMatching(true, true);
}, multiSelectAction: "forEach", scrollIntoView: "animate", readOnly: true }, { name: "passKeysToBrowser", description: "Pass keys to browser", bindKey: h(null, null), exec: function() {
}, passEvent: true, readOnly: true }, { name: "copy", description: "Copy", exec: function(n) {
}, readOnly: true }, { name: "cut", description: "Cut", exec: function(n) {
var o = n.$copyWithEmptySelection && n.selection.isEmpty() ? n.selection.getLineRange() : n.selection.getRange();
n._emit("cut", o), o.isEmpty() || n.session.remove(o), n.clearSelection();
}, scrollIntoView: "cursor", multiSelectAction: "forEach" }, { name: "paste", description: "Paste", exec: function(n, o) {
n.$handlePaste(o);
}, scrollIntoView: "cursor" }, { name: "removeline", description: "Remove line", bindKey: h("Ctrl-D", "Command-D"), exec: function(n) {
n.removeLines();
}, scrollIntoView: "cursor", multiSelectAction: "forEachLine" }, { name: "duplicateSelection", description: "Duplicate selection", bindKey: h("Ctrl-Shift-D", "Command-Shift-D"), exec: function(n) {
n.duplicateSelection();
}, scrollIntoView: "cursor", multiSelectAction: "forEach" }, { name: "sortlines", description: "Sort lines", bindKey: h("Ctrl-Alt-S", "Command-Alt-S"), exec: function(n) {
n.sortLines();
}, scrollIntoView: "selection", multiSelectAction: "forEachLine" }, { name: "togglecomment", description: "Toggle comment", bindKey: h("Ctrl-/", "Command-/"), exec: function(n) {
n.toggleCommentLines();
}, multiSelectAction: "forEachLine", scrollIntoView: "selectionPart" }, { name: "toggleBlockComment", description: "Toggle block comment", bindKey: h("Ctrl-Shift-/", "Command-Shift-/"), exec: function(n) {
n.toggleBlockComment();
}, multiSelectAction: "forEach", scrollIntoView: "selectionPart" }, { name: "modifyNumberUp", description: "Modify number up", bindKey: h("Ctrl-Shift-Up", "Alt-Shift-Up"), exec: function(n) {
n.modifyNumber(1);
}, scrollIntoView: "cursor", multiSelectAction: "forEach" }, { name: "modifyNumberDown", description: "Modify number down", bindKey: h("Ctrl-Shift-Down", "Alt-Shift-Down"), exec: function(n) {
n.modifyNumber(-1);
}, scrollIntoView: "cursor", multiSelectAction: "forEach" }, { name: "replace", description: "Replace", bindKey: h("Ctrl-H", "Command-Option-F"), exec: function(n) {
C.loadModule("ace/ext/searchbox", function(o) {
o.Search(n, true);
});
} }, {
name: "undo",
description: "Undo",
bindKey: h("Ctrl-Z", "Command-Z"),
exec: function(n) {
n.undo();
}
}, { name: "redo", description: "Redo", bindKey: h("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"), exec: function(n) {
n.redo();
} }, { name: "copylinesup", description: "Copy lines up", bindKey: h("Alt-Shift-Up", "Command-Option-Up"), exec: function(n) {
n.copyLinesUp();
}, scrollIntoView: "cursor" }, { name: "movelinesup", description: "Move lines up", bindKey: h("Alt-Up", "Option-Up"), exec: function(n) {
n.moveLinesUp();
}, scrollIntoView: "cursor" }, { name: "copylinesdown", description: "Copy lines down", bindKey: h("Alt-Shift-Down", "Command-Option-Down"), exec: function(n) {
n.copyLinesDown();
}, scrollIntoView: "cursor" }, { name: "movelinesdown", description: "Move lines down", bindKey: h("Alt-Down", "Option-Down"), exec: function(n) {
n.moveLinesDown();
}, scrollIntoView: "cursor" }, { name: "del", description: "Delete", bindKey: h("Delete", "Delete|Ctrl-D|Shift-Delete"), exec: function(n) {
n.remove("right");
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "backspace", description: "Backspace", bindKey: h("Shift-Backspace|Backspace", "Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"), exec: function(n) {
n.remove("left");
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "cut_or_delete", description: "Cut or delete", bindKey: h("Shift-Delete", null), exec: function(n) {
if (!n.selection.isEmpty())
return false;
n.remove("left");
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "removetolinestart", description: "Remove to line start", bindKey: h("Alt-Backspace", "Command-Backspace"), exec: function(n) {
n.removeToLineStart();
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "removetolineend", description: "Remove to line end", bindKey: h("Alt-Delete", "Ctrl-K|Command-Delete"), exec: function(n) {
n.removeToLineEnd();
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "removetolinestarthard", description: "Remove to line start hard", bindKey: h("Ctrl-Shift-Backspace", null), exec: function(n) {
var o = n.selection.getRange();
o.start.column = 0, n.session.remove(o);
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "removetolineendhard", description: "Remove to line end hard", bindKey: h("Ctrl-Shift-Delete", null), exec: function(n) {
var o = n.selection.getRange();
o.end.column = Number.MAX_VALUE, n.session.remove(o);
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "removewordleft", description: "Remove word left", bindKey: h("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"), exec: function(n) {
n.removeWordLeft();
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "removewordright", description: "Remove word right", bindKey: h("Ctrl-Delete", "Alt-Delete"), exec: function(n) {
n.removeWordRight();
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "outdent", description: "Outdent", bindKey: h("Shift-Tab", "Shift-Tab"), exec: function(n) {
n.blockOutdent();
}, multiSelectAction: "forEach", scrollIntoView: "selectionPart" }, { name: "indent", description: "Indent", bindKey: h("Tab", "Tab"), exec: function(n) {
n.indent();
}, multiSelectAction: "forEach", scrollIntoView: "selectionPart" }, { name: "blockoutdent", description: "Block outdent", bindKey: h("Ctrl-[", "Ctrl-["), exec: function(n) {
n.blockOutdent();
}, multiSelectAction: "forEachLine", scrollIntoView: "selectionPart" }, { name: "blockindent", description: "Block indent", bindKey: h("Ctrl-]", "Ctrl-]"), exec: function(n) {
n.blockIndent();
}, multiSelectAction: "forEachLine", scrollIntoView: "selectionPart" }, { name: "insertstring", description: "Insert string", exec: function(n, o) {
n.insert(o);
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "inserttext", description: "Insert text", exec: function(n, o) {
n.insert(y.stringRepeat(o.text || "", o.times || 1));
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "splitline", description: "Split line", bindKey: h(null, "Ctrl-O"), exec: function(n) {
n.splitLine();
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "transposeletters", description: "Transpose letters", bindKey: h("Alt-Shift-X", "Ctrl-T"), exec: function(n) {
n.transposeLetters();
}, multiSelectAction: function(n) {
n.transposeSelections(1);
}, scrollIntoView: "cursor" }, { name: "touppercase", description: "To uppercase", bindKey: h("Ctrl-U", "Ctrl-U"), exec: function(n) {
n.toUpperCase();
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "tolowercase", description: "To lowercase", bindKey: h("Ctrl-Shift-U", "Ctrl-Shift-U"), exec: function(n) {
n.toLowerCase();
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "autoindent", description: "Auto Indent", bindKey: h(null, null), exec: function(n) {
n.autoIndent();
}, multiSelectAction: "forEachLine", scrollIntoView: "animate" }, { name: "expandtoline", description: "Expand to line", bindKey: h("Ctrl-Shift-L", "Command-Shift-L"), exec: function(n) {
var o = n.selection.getRange();
o.start.column = o.end.column = 0, o.end.row++, n.selection.setRange(o, false);
}, multiSelectAction: "forEach", scrollIntoView: "cursor", readOnly: true }, { name: "openlink", bindKey: h("Ctrl+F3", "F3"), exec: function(n) {
n.openLink();
} }, { name: "joinlines", description: "Join lines", bindKey: h(null, null), exec: function(n) {
for (var a = n.selection.isBackwards(), o = a ? n.selection.getSelectionLead() : n.selection.getSelectionAnchor(), i = a ? n.selection.getSelectionAnchor() : n.selection.getSelectionLead(), a = n.session.doc.getLine(o.row).length, r = n.session.doc.getTextRange(n.selection.getRange()).replace(/\n\s*/, " ").length, e2 = n.session.doc.getLine(o.row), t = o.row + 1; t <= i.row + 1; t++) {
var s = y.stringTrimLeft(y.stringTrimRight(n.session.doc.getLine(t)));
e2 += s = s.length !== 0 ? " " + s : s;
}
i.row + 1 < n.session.doc.getLength() - 1 && (e2 += n.session.doc.getNewLineCharacter()), n.clearSelection(), n.session.doc.replace(new d(o.row, 0, i.row + 2, 0), e2), 0 < r ? (n.selection.moveCursorTo(o.row, o.column), n.selection.selectTo(o.row, o.column + r)) : (a = n.session.doc.getLine(o.row).length > a ? a + 1 : a, n.selection.moveCursorTo(o.row, a));
}, multiSelectAction: "forEach", readOnly: true }, { name: "invertSelection", description: "Invert selection", bindKey: h(null, null), exec: function(n) {
var o = n.session.doc.getLength() - 1, i = n.session.doc.getLine(o).length, a = n.selection.rangeList.ranges, r = [];
a.length < 1 && (a = [n.selection.getRange()]);
for (var e2 = 0; e2 < a.length; e2++)
e2 != a.length - 1 || a[e2].end.row === o && a[e2].end.column === i || r.push(new d(a[e2].end.row, a[e2].end.column, o, i)), e2 === 0 ? a[e2].start.row === 0 && a[e2].start.column === 0 || r.push(new d(0, 0, a[e2].start.row, a[e2].start.column)) : r.push(new d(a[e2 - 1].end.row, a[e2 - 1].end.column, a[e2].start.row, a[e2].start.column));
for (n.exitMultiSelectMode(), n.clearSelection(), e2 = 0; e2 < r.length; e2++)
n.selection.addRange(r[e2], false);
}, readOnly: true, scrollIntoView: "none" }, { name: "addLineAfter", description: "Add new line after the current line", exec: function(n) {
n.selection.clearSelection(), n.navigateLineEnd(), n.insert(`
`);
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "addLineBefore", description: "Add new line before the current line", exec: function(n) {
n.selection.clearSelection();
var o = n.getCursorPosition();
n.selection.moveTo(o.row - 1, Number.MAX_VALUE), n.insert(`
`), o.row === 0 && n.navigateUp();
}, multiSelectAction: "forEach", scrollIntoView: "cursor" }, { name: "openCommandPallete", exec: function(n) {
n.prompt({ $type: "commands" });
}, readOnly: true }, { name: "openCommandPalette", description: "Open command palette", bindKey: h("F1", "F1"), exec: function(n) {
n.prompt({ $type: "commands" });
}, readOnly: true }, { name: "modeSelect", description: "Change language mode...", bindKey: h(null, null), exec: function(n) {
n.prompt({ $type: "modes" });
}, readOnly: true }];
for (var l = 1; l < 9; l++)
f.commands.push({ name: "foldToLevel" + l, description: "Fold To Level " + l, level: l, exec: function(n) {
n.session.foldToLevel(this.level);
}, scrollIntoView: "center", readOnly: true });
}), ace.define("ace/line_widgets", ["require", "exports", "module", "ace/lib/dom"], function(A, f, R) {
var y = A("./lib/dom");
function C(d) {
this.session = d, (this.session.widgetManager = this).session.getRowLength = this.getRowLength, this.session.$getWidgetScreenLength = this.$getWidgetScreenLength, this.updateOnChange = this.updateOnChange.bind(this), this.renderWidgets = this.renderWidgets.bind(this), this.measureWidgets = this.measureWidgets.bind(this), this.session._changedWidgets = [], this.$onChangeEditor = this.$onChangeEditor.bind(this), this.session.on("change", this.updateOnChange), this.session.on("changeFold", this.updateOnFold), this.session.on("changeEditor", this.$onChangeEditor);
}
C.prototype.getRowLength = function(d) {
var h = this.lineWidgets && this.lineWidgets[d] && this.lineWidgets[d].rowCount || 0;
return this.$useWrapMode && this.$wrapData[d] ? this.$wrapData[d].length + 1 + h : 1 + h;
}, C.prototype.$getWidgetScreenLength = function() {
var d = 0;
return this.lineWidgets.forEach(function(h) {
h && h.rowCount && !h.hidden && (d += h.rowCount);
}), d;
}, C.prototype.$onChangeEditor = function(d) {
this.attach(d.editor);
}, C.prototype.attach = function(d) {
d && d.widgetManager && d.widgetManager != this && d.widgetManager.detach(), this.editor != d && (this.detach(), this.editor = d) && (d.widgetManager = this, d.renderer.on("beforeRender", this.measureWidgets), d.renderer.on("afterRender", this.renderWidgets));
}, C.prototype.detach = function(d) {
var h = this.editor;
h && (this.editor = null, h.widgetManager = null, h.renderer.off("beforeRender", this.measureWidgets), h.renderer.off("afterRender", this.renderWidgets), h = this.session.lineWidgets) && h.forEach(function(l) {
l && l.el && l.el.parentNode && (l._inDocument = false, l.el.parentNode.removeChild(l.el));
});
}, C.prototype.updateOnFold = function(d, h) {
var l = h.lineWidgets;
if (l && d.action) {
for (var h = d.data, n = h.start.row, o = h.end.row, i = d.action == "add", a = n + 1; a < o; a++)
l[a] && (l[a].hidden = i);
l[o] && (i ? l[n] ? l[o].hidden = i : l[n] = l[o] : (l[n] == l[o] && (l[n] = void 0), l[o].hidden = i));
}
}, C.prototype.updateOnChange = function(d) {
var h, l, n, o = this.session.lineWidgets;
o && (h = d.start.row, (l = d.end.row - h) != 0) && (d.action == "remove" ? (n = o.splice(h + 1, l), !o[h] && n[n.length - 1] && (o[h] = n.pop()), n.forEach(function(i) {
i && this.removeLineWidget(i);
}, this)) : (n = new Array(l), o[h] && o[h].column != null && d.start.column > o[h].column && h++, n.unshift(h, 0), o.splice.apply(o, n)), this.$updateRows());
}, C.prototype.$updateRows = function() {
var d, h = this.session.lineWidgets;
h && (d = true, h.forEach(function(l, n) {
if (l)
for (d = false, l.row = n; l.$oldWidget; )
l.$oldWidget.row = n, l = l.$oldWidget;
}), d) && (this.session.lineWidgets = null);
}, C.prototype.$registerLineWidget = function(d) {
this.session.lineWidgets || (this.session.lineWidgets = new Array(this.session.getLength()));
var h = this.session.lineWidgets[d.row];
return h && (d.$oldWidget = h).el && h.el.parentNode && (h.el.parentNode.removeChild(h.el), h._inDocument = false), this.session.lineWidgets[d.row] = d;
}, C.prototype.addLineWidget = function(d) {
var h, l, n;
return this.$registerLineWidget(d), d.session = this.session, this.editor && (h = this.editor.renderer, d.html && !d.el && (d.el = y.createElement("div"), d.el.innerHTML = d.html), d.text && !d.el && (d.el = y.createElement("div"), d.el.textContent = d.text), d.el && (y.addCssClass(d.el, "ace_lineWidgetContainer"), d.className && y.addCssClass(d.el, d.className), d.el.style.position = "absolute", d.el.style.zIndex = 5, h.container.appendChild(d.el), d._inDocument = true, d.coverGutter || (d.el.style.zIndex = 3), d.pixelHeight == null) && (d.pixelHeight = d.el.offsetHeight), d.rowCount == null && (d.rowCount = d.pixelHeight / h.layerConfig.lineHeight), l = this.session.getFoldAt(d.row, 0), (d.$fold = l) && (n = this.session.lineWidgets, d.row != l.end.row || n[l.start.row] ? d.hidden = true : n[l.start.row] = d), this.session._emit("changeFold", { data: { start: { row: d.row } } }), this.$updateRows(), this.renderWidgets(null, h), this.onWidgetChanged(d)), d;
}, C.prototype.removeLineWidget = function(d) {
if (d._inDocument = false, d.session = null, d.el && d.el.parentNode && d.el.parentNode.removeChild(d.el), d.editor && d.editor.destroy)
try {
d.editor.destroy();
} catch {
}
if (this.session.lineWidgets) {
var h = this.session.lineWidgets[d.row];
if (h == d)
this.session.lineWidgets[d.row] = d.$oldWidget, d.$oldWidget && this.onWidgetChanged(d.$oldWidget);
else
for (; h; ) {
if (h.$oldWidget == d) {
h.$oldWidget = d.$oldWidget;
break;
}
h = h.$oldWidget;
}
}
this.session._emit("changeFold", { data: { start: { row: d.row } } }), this.$updateRows();
}, C.prototype.getWidgetsAtRow = function(d) {
for (var h = this.session.lineWidgets, l = h && h[d], n = []; l; )
n.push(l), l = l.$oldWidget;
return n;
}, C.prototype.onWidgetChanged = function(d) {
this.session._changedWidgets.push(d), this.editor && this.editor.renderer.updateFull();
}, C.prototype.measureWidgets = function(d, h) {
var l = this.session._changedWidgets, n = h.layerConfig;
if (l && l.length) {
for (var o = 1 / 0, i = 0; i < l.length; i++) {
var a = l[i];
if (a && a.el && a.session == this.session) {
if (!a._inDocument) {
if (this.session.lineWidgets[a.row] != a)
continue;
a._inDocument = true, h.container.appendChild(a.el);
}
a.h = a.el.offsetHeight, a.fixedWidth || (a.w = a.el.offsetWidth, a.screenWidth = Math.ceil(a.w / n.characterWidth));
var r = a.h / n.lineHeight;
a.coverLine && (r -= this.session.getRowLineCount(a.row)) < 0 && (r = 0), a.rowCount != r && (a.rowCount = r, a.row < o) && (o = a.row);
}
}
o != 1 / 0 && (this.session._emit("changeFold", { data: { start: { row: o } } }), this.session.lineWidgetWidth = null), this.session._changedWidgets = [];
}
}, C.prototype.renderWidgets = function(d, h) {
var l = h.layerConfig, n = this.session.lineWidgets;
if (n) {
for (var o = Math.min(this.firstRow, l.firstRow), i = Math.max(this.lastRow, l.lastRow, n.length); 0 < o && !n[o]; )
o--;
this.firstRow = l.firstRow, this.lastRow = l.lastRow, h.$cursorLayer.config = l;
for (var a = o; a <= i; a++) {
var r, e2 = n[a];
e2 && e2.el && (e2.hidden ? e2.el.style.top = -100 - (e2.pixelHeight || 0) + "px" : (e2._inDocument || (e2._inDocument = true, h.container.appendChild(e2.el)), r = h.$cursorLayer.getPixelPosition({ row: a, column: 0 }, true).top, e2.coverLine || (r += l.lineHeight * this.session.getRowLineCount(e2.row)), e2.el.style.top = r - l.offset + "px", r = e2.coverGutter ? 0 : h.gutterWidth, e2.fixedWidth || (r -= h.scrollLeft), e2.el.style.left = r + "px", e2.fullWidth && e2.screenWidth && (e2.el.style.minWidth = l.width + 2 * l.padding + "px"), e2.fixedWidth ? e2.el.style.right = h.scrollBar.getWidth() + "px" : e2.el.style.right = ""));
}
}
}, f.LineWidgets = C;
}), ace.define("ace/keyboard/gutter_handler", ["require", "exports", "module", "ace/lib/keys", "ace/mouse/default_gutter_handler"], function(A, f, R) {
var y = A("../lib/keys"), C = A("../mouse/default_gutter_handler").GutterTooltip;
function d(n) {
this.editor = n, this.gutterLayer = n.renderer.$gutterLayer, this.element = n.renderer.$gutter, this.lines = n.renderer.$gutterLayer.$lines, this.activeRowIndex = null, this.activeLane = null, this.annotationTooltip = new C(this.editor);
}
d.prototype.addListener = function() {
this.element.addEventListener("keydown", this.$onGutterKeyDown.bind(this)), this.element.addEventListener("focusout", this.$blurGutter.bind(this)), this.editor.on("mousewheel", this.$blurGutter.bind(this));
}, d.prototype.removeListener = function() {
this.element.removeEventListener("keydown", this.$onGutterKeyDown.bind(this)), this.element.removeEventListener("focusout", this.$blurGutter.bind(this)), this.editor.off("mousewheel", this.$blurGutter.bind(this));
}, d.prototype.$onGutterKeyDown = function(n) {
var o;
this.annotationTooltip.isOpen ? (n.preventDefault(), n.keyCode === y.escape && this.annotationTooltip.hideTooltip()) : n.target === this.element ? n.keyCode == y.enter && (n.preventDefault(), o = this.editor.getCursorPosition().row, this.editor.isRowVisible(o) || this.editor.scrollToLine(o, true, true), setTimeout((function() {
var i = this.$rowToRowIndex(this.gutterLayer.$cursorCell.row), a = this.$findNearestFoldWidget(i), r = this.$findNearestAnnotation(i);
a === null && r === null || (a === null && r !== null || (a === null || r !== null) && Math.abs(r - i) < Math.abs(a - i) ? (this.activeRowIndex = r, this.activeLane = "annotation", this.$focusAnnotation(this.activeRowIndex)) : (this.activeRowIndex = a, this.activeLane = "fold", this.$focusFoldWidget(this.activeRowIndex)));
}).bind(this), 10)) : (this.$handleGutterKeyboardInteraction(n), setTimeout((function() {
this.editor._signal("gutterkeydown", new h(n, this));
}).bind(this), 10));
}, d.prototype.$handleGutterKeyboardInteraction = function(n) {
if (n.keyCode === y.tab)
n.preventDefault();
else if (n.keyCode === y.escape)
n.preventDefault(), this.$blurGutter(), this.element.focus(), this.lane = null;
else if (n.keyCode === y.up)
switch (n.preventDefault(), this.activeLane) {
case "fold":
this.$moveFoldWidgetUp();
break;
case "annotation":
this.$moveAnnotationUp();
}
else if (n.keyCode === y.down)
switch (n.preventDefault(), this.activeLane) {
case "fold":
this.$moveFoldWidgetDown();
break;
case "annotation":
this.$moveAnnotationDown();
}
else if (n.keyCode === y.left)
n.preventDefault(), this.$switchLane("annotation");
else if (n.keyCode === y.right)
n.preventDefault(), this.$switchLane("fold");
else if (n.keyCode === y.enter || n.keyCode === y.space)
switch (n.preventDefault(), this.activeLane) {
case "fold":
if (this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)] === "start") {
var o = this.$rowIndexToRow(this.activeRowIndex);
this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex), n), setTimeout((function() {
this.$rowIndexToRow(this.activeRowIndex) !== o && (this.$blurFoldWidget(this.activeRowIndex), this.activeRowIndex = this.$rowToRowIndex(o), this.$focusFoldWidget(this.activeRowIndex));
}).bind(this), 10);
break;
}
if (this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)] === "end")
break;
return;
case "annotation":
var i = this.lines.cells[this.activeRowIndex].element.childNodes[2].getBoundingClientRect(), a = this.annotationTooltip.getElement().style;
a.left = i.right + "px", a.top = i.bottom + "px", this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));
}
}, d.prototype.$blurGutter = function() {
if (this.activeRowIndex !== null)
switch (this.activeLane) {
case "fold":
this.$blurFoldWidget(this.activeRowIndex);
break;
case "annotation":
this.$blurAnnotation(this.activeRowIndex);
}
this.annotationTooltip.isOpen && this.annotationTooltip.hideTooltip();
}, d.prototype.$isFoldWidgetVisible = function(i) {
var o = this.editor.isRowFullyVisible(this.$rowIndexToRow(i)), i = this.$getFoldWidget(i).style.display !== "none";
return o && i;
}, d.prototype.$isAnnotationVisible = function(i) {
var o = this.editor.isRowFullyVisible(this.$rowIndexToRow(i)), i = this.$getAnnotation(i).style.display !== "none";
return o && i;
}, d.prototype.$getFoldWidget = function(n) {
return this.lines.get(n).element.childNodes[1];
}, d.prototype.$getAnnotation = function(n) {
return this.lines.get(n).element.childNodes[2];
}, d.prototype.$findNearestFoldWidget = function(n) {
if (this.$isFoldWidgetVisible(n))
return n;
for (var o = 0; 0 < n - o || n + o < this.lines.getLength() - 1; ) {
if (0 <= n - ++o && this.$isFoldWidgetVisible(n - o))
return n - o;
if (n + o <= this.lines.getLength() - 1 && this.$isFoldWidgetVisible(n + o))
return n + o;
}
return null;
}, d.prototype.$findNearestAnnotation = function(n) {
if (this.$isAnnotationVisible(n))
return n;
for (var o = 0; 0 < n - o || n + o < this.lines.getLength() - 1; ) {
if (0 <= n - ++o && this.$isAnnotationVisible(n - o))
return n - o;
if (n + o <= this.lines.getLength() - 1 && this.$isAnnotationVisible(n + o))
return n + o;
}
return null;
}, d.prototype.$focusFoldWidget = function(n) {
n != null && ((n = this.$getFoldWidget(n)).classList.add(this.editor.renderer.keyboardFocusClassName), n.focus());
}, d.prototype.$focusAnnotation = function(n) {
n != null && ((n = this.$getAnnotation(n)).classList.add(this.editor.renderer.keyboardFocusClassName), n.focus());
}, d.prototype.$blurFoldWidget = function(n) {
n = this.$getFoldWidget(n), n.classList.remove(this.editor.renderer.keyboardFocusClassName), n.blur();
}, d.prototype.$blurAnnotation = function(n) {
n = this.$getAnnotation(n), n.classList.remove(this.editor.renderer.keyboardFocusClassName), n.blur();
}, d.prototype.$moveFoldWidgetUp = function() {
for (var n = this.activeRowIndex; 0 < n; )
if (this.$isFoldWidgetVisible(--n))
return this.$blurFoldWidget(this.activeRowIndex), this.activeRowIndex = n, void this.$focusFoldWidget(this.activeRowIndex);
}, d.prototype.$moveFoldWidgetDown = function() {
for (var n = this.activeRowIndex; n < this.lines.getLength() - 1; )
if (this.$isFoldWidgetVisible(++n))
return this.$blurFoldWidget(this.activeRowIndex), this.activeRowIndex = n, void this.$focusFoldWidget(this.activeRowIndex);
}, d.prototype.$moveAnnotationUp = function() {
for (var n = this.activeRowIndex; 0 < n; )
if (this.$isAnnotationVisible(--n))
return this.$blurAnnotation(this.activeRowIndex), this.activeRowIndex = n, void this.$focusAnnotation(this.activeRowIndex);
}, d.prototype.$moveAnnotationDown = function() {
for (var n = this.activeRowIndex; n < this.lines.getLength() - 1; )
if (this.$isAnnotationVisible(++n))
return this.$blurAnnotation(this.activeRowIndex), this.activeRowIndex = n, void this.$focusAnnotation(this.activeRowIndex);
}, d.prototype.$switchLane = function(n) {
switch (n) {
case "annotation":
this.activeLane !== "annotation" && (o = this.$findNearestAnnotation(this.activeRowIndex)) != null && (this.activeLane = "annotation", this.$blurFoldWidget(this.activeRowIndex), this.activeRowIndex = o, this.$focusAnnotation(this.activeRowIndex));
break;
case "fold":
var o;
this.activeLane !== "fold" && (o = this.$findNearestFoldWidget(this.activeRowIndex)) != null && (this.activeLane = "fold", this.$blurAnnotation(this.activeRowIndex), this.activeRowIndex = o, this.$focusFoldWidget(this.activeRowIndex));
}
}, d.prototype.$rowIndexToRow = function(n) {
return n = this.lines.get(n), n ? n.row : null;
}, d.prototype.$rowToRowIndex = function(n) {
for (var o = 0; o < this.lines.getLength(); o++)
if (this.lines.get(o).row == n)
return o;
return null;
}, f.GutterKeyboardHandler = d, l.prototype.getKey = function() {
return y.keyCodeToString(this.domEvent.keyCode);
}, l.prototype.getRow = function() {
return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex);
}, l.prototype.isInAnnotationLane = function() {
return this.gutterKeyboardHandler.activeLane === "annotation";
}, l.prototype.isInFoldLane = function() {
return this.gutterKeyboardHandler.activeLane === "fold";
};
var h = l;
function l(n, o) {
this.gutterKeyboardHandler = o, this.domEvent = n;
}
f.GutterKeyboardEvent = h;
}), ace.define("ace/editor", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/lang", "ace/lib/useragent", "ace/keyboard/textinput", "ace/mouse/mouse_handler", "ace/mouse/fold_handler", "ace/keyboard/keybinding", "ace/edit_session", "ace/search", "ace/range", "ace/lib/event_emitter", "ace/commands/command_manager", "ace/commands/default_commands", "ace/config", "ace/token_iterator", "ace/line_widgets", "ace/keyboard/gutter_handler", "ace/config", "ace/clipboard", "ace/lib/keys"], function(k, f, R) {
var y = this && this.__values || function(v) {
var $ = typeof Symbol == "function" && Symbol.iterator, G = $ && v[$], W = 0;
if (G)
return G.call(v);
if (v && typeof v.length == "number")
return { next: function() {
return { value: (v = v && W >= v.length ? void 0 : v) && v[W++], done: !v };
} };
throw new TypeError($ ? "Object is not iterable." : "Symbol.iterator is not defined.");
}, C = k("./lib/oop"), d = k("./lib/dom"), h = k("./lib/lang"), l = k("./lib/useragent"), n = k("./keyboard/textinput").TextInput, o = k("./mouse/mouse_handler").MouseHandler, i = k("./mouse/fold_handler").FoldHandler, a = k("./keyboard/keybinding").KeyBinding, r = k("./edit_session").EditSession, e2 = k("./search").Search, t = k("./range").Range, s = k("./lib/event_emitter").EventEmitter, c = k("./commands/command_manager").CommandManager, p = k("./commands/default_commands").commands, g = k("./config"), b = k("./token_iterator").TokenIterator, w = k("./line_widgets").LineWidgets, E = k("./keyboard/gutter_handler").GutterKeyboardHandler, M = k("./config").nls, B2 = k("./clipboard"), Z = k("./lib/keys"), k = (u.prototype.$initOperationListeners = function() {
this.commands.on("exec", this.startOperation.bind(this), true), this.commands.on("afterExec", this.endOperation.bind(this), true), this.$opResetTimer = h.delayedCall(this.endOperation.bind(this, true)), this.on("change", (function() {
this.curOp || (this.startOperation(), this.curOp.selectionBefore = this.$lastSel), this.curOp.docChanged = true;
}).bind(this), true), this.on("changeSelection", (function() {
this.curOp || (this.startOperation(), this.curOp.selectionBefore = this.$lastSel), this.curOp.selectionChanged = true;
}).bind(this), true);
}, u.prototype.startOperation = function(v) {
if (this.curOp) {
if (!v || this.curOp.command)
return;
this.prevOp = this.curOp;
}
v || (this.previousCommand = null, v = {}), this.$opResetTimer.schedule(), this.curOp = this.session.curOp = { command: v.command || {}, args: v.args, scrollTop: this.renderer.scrollTop }, this.curOp.selectionBefore = this.selection.toJSON();
}, u.prototype.endOperation = function(v) {
if (this.curOp && this.session) {
if (v && v.returnValue === false || !this.session)
return this.curOp = null;
if ((v != 1 || !this.curOp.command || this.curOp.command.name != "mouse") && (this._signal("beforeEndOperation"), this.curOp)) {
var v = this.curOp.command, $ = v && v.scrollIntoView;
if ($) {
switch ($) {
case "center-animate":
$ = "animate";
case "center":
this.renderer.scrollCursorIntoView(null, 0.5);
break;
case "animate":
case "cursor":
this.renderer.scrollCursorIntoView();
break;
case "selectionPart":
var G = this.selection.getRange(), W = this.renderer.layerConfig;
(G.start.row >= W.lastRow || G.end.row <= W.firstRow) && this.renderer.scrollSelectionIntoView(this.selection.anchor, this.selection.lead);
}
$ == "animate" && this.renderer.animateScrolling(this.curOp.scrollTop);
}
v = this.selection.toJSON(), this.curOp.selectionAfter = v, this.$lastSel = this.selection.toJSON(), this.session.getUndoManager().addSelection(v), this.prevOp = this.curOp, this.curOp = null;
}
}
}, u.prototype.$historyTracker = function(v) {
var $, G, W, X;
this.$mergeUndoDeltas && ($ = this.prevOp, G = this.$mergeableCommands, W = $.command && v.command.name == $.command.name, v.command.name == "insertstring" ? (X = v.args, this.mergeNextCommand === void 0 && (this.mergeNextCommand = true), W = W && this.mergeNextCommand && (!/\s/.test(X) || /\s/.test($.args)), this.mergeNextCommand = true) : W = W && G.indexOf(v.command.name) !== -1, (W = this.$mergeUndoDeltas != "always" && 2e3 < Date.now() - this.sequenceStartTime ? false : W) ? this.session.mergeUndoDeltas = true : G.indexOf(v.command.name) !== -1 && (this.sequenceStartTime = Date.now()));
}, u.prototype.setKeyboardHandler = function(v, $) {
var G;
v && typeof v == "string" && v != "ace" ? (this.$keybindingId = v, G = this, g.loadModule(["keybinding", v], function(W) {
G.$keybindingId == v && G.keyBinding.setKeyboardHandler(W && W.handler), $ && $();
})) : (this.$keybindingId = null, this.keyBinding.setKeyboardHandler(v), $ && $());
}, u.prototype.getKeyboardHandler = function() {
return this.keyBinding.getKeyboardHandler();
}, u.prototype.setSession = function(v) {
var $, G;
this.session != v && (this.curOp && this.endOperation(), this.curOp = {}, ($ = this.session) && (this.session.off("change", this.$onDocumentChange), this.session.off("changeMode", this.$onChangeMode), this.session.off("tokenizerUpdate", this.$onTokenizerUpdate), this.session.off("changeTabSize", this.$onChangeTabSize), this.session.off("changeWrapLimit", this.$onChangeWrapLimit), this.session.off("changeWrapMode", this.$onChangeWrapMode), this.session.off("changeFold", this.$onChangeFold), this.session.off("changeFrontMarker", this.$onChangeFrontMarker), this.session.off("changeBackMarker", this.$onChangeBackMarker), this.session.off("changeBreakpoint", this.$onChangeBreakpoint), this.session.off("changeAnnotation", this.$onChangeAnnotation), this.session.off("changeOverwrite", this.$onCursorChange), this.session.off("changeScrollTop", this.$onScrollTopChange), this.session.off("changeScrollLeft", this.$onScrollLeftChange), (G = this.session.getSelection()).off("changeCursor", this.$onCursorChange), G.off("changeSelection", this.$onSelectionChange)), (this.session = v) ? (this.$onDocumentChange = this.onDocumentChange.bind(this), v.on("change", this.$onDocumentChange), this.renderer.setSession(v), this.$onChangeMode = this.onChangeMode.bind(this), v.on("changeMode", this.$onChangeMode), this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this), v.on("tokenizerUpdate", this.$onTokenizerUpdate), this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer), v.on("changeTabSize", this.$onChangeTabSize), this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this), v.on("changeWrapLimit", this.$onChangeWrapLimit), this.$onChangeWrapMode = this.onChangeWrapMode.bind(this), v.on("changeWrapMode", this.$onChangeWrapMode), this.$onChangeFold = this.onChangeFold.bind(this), v.on("changeFold", this.$onChangeFold), this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this), this.session.on("changeFrontMarker", this.$onChangeFrontMarker), this.$onChangeBackMarker = this.onChangeBackMarker.bind(this), this.session.on("changeBackMarker", this.$onChangeBackMarker), this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this), this.session.on("changeBreakpoint", this.$onChangeBreakpoint), this.$onChangeAnnotation = this.onChangeAnnotation.bind(this), this.session.on("changeAnnotation", this.$onChangeAnnotation), this.$onCursorChange = this.onCursorChange.bind(this), this.session.on("changeOverwrite", this.$onCursorChange), this.$onScrollTopChange = this.onScrollTopChange.bind(this), this.session.on("changeScrollTop", this.$onScrollTopChange), this.$onScrollLeftChange = this.onScrollLeftChange.bind(this), this.session.on("changeScrollLeft", this.$onScrollLeftChange), this.selection = v.getSelection(), this.selection.on("changeCursor", this.$onCursorChange), this.$onSelectionChange = this.onSelectionChange.bind(this), this.selection.on("changeSelection", this.$onSelectionChange), this.onChangeMode(), this.onCursorChange(), this.onScrollTopChange(), this.onScrollLeftChange(), this.onSelectionChange(), this.onChangeFrontMarker(), this.onChangeBackMarker(), this.onChangeBreakpoint(), this.onChangeAnnotation(), this.session.getUseWrapMode() && this.renderer.adjustWrapLimit(), this.renderer.updateFull()) : (this.selection = null, this.renderer.setSession(v)), this._signal("changeSession", { session: v, oldSession: $ }), this.curOp = null, $ && $._signal("changeEditor", { oldEditor: this }), v && v._signal("changeEditor", { editor: this }), v) && !v.destroyed && v.bgTokenizer.scheduleStart();
}, u.prototype.getSession = function() {
return this.session;
}, u.prototype.setValue = function(v, $) {
return this.session.doc.setValue(v), $ ? $ == 1 ? this.navigateFileEnd() : $ == -1 && this.navigateFileStart() : this.selectAll(), v;
}, u.prototype.getValue = function() {
return this.session.getValue();
}, u.prototype.getSelection = function() {
return this.selection;
}, u.prototype.resize = function(v) {
this.renderer.onResize(v);
}, u.prototype.setTheme = function(v, $) {
this.renderer.setTheme(v, $);
}, u.prototype.getTheme = function() {
return this.renderer.getTheme();
}, u.prototype.setStyle = function(v) {
this.renderer.setStyle(v);
}, u.prototype.unsetStyle = function(v) {
this.renderer.unsetStyle(v);
}, u.prototype.getFontSize = function() {
return this.getOption("fontSize") || d.computedStyle(this.container).fontSize;
}, u.prototype.setFontSize = function(v) {
this.setOption("fontSize", v);
}, u.prototype.$highlightBrackets = function() {
var v;
this.$highlightPending || ((v = this).$highlightPending = true, setTimeout(function() {
v.$highlightPending = false;
var $, G, W, X, Q = v.session;
Q && !Q.destroyed && (Q.$bracketHighlight && (Q.$bracketHighlight.markerIds.forEach(function(K) {
Q.removeMarker(K);
}), Q.$bracketHighlight = null), $ = v.getCursorPosition(), G = (G = v.getKeyboardHandler()) && G.$getDirectionForHighlight && G.$getDirectionForHighlight(v), (G = Q.getMatchingBracketRanges($, G)) || (W = new b(Q, $.row, $.column).getCurrentToken()) && /\b(?:tag-open|tag-name)/.test(W.type) && (W = Q.getMatchingTags($)) && (G = [W.openTagName, W.closeTagName]), (G = !G && Q.$mode.getMatching ? Q.$mode.getMatching(v.session) : G) && (X = "ace_bracket", Array.isArray(G) ? G.length == 1 && (X = "ace_error_bracket") : G = [G], G.length == 2 && (t.comparePoints(G[0].end, G[1].start) == 0 ? G = [t.fromPoints(G[0].start, G[1].end)] : t.comparePoints(G[0].start, G[1].end) == 0 && (G = [t.fromPoints(G[1].start, G[0].end)])), Q.$bracketHighlight = { ranges: G, markerIds: G.map(function(K) {
return Q.addMarker(K, X, "text");
}) }), v.getHighlightIndentGuides()) && v.renderer.$textLayer.$highlightIndentGuide();
}, 50));
}, u.prototype.focus = function() {
this.textInput.focus();
}, u.prototype.isFocused = function() {
return this.textInput.isFocused();
}, u.prototype.blur = function() {
this.textInput.blur();
}, u.prototype.onFocus = function(v) {
this.$isFocused || (this.$isFocused = true, this.renderer.showCursor(), this.renderer.visualizeFocus(), this._emit("focus", v));
}, u.prototype.onBlur = function(v) {
this.$isFocused && (this.$isFocused = false, this.renderer.hideCursor(), this.renderer.visualizeBlur(), this._emit("blur", v));
}, u.prototype.$cursorChange = function() {
this.renderer.updateCursor(), this.$highlightBrackets(), this.$updateHighlightActiveLine();
}, u.prototype.onDocumentChange = function(v) {
var $ = this.session.$useWrapMode, G = v.start.row == v.end.row ? v.end.row : 1 / 0;
this.renderer.updateLines(v.start.row, G, $), this._signal("change", v), this.$cursorChange();
}, u.prototype.onTokenizerUpdate = function(v) {
v = v.data, this.renderer.updateLines(v.first, v.last);
}, u.prototype.onScrollTopChange = function() {
this.renderer.scrollToY(this.session.getScrollTop());
}, u.prototype.onScrollLeftChange = function() {
this.renderer.scrollToX(this.session.getScrollLeft());
}, u.prototype.onCursorChange = function() {
this.$cursorChange(), this._signal("changeSelection");
}, u.prototype.$updateHighlightActiveLine = function() {
var v, $, G = this.getSession();
this.$highlightActiveLine && (this.$selectionStyle == "line" && this.selection.isMultiLine() || (v = this.getCursorPosition()), this.renderer.theme && this.renderer.theme.$selectionColorConflict && !this.selection.isEmpty() && (v = false), !this.renderer.$maxLines || this.session.getLength() !== 1 || 1 < this.renderer.$minLines || (v = false)), G.$highlightLineMarker && !v ? (G.removeMarker(G.$highlightLineMarker.id), G.$highlightLineMarker = null) : !G.$highlightLineMarker && v ? (($ = new t(v.row, v.column, v.row, 1 / 0)).id = G.addMarker($, "ace_active-line", "screenLine"), G.$highlightLineMarker = $) : v && (G.$highlightLineMarker.start.row = v.row, G.$highlightLineMarker.end.row = v.row, G.$highlightLineMarker.start.column = v.column, G._signal("changeBackMarker"));
}, u.prototype.onSelectionChange = function(v) {
var $, G, W = this.session, W = (W.$selectionMarker && W.removeMarker(W.$selectionMarker), W.$selectionMarker = null, this.selection.isEmpty() ? this.$updateHighlightActiveLine() : ($ = this.selection.getRange(), G = this.getSelectionStyle(), W.$selectionMarker = W.addMarker($, "ace_selection", G)), this.$highlightSelectedWord && this.$getSelectionHighLightRegexp());
this.session.highlight(W), this._signal("changeSelection");
}, u.prototype.$getSelectionHighLightRegexp = function() {
var v = this.session, $ = this.getSelectionRange();
if (!$.isEmpty() && !$.isMultiLine()) {
var G = $.start.column, W = $.end.column, v = v.getLine($.start.row), $ = v.substring(G, W);
if (!(5e3 < $.length) && /[\w\d]/.test($) && ($ = this.$search.$assembleRegExp({ wholeWord: true, caseSensitive: true, needle: $ }), v = v.substring(G - 1, W + 1), $.test(v)))
return $;
}
}, u.prototype.onChangeFrontMarker = function() {
this.renderer.updateFrontMarkers();
}, u.prototype.onChangeBackMarker = function() {
this.renderer.updateBackMarkers();
}, u.prototype.onChangeBreakpoint = function() {
this.renderer.updateBreakpoints();
}, u.prototype.onChangeAnnotation = function() {
this.renderer.setAnnotations(this.session.getAnnotations());
}, u.prototype.onChangeMode = function(v) {
this.renderer.updateText(), this._emit("changeMode", v);
}, u.prototype.onChangeWrapLimit = function() {
this.renderer.updateFull();
}, u.prototype.onChangeWrapMode = function() {
this.renderer.onResize(true);
}, u.prototype.onChangeFold = function() {
this.$updateHighlightActiveLine(), this.renderer.updateFull();
}, u.prototype.getSelectedText = function() {
return this.session.getTextRange(this.getSelectionRange());
}, u.prototype.getCopyText = function() {
var v = this.getSelectedText(), $ = this.session.doc.getNewLineCharacter(), G = false;
if (!v && this.$copyWithEmptySelection)
for (var G = true, W = this.selection.getAllRanges(), X = 0; X < W.length; X++) {
var Q = W[X];
X && W[X - 1].start.row == Q.start.row || (v += this.session.getLine(Q.start.row) + $);
}
var K = { text: v };
return this._signal("copy", K), B2.lineMode = !!G && K.text, K.text;
}, u.prototype.onCopy = function() {
this.commands.exec("copy", this);
}, u.prototype.onCut = function() {
this.commands.exec("cut", this);
}, u.prototype.onPaste = function(v, $) {
this.commands.exec("paste", this, { text: v, event: $ });
}, u.prototype.$handlePaste = function(G) {
this._signal("paste", G = typeof G == "string" ? { text: G } : G);
var $ = G.text, G = $ === B2.lineMode, W = this.session;
if (!this.inMultiSelectMode || this.inVirtualSelectionMode)
G ? W.insert({ row: this.selection.lead.row, column: 0 }, $) : this.insert($);
else if (G)
this.selection.rangeList.ranges.forEach(function(T) {
W.insert({ row: T.start.row, column: 0 }, $);
});
else {
var X = $.split(/\r\n|\r|\n/), Q = this.selection.rangeList.ranges, G = !(X.length != 2 || X[0] && X[1]);
if (X.length != Q.length || G)
return this.commands.exec("insertstring", this, $);
for (var K = Q.length; K--; ) {
var ne = Q[K];
ne.isEmpty() || W.remove(ne), W.insert(ne.start, X[K]);
}
}
}, u.prototype.execCommand = function(v, $) {
return this.commands.exec(v, this, $);
}, u.prototype.insert = function(v, ne) {
var G, W = this.session, X = W.getMode(), Q = this.getCursorPosition(), K = (this.getBehavioursEnabled() && !ne && (G = X.transformAction(W.getState(Q.row), "insertion", this, W, v)) && (v === G.text || this.inVirtualSelectionMode || (this.session.mergeUndoDeltas = false, this.mergeNextCommand = false), v = G.text), v == " " && (v = this.session.getTabString()), this.selection.isEmpty() ? this.session.getOverwrite() && v.indexOf(`
`) == -1 && ((K = new t.fromPoints(Q, Q)).end.column += v.length, this.session.remove(K)) : (K = this.getSelectionRange(), Q = this.session.remove(K), this.clearSelection()), v != `
` && v != `\r
` || (T = W.getLine(Q.row), Q.column > T.search(/\S|$/) && (ne = T.substr(Q.column).search(/\S|$/), W.doc.removeInLine(Q.row, Q.column, Q.column + ne))), this.clearSelection(), Q.column), ne = W.getState(Q.row), T = W.getLine(Q.row), V = X.checkOutdent(ne, T, v);
W.insert(Q, v), G && G.selection && (G.selection.length == 2 ? this.selection.setSelectionRange(new t(Q.row, K + G.selection[0], Q.row, K + G.selection[1])) : this.selection.setSelectionRange(new t(Q.row + G.selection[0], G.selection[1], Q.row + G.selection[2], G.selection[3]))), this.$enableAutoIndent && (W.getDocument().isNewLine(v) && (K = X.getNextLineIndent(ne, T.slice(0, Q.column), W.getTabString()), W.insert({ row: Q.row + 1, column: 0 }, K)), V) && X.autoOutdent(ne, W, Q.row);
}, u.prototype.autoIndent = function() {
for (var v, $, G, W, X, Q = this.session, K = Q.getMode(), ne = (G = this.selection.isEmpty() ? ($ = 0, Q.doc.getLength() - 1) : ($ = (v = this.getSelectionRange()).start.row, v.end.row), ""), T = "", V = Q.getTabString(), F = $; F <= G; F++)
0 < F && (ne = Q.getState(F - 1), W = Q.getLine(F - 1), T = K.getNextLineIndent(ne, W, V)), W = Q.getLine(F), T !== (X = K.$getIndent(W)) && (0 < X.length && (X = new t(F, 0, F, X.length), Q.remove(X)), 0 < T.length) && Q.insert({ row: F, column: 0 }, T), K.autoOutdent(ne, Q, F);
}, u.prototype.onTextInput = function(v, $) {
if (!$)
return this.keyBinding.onTextInput(v);
this.startOperation({ command: { name: "insertstring" } }), v = this.applyComposition.bind(this, v, $), this.selection.rangeCount ? this.forEachSelection(v) : v(), this.endOperation();
}, u.prototype.applyComposition = function(v, $) {
var G;
($.extendLeft || $.extendRight) && ((G = this.selection.getRange()).start.column -= $.extendLeft, G.end.column += $.extendRight, G.start.column < 0 && (G.start.row--, G.start.column += this.session.getLine(G.start.row).length + 1), this.selection.setRange(G), v || G.isEmpty() || this.remove()), !v && this.selection.isEmpty() || this.insert(v, true), ($.restoreStart || $.restoreEnd) && ((G = this.selection.getRange()).start.column -= $.restoreStart, G.end.column -= $.restoreEnd, this.selection.setRange(G));
}, u.prototype.onCommandKey = function(v, $, G) {
return this.keyBinding.onCommandKey(v, $, G);
}, u.prototype.setOverwrite = function(v) {
this.session.setOverwrite(v);
}, u.prototype.getOverwrite = function() {
return this.session.getOverwrite();
}, u.prototype.toggleOverwrite = function() {
this.session.toggleOverwrite();
}, u.prototype.setScrollSpeed = function(v) {
this.setOption("scrollSpeed", v);
}, u.prototype.getScrollSpeed = function() {
return this.getOption("scrollSpeed");
}, u.prototype.setDragDelay = function(v) {
this.setOption("dragDelay", v);
}, u.prototype.getDragDelay = function() {
return this.getOption("dragDelay");
}, u.prototype.setSelectionStyle = function(v) {
this.setOption("selectionStyle", v);
}, u.prototype.getSelectionStyle = function() {
return this.getOption("selectionStyle");
}, u.prototype.setHighlightActiveLine = function(v) {
this.setOption("highlightActiveLine", v);
}, u.prototype.getHighlightActiveLine = function() {
return this.getOption("highlightActiveLine");
}, u.prototype.setHighlightGutterLine = function(v) {
this.setOption("highlightGutterLine", v);
}, u.prototype.getHighlightGutterLine = function() {
return this.getOption("highlightGutterLine");
}, u.prototype.setHighlightSelectedWord = function(v) {
this.setOption("highlightSelectedWord", v);
}, u.prototype.getHighlightSelectedWord = function() {
return this.$highlightSelectedWord;
}, u.prototype.setAnimatedScroll = function(v) {
this.renderer.setAnimatedScroll(v);
}, u.prototype.getAnimatedScroll = function() {
return this.renderer.getAnimatedScroll();
}, u.prototype.setShowInvisibles = function(v) {
this.renderer.setShowInvisibles(v);
}, u.prototype.getShowInvisibles = function() {
return this.renderer.getShowInvisibles();
}, u.prototype.setDisplayIndentGuides = function(v) {
this.renderer.setDisplayIndentGuides(v);
}, u.prototype.getDisplayIndentGuides = function() {
return this.renderer.getDisplayIndentGuides();
}, u.prototype.setHighlightIndentGuides = function(v) {
this.renderer.setHighlightIndentGuides(v);
}, u.prototype.getHighlightIndentGuides = function() {
return this.renderer.getHighlightIndentGuides();
}, u.prototype.setShowPrintMargin = function(v) {
this.renderer.setShowPrintMargin(v);
}, u.prototype.getShowPrintMargin = function() {
return this.renderer.getShowPrintMargin();
}, u.prototype.setPrintMarginColumn = function(v) {
this.renderer.setPrintMarginColumn(v);
}, u.prototype.getPrintMarginColumn = function() {
return this.renderer.getPrintMarginColumn();
}, u.prototype.setReadOnly = function(v) {
this.setOption("readOnly", v);
}, u.prototype.getReadOnly = function() {
return this.getOption("readOnly");
}, u.prototype.setBehavioursEnabled = function(v) {
this.setOption("behavioursEnabled", v);
}, u.prototype.getBehavioursEnabled = function() {
return this.getOption("behavioursEnabled");
}, u.prototype.setWrapBehavioursEnabled = function(v) {
this.setOption("wrapBehavioursEnabled", v);
}, u.prototype.getWrapBehavioursEnabled = function() {
return this.getOption("wrapBehavioursEnabled");
}, u.prototype.setShowFoldWidgets = function(v) {
this.setOption("showFoldWidgets", v);
}, u.prototype.getShowFoldWidgets = function() {
return this.getOption("showFoldWidgets");
}, u.prototype.setFadeFoldWidgets = function(v) {
this.setOption("fadeFoldWidgets", v);
}, u.prototype.getFadeFoldWidgets = function() {
return this.getOption("fadeFoldWidgets");
}, u.prototype.remove = function(X) {
this.selection.isEmpty() && (X == "left" ? this.selection.selectLeft() : this.selection.selectRight());
var $, G, W, X = this.getSelectionRange();
this.getBehavioursEnabled() && (G = ($ = this.session).getState(X.start.row), G = $.getMode().transformAction(G, "deletion", this, $, X), X.end.column === 0 && (W = $.getTextRange(X))[W.length - 1] == `
` && (W = $.getLine(X.end.row), /^\s+$/.test(W)) && (X.end.column = W.length), G) && (X = G), this.session.remove(X), this.clearSelection();
}, u.prototype.removeWordRight = function() {
this.selection.isEmpty() && this.selection.selectWordRight(), this.session.remove(this.getSelectionRange()), this.clearSelection();
}, u.prototype.removeWordLeft = function() {
this.selection.isEmpty() && this.selection.selectWordLeft(), this.session.remove(this.getSelectionRange()), this.clearSelection();
}, u.prototype.removeToLineStart = function() {
this.selection.isEmpty() && this.selection.selectLineStart(), this.selection.isEmpty() && this.selection.selectLeft(), this.session.remove(this.getSelectionRange()), this.clearSelection();
}, u.prototype.removeToLineEnd = function() {
this.selection.isEmpty() && this.selection.selectLineEnd();
var v = this.getSelectionRange();
v.start.column == v.end.column && v.start.row == v.end.row && (v.end.column = 0, v.end.row++), this.session.remove(v), this.clearSelection();
}, u.prototype.splitLine = function() {
this.selection.isEmpty() || (this.session.remove(this.getSelectionRange()), this.clearSelection());
var v = this.getCursorPosition();
this.insert(`
`), this.moveCursorToPosition(v);
}, u.prototype.setGhostText = function(v, $) {
this.session.widgetManager || (this.session.widgetManager = new w(this.session), this.session.widgetManager.attach(this)), this.renderer.setGhostText(v, $);
}, u.prototype.removeGhostText = function() {
this.session.widgetManager && this.renderer.removeGhostText();
}, u.prototype.transposeLetters = function() {
var v, $, G, W;
this.selection.isEmpty() && ($ = (v = this.getCursorPosition()).column) !== 0 && (W = $ < (W = this.session.getLine(v.row)).length ? (G = W.charAt($) + W.charAt($ - 1), new t(v.row, $ - 1, v.row, $ + 1)) : (G = W.charAt($ - 1) + W.charAt($ - 2), new t(v.row, $ - 2, v.row, $)), this.session.replace(W, G), this.session.selection.moveToPosition(W.end));
}, u.prototype.toLowerCase = function() {
var v = this.getSelectionRange(), $ = (this.selection.isEmpty() && this.selection.selectWord(), this.getSelectionRange()), G = this.session.getTextRange($);
this.session.replace($, G.toLowerCase()), this.selection.setSelectionRange(v);
}, u.prototype.toUpperCase = function() {
var v = this.getSelectionRange(), $ = (this.selection.isEmpty() && this.selection.selectWord(), this.getSelectionRange()), G = this.session.getTextRange($);
this.session.replace($, G.toUpperCase()), this.selection.setSelectionRange(v);
}, u.prototype.indent = function() {
var v = this.session, $ = this.getSelectionRange();
if (!($.start.row < $.end.row)) {
if ($.start.column < $.end.column) {
var G, Q = v.getTextRange($);
if (!/^\s+$/.test(Q))
return G = this.$getSelectedRows(), void v.indentRows(G.first, G.last, " ");
}
var W = v.getLine($.start.row), Q = $.start, X = v.getTabSize(), Q = v.documentToScreenColumn(Q.row, Q.column);
if (this.session.getUseSoftTabs())
var K = X - Q % X, ne = h.stringRepeat(" ", K);
else {
for (K = Q % X; W[$.start.column - 1] == " " && K; )
$.start.column--, K--;
this.selection.setSelectionRange($), ne = " ";
}
return this.insert(ne);
}
G = this.$getSelectedRows(), v.indentRows(G.first, G.last, " ");
}, u.prototype.blockIndent = function() {
var v = this.$getSelectedRows();
this.session.indentRows(v.first, v.last, " ");
}, u.prototype.blockOutdent = function() {
var v = this.session.getSelection();
this.session.outdentRows(v.getRange());
}, u.prototype.sortLines = function() {
for (var v = this.$getSelectedRows(), $ = this.session, G = [], W = v.first; W <= v.last; W++)
G.push($.getLine(W));
G.sort(function(K, ne) {
return K.toLowerCase() < ne.toLowerCase() ? -1 : K.toLowerCase() > ne.toLowerCase() ? 1 : 0;
});
for (var X = new t(0, 0, 0, 0), W = v.first; W <= v.last; W++) {
var Q = $.getLine(W);
X.start.row = W, X.end.row = W, X.end.column = Q.length, $.replace(X, G[W - v.first]);
}
}, u.prototype.toggleCommentLines = function() {
var v = this.session.getState(this.getCursorPosition().row), $ = this.$getSelectedRows();
this.session.getMode().toggleCommentLines(v, this.session, $.first, $.last);
}, u.prototype.toggleBlockComment = function() {
var v = this.getCursorPosition(), $ = this.session.getState(v.row), G = this.getSelectionRange();
this.session.getMode().toggleBlockComment($, this.session, G, v);
}, u.prototype.getNumberAt = function(v, $) {
for (var G = /[\-]?[0-9]+(?:\.[0-9]+)?/g, W = (G.lastIndex = 0, this.session.getLine(v)); G.lastIndex < $; ) {
var X = G.exec(W);
if (X.index <= $ && X.index + X[0].length >= $)
return { value: X[0], start: X.index, end: X.index + X[0].length };
}
return null;
}, u.prototype.modifyNumber = function(v) {
var $, G, W, X = this.selection.getCursor().row, Q = this.selection.getCursor().column, K = new t(X, Q - 1, X, Q), K = this.session.getTextRange(K);
!isNaN(parseFloat(K)) && isFinite(K) ? (K = this.getNumberAt(X, Q)) && (W = 0 <= K.value.indexOf(".") ? K.start + K.value.indexOf(".") + 1 : K.end, $ = K.start + K.value.length - W, G = parseFloat(K.value), G *= Math.pow(10, $), W !== K.end && Q < W ? v *= Math.pow(10, K.end - Q - 1) : v *= Math.pow(10, K.end - Q), W = (G = (G += v) / Math.pow(10, $)).toFixed($), v = new t(X, K.start, X, K.end), this.session.replace(v, W), this.moveCursorTo(X, Math.max(K.start + 1, Q + W.length - K.value.length))) : this.toggleWord();
}, u.prototype.toggleWord = function() {
for (var v, $ = this.selection.getCursor().row, G = this.selection.getCursor().column, W = (this.selection.selectWord(), this.getSelectedText()), X = this.selection.getWordRange().start.column, Q = W.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g, "$1 ").split(/\s/), K = G - X - 1, ne = (K < 0 && (K = 0), 0), T = this, V = (W.match(/[A-Za-z0-9_]+/) && Q.forEach(function(J, re) {
v = ne + J.length, ne <= K && K <= v && (W = J, T.selection.clearSelection(), T.moveCursorTo($, ne + X), T.selection.selectTo($, v + X)), ne = v;
}), this.$toggleWordPairs), F = 0; F < V.length; F++)
for (var I = V[F], S = 0; S <= 1; S++) {
var L = +!S, O = W.match(new RegExp("^\\s?_?(" + h.escapeRegExp(I[S]) + ")\\s?$", "i"));
O && W.match(new RegExp("([_]|^|\\s)(" + h.escapeRegExp(O[1]) + ")($|\\s)", "g")) && (O = W.replace(new RegExp(h.escapeRegExp(I[S]), "i"), function(J) {
var re = I[L];
return J.toUpperCase() == J ? re = re.toUpperCase() : J.charAt(0).toUpperCase() == J.charAt(0) && (re = re.substr(0, 0) + I[L].charAt(0).toUpperCase() + re.substr(1)), re;
}), this.insert(O));
}
}, u.prototype.findLinkAt = function(Q, $) {
var G, W, X, Q = this.session.getLine(Q).split(/((?:https?|ftp):\/\/[\S]+)/), K = $, ne = (K < 0 && (K = 0), 0);
try {
for (var T = y(Q), V = T.next(); !V.done; V = T.next()) {
var F = V.value, I = ne + F.length;
if (ne <= K && K <= I && F.match(/((?:https?|ftp):\/\/[\S]+)/)) {
X = F.replace(/[\s:.,'";}\]]+$/, "");
break;
}
ne = I;
}
} catch (S) {
G = { error: S };
} finally {
try {
V && !V.done && (W = T.return) && W.call(T);
} finally {
if (G)
throw G.error;
}
}
return X;
}, u.prototype.openLink = function() {
var v = this.selection.getCursor(), v = this.findLinkAt(v.row, v.column);
return v && window.open(v, "_blank"), v != null;
}, u.prototype.removeLines = function() {
var v = this.$getSelectedRows();
this.session.removeFullLines(v.first, v.last), this.clearSelection();
}, u.prototype.duplicateSelection = function() {
var v, $ = this.selection, G = this.session, W = $.getRange(), X = $.isBackwards();
W.isEmpty() ? (v = W.start.row, G.duplicateLines(v, v)) : (v = X ? W.start : W.end, G = G.insert(v, G.getTextRange(W), false), W.start = v, W.end = G, $.setSelectionRange(W, X));
}, u.prototype.moveLinesDown = function() {
this.$moveLines(1, false);
}, u.prototype.moveLinesUp = function() {
this.$moveLines(-1, false);
}, u.prototype.moveText = function(v, $, G) {
return this.session.moveText(v, $, G);
}, u.prototype.copyLinesUp = function() {
this.$moveLines(-1, true);
}, u.prototype.copyLinesDown = function() {
this.$moveLines(1, true);
}, u.prototype.$moveLines = function(v, $) {
var G = this.selection;
if (!G.inMultiSelectMode || this.inVirtualSelectionMode) {
var W = G.toOrientedRange(), X = this.$getSelectedRows(W), Q = this.session.$moveLines(X.first, X.last, $ ? 0 : v);
W.moveBy(Q = $ && v == -1 ? 0 : Q, 0), G.fromOrientedRange(W);
} else {
for (var K = G.rangeList.ranges, ne = (G.rangeList.detach(this.session), this.inVirtualSelectionMode = true, 0), T = 0, V = K.length, F = 0; F < V; F++) {
for (var I = F, S = (K[F].moveBy(ne, 0), (X = this.$getSelectedRows(K[F])).first), L = X.last; ++F < V; ) {
T && K[F].moveBy(T, 0);
var O = this.$getSelectedRows(K[F]);
if ($ && O.first != L || !$ && O.first > L + 1)
break;
L = O.last;
}
for (F--, ne = this.session.$moveLines(S, L, $ ? 0 : v), $ && v == -1 && (I = F + 1); I <= F; )
K[I].moveBy(ne, 0), I++;
T += ne = $ ? ne : 0;
}
G.fromOrientedRange(G.ranges[0]), G.rangeList.attach(this.session), this.inVirtualSelectionMode = false;
}
}, u.prototype.$getSelectedRows = function(v) {
return v = (v || this.getSelectionRange()).collapseRows(), { first: this.session.getRowFoldStart(v.start.row), last: this.session.getRowFoldEnd(v.end.row) };
}, u.prototype.onCompositionStart = function(v) {
this.renderer.showComposition(v);
}, u.prototype.onCompositionUpdate = function(v) {
this.renderer.setCompositionText(v);
}, u.prototype.onCompositionEnd = function() {
this.renderer.hideComposition();
}, u.prototype.getFirstVisibleRow = function() {
return this.renderer.getFirstVisibleRow();
}, u.prototype.getLastVisibleRow = function() {
return this.renderer.getLastVisibleRow();
}, u.prototype.isRowVisible = function(v) {
return v >= this.getFirstVisibleRow() && v <= this.getLastVisibleRow();
}, u.prototype.isRowFullyVisible = function(v) {
return v >= this.renderer.getFirstFullyVisibleRow() && v <= this.renderer.getLastFullyVisibleRow();
}, u.prototype.$getVisibleRowCount = function() {
return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;
}, u.prototype.$moveByPage = function(Q, $) {
var G = this.renderer, W = this.renderer.layerConfig, X = Q * Math.floor(W.height / W.lineHeight), Q = ($ === true ? this.selection.$moveSelection(function() {
this.moveCursorBy(X, 0);
}) : $ === false && (this.selection.moveCursorBy(X, 0), this.selection.clearSelection()), G.scrollTop);
G.scrollBy(0, X * W.lineHeight), $ != null && G.scrollCursorIntoView(null, 0.5), G.animateScrolling(Q);
}, u.prototype.selectPageDown = function() {
this.$moveByPage(1, true);
}, u.prototype.selectPageUp = function() {
this.$moveByPage(-1, true);
}, u.prototype.gotoPageDown = function() {
this.$moveByPage(1, false);
}, u.prototype.gotoPageUp = function() {
this.$moveByPage(-1, false);
}, u.prototype.scrollPageDown = function() {
this.$moveByPage(1);
}, u.prototype.scrollPageUp = function() {
this.$moveByPage(-1);
}, u.prototype.scrollToRow = function(v) {
this.renderer.scrollToRow(v);
}, u.prototype.scrollToLine = function(v, $, G, W) {
this.renderer.scrollToLine(v, $, G, W);
}, u.prototype.centerSelection = function() {
var v = this.getSelectionRange(), v = { row: Math.floor(v.start.row + (v.end.row - v.start.row) / 2), column: Math.floor(v.start.column + (v.end.column - v.start.column) / 2) };
this.renderer.alignCursor(v, 0.5);
}, u.prototype.getCursorPosition = function() {
return this.selection.getCursor();
}, u.prototype.getCursorPositionScreen = function() {
return this.session.documentToScreenPosition(this.getCursorPosition());
}, u.prototype.getSelectionRange = function() {
return this.selection.getRange();
}, u.prototype.selectAll = function() {
this.selection.selectAll();
}, u.prototype.clearSelection = function() {
this.selection.clearSelection();
}, u.prototype.moveCursorTo = function(v, $) {
this.selection.moveCursorTo(v, $);
}, u.prototype.moveCursorToPosition = function(v) {
this.selection.moveCursorToPosition(v);
}, u.prototype.jumpToMatching = function(v, $) {
var G = this.getCursorPosition(), W = new b(this.session, G.row, G.column), X = W.getCurrentToken(), Q = 0, K = (X = X && X.type.indexOf("tag-name") !== -1 ? W.stepBackward() : X) || W.stepForward();
if (K) {
var ne, T, V = false, F = {}, I = G.column - K.start, S = { ")": "(", "(": "(", "]": "[", "[": "[", "{": "{", "}": "{" };
do
if (K.value.match(/[{}()\[\]]/g)) {
for (; I < K.value.length && !V; I++)
if (S[K.value[I]])
switch (T = S[K.value[I]] + "." + K.type.replace("rparen", "lparen"), isNaN(F[T]) && (F[T] = 0), K.value[I]) {
case "(":
case "[":
case "{":
F[T]++;
break;
case ")":
case "]":
case "}":
F[T]--, F[T] === -1 && (ne = "bracket", V = true);
}
} else
K.type.indexOf("tag-name") !== -1 && (isNaN(F[K.value]) && (F[K.value] = 0), X.value === "<" && 1 < Q ? F[K.value]++ : X.value === "" && F[K.value]--, F[K.value] === -1) && (ne = "tag", V = true);
while (V || (X = K, Q++, K = W.stepForward(), I = 0), K && !V);
if (ne) {
if (ne === "bracket")
!(O = this.session.getBracketRange(G)) && (J = (O = new t(W.getCurrentTokenRow(), W.getCurrentTokenColumn() + I - 1, W.getCurrentTokenRow(), W.getCurrentTokenColumn() + I - 1)).start, $ || J.row === G.row && Math.abs(J.column - G.column) < 2) && (O = this.session.getBracketRange(J));
else if (ne === "tag") {
if (!K || K.type.indexOf("tag-name") === -1)
return;
var L, O, J = (J = (O = new t(W.getCurrentTokenRow(), W.getCurrentTokenColumn() - 2, W.getCurrentTokenRow(), W.getCurrentTokenColumn() - 2)).compare(G.row, G.column) === 0 && (L = this.session.getMatchingTags(G)) ? L.openTag.contains(G.row, G.column) ? (O = L.closeTag).start : (O = L.openTag, L.closeTag.start.row === G.row && L.closeTag.start.column === G.column ? O.end : O.start) : J) || O.start;
}
(J = O && O.cursor || J) && (v ? O && $ ? this.selection.setRange(O) : O && O.isEqual(this.getSelectionRange()) ? this.clearSelection() : this.selection.selectTo(J.row, J.column) : this.selection.moveTo(J.row, J.column));
}
}
}, u.prototype.gotoLine = function(v, $, G) {
this.selection.clearSelection(), this.session.unfold({ row: v - 1, column: $ || 0 }), this.exitMultiSelectMode && this.exitMultiSelectMode(), this.moveCursorTo(v - 1, $ || 0), this.isRowFullyVisible(v - 1) || this.scrollToLine(v - 1, true, G);
}, u.prototype.navigateTo = function(v, $) {
this.selection.moveTo(v, $);
}, u.prototype.navigateUp = function(v) {
var $;
if (this.selection.isMultiLine() && !this.selection.isBackwards())
return $ = this.selection.anchor.getPosition(), this.moveCursorToPosition($);
this.selection.clearSelection(), this.selection.moveCursorBy(-v || -1, 0);
}, u.prototype.navigateDown = function(v) {
var $;
if (this.selection.isMultiLine() && this.selection.isBackwards())
return $ = this.selection.anchor.getPosition(), this.moveCursorToPosition($);
this.selection.clearSelection(), this.selection.moveCursorBy(v || 1, 0);
}, u.prototype.navigateLeft = function(v) {
if (this.selection.isEmpty())
for (v = v || 1; v--; )
this.selection.moveCursorLeft();
else {
var $ = this.getSelectionRange().start;
this.moveCursorToPosition($);
}
this.clearSelection();
}, u.prototype.navigateRight = function(v) {
if (this.selection.isEmpty())
for (v = v || 1; v--; )
this.selection.moveCursorRight();
else {
var $ = this.getSelectionRange().end;
this.moveCursorToPosition($);
}
this.clearSelection();
}, u.prototype.navigateLineStart = function() {
this.selection.moveCursorLineStart(), this.clearSelection();
}, u.prototype.navigateLineEnd = function() {
this.selection.moveCursorLineEnd(), this.clearSelection();
}, u.prototype.navigateFileEnd = function() {
this.selection.moveCursorFileEnd(), this.clearSelection();
}, u.prototype.navigateFileStart = function() {
this.selection.moveCursorFileStart(), this.clearSelection();
}, u.prototype.navigateWordRight = function() {
this.selection.moveCursorWordRight(), this.clearSelection();
}, u.prototype.navigateWordLeft = function() {
this.selection.moveCursorWordLeft(), this.clearSelection();
}, u.prototype.replace = function(v, G) {
G && this.$search.set(G);
var G = this.$search.find(this.session), W = 0;
return G && (this.$tryReplace(G, v) && (W = 1), this.selection.setSelectionRange(G), this.renderer.scrollSelectionIntoView(G.start, G.end)), W;
}, u.prototype.replaceAll = function(v, $) {
$ && this.$search.set($);
var G = this.$search.findAll(this.session), W = 0;
if (G.length) {
$ = this.getSelectionRange(), this.selection.moveTo(0, 0);
for (var X = G.length - 1; 0 <= X; --X)
this.$tryReplace(G[X], v) && W++;
this.selection.setSelectionRange($);
}
return W;
}, u.prototype.$tryReplace = function(v, $) {
var G = this.session.getTextRange(v);
return ($ = this.$search.replace(G, $)) !== null ? (v.end = this.session.replace(v, $), v) : null;
}, u.prototype.getLastSearchOptions = function() {
return this.$search.getOptions();
}, u.prototype.find = function(X, $, G) {
$ = $ || {}, typeof X == "string" || X instanceof RegExp ? $.needle = X : typeof X == "object" && C.mixin($, X);
var W = this.selection.getRange(), X = ($.needle == null && ((X = this.session.getTextRange(W) || this.$search.$options.needle) || (W = this.session.getWordRange(W.start.row, W.start.column), X = this.session.getTextRange(W)), this.$search.set({ needle: X })), this.$search.set($), $.start || this.$search.set({ start: W }), this.$search.find(this.session));
return $.preventScroll ? X : X ? (this.revealRange(X, G), X) : ($.backwards ? W.start = W.end : W.end = W.start, void this.selection.setRange(W));
}, u.prototype.findNext = function(v, $) {
this.find({ skipCurrent: true, backwards: false }, v, $);
}, u.prototype.findPrevious = function(v, $) {
this.find(v, { skipCurrent: true, backwards: true }, $);
}, u.prototype.revealRange = function(v, $) {
this.session.unfold(v), this.selection.setSelectionRange(v);
var G = this.renderer.scrollTop;
this.renderer.scrollSelectionIntoView(v.start, v.end, 0.5), $ !== false && this.renderer.animateScrolling(G);
}, u.prototype.undo = function() {
this.session.getUndoManager().undo(this.session), this.renderer.scrollCursorIntoView(null, 0.5);
}, u.prototype.redo = function() {
this.session.getUndoManager().redo(this.session), this.renderer.scrollCursorIntoView(null, 0.5);
}, u.prototype.destroy = function() {
this.$toDestroy && (this.$toDestroy.forEach(function(v) {
v.destroy();
}), this.$toDestroy = null), this.$mouseHandler && this.$mouseHandler.destroy(), this.renderer.destroy(), this._signal("destroy", this), this.session && this.session.destroy(), this._$emitInputEvent && this._$emitInputEvent.cancel(), this.removeAllListeners();
}, u.prototype.setAutoScrollEditorIntoView = function(v) {
var $, G, W, X, Q, K, ne;
v && (W = false, (G = this).$scrollAnchor || (this.$scrollAnchor = document.createElement("div")), (X = this.$scrollAnchor).style.cssText = "position:absolute", this.container.insertBefore(X, this.container.firstChild), Q = this.on("changeSelection", function() {
W = true;
}), K = this.renderer.on("beforeRender", function() {
W && ($ = G.renderer.container.getBoundingClientRect());
}), ne = this.renderer.on("afterRender", function() {
var T, V, F;
W && $ && (G.isFocused() || G.searchBox && G.searchBox.isFocused()) && (T = (V = G.renderer).$cursorLayer.$pixelPos, V = V.layerConfig, F = T.top - V.offset, (W = 0 <= T.top && F + $.top < 0 || !(T.top < V.height && T.top + $.top + V.lineHeight > window.innerHeight) && null) != null && (X.style.top = F + "px", X.style.left = T.left + "px", X.style.height = V.lineHeight + "px", X.scrollIntoView(W)), W = $ = null);
}), this.setAutoScrollEditorIntoView = function(T) {
T || (delete this.setAutoScrollEditorIntoView, this.off("changeSelection", Q), this.renderer.off("afterRender", ne), this.renderer.off("beforeRender", K));
});
}, u.prototype.$resetCursorStyle = function() {
var v = this.$cursorStyle || "ace", $ = this.renderer.$cursorLayer;
$ && ($.setSmoothBlinking(/smooth/.test(v)), $.isBlinking = !this.$readOnly && v != "wide", d.setCssClass($.element, "ace_slim-cursors", /slim/.test(v)));
}, u.prototype.prompt = function(v, $, G) {
var W = this;
g.loadModule("ace/ext/prompt", function(X) {
X.prompt(W, v, $, G);
});
}, u);
function u(v, $, G) {
this.$toDestroy = [];
var W = v.getContainerElement();
this.container = W, this.renderer = v, this.id = "editor" + ++u.$uid, this.commands = new c(l.isMac ? "mac" : "win", p), typeof document == "object" && (this.textInput = new n(v.getTextAreaContainer(), this), this.renderer.textarea = this.textInput.getElement(), this.$mouseHandler = new o(this), new i(this)), this.keyBinding = new a(this), this.$search = new e2().set({ wrap: true }), this.$historyTracker = this.$historyTracker.bind(this), this.commands.on("exec", this.$historyTracker), this.$initOperationListeners(), this._$emitInputEvent = h.delayedCall((function() {
this._signal("input", {}), this.session && !this.session.destroyed && this.session.bgTokenizer.scheduleStart();
}).bind(this)), this.on("change", function(X, Q) {
Q._$emitInputEvent.schedule(31);
}), this.setSession($ || G && G.session || new r("")), g.resetOptions(this), G && this.setOptions(G), g._signal("editor", this);
}
k.$uid = 0, k.prototype.curOp = null, k.prototype.prevOp = {}, k.prototype.$mergeableCommands = ["backspace", "del", "insertstring"], k.prototype.$toggleWordPairs = [["first", "last"], ["true", "false"], ["yes", "no"], ["width", "height"], ["top", "bottom"], ["right", "left"], ["on", "off"], ["x", "y"], ["get", "set"], ["max", "min"], ["horizontal", "vertical"], ["show", "hide"], ["add", "remove"], ["up", "down"], ["before", "after"], ["even", "odd"], ["in", "out"], ["inside", "outside"], ["next", "previous"], ["increase", "decrease"], ["attach", "detach"], ["&&", "||"], ["==", "!="]], C.implement(k.prototype, s), g.defineOptions(k.prototype, "editor", { selectionStyle: { set: function(v) {
this.onSelectionChange(), this._signal("changeSelectionStyle", { data: v });
}, initialValue: "line" }, highlightActiveLine: { set: function() {
this.$updateHighlightActiveLine();
}, initialValue: true }, highlightSelectedWord: { set: function(v) {
this.$onSelectionChange();
}, initialValue: true }, readOnly: { set: function(v) {
this.textInput.setReadOnly(v), this.$resetCursorStyle();
}, initialValue: false }, copyWithEmptySelection: { set: function(v) {
this.textInput.setCopyWithEmptySelection(v);
}, initialValue: false }, cursorStyle: { set: function(v) {
this.$resetCursorStyle();
}, values: ["ace", "slim", "smooth", "wide"], initialValue: "ace" }, mergeUndoDeltas: { values: [false, true, "always"], initialValue: true }, behavioursEnabled: { initialValue: true }, wrapBehavioursEnabled: { initialValue: true }, enableAutoIndent: { initialValue: true }, autoScrollEditorIntoView: { set: function(v) {
this.setAutoScrollEditorIntoView(v);
} }, keyboardHandler: { set: function(v) {
this.setKeyboardHandler(v);
}, get: function() {
return this.$keybindingId;
}, handlesSet: true }, value: { set: function(v) {
this.session.setValue(v);
}, get: function() {
return this.getValue();
}, handlesSet: true, hidden: true }, session: { set: function(v) {
this.setSession(v);
}, get: function() {
return this.session;
}, handlesSet: true, hidden: true }, showLineNumbers: { set: function(v) {
this.renderer.$gutterLayer.setShowLineNumbers(v), this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER), v && this.$relativeLineNumbers ? _.attach(this) : _.detach(this);
}, initialValue: true }, relativeLineNumbers: { set: function(v) {
this.$showLineNumbers && v ? _.attach(this) : _.detach(this);
} }, placeholder: { set: function(v) {
this.$updatePlaceholder || (this.$updatePlaceholder = (function() {
var $ = this.session && (this.renderer.$composition || 1 < this.session.getLength() || 0 < this.session.getLine(0).length);
$ && this.renderer.placeholderNode ? (this.renderer.off("afterRender", this.$updatePlaceholder), d.removeCssClass(this.container, "ace_hasPlaceholder"), this.renderer.placeholderNode.remove(), this.renderer.placeholderNode = null) : $ || this.renderer.placeholderNode ? !$ && this.renderer.placeholderNode && (this.renderer.placeholderNode.textContent = this.$placeholder || "") : (this.renderer.on("afterRender", this.$updatePlaceholder), d.addCssClass(this.container, "ace_hasPlaceholder"), ($ = d.createElement("div")).className = "ace_placeholder", $.textContent = this.$placeholder || "", this.renderer.placeholderNode = $, this.renderer.content.appendChild(this.renderer.placeholderNode));
}).bind(this), this.on("input", this.$updatePlaceholder)), this.$updatePlaceholder();
} }, enableKeyboardAccessibility: { set: function(v) {
function $(X) {
X.target == this.renderer.scroller && X.keyCode === Z.enter && (X.preventDefault(), X = this.getCursorPosition().row, this.isRowVisible(X) || this.scrollToLine(X, true, true), this.focus());
}
var G, W = { name: "blurTextInput", description: "Set focus to the editor content div to allow tabbing through the page", bindKey: "Esc", exec: function(X) {
X.blur(), X.renderer.scroller.focus();
}, readOnly: true };
v ? (this.renderer.enableKeyboardAccessibility = true, this.renderer.keyboardFocusClassName = "ace_keyboard-focus", this.textInput.getElement().setAttribute("tabindex", -1), this.textInput.setNumberOfExtraLines(l.isWin ? 3 : 0), this.renderer.scroller.setAttribute("tabindex", 0), this.renderer.scroller.setAttribute("role", "group"), this.renderer.scroller.setAttribute("aria-roledescription", M("editor")), this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName), this.renderer.scroller.setAttribute("aria-label", M("Editor content, press Enter to start editing, press Escape to exit")), this.renderer.scroller.addEventListener("keyup", $.bind(this)), this.commands.addCommand(W), this.renderer.$gutter.setAttribute("tabindex", 0), this.renderer.$gutter.setAttribute("aria-hidden", false), this.renderer.$gutter.setAttribute("role", "group"), this.renderer.$gutter.setAttribute("aria-roledescription", M("editor")), this.renderer.$gutter.setAttribute("aria-label", M("Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")), this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName), this.renderer.content.setAttribute("aria-hidden", true), (G = G || new E(this)).addListener()) : (this.renderer.enableKeyboardAccessibility = false, this.textInput.getElement().setAttribute("tabindex", 0), this.textInput.setNumberOfExtraLines(0), this.renderer.scroller.setAttribute("tabindex", -1), this.renderer.scroller.removeAttribute("role"), this.renderer.scroller.removeAttribute("aria-roledescription"), this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName), this.renderer.scroller.removeAttribute("aria-label"), this.renderer.scroller.removeEventListener("keyup", $.bind(this)), this.commands.removeCommand(W), this.renderer.content.removeAttribute("aria-hidden"), this.renderer.$gutter.setAttribute("tabindex", -1), this.renderer.$gutter.setAttribute("aria-hidden", true), this.renderer.$gutter.removeAttribute("role"), this.renderer.$gutter.removeAttribute("aria-roledescription"), this.renderer.$gutter.removeAttribute("aria-label"), this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName), G && G.removeListener());
}, initialValue: false }, customScrollbar: "renderer", hScrollBarAlwaysVisible: "renderer", vScrollBarAlwaysVisible: "renderer", highlightGutterLine: "renderer", animatedScroll: "renderer", showInvisibles: "renderer", showPrintMargin: "renderer", printMarginColumn: "renderer", printMargin: "renderer", fadeFoldWidgets: "renderer", showFoldWidgets: "renderer", displayIndentGuides: "renderer", highlightIndentGuides: "renderer", showGutter: "renderer", fontSize: "renderer", fontFamily: "renderer", maxLines: "renderer", minLines: "renderer", scrollPastEnd: "renderer", fixedWidthGutter: "renderer", theme: "renderer", hasCssTransforms: "renderer", maxPixelHeight: "renderer", useTextareaForIME: "renderer", useResizeObserver: "renderer", useSvgGutterIcons: "renderer", showFoldedAnnotations: "renderer", scrollSpeed: "$mouseHandler", dragDelay: "$mouseHandler", dragEnabled: "$mouseHandler", focusTimeout: "$mouseHandler", tooltipFollowsMouse: "$mouseHandler", firstLineNumber: "session", overwrite: "session", newLineMode: "session", useWorker: "session", useSoftTabs: "session", navigateWithinSoftTabs: "session", tabSize: "session", wrap: "session", indentedSoftWrap: "session", foldStyle: "session", mode: "session" });
var _ = { getText: function(v, $) {
return (Math.abs(v.selection.lead.row - $) || $ + 1 + ($ < 9 ? "·" : "")) + "";
}, getWidth: function(v, $, G) {
return Math.max($.toString().length, (G.lastRow + 1).toString().length, 2) * G.characterWidth;
}, update: function(v, $) {
$.renderer.$loop.schedule($.renderer.CHANGE_GUTTER);
}, attach: function(v) {
v.renderer.$gutterLayer.$renderer = this, v.on("changeSelection", this.update), this.update(null, v);
}, detach: function(v) {
v.renderer.$gutterLayer.$renderer == this && (v.renderer.$gutterLayer.$renderer = null), v.off("changeSelection", this.update), this.update(null, v);
} };
f.Editor = k;
}), ace.define("ace/layer/lines", ["require", "exports", "module", "ace/lib/dom"], function(A, f, R) {
var y = A("../lib/dom");
function C(d, h) {
this.element = d, this.canvasHeight = h || 5e5, this.element.style.height = 2 * this.canvasHeight + "px", this.cells = [], this.cellCache = [], this.$offsetCoefficient = 0;
}
C.prototype.moveContainer = function(d) {
y.translate(this.element, 0, -(d.firstRowScreen * d.lineHeight % this.canvasHeight) - d.offset * this.$offsetCoefficient);
}, C.prototype.pageChanged = function(d, h) {
return Math.floor(d.firstRowScreen * d.lineHeight / this.canvasHeight) !== Math.floor(h.firstRowScreen * h.lineHeight / this.canvasHeight);
}, C.prototype.computeLineTop = function(d, h, l) {
var n = h.firstRowScreen * h.lineHeight, n = Math.floor(n / this.canvasHeight);
return l.documentToScreenRow(d, 0) * h.lineHeight - n * this.canvasHeight;
}, C.prototype.computeLineHeight = function(d, h, l) {
return h.lineHeight * l.getRowLineCount(d);
}, C.prototype.getLength = function() {
return this.cells.length;
}, C.prototype.get = function(d) {
return this.cells[d];
}, C.prototype.shift = function() {
this.$cacheCell(this.cells.shift());
}, C.prototype.pop = function() {
this.$cacheCell(this.cells.pop());
}, C.prototype.push = function(d) {
if (Array.isArray(d)) {
this.cells.push.apply(this.cells, d);
for (var h = y.createFragment(this.element), l = 0; l < d.length; l++)
h.appendChild(d[l].element);
this.element.appendChild(h);
} else
this.cells.push(d), this.element.appendChild(d.element);
}, C.prototype.unshift = function(d) {
if (Array.isArray(d)) {
this.cells.unshift.apply(this.cells, d);
for (var h = y.createFragment(this.element), l = 0; l < d.length; l++)
h.appendChild(d[l].element);
this.element.firstChild ? this.element.insertBefore(h, this.element.firstChild) : this.element.appendChild(h);
} else
this.cells.unshift(d), this.element.insertAdjacentElement("afterbegin", d.element);
}, C.prototype.last = function() {
return this.cells.length ? this.cells[this.cells.length - 1] : null;
}, C.prototype.$cacheCell = function(d) {
d && (d.element.remove(), this.cellCache.push(d));
}, C.prototype.createCell = function(d, h, l, n) {
var o, i = this.cellCache.pop();
return i || (o = y.createElement("div"), n && n(o), this.element.appendChild(o), i = { element: o, text: "", row: d }), i.row = d, i;
}, f.Lines = C;
}), ace.define("ace/layer/gutter", ["require", "exports", "module", "ace/lib/dom", "ace/lib/oop", "ace/lib/lang", "ace/lib/event_emitter", "ace/layer/lines", "ace/config"], function(o, f, R) {
var y = o("../lib/dom"), C = o("../lib/oop"), d = o("../lib/lang"), h = o("../lib/event_emitter").EventEmitter, l = o("./lines").Lines, n = o("../config").nls, o = (i.prototype.setSession = function(r) {
this.session && this.session.off("change", this.$updateAnnotations), (this.session = r) && r.on("change", this.$updateAnnotations);
}, i.prototype.addGutterDecoration = function(r, e2) {
this.session.addGutterDecoration(r, e2);
}, i.prototype.removeGutterDecoration = function(r, e2) {
this.session.removeGutterDecoration(r, e2);
}, i.prototype.setAnnotations = function(r) {
this.$annotations = [];
for (var e2 = 0; e2 < r.length; e2++) {
var t = r[e2], p = t.row, s = (s = this.$annotations[p]) || (this.$annotations[p] = { text: [], type: [] }), p = t.text, c = t.type, p = p ? d.escapeHTML(p) : t.html || "", p = (s.text.indexOf(p) === -1 && (s.text.push(p), s.type.push(c)), t.className);
p ? s.className = p : c == "error" ? s.className = " ace_error" : c == "warning" && s.className != " ace_error" ? s.className = " ace_warning" : c != "info" || s.className || (s.className = " ace_info");
}
}, i.prototype.$updateAnnotations = function(r) {
var e2, t;
this.$annotations.length && (e2 = r.start.row, (t = r.end.row - e2) != 0) && (r.action == "remove" ? this.$annotations.splice(e2, 1 + t, null) : ((r = new Array(1 + t)).unshift(e2, 1), this.$annotations.splice.apply(this.$annotations, r)));
}, i.prototype.update = function(r) {
this.config = r;
for (var e2 = this.session, t = r.firstRow, s = Math.min(r.lastRow + r.gutterOffset, e2.getLength() - 1), c = (this.oldLastRow = s, this.config = r, this.$lines.moveContainer(r), this.$updateCursorRow(), e2.getNextFoldLine(t)), p = c ? c.start.row : 1 / 0, g = null, b = -1, w = t; ; ) {
if (p < w && (w = c.end.row + 1, p = (c = e2.getNextFoldLine(w, c)) ? c.start.row : 1 / 0), s < w) {
for (; this.$lines.getLength() > b + 1; )
this.$lines.pop();
break;
}
(g = this.$lines.get(++b)) ? g.row = w : (g = this.$lines.createCell(w, r, this.session, a), this.$lines.push(g)), this.$renderCell(g, r, c, w), w++;
}
this._signal("afterRender"), this.$updateGutterWidth(r);
}, i.prototype.$updateGutterWidth = function(r) {
var e2 = this.session, c = e2.gutterRenderer || this.$renderer, s = e2.$firstLineNumber, t = this.$lines.last() ? this.$lines.last().text : "", s = ((this.$fixedWidth || e2.$useWrapMode) && (t = e2.getLength() + s - 1), c ? c.getWidth(e2, t, r) : t.toString().length * r.characterWidth), c = this.$padding || this.$computePadding();
(s += c.left + c.right) === this.gutterWidth || isNaN(s) || (this.gutterWidth = s, this.element.parentNode.style.width = this.element.style.width = Math.ceil(this.gutterWidth) + "px", this._signal("changeGutterWidth", s));
}, i.prototype.$updateCursorRow = function() {
var r;
this.$highlightGutterLine && (r = this.session.selection.getCursor(), this.$cursorRow !== r.row) && (this.$cursorRow = r.row);
}, i.prototype.updateLineHighlight = function() {
if (this.$highlightGutterLine) {
var r = this.session.selection.cursor.row;
if (this.$cursorRow = r, !this.$cursorCell || this.$cursorCell.row != r) {
this.$cursorCell && (this.$cursorCell.element.className = this.$cursorCell.element.className.replace("ace_gutter-active-line ", ""));
var e2 = this.$lines.cells;
this.$cursorCell = null;
for (var t = 0; t < e2.length; t++) {
var s = e2[t];
if (s.row >= this.$cursorRow) {
if (s.row > this.$cursorRow) {
var c = this.session.getFoldLine(this.$cursorRow);
if (!(0 < t && c && c.start.row == e2[t - 1].row))
break;
s = e2[t - 1];
}
s.element.className = "ace_gutter-active-line " + s.element.className, this.$cursorCell = s;
break;
}
}
}
}
}, i.prototype.scrollLines = function(r) {
var e2 = this.config;
if (this.config = r, this.$updateCursorRow(), this.$lines.pageChanged(e2, r))
return this.update(r);
this.$lines.moveContainer(r);
var t = Math.min(r.lastRow + r.gutterOffset, this.session.getLength() - 1), s = this.oldLastRow;
if (this.oldLastRow = t, !e2 || s < r.firstRow)
return this.update(r);
if (t < e2.firstRow)
return this.update(r);
if (e2.firstRow < r.firstRow)
for (var c = this.session.getFoldedRowCount(e2.firstRow, r.firstRow - 1); 0 < c; c--)
this.$lines.shift();
if (t < s)
for (c = this.session.getFoldedRowCount(t + 1, s); 0 < c; c--)
this.$lines.pop();
r.firstRow < e2.firstRow && this.$lines.unshift(this.$renderLines(r, r.firstRow, e2.firstRow - 1)), s < t && this.$lines.push(this.$renderLines(r, s + 1, t)), this.updateLineHighlight(), this._signal("afterRender"), this.$updateGutterWidth(r);
}, i.prototype.$renderLines = function(r, e2, t) {
for (var s = [], c = e2, p = this.session.getNextFoldLine(c), g = p ? p.start.row : 1 / 0; g < c && (c = p.end.row + 1, g = (p = this.session.getNextFoldLine(c, p)) ? p.start.row : 1 / 0), !(t < c); ) {
var b = this.$lines.createCell(c, r, this.session, a);
this.$renderCell(b, r, p, c), s.push(b), c++;
}
return s;
}, i.prototype.$renderCell = function(r, e2, t, s) {
var c, p = r.element, g = this.session, b = p.childNodes[0], w = p.childNodes[1], E = p.childNodes[2], M = E.firstChild, B2 = g.$firstLineNumber, Z = g.$breakpoints, k = g.$decorations, W = g.gutterRenderer || this.$renderer, u = this.$showFoldWidgets && g.foldWidgets, _ = t ? t.start.row : Number.MAX_VALUE, v = e2.lineHeight + "px", $ = this.$useSvgGutterIcons ? "ace_gutter-cell_svg-icons " : "ace_gutter-cell ", G = this.$useSvgGutterIcons ? "ace_icon_svg" : "ace_icon", W = (W ? W.getText(g, s) : s + B2).toString();
if (this.$highlightGutterLine && (s == this.$cursorRow || t && s < this.$cursorRow && _ <= s && this.$cursorRow <= t.end.row) && ($ += "ace_gutter-active-line ", this.$cursorCell != r) && (this.$cursorCell && (this.$cursorCell.element.className = this.$cursorCell.element.className.replace("ace_gutter-active-line ", "")), this.$cursorCell = r), Z[s] && ($ += Z[s]), k[s] && ($ += k[s]), this.$annotations[s] && s !== _ && ($ += this.$annotations[s].className), c = u && (c = u[s]) == null ? u[s] = g.getFoldWidget(s) : c) {
if (B2 = "ace_fold-widget ace_" + c, Z = c == "start" && s == _ && s < t.end.row, Z) {
B2 += " ace_closed";
for (var X = "", Q = false, K = s + 1; K <= t.end.row; K++)
if (this.$annotations[K]) {
if (this.$annotations[K].className === " ace_error") {
Q = true, X = " ace_error_fold";
break;
}
this.$annotations[K].className === " ace_warning" && (Q = true, X = " ace_warning_fold");
}
$ += X;
} else
B2 += " ace_open";
w.className != B2 && (w.className = B2), y.setStyle(w.style, "height", v), y.setStyle(w.style, "display", "inline-block"), w.setAttribute("role", "button"), w.setAttribute("tabindex", "-1"), k = g.getFoldWidgetRange(s), k ? w.setAttribute("aria-label", n("Toggle code folding, rows $0 through $1", [k.start.row + 1, k.end.row + 1])) : t ? w.setAttribute("aria-label", n("Toggle code folding, rows $0 through $1", [t.start.row + 1, t.end.row + 1])) : w.setAttribute("aria-label", n("Toggle code folding, row $0", [s + 1])), Z ? (w.setAttribute("aria-expanded", "false"), w.setAttribute("title", n("Unfold code"))) : (w.setAttribute("aria-expanded", "true"), w.setAttribute("title", n("Fold code")));
} else
w && (y.setStyle(w.style, "display", "none"), w.setAttribute("tabindex", "0"), w.removeAttribute("role"), w.removeAttribute("aria-label"));
return Q && this.$showFoldedAnnotations ? (E.className = "ace_gutter_annotation", M.className = G, M.className += X, y.setStyle(M.style, "height", v), y.setStyle(E.style, "display", "block"), y.setStyle(E.style, "height", v), E.setAttribute("aria-label", n("Read annotations row $0", [W])), E.setAttribute("tabindex", "-1"), E.setAttribute("role", "button")) : this.$annotations[s] ? (E.className = "ace_gutter_annotation", M.className = G, this.$useSvgGutterIcons ? M.className += this.$annotations[s].className : p.classList.add(this.$annotations[s].className.replace(" ", "")), y.setStyle(M.style, "height", v), y.setStyle(E.style, "display", "block"), y.setStyle(E.style, "height", v), E.setAttribute("aria-label", n("Read annotations row $0", [W])), E.setAttribute("tabindex", "-1"), E.setAttribute("role", "button")) : (y.setStyle(E.style, "display", "none"), E.removeAttribute("aria-label"), E.removeAttribute("role"), E.setAttribute("tabindex", "0")), W !== b.data && (b.data = W), p.className != $ && (p.className = $), y.setStyle(r.element.style, "height", this.$lines.computeLineHeight(s, e2, g) + "px"), y.setStyle(r.element.style, "top", this.$lines.computeLineTop(s, e2, g) + "px"), r.text = W, E.style.display === "none" && w.style.display === "none" ? r.element.setAttribute("aria-hidden", true) : r.element.setAttribute("aria-hidden", false), r;
}, i.prototype.setHighlightGutterLine = function(r) {
this.$highlightGutterLine = r;
}, i.prototype.setShowLineNumbers = function(r) {
this.$renderer = !r && { getWidth: function() {
return 0;
}, getText: function() {
return "";
} };
}, i.prototype.getShowLineNumbers = function() {
return this.$showLineNumbers;
}, i.prototype.setShowFoldWidgets = function(r) {
r ? y.addCssClass(this.element, "ace_folding-enabled") : y.removeCssClass(this.element, "ace_folding-enabled"), this.$showFoldWidgets = r, this.$padding = null;
}, i.prototype.getShowFoldWidgets = function() {
return this.$showFoldWidgets;
}, i.prototype.$computePadding = function() {
var r;
return this.element.firstChild ? (r = y.computedStyle(this.element.firstChild), this.$padding = {}, this.$padding.left = (parseInt(r.borderLeftWidth) || 0) + (parseInt(r.paddingLeft) || 0) + 1, this.$padding.right = (parseInt(r.borderRightWidth) || 0) + (parseInt(r.paddingRight) || 0), this.$padding) : { left: 0, right: 0 };
}, i.prototype.getRegion = function(r) {
var e2 = this.$padding || this.$computePadding(), t = this.element.getBoundingClientRect();
return r.x < e2.left + t.left ? "markers" : this.$showFoldWidgets && r.x > t.right - e2.right ? "foldWidgets" : void 0;
}, i);
function i(r) {
this.element = y.createElement("div"), this.element.className = "ace_layer ace_gutter-layer", r.appendChild(this.element), this.setShowFoldWidgets(this.$showFoldWidgets), this.gutterWidth = 0, this.$annotations = [], this.$updateAnnotations = this.$updateAnnotations.bind(this), this.$lines = new l(this.element), this.$lines.$offsetCoefficient = 1;
}
function a(r) {
var e2 = document.createTextNode(""), e2 = (r.appendChild(e2), y.createElement("span")), e2 = (r.appendChild(e2), y.createElement("span")), t = (r.appendChild(e2), y.createElement("span"));
return e2.appendChild(t), r;
}
o.prototype.$fixedWidth = false, o.prototype.$highlightGutterLine = true, o.prototype.$renderer = "", o.prototype.$showLineNumbers = true, o.prototype.$showFoldWidgets = true, C.implement(o.prototype, h), f.Gutter = o;
}), ace.define("ace/layer/marker", ["require", "exports", "module", "ace/range", "ace/lib/dom"], function(d, f, R) {
var y = d("../range").Range, C = d("../lib/dom"), d = (h.prototype.setPadding = function(l) {
this.$padding = l;
}, h.prototype.setSession = function(l) {
this.session = l;
}, h.prototype.setMarkers = function(l) {
this.markers = l;
}, h.prototype.elt = function(l, n) {
var o = this.i != -1 && this.element.childNodes[this.i];
o ? this.i++ : (o = document.createElement("div"), this.element.appendChild(o), this.i = -1), o.style.cssText = n, o.className = l;
}, h.prototype.update = function(l) {
if (l) {
var n, o;
for (o in this.config = l, this.i = 0, this.markers) {
var i, a, r, e2 = this.markers[o];
e2.range ? (r = e2.range.clipRows(l.firstRow, l.lastRow)).isEmpty() || (r = r.toScreenRange(this.session), e2.renderer ? (i = this.$getTop(r.start.row, l), a = this.$padding + r.start.column * l.characterWidth, e2.renderer(n, r, a, i, l)) : e2.type == "fullLine" ? this.drawFullLineMarker(n, r, e2.clazz, l) : e2.type == "screenLine" ? this.drawScreenLineMarker(n, r, e2.clazz, l) : r.isMultiLine() ? e2.type == "text" ? this.drawTextMarker(n, r, e2.clazz, l) : this.drawMultiLineMarker(n, r, e2.clazz, l) : this.drawSingleLineMarker(n, r, e2.clazz + " ace_start ace_br15", l)) : e2.update(n, this, this.session, l);
}
if (this.i != -1)
for (; this.i < this.element.childElementCount; )
this.element.removeChild(this.element.lastChild);
}
}, h.prototype.$getTop = function(l, n) {
return (l - n.firstRowScreen) * n.lineHeight;
}, h.prototype.drawTextMarker = function(l, n, o, i, a) {
for (var r, e2 = this.session, t = n.start.row, s = n.end.row, c = t, p = 0, g = e2.getScreenLastRowColumn(c), b = new y(c, n.start.column, c, p); c <= s; c++)
b.start.row = b.end.row = c, b.start.column = c == t ? n.start.column : e2.getRowWrapIndent(c), b.end.column = g, r = p, p = g, g = c + 1 < s ? e2.getScreenLastRowColumn(c + 1) : c == s ? 0 : n.end.column, this.drawSingleLineMarker(l, b, o + (c == t ? " ace_start" : "") + " ace_br" + ((c == t || c == t + 1 && n.start.column ? 1 : 0) | (r < p ? 2 : 0) | (g < p ? 4 : 0) | (c == s ? 8 : 0)), i, c == s ? 0 : 1, a);
}, h.prototype.drawMultiLineMarker = function(l, n, o, i, a) {
var r, e2 = this.$padding, t = i.lineHeight, s = this.$getTop(n.start.row, i), c = e2 + n.start.column * i.characterWidth;
a = a || "", this.session.$bidiHandler.isBidiRow(n.start.row) ? ((r = n.clone()).end.row = r.start.row, r.end.column = this.session.getLine(r.start.row).length, this.drawBidiSingleLineMarker(l, r, o + " ace_br1 ace_start", i, null, a)) : this.elt(o + " ace_br1 ace_start", "height:" + t + "px;right:0;top:" + s + "px;left:" + c + "px;" + (a || "")), this.session.$bidiHandler.isBidiRow(n.end.row) ? ((r = n.clone()).start.row = r.end.row, r.start.column = 0, this.drawBidiSingleLineMarker(l, r, o + " ace_br12", i, null, a)) : (s = this.$getTop(n.end.row, i), c = n.end.column * i.characterWidth, this.elt(o + " ace_br12", "height:" + t + "px;width:" + c + "px;top:" + s + "px;left:" + e2 + "px;" + (a || ""))), (t = (n.end.row - n.start.row - 1) * i.lineHeight) <= 0 || (s = this.$getTop(n.start.row + 1, i), l = (n.start.column ? 1 : 0) | (n.end.column ? 0 : 8), this.elt(o + (l ? " ace_br" + l : ""), "height:" + t + "px;right:0;top:" + s + "px;left:" + e2 + "px;" + (a || "")));
}, h.prototype.drawSingleLineMarker = function(e2, c, o, i, t, r) {
if (this.session.$bidiHandler.isBidiRow(c.start.row))
return this.drawBidiSingleLineMarker(e2, c, o, i, t, r);
var e2 = i.lineHeight, t = (c.end.column + (t || 0) - c.start.column) * i.characterWidth, s = this.$getTop(c.start.row, i), c = this.$padding + c.start.column * i.characterWidth;
this.elt(o, "height:" + e2 + "px;width:" + t + "px;top:" + s + "px;left:" + c + "px;" + (r || ""));
}, h.prototype.drawBidiSingleLineMarker = function(l, n, o, i, a, r) {
var e2 = i.lineHeight, t = this.$getTop(n.start.row, i), s = this.$padding;
this.session.$bidiHandler.getSelections(n.start.column, n.end.column).forEach(function(c) {
this.elt(o, "height:" + e2 + "px;width:" + (c.width + (a || 0)) + "px;top:" + t + "px;left:" + (s + c.left) + "px;" + (r || ""));
}, this);
}, h.prototype.drawFullLineMarker = function(l, n, o, i, a) {
var r = this.$getTop(n.start.row, i), e2 = i.lineHeight;
n.start.row != n.end.row && (e2 += this.$getTop(n.end.row, i) - r), this.elt(o, "height:" + e2 + "px;top:" + r + "px;left:0;right:0;" + (a || ""));
}, h.prototype.drawScreenLineMarker = function(l, n, o, i, a) {
n = this.$getTop(n.start.row, i), i = i.lineHeight, this.elt(o, "height:" + i + "px;top:" + n + "px;left:0;right:0;" + (a || ""));
}, h);
function h(l) {
this.element = C.createElement("div"), this.element.className = "ace_layer ace_marker-layer", l.appendChild(this.element);
}
d.prototype.$padding = 0, f.Marker = d;
}), ace.define("ace/layer/text_util", ["require", "exports", "module"], function(A, f, R) {
var y = /* @__PURE__ */ new Set(["text", "rparen", "lparen"]);
f.isTextToken = function(C) {
return y.has(C);
};
}), ace.define("ace/layer/text", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/lang", "ace/layer/lines", "ace/lib/event_emitter", "ace/config", "ace/layer/text_util"], function(i, f, R) {
var y = i("../lib/oop"), C = i("../lib/dom"), d = i("../lib/lang"), h = i("./lines").Lines, l = i("../lib/event_emitter").EventEmitter, n = i("../config").nls, o = i("./text_util").isTextToken, i = (a.prototype.$updateEolChar = function() {
var r = this.session.doc, r = r.getNewLineCharacter() == `
` && r.getNewLineMode() != "windows" ? this.EOL_CHAR_LF : this.EOL_CHAR_CRLF;
if (this.EOL_CHAR != r)
return this.EOL_CHAR = r, true;
}, a.prototype.setPadding = function(r) {
this.$padding = r, this.element.style.margin = "0 " + r + "px";
}, a.prototype.getLineHeight = function() {
return this.$fontMetrics.$characterSize.height || 0;
}, a.prototype.getCharacterWidth = function() {
return this.$fontMetrics.$characterSize.width || 0;
}, a.prototype.$setFontMetrics = function(r) {
this.$fontMetrics = r, this.$fontMetrics.on("changeCharacterSize", (function(e2) {
this._signal("changeCharacterSize", e2);
}).bind(this)), this.$pollSizeChanges();
}, a.prototype.checkForSizeChanges = function() {
this.$fontMetrics.checkForSizeChanges();
}, a.prototype.$pollSizeChanges = function() {
return this.$pollSizeChangesTimer = this.$fontMetrics.$pollSizeChanges();
}, a.prototype.setSession = function(r) {
(this.session = r) && this.$computeTabString();
}, a.prototype.setShowInvisibles = function(r) {
return this.showInvisibles != r && (typeof (this.showInvisibles = r) == "string" ? (this.showSpaces = /tab/i.test(r), this.showTabs = /space/i.test(r), this.showEOL = /eol/i.test(r)) : this.showSpaces = this.showTabs = this.showEOL = r, this.$computeTabString(), true);
}, a.prototype.setDisplayIndentGuides = function(r) {
return this.displayIndentGuides != r && (this.displayIndentGuides = r, this.$computeTabString(), true);
}, a.prototype.setHighlightIndentGuides = function(r) {
return this.$highlightIndentGuides !== r && (this.$highlightIndentGuides = r);
}, a.prototype.$computeTabString = function() {
for (var r, e2, t, s, c, p, g = this.session.getTabSize(), b = (this.tabSize = g, this.$tabStrings = [0]), w = 1; w < g + 1; w++)
this.showTabs ? ((p = this.dom.createElement("span")).className = "ace_invisible ace_invisible_tab", p.textContent = d.stringRepeat(this.TAB_CHAR, w), b.push(p)) : b.push(this.dom.createTextNode(d.stringRepeat(" ", w), this.element));
this.displayIndentGuides && (this.$indentGuideRe = /\s\S| \t|\t |\s$/, r = "ace_indent-guide", e2 = this.showSpaces ? " ace_invisible ace_invisible_space" : "", t = this.showSpaces ? d.stringRepeat(this.SPACE_CHAR, this.tabSize) : d.stringRepeat(" ", this.tabSize), s = this.showTabs ? " ace_invisible ace_invisible_tab" : "", c = this.showTabs ? d.stringRepeat(this.TAB_CHAR, this.tabSize) : t, (p = this.dom.createElement("span")).className = r + e2, p.textContent = t, this.$tabStrings[" "] = p, (p = this.dom.createElement("span")).className = r + s, p.textContent = c, this.$tabStrings[" "] = p);
}, a.prototype.updateLines = function(r, e2, t) {
if (this.config.lastRow != r.lastRow || this.config.firstRow != r.firstRow)
return this.update(r);
this.config = r;
for (var s = Math.max(e2, r.firstRow), c = Math.min(t, r.lastRow), p = this.element.childNodes, g = 0, b = r.firstRow; b < s; b++) {
if (w = this.session.getFoldLine(b)) {
if (w.containsRow(s)) {
s = w.start.row;
break;
}
b = w.end.row;
}
g++;
}
for (var w, E = false, b = s, M = (w = this.session.getNextFoldLine(b)) ? w.start.row : 1 / 0; M < b && (b = w.end.row + 1, M = (w = this.session.getNextFoldLine(b, w)) ? w.start.row : 1 / 0), !(c < b); ) {
var B2, Z = p[g++];
Z && (this.dom.removeChildren(Z), this.$renderLine(Z, b, b == M && w), E && (Z.style.top = this.$lines.computeLineTop(b, r, this.session) + "px"), B2 = r.lineHeight * this.session.getRowLength(b) + "px", Z.style.height != B2) && (E = true, Z.style.height = B2), b++;
}
if (E)
for (; g < this.$lines.cells.length; ) {
var k = this.$lines.cells[g++];
k.element.style.top = this.$lines.computeLineTop(k.row, r, this.session) + "px";
}
}, a.prototype.scrollLines = function(r) {
var e2 = this.config;
if (this.config = r, this.$lines.pageChanged(e2, r))
return this.update(r);
this.$lines.moveContainer(r);
var t = r.lastRow, s = e2 ? e2.lastRow : -1;
if (!e2 || s < r.firstRow)
return this.update(r);
if (t < e2.firstRow)
return this.update(r);
if (!e2 || e2.lastRow < r.firstRow)
return this.update(r);
if (r.lastRow < e2.firstRow)
return this.update(r);
if (e2.firstRow < r.firstRow)
for (var c = this.session.getFoldedRowCount(e2.firstRow, r.firstRow - 1); 0 < c; c--)
this.$lines.shift();
if (e2.lastRow > r.lastRow)
for (c = this.session.getFoldedRowCount(r.lastRow + 1, e2.lastRow); 0 < c; c--)
this.$lines.pop();
r.firstRow < e2.firstRow && this.$lines.unshift(this.$renderLinesFragment(r, r.firstRow, e2.firstRow - 1)), r.lastRow > e2.lastRow && this.$lines.push(this.$renderLinesFragment(r, e2.lastRow + 1, r.lastRow)), this.$highlightIndentGuide();
}, a.prototype.$renderLinesFragment = function(r, e2, t) {
for (var s = [], c = e2, p = this.session.getNextFoldLine(c), g = p ? p.start.row : 1 / 0; g < c && (c = p.end.row + 1, g = (p = this.session.getNextFoldLine(c, p)) ? p.start.row : 1 / 0), !(t < c); ) {
var b = this.$lines.createCell(c, r, this.session), w = b.element;
this.dom.removeChildren(w), C.setStyle(w.style, "height", this.$lines.computeLineHeight(c, r, this.session) + "px"), C.setStyle(w.style, "top", this.$lines.computeLineTop(c, r, this.session) + "px"), this.$renderLine(w, c, c == g && p), this.$useLineGroups() ? w.className = "ace_line_group" : w.className = "ace_line", s.push(b), c++;
}
return s;
}, a.prototype.update = function(r) {
this.$lines.moveContainer(r);
for (var e2 = (this.config = r).firstRow, t = r.lastRow, s = this.$lines; s.getLength(); )
s.pop();
s.push(this.$renderLinesFragment(r, e2, t));
}, a.prototype.$renderToken = function(r, e2, t, s) {
for (var c, p, g = this, b = /(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g, w = this.dom.createFragment(this.element), E = 0; c = b.exec(s); ) {
var M, B2, Z = c[1], k = c[2], u = c[3], _ = c[4], v = c[5];
!g.showSpaces && k || (M = E != c.index ? s.slice(E, c.index) : "", E = c.index + c[0].length, M && w.appendChild(this.dom.createTextNode(M, this.element)), Z ? (M = g.session.getScreenTabSize(e2 + c.index), w.appendChild(g.$tabStrings[M].cloneNode(true)), e2 += M - 1) : k ? g.showSpaces ? ((B2 = this.dom.createElement("span")).className = "ace_invisible ace_invisible_space", B2.textContent = d.stringRepeat(g.SPACE_CHAR, k.length), w.appendChild(B2)) : w.appendChild(this.dom.createTextNode(k, this.element)) : u ? ((B2 = this.dom.createElement("span")).className = "ace_invisible ace_invisible_space ace_invalid", B2.textContent = d.stringRepeat(g.SPACE_CHAR, u.length), w.appendChild(B2)) : _ ? (e2 += 1, (B2 = this.dom.createElement("span")).style.width = 2 * g.config.characterWidth + "px", B2.className = g.showSpaces ? "ace_cjk ace_invisible ace_invisible_space" : "ace_cjk", B2.textContent = g.showSpaces ? g.SPACE_CHAR : _, w.appendChild(B2)) : v && (e2 += 1, (B2 = this.dom.createElement("span")).style.width = 2 * g.config.characterWidth + "px", B2.className = "ace_cjk", B2.textContent = v, w.appendChild(B2)));
}
return w.appendChild(this.dom.createTextNode(E ? s.slice(E) : s, this.element)), o(t.type) ? r.appendChild(w) : (p = "ace_" + t.type.replace(/\./g, " ace_"), B2 = this.dom.createElement("span"), t.type == "fold" && (B2.style.width = t.value.length * this.config.characterWidth + "px", B2.setAttribute("title", n("Unfold code"))), B2.className = p, B2.appendChild(w), r.appendChild(B2)), e2 + s.length;
}, a.prototype.renderIndentGuide = function(r, e2, t) {
var s = e2.search(this.$indentGuideRe);
if (!(s <= 0 || t <= s)) {
if (e2[0] == " ") {
for (var c = (s -= s % this.tabSize) / this.tabSize, p = 0; p < c; p++)
r.appendChild(this.$tabStrings[" "].cloneNode(true));
return this.$highlightIndentGuide(), e2.substr(s);
}
if (e2[0] == " ") {
for (p = 0; p < s; p++)
r.appendChild(this.$tabStrings[" "].cloneNode(true));
return this.$highlightIndentGuide(), e2.substr(s);
}
this.$highlightIndentGuide();
}
return e2;
}, a.prototype.$highlightIndentGuide = function() {
if (this.$highlightIndentGuides && this.displayIndentGuides) {
this.$highlightIndentGuideMarker = { indentLevel: void 0, start: void 0, end: void 0, dir: void 0 };
var r = this.session.doc.$lines;
if (r) {
var e2 = this.session.selection.getCursor(), t = /^\s*/.exec(this.session.doc.getLine(e2.row))[0].length, s = Math.floor(t / this.tabSize);
if (this.$highlightIndentGuideMarker = { indentLevel: s, start: e2.row }, this.session.$bracketHighlight) {
for (var c = this.session.$bracketHighlight.ranges, p = 0; p < c.length; p++)
if (e2.row !== c[p].start.row) {
this.$highlightIndentGuideMarker.end = c[p].start.row, e2.row > c[p].start.row ? this.$highlightIndentGuideMarker.dir = -1 : this.$highlightIndentGuideMarker.dir = 1;
break;
}
}
if (!this.$highlightIndentGuideMarker.end && r[e2.row] !== "" && e2.column === r[e2.row].length)
for (this.$highlightIndentGuideMarker.dir = 1, p = e2.row + 1; p < r.length; p++) {
var g = r[p], b = /^\s*/.exec(g)[0].length;
if (g !== "" && (this.$highlightIndentGuideMarker.end = p, b <= t))
break;
}
this.$renderHighlightIndentGuide();
}
}
}, a.prototype.$clearActiveIndentGuide = function() {
for (var r = this.$lines.cells, e2 = 0; e2 < r.length; e2++) {
var t = r[e2].element.childNodes;
if (0 < t.length) {
for (var s = 0; s < t.length; s++)
if (t[s].classList && t[s].classList.contains("ace_indent-guide-active")) {
t[s].classList.remove("ace_indent-guide-active");
break;
}
}
}
}, a.prototype.$setIndentGuideActive = function(r, e2) {
this.session.doc.getLine(r.row) !== "" && (r = r.element.childNodes) && (r = r[e2 - 1]) && r.classList && r.classList.contains("ace_indent-guide") && r.classList.add("ace_indent-guide-active");
}, a.prototype.$renderHighlightIndentGuide = function() {
if (this.$lines) {
var r = this.$lines.cells, e2 = (this.$clearActiveIndentGuide(), this.$highlightIndentGuideMarker.indentLevel);
if (e2 !== 0) {
if (this.$highlightIndentGuideMarker.dir === 1)
for (var t = 0; t < r.length; t++) {
var s = r[t];
if (this.$highlightIndentGuideMarker.end && s.row >= this.$highlightIndentGuideMarker.start + 1) {
if (s.row >= this.$highlightIndentGuideMarker.end)
break;
this.$setIndentGuideActive(s, e2);
}
}
else
for (t = r.length - 1; 0 <= t; t--)
if (s = r[t], this.$highlightIndentGuideMarker.end && s.row < this.$highlightIndentGuideMarker.start) {
if (s.row <= this.$highlightIndentGuideMarker.end)
break;
this.$setIndentGuideActive(s, e2);
}
}
}
}, a.prototype.$createLineElement = function(r) {
var e2 = this.dom.createElement("div");
return e2.className = "ace_line", e2.style.height = this.config.lineHeight + "px", e2;
}, a.prototype.$renderWrappedLine = function(r, e2, t) {
var s = 0, c = 0, p = t[0], g = 0, b = this.$createLineElement();
r.appendChild(b);
for (var w = 0; w < e2.length; w++) {
var E = e2[w], M = E.value;
if (w == 0 && this.displayIndentGuides) {
if (s = M.length, !(M = this.renderIndentGuide(b, M, p)))
continue;
s -= M.length;
}
if (s + M.length < p)
g = this.$renderToken(b, g, E, M), s += M.length;
else {
for (; s + M.length >= p; )
g = this.$renderToken(b, g, E, M.substring(0, p - s)), M = M.substring(p - s), s = p, b = this.$createLineElement(), r.appendChild(b), b.appendChild(this.dom.createTextNode(d.stringRepeat(" ", t.indent), this.element)), g = 0, p = t[++c] || Number.MAX_VALUE;
M.length != 0 && (s += M.length, g = this.$renderToken(b, g, E, M));
}
}
t[t.length - 1] > this.MAX_LINE_LENGTH && this.$renderOverflowMessage(b, g, null, "", true);
}, a.prototype.$renderSimpleLine = function(r, e2) {
for (var t = 0, s = 0; s < e2.length; s++) {
var c = e2[s], p = c.value;
if (s != 0 || !this.displayIndentGuides || (p = this.renderIndentGuide(r, p))) {
if (t + p.length > this.MAX_LINE_LENGTH)
return this.$renderOverflowMessage(r, t, c, p);
t = this.$renderToken(r, t, c, p);
}
}
}, a.prototype.$renderOverflowMessage = function(r, e2, t, s, c) {
t && this.$renderToken(r, e2, t, s.slice(0, this.MAX_LINE_LENGTH - e2)), t = this.dom.createElement("span"), t.className = "ace_inline_button ace_keyword ace_toggle_wrap", t.textContent = c ? "" : "", r.appendChild(t);
}, a.prototype.$renderLine = function(r, e2, t) {
var s, c, p = r;
(s = (t = t || t == 0 ? t : this.session.getFoldLine(e2)) ? this.$getFoldLineTokens(e2, t) : this.session.getTokens(e2)).length ? (c = this.session.getRowSplitData(e2)) && c.length ? (this.$renderWrappedLine(r, s, c), p = r.lastChild) : (p = r, this.$useLineGroups() && (p = this.$createLineElement(), r.appendChild(p)), this.$renderSimpleLine(p, s)) : this.$useLineGroups() && (p = this.$createLineElement(), r.appendChild(p)), this.showEOL && p && (t && (e2 = t.end.row), (c = this.dom.createElement("span")).className = "ace_invisible ace_invisible_eol", c.textContent = e2 == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR, p.appendChild(c));
}, a.prototype.$getFoldLineTokens = function(r, e2) {
var t = this.session, s = [], c = t.getTokens(r);
return e2.walk(function(p, g, b, w, E) {
if (p != null)
s.push({ type: "fold", value: p });
else if ((c = E ? t.getTokens(g) : c).length) {
for (var M, B2 = c, Z = w, k = b, u = 0, _ = 0; _ + B2[u].value.length < Z; )
if (_ += B2[u].value.length, ++u == B2.length)
return;
for (_ != Z && ((M = B2[u].value.substring(Z - _)).length > k - Z && (M = M.substring(0, k - Z)), s.push({ type: B2[u].type, value: M }), _ = Z + M.length, u += 1); _ < k && u < B2.length; )
(M = B2[u].value).length + _ > k ? s.push({ type: B2[u].type, value: M.substring(0, k - _) }) : s.push(B2[u]), _ += M.length, u += 1;
}
}, e2.end.row, this.session.getLine(e2.end.row).length), s;
}, a.prototype.$useLineGroups = function() {
return this.session.getUseWrapMode();
}, a);
function a(r) {
this.dom = C, this.element = this.dom.createElement("div"), this.element.className = "ace_layer ace_text-layer", r.appendChild(this.element), this.$updateEolChar = this.$updateEolChar.bind(this), this.$lines = new h(this.element);
}
i.prototype.EOF_CHAR = "¶", i.prototype.EOL_CHAR_LF = "¬", i.prototype.EOL_CHAR_CRLF = "¤", i.prototype.EOL_CHAR = i.prototype.EOL_CHAR_LF, i.prototype.TAB_CHAR = "—", i.prototype.SPACE_CHAR = "·", i.prototype.$padding = 0, i.prototype.MAX_LINE_LENGTH = 1e4, i.prototype.showInvisibles = false, i.prototype.showSpaces = false, i.prototype.showTabs = false, i.prototype.showEOL = false, i.prototype.displayIndentGuides = true, i.prototype.$highlightIndentGuides = true, i.prototype.$tabStrings = [], i.prototype.destroy = {}, i.prototype.onChangeTabSize = i.prototype.$computeTabString, y.implement(i.prototype, l), f.Text = i;
}), ace.define("ace/layer/cursor", ["require", "exports", "module", "ace/lib/dom"], function(C, f, R) {
var y = C("../lib/dom"), C = (d.prototype.$updateOpacity = function(h) {
for (var l = this.cursors, n = l.length; n--; )
y.setStyle(l[n].style, "opacity", h ? "" : "0");
}, d.prototype.$startCssAnimation = function() {
for (var h = this.cursors, l = h.length; l--; )
h[l].style.animationDuration = this.blinkInterval + "ms";
this.$isAnimating = true, setTimeout((function() {
this.$isAnimating && y.addCssClass(this.element, "ace_animate-blinking");
}).bind(this));
}, d.prototype.$stopCssAnimation = function() {
this.$isAnimating = false, y.removeCssClass(this.element, "ace_animate-blinking");
}, d.prototype.setPadding = function(h) {
this.$padding = h;
}, d.prototype.setSession = function(h) {
this.session = h;
}, d.prototype.setBlinking = function(h) {
h != this.isBlinking && (this.isBlinking = h, this.restartTimer());
}, d.prototype.setBlinkInterval = function(h) {
h != this.blinkInterval && (this.blinkInterval = h, this.restartTimer());
}, d.prototype.setSmoothBlinking = function(h) {
h != this.smoothBlinking && (this.smoothBlinking = h, y.setCssClass(this.element, "ace_smooth-blinking", h), this.$updateCursors(true), this.restartTimer());
}, d.prototype.addCursor = function() {
var h = y.createElement("div");
return h.className = "ace_cursor", this.element.appendChild(h), this.cursors.push(h), h;
}, d.prototype.removeCursor = function() {
var h;
if (1 < this.cursors.length)
return (h = this.cursors.pop()).parentNode.removeChild(h), h;
}, d.prototype.hideCursor = function() {
this.isVisible = false, y.addCssClass(this.element, "ace_hidden-cursors"), this.restartTimer();
}, d.prototype.showCursor = function() {
this.isVisible = true, y.removeCssClass(this.element, "ace_hidden-cursors"), this.restartTimer();
}, d.prototype.restartTimer = function() {
var h, l = this.$updateCursors;
clearInterval(this.intervalId), clearTimeout(this.timeoutId), this.$stopCssAnimation(), this.smoothBlinking && (this.$isSmoothBlinking = false, y.removeCssClass(this.element, "ace_smooth-blinking")), l(true), this.isBlinking && this.blinkInterval && this.isVisible ? (this.smoothBlinking && (this.$isSmoothBlinking = true, setTimeout((function() {
this.$isSmoothBlinking && y.addCssClass(this.element, "ace_smooth-blinking");
}).bind(this))), y.HAS_CSS_ANIMATION ? this.$startCssAnimation() : (h = (function() {
this.timeoutId = setTimeout(function() {
l(false);
}, 0.6 * this.blinkInterval);
}).bind(this), this.intervalId = setInterval(function() {
l(true), h();
}, this.blinkInterval), h())) : this.$stopCssAnimation();
}, d.prototype.getPixelPosition = function(h, l) {
if (!this.config || !this.session)
return { left: 0, top: 0 };
h = h || this.session.selection.getCursor();
var n = this.session.documentToScreenPosition(h);
return { left: this.$padding + (this.session.$bidiHandler.isBidiRow(n.row, h.row) ? this.session.$bidiHandler.getPosLeft(n.column) : n.column * this.config.characterWidth), top: (n.row - (l ? this.config.firstRowScreen : 0)) * this.config.lineHeight };
}, d.prototype.isCursorInView = function(h, l) {
return 0 <= h.top && h.top < l.maxHeight;
}, d.prototype.update = function(h) {
this.config = h;
for (var l = this.session.$selectionMarkers, o = 0, n = 0, o = 0, i = (l = l !== void 0 && l.length !== 0 ? l : [{ cursor: null }]).length; o < i; o++) {
var a, r, e2 = this.getPixelPosition(l[o].cursor, true);
(e2.top > h.height + h.offset || e2.top < 0) && 1 < o || (r = (a = this.cursors[n++] || this.addCursor()).style, this.drawCursor ? this.drawCursor(a, e2, h, l[o], this.session) : this.isCursorInView(e2, h) ? (y.setStyle(r, "display", "block"), y.translate(a, e2.left, e2.top), y.setStyle(r, "width", Math.round(h.characterWidth) + "px"), y.setStyle(r, "height", h.lineHeight + "px")) : y.setStyle(r, "display", "none"));
}
for (; this.cursors.length > n; )
this.removeCursor();
var t = this.session.getOverwrite();
this.$setOverwrite(t), this.$pixelPos = e2, this.restartTimer();
}, d.prototype.$setOverwrite = function(h) {
h != this.overwrite && ((this.overwrite = h) ? y.addCssClass(this.element, "ace_overwrite-cursors") : y.removeCssClass(this.element, "ace_overwrite-cursors"));
}, d.prototype.destroy = function() {
clearInterval(this.intervalId), clearTimeout(this.timeoutId);
}, d);
function d(h) {
this.element = y.createElement("div"), this.element.className = "ace_layer ace_cursor-layer", h.appendChild(this.element), this.isVisible = false, this.isBlinking = true, this.blinkInterval = 1e3, this.smoothBlinking = false, this.cursors = [], this.cursor = this.addCursor(), y.addCssClass(this.element, "ace_hidden-cursors"), this.$updateCursors = this.$updateOpacity.bind(this);
}
C.prototype.$padding = 0, C.prototype.drawCursor = null, f.Cursor = C;
}), ace.define("ace/scrollbar", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/event", "ace/lib/event_emitter"], function(e2, f, R) {
var y, C = this && this.__extends || (y = function(s, c) {
return (y = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? function(p, g) {
p.__proto__ = g;
} : function(p, g) {
for (var b in g)
Object.prototype.hasOwnProperty.call(g, b) && (p[b] = g[b]);
}))(s, c);
}, function(s, c) {
if (typeof c != "function" && c !== null)
throw new TypeError("Class extends value " + String(c) + " is not a constructor or null");
function p() {
this.constructor = s;
}
y(s, c), s.prototype = c === null ? Object.create(c) : (p.prototype = c.prototype, new p());
}), i = e2("./lib/oop"), d = e2("./lib/dom"), h = e2("./lib/event"), e2 = e2("./lib/event_emitter").EventEmitter, l = (n.prototype.setVisible = function(s) {
this.element.style.display = s ? "" : "none", this.isVisible = s, this.coeff = 1;
}, n);
function n(s, c) {
this.element = d.createElement("div"), this.element.className = "ace_scrollbar ace_scrollbar" + c, this.inner = d.createElement("div"), this.inner.className = "ace_scrollbar-inner", this.inner.textContent = " ", this.element.appendChild(this.inner), s.appendChild(this.element), this.setVisible(false), this.skipEvent = false, h.addListener(this.element, "scroll", this.onScroll.bind(this)), h.addListener(this.element, "mousedown", h.preventDefault);
}
i.implement(l.prototype, e2), C(a, o = l), a.prototype.onScroll = function() {
var s;
this.skipEvent || (this.scrollTop = this.element.scrollTop, this.coeff != 1 && (s = this.element.clientHeight / this.scrollHeight, this.scrollTop = this.scrollTop * (1 - s) / (this.coeff - s)), this._emit("scroll", { data: this.scrollTop })), this.skipEvent = false;
}, a.prototype.getWidth = function() {
return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0);
}, a.prototype.setHeight = function(s) {
this.element.style.height = s + "px";
}, a.prototype.setScrollHeight = function(s) {
32768 < (this.scrollHeight = s) ? (this.coeff = 32768 / s, s = 32768) : this.coeff != 1 && (this.coeff = 1), this.inner.style.height = s + "px";
}, a.prototype.setScrollTop = function(s) {
this.scrollTop != s && (this.skipEvent = true, this.scrollTop = s, this.element.scrollTop = s * this.coeff);
};
var o, i = a;
function a(s, c) {
var p = o.call(this, s, "-v") || this;
return p.scrollTop = 0, p.scrollHeight = 0, c.$scrollbarWidth = p.width = d.scrollbarWidth(s.ownerDocument), p.inner.style.width = p.element.style.width = (p.width || 15) + 5 + "px", p.$minWidth = 0, p;
}
i.prototype.setInnerHeight = i.prototype.setScrollHeight, C(t, r = l), t.prototype.onScroll = function() {
this.skipEvent || (this.scrollLeft = this.element.scrollLeft, this._emit("scroll", { data: this.scrollLeft })), this.skipEvent = false;
}, t.prototype.getHeight = function() {
return this.isVisible ? this.height : 0;
}, t.prototype.setWidth = function(s) {
this.element.style.width = s + "px";
}, t.prototype.setInnerWidth = function(s) {
this.inner.style.width = s + "px";
}, t.prototype.setScrollWidth = function(s) {
this.inner.style.width = s + "px";
}, t.prototype.setScrollLeft = function(s) {
this.scrollLeft != s && (this.skipEvent = true, this.scrollLeft = this.element.scrollLeft = s);
};
var r, e2 = t;
function t(s, c) {
return s = r.call(this, s, "-h") || this, s.scrollLeft = 0, s.height = c.$scrollbarWidth, s.inner.style.height = s.element.style.height = (s.height || 15) + 5 + "px", s;
}
f.ScrollBar = i, f.ScrollBarV = i, f.ScrollBarH = e2, f.VScrollBar = i, f.HScrollBar = e2;
}), ace.define("ace/scrollbar_custom", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/event", "ace/lib/event_emitter"], function(e2, f, R) {
var y, C = this && this.__extends || (y = function(s, c) {
return (y = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? function(p, g) {
p.__proto__ = g;
} : function(p, g) {
for (var b in g)
Object.prototype.hasOwnProperty.call(g, b) && (p[b] = g[b]);
}))(s, c);
}, function(s, c) {
if (typeof c != "function" && c !== null)
throw new TypeError("Class extends value " + String(c) + " is not a constructor or null");
function p() {
this.constructor = s;
}
y(s, c), s.prototype = c === null ? Object.create(c) : (p.prototype = c.prototype, new p());
}), i = e2("./lib/oop"), d = e2("./lib/dom"), h = e2("./lib/event"), e2 = e2("./lib/event_emitter").EventEmitter, l = (d.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
position: absolute;
background: rgba(128, 128, 128, 0.6);
-moz-box-sizing: border-box;
box-sizing: border-box;
border: 1px solid #bbb;
border-radius: 2px;
z-index: 8;
}
.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {
position: absolute;
z-index: 6;
background: none;
overflow: hidden!important;
}
.ace_editor>.ace_sb-v {
z-index: 6;
right: 0;
top: 0;
width: 12px;
}
.ace_editor>.ace_sb-v div {
z-index: 8;
right: 0;
width: 100%;
}
.ace_editor>.ace_sb-h {
bottom: 0;
left: 0;
height: 12px;
}
.ace_editor>.ace_sb-h div {
bottom: 0;
height: 100%;
}
.ace_editor>.ace_sb_grabbed {
z-index: 8;
background: #000;
}`, "ace_scrollbar.css", false), n.prototype.setVisible = function(s) {
this.element.style.display = s ? "" : "none", this.isVisible = s, this.coeff = 1;
}, n);
function n(s, c) {
this.element = d.createElement("div"), this.element.className = "ace_sb" + c, this.inner = d.createElement("div"), this.inner.className = "", this.element.appendChild(this.inner), this.VScrollWidth = 12, this.HScrollHeight = 12, s.appendChild(this.element), this.setVisible(false), this.skipEvent = false, h.addMultiMouseDownListener(this.element, [500, 300, 300], this, "onMouseDown");
}
i.implement(l.prototype, e2), C(a, o = l), a.prototype.onMouseDown = function(s, c) {
var p, g, b, w, E;
if (s === "mousedown" && h.getButton(c) === 0 && c.detail !== 2)
return c.target === this.inner ? (p = this, g = c.clientY, b = c.clientY, w = this.thumbTop, h.capture(this.inner, function(M) {
g = M.clientY;
}, function() {
clearInterval(E);
}), E = setInterval(function() {
var M;
g !== void 0 && (M = p.scrollTopFromThumbTop(w + g - b)) !== p.scrollTop && p._emit("scroll", { data: M });
}, 20)) : (s = c.clientY - this.element.getBoundingClientRect().top - this.thumbHeight / 2, this._emit("scroll", { data: this.scrollTopFromThumbTop(s) })), h.preventDefault(c);
}, a.prototype.getHeight = function() {
return this.height;
}, a.prototype.scrollTopFromThumbTop = function(s) {
return s = s * (this.pageHeight - this.viewHeight) / (this.slideHeight - this.thumbHeight), (s >>= 0) < 0 ? s = 0 : s > this.pageHeight - this.viewHeight && (s = this.pageHeight - this.viewHeight), s;
}, a.prototype.getWidth = function() {
return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0);
}, a.prototype.setHeight = function(s) {
this.height = Math.max(0, s), this.slideHeight = this.height, this.viewHeight = this.height, this.setScrollHeight(this.pageHeight, true);
}, a.prototype.setScrollHeight = function(s, c) {
(this.pageHeight !== s || c) && (this.pageHeight = s, this.thumbHeight = this.slideHeight * this.viewHeight / this.pageHeight, this.thumbHeight > this.slideHeight && (this.thumbHeight = this.slideHeight), this.thumbHeight < 15 && (this.thumbHeight = 15), this.inner.style.height = this.thumbHeight + "px", this.scrollTop > this.pageHeight - this.viewHeight) && (this.scrollTop = this.pageHeight - this.viewHeight, this.scrollTop < 0 && (this.scrollTop = 0), this._emit("scroll", { data: this.scrollTop }));
}, a.prototype.setScrollTop = function(s) {
this.scrollTop = s, this.thumbTop = (s = s < 0 ? 0 : s) * (this.slideHeight - this.thumbHeight) / (this.pageHeight - this.viewHeight), this.inner.style.top = this.thumbTop + "px";
};
var o, i = a;
function a(s, c) {
var p = o.call(this, s, "-v") || this;
return p.scrollTop = 0, p.scrollHeight = 0, p.parent = s, p.width = p.VScrollWidth, p.renderer = c, p.inner.style.width = p.element.style.width = (p.width || 15) + "px", p.$minWidth = 0, p;
}
i.prototype.setInnerHeight = i.prototype.setScrollHeight, C(t, r = l), t.prototype.onMouseDown = function(s, c) {
var p, g, b, w, E;
if (s === "mousedown" && h.getButton(c) === 0 && c.detail !== 2)
return c.target === this.inner ? (p = this, g = c.clientX, b = c.clientX, w = this.thumbLeft, h.capture(this.inner, function(M) {
g = M.clientX;
}, function() {
clearInterval(E);
}), E = setInterval(function() {
var M;
g !== void 0 && (M = p.scrollLeftFromThumbLeft(w + g - b)) !== p.scrollLeft && p._emit("scroll", { data: M });
}, 20)) : (s = c.clientX - this.element.getBoundingClientRect().left - this.thumbWidth / 2, this._emit("scroll", { data: this.scrollLeftFromThumbLeft(s) })), h.preventDefault(c);
}, t.prototype.getHeight = function() {
return this.isVisible ? this.height : 0;
}, t.prototype.scrollLeftFromThumbLeft = function(s) {
return s = s * (this.pageWidth - this.viewWidth) / (this.slideWidth - this.thumbWidth), (s >>= 0) < 0 ? s = 0 : s > this.pageWidth - this.viewWidth && (s = this.pageWidth - this.viewWidth), s;
}, t.prototype.setWidth = function(s) {
this.width = Math.max(0, s), this.element.style.width = this.width + "px", this.slideWidth = this.width, this.viewWidth = this.width, this.setScrollWidth(this.pageWidth, true);
}, t.prototype.setScrollWidth = function(s, c) {
(this.pageWidth !== s || c) && (this.pageWidth = s, this.thumbWidth = this.slideWidth * this.viewWidth / this.pageWidth, this.thumbWidth > this.slideWidth && (this.thumbWidth = this.slideWidth), this.thumbWidth < 15 && (this.thumbWidth = 15), this.inner.style.width = this.thumbWidth + "px", this.scrollLeft > this.pageWidth - this.viewWidth) && (this.scrollLeft = this.pageWidth - this.viewWidth, this.scrollLeft < 0 && (this.scrollLeft = 0), this._emit("scroll", { data: this.scrollLeft }));
}, t.prototype.setScrollLeft = function(s) {
this.scrollLeft = s, this.thumbLeft = (s = s < 0 ? 0 : s) * (this.slideWidth - this.thumbWidth) / (this.pageWidth - this.viewWidth), this.inner.style.left = this.thumbLeft + "px";
};
var r, e2 = t;
function t(s, c) {
return s = r.call(this, s, "-h") || this, s.scrollLeft = 0, s.scrollWidth = 0, s.height = s.HScrollHeight, s.inner.style.height = s.element.style.height = (s.height || 12) + "px", s.renderer = c, s;
}
e2.prototype.setInnerWidth = e2.prototype.setScrollWidth, f.ScrollBar = i, f.ScrollBarV = i, f.ScrollBarH = e2, f.VScrollBar = i, f.HScrollBar = e2;
}), ace.define("ace/renderloop", ["require", "exports", "module", "ace/lib/event"], function(A, f, R) {
var y = A("./lib/event");
function C(d, h) {
this.onRender = d, this.pending = false, this.changes = 0, this.$recursionLimit = 2, this.window = h || window;
var l = this;
this._flush = function(n) {
l.pending = false;
var o = l.changes;
o && (y.blockIdle(100), l.changes = 0, l.onRender(o)), l.changes ? l.$recursionLimit-- < 0 || l.schedule() : l.$recursionLimit = 2;
};
}
C.prototype.schedule = function(d) {
this.changes = this.changes | d, this.changes && !this.pending && (y.nextFrame(this._flush), this.pending = true);
}, C.prototype.clear = function(d) {
var h = this.changes;
return this.changes = 0, h;
}, f.RenderLoop = C;
}), ace.define("ace/layer/font_metrics", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/lang", "ace/lib/event", "ace/lib/useragent", "ace/lib/event_emitter"], function(n, f, R) {
var y = n("../lib/oop"), C = n("../lib/dom"), d = n("../lib/lang"), h = n("../lib/event"), l = n("../lib/useragent"), n = n("../lib/event_emitter").EventEmitter, o = typeof ResizeObserver == "function", i = (a.prototype.$setMeasureNodeStyles = function(r, e2) {
r.width = r.height = "auto", r.left = r.top = "0px", r.visibility = "hidden", r.position = "absolute", r.whiteSpace = "pre", l.isIE < 8 ? r["font-family"] = "inherit" : r.font = "inherit", r.overflow = e2 ? "hidden" : "visible";
}, a.prototype.checkForSizeChanges = function(r) {
var e2;
!(r = r === void 0 ? this.$measureSizes() : r) || this.$characterSize.width === r.width && this.$characterSize.height === r.height || (this.$measureNode.style.fontWeight = "bold", e2 = this.$measureSizes(), this.$measureNode.style.fontWeight = "", this.$characterSize = r, this.charSizes = /* @__PURE__ */ Object.create(null), this.allowBoldFonts = e2 && e2.width === r.width && e2.height === r.height, this._emit("changeCharacterSize", { data: r }));
}, a.prototype.$addObserver = function() {
var r = this;
this.$observer = new window.ResizeObserver(function(e2) {
r.checkForSizeChanges();
}), this.$observer.observe(this.$measureNode);
}, a.prototype.$pollSizeChanges = function() {
var r;
return this.$pollSizeChangesTimer || this.$observer ? this.$pollSizeChangesTimer : (r = this).$pollSizeChangesTimer = h.onIdle(function e2() {
r.checkForSizeChanges(), h.onIdle(e2, 500);
}, 500);
}, a.prototype.setPolling = function(r) {
r ? this.$pollSizeChanges() : this.$pollSizeChangesTimer && (clearInterval(this.$pollSizeChangesTimer), this.$pollSizeChangesTimer = 0);
}, a.prototype.$measureSizes = function(r) {
return r = { height: (r || this.$measureNode).clientHeight, width: (r || this.$measureNode).clientWidth / 512 }, r.width === 0 || r.height === 0 ? null : r;
}, a.prototype.$measureCharWidth = function(r) {
return this.$main.textContent = d.stringRepeat(r, 512), this.$main.getBoundingClientRect().width / 512;
}, a.prototype.getCharacterWidth = function(r) {
var e2 = this.charSizes[r];
return e2 = e2 === void 0 ? this.charSizes[r] = this.$measureCharWidth(r) / this.$characterSize.width : e2;
}, a.prototype.destroy = function() {
clearInterval(this.$pollSizeChangesTimer), this.$observer && this.$observer.disconnect(), this.el && this.el.parentNode && this.el.parentNode.removeChild(this.el);
}, a.prototype.$getZoom = function(r) {
return r && r.parentElement ? (window.getComputedStyle(r).zoom || 1) * this.$getZoom(r.parentElement) : 1;
}, a.prototype.$initTransformMeasureNodes = function() {
function r(e2, t) {
return ["div", { style: "position: absolute;top:" + e2 + "px;left:" + t + "px;" }];
}
this.els = C.buildDom([r(0, 0), r(200, 0), r(0, 200), r(200, 200)], this.el);
}, a.prototype.transformCoordinates = function(r, e2) {
function t(Z, k, u) {
var _ = Z[1] * k[0] - Z[0] * k[1];
return [(-k[1] * u[0] + k[0] * u[1]) / _, (+Z[1] * u[0] - Z[0] * u[1]) / _];
}
function s(Z, k) {
return [Z[0] - k[0], Z[1] - k[1]];
}
function c(Z, k) {
return [Z[0] + k[0], Z[1] + k[1]];
}
function p(Z, k) {
return [Z * k[0], Z * k[1]];
}
function g(Z) {
return Z = Z.getBoundingClientRect(), [Z.left, Z.top];
}
r = r && p(1 / this.$getZoom(this.el), r), this.els || this.$initTransformMeasureNodes();
var b, w = g(this.els[0]), M = g(this.els[1]), B2 = g(this.els[2]), E = g(this.els[3]), E = t(s(E, M), s(E, B2), s(c(M, B2), c(E, w))), M = p(1 + E[0], s(M, w)), B2 = p(1 + E[1], s(B2, w));
return e2 ? (b = E[0] * e2[0] / 200 + E[1] * e2[1] / 200 + 1, e2 = c(p(e2[0], M), p(e2[1], B2)), c(p(1 / b / 200, e2), w)) : (b = s(r, w), e2 = t(s(M, p(E[0], b)), s(B2, p(E[1], b)), b), p(200, e2));
}, a);
function a(r) {
this.el = C.createElement("div"), this.$setMeasureNodeStyles(this.el.style, true), this.$main = C.createElement("div"), this.$setMeasureNodeStyles(this.$main.style), this.$measureNode = C.createElement("div"), this.$setMeasureNodeStyles(this.$measureNode.style), this.el.appendChild(this.$main), this.el.appendChild(this.$measureNode), r.appendChild(this.el), this.$measureNode.textContent = d.stringRepeat("X", 512), this.$characterSize = { width: 0, height: 0 }, o ? this.$addObserver() : this.checkForSizeChanges();
}
i.prototype.$characterSize = { width: 0, height: 0 }, y.implement(i.prototype, n), f.FontMetrics = i;
}), ace.define("ace/css/editor-css", ["require", "exports", "module"], function(A, f, R) {
R.exports = `
.ace_br1 {border-top-left-radius : 3px;}
.ace_br2 {border-top-right-radius : 3px;}
.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
.ace_br4 {border-bottom-right-radius: 3px;}
.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}
.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}
.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}
.ace_br8 {border-bottom-left-radius : 3px;}
.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}
.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}
.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}
.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
.ace_editor {
position: relative;
overflow: hidden;
padding: 0;
font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace;
direction: ltr;
text-align: left;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.ace_scroller {
position: absolute;
overflow: hidden;
top: 0;
bottom: 0;
background-color: inherit;
-ms-user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
cursor: text;
}
.ace_content {
position: absolute;
box-sizing: border-box;
min-width: 100%;
contain: style size layout;
font-variant-ligatures: no-common-ligatures;
}
.ace_keyboard-focus:focus {
box-shadow: inset 0 0 0 2px #5E9ED6;
outline: none;
}
.ace_dragging .ace_scroller:before{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
content: '';
background: rgba(250, 250, 250, 0.01);
z-index: 1000;
}
.ace_dragging.ace_dark .ace_scroller:before{
background: rgba(0, 0, 0, 0.01);
}
.ace_gutter {
position: absolute;
overflow : hidden;
width: auto;
top: 0;
bottom: 0;
left: 0;
cursor: default;
z-index: 4;
-ms-user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
contain: style size layout;
}
.ace_gutter-active-line {
position: absolute;
left: 0;
right: 0;
}
.ace_scroller.ace_scroll-left:after {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
pointer-events: none;
}
.ace_gutter-cell, .ace_gutter-cell_svg-icons {
position: absolute;
top: 0;
left: 0;
right: 0;
padding-left: 19px;
padding-right: 6px;
background-repeat: no-repeat;
}
.ace_gutter-cell_svg-icons .ace_gutter_annotation {
margin-left: -14px;
float: left;
}
.ace_gutter-cell .ace_gutter_annotation {
margin-left: -19px;
float: left;
}
.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");
background-repeat: no-repeat;
background-position: 2px center;
}
.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");
background-repeat: no-repeat;
background-position: 2px center;
}
.ace_gutter-cell.ace_info, .ace_icon.ace_info {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");
background-repeat: no-repeat;
background-position: 2px center;
}
.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");
}
.ace_icon_svg.ace_error {
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+");
background-color: crimson;
}
.ace_icon_svg.ace_warning {
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==");
background-color: darkorange;
}
.ace_icon_svg.ace_info {
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==");
background-color: royalblue;
}
.ace_icon_svg.ace_error_fold {
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
background-color: crimson;
}
.ace_icon_svg.ace_warning_fold {
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=");
background-color: darkorange;
}
.ace_scrollbar {
contain: strict;
position: absolute;
right: 0;
bottom: 0;
z-index: 6;
}
.ace_scrollbar-inner {
position: absolute;
cursor: text;
left: 0;
top: 0;
}
.ace_scrollbar-v{
overflow-x: hidden;
overflow-y: scroll;
top: 0;
}
.ace_scrollbar-h {
overflow-x: scroll;
overflow-y: hidden;
left: 0;
}
.ace_print-margin {
position: absolute;
height: 100%;
}
.ace_text-input {
position: absolute;
z-index: 0;
width: 0.5em;
height: 1em;
opacity: 0;
background: transparent;
-moz-appearance: none;
appearance: none;
border: none;
resize: none;
outline: none;
overflow: hidden;
font: inherit;
padding: 0 1px;
margin: 0 -1px;
contain: strict;
-ms-user-select: text;
-moz-user-select: text;
-webkit-user-select: text;
user-select: text;
/*with \`pre-line\` chrome inserts instead of space*/
white-space: pre!important;
}
.ace_text-input.ace_composition {
background: transparent;
color: inherit;
z-index: 1000;
opacity: 1;
}
.ace_composition_placeholder { color: transparent }
.ace_composition_marker {
border-bottom: 1px solid;
position: absolute;
border-radius: 0;
margin-top: 1px;
}
[ace_nocontext=true] {
transform: none!important;
filter: none!important;
clip-path: none!important;
mask : none!important;
contain: none!important;
perspective: none!important;
mix-blend-mode: initial!important;
z-index: auto;
}
.ace_layer {
z-index: 1;
position: absolute;
overflow: hidden;
/* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/
word-wrap: normal;
white-space: pre;
height: 100%;
width: 100%;
box-sizing: border-box;
/* setting pointer-events: auto; on node under the mouse, which changes
during scroll, will break mouse wheel scrolling in Safari */
pointer-events: none;
}
.ace_gutter-layer {
position: relative;
width: auto;
text-align: right;
pointer-events: auto;
height: 1000000px;
contain: style size layout;
}
.ace_text-layer {
font: inherit !important;
position: absolute;
height: 1000000px;
width: 1000000px;
contain: style size layout;
}
.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {
contain: style size layout;
position: absolute;
top: 0;
left: 0;
right: 0;
}
.ace_hidpi .ace_text-layer,
.ace_hidpi .ace_gutter-layer,
.ace_hidpi .ace_content,
.ace_hidpi .ace_gutter {
contain: strict;
}
.ace_hidpi .ace_text-layer > .ace_line,
.ace_hidpi .ace_text-layer > .ace_line_group {
contain: strict;
}
.ace_cjk {
display: inline-block;
text-align: center;
}
.ace_cursor-layer {
z-index: 4;
}
.ace_cursor {
z-index: 4;
position: absolute;
box-sizing: border-box;
border-left: 2px solid;
/* workaround for smooth cursor repaintng whole screen in chrome */
transform: translatez(0);
}
.ace_multiselect .ace_cursor {
border-left-width: 1px;
}
.ace_slim-cursors .ace_cursor {
border-left-width: 1px;
}
.ace_overwrite-cursors .ace_cursor {
border-left-width: 0;
border-bottom: 1px solid;
}
.ace_hidden-cursors .ace_cursor {
opacity: 0.2;
}
.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {
opacity: 0;
}
.ace_smooth-blinking .ace_cursor {
transition: opacity 0.18s;
}
.ace_animate-blinking .ace_cursor {
animation-duration: 1000ms;
animation-timing-function: step-end;
animation-name: blink-ace-animate;
animation-iteration-count: infinite;
}
.ace_animate-blinking.ace_smooth-blinking .ace_cursor {
animation-duration: 1000ms;
animation-timing-function: ease-in-out;
animation-name: blink-ace-animate-smooth;
}
@keyframes blink-ace-animate {
from, to { opacity: 1; }
60% { opacity: 0; }
}
@keyframes blink-ace-animate-smooth {
from, to { opacity: 1; }
45% { opacity: 1; }
60% { opacity: 0; }
85% { opacity: 0; }
}
.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {
position: absolute;
z-index: 3;
}
.ace_marker-layer .ace_selection {
position: absolute;
z-index: 5;
}
.ace_marker-layer .ace_bracket {
position: absolute;
z-index: 6;
}
.ace_marker-layer .ace_error_bracket {
position: absolute;
border-bottom: 1px solid #DE5555;
border-radius: 0;
}
.ace_marker-layer .ace_active-line {
position: absolute;
z-index: 2;
}
.ace_marker-layer .ace_selected-word {
position: absolute;
z-index: 4;
box-sizing: border-box;
}
.ace_line .ace_fold {
box-sizing: border-box;
display: inline-block;
height: 11px;
margin-top: -2px;
vertical-align: middle;
background-image:
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");
background-repeat: no-repeat, repeat-x;
background-position: center center, top left;
color: transparent;
border: 1px solid black;
border-radius: 2px;
cursor: pointer;
pointer-events: auto;
}
.ace_dark .ace_fold {
}
.ace_fold:hover{
background-image:
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");
}
.ace_tooltip {
background-color: #f5f5f5;
border: 1px solid gray;
border-radius: 1px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
color: black;
max-width: 100%;
padding: 3px 4px;
position: fixed;
z-index: 999999;
box-sizing: border-box;
cursor: default;
white-space: pre;
word-wrap: break-word;
line-height: normal;
font-style: normal;
font-weight: normal;
letter-spacing: normal;
pointer-events: none;
}
.ace_tooltip.ace_dark {
background-color: #636363;
color: #fff;
}
.ace_tooltip:focus {
outline: 1px solid #5E9ED6;
}
.ace_icon {
display: inline-block;
width: 18px;
vertical-align: top;
}
.ace_icon_svg {
display: inline-block;
width: 12px;
vertical-align: top;
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: 12px;
-webkit-mask-position: center;
}
.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {
padding-right: 13px;
}
.ace_fold-widget {
box-sizing: border-box;
margin: 0 -12px 0 1px;
display: none;
width: 11px;
vertical-align: top;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");
background-repeat: no-repeat;
background-position: center;
border-radius: 3px;
border: 1px solid transparent;
cursor: pointer;
}
.ace_folding-enabled .ace_fold-widget {
display: inline-block;
}
.ace_fold-widget.ace_end {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");
}
.ace_fold-widget.ace_closed {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");
}
.ace_fold-widget:hover {
border: 1px solid rgba(0, 0, 0, 0.3);
background-color: rgba(255, 255, 255, 0.2);
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}
.ace_fold-widget:active {
border: 1px solid rgba(0, 0, 0, 0.4);
background-color: rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}
/**
* Dark version for fold widgets
*/
.ace_dark .ace_fold-widget {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");
}
.ace_dark .ace_fold-widget.ace_end {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");
}
.ace_dark .ace_fold-widget.ace_closed {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");
}
.ace_dark .ace_fold-widget:hover {
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
background-color: rgba(255, 255, 255, 0.1);
}
.ace_dark .ace_fold-widget:active {
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
}
.ace_inline_button {
border: 1px solid lightgray;
display: inline-block;
margin: -1px 8px;
padding: 0 5px;
pointer-events: auto;
cursor: pointer;
}
.ace_inline_button:hover {
border-color: gray;
background: rgba(200,200,200,0.2);
display: inline-block;
pointer-events: auto;
}
.ace_fold-widget.ace_invalid {
background-color: #FFB4B4;
border-color: #DE5555;
}
.ace_fade-fold-widgets .ace_fold-widget {
transition: opacity 0.4s ease 0.05s;
opacity: 0;
}
.ace_fade-fold-widgets:hover .ace_fold-widget {
transition: opacity 0.05s ease 0.05s;
opacity:1;
}
.ace_underline {
text-decoration: underline;
}
.ace_bold {
font-weight: bold;
}
.ace_nobold .ace_bold {
font-weight: normal;
}
.ace_italic {
font-style: italic;
}
.ace_error-marker {
background-color: rgba(255, 0, 0,0.2);
position: absolute;
z-index: 9;
}
.ace_highlight-marker {
background-color: rgba(255, 255, 0,0.2);
position: absolute;
z-index: 8;
}
.ace_mobile-menu {
position: absolute;
line-height: 1.5;
border-radius: 4px;
-ms-user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
background: white;
box-shadow: 1px 3px 2px grey;
border: 1px solid #dcdcdc;
color: black;
}
.ace_dark > .ace_mobile-menu {
background: #333;
color: #ccc;
box-shadow: 1px 3px 2px grey;
border: 1px solid #444;
}
.ace_mobile-button {
padding: 2px;
cursor: pointer;
overflow: hidden;
}
.ace_mobile-button:hover {
background-color: #eee;
opacity:1;
}
.ace_mobile-button:active {
background-color: #ddd;
}
.ace_placeholder {
font-family: arial;
transform: scale(0.9);
transform-origin: left;
white-space: pre;
opacity: 0.7;
margin: 0 10px;
}
.ace_ghost_text {
opacity: 0.5;
font-style: italic;
white-space: pre;
}
.ace_screenreader-only {
position:absolute;
left:-10000px;
top:auto;
width:1px;
height:1px;
overflow:hidden;
}`;
}), ace.define("ace/layer/decorators", ["require", "exports", "module", "ace/lib/dom", "ace/lib/oop", "ace/lib/event_emitter"], function(d, f, R) {
var y = d("../lib/dom"), C = d("../lib/oop"), d = d("../lib/event_emitter").EventEmitter, h = (l.prototype.$updateDecorators = function(n) {
var o = this.renderer.theme.isDark === true ? this.colors.dark : this.colors.light, i = (n && (this.maxHeight = n.maxHeight, this.lineHeight = n.lineHeight, this.canvasHeight = n.height, (n.lastRow + 1) * this.lineHeight < this.canvasHeight ? this.heightRatio = 1 : this.heightRatio = this.canvasHeight / this.maxHeight), this.canvas.getContext("2d")), a = this.renderer.session.$annotations;
if (i.clearRect(0, 0, this.canvas.width, this.canvas.height), a)
for (var r = { info: 1, warning: 2, error: 3 }, e2 = (a.forEach(function(w) {
w.priority = r[w.type] || null;
}), a = a.sort(function(w, E) {
return w.priority < E.priority ? -1 : w.priority > E.priority ? 1 : 0;
}), this.renderer.session.$foldData), t = 0; t < a.length; t++) {
var s, b = a[t].row, c = this.compensateFoldRows(b, e2), p = Math.round((b - c) * this.lineHeight * this.heightRatio), g = Math.round((b - c) * this.lineHeight * this.heightRatio), b = Math.round(((b - c) * this.lineHeight + this.lineHeight) * this.heightRatio);
b - g < this.minDecorationHeight && ((s = (g + b) / 2 | 0) < this.halfMinDecorationHeight ? s = this.halfMinDecorationHeight : s + this.halfMinDecorationHeight > this.canvasHeight && (s = this.canvasHeight - this.halfMinDecorationHeight), g = Math.round(s - this.halfMinDecorationHeight), b = Math.round(s + this.halfMinDecorationHeight)), i.fillStyle = o[a[t].type] || null, i.fillRect(0, p, this.canvasWidth, b - g);
}
n = this.renderer.session.selection.getCursor(), n && (c = this.compensateFoldRows(n.row, e2), p = Math.round((n.row - c) * this.lineHeight * this.heightRatio), i.fillStyle = "rgba(0, 0, 0, 0.5)", i.fillRect(0, p, this.canvasWidth, 2));
}, l.prototype.compensateFoldRows = function(n, o) {
var i = 0;
if (o && 0 < o.length)
for (var a = 0; a < o.length; a++)
n > o[a].start.row && n < o[a].end.row ? i += n - o[a].start.row : n >= o[a].end.row && (i += o[a].end.row - o[a].start.row);
return i;
}, l);
function l(n, o) {
this.canvas = y.createElement("canvas"), this.renderer = o, this.pixelRatio = 1, this.maxHeight = o.layerConfig.maxHeight, this.lineHeight = o.layerConfig.lineHeight, this.canvasHeight = n.parent.scrollHeight, this.heightRatio = this.canvasHeight / this.maxHeight, this.canvasWidth = n.width, this.minDecorationHeight = 2 * this.pixelRatio | 0, this.halfMinDecorationHeight = this.minDecorationHeight / 2 | 0, this.canvas.width = this.canvasWidth, this.canvas.height = this.canvasHeight, this.canvas.style.top = "0px", this.canvas.style.right = "0px", this.canvas.style.zIndex = "7px", this.canvas.style.position = "absolute", this.colors = {}, this.colors.dark = { error: "rgba(255, 18, 18, 1)", warning: "rgba(18, 136, 18, 1)", info: "rgba(18, 18, 136, 1)" }, this.colors.light = { error: "rgb(255,51,51)", warning: "rgb(32,133,72)", info: "rgb(35,68,138)" }, n.element.appendChild(this.canvas);
}
C.implement(h.prototype, d), f.Decorator = h;
}), ace.define("ace/virtual_renderer", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/lang", "ace/config", "ace/layer/gutter", "ace/layer/marker", "ace/layer/text", "ace/layer/cursor", "ace/scrollbar", "ace/scrollbar", "ace/scrollbar_custom", "ace/scrollbar_custom", "ace/renderloop", "ace/layer/font_metrics", "ace/lib/event_emitter", "ace/css/editor-css", "ace/layer/decorators", "ace/lib/useragent"], function(E, f, R) {
var y = E("./lib/oop"), C = E("./lib/dom"), d = E("./lib/lang"), h = E("./config"), l = E("./layer/gutter").Gutter, n = E("./layer/marker").Marker, o = E("./layer/text").Text, i = E("./layer/cursor").Cursor, a = E("./scrollbar").HScrollBar, r = E("./scrollbar").VScrollBar, e2 = E("./scrollbar_custom").HScrollBar, t = E("./scrollbar_custom").VScrollBar, s = E("./renderloop").RenderLoop, c = E("./layer/font_metrics").FontMetrics, p = E("./lib/event_emitter").EventEmitter, g = E("./css/editor-css"), b = E("./layer/decorators").Decorator, w = E("./lib/useragent"), E = (C.importCssString(g, "ace_editor.css", false), M.prototype.updateCharacterSize = function() {
this.$textLayer.allowBoldFonts != this.$allowBoldFonts && (this.$allowBoldFonts = this.$textLayer.allowBoldFonts, this.setStyle("ace_nobold", !this.$allowBoldFonts)), this.layerConfig.characterWidth = this.characterWidth = this.$textLayer.getCharacterWidth(), this.layerConfig.lineHeight = this.lineHeight = this.$textLayer.getLineHeight(), this.$updatePrintMargin(), C.setStyle(this.scroller.style, "line-height", this.lineHeight + "px");
}, M.prototype.setSession = function(B2) {
this.session && this.session.doc.off("changeNewLineMode", this.onChangeNewLineMode), (this.session = B2) && this.scrollMargin.top && B2.getScrollTop() <= 0 && B2.setScrollTop(-this.scrollMargin.top), this.$cursorLayer.setSession(B2), this.$markerBack.setSession(B2), this.$markerFront.setSession(B2), this.$gutterLayer.setSession(B2), this.$textLayer.setSession(B2), B2 && (this.$loop.schedule(this.CHANGE_FULL), this.session.$setFontMetrics(this.$fontMetrics), this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null, this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this), this.onChangeNewLineMode(), this.session.doc.on("changeNewLineMode", this.onChangeNewLineMode));
}, M.prototype.updateLines = function(B2, Z, k) {
if (Z === void 0 && (Z = 1 / 0), this.$changedLines ? (this.$changedLines.firstRow > B2 && (this.$changedLines.firstRow = B2), this.$changedLines.lastRow < Z && (this.$changedLines.lastRow = Z)) : this.$changedLines = { firstRow: B2, lastRow: Z }, this.$changedLines.lastRow < this.layerConfig.firstRow) {
if (!k)
return;
this.$changedLines.lastRow = this.layerConfig.lastRow;
}
this.$changedLines.firstRow > this.layerConfig.lastRow || this.$loop.schedule(this.CHANGE_LINES);
}, M.prototype.onChangeNewLineMode = function() {
this.$loop.schedule(this.CHANGE_TEXT), this.$textLayer.$updateEolChar(), this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR);
}, M.prototype.onChangeTabSize = function() {
this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER), this.$textLayer.onChangeTabSize();
}, M.prototype.updateText = function() {
this.$loop.schedule(this.CHANGE_TEXT);
}, M.prototype.updateFull = function(B2) {
B2 ? this.$renderChanges(this.CHANGE_FULL, true) : this.$loop.schedule(this.CHANGE_FULL);
}, M.prototype.updateFontSize = function() {
this.$textLayer.checkForSizeChanges();
}, M.prototype.$updateSizeAsync = function() {
this.$loop.pending ? this.$size.$dirty = true : this.onResize();
}, M.prototype.onResize = function(B2, Z, k, u) {
if (!(2 < this.resizing)) {
0 < this.resizing ? this.resizing++ : this.resizing = B2 ? 1 : 0;
var _ = this.container, _ = (u = u || _.clientHeight || _.scrollHeight, k = k || _.clientWidth || _.scrollWidth, this.$updateCachedSize(B2, Z, k, u));
if (this.$resizeTimer && this.$resizeTimer.cancel(), !this.$size.scrollerHeight || !k && !u)
return this.resizing = 0;
B2 && (this.$gutterLayer.$padding = null), B2 ? this.$renderChanges(_ | this.$changes, true) : this.$loop.schedule(_ | this.$changes), this.resizing && (this.resizing = 0), this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null, this.$customScrollbar && this.$updateCustomScrollbar(true);
}
}, M.prototype.$updateCachedSize = function(B2, Z, k, u) {
u -= this.$extraHeight || 0;
var _ = 0, v = this.$size, $ = { width: v.width, height: v.height, scrollerHeight: v.scrollerHeight, scrollerWidth: v.scrollerWidth };
return u && (B2 || v.height != u) && (v.height = u, _ |= this.CHANGE_SIZE, v.scrollerHeight = v.height, this.$horizScroll && (v.scrollerHeight -= this.scrollBarH.getHeight()), this.scrollBarV.setHeight(v.scrollerHeight), this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + "px", _ |= this.CHANGE_SCROLL), k && (B2 || v.width != k) && (_ |= this.CHANGE_SIZE, v.width = k, Z == null && (Z = this.$showGutter ? this.$gutter.offsetWidth : 0), this.gutterWidth = Z, C.setStyle(this.scrollBarH.element.style, "left", Z + "px"), C.setStyle(this.scroller.style, "left", Z + this.margin.left + "px"), v.scrollerWidth = Math.max(0, k - Z - this.scrollBarV.getWidth() - this.margin.h), C.setStyle(this.$gutter.style, "left", this.margin.left + "px"), Z = this.scrollBarV.getWidth() + "px", C.setStyle(this.scrollBarH.element.style, "right", Z), C.setStyle(this.scroller.style, "right", Z), C.setStyle(this.scroller.style, "bottom", this.scrollBarH.getHeight()), this.scrollBarH.setWidth(v.scrollerWidth), this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || B2) && (_ |= this.CHANGE_FULL), v.$dirty = !k || !u, _ && this._signal("resize", $), _;
}, M.prototype.onGutterResize = function(B2) {
B2 = this.$showGutter ? B2 : 0, B2 != this.gutterWidth && (this.$changes |= this.$updateCachedSize(true, B2, this.$size.width, this.$size.height)), this.session.getUseWrapMode() && this.adjustWrapLimit() || this.$size.$dirty ? this.$loop.schedule(this.CHANGE_FULL) : this.$computeLayerConfig();
}, M.prototype.adjustWrapLimit = function() {
var B2 = this.$size.scrollerWidth - 2 * this.$padding, B2 = Math.floor(B2 / this.characterWidth);
return this.session.adjustWrapLimit(B2, this.$showPrintMargin && this.$printMarginColumn);
}, M.prototype.setAnimatedScroll = function(B2) {
this.setOption("animatedScroll", B2);
}, M.prototype.getAnimatedScroll = function() {
return this.$animatedScroll;
}, M.prototype.setShowInvisibles = function(B2) {
this.setOption("showInvisibles", B2), this.session.$bidiHandler.setShowInvisibles(B2);
}, M.prototype.getShowInvisibles = function() {
return this.getOption("showInvisibles");
}, M.prototype.getDisplayIndentGuides = function() {
return this.getOption("displayIndentGuides");
}, M.prototype.setDisplayIndentGuides = function(B2) {
this.setOption("displayIndentGuides", B2);
}, M.prototype.getHighlightIndentGuides = function() {
return this.getOption("highlightIndentGuides");
}, M.prototype.setHighlightIndentGuides = function(B2) {
this.setOption("highlightIndentGuides", B2);
}, M.prototype.setShowPrintMargin = function(B2) {
this.setOption("showPrintMargin", B2);
}, M.prototype.getShowPrintMargin = function() {
return this.getOption("showPrintMargin");
}, M.prototype.setPrintMarginColumn = function(B2) {
this.setOption("printMarginColumn", B2);
}, M.prototype.getPrintMarginColumn = function() {
return this.getOption("printMarginColumn");
}, M.prototype.getShowGutter = function() {
return this.getOption("showGutter");
}, M.prototype.setShowGutter = function(B2) {
return this.setOption("showGutter", B2);
}, M.prototype.getFadeFoldWidgets = function() {
return this.getOption("fadeFoldWidgets");
}, M.prototype.setFadeFoldWidgets = function(B2) {
this.setOption("fadeFoldWidgets", B2);
}, M.prototype.setHighlightGutterLine = function(B2) {
this.setOption("highlightGutterLine", B2);
}, M.prototype.getHighlightGutterLine = function() {
return this.getOption("highlightGutterLine");
}, M.prototype.$updatePrintMargin = function() {
var B2;
(this.$showPrintMargin || this.$printMarginEl) && (this.$printMarginEl || ((B2 = C.createElement("div")).className = "ace_layer ace_print-margin-layer", this.$printMarginEl = C.createElement("div"), this.$printMarginEl.className = "ace_print-margin", B2.appendChild(this.$printMarginEl), this.content.insertBefore(B2, this.content.firstChild)), (B2 = this.$printMarginEl.style).left = Math.round(this.characterWidth * this.$printMarginColumn + this.$padding) + "px", B2.visibility = this.$showPrintMargin ? "visible" : "hidden", this.session) && this.session.$wrap == -1 && this.adjustWrapLimit();
}, M.prototype.getContainerElement = function() {
return this.container;
}, M.prototype.getMouseEventTarget = function() {
return this.scroller;
}, M.prototype.getTextAreaContainer = function() {
return this.container;
}, M.prototype.$moveTextAreaToCursor = function() {
var B2, Z, k, u, _, v, $;
this.$isMousePressed || (B2 = this.textarea.style, v = this.$composition, this.$keepTextAreaAtCursor || v ? (k = this.$cursorLayer.$pixelPos) && (v && v.markerRange && (k = this.$cursorLayer.getPixelPosition(v.markerRange.start, true)), $ = this.layerConfig, Z = k.top, k = k.left, Z -= $.offset, u = v && v.useTextareaForIME || w.isMobile ? this.lineHeight : 1, Z < 0 || Z > $.height - u ? C.translate(this.textarea, 0, 0) : ($ = 1, _ = this.$size.height - u, v ? v.useTextareaForIME ? (v = this.textarea.value, $ = this.characterWidth * this.session.$getStringScreenWidth(v)[0]) : Z += this.lineHeight + 2 : Z += this.lineHeight, (k -= this.scrollLeft) > this.$size.scrollerWidth - $ && (k = this.$size.scrollerWidth - $), k += this.gutterWidth + this.margin.left, C.setStyle(B2, "height", u + "px"), C.setStyle(B2, "width", $ + "px"), C.translate(this.textarea, Math.min(k, this.$size.scrollerWidth - $), Math.min(Z, _)))) : C.translate(this.textarea, -100, 0));
}, M.prototype.getFirstVisibleRow = function() {
return this.layerConfig.firstRow;
}, M.prototype.getFirstFullyVisibleRow = function() {
return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1);
}, M.prototype.getLastFullyVisibleRow = function() {
var B2 = this.layerConfig, Z = B2.lastRow;
return this.session.documentToScreenRow(Z, 0) * B2.lineHeight - this.session.getScrollTop() > B2.height - B2.lineHeight ? Z - 1 : Z;
}, M.prototype.getLastVisibleRow = function() {
return this.layerConfig.lastRow;
}, M.prototype.setPadding = function(B2) {
this.$padding = B2, this.$textLayer.setPadding(B2), this.$cursorLayer.setPadding(B2), this.$markerFront.setPadding(B2), this.$markerBack.setPadding(B2), this.$loop.schedule(this.CHANGE_FULL), this.$updatePrintMargin();
}, M.prototype.setScrollMargin = function(B2, Z, k, u) {
var _ = this.scrollMargin;
_.top = 0 | B2, _.bottom = 0 | Z, _.right = 0 | u, _.left = 0 | k, _.v = _.top + _.bottom, _.h = _.left + _.right, _.top && this.scrollTop <= 0 && this.session && this.session.setScrollTop(-_.top), this.updateFull();
}, M.prototype.setMargin = function(B2, Z, k, u) {
var _ = this.margin;
_.top = 0 | B2, _.bottom = 0 | Z, _.right = 0 | u, _.left = 0 | k, _.v = _.top + _.bottom, _.h = _.left + _.right, this.$updateCachedSize(true, this.gutterWidth, this.$size.width, this.$size.height), this.updateFull();
}, M.prototype.getHScrollBarAlwaysVisible = function() {
return this.$hScrollBarAlwaysVisible;
}, M.prototype.setHScrollBarAlwaysVisible = function(B2) {
this.setOption("hScrollBarAlwaysVisible", B2);
}, M.prototype.getVScrollBarAlwaysVisible = function() {
return this.$vScrollBarAlwaysVisible;
}, M.prototype.setVScrollBarAlwaysVisible = function(B2) {
this.setOption("vScrollBarAlwaysVisible", B2);
}, M.prototype.$updateScrollBarV = function() {
var B2 = this.layerConfig.maxHeight, Z = this.$size.scrollerHeight;
!this.$maxLines && this.$scrollPastEnd && (B2 -= (Z - this.lineHeight) * this.$scrollPastEnd, this.scrollTop > B2 - Z) && (B2 = this.scrollTop + Z, this.scrollBarV.scrollTop = null), this.scrollBarV.setScrollHeight(B2 + this.scrollMargin.v), this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top);
}, M.prototype.$updateScrollBarH = function() {
this.scrollBarH.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h), this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left);
}, M.prototype.freeze = function() {
this.$frozen = true;
}, M.prototype.unfreeze = function() {
this.$frozen = false;
}, M.prototype.$renderChanges = function(B2, Z) {
if (this.$changes && (B2 |= this.$changes, this.$changes = 0), this.session && this.container.offsetWidth && !this.$frozen && (B2 || Z)) {
if (this.$size.$dirty)
return this.$changes |= B2, this.onResize(true);
this.lineHeight || this.$textLayer.checkForSizeChanges(), this._signal("beforeRender", B2), this.session && this.session.$bidiHandler && this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);
var k, u, Z = this.layerConfig;
(B2 & this.CHANGE_FULL || B2 & this.CHANGE_SIZE || B2 & this.CHANGE_TEXT || B2 & this.CHANGE_LINES || B2 & this.CHANGE_SCROLL || B2 & this.CHANGE_H_SCROLL) && (B2 |= this.$computeLayerConfig() | this.$loop.clear(), Z.firstRow != this.layerConfig.firstRow && Z.firstRowScreen == this.layerConfig.firstRowScreen && 0 < (k = this.scrollTop + (Z.firstRow - Math.max(this.layerConfig.firstRow, 0)) * this.lineHeight) && (this.scrollTop = k, B2 = (B2 |= this.CHANGE_SCROLL) | (this.$computeLayerConfig() | this.$loop.clear())), Z = this.layerConfig, this.$updateScrollBarV(), B2 & this.CHANGE_H_SCROLL && this.$updateScrollBarH(), C.translate(this.content, -this.scrollLeft, -Z.offset), k = Z.width + 2 * this.$padding + "px", u = Z.minHeight + "px", C.setStyle(this.content.style, "width", k), C.setStyle(this.content.style, "height", u)), B2 & this.CHANGE_H_SCROLL && (C.translate(this.content, -this.scrollLeft, -Z.offset), this.scroller.className = this.scrollLeft <= 0 ? "ace_scroller " : "ace_scroller ace_scroll-left ", this.enableKeyboardAccessibility) && (this.scroller.className += this.keyboardFocusClassName), B2 & this.CHANGE_FULL ? (this.$changedLines = null, this.$textLayer.update(Z), this.$showGutter && this.$gutterLayer.update(Z), this.$customScrollbar && this.$scrollDecorator.$updateDecorators(Z), this.$markerBack.update(Z), this.$markerFront.update(Z), this.$cursorLayer.update(Z), this.$moveTextAreaToCursor()) : B2 & this.CHANGE_SCROLL ? (this.$changedLines = null, B2 & this.CHANGE_TEXT || B2 & this.CHANGE_LINES ? this.$textLayer.update(Z) : this.$textLayer.scrollLines(Z), this.$showGutter && (B2 & this.CHANGE_GUTTER || B2 & this.CHANGE_LINES ? this.$gutterLayer.update(Z) : this.$gutterLayer.scrollLines(Z)), this.$customScrollbar && this.$scrollDecorator.$updateDecorators(Z), this.$markerBack.update(Z), this.$markerFront.update(Z), this.$cursorLayer.update(Z), this.$moveTextAreaToCursor()) : (B2 & this.CHANGE_TEXT ? (this.$changedLines = null, this.$textLayer.update(Z), this.$showGutter && this.$gutterLayer.update(Z), this.$customScrollbar && this.$scrollDecorator.$updateDecorators(Z)) : B2 & this.CHANGE_LINES ? ((this.$updateLines() || B2 & this.CHANGE_GUTTER && this.$showGutter) && this.$gutterLayer.update(Z), this.$customScrollbar && this.$scrollDecorator.$updateDecorators(Z)) : B2 & this.CHANGE_TEXT || B2 & this.CHANGE_GUTTER ? (this.$showGutter && this.$gutterLayer.update(Z), this.$customScrollbar && this.$scrollDecorator.$updateDecorators(Z)) : B2 & this.CHANGE_CURSOR && (this.$highlightGutterLine && this.$gutterLayer.updateLineHighlight(Z), this.$customScrollbar) && this.$scrollDecorator.$updateDecorators(Z), B2 & this.CHANGE_CURSOR && (this.$cursorLayer.update(Z), this.$moveTextAreaToCursor()), B2 & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT) && this.$markerFront.update(Z), B2 & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK) && this.$markerBack.update(Z)), this._signal("afterRender", B2);
} else
this.$changes |= B2;
}, M.prototype.$autosize = function() {
var B2 = this.session.getScreenLength() * this.lineHeight, Z = this.$maxLines * this.lineHeight, k = Math.min(Z, Math.max((this.$minLines || 1) * this.lineHeight, B2)) + this.scrollMargin.v + (this.$extraHeight || 0);
this.$horizScroll && (k += this.scrollBarH.getHeight()), Z = !((k = this.$maxPixelHeight && k > this.$maxPixelHeight ? this.$maxPixelHeight : k) <= 2 * this.lineHeight) && Z < B2, k == this.desiredHeight && this.$size.height == this.desiredHeight && Z == this.$vScroll || (Z != this.$vScroll && (this.$vScroll = Z, this.scrollBarV.setVisible(Z)), B2 = this.container.clientWidth, this.container.style.height = k + "px", this.$updateCachedSize(true, this.$gutterWidth, B2, k), this.desiredHeight = k, this._signal("autosize"));
}, M.prototype.$computeLayerConfig = function() {
var B2, ne = this.session, Z = this.$size, Q = Z.height <= 2 * this.lineHeight, k = this.session.getScreenLength() * this.lineHeight, u = this.$getLongestLine(), W = !Q && (this.$hScrollBarAlwaysVisible || Z.scrollerWidth - u - 2 * this.$padding < 0), _ = this.$horizScroll !== W, W = (_ && (this.$horizScroll = W, this.scrollBarH.setVisible(W)), this.$vScroll), v = (this.$maxLines && 1 < this.lineHeight && this.$autosize(), Z.scrollerHeight + this.lineHeight), $ = !this.$maxLines && this.$scrollPastEnd ? (Z.scrollerHeight - this.lineHeight) * this.$scrollPastEnd : 0, G = (k += $, this.scrollMargin), Q = (this.session.setScrollTop(Math.max(-G.top, Math.min(this.scrollTop, k - Z.scrollerHeight + G.bottom))), this.session.setScrollLeft(Math.max(-G.left, Math.min(this.scrollLeft, u + 2 * this.$padding - Z.scrollerWidth + G.right))), !Q && (this.$vScrollBarAlwaysVisible || Z.scrollerHeight - k + $ < 0 || this.scrollTop > G.top)), $ = W !== Q, G = ($ && (this.$vScroll = Q, this.scrollBarV.setVisible(Q)), this.scrollTop % this.lineHeight), W = Math.ceil(v / this.lineHeight) - 1, W = (Q = Math.max(0, Math.round((this.scrollTop - G) / this.lineHeight))) + W, X = this.lineHeight, Q = ne.screenToDocumentRow(Q, 0), K = ne.getFoldLine(Q), ne = (K && (Q = K.start.row), K = ne.documentToScreenRow(Q, 0), B2 = ne.getRowLength(Q) * X, W = Math.min(ne.screenToDocumentRow(W, 0), ne.getLength() - 1), v = Z.scrollerHeight + ne.getRowLength(W) * X + B2, G = this.scrollTop - K * X, 0);
return this.layerConfig.width == u && !_ || (ne = this.CHANGE_H_SCROLL), (_ || $) && (ne |= this.$updateCachedSize(true, this.gutterWidth, Z.width, Z.height), this._signal("scrollbarVisibilityChanged"), $) && (u = this.$getLongestLine()), this.layerConfig = { width: u, padding: this.$padding, firstRow: Q, firstRowScreen: K, lastRow: W, lineHeight: X, characterWidth: this.characterWidth, minHeight: v, maxHeight: k, offset: G, gutterOffset: X ? Math.max(0, Math.ceil((G + Z.height - Z.scrollerHeight) / X)) : 0, height: this.$size.scrollerHeight }, this.session.$bidiHandler && this.session.$bidiHandler.setContentWidth(u - this.$padding), ne;
}, M.prototype.$updateLines = function() {
if (this.$changedLines) {
var B2 = this.$changedLines.firstRow, Z = this.$changedLines.lastRow, k = (this.$changedLines = null, this.layerConfig);
if (!(B2 > k.lastRow + 1 || Z < k.firstRow)) {
if (Z !== 1 / 0)
return this.$textLayer.updateLines(k, B2, Z), true;
this.$showGutter && this.$gutterLayer.update(k), this.$textLayer.update(k);
}
}
}, M.prototype.$getLongestLine = function() {
var B2 = this.session.getScreenWidth();
return this.showInvisibles && !this.session.$useWrapMode && (B2 += 1), this.$textLayer && B2 > this.$textLayer.MAX_LINE_LENGTH && (B2 = this.$textLayer.MAX_LINE_LENGTH + 30), Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(B2 * this.characterWidth));
}, M.prototype.updateFrontMarkers = function() {
this.$markerFront.setMarkers(this.session.getMarkers(true)), this.$loop.schedule(this.CHANGE_MARKER_FRONT);
}, M.prototype.updateBackMarkers = function() {
this.$markerBack.setMarkers(this.session.getMarkers()), this.$loop.schedule(this.CHANGE_MARKER_BACK);
}, M.prototype.addGutterDecoration = function(B2, Z) {
this.$gutterLayer.addGutterDecoration(B2, Z);
}, M.prototype.removeGutterDecoration = function(B2, Z) {
this.$gutterLayer.removeGutterDecoration(B2, Z);
}, M.prototype.updateBreakpoints = function(B2) {
this.$loop.schedule(this.CHANGE_GUTTER);
}, M.prototype.setAnnotations = function(B2) {
this.$gutterLayer.setAnnotations(B2), this.$loop.schedule(this.CHANGE_GUTTER);
}, M.prototype.updateCursor = function() {
this.$loop.schedule(this.CHANGE_CURSOR);
}, M.prototype.hideCursor = function() {
this.$cursorLayer.hideCursor();
}, M.prototype.showCursor = function() {
this.$cursorLayer.showCursor();
}, M.prototype.scrollSelectionIntoView = function(B2, Z, k) {
this.scrollCursorIntoView(B2, k), this.scrollCursorIntoView(Z, k);
}, M.prototype.scrollCursorIntoView = function(B2, Z, k) {
var u, _, v;
this.$size.scrollerHeight !== 0 && (u = (B2 = this.$cursorLayer.getPixelPosition(B2)).left, B2 = B2.top, _ = k && k.top || 0, k = k && k.bottom || 0, this.$scrollAnimation && (this.$stopAnimation = true), B2 < (v = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop) + _ ? (Z && v + _ > B2 + this.lineHeight && (B2 -= Z * this.$size.scrollerHeight), B2 === 0 && (B2 = -this.scrollMargin.top), this.session.setScrollTop(B2)) : v + this.$size.scrollerHeight - k < B2 + this.lineHeight && (Z && v + this.$size.scrollerHeight - k < B2 - this.lineHeight && (B2 += Z * this.$size.scrollerHeight), this.session.setScrollTop(B2 + this.lineHeight + k - this.$size.scrollerHeight)), _ = this.scrollLeft, u - (v = 2 * this.layerConfig.characterWidth) < _ ? ((u -= v) < this.$padding + v && (u = -this.scrollMargin.left), this.session.setScrollLeft(u)) : _ + this.$size.scrollerWidth < (u += v) + this.characterWidth ? this.session.setScrollLeft(Math.round(u + this.characterWidth - this.$size.scrollerWidth)) : _ <= this.$padding && u - _ < this.characterWidth && this.session.setScrollLeft(0));
}, M.prototype.getScrollTop = function() {
return this.session.getScrollTop();
}, M.prototype.getScrollLeft = function() {
return this.session.getScrollLeft();
}, M.prototype.getScrollTopRow = function() {
return this.scrollTop / this.lineHeight;
}, M.prototype.getScrollBottomRow = function() {
return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1);
}, M.prototype.scrollToRow = function(B2) {
this.session.setScrollTop(B2 * this.lineHeight);
}, M.prototype.alignCursor = function(u, Z) {
var u = this.$cursorLayer.getPixelPosition(u = typeof u == "number" ? { row: u, column: 0 } : u), k = this.$size.scrollerHeight - this.lineHeight, u = u.top - k * (Z || 0);
return this.session.setScrollTop(u), u;
}, M.prototype.$calcSteps = function(B2, Z) {
for (var k, u, $ = 0, _ = this.STEPS, v = [], $ = 0; $ < _; ++$)
v.push((k = $ / this.STEPS, (Z - (u = B2)) * (Math.pow(k - 1, 3) + 1) + u));
return v;
}, M.prototype.scrollToLine = function(B2, Z, k, u) {
B2 = this.$cursorLayer.getPixelPosition({ row: B2, column: 0 }).top, Z && (B2 -= this.$size.scrollerHeight / 2), Z = this.scrollTop, this.session.setScrollTop(B2), k !== false && this.animateScrolling(Z, u);
}, M.prototype.animateScrolling = function(B2, Z) {
var k = this.scrollTop;
if (this.$animatedScroll) {
var u = this;
if (B2 != k) {
if (this.$scrollAnimation) {
var _ = this.$scrollAnimation.steps;
if (_.length && (B2 = _[0]) == k)
return;
}
var v = u.$calcSteps(B2, k);
this.$scrollAnimation = { from: B2, to: k, steps: v }, clearInterval(this.$timer), u.session.setScrollTop(v.shift()), u.session.$scrollTop = k, this.$timer = setInterval(function() {
if (!u.$stopAnimation)
return u.session ? void (v.length ? (u.session.setScrollTop(v.shift()), u.session.$scrollTop = k) : k != null ? (u.session.$scrollTop = -1, u.session.setScrollTop(k), k = null) : $()) : clearInterval(u.$timer);
$();
}, 10);
}
}
function $() {
u.$timer = clearInterval(u.$timer), u.$scrollAnimation = null, u.$stopAnimation = false, Z && Z();
}
}, M.prototype.scrollToY = function(B2) {
this.scrollTop !== B2 && (this.$loop.schedule(this.CHANGE_SCROLL), this.scrollTop = B2);
}, M.prototype.scrollToX = function(B2) {
this.scrollLeft !== B2 && (this.scrollLeft = B2), this.$loop.schedule(this.CHANGE_H_SCROLL);
}, M.prototype.scrollTo = function(B2, Z) {
this.session.setScrollTop(Z), this.session.setScrollLeft(B2);
}, M.prototype.scrollBy = function(B2, Z) {
Z && this.session.setScrollTop(this.session.getScrollTop() + Z), B2 && this.session.setScrollLeft(this.session.getScrollLeft() + B2);
}, M.prototype.isScrollableBy = function(B2, Z) {
return Z < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top || 0 < Z && this.session.getScrollTop() + this.$size.scrollerHeight - this.layerConfig.maxHeight < -1 + this.scrollMargin.bottom || B2 < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left || 0 < B2 && this.session.getScrollLeft() + this.$size.scrollerWidth - this.layerConfig.width < -1 + this.scrollMargin.right || void 0;
}, M.prototype.pixelToScreenCoordinates = function(u, _) {
this.$hasCssTransforms ? (v = { top: 0, left: 0 }, u = (k = this.$fontMetrics.transformCoordinates([u, _]))[1] - this.gutterWidth - this.margin.left, _ = k[0]) : v = this.scroller.getBoundingClientRect();
var k = u + this.scrollLeft - v.left - this.$padding, u = k / this.characterWidth, _ = Math.floor((_ + this.scrollTop - v.top) / this.lineHeight), v = this.$blockCursor ? Math.floor(u) : Math.round(u);
return { row: _, column: v, side: 0 < u - v ? 1 : -1, offsetX: k };
}, M.prototype.screenToTextCoordinates = function(_, v) {
this.$hasCssTransforms ? (k = { top: 0, left: 0 }, _ = (u = this.$fontMetrics.transformCoordinates([_, v]))[1] - this.gutterWidth - this.margin.left, v = u[0]) : k = this.scroller.getBoundingClientRect();
var k, u = _ + this.scrollLeft - k.left - this.$padding, _ = u / this.characterWidth, _ = this.$blockCursor ? Math.floor(_) : Math.round(_), v = Math.floor((v + this.scrollTop - k.top) / this.lineHeight);
return this.session.screenToDocumentPosition(v, Math.max(_, 0), u);
}, M.prototype.textToScreenCoordinates = function(u, _) {
var k = this.scroller.getBoundingClientRect(), _ = this.session.documentToScreenPosition(u, _), u = this.$padding + (this.session.$bidiHandler.isBidiRow(_.row, u) ? this.session.$bidiHandler.getPosLeft(_.column) : Math.round(_.column * this.characterWidth)), _ = _.row * this.lineHeight;
return { pageX: k.left + u - this.scrollLeft, pageY: k.top + _ - this.scrollTop };
}, M.prototype.visualizeFocus = function() {
C.addCssClass(this.container, "ace_focus");
}, M.prototype.visualizeBlur = function() {
C.removeCssClass(this.container, "ace_focus");
}, M.prototype.showComposition = function(B2) {
(this.$composition = B2).cssText || (B2.cssText = this.textarea.style.cssText), B2.useTextareaForIME == null && (B2.useTextareaForIME = this.$useTextareaForIME), this.$useTextareaForIME ? (C.addCssClass(this.textarea, "ace_composition"), this.textarea.style.cssText = "", this.$moveTextAreaToCursor(), this.$cursorLayer.element.style.display = "none") : B2.markerId = this.session.addMarker(B2.markerRange, "ace_composition_marker", "text");
}, M.prototype.setCompositionText = function(B2) {
var Z = this.session.selection.cursor;
this.addToken(B2, "composition_placeholder", Z.row, Z.column), this.$moveTextAreaToCursor();
}, M.prototype.hideComposition = function() {
var B2;
this.$composition && (this.$composition.markerId && this.session.removeMarker(this.$composition.markerId), C.removeCssClass(this.textarea, "ace_composition"), this.textarea.style.cssText = this.$composition.cssText, B2 = this.session.selection.cursor, this.removeExtraToken(B2.row, B2.column), this.$composition = null, this.$cursorLayer.element.style.display = "");
}, M.prototype.setGhostText = function(B2, k) {
var u = this.session.selection.cursor, k = k || { row: u.row, column: u.column }, u = (this.removeGhostText(), B2.split(`
`));
this.addToken(u[0], "ghost_text", k.row, k.column), this.$ghostText = { text: B2, position: { row: k.row, column: k.column } }, 1 < u.length && (this.$ghostTextWidget = { text: u.slice(1).join(`
`), row: k.row, column: k.column, className: "ace_ghost_text" }, this.session.widgetManager.addLineWidget(this.$ghostTextWidget));
}, M.prototype.removeGhostText = function() {
var B2;
this.$ghostText && (B2 = this.$ghostText.position, this.removeExtraToken(B2.row, B2.column), this.$ghostTextWidget && (this.session.widgetManager.removeLineWidget(this.$ghostTextWidget), this.$ghostTextWidget = null), this.$ghostText = null);
}, M.prototype.addToken = function(B2, Z, k, u) {
var _ = this.session, v = (_.bgTokenizer.lines[k] = null, { type: Z, value: B2 }), $ = _.getTokens(k);
if (u != null && $.length)
for (var G = 0, W = 0; W < $.length; W++) {
var X = $[W];
if (u <= (G += X.value.length)) {
var K = X.value.length - (G - u), Q = X.value.slice(0, K), K = X.value.slice(K);
$.splice(W, 1, { type: X.type, value: Q }, v, { type: X.type, value: K });
break;
}
}
else
$.push(v);
this.updateLines(k, k);
}, M.prototype.removeExtraToken = function(B2, Z) {
this.session.bgTokenizer.lines[B2] = null, this.updateLines(B2, B2);
}, M.prototype.setTheme = function(B2, Z) {
var k, u = this;
function _(v) {
if (u.$themeId != B2)
return Z && Z();
if (!v || !v.cssClass)
throw new Error("couldn't load module " + B2 + " or it didn't call define");
v.$id && (u.$themeId = v.$id), C.importCssString(v.cssText, v.cssClass, u.container), u.theme && C.removeCssClass(u.container, u.theme.cssClass);
var $ = "padding" in v ? v.padding : "padding" in (u.theme || {}) ? 4 : u.$padding;
u.$padding && $ != u.$padding && u.setPadding($), u.$theme = v.cssClass, u.theme = v, C.addCssClass(u.container, v.cssClass), C.setCssClass(u.container, "ace_dark", v.isDark), u.$size && (u.$size.width = 0, u.$updateSizeAsync()), u._dispatchEvent("themeLoaded", { theme: v }), Z && Z();
}
this.$themeId = B2, u._dispatchEvent("themeChange", { theme: B2 }), B2 && typeof B2 != "string" ? _(B2) : (k = B2 || this.$options.theme.initialValue, h.loadModule(["theme", k], _));
}, M.prototype.getTheme = function() {
return this.$themeId;
}, M.prototype.setStyle = function(B2, Z) {
C.setCssClass(this.container, B2, Z !== false);
}, M.prototype.unsetStyle = function(B2) {
C.removeCssClass(this.container, B2);
}, M.prototype.setCursorStyle = function(B2) {
C.setStyle(this.scroller.style, "cursor", B2);
}, M.prototype.setMouseCursor = function(B2) {
C.setStyle(this.scroller.style, "cursor", B2);
}, M.prototype.attachToShadowRoot = function() {
C.importCssString(g, "ace_editor.css", this.container);
}, M.prototype.destroy = function() {
this.freeze(), this.$fontMetrics.destroy(), this.$cursorLayer.destroy(), this.removeAllListeners(), this.container.textContent = "", this.setOption("useResizeObserver", false);
}, M.prototype.$updateCustomScrollbar = function(B2) {
var Z = this;
this.$horizScroll = this.$vScroll = null, this.scrollBarV.element.remove(), this.scrollBarH.element.remove(), this.$scrollDecorator && delete this.$scrollDecorator, B2 === true ? (this.scrollBarV = new t(this.container, this), this.scrollBarH = new e2(this.container, this), this.scrollBarV.setHeight(this.$size.scrollerHeight), this.scrollBarH.setWidth(this.$size.scrollerWidth), this.scrollBarV.addEventListener("scroll", function(k) {
Z.$scrollAnimation || Z.session.setScrollTop(k.data - Z.scrollMargin.top);
}), this.scrollBarH.addEventListener("scroll", function(k) {
Z.$scrollAnimation || Z.session.setScrollLeft(k.data - Z.scrollMargin.left);
}), this.$scrollDecorator = new b(this.scrollBarV, this), this.$scrollDecorator.$updateDecorators()) : (this.scrollBarV = new r(this.container, this), this.scrollBarH = new a(this.container, this), this.scrollBarV.addEventListener("scroll", function(k) {
Z.$scrollAnimation || Z.session.setScrollTop(k.data - Z.scrollMargin.top);
}), this.scrollBarH.addEventListener("scroll", function(k) {
Z.$scrollAnimation || Z.session.setScrollLeft(k.data - Z.scrollMargin.left);
}));
}, M.prototype.$addResizeObserver = function() {
var B2;
window.ResizeObserver && !this.$resizeObserver && ((B2 = this).$resizeTimer = d.delayedCall(function() {
B2.destroyed || B2.onResize();
}, 50), this.$resizeObserver = new window.ResizeObserver(function(u) {
var k = u[0].contentRect.width, u = u[0].contentRect.height;
1 < Math.abs(B2.$size.width - k) || 1 < Math.abs(B2.$size.height - u) ? B2.$resizeTimer.delay() : B2.$resizeTimer.cancel();
}), this.$resizeObserver.observe(this.container));
}, M);
function M(u, Z) {
var k = this, u = (this.container = u || C.createElement("div"), C.addCssClass(this.container, "ace_editor"), C.HI_DPI && C.addCssClass(this.container, "ace_hidpi"), this.setTheme(Z), h.get("useStrictCSP") == null && h.set("useStrictCSP", false), this.$gutter = C.createElement("div"), this.$gutter.className = "ace_gutter", this.container.appendChild(this.$gutter), this.$gutter.setAttribute("aria-hidden", true), this.scroller = C.createElement("div"), this.scroller.className = "ace_scroller", this.container.appendChild(this.scroller), this.content = C.createElement("div"), this.content.className = "ace_content", this.scroller.appendChild(this.content), this.$gutterLayer = new l(this.$gutter), this.$gutterLayer.on("changeGutterWidth", this.onGutterResize.bind(this)), this.$markerBack = new n(this.content), this.$textLayer = new o(this.content));
this.canvas = u.element, this.$markerFront = new n(this.content), this.$cursorLayer = new i(this.content), this.$horizScroll = false, this.$vScroll = false, this.scrollBar = this.scrollBarV = new r(this.container, this), this.scrollBarH = new a(this.container, this), this.scrollBarV.on("scroll", function(_) {
k.$scrollAnimation || k.session.setScrollTop(_.data - k.scrollMargin.top);
}), this.scrollBarH.on("scroll", function(_) {
k.$scrollAnimation || k.session.setScrollLeft(_.data - k.scrollMargin.left);
}), this.scrollTop = 0, this.scrollLeft = 0, this.cursorPos = { row: 0, column: 0 }, this.$fontMetrics = new c(this.container), this.$textLayer.$setFontMetrics(this.$fontMetrics), this.$textLayer.on("changeCharacterSize", function(_) {
k.updateCharacterSize(), k.onResize(true, k.gutterWidth, k.$size.width, k.$size.height), k._signal("changeCharacterSize", _);
}), this.$size = { width: 0, height: 0, scrollerHeight: 0, scrollerWidth: 0, $dirty: true }, this.layerConfig = { width: 1, padding: 0, firstRow: 0, firstRowScreen: 0, lastRow: 0, lineHeight: 0, characterWidth: 0, minHeight: 1, maxHeight: 1, offset: 0, height: 1, gutterOffset: 1 }, this.scrollMargin = { left: 0, right: 0, top: 0, bottom: 0, v: 0, h: 0 }, this.margin = { left: 0, right: 0, top: 0, bottom: 0, v: 0, h: 0 }, this.$keepTextAreaAtCursor = !w.isIOS, this.$loop = new s(this.$renderChanges.bind(this), this.container.ownerDocument.defaultView), this.$loop.schedule(this.CHANGE_FULL), this.updateCharacterSize(), this.setPadding(4), this.$addResizeObserver(), h.resetOptions(this), h._signal("renderer", this);
}
E.prototype.CHANGE_CURSOR = 1, E.prototype.CHANGE_MARKER = 2, E.prototype.CHANGE_GUTTER = 4, E.prototype.CHANGE_SCROLL = 8, E.prototype.CHANGE_LINES = 16, E.prototype.CHANGE_TEXT = 32, E.prototype.CHANGE_SIZE = 64, E.prototype.CHANGE_MARKER_BACK = 128, E.prototype.CHANGE_MARKER_FRONT = 256, E.prototype.CHANGE_FULL = 512, E.prototype.CHANGE_H_SCROLL = 1024, E.prototype.$changes = 0, E.prototype.$padding = null, E.prototype.$frozen = false, E.prototype.STEPS = 8, y.implement(E.prototype, p), h.defineOptions(E.prototype, "renderer", { useResizeObserver: { set: function(B2) {
!B2 && this.$resizeObserver ? (this.$resizeObserver.disconnect(), this.$resizeTimer.cancel(), this.$resizeTimer = this.$resizeObserver = null) : B2 && !this.$resizeObserver && this.$addResizeObserver();
} }, animatedScroll: { initialValue: false }, showInvisibles: { set: function(B2) {
this.$textLayer.setShowInvisibles(B2) && this.$loop.schedule(this.CHANGE_TEXT);
}, initialValue: false }, showPrintMargin: { set: function() {
this.$updatePrintMargin();
}, initialValue: true }, printMarginColumn: { set: function() {
this.$updatePrintMargin();
}, initialValue: 80 }, printMargin: { set: function(B2) {
typeof B2 == "number" && (this.$printMarginColumn = B2), this.$showPrintMargin = !!B2, this.$updatePrintMargin();
}, get: function() {
return this.$showPrintMargin && this.$printMarginColumn;
} }, showGutter: { set: function(B2) {
this.$gutter.style.display = B2 ? "block" : "none", this.$loop.schedule(this.CHANGE_FULL), this.onGutterResize();
}, initialValue: true }, useSvgGutterIcons: { set: function(B2) {
this.$gutterLayer.$useSvgGutterIcons = B2;
}, initialValue: false }, showFoldedAnnotations: { set: function(B2) {
this.$gutterLayer.$showFoldedAnnotations = B2;
}, initialValue: false }, fadeFoldWidgets: { set: function(B2) {
C.setCssClass(this.$gutter, "ace_fade-fold-widgets", B2);
}, initialValue: false }, showFoldWidgets: { set: function(B2) {
this.$gutterLayer.setShowFoldWidgets(B2), this.$loop.schedule(this.CHANGE_GUTTER);
}, initialValue: true }, displayIndentGuides: { set: function(B2) {
this.$textLayer.setDisplayIndentGuides(B2) && this.$loop.schedule(this.CHANGE_TEXT);
}, initialValue: true }, highlightIndentGuides: { set: function(B2) {
this.$textLayer.setHighlightIndentGuides(B2) == 1 ? this.$textLayer.$highlightIndentGuide() : this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells);
}, initialValue: true }, highlightGutterLine: { set: function(B2) {
this.$gutterLayer.setHighlightGutterLine(B2), this.$loop.schedule(this.CHANGE_GUTTER);
}, initialValue: true }, hScrollBarAlwaysVisible: { set: function(B2) {
this.$hScrollBarAlwaysVisible && this.$horizScroll || this.$loop.schedule(this.CHANGE_SCROLL);
}, initialValue: false }, vScrollBarAlwaysVisible: { set: function(B2) {
this.$vScrollBarAlwaysVisible && this.$vScroll || this.$loop.schedule(this.CHANGE_SCROLL);
}, initialValue: false }, fontSize: { set: function(B2) {
typeof B2 == "number" && (B2 += "px"), this.container.style.fontSize = B2, this.updateFontSize();
}, initialValue: 12 }, fontFamily: { set: function(B2) {
this.container.style.fontFamily = B2, this.updateFontSize();
} }, maxLines: { set: function(B2) {
this.updateFull();
} }, minLines: { set: function(B2) {
this.$minLines < 562949953421311 || (this.$minLines = 0), this.updateFull();
} }, maxPixelHeight: { set: function(B2) {
this.updateFull();
}, initialValue: 0 }, scrollPastEnd: { set: function(B2) {
this.$scrollPastEnd != (B2 = +B2 || 0) && (this.$scrollPastEnd = B2, this.$loop.schedule(this.CHANGE_SCROLL));
}, initialValue: 0, handlesSet: true }, fixedWidthGutter: { set: function(B2) {
this.$gutterLayer.$fixedWidth = !!B2, this.$loop.schedule(this.CHANGE_GUTTER);
} }, customScrollbar: { set: function(B2) {
this.$updateCustomScrollbar(B2);
}, initialValue: false }, theme: { set: function(B2) {
this.setTheme(B2);
}, get: function() {
return this.$themeId || this.theme;
}, initialValue: "./theme/textmate", handlesSet: true }, hasCssTransforms: {}, useTextareaForIME: { initialValue: !w.isMobile && !w.isIE } }), f.VirtualRenderer = E;
}), ace.define("ace/worker/worker_client", ["require", "exports", "module", "ace/lib/oop", "ace/lib/net", "ace/lib/event_emitter", "ace/config"], function(A, f, R) {
var y = A("../lib/oop"), C = A("../lib/net"), d = A("../lib/event_emitter").EventEmitter, h = A("../config");
function l(o) {
var i;
return typeof Worker > "u" ? { postMessage: function() {
}, terminate: function() {
} } : h.get("loadWorkerFromBlob") ? (i = function(a) {
a = "importScripts('" + C.qualifyURL(a) + "');";
try {
return new Blob([a], { type: "application/javascript" });
} catch {
var r = new (window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder)();
return r.append(a), r.getBlob("application/javascript");
}
}(o), i = (window.URL || window.webkitURL).createObjectURL(i), new Worker(i)) : new Worker(o);
}
function n(o) {
o.postMessage || (o = this.$createWorkerFromOldConfig.apply(this, arguments)), this.$worker = o, this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this), this.changeListener = this.changeListener.bind(this), this.onMessage = this.onMessage.bind(this), this.callbackId = 1, this.callbacks = {}, this.$worker.onmessage = this.onMessage;
}
(function() {
y.implement(this, d), this.$createWorkerFromOldConfig = function(o, i, a, r, e2) {
var t, s;
return A.nameToUrl && !A.toUrl && (A.toUrl = A.nameToUrl), h.get("packaged") || !A.toUrl ? r = r || h.moduleUrl(i, "worker") : (t = this.$normalizePath, r = r || t(A.toUrl("ace/worker/worker.js", null, "_")), s = {}, o.forEach(function(c) {
s[c] = t(A.toUrl(c, null, "_").replace(/(\.js)?(\?.*)?$/, ""));
})), this.$worker = l(r), e2 && this.send("importScripts", e2), this.$worker.postMessage({ init: true, tlns: s, module: i, classname: a }), this.$worker;
}, this.onMessage = function(o) {
var i = o.data;
switch (i.type) {
case "event":
this._signal(i.name, { data: i.data });
break;
case "call":
var a = this.callbacks[i.id];
a && (a(i.data), delete this.callbacks[i.id]);
break;
case "error":
this.reportError(i.data);
break;
case "log":
window.console && console.log && console.log.apply(console, i.data);
}
}, this.reportError = function(o) {
}, this.$normalizePath = function(o) {
return C.qualifyURL(o);
}, this.terminate = function() {
this._signal("terminate", {}), this.deltaQueue = null, this.$worker.terminate(), this.$worker.onerror = function(o) {
o.preventDefault();
}, this.$worker = null, this.$doc && this.$doc.off("change", this.changeListener), this.$doc = null;
}, this.send = function(o, i) {
this.$worker.postMessage({ command: o, args: i });
}, this.call = function(o, i, a) {
var r;
a && (r = this.callbackId++, this.callbacks[r] = a, i.push(r)), this.send(o, i);
}, this.emit = function(o, i) {
try {
i.data && i.data.err && (i.data.err = { message: i.data.err.message, stack: i.data.err.stack, code: i.data.err.code }), this.$worker && this.$worker.postMessage({ event: o, data: { data: i.data } });
} catch {
}
}, this.attachToDocument = function(o) {
this.$doc && this.terminate(), this.$doc = o, this.call("setValue", [o.getValue()]), o.on("change", this.changeListener, true);
}, this.changeListener = function(o) {
this.deltaQueue || (this.deltaQueue = [], setTimeout(this.$sendDeltaQueue, 0)), o.action == "insert" ? this.deltaQueue.push(o.start, o.lines) : this.deltaQueue.push(o.start, o.end);
}, this.$sendDeltaQueue = function() {
var o = this.deltaQueue;
o && (this.deltaQueue = null, 50 < o.length && o.length > this.$doc.getLength() >> 1 ? this.call("setValue", [this.$doc.getValue()]) : this.emit("change", { data: o }));
};
}).call(n.prototype), f.UIWorkerClient = function(o, i, a) {
var r = null, e2 = false, t = Object.create(d), s = [], c = new n({ messageBuffer: s, terminate: function() {
}, postMessage: function(g) {
s.push(g), r && (e2 ? setTimeout(p) : p());
} }), p = (c.setEmitSync = function(g) {
e2 = g;
}, function() {
var g = s.shift();
g.command ? r[g.command].apply(r, g.args) : g.event && t._signal(g.event, g.data);
});
return t.postMessage = function(g) {
c.onMessage({ data: g });
}, t.callback = function(g, b) {
this.postMessage({ type: "call", id: b, data: g });
}, t.emit = function(g, b) {
this.postMessage({ type: "event", name: g, data: b });
}, h.loadModule(["worker", i], function(g) {
for (r = new g[a](t); s.length; )
p();
}), c;
}, f.WorkerClient = n, f.createWorker = l;
}), ace.define("ace/placeholder", ["require", "exports", "module", "ace/range", "ace/lib/event_emitter", "ace/lib/oop"], function(d, f, R) {
var y = d("./range").Range, C = d("./lib/event_emitter").EventEmitter, d = d("./lib/oop"), h = (l.prototype.setup = function() {
var n = this, o = this.doc, i = this.session, a = (this.selectionBefore = i.selection.toJSON(), i.selection.inMultiSelectMode && i.selection.toSingleRange(), this.pos = o.createAnchor(this.$pos.row, this.$pos.column), this.pos);
a.$insertRight = true, a.detach(), a.markerId = i.addMarker(new y(a.row, a.column, a.row, a.column + this.length), this.mainClass, null, false), this.others = [], this.$others.forEach(function(r) {
r = o.createAnchor(r.row, r.column), r.$insertRight = true, r.detach(), n.others.push(r);
}), i.setUndoSelect(false);
}, l.prototype.showOtherMarkers = function() {
var n, o;
this.othersActive || (n = this.session, (o = this).othersActive = true, this.others.forEach(function(i) {
i.markerId = n.addMarker(new y(i.row, i.column, i.row, i.column + o.length), o.othersClass, null, false);
}));
}, l.prototype.hideOtherMarkers = function() {
if (this.othersActive) {
this.othersActive = false;
for (var n = 0; n < this.others.length; n++)
this.session.removeMarker(this.others[n].markerId);
}
}, l.prototype.onUpdate = function(n) {
if (this.$updating)
return this.updateAnchors(n);
var o = n;
if (o.start.row === o.end.row && o.start.row === this.pos.row) {
this.$updating = true;
var i = n.action === "insert" ? o.end.column - o.start.column : o.start.column - o.end.column, a = o.start.column >= this.pos.column && o.start.column <= this.pos.column + this.length + 1, r = o.start.column - this.pos.column;
if (this.updateAnchors(n), a && (this.length += i), a && !this.session.$fromUndo) {
if (n.action === "insert")
for (var e2 = this.others.length - 1; 0 <= e2; e2--) {
var t = { row: (s = this.others[e2]).row, column: s.column + r };
this.doc.insertMergedLines(t, n.lines);
}
else if (n.action === "remove")
for (e2 = this.others.length - 1; 0 <= e2; e2--) {
var s, t = { row: (s = this.others[e2]).row, column: s.column + r };
this.doc.remove(new y(t.row, t.column, t.row, t.column - i));
}
}
this.$updating = false, this.updateMarkers();
}
}, l.prototype.updateAnchors = function(n) {
this.pos.onChange(n);
for (var o = this.others.length; o--; )
this.others[o].onChange(n);
this.updateMarkers();
}, l.prototype.updateMarkers = function() {
if (!this.$updating) {
var n = this, o = this.session, i = function(r, e2) {
o.removeMarker(r.markerId), r.markerId = o.addMarker(new y(r.row, r.column, r.row, r.column + n.length), e2, null, false);
};
i(this.pos, this.mainClass);
for (var a = this.others.length; a--; )
i(this.others[a], this.othersClass);
}
}, l.prototype.onCursorChange = function(n) {
var o;
!this.$updating && this.session && ((o = this.session.selection.getCursor()).row === this.pos.row && o.column >= this.pos.column && o.column <= this.pos.column + this.length ? (this.showOtherMarkers(), this._emit("cursorEnter", n)) : (this.hideOtherMarkers(), this._emit("cursorLeave", n)));
}, l.prototype.detach = function() {
this.session.removeMarker(this.pos && this.pos.markerId), this.hideOtherMarkers(), this.doc.off("change", this.$onUpdate), this.session.selection.off("changeCursor", this.$onCursorChange), this.session.setUndoSelect(true), this.session = null;
}, l.prototype.cancel = function() {
if (this.$undoStackDepth !== -1) {
for (var n = this.session.getUndoManager(), o = (n.$undoStack || n.$undostack).length - this.$undoStackDepth, i = 0; i < o; i++)
n.undo(this.session, true);
this.selectionBefore && this.session.selection.fromJSON(this.selectionBefore);
}
}, l);
function l(n, s, i, a, r, e2) {
var t = this, s = (this.length = s, this.session = n, this.doc = n.getDocument(), this.mainClass = r, this.othersClass = e2, this.$onUpdate = this.onUpdate.bind(this), this.doc.on("change", this.$onUpdate, true), this.$others = a, this.$onCursorChange = function() {
setTimeout(function() {
t.onCursorChange();
});
}, this.$pos = i, n.getUndoManager().$undoStack || n.getUndoManager().$undostack || { length: -1 });
this.$undoStackDepth = s.length, this.setup(), n.selection.on("changeCursor", this.$onCursorChange);
}
d.implement(h.prototype, C), f.PlaceHolder = h;
}), ace.define("ace/mouse/multi_select_handler", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent"], function(A, f, R) {
var y = A("../lib/event"), C = A("../lib/useragent");
function d(h, l) {
return h.row == l.row && h.column == l.column;
}
f.onMouseDown = function(h) {
var l = h.domEvent, n = l.altKey, o = l.shiftKey, i = l.ctrlKey, a = h.getAccelKey(), r = h.getButton();
if (i && C.isMac && (r = l.button), h.editor.inMultiSelectMode && r == 2)
h.editor.textInput.onContextMenu(h.domEvent);
else if (i || n || a) {
if (r === 0) {
var e2, t, s, c, p, g, b, w, E = h.editor, M = E.selection, B2 = E.inMultiSelectMode, Z = h.getDocumentPosition(), k = M.getCursor(), k = h.inSelection() || M.isEmpty() && d(Z, k), u = h.x, _ = h.y, v = E.session, $ = E.renderer.pixelToScreenCoordinates(u, _), G = $;
if (E.$mouseHandler.$enableJumpToDef)
i && n || a && n ? e2 = o ? "block" : "add" : n && E.$blockSelectEnabled && (e2 = "block");
else if (a && !n) {
if (e2 = "add", !B2 && o)
return;
} else
n && E.$blockSelectEnabled && (e2 = "block");
if (e2 && C.isMac && l.ctrlKey && E.$mouseHandler.cancelContextMenu(), e2 == "add")
!B2 && k || (B2 || (t = M.toOrientedRange(), E.addSelectionMarker(t)), s = M.rangeList.rangeAtPoint(Z), E.inVirtualSelectionMode = true, o && (s = null, t = M.ranges[0] || t, E.removeSelectionMarker(t)), E.once("mouseup", function() {
var W = M.toOrientedRange();
s && W.isEmpty() && d(s.cursor, W.cursor) ? M.substractPoint(W.cursor) : (o ? M.substractPoint(t.cursor) : t && (E.removeSelectionMarker(t), M.addRange(t)), M.addRange(W)), E.inVirtualSelectionMode = false;
}));
else if (e2 == "block")
return h.stop(), E.inVirtualSelectionMode = true, p = [], g = function() {
var W = E.renderer.pixelToScreenCoordinates(u, _), X = v.screenToDocumentPosition(W.row, W.column, W.offsetX);
d(G, W) && d(X, M.lead) || (G = W, E.selection.moveToPosition(X), E.renderer.scrollCursorIntoView(), E.removeSelectionMarkers(p), p = M.rectangularRangeBlock(G, $), E.$mouseHandler.$clickSelection && p.length == 1 && p[0].isEmpty() && (p[0] = E.$mouseHandler.$clickSelection.clone()), p.forEach(E.addSelectionMarker, E), E.updateSelectionMarkers());
}, B2 && !a ? M.toSingleRange() : !B2 && a && (c = M.toOrientedRange(), E.addSelectionMarker(c)), o ? $ = v.documentToScreenPosition(M.lead) : M.moveToPosition(Z), G = { row: -1, column: -1 }, b = g, y.capture(E.container, function(W) {
u = W.clientX, _ = W.clientY;
}, function(W) {
g(), clearInterval(w), E.removeSelectionMarkers(p), p.length || (p = [M.toOrientedRange()]), c && (E.removeSelectionMarker(c), M.toSingleRange(c));
for (var X = 0; X < p.length; X++)
M.addRange(p[X]);
E.inVirtualSelectionMode = false, E.$mouseHandler.$clickSelection = null;
}), w = setInterval(function() {
b();
}, 20), h.preventDefault();
}
} else
r === 0 && h.editor.inMultiSelectMode && h.editor.exitMultiSelectMode();
};
}), ace.define("ace/commands/multi_select_commands", ["require", "exports", "module", "ace/keyboard/hash_handler"], function(A, f, R) {
f.defaultCommands = [{ name: "addCursorAbove", description: "Add cursor above", exec: function(y) {
y.selectMoreLines(-1);
}, bindKey: { win: "Ctrl-Alt-Up", mac: "Ctrl-Alt-Up" }, scrollIntoView: "cursor", readOnly: true }, { name: "addCursorBelow", description: "Add cursor below", exec: function(y) {
y.selectMoreLines(1);
}, bindKey: { win: "Ctrl-Alt-Down", mac: "Ctrl-Alt-Down" }, scrollIntoView: "cursor", readOnly: true }, { name: "addCursorAboveSkipCurrent", description: "Add cursor above (skip current)", exec: function(y) {
y.selectMoreLines(-1, true);
}, bindKey: { win: "Ctrl-Alt-Shift-Up", mac: "Ctrl-Alt-Shift-Up" }, scrollIntoView: "cursor", readOnly: true }, { name: "addCursorBelowSkipCurrent", description: "Add cursor below (skip current)", exec: function(y) {
y.selectMoreLines(1, true);
}, bindKey: { win: "Ctrl-Alt-Shift-Down", mac: "Ctrl-Alt-Shift-Down" }, scrollIntoView: "cursor", readOnly: true }, { name: "selectMoreBefore", description: "Select more before", exec: function(y) {
y.selectMore(-1);
}, bindKey: { win: "Ctrl-Alt-Left", mac: "Ctrl-Alt-Left" }, scrollIntoView: "cursor", readOnly: true }, { name: "selectMoreAfter", description: "Select more after", exec: function(y) {
y.selectMore(1);
}, bindKey: { win: "Ctrl-Alt-Right", mac: "Ctrl-Alt-Right" }, scrollIntoView: "cursor", readOnly: true }, { name: "selectNextBefore", description: "Select next before", exec: function(y) {
y.selectMore(-1, true);
}, bindKey: { win: "Ctrl-Alt-Shift-Left", mac: "Ctrl-Alt-Shift-Left" }, scrollIntoView: "cursor", readOnly: true }, { name: "selectNextAfter", description: "Select next after", exec: function(y) {
y.selectMore(1, true);
}, bindKey: { win: "Ctrl-Alt-Shift-Right", mac: "Ctrl-Alt-Shift-Right" }, scrollIntoView: "cursor", readOnly: true }, { name: "toggleSplitSelectionIntoLines", description: "Split selection into lines", exec: function(y) {
1 < y.multiSelect.rangeCount ? y.multiSelect.joinSelections() : y.multiSelect.splitIntoLines();
}, bindKey: { win: "Ctrl-Alt-L", mac: "Ctrl-Alt-L" }, readOnly: true }, { name: "splitSelectionIntoLines", description: "Split into lines", exec: function(y) {
y.multiSelect.splitIntoLines();
}, readOnly: true }, { name: "alignCursors", description: "Align cursors", exec: function(y) {
y.alignCursors();
}, bindKey: { win: "Ctrl-Alt-A", mac: "Ctrl-Alt-A" }, scrollIntoView: "cursor" }, { name: "findAll", description: "Find all", exec: function(y) {
y.findAll();
}, bindKey: { win: "Ctrl-Alt-K", mac: "Ctrl-Alt-G" }, scrollIntoView: "cursor", readOnly: true }], f.multiSelectCommands = [{ name: "singleSelection", description: "Single selection", bindKey: "esc", exec: function(y) {
y.exitMultiSelectMode();
}, scrollIntoView: "cursor", readOnly: true, isAvailable: function(y) {
return y && y.inMultiSelectMode;
} }], A = A("../keyboard/hash_handler").HashHandler, f.keyboardHandler = new A(f.multiSelectCommands);
}), ace.define("ace/multi_select", ["require", "exports", "module", "ace/range_list", "ace/range", "ace/selection", "ace/mouse/multi_select_handler", "ace/lib/event", "ace/lib/lang", "ace/commands/multi_select_commands", "ace/search", "ace/edit_session", "ace/editor", "ace/config"], function(A, f, R) {
var y = A("./range_list").RangeList, C = A("./range").Range, d = A("./selection").Selection, h = A("./mouse/multi_select_handler").onMouseDown, l = A("./lib/event"), n = A("./lib/lang"), o = A("./commands/multi_select_commands");
f.commands = o.defaultCommands.concat(o.multiSelectCommands);
var i = new (A("./search")).Search(), a = A("./edit_session").EditSession, a = ((function() {
this.getSelectionMarkers = function() {
return this.$selectionMarkers;
};
}).call(a.prototype), (function() {
this.ranges = null, this.rangeList = null, this.addRange = function(e2, t) {
if (e2) {
if (!this.inMultiSelectMode && this.rangeCount === 0) {
var s = this.toOrientedRange();
if (this.rangeList.add(s), this.rangeList.add(e2), this.rangeList.ranges.length != 2)
return this.rangeList.removeAll(), t || this.fromOrientedRange(e2);
this.rangeList.removeAll(), this.rangeList.add(s), this.$onAddRange(s);
}
return e2.cursor || (e2.cursor = e2.end), s = this.rangeList.add(e2), this.$onAddRange(e2), s.length && this.$onRemoveRange(s), 1 < this.rangeCount && !this.inMultiSelectMode && (this._signal("multiSelect"), this.inMultiSelectMode = true, this.session.$undoSelect = false, this.rangeList.attach(this.session)), t || this.fromOrientedRange(e2);
}
}, this.toSingleRange = function(e2) {
e2 = e2 || this.ranges[0];
var t = this.rangeList.removeAll();
t.length && this.$onRemoveRange(t), e2 && this.fromOrientedRange(e2);
}, this.substractPoint = function(e2) {
if (e2 = this.rangeList.substractPoint(e2), e2)
return this.$onRemoveRange(e2), e2[0];
}, this.mergeOverlappingRanges = function() {
var e2 = this.rangeList.merge();
e2.length && this.$onRemoveRange(e2);
}, this.$onAddRange = function(e2) {
this.rangeCount = this.rangeList.ranges.length, this.ranges.unshift(e2), this._signal("addRange", { range: e2 });
}, this.$onRemoveRange = function(e2) {
var t;
this.rangeCount = this.rangeList.ranges.length, this.rangeCount == 1 && this.inMultiSelectMode && (t = this.rangeList.ranges.pop(), e2.push(t), this.rangeCount = 0);
for (var s = e2.length; s--; ) {
var c = this.ranges.indexOf(e2[s]);
this.ranges.splice(c, 1);
}
this._signal("removeRange", { ranges: e2 }), this.rangeCount === 0 && this.inMultiSelectMode && (this.inMultiSelectMode = false, this._signal("singleSelect"), this.session.$undoSelect = true, this.rangeList.detach(this.session)), (t = t || this.ranges[0]) && !t.isEqual(this.getRange()) && this.fromOrientedRange(t);
}, this.$initRangeList = function() {
this.rangeList || (this.rangeList = new y(), this.ranges = [], this.rangeCount = 0);
}, this.getAllRanges = function() {
return this.rangeCount ? this.rangeList.ranges.concat() : [this.getRange()];
}, this.splitIntoLines = function() {
for (var e2 = this.ranges.length ? this.ranges : [this.getRange()], t = [], s = 0; s < e2.length; s++) {
var c = e2[s], p = c.start.row, g = c.end.row;
if (p === g)
t.push(c.clone());
else {
for (t.push(new C(p, c.start.column, p, this.session.getLine(p).length)); ++p < g; )
t.push(this.getLineRange(p, true));
t.push(new C(g, 0, g, c.end.column));
}
s != 0 || this.isBackwards() || (t = t.reverse());
}
for (this.toSingleRange(), s = t.length; s--; )
this.addRange(t[s]);
}, this.joinSelections = function() {
var t = this.rangeList.ranges, e2 = t[t.length - 1], t = C.fromPoints(t[0].start, e2.end);
this.toSingleRange(), this.setSelectionRange(t, e2.cursor == e2.start);
}, this.toggleBlockSelection = function() {
var e2, t;
1 < this.rangeCount ? (t = (e2 = this.rangeList.ranges)[e2.length - 1], e2 = C.fromPoints(e2[0].start, t.end), this.toSingleRange(), this.setSelectionRange(e2, t.cursor == t.start)) : (e2 = this.session.documentToScreenPosition(this.cursor), t = this.session.documentToScreenPosition(this.anchor), this.rectangularRangeBlock(e2, t).forEach(this.addRange, this));
}, this.rectangularRangeBlock = function(e2, t, s) {
var c, p, g, b, w, E, M, B2 = [], Z = e2.column < t.column, k = (b = (Z ? (c = e2.column, p = t.column, g = e2.offsetX, t) : (c = t.column, p = e2.column, g = t.offsetX, e2)).offsetX, e2.row < t.row);
E = (k ? (w = e2.row, t) : (w = t.row, e2)).row, c < 0 && (c = 0), (w = w < 0 ? 0 : w) == E && (s = true);
for (var u, _, v = w; v <= E; v++) {
var $ = C.fromPoints(this.session.screenToDocumentPosition(v, c, g), this.session.screenToDocumentPosition(v, p, b));
if ($.isEmpty()) {
if (M && (u = $.end, _ = M, u.row == _.row) && u.column == _.column)
break;
M = $.end;
}
$.cursor = Z ? $.start : $.end, B2.push($);
}
if (k && B2.reverse(), !s) {
for (var G = B2.length - 1; B2[G].isEmpty() && 0 < G; )
G--;
if (0 < G)
for (var W = 0; B2[W].isEmpty(); )
W++;
for (var X = G; W <= X; X--)
B2[X].isEmpty() && B2.splice(X, 1);
}
return B2;
};
}).call(d.prototype), A("./editor").Editor);
function r(e2) {
var t, s;
function c(p) {
s && (t.renderer.setMouseCursor(""), s = false);
}
e2.$multiselectOnSessionChange || (e2.$onAddRange = e2.$onAddRange.bind(e2), e2.$onRemoveRange = e2.$onRemoveRange.bind(e2), e2.$onMultiSelect = e2.$onMultiSelect.bind(e2), e2.$onSingleSelect = e2.$onSingleSelect.bind(e2), e2.$multiselectOnSessionChange = f.onSessionChange.bind(e2), e2.$checkMultiselectChange = e2.$checkMultiselectChange.bind(e2), e2.$multiselectOnSessionChange(e2), e2.on("changeSession", e2.$multiselectOnSessionChange), e2.on("mousedown", h), e2.commands.addCommands(o.defaultCommands), (t = e2).textInput && (e2 = t.textInput.getElement(), s = false, l.addListener(e2, "keydown", function(p) {
p = p.keyCode == 18 && !(p.ctrlKey || p.shiftKey || p.metaKey), t.$blockSelectEnabled && p ? s || (t.renderer.setMouseCursor("crosshair"), s = true) : s && c();
}, t), l.addListener(e2, "keyup", c, t), l.addListener(e2, "blur", c, t)));
}
(function() {
this.updateSelectionMarkers = function() {
this.renderer.updateCursor(), this.renderer.updateBackMarkers();
}, this.addSelectionMarker = function(e2) {
e2.cursor || (e2.cursor = e2.end);
var t = this.getSelectionStyle();
return e2.marker = this.session.addMarker(e2, "ace_selection", t), this.session.$selectionMarkers.push(e2), this.session.selectionMarkerCount = this.session.$selectionMarkers.length, e2;
}, this.removeSelectionMarker = function(e2) {
e2.marker && (this.session.removeMarker(e2.marker), (e2 = this.session.$selectionMarkers.indexOf(e2)) != -1 && this.session.$selectionMarkers.splice(e2, 1), this.session.selectionMarkerCount = this.session.$selectionMarkers.length);
}, this.removeSelectionMarkers = function(e2) {
for (var t = this.session.$selectionMarkers, s = e2.length; s--; ) {
var c = e2[s];
c.marker && (this.session.removeMarker(c.marker), (c = t.indexOf(c)) != -1) && t.splice(c, 1);
}
this.session.selectionMarkerCount = t.length;
}, this.$onAddRange = function(e2) {
this.addSelectionMarker(e2.range), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
}, this.$onRemoveRange = function(e2) {
this.removeSelectionMarkers(e2.ranges), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
}, this.$onMultiSelect = function(e2) {
this.inMultiSelectMode || (this.inMultiSelectMode = true, this.setStyle("ace_multiselect"), this.keyBinding.addKeyboardHandler(o.keyboardHandler), this.commands.setDefaultHandler("exec", this.$onMultiSelectExec), this.renderer.updateCursor(), this.renderer.updateBackMarkers());
}, this.$onSingleSelect = function(e2) {
this.session.multiSelect.inVirtualMode || (this.inMultiSelectMode = false, this.unsetStyle("ace_multiselect"), this.keyBinding.removeKeyboardHandler(o.keyboardHandler), this.commands.removeDefaultHandler("exec", this.$onMultiSelectExec), this.renderer.updateCursor(), this.renderer.updateBackMarkers(), this._emit("changeSelection"));
}, this.$onMultiSelectExec = function(e2) {
var t, s = e2.command, c = e2.editor;
if (c.multiSelect)
return s.multiSelectAction ? t = s.multiSelectAction == "forEach" ? c.forEachSelection(s, e2.args) : s.multiSelectAction == "forEachLine" ? c.forEachSelection(s, e2.args, true) : s.multiSelectAction == "single" ? (c.exitMultiSelectMode(), s.exec(c, e2.args || {})) : s.multiSelectAction(c, e2.args || {}) : (t = s.exec(c, e2.args || {}), c.multiSelect.addRange(c.multiSelect.toOrientedRange()), c.multiSelect.mergeOverlappingRanges()), t;
}, this.forEachSelection = function(e2, t, s) {
if (!this.inVirtualSelectionMode) {
var c, E = s && s.keepOrder, p = s == 1 || s && s.$byLines, g = this.session, s = this.selection, b = s.rangeList, w = (E ? s : b).ranges;
if (!w.length)
return e2.exec ? e2.exec(this, t || {}) : e2(this, t || {});
var E = s._eventRegistry, M = (s._eventRegistry = {}, new d(g));
this.inVirtualSelectionMode = true;
for (var B2 = w.length; B2--; ) {
if (p)
for (; 0 < B2 && w[B2].start.row == w[B2 - 1].end.row; )
B2--;
M.fromOrientedRange(w[B2]), M.index = B2, this.selection = g.selection = M;
var Z = e2.exec ? e2.exec(this, t || {}) : e2(this, t || {});
c || Z === void 0 || (c = Z), M.toOrientedRange(w[B2]);
}
return M.detach(), this.selection = g.selection = s, this.inVirtualSelectionMode = false, s._eventRegistry = E, s.mergeOverlappingRanges(), s.ranges[0] && s.fromOrientedRange(s.ranges[0]), b = this.renderer.$scrollAnimation, this.onCursorChange(), this.onSelectionChange(), b && b.from == b.to && this.renderer.animateScrolling(b.from), c;
}
}, this.exitMultiSelectMode = function() {
this.inMultiSelectMode && !this.inVirtualSelectionMode && this.multiSelect.toSingleRange();
}, this.getSelectedText = function() {
var e2 = "";
if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {
for (var t = this.multiSelect.rangeList.ranges, s = [], c = 0; c < t.length; c++)
s.push(this.session.getTextRange(t[c]));
var p = this.session.getDocument().getNewLineCharacter();
(e2 = s.join(p)).length == (s.length - 1) * p.length && (e2 = "");
} else
this.selection.isEmpty() || (e2 = this.session.getTextRange(this.getSelectionRange()));
return e2;
}, this.$checkMultiselectChange = function(e2, t) {
var s;
this.inMultiSelectMode && !this.inVirtualSelectionMode && (s = this.multiSelect.ranges[0], this.multiSelect.isEmpty() && t == this.multiSelect.anchor || ((s = t == this.multiSelect.anchor ? s.cursor == s.start ? s.end : s.start : s.cursor).row != t.row || this.session.$clipPositionToDocument(s.row, s.column).column != t.column ? this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()) : this.multiSelect.mergeOverlappingRanges()));
}, this.findAll = function(e2, t, s) {
(t = t || {}).needle = e2 || t.needle, t.needle == null && (c = this.selection.isEmpty() ? this.selection.getWordRange() : this.selection.getRange(), t.needle = this.session.getTextRange(c)), this.$search.set(t);
var c, p = this.$search.findAll(this.session);
if (!p.length)
return 0;
var g = this.multiSelect;
s || g.toSingleRange(p[0]);
for (var b = p.length; b--; )
g.addRange(p[b], true);
return c && g.rangeList.rangeAtPoint(c.start) && g.addRange(c, true), p.length;
}, this.selectMoreLines = function(e2, t) {
var s, c, p, g = this.selection.toOrientedRange(), b = g.cursor == g.end, w = this.session.documentToScreenPosition(g.cursor), E = (this.selection.$desiredColumn && (w.column = this.selection.$desiredColumn), this.session.screenToDocumentPosition(w.row + e2, w.column));
e2 = g.isEmpty() ? E : (s = this.session.documentToScreenPosition(b ? g.end : g.start), this.session.screenToDocumentPosition(s.row + e2, s.column)), b ? (c = C.fromPoints(E, e2)).cursor = c.start : (c = C.fromPoints(e2, E)).cursor = c.end, c.desiredColumn = w.column, this.selection.inMultiSelectMode ? t && (p = g.cursor) : this.selection.addRange(g), this.selection.addRange(c), p && this.selection.substractPoint(p);
}, this.transposeSelections = function(e2) {
for (var t = this.session, s = t.multiSelect, c = s.ranges, p = c.length; p--; )
(b = c[p]).isEmpty() && (w = t.getWordRange(b.start.row, b.start.column), b.start.row = w.start.row, b.start.column = w.start.column, b.end.row = w.end.row, b.end.column = w.end.column);
s.mergeOverlappingRanges();
for (var g = [], p = c.length; p--; ) {
var b = c[p];
g.unshift(t.getTextRange(b));
}
for (e2 < 0 ? g.unshift(g.pop()) : g.push(g.shift()), p = c.length; p--; ) {
var w = (b = c[p]).clone();
t.replace(b, g[p]), b.start.row = w.start.row, b.start.column = w.start.column;
}
s.fromOrientedRange(s.ranges[0]);
}, this.selectMore = function(e2, t, s) {
var c, p = this.session, g = p.multiSelect.toOrientedRange();
g.isEmpty() && ((g = p.getWordRange(g.start.row, g.start.column)).cursor = e2 == -1 ? g.start : g.end, this.multiSelect.addRange(g), s) || (s = p.getTextRange(g), p = p, s = s, c = e2, i.$options.wrap = true, i.$options.needle = s, i.$options.backwards = c == -1, (s = i.find(p)) && (s.cursor = e2 == -1 ? s.start : s.end, this.session.unfold(s), this.multiSelect.addRange(s), this.renderer.scrollCursorIntoView(null, 0.5)), t && this.multiSelect.substractPoint(g.cursor));
}, this.alignCursors = function() {
var e2 = this.session, t = e2.multiSelect, s = t.ranges, c = -1, p = s.filter(function(u) {
if (u.cursor.row == c)
return true;
c = u.cursor.row;
});
if (s.length && p.length != s.length - 1) {
p.forEach(function(u) {
t.substractPoint(u.cursor);
});
var g = 0, b = 1 / 0, w = s.map(function(_) {
var _ = _.cursor, v = e2.getLine(_.row).substr(_.column).search(/\S/g);
return _.column > g && (g = _.column), (v = v == -1 ? 0 : v) < b && (b = v), v;
});
s.forEach(function(u, G) {
var v = u.cursor, $ = g - v.column, G = w[G] - b;
G < $ ? e2.insert(v, n.stringRepeat(" ", $ - G)) : e2.remove(new C(v.row, v.column, v.row, v.column - $ + G)), u.start.column = u.end.column = g, u.start.row = u.end.row = v.row, u.cursor = u.end;
}), t.fromOrientedRange(s[0]), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
} else {
var p = this.selection.getRange(), E = p.start.row, M = p.end.row, s = E == M;
if (s) {
for (var B2, Z = this.session.getLength(); B2 = this.session.getLine(M), /[=:]/.test(B2) && ++M < Z; )
;
for (; B2 = this.session.getLine(E), /[=:]/.test(B2) && 0 < --E; )
;
E < 0 && (E = 0), Z <= M && (M = Z - 1);
}
var k = this.session.removeFullLines(E, M), k = this.$reAlignText(k, s);
this.session.insert({ row: E, column: 0 }, k.join(`
`) + `
`), s || (p.start.column = 0, p.end.column = k[k.length - 1].length), this.selection.setRange(p);
}
}, this.$reAlignText = function(e2, t) {
var s, c, p, g = true, b = true;
return e2.map(function(M) {
var B2 = M.match(/(\s*)(.*?)(\s*)([=:].*)/);
return B2 ? (s == null ? (s = B2[1].length, c = B2[2].length, p = B2[3].length) : (s + c + p != B2[1].length + B2[2].length + B2[3].length && (b = false), s != B2[1].length && (g = false), s > B2[1].length && (s = B2[1].length), c < B2[2].length && (c = B2[2].length), p > B2[3].length && (p = B2[3].length)), B2) : [M];
}).map(t ? E : g ? b ? function(M) {
return M[2] ? w(s + c - M[2].length) + M[2] + w(p) + M[4].replace(/^([=:])\s+/, "$1 ") : M[0];
} : E : function(M) {
return M[2] ? w(s) + M[2] + w(p) + M[4].replace(/^([=:])\s+/, "$1 ") : M[0];
});
function w(M) {
return n.stringRepeat(" ", M);
}
function E(M) {
return M[2] ? w(s) + M[2] + w(c - M[2].length + p) + M[4].replace(/^([=:])\s+/, "$1 ") : M[0];
}
};
}).call(a.prototype), f.onSessionChange = function(s) {
var t = s.session, s = (t && !t.multiSelect && (t.$selectionMarkers = [], t.selection.$initRangeList(), t.multiSelect = t.selection), this.multiSelect = t && t.multiSelect, s.oldSession);
s && (s.multiSelect.off("addRange", this.$onAddRange), s.multiSelect.off("removeRange", this.$onRemoveRange), s.multiSelect.off("multiSelect", this.$onMultiSelect), s.multiSelect.off("singleSelect", this.$onSingleSelect), s.multiSelect.lead.off("change", this.$checkMultiselectChange), s.multiSelect.anchor.off("change", this.$checkMultiselectChange)), t && (t.multiSelect.on("addRange", this.$onAddRange), t.multiSelect.on("removeRange", this.$onRemoveRange), t.multiSelect.on("multiSelect", this.$onMultiSelect), t.multiSelect.on("singleSelect", this.$onSingleSelect), t.multiSelect.lead.on("change", this.$checkMultiselectChange), t.multiSelect.anchor.on("change", this.$checkMultiselectChange)), t && this.inMultiSelectMode != t.selection.inMultiSelectMode && (t.selection.inMultiSelectMode ? this.$onMultiSelect() : this.$onSingleSelect());
}, f.MultiSelect = r, A("./config").defineOptions(a.prototype, "editor", { enableMultiselect: { set: function(e2) {
r(this), e2 ? this.on("mousedown", h) : this.off("mousedown", h);
}, value: true }, enableBlockSelect: { set: function(e2) {
this.$blockSelectEnabled = e2;
}, value: true } });
}), ace.define("ace/mode/folding/fold_mode", ["require", "exports", "module", "ace/range"], function(C, f, R) {
var y = C("../../range").Range, C = f.FoldMode = function() {
};
(function() {
this.foldingStartMarker = null, this.foldingStopMarker = null, this.getFoldWidget = function(d, h, l) {
return d = d.getLine(l), this.foldingStartMarker.test(d) ? "start" : h == "markbeginend" && this.foldingStopMarker && this.foldingStopMarker.test(d) ? "end" : "";
}, this.getFoldWidgetRange = function(d, h, l) {
return null;
}, this.indentationBlock = function(d, h, l) {
var n = /\S/, o = d.getLine(h), i = o.search(n);
if (i != -1) {
for (var a, l = l || o.length, r = d.getLength(), o = h, e2 = h; ++h < r; ) {
var t = d.getLine(h).search(n);
if (t != -1) {
if (t <= i && (t = d.getTokenAt(h, 0), !t || t.type !== "string"))
break;
e2 = h;
}
}
return o < e2 ? (a = d.getLine(e2).length, new y(o, l, e2, a)) : void 0;
}
}, this.openingBracketBlock = function(d, h, l, n, o) {
if (l = { row: l, column: n + 1 }, n = d.$findClosingBracket(h, l, o), n)
return (h = (h = d.foldWidgets[n.row]) == null ? d.getFoldWidget(n.row) : h) == "start" && n.row > l.row && (n.row--, n.column = d.getLine(n.row).length), y.fromPoints(l, n);
}, this.closingBracketBlock = function(d, h, l, n, o) {
if (l = { row: l, column: n }, n = d.$findOpeningBracket(h, l), n)
return n.column++, l.column--, y.fromPoints(n, l);
};
}).call(C.prototype);
}), ace.define("ace/ext/error_marker", ["require", "exports", "module", "ace/line_widgets", "ace/lib/dom", "ace/range", "ace/config"], function(A, f, R) {
var y = A("../line_widgets").LineWidgets, C = A("../lib/dom"), d = A("../range").Range, h = A("../config").nls;
function l(n, o, i) {
var a = n.getAnnotations().sort(d.comparePoints);
if (a.length) {
var r = function(s, c, p) {
for (var g = 0, b = s.length - 1; g <= b; ) {
var w = g + b >> 1, E = p(c, s[w]);
if (0 < E)
g = 1 + w;
else {
if (!(E < 0))
return w;
b = w - 1;
}
}
return -(g + 1);
}(a, { row: o, column: -1 }, d.comparePoints), e2 = ((r = r < 0 ? -r - 1 : r) >= a.length ? r = 0 < i ? 0 : a.length - 1 : r === 0 && i < 0 && (r = a.length - 1), a[r]);
if (e2 && i) {
if (e2.row === o) {
for (; (e2 = a[r += i]) && e2.row === o; )
;
if (!e2)
return a.slice();
}
var t = [];
for (o = e2.row; t[i < 0 ? "unshift" : "push"](e2), (e2 = a[r += i]) && e2.row == o; )
;
return t.length && t;
}
}
}
f.showErrorMarker = function(n, c) {
var i, a = n.session, r = (a.widgetManager || (a.widgetManager = new y(a), a.widgetManager.attach(n)), n.getCursorPosition()), s = r.row, p = a.widgetManager.getWidgetsAtRow(s).filter(function(g) {
return g.type == "errorMarker";
})[0], s = (p ? p.destroy() : s -= c, l(a, s, c));
if (s)
c = s[0], r.column = (c.pos && typeof c.column != "number" ? c.pos.sc : c.column) || 0, r.row = c.row, i = n.renderer.$gutterLayer.$annotations[r.row];
else {
if (p)
return;
i = { text: [h("Looks good!")], className: "ace_ok" };
}
n.session.unfold(r.row), n.selection.moveToPosition(r);
function e2(g, b, w) {
if (b === 0 && (w === "esc" || w === "return"))
return t.destroy(), { command: "null" };
}
var t = { row: r.row, fixedWidth: true, coverGutter: true, el: C.createElement("div"), type: "errorMarker" }, s = t.el.appendChild(C.createElement("div")), c = t.el.appendChild(C.createElement("div")), p = (c.className = "error_widget_arrow " + i.className, n.renderer.$cursorLayer.getPixelPosition(r).left);
c.style.left = p + n.renderer.gutterWidth - 5 + "px", t.el.className = "error_widget_wrapper", s.className = "error_widget " + i.className, s.innerHTML = i.text.join(" "), s.appendChild(C.createElement("div")), t.destroy = function() {
n.$mouseHandler.isMousePressed || (n.keyBinding.removeKeyboardHandler(e2), a.widgetManager.removeLineWidget(t), n.off("changeSelection", t.destroy), n.off("changeSession", t.destroy), n.off("mouseup", t.destroy), n.off("change", t.destroy));
}, n.keyBinding.addKeyboardHandler(e2), n.on("changeSelection", t.destroy), n.on("changeSession", t.destroy), n.on("mouseup", t.destroy), n.on("change", t.destroy), n.session.widgetManager.addLineWidget(t), t.el.onmousedown = n.focus.bind(n), n.renderer.scrollCursorIntoView(null, 0.5, { bottom: t.el.offsetHeight });
}, C.importCssString(`
.error_widget_wrapper {
background: inherit;
color: inherit;
border:none
}
.error_widget {
border-top: solid 2px;
border-bottom: solid 2px;
margin: 5px 0;
padding: 10px 40px;
white-space: pre-wrap;
}
.error_widget.ace_error, .error_widget_arrow.ace_error{
border-color: #ff5a5a
}
.error_widget.ace_warning, .error_widget_arrow.ace_warning{
border-color: #F1D817
}
.error_widget.ace_info, .error_widget_arrow.ace_info{
border-color: #5a5a5a
}
.error_widget.ace_ok, .error_widget_arrow.ace_ok{
border-color: #5aaa5a
}
.error_widget_arrow {
position: absolute;
border: solid 5px;
border-top-color: transparent!important;
border-right-color: transparent!important;
border-left-color: transparent!important;
top: -5px;
}
`, "error_marker.css", false);
}), ace.define("ace/ace", ["require", "exports", "module", "ace/lib/dom", "ace/range", "ace/editor", "ace/edit_session", "ace/undomanager", "ace/virtual_renderer", "ace/worker/worker_client", "ace/keyboard/hash_handler", "ace/placeholder", "ace/multi_select", "ace/mode/folding/fold_mode", "ace/theme/textmate", "ace/ext/error_marker", "ace/config", "ace/loader_build"], function(A, f, R) {
A("./loader_build")(f);
var y = A("./lib/dom"), C = A("./range").Range, d = A("./editor").Editor, h = A("./edit_session").EditSession, l = A("./undomanager").UndoManager, n = A("./virtual_renderer").VirtualRenderer;
A("./worker/worker_client"), A("./keyboard/hash_handler"), A("./placeholder"), A("./multi_select"), A("./mode/folding/fold_mode"), A("./theme/textmate"), A("./ext/error_marker"), f.config = A("./config"), f.edit = function(o, i) {
if (typeof o == "string") {
var a = o;
if (!(o = document.getElementById(a)))
throw new Error("ace.edit can't find div #" + a);
}
var r, e2;
return o && o.env && o.env.editor instanceof d ? o.env.editor : (a = "", o && /input|textarea/i.test(o.tagName) ? (a = (r = o).value, o = y.createElement("pre"), r.parentNode.replaceChild(o, r)) : o && (a = o.textContent, o.innerHTML = ""), a = f.createEditSession(a), o = new d(new n(o), a, i), e2 = { document: a, editor: o, onResize: o.resize.bind(o, null) }, r && (e2.textarea = r), o.on("destroy", function() {
e2.editor.container.env = null;
}), o.container.env = o.env = e2, o);
}, f.createEditSession = function(o, i) {
return o = new h(o, i), o.setUndoManager(new l()), o;
}, f.Range = C, f.Editor = d, f.EditSession = h, f.UndoManager = l, f.VirtualRenderer = n, f.version = f.config.version;
}), ace.require(["ace/ace"], function(A) {
A && (A.config.init(true), A.define = ace.define);
var f, R = /* @__PURE__ */ function() {
return this;
}();
for (f in (R = (R = R || typeof window > "u" ? R : window) || typeof self > "u" ? R : self).ace || (R.ace = A), A)
A.hasOwnProperty(f) && (R.ace[f] = A[f]);
R.ace.default = R.ace, le && (le.exports = R.ace);
});
}, 4317: function(le, m, D) {
le = D.nmd(le), ace.define("ace/snippets", ["require", "exports", "module", "ace/lib/dom", "ace/lib/oop", "ace/lib/event_emitter", "ace/lib/lang", "ace/range", "ace/range_list", "ace/keyboard/hash_handler", "ace/tokenizer", "ace/clipboard", "ace/editor"], function(U, x, H) {
var z = U("./lib/dom"), r = U("./lib/oop"), j = U("./lib/event_emitter").EventEmitter, Y = U("./lib/lang"), P = U("./range").Range, N = U("./range_list").RangeList, A = U("./keyboard/hash_handler").HashHandler, f = U("./tokenizer").Tokenizer, R = U("./clipboard"), y = { CURRENT_WORD: function(e2) {
return e2.session.getTextRange(e2.session.getWordRange());
}, SELECTION: function(e2, t, s) {
return e2 = e2.session.getTextRange(), s ? e2.replace(/\n\r?([ \t]*\S)/g, `
` + s + "$1") : e2;
}, CURRENT_LINE: function(e2) {
return e2.session.getLine(e2.getCursorPosition().row);
}, PREV_LINE: function(e2) {
return e2.session.getLine(e2.getCursorPosition().row - 1);
}, LINE_INDEX: function(e2) {
return e2.getCursorPosition().row;
}, LINE_NUMBER: function(e2) {
return e2.getCursorPosition().row + 1;
}, SOFT_TABS: function(e2) {
return e2.session.getUseSoftTabs() ? "YES" : "NO";
}, TAB_SIZE: function(e2) {
return e2.session.getTabSize();
}, CLIPBOARD: function(e2) {
return R.getText && R.getText();
}, FILENAME: function(e2) {
return /[^/\\]*$/.exec(this.FILEPATH(e2))[0];
}, FILENAME_BASE: function(e2) {
return /[^/\\]*$/.exec(this.FILEPATH(e2))[0].replace(/\.[^.]*$/, "");
}, DIRECTORY: function(e2) {
return this.FILEPATH(e2).replace(/[^/\\]*$/, "");
}, FILEPATH: function(e2) {
return "/not implemented.txt";
}, WORKSPACE_NAME: function() {
return "Unknown";
}, FULLNAME: function() {
return "Unknown";
}, BLOCK_COMMENT_START: function(e2) {
return e2 = e2.session.$mode || {}, e2.blockComment && e2.blockComment.start || "";
}, BLOCK_COMMENT_END: function(e2) {
return e2 = e2.session.$mode || {}, e2.blockComment && e2.blockComment.end || "";
}, LINE_COMMENT: function(e2) {
return (e2.session.$mode || {}).lineCommentStart || "";
}, CURRENT_YEAR: C.bind(null, { year: "numeric" }), CURRENT_YEAR_SHORT: C.bind(null, { year: "2-digit" }), CURRENT_MONTH: C.bind(null, { month: "numeric" }), CURRENT_MONTH_NAME: C.bind(null, { month: "long" }), CURRENT_MONTH_NAME_SHORT: C.bind(null, { month: "short" }), CURRENT_DATE: C.bind(null, { day: "2-digit" }), CURRENT_DAY_NAME: C.bind(null, { weekday: "long" }), CURRENT_DAY_NAME_SHORT: C.bind(null, { weekday: "short" }), CURRENT_HOUR: C.bind(null, { hour: "2-digit", hour12: false }), CURRENT_MINUTE: C.bind(null, { minute: "2-digit" }), CURRENT_SECOND: C.bind(null, { second: "2-digit" }) };
function C(e2) {
return e2 = (/* @__PURE__ */ new Date()).toLocaleString("en-us", e2), e2.length == 1 ? "0" + e2 : e2;
}
y.SELECTED_TEXT = y.SELECTION, h.prototype.getTokenizer = function() {
return h.$tokenizer || this.createTokenizer();
}, h.prototype.createTokenizer = function() {
function e2(c) {
return c = c.substr(1), /^\d+$/.test(c) ? [{ tabstopId: parseInt(c, 10) }] : [{ text: c }];
}
function t(c) {
return "(?:[^\\\\" + c + "]|\\\\.)";
}
var s = { regex: "/(" + t("/") + "+)/", onMatch: function(c, p, g) {
return g = g[0], g.fmtString = true, g.guard = c.slice(1, -1), g.flag = "";
}, next: "formatString" };
return h.$tokenizer = new f({ start: [{ regex: /\\./, onMatch: function(c, p, g) {
var b = c[1];
return [c = b == "}" && g.length || "`$\\".indexOf(b) != -1 ? b : c];
} }, { regex: /}/, onMatch: function(c, p, g) {
return [g.length ? g.shift() : c];
} }, { regex: /\$(?:\d+|\w+)/, onMatch: e2 }, { regex: /\$\{[\dA-Z_a-z]+/, onMatch: function(c, p, g) {
return c = e2(c.substr(1)), g.unshift(c[0]), c;
}, next: "snippetVar" }, { regex: /\n/, token: "newline", merge: false }], snippetVar: [{ regex: "\\|" + t("\\|") + "*\\|", onMatch: function(c, p, g) {
return c = c.slice(1, -1).replace(/\\[,|\\]|,/g, function(b) {
return b.length == 2 ? b[1] : "\0";
}).split("\0").map(function(b) {
return { value: b };
}), [(g[0].choices = c)[0]];
}, next: "start" }, s, { regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "start" }], formatString: [{ regex: /:/, onMatch: function(c, p, g) {
return g.length && g[0].expectElse ? (g[0].expectElse = false, g[0].ifEnd = { elseEnd: g[0] }, [g[0].ifEnd]) : ":";
} }, { regex: /\\./, onMatch: function(c, p, g) {
var b = c[1];
return b == "}" && g.length || "`$\\".indexOf(b) != -1 ? c = b : b == "n" ? c = `
` : b == "t" ? c = " " : "ulULE".indexOf(b) != -1 && (c = { changeCase: b, local: "a" < b }), [c];
} }, { regex: "/\\w*}", onMatch: function(c, p, g) {
return g = g.shift(), g && (g.flag = c.slice(1, -1)), this.next = g && g.tabstopId ? "start" : "", [g || c];
}, next: "start" }, { regex: /\$(?:\d+|\w+)/, onMatch: function(c, p, g) {
return [{ text: c.slice(1) }];
} }, { regex: /\${\w+/, onMatch: function(c, p, g) {
return c = { text: c.slice(2) }, g.unshift(c), [c];
}, next: "formatStringVar" }, { regex: /\n/, token: "newline", merge: false }, { regex: /}/, onMatch: function(c, p, g) {
return g = g.shift(), this.next = g && g.tabstopId ? "start" : "", [g || c];
}, next: "start" }], formatStringVar: [{ regex: /:\/\w+}/, onMatch: function(c, p, g) {
return g[0].formatFunction = c.slice(2, -1), [g.shift()];
}, next: "formatString" }, s, { regex: /:[\?\-+]?/, onMatch: function(c, p, g) {
c[1] == "+" && (g[0].ifEnd = g[0]), c[1] == "?" && (g[0].expectElse = true);
}, next: "formatString" }, { regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "formatString" }] });
}, h.prototype.tokenizeTmSnippet = function(e2, t) {
return this.getTokenizer().getLineTokens(e2, t).tokens.map(function(s) {
return s.value || s;
});
}, h.prototype.getVariableValue = function(e2, t, s) {
var c;
return /^\d+$/.test(t) ? (this.variables.__ || {})[t] || "" : /^[A-Z]\d+$/.test(t) ? (this.variables[t[0] + "__"] || {})[t.substr(1)] || "" : (t = t.replace(/^TM_/, ""), !this.variables.hasOwnProperty(t) || (c = typeof (c = this.variables[t]) == "function" ? this.variables[t](e2, t, s) : c) == null ? "" : c);
}, h.prototype.tmStrFormat = function(e2, t, s) {
var c, p, g, b;
return t.fmt ? (c = t.flag || "", p = t.guard, p = new RegExp(p, c.replace(/[^gim]/g, "")), g = typeof t.fmt == "string" ? this.tokenizeTmSnippet(t.fmt, "formatString") : t.fmt, b = this, e2.replace(p, function() {
for (var w = b.variables.__, E = (b.variables.__ = [].slice.call(arguments), b.resolveVariables(g, s)), M = "E", B2 = 0; B2 < E.length; B2++) {
var Z, k = E[B2];
typeof k == "object" ? (E[B2] = "", k.changeCase && k.local ? (Z = E[B2 + 1]) && typeof Z == "string" && (k.changeCase == "u" ? E[B2] = Z[0].toUpperCase() : E[B2] = Z[0].toLowerCase(), E[B2 + 1] = Z.substr(1)) : k.changeCase && (M = k.changeCase)) : M == "U" ? E[B2] = k.toUpperCase() : M == "L" && (E[B2] = k.toLowerCase());
}
return b.variables.__ = w, E.join("");
})) : e2;
}, h.prototype.tmFormatFunction = function(e2, t, s) {
return t.formatFunction == "upcase" ? e2.toUpperCase() : t.formatFunction == "downcase" ? e2.toLowerCase() : e2;
}, h.prototype.resolveVariables = function(e2, t) {
for (var s = [], c = "", p = true, g = 0; g < e2.length; g++) {
var b, w = e2[g];
typeof w == "string" ? (s.push(w), w == `
` ? (p = true, c = "") : p && (c = /^\t*/.exec(w)[0], p = /\S/.test(w))) : w && (p = false, w.fmtString && ((b = e2.indexOf(w, g + 1)) == -1 && (b = e2.length), w.fmt = e2.slice(g + 1, b), g = b), w.text ? (b = this.getVariableValue(t, w.text, c) + "", w.fmtString && (b = this.tmStrFormat(b, w, t)), (b = w.formatFunction ? this.tmFormatFunction(b, w, t) : b) && !w.ifEnd ? (s.push(b), E(w)) : !b && w.ifEnd && E(w.ifEnd)) : w.elseEnd ? E(w.elseEnd) : w.tabstopId == null && w.changeCase == null || s.push(w));
}
function E(M) {
M = e2.indexOf(M, g + 1), M != -1 && (g = M);
}
return s;
}, h.prototype.getDisplayTextForSnippet = function(e2, t) {
return l.call(this, e2, t).text;
}, h.prototype.insertSnippetForSelection = function(w, c, p) {
var c = l.call(this, w, c, p = p === void 0 ? {} : p), p = w.getSelectionRange(), g = w.session.replace(p, c.text), b = new n(w), w = w.inVirtualSelectionMode && w.selection.index;
b.addTabstops(c.tabstops, p.start, g, w);
}, h.prototype.insertSnippet = function(e2, t, s) {
s === void 0 && (s = {});
var c = this;
if (e2.inVirtualSelectionMode)
return c.insertSnippetForSelection(e2, t, s);
e2.forEachSelection(function() {
c.insertSnippetForSelection(e2, t, s);
}, null, { keepOrder: true }), e2.tabstopManager && e2.tabstopManager.tabNext();
}, h.prototype.$getScope = function(e2) {
var t, s = e2.session.$mode.$id || "";
return (s = s.split("/").pop()) !== "html" && s !== "php" || (s !== "php" || e2.session.$mode.inlinePhp || (s = "html"), t = e2.getCursorPosition(), (e2 = typeof (e2 = e2.session.getState(t.row)) == "object" ? e2[0] : e2).substring && (e2.substring(0, 3) == "js-" ? s = "javascript" : e2.substring(0, 4) == "css-" ? s = "css" : e2.substring(0, 4) == "php-" && (s = "php"))), s;
}, h.prototype.getActiveScopes = function(t) {
var t = this.$getScope(t), s = [t], c = this.snippetMap;
return c[t] && c[t].includeScopes && s.push.apply(s, c[t].includeScopes), s.push("_"), s;
}, h.prototype.expandWithTab = function(e2, t) {
var s = this, c = e2.forEachSelection(function() {
return s.expandSnippetForSelection(e2, t);
}, null, { keepOrder: true });
return c && e2.tabstopManager && e2.tabstopManager.tabNext(), c;
}, h.prototype.expandSnippetForSelection = function(e2, t) {
var s, c = e2.getCursorPosition(), p = e2.session.getLine(c.row), g = p.substring(0, c.column), b = p.substr(c.column), w = this.snippetMap;
return this.getActiveScopes(e2).some(function(E) {
return E = w[E], !!(s = E ? this.findMatchingSnippet(E, g, b) : s);
}, this), !!s && (t && t.dryRun || (e2.session.doc.removeInLine(c.row, c.column - s.replaceBefore.length, c.column + s.replaceAfter.length), this.variables.M__ = s.matchBefore, this.variables.T__ = s.matchAfter, this.insertSnippetForSelection(e2, s.content), this.variables.M__ = this.variables.T__ = null), true);
}, h.prototype.findMatchingSnippet = function(e2, t, s) {
for (var c = e2.length; c--; ) {
var p = e2[c];
if ((!p.startRe || p.startRe.test(t)) && (!p.endRe || p.endRe.test(s)) && (p.startRe || p.endRe))
return p.matchBefore = p.startRe ? p.startRe.exec(t) : [""], p.matchAfter = p.endRe ? p.endRe.exec(s) : [""], p.replaceBefore = p.triggerRe ? p.triggerRe.exec(t)[0] : "", p.replaceAfter = p.endTriggerRe ? p.endTriggerRe.exec(s)[0] : "", p;
}
}, h.prototype.register = function(e2, t) {
var s = this.snippetMap, c = this.snippetNameMap, p = this;
function g(E) {
return (E = E && !/^\^?\(.*\)\$?$|^\\b$/.test(E) ? "(?:" + E + ")" : E) || "";
}
function b(E, M, B2) {
return E = g(E), M = g(M), B2 ? (E = M + E) && E[E.length - 1] != "$" && (E += "$") : (E += M) && E[0] != "^" && (E = "^" + E), new RegExp(E);
}
function w(E) {
E.scope || (E.scope = t || "_"), t = E.scope, s[t] || (s[t] = [], c[t] = {});
var M, B2 = c[t];
E.name && ((M = B2[E.name]) && p.unregister(M), B2[E.name] = E), s[t].push(E), E.prefix && (E.tabTrigger = E.prefix), !E.content && E.body && (E.content = Array.isArray(E.body) ? E.body.join(`
`) : E.body), E.tabTrigger && !E.trigger && (!E.guard && /^\w/.test(E.tabTrigger) && (E.guard = "\\b"), E.trigger = Y.escapeRegExp(E.tabTrigger)), (E.trigger || E.guard || E.endTrigger || E.endGuard) && (E.startRe = b(E.trigger, E.guard, true), E.triggerRe = new RegExp(E.trigger), E.endRe = b(E.endTrigger, E.endGuard, true), E.endTriggerRe = new RegExp(E.endTrigger));
}
e2 = e2 || [], Array.isArray(e2) ? e2.forEach(w) : Object.keys(e2).forEach(function(E) {
w(e2[E]);
}), this._signal("registerSnippets", { scope: t });
}, h.prototype.unregister = function(e2, t) {
var s = this.snippetMap, c = this.snippetNameMap;
function p(g) {
var b = c[g.scope || t];
b && b[g.name] && (delete b[g.name], 0 <= (g = (b = s[g.scope || t]) && b.indexOf(g))) && b.splice(g, 1);
}
e2.content ? p(e2) : Array.isArray(e2) && e2.forEach(p);
}, h.prototype.parseSnippetFile = function(e2) {
e2 = e2.replace(/\r/g, "");
for (var t, s, c, p = [], g = {}, b = /^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm; s = b.exec(e2); ) {
if (s[1])
try {
g = JSON.parse(s[1]), p.push(g);
} catch {
}
s[4] ? (g.content = s[4].replace(/^\t/gm, ""), p.push(g), g = {}) : (t = s[2], s = s[3], t == "regex" ? (g.guard = (c = /\/((?:[^\/\\]|\\.)*)|$/g).exec(s)[1], g.trigger = c.exec(s)[1], g.endTrigger = c.exec(s)[1], g.endGuard = c.exec(s)[1]) : t == "snippet" ? (g.tabTrigger = s.match(/^\S*/)[0], g.name || (g.name = s)) : t && (g[t] = s));
}
return p;
}, h.prototype.getSnippetByName = function(e2, t) {
var s, c = this.snippetNameMap;
return this.getActiveScopes(t).some(function(p) {
return p = c[p], !!(s = p ? p[e2] : s);
}, this), s;
};
var d = h;
function h() {
this.snippetMap = {}, this.snippetNameMap = {}, this.variables = y;
}
r.implement(d.prototype, j);
var l = function(e2, t, s) {
s === void 0 && (s = {});
for (var c = e2.getCursorPosition(), p = e2.session.getLine(c.row), g = e2.session.getTabString(), b = p.match(/^\s*/)[0], w = (c.column < b.length && (b = b.slice(0, c.column)), t = t.replace(/\r/g, ""), this.tokenizeTmSnippet(t)), E = (w = (w = this.resolveVariables(w, e2)).map(function(W) {
return W != `
` || s.excludeExtraIndent ? typeof W == "string" ? W.replace(/\t/g, g) : W : W + b;
}), []), M = (w.forEach(function(W, X) {
var Q, K, ne;
typeof W == "object" && (ne = W.tabstopId, (Q = E[ne]) || ((Q = E[ne] = []).index = ne, Q.value = "", Q.parents = {}), Q.indexOf(W) === -1) && (W.choices && !Q.choices && (Q.choices = W.choices), Q.push(W), (K = w.indexOf(W, X + 1)) !== -1) && ((ne = w.slice(X + 1, K)).some(function(T) {
return typeof T == "object";
}) && !Q.value ? Q.value = ne : !ne.length || Q.value && typeof Q.value == "string" || (Q.value = ne.join("")));
}), E.forEach(function(W) {
W.length = 0;
}), {}), B2 = 0; B2 < w.length; B2++) {
var Z, k, u, _ = w[B2];
typeof _ == "object" && (u = _.tabstopId, Z = E[u], k = w.indexOf(_, B2 + 1), M[u] ? M[u] === _ && (delete M[u], Object.keys(M).forEach(function(W) {
Z.parents[W] = true;
})) : (M[u] = _, typeof (u = Z.value) != "string" ? u = function(W) {
for (var X = [], Q = 0; Q < W.length; Q++) {
if (typeof (K = W[Q]) == "object") {
if (M[K.tabstopId])
continue;
var K = X[W.lastIndexOf(K, Q - 1)] || { tabstopId: K.tabstopId };
}
X[Q] = K;
}
return X;
}(u) : _.fmt && (u = this.tmStrFormat(u, _, e2)), w.splice.apply(w, [B2 + 1, Math.max(0, k - B2)].concat(u, _)), Z.indexOf(_) === -1 && Z.push(_)));
}
var v = 0, $ = 0, G = "";
return w.forEach(function(W) {
var X;
typeof W == "string" ? (1 < (X = W.split(`
`)).length ? ($ = X[X.length - 1].length, v += X.length - 1) : $ += W.length, G += W) : W && (W.start ? W.end = { row: v, column: $ } : W.start = { row: v, column: $ });
}), { text: G, tabstops: E, tokens: w };
}, n = (o.prototype.attach = function(e2) {
this.$openTabstops = null, this.selectedTabstop = null, this.editor = e2, this.session = e2.session, this.editor.on("change", this.$onChange), this.editor.on("changeSelection", this.$onChangeSelection), this.editor.on("changeSession", this.$onChangeSession), this.editor.commands.on("afterExec", this.$onAfterExec), this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler);
}, o.prototype.detach = function() {
this.tabstops.forEach(this.removeTabstopMarkers, this), this.ranges.length = 0, this.tabstops.length = 0, this.selectedTabstop = null, this.editor.off("change", this.$onChange), this.editor.off("changeSelection", this.$onChangeSelection), this.editor.off("changeSession", this.$onChangeSession), this.editor.commands.off("afterExec", this.$onAfterExec), this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler), this.editor.tabstopManager = null, this.session = null, this.editor = null;
}, o.prototype.onChange = function(e2) {
for (var t = e2.action[0] == "r", s = this.selectedTabstop || {}, c = s.parents || {}, p = this.tabstops.slice(), g = 0; g < p.length; g++) {
var b = p[g], w = b == s || c[b.index];
if (b.rangeList.$bias = w ? 0 : 1, e2.action == "remove" && b !== s)
for (var w = b.parents && b.parents[s.index], E = (E = b.rangeList.pointIndex(e2.start, w)) < 0 ? -E - 1 : E + 1, w = b.rangeList.pointIndex(e2.end, w), M = b.rangeList.ranges.slice(E, w < 0 ? -w - 1 : w - 1), B2 = 0; B2 < M.length; B2++)
this.removeRange(M[B2]);
b.rangeList.$onChange(e2);
}
var Z = this.session;
this.$inChange || !t || Z.getLength() != 1 || Z.getValue() || this.detach();
}, o.prototype.updateLinkedFields = function() {
var e2 = this.selectedTabstop;
if (e2 && e2.hasLinkedRanges && e2.firstNonLinked) {
this.$inChange = true;
for (var t = this.session, s = t.getTextRange(e2.firstNonLinked), c = 0; c < e2.length; c++) {
var p, g = e2[c];
g.linked && (p = g.original, p = x.snippetManager.tmStrFormat(s, p, this.editor), t.replace(g, p));
}
this.$inChange = false;
}
}, o.prototype.onAfterExec = function(e2) {
e2.command && !e2.command.readOnly && this.updateLinkedFields();
}, o.prototype.onChangeSelection = function() {
if (this.editor) {
for (var e2 = this.editor.selection.lead, t = this.editor.selection.anchor, s = this.editor.selection.isEmpty(), c = 0; c < this.ranges.length; c++)
if (!this.ranges[c].linked) {
var p = this.ranges[c].contains(e2.row, e2.column), g = s || this.ranges[c].contains(t.row, t.column);
if (p && g)
return;
}
this.detach();
}
}, o.prototype.onChangeSession = function() {
this.detach();
}, o.prototype.tabNext = function(s) {
var t = this.tabstops.length, s = this.index + (s || 1), s = Math.min(Math.max(s, 1), t);
this.selectTabstop(s = s == t ? 0 : s), s === 0 && this.detach();
}, o.prototype.selectTabstop = function(e2) {
this.$openTabstops = null;
var t = this.tabstops[this.index];
if (t && this.addTabstopMarkers(t), this.index = e2, (t = this.tabstops[this.index]) && t.length) {
if (e2 = (this.selectedTabstop = t).firstNonLinked || t, t.choices && (e2.cursor = e2.start), this.editor.inVirtualSelectionMode)
this.editor.selection.fromOrientedRange(e2);
else {
var s = this.editor.multiSelect;
s.toSingleRange(e2);
for (var c = 0; c < t.length; c++)
t.hasLinkedRanges && t[c].linked || s.addRange(t[c].clone(), true);
}
this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler), this.selectedTabstop && this.selectedTabstop.choices && this.editor.execCommand("startAutocomplete", { matches: this.selectedTabstop.choices });
}
}, o.prototype.addTabstops = function(e2, t, s) {
var c = this.useLink || !this.editor.getOption("enableMultiselect");
this.$openTabstops || (this.$openTabstops = []), e2[0] || (s = P.fromPoints(s, s), a(s.start, t), a(s.end, t), e2[0] = [s], e2[0].index = 0);
var p = [this.index + 1, 0], g = this.ranges;
e2.forEach(function(b, w) {
for (var E = this.$openTabstops[w] || b, M = 0; M < b.length; M++) {
var B2 = b[M], Z = P.fromPoints(B2.start, B2.end || B2.start);
i(Z.start, t), i(Z.end, t), Z.original = B2, Z.tabstop = E, g.push(Z), E != b ? E.unshift(Z) : E[M] = Z, B2.fmtString || E.firstNonLinked && c ? (Z.linked = true, E.hasLinkedRanges = true) : E.firstNonLinked || (E.firstNonLinked = Z);
}
E.firstNonLinked || (E.hasLinkedRanges = false), E === b && (p.push(E), this.$openTabstops[w] = E), this.addTabstopMarkers(E), E.rangeList = E.rangeList || new N(), E.rangeList.$bias = 0, E.rangeList.addList(E);
}, this), 2 < p.length && (this.tabstops.length && p.push(p.splice(2, 1)[0]), this.tabstops.splice.apply(this.tabstops, p));
}, o.prototype.addTabstopMarkers = function(e2) {
var t = this.session;
e2.forEach(function(s) {
s.markerId || (s.markerId = t.addMarker(s, "ace_snippet-marker", "text"));
});
}, o.prototype.removeTabstopMarkers = function(e2) {
var t = this.session;
e2.forEach(function(s) {
t.removeMarker(s.markerId), s.markerId = null;
});
}, o.prototype.removeRange = function(e2) {
var t = e2.tabstop.indexOf(e2);
t != -1 && e2.tabstop.splice(t, 1), (t = this.ranges.indexOf(e2)) != -1 && this.ranges.splice(t, 1), (t = e2.tabstop.rangeList.ranges.indexOf(e2)) != -1 && e2.tabstop.splice(t, 1), this.session.removeMarker(e2.markerId), e2.tabstop.length || ((t = this.tabstops.indexOf(e2.tabstop)) != -1 && this.tabstops.splice(t, 1), this.tabstops.length) || this.detach();
}, o);
function o(e2) {
if (this.index = 0, this.ranges = [], this.tabstops = [], e2.tabstopManager)
return e2.tabstopManager;
(e2.tabstopManager = this).$onChange = this.onChange.bind(this), this.$onChangeSelection = Y.delayedCall(this.onChangeSelection.bind(this)).schedule, this.$onChangeSession = this.onChangeSession.bind(this), this.$onAfterExec = this.onAfterExec.bind(this), this.attach(e2);
}
n.prototype.keyboardHandler = new A(), n.prototype.keyboardHandler.bindKeys({ Tab: function(e2) {
x.snippetManager && x.snippetManager.expandWithTab(e2) || (e2.tabstopManager.tabNext(1), e2.renderer.scrollCursorIntoView());
}, "Shift-Tab": function(e2) {
e2.tabstopManager.tabNext(-1), e2.renderer.scrollCursorIntoView();
}, Esc: function(e2) {
e2.tabstopManager.detach();
} });
var i = function(e2, t) {
e2.row == 0 && (e2.column += t.column), e2.row += t.row;
}, a = function(e2, t) {
e2.row == t.row && (e2.column -= t.column), e2.row -= t.row;
}, r = (z.importCssString(`
.ace_snippet-marker {
-moz-box-sizing: border-box;
box-sizing: border-box;
background: rgba(194, 193, 208, 0.09);
border: 1px dotted rgba(211, 208, 235, 0.62);
position: absolute;
}`, "snippets.css", false), x.snippetManager = new d(), U("./editor").Editor);
(function() {
this.insertSnippet = function(e2, t) {
return x.snippetManager.insertSnippet(this, e2, t);
}, this.expandSnippet = function(e2) {
return x.snippetManager.expandWithTab(this, e2);
};
}).call(r.prototype);
}), ace.define("ace/autocomplete/popup", ["require", "exports", "module", "ace/virtual_renderer", "ace/editor", "ace/range", "ace/lib/event", "ace/lib/lang", "ace/lib/dom", "ace/config"], function(U, x, H) {
function z(d) {
return "suggest-aria-id:".concat(d);
}
function j(d) {
return (d = new P(d)).$maxLines = 4, (d = new N(d)).setHighlightActiveLine(false), d.setShowPrintMargin(false), d.renderer.setShowGutter(false), d.renderer.setHighlightGutterLine(false), d.$mouseHandler.$focusTimeout = 0, d.$highlightTagPending = true, d;
}
function Y(d) {
function h() {
}
function l() {
e2(-1);
}
var n, o = y.createElement("div"), i = new j(o), a = (d && d.appendChild(o), o.style.display = "none", i.renderer.content.style.cursor = "default", i.renderer.setStyle("ace_autocomplete"), i.renderer.$textLayer.element.setAttribute("role", "listbox"), i.renderer.$textLayer.element.setAttribute("aria-label", C("Autocomplete suggestions")), i.renderer.textarea.setAttribute("aria-hidden", "true"), i.setOption("displayIndentGuides", false), i.setOption("dragDelay", 150), i.focus = h, i.$isFocused = true, i.renderer.$cursorLayer.restartTimer = h, i.renderer.$cursorLayer.element.style.opacity = 0, i.renderer.$maxLines = 8, i.renderer.$keepTextAreaAtCursor = false, i.setHighlightActiveLine(false), i.session.highlight(""), i.session.$searchHighlight.clazz = "ace_highlight-marker", i.on("mousedown", function(t) {
var s = t.getDocumentPosition();
i.selection.moveToPosition(s), r.start.row = r.end.row = s.row, t.stop();
}), new A(-1, 0, -1, 1 / 0)), r = new A(-1, 0, -1, 1 / 0), e2 = (r.id = i.session.addMarker(r, "ace_active-line", "fullLine"), i.setSelectOnHover = function(t) {
t ? a.id && (i.session.removeMarker(a.id), a.id = null) : a.id = i.session.addMarker(a, "ace_line-hover", "fullLine");
}, i.setSelectOnHover(false), i.on("mousemove", function(t) {
var s;
n ? n.x == t.x && n.y == t.y || ((n = t).scrollTop = i.renderer.scrollTop, i.isMouseOver = true, s = n.getDocumentPosition().row, a.start.row != s && (a.id || i.setRow(s), e2(s))) : n = t;
}), i.renderer.on("beforeRender", function() {
var t;
n && a.start.row != -1 && (n.$pos = null, t = n.getDocumentPosition().row, a.id || i.setRow(t), e2(t, true));
}), i.renderer.on("afterRender", function() {
var t, s = i.getRow(), c = i.renderer.$textLayer, p = c.element.childNodes[s - c.config.firstRow], g = document.activeElement;
p !== c.selectedNode && c.selectedNode && (y.removeCssClass(c.selectedNode, "ace_selected"), g.removeAttribute("aria-activedescendant"), c.selectedNode.removeAttribute("id")), (c.selectedNode = p) && (y.addCssClass(p, "ace_selected"), t = z(s), p.id = t, c.element.setAttribute("aria-activedescendant", t), g.setAttribute("aria-activedescendant", t), p.setAttribute("role", "option"), p.setAttribute("aria-label", i.getData(s).value), p.setAttribute("aria-setsize", i.data.length), p.setAttribute("aria-posinset", s + 1), p.setAttribute("aria-describedby", "doc-tooltip"));
}), function(t, s) {
t !== a.start.row && (a.start.row = a.end.row = t, s || i.session._emit("changeBackMarker"), i._emit("changeHoverMarker"));
});
return i.getHoveredRow = function() {
return a.start.row;
}, f.addListener(i.container, "mouseout", function() {
i.isMouseOver = false, l();
}), i.on("hide", l), i.on("changeSelection", l), i.session.doc.getLength = function() {
return i.data.length;
}, i.session.doc.getLine = function(t) {
return t = i.data[t], typeof t == "string" ? t : t && t.value || "";
}, (d = i.session.bgTokenizer).$tokenizeRow = function(t) {
var s = i.data[t], c = [];
if (s) {
for (var p, g, b = (s = typeof s == "string" ? { value: s } : s).caption || s.value || s.name, w = b.toLowerCase(), E = (i.filterText || "").toLowerCase(), M = 0, B2 = 0, Z = 0; Z <= E.length; Z++)
Z != B2 && (s.matchMask & 1 << Z || Z == E.length) && (p = E.slice(B2, Z), B2 = Z, (g = w.indexOf(p, M)) != -1) && (k(b.slice(M, g), ""), M = g + p.length, k(b.slice(g, M), "completion-highlight"));
k(b.slice(M, b.length), ""), c.push({ type: "completion-spacer", value: " " }), s.meta && c.push({ type: "completion-meta", value: s.meta }), s.message && c.push({ type: "completion-message", value: s.message });
}
return c;
function k(u, _) {
u && c.push({ type: (s.className || "") + (_ || ""), value: u });
}
}, d.$updateOnChange = h, d.start = h, i.session.$computeWidth = function() {
return this.screenWidth = 0;
}, i.isOpen = false, i.isTopdown = false, i.autoSelect = true, i.filterText = "", i.isMouseOver = false, i.data = [], i.setData = function(t, s) {
i.filterText = s || "", i.setValue(R.stringRepeat(`
`, t.length), -1), i.data = t || [], i.setRow(0);
}, i.getData = function(t) {
return i.data[t];
}, i.getRow = function() {
return r.start.row;
}, i.setRow = function(t) {
t = Math.max(this.autoSelect ? 0 : -1, Math.min(this.data.length - 1, t)), r.start.row != t && (i.selection.clearSelection(), r.start.row = r.end.row = t || 0, i.session._emit("changeBackMarker"), i.moveCursorTo(t || 0, 0), i.isOpen) && i._signal("select");
}, i.on("changeSelection", function() {
i.isOpen && i.setRow(i.selection.lead.row), i.renderer.scrollCursorIntoView();
}), i.hide = function() {
this.container.style.display = "none", i.anchorPos = null, i.anchor = null, i.isOpen && (i.isOpen = false, this._signal("hide"));
}, i.tryShow = function(t, s, c, p) {
if (p || !i.isOpen || !i.anchorPos || !i.anchor || i.anchorPos.top !== t.top || i.anchorPos.left !== t.left || i.anchor !== c) {
var g = this.container, b = window.innerHeight, w = window.innerWidth, E = this.renderer, M = E.$maxLines * s * 1.4, B2 = { top: 0, bottom: 0, left: 0 }, Z = b - t.top - 3 * this.$borderSize - s, k = t.top - 3 * this.$borderSize, s = ((c = c || (k <= Z || M <= Z ? "bottom" : "top")) === "top" ? (B2.bottom = t.top - this.$borderSize, B2.top = B2.bottom - M) : c === "bottom" && (B2.top = t.top + s + this.$borderSize, B2.bottom = B2.top + M), 0 <= B2.top && B2.bottom <= b);
if (!p && !s)
return false;
E.$maxPixelHeight = s ? null : c === "top" ? k : Z, c === "top" ? (g.style.top = "", g.style.bottom = b - B2.bottom + "px", i.isTopdown = false) : (g.style.top = B2.top + "px", g.style.bottom = "", i.isTopdown = true), g.style.display = "", M = t.left, M + g.offsetWidth > w && (M = w - g.offsetWidth), g.style.left = M + "px", g.style.right = "", i.isOpen || (i.isOpen = true, this._signal("show"), n = null), i.anchorPos = t, i.anchor = c;
}
return true;
}, i.show = function(t, s, c) {
this.tryShow(t, s, c ? "bottom" : void 0, true);
}, i.goTo = function(t) {
var s = this.getRow(), c = this.session.getLength() - 1;
switch (t) {
case "up":
s = s <= 0 ? c : s - 1;
break;
case "down":
s = c <= s ? -1 : s + 1;
break;
case "start":
s = 0;
break;
case "end":
s = c;
}
this.setRow(s);
}, i.getTextLeftOffset = function() {
return this.$borderSize + this.renderer.$padding + this.$imageSize;
}, i.$imageSize = 0, i.$borderSize = 1, i;
}
var P = U("../virtual_renderer").VirtualRenderer, N = U("../editor").Editor, A = U("../range").Range, f = U("../lib/event"), R = U("../lib/lang"), y = U("../lib/dom"), C = U("../config").nls;
y.importCssString(`
.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
background-color: #CAD6FA;
z-index: 1;
}
.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
background-color: #3a674e;
}
.ace_editor.ace_autocomplete .ace_line-hover {
border: 1px solid #abbffe;
margin-top: -1px;
background: rgba(233,233,253,0.4);
position: absolute;
z-index: 2;
}
.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {
border: 1px solid rgba(109, 150, 13, 0.8);
background: rgba(58, 103, 78, 0.62);
}
.ace_completion-meta {
opacity: 0.5;
margin-left: 0.9em;
}
.ace_completion-message {
margin-left: 0.9em;
color: blue;
}
.ace_editor.ace_autocomplete .ace_completion-highlight{
color: #2d69c7;
}
.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{
color: #93ca12;
}
.ace_editor.ace_autocomplete {
width: 300px;
z-index: 200000;
border: 1px lightgray solid;
position: fixed;
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
line-height: 1.4;
background: #fefefe;
color: #111;
}
.ace_dark.ace_editor.ace_autocomplete {
border: 1px #484747 solid;
box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);
line-height: 1.4;
background: #25282c;
color: #c1c1c1;
}
.ace_autocomplete .ace_text-layer {
width: calc(100% - 8px);
}
.ace_autocomplete .ace_line {
display: flex;
align-items: center;
}
.ace_autocomplete .ace_line > * {
min-width: 0;
flex: 0 0 auto;
}
.ace_autocomplete .ace_line .ace_ {
flex: 0 1 auto;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.ace_autocomplete .ace_completion-spacer {
flex: 1;
}
.ace_autocomplete.ace_loading:after {
content: "";
position: absolute;
top: 0px;
height: 2px;
width: 8%;
background: blue;
z-index: 100;
animation: ace_progress 3s infinite linear;
animation-delay: 300ms;
transform: translateX(-100%) scaleX(1);
}
@keyframes ace_progress {
0% { transform: translateX(-100%) scaleX(1) }
50% { transform: translateX(625%) scaleX(2) }
100% { transform: translateX(1500%) scaleX(3) }
}
@media (prefers-reduced-motion) {
.ace_autocomplete.ace_loading:after {
transform: translateX(625%) scaleX(2);
animation: none;
}
}
`, "autocompletion.css", false), x.AcePopup = Y, x.$singleLineEditor = j, x.getAriaId = z;
}), ace.define("ace/autocomplete/inline_screenreader", ["require", "exports", "module"], function(U, x, H) {
function z(j) {
this.editor = j, this.screenReaderDiv = document.createElement("div"), this.screenReaderDiv.classList.add("ace_screenreader-only"), this.editor.container.appendChild(this.screenReaderDiv);
}
z.prototype.setScreenReaderContent = function(j) {
for (!this.popup && this.editor.completer && this.editor.completer.popup && (this.popup = this.editor.completer.popup, this.popup.renderer.on("afterRender", (function() {
var P = this.popup.getRow(), Y = this.popup.renderer.$textLayer, P = Y.element.childNodes[P - Y.config.firstRow];
if (P) {
for (var N = "doc-tooltip ", A = 0; A < this._lines.length; A++)
N += "ace-inline-screenreader-line-".concat(A, " ");
P.setAttribute("aria-describedby", N);
}
}).bind(this))); this.screenReaderDiv.firstChild; )
this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);
this._lines = j.split(/\r\n|\r|\n/), j = this.createCodeBlock(), this.screenReaderDiv.appendChild(j);
}, z.prototype.destroy = function() {
this.screenReaderDiv.remove();
}, z.prototype.createCodeBlock = function() {
var j = document.createElement("pre");
j.setAttribute("id", "ace-inline-screenreader");
for (var Y = 0; Y < this._lines.length; Y++) {
var P = document.createElement("code"), N = (P.setAttribute("id", "ace-inline-screenreader-line-".concat(Y)), document.createTextNode(this._lines[Y]));
P.appendChild(N), j.appendChild(P);
}
return j;
}, x.AceInlineScreenReader = z;
}), ace.define("ace/autocomplete/inline", ["require", "exports", "module", "ace/snippets", "ace/autocomplete/inline_screenreader"], function(U, x, H) {
var z = U("../snippets").snippetManager, j = U("./inline_screenreader").AceInlineScreenReader;
function Y() {
this.editor = null;
}
Y.prototype.show = function(P, N, A) {
if (A = A || "", P && this.editor && this.editor !== P && (this.hide(), this.editor = null, this.inlineScreenReader = null), !P || !N)
return false;
this.inlineScreenReader || (this.inlineScreenReader = new j(P));
var f = N.snippet ? z.getDisplayTextForSnippet(P, N.snippet) : N.value;
return !(N.hideInlinePreview || !f || !f.startsWith(A) || (this.editor = P, this.inlineScreenReader.setScreenReaderContent(f), (f = f.slice(A.length)) === "" ? P.removeGhostText() : P.setGhostText(f), 0));
}, Y.prototype.isOpen = function() {
return !!this.editor && !!this.editor.renderer.$ghostText;
}, Y.prototype.hide = function() {
return !!this.editor && (this.editor.removeGhostText(), true);
}, Y.prototype.destroy = function() {
this.hide(), this.editor = null, this.inlineScreenReader && (this.inlineScreenReader.destroy(), this.inlineScreenReader = null);
}, x.AceInline = Y;
}), ace.define("ace/autocomplete/util", ["require", "exports", "module"], function(U, x, H) {
x.parForEach = function(j, Y, P) {
var N = 0, A = j.length;
A === 0 && P();
for (var f = 0; f < A; f++)
Y(j[f], function(R, y) {
++N === A && P(R, y);
});
};
var z = /[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;
x.retrievePrecedingIdentifier = function(j, Y, P) {
P = P || z;
for (var N = [], A = Y - 1; 0 <= A && P.test(j[A]); A--)
N.push(j[A]);
return N.reverse().join("");
}, x.retrieveFollowingIdentifier = function(j, Y, P) {
P = P || z;
for (var N = [], A = Y; A < j.length && P.test(j[A]); A++)
N.push(j[A]);
return N;
}, x.getCompletionPrefix = function(j) {
var Y, P = j.getCursorPosition(), N = j.session.getLine(P.row);
return j.completers.forEach((function(A) {
A.identifierRegexps && A.identifierRegexps.forEach((function(f) {
!Y && f && (Y = this.retrievePrecedingIdentifier(N, P.column, f));
}).bind(this));
}).bind(this)), Y || this.retrievePrecedingIdentifier(N, P.column);
}, x.triggerAutocomplete = function(j) {
var Y = j.getCursorPosition(), P = j.session.getLine(Y.row)[Y.column === 0 ? 0 : Y.column - 1];
return j.completers.some(function(N) {
if (N.triggerCharacters && Array.isArray(N.triggerCharacters))
return N.triggerCharacters.includes(P);
});
};
}), ace.define("ace/autocomplete", ["require", "exports", "module", "ace/keyboard/hash_handler", "ace/autocomplete/popup", "ace/autocomplete/inline", "ace/autocomplete/popup", "ace/autocomplete/util", "ace/lib/lang", "ace/lib/dom", "ace/snippets", "ace/config", "ace/lib/event"], function(U, x, H) {
function z(r, e2) {
e2.completer && e2.completer.destroy();
}
var j = U("./keyboard/hash_handler").HashHandler, Y = U("./autocomplete/popup").AcePopup, P = U("./autocomplete/inline").AceInline, N = U("./autocomplete/popup").getAriaId, A = U("./autocomplete/util"), f = U("./lib/lang"), R = U("./lib/dom"), y = U("./snippets").snippetManager, C = U("./config"), d = U("./lib/event"), h = (l.prototype.$init = function() {
return this.popup = new Y(this.parentNode || document.body || document.documentElement), this.popup.on("click", (function(r) {
this.insertMatch(), r.stop();
}).bind(this)), this.popup.focus = this.editor.focus.bind(this.editor), this.popup.on("show", this.$onPopupShow.bind(this)), this.popup.on("hide", this.$onHidePopup.bind(this)), this.popup.on("select", this.$onPopupChange.bind(this)), d.addListener(this.popup.container, "mouseout", this.mouseOutListener.bind(this)), this.popup.on("changeHoverMarker", this.tooltipTimer.bind(null, null)), this.popup;
}, l.prototype.$initInline = function() {
if (this.inlineEnabled && !this.inlineRenderer)
return this.inlineRenderer = new P(), this.inlineRenderer;
}, l.prototype.getPopup = function() {
return this.popup || this.$init();
}, l.prototype.$onHidePopup = function() {
this.inlineRenderer && this.inlineRenderer.hide(), this.hideDocTooltip(), this.stickySelectionTimer.cancel(), this.stickySelection = false;
}, l.prototype.$onPopupChange = function(r) {
if (this.inlineRenderer && this.inlineEnabled) {
var r = r ? null : this.popup.getData(this.popup.getRow()), e2 = A.getCompletionPrefix(this.editor);
if (this.inlineRenderer.show(this.editor, r, e2) || this.inlineRenderer.hide(), this.popup.isMouseOver && this.setSelectOnHover)
return void this.tooltipTimer.call(null, null);
}
this.$updatePopupPosition(), this.tooltipTimer.call(null, null);
}, l.prototype.$onPopupShow = function(r) {
this.$onPopupChange(r), this.stickySelection = false, 0 <= this.stickySelectionDelay && this.stickySelectionTimer.schedule(this.stickySelectionDelay);
}, l.prototype.observeLayoutChanges = function() {
if (!this.$elements && this.editor) {
window.addEventListener("resize", this.onLayoutChange, { passive: true }), window.addEventListener("wheel", this.mousewheelListener);
for (var r = this.editor.container.parentNode, e2 = []; r; )
e2.push(r), r.addEventListener("scroll", this.onLayoutChange, { passive: true }), r = r.parentNode;
this.$elements = e2;
}
}, l.prototype.unObserveLayoutChanges = function() {
var r = this;
window.removeEventListener("resize", this.onLayoutChange, { passive: true }), window.removeEventListener("wheel", this.mousewheelListener), this.$elements && this.$elements.forEach(function(e2) {
e2.removeEventListener("scroll", r.onLayoutChange, { passive: true });
}), this.$elements = null;
}, l.prototype.onLayoutChange = function() {
if (!this.popup.isOpen)
return this.unObserveLayoutChanges();
this.$updatePopupPosition(), this.updateDocTooltip();
}, l.prototype.$updatePopupPosition = function() {
var r = this.editor, e2 = r.renderer, t = e2.layerConfig.lineHeight, s = e2.$cursorLayer.getPixelPosition(this.base, true), c = (s.left -= this.popup.getTextLeftOffset(), r.container.getBoundingClientRect()), c = (s.top += c.top - e2.layerConfig.offset, s.left += c.left - r.renderer.scrollLeft, s.left += e2.gutterWidth, { top: s.top, left: s.left });
e2.$ghostText && e2.$ghostTextWidget && this.base.row === e2.$ghostText.position.row && (c.top += e2.$ghostTextWidget.el.offsetHeight), this.popup.tryShow(c, t, "bottom") || this.popup.tryShow(s, t, "top") || this.popup.show(s, t);
}, l.prototype.openPopup = function(r, e2, t) {
this.$firstOpenTimer.cancel(), this.popup || this.$init(), this.inlineEnabled && !this.inlineRenderer && this.$initInline(), this.popup.autoSelect = this.autoSelect, this.popup.setSelectOnHover(this.setSelectOnHover);
var s = this.popup.data[this.popup.getRow()], s = (this.popup.setData(this.completions.filtered, this.completions.filterText), this.editor.textInput.setAriaOptions && this.editor.textInput.setAriaOptions({ activeDescendant: N(this.popup.getRow()), inline: this.inlineEnabled }), r.keyBinding.addKeyboardHandler(this.keyboardHandler), this.popup.data.indexOf(s));
s && this.stickySelection ? this.popup.setRow(this.autoSelect ? s : -1) : this.popup.setRow(this.autoSelect ? 0 : -1), t ? e2 || this.detach() : (this.popup.setTheme(r.getTheme()), this.popup.setFontSize(r.getFontSize()), this.$updatePopupPosition(), this.tooltipNode && this.updateDocTooltip()), this.changeTimer.cancel(), this.observeLayoutChanges();
}, l.prototype.detach = function() {
this.editor && (this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler), this.editor.off("changeSelection", this.changeListener), this.editor.off("blur", this.blurListener), this.editor.off("mousedown", this.mousedownListener), this.editor.off("mousewheel", this.mousewheelListener)), this.$firstOpenTimer.cancel(), this.changeTimer.cancel(), this.hideDocTooltip(), this.completionProvider && this.completionProvider.detach(), this.popup && this.popup.isOpen && this.popup.hide(), this.base && this.base.detach(), this.activated = false, this.completionProvider = this.completions = this.base = null, this.unObserveLayoutChanges();
}, l.prototype.changeListener = function(r) {
var e2 = this.editor.selection.lead;
(e2.row != this.base.row || e2.column < this.base.column) && this.detach(), this.activated ? this.changeTimer.schedule() : this.detach();
}, l.prototype.blurListener = function(r) {
var e2 = document.activeElement, t = this.editor.textInput.getElement(), s = r.relatedTarget && this.tooltipNode && this.tooltipNode.contains(r.relatedTarget), c = this.popup && this.popup.container;
e2 == t || e2.parentNode == c || s || e2 == this.tooltipNode || r.relatedTarget == t || this.detach();
}, l.prototype.mousedownListener = function(r) {
this.detach();
}, l.prototype.mousewheelListener = function(r) {
this.popup.isMouseOver || this.detach();
}, l.prototype.mouseOutListener = function(r) {
this.popup.isOpen && this.$updatePopupPosition();
}, l.prototype.goTo = function(r) {
this.popup.goTo(r);
}, l.prototype.insertMatch = function(r, e2) {
var t;
return !!(r = r || this.popup.getData(this.popup.getRow())) && (r.value === "" ? this.detach() : (t = this.completions, r = this.getCompletionProvider().insertMatch(this.editor, r, t.filterText, e2), this.completions == t && this.detach(), r));
}, l.prototype.showPopup = function(r, e2) {
this.editor && this.detach(), this.activated = true, (this.editor = r).completer != this && (r.completer && r.completer.detach(), r.completer = this), r.on("changeSelection", this.changeListener), r.on("blur", this.blurListener), r.on("mousedown", this.mousedownListener), r.on("mousewheel", this.mousewheelListener), this.updateCompletions(false, e2);
}, l.prototype.getCompletionProvider = function(r) {
return this.completionProvider || (this.completionProvider = new n(r)), this.completionProvider;
}, l.prototype.gatherCompletions = function(r, e2) {
return this.getCompletionProvider().gatherCompletions(r, e2);
}, l.prototype.updateCompletions = function(r, e2) {
var t, s;
return r && this.base && this.completions ? (t = this.editor.getCursorPosition(), (s = this.editor.session.getTextRange({ start: this.base, end: t })) == this.completions.filterText ? void 0 : (this.completions.setFilter(s), this.completions.filtered.length && (this.completions.filtered.length != 1 || this.completions.filtered[0].value != s || this.completions.filtered[0].snippet) ? void this.openPopup(this.editor, s, r) : this.detach())) : e2 && e2.matches ? (t = this.editor.getSelectionRange().start, this.base = this.editor.session.doc.createAnchor(t.row, t.column), this.base.$insertRight = true, this.completions = new i(e2.matches), this.openPopup(this.editor, "", r)) : (e2 = this.editor.getSession(), t = this.editor.getCursorPosition(), s = A.getCompletionPrefix(this.editor), this.base = e2.doc.createAnchor(t.row, t.column - s.length), this.base.$insertRight = true, e2 = { exactMatch: this.exactMatch, ignoreCaption: this.ignoreCaption }, this.getCompletionProvider({ prefix: s, pos: t }).provideCompletions(this.editor, e2, (function(c, p, g) {
var b, w = p.filtered, E = A.getCompletionPrefix(this.editor);
if (this.$firstOpenTimer.cancel(), g) {
if (!w.length)
return (b = typeof (b = !this.autoShown && this.emptyMessage) == "function" ? this.emptyMessage(E) : b) ? (this.completions = new i([{ caption: b, value: "" }]), void this.openPopup(this.editor, E, r)) : this.detach();
if (w.length == 1 && w[0].value == E && !w[0].snippet)
return this.detach();
if (this.autoInsert && !this.autoShown && w.length == 1)
return this.insertMatch(w[0]);
}
this.completions = p, this.openPopup(this.editor, E, r), this.popup.renderer.setStyle("ace_loading", !g);
}).bind(this)), void (this.autoShown || this.popup && this.popup.isOpen || this.$firstOpenTimer.delay(this.stickySelectionDelay / 2)));
}, l.prototype.cancelContextMenu = function() {
this.editor.$mouseHandler.cancelContextMenu();
}, l.prototype.updateDocTooltip = function() {
var r = this.popup, e2 = this.completions.filtered, t = e2 && (e2[r.getHoveredRow()] || e2[r.getRow()]), s = null;
if (!t || !this.editor || !this.popup.isOpen)
return this.hideDocTooltip();
for (var c = this.editor.completers.length, p = 0; p < c; p++) {
var g = this.editor.completers[p];
if (g.getDocTooltip && t.completerId === g.id) {
s = g.getDocTooltip(t);
break;
}
}
if (!(s = typeof (s = s || typeof t == "string" ? s : t) == "string" ? { docText: s } : s) || !s.docHTML && !s.docText)
return this.hideDocTooltip();
this.showDocTooltip(s);
}, l.prototype.showDocTooltip = function(t) {
this.tooltipNode || (this.tooltipNode = R.createElement("div"), this.tooltipNode.style.margin = 0, this.tooltipNode.style.pointerEvents = "auto", this.tooltipNode.tabIndex = -1, this.tooltipNode.onblur = this.blurListener.bind(this), this.tooltipNode.onclick = this.onTooltipClick.bind(this), this.tooltipNode.id = "doc-tooltip", this.tooltipNode.setAttribute("role", "tooltip"));
var e2 = this.editor.renderer.theme, e2 = (this.tooltipNode.className = "ace_tooltip ace_doc-tooltip " + (e2.isDark ? "ace_dark " : "") + (e2.cssClass || ""), this.tooltipNode), t = (t.docHTML ? e2.innerHTML = t.docHTML : t.docText && (e2.textContent = t.docText), e2.parentNode || this.popup.container.appendChild(this.tooltipNode), this.popup), s = t.container.getBoundingClientRect();
e2.style.top = t.container.style.top, e2.style.bottom = t.container.style.bottom, e2.style.display = "block", window.innerWidth - s.right < 320 ? s.left < 320 ? (t.isTopdown ? e2.style.top = s.bottom + "px" : e2.style.top = t.container.offsetTop - e2.offsetHeight + "px", e2.style.left = s.left + "px", e2.style.right = "", e2.style.bottom = "") : (e2.style.right = window.innerWidth - s.left + "px", e2.style.left = "") : (e2.style.left = s.right + 1 + "px", e2.style.right = "");
}, l.prototype.hideDocTooltip = function() {
var r;
this.tooltipTimer.cancel(), this.tooltipNode && (r = this.tooltipNode, this.editor.isFocused() || document.activeElement != r || this.editor.focus(), this.tooltipNode = null, r.parentNode) && r.parentNode.removeChild(r);
}, l.prototype.onTooltipClick = function(r) {
for (var e2 = r.target; e2 && e2 != this.tooltipNode; ) {
if (e2.nodeName == "A" && e2.href) {
e2.rel = "noreferrer", e2.target = "_blank";
break;
}
e2 = e2.parentNode;
}
}, l.prototype.destroy = function() {
var r;
this.detach(), this.popup && (this.popup.destroy(), r = this.popup.container) && r.parentNode && r.parentNode.removeChild(r), this.editor && this.editor.completer == this && (this.editor.off("destroy", z), this.editor.completer = null), this.inlineRenderer = this.popup = this.editor = null;
}, l);
function l() {
this.autoInsert = false, this.autoSelect = true, this.autoShown = false, this.exactMatch = false, this.inlineEnabled = false, this.keyboardHandler = new j(), this.keyboardHandler.bindKeys(this.commands), this.parentNode = null, this.setSelectOnHover = false, this.stickySelectionDelay = 500, this.blurListener = this.blurListener.bind(this), this.changeListener = this.changeListener.bind(this), this.mousedownListener = this.mousedownListener.bind(this), this.mousewheelListener = this.mousewheelListener.bind(this), this.onLayoutChange = this.onLayoutChange.bind(this), this.changeTimer = f.delayedCall((function() {
this.updateCompletions(true);
}).bind(this)), this.tooltipTimer = f.delayedCall(this.updateDocTooltip.bind(this), 50), this.stickySelectionTimer = f.delayedCall((function() {
this.stickySelection = true;
}).bind(this), this.stickySelectionDelay), this.$firstOpenTimer = f.delayedCall((function() {
var r, e2 = this.completionProvider && this.completionProvider.initialPosition;
this.autoShown || this.popup && this.popup.isOpen || !e2 || (r = [{ caption: C.nls("Loading..."), value: "" }], this.completions = new i(r), this.openPopup(this.editor, e2.prefix, false), this.popup.renderer.setStyle("ace_loading", true));
}).bind(this), this.stickySelectionDelay);
}
h.prototype.commands = { Up: function(r) {
r.completer.goTo("up");
}, Down: function(r) {
r.completer.goTo("down");
}, "Ctrl-Up|Ctrl-Home": function(r) {
r.completer.goTo("start");
}, "Ctrl-Down|Ctrl-End": function(r) {
r.completer.goTo("end");
}, Esc: function(r) {
r.completer.detach();
}, Return: function(r) {
return r.completer.insertMatch();
}, "Shift-Return": function(r) {
r.completer.insertMatch(null, { deleteSuffix: true });
}, Tab: function(r) {
var e2 = r.completer.insertMatch();
if (e2 || r.tabstopManager)
return e2;
r.completer.goTo("down");
}, PageUp: function(r) {
r.completer.popup.gotoPageUp();
}, PageDown: function(r) {
r.completer.popup.gotoPageDown();
} }, h.for = function(r) {
return r.completer instanceof h || (r.completer && (r.completer.destroy(), r.completer = null), C.get("sharedPopups") ? (h.$sharedInstance || (h.$sharedInstance = new h()), r.completer = h.$sharedInstance) : (r.completer = new h(), r.once("destroy", z))), r.completer;
}, h.startCommand = { name: "startAutocomplete", exec: function(r, e2) {
var t = h.for(r);
t.autoInsert = false, t.autoSelect = true, t.autoShown = false, t.showPopup(r, e2), t.cancelContextMenu();
}, bindKey: "Ctrl-Space|Ctrl-Shift-Space|Alt-Space" }, o.prototype.insertByIndex = function(r, e2, t) {
return !(!this.completions || !this.completions.filtered) && this.insertMatch(r, this.completions.filtered[e2], t);
}, o.prototype.insertMatch = function(r, e2, t) {
if (!e2)
return false;
if (r.startOperation({ command: { name: "insertMatch" } }), e2.completer && e2.completer.insertMatch)
e2.completer.insertMatch(r, e2);
else {
if (!this.completions)
return false;
var s = this.completions.filterText.length, c = 0;
if (e2.range && e2.range.start.row === e2.range.end.row && (s = (s -= this.initialPosition.prefix.length) + (this.initialPosition.pos.column - e2.range.start.column), c += e2.range.end.column - this.initialPosition.pos.column), s || c)
for (var p, g = r.selection.getAllRanges ? r.selection.getAllRanges() : [r.getSelectionRange()], b = 0; p = g[b]; b++)
p.start.column -= s, p.end.column += c, r.session.remove(p);
e2.snippet ? y.insertSnippet(r, e2.snippet) : this.$insertString(r, e2), e2.command && e2.command === "startAutocomplete" && r.execCommand(e2.command);
}
return r.endOperation(), true;
}, o.prototype.$insertString = function(r, e2) {
e2 = e2.value || e2, r.execCommand("insertstring", e2);
}, o.prototype.gatherCompletions = function(r, e2) {
var t = r.getSession(), s = r.getCursorPosition(), c = A.getCompletionPrefix(r), p = [], g = (this.completers = r.completers, r.completers.length);
return r.completers.forEach(function(b, w) {
b.getCompletions(r, t, s, c, function(E, M) {
b.hideInlinePreview && (M = M.map(function(B2) {
return Object.assign(B2, { hideInlinePreview: b.hideInlinePreview });
})), !E && M && (p = p.concat(M)), e2(null, { prefix: A.getCompletionPrefix(r), matches: p, finished: --g == 0 });
});
}), true;
}, o.prototype.provideCompletions = function(r, e2, t) {
var s = (function(g) {
var b = g.prefix, w = g.matches;
this.completions = new i(w), e2.exactMatch && (this.completions.exactMatch = true), e2.ignoreCaption && (this.completions.ignoreCaption = true), this.completions.setFilter(b), (g.finished || this.completions.filtered.length) && t(null, this.completions, g.finished);
}).bind(this), c = true, p = null;
this.gatherCompletions(r, (function(g, b) {
this.active && (g && (t(g, [], true), this.detach()), b.prefix.indexOf(b.prefix) === 0) && (c ? p = b : s(b));
}).bind(this)), c = false, p && (r = p, p = null, s(r));
}, o.prototype.detach = function() {
this.active = false, this.completers && this.completers.forEach(function(r) {
typeof r.cancel == "function" && r.cancel();
});
};
var n = o;
function o(r) {
this.initialPosition = r, this.active = true;
}
a.prototype.setFilter = function(r) {
e2 = r.length > this.filterText && r.lastIndexOf(this.filterText, 0) === 0 ? this.filtered : this.all, this.filterText = r, e2 = (e2 = this.filterCompletions(e2, this.filterText)).sort(function(s, c) {
return c.exactMatch - s.exactMatch || c.$score - s.$score || (s.caption || s.value).localeCompare(c.caption || c.value);
});
var e2, t = null;
e2 = e2.filter(function(s) {
return s = s.snippet || s.caption || s.value, s !== t && (t = s, true);
}), this.filtered = e2;
}, a.prototype.filterCompletions = function(r, e2) {
var t = [], s = e2.toUpperCase(), c = e2.toLowerCase();
e:
for (var p, g = 0; p = r[g]; g++) {
var b = !this.ignoreCaption && p.caption || p.value || p.snippet;
if (b) {
var w = -1, E = 0, M = 0;
if (this.exactMatch) {
if (e2 !== b.substr(0, e2.length))
continue;
} else {
var B2 = b.toLowerCase().indexOf(c);
if (-1 < B2)
M = B2;
else
for (var Z = 0; Z < e2.length; Z++) {
var k = b.indexOf(c[Z], w + 1), u = b.indexOf(s[Z], w + 1);
if ((k = 0 <= k && (u < 0 || k < u) ? k : u) < 0)
continue e;
0 < (u = k - w - 1) && (w === -1 && (M += 10), M += u, E |= 1 << Z), w = k;
}
}
p.matchMask = E, p.exactMatch = M ? 0 : 1, p.$score = (p.score || 0) - M, t.push(p);
}
}
return t;
};
var i = a;
function a(r, e2) {
this.all = r, this.filtered = r, this.filterText = e2 || "", this.exactMatch = false, this.ignoreCaption = false;
}
x.Autocomplete = h, x.CompletionProvider = n, x.FilteredList = i;
}), ace.define("ace/autocomplete/text_completer", ["require", "exports", "module", "ace/range"], function(U, x, H) {
var z = U("../range").Range, j = /[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;
function Y(P, N) {
var A = P.getTextRange(z.fromPoints({ row: 0, column: 0 }, N)).split(j).length - 1, f = P.getValue().split(j), R = /* @__PURE__ */ Object.create(null), y = f[A];
return f.forEach(function(C, d) {
C && C !== y && (d = Math.abs(A - d), d = f.length - d, R[C] ? R[C] = Math.max(d, R[C]) : R[C] = d);
}), R;
}
x.getCompletions = function(P, N, A, f, R) {
var y = Y(N, A);
R(null, Object.keys(y).map(function(C) {
return { caption: C, value: C, score: y[C], meta: "local" };
}));
};
}), ace.define("ace/ext/language_tools", ["require", "exports", "module", "ace/snippets", "ace/autocomplete", "ace/config", "ace/lib/lang", "ace/autocomplete/util", "ace/autocomplete/text_completer", "ace/editor", "ace/config"], function(U, x, H) {
function z(r, e2) {
l(e2.session.$mode);
}
function j(r) {
var e2 = r.editor, t = e2.completer && e2.completer.activated;
r.command.name === "backspace" ? t && !R.getCompletionPrefix(e2) && e2.completer.detach() : r.command.name !== "insertstring" || t || ((e2 = (Y = r).editor.$liveAutocompletionDelay) ? o.delay(e2) : i(r));
}
var Y, P = U("../snippets").snippetManager, N = U("../autocomplete").Autocomplete, A = U("../config"), f = U("../lib/lang"), R = U("../autocomplete/util"), a = U("../autocomplete/text_completer"), y = { getCompletions: function(r, e2, t, s, c) {
if (e2.$mode.completer)
return e2.$mode.completer.getCompletions(r, e2, t, s, c);
r = r.session.getState(t.row), c(null, e2.$mode.getCompletions(r, e2, t, s).map(function(p) {
return p.completerId = y.id, p;
}));
}, id: "keywordCompleter" }, C = { getCompletions: function(r, g, t, s, c) {
var p = [], g = g.getTokenAt(t.row, t.column), b = (g && g.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/) ? p.push("html-tag") : p = P.getActiveScopes(r), P.snippetMap), w = [];
p.forEach(function(E) {
for (var M = b[E] || [], B2 = M.length; B2--; ) {
var Z = M[B2], k = Z.name || Z.tabTrigger;
k && w.push({ caption: k, snippet: Z.content, meta: Z.tabTrigger && !Z.name ? Z.tabTrigger + "⇥ " : "snippet", completerId: C.id });
}
}, this), c(null, w);
}, getDocTooltip: function(r) {
var e2;
r.snippet && !r.docHTML && (r.docHTML = ["", f.escapeHTML(r.caption), " ", " ", f.escapeHTML((r = r.snippet, e2 = {}, r.replace(/\${(\d+)(:(.*?))?}/g, function(t, s, c, p) {
return e2[s] = p || "";
}).replace(/\$(\d+?)/g, function(t, s) {
return e2[s];
})))].join(""));
}, id: "snippetCompleter" }, d = [C, a, y], h = (x.setCompleters = function(r) {
d.length = 0, r && d.push.apply(d, r);
}, x.addCompleter = function(r) {
d.push(r);
}, x.textCompleter = a, x.keyWordCompleter = y, x.snippetCompleter = C, { name: "expandSnippet", exec: function(r) {
return P.expandWithTab(r);
}, bindKey: "Tab" }), l = function(r) {
(r = typeof r == "string" ? A.$modes[r] : r) && (P.files || (P.files = {}), n(r.$id, r.snippetFileId), r.modes) && r.modes.forEach(l);
}, n = function(r, e2) {
e2 && r && !P.files[r] && (P.files[r] = {}, A.loadModule(e2, function(t) {
t && (!(P.files[r] = t).snippets && t.snippetText && (t.snippets = P.parseSnippetFile(t.snippetText)), P.register(t.snippets || [], t.scope), t.includeScopes) && (P.snippetMap[t.scope].includeScopes = t.includeScopes, t.includeScopes.forEach(function(s) {
l("ace/mode/" + s);
}));
}));
}, o = f.delayedCall(function() {
i(Y);
}, 0), i = function(e2) {
var e2 = e2.editor, t = R.getCompletionPrefix(e2), s = R.triggerAutocomplete(e2);
(t && t.length >= e2.$liveAutocompletionThreshold || s) && ((t = N.for(e2)).autoShown = true, t.showPopup(e2));
}, a = U("../editor").Editor;
U("../config").defineOptions(a.prototype, "editor", { enableBasicAutocompletion: { set: function(r) {
r ? (this.completers || (this.completers = Array.isArray(r) ? r : d), this.commands.addCommand(N.startCommand)) : this.commands.removeCommand(N.startCommand);
}, value: false }, enableLiveAutocompletion: { set: function(r) {
r ? (this.completers || (this.completers = Array.isArray(r) ? r : d), this.commands.on("afterExec", j)) : this.commands.off("afterExec", j);
}, value: false }, liveAutocompletionDelay: { initialValue: 0 }, liveAutocompletionThreshold: { initialValue: 0 }, enableSnippets: { set: function(r) {
r ? (this.commands.addCommand(h), this.on("changeMode", z), z(0, this)) : (this.commands.removeCommand(h), this.off("changeMode", z));
}, value: false } });
}), ace.require(["ace/ext/language_tools"], function(U) {
le && (le.exports = U);
});
}, 3330: function(le, m, D) {
le = D.nmd(le), ace.define("ace/ext/searchbox-css", ["require", "exports", "module"], function(U, x, H) {
H.exports = `
/* ------------------------------------------------------------------------------------------
* Editor Search Form
* --------------------------------------------------------------------------------------- */
.ace_search {
background-color: #ddd;
color: #666;
border: 1px solid #cbcbcb;
border-top: 0 none;
overflow: hidden;
margin: 0;
padding: 4px 6px 0 4px;
position: absolute;
top: 0;
z-index: 99;
white-space: normal;
}
.ace_search.left {
border-left: 0 none;
border-radius: 0px 0px 5px 0px;
left: 0;
}
.ace_search.right {
border-radius: 0px 0px 0px 5px;
border-right: 0 none;
right: 0;
}
.ace_search_form, .ace_replace_form {
margin: 0 20px 4px 0;
overflow: hidden;
line-height: 1.9;
}
.ace_replace_form {
margin-right: 0;
}
.ace_search_form.ace_nomatch {
outline: 1px solid red;
}
.ace_search_field {
border-radius: 3px 0 0 3px;
background-color: white;
color: black;
border: 1px solid #cbcbcb;
border-right: 0 none;
outline: 0;
padding: 0;
font-size: inherit;
margin: 0;
line-height: inherit;
padding: 0 6px;
min-width: 17em;
vertical-align: top;
min-height: 1.8em;
box-sizing: content-box;
}
.ace_searchbtn {
border: 1px solid #cbcbcb;
line-height: inherit;
display: inline-block;
padding: 0 6px;
background: #fff;
border-right: 0 none;
border-left: 1px solid #dcdcdc;
cursor: pointer;
margin: 0;
position: relative;
color: #666;
}
.ace_searchbtn:last-child {
border-radius: 0 3px 3px 0;
border-right: 1px solid #cbcbcb;
}
.ace_searchbtn:disabled {
background: none;
cursor: default;
}
.ace_searchbtn:hover {
background-color: #eef1f6;
}
.ace_searchbtn.prev, .ace_searchbtn.next {
padding: 0px 0.7em
}
.ace_searchbtn.prev:after, .ace_searchbtn.next:after {
content: "";
border: solid 2px #888;
width: 0.5em;
height: 0.5em;
border-width: 2px 0 0 2px;
display:inline-block;
transform: rotate(-45deg);
}
.ace_searchbtn.next:after {
border-width: 0 2px 2px 0 ;
}
.ace_searchbtn_close {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;
border-radius: 50%;
border: 0 none;
color: #656565;
cursor: pointer;
font: 16px/16px Arial;
padding: 0;
height: 14px;
width: 14px;
top: 9px;
right: 7px;
position: absolute;
}
.ace_searchbtn_close:hover {
background-color: #656565;
background-position: 50% 100%;
color: white;
}
.ace_button {
margin-left: 2px;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-o-user-select: none;
-ms-user-select: none;
user-select: none;
overflow: hidden;
opacity: 0.7;
border: 1px solid rgba(100,100,100,0.23);
padding: 1px;
box-sizing: border-box!important;
color: black;
}
.ace_button:hover {
background-color: #eee;
opacity:1;
}
.ace_button:active {
background-color: #ddd;
}
.ace_button.checked {
border-color: #3399ff;
opacity:1;
}
.ace_search_options{
margin-bottom: 3px;
text-align: right;
-webkit-user-select: none;
-moz-user-select: none;
-o-user-select: none;
-ms-user-select: none;
user-select: none;
clear: both;
}
.ace_search_counter {
float: left;
font-family: arial;
padding: 0 8px;
}`;
}), ace.define("ace/ext/searchbox", ["require", "exports", "module", "ace/lib/dom", "ace/lib/lang", "ace/lib/event", "ace/ext/searchbox-css", "ace/keyboard/hash_handler", "ace/lib/keys", "ace/config"], function(U, x, H) {
var z = U("../lib/dom"), j = U("../lib/lang"), Y = U("../lib/event"), P = U("./searchbox-css"), N = U("../keyboard/hash_handler").HashHandler, A = U("../lib/keys"), f = U("../config").nls, R = (z.importCssString(P, "ace_searchbox", false), y.prototype.setEditor = function(C) {
C.searchBox = this, C.renderer.scroller.appendChild(this.element), this.editor = C;
}, y.prototype.setSession = function(C) {
this.searchRange = null, this.$syncOptions(true);
}, y.prototype.$initElements = function(C) {
this.searchBox = C.querySelector(".ace_search_form"), this.replaceBox = C.querySelector(".ace_replace_form"), this.searchOption = C.querySelector("[action=searchInSelection]"), this.replaceOption = C.querySelector("[action=toggleReplace]"), this.regExpOption = C.querySelector("[action=toggleRegexpMode]"), this.caseSensitiveOption = C.querySelector("[action=toggleCaseSensitive]"), this.wholeWordOption = C.querySelector("[action=toggleWholeWords]"), this.searchInput = this.searchBox.querySelector(".ace_search_field"), this.replaceInput = this.replaceBox.querySelector(".ace_search_field"), this.searchCounter = C.querySelector(".ace_search_counter");
}, y.prototype.$init = function() {
var C = this.element, d = (this.$initElements(C), this);
Y.addListener(C, "mousedown", function(h) {
setTimeout(function() {
d.activeInput.focus();
}, 0), Y.stopPropagation(h);
}), Y.addListener(C, "click", function(h) {
var l = (h.target || h.srcElement).getAttribute("action");
l && d[l] ? d[l]() : d.$searchBarKb.commands[l] && d.$searchBarKb.commands[l].exec(d), Y.stopPropagation(h);
}), Y.addCommandKeyListener(C, function(h, l, n) {
n = A.keyCodeToString(n), l = d.$searchBarKb.findKeyCommand(l, n), l && l.exec && (l.exec(d), Y.stopEvent(h));
}), this.$onChange = j.delayedCall(function() {
d.find(false, false);
}), Y.addListener(this.searchInput, "input", function() {
d.$onChange.schedule(20);
}), Y.addListener(this.searchInput, "focus", function() {
d.activeInput = d.searchInput, d.searchInput.value && d.highlight();
}), Y.addListener(this.replaceInput, "focus", function() {
d.activeInput = d.replaceInput, d.searchInput.value && d.highlight();
});
}, y.prototype.setSearchRange = function(C) {
(this.searchRange = C) ? this.searchRangeMarker = this.editor.session.addMarker(C, "ace_active-line") : this.searchRangeMarker && (this.editor.session.removeMarker(this.searchRangeMarker), this.searchRangeMarker = null);
}, y.prototype.$syncOptions = function(C) {
z.setCssClass(this.replaceOption, "checked", this.searchRange), z.setCssClass(this.searchOption, "checked", this.searchOption.checked), this.replaceOption.textContent = this.replaceOption.checked ? "-" : "+", z.setCssClass(this.regExpOption, "checked", this.regExpOption.checked), z.setCssClass(this.wholeWordOption, "checked", this.wholeWordOption.checked), z.setCssClass(this.caseSensitiveOption, "checked", this.caseSensitiveOption.checked);
var d = this.editor.getReadOnly();
this.replaceOption.style.display = d ? "none" : "", this.replaceBox.style.display = this.replaceOption.checked && !d ? "" : "none", this.find(false, false, C);
}, y.prototype.highlight = function(C) {
this.editor.session.highlight(C || this.editor.$search.$options.re), this.editor.renderer.updateBackMarkers();
}, y.prototype.find = function(C, d, h) {
C = !this.editor.find(this.searchInput.value, { skipCurrent: C, backwards: d, wrap: true, regExp: this.regExpOption.checked, caseSensitive: this.caseSensitiveOption.checked, wholeWord: this.wholeWordOption.checked, preventScroll: h, range: this.searchRange }) && this.searchInput.value, z.setCssClass(this.searchBox, "ace_nomatch", C), this.editor._emit("findSearchBox", { match: !C }), this.highlight(), this.updateCounter();
}, y.prototype.updateCounter = function() {
var C = this.editor, d = C.$search.$options.re, h = 0, l = 0;
if (d) {
var n, o, i = this.searchRange ? C.session.getTextRange(this.searchRange) : C.getValue(), a = C.session.doc.positionToIndex(C.selection.anchor);
for (this.searchRange && (a -= C.session.doc.positionToIndex(this.searchRange.start)), d.lastIndex = 0; (o = d.exec(i)) && ((n = o.index) <= a && l++, !(999 < ++h)) && (o[0] || (d.lastIndex = n += 1, !(n >= i.length))); )
;
}
this.searchCounter.textContent = f("$0 of $1", [l, 999 < h ? "999+" : h]);
}, y.prototype.findNext = function() {
this.find(true, false);
}, y.prototype.findPrev = function() {
this.find(true, true);
}, y.prototype.findAll = function() {
var C = !this.editor.findAll(this.searchInput.value, { regExp: this.regExpOption.checked, caseSensitive: this.caseSensitiveOption.checked, wholeWord: this.wholeWordOption.checked }) && this.searchInput.value;
z.setCssClass(this.searchBox, "ace_nomatch", C), this.editor._emit("findSearchBox", { match: !C }), this.highlight(), this.hide();
}, y.prototype.replace = function() {
this.editor.getReadOnly() || this.editor.replace(this.replaceInput.value);
}, y.prototype.replaceAndFindNext = function() {
this.editor.getReadOnly() || (this.editor.replace(this.replaceInput.value), this.findNext());
}, y.prototype.replaceAll = function() {
this.editor.getReadOnly() || this.editor.replaceAll(this.replaceInput.value);
}, y.prototype.hide = function() {
this.active = false, this.setSearchRange(null), this.editor.off("changeSession", this.setSession), this.element.style.display = "none", this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb), this.editor.focus();
}, y.prototype.show = function(C, d) {
this.active = true, this.editor.on("changeSession", this.setSession), this.element.style.display = "", this.replaceOption.checked = d, C && (this.searchInput.value = C), this.searchInput.focus(), this.searchInput.select(), this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb), this.$syncOptions(true);
}, y.prototype.isFocused = function() {
var C = document.activeElement;
return C == this.searchInput || C == this.replaceInput;
}, y);
function y(C, d, h) {
var l = z.createElement("div");
z.buildDom(["div", { class: "ace_search right" }, ["span", { action: "hide", class: "ace_searchbtn_close" }], ["div", { class: "ace_search_form" }, ["input", { class: "ace_search_field", placeholder: f("Search for"), spellcheck: "false" }], ["span", { action: "findPrev", class: "ace_searchbtn prev" }, ""], ["span", { action: "findNext", class: "ace_searchbtn next" }, ""], ["span", { action: "findAll", class: "ace_searchbtn", title: "Alt-Enter" }, f("All")]], ["div", { class: "ace_replace_form" }, ["input", { class: "ace_search_field", placeholder: f("Replace with"), spellcheck: "false" }], ["span", { action: "replaceAndFindNext", class: "ace_searchbtn" }, f("Replace")], ["span", { action: "replaceAll", class: "ace_searchbtn" }, f("All")]], ["div", { class: "ace_search_options" }, ["span", { action: "toggleReplace", class: "ace_button", title: f("Toggle Replace mode"), style: "float:left;margin-top:-2px;padding:0 5px;" }, "+"], ["span", { class: "ace_search_counter" }], ["span", { action: "toggleRegexpMode", class: "ace_button", title: f("RegExp Search") }, ".*"], ["span", { action: "toggleCaseSensitive", class: "ace_button", title: f("CaseSensitive Search") }, "Aa"], ["span", { action: "toggleWholeWords", class: "ace_button", title: f("Whole Word Search") }, "\\b"], ["span", { action: "searchInSelection", class: "ace_button", title: f("Search In Selection") }, "S"]]], l), this.element = l.firstChild, this.setSession = this.setSession.bind(this), this.$init(), this.setEditor(C), z.importCssString(P, "ace_searchbox", C.container);
}
U = new N(), U.bindKeys({ "Ctrl-f|Command-f": function(C) {
var d = C.isReplace = !C.isReplace;
C.replaceBox.style.display = d ? "" : "none", C.replaceOption.checked = false, C.$syncOptions(), C.searchInput.focus();
}, "Ctrl-H|Command-Option-F": function(C) {
C.editor.getReadOnly() || (C.replaceOption.checked = true, C.$syncOptions(), C.replaceInput.focus());
}, "Ctrl-G|Command-G": function(C) {
C.findNext();
}, "Ctrl-Shift-G|Command-Shift-G": function(C) {
C.findPrev();
}, esc: function(C) {
setTimeout(function() {
C.hide();
});
}, Return: function(C) {
C.activeInput == C.replaceInput && C.replace(), C.findNext();
}, "Shift-Return": function(C) {
C.activeInput == C.replaceInput && C.replace(), C.findPrev();
}, "Alt-Return": function(C) {
C.activeInput == C.replaceInput && C.replaceAll(), C.findAll();
}, Tab: function(C) {
(C.activeInput == C.replaceInput ? C.searchInput : C.replaceInput).focus();
} }), U.addCommands([{ name: "toggleRegexpMode", bindKey: { win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/" }, exec: function(C) {
C.regExpOption.checked = !C.regExpOption.checked, C.$syncOptions();
} }, { name: "toggleCaseSensitive", bindKey: { win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I" }, exec: function(C) {
C.caseSensitiveOption.checked = !C.caseSensitiveOption.checked, C.$syncOptions();
} }, { name: "toggleWholeWords", bindKey: { win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W" }, exec: function(C) {
C.wholeWordOption.checked = !C.wholeWordOption.checked, C.$syncOptions();
} }, { name: "toggleReplace", exec: function(C) {
C.replaceOption.checked = !C.replaceOption.checked, C.$syncOptions();
} }, { name: "searchInSelection", exec: function(C) {
C.searchOption.checked = !C.searchRange, C.setSearchRange(C.searchOption.checked && C.editor.getSelectionRange()), C.$syncOptions();
} }]), N = new N([{ bindKey: "Esc", name: "closeSearchBar", exec: function(C) {
C.searchBox.hide();
} }]), R.prototype.$searchBarKb = U, R.prototype.$closeSearchBarKb = N, x.SearchBox = R, x.Search = function(C, d) {
(C.searchBox || new R(C)).show(C.session.getTextRange(), d);
};
}), ace.require(["ace/ext/searchbox"], function(U) {
le && (le.exports = U);
});
}, 4091: function(le, m, D) {
le = D.nmd(le), ace.define("ace/mode/json_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function(Y, x, H) {
function z() {
this.$rules = { start: [{ token: "variable", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)' }, { token: "string", regex: '"', next: "string" }, { token: "constant.numeric", regex: "0[xX][0-9a-fA-F]+\\b" }, { token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" }, { token: "constant.language.boolean", regex: "(?:true|false)\\b" }, { token: "text", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" }, { token: "comment", regex: "\\/\\/.*$" }, { token: "comment.start", regex: "\\/\\*", next: "comment" }, { token: "paren.lparen", regex: "[[({]" }, { token: "paren.rparen", regex: "[\\])}]" }, { token: "punctuation.operator", regex: /[,]/ }, { token: "text", regex: "\\s+" }], string: [{ token: "constant.language.escape", regex: /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/ }, { token: "string", regex: '"|$', next: "start" }, { defaultToken: "string" }], comment: [{ token: "comment.end", regex: "\\*\\/", next: "start" }, { defaultToken: "comment" }] };
}
var j = Y("../lib/oop"), Y = Y("./text_highlight_rules").TextHighlightRules;
j.inherits(z, Y), x.JsonHighlightRules = z;
}), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function(U, x, H) {
function z() {
}
var j = U("../range").Range;
(function() {
this.checkOutdent = function(Y, P) {
return !!/^\s+$/.test(Y) && /^\s*\}/.test(P);
}, this.autoOutdent = function(Y, P) {
var N, A = Y.getLine(P).match(/^(\s*\})/);
return A && (A = A[1].length, N = Y.findMatchingBracket({ row: P, column: A })) && N.row != P ? (N = this.$getIndent(Y.getLine(N.row)), void Y.replace(new j(P, 0, P, A - 1), N)) : 0;
}, this.$getIndent = function(Y) {
return Y.match(/^\s*/)[0];
};
}).call(z.prototype), x.MatchingBraceOutdent = z;
}), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function(Y, P, H) {
var z = Y("../../lib/oop"), j = Y("../../range").Range, Y = Y("./fold_mode").FoldMode, P = P.FoldMode = function(N) {
N && (this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + N.start)), this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + N.end)));
};
z.inherits(P, Y), (function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/, this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/, this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/, this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/, this._getFoldWidgetBase = this.getFoldWidget, this.getFoldWidget = function(N, A, f) {
var R = N.getLine(f);
return !this.singleLineBlockCommentRe.test(R) || this.startRegionRe.test(R) || this.tripleStarBlockCommentRe.test(R) ? !(N = this._getFoldWidgetBase(N, A, f)) && this.startRegionRe.test(R) ? "start" : N : "";
}, this.getFoldWidgetRange = function(N, A, f, R) {
var y, C, d, h = N.getLine(f);
return this.startRegionRe.test(h) ? this.getCommentRegionBlock(N, h, f) : (C = h.match(this.foldingStartMarker)) ? (d = C.index, C[1] ? this.openingBracketBlock(N, C[1], f, d) : ((y = N.getCommentFoldRange(f, d + C[0].length, 1)) && !y.isMultiLine() && (R ? y = this.getSectionRange(N, f) : A != "all" && (y = null)), y)) : A !== "markbegin" && (C = h.match(this.foldingStopMarker)) ? (d = C.index + C[0].length, C[1] ? this.closingBracketBlock(N, C[1], f, d) : N.getCommentFoldRange(f, d, -1)) : void 0;
}, this.getSectionRange = function(N, A) {
for (var f = (h = N.getLine(A)).search(/\S/), R = A, y = h.length, C = A += 1, d = N.getLength(); ++A < d; ) {
var h, l = (h = N.getLine(A)).search(/\S/);
if (l !== -1) {
if (l < f)
break;
var n = this.getFoldWidgetRange(N, "all", A);
if (n) {
if (n.start.row <= R)
break;
if (n.isMultiLine())
A = n.end.row;
else if (f == l)
break;
}
C = A;
}
}
return new j(R, y, C, N.getLine(C).length);
}, this.getCommentRegionBlock = function(N, A, f) {
for (var R = A.search(/\s*$/), y = N.getLength(), C = f, d = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/, h = 1; ++f < y; ) {
A = N.getLine(f);
var l = d.exec(A);
if (l && (l[1] ? h-- : h++, !h))
break;
}
if (C < f)
return new j(C, R, f, A.length);
};
}).call(P.prototype);
}), ace.define("ace/mode/json", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/json_highlight_rules", "ace/mode/matching_brace_outdent", "ace/mode/folding/cstyle", "ace/worker/worker_client"], function(U, x, H) {
function z() {
this.HighlightRules = P, this.$outdent = new N(), this.$behaviour = this.$defaultBehaviour, this.foldingRules = new A();
}
var j = U("../lib/oop"), Y = U("./text").Mode, P = U("./json_highlight_rules").JsonHighlightRules, N = U("./matching_brace_outdent").MatchingBraceOutdent, A = U("./folding/cstyle").FoldMode, f = U("../worker/worker_client").WorkerClient;
j.inherits(z, Y), (function() {
this.lineCommentStart = "//", this.blockComment = { start: "/*", end: "*/" }, this.getNextLineIndent = function(R, y, C) {
var d = this.$getIndent(y);
return R == "start" && y.match(/^.*[\{\(\[]\s*$/) && (d += C), d;
}, this.checkOutdent = function(R, y, C) {
return this.$outdent.checkOutdent(y, C);
}, this.autoOutdent = function(R, y, C) {
this.$outdent.autoOutdent(y, C);
}, this.createWorker = function(R) {
var y = new f(["ace"], "ace/mode/json_worker", "JsonWorker");
return y.attachToDocument(R.getDocument()), y.on("annotate", function(C) {
R.setAnnotations(C.data);
}), y.on("terminate", function() {
R.clearAnnotations();
}), y;
}, this.$id = "ace/mode/json";
}).call(z.prototype), x.Mode = z;
}), ace.require(["ace/mode/json"], function(U) {
le && (le.exports = U);
});
}, 8903: function(f, m, D) {
var U = D(5689), x = D(3969), H = D(5255), z = D(4293), j = D(3508), Y = D(3368), P = D(742), N = D(9394), A = D(3724), f = ((f.exports = d).prototype.validate = function(e2, t) {
var s;
if (typeof e2 == "string") {
if (!(s = this.getSchema(e2)))
throw new Error('no schema with key or ref "' + e2 + '"');
} else
e2 = this._addSchema(e2), s = e2.validate || this._compile(e2);
return e2 = s(t), s.$async !== true && (this.errors = s.errors), e2;
}, d.prototype.compile = function(e2, t) {
return e2 = this._addSchema(e2, void 0, t), e2.validate || this._compile(e2);
}, d.prototype.addSchema = function(e2, t, s, c) {
if (Array.isArray(e2))
for (var p = 0; p < e2.length; p++)
this.addSchema(e2[p], void 0, s, c);
else {
var g = this._getId(e2);
if (g !== void 0 && typeof g != "string")
throw new Error("schema id must be string");
a(this, t = x.normalizeId(t || g)), this._schemas[t] = this._addSchema(e2, s, c, true);
}
return this;
}, d.prototype.addMetaSchema = function(e2, t, s) {
return this.addSchema(e2, t, s, true), this;
}, d.prototype.validateSchema = function(e2, t) {
var s = e2.$schema;
if (s !== void 0 && typeof s != "string")
throw new Error("$schema must be a string");
if (!(s = s || this._opts.defaultMeta || function(c) {
var p = c._opts.meta;
return c._opts.defaultMeta = typeof p == "object" ? c._getId(p) || p : c.getSchema(R) ? R : void 0, c._opts.defaultMeta;
}(this)))
return this.logger.warn("meta-schema not available"), !(this.errors = null);
if (s = this.validate(s, e2), !s && t) {
if (e2 = "schema is invalid: " + this.errorsText(), this._opts.validateSchema != "log")
throw new Error(e2);
this.logger.error(e2);
}
return s;
}, d.prototype.getSchema = function(e2) {
var t = h(this, e2);
switch (typeof t) {
case "object":
return t.validate || this._compile(t);
case "string":
return this.getSchema(t);
case "undefined":
return function(s, c) {
var p = x.schema.call(s, { schema: {} }, c);
{
var g, b, w;
if (p)
return g = p.schema, b = p.root, p = p.baseId, w = U.call(s, g, b, void 0, p), s._fragments[c] = new z({ ref: c, fragment: true, schema: g, root: b, baseId: p, validate: w }), w;
}
}(this, e2);
}
}, d.prototype.removeSchema = function(e2) {
if (e2 instanceof RegExp)
l(this, this._schemas, e2), l(this, this._refs, e2);
else
switch (typeof e2) {
case "undefined":
return l(this, this._schemas), l(this, this._refs), this._cache.clear(), this;
case "string":
var t = h(this, e2);
return t && this._cache.del(t.cacheKey), delete this._schemas[e2], delete this._refs[e2], this;
case "object":
t = this._opts.serialize, t = t ? t(e2) : e2, t = (this._cache.del(t), this._getId(e2)), t && (t = x.normalizeId(t), delete this._schemas[t], delete this._refs[t]);
}
return this;
}, d.prototype.addFormat = function(e2, t) {
return typeof t == "string" && (t = new RegExp(t)), this._formats[e2] = t, this;
}, d.prototype.errorsText = function(e2, t) {
if (!(e2 = e2 || this.errors))
return "No errors";
for (var s = (t = t || {}).separator === void 0 ? ", " : t.separator, c = t.dataVar === void 0 ? "data" : t.dataVar, p = "", g = 0; g < e2.length; g++) {
var b = e2[g];
b && (p += c + b.dataPath + " " + b.message + s);
}
return p.slice(0, -s.length);
}, d.prototype._addSchema = function(e2, w, s, c) {
if (typeof e2 != "object" && typeof e2 != "boolean")
throw new Error("schema should be object or boolean");
var p = this._opts.serialize, p = p ? p(e2) : e2, g = this._cache.get(p);
if (g)
return g;
c = c || this._opts.addUsedSchema !== false, g = x.normalizeId(this._getId(e2)), g && c && a(this, g);
var b, w = this._opts.validateSchema !== false && !w;
w && !(b = g && g == x.normalizeId(e2.$schema)) && this.validateSchema(e2, true);
var E = x.ids.call(this, e2), E = new z({ id: g, schema: e2, localRefs: E, cacheKey: p, meta: s });
return g[0] != "#" && c && (this._refs[g] = E), this._cache.put(p, E), w && b && this.validateSchema(e2, true), E;
}, d.prototype._compile = function(e2, t) {
if (e2.compiling)
return (e2.validate = p).schema = e2.schema, p.errors = null, p.root = t || p, e2.schema.$async === true && (p.$async = true), p;
var s, c;
e2.compiling = true, e2.meta && (s = this._opts, this._opts = this._metaOpts);
try {
c = U.call(this, e2.schema, t, e2.localRefs);
} catch (g) {
throw delete e2.validate, g;
} finally {
e2.compiling = false, e2.meta && (this._opts = s);
}
return e2.validate = c, e2.refs = c.refs, e2.refVal = c.refVal, e2.root = c.root, c;
function p() {
var g = e2.validate, b = g.apply(this, arguments);
return p.errors = g.errors, b;
}
}, d.prototype.compileAsync = D(9677), D(7931)), f = (d.prototype.addKeyword = f.add, d.prototype.getKeyword = f.get, d.prototype.removeKeyword = f.remove, d.prototype.validateKeyword = f.validate, D(5359)), R = (d.ValidationError = f.Validation, d.MissingRefError = f.MissingRef, d.$dataMetaSchema = N, "http://json-schema.org/draft-07/schema"), y = ["removeAdditional", "useDefaults", "coerceTypes", "strictDefaults"], C = ["/properties"];
function d(e2) {
if (!(this instanceof d))
return new d(e2);
e2 = this._opts = A.copy(e2) || {};
var M = this, t = M._opts.logger;
if (t === false)
M.logger = { log: r, warn: r, error: r };
else {
if (!(typeof (t = t === void 0 ? console : t) == "object" && t.log && t.warn && t.error))
throw new Error("logger must implement log, warn and error methods");
M.logger = t;
}
if (this._schemas = {}, this._refs = {}, this._fragments = {}, this._formats = Y(e2.format), this._cache = e2.cache || new H(), this._loadingSchemas = {}, this._compilations = [], this.RULES = P(), this._getId = function(u) {
switch (u.schemaId) {
case "auto":
return i;
case "id":
return n;
default:
return o;
}
}(e2), e2.loopRequired = e2.loopRequired || 1 / 0, e2.errorDataPath == "property" && (e2._errorDataPathProperty = true), e2.serialize === void 0 && (e2.serialize = j), this._metaOpts = function(u) {
for (var _ = A.copy(u._opts), v = 0; v < y.length; v++)
delete _[y[v]];
return _;
}(this), e2.formats) {
var s, c = this;
for (s in c._opts.formats) {
var p = c._opts.formats[s];
c.addFormat(s, p);
}
}
if (e2.keywords) {
var g, b = this;
for (g in b._opts.keywords) {
var w = b._opts.keywords[g];
b.addKeyword(g, w);
}
}
var E, M = this, B2 = (M._opts.$data && (E = D(894), M.addMetaSchema(E, E.$id, true)), M._opts.meta !== false && (E = D(6680), M._opts.$data && (E = N(E, C)), M.addMetaSchema(E, R, true), M._refs["http://json-schema.org/schema"] = R), typeof e2.meta == "object" && this.addMetaSchema(e2.meta), e2.nullable && this.addKeyword("nullable", { metaSchema: { type: "boolean" } }), this), Z = B2._opts.schemas;
if (Z)
if (Array.isArray(Z))
B2.addSchema(Z);
else
for (var k in Z)
B2.addSchema(Z[k], k);
}
function h(e2, t) {
return t = x.normalizeId(t), e2._schemas[t] || e2._refs[t] || e2._fragments[t];
}
function l(e2, t, s) {
for (var c in t) {
var p = t[c];
p.meta || s && !s.test(c) || (e2._cache.del(p.cacheKey), delete t[c]);
}
}
function n(e2) {
return e2.$id && this.logger.warn("schema $id ignored", e2.$id), e2.id;
}
function o(e2) {
return e2.id && this.logger.warn("schema id ignored", e2.id), e2.$id;
}
function i(e2) {
if (e2.$id && e2.id && e2.$id != e2.id)
throw new Error("schema $id is different from id");
return e2.$id || e2.id;
}
function a(e2, t) {
if (e2._schemas[t] || e2._refs[t])
throw new Error('schema with key or id "' + t + '" already exists');
}
function r() {
}
}, 5255: function(le) {
le = le.exports = function() {
this._cache = {};
}, le.prototype.put = function(m, D) {
this._cache[m] = D;
}, le.prototype.get = function(m) {
return this._cache[m];
}, le.prototype.del = function(m) {
delete this._cache[m];
}, le.prototype.clear = function() {
this._cache = {};
};
}, 9677: function(le, m, D) {
var U = D(5359).MissingRef;
function x(H, z, j) {
var Y = this;
if (typeof this._opts.loadSchema != "function")
throw new Error("options.loadSchema should be a function");
typeof z == "function" && (j = z, z = void 0);
var P = N(H).then(function() {
var A = Y._addSchema(H, void 0, z);
return A.validate || function f(R) {
try {
return Y._compile(R);
} catch (C) {
if (C instanceof U)
return y(C);
throw C;
}
function y(C) {
var d = C.missingSchema;
if (l(d))
throw new Error("Schema " + d + " is loaded but " + C.missingRef + " cannot be resolved");
return C = Y._loadingSchemas[d], C || (C = Y._loadingSchemas[d] = Y._opts.loadSchema(d)).then(h, h), C.then(function(n) {
if (!l(d))
return N(n).then(function() {
l(d) || Y.addSchema(n, d, void 0, z);
});
}).then(function() {
return f(R);
});
function h() {
delete Y._loadingSchemas[d];
}
function l(n) {
return Y._refs[n] || Y._schemas[n];
}
}
}(A);
});
return j && P.then(function(A) {
j(null, A);
}, j), P;
function N(A) {
return A = A.$schema, A && !Y.getSchema(A) ? x.call(Y, { $ref: A }, true) : Promise.resolve();
}
}
le.exports = x;
}, 5359: function(le, m, D) {
var U = D(3969);
function x(z, j, Y) {
this.message = Y || x.message(z, j), this.missingRef = U.url(z, j), this.missingSchema = U.normalizeId(U.fullPath(this.missingRef));
}
function H(z) {
return z.prototype = Object.create(Error.prototype), z.prototype.constructor = z;
}
le.exports = { Validation: H(function(z) {
this.message = "validation failed", this.errors = z, this.ajv = this.validation = true;
}), MissingRef: H(x) }, x.message = function(z, j) {
return "can't resolve reference " + j + " from id " + z;
};
}, 3368: function(le, m, j) {
var U = j(3724), x = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, H = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], z = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i, j = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i, Y = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, P = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i, N = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i, A = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i, f = /^(?:\/(?:[^~/]|~0|~1)*)*$/, R = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i, y = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
function C(a) {
return U.copy(C[a = a == "full" ? "full" : "fast"]);
}
function d(t) {
var r, e2, t = t.match(x);
return !!t && (r = +t[1], e2 = +t[2], t = +t[3], 1 <= e2) && e2 <= 12 && 1 <= t && t <= (e2 != 2 || (t = r) % 4 != 0 || t % 100 == 0 && t % 400 != 0 ? H[e2] : 29);
}
function h(c, r) {
var e2, t, s, c = c.match(z);
return !!c && (e2 = c[1], t = c[2], s = c[3], c = c[5], e2 <= 23 && t <= 59 && s <= 59 || e2 == 23 && t == 59 && s == 60) && (!r || c);
}
(le.exports = C).fast = { date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, "date-time": /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, "uri-template": P, url: N, email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, hostname: j, ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, regex: i, uuid: A, "json-pointer": f, "json-pointer-uri-fragment": R, "relative-json-pointer": y }, C.full = { date: d, time: h, "date-time": function(a) {
return a = a.split(l), a.length == 2 && d(a[0]) && h(a[1], true);
}, uri: function(a) {
return n.test(a) && Y.test(a);
}, "uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, "uri-template": P, url: N, email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, hostname: j, ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, regex: i, uuid: A, "json-pointer": f, "json-pointer-uri-fragment": R, "relative-json-pointer": y };
var l = /t|\s/i, n = /\/|:/, o = /[^\\]\\Z/;
function i(a) {
if (o.test(a))
return false;
try {
return new RegExp(a), true;
} catch {
return false;
}
}
}, 5689: function(le, m, D) {
var U = D(3969), x = D(3724), H = D(5359), z = D(3508), j = D(1869), Y = x.ucs2length, P = D(2303), N = H.Validation;
function A(l, n, o, i) {
var a = this, r = this._opts, e2 = [void 0], t = {}, s = [], c = {}, p = [], g = {}, b = [], w = (n = n || { schema: l, refVal: e2, refs: t }, (function(K, ne, T) {
var V = f.call(this, K, ne, T);
return 0 <= V ? { index: V, compiling: true } : (V = this._compilations.length, this._compilations[V] = { schema: K, root: ne, baseId: T }, { index: V, compiling: false });
}).call(this, l, n, i)), E = this._compilations[w.index];
if (w.compiling)
return E.callValidate = u;
var M = this._formats, B2 = this.RULES;
try {
var Z = _(l, n, o, i), k = (E.validate = Z, E.callValidate);
return k && (k.schema = Z.schema, k.errors = null, k.refs = Z.refs, k.refVal = Z.refVal, k.root = Z.root, k.$async = Z.$async, r.sourceCode) && (k.source = Z.source), Z;
} finally {
(function(K, ne, T) {
K = f.call(this, K, ne, T), 0 <= K && this._compilations.splice(K, 1);
}).call(this, l, n, i);
}
function u() {
var K = E.validate, ne = K.apply(this, arguments);
return u.errors = K.errors, ne;
}
function _(K, ne, T, V) {
var F = !ne || ne.schema == K;
if (ne.schema != n.schema)
return A.call(a, K, ne, T, V);
T = K.$async === true, V = j({ isTop: true, schema: K, isRoot: F, baseId: V, root: ne, schemaPath: "", errSchemaPath: "#", errorPath: '""', MissingRefError: H.MissingRef, RULES: B2, validate: j, util: x, resolve: U, resolveRef: v, usePattern: W, useDefault: X, useCustomRule: Q, opts: r, formats: M, logger: a.logger, self: a }), V = h(e2, C) + h(s, R) + h(p, y) + h(b, d) + V, r.processCode && (V = r.processCode(V, K));
try {
var I = new Function("self", "RULES", "formats", "root", "refVal", "defaults", "customRules", "equal", "ucs2length", "ValidationError", V)(a, B2, M, n, e2, p, b, P, Y, N);
e2[0] = I;
} catch (S) {
throw a.logger.error("Error compiling schema, function code:", V), S;
}
return I.schema = K, I.errors = null, I.refs = t, I.refVal = e2, I.root = F ? I : ne, T && (I.$async = true), r.sourceCode === true && (I.source = { code: V, patterns: s, defaults: p }), I;
}
function v(K, ne, S) {
ne = U.url(K, ne);
var V = t[ne];
if (V !== void 0)
return G(F = e2[V], I = "refVal[" + V + "]");
if (!S && n.refs && (V = n.refs[ne], V !== void 0))
return G(F = n.refVal[V], I = $(ne, F));
var F, I = $(ne), S = U.call(a, _, n, ne);
if ((S = S === void 0 && (V = o && o[ne]) ? U.inlineRef(V, r.inlineRefs) ? V : A.call(a, V, n, o, K) : S) !== void 0)
return F = S, V = t[V = ne], e2[V] = F, G(S, I);
delete t[ne];
}
function $(K, ne) {
var T = e2.length;
return e2[T] = ne, "refVal" + (t[K] = T);
}
function G(K, ne) {
return typeof K == "object" || typeof K == "boolean" ? { code: ne, schema: K, inline: true } : { code: ne, $async: K && !!K.$async };
}
function W(K) {
var ne = c[K];
return ne === void 0 && (ne = c[K] = s.length, s[ne] = K), "pattern" + ne;
}
function X(K) {
switch (typeof K) {
case "boolean":
case "number":
return "" + K;
case "string":
return x.toQuotedString(K);
case "object":
var ne, T;
return K === null ? "null" : (ne = z(K), (T = g[ne]) === void 0 && (T = g[ne] = p.length, p[T] = K), "default" + T);
}
}
function Q(K, ne, T, V) {
if (a._opts.validateSchema !== false) {
var I = K.definition.dependencies;
if (I && !I.every(function(J) {
return Object.prototype.hasOwnProperty.call(T, J);
}))
throw new Error("parent schema must have all required keywords: " + I.join(","));
if (I = K.definition.validateSchema, I && !I(ne)) {
if (I = "keyword schema is invalid: " + a.errorsText(I.errors), a._opts.validateSchema != "log")
throw new Error(I);
a.logger.error(I);
}
}
var F, I = K.definition.compile, S = K.definition.inline, L = K.definition.macro;
if (I)
F = I.call(a, ne, T, V);
else if (L)
F = L.call(a, ne, T, V), r.validateSchema !== false && a.validateSchema(F, true);
else if (S)
F = S.call(a, V, K.keyword, ne, T);
else if (!(F = K.definition.validate))
return;
if (F === void 0)
throw new Error('custom keyword "' + K.keyword + '"failed to compile');
return I = b.length, { code: "customRule" + I, validate: b[I] = F };
}
}
function f(l, n, o) {
for (var i = 0; i < this._compilations.length; i++) {
var a = this._compilations[i];
if (a.schema == l && a.root == n && a.baseId == o)
return i;
}
return -1;
}
function R(l, n) {
return "var pattern" + l + " = new RegExp(" + x.toQuotedString(n[l]) + ");";
}
function y(l) {
return "var default" + l + " = defaults[" + l + "];";
}
function C(l, n) {
return n[l] === void 0 ? "" : "var refVal" + l + " = refVal[" + l + "];";
}
function d(l) {
return "var customRule" + l + " = customRules[" + l + "];";
}
function h(l, n) {
if (!l.length)
return "";
for (var o = "", i = 0; i < l.length; i++)
o += n(i, l);
return o;
}
le.exports = A;
}, 3969: function(le, m, D) {
var U = D(7533), x = D(2303), H = D(3724), z = D(4293), j = D(500);
function Y(n, o, i) {
var a, r, e2, t = this._refs[i];
if (typeof t == "string") {
if (!this._refs[t])
return Y.call(this, n, o, t);
t = this._refs[t];
}
return (t = t || this._schemas[i]) instanceof z ? R(t.schema, this._opts.inlineRefs) ? t.schema : t.validate || this._compile(t) : ((t = P.call(this, o, i)) && (a = t.schema, o = t.root, e2 = t.baseId), a instanceof z ? r = a.validate || n.call(this, a.schema, o, void 0, e2) : a !== void 0 && (r = R(a, this._opts.inlineRefs) ? a : n.call(this, a, o, void 0, e2)), r);
}
function P(n, o) {
var i = U.parse(o), a = C(i), r = y(this._getId(n.schema));
if (Object.keys(n.schema).length === 0 || a !== r) {
var a = h(a), e2 = this._refs[a];
if (typeof e2 == "string")
return (function(s, c, p) {
c = P.call(this, s, c);
{
var g, b;
if (c)
return g = c.schema, b = c.baseId, s = c.root, (c = this._getId(g)) && (b = l(b, c)), A.call(this, p, b, g, s);
}
}).call(this, n, e2, i);
if (e2 instanceof z)
e2.validate || this._compile(e2);
else {
if (!((e2 = this._schemas[a]) instanceof z))
return;
if (e2.validate || this._compile(e2), a == h(o))
return { schema: e2, root: n, baseId: r };
}
if (!(n = e2).schema)
return;
r = y(this._getId(n.schema));
}
return A.call(this, i, r, n.schema, n);
}
(le.exports = Y).normalizeId = h, Y.fullPath = y, Y.url = l, Y.ids = function(n) {
var o = h(this._getId(n)), i = { "": o }, a = { "": y(o, false) }, r = {}, e2 = this;
return j(n, { allKeys: true }, function(t, s, c, p, g, b, w) {
if (s !== "") {
var E = e2._getId(t), M = i[p], p = a[p] + "/" + g;
if (w !== void 0 && (p += "/" + (typeof w == "number" ? w : H.escapeFragment(w))), typeof E == "string") {
if (E = M = h(M ? U.resolve(M, E) : E), g = e2._refs[E], (g = typeof g == "string" ? e2._refs[g] : g) && g.schema) {
if (!x(t, g.schema))
throw new Error('id "' + E + '" resolves to more than one schema');
} else if (E != h(p))
if (E[0] == "#") {
if (r[E] && !x(t, r[E]))
throw new Error('id "' + E + '" resolves to more than one schema');
r[E] = t;
} else
e2._refs[E] = p;
}
i[s] = M, a[s] = p;
}
}), r;
}, Y.inlineRef = R, Y.schema = P;
var N = H.toHash(["properties", "patternProperties", "enum", "dependencies", "definitions"]);
function A(n, o, i, a) {
if (n.fragment = n.fragment || "", n.fragment.slice(0, 1) == "/") {
for (var r = n.fragment.split("/"), e2 = 1; e2 < r.length; e2++) {
var t = r[e2];
if (t) {
if ((i = i[t = H.unescapeFragment(t)]) === void 0)
break;
N[t] || ((t = this._getId(i)) && (o = l(o, t)), i.$ref && (t = l(o, i.$ref), t = P.call(this, a, t)) && (i = t.schema, a = t.root, o = t.baseId));
}
}
return i !== void 0 && i !== a.schema ? { schema: i, root: a, baseId: o } : void 0;
}
}
var f = H.toHash(["type", "format", "pattern", "maxLength", "minLength", "maxProperties", "minProperties", "maxItems", "minItems", "maximum", "minimum", "uniqueItems", "multipleOf", "required", "enum"]);
function R(n, o) {
return o !== false && (o === void 0 || o === true ? function i(a) {
var r;
if (Array.isArray(a)) {
for (var e2 = 0; e2 < a.length; e2++)
if (typeof (r = a[e2]) == "object" && !i(r))
return false;
} else
for (var t in a)
if (t == "$ref" || typeof (r = a[t]) == "object" && !i(r))
return false;
return true;
}(n) : o ? function i(a) {
var r, e2 = 0;
if (Array.isArray(a)) {
for (var t = 0; t < a.length; t++)
if (typeof (r = a[t]) == "object" && (e2 += i(r)), e2 == 1 / 0)
return 1 / 0;
} else
for (var s in a) {
if (s == "$ref")
return 1 / 0;
if (f[s])
e2++;
else if (typeof (r = a[s]) == "object" && (e2 += i(r) + 1), e2 == 1 / 0)
return 1 / 0;
}
return e2;
}(n) <= o : void 0);
}
function y(n, o) {
return o !== false && (n = h(n)), C(U.parse(n));
}
function C(n) {
return U.serialize(n).split("#")[0] + "#";
}
var d = /#\/?$/;
function h(n) {
return n ? n.replace(d, "") : "";
}
function l(n, o) {
return o = h(o), U.resolve(n, o);
}
}, 742: function(le, m, D) {
var U = D(9646), x = D(3724).toHash;
le.exports = function() {
var H = [{ type: "number", rules: [{ maximum: ["exclusiveMaximum"] }, { minimum: ["exclusiveMinimum"] }, "multipleOf", "format"] }, { type: "string", rules: ["maxLength", "minLength", "pattern", "format"] }, { type: "array", rules: ["maxItems", "minItems", "items", "contains", "uniqueItems"] }, { type: "object", rules: ["maxProperties", "minProperties", "required", "dependencies", "propertyNames", { properties: ["additionalProperties", "patternProperties"] }] }, { rules: ["$ref", "const", "enum", "not", "anyOf", "oneOf", "allOf", "if"] }], z = ["type", "$comment"];
return H.all = x(z), H.types = x(["number", "integer", "string", "array", "object", "boolean", "null"]), H.forEach(function(j) {
j.rules = j.rules.map(function(Y) {
var P, N;
return typeof Y == "object" && (N = Y[P = Object.keys(Y)[0]], Y = P, N.forEach(function(A) {
z.push(A), H.all[A] = true;
})), z.push(Y), H.all[Y] = { keyword: Y, code: U[Y], implements: N };
}), H.all.$comment = { keyword: "$comment", code: U.$comment }, j.type && (H.types[j.type] = j);
}), H.keywords = x(z.concat(["$schema", "$id", "id", "$data", "$async", "title", "description", "default", "definitions", "examples", "readOnly", "writeOnly", "contentMediaType", "contentEncoding", "additionalItems", "then", "else"])), H.custom = {}, H;
};
}, 4293: function(le, m, D) {
var U = D(3724);
le.exports = function(x) {
U.copy(x, this);
};
}, 6887: function(le) {
le.exports = function(m) {
for (var D, U = 0, x = m.length, H = 0; H < x; )
U++, 55296 <= (D = m.charCodeAt(H++)) && D <= 56319 && H < x && (64512 & m.charCodeAt(H)) == 56320 && H++;
return U;
};
}, 3724: function(le, m, D) {
function U(d, h, l, n) {
var o = n ? " !== " : " === ", i = n ? " || " : " && ", a = n ? "!" : "", r = n ? "" : "!";
switch (d) {
case "null":
return h + o + "null";
case "array":
return a + "Array.isArray(" + h + ")";
case "object":
return "(" + a + h + i + "typeof " + h + o + '"object"' + i + r + "Array.isArray(" + h + "))";
case "integer":
return "(typeof " + h + o + '"number"' + i + r + "(" + h + " % 1)" + i + h + o + h + (l ? i + a + "isFinite(" + h + ")" : "") + ")";
case "number":
return "(typeof " + h + o + '"' + d + '"' + (l ? i + a + "isFinite(" + h + ")" : "") + ")";
default:
return "typeof " + h + o + '"' + d + '"';
}
}
le.exports = { copy: function(d, h) {
for (var l in h = h || {}, d)
h[l] = d[l];
return h;
}, checkDataType: U, checkDataTypes: function(d, h, l) {
{
if (d.length === 1)
return U(d[0], h, l, true);
var n, o = "", d = H(d);
for (n in d.array && d.object && (o = d.null ? "(" : "(!" + h + " || ", o += "typeof " + h + ' !== "object")', delete d.null, delete d.array, delete d.object), d.number && delete d.integer, d)
o += (o ? " && " : "") + U(n, h, l, true);
return o;
}
}, coerceToTypes: function(d, h) {
{
if (!Array.isArray(h))
return x[h] ? [h] : d === "array" && h === "array" ? ["array"] : void 0;
for (var l = [], n = 0; n < h.length; n++) {
var o = h[n];
(x[o] || d === "array" && o === "array") && (l[l.length] = o);
}
return l.length ? l : void 0;
}
}, toHash: H, getProperty: Y, escapeQuotes: P, equal: D(2303), ucs2length: D(6887), varOccurences: function(d, h) {
return h += "[^0-9]", d = d.match(new RegExp(h, "g")), d ? d.length : 0;
}, varReplace: function(d, h, l) {
return h += "([^0-9])", l = l.replace(/\$/g, "$$$$"), d.replace(new RegExp(h, "g"), l + "$1");
}, schemaHasRules: function(d, h) {
if (typeof d == "boolean")
return !d;
for (var l in d)
if (h[l])
return true;
}, schemaHasRulesExcept: function(d, h, l) {
if (typeof d == "boolean")
return !d && l != "not";
for (var n in d)
if (n != l && h[n])
return true;
}, schemaUnknownRules: function(d, h) {
if (typeof d != "boolean") {
for (var l in d)
if (!h[l])
return l;
}
}, toQuotedString: N, getPathExpr: function(d, h, l, n) {
return R(d, l ? "'/' + " + h + (n ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : n ? "'[' + " + h + " + ']'" : "'[\\'' + " + h + " + '\\']'");
}, getPath: function(d, h, l) {
return l = N(l ? "/" + y(h) : Y(h)), R(d, l);
}, getData: function(d, h, l) {
var n, o, i;
if (d === "")
return "rootData";
if (d[0] == "/") {
if (!A.test(d))
throw new Error("Invalid JSON-pointer: " + d);
n = d, o = "rootData";
} else {
if (!(i = d.match(f)))
throw new Error("Invalid JSON-pointer: " + d);
if (d = +i[1], (n = i[2]) == "#") {
if (h <= d)
throw new Error("Cannot access property/index " + d + " levels up, current level is " + h);
return l[h - d];
}
if (h < d)
throw new Error("Cannot access data " + d + " levels up, current level is " + h);
if (o = "data" + (h - d || ""), !n)
return o;
}
for (var a = o, r = n.split("/"), e2 = 0; e2 < r.length; e2++) {
var t = r[e2];
t && (o += Y(C(t)), a += " && " + o);
}
return a;
}, unescapeFragment: function(d) {
return C(decodeURIComponent(d));
}, unescapeJsonPointer: C, escapeFragment: function(d) {
return encodeURIComponent(y(d));
}, escapeJsonPointer: y };
var x = H(["string", "number", "integer", "boolean", "null"]);
function H(d) {
for (var h = {}, l = 0; l < d.length; l++)
h[d[l]] = true;
return h;
}
var z = /^[a-z$_][a-z$_0-9]*$/i, j = /'|\\/g;
function Y(d) {
return typeof d == "number" ? "[" + d + "]" : z.test(d) ? "." + d : "['" + P(d) + "']";
}
function P(d) {
return d.replace(j, "\\$&").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\f/g, "\\f").replace(/\t/g, "\\t");
}
function N(d) {
return "'" + P(d) + "'";
}
var A = /^\/(?:[^~]|~0|~1)*$/, f = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
function R(d, h) {
return d == '""' ? h : (d + " + " + h).replace(/([^\\])' \+ '/g, "$1");
}
function y(d) {
return d.replace(/~/g, "~0").replace(/\//g, "~1");
}
function C(d) {
return d.replace(/~1/g, "/").replace(/~0/g, "~");
}
}, 9394: function(le) {
var m = ["multipleOf", "maximum", "exclusiveMaximum", "minimum", "exclusiveMinimum", "maxLength", "minLength", "pattern", "additionalItems", "maxItems", "minItems", "uniqueItems", "maxProperties", "minProperties", "required", "additionalProperties", "enum", "format", "const"];
le.exports = function(D, U) {
for (var x = 0; x < U.length; x++) {
D = JSON.parse(JSON.stringify(D));
for (var H = U[x].split("/"), z = D, j = 1; j < H.length; j++)
z = z[H[j]];
for (j = 0; j < m.length; j++) {
var Y = m[j], P = z[Y];
P && (z[Y] = { anyOf: [P, { $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" }] });
}
}
return D;
};
}, 5868: function(le, m, D) {
D = D(6680), le.exports = {
$id: "https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",
definitions: { simpleTypes: D.definitions.simpleTypes },
type: "object",
dependencies: { schema: ["validate"], $data: ["validate"], statements: ["inline"], valid: { not: { required: ["macro"] } } },
properties: { type: D.properties.type, schema: { type: "boolean" }, statements: { type: "boolean" }, dependencies: { type: "array", items: { type: "string" } }, metaSchema: { type: "object" }, modifying: { type: "boolean" }, valid: { type: "boolean" }, $data: { type: "boolean" }, async: { type: "boolean" }, errors: { anyOf: [{ type: "boolean" }, { const: "full" }] } }
};
}, 1796: function(le) {
le.exports = function(m, D, U) {
var x, H, z, j, Y, P = " ", N = m.level, A = m.dataLevel, f = m.schema[D], R = m.schemaPath + m.util.getProperty(D), y = m.errSchemaPath + "/" + D, C = !m.opts.allErrors, d = "data" + (A || ""), h = m.opts.$data && f && f.$data, l = h ? (P += " var schema" + N + " = " + m.util.getData(f.$data, A, m.dataPathArr) + "; ", "schema" + N) : f, n = D == "maximum", o = n ? "exclusiveMaximum" : "exclusiveMinimum", i = m.schema[o], a = m.opts.$data && i && i.$data, r = n ? "<" : ">", e2 = n ? ">" : "<", t = void 0;
if (!h && typeof f != "number" && f !== void 0)
throw new Error(D + " must be number");
if (!a && i !== void 0 && typeof i != "number" && typeof i != "boolean")
throw new Error(o + " must be number or boolean");
a ? (A = m.util.getData(i.$data, A, m.dataPathArr), z = "exclIsNumber" + N, j = "' + " + (Y = "op" + N) + " + '", t = o, (s = s || []).push(P = P + (" var schemaExcl" + N + " = " + A + "; ") + (" var " + (x = "exclusive" + N) + "; var " + (H = "exclType" + N) + " = typeof " + (A = "schemaExcl" + N) + "; if (" + H + " != 'boolean' && " + H + " != 'undefined' && " + H + " != 'number') { ")), P = "", m.createErrors !== false ? (P += " { keyword: '" + (t || "_exclusiveLimit") + "' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(y) + " , params: {} ", m.opts.messages !== false && (P += " , message: '" + o + " should be boolean' "), m.opts.verbose && (P += " , schema: validate.schema" + R + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + d + " "), P += " } ") : P += " {} ", c = P, P = s.pop(), !m.compositeRule && C ? m.async ? P += " throw new ValidationError([" + c + "]); " : P += " validate.errors = [" + c + "]; return false; " : P += " var err = " + c + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", P += " } else if ( ", h && (P += " (" + l + " !== undefined && typeof " + l + " != 'number') || "), P += " " + H + " == 'number' ? ( (" + x + " = " + l + " === undefined || " + A + " " + r + "= " + l + ") ? " + d + " " + e2 + "= " + A + " : " + d + " " + e2 + " " + l + " ) : ( (" + x + " = " + A + " === true) ? " + d + " " + e2 + "= " + l + " : " + d + " " + e2 + " " + l + " ) || " + d + " !== " + d + ") { var op" + N + " = " + x + " ? '" + r + "' : '" + r + "='; ", f === void 0 && (y = m.errSchemaPath + "/" + (t = o), l = A, h = a)) : (j = r, (z = typeof i == "number") && h ? (Y = "'" + j + "'", P += " if ( ", h && (P += " (" + l + " !== undefined && typeof " + l + " != 'number') || "), P += " ( " + l + " === undefined || " + i + " " + r + "= " + l + " ? " + d + " " + e2 + "= " + i + " : " + d + " " + e2 + " " + l + " ) || " + d + " !== " + d + ") { ") : (z && f === void 0 ? (x = true, y = m.errSchemaPath + "/" + (t = o), l = i, e2 += "=") : (z && (l = Math[n ? "min" : "max"](i, f)), i === (!z || l) ? (x = true, y = m.errSchemaPath + "/" + (t = o), e2 += "=") : (x = false, j += "=")), Y = "'" + j + "'", P += " if ( ", h && (P += " (" + l + " !== undefined && typeof " + l + " != 'number') || "), P += " " + d + " " + e2 + " " + l + " || " + d + " !== " + d + ") { ")), t = t || D, (s = s || []).push(P), P = "", m.createErrors !== false ? (P += " { keyword: '" + (t || "_limit") + "' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(y) + " , params: { comparison: " + Y + ", limit: " + l + ", exclusive: " + x + " } ", m.opts.messages !== false && (P = P + " , message: 'should be " + j + " " + (h ? "' + " + l : l + "'")), m.opts.verbose && (P = (P += " , schema: ") + (h ? "validate.schema" + R : "" + f) + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + d + " "), P += " } ") : P += " {} ";
var s, c = P;
return P = s.pop(), !m.compositeRule && C ? m.async ? P += " throw new ValidationError([" + c + "]); " : P += " validate.errors = [" + c + "]; return false; " : P += " var err = " + c + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", P += " } ", C && (P += " else { "), P;
};
}, 2407: function(le) {
le.exports = function(m, D, U) {
var x, H = " ", z = m.level, R = m.dataLevel, j = m.schema[D], Y = m.schemaPath + m.util.getProperty(D), P = m.errSchemaPath + "/" + D, N = !m.opts.allErrors, A = "data" + (R || ""), f = m.opts.$data && j && j.$data, R = f ? (H += " var schema" + z + " = " + m.util.getData(j.$data, R, m.dataPathArr) + "; ", "schema" + z) : j;
if (f || typeof j == "number")
return H += "if ( ", f && (H += " (" + R + " !== undefined && typeof " + R + " != 'number') || "), (z = []).push(H += " " + A + ".length " + ((x = D) == "maxItems" ? ">" : "<") + " " + R + ") { "), H = "", m.createErrors !== false ? (H += " { keyword: '" + (x || "_limitItems") + "' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(P) + " , params: { limit: " + R + " } ", m.opts.messages !== false && (H = (H = (H += " , message: 'should NOT have ") + (D == "maxItems" ? "more" : "fewer") + " than ") + (f ? "' + " + R + " + '" : "" + j) + " items' "), m.opts.verbose && (H = (H += " , schema: ") + (f ? "validate.schema" + Y : "" + j) + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + A + " "), H += " } ") : H += " {} ", x = H, H = z.pop(), !m.compositeRule && N ? m.async ? H += " throw new ValidationError([" + x + "]); " : H += " validate.errors = [" + x + "]; return false; " : H += " var err = " + x + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", H += "} ", N && (H += " else { "), H;
throw new Error(D + " must be number");
};
}, 1250: function(le) {
le.exports = function(m, D, U) {
var x, H = " ", z = m.level, R = m.dataLevel, j = m.schema[D], Y = m.schemaPath + m.util.getProperty(D), P = m.errSchemaPath + "/" + D, N = !m.opts.allErrors, A = "data" + (R || ""), f = m.opts.$data && j && j.$data, R = f ? (H += " var schema" + z + " = " + m.util.getData(j.$data, R, m.dataPathArr) + "; ", "schema" + z) : j;
if (f || typeof j == "number")
return H += "if ( ", f && (H += " (" + R + " !== undefined && typeof " + R + " != 'number') || "), m.opts.unicode === false ? H += " " + A + ".length " : H += " ucs2length(" + A + ") ", (z = []).push(H += " " + ((x = D) == "maxLength" ? ">" : "<") + " " + R + ") { "), H = "", m.createErrors !== false ? (H += " { keyword: '" + (x || "_limitLength") + "' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(P) + " , params: { limit: " + R + " } ", m.opts.messages !== false && (H = (H = (H += " , message: 'should NOT be ") + (D == "maxLength" ? "longer" : "shorter") + " than ") + (f ? "' + " + R + " + '" : "" + j) + " characters' "), m.opts.verbose && (H = (H += " , schema: ") + (f ? "validate.schema" + Y : "" + j) + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + A + " "), H += " } ") : H += " {} ", x = H, H = z.pop(), !m.compositeRule && N ? m.async ? H += " throw new ValidationError([" + x + "]); " : H += " validate.errors = [" + x + "]; return false; " : H += " var err = " + x + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", H += "} ", N && (H += " else { "), H;
throw new Error(D + " must be number");
};
}, 2596: function(le) {
le.exports = function(m, D, U) {
var x, H = " ", z = m.level, R = m.dataLevel, j = m.schema[D], Y = m.schemaPath + m.util.getProperty(D), P = m.errSchemaPath + "/" + D, N = !m.opts.allErrors, A = "data" + (R || ""), f = m.opts.$data && j && j.$data, R = f ? (H += " var schema" + z + " = " + m.util.getData(j.$data, R, m.dataPathArr) + "; ", "schema" + z) : j;
if (f || typeof j == "number")
return H += "if ( ", f && (H += " (" + R + " !== undefined && typeof " + R + " != 'number') || "), (z = []).push(H += " Object.keys(" + A + ").length " + ((x = D) == "maxProperties" ? ">" : "<") + " " + R + ") { "), H = "", m.createErrors !== false ? (H += " { keyword: '" + (x || "_limitProperties") + "' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(P) + " , params: { limit: " + R + " } ", m.opts.messages !== false && (H = (H = (H += " , message: 'should NOT have ") + (D == "maxProperties" ? "more" : "fewer") + " than ") + (f ? "' + " + R + " + '" : "" + j) + " properties' "), m.opts.verbose && (H = (H += " , schema: ") + (f ? "validate.schema" + Y : "" + j) + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + A + " "), H += " } ") : H += " {} ", x = H, H = z.pop(), !m.compositeRule && N ? m.async ? H += " throw new ValidationError([" + x + "]); " : H += " validate.errors = [" + x + "]; return false; " : H += " var err = " + x + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", H += "} ", N && (H += " else { "), H;
throw new Error(D + " must be number");
};
}, 9486: function(le) {
le.exports = function(m, D, U) {
var x = " ", H = m.schema[D], z = m.schemaPath + m.util.getProperty(D), j = m.errSchemaPath + "/" + D, Y = !m.opts.allErrors, P = m.util.copy(m), N = "", A = (P.level++, "valid" + P.level), f = P.baseId, R = true, y = H;
if (y)
for (var C, d = -1, h = y.length - 1; d < h; )
C = y[d += 1], (m.opts.strictKeywords ? typeof C == "object" && 0 < Object.keys(C).length || C === false : m.util.schemaHasRules(C, m.RULES.all)) && (R = false, P.schema = C, P.schemaPath = z + "[" + d + "]", P.errSchemaPath = j + "/" + d, x += " " + m.validate(P) + " ", P.baseId = f, Y) && (x += " if (" + A + ") { ", N += "}");
return Y && (x += R ? " if (true) { " : " " + N.slice(0, -1) + " "), x;
};
}, 5347: function(le) {
le.exports = function(m, Y, U) {
var x = " ", A = m.level, P = m.dataLevel, H = m.schema[Y], z = m.schemaPath + m.util.getProperty(Y), j = m.errSchemaPath + "/" + Y, Y = !m.opts.allErrors, P = "data" + (P || ""), N = "valid" + A, A = "errs__" + A, f = m.util.copy(m), R = "", y = (f.level++, "valid" + f.level);
if (H.every(function(i) {
return m.opts.strictKeywords ? typeof i == "object" && 0 < Object.keys(i).length || i === false : m.util.schemaHasRules(i, m.RULES.all);
})) {
var C = f.baseId, d = (x += " var " + A + " = errors; var " + N + " = false; ", m.compositeRule), h = (m.compositeRule = f.compositeRule = true, H);
if (h)
for (var l, n = -1, o = h.length - 1; n < o; )
l = h[n += 1], f.schema = l, f.schemaPath = z + "[" + n + "]", f.errSchemaPath = j + "/" + n, x += " " + m.validate(f) + " ", f.baseId = C, x += " " + N + " = " + N + " || " + y + "; if (!" + N + ") { ", R += "}";
m.compositeRule = f.compositeRule = d, x += " " + R + " if (!" + N + ") { var err = ", m.createErrors !== false ? (x += " { keyword: 'anyOf' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(j) + " , params: {} ", m.opts.messages !== false && (x += " , message: 'should match some schema in anyOf' "), m.opts.verbose && (x += " , schema: validate.schema" + z + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + P + " "), x += " } ") : x += " {} ", x += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", !m.compositeRule && Y && (m.async ? x += " throw new ValidationError(vErrors); " : x += " validate.errors = vErrors; return false; "), x += " } else { errors = " + A + "; if (vErrors !== null) { if (" + A + ") vErrors.length = " + A + "; else vErrors = null; } ", m.opts.allErrors && (x += " } ");
} else
Y && (x += " if (true) { ");
return x;
};
}, 923: function(le) {
le.exports = function(m, H, U) {
var x = " ", z = m.schema[H], H = m.errSchemaPath + "/" + H, z = (m.opts.allErrors, m.util.toQuotedString(z));
return m.opts.$comment === true ? x += " console.log(" + z + ");" : typeof m.opts.$comment == "function" && (x += " self._opts.$comment(" + z + ", " + m.util.toQuotedString(H) + ", validate.root.schema);"), x;
};
}, 2617: function(le) {
le.exports = function(m, z, U) {
var R = " ", x = m.level, f = m.dataLevel, A = m.schema[z], H = m.schemaPath + m.util.getProperty(z), z = m.errSchemaPath + "/" + z, j = !m.opts.allErrors, Y = "data" + (f || ""), P = "valid" + x, N = m.opts.$data && A && A.$data, A = (N && (R += " var schema" + x + " = " + m.util.getData(A.$data, f, m.dataPathArr) + "; "), N || (R += " var schema" + x + " = validate.schema" + H + ";"), []), f = (A.push(R += "var " + P + " = equal(" + Y + ", schema" + x + "); if (!" + P + ") { "), R = "", m.createErrors !== false ? (R += " { keyword: 'const' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(z) + " , params: { allowedValue: schema" + x + " } ", m.opts.messages !== false && (R += " , message: 'should be equal to constant' "), m.opts.verbose && (R += " , schema: validate.schema" + H + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + Y + " "), R += " } ") : R += " {} ", R), R = A.pop();
return !m.compositeRule && j ? m.async ? R += " throw new ValidationError([" + f + "]); " : R += " validate.errors = [" + f + "]; return false; " : R += " var err = " + f + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", R += " }", j && (R += " else { "), R;
};
}, 2119: function(le) {
le.exports = function(m, z, U) {
var l = " ", d = m.level, Y = m.dataLevel, x = m.schema[z], H = m.schemaPath + m.util.getProperty(z), z = m.errSchemaPath + "/" + z, j = !m.opts.allErrors, Y = "data" + (Y || ""), P = "valid" + d, N = "errs__" + d, A = m.util.copy(m), f = (A.level++, "valid" + A.level), d = "i" + d, R = A.dataLevel = m.dataLevel + 1, y = "data" + R, h = m.baseId, C = m.opts.strictKeywords ? typeof x == "object" && 0 < Object.keys(x).length || x === false : m.util.schemaHasRules(x, m.RULES.all), d = (l += "var " + N + " = errors;var " + P + ";", C ? (P = m.compositeRule, m.compositeRule = A.compositeRule = true, A.schema = x, A.schemaPath = H, A.errSchemaPath = z, l += " var " + f + " = false; for (var " + d + " = 0; " + d + " < " + Y + ".length; " + d + "++) { ", A.errorPath = m.util.getPathExpr(m.errorPath, d, m.opts.jsonPointers, true), x = Y + "[" + d + "]", A.dataPathArr[R] = d, R = m.validate(A), A.baseId = h, m.util.varOccurences(R, y) < 2 ? l += " " + m.util.varReplace(R, y, x) + " " : l += " var " + y + " = " + x + "; " + R + " ", l += " if (" + f + ") break; } ", m.compositeRule = A.compositeRule = P, l += " if (!" + f + ") {") : l += " if (" + Y + ".length == 0) {", []), h = (d.push(l), l = "", m.createErrors !== false ? (l += " { keyword: 'contains' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(z) + " , params: {} ", m.opts.messages !== false && (l += " , message: 'should contain a valid item' "), m.opts.verbose && (l += " , schema: validate.schema" + H + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + Y + " "), l += " } ") : l += " {} ", l), l = d.pop();
return !m.compositeRule && j ? m.async ? l += " throw new ValidationError([" + h + "]); " : l += " validate.errors = [" + h + "]; return false; " : l += " var err = " + h + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", l += " } else { ", C && (l += " errors = " + N + "; if (vErrors !== null) { if (" + N + ") vErrors.length = " + N + "; else vErrors = null; } "), m.opts.allErrors && (l += " } "), l;
};
}, 1793: function(le) {
le.exports = function(m, p, U) {
var x, H, z, j = " ", Y = m.level, P = m.dataLevel, g = m.schema[p], N = m.schemaPath + m.util.getProperty(p), A = m.errSchemaPath + "/" + p, f = !m.opts.allErrors, R = "data" + (P || ""), y = "valid" + Y, C = "errs__" + Y, d = m.opts.$data && g && g.$data, h = d ? (j += " var schema" + Y + " = " + m.util.getData(g.$data, P, m.dataPathArr) + "; ", "schema" + Y) : g, l = "definition" + Y, n = this.definition, o = "";
if (d && n.$data) {
var i = "keywordValidate" + Y, a = n.validateSchema;
j += " var " + l + " = RULES.custom['" + p + "'].definition; var " + i + " = " + l + ".validate;";
} else {
if (!(s = m.useCustomRule(this, g, m.schema, m)))
return;
h = "validate.schema" + N, i = s.code, x = n.compile, H = n.inline, z = n.macro;
}
var r, e2, t, s, c, p = i + ".errors", g = "i" + Y, b = "ruleErr" + Y, w = n.async;
if (w && !m.async)
throw new Error("async keyword in sync schema");
return H || z || (j += p + " = null;"), j += "var " + C + " = errors;var " + y + ";", d && n.$data && (o += "}", j += " if (" + h + " === undefined) { " + y + " = true; } else { ", a) && (o += "}", j += " " + y + " = " + l + ".validateSchema(" + h + "); if (" + y + ") { "), H ? n.statements ? j += " " + s.validate + " " : j += " " + y + " = " + s.validate + "; " : z ? (o = "", (d = m.util.copy(m)).level++, r = "valid" + d.level, d.schema = s.validate, d.schemaPath = "", a = m.compositeRule, m.compositeRule = d.compositeRule = true, l = m.validate(d).replace(/validate\.schema/g, i), m.compositeRule = d.compositeRule = a, j += " " + l) : ((c = c || []).push(j), j = "", j += " " + i + ".call( ", m.opts.passContext ? j += "this" : j += "self", x || n.schema === false ? j += " , " + R + " " : j += " , " + h + " , " + R + " , validate.schema" + m.schemaPath + " ", j += " , (dataPath || '')", m.errorPath != '""' && (j += " + " + m.errorPath), s = j += " , " + (e2 = P ? "data" + (P - 1 || "") : "parentData") + " , " + (t = P ? m.dataPathArr[P] : "parentDataProperty") + " , rootData ) ", j = c.pop(), n.errors === false ? (j += " " + y + " = ", w && (j += "await "), j += s + "; ") : j += w ? " var " + (p = "customErrors" + Y) + " = null; try { " + y + " = await " + s + "; } catch (e) { " + y + " = false; if (e instanceof ValidationError) " + p + " = e.errors; else throw e; } " : " " + p + " = null; " + y + " = " + s + "; "), n.modifying && (j += " if (" + e2 + ") " + R + " = " + e2 + "[" + t + "];"), j += "" + o, n.valid ? f && (j += " if (true) { ") : (j += " if ( ", n.valid === void 0 ? j = j + " !" + (z ? "" + r : y) : j += " " + !n.valid + " ", d = this.keyword, (c = c || []).push(j += ") { "), (c = c || []).push(j = ""), j = "", m.createErrors !== false ? (j += " { keyword: '" + (d || "custom") + "' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(A) + " , params: { keyword: '" + this.keyword + "' } ", m.opts.messages !== false && (j += ` , message: 'should pass "` + this.keyword + `" keyword validation' `), m.opts.verbose && (j += " , schema: validate.schema" + N + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + R + " "), j += " } ") : j += " {} ", a = j, j = c.pop(), !m.compositeRule && f ? m.async ? j += " throw new ValidationError([" + a + "]); " : j += " validate.errors = [" + a + "]; return false; " : j += " var err = " + a + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", l = j, j = c.pop(), H ? n.errors ? n.errors != "full" && (j += " for (var " + g + "=" + C + "; " + g + " " + r + ") { ", t = P + "[" + r + "]", f.schema = c, f.schemaPath = z + "[" + r + "]", f.errSchemaPath = j + "/" + r, f.errorPath = m.util.getPathExpr(m.errorPath, r, m.opts.jsonPointers, true), f.dataPathArr[d] = r, s = m.validate(f), f.baseId = l, m.util.varOccurences(s, h) < 2 ? x += " " + m.util.varReplace(s, h, t) + " " : x += " var " + h + " = " + t + "; " + s + " ", x += " } ", Y) && (x += " if (" + y + ") { ", R += "}");
}
typeof i == "object" && (m.opts.strictKeywords ? typeof i == "object" && 0 < Object.keys(i).length || i === false : m.util.schemaHasRules(i, m.RULES.all)) && (f.schema = i, f.schemaPath = m.schemaPath + ".additionalItems", f.errSchemaPath = m.errSchemaPath + "/additionalItems", x += " " + y + " = true; if (" + P + ".length > " + H.length + ") { for (var " + C + " = " + H.length + "; " + C + " < " + P + ".length; " + C + "++) { ", f.errorPath = m.util.getPathExpr(m.errorPath, C, m.opts.jsonPointers, true), t = P + "[" + C + "]", f.dataPathArr[d] = C, s = m.validate(f), f.baseId = l, m.util.varOccurences(s, h) < 2 ? x += " " + m.util.varReplace(s, h, t) + " " : x += " var " + h + " = " + t + "; " + s + " ", Y && (x += " if (!" + y + ") break; "), x += " } } ", Y) && (x += " if (" + y + ") { ", R += "}");
} else
(m.opts.strictKeywords ? typeof H == "object" && 0 < Object.keys(H).length || H === false : m.util.schemaHasRules(H, m.RULES.all)) && (f.schema = H, f.schemaPath = z, f.errSchemaPath = j, x += " for (var " + C + " = 0; " + C + " < " + P + ".length; " + C + "++) { ", f.errorPath = m.util.getPathExpr(m.errorPath, C, m.opts.jsonPointers, true), t = P + "[" + C + "]", f.dataPathArr[d] = C, s = m.validate(f), f.baseId = l, m.util.varOccurences(s, h) < 2 ? x += " " + m.util.varReplace(s, h, t) + " " : x += " var " + h + " = " + t + "; " + s + " ", Y && (x += " if (!" + y + ") break; "), x += " }");
return Y && (x += " " + R + " if (" + A + " == errors) {"), x;
};
}, 6039: function(le) {
le.exports = function(m, D, U) {
var x = " ", H = m.level, f = m.dataLevel, z = m.schema[D], j = m.schemaPath + m.util.getProperty(D), Y = m.errSchemaPath + "/" + D, P = !m.opts.allErrors, N = "data" + (f || ""), A = m.opts.$data && z && z.$data, f = A ? (x += " var schema" + H + " = " + m.util.getData(z.$data, f, m.dataPathArr) + "; ", "schema" + H) : z;
if (!A && typeof z != "number")
throw new Error(D + " must be number");
return x += "var division" + H + ";if (", A && (x += " " + f + " !== undefined && ( typeof " + f + " != 'number' || "), x += " (division" + H + " = " + N + " / " + f + ", ", m.opts.multipleOfPrecision ? x += " Math.abs(Math.round(division" + H + ") - division" + H + ") > 1e-" + m.opts.multipleOfPrecision + " " : x += " division" + H + " !== parseInt(division" + H + ") ", x += " ) ", A && (x += " ) "), D = [], D.push(x += " ) { "), x = "", m.createErrors !== false ? (x += " { keyword: 'multipleOf' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(Y) + " , params: { multipleOf: " + f + " } ", m.opts.messages !== false && (x = x + " , message: 'should be multiple of " + (A ? "' + " + f : f + "'")), m.opts.verbose && (x = (x += " , schema: ") + (A ? "validate.schema" + j : "" + z) + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + N + " "), x += " } ") : x += " {} ", H = x, x = D.pop(), !m.compositeRule && P ? m.async ? x += " throw new ValidationError([" + H + "]); " : x += " validate.errors = [" + H + "]; return false; " : x += " var err = " + H + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", x += "} ", P && (x += " else { "), x;
};
}, 7946: function(le) {
le.exports = function(m, P, U) {
var x, H, z = " ", f = m.level, A = m.dataLevel, j = m.schema[P], Y = m.schemaPath + m.util.getProperty(P), P = m.errSchemaPath + "/" + P, N = !m.opts.allErrors, A = "data" + (A || ""), f = "errs__" + f, R = m.util.copy(m), y = (R.level++, "valid" + R.level);
return (m.opts.strictKeywords ? typeof j == "object" && 0 < Object.keys(j).length || j === false : m.util.schemaHasRules(j, m.RULES.all)) ? (R.schema = j, R.schemaPath = Y, R.errSchemaPath = P, z += " var " + f + " = errors; ", j = m.compositeRule, m.compositeRule = R.compositeRule = true, R.createErrors = false, R.opts.allErrors && (H = R.opts.allErrors, R.opts.allErrors = false), z += " " + m.validate(R) + " ", R.createErrors = true, H && (R.opts.allErrors = H), m.compositeRule = R.compositeRule = j, (x = x || []).push(z += " if (" + y + ") { "), z = "", m.createErrors !== false ? (z += " { keyword: 'not' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(P) + " , params: {} ", m.opts.messages !== false && (z += " , message: 'should NOT be valid' "), m.opts.verbose && (z += " , schema: validate.schema" + Y + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + A + " "), z += " } ") : z += " {} ", H = z, z = x.pop(), !m.compositeRule && N ? m.async ? z += " throw new ValidationError([" + H + "]); " : z += " validate.errors = [" + H + "]; return false; " : z += " var err = " + H + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", z += " } else { errors = " + f + "; if (vErrors !== null) { if (" + f + ") vErrors.length = " + f + "; else vErrors = null; } ", m.opts.allErrors && (z += " } ")) : (z += " var err = ", m.createErrors !== false ? (z += " { keyword: 'not' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(P) + " , params: {} ", m.opts.messages !== false && (z += " , message: 'should NOT be valid' "), m.opts.verbose && (z += " , schema: validate.schema" + Y + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + A + " "), z += " } ") : z += " {} ", z += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", N && (z += " if (false) { ")), z;
};
}, 9344: function(le) {
le.exports = function(m, Y, U) {
var x = " ", l = m.level, P = m.dataLevel, H = m.schema[Y], z = m.schemaPath + m.util.getProperty(Y), j = m.errSchemaPath + "/" + Y, Y = !m.opts.allErrors, P = "data" + (P || ""), N = "valid" + l, A = "errs__" + l, f = m.util.copy(m), R = "", y = (f.level++, "valid" + f.level), C = f.baseId, d = "prevValid" + l, h = "passingSchemas" + l, l = (x += "var " + A + " = errors , " + d + " = false , " + N + " = false , " + h + " = null; ", m.compositeRule), n = (m.compositeRule = f.compositeRule = true, H);
if (n)
for (var o, i = -1, a = n.length - 1; i < a; )
o = n[i += 1], (m.opts.strictKeywords ? typeof o == "object" && 0 < Object.keys(o).length || o === false : m.util.schemaHasRules(o, m.RULES.all)) ? (f.schema = o, f.schemaPath = z + "[" + i + "]", f.errSchemaPath = j + "/" + i, x += " " + m.validate(f) + " ", f.baseId = C) : x += " var " + y + " = true; ", i && (x += " if (" + y + " && " + d + ") { " + N + " = false; " + h + " = [" + h + ", " + i + "]; } else { ", R += "}"), x += " if (" + y + ") { " + N + " = " + d + " = true; " + h + " = " + i + "; }";
return m.compositeRule = f.compositeRule = l, x += R + "if (!" + N + ") { var err = ", m.createErrors !== false ? (x += " { keyword: 'oneOf' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(j) + " , params: { passingSchemas: " + h + " } ", m.opts.messages !== false && (x += " , message: 'should match exactly one schema in oneOf' "), m.opts.verbose && (x += " , schema: validate.schema" + z + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + P + " "), x += " } ") : x += " {} ", x += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", !m.compositeRule && Y && (m.async ? x += " throw new ValidationError(vErrors); " : x += " validate.errors = vErrors; return false; "), x += "} else { errors = " + A + "; if (vErrors !== null) { if (" + A + ") vErrors.length = " + A + "; else vErrors = null; }", m.opts.allErrors && (x += " } "), x;
};
}, 9737: function(le) {
le.exports = function(m, z, U) {
var R = " ", f = m.level, N = m.dataLevel, x = m.schema[z], H = m.schemaPath + m.util.getProperty(z), z = m.errSchemaPath + "/" + z, j = !m.opts.allErrors, Y = "data" + (N || ""), P = m.opts.$data && x && x.$data, N = P ? (R += " var schema" + f + " = " + m.util.getData(x.$data, N, m.dataPathArr) + "; ", "schema" + f) : x, f = P ? "(new RegExp(" + N + "))" : m.usePattern(x), A = (R += "if ( ", P && (R += " (" + N + " !== undefined && typeof " + N + " != 'string') || "), []), f = (A.push(R += " !" + f + ".test(" + Y + ") ) { "), R = "", m.createErrors !== false ? (R = (R += " { keyword: 'pattern' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(z) + " , params: { pattern: ") + (P ? "" + N : "" + m.util.toQuotedString(x)) + " } ", m.opts.messages !== false && (R = (R += ` , message: 'should match pattern "`) + (P ? "' + " + N + " + '" : "" + m.util.escapeQuotes(x)) + `"' `), m.opts.verbose && (R = (R = (R += " , schema: ") + (P ? "validate.schema" + H : "" + m.util.toQuotedString(x))) + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + Y + " "), R += " } ") : R += " {} ", R), R = A.pop();
return !m.compositeRule && j ? m.async ? R += " throw new ValidationError([" + f + "]); " : R += " validate.errors = [" + f + "]; return false; " : R += " var err = " + f + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", R += "} ", j && (R += " else { "), R;
};
}, 2537: function(le) {
le.exports = function(m, f, U) {
var x, H = " ", z = m.level, i = m.dataLevel, j = m.schema[f], Y = m.schemaPath + m.util.getProperty(f), P = m.errSchemaPath + "/" + f, N = !m.opts.allErrors, A = "data" + (i || ""), f = "errs__" + z, R = m.util.copy(m), y = "", C = (R.level++, "valid" + R.level), d = "key" + z, h = "idx" + z, l = R.dataLevel = m.dataLevel + 1, n = "data" + l, o = "dataProperties" + z, i = Object.keys(j || {}).filter(M), a = m.schema.patternProperties || {}, r = Object.keys(a).filter(M), e2 = m.schema.additionalProperties, t = i.length || r.length, s = e2 === false, c = typeof e2 == "object" && Object.keys(e2).length, p = m.opts.removeAdditional, g = s || c || p, b = m.opts.ownProperties, w = m.baseId, E = m.schema.required;
function M(xe) {
return xe !== "__proto__";
}
if (E && (!m.opts.$data || !E.$data) && E.length < m.opts.loopRequired && (x = m.util.toHash(E)), H += "var " + f + " = errors;var " + C + " = true;", b && (H += " var " + o + " = undefined;"), g) {
if (H += b ? " " + o + " = " + o + " || Object.keys(" + A + "); for (var " + h + "=0; " + h + "<" + o + ".length; " + h + "++) { var " + d + " = " + o + "[" + h + "]; " : " for (var " + d + " in " + A + ") { ", t) {
if (H += " var isAdditional" + z + " = !(false ", i.length)
if (8 < i.length)
H += " || validate.schema" + Y + ".hasOwnProperty(" + d + ") ";
else {
var B2 = i;
if (B2)
for (var Z = -1, k = B2.length - 1; Z < k; )
W = B2[Z += 1], H += " || " + d + " == " + m.util.toQuotedString(W) + " ";
}
if (r.length) {
var u = r;
if (u)
for (var _ = -1, v = u.length - 1; _ < v; )
J = u[_ += 1], H += " || " + m.usePattern(J) + ".test(" + d + ") ";
}
H += " ); if (isAdditional" + z + ") { ";
}
p == "all" ? H += " delete " + A + "[" + d + "]; " : (T = m.errorPath, E = "' + " + d + " + '", m.opts._errorDataPathProperty && (m.errorPath = m.util.getPathExpr(m.errorPath, d, m.opts.jsonPointers)), s ? p ? H += " delete " + A + "[" + d + "]; " : (V = P, P = m.errSchemaPath + "/additionalProperties", (I = I || []).push(H += " " + C + " = false; "), H = "", m.createErrors !== false ? (H += " { keyword: 'additionalProperties' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(P) + " , params: { additionalProperty: '" + E + "' } ", m.opts.messages !== false && (H += " , message: '", m.opts._errorDataPathProperty ? H += "is an invalid additional property" : H += "should NOT have additional properties", H += "' "), m.opts.verbose && (H += " , schema: false , parentSchema: validate.schema" + m.schemaPath + " , data: " + A + " "), H += " } ") : H += " {} ", S = H, H = I.pop(), !m.compositeRule && N ? m.async ? H += " throw new ValidationError([" + S + "]); " : H += " validate.errors = [" + S + "]; return false; " : H += " var err = " + S + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", P = V, N && (H += " break; ")) : c && (p == "failing" ? (H += " var " + f + " = errors; ", g = m.compositeRule, m.compositeRule = R.compositeRule = true, R.schema = e2, R.schemaPath = m.schemaPath + ".additionalProperties", R.errSchemaPath = m.errSchemaPath + "/additionalProperties", R.errorPath = m.opts._errorDataPathProperty ? m.errorPath : m.util.getPathExpr(m.errorPath, d, m.opts.jsonPointers), me = A + "[" + d + "]", R.dataPathArr[l] = d, ye = m.validate(R), R.baseId = w, m.util.varOccurences(ye, n) < 2 ? H += " " + m.util.varReplace(ye, n, me) + " " : H += " var " + n + " = " + me + "; " + ye + " ", H += " if (!" + C + ") { errors = " + f + "; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete " + A + "[" + d + "]; } ", m.compositeRule = R.compositeRule = g) : (R.schema = e2, R.schemaPath = m.schemaPath + ".additionalProperties", R.errSchemaPath = m.errSchemaPath + "/additionalProperties", R.errorPath = m.opts._errorDataPathProperty ? m.errorPath : m.util.getPathExpr(m.errorPath, d, m.opts.jsonPointers), me = A + "[" + d + "]", R.dataPathArr[l] = d, ye = m.validate(R), R.baseId = w, m.util.varOccurences(ye, n) < 2 ? H += " " + m.util.varReplace(ye, n, me) + " " : H += " var " + n + " = " + me + "; " + ye + " ", N && (H += " if (!" + C + ") break; "))), m.errorPath = T), t && (H += " } "), H += " } ", N && (H += " if (" + C + ") { ", y += "}");
}
var $ = m.opts.useDefaults && !m.compositeRule;
if (i.length) {
var G = i;
if (G)
for (var W, X = -1, Q = G.length - 1; X < Q; ) {
var K, ne, T, V, F, I, S, L = j[W = G[X += 1]];
(m.opts.strictKeywords ? typeof L == "object" && 0 < Object.keys(L).length || L === false : m.util.schemaHasRules(L, m.RULES.all)) && (me = A + (F = m.util.getProperty(W)), K = $ && L.default !== void 0, R.schema = L, R.schemaPath = Y + F, R.errSchemaPath = P + "/" + m.util.escapeFragment(W), R.errorPath = m.util.getPath(m.errorPath, W, m.opts.jsonPointers), R.dataPathArr[l] = m.util.toQuotedString(W), ye = m.validate(R), R.baseId = w, m.util.varOccurences(ye, n) < 2 ? (ye = m.util.varReplace(ye, n, me), ne = me) : H += " var " + (ne = n) + " = " + me + "; ", K ? H += " " + ye + " " : (x && x[W] ? (H += " if ( " + ne + " === undefined ", b && (H += " || ! Object.prototype.hasOwnProperty.call(" + A + ", '" + m.util.escapeQuotes(W) + "') "), H += ") { " + C + " = false; ", T = m.errorPath, V = P, F = m.util.escapeQuotes(W), m.opts._errorDataPathProperty && (m.errorPath = m.util.getPath(T, W, m.opts.jsonPointers)), P = m.errSchemaPath + "/required", (I = I || []).push(H), H = "", m.createErrors !== false ? (H += " { keyword: 'required' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(P) + " , params: { missingProperty: '" + F + "' } ", m.opts.messages !== false && (H += " , message: '", m.opts._errorDataPathProperty ? H += "is a required property" : H += "should have required property \\'" + F + "\\'", H += "' "), m.opts.verbose && (H += " , schema: validate.schema" + Y + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + A + " "), H += " } ") : H += " {} ", S = H, H = I.pop(), !m.compositeRule && N ? m.async ? H += " throw new ValidationError([" + S + "]); " : H += " validate.errors = [" + S + "]; return false; " : H += " var err = " + S + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", P = V, m.errorPath = T, H += " } else { ") : N ? (H += " if ( " + ne + " === undefined ", b && (H += " || ! Object.prototype.hasOwnProperty.call(" + A + ", '" + m.util.escapeQuotes(W) + "') "), H += ") { " + C + " = true; } else { ") : (H += " if (" + ne + " !== undefined ", b && (H += " && Object.prototype.hasOwnProperty.call(" + A + ", '" + m.util.escapeQuotes(W) + "') "), H += " ) { "), H += " " + ye + " } ")), N && (H += " if (" + C + ") { ", y += "}");
}
}
if (r.length) {
var O = r;
if (O)
for (var J, re = -1, pe = O.length - 1; re < pe; ) {
var me, ye, L = a[J = O[re += 1]];
(m.opts.strictKeywords ? typeof L == "object" && 0 < Object.keys(L).length || L === false : m.util.schemaHasRules(L, m.RULES.all)) && (R.schema = L, R.schemaPath = m.schemaPath + ".patternProperties" + m.util.getProperty(J), R.errSchemaPath = m.errSchemaPath + "/patternProperties/" + m.util.escapeFragment(J), H = (H += b ? " " + o + " = " + o + " || Object.keys(" + A + "); for (var " + h + "=0; " + h + "<" + o + ".length; " + h + "++) { var " + d + " = " + o + "[" + h + "]; " : " for (var " + d + " in " + A + ") { ") + " if (" + m.usePattern(J) + ".test(" + d + ")) { ", R.errorPath = m.util.getPathExpr(m.errorPath, d, m.opts.jsonPointers), me = A + "[" + d + "]", R.dataPathArr[l] = d, ye = m.validate(R), R.baseId = w, m.util.varOccurences(ye, n) < 2 ? H += " " + m.util.varReplace(ye, n, me) + " " : H += " var " + n + " = " + me + "; " + ye + " ", N && (H += " if (!" + C + ") break; "), H += " } ", N && (H += " else " + C + " = true; "), H += " } ", N) && (H += " if (" + C + ") { ", y += "}");
}
}
return N && (H += " " + y + " if (" + f + " == errors) {"), H;
};
}, 2127: function(le) {
le.exports = function(m, C, U) {
var x, H, z, j, Y, P, N, A = " ", f = m.level, h = m.dataLevel, R = m.schema[C], y = m.schemaPath + m.util.getProperty(C), C = m.errSchemaPath + "/" + C, d = !m.opts.allErrors, h = "data" + (h || ""), l = "errs__" + f, n = m.util.copy(m), o = (n.level++, "valid" + n.level);
return A += "var " + l + " = errors;", (m.opts.strictKeywords ? typeof R == "object" && 0 < Object.keys(R).length || R === false : m.util.schemaHasRules(R, m.RULES.all)) && (n.schema = R, n.schemaPath = y, n.errSchemaPath = C, R = "idx" + f, H = "i" + f, z = "' + " + (x = "key" + f) + " + '", j = "data" + (n.dataLevel = m.dataLevel + 1), N = "dataProperties" + f, P = m.opts.ownProperties, Y = m.baseId, P && (A += " var " + N + " = undefined; "), A = A + (P ? " " + N + " = " + N + " || Object.keys(" + h + "); for (var " + R + "=0; " + R + "<" + N + ".length; " + R + "++) { var " + x + " = " + N + "[" + R + "]; " : " for (var " + x + " in " + h + ") { ") + " var startErrs" + f + " = errors; ", P = x, N = m.compositeRule, m.compositeRule = n.compositeRule = true, R = m.validate(n), n.baseId = Y, m.util.varOccurences(R, j) < 2 ? A += " " + m.util.varReplace(R, j, P) + " " : A += " var " + j + " = " + P + "; " + R + " ", m.compositeRule = n.compositeRule = N, A += " if (!" + o + ") { for (var " + H + "=startErrs" + f + "; " + H + "= m.opts.loopRequired, i = m.opts.ownProperties;
if (P) {
if (x += " var missing" + H + "; ", z) {
f || (x += " var " + R + " = validate.schema" + j + "; ");
var a = "' + " + (p = "schema" + H + "[" + (t = "i" + H) + "]") + " + '";
m.opts._errorDataPathProperty && (m.errorPath = m.util.getPathExpr(o, p, m.opts.jsonPointers)), x += " var " + A + " = true; ", f && (x += " if (schema" + H + " === undefined) " + A + " = true; else if (!Array.isArray(schema" + H + ")) " + A + " = false; else {"), x += " for (var " + t + " = 0; " + t + " < " + R + ".length; " + t + "++) { " + A + " = " + N + "[" + R + "[" + t + "]] !== undefined ", i && (x += " && Object.prototype.hasOwnProperty.call(" + N + ", " + R + "[" + t + "]) "), x += "; if (!" + A + ") break; } ", f && (x += " } "), (c = c || []).push(x += " if (!" + A + ") { "), x = "", m.createErrors !== false ? (x += " { keyword: 'required' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(Y) + " , params: { missingProperty: '" + a + "' } ", m.opts.messages !== false && (x += " , message: '", m.opts._errorDataPathProperty ? x += "is a required property" : x += "should have required property \\'" + a + "\\'", x += "' "), m.opts.verbose && (x += " , schema: validate.schema" + j + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + N + " "), x += " } ") : x += " {} ";
var r = x, x = c.pop();
} else {
x += " if ( ";
var e2 = y;
if (e2)
for (var t = -1, s = e2.length - 1; t < s; )
b = e2[t += 1], t && (x += " || "), x += " ( ( " + (B2 = N + (M = m.util.getProperty(b))) + " === undefined ", i && (x += " || ! Object.prototype.hasOwnProperty.call(" + N + ", '" + m.util.escapeQuotes(b) + "') "), x += ") && (missing" + H + " = " + m.util.toQuotedString(m.opts.jsonPointers ? b : M) + ") ) ";
x += ") { ", a = "' + " + (p = "missing" + H) + " + '", m.opts._errorDataPathProperty && (m.errorPath = m.opts.jsonPointers ? m.util.getPathExpr(o, p, true) : o + " + " + p), (c = c || []).push(x), x = "", m.createErrors !== false ? (x += " { keyword: 'required' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(Y) + " , params: { missingProperty: '" + a + "' } ", m.opts.messages !== false && (x += " , message: '", m.opts._errorDataPathProperty ? x += "is a required property" : x += "should have required property \\'" + a + "\\'", x += "' "), m.opts.verbose && (x += " , schema: validate.schema" + j + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + N + " "), x += " } ") : x += " {} ";
var c, r = x;
x = c.pop();
}
!m.compositeRule && P ? m.async ? x += " throw new ValidationError([" + r + "]); " : x += " validate.errors = [" + r + "]; return false; " : x += " var err = " + r + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", x += " } else { ";
} else if (z) {
f || (x += " var " + R + " = validate.schema" + j + "; ");
var p, a = "' + " + (p = "schema" + H + "[" + (t = "i" + H) + "]") + " + '";
m.opts._errorDataPathProperty && (m.errorPath = m.util.getPathExpr(o, p, m.opts.jsonPointers)), f && (x += " if (" + R + " && !Array.isArray(" + R + ")) { var err = ", m.createErrors !== false ? (x += " { keyword: 'required' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(Y) + " , params: { missingProperty: '" + a + "' } ", m.opts.messages !== false && (x += " , message: '", m.opts._errorDataPathProperty ? x += "is a required property" : x += "should have required property \\'" + a + "\\'", x += "' "), m.opts.verbose && (x += " , schema: validate.schema" + j + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + N + " "), x += " } ") : x += " {} ", x += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (" + R + " !== undefined) { "), x += " for (var " + t + " = 0; " + t + " < " + R + ".length; " + t + "++) { if (" + N + "[" + R + "[" + t + "]] === undefined ", i && (x += " || ! Object.prototype.hasOwnProperty.call(" + N + ", " + R + "[" + t + "]) "), x += ") { var err = ", m.createErrors !== false ? (x += " { keyword: 'required' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(Y) + " , params: { missingProperty: '" + a + "' } ", m.opts.messages !== false && (x += " , message: '", m.opts._errorDataPathProperty ? x += "is a required property" : x += "should have required property \\'" + a + "\\'", x += "' "), m.opts.verbose && (x += " , schema: validate.schema" + j + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + N + " "), x += " } ") : x += " {} ", x += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ", f && (x += " } ");
} else {
var g = y;
if (g)
for (var b, w = -1, E = g.length - 1; w < E; ) {
b = g[w += 1];
var M = m.util.getProperty(b), a = m.util.escapeQuotes(b), B2 = N + M;
m.opts._errorDataPathProperty && (m.errorPath = m.util.getPath(o, b, m.opts.jsonPointers)), x += " if ( " + B2 + " === undefined ", i && (x += " || ! Object.prototype.hasOwnProperty.call(" + N + ", '" + m.util.escapeQuotes(b) + "') "), x += ") { var err = ", m.createErrors !== false ? (x += " { keyword: 'required' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(Y) + " , params: { missingProperty: '" + a + "' } ", m.opts.messages !== false && (x += " , message: '", m.opts._errorDataPathProperty ? x += "is a required property" : x += "should have required property \\'" + a + "\\'", x += "' "), m.opts.verbose && (x += " , schema: validate.schema" + j + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + N + " "), x += " } ") : x += " {} ", x += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ";
}
}
m.errorPath = o;
} else
P && (x += " if (true) {");
return x;
};
}, 1985: function(le) {
le.exports = function(m, P, U) {
var x, H = " ", z = m.level, y = m.dataLevel, j = m.schema[P], Y = m.schemaPath + m.util.getProperty(P), P = m.errSchemaPath + "/" + P, N = !m.opts.allErrors, A = "data" + (y || ""), f = "valid" + z, R = m.opts.$data && j && j.$data, y = R ? (H += " var schema" + z + " = " + m.util.getData(j.$data, y, m.dataPathArr) + "; ", "schema" + z) : j;
return (j || R) && m.opts.uniqueItems !== false ? (R && (H += " var " + f + "; if (" + y + " === false || " + y + " === undefined) " + f + " = true; else if (typeof " + y + " != 'boolean') " + f + " = false; else { "), H += " var i = " + A + ".length , " + f + " = true , j; if (i > 1) { ", z = m.schema.items && m.schema.items.type, y = Array.isArray(z), !z || z == "object" || z == "array" || y && (0 <= z.indexOf("object") || 0 <= z.indexOf("array")) ? H += " outer: for (;i--;) { for (j = i; j--;) { if (equal(" + A + "[i], " + A + "[j])) { " + f + " = false; break outer; } } } " : (H = (H += " var itemIndices = {}, item; for (;i--;) { var item = " + A + "[i]; ") + " if (" + m.util["checkDataType" + (y ? "s" : "")](z, "item", m.opts.strictNumbers, true) + ") continue; ", y && (H += ` if (typeof item == 'string') item = '"' + item; `), H += " if (typeof itemIndices[item] == 'number') { " + f + " = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "), H += " } ", R && (H += " } "), (x = x || []).push(H += " if (!" + f + ") { "), H = "", m.createErrors !== false ? (H += " { keyword: 'uniqueItems' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(P) + " , params: { i: i, j: j } ", m.opts.messages !== false && (H += " , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "), m.opts.verbose && (H = (H += " , schema: ") + (R ? "validate.schema" + Y : "" + j) + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + A + " "), H += " } ") : H += " {} ", z = H, H = x.pop(), !m.compositeRule && N ? m.async ? H += " throw new ValidationError([" + z + "]); " : H += " validate.errors = [" + z + "]; return false; " : H += " var err = " + z + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", H += " } ", N && (H += " else { ")) : N && (H += " if (true) { "), H;
};
}, 1869: function(le) {
le.exports = function(m, D, U) {
var x = "", H = m.schema.$async === true, z = m.util.schemaHasRulesExcept(m.schema, m.RULES.all, "$ref"), j = m.self._getId(m.schema);
if (m.opts.strictKeywords) {
var Y = m.util.schemaUnknownRules(m.schema, m.RULES.keywords);
if (Y) {
if (Y = "unknown keyword: " + Y, m.opts.strictKeywords !== "log")
throw new Error(Y);
m.logger.warn(Y);
}
}
if (m.isTop && (x += " var validate = ", H && (m.async = true, x += "async "), x += "function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ", j) && (m.opts.sourceCode || m.opts.processCode) && (x += " /*# sourceURL=" + j + " */ "), typeof m.schema == "boolean" || !z && !m.schema.$ref)
N = m.level, A = m.dataLevel, B2 = m.schema[D = "false schema"], a = m.schemaPath + m.util.getProperty(D), r = m.errSchemaPath + "/" + D, C = !m.opts.allErrors, f = "data" + (A || ""), y = "valid" + N, m.schema === false ? (m.isTop ? C = true : x += " var " + y + " = false; ", (X = X || []).push(x), x = "", m.createErrors !== false ? (x += " { keyword: 'false schema' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(r) + " , params: {} ", m.opts.messages !== false && (x += " , message: 'boolean schema is false' "), m.opts.verbose && (x += " , schema: false , parentSchema: validate.schema" + m.schemaPath + " , data: " + f + " "), x += " } ") : x += " {} ", b = x, x = X.pop(), !m.compositeRule && C ? m.async ? x += " throw new ValidationError([" + b + "]); " : x += " validate.errors = [" + b + "]; return false; " : x += " var err = " + b + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ") : m.isTop ? x += H ? " return data; " : " validate.errors = null; return true; " : x += " var " + y + " = true; ", m.isTop && (x += " }; return validate; ");
else {
if (m.isTop) {
var P = m.isTop, N = m.level = 0, A = m.dataLevel = 0, f = "data";
if (m.rootId = m.resolve.fullPath(m.self._getId(m.root.schema)), m.baseId = m.baseId || m.rootId, delete m.isTop, m.dataPathArr = [""], m.schema.default !== void 0 && m.opts.useDefaults && m.opts.strictDefaults) {
var R = "default is ignored in the schema root";
if (m.opts.strictDefaults !== "log")
throw new Error(R);
m.logger.warn(R);
}
x = (x += " var vErrors = null; ") + " var errors = 0; if (rootData === undefined) rootData = data; ";
} else {
if (N = m.level, f = "data" + ((A = m.dataLevel) || ""), j && (m.baseId = m.resolve.url(m.baseId, j)), H && !m.async)
throw new Error("async schema in sync schema");
x += " var errs_" + N + " = errors;";
}
var y = "valid" + N, C = !m.opts.allErrors, d = "", h = "", l = m.schema.type, n = Array.isArray(l);
if (l && m.opts.nullable && m.schema.nullable === true && (n ? l.indexOf("null") == -1 && (l = l.concat("null")) : l != "null" && (l = [l, "null"], n = true)), n && l.length == 1 && (l = l[0], n = false), m.schema.$ref && z) {
if (m.opts.extendRefs == "fail")
throw new Error('$ref: validation keywords used in schema at path "' + m.errSchemaPath + '" (see option extendRefs)');
m.opts.extendRefs !== true && (z = false, m.logger.warn('$ref: keywords ignored in schema at path "' + m.errSchemaPath + '"'));
}
if (m.schema.$comment && m.opts.$comment && (x += " " + m.RULES.all.$comment.code(m, "$comment")), l) {
m.opts.coerceTypes && (o = m.util.coerceToTypes(m.opts.coerceTypes, l));
var o, i = m.RULES.types[l];
if (o || n || i === true || i && !V(i)) {
var a = m.schemaPath + ".type", r = m.errSchemaPath + "/type", a = m.schemaPath + ".type", r = m.errSchemaPath + "/type";
if (x += " if (" + m.util[n ? "checkDataTypes" : "checkDataType"](l, f, m.opts.strictNumbers, true) + ") { ", o) {
var e2 = "dataType" + N, t = "coerced" + N, s = (x += " var " + e2 + " = typeof " + f + "; var " + t + " = undefined; ", m.opts.coerceTypes == "array" && (x += " if (" + e2 + " == 'object' && Array.isArray(" + f + ") && " + f + ".length == 1) { " + f + " = " + f + "[0]; " + e2 + " = typeof " + f + "; if (" + m.util.checkDataType(m.schema.type, f, m.opts.strictNumbers) + ") " + t + " = " + f + "; } "), x += " if (" + t + " !== undefined) ; ", o);
if (s)
for (var c, p = -1, g = s.length - 1; p < g; )
(c = s[p += 1]) == "string" ? x += " else if (" + e2 + " == 'number' || " + e2 + " == 'boolean') " + t + " = '' + " + f + "; else if (" + f + " === null) " + t + " = ''; " : c == "number" || c == "integer" ? (x += " else if (" + e2 + " == 'boolean' || " + f + " === null || (" + e2 + " == 'string' && " + f + " && " + f + " == +" + f + " ", c == "integer" && (x += " && !(" + f + " % 1)"), x += ")) " + t + " = +" + f + "; ") : c == "boolean" ? x += " else if (" + f + " === 'false' || " + f + " === 0 || " + f + " === null) " + t + " = false; else if (" + f + " === 'true' || " + f + " === 1) " + t + " = true; " : c == "null" ? x += " else if (" + f + " === '' || " + f + " === 0 || " + f + " === false) " + t + " = null; " : m.opts.coerceTypes == "array" && c == "array" && (x += " else if (" + e2 + " == 'string' || " + e2 + " == 'number' || " + e2 + " == 'boolean' || " + f + " == null) " + t + " = [" + f + "]; ");
(X = X || []).push(x += " else { "), x = "", m.createErrors !== false ? (x = (x += " { keyword: 'type' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(r) + " , params: { type: '") + (n ? "" + l.join(",") : "" + l) + "' } ", m.opts.messages !== false && (x = (x += " , message: 'should be ") + (n ? "" + l.join(",") : "" + l) + "' "), m.opts.verbose && (x += " , schema: validate.schema" + a + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + f + " "), x += " } ") : x += " {} ";
var b = x, Y = (x = X.pop(), !m.compositeRule && C ? m.async ? x += " throw new ValidationError([" + b + "]); " : x += " validate.errors = [" + b + "]; return false; " : x += " var err = " + b + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", A ? "data" + (A - 1 || "") : "parentData");
x = x + (" } if (" + t + " !== undefined) { ") + (" " + f + " = " + t + "; "), A || (x += "if (" + Y + " !== undefined)"), x += " " + Y + "[" + (A ? m.dataPathArr[A] : "parentDataProperty") + "] = " + t + "; } ";
} else
b = ((X = X || []).push(x), x = "", m.createErrors !== false ? (x = (x += " { keyword: 'type' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(r) + " , params: { type: '") + (n ? "" + l.join(",") : "" + l) + "' } ", m.opts.messages !== false && (x = (x += " , message: 'should be ") + (n ? "" + l.join(",") : "" + l) + "' "), m.opts.verbose && (x += " , schema: validate.schema" + a + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + f + " "), x += " } ") : x += " {} ", x), x = X.pop(), !m.compositeRule && C ? m.async ? x += " throw new ValidationError([" + b + "]); " : x += " validate.errors = [" + b + "]; return false; " : x += " var err = " + b + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
x += " } ";
}
}
if (m.schema.$ref && !z)
x += " " + m.RULES.all.$ref.code(m, "$ref") + " ", C && (x = (x += " } if (errors === ") + (P ? "0" : "errs_" + N) + ") { ", h += "}");
else {
var w = m.RULES;
if (w) {
for (var E = -1, M = w.length - 1; E < M; )
if (V(i = w[E += 1])) {
if (i.type && (x += " if (" + m.util.checkDataType(i.type, f, m.opts.strictNumbers) + ") { "), m.opts.useDefaults) {
if (i.type == "object" && m.schema.properties) {
var B2 = m.schema.properties, Z = Object.keys(B2);
if (Z) {
for (var k, u = -1, _ = Z.length - 1; u < _; )
if ((G = B2[k = Z[u += 1]]).default !== void 0) {
var v = f + m.util.getProperty(k);
if (m.compositeRule) {
if (m.opts.strictDefaults) {
if (R = "default is ignored for: " + v, m.opts.strictDefaults !== "log")
throw new Error(R);
m.logger.warn(R);
}
} else
x += " if (" + v + " === undefined ", m.opts.useDefaults == "empty" && (x += " || " + v + " === null || " + v + " === '' "), x += " ) " + v + " = ", m.opts.useDefaults == "shared" ? x += " " + m.useDefault(G.default) + " " : x += " " + JSON.stringify(G.default) + " ", x += "; ";
}
}
} else if (i.type == "array" && Array.isArray(m.schema.items)) {
var $ = m.schema.items;
if ($) {
for (var G, p = -1, W = $.length - 1; p < W; )
if ((G = $[p += 1]).default !== void 0)
if (v = f + "[" + p + "]", m.compositeRule) {
if (m.opts.strictDefaults) {
if (R = "default is ignored for: " + v, m.opts.strictDefaults !== "log")
throw new Error(R);
m.logger.warn(R);
}
} else
x += " if (" + v + " === undefined ", m.opts.useDefaults == "empty" && (x += " || " + v + " === null || " + v + " === '' "), x += " ) " + v + " = ", m.opts.useDefaults == "shared" ? x += " " + m.useDefault(G.default) + " " : x += " " + JSON.stringify(G.default) + " ", x += "; ";
}
}
}
var X, Q = i.rules;
if (Q)
for (var K, ne = -1, T = Q.length - 1; ne < T; )
F(K = Q[ne += 1]) && (K = K.code(m, K.keyword, i.type)) && (x += " " + K + " ", C) && (d += "}");
C && (x += " " + d + " ", d = ""), i.type && (x += " } ", l) && l === i.type && !o && (x += " else { ", a = m.schemaPath + ".type", r = m.errSchemaPath + "/type", (X = X || []).push(x), x = "", m.createErrors !== false ? (x = (x += " { keyword: 'type' , dataPath: (dataPath || '') + " + m.errorPath + " , schemaPath: " + m.util.toQuotedString(r) + " , params: { type: '") + (n ? "" + l.join(",") : "" + l) + "' } ", m.opts.messages !== false && (x = (x += " , message: 'should be ") + (n ? "" + l.join(",") : "" + l) + "' "), m.opts.verbose && (x += " , schema: validate.schema" + a + " , parentSchema: validate.schema" + m.schemaPath + " , data: " + f + " "), x += " } ") : x += " {} ", b = x, x = X.pop(), !m.compositeRule && C ? m.async ? x += " throw new ValidationError([" + b + "]); " : x += " validate.errors = [" + b + "]; return false; " : x += " var err = " + b + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", x += " } "), C && (x = (x += " if (errors === ") + (P ? "0" : "errs_" + N) + ") { ", h += "}");
}
}
}
C && (x += " " + h + " "), P ? x = x + (H ? " if (errors === 0) return data; else throw new ValidationError(vErrors); " : " validate.errors = vErrors; return errors === 0; ") + " }; return validate;" : x += " var " + y + " = errors === errs_" + N + ";";
}
return x;
function V(I) {
for (var S = I.rules, L = 0; L < S.length; L++)
if (F(S[L]))
return 1;
}
function F(I) {
return m.schema[I.keyword] !== void 0 || I.implements && function(S) {
for (var L = S.implements, O = 0; O < L.length; O++)
if (m.schema[L[O]] !== void 0)
return 1;
}(I);
}
};
}, 7931: function(le, m, D) {
var U = /^[a-z_$][a-z0-9_$-]*$/i, x = D(1793), H = D(5868);
function z(j, Y) {
z.errors = null;
var P = this._validateKeyword = this._validateKeyword || this.compile(H, true);
if (P(j))
return true;
if (z.errors = P.errors, Y)
throw new Error("custom keyword definition is invalid: " + this.errorsText(P.errors));
return false;
}
le.exports = { add: function(j, Y) {
var P = this.RULES;
if (P.keywords[j])
throw new Error("Keyword " + j + " is already defined");
if (!U.test(j))
throw new Error("Keyword " + j + " is not a valid identifier");
if (Y) {
this.validateKeyword(Y, true);
var N = Y.type;
if (Array.isArray(N))
for (var A = 0; A < N.length; A++)
R(j, N[A], Y);
else
R(j, N, Y);
var f = Y.metaSchema;
f && (Y.$data && this._opts.$data && (f = { anyOf: [f, { $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" }] }), Y.validateSchema = this.compile(f, true));
}
function R(y, C, d) {
for (var h, l = 0; l < P.length; l++) {
var n = P[l];
if (n.type == C) {
h = n;
break;
}
}
h || P.push(h = { type: C, rules: [] }), d = { keyword: y, definition: d, custom: true, code: x, implements: d.implements }, h.rules.push(d), P.custom[y] = d;
}
return P.keywords[j] = P.all[j] = true, this;
}, get: function(j) {
var Y = this.RULES.custom[j];
return Y ? Y.definition : this.RULES.keywords[j] || false;
}, remove: function(j) {
var Y = this.RULES;
delete Y.keywords[j], delete Y.all[j], delete Y.custom[j];
for (var P = 0; P < Y.length; P++)
for (var N = Y[P].rules, A = 0; A < N.length; A++)
if (N[A].keyword == j) {
N.splice(A, 1);
break;
}
return this;
}, validate: z };
}, 2303: function(le) {
le.exports = function m(D, U) {
if (D === U)
return true;
if (D && U && typeof D == "object" && typeof U == "object") {
if (D.constructor !== U.constructor)
return false;
var x, H, z;
if (Array.isArray(D)) {
if ((x = D.length) != U.length)
return false;
for (H = x; H-- != 0; )
if (!m(D[H], U[H]))
return false;
} else {
if (D.constructor === RegExp)
return D.source === U.source && D.flags === U.flags;
if (D.valueOf !== Object.prototype.valueOf)
return D.valueOf() === U.valueOf();
if (D.toString !== Object.prototype.toString)
return D.toString() === U.toString();
if ((x = (z = Object.keys(D)).length) !== Object.keys(U).length)
return false;
for (H = x; H-- != 0; )
if (!Object.prototype.hasOwnProperty.call(U, z[H]))
return false;
for (H = x; H-- != 0; ) {
var j = z[H];
if (!m(D[j], U[j]))
return false;
}
}
return true;
}
return D != D && U != U;
};
}, 3508: function(le) {
le.exports = function(m, D) {
var U, x = typeof (D = typeof (D = D || {}) == "function" ? { cmp: D } : D).cycles == "boolean" && D.cycles, H = D.cmp && (U = D.cmp, function(j) {
return function(Y, P) {
return Y = { key: Y, value: j[Y] }, P = { key: P, value: j[P] }, U(Y, P);
};
}), z = [];
return function j(Y) {
if ((Y = Y && Y.toJSON && typeof Y.toJSON == "function" ? Y.toJSON() : Y) !== void 0) {
if (typeof Y == "number")
return isFinite(Y) ? "" + Y : "null";
if (typeof Y != "object")
return JSON.stringify(Y);
if (Array.isArray(Y)) {
for (A = "[", f = 0; f < Y.length; f++)
f && (A += ","), A += j(Y[f]) || "null";
return A + "]";
}
if (Y === null)
return "null";
if (z.indexOf(Y) !== -1) {
if (x)
return JSON.stringify("__cycle__");
throw new TypeError("Converting circular structure to JSON");
}
for (var P = z.push(Y) - 1, N = Object.keys(Y).sort(H && H(Y)), A = "", f = 0; f < N.length; f++) {
var R = N[f], y = j(Y[R]);
y && (A && (A += ","), A += JSON.stringify(R) + ":" + y);
}
return z.splice(P, 1), "{" + A + "}";
}
}(m);
};
}, 233: function(le) {
le.exports = function m(N, A) {
function x(l) {
return m.insensitive && ("" + l).toLowerCase() || "" + l;
}
var H, z, C = /(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi, y = /(^[ ]*|[ ]*$)/g, j = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/, Y = /^0x[0-9a-f]+$/i, P = /^0/, N = x(N).replace(y, "") || "", A = x(A).replace(y, "") || "", f = N.replace(C, "\0$1\0").replace(/\0$/, "").replace(/^\0/, "").split("\0"), R = A.replace(C, "\0$1\0").replace(/\0$/, "").replace(/^\0/, "").split("\0"), y = parseInt(N.match(Y), 16) || f.length !== 1 && N.match(j) && Date.parse(N), C = parseInt(A.match(Y), 16) || y && A.match(j) && Date.parse(A) || null;
if (C) {
if (y < C)
return -1;
if (C < y)
return 1;
}
for (var d = 0, h = Math.max(f.length, R.length); d < h; d++) {
if (H = !(f[d] || "").match(P) && parseFloat(f[d]) || f[d] || 0, z = !(R[d] || "").match(P) && parseFloat(R[d]) || R[d] || 0, isNaN(H) !== isNaN(z))
return isNaN(H) ? 1 : -1;
if (typeof H != typeof z && (H += "", z += ""), H < z)
return -1;
if (z < H)
return 1;
}
return 0;
};
}, 5156: function(le, m) {
(function(D) {
function U(k) {
return k !== null && Object.prototype.toString.call(k) === "[object Array]";
}
function x(k) {
return k !== null && Object.prototype.toString.call(k) === "[object Object]";
}
function H(k, u) {
if (k !== u) {
if (Object.prototype.toString.call(k) !== Object.prototype.toString.call(u))
return false;
if (U(k) === true) {
if (k.length !== u.length)
return false;
for (var _ = 0; _ < k.length; _++)
if (H(k[_], u[_]) === false)
return false;
} else {
if (x(k) !== true)
return false;
var v, $, G = {};
for (v in k)
if (hasOwnProperty.call(k, v)) {
if (H(k[v], u[v]) === false)
return false;
G[v] = true;
}
for ($ in u)
if (hasOwnProperty.call(u, $) && G[$] !== true)
return false;
}
}
return true;
}
function z(k) {
if (k === "" || k === false || k === null || U(k) && k.length === 0)
return true;
if (x(k)) {
for (var u in k)
if (k.hasOwnProperty(u))
return false;
return true;
}
return false;
}
var j = typeof String.prototype.trimLeft == "function" ? function(k) {
return k.trimLeft();
} : function(k) {
return k.match(/^\s*(.*)/)[1];
}, Y = { 0: "number", 1: "any", 2: "string", 3: "array", 4: "object", 5: "boolean", 6: "expression", 7: "null", 8: "Array", 9: "Array" }, P = "UnquotedIdentifier", N = "QuotedIdentifier", A = "Rbracket", f = "Rparen", R = "Comma", y = "Colon", C = "Rbrace", d = "Number", h = "Current", l = "Expref", n = "Pipe", o = "Flatten", i = "Star", a = "Filter", r = "Lbrace", e2 = "Lbracket", t = "Lparen", s = "Literal", c = { ".": "Dot", "*": i, ",": R, ":": y, "{": r, "}": C, "]": A, "(": t, ")": f, "@": h }, p = { "<": true, ">": true, "=": true, "!": true }, g = { " ": true, " ": true, "\n": true };
function b(k) {
return "0" <= k && k <= "9" || k === "-";
}
function w() {
}
w.prototype = { tokenize: function(k) {
var u, _, v = [];
for (this._current = 0; this._current < k.length; )
if ("a" <= (G = k[this._current]) && G <= "z" || "A" <= G && G <= "Z" || G === "_")
$ = this._current, u = this._consumeUnquotedIdentifier(k), v.push({ type: P, value: u, start: $ });
else if (c[k[this._current]] !== void 0)
v.push({ type: c[k[this._current]], value: k[this._current], start: this._current }), this._current++;
else if (b(k[this._current]))
_ = this._consumeNumber(k), v.push(_);
else if (k[this._current] === "[")
_ = this._consumeLBracket(k), v.push(_);
else if (k[this._current] === '"')
$ = this._current, u = this._consumeQuotedIdentifier(k), v.push({ type: N, value: u, start: $ });
else if (k[this._current] === "'")
$ = this._current, u = this._consumeRawStringLiteral(k), v.push({ type: s, value: u, start: $ });
else if (k[this._current] === "`") {
var $ = this._current, G = this._consumeLiteral(k);
v.push({ type: s, value: G, start: $ });
} else if (p[k[this._current]] !== void 0)
v.push(this._consumeOperator(k));
else if (g[k[this._current]] !== void 0)
this._current++;
else if (k[this._current] === "&")
$ = this._current, this._current++, k[this._current] === "&" ? (this._current++, v.push({ type: "And", value: "&&", start: $ })) : v.push({ type: l, value: "&", start: $ });
else {
if (k[this._current] !== "|")
throw (G = new Error("Unknown character:" + k[this._current])).name = "LexerError", G;
$ = this._current, this._current++, k[this._current] === "|" ? (this._current++, v.push({ type: "Or", value: "||", start: $ })) : v.push({ type: n, value: "|", start: $ });
}
return v;
}, _consumeUnquotedIdentifier: function(k) {
var u, _ = this._current;
for (this._current++; this._current < k.length && ("a" <= (u = k[this._current]) && u <= "z" || "A" <= u && u <= "Z" || "0" <= u && u <= "9" || u === "_"); )
this._current++;
return k.slice(_, this._current);
}, _consumeQuotedIdentifier: function(k) {
for (var u = this._current, _ = (this._current++, k.length); k[this._current] !== '"' && this._current < _; ) {
var v = this._current;
k[v] !== "\\" || k[v + 1] !== "\\" && k[v + 1] !== '"' ? v++ : v += 2, this._current = v;
}
return this._current++, JSON.parse(k.slice(u, this._current));
}, _consumeRawStringLiteral: function(k) {
for (var u = this._current, _ = (this._current++, k.length); k[this._current] !== "'" && this._current < _; ) {
var v = this._current;
k[v] !== "\\" || k[v + 1] !== "\\" && k[v + 1] !== "'" ? v++ : v += 2, this._current = v;
}
return this._current++, k.slice(u + 1, this._current - 1).replace("\\'", "'");
}, _consumeNumber: function(k) {
for (var u = this._current, _ = (this._current++, k.length); b(k[this._current]) && this._current < _; )
this._current++;
var v = parseInt(k.slice(u, this._current));
return { type: d, value: v, start: u };
}, _consumeLBracket: function(k) {
var u = this._current;
return this._current++, k[this._current] === "?" ? (this._current++, { type: a, value: "[?", start: u }) : k[this._current] === "]" ? (this._current++, { type: o, value: "[]", start: u }) : { type: e2, value: "[", start: u };
}, _consumeOperator: function(k) {
var u = this._current, _ = k[u];
return this._current++, _ === "!" ? k[this._current] === "=" ? (this._current++, { type: "NE", value: "!=", start: u }) : { type: "Not", value: "!", start: u } : _ === "<" ? k[this._current] === "=" ? (this._current++, { type: "LTE", value: "<=", start: u }) : { type: "LT", value: "<", start: u } : _ === ">" ? k[this._current] === "=" ? (this._current++, { type: "GTE", value: ">=", start: u }) : { type: "GT", value: ">", start: u } : _ === "=" && k[this._current] === "=" ? (this._current++, { type: "EQ", value: "==", start: u }) : void 0;
}, _consumeLiteral: function(k) {
this._current++;
for (var u = this._current, _ = k.length; k[this._current] !== "`" && this._current < _; ) {
var v = this._current;
k[v] !== "\\" || k[v + 1] !== "\\" && k[v + 1] !== "`" ? v++ : v += 2, this._current = v;
}
return u = (u = j(k.slice(u, this._current))).replace("\\`", "`"), u = this._looksLikeJSON(u) ? JSON.parse(u) : JSON.parse('"' + u + '"'), this._current++, u;
}, _looksLikeJSON: function(k) {
if (k === "")
return false;
if (0 <= '[{"'.indexOf(k[0]) || 0 <= ["true", "false", "null"].indexOf(k))
return true;
if (!(0 <= "-0123456789".indexOf(k[0])))
return false;
try {
return JSON.parse(k), true;
} catch {
return false;
}
} };
var E = {};
function M() {
}
function B2(k) {
this.runtime = k;
}
function Z(k) {
this._interpreter = k, this.functionTable = { abs: { _func: this._functionAbs, _signature: [{ types: [0] }] }, avg: { _func: this._functionAvg, _signature: [{ types: [8] }] }, ceil: { _func: this._functionCeil, _signature: [{ types: [0] }] }, contains: { _func: this._functionContains, _signature: [{ types: [2, 3] }, { types: [1] }] }, ends_with: { _func: this._functionEndsWith, _signature: [{ types: [2] }, { types: [2] }] }, floor: { _func: this._functionFloor, _signature: [{ types: [0] }] }, length: { _func: this._functionLength, _signature: [{ types: [2, 3, 4] }] }, map: { _func: this._functionMap, _signature: [{ types: [6] }, { types: [3] }] }, max: { _func: this._functionMax, _signature: [{ types: [8, 9] }] }, merge: { _func: this._functionMerge, _signature: [{ types: [4], variadic: true }] }, max_by: { _func: this._functionMaxBy, _signature: [{ types: [3] }, { types: [6] }] }, sum: { _func: this._functionSum, _signature: [{ types: [8] }] }, starts_with: { _func: this._functionStartsWith, _signature: [{ types: [2] }, { types: [2] }] }, min: { _func: this._functionMin, _signature: [{ types: [8, 9] }] }, min_by: { _func: this._functionMinBy, _signature: [{ types: [3] }, { types: [6] }] }, type: { _func: this._functionType, _signature: [{ types: [1] }] }, keys: { _func: this._functionKeys, _signature: [{ types: [4] }] }, values: { _func: this._functionValues, _signature: [{ types: [4] }] }, sort: { _func: this._functionSort, _signature: [{ types: [9, 8] }] }, sort_by: { _func: this._functionSortBy, _signature: [{ types: [3] }, { types: [6] }] }, join: { _func: this._functionJoin, _signature: [{ types: [2] }, { types: [9] }] }, reverse: { _func: this._functionReverse, _signature: [{ types: [2, 3] }] }, to_array: { _func: this._functionToArray, _signature: [{ types: [1] }] }, to_string: { _func: this._functionToString, _signature: [{ types: [1] }] }, to_number: { _func: this._functionToNumber, _signature: [{ types: [1] }] }, not_null: { _func: this._functionNotNull, _signature: [{ types: [1], variadic: true }] } };
}
E.EOF = 0, E[P] = 0, E[N] = 0, E[A] = 0, E[f] = 0, E[R] = 0, E[C] = 0, E[d] = 0, E[h] = 0, E[l] = 0, E.Pipe = 1, E.Or = 2, E.And = 3, E.EQ = 5, E.GT = 5, E.LT = 5, E.GTE = 5, E.LTE = 5, E.NE = 5, E[o] = 9, E.Star = 20, E[a] = 21, E.Dot = 40, E.Not = 45, E[r] = 50, E[e2] = 55, E[t] = 60, M.prototype = { parse: function(_) {
this._loadTokens(_), this.index = 0;
var u, _ = this.expression(0);
if (this._lookahead(0) !== "EOF")
throw u = this._lookaheadToken(0), (u = new Error("Unexpected token type: " + u.type + ", value: " + u.value)).name = "ParserError", u;
return _;
}, _loadTokens: function(k) {
var u = new w().tokenize(k);
u.push({ type: "EOF", value: "", start: k.length }), this.tokens = u;
}, expression: function(k) {
for (var u = this._lookaheadToken(0), _ = (this._advance(), this.nud(u)), v = this._lookahead(0); k < E[v]; )
this._advance(), _ = this.led(v, _), v = this._lookahead(0);
return _;
}, _lookahead: function(k) {
return this.tokens[this.index + k].type;
}, _lookaheadToken: function(k) {
return this.tokens[this.index + k];
}, _advance: function() {
this.index++;
}, nud: function(k) {
var u, _;
switch (k.type) {
case s:
return { type: "Literal", value: k.value };
case P:
return { type: "Field", name: k.value };
case N:
var v = { type: "Field", name: k.value };
if (this._lookahead(0) === t)
throw new Error("Quoted identifier not allowed for function names.");
return v;
case "Not":
return { type: "NotExpression", children: [u = this.expression(E.Not)] };
case i:
return u = null, { type: "ValueProjection", children: [{ type: "Identity" }, u = this._lookahead(0) === A ? { type: "Identity" } : this._parseProjectionRHS(E.Star)] };
case a:
return this.led(k.type, { type: "Identity" });
case r:
return this._parseMultiselectHash();
case o:
return { type: "Projection", children: [{ type: o, children: [{ type: "Identity" }] }, u = this._parseProjectionRHS(E.Flatten)] };
case e2:
return this._lookahead(0) === d || this._lookahead(0) === y ? (u = this._parseIndexExpression(), this._projectIfSlice({ type: "Identity" }, u)) : this._lookahead(0) === i && this._lookahead(1) === A ? (this._advance(), this._advance(), { type: "Projection", children: [{ type: "Identity" }, u = this._parseProjectionRHS(E.Star)] }) : this._parseMultiselectList();
case h:
return { type: h };
case l:
return { type: "ExpressionReference", children: [_ = this.expression(E.Expref)] };
case t:
for (var $ = []; this._lookahead(0) !== f; )
this._lookahead(0) === h ? (_ = { type: h }, this._advance()) : _ = this.expression(0), $.push(_);
return this._match(f), $[0];
default:
this._errorToken(k);
}
}, led: function(k, u) {
var _;
switch (k) {
case "Dot":
var v = E.Dot;
return this._lookahead(0) !== i ? { type: "Subexpression", children: [u, _ = this._parseDotRHS(v)] } : (this._advance(), { type: "ValueProjection", children: [u, _ = this._parseProjectionRHS(v)] });
case n:
return _ = this.expression(E.Pipe), { type: n, children: [u, _] };
case "Or":
return { type: "OrExpression", children: [u, _ = this.expression(E.Or)] };
case "And":
return { type: "AndExpression", children: [u, _ = this.expression(E.And)] };
case t:
for (var $, v = u.name, G = []; this._lookahead(0) !== f; )
this._lookahead(0) === h ? ($ = { type: h }, this._advance()) : $ = this.expression(0), this._lookahead(0) === R && this._match(R), G.push($);
return this._match(f), { type: "Function", name: v, children: G };
case a:
return v = this.expression(0), this._match(A), { type: "FilterProjection", children: [u, _ = this._lookahead(0) === o ? { type: "Identity" } : this._parseProjectionRHS(E.Filter), v] };
case o:
return { type: "Projection", children: [{ type: o, children: [u] }, this._parseProjectionRHS(E.Flatten)] };
case "EQ":
case "NE":
case "GT":
case "GTE":
case "LT":
case "LTE":
return this._parseComparator(u, k);
case e2:
return v = this._lookaheadToken(0), v.type === d || v.type === y ? (_ = this._parseIndexExpression(), this._projectIfSlice(u, _)) : (this._match(i), this._match(A), { type: "Projection", children: [u, _ = this._parseProjectionRHS(E.Star)] });
default:
this._errorToken(this._lookaheadToken(0));
}
}, _match: function(k) {
var u;
if (this._lookahead(0) !== k)
throw u = this._lookaheadToken(0), (k = new Error("Expected " + k + ", got: " + u.type)).name = "ParserError", k;
this._advance();
}, _errorToken: function(k) {
throw k = new Error("Invalid token (" + k.type + '): "' + k.value + '"'), k.name = "ParserError", k;
}, _parseIndexExpression: function() {
var k;
return this._lookahead(0) === y || this._lookahead(1) === y ? this._parseSliceExpression() : (k = { type: "Index", value: this._lookaheadToken(0).value }, this._advance(), this._match(A), k);
}, _projectIfSlice: function(k, u) {
return k = { type: "IndexExpression", children: [k, u] }, u.type === "Slice" ? { type: "Projection", children: [k, this._parseProjectionRHS(E.Star)] } : k;
}, _parseSliceExpression: function() {
for (var k, u = [null, null, null], _ = 0, v = this._lookahead(0); v !== A && _ < 3; ) {
if (v === y)
_++;
else {
if (v !== d)
throw k = this._lookahead(0), (k = new Error("Syntax error, unexpected token: " + k.value + "(" + k.type + ")")).name = "Parsererror", k;
u[_] = this._lookaheadToken(0).value;
}
this._advance(), v = this._lookahead(0);
}
return this._match(A), { type: "Slice", children: u };
}, _parseComparator: function(k, u) {
return { type: "Comparator", name: u, children: [k, this.expression(E[u])] };
}, _parseDotRHS: function(k) {
var u = this._lookahead(0);
return 0 <= [P, N, i].indexOf(u) ? this.expression(k) : u === e2 ? (this._match(e2), this._parseMultiselectList()) : u === r ? (this._match(r), this._parseMultiselectHash()) : void 0;
}, _parseProjectionRHS: function(k) {
var u, _;
if (E[this._lookahead(0)] < 10)
u = { type: "Identity" };
else if (this._lookahead(0) === e2)
u = this.expression(k);
else if (this._lookahead(0) === a)
u = this.expression(k);
else {
if (this._lookahead(0) !== "Dot")
throw _ = this._lookaheadToken(0), (_ = new Error("Sytanx error, unexpected token: " + _.value + "(" + _.type + ")")).name = "ParserError", _;
this._match("Dot"), u = this._parseDotRHS(k);
}
return u;
}, _parseMultiselectList: function() {
for (var k = []; this._lookahead(0) !== A; ) {
var u = this.expression(0);
if (k.push(u), this._lookahead(0) === R && (this._match(R), this._lookahead(0) === A))
throw new Error("Unexpected token Rbracket");
}
return this._match(A), { type: "MultiSelectList", children: k };
}, _parseMultiselectHash: function() {
for (var k, u, _ = [], v = [P, N]; ; ) {
if (k = this._lookaheadToken(0), v.indexOf(k.type) < 0)
throw new Error("Expecting an identifier token, got: " + k.type);
if (k = k.value, this._advance(), this._match(y), u = this.expression(0), _.push({ type: "KeyValuePair", name: k, value: u }), this._lookahead(0) === R)
this._match(R);
else if (this._lookahead(0) === C) {
this._match(C);
break;
}
}
return { type: "MultiSelectHash", children: _ };
} }, B2.prototype = { search: function(k, u) {
return this.visit(k, u);
}, visit: function(k, u) {
var _, v, $, G, W, X;
switch (k.type) {
case "Field":
return u !== null && x(u) ? (Q = u[k.name]) === void 0 ? null : Q : null;
case "Subexpression":
for (V = this.visit(k.children[0], u), L = 1; L < k.children.length; L++)
if ((V = this.visit(k.children[1], V)) === null)
return null;
return V;
case "IndexExpression":
return W = this.visit(k.children[0], u), this.visit(k.children[1], W);
case "Index":
return U(u) ? (V = u[Q = (Q = k.value) < 0 ? u.length + Q : Q]) === void 0 ? null : V : null;
case "Slice":
if (!U(u))
return null;
var Q = k.children.slice(0), Q = this.computeSliceParams(u.length, Q), K = Q[0], ne = Q[1], T = Q[2], V = [];
if (0 < T)
for (L = K; L < ne; L += T)
V.push(u[L]);
else
for (L = K; ne < L; L += T)
V.push(u[L]);
return V;
case "Projection":
var F = this.visit(k.children[0], u);
if (!U(F))
return null;
for (I = [], L = 0; L < F.length; L++)
(v = this.visit(k.children[1], F[L])) !== null && I.push(v);
return I;
case "ValueProjection":
if (!x(F = this.visit(k.children[0], u)))
return null;
for (var I = [], S = function(xe) {
for (var be = Object.keys(xe), Ae = [], we = 0; we < be.length; we++)
Ae.push(xe[be[we]]);
return Ae;
}(F), L = 0; L < S.length; L++)
(v = this.visit(k.children[1], S[L])) !== null && I.push(v);
return I;
case "FilterProjection":
if (!U(F = this.visit(k.children[0], u)))
return null;
var O = [], J = [];
for (L = 0; L < F.length; L++)
z(_ = this.visit(k.children[2], F[L])) || O.push(F[L]);
for (var re = 0; re < O.length; re++)
(v = this.visit(k.children[1], O[re])) !== null && J.push(v);
return J;
case "Comparator":
switch ($ = this.visit(k.children[0], u), G = this.visit(k.children[1], u), k.name) {
case "EQ":
V = H($, G);
break;
case "NE":
V = !H($, G);
break;
case "GT":
V = G < $;
break;
case "GTE":
V = G <= $;
break;
case "LT":
V = $ < G;
break;
case "LTE":
V = $ <= G;
break;
default:
throw new Error("Unknown comparator: " + k.name);
}
return V;
case o:
var pe = this.visit(k.children[0], u);
if (!U(pe))
return null;
var me = [];
for (L = 0; L < pe.length; L++)
U(v = pe[L]) ? me.push.apply(me, v) : me.push(v);
return me;
case "Identity":
return u;
case "MultiSelectList":
if (u === null)
return null;
for (I = [], L = 0; L < k.children.length; L++)
I.push(this.visit(k.children[L], u));
return I;
case "MultiSelectHash":
if (u === null)
return null;
for (I = {}, L = 0; L < k.children.length; L++)
I[(X = k.children[L]).name] = this.visit(X.value, u);
return I;
case "OrExpression":
return _ = z(_ = this.visit(k.children[0], u)) ? this.visit(k.children[1], u) : _;
case "AndExpression":
return z($ = this.visit(k.children[0], u)) === true ? $ : this.visit(k.children[1], u);
case "NotExpression":
return z($ = this.visit(k.children[0], u));
case "Literal":
return k.value;
case n:
return W = this.visit(k.children[0], u), this.visit(k.children[1], W);
case h:
return u;
case "Function":
var ye = [];
for (L = 0; L < k.children.length; L++)
ye.push(this.visit(k.children[L], u));
return this.runtime.callFunction(k.name, ye);
case "ExpressionReference":
return Q = k.children[0], Q.jmespathType = l, Q;
default:
throw new Error("Unknown node type: " + k.type);
}
}, computeSliceParams: function(k, _) {
var G = _[0], W = _[1], _ = _[2], v = [null, null, null];
if (_ === null)
_ = 1;
else if (_ === 0)
throw ($ = new Error("Invalid slice, step cannot be 0")).name = "RuntimeError", $;
var $ = _ < 0, G = G === null ? $ ? k - 1 : 0 : this.capSliceRange(k, G, _), W = W === null ? $ ? -1 : k : this.capSliceRange(k, W, _);
return v[0] = G, v[1] = W, v[2] = _, v;
}, capSliceRange: function(k, u, _) {
return u < 0 ? (u += k) < 0 && (u = _ < 0 ? -1 : 0) : k <= u && (u = _ < 0 ? k - 1 : k), u;
} }, Z.prototype = { callFunction: function(k, u) {
var _ = this.functionTable[k];
if (_ === void 0)
throw new Error("Unknown function: " + k + "()");
return this._validateArgs(k, u, _._signature), _._func.call(this, u);
}, _validateArgs: function(k, u, _) {
var v;
if (_[_.length - 1].variadic) {
if (u.length < _.length)
throw v = _.length === 1 ? " argument" : " arguments", new Error("ArgumentError: " + k + "() takes at least" + _.length + v + " but received " + u.length);
} else if (u.length !== _.length)
throw v = _.length === 1 ? " argument" : " arguments", new Error("ArgumentError: " + k + "() takes " + _.length + v + " but received " + u.length);
for (var $ = 0; $ < _.length; $++) {
for (var G, W = false, X = _[$].types, Q = this._getTypeName(u[$]), K = 0; K < X.length; K++)
if (this._typeMatches(Q, X[K], u[$])) {
W = true;
break;
}
if (!W)
throw G = X.map(function(ne) {
return Y[ne];
}).join(","), new Error("TypeError: " + k + "() expected argument " + ($ + 1) + " to be type " + G + " but received type " + Y[Q] + " instead.");
}
}, _typeMatches: function(k, u, _) {
if (u === 1)
return true;
if (u !== 9 && u !== 8 && u !== 3)
return k === u;
if (u === 3)
return k === 3;
if (k === 3) {
var v;
u === 8 ? v = 0 : u === 9 && (v = 2);
for (var $ = 0; $ < _.length; $++)
if (!this._typeMatches(this._getTypeName(_[$]), v, _[$]))
return false;
return true;
}
}, _getTypeName: function(k) {
switch (Object.prototype.toString.call(k)) {
case "[object String]":
return 2;
case "[object Number]":
return 0;
case "[object Array]":
return 3;
case "[object Boolean]":
return 5;
case "[object Null]":
return 7;
case "[object Object]":
return k.jmespathType === l ? 6 : 4;
}
}, _functionStartsWith: function(k) {
return k[0].lastIndexOf(k[1]) === 0;
}, _functionEndsWith: function(_) {
var u = _[0], _ = _[1];
return u.indexOf(_, u.length - _.length) !== -1;
}, _functionReverse: function(k) {
var u;
if (this._getTypeName(k[0]) !== 2)
return (u = k[0].slice(0)).reverse(), u;
for (var _ = k[0], v = "", $ = _.length - 1; 0 <= $; $--)
v += _[$];
return v;
}, _functionAbs: function(k) {
return Math.abs(k[0]);
}, _functionCeil: function(k) {
return Math.ceil(k[0]);
}, _functionAvg: function(k) {
for (var u = 0, _ = k[0], v = 0; v < _.length; v++)
u += _[v];
return u / _.length;
}, _functionContains: function(k) {
return 0 <= k[0].indexOf(k[1]);
}, _functionFloor: function(k) {
return Math.floor(k[0]);
}, _functionLength: function(k) {
return (x(k[0]) ? Object.keys(k[0]) : k[0]).length;
}, _functionMap: function(k) {
for (var u = [], _ = this._interpreter, v = k[0], $ = k[1], G = 0; G < $.length; G++)
u.push(_.visit(v, $[G]));
return u;
}, _functionMerge: function(k) {
for (var u = {}, _ = 0; _ < k.length; _++) {
var v, $ = k[_];
for (v in $)
u[v] = $[v];
}
return u;
}, _functionMax: function(k) {
if (0 < k[0].length) {
if (this._getTypeName(k[0][0]) === 0)
return Math.max.apply(Math, k[0]);
for (var u = k[0], _ = u[0], v = 1; v < u.length; v++)
_.localeCompare(u[v]) < 0 && (_ = u[v]);
return _;
}
return null;
}, _functionMin: function(k) {
if (0 < k[0].length) {
if (this._getTypeName(k[0][0]) === 0)
return Math.min.apply(Math, k[0]);
for (var u = k[0], _ = u[0], v = 1; v < u.length; v++)
u[v].localeCompare(_) < 0 && (_ = u[v]);
return _;
}
return null;
}, _functionSum: function(k) {
for (var u = 0, _ = k[0], v = 0; v < _.length; v++)
u += _[v];
return u;
}, _functionType: function(k) {
switch (this._getTypeName(k[0])) {
case 0:
return "number";
case 2:
return "string";
case 3:
return "array";
case 4:
return "object";
case 5:
return "boolean";
case 6:
return "expref";
case 7:
return "null";
}
}, _functionKeys: function(k) {
return Object.keys(k[0]);
}, _functionValues: function(k) {
for (var u = k[0], _ = Object.keys(u), v = [], $ = 0; $ < _.length; $++)
v.push(u[_[$]]);
return v;
}, _functionJoin: function(k) {
var u = k[0];
return k[1].join(u);
}, _functionToArray: function(k) {
return this._getTypeName(k[0]) === 3 ? k[0] : [k[0]];
}, _functionToString: function(k) {
return this._getTypeName(k[0]) === 2 ? k[0] : JSON.stringify(k[0]);
}, _functionToNumber: function(k) {
var u = this._getTypeName(k[0]);
return u === 0 ? k[0] : u !== 2 || (u = +k[0], isNaN(u)) ? null : u;
}, _functionNotNull: function(k) {
for (var u = 0; u < k.length; u++)
if (this._getTypeName(k[u]) !== 7)
return k[u];
return null;
}, _functionSort: function(k) {
return k = k[0].slice(0), k.sort(), k;
}, _functionSortBy: function(k) {
var u = k[0].slice(0);
if (u.length !== 0) {
var _ = this._interpreter, v = k[1], $ = this._getTypeName(_.visit(v, u[0]));
if ([0, 2].indexOf($) < 0)
throw new Error("TypeError");
for (var G = this, W = [], X = 0; X < u.length; X++)
W.push([X, u[X]]);
W.sort(function(K, ne) {
var T = _.visit(v, K[1]), V = _.visit(v, ne[1]);
if (G._getTypeName(T) !== $)
throw new Error("TypeError: expected " + $ + ", received " + G._getTypeName(T));
if (G._getTypeName(V) !== $)
throw new Error("TypeError: expected " + $ + ", received " + G._getTypeName(V));
return V < T ? 1 : T < V ? -1 : K[0] - ne[0];
});
for (var Q = 0; Q < W.length; Q++)
u[Q] = W[Q][1];
}
return u;
}, _functionMaxBy: function(k) {
for (var u, _, v = k[1], $ = k[0], G = this.createKeyFunction(v, [0, 2]), W = -1 / 0, X = 0; X < $.length; X++)
W < (_ = G($[X])) && (W = _, u = $[X]);
return u;
}, _functionMinBy: function(k) {
for (var u, _, v = k[1], $ = k[0], G = this.createKeyFunction(v, [0, 2]), W = 1 / 0, X = 0; X < $.length; X++)
(_ = G($[X])) < W && (W = _, u = $[X]);
return u;
}, createKeyFunction: function(k, u) {
var _ = this, v = this._interpreter;
return function(W) {
var G, W = v.visit(k, W);
if (u.indexOf(_._getTypeName(W)) < 0)
throw G = "TypeError: expected one of " + u + ", received " + _._getTypeName(W), new Error(G);
return W;
};
} }, D.tokenize = function(k) {
return new w().tokenize(k);
}, D.compile = function(k) {
return new M().parse(k);
}, D.search = function(k, u) {
var _ = new M(), v = new B2($ = new Z()), $ = ($._interpreter = v, _.parse(u));
return v.search($, k);
}, D.strictDeepEqual = H;
})(m);
}, 500: function(le) {
var m = le.exports = function(U, x, H) {
typeof x == "function" && (H = x, x = {}), function z(j, Y, P, N, A, f, R, y, C, d) {
if (N && typeof N == "object" && !Array.isArray(N)) {
for (var h in Y(N, A, f, R, y, C, d), N) {
var l = N[h];
if (Array.isArray(l)) {
if (h in m.arrayKeywords)
for (var n = 0; n < l.length; n++)
z(j, Y, P, l[n], A + "/" + h + "/" + n, f, A, h, N, n);
} else if (h in m.propsKeywords) {
if (l && typeof l == "object")
for (var o in l)
z(j, Y, P, l[o], A + "/" + h + "/" + D(o), f, A, h, N, o);
} else
(h in m.keywords || j.allKeys && !(h in m.skipKeywords)) && z(j, Y, P, l, A + "/" + h, f, A, h, N);
}
P(N, A, f, R, y, C, d);
}
}(x, typeof (H = x.cb || H) == "function" ? H : H.pre || function() {
}, H.post || function() {
}, U, "", U);
};
function D(U) {
return U.replace(/~/g, "~0").replace(/\//g, "~1");
}
m.keywords = { additionalItems: true, items: true, contains: true, additionalProperties: true, propertyNames: true, not: true }, m.arrayKeywords = { items: true, allOf: true, anyOf: true, oneOf: true }, m.propsKeywords = { definitions: true, properties: true, patternProperties: true, dependencies: true }, m.skipKeywords = { default: true, enum: true, const: true, required: true, maximum: true, minimum: true, exclusiveMaximum: true, exclusiveMinimum: true, multipleOf: true, maxLength: true, minLength: true, pattern: true, format: true, maxItems: true, minItems: true, uniqueItems: true, maxProperties: true, minProperties: true };
}, 7026: function(le, m) {
var D = { b: "\b", f: "\f", n: `
`, r: "\r", t: " ", '"': '"', "/": "/", "\\": "\\" }, U = "a".charCodeAt(), x = (m.parse = function(d, h, l) {
var n = {}, o = 0, i = 0, a = 0, r = l && l.bigint && typeof BigInt < "u";
return { data: e2("", true), pointers: n };
function e2(u, _) {
t(), w(u, "value");
var v, $ = p();
switch ($) {
case "t":
c("rue"), v = true;
break;
case "f":
c("alse"), v = false;
break;
case "n":
c("ull"), v = null;
break;
case '"':
v = s();
break;
case "[":
v = function(G) {
t();
var W = [], X = 0;
if (p() != "]")
for (g(); ; ) {
W.push(e2(G + "/" + X)), t();
var Q = p();
if (Q == "]")
break;
Q != "," && Z(), t(), X++;
}
return W;
}(u);
break;
case "{":
v = function(G) {
t();
var W = {};
if (p() != "}")
for (g(); ; ) {
var K = M(), X = (p() != '"' && Z(), s()), Q = G + "/" + C(X), K = (E(Q, "key", K), w(Q, "keyEnd"), t(), p() != ":" && Z(), t(), W[X] = e2(Q), t(), p());
if (K == "}")
break;
K != "," && Z(), t();
}
return W;
}(u);
break;
default:
g(), 0 <= "-0123456789".indexOf($) ? v = function() {
var G = "", W = true;
d[a] == "-" && (G += p()), G += (d[a] == "0" ? p : b)(), d[a] == "." && (G += p() + b(), W = false), d[a] != "e" && d[a] != "E" || (G += p(), d[a] != "+" && d[a] != "-" || (G += p()), G += b(), W = false);
var X = +G;
return r && W && (X > Number.MAX_SAFE_INTEGER || X < Number.MIN_SAFE_INTEGER) ? BigInt(G) : X;
}() : B2();
}
return w(u, "valueEnd"), t(), _ && a < d.length && B2(), v;
}
function t() {
e:
for (; a < d.length; ) {
switch (d[a]) {
case " ":
i++;
break;
case " ":
i += 4;
break;
case "\r":
i = 0;
break;
case `
`:
i = 0, o++;
break;
default:
break e;
}
a++;
}
}
function s() {
for (var u, _ = ""; (u = p()) != '"'; )
u == "\\" ? (u = p()) in D ? _ += D[u] : u == "u" ? _ += function() {
for (var v = 4, $ = 0; v--; ) {
$ <<= 4;
var G = p().toLowerCase();
"a" <= G && G <= "f" ? $ += G.charCodeAt() - U + 10 : "0" <= G && G <= "9" ? $ += +G : Z();
}
return String.fromCharCode($);
}() : Z() : _ += u;
return _;
}
function c(u) {
for (var _ = 0; _ < u.length; _++)
p() !== u[_] && Z();
}
function p() {
k();
var u = d[a];
return a++, i++, u;
}
function g() {
a--, i--;
}
function b() {
for (var u = ""; "0" <= d[a] && d[a] <= "9"; )
u += p();
if (u.length)
return u;
k(), B2();
}
function w(u, _) {
E(u, _, M());
}
function E(u, _, v) {
n[u] = n[u] || {}, n[u][_] = v;
}
function M() {
return { line: o, column: i, pos: a };
}
function B2() {
throw new SyntaxError("Unexpected token " + d[a] + " in JSON at position " + a);
}
function Z() {
g(), B2();
}
function k() {
if (a >= d.length)
throw new SyntaxError("Unexpected end of JSON input");
}
}, m.stringify = function(d, h, l) {
if (H(d)) {
var n = 0;
switch (typeof (i = typeof l == "object" ? l.space : l)) {
case "number":
var o = 10 < i ? 10 : i < 0 ? 0 : Math.floor(i), i = o && B2(o, " "), a = o, r = o;
break;
case "string":
i = i.slice(0, 10);
for (var e2 = r = a = 0; e2 < i.length; e2++) {
switch (i[e2]) {
case " ":
r++;
break;
case " ":
r += 4;
break;
case "\r":
r = 0;
break;
case `
`:
r = 0, n++;
break;
default:
throw new Error("whitespace characters not allowed in JSON");
}
a++;
}
break;
default:
i = void 0;
}
var t = "", s = {}, c = 0, p = 0, g = 0, b = l && l.es6 && typeof Map == "function";
return function Z(k, u, _) {
switch (M(_, "value"), typeof k) {
case "number":
case "bigint":
case "boolean":
w("" + k);
break;
case "string":
w(f(k));
break;
case "object":
k === null ? w("null") : typeof k.toJSON == "function" ? w(f(k.toJSON())) : Array.isArray(k) ? v() : b ? k.constructor.BYTES_PER_ELEMENT ? v() : k instanceof Map ? G() : k instanceof Set ? G(true) : $() : $();
}
M(_, "valueEnd");
function v() {
if (k.length) {
w("[");
for (var W = u + 1, X = 0; X < k.length; X++) {
X && w(","), E(W);
var Q = H(k[X]) ? k[X] : null, K = _ + "/" + X;
Z(Q, W, K);
}
E(u), w("]");
} else
w("[]");
}
function $() {
var W = Object.keys(k);
if (W.length) {
w("{");
for (var X = u + 1, Q = 0; Q < W.length; Q++) {
var K, ne = W[Q], T = k[ne];
H(T) && (Q && w(","), K = _ + "/" + C(ne), E(X), M(K, "key"), w(f(ne)), M(K, "keyEnd"), w(":"), i && w(" "), Z(T, X, K));
}
E(u), w("}");
} else
w("{}");
}
function G(W) {
if (k.size) {
w("{");
for (var X = u + 1, Q = true, K = k.entries(), ne = K.next(); !ne.done; ) {
var T, F = ne.value, V = F[0], F = !!W || F[1];
H(F) && (Q || w(","), Q = false, T = _ + "/" + C(V), E(X), M(T, "key"), w(f(V)), M(T, "keyEnd"), w(":"), i && w(" "), Z(F, X, T)), ne = K.next();
}
E(u), w("}");
} else
w("{}");
}
}(d, 0, ""), { json: t, pointers: s };
}
function w(Z) {
p += Z.length, g += Z.length, t += Z;
}
function E(Z) {
if (i) {
for (t += `
` + B2(Z, i), c++, p = 0; Z--; )
n ? (c += n, p = r) : p += r, g += a;
g += 1;
}
}
function M(Z, k) {
s[Z] = s[Z] || {}, s[Z][k] = { line: c, column: p, pos: g };
}
function B2(Z, k) {
return Array(Z + 1).join(k);
}
}, ["number", "bigint", "boolean", "string", "object"]);
function H(d) {
return 0 <= x.indexOf(typeof d);
}
var z = /"|\\/g, j = /[\b]/g, Y = /\f/g, P = /\n/g, N = /\r/g, A = /\t/g;
function f(d) {
return '"' + (d = d.replace(z, "\\$&").replace(Y, "\\f").replace(j, "\\b").replace(P, "\\n").replace(N, "\\r").replace(A, "\\t")) + '"';
}
var R = /~/g, y = /\//g;
function C(d) {
return d.replace(R, "~0").replace(y, "~1");
}
}, 483: function(le, m) {
var D, U;
(function() {
U = [], (U = typeof (D = function() {
function x(l) {
return typeof Node == "object" ? l instanceof Node : l && typeof l == "object" && typeof l.nodeType == "number";
}
function H(l) {
return typeof l == "string";
}
function z() {
var l = [];
return { watch: l.push.bind(l), trigger: function(n, o) {
for (var i = true, a = { detail: o, preventDefault: function() {
i = false;
} }, r = 0; r < l.length; r++)
l[r](n, a);
return i;
} };
}
function j(l) {
return window.getComputedStyle(l).display === "none";
}
function Y(l) {
this.elem = l;
}
function P(l, n) {
return Y.make(l("parent")).clazz("pico-overlay").clazz(l("overlayClass", "")).stylize({ display: "none", position: "fixed", top: "0px", left: "0px", height: "100%", width: "100%", zIndex: 1e4 }).stylize(l("overlayStyles", { opacity: 0.5, background: "#000" })).onClick(function() {
l("overlayClose", true) && n();
});
}
Y.make = function(l, n) {
typeof l == "string" && (l = document.querySelector(l));
var o = document.createElement(n || "div");
return (l || document.body).appendChild(o), new Y(o);
}, Y.prototype = { child: function(l) {
return Y.make(this.elem, l);
}, stylize: function(l) {
l = l || {}, typeof l.opacity < "u" && (l.filter = "alpha(opacity=" + l.opacity * 100 + ")");
for (var n in l)
l.hasOwnProperty(n) && (this.elem.style[n] = l[n]);
return this;
}, clazz: function(l) {
return this.elem.className += " " + l, this;
}, html: function(l) {
return x(l) ? this.elem.appendChild(l) : this.elem.innerHTML = l, this;
}, onClick: function(l) {
return this.elem.addEventListener("click", l), this;
}, destroy: function() {
this.elem.parentNode.removeChild(this.elem);
}, hide: function() {
this.elem.style.display = "none";
}, show: function() {
this.elem.style.display = "block";
}, attr: function(l, n) {
return n !== void 0 && this.elem.setAttribute(l, n), this;
}, anyAncestor: function(l) {
for (var n = this.elem; n; ) {
if (l(new Y(n)))
return true;
n = n.parentNode;
}
return false;
}, isVisible: function() {
return !j(this.elem);
} };
var N = 1;
function A(l, n) {
var o = l("width", "auto");
typeof o == "number" && (o = "" + o + "px");
var i = l("modalId", "pico-" + N++), a = Y.make(l("parent")).clazz("pico-content").clazz(l("modalClass", "")).stylize({ display: "none", position: "fixed", zIndex: 10001, left: "50%", top: "38.1966%", maxHeight: "90%", boxSizing: "border-box", width: o, "-ms-transform": "translate(-50%,-38.1966%)", "-moz-transform": "translate(-50%,-38.1966%)", "-webkit-transform": "translate(-50%,-38.1966%)", "-o-transform": "translate(-50%,-38.1966%)", transform: "translate(-50%,-38.1966%)" }).stylize(l("modalStyles", { overflow: "auto", backgroundColor: "white", padding: "20px", borderRadius: "5px" })).html(l("content")).attr("id", i).attr("role", "dialog").attr("aria-labelledby", l("ariaLabelledBy")).attr("aria-describedby", l("ariaDescribedBy", i)).onClick(function(r) {
var e2 = new Y(r.target).anyAncestor(function(t) {
return /\bpico-close\b/.test(t.elem.className);
});
e2 && n();
});
return a;
}
function f(l, n) {
if (n("closeButton", true))
return l.child("button").html(n("closeHtml", "×")).clazz("pico-close").clazz(n("closeClass", "")).stylize(n("closeStyles", { borderRadius: "2px", border: 0, padding: 0, cursor: "pointer", height: "15px", width: "15px", position: "absolute", top: "5px", right: "5px", fontSize: "16px", textAlign: "center", lineHeight: "15px", background: "#CCC" })).attr("aria-label", n("close-label", "Close"));
}
function R(l) {
return function() {
return l().elem;
};
}
var y = z(), C = z();
function d(l, n) {
function o(t, s) {
var c = t.msMatchesSelector || t.webkitMatchesSelector || t.matches;
return c.call(t, s);
}
function i(t) {
return j(t) || o(t, ":disabled") || t.hasAttribute("contenteditable") ? false : t.hasAttribute("tabindex") || o(t, "input,select,textarea,button,a[href],area[href],iframe");
}
function a(t) {
for (var s = t.getElementsByTagName("*"), c = 0; c < s.length; c++)
if (i(s[c]))
return s[c];
}
function r(t) {
for (var s = t.getElementsByTagName("*"), c = s.length; c--; )
if (i(s[c]))
return s[c];
}
var e2;
l.beforeShow(function() {
e2 = document.activeElement;
}), l.afterShow(function() {
if (n()) {
var s = a(l.modalElem());
s && s.focus();
}
}), l.afterClose(function() {
n() && e2 && e2.focus(), e2 = null;
}), C.watch(function(s) {
if (n() && l.isVisible()) {
var c = a(l.modalElem()), p = r(l.modalElem()), g = s.shiftKey ? c : p;
g === document.activeElement && ((s.shiftKey ? p : c).focus(), s.preventDefault());
}
});
}
function h(l, n) {
var o, i = new Y(document.body);
l.beforeShow(function() {
o = i.elem.style.overflow, n() && i.stylize({ overflow: "hidden" });
}), l.afterClose(function() {
i.stylize({ overflow: o });
});
}
return document.documentElement.addEventListener("keydown", function(n) {
var o = n.which || n.keyCode;
o === 27 ? y.trigger() : o === 9 && C.trigger(n);
}), function(n) {
(H(n) || x(n)) && (n = { content: n });
var o = z(), i = z(), a = z(), r = z(), e2 = z();
function t(Z, k) {
var u = n[Z];
return typeof u == "function" && (u = u(k)), u === void 0 ? k : u;
}
var s = B2.bind(window, "modal"), c = B2.bind(window, "overlay"), p = B2.bind(window, "close"), g;
function b(Z) {
c().hide(), s().hide(), e2.trigger(g, Z);
}
function w(Z) {
r.trigger(g, Z) && b(Z);
}
function E(Z) {
return function() {
return Z.apply(this, arguments), g;
};
}
var M;
function B2(Z, k) {
if (!M) {
var u = A(t, w);
M = { modal: u, overlay: P(t, w), close: f(u, t) }, o.trigger(g, k);
}
return M[Z];
}
return g = { modalElem: R(s), closeElem: R(p), overlayElem: R(c), buildDom: E(B2.bind(null, null)), isVisible: function() {
return !!(M && s && s().isVisible());
}, show: function(Z) {
return i.trigger(g, Z) && (c().show(), p(), s().show(), a.trigger(g, Z)), this;
}, close: E(w), forceClose: E(b), destroy: function() {
s().destroy(), c().destroy(), c = s = p = void 0;
}, options: function(Z) {
Object.keys(Z).map(function(k) {
n[k] = Z[k];
});
}, afterCreate: E(o.watch), beforeShow: E(i.watch), afterShow: E(a.watch), beforeClose: E(r.watch), afterClose: E(e2.watch) }, d(g, t.bind(null, "focus", true)), h(g, t.bind(null, "bodyOverflow", true)), y.watch(function() {
t("escCloses", true) && g.isVisible() && g.close();
}), g;
};
}) == "function" ? D.apply(m, U) : D) !== void 0 && (le.exports = U);
})();
}, 7533: function(le, m) {
(function(D) {
function U() {
for (var se = arguments.length, q = Array(se), oe = 0; oe < se; oe++)
q[oe] = arguments[oe];
if (q.length > 1) {
q[0] = q[0].slice(0, -1);
for (var de = q.length - 1, ue = 1; ue < de; ++ue)
q[ue] = q[ue].slice(1, -1);
return q[de] = q[de].slice(1), q.join("");
} else
return q[0];
}
function x(se) {
return "(?:" + se + ")";
}
function H(se) {
return se === void 0 ? "undefined" : se === null ? "null" : Object.prototype.toString.call(se).split(" ").pop().split("]").shift().toLowerCase();
}
function z(se) {
return se.toUpperCase();
}
function j(se) {
return se != null ? se instanceof Array ? se : typeof se.length != "number" || se.split || se.setInterval || se.call ? [se] : Array.prototype.slice.call(se) : [];
}
function Y(se, q) {
var oe = se;
if (q)
for (var de in q)
oe[de] = q[de];
return oe;
}
function P(se) {
var q = "[A-Za-z]", oe = "[0-9]", de = U(oe, "[A-Fa-f]"), ue = x(x("%[EFef]" + de + "%" + de + de + "%" + de + de) + "|" + x("%[89A-Fa-f]" + de + "%" + de + de) + "|" + x("%" + de + de)), Ee = "[\\:\\/\\?\\#\\[\\]\\@]", _e = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", He = U(Ee, _e), Pe = se ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", Oe = se ? "[\\uE000-\\uF8FF]" : "[]", We = U(q, oe, "[\\-\\.\\_\\~]", Pe);
x(q + U(q, oe, "[\\+\\-\\.]") + "*"), x(x(ue + "|" + U(We, _e, "[\\:]")) + "*");
var Ve = x(x("25[0-5]") + "|" + x("2[0-4]" + oe) + "|" + x("1" + oe + oe) + "|" + x("0?[1-9]" + oe) + "|0?0?" + oe), je = x(Ve + "\\." + Ve + "\\." + Ve + "\\." + Ve), Be = x(de + "{1,4}"), De = x(x(Be + "\\:" + Be) + "|" + je), ze = x(x(Be + "\\:") + "{6}" + De), Ke = x("\\:\\:" + x(Be + "\\:") + "{5}" + De), rt = x(x(Be) + "?\\:\\:" + x(Be + "\\:") + "{4}" + De), qe = x(x(x(Be + "\\:") + "{0,1}" + Be) + "?\\:\\:" + x(Be + "\\:") + "{3}" + De), et = x(x(x(Be + "\\:") + "{0,2}" + Be) + "?\\:\\:" + x(Be + "\\:") + "{2}" + De), lt = x(x(x(Be + "\\:") + "{0,3}" + Be) + "?\\:\\:" + Be + "\\:" + De), st = x(x(x(Be + "\\:") + "{0,4}" + Be) + "?\\:\\:" + De), Qe = x(x(x(Be + "\\:") + "{0,5}" + Be) + "?\\:\\:" + Be), tt = x(x(x(Be + "\\:") + "{0,6}" + Be) + "?\\:\\:"), at = x([ze, Ke, rt, qe, et, lt, st, Qe, tt].join("|")), nt = x(x(We + "|" + ue) + "+");
x("[vV]" + de + "+\\." + U(We, _e, "[\\:]") + "+"), x(x(ue + "|" + U(We, _e)) + "*");
var ct = x(ue + "|" + U(We, _e, "[\\:\\@]"));
return x(x(ue + "|" + U(We, _e, "[\\@]")) + "+"), x(x(ct + "|" + U("[\\/\\?]", Oe)) + "*"), { NOT_SCHEME: new RegExp(U("[^]", q, oe, "[\\+\\-\\.]"), "g"), NOT_USERINFO: new RegExp(U("[^\\%\\:]", We, _e), "g"), NOT_HOST: new RegExp(U("[^\\%\\[\\]\\:]", We, _e), "g"), NOT_PATH: new RegExp(U("[^\\%\\/\\:\\@]", We, _e), "g"), NOT_PATH_NOSCHEME: new RegExp(U("[^\\%\\/\\@]", We, _e), "g"), NOT_QUERY: new RegExp(U("[^\\%]", We, _e, "[\\:\\@\\/\\?]", Oe), "g"), NOT_FRAGMENT: new RegExp(U("[^\\%]", We, _e, "[\\:\\@\\/\\?]"), "g"), ESCAPE: new RegExp(U("[^]", We, _e), "g"), UNRESERVED: new RegExp(We, "g"), OTHER_CHARS: new RegExp(U("[^\\%]", We, He), "g"), PCT_ENCODED: new RegExp(ue, "g"), IPV4ADDRESS: new RegExp("^(" + je + ")$"), IPV6ADDRESS: new RegExp("^\\[?(" + at + ")" + x(x("\\%25|\\%(?!" + de + "{2})") + "(" + nt + ")") + "?\\]?$") };
}
var N = P(false), A = P(true), f = /* @__PURE__ */ function() {
function se(q, oe) {
var de = [], ue = true, Ee = false, _e = void 0;
try {
for (var He = q[Symbol.iterator](), Pe; !(ue = (Pe = He.next()).done) && (de.push(Pe.value), !(oe && de.length === oe)); ue = true)
;
} catch (Oe) {
Ee = true, _e = Oe;
} finally {
try {
!ue && He.return && He.return();
} finally {
if (Ee)
throw _e;
}
}
return de;
}
return function(q, oe) {
if (Array.isArray(q))
return q;
if (Symbol.iterator in Object(q))
return se(q, oe);
throw new TypeError("Invalid attempt to destructure non-iterable instance");
};
}(), R = function(se) {
if (Array.isArray(se)) {
for (var q = 0, oe = Array(se.length); q < se.length; q++)
oe[q] = se[q];
return oe;
} else
return Array.from(se);
}, y = 2147483647, C = 36, d = 1, h = 26, l = 38, n = 700, o = 72, i = 128, a = "-", r = /^xn--/, e2 = /[^\0-\x7E]/, t = /[\x2E\u3002\uFF0E\uFF61]/g, s = { overflow: "Overflow: input needs wider integers to process", "not-basic": "Illegal input >= 0x80 (not a basic code point)", "invalid-input": "Invalid input" }, c = C - d, p = Math.floor, g = String.fromCharCode;
function b(se) {
throw new RangeError(s[se]);
}
function w(se, q) {
for (var oe = [], de = se.length; de--; )
oe[de] = q(se[de]);
return oe;
}
function E(se, q) {
var oe = se.split("@"), de = "";
oe.length > 1 && (de = oe[0] + "@", se = oe[1]), se = se.replace(t, ".");
var ue = se.split("."), Ee = w(ue, q).join(".");
return de + Ee;
}
function M(se) {
for (var q = [], oe = 0, de = se.length; oe < de; ) {
var ue = se.charCodeAt(oe++);
if (ue >= 55296 && ue <= 56319 && oe < de) {
var Ee = se.charCodeAt(oe++);
(Ee & 64512) == 56320 ? q.push(((ue & 1023) << 10) + (Ee & 1023) + 65536) : (q.push(ue), oe--);
} else
q.push(ue);
}
return q;
}
var B2 = function(q) {
return q - 48 < 10 ? q - 22 : q - 65 < 26 ? q - 65 : q - 97 < 26 ? q - 97 : C;
}, Z = function(q, oe) {
return q + 22 + 75 * (q < 26) - ((oe != 0) << 5);
}, k = function(q, oe, de) {
var ue = 0;
for (q = de ? p(q / n) : q >> 1, q += p(q / oe); q > c * h >> 1; ue += C)
q = p(q / c);
return p(ue + (c + 1) * q / (q + l));
}, u = function(q) {
var oe = [], de = q.length, ue = 0, Ee = i, _e = o, He = q.lastIndexOf(a);
He < 0 && (He = 0);
for (var Pe = 0; Pe < He; ++Pe)
q.charCodeAt(Pe) >= 128 && b("not-basic"), oe.push(q.charCodeAt(Pe));
for (var Oe = He > 0 ? He + 1 : 0; Oe < de; ) {
for (var We = ue, Ve = 1, je = C; ; je += C) {
Oe >= de && b("invalid-input");
var Be = B2(q.charCodeAt(Oe++));
(Be >= C || Be > p((y - ue) / Ve)) && b("overflow"), ue += Be * Ve;
var De = je <= _e ? d : je >= _e + h ? h : je - _e;
if (Be < De)
break;
var ze = C - De;
Ve > p(y / ze) && b("overflow"), Ve *= ze;
}
var Ke = oe.length + 1;
_e = k(ue - We, Ke, We == 0), p(ue / Ke) > y - Ee && b("overflow"), Ee += p(ue / Ke), ue %= Ke, oe.splice(ue++, 0, Ee);
}
return String.fromCodePoint.apply(String, oe);
}, _ = function(q) {
var oe = [];
q = M(q);
var de = q.length, ue = i, Ee = 0, _e = o, He = true, Pe = false, Oe = void 0;
try {
for (var We = q[Symbol.iterator](), Ve; !(He = (Ve = We.next()).done); He = true) {
var je = Ve.value;
je < 128 && oe.push(g(je));
}
} catch (ht) {
Pe = true, Oe = ht;
} finally {
try {
!He && We.return && We.return();
} finally {
if (Pe)
throw Oe;
}
}
var Be = oe.length, De = Be;
for (Be && oe.push(a); De < de; ) {
var ze = y, Ke = true, rt = false, qe = void 0;
try {
for (var et = q[Symbol.iterator](), lt; !(Ke = (lt = et.next()).done); Ke = true) {
var st = lt.value;
st >= ue && st < ze && (ze = st);
}
} catch (ht) {
rt = true, qe = ht;
} finally {
try {
!Ke && et.return && et.return();
} finally {
if (rt)
throw qe;
}
}
var Qe = De + 1;
ze - ue > p((y - Ee) / Qe) && b("overflow"), Ee += (ze - ue) * Qe, ue = ze;
var tt = true, at = false, nt = void 0;
try {
for (var ct = q[Symbol.iterator](), pt; !(tt = (pt = ct.next()).done); tt = true) {
var mt = pt.value;
if (mt < ue && ++Ee > y && b("overflow"), mt == ue) {
for (var dt = Ee, ut = C; ; ut += C) {
var gt = ut <= _e ? d : ut >= _e + h ? h : ut - _e;
if (dt < gt)
break;
var ft = dt - gt, Ct = C - gt;
oe.push(g(Z(gt + ft % Ct, 0))), dt = p(ft / Ct);
}
oe.push(g(Z(dt, 0))), _e = k(Ee, Qe, De == Be), Ee = 0, ++De;
}
}
} catch (ht) {
at = true, nt = ht;
} finally {
try {
!tt && ct.return && ct.return();
} finally {
if (at)
throw nt;
}
}
++Ee, ++ue;
}
return oe.join("");
}, v = { version: "2.1.0", ucs2: { decode: M, encode: function(q) {
return String.fromCodePoint.apply(String, R(q));
} }, decode: u, encode: _, toASCII: function(q) {
return E(q, function(oe) {
return e2.test(oe) ? "xn--" + _(oe) : oe;
});
}, toUnicode: function(q) {
return E(q, function(oe) {
return r.test(oe) ? u(oe.slice(4).toLowerCase()) : oe;
});
} }, $ = {};
function G(se) {
var q = se.charCodeAt(0), oe = void 0;
return q < 16 ? oe = "%0" + q.toString(16).toUpperCase() : q < 128 ? oe = "%" + q.toString(16).toUpperCase() : q < 2048 ? oe = "%" + (q >> 6 | 192).toString(16).toUpperCase() + "%" + (q & 63 | 128).toString(16).toUpperCase() : oe = "%" + (q >> 12 | 224).toString(16).toUpperCase() + "%" + (q >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (q & 63 | 128).toString(16).toUpperCase(), oe;
}
function W(se) {
for (var q = "", oe = 0, de = se.length; oe < de; ) {
var ue = parseInt(se.substr(oe + 1, 2), 16);
if (ue < 128)
q += String.fromCharCode(ue), oe += 3;
else if (ue >= 194 && ue < 224) {
if (de - oe >= 6) {
var Ee = parseInt(se.substr(oe + 4, 2), 16);
q += String.fromCharCode((ue & 31) << 6 | Ee & 63);
} else
q += se.substr(oe, 6);
oe += 6;
} else if (ue >= 224) {
if (de - oe >= 9) {
var _e = parseInt(se.substr(oe + 4, 2), 16), He = parseInt(se.substr(oe + 7, 2), 16);
q += String.fromCharCode((ue & 15) << 12 | (_e & 63) << 6 | He & 63);
} else
q += se.substr(oe, 9);
oe += 9;
} else
q += se.substr(oe, 3), oe += 3;
}
return q;
}
function X(se, q) {
function oe(de) {
var ue = W(de);
return ue.match(q.UNRESERVED) ? ue : de;
}
return se.scheme && (se.scheme = String(se.scheme).replace(q.PCT_ENCODED, oe).toLowerCase().replace(q.NOT_SCHEME, "")), se.userinfo !== void 0 && (se.userinfo = String(se.userinfo).replace(q.PCT_ENCODED, oe).replace(q.NOT_USERINFO, G).replace(q.PCT_ENCODED, z)), se.host !== void 0 && (se.host = String(se.host).replace(q.PCT_ENCODED, oe).toLowerCase().replace(q.NOT_HOST, G).replace(q.PCT_ENCODED, z)), se.path !== void 0 && (se.path = String(se.path).replace(q.PCT_ENCODED, oe).replace(se.scheme ? q.NOT_PATH : q.NOT_PATH_NOSCHEME, G).replace(q.PCT_ENCODED, z)), se.query !== void 0 && (se.query = String(se.query).replace(q.PCT_ENCODED, oe).replace(q.NOT_QUERY, G).replace(q.PCT_ENCODED, z)), se.fragment !== void 0 && (se.fragment = String(se.fragment).replace(q.PCT_ENCODED, oe).replace(q.NOT_FRAGMENT, G).replace(q.PCT_ENCODED, z)), se;
}
function Q(se) {
return se.replace(/^0*(.*)/, "$1") || "0";
}
function K(se, q) {
var oe = se.match(q.IPV4ADDRESS) || [], de = f(oe, 2), ue = de[1];
return ue ? ue.split(".").map(Q).join(".") : se;
}
function ne(se, q) {
var oe = se.match(q.IPV6ADDRESS) || [], de = f(oe, 3), ue = de[1], Ee = de[2];
if (ue) {
for (var _e = ue.toLowerCase().split("::").reverse(), He = f(_e, 2), Pe = He[0], Oe = He[1], We = Oe ? Oe.split(":").map(Q) : [], Ve = Pe.split(":").map(Q), je = q.IPV4ADDRESS.test(Ve[Ve.length - 1]), Be = je ? 7 : 8, De = Ve.length - Be, ze = Array(Be), Ke = 0; Ke < Be; ++Ke)
ze[Ke] = We[Ke] || Ve[De + Ke] || "";
je && (ze[Be - 1] = K(ze[Be - 1], q));
var rt = ze.reduce(function(Qe, tt, at) {
if (!tt || tt === "0") {
var nt = Qe[Qe.length - 1];
nt && nt.index + nt.length === at ? nt.length++ : Qe.push({ index: at, length: 1 });
}
return Qe;
}, []), qe = rt.sort(function(Qe, tt) {
return tt.length - Qe.length;
})[0], et = void 0;
if (qe && qe.length > 1) {
var lt = ze.slice(0, qe.index), st = ze.slice(qe.index + qe.length);
et = lt.join(":") + "::" + st.join(":");
} else
et = ze.join(":");
return Ee && (et += "%" + Ee), et;
} else
return se;
}
var T = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i, V = "".match(/(){0}/)[1] === void 0;
function F(se) {
var q = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, oe = {}, de = q.iri !== false ? A : N;
q.reference === "suffix" && (se = (q.scheme ? q.scheme + ":" : "") + "//" + se);
var ue = se.match(T);
if (ue) {
V ? (oe.scheme = ue[1], oe.userinfo = ue[3], oe.host = ue[4], oe.port = parseInt(ue[5], 10), oe.path = ue[6] || "", oe.query = ue[7], oe.fragment = ue[8], isNaN(oe.port) && (oe.port = ue[5])) : (oe.scheme = ue[1] || void 0, oe.userinfo = se.indexOf("@") !== -1 ? ue[3] : void 0, oe.host = se.indexOf("//") !== -1 ? ue[4] : void 0, oe.port = parseInt(ue[5], 10), oe.path = ue[6] || "", oe.query = se.indexOf("?") !== -1 ? ue[7] : void 0, oe.fragment = se.indexOf("#") !== -1 ? ue[8] : void 0, isNaN(oe.port) && (oe.port = se.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? ue[4] : void 0)), oe.host && (oe.host = ne(K(oe.host, de), de)), oe.scheme === void 0 && oe.userinfo === void 0 && oe.host === void 0 && oe.port === void 0 && !oe.path && oe.query === void 0 ? oe.reference = "same-document" : oe.scheme === void 0 ? oe.reference = "relative" : oe.fragment === void 0 ? oe.reference = "absolute" : oe.reference = "uri", q.reference && q.reference !== "suffix" && q.reference !== oe.reference && (oe.error = oe.error || "URI is not a " + q.reference + " reference.");
var Ee = $[(q.scheme || oe.scheme || "").toLowerCase()];
if (!q.unicodeSupport && (!Ee || !Ee.unicodeSupport)) {
if (oe.host && (q.domainHost || Ee && Ee.domainHost))
try {
oe.host = v.toASCII(oe.host.replace(de.PCT_ENCODED, W).toLowerCase());
} catch (_e) {
oe.error = oe.error || "Host's domain name can not be converted to ASCII via punycode: " + _e;
}
X(oe, N);
} else
X(oe, de);
Ee && Ee.parse && Ee.parse(oe, q);
} else
oe.error = oe.error || "URI can not be parsed.";
return oe;
}
function I(se, q) {
var oe = q.iri !== false ? A : N, de = [];
return se.userinfo !== void 0 && (de.push(se.userinfo), de.push("@")), se.host !== void 0 && de.push(ne(K(String(se.host), oe), oe).replace(oe.IPV6ADDRESS, function(ue, Ee, _e) {
return "[" + Ee + (_e ? "%25" + _e : "") + "]";
})), (typeof se.port == "number" || typeof se.port == "string") && (de.push(":"), de.push(String(se.port))), de.length ? de.join("") : void 0;
}
var S = /^\.\.?\//, L = /^\/\.(\/|$)/, O = /^\/\.\.(\/|$)/, J = /^\/?(?:.|\n)*?(?=\/|$)/;
function re(se) {
for (var q = []; se.length; )
if (se.match(S))
se = se.replace(S, "");
else if (se.match(L))
se = se.replace(L, "/");
else if (se.match(O))
se = se.replace(O, "/"), q.pop();
else if (se === "." || se === "..")
se = "";
else {
var oe = se.match(J);
if (oe) {
var de = oe[0];
se = se.slice(de.length), q.push(de);
} else
throw new Error("Unexpected dot segment condition");
}
return q.join("");
}
function pe(se) {
var q = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, oe = q.iri ? A : N, de = [], ue = $[(q.scheme || se.scheme || "").toLowerCase()];
if (ue && ue.serialize && ue.serialize(se, q), se.host && !oe.IPV6ADDRESS.test(se.host)) {
if (q.domainHost || ue && ue.domainHost)
try {
se.host = q.iri ? v.toUnicode(se.host) : v.toASCII(se.host.replace(oe.PCT_ENCODED, W).toLowerCase());
} catch (He) {
se.error = se.error || "Host's domain name can not be converted to " + (q.iri ? "Unicode" : "ASCII") + " via punycode: " + He;
}
}
X(se, oe), q.reference !== "suffix" && se.scheme && (de.push(se.scheme), de.push(":"));
var Ee = I(se, q);
if (Ee !== void 0 && (q.reference !== "suffix" && de.push("//"), de.push(Ee), se.path && se.path.charAt(0) !== "/" && de.push("/")), se.path !== void 0) {
var _e = se.path;
!q.absolutePath && (!ue || !ue.absolutePath) && (_e = re(_e)), Ee === void 0 && (_e = _e.replace(/^\/\//, "/%2F")), de.push(_e);
}
return se.query !== void 0 && (de.push("?"), de.push(se.query)), se.fragment !== void 0 && (de.push("#"), de.push(se.fragment)), de.join("");
}
function me(se, q) {
var oe = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, de = arguments[3], ue = {};
return de || (se = F(pe(se, oe), oe), q = F(pe(q, oe), oe)), oe = oe || {}, !oe.tolerant && q.scheme ? (ue.scheme = q.scheme, ue.userinfo = q.userinfo, ue.host = q.host, ue.port = q.port, ue.path = re(q.path || ""), ue.query = q.query) : (q.userinfo !== void 0 || q.host !== void 0 || q.port !== void 0 ? (ue.userinfo = q.userinfo, ue.host = q.host, ue.port = q.port, ue.path = re(q.path || ""), ue.query = q.query) : (q.path ? (q.path.charAt(0) === "/" ? ue.path = re(q.path) : ((se.userinfo !== void 0 || se.host !== void 0 || se.port !== void 0) && !se.path ? ue.path = "/" + q.path : se.path ? ue.path = se.path.slice(0, se.path.lastIndexOf("/") + 1) + q.path : ue.path = q.path, ue.path = re(ue.path)), ue.query = q.query) : (ue.path = se.path, q.query !== void 0 ? ue.query = q.query : ue.query = se.query), ue.userinfo = se.userinfo, ue.host = se.host, ue.port = se.port), ue.scheme = se.scheme), ue.fragment = q.fragment, ue;
}
function ye(se, q, oe) {
var de = Y({ scheme: "null" }, oe);
return pe(me(F(se, de), F(q, de), de, true), de);
}
function xe(se, q) {
return typeof se == "string" ? se = pe(F(se, q), q) : H(se) === "object" && (se = F(pe(se, q), q)), se;
}
function be(se, q, oe) {
return typeof se == "string" ? se = pe(F(se, oe), oe) : H(se) === "object" && (se = pe(se, oe)), typeof q == "string" ? q = pe(F(q, oe), oe) : H(q) === "object" && (q = pe(q, oe)), se === q;
}
function Ae(se, q) {
return se && se.toString().replace(!q || !q.iri ? N.ESCAPE : A.ESCAPE, G);
}
function we(se, q) {
return se && se.toString().replace(!q || !q.iri ? N.PCT_ENCODED : A.PCT_ENCODED, W);
}
var Re = { scheme: "http", domainHost: true, parse: function(q, oe) {
return q.host || (q.error = q.error || "HTTP URIs must have a host."), q;
}, serialize: function(q, oe) {
var de = String(q.scheme).toLowerCase() === "https";
return (q.port === (de ? 443 : 80) || q.port === "") && (q.port = void 0), q.path || (q.path = "/"), q;
} }, Me = { scheme: "https", domainHost: Re.domainHost, parse: Re.parse, serialize: Re.serialize };
function Se(se) {
return typeof se.secure == "boolean" ? se.secure : String(se.scheme).toLowerCase() === "wss";
}
var ve = { scheme: "ws", domainHost: true, parse: function(q, oe) {
var de = q;
return de.secure = Se(de), de.resourceName = (de.path || "/") + (de.query ? "?" + de.query : ""), de.path = void 0, de.query = void 0, de;
}, serialize: function(q, oe) {
if ((q.port === (Se(q) ? 443 : 80) || q.port === "") && (q.port = void 0), typeof q.secure == "boolean" && (q.scheme = q.secure ? "wss" : "ws", q.secure = void 0), q.resourceName) {
var de = q.resourceName.split("?"), ue = f(de, 2), Ee = ue[0], _e = ue[1];
q.path = Ee && Ee !== "/" ? Ee : void 0, q.query = _e, q.resourceName = void 0;
}
return q.fragment = void 0, q;
} }, Le = { scheme: "wss", domainHost: ve.domainHost, parse: ve.parse, serialize: ve.serialize }, Ge = {}, ge2 = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", te = "[0-9A-Fa-f]", ie = x(x("%[EFef]" + te + "%" + te + te + "%" + te + te) + "|" + x("%[89A-Fa-f]" + te + "%" + te + te) + "|" + x("%" + te + te)), ce = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", fe = U("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", '[\\"\\\\]'), Ie = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", $e = new RegExp(ge2, "g"), ee = new RegExp(ie, "g"), ae = new RegExp(U("[^]", ce, "[\\.]", '[\\"]', fe), "g"), he = new RegExp(U("[^]", ge2, Ie), "g"), Ce = he;
function Te(se) {
var q = W(se);
return q.match($e) ? q : se;
}
var ke = { scheme: "mailto", parse: function(q, oe) {
var de = q, ue = de.to = de.path ? de.path.split(",") : [];
if (de.path = void 0, de.query) {
for (var Ee = false, _e = {}, He = de.query.split("&"), Pe = 0, Oe = He.length; Pe < Oe; ++Pe) {
var We = He[Pe].split("=");
switch (We[0]) {
case "to":
for (var Ve = We[1].split(","), je = 0, Be = Ve.length; je < Be; ++je)
ue.push(Ve[je]);
break;
case "subject":
de.subject = we(We[1], oe);
break;
case "body":
de.body = we(We[1], oe);
break;
default:
Ee = true, _e[we(We[0], oe)] = we(We[1], oe);
break;
}
}
Ee && (de.headers = _e);
}
de.query = void 0;
for (var De = 0, ze = ue.length; De < ze; ++De) {
var Ke = ue[De].split("@");
if (Ke[0] = we(Ke[0]), oe.unicodeSupport)
Ke[1] = we(Ke[1], oe).toLowerCase();
else
try {
Ke[1] = v.toASCII(we(Ke[1], oe).toLowerCase());
} catch (rt) {
de.error = de.error || "Email address's domain name can not be converted to ASCII via punycode: " + rt;
}
ue[De] = Ke.join("@");
}
return de;
}, serialize: function(q, oe) {
var de = q, ue = j(q.to);
if (ue) {
for (var Ee = 0, _e = ue.length; Ee < _e; ++Ee) {
var He = String(ue[Ee]), Pe = He.lastIndexOf("@"), Oe = He.slice(0, Pe).replace(ee, Te).replace(ee, z).replace(ae, G), We = He.slice(Pe + 1);
try {
We = oe.iri ? v.toUnicode(We) : v.toASCII(we(We, oe).toLowerCase());
} catch (De) {
de.error = de.error || "Email address's domain name can not be converted to " + (oe.iri ? "Unicode" : "ASCII") + " via punycode: " + De;
}
ue[Ee] = Oe + "@" + We;
}
de.path = ue.join(",");
}
var Ve = q.headers = q.headers || {};
q.subject && (Ve.subject = q.subject), q.body && (Ve.body = q.body);
var je = [];
for (var Be in Ve)
Ve[Be] !== Ge[Be] && je.push(Be.replace(ee, Te).replace(ee, z).replace(he, G) + "=" + Ve[Be].replace(ee, Te).replace(ee, z).replace(Ce, G));
return je.length && (de.query = je.join("&")), de;
} }, Ne = /^([^\:]+)\:(.*)/, Fe = { scheme: "urn", parse: function(q, oe) {
var de = q.path && q.path.match(Ne), ue = q;
if (de) {
var Ee = oe.scheme || ue.scheme || "urn", _e = de[1].toLowerCase(), He = de[2], Pe = Ee + ":" + (oe.nid || _e), Oe = $[Pe];
ue.nid = _e, ue.nss = He, ue.path = void 0, Oe && (ue = Oe.parse(ue, oe));
} else
ue.error = ue.error || "URN can not be parsed.";
return ue;
}, serialize: function(q, oe) {
var de = oe.scheme || q.scheme || "urn", ue = q.nid, Ee = de + ":" + (oe.nid || ue), _e = $[Ee];
_e && (q = _e.serialize(q, oe));
var He = q, Pe = q.nss;
return He.path = (ue || oe.nid) + ":" + Pe, He;
} }, Xe = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, Ue = { scheme: "urn:uuid", parse: function(q, oe) {
var de = q;
return de.uuid = de.nss, de.nss = void 0, !oe.tolerant && (!de.uuid || !de.uuid.match(Xe)) && (de.error = de.error || "UUID is not valid."), de;
}, serialize: function(q, oe) {
var de = q;
return de.nss = (q.uuid || "").toLowerCase(), de;
} };
$[Re.scheme] = Re, $[Me.scheme] = Me, $[ve.scheme] = ve, $[Le.scheme] = Le, $[ke.scheme] = ke, $[Fe.scheme] = Fe, $[Ue.scheme] = Ue, D.SCHEMES = $, D.pctEncChar = G, D.pctDecChars = W, D.parse = F, D.removeDotSegments = re, D.serialize = pe, D.resolveComponents = me, D.resolve = ye, D.normalize = xe, D.equal = be, D.escapeComponent = Ae, D.unescapeComponent = we, Object.defineProperty(D, "__esModule", { value: true });
})(m);
}, 4049: function(le) {
le.exports = function() {
var m = function(o, i) {
if (!(o instanceof i))
throw new TypeError("Cannot call a class as a function");
}, D = /* @__PURE__ */ function() {
function o(i, a) {
for (var r = 0; r < a.length; r++) {
var e2 = a[r];
e2.enumerable = e2.enumerable || false, e2.configurable = true, "value" in e2 && (e2.writable = true), Object.defineProperty(i, e2.key, e2);
}
}
return function(i, a, r) {
return a && o(i.prototype, a), r && o(i, r), i;
};
}(), U = /* @__PURE__ */ function() {
function o(i, a) {
var r = [], e2 = true, t = false, s = void 0;
try {
for (var c = i[Symbol.iterator](), p; !(e2 = (p = c.next()).done) && (r.push(p.value), !(a && r.length === a)); e2 = true)
;
} catch (g) {
t = true, s = g;
} finally {
try {
!e2 && c.return && c.return();
} finally {
if (t)
throw s;
}
}
return r;
}
return function(i, a) {
if (Array.isArray(i))
return i;
if (Symbol.iterator in Object(i))
return o(i, a);
throw new TypeError("Invalid attempt to destructure non-iterable instance");
};
}(), x = (String.prototype.startsWith = String.prototype.startsWith || function(o) {
return this.indexOf(o) === 0;
}, String.prototype.padStart = String.prototype.padStart || function(o, i) {
for (var a = this; a.length < o; )
a = i + a;
return a;
}, { cb: "0f8ff", tqw: "aebd7", q: "-ffff", qmrn: "7fffd4", zr: "0ffff", bg: "5f5dc", bsq: "e4c4", bck: "---", nch: "ebcd", b: "--ff", bvt: "8a2be2", brwn: "a52a2a", brw: "deb887", ctb: "5f9ea0", hrt: "7fff-", chcT: "d2691e", cr: "7f50", rnw: "6495ed", crns: "8dc", crms: "dc143c", cn: "-ffff", Db: "--8b", Dcn: "-8b8b", Dgnr: "b8860b", Dgr: "a9a9a9", Dgrn: "-64-", Dkhk: "bdb76b", Dmgn: "8b-8b", Dvgr: "556b2f", Drng: "8c-", Drch: "9932cc", Dr: "8b--", Dsmn: "e9967a", Dsgr: "8fbc8f", DsTb: "483d8b", DsTg: "2f4f4f", Dtrq: "-ced1", Dvt: "94-d3", ppnk: "1493", pskb: "-bfff", mgr: "696969", grb: "1e90ff", rbrc: "b22222", rwht: "af0", stg: "228b22", chs: "-ff", gnsb: "dcdcdc", st: "8f8ff", g: "d7-", gnr: "daa520", gr: "808080", grn: "-8-0", grnw: "adff2f", hnw: "0fff0", htpn: "69b4", nnr: "cd5c5c", ng: "4b-82", vr: "0", khk: "0e68c", vnr: "e6e6fa", nrb: "0f5", wngr: "7cfc-", mnch: "acd", Lb: "add8e6", Lcr: "08080", Lcn: "e0ffff", Lgnr: "afad2", Lgr: "d3d3d3", Lgrn: "90ee90", Lpnk: "b6c1", Lsmn: "a07a", Lsgr: "20b2aa", Lskb: "87cefa", LsTg: "778899", Lstb: "b0c4de", Lw: "e0", m: "-ff-", mgrn: "32cd32", nn: "af0e6", mgnt: "-ff", mrn: "8--0", mqm: "66cdaa", mmb: "--cd", mmrc: "ba55d3", mmpr: "9370db", msg: "3cb371", mmsT: "7b68ee", "": "-fa9a", mtr: "48d1cc", mmvt: "c71585", mnLb: "191970", ntc: "5fffa", mstr: "e4e1", mccs: "e4b5", vjw: "dead", nv: "--80", c: "df5e6", v: "808-0", vrb: "6b8e23", rng: "a5-", rngr: "45-", rch: "da70d6", pgnr: "eee8aa", pgrn: "98fb98", ptrq: "afeeee", pvtr: "db7093", ppwh: "efd5", pchp: "dab9", pr: "cd853f", pnk: "c0cb", pm: "dda0dd", pwrb: "b0e0e6", prp: "8-080", cc: "663399", r: "--", sbr: "bc8f8f", rb: "4169e1", sbrw: "8b4513", smn: "a8072", nbr: "4a460", sgrn: "2e8b57", ssh: "5ee", snn: "a0522d", svr: "c0c0c0", skb: "87ceeb", sTb: "6a5acd", sTgr: "708090", snw: "afa", n: "-ff7f", stb: "4682b4", tn: "d2b48c", t: "-8080", thst: "d8bfd8", tmT: "6347", trqs: "40e0d0", vt: "ee82ee", whT: "5deb3", wht: "", hts: "5f5f5", w: "-", wgrn: "9acd32" });
function H(o) {
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1, a = i > 0 ? o.toFixed(i).replace(/0+$/, "").replace(/\.$/, "") : o.toString();
return a || "0";
}
var z = function() {
function o(i, a, r, e2) {
m(this, o);
var t = this;
function s(p) {
if (p.startsWith("hsl")) {
var g = p.match(/([\-\d\.e]+)/g).map(Number), b = U(g, 4), w = b[0], E = b[1], M = b[2], B2 = b[3];
B2 === void 0 && (B2 = 1), w /= 360, E /= 100, M /= 100, t.hsla = [w, E, M, B2];
} else if (p.startsWith("rgb")) {
var Z = p.match(/([\-\d\.e]+)/g).map(Number), k = U(Z, 4), u = k[0], _ = k[1], v = k[2], $ = k[3];
$ === void 0 && ($ = 1), t.rgba = [u, _, v, $];
} else
p.startsWith("#") ? t.rgba = o.hexToRgb(p) : t.rgba = o.nameToRgb(p) || o.hexToRgb(p);
}
if (i !== void 0)
if (Array.isArray(i))
this.rgba = i;
else if (r === void 0) {
var c = i && "" + i;
c && s(c.toLowerCase());
} else
this.rgba = [i, a, r, e2 === void 0 ? 1 : e2];
}
return D(o, [{ key: "printRGB", value: function(a) {
var r = a ? this.rgba : this.rgba.slice(0, 3), e2 = r.map(function(t, s) {
return H(t, s === 3 ? 3 : 0);
});
return a ? "rgba(" + e2 + ")" : "rgb(" + e2 + ")";
} }, { key: "printHSL", value: function(a) {
var r = [360, 100, 100, 1], e2 = ["", "%", "%", ""], t = a ? this.hsla : this.hsla.slice(0, 3), s = t.map(function(c, p) {
return H(c * r[p], p === 3 ? 3 : 1) + e2[p];
});
return a ? "hsla(" + s + ")" : "hsl(" + s + ")";
} }, { key: "printHex", value: function(a) {
var r = this.hex;
return a ? r : r.substring(0, 7);
} }, { key: "rgba", get: function() {
if (this._rgba)
return this._rgba;
if (!this._hsla)
throw new Error("No color is set");
return this._rgba = o.hslToRgb(this._hsla);
}, set: function(a) {
a.length === 3 && (a[3] = 1), this._rgba = a, this._hsla = null;
} }, { key: "rgbString", get: function() {
return this.printRGB();
} }, { key: "rgbaString", get: function() {
return this.printRGB(true);
} }, { key: "hsla", get: function() {
if (this._hsla)
return this._hsla;
if (!this._rgba)
throw new Error("No color is set");
return this._hsla = o.rgbToHsl(this._rgba);
}, set: function(a) {
a.length === 3 && (a[3] = 1), this._hsla = a, this._rgba = null;
} }, { key: "hslString", get: function() {
return this.printHSL();
} }, { key: "hslaString", get: function() {
return this.printHSL(true);
} }, { key: "hex", get: function() {
var a = this.rgba, r = a.map(function(e2, t) {
return t < 3 ? e2.toString(16) : Math.round(e2 * 255).toString(16);
});
return "#" + r.map(function(e2) {
return e2.padStart(2, "0");
}).join("");
}, set: function(a) {
this.rgba = o.hexToRgb(a);
} }], [{ key: "hexToRgb", value: function(a) {
var r = (a.startsWith("#") ? a.slice(1) : a).replace(/^(\w{3})$/, "$1F").replace(/^(\w)(\w)(\w)(\w)$/, "$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/, "$1FF");
if (!r.match(/^([0-9a-fA-F]{8})$/))
throw new Error("Unknown hex color; " + a);
var e2 = r.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(t) {
return parseInt(t, 16);
});
return e2[3] = e2[3] / 255, e2;
} }, { key: "nameToRgb", value: function(a) {
var r = a.toLowerCase().replace("at", "T").replace(/[aeiouyldf]/g, "").replace("ght", "L").replace("rk", "D").slice(-5, 4), e2 = x[r];
return e2 === void 0 ? e2 : o.hexToRgb(e2.replace(/\-/g, "00").padStart(6, "f"));
} }, { key: "rgbToHsl", value: function(a) {
var r = U(a, 4), e2 = r[0], t = r[1], s = r[2], c = r[3];
e2 /= 255, t /= 255, s /= 255;
var p = Math.max(e2, t, s), g = Math.min(e2, t, s), b = void 0, w = void 0, E = (p + g) / 2;
if (p === g)
b = w = 0;
else {
var M = p - g;
switch (w = E > 0.5 ? M / (2 - p - g) : M / (p + g), p) {
case e2:
b = (t - s) / M + (t < s ? 6 : 0);
break;
case t:
b = (s - e2) / M + 2;
break;
case s:
b = (e2 - t) / M + 4;
break;
}
b /= 6;
}
return [b, w, E, c];
} }, { key: "hslToRgb", value: function(a) {
var r = U(a, 4), e2 = r[0], t = r[1], s = r[2], c = r[3], p = void 0, g = void 0, b = void 0;
if (t === 0)
p = g = b = s;
else {
var w = function(k, u, _) {
return _ < 0 && (_ += 1), _ > 1 && (_ -= 1), _ < 0.16666666666666666 ? k + (u - k) * 6 * _ : _ < 0.5 ? u : _ < 0.6666666666666666 ? k + (u - k) * (0.6666666666666666 - _) * 6 : k;
}, E = s < 0.5 ? s * (1 + t) : s + t - s * t, M = 2 * s - E;
p = w(M, E, e2 + 1 / 3), g = w(M, E, e2), b = w(M, E, e2 - 1 / 3);
}
var B2 = [p * 255, g * 255, b * 255].map(Math.round);
return B2[3] = c, B2;
} }]), o;
}(), j = function() {
function o() {
m(this, o), this._events = [];
}
return D(o, [{ key: "add", value: function(a, r, e2) {
a.addEventListener(r, e2, false), this._events.push({ target: a, type: r, handler: e2 });
} }, { key: "remove", value: function(a, r, e2) {
this._events = this._events.filter(function(t) {
var s = true;
return a && a !== t.target && (s = false), r && r !== t.type && (s = false), e2 && e2 !== t.handler && (s = false), s && o._doRemove(t.target, t.type, t.handler), !s;
});
} }, { key: "destroy", value: function() {
this._events.forEach(function(a) {
return o._doRemove(a.target, a.type, a.handler);
}), this._events = [];
} }], [{ key: "_doRemove", value: function(a, r, e2) {
a.removeEventListener(r, e2, false);
} }]), o;
}();
function Y(o) {
var i = document.createElement("div");
return i.innerHTML = o, i.firstElementChild;
}
function P(o, i, a) {
var r = false;
function e2(p, g, b) {
return Math.max(g, Math.min(p, b));
}
function t(p, g, b) {
if (b && (r = true), !!r) {
p.preventDefault();
var w = i.getBoundingClientRect(), E = w.width, M = w.height, B2 = g.clientX, Z = g.clientY, k = e2(B2 - w.left, 0, E), u = e2(Z - w.top, 0, M);
a(k / E, u / M);
}
}
function s(p, g) {
var b = p.buttons === void 0 ? p.which : p.buttons;
b === 1 ? t(p, p, g) : r = false;
}
function c(p, g) {
p.touches.length === 1 ? t(p, p.touches[0], g) : r = false;
}
o.add(i, "mousedown", function(p) {
s(p, true);
}), o.add(i, "touchstart", function(p) {
c(p, true);
}), o.add(window, "mousemove", s), o.add(i, "touchmove", c), o.add(window, "mouseup", function(p) {
r = false;
}), o.add(i, "touchend", function(p) {
r = false;
}), o.add(i, "touchcancel", function(p) {
r = false;
});
}
var N = `linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,
linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em`, A = 360, f = "keydown", R = "mousedown", y = "focusin";
function C(o, i) {
return (i || document).querySelector(o);
}
function d(o) {
o.preventDefault(), o.stopPropagation();
}
function h(o, i, a, r, e2) {
o.add(i, f, function(t) {
a.indexOf(t.key) >= 0 && (e2 && d(t), r(t));
});
}
var l = function() {
function o(i) {
m(this, o), this.settings = { popup: "right", layout: "default", alpha: true, editor: true, editorFormat: "hex", cancelButton: false, defaultColor: "#0cf" }, this._events = new j(), this.onChange = null, this.onDone = null, this.onOpen = null, this.onClose = null, this.setOptions(i);
}
return D(o, [{ key: "setOptions", value: function(a) {
var r = this;
if (!a)
return;
var e2 = this.settings;
function t(g, b, w) {
for (var E in g)
w && w.indexOf(E) >= 0 || (b[E] = g[E]);
}
if (a instanceof HTMLElement)
e2.parent = a;
else {
e2.parent && a.parent && e2.parent !== a.parent && (this._events.remove(e2.parent), this._popupInited = false), t(a, e2), a.onChange && (this.onChange = a.onChange), a.onDone && (this.onDone = a.onDone), a.onOpen && (this.onOpen = a.onOpen), a.onClose && (this.onClose = a.onClose);
var s = a.color || a.colour;
s && this._setColor(s);
}
var c = e2.parent;
if (c && e2.popup && !this._popupInited) {
var p = function(b) {
return r.openHandler(b);
};
this._events.add(c, "click", p), h(this._events, c, [" ", "Spacebar", "Enter"], p), this._popupInited = true;
} else
a.parent && !e2.popup && this.show();
} }, { key: "openHandler", value: function(a) {
if (this.show()) {
a && a.preventDefault(), this.settings.parent.style.pointerEvents = "none";
var r = a && a.type === f ? this._domEdit : this.domElement;
setTimeout(function() {
return r.focus();
}, 100), this.onOpen && this.onOpen(this.colour);
}
} }, { key: "closeHandler", value: function(a) {
var r = a && a.type, e2 = false;
if (!a)
e2 = true;
else if (r === R || r === y) {
var t = (this.__containedEvent || 0) + 100;
a.timeStamp > t && (e2 = true);
} else
d(a), e2 = true;
e2 && this.hide() && (this.settings.parent.style.pointerEvents = "", r !== R && this.settings.parent.focus(), this.onClose && this.onClose(this.colour));
} }, { key: "movePopup", value: function(a, r) {
this.closeHandler(), this.setOptions(a), r && this.openHandler();
} }, { key: "setColor", value: function(a, r) {
this._setColor(a, { silent: r });
} }, { key: "_setColor", value: function(a, r) {
if (typeof a == "string" && (a = a.trim()), !!a) {
r = r || {};
var e2 = void 0;
try {
e2 = new z(a);
} catch (s) {
if (r.failSilently)
return;
throw s;
}
if (!this.settings.alpha) {
var t = e2.hsla;
t[3] = 1, e2.hsla = t;
}
this.colour = this.color = e2, this._setHSLA(null, null, null, null, r);
}
} }, { key: "setColour", value: function(a, r) {
this.setColor(a, r);
} }, { key: "show", value: function() {
var a = this.settings.parent;
if (!a)
return false;
if (this.domElement) {
var r = this._toggleDOM(true);
return this._setPosition(), r;
}
var e2 = this.settings.template || '', t = Y(e2);
return this.domElement = t, this._domH = C(".picker_hue", t), this._domSL = C(".picker_sl", t), this._domA = C(".picker_alpha", t), this._domEdit = C(".picker_editor input", t), this._domSample = C(".picker_sample", t), this._domOkay = C(".picker_done button", t), this._domCancel = C(".picker_cancel button", t), t.classList.add("layout_" + this.settings.layout), this.settings.alpha || t.classList.add("no_alpha"), this.settings.editor || t.classList.add("no_editor"), this.settings.cancelButton || t.classList.add("no_cancel"), this._ifPopup(function() {
return t.classList.add("popup");
}), this._setPosition(), this.colour ? this._updateUI() : this._setColor(this.settings.defaultColor), this._bindEvents(), true;
} }, { key: "hide", value: function() {
return this._toggleDOM(false);
} }, { key: "destroy", value: function() {
this._events.destroy(), this.domElement && this.settings.parent.removeChild(this.domElement);
} }, { key: "_bindEvents", value: function() {
var a = this, r = this, e2 = this.domElement, t = this._events;
function s(g, b, w) {
t.add(g, b, w);
}
s(e2, "click", function(g) {
return g.preventDefault();
}), P(t, this._domH, function(g, b) {
return r._setHSLA(g);
}), P(t, this._domSL, function(g, b) {
return r._setHSLA(null, g, 1 - b);
}), this.settings.alpha && P(t, this._domA, function(g, b) {
return r._setHSLA(null, null, null, 1 - b);
});
var c = this._domEdit;
s(c, "input", function(g) {
r._setColor(this.value, { fromEditor: true, failSilently: true });
}), s(c, "focus", function(g) {
var b = this;
b.selectionStart === b.selectionEnd && b.select();
}), this._ifPopup(function() {
var g = function(E) {
return a.closeHandler(E);
};
s(window, R, g), s(window, y, g), h(t, e2, ["Esc", "Escape"], g);
var b = function(E) {
a.__containedEvent = E.timeStamp;
};
s(e2, R, b), s(e2, y, b), s(a._domCancel, "click", g);
});
var p = function(b) {
a._ifPopup(function() {
return a.closeHandler(b);
}), a.onDone && a.onDone(a.colour);
};
s(this._domOkay, "click", p), h(t, e2, ["Enter"], p);
} }, { key: "_setPosition", value: function() {
var a = this.settings.parent, r = this.domElement;
a !== r.parentNode && a.appendChild(r), this._ifPopup(function(e2) {
getComputedStyle(a).position === "static" && (a.style.position = "relative");
var t = e2 === true ? "popup_right" : "popup_" + e2;
["popup_top", "popup_bottom", "popup_left", "popup_right"].forEach(function(s) {
s === t ? r.classList.add(s) : r.classList.remove(s);
}), r.classList.add(t);
});
} }, { key: "_setHSLA", value: function(a, r, e2, t, s) {
s = s || {};
var c = this.colour, p = c.hsla;
[a, r, e2, t].forEach(function(g, b) {
(g || g === 0) && (p[b] = g);
}), c.hsla = p, this._updateUI(s), this.onChange && !s.silent && this.onChange(c);
} }, { key: "_updateUI", value: function(a) {
if (!this.domElement)
return;
a = a || {};
var r = this.colour, e2 = r.hsla, t = "hsl(" + e2[0] * A + ", 100%, 50%)", s = r.hslString, c = r.hslaString, p = this._domH, g = this._domSL, b = this._domA, w = C(".picker_selector", p), E = C(".picker_selector", g), M = C(".picker_selector", b);
function B2(W, X, Q) {
X.style.left = Q * 100 + "%";
}
function Z(W, X, Q) {
X.style.top = Q * 100 + "%";
}
B2(p, w, e2[0]), this._domSL.style.backgroundColor = this._domH.style.color = t, B2(g, E, e2[1]), Z(g, E, 1 - e2[2]), g.style.color = s, Z(b, M, 1 - e2[3]);
var k = s, u = k.replace("hsl", "hsla").replace(")", ", 0)"), _ = "linear-gradient(" + [k, u] + ")";
if (this._domA.style.background = _ + ", " + N, !a.fromEditor) {
var v = this.settings.editorFormat, $ = this.settings.alpha, G = void 0;
switch (v) {
case "rgb":
G = r.printRGB($);
break;
case "hsl":
G = r.printHSL($);
break;
default:
G = r.printHex($);
}
this._domEdit.value = G;
}
this._domSample.style.color = c;
} }, { key: "_ifPopup", value: function(a, r) {
this.settings.parent && this.settings.popup ? a && a(this.settings.popup) : r && r();
} }, { key: "_toggleDOM", value: function(a) {
var r = this.domElement;
if (!r)
return false;
var e2 = a ? "" : "none", t = r.style.display !== e2;
return t && (r.style.display = e2), t;
} }]), o;
}(), n = document.createElement("style");
return n.textContent = '.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}', document.documentElement.firstElementChild.appendChild(n), l.StyleElement = n, l;
}();
}, 1262: function(le, m, D) {
function U(te) {
return (U = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(ie) {
return typeof ie;
} : function(ie) {
return ie && typeof Symbol == "function" && ie.constructor === Symbol && ie !== Symbol.prototype ? "symbol" : typeof ie;
})(te);
}
function x(te) {
var ie = j();
return function() {
var ce, fe = P(te), fe = (ce = ie ? (ce = P(this).constructor, Reflect.construct(fe, arguments, ce)) : fe.apply(this, arguments), this);
if (ce && (U(ce) === "object" || typeof ce == "function"))
return ce;
if (ce !== void 0)
throw new TypeError("Derived constructors may only return object or undefined");
if (fe !== void 0)
return fe;
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
};
}
function H(te) {
var ie = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
return function(ce) {
if (ce === null || Function.toString.call(ce).indexOf("[native code]") === -1)
return ce;
if (typeof ce != "function")
throw new TypeError("Super expression must either be null or a function");
if (ie !== void 0) {
if (ie.has(ce))
return ie.get(ce);
ie.set(ce, fe);
}
function fe() {
return z(ce, arguments, P(this).constructor);
}
return fe.prototype = Object.create(ce.prototype, { constructor: { value: fe, enumerable: false, writable: true, configurable: true } }), Y(fe, ce);
}(te);
}
function z(te, ie, ce) {
return (z = j() ? Reflect.construct.bind() : function(fe, Ie, $e) {
var ee = [null];
return ee.push.apply(ee, Ie), Ie = new (Function.bind.apply(fe, ee))(), $e && Y(Ie, $e.prototype), Ie;
}).apply(null, arguments);
}
function j() {
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
return false;
if (typeof Proxy == "function")
return true;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
})), true;
} catch {
return false;
}
}
function Y(te, ie) {
return (Y = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(ce, fe) {
return ce.__proto__ = fe, ce;
})(te, ie);
}
function P(te) {
return (P = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(ie) {
return ie.__proto__ || Object.getPrototypeOf(ie);
})(te);
}
D.d(m, { K: function() {
return ge2;
} });
var N = function(te) {
var ie = fe;
if (typeof te != "function" && te !== null)
throw new TypeError("Super expression must either be null or a function");
ie.prototype = Object.create(te && te.prototype, { constructor: { value: ie, writable: true, configurable: true } }), Object.defineProperty(ie, "prototype", { writable: false }), te && Y(ie, te);
var ce = x(fe);
function fe(Ie, $e) {
if (this instanceof fe)
return (Ie = ce.call(this, Ie + " at position " + $e)).position = $e, Ie;
throw new TypeError("Cannot call a class as a function");
}
return ie = fe, Object.defineProperty(ie, "prototype", { writable: false }), ie;
}(H(Error)), A = 92, f = 47, R = 42, y = 123, C = 125, d = 91, h = 93, l = 40, n = 41, o = 32, i = 10, a = 9, r = 13, e2 = 8, t = 12, s = 34, c = 43, p = 45, g = 39, b = 48, w = 49, E = 57, M = 44, B2 = 46, Z = 58, k = 59, u = 65, _ = 97, v = 69, $ = 101, G = 70, W = 102, X = 160, Q = 8192, K = 8202, ne = 8239, T = 8287, V = 12288, F = 8220, I = 8221, S = 8216, L = 8217, O = 96, J = 180;
function re(te) {
return b <= te && te <= E || u <= te && te <= G || _ <= te && te <= W;
}
function pe(te) {
return b <= te && te <= E;
}
var me = /^[,:[\]{}()\n]$/;
function ye(te) {
return xe.test(te) || te && Ae(te.charCodeAt(0));
}
var xe = /^[[{\w-]$/;
function be(te) {
return te === o || te === i || te === a || te === r;
}
function Ae(te) {
return we(te) || Me(te);
}
function we(te) {
return te === s || te === F || te === I;
}
function Re(te) {
return te === s;
}
function Me(te) {
return te === g || te === S || te === L || te === O || te === J;
}
function Se(te, ie, ce) {
return ce = 2 < arguments.length && ce !== void 0 && ce, ie = te.lastIndexOf(ie), ie !== -1 ? te.substring(0, ie) + (ce ? "" : te.substring(ie + 1)) : te;
}
function ve(te, ie) {
var ce = te.length;
if (!be(te.charCodeAt(ce - 1)))
return te + ie;
for (; be(te.charCodeAt(ce - 1)); )
ce--;
return te.substring(0, ce) + ie + te.substring(ce);
}
var Le = { "\b": "\\b", "\f": "\\f", "\n": "\\n", "\r": "\\r", " ": "\\t" }, Ge = { '"': '"', "\\": "\\", "/": "/", b: "\b", f: "\f", n: `
`, r: "\r", t: " " };
function ge2(te) {
var ie = 0, ce = "";
if (!ee())
throw new N("Unexpected end of json string", te.length);
var fe = Ce(M);
if (fe && ae(), ye(te[ie]) && /[,\n][ \t\r]*$/.test(ce)) {
fe || (ce = ve(ce, ","));
for (var Ie = true, $e = true; $e; )
Ie ? Ie = false : Ce(M) || (ce = ve(ce, ",")), $e = ee();
$e || (ce = Se(ce, ",")), ce = `[
`.concat(ce, `
]`);
} else
fe && (ce = Se(ce, ","));
if (ie >= te.length)
return ce;
throw new N("Unexpected character " + JSON.stringify(te[ie]), ie);
function ee() {
ae();
var q = function() {
if (te.charCodeAt(ie) !== y)
return false;
ce += "{", ie++, ae();
for (var oe = true; ie < te.length && te.charCodeAt(ie) !== C; ) {
if (oe ? oe = false : (Ce(M) || (ce = ve(ce, ",")), ae()), !(ke() || Fe())) {
te.charCodeAt(ie) === C || te.charCodeAt(ie) === y || te.charCodeAt(ie) === h || te.charCodeAt(ie) === d || te[ie] === void 0 ? ce = Se(ce, ",") : function() {
throw new N("Object key expected", ie);
}();
break;
}
ae();
var de = Ce(Z);
de || (ye(te[ie]) ? ce = ve(ce, ":") : se()), ee() || (de ? function() {
throw new N("Object value expected", ie);
} : se)();
}
return te.charCodeAt(ie) === C ? (ce += "}", ie++) : ce = ve(ce, "}"), true;
}() || function() {
if (te.charCodeAt(ie) !== d)
return false;
ce += "[", ie++, ae();
for (var oe = true; ie < te.length && te.charCodeAt(ie) !== h; )
if (oe ? oe = false : Ce(M) || (ce = ve(ce, ",")), !ee()) {
ce = Se(ce, ",");
break;
}
return te.charCodeAt(ie) === h ? (ce += "]", ie++) : ce = ve(ce, "]"), true;
}() || ke() || function() {
var oe = ie;
if (te.charCodeAt(ie) === p && (ie++, Ue(oe)))
return true;
if (te.charCodeAt(ie) === b)
ie++;
else if (function(de) {
return w <= de && de <= E;
}(te.charCodeAt(ie)))
for (ie++; pe(te.charCodeAt(ie)); )
ie++;
if (te.charCodeAt(ie) === B2) {
if (ie++, Ue(oe))
return true;
for (; pe(te.charCodeAt(ie)); )
ie++;
}
if (te.charCodeAt(ie) === $ || te.charCodeAt(ie) === v) {
if (ie++, te.charCodeAt(ie) !== p && te.charCodeAt(ie) !== c || ie++, Ue(oe))
return true;
for (; pe(te.charCodeAt(ie)); )
ie++;
}
return oe < ie ? (ce += te.slice(oe, ie), true) : false;
}() || Ne("true", "true") || Ne("false", "false") || Ne("null", "null") || Ne("True", "true") || Ne("False", "false") || Ne("None", "null") || Fe();
return ae(), q;
}
function ae() {
for (he(); function() {
if (te.charCodeAt(ie) === f && te.charCodeAt(ie + 1) === R) {
for (; ie < te.length && !function(q, oe) {
return q[oe] === "*" && q[oe + 1] === "/";
}(te, ie); )
ie++;
ie += 2;
} else {
if (te.charCodeAt(ie) !== f || te.charCodeAt(ie + 1) !== f)
return false;
for (; ie < te.length && te.charCodeAt(ie) !== i; )
ie++;
}
return true;
}() && he(); )
;
}
function he() {
for (var q, oe, de = ""; (q = be(te.charCodeAt(ie))) || (oe = te.charCodeAt(ie)) === X || Q <= oe && oe <= K || oe === ne || oe === T || oe === V; )
de += q ? te[ie] : " ", ie++;
return 0 < de.length && (ce += de, true);
}
function Ce(q) {
return te.charCodeAt(ie) === q && (ce += te[ie], ie++, true);
}
function Te() {
return q = A, te.charCodeAt(ie) === q && (ie++, true);
var q;
}
function ke() {
var q, oe = te.charCodeAt(ie) === A;
if (oe && (ie++, oe = true), Ae(te.charCodeAt(ie))) {
var de = Me(te.charCodeAt(ie)) ? Me : Re(te.charCodeAt(ie)) ? Re : we;
for (ce += '"', ie++; ie < te.length && !de(te.charCodeAt(ie)); ) {
if (te.charCodeAt(ie) === A) {
var ue = te[ie + 1];
if (Ge[ue] !== void 0)
ce += te.slice(ie, ie + 2), ie += 2;
else if (ue === "u") {
if (!(re(te.charCodeAt(ie + 2)) && re(te.charCodeAt(ie + 3)) && re(te.charCodeAt(ie + 4)) && re(te.charCodeAt(ie + 5)))) {
_e = Ee = void 0;
for (var Ee = ie, _e = Ee + 2; /\w/.test(te[_e]); )
_e++;
throw Ee = te.slice(Ee, _e), new N('Invalid unicode character "'.concat(Ee, '"'), ie);
}
ce += te.slice(ie, ie + 6), ie += 6;
} else
ce += ue, ie += 2;
} else {
if (Ee = te[ie], ue = te.charCodeAt(ie), ue === s && te.charCodeAt(ie - 1) !== A)
ce += "\\" + Ee;
else if ((q = ue) === i || q === r || q === a || q === e2 || q === t)
ce += Le[Ee];
else {
if (!(32 <= (q = ue) && q <= 1114111))
throw new N("Invalid character " + JSON.stringify(Ee), ie);
ce += Ee;
}
ie++;
}
oe && Te();
}
for (Ae(te.charCodeAt(ie)) ? (te.charCodeAt(ie), ce += '"', ie++) : ce += '"', ae(); te.charCodeAt(ie) === c; ) {
ie++, ae();
var He = (ce = Se(ce, '"', true)).length;
ke(), ce = function(Pe, Oe, We) {
return Pe.substring(0, Oe) + Pe.substring(Oe + We);
}(ce, He, 1);
}
return true;
}
return false;
}
function Ne(q, oe) {
return te.slice(ie, ie + q.length) === q && (ce += oe, ie += q.length, true);
}
function Fe() {
for (var q, oe = ie; ie < te.length && (q = te[ie], !(me.test(q) || q && Ae(q.charCodeAt(0)))); )
ie++;
if (oe < ie) {
if (te.charCodeAt(ie) === l)
ie++, ee(), te.charCodeAt(ie) === n && (ie++, te.charCodeAt(ie) === k) && ie++;
else {
for (; be(te.charCodeAt(ie - 1)) && 0 < ie; )
ie--;
oe = te.slice(oe, ie), ce += JSON.stringify(oe);
}
return true;
}
}
function Xe(q) {
if (!pe(te.charCodeAt(ie)))
throw q = te.slice(q, ie), new N("Invalid number '".concat(q, "', expecting a digit ").concat(te[ie] ? "but got '".concat(te[ie], "'") : "but reached end of input"), 2);
}
function Ue(q) {
if (ie >= te.length)
return ce += te.slice(q, ie) + "0", 1;
Xe(q);
}
function se() {
throw new N("Colon expected", ie);
}
}
}, 894: function(le) {
le.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}');
}, 7171: function(le) {
le.exports = JSON.parse('{"id":"http://json-schema.org/draft-04/schema#","$schema":"http://json-schema.org/draft-04/schema#","description":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"positiveInteger":{"type":"integer","minimum":0},"positiveIntegerDefault0":{"allOf":[{"$ref":"#/definitions/positiveInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true}},"type":"object","properties":{"id":{"type":"string"},"$schema":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"multipleOf":{"type":"number","minimum":0,"exclusiveMinimum":true},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"$ref":"#/definitions/positiveInteger"},"minLength":{"$ref":"#/definitions/positiveIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/positiveInteger"},"minItems":{"$ref":"#/definitions/positiveIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"$ref":"#/definitions/positiveInteger"},"minProperties":{"$ref":"#/definitions/positiveIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"dependencies":{"exclusiveMaximum":["maximum"],"exclusiveMinimum":["minimum"]},"default":{}}');
}, 6273: function(le) {
le.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-06/schema#","$id":"http://json-schema.org/draft-06/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"examples":{"type":"array","items":{}},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":{},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":{}}');
}, 6680: function(le) {
le.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}');
} }, Ze = {}, Ye.amdD = function() {
throw new Error("define cannot be used indirect");
}, Ye.n = function(le) {
var m = le && le.__esModule ? function() {
return le.default;
} : function() {
return le;
};
return Ye.d(m, { a: m }), m;
}, Ye.d = function(le, m) {
for (var D in m)
Ye.o(m, D) && !Ye.o(le, D) && Object.defineProperty(le, D, { enumerable: true, get: m[D] });
}, Ye.o = function(le, m) {
return Object.prototype.hasOwnProperty.call(le, m);
}, Ye.r = function(le) {
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(le, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(le, "__esModule", { value: true });
}, Ye.nmd = function(le) {
return le.paths = [], le.children || (le.children = []), le;
}, Ye(3161);
function Ye(le) {
var m = Ze[le];
return m !== void 0 || (m = Ze[le] = { id: le, loaded: false, exports: {} }, ot[le].call(m.exports, m, m.exports, Ye), m.loaded = true), m.exports;
}
var ot, Ze;
});
})(bt);
var Nt = bt.exports;
var Bt = e(Nt);
var Mt = defineComponent({
name: "FsJsonEditor",
props: {
modelValue: [String, Boolean, Object, Array],
showBtns: [Boolean],
expandedOnStart: {
type: Boolean,
default: false
},
mode: {
type: String,
default: "tree"
},
modes: {
type: Array,
default: function() {
return ["tree", "code", "form", "text", "view"];
}
},
lang: {
type: String,
default: "en"
}
},
emits: ["error", "update:modelValue", "save", "change"],
setup(Je, { emit: it }) {
var z;
const Ye = (z = getCurrentInstance()) == null ? void 0 : z.root.proxy, ot = ref(), Ze = reactive({
editor: null,
error: false,
json: {},
internalChange: false,
expandedModes: ["tree", "view", "form"],
locale: {
en: {
save: "SAVE"
},
zh: {
save: "保存"
}
}
});
watch(
() => Je.modelValue,
async (j) => {
Ze.internalChange || (Ze.json = j, await x(j), Ze.error = false, D());
},
{ immediate: true }
);
const { ui: le } = B(), m = le.formItem.injectFormItemContext();
onMounted(() => {
const j = {
mode: Je.mode,
modes: Je.modes,
onChange() {
try {
const Y = Ze.editor.get();
Ze.json = Y, Ze.error = false, it("change", Y), Ze.internalChange = true, it("update:modelValue", Y), Ye.$nextTick(function() {
Ze.internalChange = false;
}), m.onChange();
} catch (Y) {
Ze.error = true, it("error", Y);
}
},
onModeChange() {
D();
}
};
Ze.editor = new Bt(ot.value, j, Ze.json);
});
function D() {
Je.expandedOnStart && Ze.expandedModes.includes(Ze.editor.getMode()) && Ze.editor.expandAll();
}
function U() {
it("save", Ze.json);
}
function x(j) {
Ze.editor && Ze.editor.set(j);
}
function H(j) {
return (Ze.locale[Je.lang] || Ze.locale.zh)[j];
}
return {
setEditor: x,
state: Ze,
onSave: U,
expandAll: D,
editorRef: ot,
getI18nText: H
};
}
});
var Wt = { class: "fs-json-editor" };
var Ht = {
ref: "editorRef",
class: "jsoneditor-vue"
};
var Gt = {
key: 0,
class: "jsoneditor-btns"
};
var Pt = ["disabled"];
function Ft(Je, it, Ye, ot, Ze, le) {
return openBlock(), createElementBlock("div", Wt, [
createBaseVNode("div", Ht, null, 512),
Je.showBtns !== false ? (openBlock(), createElementBlock("div", Gt, [
createBaseVNode("button", {
class: "json-save-btn",
type: "button",
disabled: Je.state.error,
onClick: it[0] || (it[0] = (...m) => Je.onSave && Je.onSave(...m))
}, toDisplayString(Je.getI18nText("save")), 9, Pt)
])) : createCommentVNode("", true)
]);
}
var jt = ge(Mt, [["render", Ft]]);
export {
jt as default
};
/*! Bundled license information:
@fast-crud/fast-extends/dist/fs-json-editor-985ed0b5.mjs:
(*!
* jsoneditor.js
*
* @brief
* JSONEditor is a web-based tool to view, edit, format, and validate JSON.
* It has various modes such as a tree editor, a code editor, and a plain text
* editor.
*
* Supported browsers: Chrome, Firefox, Safari, Opera, Internet Explorer 8+
*
* @license
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*
* Copyright (c) 2011-2023 Jos de Jong, http://jsoneditoronline.org
*
* @author Jos de Jong,
* @version 9.10.5
* @date 2023-12-21
*)
(** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
*/
//# sourceMappingURL=fs-json-editor-985ed0b5-HDVYTRP2.js.map