diff --git a/dist/filament-tools.js b/dist/filament-tools.js index 4eb900f..a74d999 100644 --- a/dist/filament-tools.js +++ b/dist/filament-tools.js @@ -77,29 +77,29 @@ function codePointSize(code) { return code < 65536 ? 1 : 2; } - function countColumn(string3, tabSize, to = string3.length) { + function countColumn(string2, tabSize, to = string2.length) { let n = 0; for (let i = 0; i < to; ) { - if (string3.charCodeAt(i) == 9) { + if (string2.charCodeAt(i) == 9) { n += tabSize - n % tabSize; i++; } else { n++; - i = findClusterBreak(string3, i); + i = findClusterBreak(string2, i); } } return n; } - function findColumn(string3, col, tabSize, strict) { + function findColumn(string2, col, tabSize, strict) { for (let i = 0, n = 0; ; ) { if (n >= col) return i; - if (i == string3.length) + if (i == string2.length) break; - n += string3.charCodeAt(i) == 9 ? tabSize - n % tabSize : 1; - i = findClusterBreak(string3, i); + n += string2.charCodeAt(i) == 9 ? tabSize - n % tabSize : 1; + i = findClusterBreak(string2, i); } - return strict === true ? -1 : string3.length; + return strict === true ? -1 : string2.length; } var Text = class { constructor() { @@ -196,9 +196,9 @@ } lineInner(target, isLine, line, offset) { for (let i = 0; ; i++) { - let string3 = this.text[i], end = offset + string3.length; + let string2 = this.text[i], end = offset + string2.length; if ((isLine ? line : end) >= target) - return new Line(offset, end, line, string3); + return new Line(offset, end, line, string2); offset = end + 1; line++; } @@ -552,10 +552,10 @@ }; } var Line = class { - constructor(from2, to, number3, text) { + constructor(from2, to, number2, text) { this.from = from2; this.to = to; - this.number = number3; + this.number = number2; this.text = text; } get length() { @@ -565,12 +565,12 @@ // node_modules/@codemirror/state/dist/index.js var DefaultSplit = /\r\n?|\n/; - var MapMode = /* @__PURE__ */ function(MapMode4) { - MapMode4[MapMode4["Simple"] = 0] = "Simple"; - MapMode4[MapMode4["TrackDel"] = 1] = "TrackDel"; - MapMode4[MapMode4["TrackBefore"] = 2] = "TrackBefore"; - MapMode4[MapMode4["TrackAfter"] = 3] = "TrackAfter"; - return MapMode4; + var MapMode = /* @__PURE__ */ function(MapMode2) { + MapMode2[MapMode2["Simple"] = 0] = "Simple"; + MapMode2[MapMode2["TrackDel"] = 1] = "TrackDel"; + MapMode2[MapMode2["TrackBefore"] = 2] = "TrackBefore"; + MapMode2[MapMode2["TrackAfter"] = 3] = "TrackAfter"; + return MapMode2; }(MapMode || (MapMode = {})); var ChangeDesc = class { constructor(sections) { @@ -677,16 +677,16 @@ super(sections); this.inserted = inserted; } - apply(doc4) { - if (this.length != doc4.length) + apply(doc2) { + if (this.length != doc2.length) throw new RangeError("Applying change set to a document with the wrong length"); - iterChanges(this, (fromA, toA, fromB, _toB, text) => doc4 = doc4.replace(fromB, fromB + (toA - fromA), text), false); - return doc4; + iterChanges(this, (fromA, toA, fromB, _toB, text) => doc2 = doc2.replace(fromB, fromB + (toA - fromA), text), false); + return doc2; } mapDesc(other, before = false) { return mapSet(this, other, before, true); } - invert(doc4) { + invert(doc2) { let sections = this.sections.slice(), inserted = []; for (let i = 0, pos = 0; i < sections.length; i += 2) { let len = sections[i], ins = sections[i + 1]; @@ -696,7 +696,7 @@ let index = i >> 1; while (inserted.length < index) inserted.push(Text.empty); - inserted.push(len ? doc4.slice(pos, pos + len) : Text.empty); + inserted.push(len ? doc2.slice(pos, pos + len) : Text.empty); } pos += len; } @@ -785,10 +785,10 @@ flush(); total = total ? total.compose(spec.map(total)) : spec; } else { - let { from: from2, to = from2, insert: insert4 } = spec; + let { from: from2, to = from2, insert: insert2 } = spec; if (from2 > to || from2 < 0 || to > length) throw new RangeError(`Invalid change range ${from2} to ${to} (in doc of length ${length})`); - let insText = !insert4 ? Text.empty : typeof insert4 == "string" ? Text.of(insert4.split(lineSep || DefaultSplit)) : insert4; + let insText = !insert2 ? Text.empty : typeof insert2 == "string" ? Text.of(insert2.split(lineSep || DefaultSplit)) : insert2; let insLen = insText.length; if (from2 == to && insLen == 0) return; @@ -882,7 +882,7 @@ } } function mapSet(setA, setB, before, mkSet = false) { - let sections = [], insert4 = mkSet ? [] : null; + let sections = [], insert2 = mkSet ? [] : null; let a = new SectionIter(setA), b = new SectionIter(setB); for (let posA = 0, posB = 0; ; ) { if (a.ins == -1) { @@ -918,12 +918,12 @@ } } addSection(sections, len, a.ins); - if (insert4) - addInsert(insert4, sections, a.text); + if (insert2) + addInsert(insert2, sections, a.text); posA = end; a.next(); } else if (a.done && b.done) { - return insert4 ? new ChangeSet(sections, insert4) : new ChangeDesc(sections); + return insert2 ? new ChangeSet(sections, insert2) : new ChangeDesc(sections); } else { throw new Error("Mismatched change set lengths"); } @@ -931,18 +931,18 @@ } function composeSets(setA, setB, mkSet = false) { let sections = []; - let insert4 = mkSet ? [] : null; + let insert2 = mkSet ? [] : null; let a = new SectionIter(setA), b = new SectionIter(setB); for (let open = false; ; ) { if (a.done && b.done) { - return insert4 ? new ChangeSet(sections, insert4) : new ChangeDesc(sections); + return insert2 ? new ChangeSet(sections, insert2) : new ChangeDesc(sections); } else if (a.ins == 0) { addSection(sections, a.len, 0, open); a.next(); } else if (b.len == 0 && !b.done) { addSection(sections, 0, b.ins, open); - if (insert4) - addInsert(insert4, sections, b.text); + if (insert2) + addInsert(insert2, sections, b.text); b.next(); } else if (a.done || b.done) { throw new Error("Mismatched change set lengths"); @@ -951,16 +951,16 @@ if (a.ins == -1) { let insB = b.ins == -1 ? -1 : b.off ? 0 : b.ins; addSection(sections, len, insB, open); - if (insert4 && insB) - addInsert(insert4, sections, b.text); + if (insert2 && insB) + addInsert(insert2, sections, b.text); } else if (b.ins == -1) { addSection(sections, a.off ? 0 : a.len, len, open); - if (insert4) - addInsert(insert4, sections, a.textBit(len)); + if (insert2) + addInsert(insert2, sections, a.textBit(len)); } else { addSection(sections, a.off ? 0 : a.len, b.off ? 0 : b.ins, open); - if (insert4 && !b.off) - addInsert(insert4, sections, b.text); + if (insert2 && !b.off) + addInsert(insert2, sections, b.text); } open = (a.ins > len || b.ins >= 0 && b.len > len) && (open || sections.length > sectionLen); a.forward2(len); @@ -1156,10 +1156,10 @@ } var nextID = 0; var Facet = class { - constructor(combine, compareInput, compare4, isStatic, extensions) { + constructor(combine, compareInput, compare2, isStatic, extensions) { this.combine = combine; this.compareInput = compareInput; - this.compare = compare4; + this.compare = compare2; this.isStatic = isStatic; this.extensions = extensions; this.id = nextID++; @@ -1199,17 +1199,17 @@ this.id = nextID++; } dynamicSlot(addresses) { - var _a4; + var _a2; let getter = this.value; - let compare4 = this.facet.compareInput; - let id3 = this.id, idx = addresses[id3] >> 1, multi = this.type == 2; + let compare2 = this.facet.compareInput; + let id2 = this.id, idx = addresses[id2] >> 1, multi = this.type == 2; let depDoc = false, depSel = false, depAddrs = []; for (let dep of this.dependencies) { if (dep == "doc") depDoc = true; else if (dep == "selection") depSel = true; - else if ((((_a4 = addresses[dep.id]) !== null && _a4 !== void 0 ? _a4 : 1) & 1) == 0) + else if ((((_a2 = addresses[dep.id]) !== null && _a2 !== void 0 ? _a2 : 1) & 1) == 0) depAddrs.push(addresses[dep.id]); } return { @@ -1220,7 +1220,7 @@ update(state, tr) { if (depDoc && tr.docChanged || depSel && (tr.docChanged || tr.selection) || depAddrs.some((addr) => (ensureAddr(state, addr) & 1) > 0)) { let newVal = getter(state); - if (multi ? !compareArray(newVal, state.values[idx], compare4) : !compare4(newVal, state.values[idx])) { + if (multi ? !compareArray(newVal, state.values[idx], compare2) : !compare2(newVal, state.values[idx])) { state.values[idx] = newVal; return 1; } @@ -1229,10 +1229,10 @@ }, reconfigure(state, oldState) { let newVal = getter(state); - let oldAddr = oldState.config.address[id3]; + let oldAddr = oldState.config.address[id2]; if (oldAddr != null) { let oldVal = getAddr(oldState, oldAddr); - if (multi ? compareArray(newVal, oldVal, compare4) : compare4(newVal, oldVal)) { + if (multi ? compareArray(newVal, oldVal, compare2) : compare2(newVal, oldVal)) { state.values[idx] = oldVal; return 0; } @@ -1243,11 +1243,11 @@ }; } }; - function compareArray(a, b, compare4) { + function compareArray(a, b, compare2) { if (a.length != b.length) return false; for (let i = 0; i < a.length; i++) - if (!compare4(a[i], b[i])) + if (!compare2(a[i], b[i])) return false; return true; } @@ -1303,8 +1303,8 @@ } var initField = /* @__PURE__ */ Facet.define({ static: true }); var StateField = class { - constructor(id3, createF, updateF, compareF, spec) { - this.id = id3; + constructor(id2, createF, updateF, compareF, spec) { + this.id = id2; this.createF = createF; this.updateF = updateF; this.compareF = compareF; @@ -1368,17 +1368,17 @@ override: /* @__PURE__ */ prec(Prec_.highest) }; var PrecExtension = class { - constructor(inner, prec4) { + constructor(inner, prec2) { this.inner = inner; - this.prec = prec4; + this.prec = prec2; } }; var Compartment = class { of(ext) { return new CompartmentInstance(this, ext); } - reconfigure(content3) { - return Compartment.reconfigure.of({ compartment: this, extension: content3 }); + reconfigure(content2) { + return Compartment.reconfigure.of({ compartment: this, extension: content2 }); } get(state) { return state.config.compartments.get(this); @@ -1424,9 +1424,9 @@ dynamicSlots.push((a) => field.slot(a)); } let oldFacets = oldState === null || oldState === void 0 ? void 0 : oldState.config.facets; - for (let id3 in facets) { - let providers = facets[id3], facet = providers[0].facet; - let oldProviders = oldFacets && oldFacets[id3] || []; + for (let id2 in facets) { + let providers = facets[id2], facet = providers[0].facet; + let oldProviders = oldFacets && oldFacets[id2] || []; if (providers.every((p) => p.type == 0)) { address[facet.id] = staticValues.length << 1 | 1; if (sameArray(oldProviders, providers)) { @@ -1456,10 +1456,10 @@ function flatten(extension, compartments, newCompartments) { let result = [[], [], [], [], []]; let seen = /* @__PURE__ */ new Map(); - function inner(ext, prec4) { + function inner(ext, prec2) { let known = seen.get(ext); if (known != null) { - if (known >= prec4) + if (known >= prec2) return; let found = result[known].indexOf(ext); if (found > -1) @@ -1467,31 +1467,31 @@ if (ext instanceof CompartmentInstance) newCompartments.delete(ext.compartment); } - seen.set(ext, prec4); + seen.set(ext, prec2); if (Array.isArray(ext)) { for (let e of ext) - inner(e, prec4); + inner(e, prec2); } else if (ext instanceof CompartmentInstance) { if (newCompartments.has(ext.compartment)) throw new RangeError(`Duplicate use of compartment in extensions`); - let content3 = compartments.get(ext.compartment) || ext.inner; - newCompartments.set(ext.compartment, content3); - inner(content3, prec4); + let content2 = compartments.get(ext.compartment) || ext.inner; + newCompartments.set(ext.compartment, content2); + inner(content2, prec2); } else if (ext instanceof PrecExtension) { inner(ext.inner, ext.prec); } else if (ext instanceof StateField) { - result[prec4].push(ext); + result[prec2].push(ext); if (ext.provides) - inner(ext.provides, prec4); + inner(ext.provides, prec2); } else if (ext instanceof FacetProvider) { - result[prec4].push(ext); + result[prec2].push(ext); if (ext.facet.extensions) - inner(ext.facet.extensions, prec4); + inner(ext.facet.extensions, prec2); } else { - let content3 = ext.extension; - if (!content3) + let content2 = ext.extension; + if (!content2) throw new Error(`Unrecognized extension value in extension set (${ext}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`); - inner(content3, prec4); + inner(content2, prec2); } } inner(extension, Prec_.default); @@ -1580,13 +1580,13 @@ StateEffect.reconfigure = /* @__PURE__ */ StateEffect.define(); StateEffect.appendConfig = /* @__PURE__ */ StateEffect.define(); var Transaction = class { - constructor(startState, changes, selection, effects, annotations, scrollIntoView5) { + constructor(startState, changes, selection, effects, annotations, scrollIntoView3) { this.startState = startState; this.changes = changes; this.selection = selection; this.effects = effects; this.annotations = annotations; - this.scrollIntoView = scrollIntoView5; + this.scrollIntoView = scrollIntoView3; this._doc = null; this._state = null; if (selection) @@ -1645,7 +1645,7 @@ } } function mergeTransaction(a, b, sequential) { - var _a4; + var _a2; let mapForA, mapForB, changes; if (sequential) { mapForA = b.changes; @@ -1658,7 +1658,7 @@ } return { changes, - selection: b.selection ? b.selection.map(mapForB) : (_a4 = a.selection) === null || _a4 === void 0 ? void 0 : _a4.map(mapForA), + selection: b.selection ? b.selection.map(mapForB) : (_a2 = a.selection) === null || _a2 === void 0 ? void 0 : _a2.map(mapForA), effects: StateEffect.mapEffects(a.effects, mapForA).concat(StateEffect.mapEffects(b.effects, mapForB)), annotations: a.annotations.length ? a.annotations.concat(b.annotations) : b.annotations, scrollIntoView: a.scrollIntoView || b.scrollIntoView @@ -1738,11 +1738,11 @@ function asArray(value) { return value == null ? none : Array.isArray(value) ? value : [value]; } - var CharCategory = /* @__PURE__ */ function(CharCategory4) { - CharCategory4[CharCategory4["Word"] = 0] = "Word"; - CharCategory4[CharCategory4["Space"] = 1] = "Space"; - CharCategory4[CharCategory4["Other"] = 2] = "Other"; - return CharCategory4; + var CharCategory = /* @__PURE__ */ function(CharCategory2) { + CharCategory2[CharCategory2["Word"] = 0] = "Word"; + CharCategory2[CharCategory2["Space"] = 1] = "Space"; + CharCategory2[CharCategory2["Other"] = 2] = "Other"; + return CharCategory2; }(CharCategory || (CharCategory = {})); var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; var wordChar; @@ -1773,9 +1773,9 @@ }; } var EditorState = class { - constructor(config2, doc4, selection, values2, computeSlot, tr) { + constructor(config2, doc2, selection, values2, computeSlot, tr) { this.config = config2; - this.doc = doc4; + this.doc = doc2; this.selection = selection; this.values = values2; this.status = config2.statusTemplate.slice(); @@ -1861,8 +1861,8 @@ return spec; return ChangeSet.of(spec, this.doc.length, this.facet(EditorState.lineSeparator)); } - toText(string3) { - return Text.of(string3.split(this.facet(EditorState.lineSeparator) || DefaultSplit)); + toText(string2) { + return Text.of(string2.split(this.facet(EditorState.lineSeparator) || DefaultSplit)); } sliceDoc(from2 = 0, to = this.doc.length) { return this.doc.sliceString(from2, to, this.lineBreak); @@ -1904,12 +1904,12 @@ } static create(config2 = {}) { let configuration = Configuration.resolve(config2.extensions || [], /* @__PURE__ */ new Map()); - let doc4 = config2.doc instanceof Text ? config2.doc : Text.of((config2.doc || "").split(configuration.staticFacet(EditorState.lineSeparator) || DefaultSplit)); + let doc2 = config2.doc instanceof Text ? config2.doc : Text.of((config2.doc || "").split(configuration.staticFacet(EditorState.lineSeparator) || DefaultSplit)); let selection = !config2.selection ? EditorSelection.single(0) : config2.selection instanceof EditorSelection ? config2.selection : EditorSelection.single(config2.selection.anchor, config2.selection.head); - checkSelection(selection, doc4.length); + checkSelection(selection, doc2.length); if (!configuration.staticFacet(allowMultipleSelections)) selection = selection.asSingle(); - return new EditorState(configuration, doc4, selection, configuration.dynamicSlots.map(() => null), (state, slot) => slot.create(state), null); + return new EditorState(configuration, doc2, selection, configuration.dynamicSlots.map(() => null), (state, slot) => slot.create(state), null); } get tabSize() { return this.facet(EditorState.tabSize); @@ -1926,12 +1926,12 @@ return map[phrase2]; return phrase2; } - languageDataAt(name3, pos, side = -1) { + languageDataAt(name2, pos, side = -1) { let values2 = []; for (let provider of this.facet(languageData)) { for (let result of provider(this, pos, side)) { - if (Object.prototype.hasOwnProperty.call(result, name3)) - values2.push(result[name3]); + if (Object.prototype.hasOwnProperty.call(result, name2)) + values2.push(result[name2]); } } return values2; @@ -2029,9 +2029,9 @@ return this.rules.join("\n"); } static newName() { - let id3 = top[COUNT] || 1; - top[COUNT] = id3 + 1; - return C + id3.toString(36); + let id2 = top[COUNT] || 1; + top[COUNT] = id2 + 1; + return C + id2.toString(36); } static mount(root, modules) { (root[SET] || new StyleSet(root)).mount(Array.isArray(modules) ? modules : [modules]); @@ -2295,8 +2295,8 @@ } } static spans(sets, from2, to, iterator, minPointSize = -1) { - var _a4; - let cursor = new SpanCursor(sets, null, minPointSize, (_a4 = iterator.filterPoint) === null || _a4 === void 0 ? void 0 : _a4.bind(iterator)).goto(from2), pos = from2; + var _a2; + let cursor = new SpanCursor(sets, null, minPointSize, (_a2 = iterator.filterPoint) === null || _a2 === void 0 ? void 0 : _a2.bind(iterator)).goto(from2), pos = from2; let open = cursor.openStart; for (; ; ) { let curTo = Math.min(cursor.to, to); @@ -2846,20 +2846,20 @@ var code; function keyName(event) { var ignoreKey = brokenModifierNames && (event.ctrlKey || event.altKey || event.metaKey) || (safari || ie) && event.shiftKey && event.key && event.key.length == 1; - var name3 = !ignoreKey && event.key || (event.shiftKey ? shift : base)[event.keyCode] || event.key || "Unidentified"; - if (name3 == "Esc") - name3 = "Escape"; - if (name3 == "Del") - name3 = "Delete"; - if (name3 == "Left") - name3 = "ArrowLeft"; - if (name3 == "Up") - name3 = "ArrowUp"; - if (name3 == "Right") - name3 = "ArrowRight"; - if (name3 == "Down") - name3 = "ArrowDown"; - return name3; + var name2 = !ignoreKey && event.key || (event.shiftKey ? shift : base)[event.keyCode] || event.key || "Unidentified"; + if (name2 == "Esc") + name2 = "Escape"; + if (name2 == "Del") + name2 = "Delete"; + if (name2 == "Left") + name2 = "ArrowLeft"; + if (name2 == "Up") + name2 = "ArrowUp"; + if (name2 == "Right") + name2 = "ArrowRight"; + if (name2 == "Down") + name2 = "ArrowDown"; + return name2; } // node_modules/@codemirror/view/dist/index.js @@ -2947,10 +2947,10 @@ }; } function scrollRectIntoView(dom, rect, side, x, y, xMargin, yMargin, ltr) { - let doc4 = dom.ownerDocument, win = doc4.defaultView; + let doc2 = dom.ownerDocument, win = doc2.defaultView; for (let cur2 = dom; cur2; ) { if (cur2.nodeType == 1) { - let bounding, top2 = cur2 == doc4.body; + let bounding, top2 = cur2 == doc2.body; if (top2) { bounding = windowRect(win); } else { @@ -3085,8 +3085,8 @@ range.setStart(node, from2); return range; } - function dispatchKey(elt, name3, code) { - let options = { key: name3, code: name3, keyCode: code, which: code, cancelable: true }; + function dispatchKey(elt, name2, code) { + let options = { key: name2, code: name2, keyCode: code, which: code, cancelable: true }; let down = new KeyboardEvent("keydown", options); down.synthetic = true; elt.dispatchEvent(down); @@ -3316,8 +3316,8 @@ return this.childCursor().findPos(pos, bias); } toString() { - let name3 = this.constructor.name.replace("View", ""); - return name3 + (this.children.length ? "(" + this.children.join() + ")" : this.length ? "[" + (name3 == "Text" ? this.text : this.length) + "]" : "") + (this.breakAfter ? "#" : ""); + let name2 = this.constructor.name.replace("View", ""); + return name2 + (this.children.length ? "(" + this.children.join() + ")" : this.length ? "[" + (name2 == "Text" ? this.text : this.length) + "]" : "") + (this.breakAfter ? "#" : ""); } static get(node) { return node.cmView; @@ -3362,12 +3362,12 @@ } } }; - function replaceRange(parent, fromI, fromOff, toI, toOff, insert4, breakAtStart, openStart, openEnd) { + function replaceRange(parent, fromI, fromOff, toI, toOff, insert2, breakAtStart, openStart, openEnd) { let { children } = parent; let before = children.length ? children[fromI] : null; - let last = insert4.length ? insert4[insert4.length - 1] : null; + let last = insert2.length ? insert2[insert2.length - 1] : null; let breakAtEnd = last ? last.breakAfter : breakAtStart; - if (fromI == toI && before && !breakAtStart && !breakAtEnd && insert4.length < 2 && before.merge(fromOff, toOff, insert4.length ? last : null, fromOff == 0, openStart, openEnd)) + if (fromI == toI && before && !breakAtStart && !breakAtEnd && insert2.length < 2 && before.merge(fromOff, toOff, insert2.length ? last : null, fromOff == 0, openStart, openEnd)) return; if (toI < children.length) { let after = children[toI]; @@ -3377,11 +3377,11 @@ toOff = 0; } if (!breakAtEnd && last && after.merge(0, toOff, last, true, 0, openEnd)) { - insert4[insert4.length - 1] = after; + insert2[insert2.length - 1] = after; } else { if (toOff) after.merge(0, toOff, null, false, 0, openEnd); - insert4.push(after); + insert2.push(after); } } else if (after === null || after === void 0 ? void 0 : after.breakAfter) { if (last) @@ -3394,41 +3394,41 @@ if (before) { before.breakAfter = breakAtStart; if (fromOff > 0) { - if (!breakAtStart && insert4.length && before.merge(fromOff, before.length, insert4[0], false, openStart, 0)) { - before.breakAfter = insert4.shift().breakAfter; + if (!breakAtStart && insert2.length && before.merge(fromOff, before.length, insert2[0], false, openStart, 0)) { + before.breakAfter = insert2.shift().breakAfter; } else if (fromOff < before.length || before.children.length && before.children[before.children.length - 1].length == 0) { before.merge(fromOff, before.length, null, false, openStart, 0); } fromI++; } } - while (fromI < toI && insert4.length) { - if (children[toI - 1].become(insert4[insert4.length - 1])) { + while (fromI < toI && insert2.length) { + if (children[toI - 1].become(insert2[insert2.length - 1])) { toI--; - insert4.pop(); - openEnd = insert4.length ? 0 : openStart; - } else if (children[fromI].become(insert4[0])) { + insert2.pop(); + openEnd = insert2.length ? 0 : openStart; + } else if (children[fromI].become(insert2[0])) { fromI++; - insert4.shift(); - openStart = insert4.length ? 0 : openEnd; + insert2.shift(); + openStart = insert2.length ? 0 : openEnd; } else { break; } } - if (!insert4.length && fromI && toI < children.length && !children[fromI - 1].breakAfter && children[toI].merge(0, 0, children[fromI - 1], false, openStart, openEnd)) + if (!insert2.length && fromI && toI < children.length && !children[fromI - 1].breakAfter && children[toI].merge(0, 0, children[fromI - 1], false, openStart, openEnd)) fromI--; - if (fromI < toI || insert4.length) - parent.replaceChildren(fromI, toI, insert4); + if (fromI < toI || insert2.length) + parent.replaceChildren(fromI, toI, insert2); } - function mergeChildrenInto(parent, from2, to, insert4, openStart, openEnd) { + function mergeChildrenInto(parent, from2, to, insert2, openStart, openEnd) { let cur2 = parent.childCursor(); let { i: toI, off: toOff } = cur2.findPos(to, 1); let { i: fromI, off: fromOff } = cur2.findPos(from2, -1); let dLen = from2 - to; - for (let view of insert4) + for (let view of insert2) dLen += view.length; parent.length += dLen; - replaceRange(parent, fromI, fromOff, toI, toOff, insert4, 0, openStart, openEnd); + replaceRange(parent, fromI, fromOff, toI, toOff, insert2, 0, openStart, openEnd); } var nav = typeof navigator != "undefined" ? navigator : { userAgent: "", vendor: "", platform: "" }; var doc = typeof document != "undefined" ? document : { documentElement: { style: {} } }; @@ -3523,8 +3523,8 @@ if (this.mark.class) dom.className = this.mark.class; if (this.mark.attrs) - for (let name3 in this.mark.attrs) - dom.setAttribute(name3, this.mark.attrs[name3]); + for (let name2 in this.mark.attrs) + dom.setAttribute(name2, this.mark.attrs[name2]); return dom; } reuseDOM(node) { @@ -3577,15 +3577,15 @@ let length = text.nodeValue.length; if (pos > length) pos = length; - let from2 = pos, to = pos, flatten4 = 0; + let from2 = pos, to = pos, flatten2 = 0; if (pos == 0 && side < 0 || pos == length && side >= 0) { if (!(browser.chrome || browser.gecko)) { if (pos) { from2--; - flatten4 = 1; + flatten2 = 1; } else { to++; - flatten4 = -1; + flatten2 = -1; } } } else { @@ -3597,10 +3597,10 @@ let rects = textRange(text, from2, to).getClientRects(); if (!rects.length) return Rect0; - let rect = rects[(flatten4 ? flatten4 < 0 : side >= 0) ? 0 : rects.length - 1]; - if (browser.safari && !flatten4 && rect.width == 0) + let rect = rects[(flatten2 ? flatten2 < 0 : side >= 0) ? 0 : rects.length - 1]; + if (browser.safari && !flatten2 && rect.width == 0) rect = Array.prototype.find.call(rects, (r) => r.width) || rect; - return flatten4 ? flattenRect(rect, flatten4 < 0) : rect || null; + return flatten2 ? flattenRect(rect, flatten2 < 0) : rect || null; } var WidgetView = class extends ContentView { constructor(widget, length, side) { @@ -3719,9 +3719,9 @@ return scanCompositionTree(pos, side, topView, text, (v, pos2, side2) => v.coordsAt(pos2, side2), (pos2, side2) => textCoords(text, pos2, side2)); } destroy() { - var _a4; + var _a2; super.destroy(); - (_a4 = this.widget.topView) === null || _a4 === void 0 ? void 0 : _a4.destroy(); + (_a2 = this.widget.topView) === null || _a2 === void 0 ? void 0 : _a2.destroy(); } get isEditable() { return true; @@ -3859,14 +3859,14 @@ for (let off = 0, i = 0; i < view.children.length; i++) { let child = view.children[i], end = off + child.length, next; if ((side <= 0 || end == view.length || child.getSide() > 0 ? end >= pos : end > pos) && (pos < end || i + 1 == view.children.length || (next = view.children[i + 1]).length || next.getSide() > 0)) { - let flatten4 = 0; + let flatten2 = 0; if (end == off) { if (child.getSide() <= 0) continue; - flatten4 = side = -child.getSide(); + flatten2 = side = -child.getSide(); } let rect = child.coordsAt(Math.max(0, pos - off), side); - return flatten4 && rect ? flattenRect(rect, side < 0) : rect; + return flatten2 && rect ? flattenRect(rect, side < 0) : rect; } off = end; } @@ -3877,13 +3877,13 @@ return rects[rects.length - 1] || null; } function combineAttrs(source, target) { - for (let name3 in source) { - if (name3 == "class" && target.class) + for (let name2 in source) { + if (name2 == "class" && target.class) target.class += " " + source.class; - else if (name3 == "style" && target.style) + else if (name2 == "style" && target.style) target.style += ";" + source.style; else - target[name3] = source[name3]; + target[name2] = source[name2]; } return target; } @@ -3903,14 +3903,14 @@ } function updateAttrs(dom, prev, attrs) { if (prev) { - for (let name3 in prev) - if (!(attrs && name3 in attrs)) - dom.removeAttribute(name3); + for (let name2 in prev) + if (!(attrs && name2 in attrs)) + dom.removeAttribute(name2); } if (attrs) { - for (let name3 in attrs) - if (!(prev && prev[name3] == attrs[name3])) - dom.setAttribute(name3, attrs[name3]); + for (let name2 in attrs) + if (!(prev && prev[name2] == attrs[name2])) + dom.setAttribute(name2, attrs[name2]); } } var WidgetType = class { @@ -3935,12 +3935,12 @@ destroy(_dom) { } }; - var BlockType = /* @__PURE__ */ function(BlockType4) { - BlockType4[BlockType4["Text"] = 0] = "Text"; - BlockType4[BlockType4["WidgetBefore"] = 1] = "WidgetBefore"; - BlockType4[BlockType4["WidgetAfter"] = 2] = "WidgetAfter"; - BlockType4[BlockType4["WidgetRange"] = 3] = "WidgetRange"; - return BlockType4; + var BlockType = /* @__PURE__ */ function(BlockType2) { + BlockType2[BlockType2["Text"] = 0] = "Text"; + BlockType2[BlockType2["WidgetBefore"] = 1] = "WidgetBefore"; + BlockType2[BlockType2["WidgetAfter"] = 2] = "WidgetAfter"; + BlockType2[BlockType2["WidgetRange"] = 3] = "WidgetRange"; + return BlockType2; }(BlockType || (BlockType = {})); var Decoration = class extends RangeValue { constructor(startSide, endSide, widget, spec) { @@ -4138,7 +4138,7 @@ } } sync(track) { - var _a4; + var _a2; if (!this.dom) { this.setDOM(document.createElement("div")); this.dom.className = "cm-line"; @@ -4157,7 +4157,7 @@ let last = this.dom.lastChild; while (last && ContentView.get(last) instanceof MarkView) last = last.lastChild; - if (!last || !this.length || last.nodeName != "BR" && ((_a4 = ContentView.get(last)) === null || _a4 === void 0 ? void 0 : _a4.isEditable) == false && (!browser.ios || !this.children.some((ch) => ch instanceof TextView))) { + if (!last || !this.length || last.nodeName != "BR" && ((_a2 = ContentView.get(last)) === null || _a2 === void 0 ? void 0 : _a2.isEditable) == false && (!browser.ios || !this.children.some((ch) => ch instanceof TextView))) { let hack = document.createElement("BR"); hack.cmIgnore = true; this.dom.appendChild(hack); @@ -4272,8 +4272,8 @@ } }; var ContentBuilder = class { - constructor(doc4, pos, end, disallowBlockEffectsBelow) { - this.doc = doc4; + constructor(doc2, pos, end, disallowBlockEffectsBelow) { + this.doc = doc2; this.pos = pos; this.end = end; this.disallowBlockEffectsBelow = disallowBlockEffectsBelow; @@ -4286,7 +4286,7 @@ this.openEnd = -1; this.text = ""; this.textOff = 0; - this.cursor = doc4.iter(); + this.cursor = doc2.iter(); this.skip = pos; } posCovered() { @@ -4408,9 +4408,9 @@ } return true; } - static build(text, from2, to, decorations4, pluginDecorationLength) { + static build(text, from2, to, decorations2, pluginDecorationLength) { let builder = new ContentBuilder(text, from2, to, pluginDecorationLength); - builder.openEnd = RangeSet.spans(decorations4, from2, to, builder); + builder.openEnd = RangeSet.spans(decorations2, from2, to, builder); if (builder.openStart < 0) builder.openStart = builder.openEnd; builder.finish(builder.openEnd); @@ -4462,7 +4462,7 @@ return changes.empty ? this : new ScrollTarget(this.range.map(changes), this.y, this.x, this.yMargin, this.xMargin); } }; - var scrollIntoView = /* @__PURE__ */ StateEffect.define({ map: (t3, ch) => t3.map(ch) }); + var scrollIntoView = /* @__PURE__ */ StateEffect.define({ map: (t2, ch) => t2.map(ch) }); function logException(state, exception, context) { let handler = state.facet(exceptionSink); if (handler.length) @@ -4495,22 +4495,22 @@ var nextPluginID = 0; var viewPlugin = /* @__PURE__ */ Facet.define(); var ViewPlugin = class { - constructor(id3, create, fields) { - this.id = id3; + constructor(id2, create, fields) { + this.id = id2; this.create = create; this.fields = fields; this.extension = viewPlugin.of(this); } static define(create, spec) { - let { eventHandlers, provide, decorations: decorations4 } = spec || {}; + let { eventHandlers, provide, decorations: decorations2 } = spec || {}; let fields = []; if (provide) for (let provider of Array.isArray(provide) ? provide : [provide]) fields.push(provider); if (eventHandlers) fields.push(domEventHandlers.from((value) => ({ plugin: value, handlers: eventHandlers }))); - if (decorations4) - fields.push(PluginField.decorations.from(decorations4)); + if (decorations2) + fields.push(PluginField.decorations.from(decorations2)); return new ViewPlugin(nextPluginID++, create, fields); } static fromClass(cls, spec) { @@ -4561,8 +4561,8 @@ return this; } destroy(view) { - var _a4; - if ((_a4 = this.value) === null || _a4 === void 0 ? void 0 : _a4.destroy) { + var _a2; + if ((_a2 = this.value) === null || _a2 === void 0 ? void 0 : _a2.destroy) { try { this.value.destroy(); } catch (e) { @@ -4668,10 +4668,10 @@ return this.flags == 0 && this.transactions.length == 0; } }; - var Direction = /* @__PURE__ */ function(Direction4) { - Direction4[Direction4["LTR"] = 0] = "LTR"; - Direction4[Direction4["RTL"] = 1] = "RTL"; - return Direction4; + var Direction = /* @__PURE__ */ function(Direction2) { + Direction2[Direction2["LTR"] = 0] = "LTR"; + Direction2[Direction2["RTL"] = 1] = "RTL"; + return Direction2; }(Direction || (Direction = {})); var LTR = Direction.LTR; var RTL = Direction.RTL; @@ -4842,7 +4842,7 @@ } var movedOver = ""; function moveVisually(line, order, dir, start, forward) { - var _a4; + var _a2; let startIndex = start.head - line.from, spanI = -1; if (startIndex == 0) { if (!forward || !line.length) @@ -4861,7 +4861,7 @@ } } if (spanI < 0) - spanI = BidiSpan.find(order, startIndex, (_a4 = start.bidiLevel) !== null && _a4 !== void 0 ? _a4 : -1, start.assoc); + spanI = BidiSpan.find(order, startIndex, (_a2 = start.bidiLevel) !== null && _a2 !== void 0 ? _a2 : -1, start.assoc); let span2 = order[spanI]; if (startIndex == span2.side(forward, dir)) { span2 = order[spanI += forward ? 1 : -1]; @@ -5065,10 +5065,10 @@ if (!next) break; let { fromA, toA, fromB, toB } = next; - let { content: content3, breakAtStart, openStart, openEnd } = ContentBuilder.build(this.view.state.doc, fromB, toB, this.decorations, this.pluginDecorationLength); + let { content: content2, breakAtStart, openStart, openEnd } = ContentBuilder.build(this.view.state.doc, fromB, toB, this.decorations, this.pluginDecorationLength); let { i: toI, off: toOff } = cursor.findPos(toA, 1); let { i: fromI, off: fromOff } = cursor.findPos(fromA, -1); - replaceRange(this, fromI, fromOff, toI, toOff, content3, breakAtStart, openStart, openEnd); + replaceRange(this, fromI, fromOff, toI, toOff, content2, breakAtStart, openStart, openEnd); } } updateSelection(mustRead = false, fromPointer = false) { @@ -5438,8 +5438,8 @@ RangeSet.compare(a, b, diff, comp); return comp.changes; } - function inUneditable(node, inside4) { - for (let cur2 = node; cur2 && cur2 != inside4; cur2 = cur2.assignedSlot || cur2.parentNode) { + function inUneditable(node, inside2) { + for (let cur2 = node; cur2 && cur2 != inside2; cur2 = cur2.assignedSlot || cur2.parentNode) { if (cur2.nodeType == 1 && cur2.contentEditable == "false") { return true; } @@ -5569,8 +5569,8 @@ return { node, offset: closestOffset > -1 ? closestOffset : generalSide > 0 ? node.nodeValue.length : 0 }; } function posAtCoords(view, { x, y }, precise, bias = -1) { - var _a4; - let content3 = view.contentDOM.getBoundingClientRect(), docTop = content3.top + view.viewState.paddingTop; + var _a2; + let content2 = view.contentDOM.getBoundingClientRect(), docTop = content2.top + view.viewState.paddingTop; let block, { docHeight } = view.viewState; let yOffset = y - docTop; if (yOffset < 0) @@ -5594,28 +5594,28 @@ y = docTop + yOffset; let lineStart = block.from; if (lineStart < view.viewport.from) - return view.viewport.from == 0 ? 0 : precise ? null : posAtCoordsImprecise(view, content3, block, x, y); + return view.viewport.from == 0 ? 0 : precise ? null : posAtCoordsImprecise(view, content2, block, x, y); if (lineStart > view.viewport.to) - return view.viewport.to == view.state.doc.length ? view.state.doc.length : precise ? null : posAtCoordsImprecise(view, content3, block, x, y); - let doc4 = view.dom.ownerDocument; - let root = view.root.elementFromPoint ? view.root : doc4; + return view.viewport.to == view.state.doc.length ? view.state.doc.length : precise ? null : posAtCoordsImprecise(view, content2, block, x, y); + let doc2 = view.dom.ownerDocument; + let root = view.root.elementFromPoint ? view.root : doc2; let element = root.elementFromPoint(x, y); if (element && !view.contentDOM.contains(element)) element = null; if (!element) { - x = Math.max(content3.left + 1, Math.min(content3.right - 1, x)); + x = Math.max(content2.left + 1, Math.min(content2.right - 1, x)); element = root.elementFromPoint(x, y); if (element && !view.contentDOM.contains(element)) element = null; } let node, offset = -1; - if (element && ((_a4 = view.docView.nearest(element)) === null || _a4 === void 0 ? void 0 : _a4.isEditable) != false) { - if (doc4.caretPositionFromPoint) { - let pos = doc4.caretPositionFromPoint(x, y); + if (element && ((_a2 = view.docView.nearest(element)) === null || _a2 === void 0 ? void 0 : _a2.isEditable) != false) { + if (doc2.caretPositionFromPoint) { + let pos = doc2.caretPositionFromPoint(x, y); if (pos) ({ offsetNode: node, offset } = pos); - } else if (doc4.caretRangeFromPoint) { - let range = doc4.caretRangeFromPoint(x, y); + } else if (doc2.caretRangeFromPoint) { + let range = doc2.caretRangeFromPoint(x, y); if (range) { ({ startContainer: node, startOffset: offset } = range); if (browser.safari && isSuspiciousCaretResult(node, offset, x)) @@ -5637,8 +5637,8 @@ let line = Math.floor((y - block.top) / view.defaultLineHeight); into += line * view.viewState.heightOracle.lineLength; } - let content3 = view.state.sliceDoc(block.from, block.to); - return block.from + findColumn(content3, into, view.state.tabSize); + let content2 = view.state.sliceDoc(block.from, block.to); + return block.from + findColumn(content2, into, view.state.tabSize); } function isSuspiciousCaretResult(node, offset, x) { let len; @@ -5782,8 +5782,8 @@ this.lastSelectionTime = Date.now(); } ensureHandlers(view) { - let handlers4 = this.customHandlers = view.pluginField(domEventHandlers); - for (let set of handlers4) { + let handlers2 = this.customHandlers = view.pluginField(domEventHandlers); + for (let set of handlers2) { for (let type in set.handlers) if (this.registeredEvents.indexOf(type) < 0 && type != "scroll") { this.registeredEvents.push(type); @@ -5888,9 +5888,9 @@ this.style = style; this.mustSelect = mustSelect; this.lastEvent = startEvent; - let doc4 = view.contentDOM.ownerDocument; - doc4.addEventListener("mousemove", this.move = this.move.bind(this)); - doc4.addEventListener("mouseup", this.up = this.up.bind(this)); + let doc2 = view.contentDOM.ownerDocument; + doc2.addEventListener("mousemove", this.move = this.move.bind(this)); + doc2.addEventListener("mouseup", this.up = this.up.bind(this)); this.extend = startEvent.shiftKey; this.multiple = view.state.facet(EditorState.allowMultipleSelections) && addsSelectionRange(view, startEvent); this.dragMove = dragMovesSelection(view, startEvent); @@ -5915,9 +5915,9 @@ this.destroy(); } destroy() { - let doc4 = this.view.contentDOM.ownerDocument; - doc4.removeEventListener("mousemove", this.move); - doc4.removeEventListener("mouseup", this.up); + let doc2 = this.view.contentDOM.ownerDocument; + doc2.removeEventListener("mousemove", this.move); + doc2.removeEventListener("mouseup", this.up); this.view.inputState.mouseSelection = null; } select(event) { @@ -5996,10 +5996,10 @@ if (line.from == lastLine) return { range }; lastLine = line.from; - let insert4 = state.toText((byLine ? text.line(i++).text : input) + state.lineBreak); + let insert2 = state.toText((byLine ? text.line(i++).text : input) + state.lineBreak); return { - changes: { from: line.from, insert: insert4 }, - range: EditorSelection.cursor(range.from + insert4.length) + changes: { from: line.from, insert: insert2 }, + range: EditorSelection.cursor(range.from + insert2.length) }; }); } else if (byLine) { @@ -6113,7 +6113,7 @@ lastEvent = null; } }, - get(event2, extend4, multiple) { + get(event2, extend2, multiple) { let cur2; if (lastEvent && event2.clientX == lastEvent.clientX && event2.clientY == lastEvent.clientY) cur2 = last; @@ -6124,12 +6124,12 @@ if (!cur2 || !start) return startSel; let range = rangeForClick(view, cur2.pos, cur2.bias, type); - if (start.pos != cur2.pos && !extend4) { + if (start.pos != cur2.pos && !extend2) { let startRange = rangeForClick(view, start.pos, start.bias, type); let from2 = Math.min(startRange.from, range.from), to = Math.max(startRange.to, range.to); range = from2 < range.from ? EditorSelection.range(from2, to) : EditorSelection.range(to, from2); } - if (extend4) + if (extend2) return startSel.replaceRange(startSel.main.extend(range.from, range.to)); else if (multiple) return startSel.addRange(range); @@ -6219,25 +6219,25 @@ }, 50); } function copiedRange(state) { - let content3 = [], ranges = [], linewise = false; + let content2 = [], ranges = [], linewise = false; for (let range of state.selection.ranges) if (!range.empty) { - content3.push(state.sliceDoc(range.from, range.to)); + content2.push(state.sliceDoc(range.from, range.to)); ranges.push(range); } - if (!content3.length) { + if (!content2.length) { let upto = -1; for (let { from: from2 } of state.selection.ranges) { let line = state.doc.lineAt(from2); if (line.number > upto) { - content3.push(line.text); + content2.push(line.text); ranges.push({ from: line.from, to: Math.min(state.doc.length, line.to + 1) }); } upto = line.number; } linewise = true; } - return { text: content3.join(state.lineBreak), ranges, linewise }; + return { text: content2.join(state.lineBreak), ranges, linewise }; } var lastLinewiseCopy = null; handlers.copy = handlers.cut = (view, event) => { @@ -6300,15 +6300,15 @@ view.inputState.lastContextMenu = Date.now(); }; handlers.beforeinput = (view, event) => { - var _a4; + var _a2; let pending; if (browser.chrome && browser.android && (pending = PendingKeys.find((key) => key.inputType == event.inputType))) { view.observer.delayAndroidKey(pending.key, pending.keyCode); if (pending.key == "Backspace" || pending.key == "Delete") { - let startViewHeight = ((_a4 = window.visualViewport) === null || _a4 === void 0 ? void 0 : _a4.height) || 0; + let startViewHeight = ((_a2 = window.visualViewport) === null || _a2 === void 0 ? void 0 : _a2.height) || 0; setTimeout(() => { - var _a5; - if ((((_a5 = window.visualViewport) === null || _a5 === void 0 ? void 0 : _a5.height) || 0) > startViewHeight + 10 && view.hasFocus) { + var _a3; + if ((((_a3 = window.visualViewport) === null || _a3 === void 0 ? void 0 : _a3.height) || 0) > startViewHeight + 10 && view.hasFocus) { view.contentDOM.blur(); view.focus(); } @@ -6340,8 +6340,8 @@ let lines = 1 + Math.max(0, Math.ceil((length - this.lineLength) / (this.lineLength - 5))); return lines * this.lineHeight; } - setDoc(doc4) { - this.doc = doc4; + setDoc(doc2) { + this.doc = doc2; return this; } mustRefreshForStyle(whiteSpace, direction) { @@ -6413,11 +6413,11 @@ return !offset ? this : new BlockInfo(this.from, this.length, this.top + offset, this.height, Array.isArray(this.type) ? this.type.map((b) => b.moveY(offset)) : this.type); } }; - var QueryType = /* @__PURE__ */ function(QueryType5) { - QueryType5[QueryType5["ByPos"] = 0] = "ByPos"; - QueryType5[QueryType5["ByHeight"] = 1] = "ByHeight"; - QueryType5[QueryType5["ByPosNoHeight"] = 2] = "ByPosNoHeight"; - return QueryType5; + var QueryType = /* @__PURE__ */ function(QueryType3) { + QueryType3[QueryType3["ByPos"] = 0] = "ByPos"; + QueryType3[QueryType3["ByHeight"] = 1] = "ByHeight"; + QueryType3[QueryType3["ByPosNoHeight"] = 2] = "ByPosNoHeight"; + return QueryType3; }(QueryType || (QueryType = {})); var Epsilon = 1e-3; var HeightMap = class { @@ -6448,7 +6448,7 @@ decomposeRight(_from, result) { result.push(this); } - applyChanges(decorations4, oldDoc, oracle, changes) { + applyChanges(decorations2, oldDoc, oracle, changes) { let me = this; for (let i = changes.length - 1; i >= 0; i--) { let { fromA, toA, fromB, toB } = changes[i]; @@ -6465,7 +6465,7 @@ } fromB += start.from - fromA; fromA = start.from; - let nodes = NodeBuilder.build(oracle, decorations4, fromB, toB); + let nodes = NodeBuilder.build(oracle, decorations2, fromB, toB); me = me.replace(fromA, toA, nodes); } return me.updateHeight(oracle, 0); @@ -6528,11 +6528,11 @@ blockAt(_height, _doc, top2, offset) { return new BlockInfo(offset, this.length, top2, this.height, this.type); } - lineAt(_value, _type, doc4, top2, offset) { - return this.blockAt(0, doc4, top2, offset); + lineAt(_value, _type, doc2, top2, offset) { + return this.blockAt(0, doc2, top2, offset); } - forEachLine(_from, _to, doc4, top2, offset, f) { - f(this.blockAt(0, doc4, top2, offset)); + forEachLine(_from, _to, doc2, top2, offset, f) { + f(this.blockAt(0, doc2, top2, offset)); } updateHeight(oracle, offset = 0, _force = false, measured) { if (measured && measured.from <= offset && measured.more) @@ -6580,31 +6580,31 @@ constructor(length) { super(length, 0); } - lines(doc4, offset) { - let firstLine = doc4.lineAt(offset).number, lastLine = doc4.lineAt(offset + this.length).number; + lines(doc2, offset) { + let firstLine = doc2.lineAt(offset).number, lastLine = doc2.lineAt(offset + this.length).number; return { firstLine, lastLine, lineHeight: this.height / (lastLine - firstLine + 1) }; } - blockAt(height, doc4, top2, offset) { - let { firstLine, lastLine, lineHeight } = this.lines(doc4, offset); + blockAt(height, doc2, top2, offset) { + let { firstLine, lastLine, lineHeight } = this.lines(doc2, offset); let line = Math.max(0, Math.min(lastLine - firstLine, Math.floor((height - top2) / lineHeight))); - let { from: from2, length } = doc4.line(firstLine + line); + let { from: from2, length } = doc2.line(firstLine + line); return new BlockInfo(from2, length, top2 + lineHeight * line, lineHeight, BlockType.Text); } - lineAt(value, type, doc4, top2, offset) { + lineAt(value, type, doc2, top2, offset) { if (type == QueryType.ByHeight) - return this.blockAt(value, doc4, top2, offset); + return this.blockAt(value, doc2, top2, offset); if (type == QueryType.ByPosNoHeight) { - let { from: from3, to } = doc4.lineAt(value); + let { from: from3, to } = doc2.lineAt(value); return new BlockInfo(from3, to - from3, 0, 0, BlockType.Text); } - let { firstLine, lineHeight } = this.lines(doc4, offset); - let { from: from2, length, number: number3 } = doc4.lineAt(value); - return new BlockInfo(from2, length, top2 + lineHeight * (number3 - firstLine), lineHeight, BlockType.Text); + let { firstLine, lineHeight } = this.lines(doc2, offset); + let { from: from2, length, number: number2 } = doc2.lineAt(value); + return new BlockInfo(from2, length, top2 + lineHeight * (number2 - firstLine), lineHeight, BlockType.Text); } - forEachLine(from2, to, doc4, top2, offset, f) { - let { firstLine, lineHeight } = this.lines(doc4, offset); + forEachLine(from2, to, doc2, top2, offset, f) { + let { firstLine, lineHeight } = this.lines(doc2, offset); for (let pos = Math.max(from2, offset), end = Math.min(offset + this.length, to); pos <= end; ) { - let line = doc4.lineAt(pos); + let line = doc2.lineAt(pos); if (pos == from2) top2 += lineHeight * (line.number - firstLine); f(new BlockInfo(line.from, line.length, top2, lineHeight, BlockType.Text)); @@ -6682,37 +6682,37 @@ get break() { return this.flags & 1; } - blockAt(height, doc4, top2, offset) { + blockAt(height, doc2, top2, offset) { let mid = top2 + this.left.height; - return height < mid ? this.left.blockAt(height, doc4, top2, offset) : this.right.blockAt(height, doc4, mid, offset + this.left.length + this.break); + return height < mid ? this.left.blockAt(height, doc2, top2, offset) : this.right.blockAt(height, doc2, mid, offset + this.left.length + this.break); } - lineAt(value, type, doc4, top2, offset) { + lineAt(value, type, doc2, top2, offset) { let rightTop = top2 + this.left.height, rightOffset = offset + this.left.length + this.break; let left = type == QueryType.ByHeight ? value < rightTop : value < rightOffset; - let base2 = left ? this.left.lineAt(value, type, doc4, top2, offset) : this.right.lineAt(value, type, doc4, rightTop, rightOffset); + let base2 = left ? this.left.lineAt(value, type, doc2, top2, offset) : this.right.lineAt(value, type, doc2, rightTop, rightOffset); if (this.break || (left ? base2.to < rightOffset : base2.from > rightOffset)) return base2; let subQuery = type == QueryType.ByPosNoHeight ? QueryType.ByPosNoHeight : QueryType.ByPos; if (left) - return base2.join(this.right.lineAt(rightOffset, subQuery, doc4, rightTop, rightOffset)); + return base2.join(this.right.lineAt(rightOffset, subQuery, doc2, rightTop, rightOffset)); else - return this.left.lineAt(rightOffset, subQuery, doc4, top2, offset).join(base2); + return this.left.lineAt(rightOffset, subQuery, doc2, top2, offset).join(base2); } - forEachLine(from2, to, doc4, top2, offset, f) { + forEachLine(from2, to, doc2, top2, offset, f) { let rightTop = top2 + this.left.height, rightOffset = offset + this.left.length + this.break; if (this.break) { if (from2 < rightOffset) - this.left.forEachLine(from2, to, doc4, top2, offset, f); + this.left.forEachLine(from2, to, doc2, top2, offset, f); if (to >= rightOffset) - this.right.forEachLine(from2, to, doc4, rightTop, rightOffset, f); + this.right.forEachLine(from2, to, doc2, rightTop, rightOffset, f); } else { - let mid = this.lineAt(rightOffset, QueryType.ByPos, doc4, top2, offset); + let mid = this.lineAt(rightOffset, QueryType.ByPos, doc2, top2, offset); if (from2 < mid.from) - this.left.forEachLine(from2, mid.from - 1, doc4, top2, offset, f); + this.left.forEachLine(from2, mid.from - 1, doc2, top2, offset, f); if (mid.to >= from2 && mid.from <= to) f(mid); if (to > mid.to) - this.right.forEachLine(mid.to + 1, to, doc4, rightTop, rightOffset, f); + this.right.forEachLine(mid.to + 1, to, doc2, rightTop, rightOffset, f); } } replace(from2, to, nodes) { @@ -6902,9 +6902,9 @@ } return this.nodes; } - static build(oracle, decorations4, from2, to) { + static build(oracle, decorations2, from2, to) { let builder = new NodeBuilder(from2, oracle); - RangeSet.spans(decorations4, from2, to, builder, 0); + RangeSet.spans(decorations2, from2, to, builder, 0); return builder.finish(from2); } }; @@ -7161,20 +7161,20 @@ } getViewport(bias, scrollTarget) { let marginTop = 0.5 - Math.max(-0.5, Math.min(0.5, bias / 1e3 / 2)); - let map = this.heightMap, doc4 = this.state.doc, { visibleTop, visibleBottom } = this; - let viewport = new Viewport(map.lineAt(visibleTop - marginTop * 1e3, QueryType.ByHeight, doc4, 0, 0).from, map.lineAt(visibleBottom + (1 - marginTop) * 1e3, QueryType.ByHeight, doc4, 0, 0).to); + let map = this.heightMap, doc2 = this.state.doc, { visibleTop, visibleBottom } = this; + let viewport = new Viewport(map.lineAt(visibleTop - marginTop * 1e3, QueryType.ByHeight, doc2, 0, 0).from, map.lineAt(visibleBottom + (1 - marginTop) * 1e3, QueryType.ByHeight, doc2, 0, 0).to); if (scrollTarget) { let { head } = scrollTarget.range; if (head < viewport.from || head > viewport.to) { let viewHeight = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top); - let block = map.lineAt(head, QueryType.ByPos, doc4, 0, 0), topPos; + let block = map.lineAt(head, QueryType.ByPos, doc2, 0, 0), topPos; if (scrollTarget.y == "center") topPos = (block.top + block.bottom) / 2 - viewHeight / 2; else if (scrollTarget.y == "start" || scrollTarget.y == "nearest" && head < viewport.from) topPos = block.top; else topPos = block.bottom - viewHeight; - viewport = new Viewport(map.lineAt(topPos - 1e3 / 2, QueryType.ByHeight, doc4, 0, 0).from, map.lineAt(topPos + viewHeight + 1e3 / 2, QueryType.ByHeight, doc4, 0, 0).to); + viewport = new Viewport(map.lineAt(topPos - 1e3 / 2, QueryType.ByHeight, doc2, 0, 0).from, map.lineAt(topPos + viewHeight + 1e3 / 2, QueryType.ByHeight, doc2, 0, 0).to); } } return viewport; @@ -7363,11 +7363,11 @@ scale: 1 }; var BigScaler = class { - constructor(doc4, heightMap, viewports) { + constructor(doc2, heightMap, viewports) { let vpHeight = 0, base2 = 0, domBase = 0; this.viewports = viewports.map(({ from: from2, to }) => { - let top2 = heightMap.lineAt(from2, QueryType.ByPos, doc4, 0, 0).top; - let bottom = heightMap.lineAt(to, QueryType.ByPos, doc4, 0, 0).bottom; + let top2 = heightMap.lineAt(from2, QueryType.ByPos, doc2, 0, 0).top; + let bottom = heightMap.lineAt(to, QueryType.ByPos, doc2, 0, 0).bottom; vpHeight += bottom - top2; return { from: from2, to, top: top2, bottom, domTop: 0, domBottom: 0 }; }); @@ -7850,9 +7850,9 @@ } } destroy() { - var _a4, _b, _c; + var _a2, _b, _c; this.stop(); - (_a4 = this.intersection) === null || _a4 === void 0 ? void 0 : _a4.disconnect(); + (_a2 = this.intersection) === null || _a2 === void 0 ? void 0 : _a2.disconnect(); (_b = this.gapIntersection) === null || _b === void 0 ? void 0 : _b.disconnect(); (_c = this.resize) === null || _c === void 0 ? void 0 : _c.disconnect(); for (let dom of this.scrollTargets) @@ -7991,13 +7991,13 @@ } view.dispatch(tr, { scrollIntoView: true, userEvent }); } else if (newSel && !newSel.main.eq(sel)) { - let scrollIntoView5 = false, userEvent = "select"; + let scrollIntoView3 = false, userEvent = "select"; if (view.inputState.lastSelectionTime > Date.now() - 50) { if (view.inputState.lastSelectionOrigin == "select") - scrollIntoView5 = true; + scrollIntoView3 = true; userEvent = view.inputState.lastSelectionOrigin; } - view.dispatch({ selection: newSel, scrollIntoView: scrollIntoView5, userEvent }); + view.dispatch({ selection: newSel, scrollIntoView: scrollIntoView3, userEvent }); } } function findDiff(a, b, preferredPos, preferredSide) { @@ -8473,8 +8473,8 @@ return order; } get hasFocus() { - var _a4; - return (document.hasFocus() || browser.safari && ((_a4 = this.inputState) === null || _a4 === void 0 ? void 0 : _a4.lastContextMenu) > Date.now() - 3e4) && this.root.activeElement == this.contentDOM; + var _a2; + return (document.hasFocus() || browser.safari && ((_a2 = this.inputState) === null || _a2 === void 0 ? void 0 : _a2.lastContextMenu) > Date.now() - 3e4) && this.root.activeElement == this.contentDOM; } focus() { this.observer.ignore(() => { @@ -8496,8 +8496,8 @@ static scrollIntoView(pos, options = {}) { return scrollIntoView.of(new ScrollTarget(typeof pos == "number" ? EditorSelection.cursor(pos) : pos, options.y, options.x, options.yMargin, options.xMargin)); } - static domEventHandlers(handlers4) { - return ViewPlugin.define(() => ({}), { eventHandlers: handlers4 }); + static domEventHandlers(handlers2) { + return ViewPlugin.define(() => ({}), { eventHandlers: handlers2 }); } static theme(spec, options) { let prefix = StyleModule.newName(); @@ -8559,16 +8559,16 @@ return base2; } var currentPlatform = browser.mac ? "mac" : browser.windows ? "win" : browser.linux ? "linux" : "key"; - function normalizeKeyName(name3, platform) { - const parts = name3.split(/-(?!$)/); + function normalizeKeyName(name2, platform) { + const parts = name2.split(/-(?!$)/); let result = parts[parts.length - 1]; if (result == "Space") result = " "; - let alt, ctrl, shift2, meta3; + let alt, ctrl, shift2, meta2; for (let i = 0; i < parts.length - 1; ++i) { const mod = parts[i]; if (/^(cmd|meta|m)$/i.test(mod)) - meta3 = true; + meta2 = true; else if (/^a(lt)?$/i.test(mod)) alt = true; else if (/^(c|ctrl|control)$/i.test(mod)) @@ -8577,7 +8577,7 @@ shift2 = true; else if (/^mod$/i.test(mod)) { if (platform == "mac") - meta3 = true; + meta2 = true; else ctrl = true; } else @@ -8587,22 +8587,22 @@ result = "Alt-" + result; if (ctrl) result = "Ctrl-" + result; - if (meta3) + if (meta2) result = "Meta-" + result; if (shift2) result = "Shift-" + result; return result; } - function modifiers(name3, event, shift2) { + function modifiers(name2, event, shift2) { if (event.altKey) - name3 = "Alt-" + name3; + name2 = "Alt-" + name2; if (event.ctrlKey) - name3 = "Ctrl-" + name3; + name2 = "Ctrl-" + name2; if (event.metaKey) - name3 = "Meta-" + name3; + name2 = "Meta-" + name2; if (shift2 !== false && event.shiftKey) - name3 = "Shift-" + name3; - return name3; + name2 = "Shift-" + name2; + return name2; } var handleKeyEvents = /* @__PURE__ */ EditorView.domEventHandlers({ keydown(event, view) { @@ -8626,12 +8626,12 @@ function buildKeymap(bindings, platform = currentPlatform) { let bound = /* @__PURE__ */ Object.create(null); let isPrefix = /* @__PURE__ */ Object.create(null); - let checkPrefix = (name3, is) => { - let current = isPrefix[name3]; + let checkPrefix = (name2, is) => { + let current = isPrefix[name2]; if (current == null) - isPrefix[name3] = is; + isPrefix[name2] = is; else if (current != is) - throw new Error("Key binding " + name3 + " is used both as a regular binding and as a multi-stroke prefix"); + throw new Error("Key binding " + name2 + " is used both as a regular binding and as a multi-stroke prefix"); }; let add2 = (scope, key, command2, preventDefault) => { let scopeObj = bound[scope] || (bound[scope] = /* @__PURE__ */ Object.create(null)); @@ -8660,19 +8660,19 @@ binding.preventDefault = true; }; for (let b of bindings) { - let name3 = b[platform] || b.key; - if (!name3) + let name2 = b[platform] || b.key; + if (!name2) continue; for (let scope of b.scope ? b.scope.split(" ") : ["editor"]) { - add2(scope, name3, b.run, b.preventDefault); + add2(scope, name2, b.run, b.preventDefault); if (b.shift) - add2(scope, "Shift-" + name3, b.shift, b.preventDefault); + add2(scope, "Shift-" + name2, b.shift, b.preventDefault); } } return bound; } function runHandlers(map, event, view, scope) { - let name3 = keyName(event), isChar = name3.length == 1 && name3 != " "; + let name2 = keyName(event), isChar = name2.length == 1 && name2 != " "; let prefix = "", fallthrough = false; if (storedPrefix && storedPrefix.view == view && storedPrefix.scope == scope) { prefix = storedPrefix.prefix + " "; @@ -8691,13 +8691,13 @@ }; let scopeObj = map[scope], baseName; if (scopeObj) { - if (runFor(scopeObj[prefix + modifiers(name3, event, !isChar)])) + if (runFor(scopeObj[prefix + modifiers(name2, event, !isChar)])) return true; - if (isChar && (event.shiftKey || event.altKey || event.metaKey) && (baseName = base[event.keyCode]) && baseName != name3) { + if (isChar && (event.shiftKey || event.altKey || event.metaKey) && (baseName = base[event.keyCode]) && baseName != name2) { if (runFor(scopeObj[prefix + modifiers(baseName, event, true)])) return true; } else if (isChar && event.shiftKey) { - if (runFor(scopeObj[prefix + modifiers(name3, event, true)])) + if (runFor(scopeObj[prefix + modifiers(name2, event, true)])) return true; } } @@ -8826,11 +8826,11 @@ let left = view.textDirection == Direction.LTR ? rect.left : rect.right - view.scrollDOM.clientWidth; return { left: left - view.scrollDOM.scrollLeft, top: rect.top - view.scrollDOM.scrollTop }; } - function wrappedLine(view, pos, inside4) { + function wrappedLine(view, pos, inside2) { let range = EditorSelection.cursor(pos); return { - from: Math.max(inside4.from, view.moveToLineBoundary(range, false, true).from), - to: Math.min(inside4.to, view.moveToLineBoundary(range, true, true).from), + from: Math.max(inside2.from, view.moveToLineBoundary(range, false, true).from), + to: Math.min(inside2.to, view.moveToLineBoundary(range, true, true).from), type: BlockType.Text }; } @@ -8848,8 +8848,8 @@ return []; let from2 = Math.max(range.from, view.viewport.from), to = Math.min(range.to, view.viewport.to); let ltr = view.textDirection == Direction.LTR; - let content3 = view.contentDOM, contentRect = content3.getBoundingClientRect(), base2 = getBase(view); - let lineStyle = window.getComputedStyle(content3.firstChild); + let content2 = view.contentDOM, contentRect = content2.getBoundingClientRect(), base2 = getBase(view); + let lineStyle = window.getComputedStyle(content2.firstChild); let leftSide = contentRect.left + parseInt(lineStyle.paddingLeft) + Math.min(0, parseInt(lineStyle.textIndent)); let rightSide = contentRect.right - parseInt(lineStyle.paddingRight); let startBlock = blockAt(view, from2), endBlock = blockAt(view, to); @@ -8949,11 +8949,11 @@ this.measureReq = { read: this.readPos.bind(this), write: this.drawCursor.bind(this) }; } update(update) { - var _a4; + var _a2; let cursorPos = update.state.field(dropCursorPos); if (cursorPos == null) { if (this.cursor != null) { - (_a4 = this.cursor) === null || _a4 === void 0 ? void 0 : _a4.remove(); + (_a2 = this.cursor) === null || _a2 === void 0 ? void 0 : _a2.remove(); this.cursor = null; } } else { @@ -9016,9 +9016,9 @@ function dropCursor() { return [dropCursorPos, drawDropCursor]; } - function iterMatches(doc4, re, from2, to, f) { + function iterMatches(doc2, re, from2, to, f) { re.lastIndex = 0; - for (let cursor = doc4.iterRange(from2, to), pos = from2, m; !cursor.next().done; pos += cursor.value.length) { + for (let cursor = doc2.iterRange(from2, to), pos = from2, m; !cursor.next().done; pos += cursor.value.length) { if (!cursor.lineBreak) while (m = re.exec(cursor.value)) f(pos + m.index, pos + m.index + m[0].length, m); @@ -9128,10 +9128,10 @@ }; var _supportsTabSize = null; function supportsTabSize() { - var _a4; + var _a2; if (_supportsTabSize == null && typeof document != "undefined" && document.body) { let styles = document.body.style; - _supportsTabSize = ((_a4 = styles.tabSize) !== null && _a4 !== void 0 ? _a4 : styles.MozTabSize) != null; + _supportsTabSize = ((_a2 = styles.tabSize) !== null && _a2 !== void 0 ? _a2 : styles.MozTabSize) != null; } return _supportsTabSize || false; } @@ -9166,10 +9166,10 @@ return new MatchDecorator({ regexp: conf.specialChars, decoration: (m, view, pos) => { - let { doc: doc4 } = view.state; + let { doc: doc2 } = view.state; let code = codePointAt(m[0], 0); if (code == 9) { - let line = doc4.lineAt(pos); + let line = doc2.lineAt(pos); let size = view.state.tabSize, col = countColumn(line.text, size, pos - line.from); return Decoration.replace({ widget: new TabWidget((size - col % size) * this.view.defaultCharacterWidth) }); } @@ -9374,9 +9374,9 @@ return new HistEvent(this.changes, this.effects, this.mapped, this.startSelection, after); } toJSON() { - var _a4, _b, _c; + var _a2, _b, _c; return { - changes: (_a4 = this.changes) === null || _a4 === void 0 ? void 0 : _a4.toJSON(), + changes: (_a2 = this.changes) === null || _a2 === void 0 ? void 0 : _a2.toJSON(), mapped: (_b = this.mapped) === null || _b === void 0 ? void 0 : _b.toJSON(), startSelection: (_c = this.startSelection) === null || _c === void 0 ? void 0 : _c.toJSON(), selectionsAfter: this.selectionsAfter.map((s) => s.toJSON()) @@ -9408,11 +9408,11 @@ } function isAdjacent(a, b) { let ranges = [], isAdjacent2 = false; - a.iterChangedRanges((f, t3) => ranges.push(f, t3)); - b.iterChangedRanges((_f, _t, f, t3) => { + a.iterChangedRanges((f, t2) => ranges.push(f, t2)); + b.iterChangedRanges((_f, _t, f, t2) => { for (let i = 0; i < ranges.length; ) { let from2 = ranges[i++], to = ranges[i++]; - if (t3 >= from2 && f <= to) + if (t2 >= from2 && f <= to) isAdjacent2 = true; } }); @@ -9572,18 +9572,18 @@ NodeProp.lookAhead = new NodeProp({ perNode: true }); NodeProp.mounted = new NodeProp({ perNode: true }); var MountedTree = class { - constructor(tree, overlay, parser7) { + constructor(tree, overlay, parser6) { this.tree = tree; this.overlay = overlay; - this.parser = parser7; + this.parser = parser6; } }; var noProps = /* @__PURE__ */ Object.create(null); var NodeType = class { - constructor(name3, props, id3, flags = 0) { - this.name = name3; + constructor(name2, props, id2, flags = 0) { + this.name = name2; this.props = props; - this.id = id3; + this.id = id2; this.flags = flags; } static define(spec) { @@ -9617,20 +9617,20 @@ get isAnonymous() { return (this.flags & 8) > 0; } - is(name3) { - if (typeof name3 == "string") { - if (this.name == name3) + is(name2) { + if (typeof name2 == "string") { + if (this.name == name2) return true; let group = this.prop(NodeProp.group); - return group ? group.indexOf(name3) > -1 : false; + return group ? group.indexOf(name2) > -1 : false; } - return this.id == name3; + return this.id == name2; } static match(map) { let direct = /* @__PURE__ */ Object.create(null); for (let prop in map) - for (let name3 of prop.split(" ")) - direct[name3] = map[prop]; + for (let name2 of prop.split(" ")) + direct[name2] = map[prop]; return (node) => { for (let groups = node.prop(NodeProp.group), i = -1; i < (groups ? groups.length : 0); i++) { let found = direct[i < 0 ? node.name : groups[i]]; @@ -9642,10 +9642,10 @@ }; NodeType.none = new NodeType("", /* @__PURE__ */ Object.create(null), 0, 8); var NodeSet = class { - constructor(types4) { - this.types = types4; - for (let i = 0; i < types4.length; i++) - if (types4[i].id != i) + constructor(types2) { + this.types = types2; + for (let i = 0; i < types2.length; i++) + if (types2[i].id != i) throw new RangeError("Node type ids should correspond to array positions when creating a node set"); } extend(...props) { @@ -9748,8 +9748,8 @@ get propValues() { let result = []; if (this.props) - for (let id3 in this.props) - result.push([+id3, this.props[id3]]); + for (let id2 in this.props) + result.push([+id2, this.props[id2]]); return result; } balance(config2 = {}) { @@ -9805,8 +9805,8 @@ return result.join(","); } childString(index) { - let id3 = this.buffer[index], endIndex = this.buffer[index + 3]; - let type = this.set.types[id3], result = type.name; + let id2 = this.buffer[index], endIndex = this.buffer[index + 3]; + let type = this.set.types[id2], result = type.name; if (/\W/.test(result) && !type.isError) result = JSON.stringify(result); index += 4; @@ -9874,7 +9874,7 @@ return node; } function resolveNode(node, pos, side, overlays) { - var _a4; + var _a2; while (node.from == node.to || (side < 1 ? node.from >= pos : node.from > pos) || (side > -1 ? node.to <= pos : node.to < pos)) { let parent = !overlays && node instanceof TreeNode && node.index < 0 ? null : node.parent; if (!parent) @@ -9883,7 +9883,7 @@ } if (overlays) for (let scan = node, parent = scan.parent; parent; scan = parent, parent = scan.parent) { - if (scan instanceof TreeNode && scan.index < 0 && ((_a4 = parent.enter(pos, side, true)) === null || _a4 === void 0 ? void 0 : _a4.from) != scan.from) + if (scan instanceof TreeNode && scan.index < 0 && ((_a2 = parent.enter(pos, side, true)) === null || _a2 === void 0 ? void 0 : _a2.from) != scan.from) node = parent; } for (; ; ) { @@ -10320,32 +10320,32 @@ return tree.children.some((ch) => ch instanceof TreeBuffer || !ch.type.isAnonymous || hasChild(ch)); } function buildTree(data) { - var _a4; + var _a2; let { buffer, nodeSet, maxBufferLength = DefaultBufferLength, reused = [], minRepeatType = nodeSet.types.length } = data; let cursor = Array.isArray(buffer) ? new FlatBufferCursor(buffer, buffer.length) : buffer; - let types4 = nodeSet.types; + let types2 = nodeSet.types; let contextHash = 0, lookAhead = 0; function takeNode(parentStart, minPos, children2, positions2, inRepeat) { - let { id: id3, start, end, size } = cursor; + let { id: id2, start, end, size } = cursor; let lookAheadAtStart = lookAhead; while (size < 0) { cursor.next(); if (size == -1) { - let node2 = reused[id3]; + let node2 = reused[id2]; children2.push(node2); positions2.push(start - parentStart); return; } else if (size == -3) { - contextHash = id3; + contextHash = id2; return; } else if (size == -4) { - lookAhead = id3; + lookAhead = id2; return; } else { throw new RangeError(`Unrecognized record size: ${size}`); } } - let type = types4[id3], node, buffer2; + let type = types2[id2], node, buffer2; let startPos = start - parentStart; if (end - start <= maxBufferLength && (buffer2 = findBufferSize(cursor.pos - minPos, inRepeat))) { let data2 = new Uint16Array(buffer2.size - buffer2.skip); @@ -10358,7 +10358,7 @@ let endPos = cursor.pos - size; cursor.next(); let localChildren = [], localPositions = []; - let localInRepeat = id3 >= minRepeatType ? id3 : -1; + let localInRepeat = id2 >= minRepeatType ? id2 : -1; let lastGroup = 0, lastEnd = end; while (cursor.pos > endPos) { if (localInRepeat >= 0 && cursor.id == localInRepeat && cursor.size >= 0) { @@ -10409,12 +10409,12 @@ } function makeTree(type, children2, positions2, length2, lookAhead2 = 0, props) { if (contextHash) { - let pair4 = [NodeProp.contextHash, contextHash]; - props = props ? [pair4].concat(props) : [pair4]; + let pair2 = [NodeProp.contextHash, contextHash]; + props = props ? [pair2].concat(props) : [pair2]; } if (lookAhead2 > 25) { - let pair4 = [NodeProp.lookAhead, lookAhead2]; - props = props ? [pair4].concat(props) : [pair4]; + let pair2 = [NodeProp.lookAhead, lookAhead2]; + props = props ? [pair2].concat(props) : [pair2]; } return new Tree(type, children2, positions2, length2, props); } @@ -10424,8 +10424,8 @@ let result = { size: 0, start: 0, skip: 0 }; scan: for (let minPos = fork.pos - maxSize; fork.pos > minPos; ) { - let nodeSize7 = fork.size; - if (fork.id == inRepeat && nodeSize7 >= 0) { + let nodeSize2 = fork.size; + if (fork.id == inRepeat && nodeSize2 >= 0) { result.size = size; result.start = start; result.skip = skip; @@ -10434,8 +10434,8 @@ fork.next(); continue; } - let startPos = fork.pos - nodeSize7; - if (nodeSize7 < 0 || startPos < minPos || fork.start < minStart) + let startPos = fork.pos - nodeSize2; + if (nodeSize2 < 0 || startPos < minPos || fork.start < minStart) break; let localSkipped = fork.id >= minRepeatType ? 4 : 0; let nodeStart2 = fork.start; @@ -10452,7 +10452,7 @@ fork.next(); } start = nodeStart2; - size += nodeSize7; + size += nodeSize2; skip += localSkipped; } if (inRepeat < 0 || size == maxSize) { @@ -10463,9 +10463,9 @@ return result.size > 4 ? result : void 0; } function copyToBuffer(bufferStart, buffer2, index) { - let { id: id3, start, end, size } = cursor; + let { id: id2, start, end, size } = cursor; cursor.next(); - if (size >= 0 && id3 < minRepeatType) { + if (size >= 0 && id2 < minRepeatType) { let startIndex = index; if (size > 4) { let endPos = cursor.pos - (size - 4); @@ -10475,19 +10475,19 @@ buffer2[--index] = startIndex; buffer2[--index] = end - bufferStart; buffer2[--index] = start - bufferStart; - buffer2[--index] = id3; + buffer2[--index] = id2; } else if (size == -3) { - contextHash = id3; + contextHash = id2; } else if (size == -4) { - lookAhead = id3; + lookAhead = id2; } return index; } let children = [], positions = []; while (cursor.pos > 0) takeNode(data.start || 0, data.bufferStart || 0, children, positions, -1); - let length = (_a4 = data.length) !== null && _a4 !== void 0 ? _a4 : children.length ? positions[0] + children[0].length : 0; - return new Tree(types4[data.topID], children.reverse(), positions.reverse(), length); + let length = (_a2 = data.length) !== null && _a2 !== void 0 ? _a2 : children.length ? positions[0] + children[0].length : 0; + return new Tree(types2[data.topID], children.reverse(), positions.reverse(), length); } var nodeSizeCache = /* @__PURE__ */ new WeakMap(); function nodeSize(balanceType, node) { @@ -10607,8 +10607,8 @@ } }; var StringInput = class { - constructor(string3) { - this.string = string3; + constructor(string2) { + this.string = string2; } get length() { return this.string.length; @@ -10627,8 +10627,8 @@ return (parse, input, fragments, ranges) => new MixedParse(parse, nest, input, fragments, ranges); } var InnerParse = class { - constructor(parser7, parse, overlay, target, ranges) { - this.parser = parser7; + constructor(parser6, parse, overlay, target, ranges) { + this.parser = parser6; this.parse = parse; this.overlay = overlay; this.target = target; @@ -10636,8 +10636,8 @@ } }; var ActiveOverlay = class { - constructor(parser7, predicate, mounts, index, start, target, prev) { - this.parser = parser7; + constructor(parser6, predicate, mounts, index, start, target, prev) { + this.parser = parser6; this.predicate = predicate; this.mounts = mounts; this.index = index; @@ -10850,13 +10850,13 @@ }; var FragmentCursor = class { constructor(fragments) { - var _a4; + var _a2; this.fragments = fragments; this.curTo = 0; this.fragI = 0; if (fragments.length) { let first = this.curFrag = fragments[0]; - this.curTo = (_a4 = first.tree.prop(stoppedInner)) !== null && _a4 !== void 0 ? _a4 : first.to; + this.curTo = (_a2 = first.tree.prop(stoppedInner)) !== null && _a2 !== void 0 ? _a2 : first.to; this.inner = new StructureCursor(first.tree, -first.offset); } else { this.curFrag = this.inner = null; @@ -10868,24 +10868,24 @@ return this.curFrag && this.curFrag.from <= node.from && this.curTo >= node.to && this.inner.hasNode(node); } nextFrag() { - var _a4; + var _a2; this.fragI++; if (this.fragI == this.fragments.length) { this.curFrag = this.inner = null; } else { let frag = this.curFrag = this.fragments[this.fragI]; - this.curTo = (_a4 = frag.tree.prop(stoppedInner)) !== null && _a4 !== void 0 ? _a4 : frag.to; + this.curTo = (_a2 = frag.tree.prop(stoppedInner)) !== null && _a2 !== void 0 ? _a2 : frag.to; this.inner = new StructureCursor(frag.tree, -frag.offset); } } - findMounts(pos, parser7) { - var _a4; + findMounts(pos, parser6) { + var _a2; let result = []; if (this.inner) { this.inner.cursor.moveTo(pos, 1); for (let pos2 = this.inner.cursor.node; pos2; pos2 = pos2.parent) { - let mount = (_a4 = pos2.tree) === null || _a4 === void 0 ? void 0 : _a4.prop(NodeProp.mounted); - if (mount && mount.parser == parser7) { + let mount = (_a2 = pos2.tree) === null || _a2 === void 0 ? void 0 : _a2.prop(NodeProp.mounted); + if (mount && mount.parser == parser6) { for (let i = this.fragI; i < this.fragments.length; i++) { let frag = this.fragments[i]; if (frag.from >= pos2.to) @@ -10993,14 +10993,14 @@ }); } var Language = class { - constructor(data, parser7, topNode, extraExtensions = []) { + constructor(data, parser6, topNode, extraExtensions = []) { this.data = data; this.topNode = topNode; if (!EditorState.prototype.hasOwnProperty("tree")) Object.defineProperty(EditorState.prototype, "tree", { get() { return syntaxTree(this); } }); - this.parser = parser7; + this.parser = parser6; this.extension = [ language.of(this), EditorState.languageData.of((state, pos, side) => state.facet(languageDataFacetAt(state, pos, side))) @@ -11063,9 +11063,9 @@ return facet; } var LRLanguage = class extends Language { - constructor(data, parser7) { - super(data, parser7, parser7.topNode); - this.parser = parser7; + constructor(data, parser6) { + super(data, parser6, parser6.topNode); + this.parser = parser6; } static define(spec) { let data = defineLanguageFacet(spec.languageData); @@ -11085,12 +11085,12 @@ return field ? field.tree : Tree.empty; } var DocInput = class { - constructor(doc4, length = doc4.length) { - this.doc = doc4; + constructor(doc2, length = doc2.length) { + this.doc = doc2; this.length = length; this.cursorPos = 0; this.string = ""; - this.cursor = doc4.iter(); + this.cursor = doc2.iter(); } syncTo(pos) { this.string = this.cursor.next(pos - this.cursorPos).value; @@ -11114,8 +11114,8 @@ }; var currentContext = null; var ParseContext = class { - constructor(parser7, state, fragments = [], tree, treeLen, viewport, skipped, scheduleOn) { - this.parser = parser7; + constructor(parser6, state, fragments = [], tree, treeLen, viewport, skipped, scheduleOn) { + this.parser = parser6; this.state = state; this.fragments = fragments; this.tree = tree; @@ -11137,7 +11137,7 @@ return true; } return this.withContext(() => { - var _a4; + var _a2; if (typeof until == "number") { let endTime = Date.now() + until; until = () => Date.now() > endTime; @@ -11150,7 +11150,7 @@ let done = this.parse.advance(); if (done) { this.fragments = this.withoutTempSkipped(TreeFragment.addTree(done, this.fragments, this.parse.stoppedAt != null)); - this.treeLen = (_a4 = this.parse.stoppedAt) !== null && _a4 !== void 0 ? _a4 : this.state.doc.length; + this.treeLen = (_a2 = this.parse.stoppedAt) !== null && _a2 !== void 0 ? _a2 : this.state.doc.length; this.tree = done; this.parse = null; if (this.treeLen < (upto !== null && upto !== void 0 ? upto : this.state.doc.length)) @@ -11243,7 +11243,7 @@ return new class extends Parser { createParse(input, fragments, ranges) { let from2 = ranges[0].from, to = ranges[ranges.length - 1].to; - let parser7 = { + let parser6 = { parsedPos: from2, advance() { let cx = currentContext; @@ -11260,7 +11260,7 @@ stopAt() { } }; - return parser7; + return parser6; } }(); } @@ -11401,10 +11401,10 @@ enables: [Language.state, parseWorker] }); var LanguageSupport = class { - constructor(language4, support = []) { - this.language = language4; + constructor(language2, support = []) { + this.language = language2; this.support = support; - this.extension = [language4, support]; + this.extension = [language2, support]; } }; var indentService = /* @__PURE__ */ Facet.define(); @@ -11576,8 +11576,8 @@ return (context) => delimitedStrategy(context, align, units, closing2); } function delimitedStrategy(context, align, units, closing2, closedAt) { - let after = context.textAfter, space4 = after.match(/^\s*/)[0].length; - let closed = closing2 && after.slice(space4, space4 + closing2.length) == closing2 || closedAt == context.pos + space4; + let after = context.textAfter, space3 = after.match(/^\s*/)[0].length; + let closed = closing2 && after.slice(space3, space3 + closing2.length) == closing2 || closedAt == context.pos + space3; let aligned = align ? bracketedAligned(context) : null; if (aligned) return closed ? context.column(aligned.from) : context.column(aligned.to); @@ -11598,10 +11598,10 @@ let rules = tr.startState.languageDataAt("indentOnInput", tr.startState.selection.main.head); if (!rules.length) return tr; - let doc4 = tr.newDoc, { head } = tr.newSelection.main, line = doc4.lineAt(head); + let doc2 = tr.newDoc, { head } = tr.newSelection.main, line = doc2.lineAt(head); if (head > line.from + DontIndentBeyond) return tr; - let lineStart = doc4.sliceString(line.from, head); + let lineStart = doc2.sliceString(line.from, head); if (!rules.some((r) => r.test(lineStart))) return tr; let { state } = tr, last = -1, changes = []; @@ -11754,8 +11754,8 @@ this.dom.setAttribute("aria-hidden", "true"); this.dom.style.minHeight = this.view.contentHeight + "px"; this.gutters = view.state.facet(activeGutters).map((conf) => new SingleGutterView(view, conf)); - for (let gutter4 of this.gutters) - this.dom.appendChild(gutter4.dom); + for (let gutter2 of this.gutters) + this.dom.appendChild(gutter2.dom); this.fixed = !view.state.facet(unfixGutters); if (this.fixed) { this.dom.style.position = "sticky"; @@ -11783,7 +11783,7 @@ this.dom.remove(); let lineClasses = RangeSet.iter(this.view.state.facet(gutterLineClass), this.view.viewport.from); let classSet = []; - let contexts = this.gutters.map((gutter4) => new UpdateContext(gutter4, this.view.viewport, -this.view.documentPadding.top)); + let contexts = this.gutters.map((gutter2) => new UpdateContext(gutter2, this.view.viewport, -this.view.documentPadding.top)); for (let line of this.view.viewportLineBlocks) { let text; if (Array.isArray(line.type)) { @@ -11812,8 +11812,8 @@ let prev = update.startState.facet(activeGutters), cur2 = update.state.facet(activeGutters); let change = update.docChanged || update.heightChanged || update.viewportChanged || !RangeSet.eq(update.startState.facet(gutterLineClass), update.state.facet(gutterLineClass), update.view.viewport.from, update.view.viewport.to); if (prev == cur2) { - for (let gutter4 of this.gutters) - if (gutter4.update(update)) + for (let gutter2 of this.gutters) + if (gutter2.update(update)) change = true; } else { change = true; @@ -11861,12 +11861,12 @@ } } var UpdateContext = class { - constructor(gutter4, viewport, height) { - this.gutter = gutter4; + constructor(gutter2, viewport, height) { + this.gutter = gutter2; this.height = height; this.localMarkers = []; this.i = 0; - this.cursor = RangeSet.iter(gutter4.markers, viewport.from); + this.cursor = RangeSet.iter(gutter2.markers, viewport.from); } line(view, line, extraMarkers) { if (this.localMarkers.length) @@ -11876,25 +11876,25 @@ let forLine = this.gutter.config.lineMarker(view, line, localMarkers); if (forLine) localMarkers.unshift(forLine); - let gutter4 = this.gutter; - if (localMarkers.length == 0 && !gutter4.config.renderEmptyElements) + let gutter2 = this.gutter; + if (localMarkers.length == 0 && !gutter2.config.renderEmptyElements) return; let above = line.top - this.height; - if (this.i == gutter4.elements.length) { + if (this.i == gutter2.elements.length) { let newElt = new GutterElement(view, line.height, above, localMarkers); - gutter4.elements.push(newElt); - gutter4.dom.appendChild(newElt.dom); + gutter2.elements.push(newElt); + gutter2.dom.appendChild(newElt.dom); } else { - gutter4.elements[this.i].update(view, line.height, above, localMarkers); + gutter2.elements[this.i].update(view, line.height, above, localMarkers); } this.height = line.bottom; this.i++; } finish() { - let gutter4 = this.gutter; - while (gutter4.elements.length > this.i) { - let last = gutter4.elements.pop(); - gutter4.dom.removeChild(last.dom); + let gutter2 = this.gutter; + while (gutter2.elements.length > this.i) { + let last = gutter2.elements.pop(); + gutter2.dom.removeChild(last.dom); last.destroy(); } } @@ -12021,9 +12021,9 @@ } }); var NumberMarker = class extends GutterMarker { - constructor(number3) { + constructor(number2) { super(); - this.number = number3; + this.number = number2; } eq(other) { return this.number == other.number; @@ -12032,8 +12032,8 @@ return document.createTextNode(this.number); } }; - function formatNumber(view, number3) { - return view.state.facet(lineNumberConfig).formatNumber(number3, view.state); + function formatNumber(view, number2) { + return view.state.facet(lineNumberConfig).formatNumber(number2, view.state); } var lineNumberGutter = /* @__PURE__ */ activeGutters.compute([lineNumberConfig], (state) => ({ class: "cm-lineNumbers", @@ -12141,9 +12141,9 @@ provide: (f) => EditorView.decorations.from(f) }); function foldInside2(state, from2, to) { - var _a4; + var _a2; let found = null; - (_a4 = state.field(foldState, false)) === null || _a4 === void 0 ? void 0 : _a4.between(from2, to, (from3, to2) => { + (_a2 = state.field(foldState, false)) === null || _a2 === void 0 ? void 0 : _a2.between(from2, to, (from3, to2) => { if (!found || found.from > from3) found = { from: from3, to: to2 }; }); @@ -12304,8 +12304,8 @@ gutter({ class: "cm-foldGutter", markers(view) { - var _a4; - return ((_a4 = view.plugin(markers)) === null || _a4 === void 0 ? void 0 : _a4.markers) || RangeSet.empty; + var _a2; + return ((_a2 = view.plugin(markers)) === null || _a2 === void 0 ? void 0 : _a2.markers) || RangeSet.empty; }, initialSpacer() { return new FoldMarker(fullConfig, false); @@ -12370,7 +12370,7 @@ update(deco, tr) { if (!tr.docChanged && !tr.selection) return deco; - let decorations4 = []; + let decorations2 = []; let config2 = tr.state.facet(bracketMatchingConfig); for (let range of tr.state.selection.ranges) { if (!range.empty) @@ -12379,11 +12379,11 @@ if (!match2) continue; let mark = match2.matched ? matchingMark : nonmatchingMark; - decorations4.push(mark.range(match2.start.from, match2.start.to)); + decorations2.push(mark.range(match2.start.from, match2.start.to)); if (match2.end) - decorations4.push(mark.range(match2.end.from, match2.end.to)); + decorations2.push(mark.range(match2.end.from, match2.end.to)); } - return Decoration.set(decorations4, true); + return Decoration.set(decorations2, true); }, provide: (f) => EditorView.decorations.from(f) }); @@ -12440,8 +12440,8 @@ } function matchPlainBrackets(state, pos, dir, tree, tokenType, maxScanDistance, brackets) { let startCh = dir < 0 ? state.sliceDoc(pos - 1, pos) : state.sliceDoc(pos, pos + 1); - let bracket3 = brackets.indexOf(startCh); - if (bracket3 < 0 || bracket3 % 2 == 0 != dir > 0) + let bracket2 = brackets.indexOf(startCh); + if (bracket2 < 0 || bracket2 % 2 == 0 != dir > 0) return null; let startToken = { from: dir < 0 ? pos - 1 : pos, to: dir > 0 ? pos + 1 : pos }; let iter = state.doc.iterRange(pos, dir > 0 ? state.doc.length : 0), depth = 0; @@ -12457,7 +12457,7 @@ if (found % 2 == 0 == dir > 0) { depth++; } else if (depth == 1) { - return { start: startToken, end: { from: basePos + pos2, to: basePos + pos2 + 1 }, matched: found >> 1 == bracket3 >> 1 }; + return { start: startToken, end: { from: basePos + pos2, to: basePos + pos2 + 1 }, matched: found >> 1 == bracket2 >> 1 }; } else { depth--; } @@ -12513,8 +12513,8 @@ else at = forward ? next.to : next.from; } - let bracket3 = pos.type.prop(bracketProp), match2, newPos; - if (bracket3 && (match2 = forward ? matchBrackets(state, pos.from, 1) : matchBrackets(state, pos.to, -1)) && match2.matched) + let bracket2 = pos.type.prop(bracketProp), match2, newPos; + if (bracket2 && (match2 = forward ? matchBrackets(state, pos.from, 1) : matchBrackets(state, pos.to, -1)) && match2.matched) newPos = forward ? match2.end.to : match2.end.from; else newPos = forward ? pos.to : pos.from; @@ -12552,9 +12552,9 @@ if (moved.head == start.head && moved.head != (forward ? line.to : line.from)) moved = view.moveToLineBoundary(start, forward, false); if (!forward && moved.head == line.from && line.length) { - let space4 = /^\s*/.exec(view.state.sliceDoc(line.from, Math.min(line.from + 100, line.to)))[0].length; - if (space4 && start.head != line.from + space4) - moved = EditorSelection.cursor(line.from + space4); + let space3 = /^\s*/.exec(view.state.sliceDoc(line.from, Math.min(line.from + 100, line.to)))[0].length; + if (space3 && start.head != line.from + space3) + moved = EditorSelection.cursor(line.from + space3); } return moved; } @@ -12562,14 +12562,14 @@ var cursorLineBoundaryBackward = (view) => moveSel(view, (range) => moveByLineBoundary(view, range, false)); var cursorLineStart = (view) => moveSel(view, (range) => EditorSelection.cursor(view.lineBlockAt(range.head).from, 1)); var cursorLineEnd = (view) => moveSel(view, (range) => EditorSelection.cursor(view.lineBlockAt(range.head).to, -1)); - function toMatchingBracket(state, dispatch, extend4) { + function toMatchingBracket(state, dispatch, extend2) { let found = false, selection = updateSel(state.selection, (range) => { let matching = matchBrackets(state, range.head, -1) || matchBrackets(state, range.head, 1) || range.head > 0 && matchBrackets(state, range.head - 1, 1) || range.head < state.doc.length && matchBrackets(state, range.head + 1, -1); if (!matching || !matching.end) return range; found = true; let head = matching.start.from == range.head ? matching.end.to : matching.end.from; - return extend4 ? EditorSelection.range(range.anchor, head) : EditorSelection.cursor(head); + return extend2 ? EditorSelection.range(range.anchor, head) : EditorSelection.cursor(head); }); if (!found) return false; @@ -12640,9 +12640,9 @@ }; var selectParentSyntax = ({ state, dispatch }) => { let selection = updateSel(state.selection, (range) => { - var _a4; + var _a2; let context = syntaxTree(state).resolveInner(range.head, 1); - while (!(context.from < range.from && context.to >= range.to || context.to > range.to && context.from <= range.from || !((_a4 = context.parent) === null || _a4 === void 0 ? void 0 : _a4.parent))) + while (!(context.from < range.from && context.to >= range.to || context.to > range.to && context.from <= range.from || !((_a2 = context.parent) === null || _a2 === void 0 ? void 0 : _a2.parent))) context = context.parent; return EditorSelection.range(context.to, context.from); }); @@ -12877,12 +12877,12 @@ ({ from: from2, to } = explode); else if (from2 > line.from && from2 < line.from + 100 && !/\S/.test(line.text.slice(0, from2))) from2 = line.from; - let insert4 = ["", indentString(state, indent)]; + let insert2 = ["", indentString(state, indent)]; if (explode) - insert4.push(indentString(state, cx.lineIndent(line.from, -1))); + insert2.push(indentString(state, cx.lineIndent(line.from, -1))); return { - changes: { from: from2, to, insert: Text.of(insert4) }, - range: EditorSelection.cursor(from2 + 1 + insert4[1].length) + changes: { from: from2, to, insert: Text.of(insert2) }, + range: EditorSelection.cursor(from2 + 1 + insert2[1].length) }; }); dispatch(state.update(changes, { scrollIntoView: true, userEvent: "input" })); @@ -12945,14 +12945,14 @@ if (state.readOnly) return false; dispatch(state.update(changeBySelectedLine(state, (line, changes) => { - let space4 = /^\s*/.exec(line.text)[0]; - if (!space4) + let space3 = /^\s*/.exec(line.text)[0]; + if (!space3) return; - let col = countColumn(space4, state.tabSize), keep = 0; - let insert4 = indentString(state, Math.max(0, col - getIndentUnit(state))); - while (keep < space4.length && keep < insert4.length && space4.charCodeAt(keep) == insert4.charCodeAt(keep)) + let col = countColumn(space3, state.tabSize), keep = 0; + let insert2 = indentString(state, Math.max(0, col - getIndentUnit(state))); + while (keep < space3.length && keep < insert2.length && space3.charCodeAt(keep) == insert2.charCodeAt(keep)) keep++; - changes.push({ from: line.from + keep, to: line.from + space4.length, insert: insert4.slice(keep) }); + changes.push({ from: line.from + keep, to: line.from + space3.length, insert: insert2.slice(keep) }); }), { userEvent: "delete.dedent" })); return true; }; @@ -13073,13 +13073,13 @@ return state.languageDataAt("closeBrackets", pos)[0] || defaults2; } var android = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent); - var inputHandler2 = /* @__PURE__ */ EditorView.inputHandler.of((view, from2, to, insert4) => { + var inputHandler2 = /* @__PURE__ */ EditorView.inputHandler.of((view, from2, to, insert2) => { if ((android ? view.composing : view.compositionStarted) || view.state.readOnly) return false; let sel = view.state.selection.main; - if (insert4.length > 2 || insert4.length == 2 && codePointSize(codePointAt(insert4, 0)) == 1 || from2 != sel.from || to != sel.to) + if (insert2.length > 2 || insert2.length == 2 && codePointSize(codePointAt(insert2, 0)) == 1 || from2 != sel.from || to != sel.to) return false; - let tr = insertBracket(view.state, insert4); + let tr = insertBracket(view.state, insert2); if (!tr) return false; view.dispatch(tr); @@ -13111,14 +13111,14 @@ var closeBracketsKeymap = [ { key: "Backspace", run: deleteBracketPair } ]; - function insertBracket(state, bracket3) { + function insertBracket(state, bracket2) { let conf = config(state, state.selection.main.head); let tokens = conf.brackets || defaults2.brackets; for (let tok of tokens) { let closed = closing(codePointAt(tok, 0)); - if (bracket3 == tok) + if (bracket2 == tok) return closed == tok ? handleSame(state, tok, tokens.indexOf(tok + tok + tok) > -1) : handleOpen(state, tok, closed, conf.before || defaults2.before); - if (bracket3 == closed && closedBracketAt(state, state.selection.main.from)) + if (bracket2 == closed && closedBracketAt(state, state.selection.main.from)) return handleClose(state, tok, closed); } return null; @@ -13131,12 +13131,12 @@ }); return found; } - function nextChar(doc4, pos) { - let next = doc4.sliceString(pos, pos + 2); + function nextChar(doc2, pos) { + let next = doc2.sliceString(pos, pos + 2); return next.slice(0, codePointSize(codePointAt(next, 0))); } - function prevChar(doc4, pos) { - let prev = doc4.sliceString(pos - 2, pos); + function prevChar(doc2, pos) { + let prev = doc2.sliceString(pos - 2, pos); return codePointSize(codePointAt(prev, 0)) == prev.length ? prev : prev.slice(1); } function handleOpen(state, open, close, closeBefore) { @@ -13415,13 +13415,13 @@ elt = document.createElement(elt); var i = 1, next = arguments[1]; if (next && typeof next == "object" && next.nodeType == null && !Array.isArray(next)) { - for (var name3 in next) - if (Object.prototype.hasOwnProperty.call(next, name3)) { - var value = next[name3]; + for (var name2 in next) + if (Object.prototype.hasOwnProperty.call(next, name2)) { + var value = next[name2]; if (typeof value == "string") - elt.setAttribute(name3, value); + elt.setAttribute(name2, value); else if (value != null) - elt[name3] = value; + elt[name2] = value; } i++; } @@ -13595,23 +13595,23 @@ get to() { return this.from + this.text.length; } - static get(doc4, from2, to) { - let cached = flattened.get(doc4); + static get(doc2, from2, to) { + let cached = flattened.get(doc2); if (!cached || cached.from >= to || cached.to <= from2) { - let flat = new FlattenedDoc(from2, doc4.sliceString(from2, to)); - flattened.set(doc4, flat); + let flat = new FlattenedDoc(from2, doc2.sliceString(from2, to)); + flattened.set(doc2, flat); return flat; } if (cached.from == from2 && cached.to == to) return cached; let { text, from: cachedFrom } = cached; if (cachedFrom > from2) { - text = doc4.sliceString(from2, cachedFrom) + text; + text = doc2.sliceString(from2, cachedFrom) + text; cachedFrom = from2; } if (cached.to < to) - text += doc4.sliceString(cached.to, to); - flattened.set(doc4, new FlattenedDoc(cachedFrom, text)); + text += doc2.sliceString(cached.to, to); + flattened.set(doc2, new FlattenedDoc(cachedFrom, text)); return new FlattenedDoc(from2, text.slice(from2 - cachedFrom, to - cachedFrom)); } }; @@ -13662,7 +13662,7 @@ try { new RegExp(source, baseFlags); return true; - } catch (_a4) { + } catch (_a2) { return false; } } @@ -13881,11 +13881,11 @@ }; var searchConfigFacet = /* @__PURE__ */ Facet.define({ combine(configs) { - var _a4; + var _a2; return { top: configs.reduce((val, conf) => val !== null && val !== void 0 ? val : conf.top, void 0) || false, caseSensitive: configs.reduce((val, conf) => val !== null && val !== void 0 ? val : conf.caseSensitive || conf.matchCase, void 0) || false, - createPanel: ((_a4 = configs.find((c) => c.createPanel)) === null || _a4 === void 0 ? void 0 : _a4.createPanel) || ((view) => new SearchPanel(view)) + createPanel: ((_a2 = configs.find((c) => c.createPanel)) === null || _a2 === void 0 ? void 0 : _a2.createPanel) || ((view) => new SearchPanel(view)) }; } }); @@ -13904,8 +13904,8 @@ create() { return this.regexp ? new RegExpQuery(this) : new StringQuery(this); } - getCursor(doc4, from2 = 0, to = doc4.length) { - return this.regexp ? regexpCursor(this, doc4, from2, to) : stringCursor(this, doc4, from2, to); + getCursor(doc2, from2 = 0, to = doc2.length) { + return this.regexp ? regexpCursor(this, doc2, from2, to) : stringCursor(this, doc2, from2, to); } }; var QueryType2 = class { @@ -13913,23 +13913,23 @@ this.spec = spec; } }; - function stringCursor(spec, doc4, from2, to) { - return new SearchCursor(doc4, spec.unquoted, from2, to, spec.caseSensitive ? void 0 : (x) => x.toLowerCase()); + function stringCursor(spec, doc2, from2, to) { + return new SearchCursor(doc2, spec.unquoted, from2, to, spec.caseSensitive ? void 0 : (x) => x.toLowerCase()); } var StringQuery = class extends QueryType2 { constructor(spec) { super(spec); } - nextMatch(doc4, curFrom, curTo) { - let cursor = stringCursor(this.spec, doc4, curTo, doc4.length).nextOverlapping(); + nextMatch(doc2, curFrom, curTo) { + let cursor = stringCursor(this.spec, doc2, curTo, doc2.length).nextOverlapping(); if (cursor.done) - cursor = stringCursor(this.spec, doc4, 0, curFrom).nextOverlapping(); + cursor = stringCursor(this.spec, doc2, 0, curFrom).nextOverlapping(); return cursor.done ? null : cursor.value; } - prevMatchInRange(doc4, from2, to) { + prevMatchInRange(doc2, from2, to) { for (let pos = to; ; ) { let start = Math.max(from2, pos - 1e4 - this.spec.unquoted.length); - let cursor = stringCursor(this.spec, doc4, start, pos), range = null; + let cursor = stringCursor(this.spec, doc2, start, pos), range = null; while (!cursor.nextOverlapping().done) range = cursor.value; if (range) @@ -13939,14 +13939,14 @@ pos -= 1e4; } } - prevMatch(doc4, curFrom, curTo) { - return this.prevMatchInRange(doc4, 0, curFrom) || this.prevMatchInRange(doc4, curTo, doc4.length); + prevMatch(doc2, curFrom, curTo) { + return this.prevMatchInRange(doc2, 0, curFrom) || this.prevMatchInRange(doc2, curTo, doc2.length); } getReplacement(_result) { return this.spec.replace; } - matchAll(doc4, limit) { - let cursor = stringCursor(this.spec, doc4, 0, doc4.length), ranges = []; + matchAll(doc2, limit) { + let cursor = stringCursor(this.spec, doc2, 0, doc2.length), ranges = []; while (!cursor.next().done) { if (ranges.length >= limit) return null; @@ -13954,26 +13954,26 @@ } return ranges; } - highlight(doc4, from2, to, add2) { - let cursor = stringCursor(this.spec, doc4, Math.max(0, from2 - this.spec.unquoted.length), Math.min(to + this.spec.unquoted.length, doc4.length)); + highlight(doc2, from2, to, add2) { + let cursor = stringCursor(this.spec, doc2, Math.max(0, from2 - this.spec.unquoted.length), Math.min(to + this.spec.unquoted.length, doc2.length)); while (!cursor.next().done) add2(cursor.value.from, cursor.value.to); } }; - function regexpCursor(spec, doc4, from2, to) { - return new RegExpCursor(doc4, spec.search, spec.caseSensitive ? void 0 : { ignoreCase: true }, from2, to); + function regexpCursor(spec, doc2, from2, to) { + return new RegExpCursor(doc2, spec.search, spec.caseSensitive ? void 0 : { ignoreCase: true }, from2, to); } var RegExpQuery = class extends QueryType2 { - nextMatch(doc4, curFrom, curTo) { - let cursor = regexpCursor(this.spec, doc4, curTo, doc4.length).next(); + nextMatch(doc2, curFrom, curTo) { + let cursor = regexpCursor(this.spec, doc2, curTo, doc2.length).next(); if (cursor.done) - cursor = regexpCursor(this.spec, doc4, 0, curFrom).next(); + cursor = regexpCursor(this.spec, doc2, 0, curFrom).next(); return cursor.done ? null : cursor.value; } - prevMatchInRange(doc4, from2, to) { + prevMatchInRange(doc2, from2, to) { for (let size = 1; ; size++) { let start = Math.max(from2, to - size * 1e4); - let cursor = regexpCursor(this.spec, doc4, start, to), range = null; + let cursor = regexpCursor(this.spec, doc2, start, to), range = null; while (!cursor.next().done) range = cursor.value; if (range && (start == from2 || range.from > start + 10)) @@ -13982,14 +13982,14 @@ return null; } } - prevMatch(doc4, curFrom, curTo) { - return this.prevMatchInRange(doc4, 0, curFrom) || this.prevMatchInRange(doc4, curTo, doc4.length); + prevMatch(doc2, curFrom, curTo) { + return this.prevMatchInRange(doc2, 0, curFrom) || this.prevMatchInRange(doc2, curTo, doc2.length); } getReplacement(result) { return this.spec.replace.replace(/\$([$&\d+])/g, (m, i) => i == "$" ? "$" : i == "&" ? result.match[0] : i != "0" && +i < result.match.length ? result.match[i] : m); } - matchAll(doc4, limit) { - let cursor = regexpCursor(this.spec, doc4, 0, doc4.length), ranges = []; + matchAll(doc2, limit) { + let cursor = regexpCursor(this.spec, doc2, 0, doc2.length), ranges = []; while (!cursor.next().done) { if (ranges.length >= limit) return null; @@ -13997,8 +13997,8 @@ } return ranges; } - highlight(doc4, from2, to, add2) { - let cursor = regexpCursor(this.spec, doc4, Math.max(0, from2 - 250), Math.min(to + 250, doc4.length)); + highlight(doc2, from2, to, add2) { + let cursor = regexpCursor(this.spec, doc2, Math.max(0, from2 - 250), Math.min(to + 250, doc2.length)); while (!cursor.next().done) add2(cursor.value.from, cursor.value.to); } @@ -14163,10 +14163,10 @@ return view.state.facet(searchConfigFacet).createPanel(view); } function defaultQuery(state, fallback) { - var _a4; + var _a2; let sel = state.selection.main; let selText = sel.empty || sel.to > sel.from + 100 ? "" : state.sliceDoc(sel.from, sel.to); - let caseSensitive = (_a4 = fallback === null || fallback === void 0 ? void 0 : fallback.caseSensitive) !== null && _a4 !== void 0 ? _a4 : state.facet(searchConfigFacet).caseSensitive; + let caseSensitive = (_a2 = fallback === null || fallback === void 0 ? void 0 : fallback.caseSensitive) !== null && _a2 !== void 0 ? _a2 : state.facet(searchConfigFacet).caseSensitive; return fallback && !selText ? fallback : new SearchQuery({ search: selText.replace(/\n/g, "\\n"), caseSensitive }); } var openSearchPanel = (view) => { @@ -14245,8 +14245,8 @@ checked: query.regexp, onchange: this.commit }); - function button(name3, onclick, content3) { - return crelt("button", { class: "cm-button", name: name3, onclick, type: "button" }, content3); + function button(name2, onclick, content2) { + return crelt("button", { class: "cm-button", name: name2, onclick, type: "button" }, content2); } this.dom = crelt("div", { onkeydown: (e) => this.keydown(e), class: "cm-search" }, [ this.searchField, @@ -14385,16 +14385,16 @@ this.facet = facet; this.createTooltipView = createTooltipView; this.input = view.state.facet(facet); - this.tooltips = this.input.filter((t3) => t3); + this.tooltips = this.input.filter((t2) => t2); this.tooltipViews = this.tooltips.map(createTooltipView); } update(update) { let input = update.state.facet(this.facet); let tooltips = input.filter((x) => x); if (input === this.input) { - for (let t3 of this.tooltipViews) - if (t3.update) - t3.update(update); + for (let t2 of this.tooltipViews) + if (t2.update) + t2.update(update); return false; } let tooltipViews = []; @@ -14415,9 +14415,9 @@ tooltipView.update(update); } } - for (let t3 of this.tooltipViews) - if (tooltipViews.indexOf(t3) < 0) - t3.dom.remove(); + for (let t2 of this.tooltipViews) + if (tooltipViews.indexOf(t2) < 0) + t2.dom.remove(); this.input = input; this.tooltips = tooltips; this.tooltipViews = tooltipViews; @@ -14429,9 +14429,9 @@ } var tooltipConfig = /* @__PURE__ */ Facet.define({ combine: (values2) => { - var _a4, _b, _c; + var _a2, _b, _c; return { - position: ios2 ? "absolute" : ((_a4 = values2.find((conf) => conf.position)) === null || _a4 === void 0 ? void 0 : _a4.position) || "fixed", + position: ios2 ? "absolute" : ((_a2 = values2.find((conf) => conf.position)) === null || _a2 === void 0 ? void 0 : _a2.position) || "fixed", parent: ((_b = values2.find((conf) => conf.parent)) === null || _b === void 0 ? void 0 : _b.parent) || null, tooltipSpace: ((_c = values2.find((conf) => conf.tooltipSpace)) === null || _c === void 0 ? void 0 : _c.tooltipSpace) || windowSpace }; @@ -14439,7 +14439,7 @@ }); var tooltipPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class { constructor(view) { - var _a4; + var _a2; this.view = view; this.inView = true; this.lastTransaction = 0; @@ -14450,13 +14450,13 @@ this.classes = view.themeClasses; this.createContainer(); this.measureReq = { read: this.readMeasure.bind(this), write: this.writeMeasure.bind(this), key: this }; - this.manager = new TooltipViewManager(view, showTooltip, (t3) => this.createTooltip(t3)); + this.manager = new TooltipViewManager(view, showTooltip, (t2) => this.createTooltip(t2)); this.intersectionObserver = typeof IntersectionObserver == "function" ? new IntersectionObserver((entries) => { if (Date.now() > this.lastTransaction - 50 && entries.length > 0 && entries[entries.length - 1].intersectionRatio < 1) this.measureSoon(); }, { threshold: [1] }) : null; this.observeIntersection(); - (_a4 = view.dom.ownerDocument.defaultView) === null || _a4 === void 0 ? void 0 : _a4.addEventListener("resize", this.measureSoon = this.measureSoon.bind(this)); + (_a2 = view.dom.ownerDocument.defaultView) === null || _a2 === void 0 ? void 0 : _a2.addEventListener("resize", this.measureSoon = this.measureSoon.bind(this)); this.maybeMeasure(); } createContainer() { @@ -14493,8 +14493,8 @@ let newConfig = update.state.facet(tooltipConfig); if (newConfig.position != this.position) { this.position = newConfig.position; - for (let t3 of this.manager.tooltipViews) - t3.dom.style.position = this.position; + for (let t2 of this.manager.tooltipViews) + t2.dom.style.position = this.position; shouldMeasure = true; } if (newConfig.parent != this.parent) { @@ -14502,8 +14502,8 @@ this.container.remove(); this.parent = newConfig.parent; this.createContainer(); - for (let t3 of this.manager.tooltipViews) - this.container.appendChild(t3.dom); + for (let t2 of this.manager.tooltipViews) + this.container.appendChild(t2.dom); shouldMeasure = true; } else if (this.parent && this.view.themeClasses != this.classes) { this.classes = this.container.className = this.view.themeClasses; @@ -14527,8 +14527,8 @@ return tooltipView; } destroy() { - var _a4, _b; - (_a4 = this.view.dom.ownerDocument.defaultView) === null || _a4 === void 0 ? void 0 : _a4.removeEventListener("resize", this.measureSoon); + var _a2, _b; + (_a2 = this.view.dom.ownerDocument.defaultView) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener("resize", this.measureSoon); for (let { dom } of this.manager.tooltipViews) dom.remove(); (_b = this.intersectionObserver) === null || _b === void 0 ? void 0 : _b.disconnect(); @@ -14539,21 +14539,21 @@ return { editor, parent: this.parent ? this.container.getBoundingClientRect() : editor, - pos: this.manager.tooltips.map((t3, i) => { + pos: this.manager.tooltips.map((t2, i) => { let tv = this.manager.tooltipViews[i]; - return tv.getCoords ? tv.getCoords(t3.pos) : this.view.coordsAtPos(t3.pos); + return tv.getCoords ? tv.getCoords(t2.pos) : this.view.coordsAtPos(t2.pos); }), size: this.manager.tooltipViews.map(({ dom }) => dom.getBoundingClientRect()), space: this.view.state.facet(tooltipConfig).tooltipSpace(this.view) }; } writeMeasure(measured) { - let { editor, space: space4 } = measured; + let { editor, space: space3 } = measured; let others = []; for (let i = 0; i < this.manager.tooltips.length; i++) { let tooltip = this.manager.tooltips[i], tView = this.manager.tooltipViews[i], { dom } = tView; let pos = measured.pos[i], size = measured.size[i]; - if (!pos || pos.bottom <= Math.max(editor.top, space4.top) || pos.top >= Math.min(editor.bottom, space4.bottom) || pos.right < Math.max(editor.left, space4.left) - 0.1 || pos.left > Math.min(editor.right, space4.right) + 0.1) { + if (!pos || pos.bottom <= Math.max(editor.top, space3.top) || pos.top >= Math.min(editor.bottom, space3.bottom) || pos.right < Math.max(editor.left, space3.left) - 0.1 || pos.left > Math.min(editor.right, space3.right) + 0.1) { dom.style.top = Outside; continue; } @@ -14561,9 +14561,9 @@ let arrowHeight = arrow ? 7 : 0; let width = size.right - size.left, height = size.bottom - size.top; let offset = tView.offset || noOffset, ltr = this.view.textDirection == Direction.LTR; - let left = size.width > space4.right - space4.left ? ltr ? space4.left : space4.right - size.width : ltr ? Math.min(pos.left - (arrow ? 14 : 0) + offset.x, space4.right - width) : Math.max(space4.left, pos.left - width + (arrow ? 14 : 0) - offset.x); + let left = size.width > space3.right - space3.left ? ltr ? space3.left : space3.right - size.width : ltr ? Math.min(pos.left - (arrow ? 14 : 0) + offset.x, space3.right - width) : Math.max(space3.left, pos.left - width + (arrow ? 14 : 0) - offset.x); let above = !!tooltip.above; - if (!tooltip.strictSide && (above ? pos.top - (size.bottom - size.top) - offset.y < space4.top : pos.bottom + (size.bottom - size.top) + offset.y > space4.bottom) && above == space4.bottom - pos.bottom > pos.top - space4.top) + if (!tooltip.strictSide && (above ? pos.top - (size.bottom - size.top) - offset.y < space3.top : pos.bottom + (size.bottom - size.top) + offset.y > space3.bottom) && above == space3.bottom - pos.bottom > pos.top - space3.top) above = !above; let top2 = above ? pos.top - height - arrowHeight - offset.y : pos.bottom + arrowHeight + offset.y; let right = left + width; @@ -14680,7 +14680,7 @@ this.mounted = false; this.dom = document.createElement("div"); this.dom.classList.add("cm-tooltip-hover"); - this.manager = new TooltipViewManager(view, showHoverTooltip, (t3) => this.createHostedView(t3)); + this.manager = new TooltipViewManager(view, showHoverTooltip, (t2) => this.createHostedView(t2)); } static create(view) { return new HoverTooltipHost(view); @@ -14711,15 +14711,15 @@ } }; var showHoverTooltipHost = /* @__PURE__ */ showTooltip.compute([showHoverTooltip], (state) => { - let tooltips = state.facet(showHoverTooltip).filter((t3) => t3); + let tooltips = state.facet(showHoverTooltip).filter((t2) => t2); if (tooltips.length === 0) return null; return { - pos: Math.min(...tooltips.map((t3) => t3.pos)), - end: Math.max(...tooltips.filter((t3) => t3.end != null).map((t3) => t3.end)), + pos: Math.min(...tooltips.map((t2) => t2.pos)), + end: Math.max(...tooltips.filter((t2) => t2.end != null).map((t2) => t2.end)), create: HoverTooltipHost.create, above: tooltips[0].above, - arrow: tooltips.some((t3) => t3.arrow) + arrow: tooltips.some((t2) => t2.arrow) }; }); var HoverPlugin = class { @@ -14758,7 +14758,7 @@ this.startHover(); } startHover() { - var _a4; + var _a2; clearTimeout(this.restartTimeout); let { lastMove } = this; let pos = this.view.contentDOM.contains(lastMove.target) ? this.view.posAtCoords(lastMove) : null; @@ -14770,7 +14770,7 @@ let bidi = this.view.bidiSpans(this.view.state.doc.lineAt(pos)).find((s) => s.from <= pos && s.to >= pos); let rtl = bidi && bidi.dir == Direction.RTL ? -1 : 1; let open = this.source(this.view, pos, lastMove.x < posCoords.left ? -rtl : rtl); - if ((_a4 = open) === null || _a4 === void 0 ? void 0 : _a4.then) { + if ((_a2 = open) === null || _a2 === void 0 ? void 0 : _a2.then) { let pending = this.pending = { pos }; open.then((result) => { if (this.pending == pending) { @@ -14784,13 +14784,13 @@ } } mousemove(event) { - var _a4; + var _a2; this.lastMove = { x: event.clientX, y: event.clientY, target: event.target, time: Date.now() }; if (this.hoverTimeout < 0) this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime); let tooltip = this.active; if (tooltip && !isInTooltip(this.lastMove.target) || this.pending) { - let { pos } = tooltip || this.pending, end = (_a4 = tooltip === null || tooltip === void 0 ? void 0 : tooltip.end) !== null && _a4 !== void 0 ? _a4 : pos; + let { pos } = tooltip || this.pending, end = (_a2 = tooltip === null || tooltip === void 0 ? void 0 : tooltip.end) !== null && _a2 !== void 0 ? _a2 : pos; if (pos == end ? this.view.posAtCoords(this.lastMove) != pos : !isOverRange(this.view, pos, end, event.clientX, event.clientY, 6)) { this.view.dispatch({ effects: this.setHover.of(null) }); this.pending = null; @@ -14882,9 +14882,9 @@ this.explicit = explicit; this.abortListeners = []; } - tokenBefore(types4) { + tokenBefore(types2) { let token = syntaxTree(this.state).resolveInner(this.pos, -1); - while (token && types4.indexOf(token.name) < 0) + while (token && types2.indexOf(token.name) < 0) token = token.parent; return token ? { from: token.from, @@ -14952,12 +14952,12 @@ return state.selection.main.head; } function ensureAnchor(expr, start) { - var _a4; + var _a2; let { source } = expr; let addStart = start && source[0] != "^", addEnd = source[source.length - 1] != "$"; if (!addStart && !addEnd) return expr; - return new RegExp(`${addStart ? "^" : ""}(?:${source})${addEnd ? "$" : ""}`, (_a4 = expr.flags) !== null && _a4 !== void 0 ? _a4 : expr.ignoreCase ? "i" : ""); + return new RegExp(`${addStart ? "^" : ""}(?:${source})${addEnd ? "$" : ""}`, (_a2 = expr.flags) !== null && _a2 !== void 0 ? _a2 : expr.ignoreCase ? "i" : ""); } var pickedCompletion = /* @__PURE__ */ Annotation.define(); function applyCompletion(view, option) { @@ -15103,9 +15103,9 @@ return a ? b ? a + " " + b : a : b; } function optionContent(config2) { - let content3 = config2.addToOptions.slice(); + let content2 = config2.addToOptions.slice(); if (config2.icons) - content3.push({ + content2.push({ render(completion) { let icon = document.createElement("div"); icon.classList.add("cm-completionIcon"); @@ -15116,7 +15116,7 @@ }, position: 20 }); - content3.push({ + content2.push({ render(completion, _s, match2) { let labelElt = document.createElement("span"); labelElt.className = "cm-completionLabel"; @@ -15146,7 +15146,7 @@ }, position: 80 }); - return content3.sort((a, b) => a.position - b.position).map((a) => a.render); + return content2.sort((a, b) => a.position - b.position).map((a) => a.render); } function rangeAroundSelected(total, selected, max) { if (total <= max) @@ -15235,10 +15235,10 @@ } } } - addInfoPane(content3) { + addInfoPane(content2) { let dom = this.info = document.createElement("div"); dom.className = "cm-tooltip cm-completionInfo"; - dom.appendChild(content3); + dom.appendChild(content2); this.dom.appendChild(dom); this.view.requestMeasure(this.placeInfo); } @@ -15286,15 +15286,15 @@ } } } - createListBox(options, id3, range) { + createListBox(options, id2, range) { const ul = document.createElement("ul"); - ul.id = id3; + ul.id = id2; ul.setAttribute("role", "listbox"); ul.setAttribute("aria-expanded", "true"); for (let i = range.from; i < range.to; i++) { let { completion, match: match2 } = options[i]; const li = ul.appendChild(document.createElement("li")); - li.id = id3 + "-" + i; + li.id = id2 + "-" + i; li.setAttribute("role", "option"); let cls = this.optionClass(completion); if (cls) @@ -15364,10 +15364,10 @@ this.timestamp = timestamp; this.selected = selected; } - setSelected(selected, id3) { - return selected == this.selected || selected >= this.options.length ? this : new CompletionDialog(this.options, makeAttrs(id3, selected), this.tooltip, this.timestamp, selected); + setSelected(selected, id2) { + return selected == this.selected || selected >= this.options.length ? this : new CompletionDialog(this.options, makeAttrs(id2, selected), this.tooltip, this.timestamp, selected); } - static build(active, state, id3, prev, conf) { + static build(active, state, id2, prev, conf) { let options = sortOptions(active, state); if (!options.length) return null; @@ -15380,7 +15380,7 @@ break; } } - return new CompletionDialog(options, makeAttrs(id3, selected), { + return new CompletionDialog(options, makeAttrs(id2, selected), { pos: active.reduce((a, b) => b.hasResult() ? Math.min(a, b.from) : a, 1e8), create: completionTooltip(completionState), above: conf.aboveCursor @@ -15391,9 +15391,9 @@ } }; var CompletionState = class { - constructor(active, id3, open) { + constructor(active, id2, open) { this.active = active; - this.id = id3; + this.id = id2; this.open = open; } static start() { @@ -15441,12 +15441,12 @@ var baseAttrs = { "aria-autocomplete": "list" }; - function makeAttrs(id3, selected) { + function makeAttrs(id2, selected) { return { "aria-autocomplete": "list", "aria-haspopup": "listbox", - "aria-activedescendant": id3 + "-" + selected, - "aria-controls": id3 + "aria-activedescendant": id2 + "-" + selected, + "aria-controls": id2 }; } var none4 = []; @@ -15673,7 +15673,7 @@ this.debounceAccept = setTimeout(() => this.accept(), DebounceTime); } accept() { - var _a4; + var _a2; if (this.debounceAccept > -1) clearTimeout(this.debounceAccept); this.debounceAccept = -1; @@ -15685,7 +15685,7 @@ continue; this.running.splice(i--, 1); if (query.done) { - let active = new ActiveResult(query.active.source, query.active.explicitPos, query.done, query.done.from, (_a4 = query.done.to) !== null && _a4 !== void 0 ? _a4 : cur(query.updates.length ? query.updates[0].startState : this.view.state), query.done.span && query.done.filter !== false ? ensureAnchor(query.done.span, true) : null); + let active = new ActiveResult(query.active.source, query.active.explicitPos, query.done, query.done.from, (_a2 = query.done.to) !== null && _a2 !== void 0 ? _a2 : cur(query.updates.length ? query.updates[0].startState : this.view.state), query.done.span && query.done.filter !== false ? ensureAnchor(query.done.span, true) : null); for (let tr of query.updates) active = active.update(tr, conf); if (active.hasResult()) { @@ -15866,28 +15866,28 @@ let ranges = this.fieldPositions.map((pos2) => new FieldRange(pos2.field, lineStart[pos2.line] + pos2.from, lineStart[pos2.line] + pos2.to)); return { text, ranges }; } - static parse(template3) { + static parse(template2) { let fields = []; let lines = [], positions = [], m; - for (let line of template3.split(/\r\n?|\n/)) { + for (let line of template2.split(/\r\n?|\n/)) { while (m = /[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(line)) { - let seq = m[1] ? +m[1] : null, name3 = m[2] || m[3] || "", found = -1; + let seq = m[1] ? +m[1] : null, name2 = m[2] || m[3] || "", found = -1; for (let i = 0; i < fields.length; i++) { - if (seq != null ? fields[i].seq == seq : name3 ? fields[i].name == name3 : false) + if (seq != null ? fields[i].seq == seq : name2 ? fields[i].name == name2 : false) found = i; } if (found < 0) { let i = 0; while (i < fields.length && (seq == null || fields[i].seq != null && fields[i].seq < seq)) i++; - fields.splice(i, 0, { seq, name: name3 }); + fields.splice(i, 0, { seq, name: name2 }); found = i; for (let pos of positions) if (pos.field >= found) pos.field++; } - positions.push(new FieldPos(found, lines.length, m.index, m.index + name3.length)); - line = line.slice(0, m.index) + name3 + line.slice(m.index + m[0].length); + positions.push(new FieldPos(found, lines.length, m.index, m.index + name2.length)); + line = line.slice(0, m.index) + name2 + line.slice(m.index + m[0].length); } lines.push(line); } @@ -15953,10 +15953,10 @@ function fieldSelection(ranges, field) { return EditorSelection.create(ranges.filter((r) => r.field == field).map((r) => EditorSelection.range(r.from, r.to))); } - function snippet(template3) { - let snippet3 = Snippet.parse(template3); + function snippet(template2) { + let snippet2 = Snippet.parse(template2); return (editor, _completion, from2, to) => { - let { text, ranges } = snippet3.instantiate(editor.state, from2); + let { text, ranges } = snippet2.instantiate(editor.state, from2); let spec = { changes: { from: from2, to, insert: Text.of(text) } }; if (ranges.length) spec.selection = fieldSelection(ranges, 0); @@ -16001,8 +16001,8 @@ } }); var addSnippetKeymap = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ keymap.compute([snippetKeymap], (state) => state.facet(snippetKeymap))); - function snippetCompletion(template3, completion) { - return Object.assign(Object.assign({}, completion), { apply: snippet(template3) }); + function snippetCompletion(template2, completion) { + return Object.assign(Object.assign({}, completion), { apply: snippet(template2) }); } var snippetPointerHandler = /* @__PURE__ */ EditorView.domEventHandlers({ mousedown(event, view) { @@ -16127,9 +16127,9 @@ })) }; } else if (option != 1 && comments.some((c) => c)) { let changes = []; - for (let i = 0, comment3; i < comments.length; i++) - if (comment3 = comments[i]) { - let token = tokens[i], { open, close } = comment3; + for (let i = 0, comment2; i < comments.length; i++) + if (comment2 = comments[i]) { + let token = tokens[i], { open, close } = comment2; changes.push({ from: open.pos - token.open.length, to: open.pos + open.margin }, { from: close.pos - close.margin, to: close.pos + token.close.length }); } return { changes }; @@ -16150,10 +16150,10 @@ continue; let indent = /^\s*/.exec(line.text)[0].length; let empty2 = indent == line.length; - let comment3 = line.text.slice(indent, indent + token.length) == token ? indent : -1; + let comment2 = line.text.slice(indent, indent + token.length) == token ? indent : -1; if (indent < line.text.length && indent < minIndent) minIndent = indent; - lines.push({ line, comment: comment3, token, indent, empty: empty2, single: false }); + lines.push({ line, comment: comment2, token, indent, empty: empty2, single: false }); } pos = line.to + 1; } @@ -16174,9 +16174,9 @@ return { changes: changeSet, selection: state.selection.map(changeSet, 1) }; } else if (option != 1 && lines.some((l) => l.comment >= 0)) { let changes = []; - for (let { line, comment: comment3, token } of lines) - if (comment3 >= 0) { - let from2 = line.from + comment3, to = from2 + token.length; + for (let { line, comment: comment2, token } of lines) + if (comment2 >= 0) { + let from2 = line.from + comment2, to = from2 + token.length; if (line.text[to - line.from] == " ") to++; changes.push({ from: from2, to }); @@ -16286,8 +16286,8 @@ return [ plugin, EditorView.contentAttributes.of((view) => { - var _a4; - return ((_a4 = view.plugin(plugin)) === null || _a4 === void 0 ? void 0 : _a4.isDown) ? showCrosshair : null; + var _a2; + return ((_a2 = view.plugin(plugin)) === null || _a2 === void 0 ? void 0 : _a2.isDown) ? showCrosshair : null; }) ]; } @@ -16307,8 +16307,8 @@ let tag = new Tag([], null, []); tag.set.push(tag); if (parent) - for (let t3 of parent.set) - tag.set.push(t3); + for (let t2 of parent.set) + tag.set.push(t2); return tag; } static defineModifier() { @@ -16329,7 +16329,7 @@ static get(base2, mods) { if (!mods.length) return base2; - let exists = mods[0].instances.find((t3) => t3.base == base2 && sameArray2(mods, t3.modified)); + let exists = mods[0].instances.find((t2) => t2.base == base2 && sameArray2(mods, t2.modified)); if (exists) return exists; let set = [], tag = new Tag(set, base2, mods); @@ -16356,9 +16356,9 @@ function styleTags(spec) { let byName = /* @__PURE__ */ Object.create(null); for (let prop in spec) { - let tags4 = spec[prop]; - if (!Array.isArray(tags4)) - tags4 = [tags4]; + let tags3 = spec[prop]; + if (!Array.isArray(tags3)) + tags3 = [tags3]; for (let part of prop.split(" ")) if (part) { let pieces = [], mode = 2, rest = part; @@ -16386,7 +16386,7 @@ let last = pieces.length - 1, inner = pieces[last]; if (!inner) throw new RangeError("Invalid path: " + part); - let rule = new Rule(tags4, mode, last > 0 ? pieces.slice(0, last) : null); + let rule = new Rule(tags3, mode, last > 0 ? pieces.slice(0, last) : null); byName[inner] = rule.sort(byName[inner]); } } @@ -16407,8 +16407,8 @@ return state.facet(highlightStyle) || state.facet(fallbackHighlightStyle); } var Rule = class { - constructor(tags4, mode, context, next) { - this.tags = tags4; + constructor(tags3, mode, context, next) { + this.tags = tags3; this.mode = mode; this.context = context; this.next = next; @@ -16437,11 +16437,11 @@ this.all = typeof options.all == "string" ? options.all : options.all ? def(options.all) : null; for (let style of spec) { let cls = (style.class || def(Object.assign({}, style, { tag: null }))) + (this.all ? " " + this.all : ""); - let tags4 = style.tag; - if (!Array.isArray(tags4)) - this.map[tags4.id] = cls; + let tags3 = style.tag; + if (!Array.isArray(tags3)) + this.map[tags3.id] = cls; else - for (let tag of tags4) + for (let tag of tags3) this.map[tag.id] = cls; } this.module = modSpec ? new StyleModule(modSpec) : null; @@ -16458,10 +16458,10 @@ match(tag, scope) { if (this.scope && scope != this.scope) return null; - for (let t3 of tag.set) { - let match2 = this.map[t3.id]; + for (let t2 of tag.set) { + let match2 = this.map[t2.id]; if (match2 !== void 0) { - if (t3 != tag) + if (t2 != tag) this.map[tag.id] = match2; return match2; } @@ -16579,12 +16579,12 @@ let mounted = cursor.tree && cursor.tree.prop(NodeProp.mounted); if (mounted && mounted.overlay) { let inner = cursor.node.enter(mounted.overlay[0].from + start, 1); - let hasChild7 = cursor.firstChild(); + let hasChild2 = cursor.firstChild(); for (let i = 0, pos = start; ; i++) { let next = i < mounted.overlay.length ? mounted.overlay[i] : null; let nextPos = next ? next.from + start : end; let rangeFrom = Math.max(from2, pos), rangeTo = Math.min(to, nextPos); - if (rangeFrom < rangeTo && hasChild7) { + if (rangeFrom < rangeTo && hasChild2) { while (cursor.from < rangeTo) { this.highlightRange(cursor, rangeFrom, rangeTo, inheritedClass, depth + 1, scope); this.startSpan(Math.min(to, cursor.to), cls); @@ -16600,7 +16600,7 @@ this.startSpan(pos, cls); } } - if (hasChild7) + if (hasChild2) cursor.parent(); } else if (cursor.firstChild()) { do { @@ -16987,9 +16987,9 @@ let assigned = []; if (actions) actions: - for (let { name: name3 } of actions) { - for (let i = 0; i < name3.length; i++) { - let ch = name3[i]; + for (let { name: name2 } of actions) { + for (let i = 0; i < name2.length; i++) { + let ch = name2[i]; if (/[a-zA-Z]/.test(ch) && !assigned.some((c) => c.toLowerCase() == ch.toLowerCase())) { assigned.push(ch); continue actions; @@ -17000,27 +17000,27 @@ return assigned; } function renderDiagnostic(view, diagnostic, inPanel) { - var _a4; + var _a2; let keys2 = inPanel ? assignKeys(diagnostic.actions) : []; - return crelt("li", { class: "cm-diagnostic cm-diagnostic-" + diagnostic.severity }, crelt("span", { class: "cm-diagnosticText" }, diagnostic.message), (_a4 = diagnostic.actions) === null || _a4 === void 0 ? void 0 : _a4.map((action, i) => { + return crelt("li", { class: "cm-diagnostic cm-diagnostic-" + diagnostic.severity }, crelt("span", { class: "cm-diagnosticText" }, diagnostic.message), (_a2 = diagnostic.actions) === null || _a2 === void 0 ? void 0 : _a2.map((action, i) => { let click = (e) => { e.preventDefault(); let found = findDiagnostic(view.state.field(lintState).diagnostics, diagnostic); if (found) action.apply(view, found.from, found.to); }; - let { name: name3 } = action, keyIndex = keys2[i] ? name3.indexOf(keys2[i]) : -1; - let nameElt = keyIndex < 0 ? name3 : [ - name3.slice(0, keyIndex), - crelt("u", name3.slice(keyIndex, keyIndex + 1)), - name3.slice(keyIndex + 1) + let { name: name2 } = action, keyIndex = keys2[i] ? name2.indexOf(keys2[i]) : -1; + let nameElt = keyIndex < 0 ? name2 : [ + name2.slice(0, keyIndex), + crelt("u", name2.slice(keyIndex, keyIndex + 1)), + name2.slice(keyIndex + 1) ]; return crelt("button", { type: "button", class: "cm-diagnosticAction", onclick: click, onmousedown: click, - "aria-label": ` Action: ${name3}${keyIndex < 0 ? "" : ` (access key "${keys2[i]})"`}.` + "aria-label": ` Action: ${name2}${keyIndex < 0 ? "" : ` (access key "${keys2[i]})"`}.` }, nameElt); }), diagnostic.source && crelt("div", { class: "cm-diagnosticSource" }, diagnostic.source)); } @@ -17204,8 +17204,8 @@ return new LintPanel(view); } }; - function svg(content3, attrs = `viewBox="0 0 40 40"`) { - return `url('data:image/svg+xml,${encodeURIComponent(content3)}')`; + function svg(content2, attrs = `viewBox="0 0 40 40"`) { + return `url('data:image/svg+xml,${encodeURIComponent(content2)}')`; } function underline(color) { return svg(``, `width="6" height="3"`); @@ -17327,31200 +17327,3950 @@ ]) ]; - // node_modules/@lezer/javascript/node_modules/@lezer/common/dist/index.js - var DefaultBufferLength2 = 1024; - var nextPropID2 = 0; - var Range3 = class { - constructor(from2, to) { - this.from = from2; - this.to = to; - } - }; - var NodeProp2 = class { - constructor(config2 = {}) { - this.id = nextPropID2++; - this.perNode = !!config2.perNode; - this.deserialize = config2.deserialize || (() => { - throw new Error("This node type doesn't define a deserialize function"); - }); - } - add(match2) { - if (this.perNode) - throw new RangeError("Can't add per-node props to node types"); - if (typeof match2 != "function") - match2 = NodeType2.match(match2); - return (type) => { - let result = match2(type); - return result === void 0 ? null : [this, result]; - }; - } - }; - NodeProp2.closedBy = new NodeProp2({ deserialize: (str) => str.split(" ") }); - NodeProp2.openedBy = new NodeProp2({ deserialize: (str) => str.split(" ") }); - NodeProp2.group = new NodeProp2({ deserialize: (str) => str.split(" ") }); - NodeProp2.contextHash = new NodeProp2({ perNode: true }); - NodeProp2.lookAhead = new NodeProp2({ perNode: true }); - NodeProp2.mounted = new NodeProp2({ perNode: true }); - var noProps2 = /* @__PURE__ */ Object.create(null); - var NodeType2 = class { - constructor(name3, props, id3, flags = 0) { - this.name = name3; - this.props = props; - this.id = id3; - this.flags = flags; - } - static define(spec) { - let props = spec.props && spec.props.length ? /* @__PURE__ */ Object.create(null) : noProps2; - let flags = (spec.top ? 1 : 0) | (spec.skipped ? 2 : 0) | (spec.error ? 4 : 0) | (spec.name == null ? 8 : 0); - let type = new NodeType2(spec.name || "", props, spec.id, flags); - if (spec.props) - for (let src of spec.props) { - if (!Array.isArray(src)) - src = src(type); - if (src) { - if (src[0].perNode) - throw new RangeError("Can't store a per-node prop on a node type"); - props[src[0].id] = src[1]; - } - } - return type; - } - prop(prop) { - return this.props[prop.id]; + // node_modules/@lezer/lr/dist/index.js + var Stack = class { + constructor(p, stack, state, reducePos, pos, score2, buffer, bufferBase, curContext, lookAhead = 0, parent) { + this.p = p; + this.stack = stack; + this.state = state; + this.reducePos = reducePos; + this.pos = pos; + this.score = score2; + this.buffer = buffer; + this.bufferBase = bufferBase; + this.curContext = curContext; + this.lookAhead = lookAhead; + this.parent = parent; } - get isTop() { - return (this.flags & 1) > 0; + toString() { + return `[${this.stack.filter((_, i) => i % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? "!" + this.score : ""}`; } - get isSkipped() { - return (this.flags & 2) > 0; + static start(p, state, pos = 0) { + let cx = p.parser.context; + return new Stack(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext(cx, cx.start) : null, 0, null); } - get isError() { - return (this.flags & 4) > 0; + get context() { + return this.curContext ? this.curContext.context : null; } - get isAnonymous() { - return (this.flags & 8) > 0; + pushState(state, start) { + this.stack.push(this.state, start, this.bufferBase + this.buffer.length); + this.state = state; } - is(name3) { - if (typeof name3 == "string") { - if (this.name == name3) - return true; - let group = this.prop(NodeProp2.group); - return group ? group.indexOf(name3) > -1 : false; + reduce(action) { + let depth = action >> 19, type = action & 65535; + let { parser: parser6 } = this.p; + let dPrec = parser6.dynamicPrecedence(type); + if (dPrec) + this.score += dPrec; + if (depth == 0) { + this.pushState(parser6.getGoto(this.state, type, true), this.reducePos); + if (type < parser6.minRepeatTerm) + this.storeNode(type, this.reducePos, this.reducePos, 4, true); + this.reduceContext(type, this.reducePos); + return; + } + let base2 = this.stack.length - (depth - 1) * 3 - (action & 262144 ? 6 : 0); + let start = this.stack[base2 - 2]; + let bufferBase = this.stack[base2 - 1], count = this.bufferBase + this.buffer.length - bufferBase; + if (type < parser6.minRepeatTerm || action & 131072) { + let pos = parser6.stateFlag(this.state, 1) ? this.pos : this.reducePos; + this.storeNode(type, start, pos, count + 4, true); + } + if (action & 262144) { + this.state = this.stack[base2]; + } else { + let baseStateID = this.stack[base2 - 3]; + this.state = parser6.getGoto(baseStateID, type, true); } - return this.id == name3; + while (this.stack.length > base2) + this.stack.pop(); + this.reduceContext(type, start); } - static match(map) { - let direct = /* @__PURE__ */ Object.create(null); - for (let prop in map) - for (let name3 of prop.split(" ")) - direct[name3] = map[prop]; - return (node) => { - for (let groups = node.prop(NodeProp2.group), i = -1; i < (groups ? groups.length : 0); i++) { - let found = direct[i < 0 ? node.name : groups[i]]; - if (found) - return found; + storeNode(term, start, end, size = 4, isReduce = false) { + if (term == 0) { + let cur2 = this, top2 = this.buffer.length; + if (top2 == 0 && cur2.parent) { + top2 = cur2.bufferBase - cur2.parent.bufferBase; + cur2 = cur2.parent; } - }; - } - }; - NodeType2.none = new NodeType2("", /* @__PURE__ */ Object.create(null), 0, 8); - var NodeSet2 = class { - constructor(types4) { - this.types = types4; - for (let i = 0; i < types4.length; i++) - if (types4[i].id != i) - throw new RangeError("Node type ids should correspond to array positions when creating a node set"); - } - extend(...props) { - let newTypes = []; - for (let type of this.types) { - let newProps = null; - for (let source of props) { - let add2 = source(type); - if (add2) { - if (!newProps) - newProps = Object.assign({}, type.props); - newProps[add2[0].id] = add2[1]; + if (top2 > 0 && cur2.buffer[top2 - 4] == 0 && cur2.buffer[top2 - 1] > -1) { + if (start == end) + return; + if (cur2.buffer[top2 - 2] >= start) { + cur2.buffer[top2 - 2] = end; + return; } } - newTypes.push(newProps ? new NodeType2(type.name, newProps, type.id, type.flags) : type); } - return new NodeSet2(newTypes); - } - }; - var CachedNode2 = /* @__PURE__ */ new WeakMap(); - var CachedInnerNode2 = /* @__PURE__ */ new WeakMap(); - var IterMode; - (function(IterMode6) { - IterMode6[IterMode6["ExcludeBuffers"] = 1] = "ExcludeBuffers"; - IterMode6[IterMode6["IncludeAnonymous"] = 2] = "IncludeAnonymous"; - IterMode6[IterMode6["IgnoreMounts"] = 4] = "IgnoreMounts"; - IterMode6[IterMode6["IgnoreOverlays"] = 8] = "IgnoreOverlays"; - })(IterMode || (IterMode = {})); - var Tree2 = class { - constructor(type, children, positions, length, props) { - this.type = type; - this.children = children; - this.positions = positions; - this.length = length; - this.props = null; - if (props && props.length) { - this.props = /* @__PURE__ */ Object.create(null); - for (let [prop, value] of props) - this.props[typeof prop == "number" ? prop : prop.id] = value; + if (!isReduce || this.pos == end) { + this.buffer.push(term, start, end, size); + } else { + let index = this.buffer.length; + if (index > 0 && this.buffer[index - 4] != 0) + while (index > 0 && this.buffer[index - 2] > end) { + this.buffer[index] = this.buffer[index - 4]; + this.buffer[index + 1] = this.buffer[index - 3]; + this.buffer[index + 2] = this.buffer[index - 2]; + this.buffer[index + 3] = this.buffer[index - 1]; + index -= 4; + if (size > 4) + size -= 4; + } + this.buffer[index] = term; + this.buffer[index + 1] = start; + this.buffer[index + 2] = end; + this.buffer[index + 3] = size; } } - toString() { - let mounted = this.prop(NodeProp2.mounted); - if (mounted && !mounted.overlay) - return mounted.tree.toString(); - let children = ""; - for (let ch of this.children) { - let str = ch.toString(); - if (str) { - if (children) - children += ","; - children += str; + shift(action, next, nextEnd) { + let start = this.pos; + if (action & 131072) { + this.pushState(action & 65535, this.pos); + } else if ((action & 262144) == 0) { + let nextState = action, { parser: parser6 } = this.p; + if (nextEnd > this.pos || next <= parser6.maxNode) { + this.pos = nextEnd; + if (!parser6.stateFlag(nextState, 1)) + this.reducePos = nextEnd; } + this.pushState(nextState, start); + this.shiftContext(next, start); + if (next <= parser6.maxNode) + this.buffer.push(next, start, nextEnd, 4); + } else { + this.pos = nextEnd; + this.shiftContext(next, start); + if (next <= this.p.parser.maxNode) + this.buffer.push(next, start, nextEnd, 4); } - return !this.type.name ? children : (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (children.length ? "(" + children + ")" : ""); - } - cursor(mode = 0) { - return new TreeCursor2(this.topNode, mode); - } - cursorAt(pos, side = 0, mode = 0) { - let scope = CachedNode2.get(this) || this.topNode; - let cursor = new TreeCursor2(scope); - cursor.moveTo(pos, side); - CachedNode2.set(this, cursor._tree); - return cursor; - } - get topNode() { - return new TreeNode2(this, 0, 0, null); - } - resolve(pos, side = 0) { - let node = resolveNode2(CachedNode2.get(this) || this.topNode, pos, side, false); - CachedNode2.set(this, node); - return node; } - resolveInner(pos, side = 0) { - let node = resolveNode2(CachedInnerNode2.get(this) || this.topNode, pos, side, true); - CachedInnerNode2.set(this, node); - return node; + apply(action, next, nextEnd) { + if (action & 65536) + this.reduce(action); + else + this.shift(action, next, nextEnd); } - iterate(spec) { - let { enter, leave, from: from2 = 0, to = this.length } = spec; - for (let c = this.cursor((spec.mode || 0) | IterMode.IncludeAnonymous); ; ) { - let entered = false; - if (c.from <= to && c.to >= from2 && (c.type.isAnonymous || enter(c) !== false)) { - if (c.firstChild()) - continue; - entered = true; - } - for (; ; ) { - if (entered && leave && !c.type.isAnonymous) - leave(c); - if (c.nextSibling()) - break; - if (!c.parent()) - return; - entered = true; - } + useNode(value, next) { + let index = this.p.reused.length - 1; + if (index < 0 || this.p.reused[index] != value) { + this.p.reused.push(value); + index++; } + let start = this.pos; + this.reducePos = this.pos = start + value.length; + this.pushState(next, start); + this.buffer.push(index, start, this.reducePos, -1); + if (this.curContext) + this.updateContext(this.curContext.tracker.reuse(this.curContext.context, value, this, this.p.stream.reset(this.pos - value.length))); } - prop(prop) { - return !prop.perNode ? this.type.prop(prop) : this.props ? this.props[prop.id] : void 0; - } - get propValues() { - let result = []; - if (this.props) - for (let id3 in this.props) - result.push([+id3, this.props[id3]]); - return result; + split() { + let parent = this; + let off = parent.buffer.length; + while (off > 0 && parent.buffer[off - 2] > parent.reducePos) + off -= 4; + let buffer = parent.buffer.slice(off), base2 = parent.bufferBase + off; + while (parent && base2 == parent.bufferBase) + parent = parent.parent; + return new Stack(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base2, this.curContext, this.lookAhead, parent); } - balance(config2 = {}) { - return this.children.length <= 8 ? this : balanceRange2(NodeType2.none, this.children, this.positions, 0, this.children.length, 0, this.length, (children, positions, length) => new Tree2(this.type, children, positions, length, this.propValues), config2.makeTree || ((children, positions, length) => new Tree2(NodeType2.none, children, positions, length))); + recoverByDelete(next, nextEnd) { + let isNode = next <= this.p.parser.maxNode; + if (isNode) + this.storeNode(next, this.pos, nextEnd, 4); + this.storeNode(0, this.pos, nextEnd, isNode ? 8 : 4); + this.pos = this.reducePos = nextEnd; + this.score -= 190; } - static build(data) { - return buildTree2(data); + canShift(term) { + for (let sim = new SimulatedStack(this); ; ) { + let action = this.p.parser.stateSlot(sim.state, 4) || this.p.parser.hasAction(sim.state, term); + if ((action & 65536) == 0) + return true; + if (action == 0) + return false; + sim.reduce(action); + } } - }; - Tree2.empty = new Tree2(NodeType2.none, [], [], 0); - var FlatBufferCursor2 = class { - constructor(buffer, index) { - this.buffer = buffer; - this.index = index; + recoverByInsert(next) { + if (this.stack.length >= 300) + return []; + let nextStates = this.p.parser.nextStates(this.state); + if (nextStates.length > 4 << 1 || this.stack.length >= 120) { + let best = []; + for (let i = 0, s; i < nextStates.length; i += 2) { + if ((s = nextStates[i + 1]) != this.state && this.p.parser.hasAction(s, next)) + best.push(nextStates[i], s); + } + if (this.stack.length < 120) + for (let i = 0; best.length < 4 << 1 && i < nextStates.length; i += 2) { + let s = nextStates[i + 1]; + if (!best.some((v, i2) => i2 & 1 && v == s)) + best.push(nextStates[i], s); + } + nextStates = best; + } + let result = []; + for (let i = 0; i < nextStates.length && result.length < 4; i += 2) { + let s = nextStates[i + 1]; + if (s == this.state) + continue; + let stack = this.split(); + stack.storeNode(0, stack.pos, stack.pos, 4, true); + stack.pushState(s, this.pos); + stack.shiftContext(nextStates[i], this.pos); + stack.score -= 200; + result.push(stack); + } + return result; } - get id() { - return this.buffer[this.index - 4]; + forceReduce() { + let reduce = this.p.parser.stateSlot(this.state, 5); + if ((reduce & 65536) == 0) + return false; + let { parser: parser6 } = this.p; + if (!parser6.validAction(this.state, reduce)) { + let depth = reduce >> 19, term = reduce & 65535; + let target = this.stack.length - depth * 3; + if (target < 0 || parser6.getGoto(this.stack[target], term, false) < 0) + return false; + this.storeNode(0, this.reducePos, this.reducePos, 4, true); + this.score -= 100; + } + this.reduce(reduce); + return true; } - get start() { - return this.buffer[this.index - 3]; + forceAll() { + while (!this.p.parser.stateFlag(this.state, 2)) { + if (!this.forceReduce()) { + this.storeNode(0, this.pos, this.pos, 4, true); + break; + } + } + return this; } - get end() { - return this.buffer[this.index - 2]; + get deadEnd() { + if (this.stack.length != 3) + return false; + let { parser: parser6 } = this.p; + return parser6.data[parser6.stateSlot(this.state, 1)] == 65535 && !parser6.stateSlot(this.state, 4); } - get size() { - return this.buffer[this.index - 1]; + restart() { + this.state = this.stack[0]; + this.stack.length = 0; } - get pos() { - return this.index; + sameState(other) { + if (this.state != other.state || this.stack.length != other.stack.length) + return false; + for (let i = 0; i < this.stack.length; i += 3) + if (this.stack[i] != other.stack[i]) + return false; + return true; } - next() { - this.index -= 4; + get parser() { + return this.p.parser; } - fork() { - return new FlatBufferCursor2(this.buffer, this.index); + dialectEnabled(dialectID) { + return this.p.parser.dialect.flags[dialectID]; } - }; - var TreeBuffer2 = class { - constructor(buffer, length, set) { - this.buffer = buffer; - this.length = length; - this.set = set; + shiftContext(term, start) { + if (this.curContext) + this.updateContext(this.curContext.tracker.shift(this.curContext.context, term, this, this.p.stream.reset(start))); } - get type() { - return NodeType2.none; + reduceContext(term, start) { + if (this.curContext) + this.updateContext(this.curContext.tracker.reduce(this.curContext.context, term, this, this.p.stream.reset(start))); } - toString() { - let result = []; - for (let index = 0; index < this.buffer.length; ) { - result.push(this.childString(index)); - index = this.buffer[index + 3]; - } - return result.join(","); + emitContext() { + let last = this.buffer.length - 1; + if (last < 0 || this.buffer[last] != -3) + this.buffer.push(this.curContext.hash, this.reducePos, this.reducePos, -3); } - childString(index) { - let id3 = this.buffer[index], endIndex = this.buffer[index + 3]; - let type = this.set.types[id3], result = type.name; - if (/\W/.test(result) && !type.isError) - result = JSON.stringify(result); - index += 4; - if (endIndex == index) - return result; - let children = []; - while (index < endIndex) { - children.push(this.childString(index)); - index = this.buffer[index + 3]; - } - return result + "(" + children.join(",") + ")"; + emitLookAhead() { + let last = this.buffer.length - 1; + if (last < 0 || this.buffer[last] != -4) + this.buffer.push(this.lookAhead, this.reducePos, this.reducePos, -4); } - findChild(startIndex, endIndex, dir, pos, side) { - let { buffer } = this, pick = -1; - for (let i = startIndex; i != endIndex; i = buffer[i + 3]) { - if (checkSide2(side, pos, buffer[i + 1], buffer[i + 2])) { - pick = i; - if (dir > 0) - break; - } + updateContext(context) { + if (context != this.curContext.context) { + let newCx = new StackContext(this.curContext.tracker, context); + if (newCx.hash != this.curContext.hash) + this.emitContext(); + this.curContext = newCx; } - return pick; } - slice(startI, endI, from2, to) { - let b = this.buffer; - let copy = new Uint16Array(endI - startI); - for (let i = startI, j = 0; i < endI; ) { - copy[j++] = b[i++]; - copy[j++] = b[i++] - from2; - copy[j++] = b[i++] - from2; - copy[j++] = b[i++] - startI; + setLookAhead(lookAhead) { + if (lookAhead > this.lookAhead) { + this.emitLookAhead(); + this.lookAhead = lookAhead; } - return new TreeBuffer2(copy, to - from2, this.set); + } + close() { + if (this.curContext && this.curContext.tracker.strict) + this.emitContext(); + if (this.lookAhead > 0) + this.emitLookAhead(); } }; - function checkSide2(side, pos, from2, to) { - switch (side) { - case -2: - return from2 < pos; - case -1: - return to >= pos && from2 < pos; - case 0: - return from2 < pos && to > pos; - case 1: - return from2 <= pos && to > pos; - case 2: - return to > pos; - case 4: - return true; + var StackContext = class { + constructor(tracker, context) { + this.tracker = tracker; + this.context = context; + this.hash = tracker.strict ? tracker.hash(context) : 0; } - } - function enterUnfinishedNodesBefore2(node, pos) { - let scan = node.childBefore(pos); - while (scan) { - let last = scan.lastChild; - if (!last || last.to != scan.to) - break; - if (last.type.isError && last.from == last.to) { - node = scan; - scan = last.prevSibling; + }; + var Recover; + (function(Recover2) { + Recover2[Recover2["Insert"] = 200] = "Insert"; + Recover2[Recover2["Delete"] = 190] = "Delete"; + Recover2[Recover2["Reduce"] = 100] = "Reduce"; + Recover2[Recover2["MaxNext"] = 4] = "MaxNext"; + Recover2[Recover2["MaxInsertStackDepth"] = 300] = "MaxInsertStackDepth"; + Recover2[Recover2["DampenInsertStackDepth"] = 120] = "DampenInsertStackDepth"; + })(Recover || (Recover = {})); + var SimulatedStack = class { + constructor(start) { + this.start = start; + this.state = start.state; + this.stack = start.stack; + this.base = this.stack.length; + } + reduce(action) { + let term = action & 65535, depth = action >> 19; + if (depth == 0) { + if (this.stack == this.start.stack) + this.stack = this.stack.slice(); + this.stack.push(this.state, 0, 0); + this.base += 3; } else { - scan = last; + this.base -= (depth - 1) * 3; } + let goto2 = this.start.p.parser.getGoto(this.stack[this.base - 3], term, true); + this.state = goto2; } - return node; - } - function resolveNode2(node, pos, side, overlays) { - var _a4; - while (node.from == node.to || (side < 1 ? node.from >= pos : node.from > pos) || (side > -1 ? node.to <= pos : node.to < pos)) { - let parent = !overlays && node instanceof TreeNode2 && node.index < 0 ? null : node.parent; - if (!parent) - return node; - node = parent; + }; + var StackBufferCursor = class { + constructor(stack, pos, index) { + this.stack = stack; + this.pos = pos; + this.index = index; + this.buffer = stack.buffer; + if (this.index == 0) + this.maybeNext(); } - let mode = overlays ? 0 : IterMode.IgnoreOverlays; - if (overlays) - for (let scan = node, parent = scan.parent; parent; scan = parent, parent = scan.parent) { - if (scan instanceof TreeNode2 && scan.index < 0 && ((_a4 = parent.enter(pos, side, mode)) === null || _a4 === void 0 ? void 0 : _a4.from) != scan.from) - node = parent; + static create(stack, pos = stack.bufferBase + stack.buffer.length) { + return new StackBufferCursor(stack, pos, pos - stack.bufferBase); + } + maybeNext() { + let next = this.stack.parent; + if (next != null) { + this.index = this.stack.bufferBase - next.bufferBase; + this.stack = next; + this.buffer = next.buffer; } - for (; ; ) { - let inner = node.enter(pos, side, mode); - if (!inner) - return node; - node = inner; } - } - var TreeNode2 = class { - constructor(_tree, from2, index, _parent) { - this._tree = _tree; - this.from = from2; - this.index = index; - this._parent = _parent; + get id() { + return this.buffer[this.index - 4]; } - get type() { - return this._tree.type; + get start() { + return this.buffer[this.index - 3]; } - get name() { - return this._tree.type.name; + get end() { + return this.buffer[this.index - 2]; } - get to() { - return this.from + this._tree.length; + get size() { + return this.buffer[this.index - 1]; } - nextChild(i, dir, pos, side, mode = 0) { - for (let parent = this; ; ) { - for (let { children, positions } = parent._tree, e = dir > 0 ? children.length : -1; i != e; i += dir) { - let next = children[i], start = positions[i] + parent.from; - if (!checkSide2(side, pos, start, start + next.length)) - continue; - if (next instanceof TreeBuffer2) { - if (mode & IterMode.ExcludeBuffers) - continue; - let index = next.findChild(0, next.buffer.length, dir, pos - start, side); - if (index > -1) - return new BufferNode2(new BufferContext2(parent, next, i, start), null, index); - } else if (mode & IterMode.IncludeAnonymous || (!next.type.isAnonymous || hasChild2(next))) { - let mounted; - if (!(mode & IterMode.IgnoreMounts) && next.props && (mounted = next.prop(NodeProp2.mounted)) && !mounted.overlay) - return new TreeNode2(mounted.tree, start, i, parent); - let inner = new TreeNode2(next, start, i, parent); - return mode & IterMode.IncludeAnonymous || !inner.type.isAnonymous ? inner : inner.nextChild(dir < 0 ? next.children.length - 1 : 0, dir, pos, side); - } - } - if (mode & IterMode.IncludeAnonymous || !parent.type.isAnonymous) - return null; - if (parent.index >= 0) - i = parent.index + dir; - else - i = dir < 0 ? -1 : parent._parent._tree.children.length; - parent = parent._parent; - if (!parent) - return null; - } + next() { + this.index -= 4; + this.pos -= 4; + if (this.index == 0) + this.maybeNext(); } - get firstChild() { - return this.nextChild(0, 1, 0, 4); + fork() { + return new StackBufferCursor(this.stack, this.pos, this.index); } - get lastChild() { - return this.nextChild(this._tree.children.length - 1, -1, 0, 4); + }; + var CachedToken = class { + constructor() { + this.start = -1; + this.value = -1; + this.end = -1; + this.extended = -1; + this.lookAhead = 0; + this.mask = 0; + this.context = 0; } - childAfter(pos) { - return this.nextChild(0, 1, pos, 2); + }; + var nullToken = new CachedToken(); + var InputStream = class { + constructor(input, ranges) { + this.input = input; + this.ranges = ranges; + this.chunk = ""; + this.chunkOff = 0; + this.chunk2 = ""; + this.chunk2Pos = 0; + this.next = -1; + this.token = nullToken; + this.rangeIndex = 0; + this.pos = this.chunkPos = ranges[0].from; + this.range = ranges[0]; + this.end = ranges[ranges.length - 1].to; + this.readNext(); } - childBefore(pos) { - return this.nextChild(this._tree.children.length - 1, -1, pos, -2); + resolveOffset(offset, assoc) { + let range = this.range, index = this.rangeIndex; + let pos = this.pos + offset; + while (pos < range.from) { + if (!index) + return null; + let next = this.ranges[--index]; + pos -= range.from - next.to; + range = next; + } + while (assoc < 0 ? pos > range.to : pos >= range.to) { + if (index == this.ranges.length - 1) + return null; + let next = this.ranges[++index]; + pos += next.from - range.to; + range = next; + } + return pos; } - enter(pos, side, mode = 0) { - let mounted; - if (!(mode & IterMode.IgnoreOverlays) && (mounted = this._tree.prop(NodeProp2.mounted)) && mounted.overlay) { - let rPos = pos - this.from; - for (let { from: from2, to } of mounted.overlay) { - if ((side > 0 ? from2 <= rPos : from2 < rPos) && (side < 0 ? to >= rPos : to > rPos)) - return new TreeNode2(mounted.tree, mounted.overlay[0].from + this.from, -1, this); + peek(offset) { + let idx = this.chunkOff + offset, pos, result; + if (idx >= 0 && idx < this.chunk.length) { + pos = this.pos + offset; + result = this.chunk.charCodeAt(idx); + } else { + let resolved = this.resolveOffset(offset, 1); + if (resolved == null) + return -1; + pos = resolved; + if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) { + result = this.chunk2.charCodeAt(pos - this.chunk2Pos); + } else { + let i = this.rangeIndex, range = this.range; + while (range.to <= pos) + range = this.ranges[++i]; + this.chunk2 = this.input.chunk(this.chunk2Pos = pos); + if (pos + this.chunk2.length > range.to) + this.chunk2 = this.chunk2.slice(0, range.to - pos); + result = this.chunk2.charCodeAt(0); } } - return this.nextChild(0, 1, pos, side, mode); - } - nextSignificantParent() { - let val = this; - while (val.type.isAnonymous && val._parent) - val = val._parent; - return val; - } - get parent() { - return this._parent ? this._parent.nextSignificantParent() : null; - } - get nextSibling() { - return this._parent && this.index >= 0 ? this._parent.nextChild(this.index + 1, 1, 0, 4) : null; - } - get prevSibling() { - return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4) : null; - } - cursor(mode = 0) { - return new TreeCursor2(this, mode); - } - get tree() { - return this._tree; - } - toTree() { - return this._tree; - } - resolve(pos, side = 0) { - return resolveNode2(this, pos, side, false); + if (pos >= this.token.lookAhead) + this.token.lookAhead = pos + 1; + return result; } - resolveInner(pos, side = 0) { - return resolveNode2(this, pos, side, true); + acceptToken(token, endOffset = 0) { + let end = endOffset ? this.resolveOffset(endOffset, -1) : this.pos; + if (end == null || end < this.token.start) + throw new RangeError("Token end out of bounds"); + this.token.value = token; + this.token.end = end; } - enterUnfinishedNodesBefore(pos) { - return enterUnfinishedNodesBefore2(this, pos); + getChunk() { + if (this.pos >= this.chunk2Pos && this.pos < this.chunk2Pos + this.chunk2.length) { + let { chunk, chunkPos } = this; + this.chunk = this.chunk2; + this.chunkPos = this.chunk2Pos; + this.chunk2 = chunk; + this.chunk2Pos = chunkPos; + this.chunkOff = this.pos - this.chunkPos; + } else { + this.chunk2 = this.chunk; + this.chunk2Pos = this.chunkPos; + let nextChunk = this.input.chunk(this.pos); + let end = this.pos + nextChunk.length; + this.chunk = end > this.range.to ? nextChunk.slice(0, this.range.to - this.pos) : nextChunk; + this.chunkPos = this.pos; + this.chunkOff = 0; + } } - getChild(type, before = null, after = null) { - let r = getChildren2(this, type, before, after); - return r.length ? r[0] : null; + readNext() { + if (this.chunkOff >= this.chunk.length) { + this.getChunk(); + if (this.chunkOff == this.chunk.length) + return this.next = -1; + } + return this.next = this.chunk.charCodeAt(this.chunkOff); } - getChildren(type, before = null, after = null) { - return getChildren2(this, type, before, after); + advance(n = 1) { + this.chunkOff += n; + while (this.pos + n >= this.range.to) { + if (this.rangeIndex == this.ranges.length - 1) + return this.setDone(); + n -= this.range.to - this.pos; + this.range = this.ranges[++this.rangeIndex]; + this.pos = this.range.from; + } + this.pos += n; + if (this.pos >= this.token.lookAhead) + this.token.lookAhead = this.pos + 1; + return this.readNext(); } - toString() { - return this._tree.toString(); + setDone() { + this.pos = this.chunkPos = this.end; + this.range = this.ranges[this.rangeIndex = this.ranges.length - 1]; + this.chunk = ""; + return this.next = -1; } - get node() { + reset(pos, token) { + if (token) { + this.token = token; + token.start = pos; + token.lookAhead = pos + 1; + token.value = token.extended = -1; + } else { + this.token = nullToken; + } + if (this.pos != pos) { + this.pos = pos; + if (pos == this.end) { + this.setDone(); + return this; + } + while (pos < this.range.from) + this.range = this.ranges[--this.rangeIndex]; + while (pos >= this.range.to) + this.range = this.ranges[++this.rangeIndex]; + if (pos >= this.chunkPos && pos < this.chunkPos + this.chunk.length) { + this.chunkOff = pos - this.chunkPos; + } else { + this.chunk = ""; + this.chunkOff = 0; + } + this.readNext(); + } return this; } - matchContext(context) { - return matchNodeContext(this, context); - } - }; - function getChildren2(node, type, before, after) { - let cur2 = node.cursor(), result = []; - if (!cur2.firstChild()) + read(from2, to) { + if (from2 >= this.chunkPos && to <= this.chunkPos + this.chunk.length) + return this.chunk.slice(from2 - this.chunkPos, to - this.chunkPos); + if (from2 >= this.chunk2Pos && to <= this.chunk2Pos + this.chunk2.length) + return this.chunk2.slice(from2 - this.chunk2Pos, to - this.chunk2Pos); + if (from2 >= this.range.from && to <= this.range.to) + return this.input.read(from2, to); + let result = ""; + for (let r of this.ranges) { + if (r.from >= to) + break; + if (r.to > from2) + result += this.input.read(Math.max(r.from, from2), Math.min(r.to, to)); + } return result; - if (before != null) { - while (!cur2.type.is(before)) - if (!cur2.nextSibling()) - return result; } - for (; ; ) { - if (after != null && cur2.type.is(after)) - return result; - if (cur2.type.is(type)) - result.push(cur2.node); - if (!cur2.nextSibling()) - return after == null ? result : []; + }; + var TokenGroup = class { + constructor(data, id2) { + this.data = data; + this.id = id2; } - } - function matchNodeContext(node, context, i = context.length - 1) { - for (let p = node.parent; i >= 0; p = p.parent) { - if (!p) - return false; - if (!p.type.isAnonymous) { - if (context[i] && context[i] != p.name) - return false; - i--; - } + token(input, stack) { + readToken(this.data, input, stack, this.id); } - return true; - } - var BufferContext2 = class { - constructor(parent, buffer, index, start) { - this.parent = parent; - this.buffer = buffer; - this.index = index; - this.start = start; + }; + TokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false; + var ExternalTokenizer = class { + constructor(token, options = {}) { + this.token = token; + this.contextual = !!options.contextual; + this.fallback = !!options.fallback; + this.extend = !!options.extend; } }; - var BufferNode2 = class { - constructor(context, _parent, index) { - this.context = context; - this._parent = _parent; - this.index = index; - this.type = context.buffer.set.types[context.buffer.buffer[index]]; - } - get name() { - return this.type.name; - } - get from() { - return this.context.start + this.context.buffer.buffer[this.index + 1]; - } - get to() { - return this.context.start + this.context.buffer.buffer[this.index + 2]; - } - child(dir, pos, side) { - let { buffer } = this.context; - let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.context.start, side); - return index < 0 ? null : new BufferNode2(this.context, this, index); - } - get firstChild() { - return this.child(1, 0, 4); + function readToken(data, input, stack, group) { + let state = 0, groupMask = 1 << group, { parser: parser6 } = stack.p, { dialect } = parser6; + scan: + for (; ; ) { + if ((groupMask & data[state]) == 0) + break; + let accEnd = data[state + 1]; + for (let i = state + 3; i < accEnd; i += 2) + if ((data[i + 1] & groupMask) > 0) { + let term = data[i]; + if (dialect.allows(term) && (input.token.value == -1 || input.token.value == term || parser6.overrides(term, input.token.value))) { + input.acceptToken(term); + break; + } + } + for (let next = input.next, low = 0, high = data[state + 2]; low < high; ) { + let mid = low + high >> 1; + let index = accEnd + mid + (mid << 1); + let from2 = data[index], to = data[index + 1]; + if (next < from2) + high = mid; + else if (next >= to) + low = mid + 1; + else { + state = data[index + 2]; + input.advance(); + continue scan; + } + } + break; + } + } + function decodeArray(input, Type = Uint16Array) { + if (typeof input != "string") + return input; + let array2 = null; + for (let pos = 0, out = 0; pos < input.length; ) { + let value = 0; + for (; ; ) { + let next = input.charCodeAt(pos++), stop = false; + if (next == 126) { + value = 65535; + break; + } + if (next >= 92) + next--; + if (next >= 34) + next--; + let digit = next - 32; + if (digit >= 46) { + digit -= 46; + stop = true; + } + value += digit; + if (stop) + break; + value *= 46; + } + if (array2) + array2[out++] = value; + else + array2 = new Type(value); } - get lastChild() { - return this.child(-1, 0, 4); + return array2; + } + var verbose = typeof process != "undefined" && /\bparse\b/.test(process.env.LOG); + var stackIDs = null; + var Safety; + (function(Safety2) { + Safety2[Safety2["Margin"] = 25] = "Margin"; + })(Safety || (Safety = {})); + function cutAt(tree, pos, side) { + let cursor = tree.fullCursor(); + cursor.moveTo(pos); + for (; ; ) { + if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos))) + for (; ; ) { + if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError) + return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25)) : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25)); + if (side < 0 ? cursor.prevSibling() : cursor.nextSibling()) + break; + if (!cursor.parent()) + return side < 0 ? 0 : tree.length; + } } - childAfter(pos) { - return this.child(1, pos, 2); + } + var FragmentCursor2 = class { + constructor(fragments, nodeSet) { + this.fragments = fragments; + this.nodeSet = nodeSet; + this.i = 0; + this.fragment = null; + this.safeFrom = -1; + this.safeTo = -1; + this.trees = []; + this.start = []; + this.index = []; + this.nextFragment(); } - childBefore(pos) { - return this.child(-1, pos, -2); + nextFragment() { + let fr = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++]; + if (fr) { + this.safeFrom = fr.openStart ? cutAt(fr.tree, fr.from + fr.offset, 1) - fr.offset : fr.from; + this.safeTo = fr.openEnd ? cutAt(fr.tree, fr.to + fr.offset, -1) - fr.offset : fr.to; + while (this.trees.length) { + this.trees.pop(); + this.start.pop(); + this.index.pop(); + } + this.trees.push(fr.tree); + this.start.push(-fr.offset); + this.index.push(0); + this.nextStart = this.safeFrom; + } else { + this.nextStart = 1e9; + } } - enter(pos, side, mode = 0) { - if (mode & IterMode.ExcludeBuffers) + nodeAt(pos) { + if (pos < this.nextStart) return null; - let { buffer } = this.context; - let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], side > 0 ? 1 : -1, pos - this.context.start, side); - return index < 0 ? null : new BufferNode2(this.context, this, index); - } - get parent() { - return this._parent || this.context.parent.nextSignificantParent(); - } - externalSibling(dir) { - return this._parent ? null : this.context.parent.nextChild(this.context.index + dir, dir, 0, 4); - } - get nextSibling() { - let { buffer } = this.context; - let after = buffer.buffer[this.index + 3]; - if (after < (this._parent ? buffer.buffer[this._parent.index + 3] : buffer.buffer.length)) - return new BufferNode2(this.context, this._parent, after); - return this.externalSibling(1); - } - get prevSibling() { - let { buffer } = this.context; - let parentStart = this._parent ? this._parent.index + 4 : 0; - if (this.index == parentStart) - return this.externalSibling(-1); - return new BufferNode2(this.context, this._parent, buffer.findChild(parentStart, this.index, -1, 0, 4)); - } - cursor(mode = 0) { - return new TreeCursor2(this, mode); - } - get tree() { - return null; - } - toTree() { - let children = [], positions = []; - let { buffer } = this.context; - let startI = this.index + 4, endI = buffer.buffer[this.index + 3]; - if (endI > startI) { - let from2 = buffer.buffer[this.index + 1], to = buffer.buffer[this.index + 2]; - children.push(buffer.slice(startI, endI, from2, to)); - positions.push(0); + while (this.fragment && this.safeTo <= pos) + this.nextFragment(); + if (!this.fragment) + return null; + for (; ; ) { + let last = this.trees.length - 1; + if (last < 0) { + this.nextFragment(); + return null; + } + let top2 = this.trees[last], index = this.index[last]; + if (index == top2.children.length) { + this.trees.pop(); + this.start.pop(); + this.index.pop(); + continue; + } + let next = top2.children[index]; + let start = this.start[last] + top2.positions[index]; + if (start > pos) { + this.nextStart = start; + return null; + } + if (next instanceof Tree) { + if (start == pos) { + if (start < this.safeFrom) + return null; + let end = start + next.length; + if (end <= this.safeTo) { + let lookAhead = next.prop(NodeProp.lookAhead); + if (!lookAhead || end + lookAhead < this.fragment.to) + return next; + } + } + this.index[last]++; + if (start + next.length >= Math.max(this.safeFrom, pos)) { + this.trees.push(next); + this.start.push(start); + this.index.push(0); + } + } else { + this.index[last]++; + this.nextStart = start + next.length; + } } - return new Tree2(this.type, children, positions, this.to - this.from); - } - resolve(pos, side = 0) { - return resolveNode2(this, pos, side, false); - } - resolveInner(pos, side = 0) { - return resolveNode2(this, pos, side, true); - } - enterUnfinishedNodesBefore(pos) { - return enterUnfinishedNodesBefore2(this, pos); - } - toString() { - return this.context.buffer.childString(this.index); - } - getChild(type, before = null, after = null) { - let r = getChildren2(this, type, before, after); - return r.length ? r[0] : null; - } - getChildren(type, before = null, after = null) { - return getChildren2(this, type, before, after); - } - get node() { - return this; - } - matchContext(context) { - return matchNodeContext(this, context); } }; - var TreeCursor2 = class { - constructor(node, mode = 0) { - this.mode = mode; - this.buffer = null; - this.stack = []; - this.index = 0; - this.bufferNode = null; - if (node instanceof TreeNode2) { - this.yieldNode(node); - } else { - this._tree = node.context.parent; - this.buffer = node.context; - for (let n = node._parent; n; n = n._parent) - this.stack.unshift(n.index); - this.bufferNode = node; - this.yieldBuf(node.index); - } - } - get name() { - return this.type.name; + var TokenCache = class { + constructor(parser6, stream) { + this.stream = stream; + this.tokens = []; + this.mainToken = null; + this.actions = []; + this.tokens = parser6.tokenizers.map((_) => new CachedToken()); } - yieldNode(node) { - if (!node) - return false; - this._tree = node; - this.type = node.type; - this.from = node.from; - this.to = node.to; - return true; - } - yieldBuf(index, type) { - this.index = index; - let { start, buffer } = this.buffer; - this.type = type || buffer.set.types[buffer.buffer[index]]; - this.from = start + buffer.buffer[index + 1]; - this.to = start + buffer.buffer[index + 2]; - return true; - } - yield(node) { - if (!node) - return false; - if (node instanceof TreeNode2) { - this.buffer = null; - return this.yieldNode(node); - } - this.buffer = node.context; - return this.yieldBuf(node.index, node.type); - } - toString() { - return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString(); - } - enterChild(dir, pos, side) { - if (!this.buffer) - return this.yield(this._tree.nextChild(dir < 0 ? this._tree._tree.children.length - 1 : 0, dir, pos, side, this.mode)); - let { buffer } = this.buffer; - let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.buffer.start, side); - if (index < 0) - return false; - this.stack.push(this.index); - return this.yieldBuf(index); - } - firstChild() { - return this.enterChild(1, 0, 4); - } - lastChild() { - return this.enterChild(-1, 0, 4); - } - childAfter(pos) { - return this.enterChild(1, pos, 2); - } - childBefore(pos) { - return this.enterChild(-1, pos, -2); - } - enter(pos, side, mode = this.mode) { - if (!this.buffer) - return this.yield(this._tree.enter(pos, side, mode)); - return mode & IterMode.ExcludeBuffers ? false : this.enterChild(1, pos, side); - } - parent() { - if (!this.buffer) - return this.yieldNode(this.mode & IterMode.IncludeAnonymous ? this._tree._parent : this._tree.parent); - if (this.stack.length) - return this.yieldBuf(this.stack.pop()); - let parent = this.mode & IterMode.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent(); - this.buffer = null; - return this.yieldNode(parent); - } - sibling(dir) { - if (!this.buffer) - return !this._tree._parent ? false : this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + dir, dir, 0, 4, this.mode)); - let { buffer } = this.buffer, d = this.stack.length - 1; - if (dir < 0) { - let parentStart = d < 0 ? 0 : this.stack[d] + 4; - if (this.index != parentStart) - return this.yieldBuf(buffer.findChild(parentStart, this.index, -1, 0, 4)); - } else { - let after = buffer.buffer[this.index + 3]; - if (after < (d < 0 ? buffer.buffer.length : buffer.buffer[this.stack[d] + 3])) - return this.yieldBuf(after); - } - return d < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + dir, dir, 0, 4, this.mode)) : false; - } - nextSibling() { - return this.sibling(1); - } - prevSibling() { - return this.sibling(-1); - } - atLastNode(dir) { - let index, parent, { buffer } = this; - if (buffer) { - if (dir > 0) { - if (this.index < buffer.buffer.buffer.length) - return false; - } else { - for (let i = 0; i < this.index; i++) - if (buffer.buffer.buffer[i + 3] < this.index) - return false; + getActions(stack) { + let actionIndex = 0; + let main = null; + let { parser: parser6 } = stack.p, { tokenizers } = parser6; + let mask = parser6.stateSlot(stack.state, 3); + let context = stack.curContext ? stack.curContext.hash : 0; + let lookAhead = 0; + for (let i = 0; i < tokenizers.length; i++) { + if ((1 << i & mask) == 0) + continue; + let tokenizer = tokenizers[i], token = this.tokens[i]; + if (main && !tokenizer.fallback) + continue; + if (tokenizer.contextual || token.start != stack.pos || token.mask != mask || token.context != context) { + this.updateCachedToken(token, tokenizer, stack); + token.mask = mask; + token.context = context; } - ({ index, parent } = buffer); - } else { - ({ index, _parent: parent } = this._tree); - } - for (; parent; { index, _parent: parent } = parent) { - if (index > -1) - for (let i = index + dir, e = dir < 0 ? -1 : parent._tree.children.length; i != e; i += dir) { - let child = parent._tree.children[i]; - if (this.mode & IterMode.IncludeAnonymous || child instanceof TreeBuffer2 || !child.type.isAnonymous || hasChild2(child)) - return false; + if (token.lookAhead > token.end + 25) + lookAhead = Math.max(token.lookAhead, lookAhead); + if (token.value != 0) { + let startIndex = actionIndex; + if (token.extended > -1) + actionIndex = this.addActions(stack, token.extended, token.end, actionIndex); + actionIndex = this.addActions(stack, token.value, token.end, actionIndex); + if (!tokenizer.extend) { + main = token; + if (actionIndex > startIndex) + break; } + } } - return true; - } - move(dir, enter) { - if (enter && this.enterChild(dir, 0, 4)) - return true; - for (; ; ) { - if (this.sibling(dir)) - return true; - if (this.atLastNode(dir) || !this.parent()) - return false; + while (this.actions.length > actionIndex) + this.actions.pop(); + if (lookAhead) + stack.setLookAhead(lookAhead); + if (!main && stack.pos == this.stream.end) { + main = new CachedToken(); + main.value = stack.p.parser.eofTerm; + main.start = main.end = stack.pos; + actionIndex = this.addActions(stack, main.value, main.end, actionIndex); } + this.mainToken = main; + return this.actions; } - next(enter = true) { - return this.move(1, enter); - } - prev(enter = true) { - return this.move(-1, enter); - } - moveTo(pos, side = 0) { - while (this.from == this.to || (side < 1 ? this.from >= pos : this.from > pos) || (side > -1 ? this.to <= pos : this.to < pos)) - if (!this.parent()) - break; - while (this.enterChild(1, pos, side)) { - } - return this; + getMainToken(stack) { + if (this.mainToken) + return this.mainToken; + let main = new CachedToken(), { pos, p } = stack; + main.start = pos; + main.end = Math.min(pos + 1, p.stream.end); + main.value = pos == p.stream.end ? p.parser.eofTerm : 0; + return main; } - get node() { - if (!this.buffer) - return this._tree; - let cache = this.bufferNode, result = null, depth = 0; - if (cache && cache.context == this.buffer) { - scan: - for (let index = this.index, d = this.stack.length; d >= 0; ) { - for (let c = cache; c; c = c._parent) - if (c.index == index) { - if (index == this.index) - return c; - result = c; - depth = d + 1; - break scan; - } - index = this.stack[--d]; + updateCachedToken(token, tokenizer, stack) { + tokenizer.token(this.stream.reset(stack.pos, token), stack); + if (token.value > -1) { + let { parser: parser6 } = stack.p; + for (let i = 0; i < parser6.specialized.length; i++) + if (parser6.specialized[i] == token.value) { + let result = parser6.specializers[i](this.stream.read(token.start, token.end), stack); + if (result >= 0 && stack.p.parser.dialect.allows(result >> 1)) { + if ((result & 1) == 0) + token.value = result >> 1; + else + token.extended = result >> 1; + break; + } } + } else { + token.value = 0; + token.end = Math.min(stack.p.stream.end, stack.pos + 1); } - for (let i = depth; i < this.stack.length; i++) - result = new BufferNode2(this.buffer, result, this.stack[i]); - return this.bufferNode = new BufferNode2(this.buffer, result, this.index); } - get tree() { - return this.buffer ? null : this._tree._tree; + putAction(action, token, end, index) { + for (let i = 0; i < index; i += 3) + if (this.actions[i] == action) + return index; + this.actions[index++] = action; + this.actions[index++] = token; + this.actions[index++] = end; + return index; } - iterate(enter, leave) { - for (let depth = 0; ; ) { - let mustLeave = false; - if (this.type.isAnonymous || enter(this) !== false) { - if (this.firstChild()) { - depth++; - continue; + addActions(stack, token, end, index) { + let { state } = stack, { parser: parser6 } = stack.p, { data } = parser6; + for (let set = 0; set < 2; set++) { + for (let i = parser6.stateSlot(state, set ? 2 : 1); ; i += 3) { + if (data[i] == 65535) { + if (data[i + 1] == 1) { + i = pair(data, i + 2); + } else { + if (index == 0 && data[i + 1] == 2) + index = this.putAction(pair(data, i + 2), token, end, index); + break; + } } - if (!this.type.isAnonymous) - mustLeave = true; - } - for (; ; ) { - if (mustLeave && leave) - leave(this); - mustLeave = this.type.isAnonymous; - if (this.nextSibling()) - break; - if (!depth) - return; - this.parent(); - depth--; - mustLeave = true; - } - } - } - matchContext(context) { - if (!this.buffer) - return matchNodeContext(this.node, context); - let { buffer } = this.buffer, { types: types4 } = buffer.set; - for (let i = context.length - 1, d = this.stack.length - 1; i >= 0; d--) { - if (d < 0) - return matchNodeContext(this.node, context, i); - let type = types4[buffer.buffer[this.stack[d]]]; - if (!type.isAnonymous) { - if (context[i] && context[i] != type.name) - return false; - i--; + if (data[i] == token) + index = this.putAction(pair(data, i + 1), token, end, index); } } - return true; + return index; } }; - function hasChild2(tree) { - return tree.children.some((ch) => ch instanceof TreeBuffer2 || !ch.type.isAnonymous || hasChild2(ch)); - } - function buildTree2(data) { - var _a4; - let { buffer, nodeSet, maxBufferLength = DefaultBufferLength2, reused = [], minRepeatType = nodeSet.types.length } = data; - let cursor = Array.isArray(buffer) ? new FlatBufferCursor2(buffer, buffer.length) : buffer; - let types4 = nodeSet.types; - let contextHash = 0, lookAhead = 0; - function takeNode(parentStart, minPos, children2, positions2, inRepeat) { - let { id: id3, start, end, size } = cursor; - let lookAheadAtStart = lookAhead; - while (size < 0) { - cursor.next(); - if (size == -1) { - let node2 = reused[id3]; - children2.push(node2); - positions2.push(start - parentStart); - return; - } else if (size == -3) { - contextHash = id3; - return; - } else if (size == -4) { - lookAhead = id3; - return; - } else { - throw new RangeError(`Unrecognized record size: ${size}`); - } - } - let type = types4[id3], node, buffer2; - let startPos = start - parentStart; - if (end - start <= maxBufferLength && (buffer2 = findBufferSize(cursor.pos - minPos, inRepeat))) { - let data2 = new Uint16Array(buffer2.size - buffer2.skip); - let endPos = cursor.pos - buffer2.size, index = data2.length; - while (cursor.pos > endPos) - index = copyToBuffer(buffer2.start, data2, index); - node = new TreeBuffer2(data2, end - buffer2.start, nodeSet); - startPos = buffer2.start - parentStart; - } else { - let endPos = cursor.pos - size; - cursor.next(); - let localChildren = [], localPositions = []; - let localInRepeat = id3 >= minRepeatType ? id3 : -1; - let lastGroup = 0, lastEnd = end; - while (cursor.pos > endPos) { - if (localInRepeat >= 0 && cursor.id == localInRepeat && cursor.size >= 0) { - if (cursor.end <= lastEnd - maxBufferLength) { - makeRepeatLeaf(localChildren, localPositions, start, lastGroup, cursor.end, lastEnd, localInRepeat, lookAheadAtStart); - lastGroup = localChildren.length; - lastEnd = cursor.end; - } - cursor.next(); + var Rec; + (function(Rec2) { + Rec2[Rec2["Distance"] = 5] = "Distance"; + Rec2[Rec2["MaxRemainingPerStep"] = 3] = "MaxRemainingPerStep"; + Rec2[Rec2["MinBufferLengthPrune"] = 500] = "MinBufferLengthPrune"; + Rec2[Rec2["ForceReduceLimit"] = 10] = "ForceReduceLimit"; + Rec2[Rec2["CutDepth"] = 15e3] = "CutDepth"; + Rec2[Rec2["CutTo"] = 9e3] = "CutTo"; + })(Rec || (Rec = {})); + var Parse = class { + constructor(parser6, input, fragments, ranges) { + this.parser = parser6; + this.input = input; + this.ranges = ranges; + this.recovering = 0; + this.nextStackID = 9812; + this.minStackPos = 0; + this.reused = []; + this.stoppedAt = null; + this.stream = new InputStream(input, ranges); + this.tokens = new TokenCache(parser6, this.stream); + this.topTerm = parser6.top[1]; + let { from: from2 } = ranges[0]; + this.stacks = [Stack.start(this, parser6.top[0], from2)]; + this.fragments = fragments.length && this.stream.end - from2 > parser6.bufferLength * 4 ? new FragmentCursor2(fragments, parser6.nodeSet) : null; + } + get parsedPos() { + return this.minStackPos; + } + advance() { + let stacks = this.stacks, pos = this.minStackPos; + let newStacks = this.stacks = []; + let stopped, stoppedTokens; + for (let i = 0; i < stacks.length; i++) { + let stack = stacks[i]; + for (; ; ) { + this.tokens.mainToken = null; + if (stack.pos > pos) { + newStacks.push(stack); + } else if (this.advanceStack(stack, newStacks, stacks)) { + continue; } else { - takeNode(start, endPos, localChildren, localPositions, localInRepeat); + if (!stopped) { + stopped = []; + stoppedTokens = []; + } + stopped.push(stack); + let tok = this.tokens.getMainToken(stack); + stoppedTokens.push(tok.value, tok.end); } - } - if (localInRepeat >= 0 && lastGroup > 0 && lastGroup < localChildren.length) - makeRepeatLeaf(localChildren, localPositions, start, lastGroup, start, lastEnd, localInRepeat, lookAheadAtStart); - localChildren.reverse(); - localPositions.reverse(); - if (localInRepeat > -1 && lastGroup > 0) { - let make = makeBalanced(type); - node = balanceRange2(type, localChildren, localPositions, 0, localChildren.length, 0, end - start, make, make); - } else { - node = makeTree(type, localChildren, localPositions, end - start, lookAheadAtStart - end); + break; } } - children2.push(node); - positions2.push(startPos); - } - function makeBalanced(type) { - return (children2, positions2, length2) => { - let lookAhead2 = 0, lastI = children2.length - 1, last, lookAheadProp; - if (lastI >= 0 && (last = children2[lastI]) instanceof Tree2) { - if (!lastI && last.type == type && last.length == length2) - return last; - if (lookAheadProp = last.prop(NodeProp2.lookAhead)) - lookAhead2 = positions2[lastI] + last.length + lookAheadProp; + if (!newStacks.length) { + let finished = stopped && findFinished(stopped); + if (finished) + return this.stackToTree(finished); + if (this.parser.strict) { + if (verbose && stopped) + console.log("Stuck with token " + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : "none")); + throw new SyntaxError("No parse at " + pos); } - return makeTree(type, children2, positions2, length2, lookAhead2); - }; - } - function makeRepeatLeaf(children2, positions2, base2, i, from2, to, type, lookAhead2) { - let localChildren = [], localPositions = []; - while (children2.length > i) { - localChildren.push(children2.pop()); - localPositions.push(positions2.pop() + base2 - from2); + if (!this.recovering) + this.recovering = 5; } - children2.push(makeTree(nodeSet.types[type], localChildren, localPositions, to - from2, lookAhead2 - to)); - positions2.push(from2 - base2); - } - function makeTree(type, children2, positions2, length2, lookAhead2 = 0, props) { - if (contextHash) { - let pair4 = [NodeProp2.contextHash, contextHash]; - props = props ? [pair4].concat(props) : [pair4]; + if (this.recovering && stopped) { + let finished = this.stoppedAt != null && stopped[0].pos > this.stoppedAt ? stopped[0] : this.runRecovery(stopped, stoppedTokens, newStacks); + if (finished) + return this.stackToTree(finished.forceAll()); } - if (lookAhead2 > 25) { - let pair4 = [NodeProp2.lookAhead, lookAhead2]; - props = props ? [pair4].concat(props) : [pair4]; + if (this.recovering) { + let maxRemaining = this.recovering == 1 ? 1 : this.recovering * 3; + if (newStacks.length > maxRemaining) { + newStacks.sort((a, b) => b.score - a.score); + while (newStacks.length > maxRemaining) + newStacks.pop(); + } + if (newStacks.some((s) => s.reducePos > pos)) + this.recovering--; + } else if (newStacks.length > 1) { + outer: + for (let i = 0; i < newStacks.length - 1; i++) { + let stack = newStacks[i]; + for (let j = i + 1; j < newStacks.length; j++) { + let other = newStacks[j]; + if (stack.sameState(other) || stack.buffer.length > 500 && other.buffer.length > 500) { + if ((stack.score - other.score || stack.buffer.length - other.buffer.length) > 0) { + newStacks.splice(j--, 1); + } else { + newStacks.splice(i--, 1); + continue outer; + } + } + } + } } - return new Tree2(type, children2, positions2, length2, props); + this.minStackPos = newStacks[0].pos; + for (let i = 1; i < newStacks.length; i++) + if (newStacks[i].pos < this.minStackPos) + this.minStackPos = newStacks[i].pos; + return null; } - function findBufferSize(maxSize, inRepeat) { - let fork = cursor.fork(); - let size = 0, start = 0, skip = 0, minStart = fork.end - maxBufferLength; - let result = { size: 0, start: 0, skip: 0 }; - scan: - for (let minPos = fork.pos - maxSize; fork.pos > minPos; ) { - let nodeSize7 = fork.size; - if (fork.id == inRepeat && nodeSize7 >= 0) { - result.size = size; - result.start = start; - result.skip = skip; - skip += 4; - size += 4; - fork.next(); - continue; + stopAt(pos) { + if (this.stoppedAt != null && this.stoppedAt < pos) + throw new RangeError("Can't move stoppedAt forward"); + this.stoppedAt = pos; + } + advanceStack(stack, stacks, split) { + let start = stack.pos, { parser: parser6 } = this; + let base2 = verbose ? this.stackID(stack) + " -> " : ""; + if (this.stoppedAt != null && start > this.stoppedAt) + return stack.forceReduce() ? stack : null; + if (this.fragments) { + let strictCx = stack.curContext && stack.curContext.tracker.strict, cxHash = strictCx ? stack.curContext.hash : 0; + for (let cached = this.fragments.nodeAt(start); cached; ) { + let match2 = this.parser.nodeSet.types[cached.type.id] == cached.type ? parser6.getGoto(stack.state, cached.type.id) : -1; + if (match2 > -1 && cached.length && (!strictCx || (cached.prop(NodeProp.contextHash) || 0) == cxHash)) { + stack.useNode(cached, match2); + if (verbose) + console.log(base2 + this.stackID(stack) + ` (via reuse of ${parser6.getName(cached.type.id)})`); + return true; } - let startPos = fork.pos - nodeSize7; - if (nodeSize7 < 0 || startPos < minPos || fork.start < minStart) + if (!(cached instanceof Tree) || cached.children.length == 0 || cached.positions[0] > 0) + break; + let inner = cached.children[0]; + if (inner instanceof Tree && cached.positions[0] == 0) + cached = inner; + else break; - let localSkipped = fork.id >= minRepeatType ? 4 : 0; - let nodeStart2 = fork.start; - fork.next(); - while (fork.pos > startPos) { - if (fork.size < 0) { - if (fork.size == -3) - localSkipped += 4; - else - break scan; - } else if (fork.id >= minRepeatType) { - localSkipped += 4; - } - fork.next(); - } - start = nodeStart2; - size += nodeSize7; - skip += localSkipped; } - if (inRepeat < 0 || size == maxSize) { - result.size = size; - result.start = start; - result.skip = skip; } - return result.size > 4 ? result : void 0; - } - function copyToBuffer(bufferStart, buffer2, index) { - let { id: id3, start, end, size } = cursor; - cursor.next(); - if (size >= 0 && id3 < minRepeatType) { - let startIndex = index; - if (size > 4) { - let endPos = cursor.pos - (size - 4); - while (cursor.pos > endPos) - index = copyToBuffer(bufferStart, buffer2, index); + let defaultReduce = parser6.stateSlot(stack.state, 4); + if (defaultReduce > 0) { + stack.reduce(defaultReduce); + if (verbose) + console.log(base2 + this.stackID(stack) + ` (via always-reduce ${parser6.getName(defaultReduce & 65535)})`); + return true; + } + if (stack.stack.length >= 15e3) { + while (stack.stack.length > 9e3 && stack.forceReduce()) { } - buffer2[--index] = startIndex; - buffer2[--index] = end - bufferStart; - buffer2[--index] = start - bufferStart; - buffer2[--index] = id3; - } else if (size == -3) { - contextHash = id3; - } else if (size == -4) { - lookAhead = id3; } - return index; + let actions = this.tokens.getActions(stack); + for (let i = 0; i < actions.length; ) { + let action = actions[i++], term = actions[i++], end = actions[i++]; + let last = i == actions.length || !split; + let localStack = last ? stack : stack.split(); + localStack.apply(action, term, end); + if (verbose) + console.log(base2 + this.stackID(localStack) + ` (via ${(action & 65536) == 0 ? "shift" : `reduce of ${parser6.getName(action & 65535)}`} for ${parser6.getName(term)} @ ${start}${localStack == stack ? "" : ", split"})`); + if (last) + return true; + else if (localStack.pos > start) + stacks.push(localStack); + else + split.push(localStack); + } + return false; } - let children = [], positions = []; - while (cursor.pos > 0) - takeNode(data.start || 0, data.bufferStart || 0, children, positions, -1); - let length = (_a4 = data.length) !== null && _a4 !== void 0 ? _a4 : children.length ? positions[0] + children[0].length : 0; - return new Tree2(types4[data.topID], children.reverse(), positions.reverse(), length); - } - var nodeSizeCache2 = /* @__PURE__ */ new WeakMap(); - function nodeSize2(balanceType, node) { - if (!balanceType.isAnonymous || node instanceof TreeBuffer2 || node.type != balanceType) - return 1; - let size = nodeSizeCache2.get(node); - if (size == null) { - size = 1; - for (let child of node.children) { - if (child.type != balanceType || !(child instanceof Tree2)) { - size = 1; - break; + advanceFully(stack, newStacks) { + let pos = stack.pos; + for (; ; ) { + if (!this.advanceStack(stack, null, null)) + return false; + if (stack.pos > pos) { + pushStackDedup(stack, newStacks); + return true; } - size += nodeSize2(balanceType, child); } - nodeSizeCache2.set(node, size); } - return size; - } - function balanceRange2(balanceType, children, positions, from2, to, start, length, mkTop, mkTree) { - let total = 0; - for (let i = from2; i < to; i++) - total += nodeSize2(balanceType, children[i]); - let maxChild = Math.ceil(total * 1.5 / 8); - let localChildren = [], localPositions = []; - function divide(children2, positions2, from3, to2, offset) { - for (let i = from3; i < to2; ) { - let groupFrom = i, groupStart = positions2[i], groupSize = nodeSize2(balanceType, children2[i]); - i++; - for (; i < to2; i++) { - let nextSize = nodeSize2(balanceType, children2[i]); - if (groupSize + nextSize >= maxChild) - break; - groupSize += nextSize; - } - if (i == groupFrom + 1) { - if (groupSize > maxChild) { - let only = children2[groupFrom]; - divide(only.children, only.positions, 0, only.children.length, positions2[groupFrom] + offset); - continue; - } - localChildren.push(children2[groupFrom]); - } else { - let length2 = positions2[i - 1] + children2[i - 1].length - groupStart; - localChildren.push(balanceRange2(balanceType, children2, positions2, groupFrom, i, groupStart, length2, null, mkTree)); + runRecovery(stacks, tokens, newStacks) { + let finished = null, restarted = false; + for (let i = 0; i < stacks.length; i++) { + let stack = stacks[i], token = tokens[i << 1], tokenEnd = tokens[(i << 1) + 1]; + let base2 = verbose ? this.stackID(stack) + " -> " : ""; + if (stack.deadEnd) { + if (restarted) + continue; + restarted = true; + stack.restart(); + if (verbose) + console.log(base2 + this.stackID(stack) + " (restarted)"); + let done = this.advanceFully(stack, newStacks); + if (done) + continue; + } + let force = stack.split(), forceBase = base2; + for (let j = 0; force.forceReduce() && j < 10; j++) { + if (verbose) + console.log(forceBase + this.stackID(force) + " (via force-reduce)"); + let done = this.advanceFully(force, newStacks); + if (done) + break; + if (verbose) + forceBase = this.stackID(force) + " -> "; + } + for (let insert2 of stack.recoverByInsert(token)) { + if (verbose) + console.log(base2 + this.stackID(insert2) + " (via recover-insert)"); + this.advanceFully(insert2, newStacks); + } + if (this.stream.end > stack.pos) { + if (tokenEnd == stack.pos) { + tokenEnd++; + token = 0; + } + stack.recoverByDelete(token, tokenEnd); + if (verbose) + console.log(base2 + this.stackID(stack) + ` (via recover-delete ${this.parser.getName(token)})`); + pushStackDedup(stack, newStacks); + } else if (!finished || finished.score < stack.score) { + finished = stack; } - localPositions.push(groupStart + offset - start); } + return finished; } - divide(children, positions, from2, to, 0); - return (mkTop || mkTree)(localChildren, localPositions, length); - } - var Parser2 = class { - startParse(input, fragments, ranges) { - if (typeof input == "string") - input = new StringInput2(input); - ranges = !ranges ? [new Range3(0, input.length)] : ranges.length ? ranges.map((r) => new Range3(r.from, r.to)) : [new Range3(0, 0)]; - return this.createParse(input, fragments || [], ranges); + stackToTree(stack) { + stack.close(); + return Tree.build({ + buffer: StackBufferCursor.create(stack), + nodeSet: this.parser.nodeSet, + topID: this.topTerm, + maxBufferLength: this.parser.bufferLength, + reused: this.reused, + start: this.ranges[0].from, + length: stack.pos - this.ranges[0].from, + minRepeatType: this.parser.minRepeatTerm + }); } - parse(input, fragments, ranges) { - let parse = this.startParse(input, fragments, ranges); - for (; ; ) { - let done = parse.advance(); - if (done) - return done; - } + stackID(stack) { + let id2 = (stackIDs || (stackIDs = /* @__PURE__ */ new WeakMap())).get(stack); + if (!id2) + stackIDs.set(stack, id2 = String.fromCodePoint(this.nextStackID++)); + return id2 + stack; } }; - var StringInput2 = class { - constructor(string3) { - this.string = string3; - } - get length() { - return this.string.length; + function pushStackDedup(stack, newStacks) { + for (let i = 0; i < newStacks.length; i++) { + let other = newStacks[i]; + if (other.pos == stack.pos && other.sameState(stack)) { + if (newStacks[i].score < stack.score) + newStacks[i] = stack; + return; + } } - chunk(from2) { - return this.string.slice(from2); + newStacks.push(stack); + } + var Dialect = class { + constructor(source, flags, disabled) { + this.source = source; + this.flags = flags; + this.disabled = disabled; } - get lineChunks() { - return false; + allows(term) { + return !this.disabled || this.disabled[term] == 0; } - read(from2, to) { - return this.string.slice(from2, to); + }; + var id = (x) => x; + var ContextTracker = class { + constructor(spec) { + this.start = spec.start; + this.shift = spec.shift || id; + this.reduce = spec.reduce || id; + this.reuse = spec.reuse || id; + this.hash = spec.hash || (() => 0); + this.strict = spec.strict !== false; } }; - var stoppedInner2 = new NodeProp2({ perNode: true }); - - // node_modules/@lezer/javascript/node_modules/@lezer/lr/dist/index.js - var Stack = class { - constructor(p, stack, state, reducePos, pos, score2, buffer, bufferBase, curContext, lookAhead = 0, parent) { - this.p = p; - this.stack = stack; - this.state = state; - this.reducePos = reducePos; - this.pos = pos; - this.score = score2; - this.buffer = buffer; - this.bufferBase = bufferBase; - this.curContext = curContext; - this.lookAhead = lookAhead; - this.parent = parent; + var LRParser = class extends Parser { + constructor(spec) { + super(); + this.wrappers = []; + if (spec.version != 13) + throw new RangeError(`Parser version (${spec.version}) doesn't match runtime version (${13})`); + let nodeNames = spec.nodeNames.split(" "); + this.minRepeatTerm = nodeNames.length; + for (let i = 0; i < spec.repeatNodeCount; i++) + nodeNames.push(""); + let topTerms = Object.keys(spec.topRules).map((r) => spec.topRules[r][1]); + let nodeProps = []; + for (let i = 0; i < nodeNames.length; i++) + nodeProps.push([]); + function setProp(nodeID, prop, value) { + nodeProps[nodeID].push([prop, prop.deserialize(String(value))]); + } + if (spec.nodeProps) + for (let propSpec of spec.nodeProps) { + let prop = propSpec[0]; + for (let i = 1; i < propSpec.length; ) { + let next = propSpec[i++]; + if (next >= 0) { + setProp(next, prop, propSpec[i++]); + } else { + let value = propSpec[i + -next]; + for (let j = -next; j > 0; j--) + setProp(propSpec[i++], prop, value); + i++; + } + } + } + this.nodeSet = new NodeSet(nodeNames.map((name2, i) => NodeType.define({ + name: i >= this.minRepeatTerm ? void 0 : name2, + id: i, + props: nodeProps[i], + top: topTerms.indexOf(i) > -1, + error: i == 0, + skipped: spec.skippedNodes && spec.skippedNodes.indexOf(i) > -1 + }))); + this.strict = false; + this.bufferLength = DefaultBufferLength; + let tokenArray = decodeArray(spec.tokenData); + this.context = spec.context; + this.specialized = new Uint16Array(spec.specialized ? spec.specialized.length : 0); + this.specializers = []; + if (spec.specialized) + for (let i = 0; i < spec.specialized.length; i++) { + this.specialized[i] = spec.specialized[i].term; + this.specializers[i] = spec.specialized[i].get; + } + this.states = decodeArray(spec.states, Uint32Array); + this.data = decodeArray(spec.stateData); + this.goto = decodeArray(spec.goto); + this.maxTerm = spec.maxTerm; + this.tokenizers = spec.tokenizers.map((value) => typeof value == "number" ? new TokenGroup(tokenArray, value) : value); + this.topRules = spec.topRules; + this.dialects = spec.dialects || {}; + this.dynamicPrecedences = spec.dynamicPrecedences || null; + this.tokenPrecTable = spec.tokenPrec; + this.termNames = spec.termNames || null; + this.maxNode = this.nodeSet.types.length - 1; + this.dialect = this.parseDialect(); + this.top = this.topRules[Object.keys(this.topRules)[0]]; } - toString() { - return `[${this.stack.filter((_, i) => i % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? "!" + this.score : ""}`; + createParse(input, fragments, ranges) { + let parse = new Parse(this, input, fragments, ranges); + for (let w of this.wrappers) + parse = w(parse, input, fragments, ranges); + return parse; } - static start(p, state, pos = 0) { - let cx = p.parser.context; - return new Stack(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext(cx, cx.start) : null, 0, null); + getGoto(state, term, loose = false) { + let table = this.goto; + if (term >= table[0]) + return -1; + for (let pos = table[term + 1]; ; ) { + let groupTag = table[pos++], last = groupTag & 1; + let target = table[pos++]; + if (last && loose) + return target; + for (let end = pos + (groupTag >> 1); pos < end; pos++) + if (table[pos] == state) + return target; + if (last) + return -1; + } } - get context() { - return this.curContext ? this.curContext.context : null; + hasAction(state, terminal) { + let data = this.data; + for (let set = 0; set < 2; set++) { + for (let i = this.stateSlot(state, set ? 2 : 1), next; ; i += 3) { + if ((next = data[i]) == 65535) { + if (data[i + 1] == 1) + next = data[i = pair(data, i + 2)]; + else if (data[i + 1] == 2) + return pair(data, i + 2); + else + break; + } + if (next == terminal || next == 0) + return pair(data, i + 1); + } + } + return 0; } - pushState(state, start) { - this.stack.push(this.state, start, this.bufferBase + this.buffer.length); - this.state = state; + stateSlot(state, slot) { + return this.states[state * 6 + slot]; } - reduce(action) { - let depth = action >> 19, type = action & 65535; - let { parser: parser7 } = this.p; - let dPrec = parser7.dynamicPrecedence(type); - if (dPrec) - this.score += dPrec; - if (depth == 0) { - this.pushState(parser7.getGoto(this.state, type, true), this.reducePos); - if (type < parser7.minRepeatTerm) - this.storeNode(type, this.reducePos, this.reducePos, 4, true); - this.reduceContext(type, this.reducePos); - return; - } - let base2 = this.stack.length - (depth - 1) * 3 - (action & 262144 ? 6 : 0); - let start = this.stack[base2 - 2]; - let bufferBase = this.stack[base2 - 1], count = this.bufferBase + this.buffer.length - bufferBase; - if (type < parser7.minRepeatTerm || action & 131072) { - let pos = parser7.stateFlag(this.state, 1) ? this.pos : this.reducePos; - this.storeNode(type, start, pos, count + 4, true); - } - if (action & 262144) { - this.state = this.stack[base2]; - } else { - let baseStateID = this.stack[base2 - 3]; - this.state = parser7.getGoto(baseStateID, type, true); - } - while (this.stack.length > base2) - this.stack.pop(); - this.reduceContext(type, start); + stateFlag(state, flag) { + return (this.stateSlot(state, 0) & flag) > 0; } - storeNode(term, start, end, size = 4, isReduce = false) { - if (term == 0 && (!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) { - let cur2 = this, top2 = this.buffer.length; - if (top2 == 0 && cur2.parent) { - top2 = cur2.bufferBase - cur2.parent.bufferBase; - cur2 = cur2.parent; - } - if (top2 > 0 && cur2.buffer[top2 - 4] == 0 && cur2.buffer[top2 - 1] > -1) { - if (start == end) - return; - if (cur2.buffer[top2 - 2] >= start) { - cur2.buffer[top2 - 2] = end; - return; - } - } - } - if (!isReduce || this.pos == end) { - this.buffer.push(term, start, end, size); - } else { - let index = this.buffer.length; - if (index > 0 && this.buffer[index - 4] != 0) - while (index > 0 && this.buffer[index - 2] > end) { - this.buffer[index] = this.buffer[index - 4]; - this.buffer[index + 1] = this.buffer[index - 3]; - this.buffer[index + 2] = this.buffer[index - 2]; - this.buffer[index + 3] = this.buffer[index - 1]; - index -= 4; - if (size > 4) - size -= 4; - } - this.buffer[index] = term; - this.buffer[index + 1] = start; - this.buffer[index + 2] = end; - this.buffer[index + 3] = size; - } - } - shift(action, next, nextEnd) { - let start = this.pos; - if (action & 131072) { - this.pushState(action & 65535, this.pos); - } else if ((action & 262144) == 0) { - let nextState = action, { parser: parser7 } = this.p; - if (nextEnd > this.pos || next <= parser7.maxNode) { - this.pos = nextEnd; - if (!parser7.stateFlag(nextState, 1)) - this.reducePos = nextEnd; + validAction(state, action) { + if (action == this.stateSlot(state, 4)) + return true; + for (let i = this.stateSlot(state, 1); ; i += 3) { + if (this.data[i] == 65535) { + if (this.data[i + 1] == 1) + i = pair(this.data, i + 2); + else + return false; } - this.pushState(nextState, start); - this.shiftContext(next, start); - if (next <= parser7.maxNode) - this.buffer.push(next, start, nextEnd, 4); - } else { - this.pos = nextEnd; - this.shiftContext(next, start); - if (next <= this.p.parser.maxNode) - this.buffer.push(next, start, nextEnd, 4); - } - } - apply(action, next, nextEnd) { - if (action & 65536) - this.reduce(action); - else - this.shift(action, next, nextEnd); - } - useNode(value, next) { - let index = this.p.reused.length - 1; - if (index < 0 || this.p.reused[index] != value) { - this.p.reused.push(value); - index++; - } - let start = this.pos; - this.reducePos = this.pos = start + value.length; - this.pushState(next, start); - this.buffer.push(index, start, this.reducePos, -1); - if (this.curContext) - this.updateContext(this.curContext.tracker.reuse(this.curContext.context, value, this, this.p.stream.reset(this.pos - value.length))); - } - split() { - let parent = this; - let off = parent.buffer.length; - while (off > 0 && parent.buffer[off - 2] > parent.reducePos) - off -= 4; - let buffer = parent.buffer.slice(off), base2 = parent.bufferBase + off; - while (parent && base2 == parent.bufferBase) - parent = parent.parent; - return new Stack(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base2, this.curContext, this.lookAhead, parent); - } - recoverByDelete(next, nextEnd) { - let isNode = next <= this.p.parser.maxNode; - if (isNode) - this.storeNode(next, this.pos, nextEnd, 4); - this.storeNode(0, this.pos, nextEnd, isNode ? 8 : 4); - this.pos = this.reducePos = nextEnd; - this.score -= 190; - } - canShift(term) { - for (let sim = new SimulatedStack(this); ; ) { - let action = this.p.parser.stateSlot(sim.state, 4) || this.p.parser.hasAction(sim.state, term); - if ((action & 65536) == 0) + if (action == pair(this.data, i + 1)) return true; - if (action == 0) - return false; - sim.reduce(action); } } - recoverByInsert(next) { - if (this.stack.length >= 300) - return []; - let nextStates = this.p.parser.nextStates(this.state); - if (nextStates.length > 4 << 1 || this.stack.length >= 120) { - let best = []; - for (let i = 0, s; i < nextStates.length; i += 2) { - if ((s = nextStates[i + 1]) != this.state && this.p.parser.hasAction(s, next)) - best.push(nextStates[i], s); - } - if (this.stack.length < 120) - for (let i = 0; best.length < 4 << 1 && i < nextStates.length; i += 2) { - let s = nextStates[i + 1]; - if (!best.some((v, i2) => i2 & 1 && v == s)) - best.push(nextStates[i], s); - } - nextStates = best; - } + nextStates(state) { let result = []; - for (let i = 0; i < nextStates.length && result.length < 4; i += 2) { - let s = nextStates[i + 1]; - if (s == this.state) - continue; - let stack = this.split(); - stack.pushState(s, this.pos); - stack.storeNode(0, stack.pos, stack.pos, 4, true); - stack.shiftContext(nextStates[i], this.pos); - stack.score -= 200; - result.push(stack); + for (let i = this.stateSlot(state, 1); ; i += 3) { + if (this.data[i] == 65535) { + if (this.data[i + 1] == 1) + i = pair(this.data, i + 2); + else + break; + } + if ((this.data[i + 2] & 65536 >> 16) == 0) { + let value = this.data[i + 1]; + if (!result.some((v, i2) => i2 & 1 && v == value)) + result.push(this.data[i], value); + } } return result; } - forceReduce() { - let reduce = this.p.parser.stateSlot(this.state, 5); - if ((reduce & 65536) == 0) - return false; - let { parser: parser7 } = this.p; - if (!parser7.validAction(this.state, reduce)) { - let depth = reduce >> 19, term = reduce & 65535; - let target = this.stack.length - depth * 3; - if (target < 0 || parser7.getGoto(this.stack[target], term, false) < 0) - return false; - this.storeNode(0, this.reducePos, this.reducePos, 4, true); - this.score -= 100; - } - this.reduce(reduce); - return true; + overrides(token, prev) { + let iPrev = findOffset(this.data, this.tokenPrecTable, prev); + return iPrev < 0 || findOffset(this.data, this.tokenPrecTable, token) < iPrev; } - forceAll() { - while (!this.p.parser.stateFlag(this.state, 2)) { - if (!this.forceReduce()) { - this.storeNode(0, this.pos, this.pos, 4, true); - break; - } + configure(config2) { + let copy = Object.assign(Object.create(LRParser.prototype), this); + if (config2.props) + copy.nodeSet = this.nodeSet.extend(...config2.props); + if (config2.top) { + let info = this.topRules[config2.top]; + if (!info) + throw new RangeError(`Invalid top rule name ${config2.top}`); + copy.top = info; } - return this; - } - get deadEnd() { - if (this.stack.length != 3) - return false; - let { parser: parser7 } = this.p; - return parser7.data[parser7.stateSlot(this.state, 1)] == 65535 && !parser7.stateSlot(this.state, 4); + if (config2.tokenizers) + copy.tokenizers = this.tokenizers.map((t2) => { + let found = config2.tokenizers.find((r) => r.from == t2); + return found ? found.to : t2; + }); + if (config2.contextTracker) + copy.context = config2.contextTracker; + if (config2.dialect) + copy.dialect = this.parseDialect(config2.dialect); + if (config2.strict != null) + copy.strict = config2.strict; + if (config2.wrap) + copy.wrappers = copy.wrappers.concat(config2.wrap); + if (config2.bufferLength != null) + copy.bufferLength = config2.bufferLength; + return copy; } - restart() { - this.state = this.stack[0]; - this.stack.length = 0; + getName(term) { + return this.termNames ? this.termNames[term] : String(term <= this.maxNode && this.nodeSet.types[term].name || term); } - sameState(other) { - if (this.state != other.state || this.stack.length != other.stack.length) - return false; - for (let i = 0; i < this.stack.length; i += 3) - if (this.stack[i] != other.stack[i]) - return false; - return true; + get eofTerm() { + return this.maxNode + 1; } - get parser() { - return this.p.parser; + get topNode() { + return this.nodeSet.types[this.top[1]]; } - dialectEnabled(dialectID) { - return this.p.parser.dialect.flags[dialectID]; + dynamicPrecedence(term) { + let prec2 = this.dynamicPrecedences; + return prec2 == null ? 0 : prec2[term] || 0; } - shiftContext(term, start) { - if (this.curContext) - this.updateContext(this.curContext.tracker.shift(this.curContext.context, term, this, this.p.stream.reset(start))); + parseDialect(dialect) { + let values2 = Object.keys(this.dialects), flags = values2.map(() => false); + if (dialect) + for (let part of dialect.split(" ")) { + let id2 = values2.indexOf(part); + if (id2 >= 0) + flags[id2] = true; + } + let disabled = null; + for (let i = 0; i < values2.length; i++) + if (!flags[i]) { + for (let j = this.dialects[values2[i]], id2; (id2 = this.data[j++]) != 65535; ) + (disabled || (disabled = new Uint8Array(this.maxTerm + 1)))[id2] = 1; + } + return new Dialect(dialect, flags, disabled); } - reduceContext(term, start) { - if (this.curContext) - this.updateContext(this.curContext.tracker.reduce(this.curContext.context, term, this, this.p.stream.reset(start))); + static deserialize(spec) { + return new LRParser(spec); } - emitContext() { - let last = this.buffer.length - 1; - if (last < 0 || this.buffer[last] != -3) - this.buffer.push(this.curContext.hash, this.reducePos, this.reducePos, -3); + }; + function pair(data, off) { + return data[off] | data[off + 1] << 16; + } + function findOffset(data, start, term) { + for (let i = start, next; (next = data[i]) != 65535; i++) + if (next == term) + return i - start; + return -1; + } + function findFinished(stacks) { + let best = null; + for (let stack of stacks) { + let stopped = stack.p.stoppedAt; + if ((stack.pos == stack.p.stream.end || stopped != null && stack.pos > stopped) && stack.p.parser.stateFlag(stack.state, 2) && (!best || best.score < stack.score)) + best = stack; } - emitLookAhead() { - let last = this.buffer.length - 1; - if (last < 0 || this.buffer[last] != -4) - this.buffer.push(this.lookAhead, this.reducePos, this.reducePos, -4); - } - updateContext(context) { - if (context != this.curContext.context) { - let newCx = new StackContext(this.curContext.tracker, context); - if (newCx.hash != this.curContext.hash) - this.emitContext(); - this.curContext = newCx; - } - } - setLookAhead(lookAhead) { - if (lookAhead > this.lookAhead) { - this.emitLookAhead(); - this.lookAhead = lookAhead; - } - } - close() { - if (this.curContext && this.curContext.tracker.strict) - this.emitContext(); - if (this.lookAhead > 0) - this.emitLookAhead(); - } - }; - var StackContext = class { - constructor(tracker, context) { - this.tracker = tracker; - this.context = context; - this.hash = tracker.strict ? tracker.hash(context) : 0; - } - }; - var Recover; - (function(Recover4) { - Recover4[Recover4["Insert"] = 200] = "Insert"; - Recover4[Recover4["Delete"] = 190] = "Delete"; - Recover4[Recover4["Reduce"] = 100] = "Reduce"; - Recover4[Recover4["MaxNext"] = 4] = "MaxNext"; - Recover4[Recover4["MaxInsertStackDepth"] = 300] = "MaxInsertStackDepth"; - Recover4[Recover4["DampenInsertStackDepth"] = 120] = "DampenInsertStackDepth"; - })(Recover || (Recover = {})); - var SimulatedStack = class { - constructor(start) { - this.start = start; - this.state = start.state; - this.stack = start.stack; - this.base = this.stack.length; - } - reduce(action) { - let term = action & 65535, depth = action >> 19; - if (depth == 0) { - if (this.stack == this.start.stack) - this.stack = this.stack.slice(); - this.stack.push(this.state, 0, 0); - this.base += 3; - } else { - this.base -= (depth - 1) * 3; - } - let goto2 = this.start.p.parser.getGoto(this.stack[this.base - 3], term, true); - this.state = goto2; - } - }; - var StackBufferCursor = class { - constructor(stack, pos, index) { - this.stack = stack; - this.pos = pos; - this.index = index; - this.buffer = stack.buffer; - if (this.index == 0) - this.maybeNext(); - } - static create(stack, pos = stack.bufferBase + stack.buffer.length) { - return new StackBufferCursor(stack, pos, pos - stack.bufferBase); - } - maybeNext() { - let next = this.stack.parent; - if (next != null) { - this.index = this.stack.bufferBase - next.bufferBase; - this.stack = next; - this.buffer = next.buffer; + return best; + } + + // node_modules/@lezer/javascript/dist/index.es.js + var noSemi = 279; + var incdec = 1; + var incdecPrefix = 2; + var templateContent = 280; + var InterpolationStart = 3; + var templateEnd = 281; + var insertSemi = 282; + var TSExtends = 4; + var spaces = 284; + var newline = 285; + var LineComment = 5; + var BlockComment = 6; + var Dialect_ts = 1; + var space = [ + 9, + 10, + 11, + 12, + 13, + 32, + 133, + 160, + 5760, + 8192, + 8193, + 8194, + 8195, + 8196, + 8197, + 8198, + 8199, + 8200, + 8201, + 8202, + 8232, + 8233, + 8239, + 8287, + 12288 + ]; + var braceR = 125; + var braceL = 123; + var semicolon = 59; + var slash = 47; + var star = 42; + var plus = 43; + var minus = 45; + var dollar = 36; + var backtick = 96; + var backslash = 92; + var trackNewline = new ContextTracker({ + start: false, + shift(context, term) { + return term == LineComment || term == BlockComment || term == spaces ? context : term == newline; + }, + strict: false + }); + var insertSemicolon = new ExternalTokenizer((input, stack) => { + let { next } = input; + if ((next == braceR || next == -1 || stack.context) && stack.canShift(insertSemi)) + input.acceptToken(insertSemi); + }, { contextual: true, fallback: true }); + var noSemicolon = new ExternalTokenizer((input, stack) => { + let { next } = input, after; + if (space.indexOf(next) > -1) + return; + if (next == slash && ((after = input.peek(1)) == slash || after == star)) + return; + if (next != braceR && next != semicolon && next != -1 && !stack.context && stack.canShift(noSemi)) + input.acceptToken(noSemi); + }, { contextual: true }); + var incdecToken = new ExternalTokenizer((input, stack) => { + let { next } = input; + if (next == plus || next == minus) { + input.advance(); + if (next == input.next) { + input.advance(); + let mayPostfix = !stack.context && stack.canShift(incdec); + input.acceptToken(mayPostfix ? incdec : incdecPrefix); } } - get id() { - return this.buffer[this.index - 4]; - } - get start() { - return this.buffer[this.index - 3]; - } - get end() { - return this.buffer[this.index - 2]; - } - get size() { - return this.buffer[this.index - 1]; - } - next() { - this.index -= 4; - this.pos -= 4; - if (this.index == 0) - this.maybeNext(); - } - fork() { - return new StackBufferCursor(this.stack, this.pos, this.index); - } - }; - var CachedToken = class { - constructor() { - this.start = -1; - this.value = -1; - this.end = -1; - this.extended = -1; - this.lookAhead = 0; - this.mask = 0; - this.context = 0; - } - }; - var nullToken = new CachedToken(); - var InputStream = class { - constructor(input, ranges) { - this.input = input; - this.ranges = ranges; - this.chunk = ""; - this.chunkOff = 0; - this.chunk2 = ""; - this.chunk2Pos = 0; - this.next = -1; - this.token = nullToken; - this.rangeIndex = 0; - this.pos = this.chunkPos = ranges[0].from; - this.range = ranges[0]; - this.end = ranges[ranges.length - 1].to; - this.readNext(); - } - resolveOffset(offset, assoc) { - let range = this.range, index = this.rangeIndex; - let pos = this.pos + offset; - while (pos < range.from) { - if (!index) - return null; - let next = this.ranges[--index]; - pos -= range.from - next.to; - range = next; - } - while (assoc < 0 ? pos > range.to : pos >= range.to) { - if (index == this.ranges.length - 1) - return null; - let next = this.ranges[++index]; - pos += next.from - range.to; - range = next; + }, { contextual: true }); + var template = new ExternalTokenizer((input) => { + for (let afterDollar = false, i = 0; ; i++) { + let { next } = input; + if (next < 0) { + if (i) + input.acceptToken(templateContent); + break; + } else if (next == backtick) { + if (i) + input.acceptToken(templateContent); + else + input.acceptToken(templateEnd, 1); + break; + } else if (next == braceL && afterDollar) { + if (i == 1) + input.acceptToken(InterpolationStart, 1); + else + input.acceptToken(templateContent, -1); + break; + } else if (next == 10 && i) { + input.advance(); + input.acceptToken(templateContent); + break; + } else if (next == backslash) { + input.advance(); } - return pos; + afterDollar = next == dollar; + input.advance(); } - peek(offset) { - let idx = this.chunkOff + offset, pos, result; - if (idx >= 0 && idx < this.chunk.length) { - pos = this.pos + offset; - result = this.chunk.charCodeAt(idx); - } else { - let resolved = this.resolveOffset(offset, 1); - if (resolved == null) - return -1; - pos = resolved; - if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) { - result = this.chunk2.charCodeAt(pos - this.chunk2Pos); - } else { - let i = this.rangeIndex, range = this.range; - while (range.to <= pos) - range = this.ranges[++i]; - this.chunk2 = this.input.chunk(this.chunk2Pos = pos); - if (pos + this.chunk2.length > range.to) - this.chunk2 = this.chunk2.slice(0, range.to - pos); - result = this.chunk2.charCodeAt(0); - } - } - if (pos >= this.token.lookAhead) - this.token.lookAhead = pos + 1; - return result; - } - acceptToken(token, endOffset = 0) { - let end = endOffset ? this.resolveOffset(endOffset, -1) : this.pos; - if (end == null || end < this.token.start) - throw new RangeError("Token end out of bounds"); - this.token.value = token; - this.token.end = end; - } - getChunk() { - if (this.pos >= this.chunk2Pos && this.pos < this.chunk2Pos + this.chunk2.length) { - let { chunk, chunkPos } = this; - this.chunk = this.chunk2; - this.chunkPos = this.chunk2Pos; - this.chunk2 = chunk; - this.chunk2Pos = chunkPos; - this.chunkOff = this.pos - this.chunkPos; - } else { - this.chunk2 = this.chunk; - this.chunk2Pos = this.chunkPos; - let nextChunk = this.input.chunk(this.pos); - let end = this.pos + nextChunk.length; - this.chunk = end > this.range.to ? nextChunk.slice(0, this.range.to - this.pos) : nextChunk; - this.chunkPos = this.pos; - this.chunkOff = 0; - } - } - readNext() { - if (this.chunkOff >= this.chunk.length) { - this.getChunk(); - if (this.chunkOff == this.chunk.length) - return this.next = -1; - } - return this.next = this.chunk.charCodeAt(this.chunkOff); - } - advance(n = 1) { - this.chunkOff += n; - while (this.pos + n >= this.range.to) { - if (this.rangeIndex == this.ranges.length - 1) - return this.setDone(); - n -= this.range.to - this.pos; - this.range = this.ranges[++this.rangeIndex]; - this.pos = this.range.from; - } - this.pos += n; - if (this.pos >= this.token.lookAhead) - this.token.lookAhead = this.pos + 1; - return this.readNext(); - } - setDone() { - this.pos = this.chunkPos = this.end; - this.range = this.ranges[this.rangeIndex = this.ranges.length - 1]; - this.chunk = ""; - return this.next = -1; - } - reset(pos, token) { - if (token) { - this.token = token; - token.start = pos; - token.lookAhead = pos + 1; - token.value = token.extended = -1; - } else { - this.token = nullToken; - } - if (this.pos != pos) { - this.pos = pos; - if (pos == this.end) { - this.setDone(); - return this; - } - while (pos < this.range.from) - this.range = this.ranges[--this.rangeIndex]; - while (pos >= this.range.to) - this.range = this.ranges[++this.rangeIndex]; - if (pos >= this.chunkPos && pos < this.chunkPos + this.chunk.length) { - this.chunkOff = pos - this.chunkPos; - } else { - this.chunk = ""; - this.chunkOff = 0; - } - this.readNext(); - } - return this; - } - read(from2, to) { - if (from2 >= this.chunkPos && to <= this.chunkPos + this.chunk.length) - return this.chunk.slice(from2 - this.chunkPos, to - this.chunkPos); - if (from2 >= this.chunk2Pos && to <= this.chunk2Pos + this.chunk2.length) - return this.chunk2.slice(from2 - this.chunk2Pos, to - this.chunk2Pos); - if (from2 >= this.range.from && to <= this.range.to) - return this.input.read(from2, to); - let result = ""; - for (let r of this.ranges) { - if (r.from >= to) - break; - if (r.to > from2) - result += this.input.read(Math.max(r.from, from2), Math.min(r.to, to)); - } - return result; - } - }; - var TokenGroup = class { - constructor(data, id3) { - this.data = data; - this.id = id3; - } - token(input, stack) { - readToken(this.data, input, stack, this.id); - } - }; - TokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false; - var ExternalTokenizer = class { - constructor(token, options = {}) { - this.token = token; - this.contextual = !!options.contextual; - this.fallback = !!options.fallback; - this.extend = !!options.extend; - } - }; - function readToken(data, input, stack, group) { - let state = 0, groupMask = 1 << group, { parser: parser7 } = stack.p, { dialect } = parser7; - scan: - for (; ; ) { - if ((groupMask & data[state]) == 0) - break; - let accEnd = data[state + 1]; - for (let i = state + 3; i < accEnd; i += 2) - if ((data[i + 1] & groupMask) > 0) { - let term = data[i]; - if (dialect.allows(term) && (input.token.value == -1 || input.token.value == term || parser7.overrides(term, input.token.value))) { - input.acceptToken(term); - break; - } + }); + function tsExtends(value, stack) { + return value == "extends" && stack.dialectEnabled(Dialect_ts) ? TSExtends : -1; + } + var spec_identifier = { __proto__: null, export: 18, as: 23, from: 29, default: 32, async: 37, function: 38, this: 48, true: 56, false: 56, void: 66, typeof: 70, null: 86, super: 88, new: 122, await: 139, yield: 141, delete: 142, class: 152, extends: 154, public: 197, private: 197, protected: 197, readonly: 199, instanceof: 220, in: 222, const: 224, import: 256, keyof: 307, unique: 311, infer: 317, is: 351, abstract: 371, implements: 373, type: 375, let: 378, var: 380, interface: 387, enum: 391, namespace: 397, module: 399, declare: 403, global: 407, for: 428, of: 437, while: 440, with: 444, do: 448, if: 452, else: 454, switch: 458, case: 464, try: 470, catch: 472, finally: 474, return: 478, throw: 482, break: 486, continue: 490, debugger: 494 }; + var spec_word = { __proto__: null, async: 109, get: 111, set: 113, public: 161, private: 161, protected: 161, static: 163, abstract: 165, override: 167, readonly: 173, new: 355 }; + var spec_LessThan = { __proto__: null, "<": 129 }; + var parser = LRParser.deserialize({ + version: 13, + states: "$1jO`QYOOO'QQ!LdO'#ChO'XOSO'#DVO)dQYO'#D]O)tQYO'#DhO){QYO'#DrO-xQYO'#DxOOQO'#E]'#E]O.]QWO'#E[O.bQWO'#E[OOQ!LS'#Ef'#EfO0aQ!LdO'#IrO2wQ!LdO'#IsO3eQWO'#EzO3jQpO'#FaOOQ!LS'#FS'#FSO3rO!bO'#FSO4QQWO'#FhO5_QWO'#FgOOQ!LS'#Is'#IsOOQ!LQ'#Ir'#IrOOQQ'#J['#J[O5dQWO'#HnO5iQ!LYO'#HoOOQQ'#If'#IfOOQQ'#Hp'#HpQ`QYOOO){QY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T!_#o%T#p~%T~!?OO!T~%r!?VT'u%j$UWO!^%T!_!`5T!`#o%T#p#q!=P#q~%T$u!?oR!S$knQ$UWO!^%T!_#o%T#p~%TX!@PR!kP$UWO!^%T!_#o%T#p~%T,T!@gr$UW'W+{#zS'Z%k'epOX%TXY%cYZ%TZ[%c[p%Tpq%cqt%Ttu2`u}%T}!O3j!O!Q%T!Q![2`![!^%T!_!c%T!c!}2`!}#R%T#R#S2`#S#T%T#T#o2`#p$f%T$f$g%c$g#BY2`#BY#BZ!@Y#BZ$IS2`$IS$I_!@Y$I_$JT2`$JT$JU!@Y$JU$KV2`$KV$KW!@Y$KW&FU2`&FU&FV!@Y&FV?HT2`?HT?HU!@Y?HU~2`,T!CO_$UW'X+{#zS'Z%k'epOt%Ttu2`u}%T}!O3j!O!Q%T!Q![2`![!^%T!_!c%T!c!}2`!}#R%T#R#S2`#S#T%T#T#o2`#p$g%T$g~2`", + tokenizers: [noSemicolon, incdecToken, template, 0, 1, 2, 3, 4, 5, 6, 7, 8, insertSemicolon], + topRules: { "Script": [0, 7] }, + dialects: { jsx: 11335, ts: 11337 }, + dynamicPrecedences: { "149": 1, "176": 1 }, + specialized: [{ term: 287, get: (value, stack) => tsExtends(value, stack) << 1 }, { term: 287, get: (value) => spec_identifier[value] || -1 }, { term: 297, get: (value) => spec_word[value] || -1 }, { term: 63, get: (value) => spec_LessThan[value] || -1 }], + tokenPrec: 11358 + }); + + // node_modules/@codemirror/lang-javascript/dist/index.js + var snippets = [ + /* @__PURE__ */ snippetCompletion("function ${name}(${params}) {\n ${}\n}", { + label: "function", + detail: "definition", + type: "keyword" + }), + /* @__PURE__ */ snippetCompletion("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}", { + label: "for", + detail: "loop", + type: "keyword" + }), + /* @__PURE__ */ snippetCompletion("for (let ${name} of ${collection}) {\n ${}\n}", { + label: "for", + detail: "of loop", + type: "keyword" + }), + /* @__PURE__ */ snippetCompletion("try {\n ${}\n} catch (${error}) {\n ${}\n}", { + label: "try", + detail: "block", + type: "keyword" + }), + /* @__PURE__ */ snippetCompletion("class ${name} {\n constructor(${params}) {\n ${}\n }\n}", { + label: "class", + detail: "definition", + type: "keyword" + }), + /* @__PURE__ */ snippetCompletion('import {${names}} from "${module}"\n${}', { + label: "import", + detail: "named", + type: "keyword" + }), + /* @__PURE__ */ snippetCompletion('import ${name} from "${module}"\n${}', { + label: "import", + detail: "default", + type: "keyword" + }) + ]; + var javascriptLanguage = /* @__PURE__ */ LRLanguage.define({ + parser: /* @__PURE__ */ parser.configure({ + props: [ + /* @__PURE__ */ indentNodeProp.add({ + IfStatement: /* @__PURE__ */ continuedIndent({ except: /^\s*({|else\b)/ }), + TryStatement: /* @__PURE__ */ continuedIndent({ except: /^\s*({|catch\b|finally\b)/ }), + LabeledStatement: flatIndent, + SwitchBody: (context) => { + let after = context.textAfter, closed = /^\s*\}/.test(after), isCase = /^\s*(case|default)\b/.test(after); + return context.baseIndent + (closed ? 0 : isCase ? 1 : 2) * context.unit; + }, + Block: /* @__PURE__ */ delimitedIndent({ closing: "}" }), + ArrowFunction: (cx) => cx.baseIndent + cx.unit, + "TemplateString BlockComment": () => -1, + "Statement Property": /* @__PURE__ */ continuedIndent({ except: /^{/ }), + JSXElement(context) { + let closed = /^\s*<\//.test(context.textAfter); + return context.lineIndent(context.node.from) + (closed ? 0 : context.unit); + }, + JSXEscape(context) { + let closed = /\s*\}/.test(context.textAfter); + return context.lineIndent(context.node.from) + (closed ? 0 : context.unit); + }, + "JSXOpenTag JSXSelfClosingTag"(context) { + return context.column(context.node.from) + context.unit; } - for (let next = input.next, low = 0, high = data[state + 2]; low < high; ) { - let mid = low + high >> 1; - let index = accEnd + mid + (mid << 1); - let from2 = data[index], to = data[index + 1]; - if (next < from2) - high = mid; - else if (next >= to) - low = mid + 1; - else { - state = data[index + 2]; - input.advance(); - continue scan; + }), + /* @__PURE__ */ foldNodeProp.add({ + "Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression": foldInside, + BlockComment(tree) { + return { from: tree.from + 2, to: tree.to - 2 }; } - } - break; - } - } - function decodeArray(input, Type = Uint16Array) { - if (typeof input != "string") - return input; - let array2 = null; - for (let pos = 0, out = 0; pos < input.length; ) { - let value = 0; - for (; ; ) { - let next = input.charCodeAt(pos++), stop = false; - if (next == 126) { - value = 65535; - break; - } - if (next >= 92) - next--; - if (next >= 34) - next--; - let digit = next - 32; - if (digit >= 46) { - digit -= 46; - stop = true; - } - value += digit; - if (stop) - break; - value *= 46; - } - if (array2) - array2[out++] = value; - else - array2 = new Type(value); + }), + /* @__PURE__ */ styleTags({ + "get set async static": tags.modifier, + "for while do if else switch try catch finally return throw break continue default case": tags.controlKeyword, + "in of await yield void typeof delete instanceof": tags.operatorKeyword, + "let var const function class extends": tags.definitionKeyword, + "import export from": tags.moduleKeyword, + "with debugger as new": tags.keyword, + TemplateString: /* @__PURE__ */ tags.special(tags.string), + Super: tags.atom, + BooleanLiteral: tags.bool, + this: tags.self, + null: tags.null, + Star: tags.modifier, + VariableName: tags.variableName, + "CallExpression/VariableName TaggedTemplateExpression/VariableName": /* @__PURE__ */ tags.function(tags.variableName), + VariableDefinition: /* @__PURE__ */ tags.definition(tags.variableName), + Label: tags.labelName, + PropertyName: tags.propertyName, + PrivatePropertyName: /* @__PURE__ */ tags.special(tags.propertyName), + "CallExpression/MemberExpression/PropertyName": /* @__PURE__ */ tags.function(tags.propertyName), + "FunctionDeclaration/VariableDefinition": /* @__PURE__ */ tags.function(/* @__PURE__ */ tags.definition(tags.variableName)), + "ClassDeclaration/VariableDefinition": /* @__PURE__ */ tags.definition(tags.className), + PropertyDefinition: /* @__PURE__ */ tags.definition(tags.propertyName), + PrivatePropertyDefinition: /* @__PURE__ */ tags.definition(/* @__PURE__ */ tags.special(tags.propertyName)), + UpdateOp: tags.updateOperator, + LineComment: tags.lineComment, + BlockComment: tags.blockComment, + Number: tags.number, + String: tags.string, + ArithOp: tags.arithmeticOperator, + LogicOp: tags.logicOperator, + BitOp: tags.bitwiseOperator, + CompareOp: tags.compareOperator, + RegExp: tags.regexp, + Equals: tags.definitionOperator, + "Arrow : Spread": tags.punctuation, + "( )": tags.paren, + "[ ]": tags.squareBracket, + "{ }": tags.brace, + "InterpolationStart InterpolationEnd": /* @__PURE__ */ tags.special(tags.brace), + ".": tags.derefOperator, + ", ;": tags.separator, + TypeName: tags.typeName, + TypeDefinition: /* @__PURE__ */ tags.definition(tags.typeName), + "type enum interface implements namespace module declare": tags.definitionKeyword, + "abstract global Privacy readonly override": tags.modifier, + "is keyof unique infer": tags.operatorKeyword, + JSXAttributeValue: tags.attributeValue, + JSXText: tags.content, + "JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag": tags.angleBracket, + "JSXIdentifier JSXNameSpacedName": tags.tagName, + "JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName": tags.attributeName + }) + ] + }), + languageData: { + closeBrackets: { brackets: ["(", "[", "{", "'", '"', "`"] }, + commentTokens: { line: "//", block: { open: "/*", close: "*/" } }, + indentOnInput: /^\s*(?:case |default:|\{|\}|<\/)$/, + wordChars: "$" } - return array2; + }); + var typescriptLanguage = /* @__PURE__ */ javascriptLanguage.configure({ dialect: "ts" }); + var jsxLanguage = /* @__PURE__ */ javascriptLanguage.configure({ dialect: "jsx" }); + var tsxLanguage = /* @__PURE__ */ javascriptLanguage.configure({ dialect: "jsx ts" }); + function javascript(config2 = {}) { + let lang = config2.jsx ? config2.typescript ? tsxLanguage : jsxLanguage : config2.typescript ? typescriptLanguage : javascriptLanguage; + return new LanguageSupport(lang, javascriptLanguage.data.of({ + autocomplete: ifNotIn(["LineComment", "BlockComment", "String"], completeFromList(snippets)) + })); } - var verbose = typeof process != "undefined" && /\bparse\b/.test(process.env.LOG); - var stackIDs = null; - var Safety; - (function(Safety4) { - Safety4[Safety4["Margin"] = 25] = "Margin"; - })(Safety || (Safety = {})); - function cutAt(tree, pos, side) { - let cursor = tree.cursor(IterMode.IncludeAnonymous); - cursor.moveTo(pos); - for (; ; ) { - if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos))) - for (; ; ) { - if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError) - return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25)) : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25)); - if (side < 0 ? cursor.prevSibling() : cursor.nextSibling()) - break; - if (!cursor.parent()) - return side < 0 ? 0 : tree.length; - } + + // node_modules/@lezer/json/dist/index.es.js + var parser2 = LRParser.deserialize({ + version: 13, + states: "$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j", + stateData: "#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O", + goto: "!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R", + nodeNames: "\u26A0 JsonText True False Null Number String } { Object Property PropertyName ] [ Array", + maxTerm: 25, + nodeProps: [ + [NodeProp.openedBy, 7, "{", 12, "["], + [NodeProp.closedBy, 8, "}", 13, "]"] + ], + skippedNodes: [0], + repeatNodeCount: 2, + tokenData: "(p~RaXY!WYZ!W]^!Wpq!Wrs!]|}$i}!O$n!Q!R$w!R![&V![!]&h!}#O&m#P#Q&r#Y#Z&w#b#c'f#h#i'}#o#p(f#q#r(k~!]Oc~~!`Upq!]qr!]rs!rs#O!]#O#P!w#P~!]~!wOe~~!zXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#g~#jR!Q![#s!c!i#s#T#Z#s~#vR!Q![$P!c!i$P#T#Z$P~$SR!Q![$]!c!i$]#T#Z$]~$`R!Q![!]!c!i!]#T#Z!]~$nOh~~$qQ!Q!R$w!R![&V~$|RT~!O!P%V!g!h%k#X#Y%k~%YP!Q![%]~%bRT~!Q![%]!g!h%k#X#Y%k~%nR{|%w}!O%w!Q![%}~%zP!Q![%}~&SPT~!Q![%}~&[ST~!O!P%V!Q![&V!g!h%k#X#Y%k~&mOg~~&rO]~~&wO[~~&zP#T#U&}~'QP#`#a'T~'WP#g#h'Z~'^P#X#Y'a~'fOR~~'iP#i#j'l~'oP#`#a'r~'uP#`#a'x~'}OS~~(QP#f#g(T~(WP#i#j(Z~(^P#X#Y(a~(fOQ~~(kOW~~(pOV~", + tokenizers: [0], + topRules: { "JsonText": [0, 1] }, + tokenPrec: 0 + }); + + // node_modules/@codemirror/lang-json/dist/index.js + var jsonLanguage = /* @__PURE__ */ LRLanguage.define({ + parser: /* @__PURE__ */ parser2.configure({ + props: [ + /* @__PURE__ */ indentNodeProp.add({ + Object: /* @__PURE__ */ continuedIndent({ except: /^\s*\}/ }), + Array: /* @__PURE__ */ continuedIndent({ except: /^\s*\]/ }) + }), + /* @__PURE__ */ foldNodeProp.add({ + "Object Array": foldInside + }), + /* @__PURE__ */ styleTags({ + String: tags.string, + Number: tags.number, + "True False": tags.bool, + PropertyName: tags.propertyName, + Null: tags.null, + ",": tags.separator, + "[ ]": tags.squareBracket, + "{ }": tags.brace + }) + ] + }), + languageData: { + closeBrackets: { brackets: ["[", "{", '"'] }, + indentOnInput: /^\s*[\}\]]$/ } + }); + function json() { + return new LanguageSupport(jsonLanguage); } - var FragmentCursor2 = class { - constructor(fragments, nodeSet) { - this.fragments = fragments; - this.nodeSet = nodeSet; - this.i = 0; - this.fragment = null; - this.safeFrom = -1; - this.safeTo = -1; - this.trees = []; - this.start = []; - this.index = []; - this.nextFragment(); - } - nextFragment() { - let fr = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++]; - if (fr) { - this.safeFrom = fr.openStart ? cutAt(fr.tree, fr.from + fr.offset, 1) - fr.offset : fr.from; - this.safeTo = fr.openEnd ? cutAt(fr.tree, fr.to + fr.offset, -1) - fr.offset : fr.to; - while (this.trees.length) { - this.trees.pop(); - this.start.pop(); - this.index.pop(); - } - this.trees.push(fr.tree); - this.start.push(-fr.offset); - this.index.push(0); - this.nextStart = this.safeFrom; - } else { - this.nextStart = 1e9; - } - } - nodeAt(pos) { - if (pos < this.nextStart) - return null; - while (this.fragment && this.safeTo <= pos) - this.nextFragment(); - if (!this.fragment) - return null; - for (; ; ) { - let last = this.trees.length - 1; - if (last < 0) { - this.nextFragment(); - return null; - } - let top2 = this.trees[last], index = this.index[last]; - if (index == top2.children.length) { - this.trees.pop(); - this.start.pop(); - this.index.pop(); - continue; - } - let next = top2.children[index]; - let start = this.start[last] + top2.positions[index]; - if (start > pos) { - this.nextStart = start; - return null; - } - if (next instanceof Tree2) { - if (start == pos) { - if (start < this.safeFrom) - return null; - let end = start + next.length; - if (end <= this.safeTo) { - let lookAhead = next.prop(NodeProp2.lookAhead); - if (!lookAhead || end + lookAhead < this.fragment.to) - return next; - } - } - this.index[last]++; - if (start + next.length >= Math.max(this.safeFrom, pos)) { - this.trees.push(next); - this.start.push(start); - this.index.push(0); - } - } else { - this.index[last]++; - this.nextStart = start + next.length; - } - } - } - }; - var TokenCache = class { - constructor(parser7, stream) { - this.stream = stream; - this.tokens = []; - this.mainToken = null; - this.actions = []; - this.tokens = parser7.tokenizers.map((_) => new CachedToken()); - } - getActions(stack) { - let actionIndex = 0; - let main = null; - let { parser: parser7 } = stack.p, { tokenizers } = parser7; - let mask = parser7.stateSlot(stack.state, 3); - let context = stack.curContext ? stack.curContext.hash : 0; - let lookAhead = 0; - for (let i = 0; i < tokenizers.length; i++) { - if ((1 << i & mask) == 0) - continue; - let tokenizer = tokenizers[i], token = this.tokens[i]; - if (main && !tokenizer.fallback) - continue; - if (tokenizer.contextual || token.start != stack.pos || token.mask != mask || token.context != context) { - this.updateCachedToken(token, tokenizer, stack); - token.mask = mask; - token.context = context; - } - if (token.lookAhead > token.end + 25) - lookAhead = Math.max(token.lookAhead, lookAhead); - if (token.value != 0) { - let startIndex = actionIndex; - if (token.extended > -1) - actionIndex = this.addActions(stack, token.extended, token.end, actionIndex); - actionIndex = this.addActions(stack, token.value, token.end, actionIndex); - if (!tokenizer.extend) { - main = token; - if (actionIndex > startIndex) - break; - } - } + + // node_modules/@lezer/php/dist/index.es.js + var castOpen = 1; + var HeredocString = 2; + var interpolatedStringContent = 262; + var EscapeSequence = 3; + var afterInterpolation = 263; + var automaticSemicolon = 264; + var eof = 265; + var abstract = 4; + var and = 5; + var array = 6; + var as = 7; + var Boolean = 8; + var _break = 9; + var _case = 10; + var _catch = 11; + var _class = 12; + var clone = 13; + var _const = 14; + var _continue = 15; + var _default = 16; + var declare = 17; + var _do = 18; + var echo = 19; + var _else = 20; + var elseif = 21; + var enddeclare = 22; + var endfor = 23; + var endforeach = 24; + var endif = 25; + var endswitch = 26; + var endwhile = 27; + var _enum = 28; + var _extends = 29; + var final = 30; + var _finally = 31; + var fn = 32; + var _for = 33; + var foreach = 34; + var from = 35; + var _function = 36; + var global = 37; + var goto = 38; + var _if = 39; + var _implements = 40; + var include = 41; + var include_once = 42; + var _instanceof = 43; + var insteadof = 44; + var _interface = 45; + var list = 46; + var match = 47; + var namespace = 48; + var _new = 49; + var _null = 50; + var or = 51; + var print = 52; + var require2 = 53; + var require_once = 54; + var _return = 55; + var _switch = 56; + var _throw = 57; + var trait = 58; + var _try = 59; + var unset = 60; + var use = 61; + var _var = 62; + var Visibility = 63; + var _while = 64; + var xor = 65; + var _yield = 66; + var keywordMap = { + abstract, + and, + array, + as, + true: Boolean, + false: Boolean, + break: _break, + case: _case, + catch: _catch, + class: _class, + clone, + const: _const, + continue: _continue, + declare, + default: _default, + do: _do, + echo, + else: _else, + elseif, + enddeclare, + endfor, + endforeach, + endif, + endswitch, + endwhile, + enum: _enum, + extends: _extends, + final, + finally: _finally, + fn, + for: _for, + foreach, + from, + function: _function, + global, + goto, + if: _if, + implements: _implements, + include, + include_once, + instanceof: _instanceof, + insteadof, + interface: _interface, + list, + match, + namespace, + new: _new, + null: _null, + or, + print, + require: require2, + require_once, + return: _return, + switch: _switch, + throw: _throw, + trait, + try: _try, + unset, + use, + var: _var, + public: Visibility, + private: Visibility, + protected: Visibility, + while: _while, + xor, + yield: _yield, + __proto__: null + }; + function keywords(name2) { + let found = keywordMap[name2.toLowerCase()]; + return found == null ? -1 : found; + } + function isSpace(ch) { + return ch == 9 || ch == 10 || ch == 13 || ch == 32; + } + function isASCIILetter(ch) { + return ch >= 97 && ch <= 122 || ch >= 65 && ch <= 90; + } + function isIdentifierStart(ch) { + return ch == 95 || ch >= 128 || isASCIILetter(ch); + } + function isHex(ch) { + return ch >= 48 && ch <= 55 || ch >= 97 && ch <= 102 || ch >= 65 && ch <= 70; + } + var castTypes = { + int: true, + integer: true, + bool: true, + boolean: true, + float: true, + double: true, + real: true, + string: true, + array: true, + object: true, + unset: true, + __proto__: null + }; + var expression = new ExternalTokenizer((input) => { + if (input.next == 40) { + input.advance(); + let peek = 0; + while (isSpace(input.peek(peek))) + peek++; + let name2 = "", next; + while (isASCIILetter(next = input.peek(peek))) { + name2 += String.fromCharCode(next); + peek++; } - while (this.actions.length > actionIndex) - this.actions.pop(); - if (lookAhead) - stack.setLookAhead(lookAhead); - if (!main && stack.pos == this.stream.end) { - main = new CachedToken(); - main.value = stack.p.parser.eofTerm; - main.start = main.end = stack.pos; - actionIndex = this.addActions(stack, main.value, main.end, actionIndex); + while (isSpace(input.peek(peek))) + peek++; + if (input.peek(peek) == 41 && castTypes[name2.toLowerCase()]) + input.acceptToken(castOpen); + } else if (input.next == 60 && input.peek(1) == 60 && input.peek(2) == 60) { + for (let i = 0; i < 3; i++) + input.advance(); + while (input.next == 32 || input.next == 9) + input.advance(); + let quoted = input.next == 39; + if (quoted) + input.advance(); + if (!isIdentifierStart(input.next)) + return; + let tag = String.fromCharCode(input.next); + for (; ; ) { + input.advance(); + if (!isIdentifierStart(input.next) && !(input.next >= 48 && input.next <= 55)) + break; + tag += String.fromCharCode(input.next); } - this.mainToken = main; - return this.actions; - } - getMainToken(stack) { - if (this.mainToken) - return this.mainToken; - let main = new CachedToken(), { pos, p } = stack; - main.start = pos; - main.end = Math.min(pos + 1, p.stream.end); - main.value = pos == p.stream.end ? p.parser.eofTerm : 0; - return main; - } - updateCachedToken(token, tokenizer, stack) { - tokenizer.token(this.stream.reset(stack.pos, token), stack); - if (token.value > -1) { - let { parser: parser7 } = stack.p; - for (let i = 0; i < parser7.specialized.length; i++) - if (parser7.specialized[i] == token.value) { - let result = parser7.specializers[i](this.stream.read(token.start, token.end), stack); - if (result >= 0 && stack.p.parser.dialect.allows(result >> 1)) { - if ((result & 1) == 0) - token.value = result >> 1; - else - token.extended = result >> 1; + if (quoted) { + if (input.next != 39) + return; + input.advance(); + } + if (input.next != 10 && input.next != 13) + return; + for (; ; ) { + let lineStart = input.next == 10 || input.next == 13; + input.advance(); + if (input.next < 0) + return; + if (lineStart) { + while (input.next == 32 || input.next == 9) + input.advance(); + let match2 = true; + for (let i = 0; i < tag.length; i++) { + if (input.next != tag.charCodeAt(i)) { + match2 = false; break; } + input.advance(); } - } else { - token.value = 0; - token.end = Math.min(stack.p.stream.end, stack.pos + 1); + if (match2) + return input.acceptToken(HeredocString); + } } } - putAction(action, token, end, index) { - for (let i = 0; i < index; i += 3) - if (this.actions[i] == action) - return index; - this.actions[index++] = action; - this.actions[index++] = token; - this.actions[index++] = end; - return index; - } - addActions(stack, token, end, index) { - let { state } = stack, { parser: parser7 } = stack.p, { data } = parser7; - for (let set = 0; set < 2; set++) { - for (let i = parser7.stateSlot(state, set ? 2 : 1); ; i += 3) { - if (data[i] == 65535) { - if (data[i + 1] == 1) { - i = pair(data, i + 2); - } else { - if (index == 0 && data[i + 1] == 2) - index = this.putAction(pair(data, i + 2), token, end, index); - break; - } - } - if (data[i] == token) - index = this.putAction(pair(data, i + 1), token, end, index); - } - } - return index; - } - }; - var Rec; - (function(Rec4) { - Rec4[Rec4["Distance"] = 5] = "Distance"; - Rec4[Rec4["MaxRemainingPerStep"] = 3] = "MaxRemainingPerStep"; - Rec4[Rec4["MinBufferLengthPrune"] = 500] = "MinBufferLengthPrune"; - Rec4[Rec4["ForceReduceLimit"] = 10] = "ForceReduceLimit"; - Rec4[Rec4["CutDepth"] = 15e3] = "CutDepth"; - Rec4[Rec4["CutTo"] = 9e3] = "CutTo"; - })(Rec || (Rec = {})); - var Parse = class { - constructor(parser7, input, fragments, ranges) { - this.parser = parser7; - this.input = input; - this.ranges = ranges; - this.recovering = 0; - this.nextStackID = 9812; - this.minStackPos = 0; - this.reused = []; - this.stoppedAt = null; - this.stream = new InputStream(input, ranges); - this.tokens = new TokenCache(parser7, this.stream); - this.topTerm = parser7.top[1]; - let { from: from2 } = ranges[0]; - this.stacks = [Stack.start(this, parser7.top[0], from2)]; - this.fragments = fragments.length && this.stream.end - from2 > parser7.bufferLength * 4 ? new FragmentCursor2(fragments, parser7.nodeSet) : null; + }); + var eofToken = new ExternalTokenizer((input) => { + if (input.next < 0) + input.acceptToken(eof); + }); + var semicolon2 = new ExternalTokenizer((input, stack) => { + if (input.next == 63 && stack.canShift(automaticSemicolon) && input.peek(1) == 62) + input.acceptToken(automaticSemicolon); + }); + function scanEscape(input) { + let after = input.peek(1); + if (after == 110 || after == 114 || after == 116 || after == 118 || after == 101 || after == 102 || after == 92 || after == 36 || after == 34 || after == 123) + return 2; + if (after >= 48 && after <= 55) { + let size = 2, next; + while (size < 5 && (next = input.peek(size)) >= 48 && next <= 55) + size++; + return size; } - get parsedPos() { - return this.minStackPos; + if (after == 120 && isHex(input.peek(2))) { + return isHex(input.peek(3)) ? 4 : 3; } - advance() { - let stacks = this.stacks, pos = this.minStackPos; - let newStacks = this.stacks = []; - let stopped, stoppedTokens; - for (let i = 0; i < stacks.length; i++) { - let stack = stacks[i]; - for (; ; ) { - this.tokens.mainToken = null; - if (stack.pos > pos) { - newStacks.push(stack); - } else if (this.advanceStack(stack, newStacks, stacks)) { - continue; - } else { - if (!stopped) { - stopped = []; - stoppedTokens = []; - } - stopped.push(stack); - let tok = this.tokens.getMainToken(stack); - stoppedTokens.push(tok.value, tok.end); - } + if (after == 117 && input.peek(2) == 123) { + for (let size = 3; ; size++) { + let next = input.peek(size); + if (next == 125) + return size == 2 ? 0 : size + 1; + if (!isHex(next)) break; - } - } - if (!newStacks.length) { - let finished = stopped && findFinished(stopped); - if (finished) - return this.stackToTree(finished); - if (this.parser.strict) { - if (verbose && stopped) - console.log("Stuck with token " + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : "none")); - throw new SyntaxError("No parse at " + pos); - } - if (!this.recovering) - this.recovering = 5; - } - if (this.recovering && stopped) { - let finished = this.stoppedAt != null && stopped[0].pos > this.stoppedAt ? stopped[0] : this.runRecovery(stopped, stoppedTokens, newStacks); - if (finished) - return this.stackToTree(finished.forceAll()); - } - if (this.recovering) { - let maxRemaining = this.recovering == 1 ? 1 : this.recovering * 3; - if (newStacks.length > maxRemaining) { - newStacks.sort((a, b) => b.score - a.score); - while (newStacks.length > maxRemaining) - newStacks.pop(); - } - if (newStacks.some((s) => s.reducePos > pos)) - this.recovering--; - } else if (newStacks.length > 1) { - outer: - for (let i = 0; i < newStacks.length - 1; i++) { - let stack = newStacks[i]; - for (let j = i + 1; j < newStacks.length; j++) { - let other = newStacks[j]; - if (stack.sameState(other) || stack.buffer.length > 500 && other.buffer.length > 500) { - if ((stack.score - other.score || stack.buffer.length - other.buffer.length) > 0) { - newStacks.splice(j--, 1); - } else { - newStacks.splice(i--, 1); - continue outer; - } - } - } - } } - this.minStackPos = newStacks[0].pos; - for (let i = 1; i < newStacks.length; i++) - if (newStacks[i].pos < this.minStackPos) - this.minStackPos = newStacks[i].pos; - return null; - } - stopAt(pos) { - if (this.stoppedAt != null && this.stoppedAt < pos) - throw new RangeError("Can't move stoppedAt forward"); - this.stoppedAt = pos; } - advanceStack(stack, stacks, split) { - let start = stack.pos, { parser: parser7 } = this; - let base2 = verbose ? this.stackID(stack) + " -> " : ""; - if (this.stoppedAt != null && start > this.stoppedAt) - return stack.forceReduce() ? stack : null; - if (this.fragments) { - let strictCx = stack.curContext && stack.curContext.tracker.strict, cxHash = strictCx ? stack.curContext.hash : 0; - for (let cached = this.fragments.nodeAt(start); cached; ) { - let match2 = this.parser.nodeSet.types[cached.type.id] == cached.type ? parser7.getGoto(stack.state, cached.type.id) : -1; - if (match2 > -1 && cached.length && (!strictCx || (cached.prop(NodeProp2.contextHash) || 0) == cxHash)) { - stack.useNode(cached, match2); - if (verbose) - console.log(base2 + this.stackID(stack) + ` (via reuse of ${parser7.getName(cached.type.id)})`); - return true; - } - if (!(cached instanceof Tree2) || cached.children.length == 0 || cached.positions[0] > 0) + return 0; + } + var interpolated = new ExternalTokenizer((input, stack) => { + let content2 = false; + for (; ; content2 = true) { + if (input.next == 34 || input.next < 0 || input.next == 36 && (isIdentifierStart(input.peek(1)) || input.peek(1) == 123) || input.next == 123 && input.peek(1) == 36) { + break; + } else if (input.next == 92) { + let escaped = scanEscape(input); + if (escaped) { + if (content2) break; - let inner = cached.children[0]; - if (inner instanceof Tree2 && cached.positions[0] == 0) - cached = inner; else - break; - } - } - let defaultReduce = parser7.stateSlot(stack.state, 4); - if (defaultReduce > 0) { - stack.reduce(defaultReduce); - if (verbose) - console.log(base2 + this.stackID(stack) + ` (via always-reduce ${parser7.getName(defaultReduce & 65535)})`); - return true; - } - if (stack.stack.length >= 15e3) { - while (stack.stack.length > 9e3 && stack.forceReduce()) { - } - } - let actions = this.tokens.getActions(stack); - for (let i = 0; i < actions.length; ) { - let action = actions[i++], term = actions[i++], end = actions[i++]; - let last = i == actions.length || !split; - let localStack = last ? stack : stack.split(); - localStack.apply(action, term, end); - if (verbose) - console.log(base2 + this.stackID(localStack) + ` (via ${(action & 65536) == 0 ? "shift" : `reduce of ${parser7.getName(action & 65535)}`} for ${parser7.getName(term)} @ ${start}${localStack == stack ? "" : ", split"})`); - if (last) - return true; - else if (localStack.pos > start) - stacks.push(localStack); - else - split.push(localStack); - } - return false; - } - advanceFully(stack, newStacks) { - let pos = stack.pos; - for (; ; ) { - if (!this.advanceStack(stack, null, null)) - return false; - if (stack.pos > pos) { - pushStackDedup(stack, newStacks); - return true; - } - } - } - runRecovery(stacks, tokens, newStacks) { - let finished = null, restarted = false; - for (let i = 0; i < stacks.length; i++) { - let stack = stacks[i], token = tokens[i << 1], tokenEnd = tokens[(i << 1) + 1]; - let base2 = verbose ? this.stackID(stack) + " -> " : ""; - if (stack.deadEnd) { - if (restarted) - continue; - restarted = true; - stack.restart(); - if (verbose) - console.log(base2 + this.stackID(stack) + " (restarted)"); - let done = this.advanceFully(stack, newStacks); - if (done) - continue; - } - let force = stack.split(), forceBase = base2; - for (let j = 0; force.forceReduce() && j < 10; j++) { - if (verbose) - console.log(forceBase + this.stackID(force) + " (via force-reduce)"); - let done = this.advanceFully(force, newStacks); - if (done) - break; - if (verbose) - forceBase = this.stackID(force) + " -> "; - } - for (let insert4 of stack.recoverByInsert(token)) { - if (verbose) - console.log(base2 + this.stackID(insert4) + " (via recover-insert)"); - this.advanceFully(insert4, newStacks); - } - if (this.stream.end > stack.pos) { - if (tokenEnd == stack.pos) { - tokenEnd++; - token = 0; - } - stack.recoverByDelete(token, tokenEnd); - if (verbose) - console.log(base2 + this.stackID(stack) + ` (via recover-delete ${this.parser.getName(token)})`); - pushStackDedup(stack, newStacks); - } else if (!finished || finished.score < stack.score) { - finished = stack; + return input.acceptToken(EscapeSequence, escaped); } + } else if (!content2 && (input.next == 91 || input.next == 45 && input.peek(1) == 62 && isIdentifierStart(input.peek(2)) || input.next == 63 && input.peek(1) == 45 && input.peek(2) == 62 && isIdentifierStart(input.peek(3))) && stack.canShift(afterInterpolation)) { + break; } - return finished; - } - stackToTree(stack) { - stack.close(); - return Tree2.build({ - buffer: StackBufferCursor.create(stack), - nodeSet: this.parser.nodeSet, - topID: this.topTerm, - maxBufferLength: this.parser.bufferLength, - reused: this.reused, - start: this.ranges[0].from, - length: stack.pos - this.ranges[0].from, - minRepeatType: this.parser.minRepeatTerm - }); - } - stackID(stack) { - let id3 = (stackIDs || (stackIDs = /* @__PURE__ */ new WeakMap())).get(stack); - if (!id3) - stackIDs.set(stack, id3 = String.fromCodePoint(this.nextStackID++)); - return id3 + stack; + input.advance(); } + if (content2) + input.acceptToken(interpolatedStringContent); + }); + var spec_Name = { __proto__: null, static: 311, STATIC: 311 }; + var parser3 = LRParser.deserialize({ + version: 13, + states: "$F|Q`OWOOQhQaOOP%oO`OOOOO#t'#H^'#H^O%tO#|O'#DuOOO#u'#Dx'#DxQ&SOWO'#DxO&XO$VOOOOQ#u'#Dy'#DyO&lQaO'#D}O(mQdO'#FOO(tQdO'#ERO*kQaO'#EXO,zQ`O'#EUO-PQ`O'#E_O/nQaO'#E_O/uQ`O'#EgO/zQ`O'#EpO*kQaO'#EpO0VQ`O'#HgO0[Q`O'#E|O0[Q`O'#E|OOQS'#Ib'#IbO0aQ`O'#EwOOQS'#IY'#IYO2oQdO'#IVO6tQeO'#FUO*kQaO'#FeO*kQaO'#FfO*kQaO'#FgO*kQaO'#FhO*kQaO'#FhO*kQaO'#FkOOQO'#Ic'#IcO7RQ`O'#FqOOQO'#Hh'#HhO7ZQ`O'#G}O7uQ`O'#FlO8QQ`O'#H[O8]Q`O'#FvO8eQaO'#FwO*kQaO'#GUO*kQaO'#GXO8}OrO'#G[OOQS'#Ip'#IpOOQS'#Io'#IoOOQS'#IV'#IVO,zQ`O'#GcO,zQ`O'#GeO,zQ`O'#GjOhQaO'#GlO9UQ`O'#GmO9ZQ`O'#GpO9`Q`O'#GsO9eQeO'#GtO9eQeO'#GuO9eQeO'#GvO9oQ`O'#G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S4U4Y4`4a4b4c4d4e4f4g4h4i4j4k4l4m4n4o4p4q4r4s4t4u4v4w5P5d5g5h5k5o5p5s$O=y_j!]!i#k#n#o#s#t%R%T&o&r&s&v&}'y(k(z)O)k*O*T,U,W-Q6]6^6_6`6a6b6c6d6e6f6g6h6i6j6k6l6m6n6o6p6q6r6s6t6u6y6z6{7W7k7n7q7v7{8S8T8W8Y8Z8e8f8g8h#|>[!y!z!}%c&W)s)u*S*n,S-c-j.s/b/h/l0c0u4V6S7h7r7t7y8i8j8k8l8m8n8o8p8q8r8s8t8u8v8w8x8y8z8{8|8}9O9P9Q9R9S9Y9Z9[9g9x9|9}:Q:X:Y:^:`:a;b;c=Y=l=m!v>]+y-P9U9W:c:d:e:f:g:i:j:l:n:o:q:s:u:w:y:{:};P;R;T;V;X;Z;];_;d;f;h;s^0U1[9V:h:k:m:p:r:t:v:x:z:|;O;Q;S;U;W;Y;[;^;`;e;g;t AssignmentExpression ArrayExpression ValueList & VariadicUnpacking ... Pair [ ] ListExpression ValueList Pair Pair SubscriptExpression MemberExpression -> ?-> VariableName DynamicVariable $ ${ CallExpression ArgList NamedArgument SpreadArgument CastExpression UnionType LogicOp OptionalType NamedType QualifiedName \\ NamespaceName ScopedExpression :: AssignOp UpdateExpression UpdateOp YieldExpression BinaryExpression LogicOp LogicOp LogicOp BitOp BitOp BitOp CompareOp CompareOp BitOp ArithOp ConcatOp ArithOp ArithOp IncludeExpression RequireExpression CloneExpression UnaryExpression ControlOp LogicOp PrintIntrinsic FunctionExpression static ParamList Parameter #[ Attributes Attribute VariadicParameter PropertyParameter UseList ArrowFunction NewExpression BaseClause ClassInterfaceClause DeclarationList ConstDeclaration VariableDeclarator PropertyDeclaration VariableDeclarator MethodDeclaration UseDeclaration UseList UseInsteadOfClause UseAsClause UpdateExpression ArithOp ShellExpression ThrowExpression Integer Float String MemberExpression SubscriptExpression UnaryExpression ArithOp Interpolation String IfStatement ColonBlock SwitchStatement Block CaseStatement DefaultStatement ColonBlock WhileStatement EmptyStatement DoStatement ForStatement ForSpec SequenceExpression ForeachStatement ForSpec Pair GotoStatement ContinueStatement BreakStatement ReturnStatement TryStatement CatchDeclarator DeclareStatement EchoStatement UnsetStatement ConstDeclaration FunctionDefinition ClassDeclaration InterfaceDeclaration TraitDeclaration EnumDeclaration EnumBody EnumCase NamespaceDefinition NamespaceUseDeclaration UseGroup UseClause UseClause GlobalDeclaration FunctionStaticDeclaration Program", + maxTerm: 303, + nodeProps: [ + [NodeProp.group, -36, 2, 8, 50, 82, 84, 86, 89, 94, 95, 103, 107, 108, 111, 112, 115, 119, 124, 127, 130, 132, 133, 147, 148, 149, 150, 153, 154, 164, 165, 178, 180, 181, 182, 183, 184, 190, "Expression", -28, 75, 79, 81, 83, 191, 193, 198, 200, 201, 204, 207, 208, 209, 210, 211, 213, 214, 215, 216, 217, 218, 219, 220, 221, 224, 225, 229, 230, "Statement", -3, 120, 122, 123, "Type"], + [NodeProp.openedBy, 70, "phpOpen", 77, "{", 87, "(", 102, "#["], + [NodeProp.closedBy, 72, "phpClose", 78, "}", 88, ")", 158, "]"] + ], + skippedNodes: [0], + repeatNodeCount: 29, + tokenData: "!5h_R!ZOX$tXY%nYZ&}Z]$t]^%n^p$tpq%nqr(]rs)wst*atu/nuv2_vw3`wx4gxy8Oyz8fz{8|{|:W|};_}!O;u!O!P=R!P!QBl!Q!RFr!R![Hn![!]Nz!]!^!!O!^!_!!f!_!`!%R!`!a!&V!a!b!'Z!b!c!*T!c!d!*k!d!e!+q!e!}!*k!}#O!-k#O#P!.R#P#Q!.i#Q#R!/P#R#S!*k#S#T!/j#T#U!*k#U#V!+q#V#o!*k#o#p!2y#p#q!3a#q#r!4j#r#s!5Q#s$f$t$f$g%n$g&j!*k&j$I_$t$I_$I`%n$I`$KW$t$KW$KX%n$KX?HT$t?HT?HU%n?HU~$tP$yT&vPOY$tYZ%YZ!^$t!^!_%_!_~$tP%_O&vPP%bSOY$tYZ%YZ!a$t!b~$tV%ub&vP&uUOX$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$twx4gx!Q$t!Q![!*k![!^$t!^!_%_!_!c$t!c!}!*k!}#R$t#R#S!*k#S#T$t#T#o!*k#o$g$t$g&j!*k&j~$tR!-[T&vP'fQOY$tYZ%YZ!^$t!^!_%_!_~$tV!-rT#XU&vPOY$tYZ%YZ!^$t!^!_%_!_~$tV!.YT#qU&vPOY$tYZ%YZ!^$t!^!_%_!_~$tR!.pT#YQ&vPOY$tYZ%YZ!^$t!^!_%_!_~$tR!/WU$OQ&vPOY$tYZ%YZ!^$t!^!_%_!_!`2x!`~$tR!/oX&vPOY!/jYZ!0[Z!^!/j!^!_!1_!_#O!/j#O#P!1}#P#S!/j#S#T!2c#T~!/jR!0aT&vPO#O!0p#O#P!1S#P#S!0p#S#T!1Y#T~!0pQ!0sTO#O!0p#O#P!1S#P#S!0p#S#T!1Y#T~!0pQ!1VPO~!0pQ!1_O$zQR!1bXOY!/jYZ!0[Z!a!/j!a!b!0p!b#O!/j#O#P!1}#P#S!/j#S#T!2c#T~!/jR!2ST&vPOY!/jYZ!0[Z!^!/j!^!_!1_!_~!/jR!2jT$zQ&vPOY$tYZ%YZ!^$t!^!_%_!_~$tV!3QT!pU&vPOY$tYZ%YZ!^$t!^!_%_!_~$tV!3jW#}Q#mS&vPOY$tYZ%YZ!^$t!^!_%_!_!`2x!`#p$t#p#q!4S#q~$tR!4ZT#{Q&vPOY$tYZ%YZ!^$t!^!_%_!_~$tR!4qT!oQ&vPOY$tYZ%YZ!^$t!^!_%_!_~$tR!5XT$^Q&vPOY$tYZ%YZ!^$t!^!_%_!_~$t", + tokenizers: [expression, interpolated, semicolon2, 0, 1, 2, 3, eofToken], + topRules: { "Template": [0, 73], "Program": [1, 231] }, + dynamicPrecedences: { "283": 1 }, + specialized: [{ term: 82, get: (value, stack) => keywords(value) << 1 }, { term: 82, get: (value) => spec_Name[value] || -1 }], + tokenPrec: 29359 + }); + + // node_modules/@lezer/html/dist/index.es.js + var scriptText = 53; + var StartCloseScriptTag = 1; + var styleText = 54; + var StartCloseStyleTag = 2; + var textareaText = 55; + var StartCloseTextareaTag = 3; + var StartTag = 4; + var StartScriptTag = 5; + var StartStyleTag = 6; + var StartTextareaTag = 7; + var StartSelfClosingTag = 8; + var StartCloseTag = 9; + var NoMatchStartCloseTag = 10; + var MismatchedStartCloseTag = 11; + var missingCloseTag = 56; + var IncompleteCloseTag = 12; + var commentContent$1 = 57; + var Element = 18; + var ScriptText = 27; + var StyleText = 30; + var TextareaText = 33; + var OpenTag = 35; + var Dialect_noMatch = 0; + var selfClosers = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + frame: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true, + menuitem: true }; - function pushStackDedup(stack, newStacks) { - for (let i = 0; i < newStacks.length; i++) { - let other = newStacks[i]; - if (other.pos == stack.pos && other.sameState(stack)) { - if (newStacks[i].score < stack.score) - newStacks[i] = stack; - return; - } - } - newStacks.push(stack); + var implicitlyClosed = { + dd: true, + li: true, + optgroup: true, + option: true, + p: true, + rp: true, + rt: true, + tbody: true, + td: true, + tfoot: true, + th: true, + tr: true + }; + var closeOnOpen = { + dd: { dd: true, dt: true }, + dt: { dd: true, dt: true }, + li: { li: true }, + option: { option: true, optgroup: true }, + optgroup: { optgroup: true }, + p: { + address: true, + article: true, + aside: true, + blockquote: true, + dir: true, + div: true, + dl: true, + fieldset: true, + footer: true, + form: true, + h1: true, + h2: true, + h3: true, + h4: true, + h5: true, + h6: true, + header: true, + hgroup: true, + hr: true, + menu: true, + nav: true, + ol: true, + p: true, + pre: true, + section: true, + table: true, + ul: true + }, + rp: { rp: true, rt: true }, + rt: { rp: true, rt: true }, + tbody: { tbody: true, tfoot: true }, + td: { td: true, th: true }, + tfoot: { tbody: true }, + th: { td: true, th: true }, + thead: { tbody: true, tfoot: true }, + tr: { tr: true } + }; + function nameChar(ch) { + return ch == 45 || ch == 46 || ch == 58 || ch >= 65 && ch <= 90 || ch == 95 || ch >= 97 && ch <= 122 || ch >= 161; } - var Dialect = class { - constructor(source, flags, disabled) { - this.source = source; - this.flags = flags; - this.disabled = disabled; + function isSpace2(ch) { + return ch == 9 || ch == 10 || ch == 13 || ch == 32; + } + var cachedName = null; + var cachedInput = null; + var cachedPos = 0; + function tagNameAfter(input, offset) { + let pos = input.pos + offset; + if (cachedPos == pos && cachedInput == input) + return cachedName; + let next = input.peek(offset); + while (isSpace2(next)) + next = input.peek(++offset); + let name2 = ""; + for (; ; ) { + if (!nameChar(next)) + break; + name2 += String.fromCharCode(next); + next = input.peek(++offset); } - allows(term) { - return !this.disabled || this.disabled[term] == 0; + cachedInput = input; + cachedPos = pos; + return cachedName = name2 ? name2.toLowerCase() : next == question || next == bang ? void 0 : null; + } + var lessThan = 60; + var greaterThan = 62; + var slash2 = 47; + var question = 63; + var bang = 33; + function ElementContext(name2, parent) { + this.name = name2; + this.parent = parent; + this.hash = parent ? parent.hash : 0; + for (let i = 0; i < name2.length; i++) + this.hash += (this.hash << 4) + name2.charCodeAt(i) + (name2.charCodeAt(i) << 8); + } + var startTagTerms = [StartTag, StartSelfClosingTag, StartScriptTag, StartStyleTag, StartTextareaTag]; + var elementContext = new ContextTracker({ + start: null, + shift(context, term, stack, input) { + return startTagTerms.indexOf(term) > -1 ? new ElementContext(tagNameAfter(input, 1) || "", context) : context; + }, + reduce(context, term) { + return term == Element && context ? context.parent : context; + }, + reuse(context, node, stack, input) { + let type = node.type.id; + return type == StartTag || type == OpenTag ? new ElementContext(tagNameAfter(input, 1) || "", context) : context; + }, + hash(context) { + return context ? context.hash : 0; + }, + strict: false + }); + var tagStart = new ExternalTokenizer((input, stack) => { + if (input.next != lessThan) { + if (input.next < 0 && stack.context) + input.acceptToken(missingCloseTag); + return; } - }; - var id = (x) => x; - var ContextTracker = class { - constructor(spec) { - this.start = spec.start; - this.shift = spec.shift || id; - this.reduce = spec.reduce || id; - this.reuse = spec.reuse || id; - this.hash = spec.hash || (() => 0); - this.strict = spec.strict !== false; + input.advance(); + let close = input.next == slash2; + if (close) + input.advance(); + let name2 = tagNameAfter(input, 0); + if (name2 === void 0) + return; + if (!name2) + return input.acceptToken(close ? IncompleteCloseTag : StartTag); + let parent = stack.context ? stack.context.name : null; + if (close) { + if (name2 == parent) + return input.acceptToken(StartCloseTag); + if (parent && implicitlyClosed[parent]) + return input.acceptToken(missingCloseTag, -2); + if (stack.dialectEnabled(Dialect_noMatch)) + return input.acceptToken(NoMatchStartCloseTag); + for (let cx = stack.context; cx; cx = cx.parent) + if (cx.name == name2) + return; + input.acceptToken(MismatchedStartCloseTag); + } else { + if (name2 == "script") + return input.acceptToken(StartScriptTag); + if (name2 == "style") + return input.acceptToken(StartStyleTag); + if (name2 == "textarea") + return input.acceptToken(StartTextareaTag); + if (selfClosers.hasOwnProperty(name2)) + return input.acceptToken(StartSelfClosingTag); + if (parent && closeOnOpen[parent] && closeOnOpen[parent][name2]) + input.acceptToken(missingCloseTag, -1); + else + input.acceptToken(StartTag); } - }; - var LRParser = class extends Parser2 { - constructor(spec) { - super(); - this.wrappers = []; - if (spec.version != 14) - throw new RangeError(`Parser version (${spec.version}) doesn't match runtime version (${14})`); - let nodeNames = spec.nodeNames.split(" "); - this.minRepeatTerm = nodeNames.length; - for (let i = 0; i < spec.repeatNodeCount; i++) - nodeNames.push(""); - let topTerms = Object.keys(spec.topRules).map((r) => spec.topRules[r][1]); - let nodeProps = []; - for (let i = 0; i < nodeNames.length; i++) - nodeProps.push([]); - function setProp(nodeID, prop, value) { - nodeProps[nodeID].push([prop, prop.deserialize(String(value))]); + }, { contextual: true }); + var commentContent = new ExternalTokenizer((input) => { + for (let endPos = 0, i = 0; ; i++) { + if (input.next < 0) { + if (i) + input.acceptToken(commentContent$1); + break; } - if (spec.nodeProps) - for (let propSpec of spec.nodeProps) { - let prop = propSpec[0]; - if (typeof prop == "string") - prop = NodeProp2[prop]; - for (let i = 1; i < propSpec.length; ) { - let next = propSpec[i++]; - if (next >= 0) { - setProp(next, prop, propSpec[i++]); - } else { - let value = propSpec[i + -next]; - for (let j = -next; j > 0; j--) - setProp(propSpec[i++], prop, value); - i++; - } - } - } - this.nodeSet = new NodeSet2(nodeNames.map((name3, i) => NodeType2.define({ - name: i >= this.minRepeatTerm ? void 0 : name3, - id: i, - props: nodeProps[i], - top: topTerms.indexOf(i) > -1, - error: i == 0, - skipped: spec.skippedNodes && spec.skippedNodes.indexOf(i) > -1 - }))); - if (spec.propSources) - this.nodeSet = this.nodeSet.extend(...spec.propSources); - this.strict = false; - this.bufferLength = DefaultBufferLength2; - let tokenArray = decodeArray(spec.tokenData); - this.context = spec.context; - this.specialized = new Uint16Array(spec.specialized ? spec.specialized.length : 0); - this.specializers = []; - if (spec.specialized) - for (let i = 0; i < spec.specialized.length; i++) { - this.specialized[i] = spec.specialized[i].term; - this.specializers[i] = spec.specialized[i].get; - } - this.states = decodeArray(spec.states, Uint32Array); - this.data = decodeArray(spec.stateData); - this.goto = decodeArray(spec.goto); - this.maxTerm = spec.maxTerm; - this.tokenizers = spec.tokenizers.map((value) => typeof value == "number" ? new TokenGroup(tokenArray, value) : value); - this.topRules = spec.topRules; - this.dialects = spec.dialects || {}; - this.dynamicPrecedences = spec.dynamicPrecedences || null; - this.tokenPrecTable = spec.tokenPrec; - this.termNames = spec.termNames || null; - this.maxNode = this.nodeSet.types.length - 1; - this.dialect = this.parseDialect(); - this.top = this.topRules[Object.keys(this.topRules)[0]]; - } - createParse(input, fragments, ranges) { - let parse = new Parse(this, input, fragments, ranges); - for (let w of this.wrappers) - parse = w(parse, input, fragments, ranges); - return parse; - } - getGoto(state, term, loose = false) { - let table = this.goto; - if (term >= table[0]) - return -1; - for (let pos = table[term + 1]; ; ) { - let groupTag = table[pos++], last = groupTag & 1; - let target = table[pos++]; - if (last && loose) - return target; - for (let end = pos + (groupTag >> 1); pos < end; pos++) - if (table[pos] == state) - return target; - if (last) - return -1; - } - } - hasAction(state, terminal) { - let data = this.data; - for (let set = 0; set < 2; set++) { - for (let i = this.stateSlot(state, set ? 2 : 1), next; ; i += 3) { - if ((next = data[i]) == 65535) { - if (data[i + 1] == 1) - next = data[i = pair(data, i + 2)]; - else if (data[i + 1] == 2) - return pair(data, i + 2); - else - break; - } - if (next == terminal || next == 0) - return pair(data, i + 1); + if (input.next == "-->".charCodeAt(endPos)) { + endPos++; + if (endPos == 3) { + if (i > 3) + input.acceptToken(commentContent$1, -2); + break; } + } else { + endPos = 0; } - return 0; - } - stateSlot(state, slot) { - return this.states[state * 6 + slot]; - } - stateFlag(state, flag) { - return (this.stateSlot(state, 0) & flag) > 0; + input.advance(); } - validAction(state, action) { - if (action == this.stateSlot(state, 4)) - return true; - for (let i = this.stateSlot(state, 1); ; i += 3) { - if (this.data[i] == 65535) { - if (this.data[i + 1] == 1) - i = pair(this.data, i + 2); - else - return false; + }); + function contentTokenizer(tag, textToken, endToken) { + let lastState = 2 + tag.length; + return new ExternalTokenizer((input) => { + for (let state = 0, matchedLen = 0, i = 0; ; i++) { + if (input.next < 0) { + if (i) + input.acceptToken(textToken); + break; } - if (action == pair(this.data, i + 1)) - return true; - } - } - nextStates(state) { - let result = []; - for (let i = this.stateSlot(state, 1); ; i += 3) { - if (this.data[i] == 65535) { - if (this.data[i + 1] == 1) - i = pair(this.data, i + 2); + if (state == 0 && input.next == lessThan || state == 1 && input.next == slash2 || state >= 2 && state < lastState && input.next == tag.charCodeAt(state - 2)) { + state++; + matchedLen++; + } else if ((state == 2 || state == lastState) && isSpace2(input.next)) { + matchedLen++; + } else if (state == lastState && input.next == greaterThan) { + if (i > matchedLen) + input.acceptToken(textToken, -matchedLen); else - break; - } - if ((this.data[i + 2] & 65536 >> 16) == 0) { - let value = this.data[i + 1]; - if (!result.some((v, i2) => i2 & 1 && v == value)) - result.push(this.data[i], value); + input.acceptToken(endToken, -(matchedLen - 2)); + break; + } else if ((input.next == 10 || input.next == 13) && i) { + input.acceptToken(textToken, 1); + break; + } else { + state = matchedLen = 0; } + input.advance(); } - return result; - } - overrides(token, prev) { - let iPrev = findOffset(this.data, this.tokenPrecTable, prev); - return iPrev < 0 || findOffset(this.data, this.tokenPrecTable, token) < iPrev; - } - configure(config2) { - let copy = Object.assign(Object.create(LRParser.prototype), this); - if (config2.props) - copy.nodeSet = this.nodeSet.extend(...config2.props); - if (config2.top) { - let info = this.topRules[config2.top]; - if (!info) - throw new RangeError(`Invalid top rule name ${config2.top}`); - copy.top = info; - } - if (config2.tokenizers) - copy.tokenizers = this.tokenizers.map((t3) => { - let found = config2.tokenizers.find((r) => r.from == t3); - return found ? found.to : t3; - }); - if (config2.contextTracker) - copy.context = config2.contextTracker; - if (config2.dialect) - copy.dialect = this.parseDialect(config2.dialect); - if (config2.strict != null) - copy.strict = config2.strict; - if (config2.wrap) - copy.wrappers = copy.wrappers.concat(config2.wrap); - if (config2.bufferLength != null) - copy.bufferLength = config2.bufferLength; - return copy; - } - hasWrappers() { - return this.wrappers.length > 0; - } - getName(term) { - return this.termNames ? this.termNames[term] : String(term <= this.maxNode && this.nodeSet.types[term].name || term); - } - get eofTerm() { - return this.maxNode + 1; - } - get topNode() { - return this.nodeSet.types[this.top[1]]; - } - dynamicPrecedence(term) { - let prec4 = this.dynamicPrecedences; - return prec4 == null ? 0 : prec4[term] || 0; - } - parseDialect(dialect) { - let values2 = Object.keys(this.dialects), flags = values2.map(() => false); - if (dialect) - for (let part of dialect.split(" ")) { - let id3 = values2.indexOf(part); - if (id3 >= 0) - flags[id3] = true; - } - let disabled = null; - for (let i = 0; i < values2.length; i++) - if (!flags[i]) { - for (let j = this.dialects[values2[i]], id3; (id3 = this.data[j++]) != 65535; ) - (disabled || (disabled = new Uint8Array(this.maxTerm + 1)))[id3] = 1; - } - return new Dialect(dialect, flags, disabled); - } - static deserialize(spec) { - return new LRParser(spec); + }); + } + var scriptTokens = contentTokenizer("script", scriptText, StartCloseScriptTag); + var styleTokens = contentTokenizer("style", styleText, StartCloseStyleTag); + var textareaTokens = contentTokenizer("textarea", textareaText, StartCloseTextareaTag); + var parser4 = LRParser.deserialize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QO1G.z1G.zOOOO-E7Y-E7Y", + stateData: "+[~O!]OS~OSSOTPOUQOVROWTOY]OZ[O[^O^^O_^O`^Oa^Ow^Oz_O!cZO~OdaO~OdbO~OdcO~OddO~OdeO~O!VfOPkP!YkP~O!WiOQnP!YnP~O!XlORqP!YqP~OSSOTPOUQOVROWTOXqOY]OZ[O[^O^^O_^O`^Oa^Ow^O!cZO~O!YrO~P#dO!ZsO!duO~OdvO~OdwO~OfyOj|O~OfyOj!OO~OfyOj!QO~OfyOj!SO~OfyOj!UO~O!VfOPkX!YkX~OP!WO!Y!XO~O!WiOQnX!YnX~OQ!ZO!Y!XO~O!XlORqX!YqX~OR!]O!Y!XO~O!Y!XO~P#dOd!_O~O!ZsO!d!aO~Oj!bO~Oj!cO~Og!dOfeXjeX~OfyOj!fO~OfyOj!gO~OfyOj!hO~OfyOj!iO~OfyOj!jO~Od!kO~Od!lO~Od!mO~Oj!nO~Oi!qO!_!oO!a!pO~Oj!rO~Oj!sO~Oj!tO~O_!uO`!uO!_!wO!`!uO~O_!xO`!xO!a!wO!b!xO~O_!uO`!uO!_!{O!`!uO~O_!xO`!xO!a!{O!b!xO~O`_a!cwz!c~", + goto: "%o!_PPPPPPPPPPPPPPPPPP!`!fP!lPP!xPP!{#O#R#X#[#_#e#h#k#q#w!`P!`!`P#}$T$k$q$w$}%T%Z%aPPPPPPPP%gX^OX`pXUOX`pezabcde{}!P!R!TR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!TeZ!e{}!P!R!TQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp", + nodeNames: "\u26A0 StartCloseTag StartCloseTag StartCloseTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue EndTag ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl", + maxTerm: 66, + context: elementContext, + nodeProps: [ + [NodeProp.closedBy, -11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, "EndTag", -4, 19, 29, 32, 35, "CloseTag"], + [NodeProp.group, -9, 12, 15, 16, 17, 18, 38, 39, 40, 41, "Entity", 14, "Entity TextContent", -3, 27, 30, 33, "TextContent Entity"], + [NodeProp.openedBy, 26, "StartTag StartCloseTag", -4, 28, 31, 34, 36, "OpenTag"] + ], + skippedNodes: [0], + repeatNodeCount: 9, + tokenData: "!#b!aR!WOX$kXY)sYZ)sZ]$k]^)s^p$kpq)sqr$krs*zsv$kvw+dwx2yx}$k}!O3f!O!P$k!P!Q7_!Q![$k![!]8u!]!^$k!^!_>b!_!`!!p!`!a8T!a!c$k!c!}8u!}#R$k#R#S8u#S#T$k#T#o8u#o$f$k$f$g&R$g%W$k%W%o8u%o%p$k%p&a8u&a&b$k&b1p8u1p4U$k4U4d8u4d4e$k4e$IS8u$IS$I`$k$I`$Ib8u$Ib$Kh$k$Kh%#t8u%#t&/x$k&/x&Et8u&Et&FV$k&FV;'S8u;'S;:jiW!``!bpOq(kqr?Rrs'gsv(kwx(]x!a(k!a!bKj!b~(k!R?YZ!``!bpOr(krs'gsv(kwx(]x}(k}!O?{!O!f(k!f!gAR!g#W(k#W#XGz#X~(k!R@SV!``!bpOr(krs'gsv(kwx(]x}(k}!O@i!O~(k!R@rT!``!bp!cPOr(krs'gsv(kwx(]x~(k!RAYV!``!bpOr(krs'gsv(kwx(]x!q(k!q!rAo!r~(k!RAvV!``!bpOr(krs'gsv(kwx(]x!e(k!e!fB]!f~(k!RBdV!``!bpOr(krs'gsv(kwx(]x!v(k!v!wBy!w~(k!RCQV!``!bpOr(krs'gsv(kwx(]x!{(k!{!|Cg!|~(k!RCnV!``!bpOr(krs'gsv(kwx(]x!r(k!r!sDT!s~(k!RD[V!``!bpOr(krs'gsv(kwx(]x!g(k!g!hDq!h~(k!RDxW!``!bpOrDqrsEbsvDqvwEvwxFfx!`Dq!`!aGb!a~DqqEgT!bpOvEbvxEvx!`Eb!`!aFX!a~EbPEyRO!`Ev!`!aFS!a~EvPFXOzPqF`Q!bpzPOv'gx~'gaFkV!``OrFfrsEvsvFfvwEvw!`Ff!`!aGQ!a~FfaGXR!``zPOr(]sv(]w~(]!RGkT!``!bpzPOr(krs'gsv(kwx(]x~(k!RHRV!``!bpOr(krs'gsv(kwx(]x#c(k#c#dHh#d~(k!RHoV!``!bpOr(krs'gsv(kwx(]x#V(k#V#WIU#W~(k!RI]V!``!bpOr(krs'gsv(kwx(]x#h(k#h#iIr#i~(k!RIyV!``!bpOr(krs'gsv(kwx(]x#m(k#m#nJ`#n~(k!RJgV!``!bpOr(krs'gsv(kwx(]x#d(k#d#eJ|#e~(k!RKTV!``!bpOr(krs'gsv(kwx(]x#X(k#X#YDq#Y~(k!RKqW!``!bpOrKjrsLZsvKjvwLowxNPx!aKj!a!b! g!b~KjqL`T!bpOvLZvxLox!aLZ!a!bM^!b~LZPLrRO!aLo!a!bL{!b~LoPMORO!`Lo!`!aMX!a~LoPM^OwPqMcT!bpOvLZvxLox!`LZ!`!aMr!a~LZqMyQ!bpwPOv'gx~'gaNUV!``OrNPrsLosvNPvwLow!aNP!a!bNk!b~NPaNpV!``OrNPrsLosvNPvwLow!`NP!`!a! V!a~NPa! ^R!``wPOr(]sv(]w~(]!R! nW!``!bpOrKjrsLZsvKjvwLowxNPx!`Kj!`!a!!W!a~Kj!R!!aT!``!bpwPOr(krs'gsv(kwx(]x~(k!V!!{VgS^P!``!bpOr&Rrs&qsv&Rwx'rx!^&R!^!_(k!_~&R", + tokenizers: [scriptTokens, styleTokens, textareaTokens, tagStart, commentContent, 0, 1, 2, 3, 4, 5], + topRules: { "Document": [0, 13] }, + dialects: { noMatch: 0 }, + tokenPrec: 464 + }); + function getAttrs(element, input) { + let attrs = /* @__PURE__ */ Object.create(null); + for (let att of element.firstChild.getChildren("Attribute")) { + let name2 = att.getChild("AttributeName"), value = att.getChild("AttributeValue") || att.getChild("UnquotedAttributeValue"); + if (name2) + attrs[input.read(name2.from, name2.to)] = !value ? "" : value.name == "AttributeValue" ? input.read(value.from + 1, value.to - 1) : input.read(value.from, value.to); } - }; - function pair(data, off) { - return data[off] | data[off + 1] << 16; + return attrs; } - function findOffset(data, start, term) { - for (let i = start, next; (next = data[i]) != 65535; i++) - if (next == term) - return i - start; - return -1; + function maybeNest(node, input, tags3) { + let attrs; + for (let tag of tags3) { + if (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(node.node.parent, input)))) + return { parser: tag.parser }; + } + return null; } - function findFinished(stacks) { - let best = null; - for (let stack of stacks) { - let stopped = stack.p.stoppedAt; - if ((stack.pos == stack.p.stream.end || stopped != null && stack.pos > stopped) && stack.p.parser.stateFlag(stack.state, 2) && (!best || best.score < stack.score)) - best = stack; + function configureNesting(tags3) { + let script = [], style = [], textarea = []; + for (let tag of tags3) { + let array2 = tag.tag == "script" ? script : tag.tag == "style" ? style : tag.tag == "textarea" ? textarea : null; + if (!array2) + throw new RangeError("Only script, style, and textarea tags can host nested parsers"); + array2.push(tag); } - return best; + return parseMixed((node, input) => { + let id2 = node.type.id; + if (id2 == ScriptText) + return maybeNest(node, input, script); + if (id2 == StyleText) + return maybeNest(node, input, style); + if (id2 == TextareaText) + return maybeNest(node, input, textarea); + return null; + }); } - // node_modules/@lezer/highlight/node_modules/@lezer/common/dist/index.js - var DefaultBufferLength3 = 1024; - var nextPropID3 = 0; - var NodeProp3 = class { - constructor(config2 = {}) { - this.id = nextPropID3++; - this.perNode = !!config2.perNode; - this.deserialize = config2.deserialize || (() => { - throw new Error("This node type doesn't define a deserialize function"); - }); - } - add(match2) { - if (this.perNode) - throw new RangeError("Can't add per-node props to node types"); - if (typeof match2 != "function") - match2 = NodeType3.match(match2); - return (type) => { - let result = match2(type); - return result === void 0 ? null : [this, result]; - }; - } - }; - NodeProp3.closedBy = new NodeProp3({ deserialize: (str) => str.split(" ") }); - NodeProp3.openedBy = new NodeProp3({ deserialize: (str) => str.split(" ") }); - NodeProp3.group = new NodeProp3({ deserialize: (str) => str.split(" ") }); - NodeProp3.contextHash = new NodeProp3({ perNode: true }); - NodeProp3.lookAhead = new NodeProp3({ perNode: true }); - NodeProp3.mounted = new NodeProp3({ perNode: true }); - var noProps3 = /* @__PURE__ */ Object.create(null); - var NodeType3 = class { - constructor(name3, props, id3, flags = 0) { - this.name = name3; - this.props = props; - this.id = id3; - this.flags = flags; - } - static define(spec) { - let props = spec.props && spec.props.length ? /* @__PURE__ */ Object.create(null) : noProps3; - let flags = (spec.top ? 1 : 0) | (spec.skipped ? 2 : 0) | (spec.error ? 4 : 0) | (spec.name == null ? 8 : 0); - let type = new NodeType3(spec.name || "", props, spec.id, flags); - if (spec.props) - for (let src of spec.props) { - if (!Array.isArray(src)) - src = src(type); - if (src) { - if (src[0].perNode) - throw new RangeError("Can't store a per-node prop on a node type"); - props[src[0].id] = src[1]; - } - } - return type; - } - prop(prop) { - return this.props[prop.id]; - } - get isTop() { - return (this.flags & 1) > 0; - } - get isSkipped() { - return (this.flags & 2) > 0; - } - get isError() { - return (this.flags & 4) > 0; - } - get isAnonymous() { - return (this.flags & 8) > 0; - } - is(name3) { - if (typeof name3 == "string") { - if (this.name == name3) - return true; - let group = this.prop(NodeProp3.group); - return group ? group.indexOf(name3) > -1 : false; + // node_modules/@lezer/css/dist/index.es.js + var descendantOp = 93; + var Unit = 1; + var callee = 94; + var identifier = 95; + var VariableName = 2; + var space2 = [ + 9, + 10, + 11, + 12, + 13, + 32, + 133, + 160, + 5760, + 8192, + 8193, + 8194, + 8195, + 8196, + 8197, + 8198, + 8199, + 8200, + 8201, + 8202, + 8232, + 8233, + 8239, + 8287, + 12288 + ]; + var colon = 58; + var parenL = 40; + var underscore = 95; + var bracketL = 91; + var dash = 45; + var period = 46; + var hash = 35; + var percent = 37; + function isAlpha(ch) { + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 161; + } + function isDigit(ch) { + return ch >= 48 && ch <= 57; + } + var identifiers = new ExternalTokenizer((input, stack) => { + for (let inside2 = false, dashes = 0, i = 0; ; i++) { + let { next } = input; + if (isAlpha(next) || next == dash || next == underscore || inside2 && isDigit(next)) { + if (!inside2 && (next != dash || i > 0)) + inside2 = true; + if (dashes === i && next == dash) + dashes++; + input.advance(); + } else { + if (inside2) + input.acceptToken(next == parenL ? callee : dashes == 2 && stack.canShift(VariableName) ? VariableName : identifier); + break; } - return this.id == name3; - } - static match(map) { - let direct = /* @__PURE__ */ Object.create(null); - for (let prop in map) - for (let name3 of prop.split(" ")) - direct[name3] = map[prop]; - return (node) => { - for (let groups = node.prop(NodeProp3.group), i = -1; i < (groups ? groups.length : 0); i++) { - let found = direct[i < 0 ? node.name : groups[i]]; - if (found) - return found; - } - }; } - }; - NodeType3.none = new NodeType3("", /* @__PURE__ */ Object.create(null), 0, 8); - var CachedNode3 = /* @__PURE__ */ new WeakMap(); - var CachedInnerNode3 = /* @__PURE__ */ new WeakMap(); - var IterMode2; - (function(IterMode6) { - IterMode6[IterMode6["ExcludeBuffers"] = 1] = "ExcludeBuffers"; - IterMode6[IterMode6["IncludeAnonymous"] = 2] = "IncludeAnonymous"; - IterMode6[IterMode6["IgnoreMounts"] = 4] = "IgnoreMounts"; - IterMode6[IterMode6["IgnoreOverlays"] = 8] = "IgnoreOverlays"; - })(IterMode2 || (IterMode2 = {})); - var Tree3 = class { - constructor(type, children, positions, length, props) { - this.type = type; - this.children = children; - this.positions = positions; - this.length = length; - this.props = null; - if (props && props.length) { - this.props = /* @__PURE__ */ Object.create(null); - for (let [prop, value] of props) - this.props[typeof prop == "number" ? prop : prop.id] = value; - } + }); + var descendant = new ExternalTokenizer((input) => { + if (space2.includes(input.peek(-1))) { + let { next } = input; + if (isAlpha(next) || next == underscore || next == hash || next == period || next == bracketL || next == colon || next == dash) + input.acceptToken(descendantOp); } - toString() { - let mounted = this.prop(NodeProp3.mounted); - if (mounted && !mounted.overlay) - return mounted.tree.toString(); - let children = ""; - for (let ch of this.children) { - let str = ch.toString(); - if (str) { - if (children) - children += ","; - children += str; - } + }); + var unitToken = new ExternalTokenizer((input) => { + if (!space2.includes(input.peek(-1))) { + let { next } = input; + if (next == percent) { + input.advance(); + input.acceptToken(Unit); } - return !this.type.name ? children : (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (children.length ? "(" + children + ")" : ""); - } - cursor(mode = 0) { - return new TreeCursor3(this.topNode, mode); - } - cursorAt(pos, side = 0, mode = 0) { - let scope = CachedNode3.get(this) || this.topNode; - let cursor = new TreeCursor3(scope); - cursor.moveTo(pos, side); - CachedNode3.set(this, cursor._tree); - return cursor; - } - get topNode() { - return new TreeNode3(this, 0, 0, null); - } - resolve(pos, side = 0) { - let node = resolveNode3(CachedNode3.get(this) || this.topNode, pos, side, false); - CachedNode3.set(this, node); - return node; - } - resolveInner(pos, side = 0) { - let node = resolveNode3(CachedInnerNode3.get(this) || this.topNode, pos, side, true); - CachedInnerNode3.set(this, node); - return node; - } - iterate(spec) { - let { enter, leave, from: from2 = 0, to = this.length } = spec; - for (let c = this.cursor((spec.mode || 0) | IterMode2.IncludeAnonymous); ; ) { - let entered = false; - if (c.from <= to && c.to >= from2 && (c.type.isAnonymous || enter(c) !== false)) { - if (c.firstChild()) - continue; - entered = true; - } - for (; ; ) { - if (entered && leave && !c.type.isAnonymous) - leave(c); - if (c.nextSibling()) - break; - if (!c.parent()) - return; - entered = true; - } + if (isAlpha(next)) { + do { + input.advance(); + } while (isAlpha(input.next)); + input.acceptToken(Unit); } } - prop(prop) { - return !prop.perNode ? this.type.prop(prop) : this.props ? this.props[prop.id] : void 0; - } - get propValues() { - let result = []; - if (this.props) - for (let id3 in this.props) - result.push([+id3, this.props[id3]]); - return result; - } - balance(config2 = {}) { - return this.children.length <= 8 ? this : balanceRange3(NodeType3.none, this.children, this.positions, 0, this.children.length, 0, this.length, (children, positions, length) => new Tree3(this.type, children, positions, length, this.propValues), config2.makeTree || ((children, positions, length) => new Tree3(NodeType3.none, children, positions, length))); - } - static build(data) { - return buildTree3(data); - } - }; - Tree3.empty = new Tree3(NodeType3.none, [], [], 0); - var FlatBufferCursor3 = class { - constructor(buffer, index) { - this.buffer = buffer; - this.index = index; - } - get id() { - return this.buffer[this.index - 4]; - } - get start() { - return this.buffer[this.index - 3]; - } - get end() { - return this.buffer[this.index - 2]; - } - get size() { - return this.buffer[this.index - 1]; - } - get pos() { - return this.index; - } - next() { - this.index -= 4; - } - fork() { - return new FlatBufferCursor3(this.buffer, this.index); - } - }; - var TreeBuffer3 = class { - constructor(buffer, length, set) { - this.buffer = buffer; - this.length = length; - this.set = set; - } - get type() { - return NodeType3.none; - } - toString() { - let result = []; - for (let index = 0; index < this.buffer.length; ) { - result.push(this.childString(index)); - index = this.buffer[index + 3]; + }); + var spec_callee = { __proto__: null, lang: 32, "nth-child": 32, "nth-last-child": 32, "nth-of-type": 32, dir: 32, url: 60, "url-prefix": 60, domain: 60, regexp: 60, selector: 134 }; + var spec_AtKeyword = { __proto__: null, "@import": 114, "@media": 138, "@charset": 142, "@namespace": 146, "@keyframes": 152, "@supports": 164 }; + var spec_identifier2 = { __proto__: null, not: 128, only: 128, from: 158, to: 160 }; + var parser5 = LRParser.deserialize({ + version: 13, + states: "7WOYQ[OOOOQP'#Cd'#CdOOQP'#Cc'#CcO!ZQ[O'#CfO!}QXO'#CaO#UQ[O'#ChO#aQ[O'#DPO#fQ[O'#DTOOQP'#Ec'#EcO#kQdO'#DeO$VQ[O'#DrO#kQdO'#DtO$hQ[O'#DvO$sQ[O'#DyO$xQ[O'#EPO%WQ[O'#EROOQS'#Eb'#EbOOQS'#ES'#ESQYQ[OOOOQP'#Cg'#CgOOQP,59Q,59QO!ZQ[O,59QO%_Q[O'#EVO%yQWO,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q#X#Y5z#Y~%Q_8ZQpVOy%Qz~%Q^8fUjSOy%Qz!O%Q!O!P4x!P!Q%Q!Q![7_![~%Q_8}S#WPOy%Qz!Q%Q!Q![5Z![~%Q~9`RjSOy%Qz{9i{~%Q~9nSoWOy9iyz9zz{:o{~9i~9}ROz9zz{:W{~9z~:ZTOz9zz{:W{!P9z!P!Q:j!Q~9z~:oOR~~:tUoWOy9iyz9zz{:o{!P9i!P!Q;W!Q~9i~;_QR~oWOy%Qz~%Q^;jY#ZUOy%Qz!O%Q!O!P5Z!P!Q%Q!Q![7_![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%QX<_S]POy%Qz![%Q![!]RUOy%Qz!c%Q!c!}>e!}#T%Q#T#o>e#o~%QX>lY!YPoWOy%Qz}%Q}!O>e!O!Q%Q!Q![>e![!c%Q!c!}>e!}#T%Q#T#o>e#o~%QX?aQxPOy%Qz~%Q^?lQvUOy%Qz~%QX?uSOy%Qz#b%Q#b#c@R#c~%QX@WSoWOy%Qz#W%Q#W#X@d#X~%QX@kQ!`PoWOy%Qz~%QX@tSOy%Qz#f%Q#f#g@d#g~%QXAVQ!RPOy%Qz~%Q_AbQ!QVOy%Qz~%QZAmS!PPOy%Qz!_%Q!_!`2e!`~%Q", + tokenizers: [descendant, unitToken, identifiers, 0, 1, 2, 3], + topRules: { "StyleSheet": [0, 4] }, + specialized: [{ term: 94, get: (value) => spec_callee[value] || -1 }, { term: 56, get: (value) => spec_AtKeyword[value] || -1 }, { term: 95, get: (value) => spec_identifier2[value] || -1 }], + tokenPrec: 1078 + }); + + // node_modules/@codemirror/lang-css/dist/index.js + var _properties = null; + function properties() { + if (!_properties && typeof document == "object" && document.body) { + let names = []; + for (let prop in document.body.style) { + if (!/[A-Z]|^-|^(item|length)$/.test(prop)) + names.push(prop); } - return result.join(","); + _properties = names.sort().map((name2) => ({ type: "property", label: name2 })); } - childString(index) { - let id3 = this.buffer[index], endIndex = this.buffer[index + 3]; - let type = this.set.types[id3], result = type.name; - if (/\W/.test(result) && !type.isError) - result = JSON.stringify(result); - index += 4; - if (endIndex == index) - return result; - let children = []; - while (index < endIndex) { - children.push(this.childString(index)); - index = this.buffer[index + 3]; - } - return result + "(" + children.join(",") + ")"; - } - findChild(startIndex, endIndex, dir, pos, side) { - let { buffer } = this, pick = -1; - for (let i = startIndex; i != endIndex; i = buffer[i + 3]) { - if (checkSide3(side, pos, buffer[i + 1], buffer[i + 2])) { - pick = i; - if (dir > 0) - break; - } - } - return pick; - } - slice(startI, endI, from2, to) { - let b = this.buffer; - let copy = new Uint16Array(endI - startI); - for (let i = startI, j = 0; i < endI; ) { - copy[j++] = b[i++]; - copy[j++] = b[i++] - from2; - copy[j++] = b[i++] - from2; - copy[j++] = b[i++] - startI; - } - return new TreeBuffer3(copy, to - from2, this.set); - } - }; - function checkSide3(side, pos, from2, to) { - switch (side) { - case -2: - return from2 < pos; - case -1: - return to >= pos && from2 < pos; - case 0: - return from2 < pos && to > pos; - case 1: - return from2 <= pos && to > pos; - case 2: - return to > pos; - case 4: - return true; - } - } - function enterUnfinishedNodesBefore3(node, pos) { - let scan = node.childBefore(pos); - while (scan) { - let last = scan.lastChild; - if (!last || last.to != scan.to) - break; - if (last.type.isError && last.from == last.to) { - node = scan; - scan = last.prevSibling; - } else { - scan = last; - } - } - return node; - } - function resolveNode3(node, pos, side, overlays) { - var _a4; - while (node.from == node.to || (side < 1 ? node.from >= pos : node.from > pos) || (side > -1 ? node.to <= pos : node.to < pos)) { - let parent = !overlays && node instanceof TreeNode3 && node.index < 0 ? null : node.parent; - if (!parent) - return node; - node = parent; - } - let mode = overlays ? 0 : IterMode2.IgnoreOverlays; - if (overlays) - for (let scan = node, parent = scan.parent; parent; scan = parent, parent = scan.parent) { - if (scan instanceof TreeNode3 && scan.index < 0 && ((_a4 = parent.enter(pos, side, mode)) === null || _a4 === void 0 ? void 0 : _a4.from) != scan.from) - node = parent; - } - for (; ; ) { - let inner = node.enter(pos, side, mode); - if (!inner) - return node; - node = inner; - } - } - var TreeNode3 = class { - constructor(_tree, from2, index, _parent) { - this._tree = _tree; - this.from = from2; - this.index = index; - this._parent = _parent; - } - get type() { - return this._tree.type; - } - get name() { - return this._tree.type.name; - } - get to() { - return this.from + this._tree.length; - } - nextChild(i, dir, pos, side, mode = 0) { - for (let parent = this; ; ) { - for (let { children, positions } = parent._tree, e = dir > 0 ? children.length : -1; i != e; i += dir) { - let next = children[i], start = positions[i] + parent.from; - if (!checkSide3(side, pos, start, start + next.length)) - continue; - if (next instanceof TreeBuffer3) { - if (mode & IterMode2.ExcludeBuffers) - continue; - let index = next.findChild(0, next.buffer.length, dir, pos - start, side); - if (index > -1) - return new BufferNode3(new BufferContext3(parent, next, i, start), null, index); - } else if (mode & IterMode2.IncludeAnonymous || (!next.type.isAnonymous || hasChild3(next))) { - let mounted; - if (!(mode & IterMode2.IgnoreMounts) && next.props && (mounted = next.prop(NodeProp3.mounted)) && !mounted.overlay) - return new TreeNode3(mounted.tree, start, i, parent); - let inner = new TreeNode3(next, start, i, parent); - return mode & IterMode2.IncludeAnonymous || !inner.type.isAnonymous ? inner : inner.nextChild(dir < 0 ? next.children.length - 1 : 0, dir, pos, side); - } - } - if (mode & IterMode2.IncludeAnonymous || !parent.type.isAnonymous) - return null; - if (parent.index >= 0) - i = parent.index + dir; - else - i = dir < 0 ? -1 : parent._parent._tree.children.length; - parent = parent._parent; - if (!parent) - return null; - } - } - get firstChild() { - return this.nextChild(0, 1, 0, 4); - } - get lastChild() { - return this.nextChild(this._tree.children.length - 1, -1, 0, 4); - } - childAfter(pos) { - return this.nextChild(0, 1, pos, 2); - } - childBefore(pos) { - return this.nextChild(this._tree.children.length - 1, -1, pos, -2); - } - enter(pos, side, mode = 0) { - let mounted; - if (!(mode & IterMode2.IgnoreOverlays) && (mounted = this._tree.prop(NodeProp3.mounted)) && mounted.overlay) { - let rPos = pos - this.from; - for (let { from: from2, to } of mounted.overlay) { - if ((side > 0 ? from2 <= rPos : from2 < rPos) && (side < 0 ? to >= rPos : to > rPos)) - return new TreeNode3(mounted.tree, mounted.overlay[0].from + this.from, -1, this); - } - } - return this.nextChild(0, 1, pos, side, mode); - } - nextSignificantParent() { - let val = this; - while (val.type.isAnonymous && val._parent) - val = val._parent; - return val; - } - get parent() { - return this._parent ? this._parent.nextSignificantParent() : null; - } - get nextSibling() { - return this._parent && this.index >= 0 ? this._parent.nextChild(this.index + 1, 1, 0, 4) : null; - } - get prevSibling() { - return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4) : null; - } - cursor(mode = 0) { - return new TreeCursor3(this, mode); - } - get tree() { - return this._tree; - } - toTree() { - return this._tree; - } - resolve(pos, side = 0) { - return resolveNode3(this, pos, side, false); - } - resolveInner(pos, side = 0) { - return resolveNode3(this, pos, side, true); - } - enterUnfinishedNodesBefore(pos) { - return enterUnfinishedNodesBefore3(this, pos); - } - getChild(type, before = null, after = null) { - let r = getChildren3(this, type, before, after); - return r.length ? r[0] : null; - } - getChildren(type, before = null, after = null) { - return getChildren3(this, type, before, after); - } - toString() { - return this._tree.toString(); - } - get node() { - return this; - } - matchContext(context) { - return matchNodeContext2(this, context); - } - }; - function getChildren3(node, type, before, after) { - let cur2 = node.cursor(), result = []; - if (!cur2.firstChild()) - return result; - if (before != null) { - while (!cur2.type.is(before)) - if (!cur2.nextSibling()) - return result; - } - for (; ; ) { - if (after != null && cur2.type.is(after)) - return result; - if (cur2.type.is(type)) - result.push(cur2.node); - if (!cur2.nextSibling()) - return after == null ? result : []; - } - } - function matchNodeContext2(node, context, i = context.length - 1) { - for (let p = node.parent; i >= 0; p = p.parent) { - if (!p) - return false; - if (!p.type.isAnonymous) { - if (context[i] && context[i] != p.name) - return false; - i--; - } - } - return true; + return _properties || []; } - var BufferContext3 = class { - constructor(parent, buffer, index, start) { - this.parent = parent; - this.buffer = buffer; - this.index = index; - this.start = start; - } - }; - var BufferNode3 = class { - constructor(context, _parent, index) { - this.context = context; - this._parent = _parent; - this.index = index; - this.type = context.buffer.set.types[context.buffer.buffer[index]]; - } - get name() { - return this.type.name; - } - get from() { - return this.context.start + this.context.buffer.buffer[this.index + 1]; - } - get to() { - return this.context.start + this.context.buffer.buffer[this.index + 2]; - } - child(dir, pos, side) { - let { buffer } = this.context; - let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.context.start, side); - return index < 0 ? null : new BufferNode3(this.context, this, index); - } - get firstChild() { - return this.child(1, 0, 4); - } - get lastChild() { - return this.child(-1, 0, 4); - } - childAfter(pos) { - return this.child(1, pos, 2); - } - childBefore(pos) { - return this.child(-1, pos, -2); - } - enter(pos, side, mode = 0) { - if (mode & IterMode2.ExcludeBuffers) - return null; - let { buffer } = this.context; - let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], side > 0 ? 1 : -1, pos - this.context.start, side); - return index < 0 ? null : new BufferNode3(this.context, this, index); - } - get parent() { - return this._parent || this.context.parent.nextSignificantParent(); - } - externalSibling(dir) { - return this._parent ? null : this.context.parent.nextChild(this.context.index + dir, dir, 0, 4); - } - get nextSibling() { - let { buffer } = this.context; - let after = buffer.buffer[this.index + 3]; - if (after < (this._parent ? buffer.buffer[this._parent.index + 3] : buffer.buffer.length)) - return new BufferNode3(this.context, this._parent, after); - return this.externalSibling(1); - } - get prevSibling() { - let { buffer } = this.context; - let parentStart = this._parent ? this._parent.index + 4 : 0; - if (this.index == parentStart) - return this.externalSibling(-1); - return new BufferNode3(this.context, this._parent, buffer.findChild(parentStart, this.index, -1, 0, 4)); - } - cursor(mode = 0) { - return new TreeCursor3(this, mode); - } - get tree() { - return null; - } - toTree() { - let children = [], positions = []; - let { buffer } = this.context; - let startI = this.index + 4, endI = buffer.buffer[this.index + 3]; - if (endI > startI) { - let from2 = buffer.buffer[this.index + 1], to = buffer.buffer[this.index + 2]; - children.push(buffer.slice(startI, endI, from2, to)); - positions.push(0); - } - return new Tree3(this.type, children, positions, this.to - this.from); - } - resolve(pos, side = 0) { - return resolveNode3(this, pos, side, false); - } - resolveInner(pos, side = 0) { - return resolveNode3(this, pos, side, true); - } - enterUnfinishedNodesBefore(pos) { - return enterUnfinishedNodesBefore3(this, pos); - } - toString() { - return this.context.buffer.childString(this.index); - } - getChild(type, before = null, after = null) { - let r = getChildren3(this, type, before, after); - return r.length ? r[0] : null; - } - getChildren(type, before = null, after = null) { - return getChildren3(this, type, before, after); - } - get node() { - return this; - } - matchContext(context) { - return matchNodeContext2(this, context); - } - }; - var TreeCursor3 = class { - constructor(node, mode = 0) { - this.mode = mode; - this.buffer = null; - this.stack = []; - this.index = 0; - this.bufferNode = null; - if (node instanceof TreeNode3) { - this.yieldNode(node); - } else { - this._tree = node.context.parent; - this.buffer = node.context; - for (let n = node._parent; n; n = n._parent) - this.stack.unshift(n.index); - this.bufferNode = node; - this.yieldBuf(node.index); - } - } - get name() { - return this.type.name; - } - yieldNode(node) { - if (!node) - return false; - this._tree = node; - this.type = node.type; - this.from = node.from; - this.to = node.to; - return true; - } - yieldBuf(index, type) { - this.index = index; - let { start, buffer } = this.buffer; - this.type = type || buffer.set.types[buffer.buffer[index]]; - this.from = start + buffer.buffer[index + 1]; - this.to = start + buffer.buffer[index + 2]; - return true; - } - yield(node) { - if (!node) - return false; - if (node instanceof TreeNode3) { - this.buffer = null; - return this.yieldNode(node); - } - this.buffer = node.context; - return this.yieldBuf(node.index, node.type); - } - toString() { - return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString(); - } - enterChild(dir, pos, side) { - if (!this.buffer) - return this.yield(this._tree.nextChild(dir < 0 ? this._tree._tree.children.length - 1 : 0, dir, pos, side, this.mode)); - let { buffer } = this.buffer; - let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.buffer.start, side); - if (index < 0) - return false; - this.stack.push(this.index); - return this.yieldBuf(index); - } - firstChild() { - return this.enterChild(1, 0, 4); - } - lastChild() { - return this.enterChild(-1, 0, 4); - } - childAfter(pos) { - return this.enterChild(1, pos, 2); - } - childBefore(pos) { - return this.enterChild(-1, pos, -2); - } - enter(pos, side, mode = this.mode) { - if (!this.buffer) - return this.yield(this._tree.enter(pos, side, mode)); - return mode & IterMode2.ExcludeBuffers ? false : this.enterChild(1, pos, side); - } - parent() { - if (!this.buffer) - return this.yieldNode(this.mode & IterMode2.IncludeAnonymous ? this._tree._parent : this._tree.parent); - if (this.stack.length) - return this.yieldBuf(this.stack.pop()); - let parent = this.mode & IterMode2.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent(); - this.buffer = null; - return this.yieldNode(parent); - } - sibling(dir) { - if (!this.buffer) - return !this._tree._parent ? false : this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + dir, dir, 0, 4, this.mode)); - let { buffer } = this.buffer, d = this.stack.length - 1; - if (dir < 0) { - let parentStart = d < 0 ? 0 : this.stack[d] + 4; - if (this.index != parentStart) - return this.yieldBuf(buffer.findChild(parentStart, this.index, -1, 0, 4)); - } else { - let after = buffer.buffer[this.index + 3]; - if (after < (d < 0 ? buffer.buffer.length : buffer.buffer[this.stack[d] + 3])) - return this.yieldBuf(after); - } - return d < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + dir, dir, 0, 4, this.mode)) : false; - } - nextSibling() { - return this.sibling(1); - } - prevSibling() { - return this.sibling(-1); - } - atLastNode(dir) { - let index, parent, { buffer } = this; - if (buffer) { - if (dir > 0) { - if (this.index < buffer.buffer.buffer.length) - return false; - } else { - for (let i = 0; i < this.index; i++) - if (buffer.buffer.buffer[i + 3] < this.index) - return false; - } - ({ index, parent } = buffer); - } else { - ({ index, _parent: parent } = this._tree); - } - for (; parent; { index, _parent: parent } = parent) { - if (index > -1) - for (let i = index + dir, e = dir < 0 ? -1 : parent._tree.children.length; i != e; i += dir) { - let child = parent._tree.children[i]; - if (this.mode & IterMode2.IncludeAnonymous || child instanceof TreeBuffer3 || !child.type.isAnonymous || hasChild3(child)) - return false; - } - } - return true; - } - move(dir, enter) { - if (enter && this.enterChild(dir, 0, 4)) - return true; - for (; ; ) { - if (this.sibling(dir)) - return true; - if (this.atLastNode(dir) || !this.parent()) - return false; - } - } - next(enter = true) { - return this.move(1, enter); - } - prev(enter = true) { - return this.move(-1, enter); - } - moveTo(pos, side = 0) { - while (this.from == this.to || (side < 1 ? this.from >= pos : this.from > pos) || (side > -1 ? this.to <= pos : this.to < pos)) - if (!this.parent()) - break; - while (this.enterChild(1, pos, side)) { - } - return this; - } - get node() { - if (!this.buffer) - return this._tree; - let cache = this.bufferNode, result = null, depth = 0; - if (cache && cache.context == this.buffer) { - scan: - for (let index = this.index, d = this.stack.length; d >= 0; ) { - for (let c = cache; c; c = c._parent) - if (c.index == index) { - if (index == this.index) - return c; - result = c; - depth = d + 1; - break scan; - } - index = this.stack[--d]; - } - } - for (let i = depth; i < this.stack.length; i++) - result = new BufferNode3(this.buffer, result, this.stack[i]); - return this.bufferNode = new BufferNode3(this.buffer, result, this.index); - } - get tree() { - return this.buffer ? null : this._tree._tree; - } - iterate(enter, leave) { - for (let depth = 0; ; ) { - let mustLeave = false; - if (this.type.isAnonymous || enter(this) !== false) { - if (this.firstChild()) { - depth++; - continue; - } - if (!this.type.isAnonymous) - mustLeave = true; - } - for (; ; ) { - if (mustLeave && leave) - leave(this); - mustLeave = this.type.isAnonymous; - if (this.nextSibling()) - break; - if (!depth) - return; - this.parent(); - depth--; - mustLeave = true; - } - } - } - matchContext(context) { - if (!this.buffer) - return matchNodeContext2(this.node, context); - let { buffer } = this.buffer, { types: types4 } = buffer.set; - for (let i = context.length - 1, d = this.stack.length - 1; i >= 0; d--) { - if (d < 0) - return matchNodeContext2(this.node, context, i); - let type = types4[buffer.buffer[this.stack[d]]]; - if (!type.isAnonymous) { - if (context[i] && context[i] != type.name) - return false; - i--; - } - } - return true; - } - }; - function hasChild3(tree) { - return tree.children.some((ch) => ch instanceof TreeBuffer3 || !ch.type.isAnonymous || hasChild3(ch)); - } - function buildTree3(data) { - var _a4; - let { buffer, nodeSet, maxBufferLength = DefaultBufferLength3, reused = [], minRepeatType = nodeSet.types.length } = data; - let cursor = Array.isArray(buffer) ? new FlatBufferCursor3(buffer, buffer.length) : buffer; - let types4 = nodeSet.types; - let contextHash = 0, lookAhead = 0; - function takeNode(parentStart, minPos, children2, positions2, inRepeat) { - let { id: id3, start, end, size } = cursor; - let lookAheadAtStart = lookAhead; - while (size < 0) { - cursor.next(); - if (size == -1) { - let node2 = reused[id3]; - children2.push(node2); - positions2.push(start - parentStart); - return; - } else if (size == -3) { - contextHash = id3; - return; - } else if (size == -4) { - lookAhead = id3; - return; - } else { - throw new RangeError(`Unrecognized record size: ${size}`); - } - } - let type = types4[id3], node, buffer2; - let startPos = start - parentStart; - if (end - start <= maxBufferLength && (buffer2 = findBufferSize(cursor.pos - minPos, inRepeat))) { - let data2 = new Uint16Array(buffer2.size - buffer2.skip); - let endPos = cursor.pos - buffer2.size, index = data2.length; - while (cursor.pos > endPos) - index = copyToBuffer(buffer2.start, data2, index); - node = new TreeBuffer3(data2, end - buffer2.start, nodeSet); - startPos = buffer2.start - parentStart; - } else { - let endPos = cursor.pos - size; - cursor.next(); - let localChildren = [], localPositions = []; - let localInRepeat = id3 >= minRepeatType ? id3 : -1; - let lastGroup = 0, lastEnd = end; - while (cursor.pos > endPos) { - if (localInRepeat >= 0 && cursor.id == localInRepeat && cursor.size >= 0) { - if (cursor.end <= lastEnd - maxBufferLength) { - makeRepeatLeaf(localChildren, localPositions, start, lastGroup, cursor.end, lastEnd, localInRepeat, lookAheadAtStart); - lastGroup = localChildren.length; - lastEnd = cursor.end; - } - cursor.next(); - } else { - takeNode(start, endPos, localChildren, localPositions, localInRepeat); - } - } - if (localInRepeat >= 0 && lastGroup > 0 && lastGroup < localChildren.length) - makeRepeatLeaf(localChildren, localPositions, start, lastGroup, start, lastEnd, localInRepeat, lookAheadAtStart); - localChildren.reverse(); - localPositions.reverse(); - if (localInRepeat > -1 && lastGroup > 0) { - let make = makeBalanced(type); - node = balanceRange3(type, localChildren, localPositions, 0, localChildren.length, 0, end - start, make, make); - } else { - node = makeTree(type, localChildren, localPositions, end - start, lookAheadAtStart - end); - } - } - children2.push(node); - positions2.push(startPos); - } - function makeBalanced(type) { - return (children2, positions2, length2) => { - let lookAhead2 = 0, lastI = children2.length - 1, last, lookAheadProp; - if (lastI >= 0 && (last = children2[lastI]) instanceof Tree3) { - if (!lastI && last.type == type && last.length == length2) - return last; - if (lookAheadProp = last.prop(NodeProp3.lookAhead)) - lookAhead2 = positions2[lastI] + last.length + lookAheadProp; - } - return makeTree(type, children2, positions2, length2, lookAhead2); - }; - } - function makeRepeatLeaf(children2, positions2, base2, i, from2, to, type, lookAhead2) { - let localChildren = [], localPositions = []; - while (children2.length > i) { - localChildren.push(children2.pop()); - localPositions.push(positions2.pop() + base2 - from2); - } - children2.push(makeTree(nodeSet.types[type], localChildren, localPositions, to - from2, lookAhead2 - to)); - positions2.push(from2 - base2); - } - function makeTree(type, children2, positions2, length2, lookAhead2 = 0, props) { - if (contextHash) { - let pair4 = [NodeProp3.contextHash, contextHash]; - props = props ? [pair4].concat(props) : [pair4]; - } - if (lookAhead2 > 25) { - let pair4 = [NodeProp3.lookAhead, lookAhead2]; - props = props ? [pair4].concat(props) : [pair4]; - } - return new Tree3(type, children2, positions2, length2, props); - } - function findBufferSize(maxSize, inRepeat) { - let fork = cursor.fork(); - let size = 0, start = 0, skip = 0, minStart = fork.end - maxBufferLength; - let result = { size: 0, start: 0, skip: 0 }; - scan: - for (let minPos = fork.pos - maxSize; fork.pos > minPos; ) { - let nodeSize7 = fork.size; - if (fork.id == inRepeat && nodeSize7 >= 0) { - result.size = size; - result.start = start; - result.skip = skip; - skip += 4; - size += 4; - fork.next(); - continue; - } - let startPos = fork.pos - nodeSize7; - if (nodeSize7 < 0 || startPos < minPos || fork.start < minStart) - break; - let localSkipped = fork.id >= minRepeatType ? 4 : 0; - let nodeStart2 = fork.start; - fork.next(); - while (fork.pos > startPos) { - if (fork.size < 0) { - if (fork.size == -3) - localSkipped += 4; - else - break scan; - } else if (fork.id >= minRepeatType) { - localSkipped += 4; - } - fork.next(); - } - start = nodeStart2; - size += nodeSize7; - skip += localSkipped; - } - if (inRepeat < 0 || size == maxSize) { - result.size = size; - result.start = start; - result.skip = skip; - } - return result.size > 4 ? result : void 0; - } - function copyToBuffer(bufferStart, buffer2, index) { - let { id: id3, start, end, size } = cursor; - cursor.next(); - if (size >= 0 && id3 < minRepeatType) { - let startIndex = index; - if (size > 4) { - let endPos = cursor.pos - (size - 4); - while (cursor.pos > endPos) - index = copyToBuffer(bufferStart, buffer2, index); - } - buffer2[--index] = startIndex; - buffer2[--index] = end - bufferStart; - buffer2[--index] = start - bufferStart; - buffer2[--index] = id3; - } else if (size == -3) { - contextHash = id3; - } else if (size == -4) { - lookAhead = id3; - } - return index; - } - let children = [], positions = []; - while (cursor.pos > 0) - takeNode(data.start || 0, data.bufferStart || 0, children, positions, -1); - let length = (_a4 = data.length) !== null && _a4 !== void 0 ? _a4 : children.length ? positions[0] + children[0].length : 0; - return new Tree3(types4[data.topID], children.reverse(), positions.reverse(), length); - } - var nodeSizeCache3 = /* @__PURE__ */ new WeakMap(); - function nodeSize3(balanceType, node) { - if (!balanceType.isAnonymous || node instanceof TreeBuffer3 || node.type != balanceType) - return 1; - let size = nodeSizeCache3.get(node); - if (size == null) { - size = 1; - for (let child of node.children) { - if (child.type != balanceType || !(child instanceof Tree3)) { - size = 1; - break; - } - size += nodeSize3(balanceType, child); - } - nodeSizeCache3.set(node, size); - } - return size; - } - function balanceRange3(balanceType, children, positions, from2, to, start, length, mkTop, mkTree) { - let total = 0; - for (let i = from2; i < to; i++) - total += nodeSize3(balanceType, children[i]); - let maxChild = Math.ceil(total * 1.5 / 8); - let localChildren = [], localPositions = []; - function divide(children2, positions2, from3, to2, offset) { - for (let i = from3; i < to2; ) { - let groupFrom = i, groupStart = positions2[i], groupSize = nodeSize3(balanceType, children2[i]); - i++; - for (; i < to2; i++) { - let nextSize = nodeSize3(balanceType, children2[i]); - if (groupSize + nextSize >= maxChild) - break; - groupSize += nextSize; - } - if (i == groupFrom + 1) { - if (groupSize > maxChild) { - let only = children2[groupFrom]; - divide(only.children, only.positions, 0, only.children.length, positions2[groupFrom] + offset); - continue; - } - localChildren.push(children2[groupFrom]); - } else { - let length2 = positions2[i - 1] + children2[i - 1].length - groupStart; - localChildren.push(balanceRange3(balanceType, children2, positions2, groupFrom, i, groupStart, length2, null, mkTree)); - } - localPositions.push(groupStart + offset - start); - } - } - divide(children, positions, from2, to, 0); - return (mkTop || mkTree)(localChildren, localPositions, length); - } - var stoppedInner3 = new NodeProp3({ perNode: true }); - - // node_modules/@lezer/highlight/dist/index.js - var nextTagID2 = 0; - var Tag2 = class { - constructor(set, base2, modified) { - this.set = set; - this.base = base2; - this.modified = modified; - this.id = nextTagID2++; - } - static define(parent) { - if (parent === null || parent === void 0 ? void 0 : parent.base) - throw new Error("Can not derive from a modified tag"); - let tag = new Tag2([], null, []); - tag.set.push(tag); - if (parent) - for (let t3 of parent.set) - tag.set.push(t3); - return tag; - } - static defineModifier() { - let mod = new Modifier2(); - return (tag) => { - if (tag.modified.indexOf(mod) > -1) - return tag; - return Modifier2.get(tag.base || tag, tag.modified.concat(mod).sort((a, b) => a.id - b.id)); - }; - } - }; - var nextModifierID2 = 0; - var Modifier2 = class { - constructor() { - this.instances = []; - this.id = nextModifierID2++; - } - static get(base2, mods) { - if (!mods.length) - return base2; - let exists = mods[0].instances.find((t3) => t3.base == base2 && sameArray3(mods, t3.modified)); - if (exists) - return exists; - let set = [], tag = new Tag2(set, base2, mods); - for (let m of mods) - m.instances.push(tag); - let configs = permute2(mods); - for (let parent of base2.set) - for (let config2 of configs) - set.push(Modifier2.get(parent, config2)); - return tag; - } - }; - function sameArray3(a, b) { - return a.length == b.length && a.every((x, i) => x == b[i]); - } - function permute2(array2) { - let result = [array2]; - for (let i = 0; i < array2.length; i++) { - for (let a of permute2(array2.slice(0, i).concat(array2.slice(i + 1)))) - result.push(a); - } - return result; - } - function styleTags2(spec) { - let byName = /* @__PURE__ */ Object.create(null); - for (let prop in spec) { - let tags4 = spec[prop]; - if (!Array.isArray(tags4)) - tags4 = [tags4]; - for (let part of prop.split(" ")) - if (part) { - let pieces = [], mode = 2, rest = part; - for (let pos = 0; ; ) { - if (rest == "..." && pos > 0 && pos + 3 == part.length) { - mode = 1; - break; - } - let m = /^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(rest); - if (!m) - throw new RangeError("Invalid path: " + part); - pieces.push(m[0] == "*" ? "" : m[0][0] == '"' ? JSON.parse(m[0]) : m[0]); - pos += m[0].length; - if (pos == part.length) - break; - let next = part[pos++]; - if (pos == part.length && next == "!") { - mode = 0; - break; - } - if (next != "/") - throw new RangeError("Invalid path: " + part); - rest = part.slice(pos); - } - let last = pieces.length - 1, inner = pieces[last]; - if (!inner) - throw new RangeError("Invalid path: " + part); - let rule = new Rule2(tags4, mode, last > 0 ? pieces.slice(0, last) : null); - byName[inner] = rule.sort(byName[inner]); - } - } - return ruleNodeProp2.add(byName); - } - var ruleNodeProp2 = new NodeProp3(); - var Rule2 = class { - constructor(tags4, mode, context, next) { - this.tags = tags4; - this.mode = mode; - this.context = context; - this.next = next; - } - sort(other) { - if (!other || other.depth < this.depth) { - this.next = other; - return this; - } - other.next = this.sort(other.next); - return other; - } - get depth() { - return this.context ? this.context.length : 0; - } - }; - function tagHighlighter(tags4, options) { - let map = /* @__PURE__ */ Object.create(null); - for (let style of tags4) { - if (!Array.isArray(style.tag)) - map[style.tag.id] = style.class; - else - for (let tag of style.tag) - map[tag.id] = style.class; - } - let { scope, all = null } = options || {}; - return { - style: (tags5) => { - let cls = all; - for (let tag of tags5) { - for (let sub of tag.set) { - let tagClass = map[sub.id]; - if (tagClass) { - cls = cls ? cls + " " + tagClass : tagClass; - break; - } - } - } - return cls; - }, - scope - }; - } - var t2 = Tag2.define; - var comment2 = t2(); - var name2 = t2(); - var typeName2 = t2(name2); - var propertyName2 = t2(name2); - var literal2 = t2(); - var string2 = t2(literal2); - var number2 = t2(literal2); - var content2 = t2(); - var heading2 = t2(content2); - var keyword2 = t2(); - var operator2 = t2(); - var punctuation2 = t2(); - var bracket2 = t2(punctuation2); - var meta2 = t2(); - var tags2 = { - comment: comment2, - lineComment: t2(comment2), - blockComment: t2(comment2), - docComment: t2(comment2), - name: name2, - variableName: t2(name2), - typeName: typeName2, - tagName: t2(typeName2), - propertyName: propertyName2, - attributeName: t2(propertyName2), - className: t2(name2), - labelName: t2(name2), - namespace: t2(name2), - macroName: t2(name2), - literal: literal2, - string: string2, - docString: t2(string2), - character: t2(string2), - attributeValue: t2(string2), - number: number2, - integer: t2(number2), - float: t2(number2), - bool: t2(literal2), - regexp: t2(literal2), - escape: t2(literal2), - color: t2(literal2), - url: t2(literal2), - keyword: keyword2, - self: t2(keyword2), - null: t2(keyword2), - atom: t2(keyword2), - unit: t2(keyword2), - modifier: t2(keyword2), - operatorKeyword: t2(keyword2), - controlKeyword: t2(keyword2), - definitionKeyword: t2(keyword2), - moduleKeyword: t2(keyword2), - operator: operator2, - derefOperator: t2(operator2), - arithmeticOperator: t2(operator2), - logicOperator: t2(operator2), - bitwiseOperator: t2(operator2), - compareOperator: t2(operator2), - updateOperator: t2(operator2), - definitionOperator: t2(operator2), - typeOperator: t2(operator2), - controlOperator: t2(operator2), - punctuation: punctuation2, - separator: t2(punctuation2), - bracket: bracket2, - angleBracket: t2(bracket2), - squareBracket: t2(bracket2), - paren: t2(bracket2), - brace: t2(bracket2), - content: content2, - heading: heading2, - heading1: t2(heading2), - heading2: t2(heading2), - heading3: t2(heading2), - heading4: t2(heading2), - heading5: t2(heading2), - heading6: t2(heading2), - contentSeparator: t2(content2), - list: t2(content2), - quote: t2(content2), - emphasis: t2(content2), - strong: t2(content2), - link: t2(content2), - monospace: t2(content2), - strikethrough: t2(content2), - inserted: t2(), - deleted: t2(), - changed: t2(), - invalid: t2(), - meta: meta2, - documentMeta: t2(meta2), - annotation: t2(meta2), - processingInstruction: t2(meta2), - definition: Tag2.defineModifier(), - constant: Tag2.defineModifier(), - function: Tag2.defineModifier(), - standard: Tag2.defineModifier(), - local: Tag2.defineModifier(), - special: Tag2.defineModifier() - }; - var classHighlighter = tagHighlighter([ - { tag: tags2.link, class: "tok-link" }, - { tag: tags2.heading, class: "tok-heading" }, - { tag: tags2.emphasis, class: "tok-emphasis" }, - { tag: tags2.strong, class: "tok-strong" }, - { tag: tags2.keyword, class: "tok-keyword" }, - { tag: tags2.atom, class: "tok-atom" }, - { tag: tags2.bool, class: "tok-bool" }, - { tag: tags2.url, class: "tok-url" }, - { tag: tags2.labelName, class: "tok-labelName" }, - { tag: tags2.inserted, class: "tok-inserted" }, - { tag: tags2.deleted, class: "tok-deleted" }, - { tag: tags2.literal, class: "tok-literal" }, - { tag: tags2.string, class: "tok-string" }, - { tag: tags2.number, class: "tok-number" }, - { tag: [tags2.regexp, tags2.escape, tags2.special(tags2.string)], class: "tok-string2" }, - { tag: tags2.variableName, class: "tok-variableName" }, - { tag: tags2.local(tags2.variableName), class: "tok-variableName tok-local" }, - { tag: tags2.definition(tags2.variableName), class: "tok-variableName tok-definition" }, - { tag: tags2.special(tags2.variableName), class: "tok-variableName2" }, - { tag: tags2.definition(tags2.propertyName), class: "tok-propertyName tok-definition" }, - { tag: tags2.typeName, class: "tok-typeName" }, - { tag: tags2.namespace, class: "tok-namespace" }, - { tag: tags2.className, class: "tok-className" }, - { tag: tags2.macroName, class: "tok-macroName" }, - { tag: tags2.propertyName, class: "tok-propertyName" }, - { tag: tags2.operator, class: "tok-operator" }, - { tag: tags2.comment, class: "tok-comment" }, - { tag: tags2.meta, class: "tok-meta" }, - { tag: tags2.invalid, class: "tok-invalid" }, - { tag: tags2.punctuation, class: "tok-punctuation" } - ]); - - // node_modules/@lezer/javascript/dist/index.es.js - var noSemi = 281; - var incdec = 1; - var incdecPrefix = 2; - var templateContent = 282; - var InterpolationStart = 3; - var templateEnd = 283; - var insertSemi = 284; - var TSExtends = 4; - var spaces = 286; - var newline = 287; - var LineComment = 5; - var BlockComment = 6; - var Dialect_ts = 1; - var space = [ - 9, - 10, - 11, - 12, - 13, - 32, - 133, - 160, - 5760, - 8192, - 8193, - 8194, - 8195, - 8196, - 8197, - 8198, - 8199, - 8200, - 8201, - 8202, - 8232, - 8233, - 8239, - 8287, - 12288 - ]; - var braceR = 125; - var braceL = 123; - var semicolon = 59; - var slash = 47; - var star = 42; - var plus = 43; - var minus = 45; - var dollar = 36; - var backtick = 96; - var backslash = 92; - var trackNewline = new ContextTracker({ - start: false, - shift(context, term) { - return term == LineComment || term == BlockComment || term == spaces ? context : term == newline; - }, - strict: false - }); - var insertSemicolon = new ExternalTokenizer((input, stack) => { - let { next } = input; - if ((next == braceR || next == -1 || stack.context) && stack.canShift(insertSemi)) - input.acceptToken(insertSemi); - }, { contextual: true, fallback: true }); - var noSemicolon = new ExternalTokenizer((input, stack) => { - let { next } = input, after; - if (space.indexOf(next) > -1) - return; - if (next == slash && ((after = input.peek(1)) == slash || after == star)) - return; - if (next != braceR && next != semicolon && next != -1 && !stack.context && stack.canShift(noSemi)) - input.acceptToken(noSemi); - }, { contextual: true }); - var incdecToken = new ExternalTokenizer((input, stack) => { - let { next } = input; - if (next == plus || next == minus) { - input.advance(); - if (next == input.next) { - input.advance(); - let mayPostfix = !stack.context && stack.canShift(incdec); - input.acceptToken(mayPostfix ? incdec : incdecPrefix); - } - } - }, { contextual: true }); - var template = new ExternalTokenizer((input) => { - for (let afterDollar = false, i = 0; ; i++) { - let { next } = input; - if (next < 0) { - if (i) - input.acceptToken(templateContent); - break; - } else if (next == backtick) { - if (i) - input.acceptToken(templateContent); - else - input.acceptToken(templateEnd, 1); - break; - } else if (next == braceL && afterDollar) { - if (i == 1) - input.acceptToken(InterpolationStart, 1); - else - input.acceptToken(templateContent, -1); - break; - } else if (next == 10 && i) { - input.advance(); - input.acceptToken(templateContent); - break; - } else if (next == backslash) { - input.advance(); - } - afterDollar = next == dollar; - input.advance(); - } - }); - function tsExtends(value, stack) { - return value == "extends" && stack.dialectEnabled(Dialect_ts) ? TSExtends : -1; - } - var jsHighlight = styleTags2({ - "get set async static": tags2.modifier, - "for while do if else switch try catch finally return throw break continue default case": tags2.controlKeyword, - "in of await yield void typeof delete instanceof": tags2.operatorKeyword, - "let var const function class extends": tags2.definitionKeyword, - "import export from": tags2.moduleKeyword, - "with debugger as new": tags2.keyword, - TemplateString: tags2.special(tags2.string), - Super: tags2.atom, - BooleanLiteral: tags2.bool, - this: tags2.self, - null: tags2.null, - Star: tags2.modifier, - VariableName: tags2.variableName, - "CallExpression/VariableName TaggedTemplateExpression/VariableName": tags2.function(tags2.variableName), - VariableDefinition: tags2.definition(tags2.variableName), - Label: tags2.labelName, - PropertyName: tags2.propertyName, - PrivatePropertyName: tags2.special(tags2.propertyName), - "CallExpression/MemberExpression/PropertyName": tags2.function(tags2.propertyName), - "FunctionDeclaration/VariableDefinition": tags2.function(tags2.definition(tags2.variableName)), - "ClassDeclaration/VariableDefinition": tags2.definition(tags2.className), - PropertyDefinition: tags2.definition(tags2.propertyName), - PrivatePropertyDefinition: tags2.definition(tags2.special(tags2.propertyName)), - UpdateOp: tags2.updateOperator, - LineComment: tags2.lineComment, - BlockComment: tags2.blockComment, - Number: tags2.number, - String: tags2.string, - ArithOp: tags2.arithmeticOperator, - LogicOp: tags2.logicOperator, - BitOp: tags2.bitwiseOperator, - CompareOp: tags2.compareOperator, - RegExp: tags2.regexp, - Equals: tags2.definitionOperator, - "Arrow : Spread": tags2.punctuation, - "( )": tags2.paren, - "[ ]": tags2.squareBracket, - "{ }": tags2.brace, - "InterpolationStart InterpolationEnd": tags2.special(tags2.brace), - ".": tags2.derefOperator, - ", ;": tags2.separator, - TypeName: tags2.typeName, - TypeDefinition: tags2.definition(tags2.typeName), - "type enum interface implements namespace module declare": tags2.definitionKeyword, - "abstract global Privacy readonly override": tags2.modifier, - "is keyof unique infer": tags2.operatorKeyword, - JSXAttributeValue: tags2.attributeValue, - JSXText: tags2.content, - "JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag": tags2.angleBracket, - "JSXIdentifier JSXNameSpacedName": tags2.tagName, - "JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName": tags2.attributeName - }); - var spec_identifier = { __proto__: null, export: 18, as: 23, from: 29, default: 32, async: 37, function: 38, this: 48, true: 56, false: 56, void: 66, typeof: 70, null: 86, super: 88, new: 122, await: 139, yield: 141, delete: 142, class: 152, extends: 154, public: 197, private: 197, protected: 197, readonly: 199, instanceof: 220, in: 222, const: 224, import: 256, keyof: 307, unique: 311, infer: 317, is: 351, abstract: 371, implements: 373, type: 375, let: 378, var: 380, interface: 387, enum: 391, namespace: 397, module: 399, declare: 403, global: 407, for: 428, of: 437, while: 440, with: 444, do: 448, if: 452, else: 454, switch: 458, case: 464, try: 470, catch: 474, finally: 478, return: 482, throw: 486, break: 490, continue: 494, debugger: 498 }; - var spec_word = { __proto__: null, async: 109, get: 111, set: 113, public: 161, private: 161, protected: 161, static: 163, abstract: 165, override: 167, readonly: 173, new: 355 }; - var spec_LessThan = { __proto__: null, "<": 129 }; - var parser = LRParser.deserialize({ - version: 14, - states: "$4|O`QYOOO'QQ$IfO'#ChO'XOSO'#DVO)dQYO'#D]O)tQYO'#DhO){QYO'#DrO-xQYO'#DxOOQO'#E]'#E]O.]QWO'#E[O.bQWO'#E[OOQ$IU'#Ef'#EfO0aQ$IfO'#ItO2wQ$IfO'#IuO3eQWO'#EzO3jQpO'#FaOOQ$IU'#FS'#FSO3rO!bO'#FSO4QQWO'#FhO5_QWO'#FgOOQ$IU'#Iu'#IuOOQ$IS'#It'#ItOOQQ'#J^'#J^O5dQWO'#HpO5iQ$I[O'#HqOOQQ'#Ih'#IhOOQQ'#Hr'#HrQ`QYOOO){QYO'#DjO5qQWO'#G[O5vQ#tO'#CmO6UQWO'#EZO6aQWO'#EgO6fQ#tO'#FRO7QQWO'#G[O7VQWO'#G`O7bQWO'#G`O7pQWO'#GcO7pQWO'#GdO7pQWO'#GfO5qQWO'#GiO8aQWO'#GlO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T#p#q!=P#q~%T5g!?oR!S5]nQ$UWO!^%T!_#o%T#p~%TX!@PR!kP$UWO!^%T!_#o%T#p~%T7Z!@gr$UW'Y7R#zS']%k'g2bOX%TXY%cYZ%TZ[%c[p%Tpq%cqt%Ttu2`u}%T}!O3j!O!Q%T!Q![2`![!^%T!_!c%T!c!}2`!}#R%T#R#S2`#S#T%T#T#o2`#p$f%T$f$g%c$g#BY2`#BY#BZ!@Y#BZ$IS2`$IS$I_!@Y$I_$JT2`$JT$JU!@Y$JU$KV2`$KV$KW!@Y$KW&FU2`&FU&FV!@Y&FV?HT2`?HT?HU!@Y?HU~2`7Z!CO_$UW'Z7R#zS']%k'g2bOt%Ttu2`u}%T}!O3j!O!Q%T!Q![2`![!^%T!_!c%T!c!}2`!}#R%T#R#S2`#S#T%T#T#o2`#p$g%T$g~2`", - tokenizers: [noSemicolon, incdecToken, template, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, insertSemicolon], - topRules: { "Script": [0, 7] }, - dialects: { jsx: 11707, ts: 11709 }, - dynamicPrecedences: { "149": 1, "176": 1 }, - specialized: [{ term: 289, get: (value, stack) => tsExtends(value, stack) << 1 }, { term: 289, get: (value) => spec_identifier[value] || -1 }, { term: 299, get: (value) => spec_word[value] || -1 }, { term: 63, get: (value) => spec_LessThan[value] || -1 }], - tokenPrec: 11730 - }); - - // node_modules/@codemirror/lang-javascript/node_modules/@lezer/common/dist/index.js - var DefaultBufferLength4 = 1024; - var nextPropID4 = 0; - var Range4 = class { - constructor(from2, to) { - this.from = from2; - this.to = to; - } - }; - var NodeProp4 = class { - constructor(config2 = {}) { - this.id = nextPropID4++; - this.perNode = !!config2.perNode; - this.deserialize = config2.deserialize || (() => { - throw new Error("This node type doesn't define a deserialize function"); - }); - } - add(match2) { - if (this.perNode) - throw new RangeError("Can't add per-node props to node types"); - if (typeof match2 != "function") - match2 = NodeType4.match(match2); - return (type) => { - let result = match2(type); - return result === void 0 ? null : [this, result]; - }; - } - }; - NodeProp4.closedBy = new NodeProp4({ deserialize: (str) => str.split(" ") }); - NodeProp4.openedBy = new NodeProp4({ deserialize: (str) => str.split(" ") }); - NodeProp4.group = new NodeProp4({ deserialize: (str) => str.split(" ") }); - NodeProp4.contextHash = new NodeProp4({ perNode: true }); - NodeProp4.lookAhead = new NodeProp4({ perNode: true }); - NodeProp4.mounted = new NodeProp4({ perNode: true }); - var noProps4 = /* @__PURE__ */ Object.create(null); - var NodeType4 = class { - constructor(name3, props, id3, flags = 0) { - this.name = name3; - this.props = props; - this.id = id3; - this.flags = flags; - } - static define(spec) { - let props = spec.props && spec.props.length ? /* @__PURE__ */ Object.create(null) : noProps4; - let flags = (spec.top ? 1 : 0) | (spec.skipped ? 2 : 0) | (spec.error ? 4 : 0) | (spec.name == null ? 8 : 0); - let type = new NodeType4(spec.name || "", props, spec.id, flags); - if (spec.props) - for (let src of spec.props) { - if (!Array.isArray(src)) - src = src(type); - if (src) { - if (src[0].perNode) - throw new RangeError("Can't store a per-node prop on a node type"); - props[src[0].id] = src[1]; - } - } - return type; - } - prop(prop) { - return this.props[prop.id]; - } - get isTop() { - return (this.flags & 1) > 0; - } - get isSkipped() { - return (this.flags & 2) > 0; - } - get isError() { - return (this.flags & 4) > 0; - } - get isAnonymous() { - return (this.flags & 8) > 0; - } - is(name3) { - if (typeof name3 == "string") { - if (this.name == name3) - return true; - let group = this.prop(NodeProp4.group); - return group ? group.indexOf(name3) > -1 : false; - } - return this.id == name3; - } - static match(map) { - let direct = /* @__PURE__ */ Object.create(null); - for (let prop in map) - for (let name3 of prop.split(" ")) - direct[name3] = map[prop]; - return (node) => { - for (let groups = node.prop(NodeProp4.group), i = -1; i < (groups ? groups.length : 0); i++) { - let found = direct[i < 0 ? node.name : groups[i]]; - if (found) - return found; - } - }; - } - }; - NodeType4.none = new NodeType4("", /* @__PURE__ */ Object.create(null), 0, 8); - var CachedNode4 = /* @__PURE__ */ new WeakMap(); - var CachedInnerNode4 = /* @__PURE__ */ new WeakMap(); - var IterMode3; - (function(IterMode6) { - IterMode6[IterMode6["ExcludeBuffers"] = 1] = "ExcludeBuffers"; - IterMode6[IterMode6["IncludeAnonymous"] = 2] = "IncludeAnonymous"; - IterMode6[IterMode6["IgnoreMounts"] = 4] = "IgnoreMounts"; - IterMode6[IterMode6["IgnoreOverlays"] = 8] = "IgnoreOverlays"; - })(IterMode3 || (IterMode3 = {})); - var Tree4 = class { - constructor(type, children, positions, length, props) { - this.type = type; - this.children = children; - this.positions = positions; - this.length = length; - this.props = null; - if (props && props.length) { - this.props = /* @__PURE__ */ Object.create(null); - for (let [prop, value] of props) - this.props[typeof prop == "number" ? prop : prop.id] = value; - } - } - toString() { - let mounted = this.prop(NodeProp4.mounted); - if (mounted && !mounted.overlay) - return mounted.tree.toString(); - let children = ""; - for (let ch of this.children) { - let str = ch.toString(); - if (str) { - if (children) - children += ","; - children += str; - } - } - return !this.type.name ? children : (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (children.length ? "(" + children + ")" : ""); - } - cursor(mode = 0) { - return new TreeCursor4(this.topNode, mode); - } - cursorAt(pos, side = 0, mode = 0) { - let scope = CachedNode4.get(this) || this.topNode; - let cursor = new TreeCursor4(scope); - cursor.moveTo(pos, side); - CachedNode4.set(this, cursor._tree); - return cursor; - } - get topNode() { - return new TreeNode4(this, 0, 0, null); - } - resolve(pos, side = 0) { - let node = resolveNode4(CachedNode4.get(this) || this.topNode, pos, side, false); - CachedNode4.set(this, node); - return node; - } - resolveInner(pos, side = 0) { - let node = resolveNode4(CachedInnerNode4.get(this) || this.topNode, pos, side, true); - CachedInnerNode4.set(this, node); - return node; - } - iterate(spec) { - let { enter, leave, from: from2 = 0, to = this.length } = spec; - for (let c = this.cursor((spec.mode || 0) | IterMode3.IncludeAnonymous); ; ) { - let entered = false; - if (c.from <= to && c.to >= from2 && (c.type.isAnonymous || enter(c) !== false)) { - if (c.firstChild()) - continue; - entered = true; - } - for (; ; ) { - if (entered && leave && !c.type.isAnonymous) - leave(c); - if (c.nextSibling()) - break; - if (!c.parent()) - return; - entered = true; - } - } - } - prop(prop) { - return !prop.perNode ? this.type.prop(prop) : this.props ? this.props[prop.id] : void 0; - } - get propValues() { - let result = []; - if (this.props) - for (let id3 in this.props) - result.push([+id3, this.props[id3]]); - return result; - } - balance(config2 = {}) { - return this.children.length <= 8 ? this : balanceRange4(NodeType4.none, this.children, this.positions, 0, this.children.length, 0, this.length, (children, positions, length) => new Tree4(this.type, children, positions, length, this.propValues), config2.makeTree || ((children, positions, length) => new Tree4(NodeType4.none, children, positions, length))); - } - static build(data) { - return buildTree4(data); - } - }; - Tree4.empty = new Tree4(NodeType4.none, [], [], 0); - var FlatBufferCursor4 = class { - constructor(buffer, index) { - this.buffer = buffer; - this.index = index; - } - get id() { - return this.buffer[this.index - 4]; - } - get start() { - return this.buffer[this.index - 3]; - } - get end() { - return this.buffer[this.index - 2]; - } - get size() { - return this.buffer[this.index - 1]; - } - get pos() { - return this.index; - } - next() { - this.index -= 4; - } - fork() { - return new FlatBufferCursor4(this.buffer, this.index); - } - }; - var TreeBuffer4 = class { - constructor(buffer, length, set) { - this.buffer = buffer; - this.length = length; - this.set = set; - } - get type() { - return NodeType4.none; - } - toString() { - let result = []; - for (let index = 0; index < this.buffer.length; ) { - result.push(this.childString(index)); - index = this.buffer[index + 3]; - } - return result.join(","); - } - childString(index) { - let id3 = this.buffer[index], endIndex = this.buffer[index + 3]; - let type = this.set.types[id3], result = type.name; - if (/\W/.test(result) && !type.isError) - result = JSON.stringify(result); - index += 4; - if (endIndex == index) - return result; - let children = []; - while (index < endIndex) { - children.push(this.childString(index)); - index = this.buffer[index + 3]; - } - return result + "(" + children.join(",") + ")"; - } - findChild(startIndex, endIndex, dir, pos, side) { - let { buffer } = this, pick = -1; - for (let i = startIndex; i != endIndex; i = buffer[i + 3]) { - if (checkSide4(side, pos, buffer[i + 1], buffer[i + 2])) { - pick = i; - if (dir > 0) - break; - } - } - return pick; - } - slice(startI, endI, from2, to) { - let b = this.buffer; - let copy = new Uint16Array(endI - startI); - for (let i = startI, j = 0; i < endI; ) { - copy[j++] = b[i++]; - copy[j++] = b[i++] - from2; - copy[j++] = b[i++] - from2; - copy[j++] = b[i++] - startI; - } - return new TreeBuffer4(copy, to - from2, this.set); - } - }; - function checkSide4(side, pos, from2, to) { - switch (side) { - case -2: - return from2 < pos; - case -1: - return to >= pos && from2 < pos; - case 0: - return from2 < pos && to > pos; - case 1: - return from2 <= pos && to > pos; - case 2: - return to > pos; - case 4: - return true; - } - } - function enterUnfinishedNodesBefore4(node, pos) { - let scan = node.childBefore(pos); - while (scan) { - let last = scan.lastChild; - if (!last || last.to != scan.to) - break; - if (last.type.isError && last.from == last.to) { - node = scan; - scan = last.prevSibling; - } else { - scan = last; - } - } - return node; - } - function resolveNode4(node, pos, side, overlays) { - var _a4; - while (node.from == node.to || (side < 1 ? node.from >= pos : node.from > pos) || (side > -1 ? node.to <= pos : node.to < pos)) { - let parent = !overlays && node instanceof TreeNode4 && node.index < 0 ? null : node.parent; - if (!parent) - return node; - node = parent; - } - let mode = overlays ? 0 : IterMode3.IgnoreOverlays; - if (overlays) - for (let scan = node, parent = scan.parent; parent; scan = parent, parent = scan.parent) { - if (scan instanceof TreeNode4 && scan.index < 0 && ((_a4 = parent.enter(pos, side, mode)) === null || _a4 === void 0 ? void 0 : _a4.from) != scan.from) - node = parent; - } - for (; ; ) { - let inner = node.enter(pos, side, mode); - if (!inner) - return node; - node = inner; - } - } - var TreeNode4 = class { - constructor(_tree, from2, index, _parent) { - this._tree = _tree; - this.from = from2; - this.index = index; - this._parent = _parent; - } - get type() { - return this._tree.type; - } - get name() { - return this._tree.type.name; - } - get to() { - return this.from + this._tree.length; - } - nextChild(i, dir, pos, side, mode = 0) { - for (let parent = this; ; ) { - for (let { children, positions } = parent._tree, e = dir > 0 ? children.length : -1; i != e; i += dir) { - let next = children[i], start = positions[i] + parent.from; - if (!checkSide4(side, pos, start, start + next.length)) - continue; - if (next instanceof TreeBuffer4) { - if (mode & IterMode3.ExcludeBuffers) - continue; - let index = next.findChild(0, next.buffer.length, dir, pos - start, side); - if (index > -1) - return new BufferNode4(new BufferContext4(parent, next, i, start), null, index); - } else if (mode & IterMode3.IncludeAnonymous || (!next.type.isAnonymous || hasChild4(next))) { - let mounted; - if (!(mode & IterMode3.IgnoreMounts) && next.props && (mounted = next.prop(NodeProp4.mounted)) && !mounted.overlay) - return new TreeNode4(mounted.tree, start, i, parent); - let inner = new TreeNode4(next, start, i, parent); - return mode & IterMode3.IncludeAnonymous || !inner.type.isAnonymous ? inner : inner.nextChild(dir < 0 ? next.children.length - 1 : 0, dir, pos, side); - } - } - if (mode & IterMode3.IncludeAnonymous || !parent.type.isAnonymous) - return null; - if (parent.index >= 0) - i = parent.index + dir; - else - i = dir < 0 ? -1 : parent._parent._tree.children.length; - parent = parent._parent; - if (!parent) - return null; - } - } - get firstChild() { - return this.nextChild(0, 1, 0, 4); - } - get lastChild() { - return this.nextChild(this._tree.children.length - 1, -1, 0, 4); - } - childAfter(pos) { - return this.nextChild(0, 1, pos, 2); - } - childBefore(pos) { - return this.nextChild(this._tree.children.length - 1, -1, pos, -2); - } - enter(pos, side, mode = 0) { - let mounted; - if (!(mode & IterMode3.IgnoreOverlays) && (mounted = this._tree.prop(NodeProp4.mounted)) && mounted.overlay) { - let rPos = pos - this.from; - for (let { from: from2, to } of mounted.overlay) { - if ((side > 0 ? from2 <= rPos : from2 < rPos) && (side < 0 ? to >= rPos : to > rPos)) - return new TreeNode4(mounted.tree, mounted.overlay[0].from + this.from, -1, this); - } - } - return this.nextChild(0, 1, pos, side, mode); - } - nextSignificantParent() { - let val = this; - while (val.type.isAnonymous && val._parent) - val = val._parent; - return val; - } - get parent() { - return this._parent ? this._parent.nextSignificantParent() : null; - } - get nextSibling() { - return this._parent && this.index >= 0 ? this._parent.nextChild(this.index + 1, 1, 0, 4) : null; - } - get prevSibling() { - return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4) : null; - } - cursor(mode = 0) { - return new TreeCursor4(this, mode); - } - get tree() { - return this._tree; - } - toTree() { - return this._tree; - } - resolve(pos, side = 0) { - return resolveNode4(this, pos, side, false); - } - resolveInner(pos, side = 0) { - return resolveNode4(this, pos, side, true); - } - enterUnfinishedNodesBefore(pos) { - return enterUnfinishedNodesBefore4(this, pos); - } - getChild(type, before = null, after = null) { - let r = getChildren4(this, type, before, after); - return r.length ? r[0] : null; - } - getChildren(type, before = null, after = null) { - return getChildren4(this, type, before, after); - } - toString() { - return this._tree.toString(); - } - get node() { - return this; - } - matchContext(context) { - return matchNodeContext3(this, context); - } - }; - function getChildren4(node, type, before, after) { - let cur2 = node.cursor(), result = []; - if (!cur2.firstChild()) - return result; - if (before != null) { - while (!cur2.type.is(before)) - if (!cur2.nextSibling()) - return result; - } - for (; ; ) { - if (after != null && cur2.type.is(after)) - return result; - if (cur2.type.is(type)) - result.push(cur2.node); - if (!cur2.nextSibling()) - return after == null ? result : []; - } - } - function matchNodeContext3(node, context, i = context.length - 1) { - for (let p = node.parent; i >= 0; p = p.parent) { - if (!p) - return false; - if (!p.type.isAnonymous) { - if (context[i] && context[i] != p.name) - return false; - i--; - } - } - return true; - } - var BufferContext4 = class { - constructor(parent, buffer, index, start) { - this.parent = parent; - this.buffer = buffer; - this.index = index; - this.start = start; - } - }; - var BufferNode4 = class { - constructor(context, _parent, index) { - this.context = context; - this._parent = _parent; - this.index = index; - this.type = context.buffer.set.types[context.buffer.buffer[index]]; - } - get name() { - return this.type.name; - } - get from() { - return this.context.start + this.context.buffer.buffer[this.index + 1]; - } - get to() { - return this.context.start + this.context.buffer.buffer[this.index + 2]; - } - child(dir, pos, side) { - let { buffer } = this.context; - let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.context.start, side); - return index < 0 ? null : new BufferNode4(this.context, this, index); - } - get firstChild() { - return this.child(1, 0, 4); - } - get lastChild() { - return this.child(-1, 0, 4); - } - childAfter(pos) { - return this.child(1, pos, 2); - } - childBefore(pos) { - return this.child(-1, pos, -2); - } - enter(pos, side, mode = 0) { - if (mode & IterMode3.ExcludeBuffers) - return null; - let { buffer } = this.context; - let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], side > 0 ? 1 : -1, pos - this.context.start, side); - return index < 0 ? null : new BufferNode4(this.context, this, index); - } - get parent() { - return this._parent || this.context.parent.nextSignificantParent(); - } - externalSibling(dir) { - return this._parent ? null : this.context.parent.nextChild(this.context.index + dir, dir, 0, 4); - } - get nextSibling() { - let { buffer } = this.context; - let after = buffer.buffer[this.index + 3]; - if (after < (this._parent ? buffer.buffer[this._parent.index + 3] : buffer.buffer.length)) - return new BufferNode4(this.context, this._parent, after); - return this.externalSibling(1); - } - get prevSibling() { - let { buffer } = this.context; - let parentStart = this._parent ? this._parent.index + 4 : 0; - if (this.index == parentStart) - return this.externalSibling(-1); - return new BufferNode4(this.context, this._parent, buffer.findChild(parentStart, this.index, -1, 0, 4)); - } - cursor(mode = 0) { - return new TreeCursor4(this, mode); - } - get tree() { - return null; - } - toTree() { - let children = [], positions = []; - let { buffer } = this.context; - let startI = this.index + 4, endI = buffer.buffer[this.index + 3]; - if (endI > startI) { - let from2 = buffer.buffer[this.index + 1], to = buffer.buffer[this.index + 2]; - children.push(buffer.slice(startI, endI, from2, to)); - positions.push(0); - } - return new Tree4(this.type, children, positions, this.to - this.from); - } - resolve(pos, side = 0) { - return resolveNode4(this, pos, side, false); - } - resolveInner(pos, side = 0) { - return resolveNode4(this, pos, side, true); - } - enterUnfinishedNodesBefore(pos) { - return enterUnfinishedNodesBefore4(this, pos); - } - toString() { - return this.context.buffer.childString(this.index); - } - getChild(type, before = null, after = null) { - let r = getChildren4(this, type, before, after); - return r.length ? r[0] : null; - } - getChildren(type, before = null, after = null) { - return getChildren4(this, type, before, after); - } - get node() { - return this; - } - matchContext(context) { - return matchNodeContext3(this, context); - } - }; - var TreeCursor4 = class { - constructor(node, mode = 0) { - this.mode = mode; - this.buffer = null; - this.stack = []; - this.index = 0; - this.bufferNode = null; - if (node instanceof TreeNode4) { - this.yieldNode(node); - } else { - this._tree = node.context.parent; - this.buffer = node.context; - for (let n = node._parent; n; n = n._parent) - this.stack.unshift(n.index); - this.bufferNode = node; - this.yieldBuf(node.index); - } - } - get name() { - return this.type.name; - } - yieldNode(node) { - if (!node) - return false; - this._tree = node; - this.type = node.type; - this.from = node.from; - this.to = node.to; - return true; - } - yieldBuf(index, type) { - this.index = index; - let { start, buffer } = this.buffer; - this.type = type || buffer.set.types[buffer.buffer[index]]; - this.from = start + buffer.buffer[index + 1]; - this.to = start + buffer.buffer[index + 2]; - return true; - } - yield(node) { - if (!node) - return false; - if (node instanceof TreeNode4) { - this.buffer = null; - return this.yieldNode(node); - } - this.buffer = node.context; - return this.yieldBuf(node.index, node.type); - } - toString() { - return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString(); - } - enterChild(dir, pos, side) { - if (!this.buffer) - return this.yield(this._tree.nextChild(dir < 0 ? this._tree._tree.children.length - 1 : 0, dir, pos, side, this.mode)); - let { buffer } = this.buffer; - let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.buffer.start, side); - if (index < 0) - return false; - this.stack.push(this.index); - return this.yieldBuf(index); - } - firstChild() { - return this.enterChild(1, 0, 4); - } - lastChild() { - return this.enterChild(-1, 0, 4); - } - childAfter(pos) { - return this.enterChild(1, pos, 2); - } - childBefore(pos) { - return this.enterChild(-1, pos, -2); - } - enter(pos, side, mode = this.mode) { - if (!this.buffer) - return this.yield(this._tree.enter(pos, side, mode)); - return mode & IterMode3.ExcludeBuffers ? false : this.enterChild(1, pos, side); - } - parent() { - if (!this.buffer) - return this.yieldNode(this.mode & IterMode3.IncludeAnonymous ? this._tree._parent : this._tree.parent); - if (this.stack.length) - return this.yieldBuf(this.stack.pop()); - let parent = this.mode & IterMode3.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent(); - this.buffer = null; - return this.yieldNode(parent); - } - sibling(dir) { - if (!this.buffer) - return !this._tree._parent ? false : this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + dir, dir, 0, 4, this.mode)); - let { buffer } = this.buffer, d = this.stack.length - 1; - if (dir < 0) { - let parentStart = d < 0 ? 0 : this.stack[d] + 4; - if (this.index != parentStart) - return this.yieldBuf(buffer.findChild(parentStart, this.index, -1, 0, 4)); - } else { - let after = buffer.buffer[this.index + 3]; - if (after < (d < 0 ? buffer.buffer.length : buffer.buffer[this.stack[d] + 3])) - return this.yieldBuf(after); - } - return d < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + dir, dir, 0, 4, this.mode)) : false; - } - nextSibling() { - return this.sibling(1); - } - prevSibling() { - return this.sibling(-1); - } - atLastNode(dir) { - let index, parent, { buffer } = this; - if (buffer) { - if (dir > 0) { - if (this.index < buffer.buffer.buffer.length) - return false; - } else { - for (let i = 0; i < this.index; i++) - if (buffer.buffer.buffer[i + 3] < this.index) - return false; - } - ({ index, parent } = buffer); - } else { - ({ index, _parent: parent } = this._tree); - } - for (; parent; { index, _parent: parent } = parent) { - if (index > -1) - for (let i = index + dir, e = dir < 0 ? -1 : parent._tree.children.length; i != e; i += dir) { - let child = parent._tree.children[i]; - if (this.mode & IterMode3.IncludeAnonymous || child instanceof TreeBuffer4 || !child.type.isAnonymous || hasChild4(child)) - return false; - } - } - return true; - } - move(dir, enter) { - if (enter && this.enterChild(dir, 0, 4)) - return true; - for (; ; ) { - if (this.sibling(dir)) - return true; - if (this.atLastNode(dir) || !this.parent()) - return false; - } - } - next(enter = true) { - return this.move(1, enter); - } - prev(enter = true) { - return this.move(-1, enter); - } - moveTo(pos, side = 0) { - while (this.from == this.to || (side < 1 ? this.from >= pos : this.from > pos) || (side > -1 ? this.to <= pos : this.to < pos)) - if (!this.parent()) - break; - while (this.enterChild(1, pos, side)) { - } - return this; - } - get node() { - if (!this.buffer) - return this._tree; - let cache = this.bufferNode, result = null, depth = 0; - if (cache && cache.context == this.buffer) { - scan: - for (let index = this.index, d = this.stack.length; d >= 0; ) { - for (let c = cache; c; c = c._parent) - if (c.index == index) { - if (index == this.index) - return c; - result = c; - depth = d + 1; - break scan; - } - index = this.stack[--d]; - } - } - for (let i = depth; i < this.stack.length; i++) - result = new BufferNode4(this.buffer, result, this.stack[i]); - return this.bufferNode = new BufferNode4(this.buffer, result, this.index); - } - get tree() { - return this.buffer ? null : this._tree._tree; - } - iterate(enter, leave) { - for (let depth = 0; ; ) { - let mustLeave = false; - if (this.type.isAnonymous || enter(this) !== false) { - if (this.firstChild()) { - depth++; - continue; - } - if (!this.type.isAnonymous) - mustLeave = true; - } - for (; ; ) { - if (mustLeave && leave) - leave(this); - mustLeave = this.type.isAnonymous; - if (this.nextSibling()) - break; - if (!depth) - return; - this.parent(); - depth--; - mustLeave = true; - } - } - } - matchContext(context) { - if (!this.buffer) - return matchNodeContext3(this.node, context); - let { buffer } = this.buffer, { types: types4 } = buffer.set; - for (let i = context.length - 1, d = this.stack.length - 1; i >= 0; d--) { - if (d < 0) - return matchNodeContext3(this.node, context, i); - let type = types4[buffer.buffer[this.stack[d]]]; - if (!type.isAnonymous) { - if (context[i] && context[i] != type.name) - return false; - i--; - } - } - return true; - } - }; - function hasChild4(tree) { - return tree.children.some((ch) => ch instanceof TreeBuffer4 || !ch.type.isAnonymous || hasChild4(ch)); - } - function buildTree4(data) { - var _a4; - let { buffer, nodeSet, maxBufferLength = DefaultBufferLength4, reused = [], minRepeatType = nodeSet.types.length } = data; - let cursor = Array.isArray(buffer) ? new FlatBufferCursor4(buffer, buffer.length) : buffer; - let types4 = nodeSet.types; - let contextHash = 0, lookAhead = 0; - function takeNode(parentStart, minPos, children2, positions2, inRepeat) { - let { id: id3, start, end, size } = cursor; - let lookAheadAtStart = lookAhead; - while (size < 0) { - cursor.next(); - if (size == -1) { - let node2 = reused[id3]; - children2.push(node2); - positions2.push(start - parentStart); - return; - } else if (size == -3) { - contextHash = id3; - return; - } else if (size == -4) { - lookAhead = id3; - return; - } else { - throw new RangeError(`Unrecognized record size: ${size}`); - } - } - let type = types4[id3], node, buffer2; - let startPos = start - parentStart; - if (end - start <= maxBufferLength && (buffer2 = findBufferSize(cursor.pos - minPos, inRepeat))) { - let data2 = new Uint16Array(buffer2.size - buffer2.skip); - let endPos = cursor.pos - buffer2.size, index = data2.length; - while (cursor.pos > endPos) - index = copyToBuffer(buffer2.start, data2, index); - node = new TreeBuffer4(data2, end - buffer2.start, nodeSet); - startPos = buffer2.start - parentStart; - } else { - let endPos = cursor.pos - size; - cursor.next(); - let localChildren = [], localPositions = []; - let localInRepeat = id3 >= minRepeatType ? id3 : -1; - let lastGroup = 0, lastEnd = end; - while (cursor.pos > endPos) { - if (localInRepeat >= 0 && cursor.id == localInRepeat && cursor.size >= 0) { - if (cursor.end <= lastEnd - maxBufferLength) { - makeRepeatLeaf(localChildren, localPositions, start, lastGroup, cursor.end, lastEnd, localInRepeat, lookAheadAtStart); - lastGroup = localChildren.length; - lastEnd = cursor.end; - } - cursor.next(); - } else { - takeNode(start, endPos, localChildren, localPositions, localInRepeat); - } - } - if (localInRepeat >= 0 && lastGroup > 0 && lastGroup < localChildren.length) - makeRepeatLeaf(localChildren, localPositions, start, lastGroup, start, lastEnd, localInRepeat, lookAheadAtStart); - localChildren.reverse(); - localPositions.reverse(); - if (localInRepeat > -1 && lastGroup > 0) { - let make = makeBalanced(type); - node = balanceRange4(type, localChildren, localPositions, 0, localChildren.length, 0, end - start, make, make); - } else { - node = makeTree(type, localChildren, localPositions, end - start, lookAheadAtStart - end); - } - } - children2.push(node); - positions2.push(startPos); - } - function makeBalanced(type) { - return (children2, positions2, length2) => { - let lookAhead2 = 0, lastI = children2.length - 1, last, lookAheadProp; - if (lastI >= 0 && (last = children2[lastI]) instanceof Tree4) { - if (!lastI && last.type == type && last.length == length2) - return last; - if (lookAheadProp = last.prop(NodeProp4.lookAhead)) - lookAhead2 = positions2[lastI] + last.length + lookAheadProp; - } - return makeTree(type, children2, positions2, length2, lookAhead2); - }; - } - function makeRepeatLeaf(children2, positions2, base2, i, from2, to, type, lookAhead2) { - let localChildren = [], localPositions = []; - while (children2.length > i) { - localChildren.push(children2.pop()); - localPositions.push(positions2.pop() + base2 - from2); - } - children2.push(makeTree(nodeSet.types[type], localChildren, localPositions, to - from2, lookAhead2 - to)); - positions2.push(from2 - base2); - } - function makeTree(type, children2, positions2, length2, lookAhead2 = 0, props) { - if (contextHash) { - let pair4 = [NodeProp4.contextHash, contextHash]; - props = props ? [pair4].concat(props) : [pair4]; - } - if (lookAhead2 > 25) { - let pair4 = [NodeProp4.lookAhead, lookAhead2]; - props = props ? [pair4].concat(props) : [pair4]; - } - return new Tree4(type, children2, positions2, length2, props); - } - function findBufferSize(maxSize, inRepeat) { - let fork = cursor.fork(); - let size = 0, start = 0, skip = 0, minStart = fork.end - maxBufferLength; - let result = { size: 0, start: 0, skip: 0 }; - scan: - for (let minPos = fork.pos - maxSize; fork.pos > minPos; ) { - let nodeSize7 = fork.size; - if (fork.id == inRepeat && nodeSize7 >= 0) { - result.size = size; - result.start = start; - result.skip = skip; - skip += 4; - size += 4; - fork.next(); - continue; - } - let startPos = fork.pos - nodeSize7; - if (nodeSize7 < 0 || startPos < minPos || fork.start < minStart) - break; - let localSkipped = fork.id >= minRepeatType ? 4 : 0; - let nodeStart2 = fork.start; - fork.next(); - while (fork.pos > startPos) { - if (fork.size < 0) { - if (fork.size == -3) - localSkipped += 4; - else - break scan; - } else if (fork.id >= minRepeatType) { - localSkipped += 4; - } - fork.next(); - } - start = nodeStart2; - size += nodeSize7; - skip += localSkipped; - } - if (inRepeat < 0 || size == maxSize) { - result.size = size; - result.start = start; - result.skip = skip; - } - return result.size > 4 ? result : void 0; - } - function copyToBuffer(bufferStart, buffer2, index) { - let { id: id3, start, end, size } = cursor; - cursor.next(); - if (size >= 0 && id3 < minRepeatType) { - let startIndex = index; - if (size > 4) { - let endPos = cursor.pos - (size - 4); - while (cursor.pos > endPos) - index = copyToBuffer(bufferStart, buffer2, index); - } - buffer2[--index] = startIndex; - buffer2[--index] = end - bufferStart; - buffer2[--index] = start - bufferStart; - buffer2[--index] = id3; - } else if (size == -3) { - contextHash = id3; - } else if (size == -4) { - lookAhead = id3; - } - return index; - } - let children = [], positions = []; - while (cursor.pos > 0) - takeNode(data.start || 0, data.bufferStart || 0, children, positions, -1); - let length = (_a4 = data.length) !== null && _a4 !== void 0 ? _a4 : children.length ? positions[0] + children[0].length : 0; - return new Tree4(types4[data.topID], children.reverse(), positions.reverse(), length); - } - var nodeSizeCache4 = /* @__PURE__ */ new WeakMap(); - function nodeSize4(balanceType, node) { - if (!balanceType.isAnonymous || node instanceof TreeBuffer4 || node.type != balanceType) - return 1; - let size = nodeSizeCache4.get(node); - if (size == null) { - size = 1; - for (let child of node.children) { - if (child.type != balanceType || !(child instanceof Tree4)) { - size = 1; - break; - } - size += nodeSize4(balanceType, child); - } - nodeSizeCache4.set(node, size); - } - return size; - } - function balanceRange4(balanceType, children, positions, from2, to, start, length, mkTop, mkTree) { - let total = 0; - for (let i = from2; i < to; i++) - total += nodeSize4(balanceType, children[i]); - let maxChild = Math.ceil(total * 1.5 / 8); - let localChildren = [], localPositions = []; - function divide(children2, positions2, from3, to2, offset) { - for (let i = from3; i < to2; ) { - let groupFrom = i, groupStart = positions2[i], groupSize = nodeSize4(balanceType, children2[i]); - i++; - for (; i < to2; i++) { - let nextSize = nodeSize4(balanceType, children2[i]); - if (groupSize + nextSize >= maxChild) - break; - groupSize += nextSize; - } - if (i == groupFrom + 1) { - if (groupSize > maxChild) { - let only = children2[groupFrom]; - divide(only.children, only.positions, 0, only.children.length, positions2[groupFrom] + offset); - continue; - } - localChildren.push(children2[groupFrom]); - } else { - let length2 = positions2[i - 1] + children2[i - 1].length - groupStart; - localChildren.push(balanceRange4(balanceType, children2, positions2, groupFrom, i, groupStart, length2, null, mkTree)); - } - localPositions.push(groupStart + offset - start); - } - } - divide(children, positions, from2, to, 0); - return (mkTop || mkTree)(localChildren, localPositions, length); - } - var TreeFragment2 = class { - constructor(from2, to, tree, offset, openStart = false, openEnd = false) { - this.from = from2; - this.to = to; - this.tree = tree; - this.offset = offset; - this.open = (openStart ? 1 : 0) | (openEnd ? 2 : 0); - } - get openStart() { - return (this.open & 1) > 0; - } - get openEnd() { - return (this.open & 2) > 0; - } - static addTree(tree, fragments = [], partial = false) { - let result = [new TreeFragment2(0, tree.length, tree, 0, false, partial)]; - for (let f of fragments) - if (f.to > tree.length) - result.push(f); - return result; - } - static applyChanges(fragments, changes, minGap = 128) { - if (!changes.length) - return fragments; - let result = []; - let fI = 1, nextF = fragments.length ? fragments[0] : null; - for (let cI = 0, pos = 0, off = 0; ; cI++) { - let nextC = cI < changes.length ? changes[cI] : null; - let nextPos = nextC ? nextC.fromA : 1e9; - if (nextPos - pos >= minGap) - while (nextF && nextF.from < nextPos) { - let cut = nextF; - if (pos >= cut.from || nextPos <= cut.to || off) { - let fFrom = Math.max(cut.from, pos) - off, fTo = Math.min(cut.to, nextPos) - off; - cut = fFrom >= fTo ? null : new TreeFragment2(fFrom, fTo, cut.tree, cut.offset + off, cI > 0, !!nextC); - } - if (cut) - result.push(cut); - if (nextF.to > nextPos) - break; - nextF = fI < fragments.length ? fragments[fI++] : null; - } - if (!nextC) - break; - pos = nextC.toA; - off = nextC.toA - nextC.toB; - } - return result; - } - }; - var Parser3 = class { - startParse(input, fragments, ranges) { - if (typeof input == "string") - input = new StringInput3(input); - ranges = !ranges ? [new Range4(0, input.length)] : ranges.length ? ranges.map((r) => new Range4(r.from, r.to)) : [new Range4(0, 0)]; - return this.createParse(input, fragments || [], ranges); - } - parse(input, fragments, ranges) { - let parse = this.startParse(input, fragments, ranges); - for (; ; ) { - let done = parse.advance(); - if (done) - return done; - } - } - }; - var StringInput3 = class { - constructor(string3) { - this.string = string3; - } - get length() { - return this.string.length; - } - chunk(from2) { - return this.string.slice(from2); - } - get lineChunks() { - return false; - } - read(from2, to) { - return this.string.slice(from2, to); - } - }; - var stoppedInner4 = new NodeProp4({ perNode: true }); - - // node_modules/@codemirror/lang-javascript/node_modules/@codemirror/state/dist/index.js - var Text2 = class { - constructor() { - } - lineAt(pos) { - if (pos < 0 || pos > this.length) - throw new RangeError(`Invalid position ${pos} in document of length ${this.length}`); - return this.lineInner(pos, false, 1, 0); - } - line(n) { - if (n < 1 || n > this.lines) - throw new RangeError(`Invalid line number ${n} in ${this.lines}-line document`); - return this.lineInner(n, true, 1, 0); - } - replace(from2, to, text) { - let parts = []; - this.decompose(0, from2, parts, 2); - if (text.length) - text.decompose(0, text.length, parts, 1 | 2); - this.decompose(to, this.length, parts, 1); - return TextNode2.from(parts, this.length - (to - from2) + text.length); - } - append(other) { - return this.replace(this.length, this.length, other); - } - slice(from2, to = this.length) { - let parts = []; - this.decompose(from2, to, parts, 0); - return TextNode2.from(parts, to - from2); - } - eq(other) { - if (other == this) - return true; - if (other.length != this.length || other.lines != this.lines) - return false; - let start = this.scanIdentical(other, 1), end = this.length - this.scanIdentical(other, -1); - let a = new RawTextCursor2(this), b = new RawTextCursor2(other); - for (let skip = start, pos = start; ; ) { - a.next(skip); - b.next(skip); - skip = 0; - if (a.lineBreak != b.lineBreak || a.done != b.done || a.value != b.value) - return false; - pos += a.value.length; - if (a.done || pos >= end) - return true; - } - } - iter(dir = 1) { - return new RawTextCursor2(this, dir); - } - iterRange(from2, to = this.length) { - return new PartialTextCursor2(this, from2, to); - } - iterLines(from2, to) { - let inner; - if (from2 == null) { - inner = this.iter(); - } else { - if (to == null) - to = this.lines + 1; - let start = this.line(from2).from; - inner = this.iterRange(start, Math.max(start, to == this.lines + 1 ? this.length : to <= 1 ? 0 : this.line(to - 1).to)); - } - return new LineCursor2(inner); - } - toString() { - return this.sliceString(0); - } - toJSON() { - let lines = []; - this.flatten(lines); - return lines; - } - static of(text) { - if (text.length == 0) - throw new RangeError("A document must have at least one line"); - if (text.length == 1 && !text[0]) - return Text2.empty; - return text.length <= 32 ? new TextLeaf2(text) : TextNode2.from(TextLeaf2.split(text, [])); - } - }; - var TextLeaf2 = class extends Text2 { - constructor(text, length = textLength2(text)) { - super(); - this.text = text; - this.length = length; - } - get lines() { - return this.text.length; - } - get children() { - return null; - } - lineInner(target, isLine, line, offset) { - for (let i = 0; ; i++) { - let string3 = this.text[i], end = offset + string3.length; - if ((isLine ? line : end) >= target) - return new Line2(offset, end, line, string3); - offset = end + 1; - line++; - } - } - decompose(from2, to, target, open) { - let text = from2 <= 0 && to >= this.length ? this : new TextLeaf2(sliceText2(this.text, from2, to), Math.min(to, this.length) - Math.max(0, from2)); - if (open & 1) { - let prev = target.pop(); - let joined = appendText2(text.text, prev.text.slice(), 0, text.length); - if (joined.length <= 32) { - target.push(new TextLeaf2(joined, prev.length + text.length)); - } else { - let mid = joined.length >> 1; - target.push(new TextLeaf2(joined.slice(0, mid)), new TextLeaf2(joined.slice(mid))); - } - } else { - target.push(text); - } - } - replace(from2, to, text) { - if (!(text instanceof TextLeaf2)) - return super.replace(from2, to, text); - let lines = appendText2(this.text, appendText2(text.text, sliceText2(this.text, 0, from2)), to); - let newLen = this.length + text.length - (to - from2); - if (lines.length <= 32) - return new TextLeaf2(lines, newLen); - return TextNode2.from(TextLeaf2.split(lines, []), newLen); - } - sliceString(from2, to = this.length, lineSep = "\n") { - let result = ""; - for (let pos = 0, i = 0; pos <= to && i < this.text.length; i++) { - let line = this.text[i], end = pos + line.length; - if (pos > from2 && i) - result += lineSep; - if (from2 < end && to > pos) - result += line.slice(Math.max(0, from2 - pos), to - pos); - pos = end + 1; - } - return result; - } - flatten(target) { - for (let line of this.text) - target.push(line); - } - scanIdentical() { - return 0; - } - static split(text, target) { - let part = [], len = -1; - for (let line of text) { - part.push(line); - len += line.length + 1; - if (part.length == 32) { - target.push(new TextLeaf2(part, len)); - part = []; - len = -1; - } - } - if (len > -1) - target.push(new TextLeaf2(part, len)); - return target; - } - }; - var TextNode2 = class extends Text2 { - constructor(children, length) { - super(); - this.children = children; - this.length = length; - this.lines = 0; - for (let child of children) - this.lines += child.lines; - } - lineInner(target, isLine, line, offset) { - for (let i = 0; ; i++) { - let child = this.children[i], end = offset + child.length, endLine = line + child.lines - 1; - if ((isLine ? endLine : end) >= target) - return child.lineInner(target, isLine, line, offset); - offset = end + 1; - line = endLine + 1; - } - } - decompose(from2, to, target, open) { - for (let i = 0, pos = 0; pos <= to && i < this.children.length; i++) { - let child = this.children[i], end = pos + child.length; - if (from2 <= end && to >= pos) { - let childOpen = open & ((pos <= from2 ? 1 : 0) | (end >= to ? 2 : 0)); - if (pos >= from2 && end <= to && !childOpen) - target.push(child); - else - child.decompose(from2 - pos, to - pos, target, childOpen); - } - pos = end + 1; - } - } - replace(from2, to, text) { - if (text.lines < this.lines) - for (let i = 0, pos = 0; i < this.children.length; i++) { - let child = this.children[i], end = pos + child.length; - if (from2 >= pos && to <= end) { - let updated = child.replace(from2 - pos, to - pos, text); - let totalLines = this.lines - child.lines + updated.lines; - if (updated.lines < totalLines >> 5 - 1 && updated.lines > totalLines >> 5 + 1) { - let copy = this.children.slice(); - copy[i] = updated; - return new TextNode2(copy, this.length - (to - from2) + text.length); - } - return super.replace(pos, end, updated); - } - pos = end + 1; - } - return super.replace(from2, to, text); - } - sliceString(from2, to = this.length, lineSep = "\n") { - let result = ""; - for (let i = 0, pos = 0; i < this.children.length && pos <= to; i++) { - let child = this.children[i], end = pos + child.length; - if (pos > from2 && i) - result += lineSep; - if (from2 < end && to > pos) - result += child.sliceString(from2 - pos, to - pos, lineSep); - pos = end + 1; - } - return result; - } - flatten(target) { - for (let child of this.children) - child.flatten(target); - } - scanIdentical(other, dir) { - if (!(other instanceof TextNode2)) - return 0; - let length = 0; - let [iA, iB, eA, eB] = dir > 0 ? [0, 0, this.children.length, other.children.length] : [this.children.length - 1, other.children.length - 1, -1, -1]; - for (; ; iA += dir, iB += dir) { - if (iA == eA || iB == eB) - return length; - let chA = this.children[iA], chB = other.children[iB]; - if (chA != chB) - return length + chA.scanIdentical(chB, dir); - length += chA.length + 1; - } - } - static from(children, length = children.reduce((l, ch) => l + ch.length + 1, -1)) { - let lines = 0; - for (let ch of children) - lines += ch.lines; - if (lines < 32) { - let flat = []; - for (let ch of children) - ch.flatten(flat); - return new TextLeaf2(flat, length); - } - let chunk = Math.max(32, lines >> 5), maxChunk = chunk << 1, minChunk = chunk >> 1; - let chunked = [], currentLines = 0, currentLen = -1, currentChunk = []; - function add2(child) { - let last; - if (child.lines > maxChunk && child instanceof TextNode2) { - for (let node of child.children) - add2(node); - } else if (child.lines > minChunk && (currentLines > minChunk || !currentLines)) { - flush(); - chunked.push(child); - } else if (child instanceof TextLeaf2 && currentLines && (last = currentChunk[currentChunk.length - 1]) instanceof TextLeaf2 && child.lines + last.lines <= 32) { - currentLines += child.lines; - currentLen += child.length + 1; - currentChunk[currentChunk.length - 1] = new TextLeaf2(last.text.concat(child.text), last.length + 1 + child.length); - } else { - if (currentLines + child.lines > chunk) - flush(); - currentLines += child.lines; - currentLen += child.length + 1; - currentChunk.push(child); - } - } - function flush() { - if (currentLines == 0) - return; - chunked.push(currentChunk.length == 1 ? currentChunk[0] : TextNode2.from(currentChunk, currentLen)); - currentLen = -1; - currentLines = currentChunk.length = 0; - } - for (let child of children) - add2(child); - flush(); - return chunked.length == 1 ? chunked[0] : new TextNode2(chunked, length); - } - }; - Text2.empty = /* @__PURE__ */ new TextLeaf2([""], 0); - function textLength2(text) { - let length = -1; - for (let line of text) - length += line.length + 1; - return length; - } - function appendText2(text, target, from2 = 0, to = 1e9) { - for (let pos = 0, i = 0, first = true; i < text.length && pos <= to; i++) { - let line = text[i], end = pos + line.length; - if (end >= from2) { - if (end > to) - line = line.slice(0, to - pos); - if (pos < from2) - line = line.slice(from2 - pos); - if (first) { - target[target.length - 1] += line; - first = false; - } else - target.push(line); - } - pos = end + 1; - } - return target; - } - function sliceText2(text, from2, to) { - return appendText2(text, [""], from2, to); - } - var RawTextCursor2 = class { - constructor(text, dir = 1) { - this.dir = dir; - this.done = false; - this.lineBreak = false; - this.value = ""; - this.nodes = [text]; - this.offsets = [dir > 0 ? 1 : (text instanceof TextLeaf2 ? text.text.length : text.children.length) << 1]; - } - nextInner(skip, dir) { - this.done = this.lineBreak = false; - for (; ; ) { - let last = this.nodes.length - 1; - let top2 = this.nodes[last], offsetValue = this.offsets[last], offset = offsetValue >> 1; - let size = top2 instanceof TextLeaf2 ? top2.text.length : top2.children.length; - if (offset == (dir > 0 ? size : 0)) { - if (last == 0) { - this.done = true; - this.value = ""; - return this; - } - if (dir > 0) - this.offsets[last - 1]++; - this.nodes.pop(); - this.offsets.pop(); - } else if ((offsetValue & 1) == (dir > 0 ? 0 : 1)) { - this.offsets[last] += dir; - if (skip == 0) { - this.lineBreak = true; - this.value = "\n"; - return this; - } - skip--; - } else if (top2 instanceof TextLeaf2) { - let next = top2.text[offset + (dir < 0 ? -1 : 0)]; - this.offsets[last] += dir; - if (next.length > Math.max(0, skip)) { - this.value = skip == 0 ? next : dir > 0 ? next.slice(skip) : next.slice(0, next.length - skip); - return this; - } - skip -= next.length; - } else { - let next = top2.children[offset + (dir < 0 ? -1 : 0)]; - if (skip > next.length) { - skip -= next.length; - this.offsets[last] += dir; - } else { - if (dir < 0) - this.offsets[last]--; - this.nodes.push(next); - this.offsets.push(dir > 0 ? 1 : (next instanceof TextLeaf2 ? next.text.length : next.children.length) << 1); - } - } - } - } - next(skip = 0) { - if (skip < 0) { - this.nextInner(-skip, -this.dir); - skip = this.value.length; - } - return this.nextInner(skip, this.dir); - } - }; - var PartialTextCursor2 = class { - constructor(text, start, end) { - this.value = ""; - this.done = false; - this.cursor = new RawTextCursor2(text, start > end ? -1 : 1); - this.pos = start > end ? text.length : 0; - this.from = Math.min(start, end); - this.to = Math.max(start, end); - } - nextInner(skip, dir) { - if (dir < 0 ? this.pos <= this.from : this.pos >= this.to) { - this.value = ""; - this.done = true; - return this; - } - skip += Math.max(0, dir < 0 ? this.pos - this.to : this.from - this.pos); - let limit = dir < 0 ? this.pos - this.from : this.to - this.pos; - if (skip > limit) - skip = limit; - limit -= skip; - let { value } = this.cursor.next(skip); - this.pos += (value.length + skip) * dir; - this.value = value.length <= limit ? value : dir < 0 ? value.slice(value.length - limit) : value.slice(0, limit); - this.done = !this.value; - return this; - } - next(skip = 0) { - if (skip < 0) - skip = Math.max(skip, this.from - this.pos); - else if (skip > 0) - skip = Math.min(skip, this.to - this.pos); - return this.nextInner(skip, this.cursor.dir); - } - get lineBreak() { - return this.cursor.lineBreak && this.value != ""; - } - }; - var LineCursor2 = class { - constructor(inner) { - this.inner = inner; - this.afterBreak = true; - this.value = ""; - this.done = false; - } - next(skip = 0) { - let { done, lineBreak, value } = this.inner.next(skip); - if (done) { - this.done = true; - this.value = ""; - } else if (lineBreak) { - if (this.afterBreak) { - this.value = ""; - } else { - this.afterBreak = true; - this.next(); - } - } else { - this.value = value; - this.afterBreak = false; - } - return this; - } - get lineBreak() { - return false; - } - }; - if (typeof Symbol != "undefined") { - Text2.prototype[Symbol.iterator] = function() { - return this.iter(); - }; - RawTextCursor2.prototype[Symbol.iterator] = PartialTextCursor2.prototype[Symbol.iterator] = LineCursor2.prototype[Symbol.iterator] = function() { - return this; - }; - } - var Line2 = class { - constructor(from2, to, number3, text) { - this.from = from2; - this.to = to; - this.number = number3; - this.text = text; - } - get length() { - return this.to - this.from; - } - }; - var extend2 = /* @__PURE__ */ "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((s) => s ? parseInt(s, 36) : 1); - for (let i = 1; i < extend2.length; i++) - extend2[i] += extend2[i - 1]; - function isExtendingChar2(code) { - for (let i = 1; i < extend2.length; i += 2) - if (extend2[i] > code) - return extend2[i - 1] <= code; - return false; - } - function isRegionalIndicator2(code) { - return code >= 127462 && code <= 127487; - } - var ZWJ2 = 8205; - function findClusterBreak2(str, pos, forward = true, includeExtending = true) { - return (forward ? nextClusterBreak2 : prevClusterBreak2)(str, pos, includeExtending); - } - function nextClusterBreak2(str, pos, includeExtending) { - if (pos == str.length) - return pos; - if (pos && surrogateLow2(str.charCodeAt(pos)) && surrogateHigh2(str.charCodeAt(pos - 1))) - pos--; - let prev = codePointAt2(str, pos); - pos += codePointSize2(prev); - while (pos < str.length) { - let next = codePointAt2(str, pos); - if (prev == ZWJ2 || next == ZWJ2 || includeExtending && isExtendingChar2(next)) { - pos += codePointSize2(next); - prev = next; - } else if (isRegionalIndicator2(next)) { - let countBefore = 0, i = pos - 2; - while (i >= 0 && isRegionalIndicator2(codePointAt2(str, i))) { - countBefore++; - i -= 2; - } - if (countBefore % 2 == 0) - break; - else - pos += 2; - } else { - break; - } - } - return pos; - } - function prevClusterBreak2(str, pos, includeExtending) { - while (pos > 0) { - let found = nextClusterBreak2(str, pos - 2, includeExtending); - if (found < pos) - return found; - pos--; - } - return 0; - } - function surrogateLow2(ch) { - return ch >= 56320 && ch < 57344; - } - function surrogateHigh2(ch) { - return ch >= 55296 && ch < 56320; - } - function codePointAt2(str, pos) { - let code0 = str.charCodeAt(pos); - if (!surrogateHigh2(code0) || pos + 1 == str.length) - return code0; - let code1 = str.charCodeAt(pos + 1); - if (!surrogateLow2(code1)) - return code0; - return (code0 - 55296 << 10) + (code1 - 56320) + 65536; - } - function codePointSize2(code) { - return code < 65536 ? 1 : 2; - } - var DefaultSplit2 = /\r\n?|\n/; - var MapMode2 = /* @__PURE__ */ function(MapMode4) { - MapMode4[MapMode4["Simple"] = 0] = "Simple"; - MapMode4[MapMode4["TrackDel"] = 1] = "TrackDel"; - MapMode4[MapMode4["TrackBefore"] = 2] = "TrackBefore"; - MapMode4[MapMode4["TrackAfter"] = 3] = "TrackAfter"; - return MapMode4; - }(MapMode2 || (MapMode2 = {})); - var ChangeDesc2 = class { - constructor(sections) { - this.sections = sections; - } - get length() { - let result = 0; - for (let i = 0; i < this.sections.length; i += 2) - result += this.sections[i]; - return result; - } - get newLength() { - let result = 0; - for (let i = 0; i < this.sections.length; i += 2) { - let ins = this.sections[i + 1]; - result += ins < 0 ? this.sections[i] : ins; - } - return result; - } - get empty() { - return this.sections.length == 0 || this.sections.length == 2 && this.sections[1] < 0; - } - iterGaps(f) { - for (let i = 0, posA = 0, posB = 0; i < this.sections.length; ) { - let len = this.sections[i++], ins = this.sections[i++]; - if (ins < 0) { - f(posA, posB, len); - posB += len; - } else { - posB += ins; - } - posA += len; - } - } - iterChangedRanges(f, individual = false) { - iterChanges2(this, f, individual); - } - get invertedDesc() { - let sections = []; - for (let i = 0; i < this.sections.length; ) { - let len = this.sections[i++], ins = this.sections[i++]; - if (ins < 0) - sections.push(len, ins); - else - sections.push(ins, len); - } - return new ChangeDesc2(sections); - } - composeDesc(other) { - return this.empty ? other : other.empty ? this : composeSets2(this, other); - } - mapDesc(other, before = false) { - return other.empty ? this : mapSet2(this, other, before); - } - mapPos(pos, assoc = -1, mode = MapMode2.Simple) { - let posA = 0, posB = 0; - for (let i = 0; i < this.sections.length; ) { - let len = this.sections[i++], ins = this.sections[i++], endA = posA + len; - if (ins < 0) { - if (endA > pos) - return posB + (pos - posA); - posB += len; - } else { - if (mode != MapMode2.Simple && endA >= pos && (mode == MapMode2.TrackDel && posA < pos && endA > pos || mode == MapMode2.TrackBefore && posA < pos || mode == MapMode2.TrackAfter && endA > pos)) - return null; - if (endA > pos || endA == pos && assoc < 0 && !len) - return pos == posA || assoc < 0 ? posB : posB + ins; - posB += ins; - } - posA = endA; - } - if (pos > posA) - throw new RangeError(`Position ${pos} is out of range for changeset of length ${posA}`); - return posB; - } - touchesRange(from2, to = from2) { - for (let i = 0, pos = 0; i < this.sections.length && pos <= to; ) { - let len = this.sections[i++], ins = this.sections[i++], end = pos + len; - if (ins >= 0 && pos <= to && end >= from2) - return pos < from2 && end > to ? "cover" : true; - pos = end; - } - return false; - } - toString() { - let result = ""; - for (let i = 0; i < this.sections.length; ) { - let len = this.sections[i++], ins = this.sections[i++]; - result += (result ? " " : "") + len + (ins >= 0 ? ":" + ins : ""); - } - return result; - } - toJSON() { - return this.sections; - } - static fromJSON(json2) { - if (!Array.isArray(json2) || json2.length % 2 || json2.some((a) => typeof a != "number")) - throw new RangeError("Invalid JSON representation of ChangeDesc"); - return new ChangeDesc2(json2); - } - }; - var ChangeSet2 = class extends ChangeDesc2 { - constructor(sections, inserted) { - super(sections); - this.inserted = inserted; - } - apply(doc4) { - if (this.length != doc4.length) - throw new RangeError("Applying change set to a document with the wrong length"); - iterChanges2(this, (fromA, toA, fromB, _toB, text) => doc4 = doc4.replace(fromB, fromB + (toA - fromA), text), false); - return doc4; - } - mapDesc(other, before = false) { - return mapSet2(this, other, before, true); - } - invert(doc4) { - let sections = this.sections.slice(), inserted = []; - for (let i = 0, pos = 0; i < sections.length; i += 2) { - let len = sections[i], ins = sections[i + 1]; - if (ins >= 0) { - sections[i] = ins; - sections[i + 1] = len; - let index = i >> 1; - while (inserted.length < index) - inserted.push(Text2.empty); - inserted.push(len ? doc4.slice(pos, pos + len) : Text2.empty); - } - pos += len; - } - return new ChangeSet2(sections, inserted); - } - compose(other) { - return this.empty ? other : other.empty ? this : composeSets2(this, other, true); - } - map(other, before = false) { - return other.empty ? this : mapSet2(this, other, before, true); - } - iterChanges(f, individual = false) { - iterChanges2(this, f, individual); - } - get desc() { - return new ChangeDesc2(this.sections); - } - filter(ranges) { - let resultSections = [], resultInserted = [], filteredSections = []; - let iter = new SectionIter2(this); - done: - for (let i = 0, pos = 0; ; ) { - let next = i == ranges.length ? 1e9 : ranges[i++]; - while (pos < next || pos == next && iter.len == 0) { - if (iter.done) - break done; - let len = Math.min(iter.len, next - pos); - addSection2(filteredSections, len, -1); - let ins = iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0; - addSection2(resultSections, len, ins); - if (ins > 0) - addInsert2(resultInserted, resultSections, iter.text); - iter.forward(len); - pos += len; - } - let end = ranges[i++]; - while (pos < end) { - if (iter.done) - break done; - let len = Math.min(iter.len, end - pos); - addSection2(resultSections, len, -1); - addSection2(filteredSections, len, iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0); - iter.forward(len); - pos += len; - } - } - return { - changes: new ChangeSet2(resultSections, resultInserted), - filtered: new ChangeDesc2(filteredSections) - }; - } - toJSON() { - let parts = []; - for (let i = 0; i < this.sections.length; i += 2) { - let len = this.sections[i], ins = this.sections[i + 1]; - if (ins < 0) - parts.push(len); - else if (ins == 0) - parts.push([len]); - else - parts.push([len].concat(this.inserted[i >> 1].toJSON())); - } - return parts; - } - static of(changes, length, lineSep) { - let sections = [], inserted = [], pos = 0; - let total = null; - function flush(force = false) { - if (!force && !sections.length) - return; - if (pos < length) - addSection2(sections, length - pos, -1); - let set = new ChangeSet2(sections, inserted); - total = total ? total.compose(set.map(total)) : set; - sections = []; - inserted = []; - pos = 0; - } - function process2(spec) { - if (Array.isArray(spec)) { - for (let sub of spec) - process2(sub); - } else if (spec instanceof ChangeSet2) { - if (spec.length != length) - throw new RangeError(`Mismatched change set length (got ${spec.length}, expected ${length})`); - flush(); - total = total ? total.compose(spec.map(total)) : spec; - } else { - let { from: from2, to = from2, insert: insert4 } = spec; - if (from2 > to || from2 < 0 || to > length) - throw new RangeError(`Invalid change range ${from2} to ${to} (in doc of length ${length})`); - let insText = !insert4 ? Text2.empty : typeof insert4 == "string" ? Text2.of(insert4.split(lineSep || DefaultSplit2)) : insert4; - let insLen = insText.length; - if (from2 == to && insLen == 0) - return; - if (from2 < pos) - flush(); - if (from2 > pos) - addSection2(sections, from2 - pos, -1); - addSection2(sections, to - from2, insLen); - addInsert2(inserted, sections, insText); - pos = to; - } - } - process2(changes); - flush(!total); - return total; - } - static empty(length) { - return new ChangeSet2(length ? [length, -1] : [], []); - } - static fromJSON(json2) { - if (!Array.isArray(json2)) - throw new RangeError("Invalid JSON representation of ChangeSet"); - let sections = [], inserted = []; - for (let i = 0; i < json2.length; i++) { - let part = json2[i]; - if (typeof part == "number") { - sections.push(part, -1); - } else if (!Array.isArray(part) || typeof part[0] != "number" || part.some((e, i2) => i2 && typeof e != "string")) { - throw new RangeError("Invalid JSON representation of ChangeSet"); - } else if (part.length == 1) { - sections.push(part[0], 0); - } else { - while (inserted.length < i) - inserted.push(Text2.empty); - inserted[i] = Text2.of(part.slice(1)); - sections.push(part[0], inserted[i].length); - } - } - return new ChangeSet2(sections, inserted); - } - }; - function addSection2(sections, len, ins, forceJoin = false) { - if (len == 0 && ins <= 0) - return; - let last = sections.length - 2; - if (last >= 0 && ins <= 0 && ins == sections[last + 1]) - sections[last] += len; - else if (len == 0 && sections[last] == 0) - sections[last + 1] += ins; - else if (forceJoin) { - sections[last] += len; - sections[last + 1] += ins; - } else - sections.push(len, ins); - } - function addInsert2(values2, sections, value) { - if (value.length == 0) - return; - let index = sections.length - 2 >> 1; - if (index < values2.length) { - values2[values2.length - 1] = values2[values2.length - 1].append(value); - } else { - while (values2.length < index) - values2.push(Text2.empty); - values2.push(value); - } - } - function iterChanges2(desc, f, individual) { - let inserted = desc.inserted; - for (let posA = 0, posB = 0, i = 0; i < desc.sections.length; ) { - let len = desc.sections[i++], ins = desc.sections[i++]; - if (ins < 0) { - posA += len; - posB += len; - } else { - let endA = posA, endB = posB, text = Text2.empty; - for (; ; ) { - endA += len; - endB += ins; - if (ins && inserted) - text = text.append(inserted[i - 2 >> 1]); - if (individual || i == desc.sections.length || desc.sections[i + 1] < 0) - break; - len = desc.sections[i++]; - ins = desc.sections[i++]; - } - f(posA, endA, posB, endB, text); - posA = endA; - posB = endB; - } - } - } - function mapSet2(setA, setB, before, mkSet = false) { - let sections = [], insert4 = mkSet ? [] : null; - let a = new SectionIter2(setA), b = new SectionIter2(setB); - for (let posA = 0, posB = 0; ; ) { - if (a.ins == -1) { - posA += a.len; - a.next(); - } else if (b.ins == -1 && posB < posA) { - let skip = Math.min(b.len, posA - posB); - b.forward(skip); - addSection2(sections, skip, -1); - posB += skip; - } else if (b.ins >= 0 && (a.done || posB < posA || posB == posA && (b.len < a.len || b.len == a.len && !before))) { - addSection2(sections, b.ins, -1); - while (posA > posB && !a.done && posA + a.len < posB + b.len) { - posA += a.len; - a.next(); - } - posB += b.len; - b.next(); - } else if (a.ins >= 0) { - let len = 0, end = posA + a.len; - for (; ; ) { - if (b.ins >= 0 && posB > posA && posB + b.len < end) { - len += b.ins; - posB += b.len; - b.next(); - } else if (b.ins == -1 && posB < end) { - let skip = Math.min(b.len, end - posB); - len += skip; - b.forward(skip); - posB += skip; - } else { - break; - } - } - addSection2(sections, len, a.ins); - if (insert4) - addInsert2(insert4, sections, a.text); - posA = end; - a.next(); - } else if (a.done && b.done) { - return insert4 ? new ChangeSet2(sections, insert4) : new ChangeDesc2(sections); - } else { - throw new Error("Mismatched change set lengths"); - } - } - } - function composeSets2(setA, setB, mkSet = false) { - let sections = []; - let insert4 = mkSet ? [] : null; - let a = new SectionIter2(setA), b = new SectionIter2(setB); - for (let open = false; ; ) { - if (a.done && b.done) { - return insert4 ? new ChangeSet2(sections, insert4) : new ChangeDesc2(sections); - } else if (a.ins == 0) { - addSection2(sections, a.len, 0, open); - a.next(); - } else if (b.len == 0 && !b.done) { - addSection2(sections, 0, b.ins, open); - if (insert4) - addInsert2(insert4, sections, b.text); - b.next(); - } else if (a.done || b.done) { - throw new Error("Mismatched change set lengths"); - } else { - let len = Math.min(a.len2, b.len), sectionLen = sections.length; - if (a.ins == -1) { - let insB = b.ins == -1 ? -1 : b.off ? 0 : b.ins; - addSection2(sections, len, insB, open); - if (insert4 && insB) - addInsert2(insert4, sections, b.text); - } else if (b.ins == -1) { - addSection2(sections, a.off ? 0 : a.len, len, open); - if (insert4) - addInsert2(insert4, sections, a.textBit(len)); - } else { - addSection2(sections, a.off ? 0 : a.len, b.off ? 0 : b.ins, open); - if (insert4 && !b.off) - addInsert2(insert4, sections, b.text); - } - open = (a.ins > len || b.ins >= 0 && b.len > len) && (open || sections.length > sectionLen); - a.forward2(len); - b.forward(len); - } - } - } - var SectionIter2 = class { - constructor(set) { - this.set = set; - this.i = 0; - this.next(); - } - next() { - let { sections } = this.set; - if (this.i < sections.length) { - this.len = sections[this.i++]; - this.ins = sections[this.i++]; - } else { - this.len = 0; - this.ins = -2; - } - this.off = 0; - } - get done() { - return this.ins == -2; - } - get len2() { - return this.ins < 0 ? this.len : this.ins; - } - get text() { - let { inserted } = this.set, index = this.i - 2 >> 1; - return index >= inserted.length ? Text2.empty : inserted[index]; - } - textBit(len) { - let { inserted } = this.set, index = this.i - 2 >> 1; - return index >= inserted.length && !len ? Text2.empty : inserted[index].slice(this.off, len == null ? void 0 : this.off + len); - } - forward(len) { - if (len == this.len) - this.next(); - else { - this.len -= len; - this.off += len; - } - } - forward2(len) { - if (this.ins == -1) - this.forward(len); - else if (len == this.ins) - this.next(); - else { - this.ins -= len; - this.off += len; - } - } - }; - var SelectionRange2 = class { - constructor(from2, to, flags) { - this.from = from2; - this.to = to; - this.flags = flags; - } - get anchor() { - return this.flags & 16 ? this.to : this.from; - } - get head() { - return this.flags & 16 ? this.from : this.to; - } - get empty() { - return this.from == this.to; - } - get assoc() { - return this.flags & 4 ? -1 : this.flags & 8 ? 1 : 0; - } - get bidiLevel() { - let level = this.flags & 3; - return level == 3 ? null : level; - } - get goalColumn() { - let value = this.flags >> 5; - return value == 33554431 ? void 0 : value; - } - map(change, assoc = -1) { - let from2, to; - if (this.empty) { - from2 = to = change.mapPos(this.from, assoc); - } else { - from2 = change.mapPos(this.from, 1); - to = change.mapPos(this.to, -1); - } - return from2 == this.from && to == this.to ? this : new SelectionRange2(from2, to, this.flags); - } - extend(from2, to = from2) { - if (from2 <= this.anchor && to >= this.anchor) - return EditorSelection2.range(from2, to); - let head = Math.abs(from2 - this.anchor) > Math.abs(to - this.anchor) ? from2 : to; - return EditorSelection2.range(this.anchor, head); - } - eq(other) { - return this.anchor == other.anchor && this.head == other.head; - } - toJSON() { - return { anchor: this.anchor, head: this.head }; - } - static fromJSON(json2) { - if (!json2 || typeof json2.anchor != "number" || typeof json2.head != "number") - throw new RangeError("Invalid JSON representation for SelectionRange"); - return EditorSelection2.range(json2.anchor, json2.head); - } - }; - var EditorSelection2 = class { - constructor(ranges, mainIndex = 0) { - this.ranges = ranges; - this.mainIndex = mainIndex; - } - map(change, assoc = -1) { - if (change.empty) - return this; - return EditorSelection2.create(this.ranges.map((r) => r.map(change, assoc)), this.mainIndex); - } - eq(other) { - if (this.ranges.length != other.ranges.length || this.mainIndex != other.mainIndex) - return false; - for (let i = 0; i < this.ranges.length; i++) - if (!this.ranges[i].eq(other.ranges[i])) - return false; - return true; - } - get main() { - return this.ranges[this.mainIndex]; - } - asSingle() { - return this.ranges.length == 1 ? this : new EditorSelection2([this.main]); - } - addRange(range, main = true) { - return EditorSelection2.create([range].concat(this.ranges), main ? 0 : this.mainIndex + 1); - } - replaceRange(range, which = this.mainIndex) { - let ranges = this.ranges.slice(); - ranges[which] = range; - return EditorSelection2.create(ranges, this.mainIndex); - } - toJSON() { - return { ranges: this.ranges.map((r) => r.toJSON()), main: this.mainIndex }; - } - static fromJSON(json2) { - if (!json2 || !Array.isArray(json2.ranges) || typeof json2.main != "number" || json2.main >= json2.ranges.length) - throw new RangeError("Invalid JSON representation for EditorSelection"); - return new EditorSelection2(json2.ranges.map((r) => SelectionRange2.fromJSON(r)), json2.main); - } - static single(anchor, head = anchor) { - return new EditorSelection2([EditorSelection2.range(anchor, head)], 0); - } - static create(ranges, mainIndex = 0) { - if (ranges.length == 0) - throw new RangeError("A selection needs at least one range"); - for (let pos = 0, i = 0; i < ranges.length; i++) { - let range = ranges[i]; - if (range.empty ? range.from <= pos : range.from < pos) - return normalized2(ranges.slice(), mainIndex); - pos = range.to; - } - return new EditorSelection2(ranges, mainIndex); - } - static cursor(pos, assoc = 0, bidiLevel, goalColumn) { - return new SelectionRange2(pos, pos, (assoc == 0 ? 0 : assoc < 0 ? 4 : 8) | (bidiLevel == null ? 3 : Math.min(2, bidiLevel)) | (goalColumn !== null && goalColumn !== void 0 ? goalColumn : 33554431) << 5); - } - static range(anchor, head, goalColumn) { - let goal = (goalColumn !== null && goalColumn !== void 0 ? goalColumn : 33554431) << 5; - return head < anchor ? new SelectionRange2(head, anchor, 16 | goal | 8) : new SelectionRange2(anchor, head, goal | (head > anchor ? 4 : 0)); - } - }; - function normalized2(ranges, mainIndex = 0) { - let main = ranges[mainIndex]; - ranges.sort((a, b) => a.from - b.from); - mainIndex = ranges.indexOf(main); - for (let i = 1; i < ranges.length; i++) { - let range = ranges[i], prev = ranges[i - 1]; - if (range.empty ? range.from <= prev.to : range.from < prev.to) { - let from2 = prev.from, to = Math.max(range.to, prev.to); - if (i <= mainIndex) - mainIndex--; - ranges.splice(--i, 2, range.anchor > range.head ? EditorSelection2.range(to, from2) : EditorSelection2.range(from2, to)); - } - } - return new EditorSelection2(ranges, mainIndex); - } - function checkSelection2(selection, docLength) { - for (let range of selection.ranges) - if (range.to > docLength) - throw new RangeError("Selection points outside of document"); - } - var nextID2 = 0; - var Facet2 = class { - constructor(combine, compareInput, compare4, isStatic, extensions) { - this.combine = combine; - this.compareInput = compareInput; - this.compare = compare4; - this.isStatic = isStatic; - this.extensions = extensions; - this.id = nextID2++; - this.default = combine([]); - } - static define(config2 = {}) { - return new Facet2(config2.combine || ((a) => a), config2.compareInput || ((a, b) => a === b), config2.compare || (!config2.combine ? sameArray4 : (a, b) => a === b), !!config2.static, config2.enables); - } - of(value) { - return new FacetProvider2([], this, 0, value); - } - compute(deps, get) { - if (this.isStatic) - throw new Error("Can't compute a static facet"); - return new FacetProvider2(deps, this, 1, get); - } - computeN(deps, get) { - if (this.isStatic) - throw new Error("Can't compute a static facet"); - return new FacetProvider2(deps, this, 2, get); - } - from(field, get) { - if (!get) - get = (x) => x; - return this.compute([field], (state) => get(state.field(field))); - } - }; - function sameArray4(a, b) { - return a == b || a.length == b.length && a.every((e, i) => e === b[i]); - } - var FacetProvider2 = class { - constructor(dependencies, facet, type, value) { - this.dependencies = dependencies; - this.facet = facet; - this.type = type; - this.value = value; - this.id = nextID2++; - } - dynamicSlot(addresses) { - var _a4; - let getter = this.value; - let compare4 = this.facet.compareInput; - let id3 = this.id, idx = addresses[id3] >> 1, multi = this.type == 2; - let depDoc = false, depSel = false, depAddrs = []; - for (let dep of this.dependencies) { - if (dep == "doc") - depDoc = true; - else if (dep == "selection") - depSel = true; - else if ((((_a4 = addresses[dep.id]) !== null && _a4 !== void 0 ? _a4 : 1) & 1) == 0) - depAddrs.push(addresses[dep.id]); - } - return { - create(state) { - state.values[idx] = getter(state); - return 1; - }, - update(state, tr) { - if (depDoc && tr.docChanged || depSel && (tr.docChanged || tr.selection) || ensureAll(state, depAddrs)) { - let newVal = getter(state); - if (multi ? !compareArray2(newVal, state.values[idx], compare4) : !compare4(newVal, state.values[idx])) { - state.values[idx] = newVal; - return 1; - } - } - return 0; - }, - reconfigure: (state, oldState) => { - let newVal = getter(state); - let oldAddr = oldState.config.address[id3]; - if (oldAddr != null) { - let oldVal = getAddr2(oldState, oldAddr); - if (this.dependencies.every((dep) => { - return dep instanceof Facet2 ? oldState.facet(dep) === state.facet(dep) : dep instanceof StateField2 ? oldState.field(dep, false) == state.field(dep, false) : true; - }) || (multi ? compareArray2(newVal, oldVal, compare4) : compare4(newVal, oldVal))) { - state.values[idx] = oldVal; - return 0; - } - } - state.values[idx] = newVal; - return 1; - } - }; - } - }; - function compareArray2(a, b, compare4) { - if (a.length != b.length) - return false; - for (let i = 0; i < a.length; i++) - if (!compare4(a[i], b[i])) - return false; - return true; - } - function ensureAll(state, addrs) { - let changed = false; - for (let addr of addrs) - if (ensureAddr2(state, addr) & 1) - changed = true; - return changed; - } - function dynamicFacetSlot2(addresses, facet, providers) { - let providerAddrs = providers.map((p) => addresses[p.id]); - let providerTypes = providers.map((p) => p.type); - let dynamic = providerAddrs.filter((p) => !(p & 1)); - let idx = addresses[facet.id] >> 1; - function get(state) { - let values2 = []; - for (let i = 0; i < providerAddrs.length; i++) { - let value = getAddr2(state, providerAddrs[i]); - if (providerTypes[i] == 2) - for (let val of value) - values2.push(val); - else - values2.push(value); - } - return facet.combine(values2); - } - return { - create(state) { - for (let addr of providerAddrs) - ensureAddr2(state, addr); - state.values[idx] = get(state); - return 1; - }, - update(state, tr) { - if (!ensureAll(state, dynamic)) - return 0; - let value = get(state); - if (facet.compare(value, state.values[idx])) - return 0; - state.values[idx] = value; - return 1; - }, - reconfigure(state, oldState) { - let depChanged = ensureAll(state, providerAddrs); - let oldProviders = oldState.config.facets[facet.id], oldValue = oldState.facet(facet); - if (oldProviders && !depChanged && sameArray4(providers, oldProviders)) { - state.values[idx] = oldValue; - return 0; - } - let value = get(state); - if (facet.compare(value, oldValue)) { - state.values[idx] = oldValue; - return 0; - } - state.values[idx] = value; - return 1; - } - }; - } - var initField2 = /* @__PURE__ */ Facet2.define({ static: true }); - var StateField2 = class { - constructor(id3, createF, updateF, compareF, spec) { - this.id = id3; - this.createF = createF; - this.updateF = updateF; - this.compareF = compareF; - this.spec = spec; - this.provides = void 0; - } - static define(config2) { - let field = new StateField2(nextID2++, config2.create, config2.update, config2.compare || ((a, b) => a === b), config2); - if (config2.provide) - field.provides = config2.provide(field); - return field; - } - create(state) { - let init = state.facet(initField2).find((i) => i.field == this); - return ((init === null || init === void 0 ? void 0 : init.create) || this.createF)(state); - } - slot(addresses) { - let idx = addresses[this.id] >> 1; - return { - create: (state) => { - state.values[idx] = this.create(state); - return 1; - }, - update: (state, tr) => { - let oldVal = state.values[idx]; - let value = this.updateF(oldVal, tr); - if (this.compareF(oldVal, value)) - return 0; - state.values[idx] = value; - return 1; - }, - reconfigure: (state, oldState) => { - if (oldState.config.address[this.id] != null) { - state.values[idx] = oldState.field(this); - return 0; - } - state.values[idx] = this.create(state); - return 1; - } - }; - } - init(create) { - return [this, initField2.of({ field: this, create })]; - } - get extension() { - return this; - } - }; - var Prec_2 = { lowest: 4, low: 3, default: 2, high: 1, highest: 0 }; - function prec2(value) { - return (ext) => new PrecExtension2(ext, value); - } - var Prec2 = { - highest: /* @__PURE__ */ prec2(Prec_2.highest), - high: /* @__PURE__ */ prec2(Prec_2.high), - default: /* @__PURE__ */ prec2(Prec_2.default), - low: /* @__PURE__ */ prec2(Prec_2.low), - lowest: /* @__PURE__ */ prec2(Prec_2.lowest) - }; - var PrecExtension2 = class { - constructor(inner, prec4) { - this.inner = inner; - this.prec = prec4; - } - }; - var Compartment2 = class { - of(ext) { - return new CompartmentInstance2(this, ext); - } - reconfigure(content3) { - return Compartment2.reconfigure.of({ compartment: this, extension: content3 }); - } - get(state) { - return state.config.compartments.get(this); - } - }; - var CompartmentInstance2 = class { - constructor(compartment, inner) { - this.compartment = compartment; - this.inner = inner; - } - }; - var Configuration2 = class { - constructor(base2, compartments, dynamicSlots, address, staticValues, facets) { - this.base = base2; - this.compartments = compartments; - this.dynamicSlots = dynamicSlots; - this.address = address; - this.staticValues = staticValues; - this.facets = facets; - this.statusTemplate = []; - while (this.statusTemplate.length < dynamicSlots.length) - this.statusTemplate.push(0); - } - staticFacet(facet) { - let addr = this.address[facet.id]; - return addr == null ? facet.default : this.staticValues[addr >> 1]; - } - static resolve(base2, compartments, oldState) { - let fields = []; - let facets = /* @__PURE__ */ Object.create(null); - let newCompartments = /* @__PURE__ */ new Map(); - for (let ext of flatten2(base2, compartments, newCompartments)) { - if (ext instanceof StateField2) - fields.push(ext); - else - (facets[ext.facet.id] || (facets[ext.facet.id] = [])).push(ext); - } - let address = /* @__PURE__ */ Object.create(null); - let staticValues = []; - let dynamicSlots = []; - for (let field of fields) { - address[field.id] = dynamicSlots.length << 1; - dynamicSlots.push((a) => field.slot(a)); - } - let oldFacets = oldState === null || oldState === void 0 ? void 0 : oldState.config.facets; - for (let id3 in facets) { - let providers = facets[id3], facet = providers[0].facet; - let oldProviders = oldFacets && oldFacets[id3] || []; - if (providers.every((p) => p.type == 0)) { - address[facet.id] = staticValues.length << 1 | 1; - if (sameArray4(oldProviders, providers)) { - staticValues.push(oldState.facet(facet)); - } else { - let value = facet.combine(providers.map((p) => p.value)); - staticValues.push(oldState && facet.compare(value, oldState.facet(facet)) ? oldState.facet(facet) : value); - } - } else { - for (let p of providers) { - if (p.type == 0) { - address[p.id] = staticValues.length << 1 | 1; - staticValues.push(p.value); - } else { - address[p.id] = dynamicSlots.length << 1; - dynamicSlots.push((a) => p.dynamicSlot(a)); - } - } - address[facet.id] = dynamicSlots.length << 1; - dynamicSlots.push((a) => dynamicFacetSlot2(a, facet, providers)); - } - } - let dynamic = dynamicSlots.map((f) => f(address)); - return new Configuration2(base2, newCompartments, dynamic, address, staticValues, facets); - } - }; - function flatten2(extension, compartments, newCompartments) { - let result = [[], [], [], [], []]; - let seen = /* @__PURE__ */ new Map(); - function inner(ext, prec4) { - let known = seen.get(ext); - if (known != null) { - if (known <= prec4) - return; - let found = result[known].indexOf(ext); - if (found > -1) - result[known].splice(found, 1); - if (ext instanceof CompartmentInstance2) - newCompartments.delete(ext.compartment); - } - seen.set(ext, prec4); - if (Array.isArray(ext)) { - for (let e of ext) - inner(e, prec4); - } else if (ext instanceof CompartmentInstance2) { - if (newCompartments.has(ext.compartment)) - throw new RangeError(`Duplicate use of compartment in extensions`); - let content3 = compartments.get(ext.compartment) || ext.inner; - newCompartments.set(ext.compartment, content3); - inner(content3, prec4); - } else if (ext instanceof PrecExtension2) { - inner(ext.inner, ext.prec); - } else if (ext instanceof StateField2) { - result[prec4].push(ext); - if (ext.provides) - inner(ext.provides, prec4); - } else if (ext instanceof FacetProvider2) { - result[prec4].push(ext); - if (ext.facet.extensions) - inner(ext.facet.extensions, prec4); - } else { - let content3 = ext.extension; - if (!content3) - throw new Error(`Unrecognized extension value in extension set (${ext}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`); - inner(content3, prec4); - } - } - inner(extension, Prec_2.default); - return result.reduce((a, b) => a.concat(b)); - } - function ensureAddr2(state, addr) { - if (addr & 1) - return 2; - let idx = addr >> 1; - let status = state.status[idx]; - if (status == 4) - throw new Error("Cyclic dependency between fields and/or facets"); - if (status & 2) - return status; - state.status[idx] = 4; - let changed = state.computeSlot(state, state.config.dynamicSlots[idx]); - return state.status[idx] = 2 | changed; - } - function getAddr2(state, addr) { - return addr & 1 ? state.config.staticValues[addr >> 1] : state.values[addr >> 1]; - } - var languageData2 = /* @__PURE__ */ Facet2.define(); - var allowMultipleSelections2 = /* @__PURE__ */ Facet2.define({ - combine: (values2) => values2.some((v) => v), - static: true - }); - var lineSeparator2 = /* @__PURE__ */ Facet2.define({ - combine: (values2) => values2.length ? values2[0] : void 0, - static: true - }); - var changeFilter2 = /* @__PURE__ */ Facet2.define(); - var transactionFilter2 = /* @__PURE__ */ Facet2.define(); - var transactionExtender2 = /* @__PURE__ */ Facet2.define(); - var readOnly2 = /* @__PURE__ */ Facet2.define({ - combine: (values2) => values2.length ? values2[0] : false - }); - var Annotation2 = class { - constructor(type, value) { - this.type = type; - this.value = value; - } - static define() { - return new AnnotationType2(); - } - }; - var AnnotationType2 = class { - of(value) { - return new Annotation2(this, value); - } - }; - var StateEffectType2 = class { - constructor(map) { - this.map = map; - } - of(value) { - return new StateEffect2(this, value); - } - }; - var StateEffect2 = class { - constructor(type, value) { - this.type = type; - this.value = value; - } - map(mapping) { - let mapped = this.type.map(this.value, mapping); - return mapped === void 0 ? void 0 : mapped == this.value ? this : new StateEffect2(this.type, mapped); - } - is(type) { - return this.type == type; - } - static define(spec = {}) { - return new StateEffectType2(spec.map || ((v) => v)); - } - static mapEffects(effects, mapping) { - if (!effects.length) - return effects; - let result = []; - for (let effect of effects) { - let mapped = effect.map(mapping); - if (mapped) - result.push(mapped); - } - return result; - } - }; - StateEffect2.reconfigure = /* @__PURE__ */ StateEffect2.define(); - StateEffect2.appendConfig = /* @__PURE__ */ StateEffect2.define(); - var Transaction2 = class { - constructor(startState, changes, selection, effects, annotations, scrollIntoView5) { - this.startState = startState; - this.changes = changes; - this.selection = selection; - this.effects = effects; - this.annotations = annotations; - this.scrollIntoView = scrollIntoView5; - this._doc = null; - this._state = null; - if (selection) - checkSelection2(selection, changes.newLength); - if (!annotations.some((a) => a.type == Transaction2.time)) - this.annotations = annotations.concat(Transaction2.time.of(Date.now())); - } - get newDoc() { - return this._doc || (this._doc = this.changes.apply(this.startState.doc)); - } - get newSelection() { - return this.selection || this.startState.selection.map(this.changes); - } - get state() { - if (!this._state) - this.startState.applyTransaction(this); - return this._state; - } - annotation(type) { - for (let ann of this.annotations) - if (ann.type == type) - return ann.value; - return void 0; - } - get docChanged() { - return !this.changes.empty; - } - get reconfigured() { - return this.startState.config != this.state.config; - } - isUserEvent(event) { - let e = this.annotation(Transaction2.userEvent); - return !!(e && (e == event || e.length > event.length && e.slice(0, event.length) == event && e[event.length] == ".")); - } - }; - Transaction2.time = /* @__PURE__ */ Annotation2.define(); - Transaction2.userEvent = /* @__PURE__ */ Annotation2.define(); - Transaction2.addToHistory = /* @__PURE__ */ Annotation2.define(); - Transaction2.remote = /* @__PURE__ */ Annotation2.define(); - function joinRanges2(a, b) { - let result = []; - for (let iA = 0, iB = 0; ; ) { - let from2, to; - if (iA < a.length && (iB == b.length || b[iB] >= a[iA])) { - from2 = a[iA++]; - to = a[iA++]; - } else if (iB < b.length) { - from2 = b[iB++]; - to = b[iB++]; - } else - return result; - if (!result.length || result[result.length - 1] < from2) - result.push(from2, to); - else if (result[result.length - 1] < to) - result[result.length - 1] = to; - } - } - function mergeTransaction2(a, b, sequential) { - var _a4; - let mapForA, mapForB, changes; - if (sequential) { - mapForA = b.changes; - mapForB = ChangeSet2.empty(b.changes.length); - changes = a.changes.compose(b.changes); - } else { - mapForA = b.changes.map(a.changes); - mapForB = a.changes.mapDesc(b.changes, true); - changes = a.changes.compose(mapForA); - } - return { - changes, - selection: b.selection ? b.selection.map(mapForB) : (_a4 = a.selection) === null || _a4 === void 0 ? void 0 : _a4.map(mapForA), - effects: StateEffect2.mapEffects(a.effects, mapForA).concat(StateEffect2.mapEffects(b.effects, mapForB)), - annotations: a.annotations.length ? a.annotations.concat(b.annotations) : b.annotations, - scrollIntoView: a.scrollIntoView || b.scrollIntoView - }; - } - function resolveTransactionInner2(state, spec, docSize) { - let sel = spec.selection, annotations = asArray3(spec.annotations); - if (spec.userEvent) - annotations = annotations.concat(Transaction2.userEvent.of(spec.userEvent)); - return { - changes: spec.changes instanceof ChangeSet2 ? spec.changes : ChangeSet2.of(spec.changes || [], docSize, state.facet(lineSeparator2)), - selection: sel && (sel instanceof EditorSelection2 ? sel : EditorSelection2.single(sel.anchor, sel.head)), - effects: asArray3(spec.effects), - annotations, - scrollIntoView: !!spec.scrollIntoView - }; - } - function resolveTransaction2(state, specs, filter) { - let s = resolveTransactionInner2(state, specs.length ? specs[0] : {}, state.doc.length); - if (specs.length && specs[0].filter === false) - filter = false; - for (let i = 1; i < specs.length; i++) { - if (specs[i].filter === false) - filter = false; - let seq = !!specs[i].sequential; - s = mergeTransaction2(s, resolveTransactionInner2(state, specs[i], seq ? s.changes.newLength : state.doc.length), seq); - } - let tr = new Transaction2(state, s.changes, s.selection, s.effects, s.annotations, s.scrollIntoView); - return extendTransaction2(filter ? filterTransaction2(tr) : tr); - } - function filterTransaction2(tr) { - let state = tr.startState; - let result = true; - for (let filter of state.facet(changeFilter2)) { - let value = filter(tr); - if (value === false) { - result = false; - break; - } - if (Array.isArray(value)) - result = result === true ? value : joinRanges2(result, value); - } - if (result !== true) { - let changes, back; - if (result === false) { - back = tr.changes.invertedDesc; - changes = ChangeSet2.empty(state.doc.length); - } else { - let filtered = tr.changes.filter(result); - changes = filtered.changes; - back = filtered.filtered.invertedDesc; - } - tr = new Transaction2(state, changes, tr.selection && tr.selection.map(back), StateEffect2.mapEffects(tr.effects, back), tr.annotations, tr.scrollIntoView); - } - let filters = state.facet(transactionFilter2); - for (let i = filters.length - 1; i >= 0; i--) { - let filtered = filters[i](tr); - if (filtered instanceof Transaction2) - tr = filtered; - else if (Array.isArray(filtered) && filtered.length == 1 && filtered[0] instanceof Transaction2) - tr = filtered[0]; - else - tr = resolveTransaction2(state, asArray3(filtered), false); - } - return tr; - } - function extendTransaction2(tr) { - let state = tr.startState, extenders = state.facet(transactionExtender2), spec = tr; - for (let i = extenders.length - 1; i >= 0; i--) { - let extension = extenders[i](tr); - if (extension && Object.keys(extension).length) - spec = mergeTransaction2(tr, resolveTransactionInner2(state, extension, tr.changes.newLength), true); - } - return spec == tr ? tr : new Transaction2(state, tr.changes, tr.selection, spec.effects, spec.annotations, spec.scrollIntoView); - } - var none5 = []; - function asArray3(value) { - return value == null ? none5 : Array.isArray(value) ? value : [value]; - } - var CharCategory2 = /* @__PURE__ */ function(CharCategory4) { - CharCategory4[CharCategory4["Word"] = 0] = "Word"; - CharCategory4[CharCategory4["Space"] = 1] = "Space"; - CharCategory4[CharCategory4["Other"] = 2] = "Other"; - return CharCategory4; - }(CharCategory2 || (CharCategory2 = {})); - var nonASCIISingleCaseWordChar2 = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; - var wordChar2; - try { - wordChar2 = /* @__PURE__ */ new RegExp("[\\p{Alphabetic}\\p{Number}_]", "u"); - } catch (_) { - } - function hasWordChar2(str) { - if (wordChar2) - return wordChar2.test(str); - for (let i = 0; i < str.length; i++) { - let ch = str[i]; - if (/\w/.test(ch) || ch > "\x80" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar2.test(ch))) - return true; - } - return false; - } - function makeCategorizer2(wordChars) { - return (char) => { - if (!/\S/.test(char)) - return CharCategory2.Space; - if (hasWordChar2(char)) - return CharCategory2.Word; - for (let i = 0; i < wordChars.length; i++) - if (char.indexOf(wordChars[i]) > -1) - return CharCategory2.Word; - return CharCategory2.Other; - }; - } - var EditorState2 = class { - constructor(config2, doc4, selection, values2, computeSlot, tr) { - this.config = config2; - this.doc = doc4; - this.selection = selection; - this.values = values2; - this.status = config2.statusTemplate.slice(); - this.computeSlot = computeSlot; - if (tr) - tr._state = this; - for (let i = 0; i < this.config.dynamicSlots.length; i++) - ensureAddr2(this, i << 1); - this.computeSlot = null; - } - field(field, require3 = true) { - let addr = this.config.address[field.id]; - if (addr == null) { - if (require3) - throw new RangeError("Field is not present in this state"); - return void 0; - } - ensureAddr2(this, addr); - return getAddr2(this, addr); - } - update(...specs) { - return resolveTransaction2(this, specs, true); - } - applyTransaction(tr) { - let conf = this.config, { base: base2, compartments } = conf; - for (let effect of tr.effects) { - if (effect.is(Compartment2.reconfigure)) { - if (conf) { - compartments = /* @__PURE__ */ new Map(); - conf.compartments.forEach((val, key) => compartments.set(key, val)); - conf = null; - } - compartments.set(effect.value.compartment, effect.value.extension); - } else if (effect.is(StateEffect2.reconfigure)) { - conf = null; - base2 = effect.value; - } else if (effect.is(StateEffect2.appendConfig)) { - conf = null; - base2 = asArray3(base2).concat(effect.value); - } - } - let startValues; - if (!conf) { - conf = Configuration2.resolve(base2, compartments, this); - let intermediateState = new EditorState2(conf, this.doc, this.selection, conf.dynamicSlots.map(() => null), (state, slot) => slot.reconfigure(state, this), null); - startValues = intermediateState.values; - } else { - startValues = tr.startState.values.slice(); - } - new EditorState2(conf, tr.newDoc, tr.newSelection, startValues, (state, slot) => slot.update(state, tr), tr); - } - replaceSelection(text) { - if (typeof text == "string") - text = this.toText(text); - return this.changeByRange((range) => ({ - changes: { from: range.from, to: range.to, insert: text }, - range: EditorSelection2.cursor(range.from + text.length) - })); - } - changeByRange(f) { - let sel = this.selection; - let result1 = f(sel.ranges[0]); - let changes = this.changes(result1.changes), ranges = [result1.range]; - let effects = asArray3(result1.effects); - for (let i = 1; i < sel.ranges.length; i++) { - let result = f(sel.ranges[i]); - let newChanges = this.changes(result.changes), newMapped = newChanges.map(changes); - for (let j = 0; j < i; j++) - ranges[j] = ranges[j].map(newMapped); - let mapBy = changes.mapDesc(newChanges, true); - ranges.push(result.range.map(mapBy)); - changes = changes.compose(newMapped); - effects = StateEffect2.mapEffects(effects, newMapped).concat(StateEffect2.mapEffects(asArray3(result.effects), mapBy)); - } - return { - changes, - selection: EditorSelection2.create(ranges, sel.mainIndex), - effects - }; - } - changes(spec = []) { - if (spec instanceof ChangeSet2) - return spec; - return ChangeSet2.of(spec, this.doc.length, this.facet(EditorState2.lineSeparator)); - } - toText(string3) { - return Text2.of(string3.split(this.facet(EditorState2.lineSeparator) || DefaultSplit2)); - } - sliceDoc(from2 = 0, to = this.doc.length) { - return this.doc.sliceString(from2, to, this.lineBreak); - } - facet(facet) { - let addr = this.config.address[facet.id]; - if (addr == null) - return facet.default; - ensureAddr2(this, addr); - return getAddr2(this, addr); - } - toJSON(fields) { - let result = { - doc: this.sliceDoc(), - selection: this.selection.toJSON() - }; - if (fields) - for (let prop in fields) { - let value = fields[prop]; - if (value instanceof StateField2) - result[prop] = value.spec.toJSON(this.field(fields[prop]), this); - } - return result; - } - static fromJSON(json2, config2 = {}, fields) { - if (!json2 || typeof json2.doc != "string") - throw new RangeError("Invalid JSON representation for EditorState"); - let fieldInit = []; - if (fields) - for (let prop in fields) { - let field = fields[prop], value = json2[prop]; - fieldInit.push(field.init((state) => field.spec.fromJSON(value, state))); - } - return EditorState2.create({ - doc: json2.doc, - selection: EditorSelection2.fromJSON(json2.selection), - extensions: config2.extensions ? fieldInit.concat([config2.extensions]) : fieldInit - }); - } - static create(config2 = {}) { - let configuration = Configuration2.resolve(config2.extensions || [], /* @__PURE__ */ new Map()); - let doc4 = config2.doc instanceof Text2 ? config2.doc : Text2.of((config2.doc || "").split(configuration.staticFacet(EditorState2.lineSeparator) || DefaultSplit2)); - let selection = !config2.selection ? EditorSelection2.single(0) : config2.selection instanceof EditorSelection2 ? config2.selection : EditorSelection2.single(config2.selection.anchor, config2.selection.head); - checkSelection2(selection, doc4.length); - if (!configuration.staticFacet(allowMultipleSelections2)) - selection = selection.asSingle(); - return new EditorState2(configuration, doc4, selection, configuration.dynamicSlots.map(() => null), (state, slot) => slot.create(state), null); - } - get tabSize() { - return this.facet(EditorState2.tabSize); - } - get lineBreak() { - return this.facet(EditorState2.lineSeparator) || "\n"; - } - get readOnly() { - return this.facet(readOnly2); - } - phrase(phrase2) { - for (let map of this.facet(EditorState2.phrases)) - if (Object.prototype.hasOwnProperty.call(map, phrase2)) - return map[phrase2]; - return phrase2; - } - languageDataAt(name3, pos, side = -1) { - let values2 = []; - for (let provider of this.facet(languageData2)) { - for (let result of provider(this, pos, side)) { - if (Object.prototype.hasOwnProperty.call(result, name3)) - values2.push(result[name3]); - } - } - return values2; - } - charCategorizer(at) { - return makeCategorizer2(this.languageDataAt("wordChars", at).join("")); - } - wordAt(pos) { - let { text, from: from2, length } = this.doc.lineAt(pos); - let cat = this.charCategorizer(pos); - let start = pos - from2, end = pos - from2; - while (start > 0) { - let prev = findClusterBreak2(text, start, false); - if (cat(text.slice(prev, start)) != CharCategory2.Word) - break; - start = prev; - } - while (end < length) { - let next = findClusterBreak2(text, end); - if (cat(text.slice(end, next)) != CharCategory2.Word) - break; - end = next; - } - return start == end ? null : EditorSelection2.range(start + from2, end + from2); - } - }; - EditorState2.allowMultipleSelections = allowMultipleSelections2; - EditorState2.tabSize = /* @__PURE__ */ Facet2.define({ - combine: (values2) => values2.length ? values2[0] : 4 - }); - EditorState2.lineSeparator = lineSeparator2; - EditorState2.readOnly = readOnly2; - EditorState2.phrases = /* @__PURE__ */ Facet2.define({ - compare(a, b) { - let kA = Object.keys(a), kB = Object.keys(b); - return kA.length == kB.length && kA.every((k) => a[k] == b[k]); - } - }); - EditorState2.languageData = languageData2; - EditorState2.changeFilter = changeFilter2; - EditorState2.transactionFilter = transactionFilter2; - EditorState2.transactionExtender = transactionExtender2; - Compartment2.reconfigure = /* @__PURE__ */ StateEffect2.define(); - var RangeValue2 = class { - eq(other) { - return this == other; - } - range(from2, to = from2) { - return new Range5(from2, to, this); - } - }; - RangeValue2.prototype.startSide = RangeValue2.prototype.endSide = 0; - RangeValue2.prototype.point = false; - RangeValue2.prototype.mapMode = MapMode2.TrackDel; - var Range5 = class { - constructor(from2, to, value) { - this.from = from2; - this.to = to; - this.value = value; - } - }; - function cmpRange2(a, b) { - return a.from - b.from || a.value.startSide - b.value.startSide; - } - var Chunk2 = class { - constructor(from2, to, value, maxPoint) { - this.from = from2; - this.to = to; - this.value = value; - this.maxPoint = maxPoint; - } - get length() { - return this.to[this.to.length - 1]; - } - findIndex(pos, side, end, startAt = 0) { - let arr = end ? this.to : this.from; - for (let lo = startAt, hi = arr.length; ; ) { - if (lo == hi) - return lo; - let mid = lo + hi >> 1; - let diff = arr[mid] - pos || (end ? this.value[mid].endSide : this.value[mid].startSide) - side; - if (mid == lo) - return diff >= 0 ? lo : hi; - if (diff >= 0) - hi = mid; - else - lo = mid + 1; - } - } - between(offset, from2, to, f) { - for (let i = this.findIndex(from2, -1e9, true), e = this.findIndex(to, 1e9, false, i); i < e; i++) - if (f(this.from[i] + offset, this.to[i] + offset, this.value[i]) === false) - return false; - } - map(offset, changes) { - let value = [], from2 = [], to = [], newPos = -1, maxPoint = -1; - for (let i = 0; i < this.value.length; i++) { - let val = this.value[i], curFrom = this.from[i] + offset, curTo = this.to[i] + offset, newFrom, newTo; - if (curFrom == curTo) { - let mapped = changes.mapPos(curFrom, val.startSide, val.mapMode); - if (mapped == null) - continue; - newFrom = newTo = mapped; - if (val.startSide != val.endSide) { - newTo = changes.mapPos(curFrom, val.endSide); - if (newTo < newFrom) - continue; - } - } else { - newFrom = changes.mapPos(curFrom, val.startSide); - newTo = changes.mapPos(curTo, val.endSide); - if (newFrom > newTo || newFrom == newTo && val.startSide > 0 && val.endSide <= 0) - continue; - } - if ((newTo - newFrom || val.endSide - val.startSide) < 0) - continue; - if (newPos < 0) - newPos = newFrom; - if (val.point) - maxPoint = Math.max(maxPoint, newTo - newFrom); - value.push(val); - from2.push(newFrom - newPos); - to.push(newTo - newPos); - } - return { mapped: value.length ? new Chunk2(from2, to, value, maxPoint) : null, pos: newPos }; - } - }; - var RangeSet2 = class { - constructor(chunkPos, chunk, nextLayer = RangeSet2.empty, maxPoint) { - this.chunkPos = chunkPos; - this.chunk = chunk; - this.nextLayer = nextLayer; - this.maxPoint = maxPoint; - } - get length() { - let last = this.chunk.length - 1; - return last < 0 ? 0 : Math.max(this.chunkEnd(last), this.nextLayer.length); - } - get size() { - if (this.isEmpty) - return 0; - let size = this.nextLayer.size; - for (let chunk of this.chunk) - size += chunk.value.length; - return size; - } - chunkEnd(index) { - return this.chunkPos[index] + this.chunk[index].length; - } - update(updateSpec) { - let { add: add2 = [], sort = false, filterFrom = 0, filterTo = this.length } = updateSpec; - let filter = updateSpec.filter; - if (add2.length == 0 && !filter) - return this; - if (sort) - add2 = add2.slice().sort(cmpRange2); - if (this.isEmpty) - return add2.length ? RangeSet2.of(add2) : this; - let cur2 = new LayerCursor2(this, null, -1).goto(0), i = 0, spill = []; - let builder = new RangeSetBuilder2(); - while (cur2.value || i < add2.length) { - if (i < add2.length && (cur2.from - add2[i].from || cur2.startSide - add2[i].value.startSide) >= 0) { - let range = add2[i++]; - if (!builder.addInner(range.from, range.to, range.value)) - spill.push(range); - } else if (cur2.rangeIndex == 1 && cur2.chunkIndex < this.chunk.length && (i == add2.length || this.chunkEnd(cur2.chunkIndex) < add2[i].from) && (!filter || filterFrom > this.chunkEnd(cur2.chunkIndex) || filterTo < this.chunkPos[cur2.chunkIndex]) && builder.addChunk(this.chunkPos[cur2.chunkIndex], this.chunk[cur2.chunkIndex])) { - cur2.nextChunk(); - } else { - if (!filter || filterFrom > cur2.to || filterTo < cur2.from || filter(cur2.from, cur2.to, cur2.value)) { - if (!builder.addInner(cur2.from, cur2.to, cur2.value)) - spill.push(new Range5(cur2.from, cur2.to, cur2.value)); - } - cur2.next(); - } - } - return builder.finishInner(this.nextLayer.isEmpty && !spill.length ? RangeSet2.empty : this.nextLayer.update({ add: spill, filter, filterFrom, filterTo })); - } - map(changes) { - if (changes.empty || this.isEmpty) - return this; - let chunks = [], chunkPos = [], maxPoint = -1; - for (let i = 0; i < this.chunk.length; i++) { - let start = this.chunkPos[i], chunk = this.chunk[i]; - let touch = changes.touchesRange(start, start + chunk.length); - if (touch === false) { - maxPoint = Math.max(maxPoint, chunk.maxPoint); - chunks.push(chunk); - chunkPos.push(changes.mapPos(start)); - } else if (touch === true) { - let { mapped, pos } = chunk.map(start, changes); - if (mapped) { - maxPoint = Math.max(maxPoint, mapped.maxPoint); - chunks.push(mapped); - chunkPos.push(pos); - } - } - } - let next = this.nextLayer.map(changes); - return chunks.length == 0 ? next : new RangeSet2(chunkPos, chunks, next, maxPoint); - } - between(from2, to, f) { - if (this.isEmpty) - return; - for (let i = 0; i < this.chunk.length; i++) { - let start = this.chunkPos[i], chunk = this.chunk[i]; - if (to >= start && from2 <= start + chunk.length && chunk.between(start, from2 - start, to - start, f) === false) - return; - } - this.nextLayer.between(from2, to, f); - } - iter(from2 = 0) { - return HeapCursor2.from([this]).goto(from2); - } - get isEmpty() { - return this.nextLayer == this; - } - static iter(sets, from2 = 0) { - return HeapCursor2.from(sets).goto(from2); - } - static compare(oldSets, newSets, textDiff, comparator, minPointSize = -1) { - let a = oldSets.filter((set) => set.maxPoint > 0 || !set.isEmpty && set.maxPoint >= minPointSize); - let b = newSets.filter((set) => set.maxPoint > 0 || !set.isEmpty && set.maxPoint >= minPointSize); - let sharedChunks = findSharedChunks2(a, b, textDiff); - let sideA = new SpanCursor2(a, sharedChunks, minPointSize); - let sideB = new SpanCursor2(b, sharedChunks, minPointSize); - textDiff.iterGaps((fromA, fromB, length) => compare2(sideA, fromA, sideB, fromB, length, comparator)); - if (textDiff.empty && textDiff.length == 0) - compare2(sideA, 0, sideB, 0, 0, comparator); - } - static eq(oldSets, newSets, from2 = 0, to) { - if (to == null) - to = 1e9; - let a = oldSets.filter((set) => !set.isEmpty && newSets.indexOf(set) < 0); - let b = newSets.filter((set) => !set.isEmpty && oldSets.indexOf(set) < 0); - if (a.length != b.length) - return false; - if (!a.length) - return true; - let sharedChunks = findSharedChunks2(a, b); - let sideA = new SpanCursor2(a, sharedChunks, 0).goto(from2), sideB = new SpanCursor2(b, sharedChunks, 0).goto(from2); - for (; ; ) { - if (sideA.to != sideB.to || !sameValues2(sideA.active, sideB.active) || sideA.point && (!sideB.point || !sideA.point.eq(sideB.point))) - return false; - if (sideA.to > to) - return true; - sideA.next(); - sideB.next(); - } - } - static spans(sets, from2, to, iterator, minPointSize = -1) { - let cursor = new SpanCursor2(sets, null, minPointSize).goto(from2), pos = from2; - let open = cursor.openStart; - for (; ; ) { - let curTo = Math.min(cursor.to, to); - if (cursor.point) { - iterator.point(pos, curTo, cursor.point, cursor.activeForPoint(cursor.to), open, cursor.pointRank); - open = cursor.openEnd(curTo) + (cursor.to > curTo ? 1 : 0); - } else if (curTo > pos) { - iterator.span(pos, curTo, cursor.active, open); - open = cursor.openEnd(curTo); - } - if (cursor.to > to) - break; - pos = cursor.to; - cursor.next(); - } - return open; - } - static of(ranges, sort = false) { - let build = new RangeSetBuilder2(); - for (let range of ranges instanceof Range5 ? [ranges] : sort ? lazySort2(ranges) : ranges) - build.add(range.from, range.to, range.value); - return build.finish(); - } - }; - RangeSet2.empty = /* @__PURE__ */ new RangeSet2([], [], null, -1); - function lazySort2(ranges) { - if (ranges.length > 1) - for (let prev = ranges[0], i = 1; i < ranges.length; i++) { - let cur2 = ranges[i]; - if (cmpRange2(prev, cur2) > 0) - return ranges.slice().sort(cmpRange2); - prev = cur2; - } - return ranges; - } - RangeSet2.empty.nextLayer = RangeSet2.empty; - var RangeSetBuilder2 = class { - constructor() { - this.chunks = []; - this.chunkPos = []; - this.chunkStart = -1; - this.last = null; - this.lastFrom = -1e9; - this.lastTo = -1e9; - this.from = []; - this.to = []; - this.value = []; - this.maxPoint = -1; - this.setMaxPoint = -1; - this.nextLayer = null; - } - finishChunk(newArrays) { - this.chunks.push(new Chunk2(this.from, this.to, this.value, this.maxPoint)); - this.chunkPos.push(this.chunkStart); - this.chunkStart = -1; - this.setMaxPoint = Math.max(this.setMaxPoint, this.maxPoint); - this.maxPoint = -1; - if (newArrays) { - this.from = []; - this.to = []; - this.value = []; - } - } - add(from2, to, value) { - if (!this.addInner(from2, to, value)) - (this.nextLayer || (this.nextLayer = new RangeSetBuilder2())).add(from2, to, value); - } - addInner(from2, to, value) { - let diff = from2 - this.lastTo || value.startSide - this.last.endSide; - if (diff <= 0 && (from2 - this.lastFrom || value.startSide - this.last.startSide) < 0) - throw new Error("Ranges must be added sorted by `from` position and `startSide`"); - if (diff < 0) - return false; - if (this.from.length == 250) - this.finishChunk(true); - if (this.chunkStart < 0) - this.chunkStart = from2; - this.from.push(from2 - this.chunkStart); - this.to.push(to - this.chunkStart); - this.last = value; - this.lastFrom = from2; - this.lastTo = to; - this.value.push(value); - if (value.point) - this.maxPoint = Math.max(this.maxPoint, to - from2); - return true; - } - addChunk(from2, chunk) { - if ((from2 - this.lastTo || chunk.value[0].startSide - this.last.endSide) < 0) - return false; - if (this.from.length) - this.finishChunk(true); - this.setMaxPoint = Math.max(this.setMaxPoint, chunk.maxPoint); - this.chunks.push(chunk); - this.chunkPos.push(from2); - let last = chunk.value.length - 1; - this.last = chunk.value[last]; - this.lastFrom = chunk.from[last] + from2; - this.lastTo = chunk.to[last] + from2; - return true; - } - finish() { - return this.finishInner(RangeSet2.empty); - } - finishInner(next) { - if (this.from.length) - this.finishChunk(false); - if (this.chunks.length == 0) - return next; - let result = new RangeSet2(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(next) : next, this.setMaxPoint); - this.from = null; - return result; - } - }; - function findSharedChunks2(a, b, textDiff) { - let inA = /* @__PURE__ */ new Map(); - for (let set of a) - for (let i = 0; i < set.chunk.length; i++) - if (set.chunk[i].maxPoint <= 0) - inA.set(set.chunk[i], set.chunkPos[i]); - let shared = /* @__PURE__ */ new Set(); - for (let set of b) - for (let i = 0; i < set.chunk.length; i++) { - let known = inA.get(set.chunk[i]); - if (known != null && (textDiff ? textDiff.mapPos(known) : known) == set.chunkPos[i] && !(textDiff === null || textDiff === void 0 ? void 0 : textDiff.touchesRange(known, known + set.chunk[i].length))) - shared.add(set.chunk[i]); - } - return shared; - } - var LayerCursor2 = class { - constructor(layer, skip, minPoint, rank = 0) { - this.layer = layer; - this.skip = skip; - this.minPoint = minPoint; - this.rank = rank; - } - get startSide() { - return this.value ? this.value.startSide : 0; - } - get endSide() { - return this.value ? this.value.endSide : 0; - } - goto(pos, side = -1e9) { - this.chunkIndex = this.rangeIndex = 0; - this.gotoInner(pos, side, false); - return this; - } - gotoInner(pos, side, forward) { - while (this.chunkIndex < this.layer.chunk.length) { - let next = this.layer.chunk[this.chunkIndex]; - if (!(this.skip && this.skip.has(next) || this.layer.chunkEnd(this.chunkIndex) < pos || next.maxPoint < this.minPoint)) - break; - this.chunkIndex++; - forward = false; - } - if (this.chunkIndex < this.layer.chunk.length) { - let rangeIndex = this.layer.chunk[this.chunkIndex].findIndex(pos - this.layer.chunkPos[this.chunkIndex], side, true); - if (!forward || this.rangeIndex < rangeIndex) - this.setRangeIndex(rangeIndex); - } - this.next(); - } - forward(pos, side) { - if ((this.to - pos || this.endSide - side) < 0) - this.gotoInner(pos, side, true); - } - next() { - for (; ; ) { - if (this.chunkIndex == this.layer.chunk.length) { - this.from = this.to = 1e9; - this.value = null; - break; - } else { - let chunkPos = this.layer.chunkPos[this.chunkIndex], chunk = this.layer.chunk[this.chunkIndex]; - let from2 = chunkPos + chunk.from[this.rangeIndex]; - this.from = from2; - this.to = chunkPos + chunk.to[this.rangeIndex]; - this.value = chunk.value[this.rangeIndex]; - this.setRangeIndex(this.rangeIndex + 1); - if (this.minPoint < 0 || this.value.point && this.to - this.from >= this.minPoint) - break; - } - } - } - setRangeIndex(index) { - if (index == this.layer.chunk[this.chunkIndex].value.length) { - this.chunkIndex++; - if (this.skip) { - while (this.chunkIndex < this.layer.chunk.length && this.skip.has(this.layer.chunk[this.chunkIndex])) - this.chunkIndex++; - } - this.rangeIndex = 0; - } else { - this.rangeIndex = index; - } - } - nextChunk() { - this.chunkIndex++; - this.rangeIndex = 0; - this.next(); - } - compare(other) { - return this.from - other.from || this.startSide - other.startSide || this.rank - other.rank || this.to - other.to || this.endSide - other.endSide; - } - }; - var HeapCursor2 = class { - constructor(heap) { - this.heap = heap; - } - static from(sets, skip = null, minPoint = -1) { - let heap = []; - for (let i = 0; i < sets.length; i++) { - for (let cur2 = sets[i]; !cur2.isEmpty; cur2 = cur2.nextLayer) { - if (cur2.maxPoint >= minPoint) - heap.push(new LayerCursor2(cur2, skip, minPoint, i)); - } - } - return heap.length == 1 ? heap[0] : new HeapCursor2(heap); - } - get startSide() { - return this.value ? this.value.startSide : 0; - } - goto(pos, side = -1e9) { - for (let cur2 of this.heap) - cur2.goto(pos, side); - for (let i = this.heap.length >> 1; i >= 0; i--) - heapBubble2(this.heap, i); - this.next(); - return this; - } - forward(pos, side) { - for (let cur2 of this.heap) - cur2.forward(pos, side); - for (let i = this.heap.length >> 1; i >= 0; i--) - heapBubble2(this.heap, i); - if ((this.to - pos || this.value.endSide - side) < 0) - this.next(); - } - next() { - if (this.heap.length == 0) { - this.from = this.to = 1e9; - this.value = null; - this.rank = -1; - } else { - let top2 = this.heap[0]; - this.from = top2.from; - this.to = top2.to; - this.value = top2.value; - this.rank = top2.rank; - if (top2.value) - top2.next(); - heapBubble2(this.heap, 0); - } - } - }; - function heapBubble2(heap, index) { - for (let cur2 = heap[index]; ; ) { - let childIndex = (index << 1) + 1; - if (childIndex >= heap.length) - break; - let child = heap[childIndex]; - if (childIndex + 1 < heap.length && child.compare(heap[childIndex + 1]) >= 0) { - child = heap[childIndex + 1]; - childIndex++; - } - if (cur2.compare(child) < 0) - break; - heap[childIndex] = cur2; - heap[index] = child; - index = childIndex; - } - } - var SpanCursor2 = class { - constructor(sets, skip, minPoint) { - this.minPoint = minPoint; - this.active = []; - this.activeTo = []; - this.activeRank = []; - this.minActive = -1; - this.point = null; - this.pointFrom = 0; - this.pointRank = 0; - this.to = -1e9; - this.endSide = 0; - this.openStart = -1; - this.cursor = HeapCursor2.from(sets, skip, minPoint); - } - goto(pos, side = -1e9) { - this.cursor.goto(pos, side); - this.active.length = this.activeTo.length = this.activeRank.length = 0; - this.minActive = -1; - this.to = pos; - this.endSide = side; - this.openStart = -1; - this.next(); - return this; - } - forward(pos, side) { - while (this.minActive > -1 && (this.activeTo[this.minActive] - pos || this.active[this.minActive].endSide - side) < 0) - this.removeActive(this.minActive); - this.cursor.forward(pos, side); - } - removeActive(index) { - remove2(this.active, index); - remove2(this.activeTo, index); - remove2(this.activeRank, index); - this.minActive = findMinIndex2(this.active, this.activeTo); - } - addActive(trackOpen) { - let i = 0, { value, to, rank } = this.cursor; - while (i < this.activeRank.length && this.activeRank[i] <= rank) - i++; - insert2(this.active, i, value); - insert2(this.activeTo, i, to); - insert2(this.activeRank, i, rank); - if (trackOpen) - insert2(trackOpen, i, this.cursor.from); - this.minActive = findMinIndex2(this.active, this.activeTo); - } - next() { - let from2 = this.to, wasPoint = this.point; - this.point = null; - let trackOpen = this.openStart < 0 ? [] : null, trackExtra = 0; - for (; ; ) { - let a = this.minActive; - if (a > -1 && (this.activeTo[a] - this.cursor.from || this.active[a].endSide - this.cursor.startSide) < 0) { - if (this.activeTo[a] > from2) { - this.to = this.activeTo[a]; - this.endSide = this.active[a].endSide; - break; - } - this.removeActive(a); - if (trackOpen) - remove2(trackOpen, a); - } else if (!this.cursor.value) { - this.to = this.endSide = 1e9; - break; - } else if (this.cursor.from > from2) { - this.to = this.cursor.from; - this.endSide = this.cursor.startSide; - break; - } else { - let nextVal = this.cursor.value; - if (!nextVal.point) { - this.addActive(trackOpen); - this.cursor.next(); - } else if (wasPoint && this.cursor.to == this.to && this.cursor.from < this.cursor.to) { - this.cursor.next(); - } else { - this.point = nextVal; - this.pointFrom = this.cursor.from; - this.pointRank = this.cursor.rank; - this.to = this.cursor.to; - this.endSide = nextVal.endSide; - if (this.cursor.from < from2) - trackExtra = 1; - this.cursor.next(); - this.forward(this.to, this.endSide); - break; - } - } - } - if (trackOpen) { - let openStart = 0; - while (openStart < trackOpen.length && trackOpen[openStart] < from2) - openStart++; - this.openStart = openStart + trackExtra; - } - } - activeForPoint(to) { - if (!this.active.length) - return this.active; - let active = []; - for (let i = this.active.length - 1; i >= 0; i--) { - if (this.activeRank[i] < this.pointRank) - break; - if (this.activeTo[i] > to || this.activeTo[i] == to && this.active[i].endSide >= this.point.endSide) - active.push(this.active[i]); - } - return active.reverse(); - } - openEnd(to) { - let open = 0; - for (let i = this.activeTo.length - 1; i >= 0 && this.activeTo[i] > to; i--) - open++; - return open; - } - }; - function compare2(a, startA, b, startB, length, comparator) { - a.goto(startA); - b.goto(startB); - let endB = startB + length; - let pos = startB, dPos = startB - startA; - for (; ; ) { - let diff = a.to + dPos - b.to || a.endSide - b.endSide; - let end = diff < 0 ? a.to + dPos : b.to, clipEnd = Math.min(end, endB); - if (a.point || b.point) { - if (!(a.point && b.point && (a.point == b.point || a.point.eq(b.point)) && sameValues2(a.activeForPoint(a.to + dPos), b.activeForPoint(b.to)))) - comparator.comparePoint(pos, clipEnd, a.point, b.point); - } else { - if (clipEnd > pos && !sameValues2(a.active, b.active)) - comparator.compareRange(pos, clipEnd, a.active, b.active); - } - if (end > endB) - break; - pos = end; - if (diff <= 0) - a.next(); - if (diff >= 0) - b.next(); - } - } - function sameValues2(a, b) { - if (a.length != b.length) - return false; - for (let i = 0; i < a.length; i++) - if (a[i] != b[i] && !a[i].eq(b[i])) - return false; - return true; - } - function remove2(array2, index) { - for (let i = index, e = array2.length - 1; i < e; i++) - array2[i] = array2[i + 1]; - array2.pop(); - } - function insert2(array2, index, value) { - for (let i = array2.length - 1; i >= index; i--) - array2[i + 1] = array2[i]; - array2[index] = value; - } - function findMinIndex2(value, array2) { - let found = -1, foundPos = 1e9; - for (let i = 0; i < array2.length; i++) - if ((array2[i] - foundPos || value[i].endSide - value[found].endSide) < 0) { - found = i; - foundPos = array2[i]; - } - return found; - } - function findColumn2(string3, col, tabSize, strict) { - for (let i = 0, n = 0; ; ) { - if (n >= col) - return i; - if (i == string3.length) - break; - n += string3.charCodeAt(i) == 9 ? tabSize - n % tabSize : 1; - i = findClusterBreak2(string3, i); - } - return strict === true ? -1 : string3.length; - } - - // node_modules/@codemirror/lang-javascript/node_modules/@codemirror/view/dist/index.js - function getSelection2(root) { - let target; - if (root.nodeType == 11) { - target = root.getSelection ? root : root.ownerDocument; - } else { - target = root; - } - return target.getSelection(); - } - function contains2(dom, node) { - return node ? dom == node || dom.contains(node.nodeType != 1 ? node.parentNode : node) : false; - } - function deepActiveElement2() { - let elt = document.activeElement; - while (elt && elt.shadowRoot) - elt = elt.shadowRoot.activeElement; - return elt; - } - function hasSelection2(dom, selection) { - if (!selection.anchorNode) - return false; - try { - return contains2(dom, selection.anchorNode); - } catch (_) { - return false; - } - } - function clientRectsFor2(dom) { - if (dom.nodeType == 3) - return textRange2(dom, 0, dom.nodeValue.length).getClientRects(); - else if (dom.nodeType == 1) - return dom.getClientRects(); - else - return []; - } - function isEquivalentPosition2(node, off, targetNode, targetOff) { - return targetNode ? scanFor2(node, off, targetNode, targetOff, -1) || scanFor2(node, off, targetNode, targetOff, 1) : false; - } - function domIndex2(node) { - for (var index = 0; ; index++) { - node = node.previousSibling; - if (!node) - return index; - } - } - function scanFor2(node, off, targetNode, targetOff, dir) { - for (; ; ) { - if (node == targetNode && off == targetOff) - return true; - if (off == (dir < 0 ? 0 : maxOffset2(node))) { - if (node.nodeName == "DIV") - return false; - let parent = node.parentNode; - if (!parent || parent.nodeType != 1) - return false; - off = domIndex2(node) + (dir < 0 ? 0 : 1); - node = parent; - } else if (node.nodeType == 1) { - node = node.childNodes[off + (dir < 0 ? -1 : 0)]; - if (node.nodeType == 1 && node.contentEditable == "false") - return false; - off = dir < 0 ? maxOffset2(node) : 0; - } else { - return false; - } - } - } - function maxOffset2(node) { - return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length; - } - var Rect02 = { left: 0, right: 0, top: 0, bottom: 0 }; - function flattenRect2(rect, left) { - let x = left ? rect.left : rect.right; - return { left: x, right: x, top: rect.top, bottom: rect.bottom }; - } - function windowRect2(win) { - return { - left: 0, - right: win.innerWidth, - top: 0, - bottom: win.innerHeight - }; - } - function scrollRectIntoView2(dom, rect, side, x, y, xMargin, yMargin, ltr) { - let doc4 = dom.ownerDocument, win = doc4.defaultView; - for (let cur2 = dom; cur2; ) { - if (cur2.nodeType == 1) { - let bounding, top2 = cur2 == doc4.body; - if (top2) { - bounding = windowRect2(win); - } else { - if (cur2.scrollHeight <= cur2.clientHeight && cur2.scrollWidth <= cur2.clientWidth) { - cur2 = cur2.parentNode; - continue; - } - let rect2 = cur2.getBoundingClientRect(); - bounding = { - left: rect2.left, - right: rect2.left + cur2.clientWidth, - top: rect2.top, - bottom: rect2.top + cur2.clientHeight - }; - } - let moveX = 0, moveY = 0; - if (y == "nearest") { - if (rect.top < bounding.top) { - moveY = -(bounding.top - rect.top + yMargin); - if (side > 0 && rect.bottom > bounding.bottom + moveY) - moveY = rect.bottom - bounding.bottom + moveY + yMargin; - } else if (rect.bottom > bounding.bottom) { - moveY = rect.bottom - bounding.bottom + yMargin; - if (side < 0 && rect.top - moveY < bounding.top) - moveY = -(bounding.top + moveY - rect.top + yMargin); - } - } else { - let rectHeight = rect.bottom - rect.top, boundingHeight = bounding.bottom - bounding.top; - let targetTop = y == "center" && rectHeight <= boundingHeight ? rect.top + rectHeight / 2 - boundingHeight / 2 : y == "start" || y == "center" && side < 0 ? rect.top - yMargin : rect.bottom - boundingHeight + yMargin; - moveY = targetTop - bounding.top; - } - if (x == "nearest") { - if (rect.left < bounding.left) { - moveX = -(bounding.left - rect.left + xMargin); - if (side > 0 && rect.right > bounding.right + moveX) - moveX = rect.right - bounding.right + moveX + xMargin; - } else if (rect.right > bounding.right) { - moveX = rect.right - bounding.right + xMargin; - if (side < 0 && rect.left < bounding.left + moveX) - moveX = -(bounding.left + moveX - rect.left + xMargin); - } - } else { - let targetLeft = x == "center" ? rect.left + (rect.right - rect.left) / 2 - (bounding.right - bounding.left) / 2 : x == "start" == ltr ? rect.left - xMargin : rect.right - (bounding.right - bounding.left) + xMargin; - moveX = targetLeft - bounding.left; - } - if (moveX || moveY) { - if (top2) { - win.scrollBy(moveX, moveY); - } else { - if (moveY) { - let start = cur2.scrollTop; - cur2.scrollTop += moveY; - moveY = cur2.scrollTop - start; - } - if (moveX) { - let start = cur2.scrollLeft; - cur2.scrollLeft += moveX; - moveX = cur2.scrollLeft - start; - } - rect = { - left: rect.left - moveX, - top: rect.top - moveY, - right: rect.right - moveX, - bottom: rect.bottom - moveY - }; - } - } - if (top2) - break; - cur2 = cur2.assignedSlot || cur2.parentNode; - x = y = "nearest"; - } else if (cur2.nodeType == 11) { - cur2 = cur2.host; - } else { - break; - } - } - } - var DOMSelectionState2 = class { - constructor() { - this.anchorNode = null; - this.anchorOffset = 0; - this.focusNode = null; - this.focusOffset = 0; - } - eq(domSel) { - return this.anchorNode == domSel.anchorNode && this.anchorOffset == domSel.anchorOffset && this.focusNode == domSel.focusNode && this.focusOffset == domSel.focusOffset; - } - setRange(range) { - this.set(range.anchorNode, range.anchorOffset, range.focusNode, range.focusOffset); - } - set(anchorNode, anchorOffset, focusNode, focusOffset) { - this.anchorNode = anchorNode; - this.anchorOffset = anchorOffset; - this.focusNode = focusNode; - this.focusOffset = focusOffset; - } - }; - var preventScrollSupported2 = null; - function focusPreventScroll2(dom) { - if (dom.setActive) - return dom.setActive(); - if (preventScrollSupported2) - return dom.focus(preventScrollSupported2); - let stack = []; - for (let cur2 = dom; cur2; cur2 = cur2.parentNode) { - stack.push(cur2, cur2.scrollTop, cur2.scrollLeft); - if (cur2 == cur2.ownerDocument) - break; - } - dom.focus(preventScrollSupported2 == null ? { - get preventScroll() { - preventScrollSupported2 = { preventScroll: true }; - return true; - } - } : void 0); - if (!preventScrollSupported2) { - preventScrollSupported2 = false; - for (let i = 0; i < stack.length; ) { - let elt = stack[i++], top2 = stack[i++], left = stack[i++]; - if (elt.scrollTop != top2) - elt.scrollTop = top2; - if (elt.scrollLeft != left) - elt.scrollLeft = left; - } - } - } - var scratchRange2; - function textRange2(node, from2, to = from2) { - let range = scratchRange2 || (scratchRange2 = document.createRange()); - range.setEnd(node, to); - range.setStart(node, from2); - return range; - } - function dispatchKey2(elt, name3, code) { - let options = { key: name3, code: name3, keyCode: code, which: code, cancelable: true }; - let down = new KeyboardEvent("keydown", options); - down.synthetic = true; - elt.dispatchEvent(down); - let up = new KeyboardEvent("keyup", options); - up.synthetic = true; - elt.dispatchEvent(up); - return down.defaultPrevented || up.defaultPrevented; - } - function getRoot2(node) { - while (node) { - if (node && (node.nodeType == 9 || node.nodeType == 11 && node.host)) - return node; - node = node.assignedSlot || node.parentNode; - } - return null; - } - function clearAttributes2(node) { - while (node.attributes.length) - node.removeAttributeNode(node.attributes[0]); - } - var DOMPos2 = class { - constructor(node, offset, precise = true) { - this.node = node; - this.offset = offset; - this.precise = precise; - } - static before(dom, precise) { - return new DOMPos2(dom.parentNode, domIndex2(dom), precise); - } - static after(dom, precise) { - return new DOMPos2(dom.parentNode, domIndex2(dom) + 1, precise); - } - }; - var noChildren2 = []; - var ContentView2 = class { - constructor() { - this.parent = null; - this.dom = null; - this.dirty = 2; - } - get editorView() { - if (!this.parent) - throw new Error("Accessing view in orphan content view"); - return this.parent.editorView; - } - get overrideDOMText() { - return null; - } - get posAtStart() { - return this.parent ? this.parent.posBefore(this) : 0; - } - get posAtEnd() { - return this.posAtStart + this.length; - } - posBefore(view) { - let pos = this.posAtStart; - for (let child of this.children) { - if (child == view) - return pos; - pos += child.length + child.breakAfter; - } - throw new RangeError("Invalid child in posBefore"); - } - posAfter(view) { - return this.posBefore(view) + view.length; - } - coordsAt(_pos, _side) { - return null; - } - sync(track) { - if (this.dirty & 2) { - let parent = this.dom; - let prev = null, next; - for (let child of this.children) { - if (child.dirty) { - if (!child.dom && (next = prev ? prev.nextSibling : parent.firstChild)) { - let contentView = ContentView2.get(next); - if (!contentView || !contentView.parent && contentView.constructor == child.constructor) - child.reuseDOM(next); - } - child.sync(track); - child.dirty = 0; - } - next = prev ? prev.nextSibling : parent.firstChild; - if (track && !track.written && track.node == parent && next != child.dom) - track.written = true; - if (child.dom.parentNode == parent) { - while (next && next != child.dom) - next = rm$1(next); - } else { - parent.insertBefore(child.dom, next); - } - prev = child.dom; - } - next = prev ? prev.nextSibling : parent.firstChild; - if (next && track && track.node == parent) - track.written = true; - while (next) - next = rm$1(next); - } else if (this.dirty & 1) { - for (let child of this.children) - if (child.dirty) { - child.sync(track); - child.dirty = 0; - } - } - } - reuseDOM(_dom) { - } - localPosFromDOM(node, offset) { - let after; - if (node == this.dom) { - after = this.dom.childNodes[offset]; - } else { - let bias = maxOffset2(node) == 0 ? 0 : offset == 0 ? -1 : 1; - for (; ; ) { - let parent = node.parentNode; - if (parent == this.dom) - break; - if (bias == 0 && parent.firstChild != parent.lastChild) { - if (node == parent.firstChild) - bias = -1; - else - bias = 1; - } - node = parent; - } - if (bias < 0) - after = node; - else - after = node.nextSibling; - } - if (after == this.dom.firstChild) - return 0; - while (after && !ContentView2.get(after)) - after = after.nextSibling; - if (!after) - return this.length; - for (let i = 0, pos = 0; ; i++) { - let child = this.children[i]; - if (child.dom == after) - return pos; - pos += child.length + child.breakAfter; - } - } - domBoundsAround(from2, to, offset = 0) { - let fromI = -1, fromStart = -1, toI = -1, toEnd = -1; - for (let i = 0, pos = offset, prevEnd = offset; i < this.children.length; i++) { - let child = this.children[i], end = pos + child.length; - if (pos < from2 && end > to) - return child.domBoundsAround(from2, to, pos); - if (end >= from2 && fromI == -1) { - fromI = i; - fromStart = pos; - } - if (pos > to && child.dom.parentNode == this.dom) { - toI = i; - toEnd = prevEnd; - break; - } - prevEnd = end; - pos = end + child.breakAfter; - } - return { - from: fromStart, - to: toEnd < 0 ? offset + this.length : toEnd, - startDOM: (fromI ? this.children[fromI - 1].dom.nextSibling : null) || this.dom.firstChild, - endDOM: toI < this.children.length && toI >= 0 ? this.children[toI].dom : null - }; - } - markDirty(andParent = false) { - this.dirty |= 2; - this.markParentsDirty(andParent); - } - markParentsDirty(childList) { - for (let parent = this.parent; parent; parent = parent.parent) { - if (childList) - parent.dirty |= 2; - if (parent.dirty & 1) - return; - parent.dirty |= 1; - childList = false; - } - } - setParent(parent) { - if (this.parent != parent) { - this.parent = parent; - if (this.dirty) - this.markParentsDirty(true); - } - } - setDOM(dom) { - if (this.dom) - this.dom.cmView = null; - this.dom = dom; - dom.cmView = this; - } - get rootView() { - for (let v = this; ; ) { - let parent = v.parent; - if (!parent) - return v; - v = parent; - } - } - replaceChildren(from2, to, children = noChildren2) { - this.markDirty(); - for (let i = from2; i < to; i++) { - let child = this.children[i]; - if (child.parent == this) - child.destroy(); - } - this.children.splice(from2, to - from2, ...children); - for (let i = 0; i < children.length; i++) - children[i].setParent(this); - } - ignoreMutation(_rec) { - return false; - } - ignoreEvent(_event) { - return false; - } - childCursor(pos = this.length) { - return new ChildCursor2(this.children, pos, this.children.length); - } - childPos(pos, bias = 1) { - return this.childCursor().findPos(pos, bias); - } - toString() { - let name3 = this.constructor.name.replace("View", ""); - return name3 + (this.children.length ? "(" + this.children.join() + ")" : this.length ? "[" + (name3 == "Text" ? this.text : this.length) + "]" : "") + (this.breakAfter ? "#" : ""); - } - static get(node) { - return node.cmView; - } - get isEditable() { - return true; - } - merge(from2, to, source, hasStart, openStart, openEnd) { - return false; - } - become(other) { - return false; - } - getSide() { - return 0; - } - destroy() { - this.parent = null; - } - }; - ContentView2.prototype.breakAfter = 0; - function rm$1(dom) { - let next = dom.nextSibling; - dom.parentNode.removeChild(dom); - return next; - } - var ChildCursor2 = class { - constructor(children, pos, i) { - this.children = children; - this.pos = pos; - this.i = i; - this.off = 0; - } - findPos(pos, bias = 1) { - for (; ; ) { - if (pos > this.pos || pos == this.pos && (bias > 0 || this.i == 0 || this.children[this.i - 1].breakAfter)) { - this.off = pos - this.pos; - return this; - } - let next = this.children[--this.i]; - this.pos -= next.length + next.breakAfter; - } - } - }; - function replaceRange2(parent, fromI, fromOff, toI, toOff, insert4, breakAtStart, openStart, openEnd) { - let { children } = parent; - let before = children.length ? children[fromI] : null; - let last = insert4.length ? insert4[insert4.length - 1] : null; - let breakAtEnd = last ? last.breakAfter : breakAtStart; - if (fromI == toI && before && !breakAtStart && !breakAtEnd && insert4.length < 2 && before.merge(fromOff, toOff, insert4.length ? last : null, fromOff == 0, openStart, openEnd)) - return; - if (toI < children.length) { - let after = children[toI]; - if (after && toOff < after.length) { - if (fromI == toI) { - after = after.split(toOff); - toOff = 0; - } - if (!breakAtEnd && last && after.merge(0, toOff, last, true, 0, openEnd)) { - insert4[insert4.length - 1] = after; - } else { - if (toOff) - after.merge(0, toOff, null, false, 0, openEnd); - insert4.push(after); - } - } else if (after === null || after === void 0 ? void 0 : after.breakAfter) { - if (last) - last.breakAfter = 1; - else - breakAtStart = 1; - } - toI++; - } - if (before) { - before.breakAfter = breakAtStart; - if (fromOff > 0) { - if (!breakAtStart && insert4.length && before.merge(fromOff, before.length, insert4[0], false, openStart, 0)) { - before.breakAfter = insert4.shift().breakAfter; - } else if (fromOff < before.length || before.children.length && before.children[before.children.length - 1].length == 0) { - before.merge(fromOff, before.length, null, false, openStart, 0); - } - fromI++; - } - } - while (fromI < toI && insert4.length) { - if (children[toI - 1].become(insert4[insert4.length - 1])) { - toI--; - insert4.pop(); - openEnd = insert4.length ? 0 : openStart; - } else if (children[fromI].become(insert4[0])) { - fromI++; - insert4.shift(); - openStart = insert4.length ? 0 : openEnd; - } else { - break; - } - } - if (!insert4.length && fromI && toI < children.length && !children[fromI - 1].breakAfter && children[toI].merge(0, 0, children[fromI - 1], false, openStart, openEnd)) - fromI--; - if (fromI < toI || insert4.length) - parent.replaceChildren(fromI, toI, insert4); - } - function mergeChildrenInto2(parent, from2, to, insert4, openStart, openEnd) { - let cur2 = parent.childCursor(); - let { i: toI, off: toOff } = cur2.findPos(to, 1); - let { i: fromI, off: fromOff } = cur2.findPos(from2, -1); - let dLen = from2 - to; - for (let view of insert4) - dLen += view.length; - parent.length += dLen; - replaceRange2(parent, fromI, fromOff, toI, toOff, insert4, 0, openStart, openEnd); - } - var nav2 = typeof navigator != "undefined" ? navigator : { userAgent: "", vendor: "", platform: "" }; - var doc2 = typeof document != "undefined" ? document : { documentElement: { style: {} } }; - var ie_edge2 = /* @__PURE__ */ /Edge\/(\d+)/.exec(nav2.userAgent); - var ie_upto102 = /* @__PURE__ */ /MSIE \d/.test(nav2.userAgent); - var ie_11up2 = /* @__PURE__ */ /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(nav2.userAgent); - var ie3 = !!(ie_upto102 || ie_11up2 || ie_edge2); - var gecko3 = !ie3 && /* @__PURE__ */ /gecko\/(\d+)/i.test(nav2.userAgent); - var chrome3 = !ie3 && /* @__PURE__ */ /Chrome\/(\d+)/.exec(nav2.userAgent); - var webkit2 = "webkitFontSmoothing" in doc2.documentElement.style; - var safari3 = !ie3 && /* @__PURE__ */ /Apple Computer/.test(nav2.vendor); - var ios3 = safari3 && (/* @__PURE__ */ /Mobile\/\w+/.test(nav2.userAgent) || nav2.maxTouchPoints > 2); - var browser2 = { - mac: ios3 || /* @__PURE__ */ /Mac/.test(nav2.platform), - windows: /* @__PURE__ */ /Win/.test(nav2.platform), - linux: /* @__PURE__ */ /Linux|X11/.test(nav2.platform), - ie: ie3, - ie_version: ie_upto102 ? doc2.documentMode || 6 : ie_11up2 ? +ie_11up2[1] : ie_edge2 ? +ie_edge2[1] : 0, - gecko: gecko3, - gecko_version: gecko3 ? +(/* @__PURE__ */ /Firefox\/(\d+)/.exec(nav2.userAgent) || [0, 0])[1] : 0, - chrome: !!chrome3, - chrome_version: chrome3 ? +chrome3[1] : 0, - ios: ios3, - android: /* @__PURE__ */ /Android\b/.test(nav2.userAgent), - webkit: webkit2, - safari: safari3, - webkit_version: webkit2 ? +(/* @__PURE__ */ /\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0, - tabSize: doc2.documentElement.style.tabSize != null ? "tab-size" : "-moz-tab-size" - }; - var MaxJoinLen2 = 256; - var TextView2 = class extends ContentView2 { - constructor(text) { - super(); - this.text = text; - } - get length() { - return this.text.length; - } - createDOM(textDOM) { - this.setDOM(textDOM || document.createTextNode(this.text)); - } - sync(track) { - if (!this.dom) - this.createDOM(); - if (this.dom.nodeValue != this.text) { - if (track && track.node == this.dom) - track.written = true; - this.dom.nodeValue = this.text; - } - } - reuseDOM(dom) { - if (dom.nodeType == 3) - this.createDOM(dom); - } - merge(from2, to, source) { - if (source && (!(source instanceof TextView2) || this.length - (to - from2) + source.length > MaxJoinLen2)) - return false; - this.text = this.text.slice(0, from2) + (source ? source.text : "") + this.text.slice(to); - this.markDirty(); - return true; - } - split(from2) { - let result = new TextView2(this.text.slice(from2)); - this.text = this.text.slice(0, from2); - this.markDirty(); - return result; - } - localPosFromDOM(node, offset) { - return node == this.dom ? offset : offset ? this.text.length : 0; - } - domAtPos(pos) { - return new DOMPos2(this.dom, pos); - } - domBoundsAround(_from, _to, offset) { - return { from: offset, to: offset + this.length, startDOM: this.dom, endDOM: this.dom.nextSibling }; - } - coordsAt(pos, side) { - return textCoords2(this.dom, pos, side); - } - }; - var MarkView2 = class extends ContentView2 { - constructor(mark, children = [], length = 0) { - super(); - this.mark = mark; - this.children = children; - this.length = length; - for (let ch of children) - ch.setParent(this); - } - setAttrs(dom) { - clearAttributes2(dom); - if (this.mark.class) - dom.className = this.mark.class; - if (this.mark.attrs) - for (let name3 in this.mark.attrs) - dom.setAttribute(name3, this.mark.attrs[name3]); - return dom; - } - reuseDOM(node) { - if (node.nodeName == this.mark.tagName.toUpperCase()) { - this.setDOM(node); - this.dirty |= 4 | 2; - } - } - sync(track) { - if (!this.dom) - this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))); - else if (this.dirty & 4) - this.setAttrs(this.dom); - super.sync(track); - } - merge(from2, to, source, _hasStart, openStart, openEnd) { - if (source && (!(source instanceof MarkView2 && source.mark.eq(this.mark)) || from2 && openStart <= 0 || to < this.length && openEnd <= 0)) - return false; - mergeChildrenInto2(this, from2, to, source ? source.children : [], openStart - 1, openEnd - 1); - this.markDirty(); - return true; - } - split(from2) { - let result = [], off = 0, detachFrom = -1, i = 0; - for (let elt of this.children) { - let end = off + elt.length; - if (end > from2) - result.push(off < from2 ? elt.split(from2 - off) : elt); - if (detachFrom < 0 && off >= from2) - detachFrom = i; - off = end; - i++; - } - let length = this.length - from2; - this.length = from2; - if (detachFrom > -1) { - this.children.length = detachFrom; - this.markDirty(); - } - return new MarkView2(this.mark, result, length); - } - domAtPos(pos) { - return inlineDOMAtPos2(this.dom, this.children, pos); - } - coordsAt(pos, side) { - return coordsInChildren2(this, pos, side); - } - }; - function textCoords2(text, pos, side) { - let length = text.nodeValue.length; - if (pos > length) - pos = length; - let from2 = pos, to = pos, flatten4 = 0; - if (pos == 0 && side < 0 || pos == length && side >= 0) { - if (!(browser2.chrome || browser2.gecko)) { - if (pos) { - from2--; - flatten4 = 1; - } else { - to++; - flatten4 = -1; - } - } - } else { - if (side < 0) - from2--; - else - to++; - } - let rects = textRange2(text, from2, to).getClientRects(); - if (!rects.length) - return Rect02; - let rect = rects[(flatten4 ? flatten4 < 0 : side >= 0) ? 0 : rects.length - 1]; - if (browser2.safari && !flatten4 && rect.width == 0) - rect = Array.prototype.find.call(rects, (r) => r.width) || rect; - return flatten4 ? flattenRect2(rect, flatten4 < 0) : rect || null; - } - var WidgetView2 = class extends ContentView2 { - constructor(widget, length, side) { - super(); - this.widget = widget; - this.length = length; - this.side = side; - this.prevWidget = null; - } - static create(widget, length, side) { - return new (widget.customView || WidgetView2)(widget, length, side); - } - split(from2) { - let result = WidgetView2.create(this.widget, this.length - from2, this.side); - this.length -= from2; - return result; - } - sync() { - if (!this.dom || !this.widget.updateDOM(this.dom)) { - if (this.dom && this.prevWidget) - this.prevWidget.destroy(this.dom); - this.prevWidget = null; - this.setDOM(this.widget.toDOM(this.editorView)); - this.dom.contentEditable = "false"; - } - } - getSide() { - return this.side; - } - merge(from2, to, source, hasStart, openStart, openEnd) { - if (source && (!(source instanceof WidgetView2) || !this.widget.compare(source.widget) || from2 > 0 && openStart <= 0 || to < this.length && openEnd <= 0)) - return false; - this.length = from2 + (source ? source.length : 0) + (this.length - to); - return true; - } - become(other) { - if (other.length == this.length && other instanceof WidgetView2 && other.side == this.side) { - if (this.widget.constructor == other.widget.constructor) { - if (!this.widget.eq(other.widget)) - this.markDirty(true); - if (this.dom && !this.prevWidget) - this.prevWidget = this.widget; - this.widget = other.widget; - return true; - } - } - return false; - } - ignoreMutation() { - return true; - } - ignoreEvent(event) { - return this.widget.ignoreEvent(event); - } - get overrideDOMText() { - if (this.length == 0) - return Text2.empty; - let top2 = this; - while (top2.parent) - top2 = top2.parent; - let view = top2.editorView, text = view && view.state.doc, start = this.posAtStart; - return text ? text.slice(start, start + this.length) : Text2.empty; - } - domAtPos(pos) { - return pos == 0 ? DOMPos2.before(this.dom) : DOMPos2.after(this.dom, pos == this.length); - } - domBoundsAround() { - return null; - } - coordsAt(pos, side) { - let rects = this.dom.getClientRects(), rect = null; - if (!rects.length) - return Rect02; - for (let i = pos > 0 ? rects.length - 1 : 0; ; i += pos > 0 ? -1 : 1) { - rect = rects[i]; - if (pos > 0 ? i == 0 : i == rects.length - 1 || rect.top < rect.bottom) - break; - } - return pos == 0 && side > 0 || pos == this.length && side <= 0 ? rect : flattenRect2(rect, pos == 0); - } - get isEditable() { - return false; - } - destroy() { - super.destroy(); - if (this.dom) - this.widget.destroy(this.dom); - } - }; - var CompositionView2 = class extends WidgetView2 { - domAtPos(pos) { - let { topView, text } = this.widget; - if (!topView) - return new DOMPos2(text, Math.min(pos, text.nodeValue.length)); - return scanCompositionTree2(pos, 0, topView, text, (v, p) => v.domAtPos(p), (p) => new DOMPos2(text, Math.min(p, text.nodeValue.length))); - } - sync() { - this.setDOM(this.widget.toDOM()); - } - localPosFromDOM(node, offset) { - let { topView, text } = this.widget; - if (!topView) - return Math.min(offset, this.length); - return posFromDOMInCompositionTree2(node, offset, topView, text); - } - ignoreMutation() { - return false; - } - get overrideDOMText() { - return null; - } - coordsAt(pos, side) { - let { topView, text } = this.widget; - if (!topView) - return textCoords2(text, pos, side); - return scanCompositionTree2(pos, side, topView, text, (v, pos2, side2) => v.coordsAt(pos2, side2), (pos2, side2) => textCoords2(text, pos2, side2)); - } - destroy() { - var _a4; - super.destroy(); - (_a4 = this.widget.topView) === null || _a4 === void 0 ? void 0 : _a4.destroy(); - } - get isEditable() { - return true; - } - }; - function scanCompositionTree2(pos, side, view, text, enterView, fromText) { - if (view instanceof MarkView2) { - for (let child of view.children) { - let hasComp = contains2(child.dom, text); - let len = hasComp ? text.nodeValue.length : child.length; - if (pos < len || pos == len && child.getSide() <= 0) - return hasComp ? scanCompositionTree2(pos, side, child, text, enterView, fromText) : enterView(child, pos, side); - pos -= len; - } - return enterView(view, view.length, -1); - } else if (view.dom == text) { - return fromText(pos, side); - } else { - return enterView(view, pos, side); - } - } - function posFromDOMInCompositionTree2(node, offset, view, text) { - if (view instanceof MarkView2) { - for (let child of view.children) { - let pos = 0, hasComp = contains2(child.dom, text); - if (contains2(child.dom, node)) - return pos + (hasComp ? posFromDOMInCompositionTree2(node, offset, child, text) : child.localPosFromDOM(node, offset)); - pos += hasComp ? text.nodeValue.length : child.length; - } - } else if (view.dom == text) { - return Math.min(offset, text.nodeValue.length); - } - return view.localPosFromDOM(node, offset); - } - var WidgetBufferView2 = class extends ContentView2 { - constructor(side) { - super(); - this.side = side; - } - get length() { - return 0; - } - merge() { - return false; - } - become(other) { - return other instanceof WidgetBufferView2 && other.side == this.side; - } - split() { - return new WidgetBufferView2(this.side); - } - sync() { - if (!this.dom) { - let dom = document.createElement("img"); - dom.className = "cm-widgetBuffer"; - dom.setAttribute("aria-hidden", "true"); - this.setDOM(dom); - } - } - getSide() { - return this.side; - } - domAtPos(pos) { - return DOMPos2.before(this.dom); - } - localPosFromDOM() { - return 0; - } - domBoundsAround() { - return null; - } - coordsAt(pos) { - let imgRect = this.dom.getBoundingClientRect(); - let siblingRect = inlineSiblingRect2(this, this.side > 0 ? -1 : 1); - return siblingRect && siblingRect.top < imgRect.bottom && siblingRect.bottom > imgRect.top ? { left: imgRect.left, right: imgRect.right, top: siblingRect.top, bottom: siblingRect.bottom } : imgRect; - } - get overrideDOMText() { - return Text2.empty; - } - }; - TextView2.prototype.children = WidgetView2.prototype.children = WidgetBufferView2.prototype.children = noChildren2; - function inlineSiblingRect2(view, side) { - let parent = view.parent, index = parent ? parent.children.indexOf(view) : -1; - while (parent && index >= 0) { - if (side < 0 ? index > 0 : index < parent.children.length) { - let next = parent.children[index + side]; - if (next instanceof TextView2) { - let nextRect = next.coordsAt(side < 0 ? next.length : 0, side); - if (nextRect) - return nextRect; - } - index += side; - } else if (parent instanceof MarkView2 && parent.parent) { - index = parent.parent.children.indexOf(parent) + (side < 0 ? 0 : 1); - parent = parent.parent; - } else { - let last = parent.dom.lastChild; - if (last && last.nodeName == "BR") - return last.getClientRects()[0]; - break; - } - } - return void 0; - } - function inlineDOMAtPos2(dom, children, pos) { - let i = 0; - for (let off = 0; i < children.length; i++) { - let child = children[i], end = off + child.length; - if (end == off && child.getSide() <= 0) - continue; - if (pos > off && pos < end && child.dom.parentNode == dom) - return child.domAtPos(pos - off); - if (pos <= off) - break; - off = end; - } - for (; i > 0; i--) { - let before = children[i - 1].dom; - if (before.parentNode == dom) - return DOMPos2.after(before); - } - return new DOMPos2(dom, 0); - } - function joinInlineInto2(parent, view, open) { - let last, { children } = parent; - if (open > 0 && view instanceof MarkView2 && children.length && (last = children[children.length - 1]) instanceof MarkView2 && last.mark.eq(view.mark)) { - joinInlineInto2(last, view.children[0], open - 1); - } else { - children.push(view); - view.setParent(parent); - } - parent.length += view.length; - } - function coordsInChildren2(view, pos, side) { - for (let off = 0, i = 0; i < view.children.length; i++) { - let child = view.children[i], end = off + child.length, next; - if ((side <= 0 || end == view.length || child.getSide() > 0 ? end >= pos : end > pos) && (pos < end || i + 1 == view.children.length || (next = view.children[i + 1]).length || next.getSide() > 0)) { - let flatten4 = 0; - if (end == off) { - if (child.getSide() <= 0) - continue; - flatten4 = side = -child.getSide(); - } - let rect = child.coordsAt(Math.max(0, pos - off), side); - return flatten4 && rect ? flattenRect2(rect, side < 0) : rect; - } - off = end; - } - let last = view.dom.lastChild; - if (!last) - return view.dom.getBoundingClientRect(); - let rects = clientRectsFor2(last); - return rects[rects.length - 1] || null; - } - function combineAttrs2(source, target) { - for (let name3 in source) { - if (name3 == "class" && target.class) - target.class += " " + source.class; - else if (name3 == "style" && target.style) - target.style += ";" + source.style; - else - target[name3] = source[name3]; - } - return target; - } - function attrsEq2(a, b) { - if (a == b) - return true; - if (!a || !b) - return false; - let keysA = Object.keys(a), keysB = Object.keys(b); - if (keysA.length != keysB.length) - return false; - for (let key of keysA) { - if (keysB.indexOf(key) == -1 || a[key] !== b[key]) - return false; - } - return true; - } - function updateAttrs2(dom, prev, attrs) { - if (prev) { - for (let name3 in prev) - if (!(attrs && name3 in attrs)) - dom.removeAttribute(name3); - } - if (attrs) { - for (let name3 in attrs) - if (!(prev && prev[name3] == attrs[name3])) - dom.setAttribute(name3, attrs[name3]); - } - } - var WidgetType2 = class { - eq(widget) { - return false; - } - updateDOM(dom) { - return false; - } - compare(other) { - return this == other || this.constructor == other.constructor && this.eq(other); - } - get estimatedHeight() { - return -1; - } - ignoreEvent(event) { - return true; - } - get customView() { - return null; - } - destroy(dom) { - } - }; - var BlockType2 = /* @__PURE__ */ function(BlockType4) { - BlockType4[BlockType4["Text"] = 0] = "Text"; - BlockType4[BlockType4["WidgetBefore"] = 1] = "WidgetBefore"; - BlockType4[BlockType4["WidgetAfter"] = 2] = "WidgetAfter"; - BlockType4[BlockType4["WidgetRange"] = 3] = "WidgetRange"; - return BlockType4; - }(BlockType2 || (BlockType2 = {})); - var Decoration2 = class extends RangeValue2 { - constructor(startSide, endSide, widget, spec) { - super(); - this.startSide = startSide; - this.endSide = endSide; - this.widget = widget; - this.spec = spec; - } - get heightRelevant() { - return false; - } - static mark(spec) { - return new MarkDecoration2(spec); - } - static widget(spec) { - let side = spec.side || 0, block = !!spec.block; - side += block ? side > 0 ? 3e8 : -4e8 : side > 0 ? 1e8 : -1e8; - return new PointDecoration2(spec, side, side, block, spec.widget || null, false); - } - static replace(spec) { - let block = !!spec.block, startSide, endSide; - if (spec.isBlockGap) { - startSide = -5e8; - endSide = 4e8; - } else { - let { start, end } = getInclusive2(spec, block); - startSide = (start ? block ? -3e8 : -1 : 5e8) - 1; - endSide = (end ? block ? 2e8 : 1 : -6e8) + 1; - } - return new PointDecoration2(spec, startSide, endSide, block, spec.widget || null, true); - } - static line(spec) { - return new LineDecoration2(spec); - } - static set(of, sort = false) { - return RangeSet2.of(of, sort); - } - hasHeight() { - return this.widget ? this.widget.estimatedHeight > -1 : false; - } - }; - Decoration2.none = RangeSet2.empty; - var MarkDecoration2 = class extends Decoration2 { - constructor(spec) { - let { start, end } = getInclusive2(spec); - super(start ? -1 : 5e8, end ? 1 : -6e8, null, spec); - this.tagName = spec.tagName || "span"; - this.class = spec.class || ""; - this.attrs = spec.attributes || null; - } - eq(other) { - return this == other || other instanceof MarkDecoration2 && this.tagName == other.tagName && this.class == other.class && attrsEq2(this.attrs, other.attrs); - } - range(from2, to = from2) { - if (from2 >= to) - throw new RangeError("Mark decorations may not be empty"); - return super.range(from2, to); - } - }; - MarkDecoration2.prototype.point = false; - var LineDecoration2 = class extends Decoration2 { - constructor(spec) { - super(-2e8, -2e8, null, spec); - } - eq(other) { - return other instanceof LineDecoration2 && attrsEq2(this.spec.attributes, other.spec.attributes); - } - range(from2, to = from2) { - if (to != from2) - throw new RangeError("Line decoration ranges must be zero-length"); - return super.range(from2, to); - } - }; - LineDecoration2.prototype.mapMode = MapMode2.TrackBefore; - LineDecoration2.prototype.point = true; - var PointDecoration2 = class extends Decoration2 { - constructor(spec, startSide, endSide, block, widget, isReplace) { - super(startSide, endSide, widget, spec); - this.block = block; - this.isReplace = isReplace; - this.mapMode = !block ? MapMode2.TrackDel : startSide <= 0 ? MapMode2.TrackBefore : MapMode2.TrackAfter; - } - get type() { - return this.startSide < this.endSide ? BlockType2.WidgetRange : this.startSide <= 0 ? BlockType2.WidgetBefore : BlockType2.WidgetAfter; - } - get heightRelevant() { - return this.block || !!this.widget && this.widget.estimatedHeight >= 5; - } - eq(other) { - return other instanceof PointDecoration2 && widgetsEq2(this.widget, other.widget) && this.block == other.block && this.startSide == other.startSide && this.endSide == other.endSide; - } - range(from2, to = from2) { - if (this.isReplace && (from2 > to || from2 == to && this.startSide > 0 && this.endSide <= 0)) - throw new RangeError("Invalid range for replacement decoration"); - if (!this.isReplace && to != from2) - throw new RangeError("Widget decorations can only have zero-length ranges"); - return super.range(from2, to); - } - }; - PointDecoration2.prototype.point = true; - function getInclusive2(spec, block = false) { - let { inclusiveStart: start, inclusiveEnd: end } = spec; - if (start == null) - start = spec.inclusive; - if (end == null) - end = spec.inclusive; - return { start: start !== null && start !== void 0 ? start : block, end: end !== null && end !== void 0 ? end : block }; - } - function widgetsEq2(a, b) { - return a == b || !!(a && b && a.compare(b)); - } - function addRange2(from2, to, ranges, margin = 0) { - let last = ranges.length - 1; - if (last >= 0 && ranges[last] + margin >= from2) - ranges[last] = Math.max(ranges[last], to); - else - ranges.push(from2, to); - } - var LineView2 = class extends ContentView2 { - constructor() { - super(...arguments); - this.children = []; - this.length = 0; - this.prevAttrs = void 0; - this.attrs = null; - this.breakAfter = 0; - } - merge(from2, to, source, hasStart, openStart, openEnd) { - if (source) { - if (!(source instanceof LineView2)) - return false; - if (!this.dom) - source.transferDOM(this); - } - if (hasStart) - this.setDeco(source ? source.attrs : null); - mergeChildrenInto2(this, from2, to, source ? source.children : [], openStart, openEnd); - return true; - } - split(at) { - let end = new LineView2(); - end.breakAfter = this.breakAfter; - if (this.length == 0) - return end; - let { i, off } = this.childPos(at); - if (off) { - end.append(this.children[i].split(off), 0); - this.children[i].merge(off, this.children[i].length, null, false, 0, 0); - i++; - } - for (let j = i; j < this.children.length; j++) - end.append(this.children[j], 0); - while (i > 0 && this.children[i - 1].length == 0) - this.children[--i].destroy(); - this.children.length = i; - this.markDirty(); - this.length = at; - return end; - } - transferDOM(other) { - if (!this.dom) - return; - other.setDOM(this.dom); - other.prevAttrs = this.prevAttrs === void 0 ? this.attrs : this.prevAttrs; - this.prevAttrs = void 0; - this.dom = null; - } - setDeco(attrs) { - if (!attrsEq2(this.attrs, attrs)) { - if (this.dom) { - this.prevAttrs = this.attrs; - this.markDirty(); - } - this.attrs = attrs; - } - } - append(child, openStart) { - joinInlineInto2(this, child, openStart); - } - addLineDeco(deco) { - let attrs = deco.spec.attributes, cls = deco.spec.class; - if (attrs) - this.attrs = combineAttrs2(attrs, this.attrs || {}); - if (cls) - this.attrs = combineAttrs2({ class: cls }, this.attrs || {}); - } - domAtPos(pos) { - return inlineDOMAtPos2(this.dom, this.children, pos); - } - reuseDOM(node) { - if (node.nodeName == "DIV") { - this.setDOM(node); - this.dirty |= 4 | 2; - } - } - sync(track) { - var _a4; - if (!this.dom) { - this.setDOM(document.createElement("div")); - this.dom.className = "cm-line"; - this.prevAttrs = this.attrs ? null : void 0; - } else if (this.dirty & 4) { - clearAttributes2(this.dom); - this.dom.className = "cm-line"; - this.prevAttrs = this.attrs ? null : void 0; - } - if (this.prevAttrs !== void 0) { - updateAttrs2(this.dom, this.prevAttrs, this.attrs); - this.dom.classList.add("cm-line"); - this.prevAttrs = void 0; - } - super.sync(track); - let last = this.dom.lastChild; - while (last && ContentView2.get(last) instanceof MarkView2) - last = last.lastChild; - if (!last || !this.length || last.nodeName != "BR" && ((_a4 = ContentView2.get(last)) === null || _a4 === void 0 ? void 0 : _a4.isEditable) == false && (!browser2.ios || !this.children.some((ch) => ch instanceof TextView2))) { - let hack = document.createElement("BR"); - hack.cmIgnore = true; - this.dom.appendChild(hack); - } - } - measureTextSize() { - if (this.children.length == 0 || this.length > 20) - return null; - let totalWidth = 0; - for (let child of this.children) { - if (!(child instanceof TextView2)) - return null; - let rects = clientRectsFor2(child.dom); - if (rects.length != 1) - return null; - totalWidth += rects[0].width; - } - return { - lineHeight: this.dom.getBoundingClientRect().height, - charWidth: totalWidth / this.length - }; - } - coordsAt(pos, side) { - return coordsInChildren2(this, pos, side); - } - become(_other) { - return false; - } - get type() { - return BlockType2.Text; - } - static find(docView, pos) { - for (let i = 0, off = 0; i < docView.children.length; i++) { - let block = docView.children[i], end = off + block.length; - if (end >= pos) { - if (block instanceof LineView2) - return block; - if (end > pos) - break; - } - off = end + block.breakAfter; - } - return null; - } - }; - var BlockWidgetView2 = class extends ContentView2 { - constructor(widget, length, type) { - super(); - this.widget = widget; - this.length = length; - this.type = type; - this.breakAfter = 0; - this.prevWidget = null; - } - merge(from2, to, source, _takeDeco, openStart, openEnd) { - if (source && (!(source instanceof BlockWidgetView2) || !this.widget.compare(source.widget) || from2 > 0 && openStart <= 0 || to < this.length && openEnd <= 0)) - return false; - this.length = from2 + (source ? source.length : 0) + (this.length - to); - return true; - } - domAtPos(pos) { - return pos == 0 ? DOMPos2.before(this.dom) : DOMPos2.after(this.dom, pos == this.length); - } - split(at) { - let len = this.length - at; - this.length = at; - let end = new BlockWidgetView2(this.widget, len, this.type); - end.breakAfter = this.breakAfter; - return end; - } - get children() { - return noChildren2; - } - sync() { - if (!this.dom || !this.widget.updateDOM(this.dom)) { - if (this.dom && this.prevWidget) - this.prevWidget.destroy(this.dom); - this.prevWidget = null; - this.setDOM(this.widget.toDOM(this.editorView)); - this.dom.contentEditable = "false"; - } - } - get overrideDOMText() { - return this.parent ? this.parent.view.state.doc.slice(this.posAtStart, this.posAtEnd) : Text2.empty; - } - domBoundsAround() { - return null; - } - become(other) { - if (other instanceof BlockWidgetView2 && other.type == this.type && other.widget.constructor == this.widget.constructor) { - if (!other.widget.eq(this.widget)) - this.markDirty(true); - if (this.dom && !this.prevWidget) - this.prevWidget = this.widget; - this.widget = other.widget; - this.length = other.length; - this.breakAfter = other.breakAfter; - return true; - } - return false; - } - ignoreMutation() { - return true; - } - ignoreEvent(event) { - return this.widget.ignoreEvent(event); - } - destroy() { - super.destroy(); - if (this.dom) - this.widget.destroy(this.dom); - } - }; - var ContentBuilder2 = class { - constructor(doc4, pos, end, disallowBlockEffectsFor) { - this.doc = doc4; - this.pos = pos; - this.end = end; - this.disallowBlockEffectsFor = disallowBlockEffectsFor; - this.content = []; - this.curLine = null; - this.breakAtStart = 0; - this.pendingBuffer = 0; - this.atCursorPos = true; - this.openStart = -1; - this.openEnd = -1; - this.text = ""; - this.textOff = 0; - this.cursor = doc4.iter(); - this.skip = pos; - } - posCovered() { - if (this.content.length == 0) - return !this.breakAtStart && this.doc.lineAt(this.pos).from != this.pos; - let last = this.content[this.content.length - 1]; - return !last.breakAfter && !(last instanceof BlockWidgetView2 && last.type == BlockType2.WidgetBefore); - } - getLine() { - if (!this.curLine) { - this.content.push(this.curLine = new LineView2()); - this.atCursorPos = true; - } - return this.curLine; - } - flushBuffer(active) { - if (this.pendingBuffer) { - this.curLine.append(wrapMarks2(new WidgetBufferView2(-1), active), active.length); - this.pendingBuffer = 0; - } - } - addBlockWidget(view) { - this.flushBuffer([]); - this.curLine = null; - this.content.push(view); - } - finish(openEnd) { - if (!openEnd) - this.flushBuffer([]); - else - this.pendingBuffer = 0; - if (!this.posCovered()) - this.getLine(); - } - buildText(length, active, openStart) { - while (length > 0) { - if (this.textOff == this.text.length) { - let { value, lineBreak, done } = this.cursor.next(this.skip); - this.skip = 0; - if (done) - throw new Error("Ran out of text content when drawing inline views"); - if (lineBreak) { - if (!this.posCovered()) - this.getLine(); - if (this.content.length) - this.content[this.content.length - 1].breakAfter = 1; - else - this.breakAtStart = 1; - this.flushBuffer([]); - this.curLine = null; - length--; - continue; - } else { - this.text = value; - this.textOff = 0; - } - } - let take = Math.min(this.text.length - this.textOff, length, 512); - this.flushBuffer(active.slice(0, openStart)); - this.getLine().append(wrapMarks2(new TextView2(this.text.slice(this.textOff, this.textOff + take)), active), openStart); - this.atCursorPos = true; - this.textOff += take; - length -= take; - openStart = 0; - } - } - span(from2, to, active, openStart) { - this.buildText(to - from2, active, openStart); - this.pos = to; - if (this.openStart < 0) - this.openStart = openStart; - } - point(from2, to, deco, active, openStart, index) { - if (this.disallowBlockEffectsFor[index] && deco instanceof PointDecoration2) { - if (deco.block) - throw new RangeError("Block decorations may not be specified via plugins"); - if (to > this.doc.lineAt(this.pos).to) - throw new RangeError("Decorations that replace line breaks may not be specified via plugins"); - } - let len = to - from2; - if (deco instanceof PointDecoration2) { - if (deco.block) { - let { type } = deco; - if (type == BlockType2.WidgetAfter && !this.posCovered()) - this.getLine(); - this.addBlockWidget(new BlockWidgetView2(deco.widget || new NullWidget2("div"), len, type)); - } else { - let view = WidgetView2.create(deco.widget || new NullWidget2("span"), len, deco.startSide); - let cursorBefore = this.atCursorPos && !view.isEditable && openStart <= active.length && (from2 < to || deco.startSide > 0); - let cursorAfter = !view.isEditable && (from2 < to || deco.startSide <= 0); - let line = this.getLine(); - if (this.pendingBuffer == 2 && !cursorBefore) - this.pendingBuffer = 0; - this.flushBuffer(active); - if (cursorBefore) { - line.append(wrapMarks2(new WidgetBufferView2(1), active), openStart); - openStart = active.length + Math.max(0, openStart - active.length); - } - line.append(wrapMarks2(view, active), openStart); - this.atCursorPos = cursorAfter; - this.pendingBuffer = !cursorAfter ? 0 : from2 < to ? 1 : 2; - } - } else if (this.doc.lineAt(this.pos).from == this.pos) { - this.getLine().addLineDeco(deco); - } - if (len) { - if (this.textOff + len <= this.text.length) { - this.textOff += len; - } else { - this.skip += len - (this.text.length - this.textOff); - this.text = ""; - this.textOff = 0; - } - this.pos = to; - } - if (this.openStart < 0) - this.openStart = openStart; - } - static build(text, from2, to, decorations4, dynamicDecorationMap) { - let builder = new ContentBuilder2(text, from2, to, dynamicDecorationMap); - builder.openEnd = RangeSet2.spans(decorations4, from2, to, builder); - if (builder.openStart < 0) - builder.openStart = builder.openEnd; - builder.finish(builder.openEnd); - return builder; - } - }; - function wrapMarks2(view, active) { - for (let mark of active) - view = new MarkView2(mark, [view], view.length); - return view; - } - var NullWidget2 = class extends WidgetType2 { - constructor(tag) { - super(); - this.tag = tag; - } - eq(other) { - return other.tag == this.tag; - } - toDOM() { - return document.createElement(this.tag); - } - updateDOM(elt) { - return elt.nodeName.toLowerCase() == this.tag; - } - }; - var none6 = []; - var clickAddsSelectionRange2 = /* @__PURE__ */ Facet2.define(); - var dragMovesSelection$12 = /* @__PURE__ */ Facet2.define(); - var mouseSelectionStyle2 = /* @__PURE__ */ Facet2.define(); - var exceptionSink2 = /* @__PURE__ */ Facet2.define(); - var updateListener2 = /* @__PURE__ */ Facet2.define(); - var inputHandler3 = /* @__PURE__ */ Facet2.define(); - var perLineTextDirection = /* @__PURE__ */ Facet2.define({ - combine: (values2) => values2.some((x) => x) - }); - var ScrollTarget2 = class { - constructor(range, y = "nearest", x = "nearest", yMargin = 5, xMargin = 5) { - this.range = range; - this.y = y; - this.x = x; - this.yMargin = yMargin; - this.xMargin = xMargin; - } - map(changes) { - return changes.empty ? this : new ScrollTarget2(this.range.map(changes), this.y, this.x, this.yMargin, this.xMargin); - } - }; - var scrollIntoView3 = /* @__PURE__ */ StateEffect2.define({ map: (t3, ch) => t3.map(ch) }); - function logException2(state, exception, context) { - let handler = state.facet(exceptionSink2); - if (handler.length) - handler[0](exception); - else if (window.onerror) - window.onerror(String(exception), context, void 0, void 0, exception); - else if (context) - console.error(context + ":", exception); - else - console.error(exception); - } - var editable2 = /* @__PURE__ */ Facet2.define({ combine: (values2) => values2.length ? values2[0] : true }); - var nextPluginID2 = 0; - var viewPlugin2 = /* @__PURE__ */ Facet2.define(); - var ViewPlugin2 = class { - constructor(id3, create, domEventHandlers2, buildExtensions) { - this.id = id3; - this.create = create; - this.domEventHandlers = domEventHandlers2; - this.extension = buildExtensions(this); - } - static define(create, spec) { - const { eventHandlers, provide, decorations: deco } = spec || {}; - return new ViewPlugin2(nextPluginID2++, create, eventHandlers, (plugin) => { - let ext = [viewPlugin2.of(plugin)]; - if (deco) - ext.push(decorations2.of((view) => { - let pluginInst = view.plugin(plugin); - return pluginInst ? deco(pluginInst) : Decoration2.none; - })); - if (provide) - ext.push(provide(plugin)); - return ext; - }); - } - static fromClass(cls, spec) { - return ViewPlugin2.define((view) => new cls(view), spec); - } - }; - var PluginInstance2 = class { - constructor(spec) { - this.spec = spec; - this.mustUpdate = null; - this.value = null; - } - update(view) { - if (!this.value) { - if (this.spec) { - try { - this.value = this.spec.create(view); - } catch (e) { - logException2(view.state, e, "CodeMirror plugin crashed"); - this.deactivate(); - } - } - } else if (this.mustUpdate) { - let update = this.mustUpdate; - this.mustUpdate = null; - if (this.value.update) { - try { - this.value.update(update); - } catch (e) { - logException2(update.state, e, "CodeMirror plugin crashed"); - if (this.value.destroy) - try { - this.value.destroy(); - } catch (_) { - } - this.deactivate(); - } - } - } - return this; - } - destroy(view) { - var _a4; - if ((_a4 = this.value) === null || _a4 === void 0 ? void 0 : _a4.destroy) { - try { - this.value.destroy(); - } catch (e) { - logException2(view.state, e, "CodeMirror plugin crashed"); - } - } - } - deactivate() { - this.spec = this.value = null; - } - }; - var editorAttributes2 = /* @__PURE__ */ Facet2.define(); - var contentAttributes2 = /* @__PURE__ */ Facet2.define(); - var decorations2 = /* @__PURE__ */ Facet2.define(); - var atomicRanges = /* @__PURE__ */ Facet2.define(); - var scrollMargins = /* @__PURE__ */ Facet2.define(); - var styleModule2 = /* @__PURE__ */ Facet2.define(); - var ChangedRange2 = class { - constructor(fromA, toA, fromB, toB) { - this.fromA = fromA; - this.toA = toA; - this.fromB = fromB; - this.toB = toB; - } - join(other) { - return new ChangedRange2(Math.min(this.fromA, other.fromA), Math.max(this.toA, other.toA), Math.min(this.fromB, other.fromB), Math.max(this.toB, other.toB)); - } - addToSet(set) { - let i = set.length, me = this; - for (; i > 0; i--) { - let range = set[i - 1]; - if (range.fromA > me.toA) - continue; - if (range.toA < me.fromA) - break; - me = me.join(range); - set.splice(i - 1, 1); - } - set.splice(i, 0, me); - return set; - } - static extendWithRanges(diff, ranges) { - if (ranges.length == 0) - return diff; - let result = []; - for (let dI = 0, rI = 0, posA = 0, posB = 0; ; dI++) { - let next = dI == diff.length ? null : diff[dI], off = posA - posB; - let end = next ? next.fromB : 1e9; - while (rI < ranges.length && ranges[rI] < end) { - let from2 = ranges[rI], to = ranges[rI + 1]; - let fromB = Math.max(posB, from2), toB = Math.min(end, to); - if (fromB <= toB) - new ChangedRange2(fromB + off, toB + off, fromB, toB).addToSet(result); - if (to > end) - break; - else - rI += 2; - } - if (!next) - return result; - new ChangedRange2(next.fromA, next.toA, next.fromB, next.toB).addToSet(result); - posA = next.toA; - posB = next.toB; - } - } - }; - var ViewUpdate2 = class { - constructor(view, state, transactions = none6) { - this.view = view; - this.state = state; - this.transactions = transactions; - this.flags = 0; - this.startState = view.state; - this.changes = ChangeSet2.empty(this.startState.doc.length); - for (let tr of transactions) - this.changes = this.changes.compose(tr.changes); - let changedRanges = []; - this.changes.iterChangedRanges((fromA, toA, fromB, toB) => changedRanges.push(new ChangedRange2(fromA, toA, fromB, toB))); - this.changedRanges = changedRanges; - let focus = view.hasFocus; - if (focus != view.inputState.notifiedFocused) { - view.inputState.notifiedFocused = focus; - this.flags |= 1; - } - } - get viewportChanged() { - return (this.flags & 4) > 0; - } - get heightChanged() { - return (this.flags & 2) > 0; - } - get geometryChanged() { - return this.docChanged || (this.flags & (8 | 2)) > 0; - } - get focusChanged() { - return (this.flags & 1) > 0; - } - get docChanged() { - return !this.changes.empty; - } - get selectionSet() { - return this.transactions.some((tr) => tr.selection); - } - get empty() { - return this.flags == 0 && this.transactions.length == 0; - } - }; - var Direction2 = /* @__PURE__ */ function(Direction4) { - Direction4[Direction4["LTR"] = 0] = "LTR"; - Direction4[Direction4["RTL"] = 1] = "RTL"; - return Direction4; - }(Direction2 || (Direction2 = {})); - var LTR2 = Direction2.LTR; - var RTL2 = Direction2.RTL; - function dec2(str) { - let result = []; - for (let i = 0; i < str.length; i++) - result.push(1 << +str[i]); - return result; - } - var LowTypes2 = /* @__PURE__ */ dec2("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"); - var ArabicTypes2 = /* @__PURE__ */ dec2("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"); - var Brackets2 = /* @__PURE__ */ Object.create(null); - var BracketStack2 = []; - for (let p of ["()", "[]", "{}"]) { - let l = /* @__PURE__ */ p.charCodeAt(0), r = /* @__PURE__ */ p.charCodeAt(1); - Brackets2[l] = r; - Brackets2[r] = -l; - } - function charType2(ch) { - return ch <= 247 ? LowTypes2[ch] : 1424 <= ch && ch <= 1524 ? 2 : 1536 <= ch && ch <= 1785 ? ArabicTypes2[ch - 1536] : 1774 <= ch && ch <= 2220 ? 4 : 8192 <= ch && ch <= 8203 ? 256 : ch == 8204 ? 256 : 1; - } - var BidiRE2 = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; - var BidiSpan2 = class { - constructor(from2, to, level) { - this.from = from2; - this.to = to; - this.level = level; - } - get dir() { - return this.level % 2 ? RTL2 : LTR2; - } - side(end, dir) { - return this.dir == dir == end ? this.to : this.from; - } - static find(order, index, level, assoc) { - let maybe = -1; - for (let i = 0; i < order.length; i++) { - let span2 = order[i]; - if (span2.from <= index && span2.to >= index) { - if (span2.level == level) - return i; - if (maybe < 0 || (assoc != 0 ? assoc < 0 ? span2.from < index : span2.to > index : order[maybe].level > span2.level)) - maybe = i; - } - } - if (maybe < 0) - throw new RangeError("Index out of range"); - return maybe; - } - }; - var types2 = []; - function computeOrder2(line, direction) { - let len = line.length, outerType = direction == LTR2 ? 1 : 2, oppositeType = direction == LTR2 ? 2 : 1; - if (!line || outerType == 1 && !BidiRE2.test(line)) - return trivialOrder2(len); - for (let i = 0, prev = outerType, prevStrong = outerType; i < len; i++) { - let type = charType2(line.charCodeAt(i)); - if (type == 512) - type = prev; - else if (type == 8 && prevStrong == 4) - type = 16; - types2[i] = type == 4 ? 2 : type; - if (type & 7) - prevStrong = type; - prev = type; - } - for (let i = 0, prev = outerType, prevStrong = outerType; i < len; i++) { - let type = types2[i]; - if (type == 128) { - if (i < len - 1 && prev == types2[i + 1] && prev & 24) - type = types2[i] = prev; - else - types2[i] = 256; - } else if (type == 64) { - let end = i + 1; - while (end < len && types2[end] == 64) - end++; - let replace = i && prev == 8 || end < len && types2[end] == 8 ? prevStrong == 1 ? 1 : 8 : 256; - for (let j = i; j < end; j++) - types2[j] = replace; - i = end - 1; - } else if (type == 8 && prevStrong == 1) { - types2[i] = 1; - } - prev = type; - if (type & 7) - prevStrong = type; - } - for (let i = 0, sI = 0, context = 0, ch, br, type; i < len; i++) { - if (br = Brackets2[ch = line.charCodeAt(i)]) { - if (br < 0) { - for (let sJ = sI - 3; sJ >= 0; sJ -= 3) { - if (BracketStack2[sJ + 1] == -br) { - let flags = BracketStack2[sJ + 2]; - let type2 = flags & 2 ? outerType : !(flags & 4) ? 0 : flags & 1 ? oppositeType : outerType; - if (type2) - types2[i] = types2[BracketStack2[sJ]] = type2; - sI = sJ; - break; - } - } - } else if (BracketStack2.length == 189) { - break; - } else { - BracketStack2[sI++] = i; - BracketStack2[sI++] = ch; - BracketStack2[sI++] = context; - } - } else if ((type = types2[i]) == 2 || type == 1) { - let embed = type == outerType; - context = embed ? 0 : 1; - for (let sJ = sI - 3; sJ >= 0; sJ -= 3) { - let cur2 = BracketStack2[sJ + 2]; - if (cur2 & 2) - break; - if (embed) { - BracketStack2[sJ + 2] |= 2; - } else { - if (cur2 & 4) - break; - BracketStack2[sJ + 2] |= 4; - } - } - } - } - for (let i = 0; i < len; i++) { - if (types2[i] == 256) { - let end = i + 1; - while (end < len && types2[end] == 256) - end++; - let beforeL = (i ? types2[i - 1] : outerType) == 1; - let afterL = (end < len ? types2[end] : outerType) == 1; - let replace = beforeL == afterL ? beforeL ? 1 : 2 : outerType; - for (let j = i; j < end; j++) - types2[j] = replace; - i = end - 1; - } - } - let order = []; - if (outerType == 1) { - for (let i = 0; i < len; ) { - let start = i, rtl = types2[i++] != 1; - while (i < len && rtl == (types2[i] != 1)) - i++; - if (rtl) { - for (let j = i; j > start; ) { - let end = j, l = types2[--j] != 2; - while (j > start && l == (types2[j - 1] != 2)) - j--; - order.push(new BidiSpan2(j, end, l ? 2 : 1)); - } - } else { - order.push(new BidiSpan2(start, i, 0)); - } - } - } else { - for (let i = 0; i < len; ) { - let start = i, rtl = types2[i++] == 2; - while (i < len && rtl == (types2[i] == 2)) - i++; - order.push(new BidiSpan2(start, i, rtl ? 1 : 2)); - } - } - return order; - } - function trivialOrder2(length) { - return [new BidiSpan2(0, length, 0)]; - } - var movedOver2 = ""; - function moveVisually2(line, order, dir, start, forward) { - var _a4; - let startIndex = start.head - line.from, spanI = -1; - if (startIndex == 0) { - if (!forward || !line.length) - return null; - if (order[0].level != dir) { - startIndex = order[0].side(false, dir); - spanI = 0; - } - } else if (startIndex == line.length) { - if (forward) - return null; - let last = order[order.length - 1]; - if (last.level != dir) { - startIndex = last.side(true, dir); - spanI = order.length - 1; - } - } - if (spanI < 0) - spanI = BidiSpan2.find(order, startIndex, (_a4 = start.bidiLevel) !== null && _a4 !== void 0 ? _a4 : -1, start.assoc); - let span2 = order[spanI]; - if (startIndex == span2.side(forward, dir)) { - span2 = order[spanI += forward ? 1 : -1]; - startIndex = span2.side(!forward, dir); - } - let indexForward = forward == (span2.dir == dir); - let nextIndex = findClusterBreak2(line.text, startIndex, indexForward); - movedOver2 = line.text.slice(Math.min(startIndex, nextIndex), Math.max(startIndex, nextIndex)); - if (nextIndex != span2.side(forward, dir)) - return EditorSelection2.cursor(nextIndex + line.from, indexForward ? -1 : 1, span2.level); - let nextSpan = spanI == (forward ? order.length - 1 : 0) ? null : order[spanI + (forward ? 1 : -1)]; - if (!nextSpan && span2.level != dir) - return EditorSelection2.cursor(forward ? line.to : line.from, forward ? -1 : 1, dir); - if (nextSpan && nextSpan.level < span2.level) - return EditorSelection2.cursor(nextSpan.side(!forward, dir) + line.from, forward ? 1 : -1, nextSpan.level); - return EditorSelection2.cursor(nextIndex + line.from, forward ? -1 : 1, span2.level); - } - var LineBreakPlaceholder2 = "\uFFFF"; - var DOMReader2 = class { - constructor(points, state) { - this.points = points; - this.text = ""; - this.lineSeparator = state.facet(EditorState2.lineSeparator); - } - append(text) { - this.text += text; - } - lineBreak() { - this.text += LineBreakPlaceholder2; - } - readRange(start, end) { - if (!start) - return this; - let parent = start.parentNode; - for (let cur2 = start; ; ) { - this.findPointBefore(parent, cur2); - this.readNode(cur2); - let next = cur2.nextSibling; - if (next == end) - break; - let view = ContentView2.get(cur2), nextView = ContentView2.get(next); - if (view && nextView ? view.breakAfter : (view ? view.breakAfter : isBlockElement2(cur2)) || isBlockElement2(next) && (cur2.nodeName != "BR" || cur2.cmIgnore)) - this.lineBreak(); - cur2 = next; - } - this.findPointBefore(parent, end); - return this; - } - readTextNode(node) { - let text = node.nodeValue; - for (let point of this.points) - if (point.node == node) - point.pos = this.text.length + Math.min(point.offset, text.length); - for (let off = 0, re = this.lineSeparator ? null : /\r\n?|\n/g; ; ) { - let nextBreak = -1, breakSize = 1, m; - if (this.lineSeparator) { - nextBreak = text.indexOf(this.lineSeparator, off); - breakSize = this.lineSeparator.length; - } else if (m = re.exec(text)) { - nextBreak = m.index; - breakSize = m[0].length; - } - this.append(text.slice(off, nextBreak < 0 ? text.length : nextBreak)); - if (nextBreak < 0) - break; - this.lineBreak(); - if (breakSize > 1) { - for (let point of this.points) - if (point.node == node && point.pos > this.text.length) - point.pos -= breakSize - 1; - } - off = nextBreak + breakSize; - } - } - readNode(node) { - if (node.cmIgnore) - return; - let view = ContentView2.get(node); - let fromView = view && view.overrideDOMText; - if (fromView != null) { - this.findPointInside(node, fromView.length); - for (let i = fromView.iter(); !i.next().done; ) { - if (i.lineBreak) - this.lineBreak(); - else - this.append(i.value); - } - } else if (node.nodeType == 3) { - this.readTextNode(node); - } else if (node.nodeName == "BR") { - if (node.nextSibling) - this.lineBreak(); - } else if (node.nodeType == 1) { - this.readRange(node.firstChild, null); - } - } - findPointBefore(node, next) { - for (let point of this.points) - if (point.node == node && node.childNodes[point.offset] == next) - point.pos = this.text.length; - } - findPointInside(node, maxLen) { - for (let point of this.points) - if (node.nodeType == 3 ? point.node == node : node.contains(point.node)) - point.pos = this.text.length + Math.min(maxLen, point.offset); - } - }; - function isBlockElement2(node) { - return node.nodeType == 1 && /^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(node.nodeName); - } - var DOMPoint2 = class { - constructor(node, offset) { - this.node = node; - this.offset = offset; - this.pos = -1; - } - }; - var DocView2 = class extends ContentView2 { - constructor(view) { - super(); - this.view = view; - this.compositionDeco = Decoration2.none; - this.decorations = []; - this.dynamicDecorationMap = []; - this.minWidth = 0; - this.minWidthFrom = 0; - this.minWidthTo = 0; - this.impreciseAnchor = null; - this.impreciseHead = null; - this.forceSelection = false; - this.lastUpdate = Date.now(); - this.setDOM(view.contentDOM); - this.children = [new LineView2()]; - this.children[0].setParent(this); - this.updateDeco(); - this.updateInner([new ChangedRange2(0, 0, 0, view.state.doc.length)], 0); - } - get root() { - return this.view.root; - } - get editorView() { - return this.view; - } - get length() { - return this.view.state.doc.length; - } - update(update) { - let changedRanges = update.changedRanges; - if (this.minWidth > 0 && changedRanges.length) { - if (!changedRanges.every(({ fromA, toA }) => toA < this.minWidthFrom || fromA > this.minWidthTo)) { - this.minWidth = this.minWidthFrom = this.minWidthTo = 0; - } else { - this.minWidthFrom = update.changes.mapPos(this.minWidthFrom, 1); - this.minWidthTo = update.changes.mapPos(this.minWidthTo, 1); - } - } - if (this.view.inputState.composing < 0) - this.compositionDeco = Decoration2.none; - else if (update.transactions.length || this.dirty) - this.compositionDeco = computeCompositionDeco2(this.view, update.changes); - if ((browser2.ie || browser2.chrome) && !this.compositionDeco.size && update && update.state.doc.lines != update.startState.doc.lines) - this.forceSelection = true; - let prevDeco = this.decorations, deco = this.updateDeco(); - let decoDiff = findChangedDeco2(prevDeco, deco, update.changes); - changedRanges = ChangedRange2.extendWithRanges(changedRanges, decoDiff); - if (this.dirty == 0 && changedRanges.length == 0) { - return false; - } else { - this.updateInner(changedRanges, update.startState.doc.length); - if (update.transactions.length) - this.lastUpdate = Date.now(); - return true; - } - } - updateInner(changes, oldLength) { - this.view.viewState.mustMeasureContent = true; - this.updateChildren(changes, oldLength); - let { observer } = this.view; - observer.ignore(() => { - this.dom.style.height = this.view.viewState.contentHeight + "px"; - this.dom.style.minWidth = this.minWidth ? this.minWidth + "px" : ""; - let track = browser2.chrome || browser2.ios ? { node: observer.selectionRange.focusNode, written: false } : void 0; - this.sync(track); - this.dirty = 0; - if (track && (track.written || observer.selectionRange.focusNode != track.node)) - this.forceSelection = true; - this.dom.style.height = ""; - }); - let gaps = []; - if (this.view.viewport.from || this.view.viewport.to < this.view.state.doc.length) { - for (let child of this.children) - if (child instanceof BlockWidgetView2 && child.widget instanceof BlockGapWidget2) - gaps.push(child.dom); - } - observer.updateGaps(gaps); - } - updateChildren(changes, oldLength) { - let cursor = this.childCursor(oldLength); - for (let i = changes.length - 1; ; i--) { - let next = i >= 0 ? changes[i] : null; - if (!next) - break; - let { fromA, toA, fromB, toB } = next; - let { content: content3, breakAtStart, openStart, openEnd } = ContentBuilder2.build(this.view.state.doc, fromB, toB, this.decorations, this.dynamicDecorationMap); - let { i: toI, off: toOff } = cursor.findPos(toA, 1); - let { i: fromI, off: fromOff } = cursor.findPos(fromA, -1); - replaceRange2(this, fromI, fromOff, toI, toOff, content3, breakAtStart, openStart, openEnd); - } - } - updateSelection(mustRead = false, fromPointer = false) { - if (mustRead) - this.view.observer.readSelectionRange(); - if (!(fromPointer || this.mayControlSelection()) || browser2.ios && this.view.inputState.rapidCompositionStart) - return; - let force = this.forceSelection; - this.forceSelection = false; - let main = this.view.state.selection.main; - let anchor = this.domAtPos(main.anchor); - let head = main.empty ? anchor : this.domAtPos(main.head); - if (browser2.gecko && main.empty && betweenUneditable2(anchor)) { - let dummy = document.createTextNode(""); - this.view.observer.ignore(() => anchor.node.insertBefore(dummy, anchor.node.childNodes[anchor.offset] || null)); - anchor = head = new DOMPos2(dummy, 0); - force = true; - } - let domSel = this.view.observer.selectionRange; - if (force || !domSel.focusNode || !isEquivalentPosition2(anchor.node, anchor.offset, domSel.anchorNode, domSel.anchorOffset) || !isEquivalentPosition2(head.node, head.offset, domSel.focusNode, domSel.focusOffset)) { - this.view.observer.ignore(() => { - if (browser2.android && browser2.chrome && this.dom.contains(domSel.focusNode) && inUneditable2(domSel.focusNode, this.dom)) { - this.dom.blur(); - this.dom.focus({ preventScroll: true }); - } - let rawSel = getSelection2(this.root); - if (main.empty) { - if (browser2.gecko) { - let nextTo = nextToUneditable2(anchor.node, anchor.offset); - if (nextTo && nextTo != (1 | 2)) { - let text = nearbyTextNode2(anchor.node, anchor.offset, nextTo == 1 ? 1 : -1); - if (text) - anchor = new DOMPos2(text, nextTo == 1 ? 0 : text.nodeValue.length); - } - } - rawSel.collapse(anchor.node, anchor.offset); - if (main.bidiLevel != null && domSel.cursorBidiLevel != null) - domSel.cursorBidiLevel = main.bidiLevel; - } else if (rawSel.extend) { - rawSel.collapse(anchor.node, anchor.offset); - rawSel.extend(head.node, head.offset); - } else { - let range = document.createRange(); - if (main.anchor > main.head) - [anchor, head] = [head, anchor]; - range.setEnd(head.node, head.offset); - range.setStart(anchor.node, anchor.offset); - rawSel.removeAllRanges(); - rawSel.addRange(range); - } - }); - this.view.observer.setSelectionRange(anchor, head); - } - this.impreciseAnchor = anchor.precise ? null : new DOMPos2(domSel.anchorNode, domSel.anchorOffset); - this.impreciseHead = head.precise ? null : new DOMPos2(domSel.focusNode, domSel.focusOffset); - } - enforceCursorAssoc() { - if (this.compositionDeco.size) - return; - let cursor = this.view.state.selection.main; - let sel = getSelection2(this.root); - if (!cursor.empty || !cursor.assoc || !sel.modify) - return; - let line = LineView2.find(this, cursor.head); - if (!line) - return; - let lineStart = line.posAtStart; - if (cursor.head == lineStart || cursor.head == lineStart + line.length) - return; - let before = this.coordsAt(cursor.head, -1), after = this.coordsAt(cursor.head, 1); - if (!before || !after || before.bottom > after.top) - return; - let dom = this.domAtPos(cursor.head + cursor.assoc); - sel.collapse(dom.node, dom.offset); - sel.modify("move", cursor.assoc < 0 ? "forward" : "backward", "lineboundary"); - } - mayControlSelection() { - return this.view.state.facet(editable2) ? this.root.activeElement == this.dom : hasSelection2(this.dom, this.view.observer.selectionRange); - } - nearest(dom) { - for (let cur2 = dom; cur2; ) { - let domView = ContentView2.get(cur2); - if (domView && domView.rootView == this) - return domView; - cur2 = cur2.parentNode; - } - return null; - } - posFromDOM(node, offset) { - let view = this.nearest(node); - if (!view) - throw new RangeError("Trying to find position for a DOM position outside of the document"); - return view.localPosFromDOM(node, offset) + view.posAtStart; - } - domAtPos(pos) { - let { i, off } = this.childCursor().findPos(pos, -1); - for (; i < this.children.length - 1; ) { - let child = this.children[i]; - if (off < child.length || child instanceof LineView2) - break; - i++; - off = 0; - } - return this.children[i].domAtPos(off); - } - coordsAt(pos, side) { - for (let off = this.length, i = this.children.length - 1; ; i--) { - let child = this.children[i], start = off - child.breakAfter - child.length; - if (pos > start || pos == start && child.type != BlockType2.WidgetBefore && child.type != BlockType2.WidgetAfter && (!i || side == 2 || this.children[i - 1].breakAfter || this.children[i - 1].type == BlockType2.WidgetBefore && side > -2)) - return child.coordsAt(pos - start, side); - off = start; - } - } - measureVisibleLineHeights(viewport) { - let result = [], { from: from2, to } = viewport; - let contentWidth = this.view.contentDOM.clientWidth; - let isWider = contentWidth > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1; - let widest = -1, ltr = this.view.textDirection == Direction2.LTR; - for (let pos = 0, i = 0; i < this.children.length; i++) { - let child = this.children[i], end = pos + child.length; - if (end > to) - break; - if (pos >= from2) { - let childRect = child.dom.getBoundingClientRect(); - result.push(childRect.height); - if (isWider) { - let last = child.dom.lastChild; - let rects = last ? clientRectsFor2(last) : []; - if (rects.length) { - let rect = rects[rects.length - 1]; - let width = ltr ? rect.right - childRect.left : childRect.right - rect.left; - if (width > widest) { - widest = width; - this.minWidth = contentWidth; - this.minWidthFrom = pos; - this.minWidthTo = end; - } - } - } - } - pos = end + child.breakAfter; - } - return result; - } - textDirectionAt(pos) { - let { i } = this.childPos(pos, 1); - return getComputedStyle(this.children[i].dom).direction == "rtl" ? Direction2.RTL : Direction2.LTR; - } - measureTextSize() { - for (let child of this.children) { - if (child instanceof LineView2) { - let measure = child.measureTextSize(); - if (measure) - return measure; - } - } - let dummy = document.createElement("div"), lineHeight, charWidth; - dummy.className = "cm-line"; - dummy.textContent = "abc def ghi jkl mno pqr stu"; - this.view.observer.ignore(() => { - this.dom.appendChild(dummy); - let rect = clientRectsFor2(dummy.firstChild)[0]; - lineHeight = dummy.getBoundingClientRect().height; - charWidth = rect ? rect.width / 27 : 7; - dummy.remove(); - }); - return { lineHeight, charWidth }; - } - childCursor(pos = this.length) { - let i = this.children.length; - if (i) - pos -= this.children[--i].length; - return new ChildCursor2(this.children, pos, i); - } - computeBlockGapDeco() { - let deco = [], vs = this.view.viewState; - for (let pos = 0, i = 0; ; i++) { - let next = i == vs.viewports.length ? null : vs.viewports[i]; - let end = next ? next.from - 1 : this.length; - if (end > pos) { - let height = vs.lineBlockAt(end).bottom - vs.lineBlockAt(pos).top; - deco.push(Decoration2.replace({ - widget: new BlockGapWidget2(height), - block: true, - inclusive: true, - isBlockGap: true - }).range(pos, end)); - } - if (!next) - break; - pos = next.to + 1; - } - return Decoration2.set(deco); - } - updateDeco() { - let allDeco = this.view.state.facet(decorations2).map((d, i) => { - let dynamic = this.dynamicDecorationMap[i] = typeof d == "function"; - return dynamic ? d(this.view) : d; - }); - for (let i = allDeco.length; i < allDeco.length + 3; i++) - this.dynamicDecorationMap[i] = false; - return this.decorations = [ - ...allDeco, - this.compositionDeco, - this.computeBlockGapDeco(), - this.view.viewState.lineGapDeco - ]; - } - scrollIntoView(target) { - let { range } = target; - let rect = this.coordsAt(range.head, range.empty ? range.assoc : range.head > range.anchor ? -1 : 1), other; - if (!rect) - return; - if (!range.empty && (other = this.coordsAt(range.anchor, range.anchor > range.head ? -1 : 1))) - rect = { - left: Math.min(rect.left, other.left), - top: Math.min(rect.top, other.top), - right: Math.max(rect.right, other.right), - bottom: Math.max(rect.bottom, other.bottom) - }; - let mLeft = 0, mRight = 0, mTop = 0, mBottom = 0; - for (let margins of this.view.state.facet(scrollMargins).map((f) => f(this.view))) - if (margins) { - let { left, right, top: top2, bottom } = margins; - if (left != null) - mLeft = Math.max(mLeft, left); - if (right != null) - mRight = Math.max(mRight, right); - if (top2 != null) - mTop = Math.max(mTop, top2); - if (bottom != null) - mBottom = Math.max(mBottom, bottom); - } - let targetRect = { - left: rect.left - mLeft, - top: rect.top - mTop, - right: rect.right + mRight, - bottom: rect.bottom + mBottom - }; - scrollRectIntoView2(this.view.scrollDOM, targetRect, range.head < range.anchor ? -1 : 1, target.x, target.y, target.xMargin, target.yMargin, this.view.textDirection == Direction2.LTR); - } - }; - function betweenUneditable2(pos) { - return pos.node.nodeType == 1 && pos.node.firstChild && (pos.offset == 0 || pos.node.childNodes[pos.offset - 1].contentEditable == "false") && (pos.offset == pos.node.childNodes.length || pos.node.childNodes[pos.offset].contentEditable == "false"); - } - var BlockGapWidget2 = class extends WidgetType2 { - constructor(height) { - super(); - this.height = height; - } - toDOM() { - let elt = document.createElement("div"); - this.updateDOM(elt); - return elt; - } - eq(other) { - return other.height == this.height; - } - updateDOM(elt) { - elt.style.height = this.height + "px"; - return true; - } - get estimatedHeight() { - return this.height; - } - }; - function compositionSurroundingNode2(view) { - let sel = view.observer.selectionRange; - let textNode = sel.focusNode && nearbyTextNode2(sel.focusNode, sel.focusOffset, 0); - if (!textNode) - return null; - let cView = view.docView.nearest(textNode); - if (!cView) - return null; - if (cView instanceof LineView2) { - let topNode = textNode; - while (topNode.parentNode != cView.dom) - topNode = topNode.parentNode; - let prev = topNode.previousSibling; - while (prev && !ContentView2.get(prev)) - prev = prev.previousSibling; - let pos = prev ? ContentView2.get(prev).posAtEnd : cView.posAtStart; - return { from: pos, to: pos, node: topNode, text: textNode }; - } else { - for (; ; ) { - let { parent } = cView; - if (!parent) - return null; - if (parent instanceof LineView2) - break; - cView = parent; - } - let from2 = cView.posAtStart; - return { from: from2, to: from2 + cView.length, node: cView.dom, text: textNode }; - } - } - function computeCompositionDeco2(view, changes) { - let surrounding = compositionSurroundingNode2(view); - if (!surrounding) - return Decoration2.none; - let { from: from2, to, node, text: textNode } = surrounding; - let newFrom = changes.mapPos(from2, 1), newTo = Math.max(newFrom, changes.mapPos(to, -1)); - let { state } = view, text = node.nodeType == 3 ? node.nodeValue : new DOMReader2([], state).readRange(node.firstChild, null).text; - if (newTo - newFrom < text.length) { - if (state.doc.sliceString(newFrom, Math.min(state.doc.length, newFrom + text.length), LineBreakPlaceholder2) == text) - newTo = newFrom + text.length; - else if (state.doc.sliceString(Math.max(0, newTo - text.length), newTo, LineBreakPlaceholder2) == text) - newFrom = newTo - text.length; - else - return Decoration2.none; - } else if (state.doc.sliceString(newFrom, newTo, LineBreakPlaceholder2) != text) { - return Decoration2.none; - } - let topView = ContentView2.get(node); - if (topView instanceof CompositionView2) - topView = topView.widget.topView; - else if (topView) - topView.parent = null; - return Decoration2.set(Decoration2.replace({ widget: new CompositionWidget2(node, textNode, topView), inclusive: true }).range(newFrom, newTo)); - } - var CompositionWidget2 = class extends WidgetType2 { - constructor(top2, text, topView) { - super(); - this.top = top2; - this.text = text; - this.topView = topView; - } - eq(other) { - return this.top == other.top && this.text == other.text; - } - toDOM() { - return this.top; - } - ignoreEvent() { - return false; - } - get customView() { - return CompositionView2; - } - }; - function nearbyTextNode2(node, offset, side) { - for (; ; ) { - if (node.nodeType == 3) - return node; - if (node.nodeType == 1 && offset > 0 && side <= 0) { - node = node.childNodes[offset - 1]; - offset = maxOffset2(node); - } else if (node.nodeType == 1 && offset < node.childNodes.length && side >= 0) { - node = node.childNodes[offset]; - offset = 0; - } else { - return null; - } - } - } - function nextToUneditable2(node, offset) { - if (node.nodeType != 1) - return 0; - return (offset && node.childNodes[offset - 1].contentEditable == "false" ? 1 : 0) | (offset < node.childNodes.length && node.childNodes[offset].contentEditable == "false" ? 2 : 0); - } - var DecorationComparator$12 = class { - constructor() { - this.changes = []; - } - compareRange(from2, to) { - addRange2(from2, to, this.changes); - } - comparePoint(from2, to) { - addRange2(from2, to, this.changes); - } - }; - function findChangedDeco2(a, b, diff) { - let comp = new DecorationComparator$12(); - RangeSet2.compare(a, b, diff, comp); - return comp.changes; - } - function inUneditable2(node, inside4) { - for (let cur2 = node; cur2 && cur2 != inside4; cur2 = cur2.assignedSlot || cur2.parentNode) { - if (cur2.nodeType == 1 && cur2.contentEditable == "false") { - return true; - } - } - return false; - } - function groupAt2(state, pos, bias = 1) { - let categorize = state.charCategorizer(pos); - let line = state.doc.lineAt(pos), linePos = pos - line.from; - if (line.length == 0) - return EditorSelection2.cursor(pos); - if (linePos == 0) - bias = 1; - else if (linePos == line.length) - bias = -1; - let from2 = linePos, to = linePos; - if (bias < 0) - from2 = findClusterBreak2(line.text, linePos, false); - else - to = findClusterBreak2(line.text, linePos); - let cat = categorize(line.text.slice(from2, to)); - while (from2 > 0) { - let prev = findClusterBreak2(line.text, from2, false); - if (categorize(line.text.slice(prev, from2)) != cat) - break; - from2 = prev; - } - while (to < line.length) { - let next = findClusterBreak2(line.text, to); - if (categorize(line.text.slice(to, next)) != cat) - break; - to = next; - } - return EditorSelection2.range(from2 + line.from, to + line.from); - } - function getdx2(x, rect) { - return rect.left > x ? rect.left - x : Math.max(0, x - rect.right); - } - function getdy2(y, rect) { - return rect.top > y ? rect.top - y : Math.max(0, y - rect.bottom); - } - function yOverlap2(a, b) { - return a.top < b.bottom - 1 && a.bottom > b.top + 1; - } - function upTop2(rect, top2) { - return top2 < rect.top ? { top: top2, left: rect.left, right: rect.right, bottom: rect.bottom } : rect; - } - function upBot2(rect, bottom) { - return bottom > rect.bottom ? { top: rect.top, left: rect.left, right: rect.right, bottom } : rect; - } - function domPosAtCoords2(parent, x, y) { - let closest, closestRect, closestX, closestY; - let above, below, aboveRect, belowRect; - for (let child = parent.firstChild; child; child = child.nextSibling) { - let rects = clientRectsFor2(child); - for (let i = 0; i < rects.length; i++) { - let rect = rects[i]; - if (closestRect && yOverlap2(closestRect, rect)) - rect = upTop2(upBot2(rect, closestRect.bottom), closestRect.top); - let dx = getdx2(x, rect), dy = getdy2(y, rect); - if (dx == 0 && dy == 0) - return child.nodeType == 3 ? domPosInText2(child, x, y) : domPosAtCoords2(child, x, y); - if (!closest || closestY > dy || closestY == dy && closestX > dx) { - closest = child; - closestRect = rect; - closestX = dx; - closestY = dy; - } - if (dx == 0) { - if (y > rect.bottom && (!aboveRect || aboveRect.bottom < rect.bottom)) { - above = child; - aboveRect = rect; - } else if (y < rect.top && (!belowRect || belowRect.top > rect.top)) { - below = child; - belowRect = rect; - } - } else if (aboveRect && yOverlap2(aboveRect, rect)) { - aboveRect = upBot2(aboveRect, rect.bottom); - } else if (belowRect && yOverlap2(belowRect, rect)) { - belowRect = upTop2(belowRect, rect.top); - } - } - } - if (aboveRect && aboveRect.bottom >= y) { - closest = above; - closestRect = aboveRect; - } else if (belowRect && belowRect.top <= y) { - closest = below; - closestRect = belowRect; - } - if (!closest) - return { node: parent, offset: 0 }; - let clipX = Math.max(closestRect.left, Math.min(closestRect.right, x)); - if (closest.nodeType == 3) - return domPosInText2(closest, clipX, y); - if (!closestX && closest.contentEditable == "true") - return domPosAtCoords2(closest, clipX, y); - let offset = Array.prototype.indexOf.call(parent.childNodes, closest) + (x >= (closestRect.left + closestRect.right) / 2 ? 1 : 0); - return { node: parent, offset }; - } - function domPosInText2(node, x, y) { - let len = node.nodeValue.length; - let closestOffset = -1, closestDY = 1e9, generalSide = 0; - for (let i = 0; i < len; i++) { - let rects = textRange2(node, i, i + 1).getClientRects(); - for (let j = 0; j < rects.length; j++) { - let rect = rects[j]; - if (rect.top == rect.bottom) - continue; - if (!generalSide) - generalSide = x - rect.left; - let dy = (rect.top > y ? rect.top - y : y - rect.bottom) - 1; - if (rect.left - 1 <= x && rect.right + 1 >= x && dy < closestDY) { - let right = x >= (rect.left + rect.right) / 2, after = right; - if (browser2.chrome || browser2.gecko) { - let rectBefore = textRange2(node, i).getBoundingClientRect(); - if (rectBefore.left == rect.right) - after = !right; - } - if (dy <= 0) - return { node, offset: i + (after ? 1 : 0) }; - closestOffset = i + (after ? 1 : 0); - closestDY = dy; - } - } - } - return { node, offset: closestOffset > -1 ? closestOffset : generalSide > 0 ? node.nodeValue.length : 0 }; - } - function posAtCoords2(view, { x, y }, precise, bias = -1) { - var _a4; - let content3 = view.contentDOM.getBoundingClientRect(), docTop = content3.top + view.viewState.paddingTop; - let block, { docHeight } = view.viewState; - let yOffset = y - docTop; - if (yOffset < 0) - return 0; - if (yOffset > docHeight) - return view.state.doc.length; - for (let halfLine = view.defaultLineHeight / 2, bounced = false; ; ) { - block = view.elementAtHeight(yOffset); - if (block.type == BlockType2.Text) - break; - for (; ; ) { - yOffset = bias > 0 ? block.bottom + halfLine : block.top - halfLine; - if (yOffset >= 0 && yOffset <= docHeight) - break; - if (bounced) - return precise ? null : 0; - bounced = true; - bias = -bias; - } - } - y = docTop + yOffset; - let lineStart = block.from; - if (lineStart < view.viewport.from) - return view.viewport.from == 0 ? 0 : precise ? null : posAtCoordsImprecise2(view, content3, block, x, y); - if (lineStart > view.viewport.to) - return view.viewport.to == view.state.doc.length ? view.state.doc.length : precise ? null : posAtCoordsImprecise2(view, content3, block, x, y); - let doc4 = view.dom.ownerDocument; - let root = view.root.elementFromPoint ? view.root : doc4; - let element = root.elementFromPoint(x, y); - if (element && !view.contentDOM.contains(element)) - element = null; - if (!element) { - x = Math.max(content3.left + 1, Math.min(content3.right - 1, x)); - element = root.elementFromPoint(x, y); - if (element && !view.contentDOM.contains(element)) - element = null; - } - let node, offset = -1; - if (element && ((_a4 = view.docView.nearest(element)) === null || _a4 === void 0 ? void 0 : _a4.isEditable) != false) { - if (doc4.caretPositionFromPoint) { - let pos = doc4.caretPositionFromPoint(x, y); - if (pos) - ({ offsetNode: node, offset } = pos); - } else if (doc4.caretRangeFromPoint) { - let range = doc4.caretRangeFromPoint(x, y); - if (range) { - ({ startContainer: node, startOffset: offset } = range); - if (browser2.safari && isSuspiciousCaretResult2(node, offset, x)) - node = void 0; - } - } - } - if (!node || !view.docView.dom.contains(node)) { - let line = LineView2.find(view.docView, lineStart); - if (!line) - return yOffset > block.top + block.height / 2 ? block.to : block.from; - ({ node, offset } = domPosAtCoords2(line.dom, x, y)); - } - return view.docView.posFromDOM(node, offset); - } - function posAtCoordsImprecise2(view, contentRect, block, x, y) { - let into = Math.round((x - contentRect.left) * view.defaultCharacterWidth); - if (view.lineWrapping && block.height > view.defaultLineHeight * 1.5) { - let line = Math.floor((y - block.top) / view.defaultLineHeight); - into += line * view.viewState.heightOracle.lineLength; - } - let content3 = view.state.sliceDoc(block.from, block.to); - return block.from + findColumn2(content3, into, view.state.tabSize); - } - function isSuspiciousCaretResult2(node, offset, x) { - let len; - if (node.nodeType != 3 || offset != (len = node.nodeValue.length)) - return false; - for (let next = node.nextSibling; next; next = next.nextSibling) - if (next.nodeType != 1 || next.nodeName != "BR") - return false; - return textRange2(node, len - 1, len).getBoundingClientRect().left > x; - } - function moveToLineBoundary2(view, start, forward, includeWrap) { - let line = view.state.doc.lineAt(start.head); - let coords = !includeWrap || !view.lineWrapping ? null : view.coordsAtPos(start.assoc < 0 && start.head > line.from ? start.head - 1 : start.head); - if (coords) { - let editorRect = view.dom.getBoundingClientRect(); - let direction = view.textDirectionAt(line.from); - let pos = view.posAtCoords({ - x: forward == (direction == Direction2.LTR) ? editorRect.right - 1 : editorRect.left + 1, - y: (coords.top + coords.bottom) / 2 - }); - if (pos != null) - return EditorSelection2.cursor(pos, forward ? -1 : 1); - } - let lineView = LineView2.find(view.docView, start.head); - let end = lineView ? forward ? lineView.posAtEnd : lineView.posAtStart : forward ? line.to : line.from; - return EditorSelection2.cursor(end, forward ? -1 : 1); - } - function moveByChar2(view, start, forward, by) { - let line = view.state.doc.lineAt(start.head), spans = view.bidiSpans(line); - let direction = view.textDirectionAt(line.from); - for (let cur2 = start, check = null; ; ) { - let next = moveVisually2(line, spans, direction, cur2, forward), char = movedOver2; - if (!next) { - if (line.number == (forward ? view.state.doc.lines : 1)) - return cur2; - char = "\n"; - line = view.state.doc.line(line.number + (forward ? 1 : -1)); - spans = view.bidiSpans(line); - next = EditorSelection2.cursor(forward ? line.from : line.to); - } - if (!check) { - if (!by) - return next; - check = by(char); - } else if (!check(char)) { - return cur2; - } - cur2 = next; - } - } - function byGroup2(view, pos, start) { - let categorize = view.state.charCategorizer(pos); - let cat = categorize(start); - return (next) => { - let nextCat = categorize(next); - if (cat == CharCategory2.Space) - cat = nextCat; - return cat == nextCat; - }; - } - function moveVertically2(view, start, forward, distance) { - let startPos = start.head, dir = forward ? 1 : -1; - if (startPos == (forward ? view.state.doc.length : 0)) - return EditorSelection2.cursor(startPos, start.assoc); - let goal = start.goalColumn, startY; - let rect = view.contentDOM.getBoundingClientRect(); - let startCoords = view.coordsAtPos(startPos), docTop = view.documentTop; - if (startCoords) { - if (goal == null) - goal = startCoords.left - rect.left; - startY = dir < 0 ? startCoords.top : startCoords.bottom; - } else { - let line = view.viewState.lineBlockAt(startPos); - if (goal == null) - goal = Math.min(rect.right - rect.left, view.defaultCharacterWidth * (startPos - line.from)); - startY = (dir < 0 ? line.top : line.bottom) + docTop; - } - let resolvedGoal = rect.left + goal; - let dist = distance !== null && distance !== void 0 ? distance : view.defaultLineHeight >> 1; - for (let extra = 0; ; extra += 10) { - let curY = startY + (dist + extra) * dir; - let pos = posAtCoords2(view, { x: resolvedGoal, y: curY }, false, dir); - if (curY < rect.top || curY > rect.bottom || (dir < 0 ? pos < startPos : pos > startPos)) - return EditorSelection2.cursor(pos, start.assoc, void 0, goal); - } - } - function skipAtoms2(view, oldPos, pos) { - let atoms = view.state.facet(atomicRanges).map((f) => f(view)); - for (; ; ) { - let moved = false; - for (let set of atoms) { - set.between(pos.from - 1, pos.from + 1, (from2, to, value) => { - if (pos.from > from2 && pos.from < to) { - pos = oldPos.from > pos.from ? EditorSelection2.cursor(from2, 1) : EditorSelection2.cursor(to, -1); - moved = true; - } - }); - } - if (!moved) - return pos; - } - } - var InputState2 = class { - constructor(view) { - this.lastKeyCode = 0; - this.lastKeyTime = 0; - this.pendingIOSKey = void 0; - this.lastSelectionOrigin = null; - this.lastSelectionTime = 0; - this.lastEscPress = 0; - this.lastContextMenu = 0; - this.scrollHandlers = []; - this.registeredEvents = []; - this.customHandlers = []; - this.composing = -1; - this.compositionFirstChange = null; - this.compositionEndedAt = 0; - this.rapidCompositionStart = false; - this.mouseSelection = null; - for (let type in handlers2) { - let handler = handlers2[type]; - view.contentDOM.addEventListener(type, (event) => { - if (!eventBelongsToEditor2(view, event) || this.ignoreDuringComposition(event)) - return; - if (type == "keydown" && this.keydown(view, event)) - return; - if (this.mustFlushObserver(event)) - view.observer.forceFlush(); - if (this.runCustomHandlers(type, view, event)) - event.preventDefault(); - else - handler(view, event); - }); - this.registeredEvents.push(type); - } - this.notifiedFocused = view.hasFocus; - if (browser2.safari) - view.contentDOM.addEventListener("input", () => null); - } - setSelectionOrigin(origin) { - this.lastSelectionOrigin = origin; - this.lastSelectionTime = Date.now(); - } - ensureHandlers(view, plugins) { - var _a4; - let handlers4; - for (let plugin of plugins) - if (handlers4 = (_a4 = plugin.update(view).spec) === null || _a4 === void 0 ? void 0 : _a4.domEventHandlers) { - this.customHandlers.push({ plugin: plugin.value, handlers: handlers4 }); - for (let type in handlers4) - if (this.registeredEvents.indexOf(type) < 0 && type != "scroll") { - this.registeredEvents.push(type); - view.contentDOM.addEventListener(type, (event) => { - if (!eventBelongsToEditor2(view, event)) - return; - if (this.runCustomHandlers(type, view, event)) - event.preventDefault(); - }); - } - } - } - runCustomHandlers(type, view, event) { - for (let set of this.customHandlers) { - let handler = set.handlers[type]; - if (handler) { - try { - if (handler.call(set.plugin, event, view) || event.defaultPrevented) - return true; - } catch (e) { - logException2(view.state, e); - } - } - } - return false; - } - runScrollHandlers(view, event) { - for (let set of this.customHandlers) { - let handler = set.handlers.scroll; - if (handler) { - try { - handler.call(set.plugin, event, view); - } catch (e) { - logException2(view.state, e); - } - } - } - } - keydown(view, event) { - this.lastKeyCode = event.keyCode; - this.lastKeyTime = Date.now(); - if (event.keyCode == 9 && Date.now() < this.lastEscPress + 2e3) - return true; - if (browser2.android && browser2.chrome && !event.synthetic && (event.keyCode == 13 || event.keyCode == 8)) { - view.observer.delayAndroidKey(event.key, event.keyCode); - return true; - } - let pending; - if (browser2.ios && (pending = PendingKeys2.find((key) => key.keyCode == event.keyCode)) && !(event.ctrlKey || event.altKey || event.metaKey) && !event.synthetic) { - this.pendingIOSKey = pending; - setTimeout(() => this.flushIOSKey(view), 250); - return true; - } - return false; - } - flushIOSKey(view) { - let key = this.pendingIOSKey; - if (!key) - return false; - this.pendingIOSKey = void 0; - return dispatchKey2(view.contentDOM, key.key, key.keyCode); - } - ignoreDuringComposition(event) { - if (!/^key/.test(event.type)) - return false; - if (this.composing > 0) - return true; - if (browser2.safari && Date.now() - this.compositionEndedAt < 100) { - this.compositionEndedAt = 0; - return true; - } - return false; - } - mustFlushObserver(event) { - return event.type == "keydown" && event.keyCode != 229 || event.type == "compositionend" && !browser2.ios; - } - startMouseSelection(mouseSelection) { - if (this.mouseSelection) - this.mouseSelection.destroy(); - this.mouseSelection = mouseSelection; - } - update(update) { - if (this.mouseSelection) - this.mouseSelection.update(update); - if (update.transactions.length) - this.lastKeyCode = this.lastSelectionTime = 0; - } - destroy() { - if (this.mouseSelection) - this.mouseSelection.destroy(); - } - }; - var PendingKeys2 = [ - { key: "Backspace", keyCode: 8, inputType: "deleteContentBackward" }, - { key: "Enter", keyCode: 13, inputType: "insertParagraph" }, - { key: "Delete", keyCode: 46, inputType: "deleteContentForward" } - ]; - var modifierCodes2 = [16, 17, 18, 20, 91, 92, 224, 225]; - var MouseSelection2 = class { - constructor(view, startEvent, style, mustSelect) { - this.view = view; - this.style = style; - this.mustSelect = mustSelect; - this.lastEvent = startEvent; - let doc4 = view.contentDOM.ownerDocument; - doc4.addEventListener("mousemove", this.move = this.move.bind(this)); - doc4.addEventListener("mouseup", this.up = this.up.bind(this)); - this.extend = startEvent.shiftKey; - this.multiple = view.state.facet(EditorState2.allowMultipleSelections) && addsSelectionRange2(view, startEvent); - this.dragMove = dragMovesSelection2(view, startEvent); - this.dragging = isInPrimarySelection2(view, startEvent) && getClickType2(startEvent) == 1 ? null : false; - if (this.dragging === false) { - startEvent.preventDefault(); - this.select(startEvent); - } - } - move(event) { - if (event.buttons == 0) - return this.destroy(); - if (this.dragging !== false) - return; - this.select(this.lastEvent = event); - } - up(event) { - if (this.dragging == null) - this.select(this.lastEvent); - if (!this.dragging) - event.preventDefault(); - this.destroy(); - } - destroy() { - let doc4 = this.view.contentDOM.ownerDocument; - doc4.removeEventListener("mousemove", this.move); - doc4.removeEventListener("mouseup", this.up); - this.view.inputState.mouseSelection = null; - } - select(event) { - let selection = this.style.get(event, this.extend, this.multiple); - if (this.mustSelect || !selection.eq(this.view.state.selection) || selection.main.assoc != this.view.state.selection.main.assoc) - this.view.dispatch({ - selection, - userEvent: "select.pointer", - scrollIntoView: true - }); - this.mustSelect = false; - } - update(update) { - if (update.docChanged && this.dragging) - this.dragging = this.dragging.map(update.changes); - if (this.style.update(update)) - setTimeout(() => this.select(this.lastEvent), 20); - } - }; - function addsSelectionRange2(view, event) { - let facet = view.state.facet(clickAddsSelectionRange2); - return facet.length ? facet[0](event) : browser2.mac ? event.metaKey : event.ctrlKey; - } - function dragMovesSelection2(view, event) { - let facet = view.state.facet(dragMovesSelection$12); - return facet.length ? facet[0](event) : browser2.mac ? !event.altKey : !event.ctrlKey; - } - function isInPrimarySelection2(view, event) { - let { main } = view.state.selection; - if (main.empty) - return false; - let sel = getSelection2(view.root); - if (sel.rangeCount == 0) - return true; - let rects = sel.getRangeAt(0).getClientRects(); - for (let i = 0; i < rects.length; i++) { - let rect = rects[i]; - if (rect.left <= event.clientX && rect.right >= event.clientX && rect.top <= event.clientY && rect.bottom >= event.clientY) - return true; - } - return false; - } - function eventBelongsToEditor2(view, event) { - if (!event.bubbles) - return true; - if (event.defaultPrevented) - return false; - for (let node = event.target, cView; node != view.contentDOM; node = node.parentNode) - if (!node || node.nodeType == 11 || (cView = ContentView2.get(node)) && cView.ignoreEvent(event)) - return false; - return true; - } - var handlers2 = /* @__PURE__ */ Object.create(null); - var brokenClipboardAPI2 = browser2.ie && browser2.ie_version < 15 || browser2.ios && browser2.webkit_version < 604; - function capturePaste2(view) { - let parent = view.dom.parentNode; - if (!parent) - return; - let target = parent.appendChild(document.createElement("textarea")); - target.style.cssText = "position: fixed; left: -10000px; top: 10px"; - target.focus(); - setTimeout(() => { - view.focus(); - target.remove(); - doPaste2(view, target.value); - }, 50); - } - function doPaste2(view, input) { - let { state } = view, changes, i = 1, text = state.toText(input); - let byLine = text.lines == state.selection.ranges.length; - let linewise = lastLinewiseCopy2 != null && state.selection.ranges.every((r) => r.empty) && lastLinewiseCopy2 == text.toString(); - if (linewise) { - let lastLine = -1; - changes = state.changeByRange((range) => { - let line = state.doc.lineAt(range.from); - if (line.from == lastLine) - return { range }; - lastLine = line.from; - let insert4 = state.toText((byLine ? text.line(i++).text : input) + state.lineBreak); - return { - changes: { from: line.from, insert: insert4 }, - range: EditorSelection2.cursor(range.from + insert4.length) - }; - }); - } else if (byLine) { - changes = state.changeByRange((range) => { - let line = text.line(i++); - return { - changes: { from: range.from, to: range.to, insert: line.text }, - range: EditorSelection2.cursor(range.from + line.length) - }; - }); - } else { - changes = state.replaceSelection(text); - } - view.dispatch(changes, { - userEvent: "input.paste", - scrollIntoView: true - }); - } - handlers2.keydown = (view, event) => { - view.inputState.setSelectionOrigin("select"); - if (event.keyCode == 27) - view.inputState.lastEscPress = Date.now(); - else if (modifierCodes2.indexOf(event.keyCode) < 0) - view.inputState.lastEscPress = 0; - }; - var lastTouch2 = 0; - handlers2.touchstart = (view, e) => { - lastTouch2 = Date.now(); - view.inputState.setSelectionOrigin("select.pointer"); - }; - handlers2.touchmove = (view) => { - view.inputState.setSelectionOrigin("select.pointer"); - }; - handlers2.mousedown = (view, event) => { - view.observer.flush(); - if (lastTouch2 > Date.now() - 2e3 && getClickType2(event) == 1) - return; - let style = null; - for (let makeStyle of view.state.facet(mouseSelectionStyle2)) { - style = makeStyle(view, event); - if (style) - break; - } - if (!style && event.button == 0) - style = basicMouseSelection2(view, event); - if (style) { - let mustFocus = view.root.activeElement != view.contentDOM; - if (mustFocus) - view.observer.ignore(() => focusPreventScroll2(view.contentDOM)); - view.inputState.startMouseSelection(new MouseSelection2(view, event, style, mustFocus)); - } - }; - function rangeForClick2(view, pos, bias, type) { - if (type == 1) { - return EditorSelection2.cursor(pos, bias); - } else if (type == 2) { - return groupAt2(view.state, pos, bias); - } else { - let visual = LineView2.find(view.docView, pos), line = view.state.doc.lineAt(visual ? visual.posAtEnd : pos); - let from2 = visual ? visual.posAtStart : line.from, to = visual ? visual.posAtEnd : line.to; - if (to < view.state.doc.length && to == line.to) - to++; - return EditorSelection2.range(from2, to); - } - } - var insideY2 = (y, rect) => y >= rect.top && y <= rect.bottom; - var inside2 = (x, y, rect) => insideY2(y, rect) && x >= rect.left && x <= rect.right; - function findPositionSide2(view, pos, x, y) { - let line = LineView2.find(view.docView, pos); - if (!line) - return 1; - let off = pos - line.posAtStart; - if (off == 0) - return 1; - if (off == line.length) - return -1; - let before = line.coordsAt(off, -1); - if (before && inside2(x, y, before)) - return -1; - let after = line.coordsAt(off, 1); - if (after && inside2(x, y, after)) - return 1; - return before && insideY2(y, before) ? -1 : 1; - } - function queryPos2(view, event) { - let pos = view.posAtCoords({ x: event.clientX, y: event.clientY }, false); - return { pos, bias: findPositionSide2(view, pos, event.clientX, event.clientY) }; - } - var BadMouseDetail2 = browser2.ie && browser2.ie_version <= 11; - var lastMouseDown2 = null; - var lastMouseDownCount2 = 0; - var lastMouseDownTime2 = 0; - function getClickType2(event) { - if (!BadMouseDetail2) - return event.detail; - let last = lastMouseDown2, lastTime = lastMouseDownTime2; - lastMouseDown2 = event; - lastMouseDownTime2 = Date.now(); - return lastMouseDownCount2 = !last || lastTime > Date.now() - 400 && Math.abs(last.clientX - event.clientX) < 2 && Math.abs(last.clientY - event.clientY) < 2 ? (lastMouseDownCount2 + 1) % 3 : 1; - } - function basicMouseSelection2(view, event) { - let start = queryPos2(view, event), type = getClickType2(event); - let startSel = view.state.selection; - let last = start, lastEvent = event; - return { - update(update) { - if (update.docChanged) { - if (start) - start.pos = update.changes.mapPos(start.pos); - startSel = startSel.map(update.changes); - lastEvent = null; - } - }, - get(event2, extend4, multiple) { - let cur2; - if (lastEvent && event2.clientX == lastEvent.clientX && event2.clientY == lastEvent.clientY) - cur2 = last; - else { - cur2 = last = queryPos2(view, event2); - lastEvent = event2; - } - if (!cur2 || !start) - return startSel; - let range = rangeForClick2(view, cur2.pos, cur2.bias, type); - if (start.pos != cur2.pos && !extend4) { - let startRange = rangeForClick2(view, start.pos, start.bias, type); - let from2 = Math.min(startRange.from, range.from), to = Math.max(startRange.to, range.to); - range = from2 < range.from ? EditorSelection2.range(from2, to) : EditorSelection2.range(to, from2); - } - if (extend4) - return startSel.replaceRange(startSel.main.extend(range.from, range.to)); - else if (multiple) - return startSel.addRange(range); - else - return EditorSelection2.create([range]); - } - }; - } - handlers2.dragstart = (view, event) => { - let { selection: { main } } = view.state; - let { mouseSelection } = view.inputState; - if (mouseSelection) - mouseSelection.dragging = main; - if (event.dataTransfer) { - event.dataTransfer.setData("Text", view.state.sliceDoc(main.from, main.to)); - event.dataTransfer.effectAllowed = "copyMove"; - } - }; - function dropText2(view, event, text, direct) { - if (!text) - return; - let dropPos = view.posAtCoords({ x: event.clientX, y: event.clientY }, false); - event.preventDefault(); - let { mouseSelection } = view.inputState; - let del = direct && mouseSelection && mouseSelection.dragging && mouseSelection.dragMove ? { from: mouseSelection.dragging.from, to: mouseSelection.dragging.to } : null; - let ins = { from: dropPos, insert: text }; - let changes = view.state.changes(del ? [del, ins] : ins); - view.focus(); - view.dispatch({ - changes, - selection: { anchor: changes.mapPos(dropPos, -1), head: changes.mapPos(dropPos, 1) }, - userEvent: del ? "move.drop" : "input.drop" - }); - } - handlers2.drop = (view, event) => { - if (!event.dataTransfer) - return; - if (view.state.readOnly) - return event.preventDefault(); - let files = event.dataTransfer.files; - if (files && files.length) { - event.preventDefault(); - let text = Array(files.length), read = 0; - let finishFile = () => { - if (++read == files.length) - dropText2(view, event, text.filter((s) => s != null).join(view.state.lineBreak), false); - }; - for (let i = 0; i < files.length; i++) { - let reader = new FileReader(); - reader.onerror = finishFile; - reader.onload = () => { - if (!/[\x00-\x08\x0e-\x1f]{2}/.test(reader.result)) - text[i] = reader.result; - finishFile(); - }; - reader.readAsText(files[i]); - } - } else { - dropText2(view, event, event.dataTransfer.getData("Text"), true); - } - }; - handlers2.paste = (view, event) => { - if (view.state.readOnly) - return event.preventDefault(); - view.observer.flush(); - let data = brokenClipboardAPI2 ? null : event.clipboardData; - if (data) { - doPaste2(view, data.getData("text/plain")); - event.preventDefault(); - } else { - capturePaste2(view); - } - }; - function captureCopy2(view, text) { - let parent = view.dom.parentNode; - if (!parent) - return; - let target = parent.appendChild(document.createElement("textarea")); - target.style.cssText = "position: fixed; left: -10000px; top: 10px"; - target.value = text; - target.focus(); - target.selectionEnd = text.length; - target.selectionStart = 0; - setTimeout(() => { - target.remove(); - view.focus(); - }, 50); - } - function copiedRange2(state) { - let content3 = [], ranges = [], linewise = false; - for (let range of state.selection.ranges) - if (!range.empty) { - content3.push(state.sliceDoc(range.from, range.to)); - ranges.push(range); - } - if (!content3.length) { - let upto = -1; - for (let { from: from2 } of state.selection.ranges) { - let line = state.doc.lineAt(from2); - if (line.number > upto) { - content3.push(line.text); - ranges.push({ from: line.from, to: Math.min(state.doc.length, line.to + 1) }); - } - upto = line.number; - } - linewise = true; - } - return { text: content3.join(state.lineBreak), ranges, linewise }; - } - var lastLinewiseCopy2 = null; - handlers2.copy = handlers2.cut = (view, event) => { - let { text, ranges, linewise } = copiedRange2(view.state); - if (!text && !linewise) - return; - lastLinewiseCopy2 = linewise ? text : null; - let data = brokenClipboardAPI2 ? null : event.clipboardData; - if (data) { - event.preventDefault(); - data.clearData(); - data.setData("text/plain", text); - } else { - captureCopy2(view, text); - } - if (event.type == "cut" && !view.state.readOnly) - view.dispatch({ - changes: ranges, - scrollIntoView: true, - userEvent: "delete.cut" - }); - }; - handlers2.focus = handlers2.blur = (view) => { - setTimeout(() => { - if (view.hasFocus != view.inputState.notifiedFocused) - view.update([]); - }, 10); - }; - function forceClearComposition2(view, rapid) { - if (view.docView.compositionDeco.size) { - view.inputState.rapidCompositionStart = rapid; - try { - view.update([]); - } finally { - view.inputState.rapidCompositionStart = false; - } - } - } - handlers2.compositionstart = handlers2.compositionupdate = (view) => { - if (view.inputState.compositionFirstChange == null) - view.inputState.compositionFirstChange = true; - if (view.inputState.composing < 0) { - view.inputState.composing = 0; - if (view.docView.compositionDeco.size) { - view.observer.flush(); - forceClearComposition2(view, true); - } - } - }; - handlers2.compositionend = (view) => { - view.inputState.composing = -1; - view.inputState.compositionEndedAt = Date.now(); - view.inputState.compositionFirstChange = null; - setTimeout(() => { - if (view.inputState.composing < 0) - forceClearComposition2(view, false); - }, 50); - }; - handlers2.contextmenu = (view) => { - view.inputState.lastContextMenu = Date.now(); - }; - handlers2.beforeinput = (view, event) => { - var _a4; - let pending; - if (browser2.chrome && browser2.android && (pending = PendingKeys2.find((key) => key.inputType == event.inputType))) { - view.observer.delayAndroidKey(pending.key, pending.keyCode); - if (pending.key == "Backspace" || pending.key == "Delete") { - let startViewHeight = ((_a4 = window.visualViewport) === null || _a4 === void 0 ? void 0 : _a4.height) || 0; - setTimeout(() => { - var _a5; - if ((((_a5 = window.visualViewport) === null || _a5 === void 0 ? void 0 : _a5.height) || 0) > startViewHeight + 10 && view.hasFocus) { - view.contentDOM.blur(); - view.focus(); - } - }, 100); - } - } - }; - var wrappingWhiteSpace2 = ["pre-wrap", "normal", "pre-line", "break-spaces"]; - var HeightOracle2 = class { - constructor() { - this.doc = Text2.empty; - this.lineWrapping = false; - this.heightSamples = {}; - this.lineHeight = 14; - this.charWidth = 7; - this.lineLength = 30; - this.heightChanged = false; - } - heightForGap(from2, to) { - let lines = this.doc.lineAt(to).number - this.doc.lineAt(from2).number + 1; - if (this.lineWrapping) - lines += Math.ceil((to - from2 - lines * this.lineLength * 0.5) / this.lineLength); - return this.lineHeight * lines; - } - heightForLine(length) { - if (!this.lineWrapping) - return this.lineHeight; - let lines = 1 + Math.max(0, Math.ceil((length - this.lineLength) / (this.lineLength - 5))); - return lines * this.lineHeight; - } - setDoc(doc4) { - this.doc = doc4; - return this; - } - mustRefreshForWrapping(whiteSpace) { - return wrappingWhiteSpace2.indexOf(whiteSpace) > -1 != this.lineWrapping; - } - mustRefreshForHeights(lineHeights) { - let newHeight = false; - for (let i = 0; i < lineHeights.length; i++) { - let h = lineHeights[i]; - if (h < 0) { - i++; - } else if (!this.heightSamples[Math.floor(h * 10)]) { - newHeight = true; - this.heightSamples[Math.floor(h * 10)] = true; - } - } - return newHeight; - } - refresh(whiteSpace, lineHeight, charWidth, lineLength, knownHeights) { - let lineWrapping = wrappingWhiteSpace2.indexOf(whiteSpace) > -1; - let changed = Math.round(lineHeight) != Math.round(this.lineHeight) || this.lineWrapping != lineWrapping; - this.lineWrapping = lineWrapping; - this.lineHeight = lineHeight; - this.charWidth = charWidth; - this.lineLength = lineLength; - if (changed) { - this.heightSamples = {}; - for (let i = 0; i < knownHeights.length; i++) { - let h = knownHeights[i]; - if (h < 0) - i++; - else - this.heightSamples[Math.floor(h * 10)] = true; - } - } - return changed; - } - }; - var MeasuredHeights2 = class { - constructor(from2, heights) { - this.from = from2; - this.heights = heights; - this.index = 0; - } - get more() { - return this.index < this.heights.length; - } - }; - var BlockInfo2 = class { - constructor(from2, length, top2, height, type) { - this.from = from2; - this.length = length; - this.top = top2; - this.height = height; - this.type = type; - } - get to() { - return this.from + this.length; - } - get bottom() { - return this.top + this.height; - } - join(other) { - let detail = (Array.isArray(this.type) ? this.type : [this]).concat(Array.isArray(other.type) ? other.type : [other]); - return new BlockInfo2(this.from, this.length + other.length, this.top, this.height + other.height, detail); - } - }; - var QueryType3 = /* @__PURE__ */ function(QueryType5) { - QueryType5[QueryType5["ByPos"] = 0] = "ByPos"; - QueryType5[QueryType5["ByHeight"] = 1] = "ByHeight"; - QueryType5[QueryType5["ByPosNoHeight"] = 2] = "ByPosNoHeight"; - return QueryType5; - }(QueryType3 || (QueryType3 = {})); - var Epsilon2 = 1e-3; - var HeightMap2 = class { - constructor(length, height, flags = 2) { - this.length = length; - this.height = height; - this.flags = flags; - } - get outdated() { - return (this.flags & 2) > 0; - } - set outdated(value) { - this.flags = (value ? 2 : 0) | this.flags & ~2; - } - setHeight(oracle, height) { - if (this.height != height) { - if (Math.abs(this.height - height) > Epsilon2) - oracle.heightChanged = true; - this.height = height; - } - } - replace(_from, _to, nodes) { - return HeightMap2.of(nodes); - } - decomposeLeft(_to, result) { - result.push(this); - } - decomposeRight(_from, result) { - result.push(this); - } - applyChanges(decorations4, oldDoc, oracle, changes) { - let me = this; - for (let i = changes.length - 1; i >= 0; i--) { - let { fromA, toA, fromB, toB } = changes[i]; - let start = me.lineAt(fromA, QueryType3.ByPosNoHeight, oldDoc, 0, 0); - let end = start.to >= toA ? start : me.lineAt(toA, QueryType3.ByPosNoHeight, oldDoc, 0, 0); - toB += end.to - toA; - toA = end.to; - while (i > 0 && start.from <= changes[i - 1].toA) { - fromA = changes[i - 1].fromA; - fromB = changes[i - 1].fromB; - i--; - if (fromA < start.from) - start = me.lineAt(fromA, QueryType3.ByPosNoHeight, oldDoc, 0, 0); - } - fromB += start.from - fromA; - fromA = start.from; - let nodes = NodeBuilder2.build(oracle, decorations4, fromB, toB); - me = me.replace(fromA, toA, nodes); - } - return me.updateHeight(oracle, 0); - } - static empty() { - return new HeightMapText2(0, 0); - } - static of(nodes) { - if (nodes.length == 1) - return nodes[0]; - let i = 0, j = nodes.length, before = 0, after = 0; - for (; ; ) { - if (i == j) { - if (before > after * 2) { - let split = nodes[i - 1]; - if (split.break) - nodes.splice(--i, 1, split.left, null, split.right); - else - nodes.splice(--i, 1, split.left, split.right); - j += 1 + split.break; - before -= split.size; - } else if (after > before * 2) { - let split = nodes[j]; - if (split.break) - nodes.splice(j, 1, split.left, null, split.right); - else - nodes.splice(j, 1, split.left, split.right); - j += 2 + split.break; - after -= split.size; - } else { - break; - } - } else if (before < after) { - let next = nodes[i++]; - if (next) - before += next.size; - } else { - let next = nodes[--j]; - if (next) - after += next.size; - } - } - let brk = 0; - if (nodes[i - 1] == null) { - brk = 1; - i--; - } else if (nodes[i] == null) { - brk = 1; - j++; - } - return new HeightMapBranch2(HeightMap2.of(nodes.slice(0, i)), brk, HeightMap2.of(nodes.slice(j))); - } - }; - HeightMap2.prototype.size = 1; - var HeightMapBlock2 = class extends HeightMap2 { - constructor(length, height, type) { - super(length, height); - this.type = type; - } - blockAt(_height, _doc, top2, offset) { - return new BlockInfo2(offset, this.length, top2, this.height, this.type); - } - lineAt(_value, _type, doc4, top2, offset) { - return this.blockAt(0, doc4, top2, offset); - } - forEachLine(from2, to, doc4, top2, offset, f) { - if (from2 <= offset + this.length && to >= offset) - f(this.blockAt(0, doc4, top2, offset)); - } - updateHeight(oracle, offset = 0, _force = false, measured) { - if (measured && measured.from <= offset && measured.more) - this.setHeight(oracle, measured.heights[measured.index++]); - this.outdated = false; - return this; - } - toString() { - return `block(${this.length})`; - } - }; - var HeightMapText2 = class extends HeightMapBlock2 { - constructor(length, height) { - super(length, height, BlockType2.Text); - this.collapsed = 0; - this.widgetHeight = 0; - } - replace(_from, _to, nodes) { - let node = nodes[0]; - if (nodes.length == 1 && (node instanceof HeightMapText2 || node instanceof HeightMapGap2 && node.flags & 4) && Math.abs(this.length - node.length) < 10) { - if (node instanceof HeightMapGap2) - node = new HeightMapText2(node.length, this.height); - else - node.height = this.height; - if (!this.outdated) - node.outdated = false; - return node; - } else { - return HeightMap2.of(nodes); - } - } - updateHeight(oracle, offset = 0, force = false, measured) { - if (measured && measured.from <= offset && measured.more) - this.setHeight(oracle, measured.heights[measured.index++]); - else if (force || this.outdated) - this.setHeight(oracle, Math.max(this.widgetHeight, oracle.heightForLine(this.length - this.collapsed))); - this.outdated = false; - return this; - } - toString() { - return `line(${this.length}${this.collapsed ? -this.collapsed : ""}${this.widgetHeight ? ":" + this.widgetHeight : ""})`; - } - }; - var HeightMapGap2 = class extends HeightMap2 { - constructor(length) { - super(length, 0); - } - lines(doc4, offset) { - let firstLine = doc4.lineAt(offset).number, lastLine = doc4.lineAt(offset + this.length).number; - return { firstLine, lastLine, lineHeight: this.height / (lastLine - firstLine + 1) }; - } - blockAt(height, doc4, top2, offset) { - let { firstLine, lastLine, lineHeight } = this.lines(doc4, offset); - let line = Math.max(0, Math.min(lastLine - firstLine, Math.floor((height - top2) / lineHeight))); - let { from: from2, length } = doc4.line(firstLine + line); - return new BlockInfo2(from2, length, top2 + lineHeight * line, lineHeight, BlockType2.Text); - } - lineAt(value, type, doc4, top2, offset) { - if (type == QueryType3.ByHeight) - return this.blockAt(value, doc4, top2, offset); - if (type == QueryType3.ByPosNoHeight) { - let { from: from3, to } = doc4.lineAt(value); - return new BlockInfo2(from3, to - from3, 0, 0, BlockType2.Text); - } - let { firstLine, lineHeight } = this.lines(doc4, offset); - let { from: from2, length, number: number3 } = doc4.lineAt(value); - return new BlockInfo2(from2, length, top2 + lineHeight * (number3 - firstLine), lineHeight, BlockType2.Text); - } - forEachLine(from2, to, doc4, top2, offset, f) { - let { firstLine, lineHeight } = this.lines(doc4, offset); - for (let pos = Math.max(from2, offset), end = Math.min(offset + this.length, to); pos <= end; ) { - let line = doc4.lineAt(pos); - if (pos == from2) - top2 += lineHeight * (line.number - firstLine); - f(new BlockInfo2(line.from, line.length, top2, lineHeight, BlockType2.Text)); - top2 += lineHeight; - pos = line.to + 1; - } - } - replace(from2, to, nodes) { - let after = this.length - to; - if (after > 0) { - let last = nodes[nodes.length - 1]; - if (last instanceof HeightMapGap2) - nodes[nodes.length - 1] = new HeightMapGap2(last.length + after); - else - nodes.push(null, new HeightMapGap2(after - 1)); - } - if (from2 > 0) { - let first = nodes[0]; - if (first instanceof HeightMapGap2) - nodes[0] = new HeightMapGap2(from2 + first.length); - else - nodes.unshift(new HeightMapGap2(from2 - 1), null); - } - return HeightMap2.of(nodes); - } - decomposeLeft(to, result) { - result.push(new HeightMapGap2(to - 1), null); - } - decomposeRight(from2, result) { - result.push(null, new HeightMapGap2(this.length - from2 - 1)); - } - updateHeight(oracle, offset = 0, force = false, measured) { - let end = offset + this.length; - if (measured && measured.from <= offset + this.length && measured.more) { - let nodes = [], pos = Math.max(offset, measured.from), singleHeight = -1; - let wasChanged = oracle.heightChanged; - if (measured.from > offset) - nodes.push(new HeightMapGap2(measured.from - offset - 1).updateHeight(oracle, offset)); - while (pos <= end && measured.more) { - let len = oracle.doc.lineAt(pos).length; - if (nodes.length) - nodes.push(null); - let height = measured.heights[measured.index++]; - if (singleHeight == -1) - singleHeight = height; - else if (Math.abs(height - singleHeight) >= Epsilon2) - singleHeight = -2; - let line = new HeightMapText2(len, height); - line.outdated = false; - nodes.push(line); - pos += len + 1; - } - if (pos <= end) - nodes.push(null, new HeightMapGap2(end - pos).updateHeight(oracle, pos)); - let result = HeightMap2.of(nodes); - oracle.heightChanged = wasChanged || singleHeight < 0 || Math.abs(result.height - this.height) >= Epsilon2 || Math.abs(singleHeight - this.lines(oracle.doc, offset).lineHeight) >= Epsilon2; - return result; - } else if (force || this.outdated) { - this.setHeight(oracle, oracle.heightForGap(offset, offset + this.length)); - this.outdated = false; - } - return this; - } - toString() { - return `gap(${this.length})`; - } - }; - var HeightMapBranch2 = class extends HeightMap2 { - constructor(left, brk, right) { - super(left.length + brk + right.length, left.height + right.height, brk | (left.outdated || right.outdated ? 2 : 0)); - this.left = left; - this.right = right; - this.size = left.size + right.size; - } - get break() { - return this.flags & 1; - } - blockAt(height, doc4, top2, offset) { - let mid = top2 + this.left.height; - return height < mid ? this.left.blockAt(height, doc4, top2, offset) : this.right.blockAt(height, doc4, mid, offset + this.left.length + this.break); - } - lineAt(value, type, doc4, top2, offset) { - let rightTop = top2 + this.left.height, rightOffset = offset + this.left.length + this.break; - let left = type == QueryType3.ByHeight ? value < rightTop : value < rightOffset; - let base2 = left ? this.left.lineAt(value, type, doc4, top2, offset) : this.right.lineAt(value, type, doc4, rightTop, rightOffset); - if (this.break || (left ? base2.to < rightOffset : base2.from > rightOffset)) - return base2; - let subQuery = type == QueryType3.ByPosNoHeight ? QueryType3.ByPosNoHeight : QueryType3.ByPos; - if (left) - return base2.join(this.right.lineAt(rightOffset, subQuery, doc4, rightTop, rightOffset)); - else - return this.left.lineAt(rightOffset, subQuery, doc4, top2, offset).join(base2); - } - forEachLine(from2, to, doc4, top2, offset, f) { - let rightTop = top2 + this.left.height, rightOffset = offset + this.left.length + this.break; - if (this.break) { - if (from2 < rightOffset) - this.left.forEachLine(from2, to, doc4, top2, offset, f); - if (to >= rightOffset) - this.right.forEachLine(from2, to, doc4, rightTop, rightOffset, f); - } else { - let mid = this.lineAt(rightOffset, QueryType3.ByPos, doc4, top2, offset); - if (from2 < mid.from) - this.left.forEachLine(from2, mid.from - 1, doc4, top2, offset, f); - if (mid.to >= from2 && mid.from <= to) - f(mid); - if (to > mid.to) - this.right.forEachLine(mid.to + 1, to, doc4, rightTop, rightOffset, f); - } - } - replace(from2, to, nodes) { - let rightStart = this.left.length + this.break; - if (to < rightStart) - return this.balanced(this.left.replace(from2, to, nodes), this.right); - if (from2 > this.left.length) - return this.balanced(this.left, this.right.replace(from2 - rightStart, to - rightStart, nodes)); - let result = []; - if (from2 > 0) - this.decomposeLeft(from2, result); - let left = result.length; - for (let node of nodes) - result.push(node); - if (from2 > 0) - mergeGaps2(result, left - 1); - if (to < this.length) { - let right = result.length; - this.decomposeRight(to, result); - mergeGaps2(result, right); - } - return HeightMap2.of(result); - } - decomposeLeft(to, result) { - let left = this.left.length; - if (to <= left) - return this.left.decomposeLeft(to, result); - result.push(this.left); - if (this.break) { - left++; - if (to >= left) - result.push(null); - } - if (to > left) - this.right.decomposeLeft(to - left, result); - } - decomposeRight(from2, result) { - let left = this.left.length, right = left + this.break; - if (from2 >= right) - return this.right.decomposeRight(from2 - right, result); - if (from2 < left) - this.left.decomposeRight(from2, result); - if (this.break && from2 < right) - result.push(null); - result.push(this.right); - } - balanced(left, right) { - if (left.size > 2 * right.size || right.size > 2 * left.size) - return HeightMap2.of(this.break ? [left, null, right] : [left, right]); - this.left = left; - this.right = right; - this.height = left.height + right.height; - this.outdated = left.outdated || right.outdated; - this.size = left.size + right.size; - this.length = left.length + this.break + right.length; - return this; - } - updateHeight(oracle, offset = 0, force = false, measured) { - let { left, right } = this, rightStart = offset + left.length + this.break, rebalance = null; - if (measured && measured.from <= offset + left.length && measured.more) - rebalance = left = left.updateHeight(oracle, offset, force, measured); - else - left.updateHeight(oracle, offset, force); - if (measured && measured.from <= rightStart + right.length && measured.more) - rebalance = right = right.updateHeight(oracle, rightStart, force, measured); - else - right.updateHeight(oracle, rightStart, force); - if (rebalance) - return this.balanced(left, right); - this.height = this.left.height + this.right.height; - this.outdated = false; - return this; - } - toString() { - return this.left + (this.break ? " " : "-") + this.right; - } - }; - function mergeGaps2(nodes, around) { - let before, after; - if (nodes[around] == null && (before = nodes[around - 1]) instanceof HeightMapGap2 && (after = nodes[around + 1]) instanceof HeightMapGap2) - nodes.splice(around - 1, 3, new HeightMapGap2(before.length + 1 + after.length)); - } - var relevantWidgetHeight2 = 5; - var NodeBuilder2 = class { - constructor(pos, oracle) { - this.pos = pos; - this.oracle = oracle; - this.nodes = []; - this.lineStart = -1; - this.lineEnd = -1; - this.covering = null; - this.writtenTo = pos; - } - get isCovered() { - return this.covering && this.nodes[this.nodes.length - 1] == this.covering; - } - span(_from, to) { - if (this.lineStart > -1) { - let end = Math.min(to, this.lineEnd), last = this.nodes[this.nodes.length - 1]; - if (last instanceof HeightMapText2) - last.length += end - this.pos; - else if (end > this.pos || !this.isCovered) - this.nodes.push(new HeightMapText2(end - this.pos, -1)); - this.writtenTo = end; - if (to > end) { - this.nodes.push(null); - this.writtenTo++; - this.lineStart = -1; - } - } - this.pos = to; - } - point(from2, to, deco) { - if (from2 < to || deco.heightRelevant) { - let height = deco.widget ? deco.widget.estimatedHeight : 0; - if (height < 0) - height = this.oracle.lineHeight; - let len = to - from2; - if (deco.block) { - this.addBlock(new HeightMapBlock2(len, height, deco.type)); - } else if (len || height >= relevantWidgetHeight2) { - this.addLineDeco(height, len); - } - } else if (to > from2) { - this.span(from2, to); - } - if (this.lineEnd > -1 && this.lineEnd < this.pos) - this.lineEnd = this.oracle.doc.lineAt(this.pos).to; - } - enterLine() { - if (this.lineStart > -1) - return; - let { from: from2, to } = this.oracle.doc.lineAt(this.pos); - this.lineStart = from2; - this.lineEnd = to; - if (this.writtenTo < from2) { - if (this.writtenTo < from2 - 1 || this.nodes[this.nodes.length - 1] == null) - this.nodes.push(this.blankContent(this.writtenTo, from2 - 1)); - this.nodes.push(null); - } - if (this.pos > from2) - this.nodes.push(new HeightMapText2(this.pos - from2, -1)); - this.writtenTo = this.pos; - } - blankContent(from2, to) { - let gap = new HeightMapGap2(to - from2); - if (this.oracle.doc.lineAt(from2).to == to) - gap.flags |= 4; - return gap; - } - ensureLine() { - this.enterLine(); - let last = this.nodes.length ? this.nodes[this.nodes.length - 1] : null; - if (last instanceof HeightMapText2) - return last; - let line = new HeightMapText2(0, -1); - this.nodes.push(line); - return line; - } - addBlock(block) { - this.enterLine(); - if (block.type == BlockType2.WidgetAfter && !this.isCovered) - this.ensureLine(); - this.nodes.push(block); - this.writtenTo = this.pos = this.pos + block.length; - if (block.type != BlockType2.WidgetBefore) - this.covering = block; - } - addLineDeco(height, length) { - let line = this.ensureLine(); - line.length += length; - line.collapsed += length; - line.widgetHeight = Math.max(line.widgetHeight, height); - this.writtenTo = this.pos = this.pos + length; - } - finish(from2) { - let last = this.nodes.length == 0 ? null : this.nodes[this.nodes.length - 1]; - if (this.lineStart > -1 && !(last instanceof HeightMapText2) && !this.isCovered) - this.nodes.push(new HeightMapText2(0, -1)); - else if (this.writtenTo < this.pos || last == null) - this.nodes.push(this.blankContent(this.writtenTo, this.pos)); - let pos = from2; - for (let node of this.nodes) { - if (node instanceof HeightMapText2) - node.updateHeight(this.oracle, pos); - pos += node ? node.length : 1; - } - return this.nodes; - } - static build(oracle, decorations4, from2, to) { - let builder = new NodeBuilder2(from2, oracle); - RangeSet2.spans(decorations4, from2, to, builder, 0); - return builder.finish(from2); - } - }; - function heightRelevantDecoChanges2(a, b, diff) { - let comp = new DecorationComparator2(); - RangeSet2.compare(a, b, diff, comp, 0); - return comp.changes; - } - var DecorationComparator2 = class { - constructor() { - this.changes = []; - } - compareRange() { - } - comparePoint(from2, to, a, b) { - if (from2 < to || a && a.heightRelevant || b && b.heightRelevant) - addRange2(from2, to, this.changes, 5); - } - }; - function visiblePixelRange2(dom, paddingTop) { - let rect = dom.getBoundingClientRect(); - let left = Math.max(0, rect.left), right = Math.min(innerWidth, rect.right); - let top2 = Math.max(0, rect.top), bottom = Math.min(innerHeight, rect.bottom); - let body = dom.ownerDocument.body; - for (let parent = dom.parentNode; parent && parent != body; ) { - if (parent.nodeType == 1) { - let elt = parent; - let style = window.getComputedStyle(elt); - if ((elt.scrollHeight > elt.clientHeight || elt.scrollWidth > elt.clientWidth) && style.overflow != "visible") { - let parentRect = elt.getBoundingClientRect(); - left = Math.max(left, parentRect.left); - right = Math.min(right, parentRect.right); - top2 = Math.max(top2, parentRect.top); - bottom = Math.min(bottom, parentRect.bottom); - } - parent = style.position == "absolute" || style.position == "fixed" ? elt.offsetParent : elt.parentNode; - } else if (parent.nodeType == 11) { - parent = parent.host; - } else { - break; - } - } - return { - left: left - rect.left, - right: Math.max(left, right) - rect.left, - top: top2 - (rect.top + paddingTop), - bottom: Math.max(top2, bottom) - (rect.top + paddingTop) - }; - } - function fullPixelRange2(dom, paddingTop) { - let rect = dom.getBoundingClientRect(); - return { - left: 0, - right: rect.right - rect.left, - top: paddingTop, - bottom: rect.bottom - (rect.top + paddingTop) - }; - } - var LineGap2 = class { - constructor(from2, to, size) { - this.from = from2; - this.to = to; - this.size = size; - } - static same(a, b) { - if (a.length != b.length) - return false; - for (let i = 0; i < a.length; i++) { - let gA = a[i], gB = b[i]; - if (gA.from != gB.from || gA.to != gB.to || gA.size != gB.size) - return false; - } - return true; - } - draw(wrapping) { - return Decoration2.replace({ widget: new LineGapWidget2(this.size, wrapping) }).range(this.from, this.to); - } - }; - var LineGapWidget2 = class extends WidgetType2 { - constructor(size, vertical) { - super(); - this.size = size; - this.vertical = vertical; - } - eq(other) { - return other.size == this.size && other.vertical == this.vertical; - } - toDOM() { - let elt = document.createElement("div"); - if (this.vertical) { - elt.style.height = this.size + "px"; - } else { - elt.style.width = this.size + "px"; - elt.style.height = "2px"; - elt.style.display = "inline-block"; - } - return elt; - } - get estimatedHeight() { - return this.vertical ? this.size : -1; - } - }; - var ViewState2 = class { - constructor(state) { - this.state = state; - this.pixelViewport = { left: 0, right: window.innerWidth, top: 0, bottom: 0 }; - this.inView = true; - this.paddingTop = 0; - this.paddingBottom = 0; - this.contentDOMWidth = 0; - this.contentDOMHeight = 0; - this.editorHeight = 0; - this.editorWidth = 0; - this.heightOracle = new HeightOracle2(); - this.scaler = IdScaler2; - this.scrollTarget = null; - this.printing = false; - this.mustMeasureContent = true; - this.defaultTextDirection = Direction2.RTL; - this.visibleRanges = []; - this.mustEnforceCursorAssoc = false; - this.stateDeco = state.facet(decorations2).filter((d) => typeof d != "function"); - this.heightMap = HeightMap2.empty().applyChanges(this.stateDeco, Text2.empty, this.heightOracle.setDoc(state.doc), [new ChangedRange2(0, 0, 0, state.doc.length)]); - this.viewport = this.getViewport(0, null); - this.updateViewportLines(); - this.updateForViewport(); - this.lineGaps = this.ensureLineGaps([]); - this.lineGapDeco = Decoration2.set(this.lineGaps.map((gap) => gap.draw(false))); - this.computeVisibleRanges(); - } - updateForViewport() { - let viewports = [this.viewport], { main } = this.state.selection; - for (let i = 0; i <= 1; i++) { - let pos = i ? main.head : main.anchor; - if (!viewports.some(({ from: from2, to }) => pos >= from2 && pos <= to)) { - let { from: from2, to } = this.lineBlockAt(pos); - viewports.push(new Viewport2(from2, to)); - } - } - this.viewports = viewports.sort((a, b) => a.from - b.from); - this.scaler = this.heightMap.height <= 7e6 ? IdScaler2 : new BigScaler2(this.heightOracle.doc, this.heightMap, this.viewports); - } - updateViewportLines() { - this.viewportLines = []; - this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.state.doc, 0, 0, (block) => { - this.viewportLines.push(this.scaler.scale == 1 ? block : scaleBlock2(block, this.scaler)); - }); - } - update(update, scrollTarget = null) { - this.state = update.state; - let prevDeco = this.stateDeco; - this.stateDeco = this.state.facet(decorations2).filter((d) => typeof d != "function"); - let contentChanges = update.changedRanges; - let heightChanges = ChangedRange2.extendWithRanges(contentChanges, heightRelevantDecoChanges2(prevDeco, this.stateDeco, update ? update.changes : ChangeSet2.empty(this.state.doc.length))); - let prevHeight = this.heightMap.height; - this.heightMap = this.heightMap.applyChanges(this.stateDeco, update.startState.doc, this.heightOracle.setDoc(this.state.doc), heightChanges); - if (this.heightMap.height != prevHeight) - update.flags |= 2; - let viewport = heightChanges.length ? this.mapViewport(this.viewport, update.changes) : this.viewport; - if (scrollTarget && (scrollTarget.range.head < viewport.from || scrollTarget.range.head > viewport.to) || !this.viewportIsAppropriate(viewport)) - viewport = this.getViewport(0, scrollTarget); - let updateLines = !update.changes.empty || update.flags & 2 || viewport.from != this.viewport.from || viewport.to != this.viewport.to; - this.viewport = viewport; - this.updateForViewport(); - if (updateLines) - this.updateViewportLines(); - if (this.lineGaps.length || this.viewport.to - this.viewport.from > 4e3) - this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps, update.changes))); - update.flags |= this.computeVisibleRanges(); - if (scrollTarget) - this.scrollTarget = scrollTarget; - if (!this.mustEnforceCursorAssoc && update.selectionSet && update.view.lineWrapping && update.state.selection.main.empty && update.state.selection.main.assoc) - this.mustEnforceCursorAssoc = true; - } - measure(view) { - let dom = view.contentDOM, style = window.getComputedStyle(dom); - let oracle = this.heightOracle; - let whiteSpace = style.whiteSpace; - this.defaultTextDirection = style.direction == "rtl" ? Direction2.RTL : Direction2.LTR; - let refresh = this.heightOracle.mustRefreshForWrapping(whiteSpace); - let measureContent = refresh || this.mustMeasureContent || this.contentDOMHeight != dom.clientHeight; - let result = 0, bias = 0; - if (this.editorWidth != view.scrollDOM.clientWidth) { - if (oracle.lineWrapping) - measureContent = true; - this.editorWidth = view.scrollDOM.clientWidth; - result |= 8; - } - if (measureContent) { - this.mustMeasureContent = false; - this.contentDOMHeight = dom.clientHeight; - let paddingTop = parseInt(style.paddingTop) || 0, paddingBottom = parseInt(style.paddingBottom) || 0; - if (this.paddingTop != paddingTop || this.paddingBottom != paddingBottom) { - result |= 8; - this.paddingTop = paddingTop; - this.paddingBottom = paddingBottom; - } - } - let pixelViewport = (this.printing ? fullPixelRange2 : visiblePixelRange2)(dom, this.paddingTop); - let dTop = pixelViewport.top - this.pixelViewport.top, dBottom = pixelViewport.bottom - this.pixelViewport.bottom; - this.pixelViewport = pixelViewport; - let inView = this.pixelViewport.bottom > this.pixelViewport.top && this.pixelViewport.right > this.pixelViewport.left; - if (inView != this.inView) { - this.inView = inView; - if (inView) - measureContent = true; - } - if (!this.inView) - return 0; - let contentWidth = dom.clientWidth; - if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) { - this.contentDOMWidth = contentWidth; - this.editorHeight = view.scrollDOM.clientHeight; - result |= 8; - } - if (measureContent) { - let lineHeights = view.docView.measureVisibleLineHeights(this.viewport); - if (oracle.mustRefreshForHeights(lineHeights)) - refresh = true; - if (refresh || oracle.lineWrapping && Math.abs(contentWidth - this.contentDOMWidth) > oracle.charWidth) { - let { lineHeight, charWidth } = view.docView.measureTextSize(); - refresh = oracle.refresh(whiteSpace, lineHeight, charWidth, contentWidth / charWidth, lineHeights); - if (refresh) { - view.docView.minWidth = 0; - result |= 8; - } - } - if (dTop > 0 && dBottom > 0) - bias = Math.max(dTop, dBottom); - else if (dTop < 0 && dBottom < 0) - bias = Math.min(dTop, dBottom); - oracle.heightChanged = false; - for (let vp of this.viewports) { - let heights = vp.from == this.viewport.from ? lineHeights : view.docView.measureVisibleLineHeights(vp); - this.heightMap = this.heightMap.updateHeight(oracle, 0, refresh, new MeasuredHeights2(vp.from, heights)); - } - if (oracle.heightChanged) - result |= 2; - } - let viewportChange = !this.viewportIsAppropriate(this.viewport, bias) || this.scrollTarget && (this.scrollTarget.range.head < this.viewport.from || this.scrollTarget.range.head > this.viewport.to); - if (viewportChange) - this.viewport = this.getViewport(bias, this.scrollTarget); - this.updateForViewport(); - if (result & 2 || viewportChange) - this.updateViewportLines(); - if (this.lineGaps.length || this.viewport.to - this.viewport.from > 4e3) - this.updateLineGaps(this.ensureLineGaps(refresh ? [] : this.lineGaps)); - result |= this.computeVisibleRanges(); - if (this.mustEnforceCursorAssoc) { - this.mustEnforceCursorAssoc = false; - view.docView.enforceCursorAssoc(); - } - return result; - } - get visibleTop() { - return this.scaler.fromDOM(this.pixelViewport.top); - } - get visibleBottom() { - return this.scaler.fromDOM(this.pixelViewport.bottom); - } - getViewport(bias, scrollTarget) { - let marginTop = 0.5 - Math.max(-0.5, Math.min(0.5, bias / 1e3 / 2)); - let map = this.heightMap, doc4 = this.state.doc, { visibleTop, visibleBottom } = this; - let viewport = new Viewport2(map.lineAt(visibleTop - marginTop * 1e3, QueryType3.ByHeight, doc4, 0, 0).from, map.lineAt(visibleBottom + (1 - marginTop) * 1e3, QueryType3.ByHeight, doc4, 0, 0).to); - if (scrollTarget) { - let { head } = scrollTarget.range; - if (head < viewport.from || head > viewport.to) { - let viewHeight = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top); - let block = map.lineAt(head, QueryType3.ByPos, doc4, 0, 0), topPos; - if (scrollTarget.y == "center") - topPos = (block.top + block.bottom) / 2 - viewHeight / 2; - else if (scrollTarget.y == "start" || scrollTarget.y == "nearest" && head < viewport.from) - topPos = block.top; - else - topPos = block.bottom - viewHeight; - viewport = new Viewport2(map.lineAt(topPos - 1e3 / 2, QueryType3.ByHeight, doc4, 0, 0).from, map.lineAt(topPos + viewHeight + 1e3 / 2, QueryType3.ByHeight, doc4, 0, 0).to); - } - } - return viewport; - } - mapViewport(viewport, changes) { - let from2 = changes.mapPos(viewport.from, -1), to = changes.mapPos(viewport.to, 1); - return new Viewport2(this.heightMap.lineAt(from2, QueryType3.ByPos, this.state.doc, 0, 0).from, this.heightMap.lineAt(to, QueryType3.ByPos, this.state.doc, 0, 0).to); - } - viewportIsAppropriate({ from: from2, to }, bias = 0) { - if (!this.inView) - return true; - let { top: top2 } = this.heightMap.lineAt(from2, QueryType3.ByPos, this.state.doc, 0, 0); - let { bottom } = this.heightMap.lineAt(to, QueryType3.ByPos, this.state.doc, 0, 0); - let { visibleTop, visibleBottom } = this; - return (from2 == 0 || top2 <= visibleTop - Math.max(10, Math.min(-bias, 250))) && (to == this.state.doc.length || bottom >= visibleBottom + Math.max(10, Math.min(bias, 250))) && (top2 > visibleTop - 2 * 1e3 && bottom < visibleBottom + 2 * 1e3); - } - mapLineGaps(gaps, changes) { - if (!gaps.length || changes.empty) - return gaps; - let mapped = []; - for (let gap of gaps) - if (!changes.touchesRange(gap.from, gap.to)) - mapped.push(new LineGap2(changes.mapPos(gap.from), changes.mapPos(gap.to), gap.size)); - return mapped; - } - ensureLineGaps(current) { - let gaps = []; - if (this.defaultTextDirection != Direction2.LTR) - return gaps; - for (let line of this.viewportLines) { - if (line.length < 4e3) - continue; - let structure = lineStructure2(line.from, line.to, this.stateDeco); - if (structure.total < 4e3) - continue; - let viewFrom, viewTo; - if (this.heightOracle.lineWrapping) { - let marginHeight = 2e3 / this.heightOracle.lineLength * this.heightOracle.lineHeight; - viewFrom = findPosition2(structure, (this.visibleTop - line.top - marginHeight) / line.height); - viewTo = findPosition2(structure, (this.visibleBottom - line.top + marginHeight) / line.height); - } else { - let totalWidth = structure.total * this.heightOracle.charWidth; - let marginWidth = 2e3 * this.heightOracle.charWidth; - viewFrom = findPosition2(structure, (this.pixelViewport.left - marginWidth) / totalWidth); - viewTo = findPosition2(structure, (this.pixelViewport.right + marginWidth) / totalWidth); - } - let outside = []; - if (viewFrom > line.from) - outside.push({ from: line.from, to: viewFrom }); - if (viewTo < line.to) - outside.push({ from: viewTo, to: line.to }); - let sel = this.state.selection.main; - if (sel.from >= line.from && sel.from <= line.to) - cutRange2(outside, sel.from - 10, sel.from + 10); - if (!sel.empty && sel.to >= line.from && sel.to <= line.to) - cutRange2(outside, sel.to - 10, sel.to + 10); - for (let { from: from2, to } of outside) - if (to - from2 > 1e3) { - gaps.push(find2(current, (gap) => gap.from >= line.from && gap.to <= line.to && Math.abs(gap.from - from2) < 1e3 && Math.abs(gap.to - to) < 1e3) || new LineGap2(from2, to, this.gapSize(line, from2, to, structure))); - } - } - return gaps; - } - gapSize(line, from2, to, structure) { - let fraction = findFraction2(structure, to) - findFraction2(structure, from2); - if (this.heightOracle.lineWrapping) { - return line.height * fraction; - } else { - return structure.total * this.heightOracle.charWidth * fraction; - } - } - updateLineGaps(gaps) { - if (!LineGap2.same(gaps, this.lineGaps)) { - this.lineGaps = gaps; - this.lineGapDeco = Decoration2.set(gaps.map((gap) => gap.draw(this.heightOracle.lineWrapping))); - } - } - computeVisibleRanges() { - let deco = this.stateDeco; - if (this.lineGaps.length) - deco = deco.concat(this.lineGapDeco); - let ranges = []; - RangeSet2.spans(deco, this.viewport.from, this.viewport.to, { - span(from2, to) { - ranges.push({ from: from2, to }); - }, - point() { - } - }, 20); - let changed = ranges.length != this.visibleRanges.length || this.visibleRanges.some((r, i) => r.from != ranges[i].from || r.to != ranges[i].to); - this.visibleRanges = ranges; - return changed ? 4 : 0; - } - lineBlockAt(pos) { - return pos >= this.viewport.from && pos <= this.viewport.to && this.viewportLines.find((b) => b.from <= pos && b.to >= pos) || scaleBlock2(this.heightMap.lineAt(pos, QueryType3.ByPos, this.state.doc, 0, 0), this.scaler); - } - lineBlockAtHeight(height) { - return scaleBlock2(this.heightMap.lineAt(this.scaler.fromDOM(height), QueryType3.ByHeight, this.state.doc, 0, 0), this.scaler); - } - elementAtHeight(height) { - return scaleBlock2(this.heightMap.blockAt(this.scaler.fromDOM(height), this.state.doc, 0, 0), this.scaler); - } - get docHeight() { - return this.scaler.toDOM(this.heightMap.height); - } - get contentHeight() { - return this.docHeight + this.paddingTop + this.paddingBottom; - } - }; - var Viewport2 = class { - constructor(from2, to) { - this.from = from2; - this.to = to; - } - }; - function lineStructure2(from2, to, stateDeco) { - let ranges = [], pos = from2, total = 0; - RangeSet2.spans(stateDeco, from2, to, { - span() { - }, - point(from3, to2) { - if (from3 > pos) { - ranges.push({ from: pos, to: from3 }); - total += from3 - pos; - } - pos = to2; - } - }, 20); - if (pos < to) { - ranges.push({ from: pos, to }); - total += to - pos; - } - return { total, ranges }; - } - function findPosition2({ total, ranges }, ratio) { - if (ratio <= 0) - return ranges[0].from; - if (ratio >= 1) - return ranges[ranges.length - 1].to; - let dist = Math.floor(total * ratio); - for (let i = 0; ; i++) { - let { from: from2, to } = ranges[i], size = to - from2; - if (dist <= size) - return from2 + dist; - dist -= size; - } - } - function findFraction2(structure, pos) { - let counted = 0; - for (let { from: from2, to } of structure.ranges) { - if (pos <= to) { - counted += pos - from2; - break; - } - counted += to - from2; - } - return counted / structure.total; - } - function cutRange2(ranges, from2, to) { - for (let i = 0; i < ranges.length; i++) { - let r = ranges[i]; - if (r.from < to && r.to > from2) { - let pieces = []; - if (r.from < from2) - pieces.push({ from: r.from, to: from2 }); - if (r.to > to) - pieces.push({ from: to, to: r.to }); - ranges.splice(i, 1, ...pieces); - i += pieces.length - 1; - } - } - } - function find2(array2, f) { - for (let val of array2) - if (f(val)) - return val; - return void 0; - } - var IdScaler2 = { - toDOM(n) { - return n; - }, - fromDOM(n) { - return n; - }, - scale: 1 - }; - var BigScaler2 = class { - constructor(doc4, heightMap, viewports) { - let vpHeight = 0, base2 = 0, domBase = 0; - this.viewports = viewports.map(({ from: from2, to }) => { - let top2 = heightMap.lineAt(from2, QueryType3.ByPos, doc4, 0, 0).top; - let bottom = heightMap.lineAt(to, QueryType3.ByPos, doc4, 0, 0).bottom; - vpHeight += bottom - top2; - return { from: from2, to, top: top2, bottom, domTop: 0, domBottom: 0 }; - }); - this.scale = (7e6 - vpHeight) / (heightMap.height - vpHeight); - for (let obj of this.viewports) { - obj.domTop = domBase + (obj.top - base2) * this.scale; - domBase = obj.domBottom = obj.domTop + (obj.bottom - obj.top); - base2 = obj.bottom; - } - } - toDOM(n) { - for (let i = 0, base2 = 0, domBase = 0; ; i++) { - let vp = i < this.viewports.length ? this.viewports[i] : null; - if (!vp || n < vp.top) - return domBase + (n - base2) * this.scale; - if (n <= vp.bottom) - return vp.domTop + (n - vp.top); - base2 = vp.bottom; - domBase = vp.domBottom; - } - } - fromDOM(n) { - for (let i = 0, base2 = 0, domBase = 0; ; i++) { - let vp = i < this.viewports.length ? this.viewports[i] : null; - if (!vp || n < vp.domTop) - return base2 + (n - domBase) / this.scale; - if (n <= vp.domBottom) - return vp.top + (n - vp.domTop); - base2 = vp.bottom; - domBase = vp.domBottom; - } - } - }; - function scaleBlock2(block, scaler) { - if (scaler.scale == 1) - return block; - let bTop = scaler.toDOM(block.top), bBottom = scaler.toDOM(block.bottom); - return new BlockInfo2(block.from, block.length, bTop, bBottom - bTop, Array.isArray(block.type) ? block.type.map((b) => scaleBlock2(b, scaler)) : block.type); - } - var theme2 = /* @__PURE__ */ Facet2.define({ combine: (strs) => strs.join(" ") }); - var darkTheme2 = /* @__PURE__ */ Facet2.define({ combine: (values2) => values2.indexOf(true) > -1 }); - var baseThemeID2 = /* @__PURE__ */ StyleModule.newName(); - var baseLightID2 = /* @__PURE__ */ StyleModule.newName(); - var baseDarkID2 = /* @__PURE__ */ StyleModule.newName(); - var lightDarkIDs2 = { "&light": "." + baseLightID2, "&dark": "." + baseDarkID2 }; - function buildTheme2(main, spec, scopes) { - return new StyleModule(spec, { - finish(sel) { - return /&/.test(sel) ? sel.replace(/&\w*/, (m) => { - if (m == "&") - return main; - if (!scopes || !scopes[m]) - throw new RangeError(`Unsupported selector: ${m}`); - return scopes[m]; - }) : main + " " + sel; - } - }); - } - var baseTheme$12 = /* @__PURE__ */ buildTheme2("." + baseThemeID2, { - "&.cm-editor": { - position: "relative !important", - boxSizing: "border-box", - "&.cm-focused": { - outline: "1px dotted #212121" - }, - display: "flex !important", - flexDirection: "column" - }, - ".cm-scroller": { - display: "flex !important", - alignItems: "flex-start !important", - fontFamily: "monospace", - lineHeight: 1.4, - height: "100%", - overflowX: "auto", - position: "relative", - zIndex: 0 - }, - ".cm-content": { - margin: 0, - flexGrow: 2, - minHeight: "100%", - display: "block", - whiteSpace: "pre", - wordWrap: "normal", - boxSizing: "border-box", - padding: "4px 0", - outline: "none", - "&[contenteditable=true]": { - WebkitUserModify: "read-write-plaintext-only" - } - }, - ".cm-lineWrapping": { - whiteSpace_fallback: "pre-wrap", - whiteSpace: "break-spaces", - wordBreak: "break-word", - overflowWrap: "anywhere" - }, - "&light .cm-content": { caretColor: "black" }, - "&dark .cm-content": { caretColor: "white" }, - ".cm-line": { - display: "block", - padding: "0 2px 0 4px" - }, - ".cm-selectionLayer": { - zIndex: -1, - contain: "size style" - }, - ".cm-selectionBackground": { - position: "absolute" - }, - "&light .cm-selectionBackground": { - background: "#d9d9d9" - }, - "&dark .cm-selectionBackground": { - background: "#222" - }, - "&light.cm-focused .cm-selectionBackground": { - background: "#d7d4f0" - }, - "&dark.cm-focused .cm-selectionBackground": { - background: "#233" - }, - ".cm-cursorLayer": { - zIndex: 100, - contain: "size style", - pointerEvents: "none" - }, - "&.cm-focused .cm-cursorLayer": { - animation: "steps(1) cm-blink 1.2s infinite" - }, - "@keyframes cm-blink": { "0%": {}, "50%": { visibility: "hidden" }, "100%": {} }, - "@keyframes cm-blink2": { "0%": {}, "50%": { visibility: "hidden" }, "100%": {} }, - ".cm-cursor, .cm-dropCursor": { - position: "absolute", - borderLeft: "1.2px solid black", - marginLeft: "-0.6px", - pointerEvents: "none" - }, - ".cm-cursor": { - display: "none" - }, - "&dark .cm-cursor": { - borderLeftColor: "#444" - }, - "&.cm-focused .cm-cursor": { - display: "block" - }, - "&light .cm-activeLine": { backgroundColor: "#f3f9ff" }, - "&dark .cm-activeLine": { backgroundColor: "#223039" }, - "&light .cm-specialChar": { color: "red" }, - "&dark .cm-specialChar": { color: "#f78" }, - ".cm-gutters": { - display: "flex", - height: "100%", - boxSizing: "border-box", - left: 0, - zIndex: 200 - }, - "&light .cm-gutters": { - backgroundColor: "#f5f5f5", - color: "#6c6c6c", - borderRight: "1px solid #ddd" - }, - "&dark .cm-gutters": { - backgroundColor: "#333338", - color: "#ccc" - }, - ".cm-gutter": { - display: "flex !important", - flexDirection: "column", - flexShrink: 0, - boxSizing: "border-box", - minHeight: "100%", - overflow: "hidden" - }, - ".cm-gutterElement": { - boxSizing: "border-box" - }, - ".cm-lineNumbers .cm-gutterElement": { - padding: "0 3px 0 5px", - minWidth: "20px", - textAlign: "right", - whiteSpace: "nowrap" - }, - "&light .cm-activeLineGutter": { - backgroundColor: "#e2f2ff" - }, - "&dark .cm-activeLineGutter": { - backgroundColor: "#222227" - }, - ".cm-panels": { - boxSizing: "border-box", - position: "sticky", - left: 0, - right: 0 - }, - "&light .cm-panels": { - backgroundColor: "#f5f5f5", - color: "black" - }, - "&light .cm-panels-top": { - borderBottom: "1px solid #ddd" - }, - "&light .cm-panels-bottom": { - borderTop: "1px solid #ddd" - }, - "&dark .cm-panels": { - backgroundColor: "#333338", - color: "white" - }, - ".cm-tab": { - display: "inline-block", - overflow: "hidden", - verticalAlign: "bottom" - }, - ".cm-widgetBuffer": { - verticalAlign: "text-top", - height: "1em", - display: "inline" - }, - ".cm-placeholder": { - color: "#888", - display: "inline-block", - verticalAlign: "top" - }, - ".cm-button": { - verticalAlign: "middle", - color: "inherit", - fontSize: "70%", - padding: ".2em 1em", - borderRadius: "1px" - }, - "&light .cm-button": { - backgroundImage: "linear-gradient(#eff1f5, #d9d9df)", - border: "1px solid #888", - "&:active": { - backgroundImage: "linear-gradient(#b4b4b4, #d0d3d6)" - } - }, - "&dark .cm-button": { - backgroundImage: "linear-gradient(#393939, #111)", - border: "1px solid #888", - "&:active": { - backgroundImage: "linear-gradient(#111, #333)" - } - }, - ".cm-textfield": { - verticalAlign: "middle", - color: "inherit", - fontSize: "70%", - border: "1px solid silver", - padding: ".2em .5em" - }, - "&light .cm-textfield": { - backgroundColor: "white" - }, - "&dark .cm-textfield": { - border: "1px solid #555", - backgroundColor: "inherit" - } - }, lightDarkIDs2); - var observeOptions2 = { - childList: true, - characterData: true, - subtree: true, - attributes: true, - characterDataOldValue: true - }; - var useCharData2 = browser2.ie && browser2.ie_version <= 11; - var DOMObserver2 = class { - constructor(view, onChange, onScrollChanged) { - this.view = view; - this.onChange = onChange; - this.onScrollChanged = onScrollChanged; - this.active = false; - this.selectionRange = new DOMSelectionState2(); - this.selectionChanged = false; - this.delayedFlush = -1; - this.resizeTimeout = -1; - this.queue = []; - this.delayedAndroidKey = null; - this.scrollTargets = []; - this.intersection = null; - this.resize = null; - this.intersecting = false; - this.gapIntersection = null; - this.gaps = []; - this.parentCheck = -1; - this.dom = view.contentDOM; - this.observer = new MutationObserver((mutations) => { - for (let mut of mutations) - this.queue.push(mut); - if ((browser2.ie && browser2.ie_version <= 11 || browser2.ios && view.composing) && mutations.some((m) => m.type == "childList" && m.removedNodes.length || m.type == "characterData" && m.oldValue.length > m.target.nodeValue.length)) - this.flushSoon(); - else - this.flush(); - }); - if (useCharData2) - this.onCharData = (event) => { - this.queue.push({ - target: event.target, - type: "characterData", - oldValue: event.prevValue - }); - this.flushSoon(); - }; - this.onSelectionChange = this.onSelectionChange.bind(this); - window.addEventListener("resize", this.onResize = this.onResize.bind(this)); - if (typeof ResizeObserver == "function") { - this.resize = new ResizeObserver(() => { - if (this.view.docView.lastUpdate < Date.now() - 75) - this.onResize(); - }); - this.resize.observe(view.scrollDOM); - } - window.addEventListener("beforeprint", this.onPrint = this.onPrint.bind(this)); - this.start(); - window.addEventListener("scroll", this.onScroll = this.onScroll.bind(this)); - if (typeof IntersectionObserver == "function") { - this.intersection = new IntersectionObserver((entries) => { - if (this.parentCheck < 0) - this.parentCheck = setTimeout(this.listenForScroll.bind(this), 1e3); - if (entries.length > 0 && entries[entries.length - 1].intersectionRatio > 0 != this.intersecting) { - this.intersecting = !this.intersecting; - if (this.intersecting != this.view.inView) - this.onScrollChanged(document.createEvent("Event")); - } - }, {}); - this.intersection.observe(this.dom); - this.gapIntersection = new IntersectionObserver((entries) => { - if (entries.length > 0 && entries[entries.length - 1].intersectionRatio > 0) - this.onScrollChanged(document.createEvent("Event")); - }, {}); - } - this.listenForScroll(); - this.readSelectionRange(); - this.dom.ownerDocument.addEventListener("selectionchange", this.onSelectionChange); - } - onScroll(e) { - if (this.intersecting) - this.flush(false); - this.onScrollChanged(e); - } - onResize() { - if (this.resizeTimeout < 0) - this.resizeTimeout = setTimeout(() => { - this.resizeTimeout = -1; - this.view.requestMeasure(); - }, 50); - } - onPrint() { - this.view.viewState.printing = true; - this.view.measure(); - setTimeout(() => { - this.view.viewState.printing = false; - this.view.requestMeasure(); - }, 500); - } - updateGaps(gaps) { - if (this.gapIntersection && (gaps.length != this.gaps.length || this.gaps.some((g, i) => g != gaps[i]))) { - this.gapIntersection.disconnect(); - for (let gap of gaps) - this.gapIntersection.observe(gap); - this.gaps = gaps; - } - } - onSelectionChange(event) { - if (!this.readSelectionRange() || this.delayedAndroidKey) - return; - let { view } = this, sel = this.selectionRange; - if (view.state.facet(editable2) ? view.root.activeElement != this.dom : !hasSelection2(view.dom, sel)) - return; - let context = sel.anchorNode && view.docView.nearest(sel.anchorNode); - if (context && context.ignoreEvent(event)) - return; - if ((browser2.ie && browser2.ie_version <= 11 || browser2.android && browser2.chrome) && !view.state.selection.main.empty && sel.focusNode && isEquivalentPosition2(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset)) - this.flushSoon(); - else - this.flush(false); - } - readSelectionRange() { - let { root } = this.view, domSel = getSelection2(root); - let range = browser2.safari && root.nodeType == 11 && deepActiveElement2() == this.view.contentDOM && safariSelectionRangeHack2(this.view) || domSel; - if (this.selectionRange.eq(range)) - return false; - this.selectionRange.setRange(range); - return this.selectionChanged = true; - } - setSelectionRange(anchor, head) { - this.selectionRange.set(anchor.node, anchor.offset, head.node, head.offset); - this.selectionChanged = false; - } - listenForScroll() { - this.parentCheck = -1; - let i = 0, changed = null; - for (let dom = this.dom; dom; ) { - if (dom.nodeType == 1) { - if (!changed && i < this.scrollTargets.length && this.scrollTargets[i] == dom) - i++; - else if (!changed) - changed = this.scrollTargets.slice(0, i); - if (changed) - changed.push(dom); - dom = dom.assignedSlot || dom.parentNode; - } else if (dom.nodeType == 11) { - dom = dom.host; - } else { - break; - } - } - if (i < this.scrollTargets.length && !changed) - changed = this.scrollTargets.slice(0, i); - if (changed) { - for (let dom of this.scrollTargets) - dom.removeEventListener("scroll", this.onScroll); - for (let dom of this.scrollTargets = changed) - dom.addEventListener("scroll", this.onScroll); - } - } - ignore(f) { - if (!this.active) - return f(); - try { - this.stop(); - return f(); - } finally { - this.start(); - this.clear(); - } - } - start() { - if (this.active) - return; - this.observer.observe(this.dom, observeOptions2); - if (useCharData2) - this.dom.addEventListener("DOMCharacterDataModified", this.onCharData); - this.active = true; - } - stop() { - if (!this.active) - return; - this.active = false; - this.observer.disconnect(); - if (useCharData2) - this.dom.removeEventListener("DOMCharacterDataModified", this.onCharData); - } - clear() { - this.processRecords(); - this.queue.length = 0; - this.selectionChanged = false; - } - delayAndroidKey(key, keyCode) { - if (!this.delayedAndroidKey) - requestAnimationFrame(() => { - let key2 = this.delayedAndroidKey; - this.delayedAndroidKey = null; - let startState = this.view.state; - this.readSelectionRange(); - if (dispatchKey2(this.view.contentDOM, key2.key, key2.keyCode)) - this.processRecords(); - else - this.flush(); - if (this.view.state == startState) - this.view.update([]); - }); - if (!this.delayedAndroidKey || key == "Enter") - this.delayedAndroidKey = { key, keyCode }; - } - flushSoon() { - if (this.delayedFlush < 0) - this.delayedFlush = window.setTimeout(() => { - this.delayedFlush = -1; - this.flush(); - }, 20); - } - forceFlush() { - if (this.delayedFlush >= 0) { - window.clearTimeout(this.delayedFlush); - this.delayedFlush = -1; - this.flush(); - } - } - processRecords() { - let records = this.queue; - for (let mut of this.observer.takeRecords()) - records.push(mut); - if (records.length) - this.queue = []; - let from2 = -1, to = -1, typeOver = false; - for (let record of records) { - let range = this.readMutation(record); - if (!range) - continue; - if (range.typeOver) - typeOver = true; - if (from2 == -1) { - ({ from: from2, to } = range); - } else { - from2 = Math.min(range.from, from2); - to = Math.max(range.to, to); - } - } - return { from: from2, to, typeOver }; - } - flush(readSelection = true) { - if (this.delayedFlush >= 0 || this.delayedAndroidKey) - return; - if (readSelection) - this.readSelectionRange(); - let { from: from2, to, typeOver } = this.processRecords(); - let newSel = this.selectionChanged && hasSelection2(this.dom, this.selectionRange); - if (from2 < 0 && !newSel) - return; - this.selectionChanged = false; - let startState = this.view.state; - this.onChange(from2, to, typeOver); - if (this.view.state == startState) - this.view.update([]); - } - readMutation(rec) { - let cView = this.view.docView.nearest(rec.target); - if (!cView || cView.ignoreMutation(rec)) - return null; - cView.markDirty(rec.type == "attributes"); - if (rec.type == "attributes") - cView.dirty |= 4; - if (rec.type == "childList") { - let childBefore = findChild2(cView, rec.previousSibling || rec.target.previousSibling, -1); - let childAfter = findChild2(cView, rec.nextSibling || rec.target.nextSibling, 1); - return { - from: childBefore ? cView.posAfter(childBefore) : cView.posAtStart, - to: childAfter ? cView.posBefore(childAfter) : cView.posAtEnd, - typeOver: false - }; - } else if (rec.type == "characterData") { - return { from: cView.posAtStart, to: cView.posAtEnd, typeOver: rec.target.nodeValue == rec.oldValue }; - } else { - return null; - } - } - destroy() { - var _a4, _b, _c; - this.stop(); - (_a4 = this.intersection) === null || _a4 === void 0 ? void 0 : _a4.disconnect(); - (_b = this.gapIntersection) === null || _b === void 0 ? void 0 : _b.disconnect(); - (_c = this.resize) === null || _c === void 0 ? void 0 : _c.disconnect(); - for (let dom of this.scrollTargets) - dom.removeEventListener("scroll", this.onScroll); - window.removeEventListener("scroll", this.onScroll); - window.removeEventListener("resize", this.onResize); - window.removeEventListener("beforeprint", this.onPrint); - this.dom.ownerDocument.removeEventListener("selectionchange", this.onSelectionChange); - clearTimeout(this.parentCheck); - clearTimeout(this.resizeTimeout); - } - }; - function findChild2(cView, dom, dir) { - while (dom) { - let curView = ContentView2.get(dom); - if (curView && curView.parent == cView) - return curView; - let parent = dom.parentNode; - dom = parent != cView.dom ? parent : dir > 0 ? dom.nextSibling : dom.previousSibling; - } - return null; - } - function safariSelectionRangeHack2(view) { - let found = null; - function read(event) { - event.preventDefault(); - event.stopImmediatePropagation(); - found = event.getTargetRanges()[0]; - } - view.contentDOM.addEventListener("beforeinput", read, true); - document.execCommand("indent"); - view.contentDOM.removeEventListener("beforeinput", read, true); - if (!found) - return null; - let anchorNode = found.startContainer, anchorOffset = found.startOffset; - let focusNode = found.endContainer, focusOffset = found.endOffset; - let curAnchor = view.docView.domAtPos(view.state.selection.main.anchor); - if (isEquivalentPosition2(curAnchor.node, curAnchor.offset, focusNode, focusOffset)) - [anchorNode, anchorOffset, focusNode, focusOffset] = [focusNode, focusOffset, anchorNode, anchorOffset]; - return { anchorNode, anchorOffset, focusNode, focusOffset }; - } - function applyDOMChange2(view, start, end, typeOver) { - let change, newSel; - let sel = view.state.selection.main; - if (start > -1) { - let bounds = view.docView.domBoundsAround(start, end, 0); - if (!bounds || view.state.readOnly) - return; - let { from: from2, to } = bounds; - let selPoints = view.docView.impreciseHead || view.docView.impreciseAnchor ? [] : selectionPoints2(view); - let reader = new DOMReader2(selPoints, view.state); - reader.readRange(bounds.startDOM, bounds.endDOM); - let preferredPos = sel.from, preferredSide = null; - if (view.inputState.lastKeyCode === 8 && view.inputState.lastKeyTime > Date.now() - 100 || browser2.android && reader.text.length < to - from2) { - preferredPos = sel.to; - preferredSide = "end"; - } - let diff = findDiff2(view.state.doc.sliceString(from2, to, LineBreakPlaceholder2), reader.text, preferredPos - from2, preferredSide); - if (diff) { - if (browser2.chrome && view.inputState.lastKeyCode == 13 && diff.toB == diff.from + 2 && reader.text.slice(diff.from, diff.toB) == LineBreakPlaceholder2 + LineBreakPlaceholder2) - diff.toB--; - change = { - from: from2 + diff.from, - to: from2 + diff.toA, - insert: Text2.of(reader.text.slice(diff.from, diff.toB).split(LineBreakPlaceholder2)) - }; - } - newSel = selectionFromPoints2(selPoints, from2); - } else if (view.hasFocus || !view.state.facet(editable2)) { - let domSel = view.observer.selectionRange; - let { impreciseHead: iHead, impreciseAnchor: iAnchor } = view.docView; - let head = iHead && iHead.node == domSel.focusNode && iHead.offset == domSel.focusOffset || !contains2(view.contentDOM, domSel.focusNode) ? view.state.selection.main.head : view.docView.posFromDOM(domSel.focusNode, domSel.focusOffset); - let anchor = iAnchor && iAnchor.node == domSel.anchorNode && iAnchor.offset == domSel.anchorOffset || !contains2(view.contentDOM, domSel.anchorNode) ? view.state.selection.main.anchor : view.docView.posFromDOM(domSel.anchorNode, domSel.anchorOffset); - if (head != sel.head || anchor != sel.anchor) - newSel = EditorSelection2.single(anchor, head); - } - if (!change && !newSel) - return; - if (!change && typeOver && !sel.empty && newSel && newSel.main.empty) - change = { from: sel.from, to: sel.to, insert: view.state.doc.slice(sel.from, sel.to) }; - else if (change && change.from >= sel.from && change.to <= sel.to && (change.from != sel.from || change.to != sel.to) && sel.to - sel.from - (change.to - change.from) <= 4) - change = { - from: sel.from, - to: sel.to, - insert: view.state.doc.slice(sel.from, change.from).append(change.insert).append(view.state.doc.slice(change.to, sel.to)) - }; - if (change) { - let startState = view.state; - if (browser2.ios && view.inputState.flushIOSKey(view)) - return; - if (browser2.android && (change.from == sel.from && change.to == sel.to && change.insert.length == 1 && change.insert.lines == 2 && dispatchKey2(view.contentDOM, "Enter", 13) || change.from == sel.from - 1 && change.to == sel.to && change.insert.length == 0 && dispatchKey2(view.contentDOM, "Backspace", 8) || change.from == sel.from && change.to == sel.to + 1 && change.insert.length == 0 && dispatchKey2(view.contentDOM, "Delete", 46))) - return; - let text = change.insert.toString(); - if (view.state.facet(inputHandler3).some((h) => h(view, change.from, change.to, text))) - return; - if (view.inputState.composing >= 0) - view.inputState.composing++; - let tr; - if (change.from >= sel.from && change.to <= sel.to && change.to - change.from >= (sel.to - sel.from) / 3 && (!newSel || newSel.main.empty && newSel.main.from == change.from + change.insert.length) && view.inputState.composing < 0) { - let before = sel.from < change.from ? startState.sliceDoc(sel.from, change.from) : ""; - let after = sel.to > change.to ? startState.sliceDoc(change.to, sel.to) : ""; - tr = startState.replaceSelection(view.state.toText(before + change.insert.sliceString(0, void 0, view.state.lineBreak) + after)); - } else { - let changes = startState.changes(change); - let mainSel = newSel && !startState.selection.main.eq(newSel.main) && newSel.main.to <= changes.newLength ? newSel.main : void 0; - if (startState.selection.ranges.length > 1 && view.inputState.composing >= 0 && change.to <= sel.to && change.to >= sel.to - 10) { - let replaced = view.state.sliceDoc(change.from, change.to); - let compositionRange = compositionSurroundingNode2(view) || view.state.doc.lineAt(sel.head); - let offset = sel.to - change.to, size = sel.to - sel.from; - tr = startState.changeByRange((range) => { - if (range.from == sel.from && range.to == sel.to) - return { changes, range: mainSel || range.map(changes) }; - let to = range.to - offset, from2 = to - replaced.length; - if (range.to - range.from != size || view.state.sliceDoc(from2, to) != replaced || compositionRange && range.to >= compositionRange.from && range.from <= compositionRange.to) - return { range }; - let rangeChanges = startState.changes({ from: from2, to, insert: change.insert }), selOff = range.to - sel.to; - return { - changes: rangeChanges, - range: !mainSel ? range.map(rangeChanges) : EditorSelection2.range(Math.max(0, mainSel.anchor + selOff), Math.max(0, mainSel.head + selOff)) - }; - }); - } else { - tr = { - changes, - selection: mainSel && startState.selection.replaceRange(mainSel) - }; - } - } - let userEvent = "input.type"; - if (view.composing) { - userEvent += ".compose"; - if (view.inputState.compositionFirstChange) { - userEvent += ".start"; - view.inputState.compositionFirstChange = false; - } - } - view.dispatch(tr, { scrollIntoView: true, userEvent }); - } else if (newSel && !newSel.main.eq(sel)) { - let scrollIntoView5 = false, userEvent = "select"; - if (view.inputState.lastSelectionTime > Date.now() - 50) { - if (view.inputState.lastSelectionOrigin == "select") - scrollIntoView5 = true; - userEvent = view.inputState.lastSelectionOrigin; - } - view.dispatch({ selection: newSel, scrollIntoView: scrollIntoView5, userEvent }); - } - } - function findDiff2(a, b, preferredPos, preferredSide) { - let minLen = Math.min(a.length, b.length); - let from2 = 0; - while (from2 < minLen && a.charCodeAt(from2) == b.charCodeAt(from2)) - from2++; - if (from2 == minLen && a.length == b.length) - return null; - let toA = a.length, toB = b.length; - while (toA > 0 && toB > 0 && a.charCodeAt(toA - 1) == b.charCodeAt(toB - 1)) { - toA--; - toB--; - } - if (preferredSide == "end") { - let adjust = Math.max(0, from2 - Math.min(toA, toB)); - preferredPos -= toA + adjust - from2; - } - if (toA < from2 && a.length < b.length) { - let move = preferredPos <= from2 && preferredPos >= toA ? from2 - preferredPos : 0; - from2 -= move; - toB = from2 + (toB - toA); - toA = from2; - } else if (toB < from2) { - let move = preferredPos <= from2 && preferredPos >= toB ? from2 - preferredPos : 0; - from2 -= move; - toA = from2 + (toA - toB); - toB = from2; - } - return { from: from2, toA, toB }; - } - function selectionPoints2(view) { - let result = []; - if (view.root.activeElement != view.contentDOM) - return result; - let { anchorNode, anchorOffset, focusNode, focusOffset } = view.observer.selectionRange; - if (anchorNode) { - result.push(new DOMPoint2(anchorNode, anchorOffset)); - if (focusNode != anchorNode || focusOffset != anchorOffset) - result.push(new DOMPoint2(focusNode, focusOffset)); - } - return result; - } - function selectionFromPoints2(points, base2) { - if (points.length == 0) - return null; - let anchor = points[0].pos, head = points.length == 2 ? points[1].pos : anchor; - return anchor > -1 && head > -1 ? EditorSelection2.single(anchor + base2, head + base2) : null; - } - var EditorView2 = class { - constructor(config2 = {}) { - this.plugins = []; - this.pluginMap = /* @__PURE__ */ new Map(); - this.editorAttrs = {}; - this.contentAttrs = {}; - this.bidiCache = []; - this.destroyed = false; - this.updateState = 2; - this.measureScheduled = -1; - this.measureRequests = []; - this.contentDOM = document.createElement("div"); - this.scrollDOM = document.createElement("div"); - this.scrollDOM.tabIndex = -1; - this.scrollDOM.className = "cm-scroller"; - this.scrollDOM.appendChild(this.contentDOM); - this.announceDOM = document.createElement("div"); - this.announceDOM.style.cssText = "position: absolute; top: -10000px"; - this.announceDOM.setAttribute("aria-live", "polite"); - this.dom = document.createElement("div"); - this.dom.appendChild(this.announceDOM); - this.dom.appendChild(this.scrollDOM); - this._dispatch = config2.dispatch || ((tr) => this.update([tr])); - this.dispatch = this.dispatch.bind(this); - this.root = config2.root || getRoot2(config2.parent) || document; - this.viewState = new ViewState2(config2.state || EditorState2.create()); - this.plugins = this.state.facet(viewPlugin2).map((spec) => new PluginInstance2(spec)); - for (let plugin of this.plugins) - plugin.update(this); - this.observer = new DOMObserver2(this, (from2, to, typeOver) => { - applyDOMChange2(this, from2, to, typeOver); - }, (event) => { - this.inputState.runScrollHandlers(this, event); - if (this.observer.intersecting) - this.measure(); - }); - this.inputState = new InputState2(this); - this.inputState.ensureHandlers(this, this.plugins); - this.docView = new DocView2(this); - this.mountStyles(); - this.updateAttrs(); - this.updateState = 0; - this.requestMeasure(); - if (config2.parent) - config2.parent.appendChild(this.dom); - } - get state() { - return this.viewState.state; - } - get viewport() { - return this.viewState.viewport; - } - get visibleRanges() { - return this.viewState.visibleRanges; - } - get inView() { - return this.viewState.inView; - } - get composing() { - return this.inputState.composing > 0; - } - get compositionStarted() { - return this.inputState.composing >= 0; - } - dispatch(...input) { - this._dispatch(input.length == 1 && input[0] instanceof Transaction2 ? input[0] : this.state.update(...input)); - } - update(transactions) { - if (this.updateState != 0) - throw new Error("Calls to EditorView.update are not allowed while an update is in progress"); - let redrawn = false, update; - let state = this.state; - for (let tr of transactions) { - if (tr.startState != state) - throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state."); - state = tr.state; - } - if (this.destroyed) { - this.viewState.state = state; - return; - } - if (state.facet(EditorState2.phrases) != this.state.facet(EditorState2.phrases)) - return this.setState(state); - update = new ViewUpdate2(this, state, transactions); - let scrollTarget = this.viewState.scrollTarget; - try { - this.updateState = 2; - for (let tr of transactions) { - if (scrollTarget) - scrollTarget = scrollTarget.map(tr.changes); - if (tr.scrollIntoView) { - let { main } = tr.state.selection; - scrollTarget = new ScrollTarget2(main.empty ? main : EditorSelection2.cursor(main.head, main.head > main.anchor ? -1 : 1)); - } - for (let e of tr.effects) - if (e.is(scrollIntoView3)) - scrollTarget = e.value; - } - this.viewState.update(update, scrollTarget); - this.bidiCache = CachedOrder2.update(this.bidiCache, update.changes); - if (!update.empty) { - this.updatePlugins(update); - this.inputState.update(update); - } - redrawn = this.docView.update(update); - if (this.state.facet(styleModule2) != this.styleModules) - this.mountStyles(); - this.updateAttrs(); - this.showAnnouncements(transactions); - this.docView.updateSelection(redrawn, transactions.some((tr) => tr.isUserEvent("select.pointer"))); - } finally { - this.updateState = 0; - } - if (update.startState.facet(theme2) != update.state.facet(theme2)) - this.viewState.mustMeasureContent = true; - if (redrawn || scrollTarget || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent) - this.requestMeasure(); - if (!update.empty) - for (let listener of this.state.facet(updateListener2)) - listener(update); - } - setState(newState) { - if (this.updateState != 0) - throw new Error("Calls to EditorView.setState are not allowed while an update is in progress"); - if (this.destroyed) { - this.viewState.state = newState; - return; - } - this.updateState = 2; - let hadFocus = this.hasFocus; - try { - for (let plugin of this.plugins) - plugin.destroy(this); - this.viewState = new ViewState2(newState); - this.plugins = newState.facet(viewPlugin2).map((spec) => new PluginInstance2(spec)); - this.pluginMap.clear(); - for (let plugin of this.plugins) - plugin.update(this); - this.docView = new DocView2(this); - this.inputState.ensureHandlers(this, this.plugins); - this.mountStyles(); - this.updateAttrs(); - this.bidiCache = []; - } finally { - this.updateState = 0; - } - if (hadFocus) - this.focus(); - this.requestMeasure(); - } - updatePlugins(update) { - let prevSpecs = update.startState.facet(viewPlugin2), specs = update.state.facet(viewPlugin2); - if (prevSpecs != specs) { - let newPlugins = []; - for (let spec of specs) { - let found = prevSpecs.indexOf(spec); - if (found < 0) { - newPlugins.push(new PluginInstance2(spec)); - } else { - let plugin = this.plugins[found]; - plugin.mustUpdate = update; - newPlugins.push(plugin); - } - } - for (let plugin of this.plugins) - if (plugin.mustUpdate != update) - plugin.destroy(this); - this.plugins = newPlugins; - this.pluginMap.clear(); - this.inputState.ensureHandlers(this, this.plugins); - } else { - for (let p of this.plugins) - p.mustUpdate = update; - } - for (let i = 0; i < this.plugins.length; i++) - this.plugins[i].update(this); - } - measure(flush = true) { - if (this.destroyed) - return; - if (this.measureScheduled > -1) - cancelAnimationFrame(this.measureScheduled); - this.measureScheduled = 0; - if (flush) - this.observer.flush(); - let updated = null; - try { - for (let i = 0; ; i++) { - this.updateState = 1; - let oldViewport = this.viewport; - let changed = this.viewState.measure(this); - if (!changed && !this.measureRequests.length && this.viewState.scrollTarget == null) - break; - if (i > 5) { - console.warn(this.measureRequests.length ? "Measure loop restarted more than 5 times" : "Viewport failed to stabilize"); - break; - } - let measuring = []; - if (!(changed & 4)) - [this.measureRequests, measuring] = [measuring, this.measureRequests]; - let measured = measuring.map((m) => { - try { - return m.read(this); - } catch (e) { - logException2(this.state, e); - return BadMeasure2; - } - }); - let update = new ViewUpdate2(this, this.state), redrawn = false, scrolled = false; - update.flags |= changed; - if (!updated) - updated = update; - else - updated.flags |= changed; - this.updateState = 2; - if (!update.empty) { - this.updatePlugins(update); - this.inputState.update(update); - this.updateAttrs(); - redrawn = this.docView.update(update); - } - for (let i2 = 0; i2 < measuring.length; i2++) - if (measured[i2] != BadMeasure2) { - try { - let m = measuring[i2]; - if (m.write) - m.write(measured[i2], this); - } catch (e) { - logException2(this.state, e); - } - } - if (this.viewState.scrollTarget) { - this.docView.scrollIntoView(this.viewState.scrollTarget); - this.viewState.scrollTarget = null; - scrolled = true; - } - if (redrawn) - this.docView.updateSelection(true); - if (this.viewport.from == oldViewport.from && this.viewport.to == oldViewport.to && !scrolled && this.measureRequests.length == 0) - break; - } - } finally { - this.updateState = 0; - this.measureScheduled = -1; - } - if (updated && !updated.empty) - for (let listener of this.state.facet(updateListener2)) - listener(updated); - } - get themeClasses() { - return baseThemeID2 + " " + (this.state.facet(darkTheme2) ? baseDarkID2 : baseLightID2) + " " + this.state.facet(theme2); - } - updateAttrs() { - let editorAttrs = attrsFromFacet2(this, editorAttributes2, { - class: "cm-editor" + (this.hasFocus ? " cm-focused " : " ") + this.themeClasses - }); - let contentAttrs = { - spellcheck: "false", - autocorrect: "off", - autocapitalize: "off", - translate: "no", - contenteditable: !this.state.facet(editable2) ? "false" : "true", - class: "cm-content", - style: `${browser2.tabSize}: ${this.state.tabSize}`, - role: "textbox", - "aria-multiline": "true" - }; - if (this.state.readOnly) - contentAttrs["aria-readonly"] = "true"; - attrsFromFacet2(this, contentAttributes2, contentAttrs); - this.observer.ignore(() => { - updateAttrs2(this.contentDOM, this.contentAttrs, contentAttrs); - updateAttrs2(this.dom, this.editorAttrs, editorAttrs); - }); - this.editorAttrs = editorAttrs; - this.contentAttrs = contentAttrs; - } - showAnnouncements(trs) { - let first = true; - for (let tr of trs) - for (let effect of tr.effects) - if (effect.is(EditorView2.announce)) { - if (first) - this.announceDOM.textContent = ""; - first = false; - let div = this.announceDOM.appendChild(document.createElement("div")); - div.textContent = effect.value; - } - } - mountStyles() { - this.styleModules = this.state.facet(styleModule2); - StyleModule.mount(this.root, this.styleModules.concat(baseTheme$12).reverse()); - } - readMeasured() { - if (this.updateState == 2) - throw new Error("Reading the editor layout isn't allowed during an update"); - if (this.updateState == 0 && this.measureScheduled > -1) - this.measure(false); - } - requestMeasure(request) { - if (this.measureScheduled < 0) - this.measureScheduled = requestAnimationFrame(() => this.measure()); - if (request) { - if (request.key != null) - for (let i = 0; i < this.measureRequests.length; i++) { - if (this.measureRequests[i].key === request.key) { - this.measureRequests[i] = request; - return; - } - } - this.measureRequests.push(request); - } - } - plugin(plugin) { - let known = this.pluginMap.get(plugin); - if (known === void 0 || known && known.spec != plugin) - this.pluginMap.set(plugin, known = this.plugins.find((p) => p.spec == plugin) || null); - return known && known.update(this).value; - } - get documentTop() { - return this.contentDOM.getBoundingClientRect().top + this.viewState.paddingTop; - } - get documentPadding() { - return { top: this.viewState.paddingTop, bottom: this.viewState.paddingBottom }; - } - elementAtHeight(height) { - this.readMeasured(); - return this.viewState.elementAtHeight(height); - } - lineBlockAtHeight(height) { - this.readMeasured(); - return this.viewState.lineBlockAtHeight(height); - } - get viewportLineBlocks() { - return this.viewState.viewportLines; - } - lineBlockAt(pos) { - return this.viewState.lineBlockAt(pos); - } - get contentHeight() { - return this.viewState.contentHeight; - } - moveByChar(start, forward, by) { - return skipAtoms2(this, start, moveByChar2(this, start, forward, by)); - } - moveByGroup(start, forward) { - return skipAtoms2(this, start, moveByChar2(this, start, forward, (initial) => byGroup2(this, start.head, initial))); - } - moveToLineBoundary(start, forward, includeWrap = true) { - return moveToLineBoundary2(this, start, forward, includeWrap); - } - moveVertically(start, forward, distance) { - return skipAtoms2(this, start, moveVertically2(this, start, forward, distance)); - } - domAtPos(pos) { - return this.docView.domAtPos(pos); - } - posAtDOM(node, offset = 0) { - return this.docView.posFromDOM(node, offset); - } - posAtCoords(coords, precise = true) { - this.readMeasured(); - return posAtCoords2(this, coords, precise); - } - coordsAtPos(pos, side = 1) { - this.readMeasured(); - let rect = this.docView.coordsAt(pos, side); - if (!rect || rect.left == rect.right) - return rect; - let line = this.state.doc.lineAt(pos), order = this.bidiSpans(line); - let span2 = order[BidiSpan2.find(order, pos - line.from, -1, side)]; - return flattenRect2(rect, span2.dir == Direction2.LTR == side > 0); - } - get defaultCharacterWidth() { - return this.viewState.heightOracle.charWidth; - } - get defaultLineHeight() { - return this.viewState.heightOracle.lineHeight; - } - get textDirection() { - return this.viewState.defaultTextDirection; - } - textDirectionAt(pos) { - let perLine = this.state.facet(perLineTextDirection); - if (!perLine || pos < this.viewport.from || pos > this.viewport.to) - return this.textDirection; - this.readMeasured(); - return this.docView.textDirectionAt(pos); - } - get lineWrapping() { - return this.viewState.heightOracle.lineWrapping; - } - bidiSpans(line) { - if (line.length > MaxBidiLine2) - return trivialOrder2(line.length); - let dir = this.textDirectionAt(line.from); - for (let entry of this.bidiCache) - if (entry.from == line.from && entry.dir == dir) - return entry.order; - let order = computeOrder2(line.text, dir); - this.bidiCache.push(new CachedOrder2(line.from, line.to, dir, order)); - return order; - } - get hasFocus() { - var _a4; - return (document.hasFocus() || browser2.safari && ((_a4 = this.inputState) === null || _a4 === void 0 ? void 0 : _a4.lastContextMenu) > Date.now() - 3e4) && this.root.activeElement == this.contentDOM; - } - focus() { - this.observer.ignore(() => { - focusPreventScroll2(this.contentDOM); - this.docView.updateSelection(); - }); - } - destroy() { - for (let plugin of this.plugins) - plugin.destroy(this); - this.plugins = []; - this.inputState.destroy(); - this.dom.remove(); - this.observer.destroy(); - if (this.measureScheduled > -1) - cancelAnimationFrame(this.measureScheduled); - this.destroyed = true; - } - static scrollIntoView(pos, options = {}) { - return scrollIntoView3.of(new ScrollTarget2(typeof pos == "number" ? EditorSelection2.cursor(pos) : pos, options.y, options.x, options.yMargin, options.xMargin)); - } - static domEventHandlers(handlers4) { - return ViewPlugin2.define(() => ({}), { eventHandlers: handlers4 }); - } - static theme(spec, options) { - let prefix = StyleModule.newName(); - let result = [theme2.of(prefix), styleModule2.of(buildTheme2(`.${prefix}`, spec))]; - if (options && options.dark) - result.push(darkTheme2.of(true)); - return result; - } - static baseTheme(spec) { - return Prec2.lowest(styleModule2.of(buildTheme2("." + baseThemeID2, spec, lightDarkIDs2))); - } - }; - EditorView2.styleModule = styleModule2; - EditorView2.inputHandler = inputHandler3; - EditorView2.perLineTextDirection = perLineTextDirection; - EditorView2.exceptionSink = exceptionSink2; - EditorView2.updateListener = updateListener2; - EditorView2.editable = editable2; - EditorView2.mouseSelectionStyle = mouseSelectionStyle2; - EditorView2.dragMovesSelection = dragMovesSelection$12; - EditorView2.clickAddsSelectionRange = clickAddsSelectionRange2; - EditorView2.decorations = decorations2; - EditorView2.atomicRanges = atomicRanges; - EditorView2.scrollMargins = scrollMargins; - EditorView2.darkTheme = darkTheme2; - EditorView2.contentAttributes = contentAttributes2; - EditorView2.editorAttributes = editorAttributes2; - EditorView2.lineWrapping = /* @__PURE__ */ EditorView2.contentAttributes.of({ "class": "cm-lineWrapping" }); - EditorView2.announce = /* @__PURE__ */ StateEffect2.define(); - var MaxBidiLine2 = 4096; - var BadMeasure2 = {}; - var CachedOrder2 = class { - constructor(from2, to, dir, order) { - this.from = from2; - this.to = to; - this.dir = dir; - this.order = order; - } - static update(cache, changes) { - if (changes.empty) - return cache; - let result = [], lastDir = cache.length ? cache[cache.length - 1].dir : Direction2.LTR; - for (let i = Math.max(0, cache.length - 10); i < cache.length; i++) { - let entry = cache[i]; - if (entry.dir == lastDir && !changes.touchesRange(entry.from, entry.to)) - result.push(new CachedOrder2(changes.mapPos(entry.from, 1), changes.mapPos(entry.to, -1), entry.dir, entry.order)); - } - return result; - } - }; - function attrsFromFacet2(view, facet, base2) { - for (let sources = view.state.facet(facet), i = sources.length - 1; i >= 0; i--) { - let source = sources[i], value = typeof source == "function" ? source(view) : source; - if (value) - combineAttrs2(value, base2); - } - return base2; - } - var currentPlatform2 = browser2.mac ? "mac" : browser2.windows ? "win" : browser2.linux ? "linux" : "key"; - function normalizeKeyName2(name3, platform) { - const parts = name3.split(/-(?!$)/); - let result = parts[parts.length - 1]; - if (result == "Space") - result = " "; - let alt, ctrl, shift2, meta3; - for (let i = 0; i < parts.length - 1; ++i) { - const mod = parts[i]; - if (/^(cmd|meta|m)$/i.test(mod)) - meta3 = true; - else if (/^a(lt)?$/i.test(mod)) - alt = true; - else if (/^(c|ctrl|control)$/i.test(mod)) - ctrl = true; - else if (/^s(hift)?$/i.test(mod)) - shift2 = true; - else if (/^mod$/i.test(mod)) { - if (platform == "mac") - meta3 = true; - else - ctrl = true; - } else - throw new Error("Unrecognized modifier name: " + mod); - } - if (alt) - result = "Alt-" + result; - if (ctrl) - result = "Ctrl-" + result; - if (meta3) - result = "Meta-" + result; - if (shift2) - result = "Shift-" + result; - return result; - } - function modifiers2(name3, event, shift2) { - if (event.altKey) - name3 = "Alt-" + name3; - if (event.ctrlKey) - name3 = "Ctrl-" + name3; - if (event.metaKey) - name3 = "Meta-" + name3; - if (shift2 !== false && event.shiftKey) - name3 = "Shift-" + name3; - return name3; - } - var handleKeyEvents2 = /* @__PURE__ */ EditorView2.domEventHandlers({ - keydown(event, view) { - return runHandlers2(getKeymap2(view.state), event, view, "editor"); - } - }); - var keymap2 = /* @__PURE__ */ Facet2.define({ enables: handleKeyEvents2 }); - var Keymaps2 = /* @__PURE__ */ new WeakMap(); - function getKeymap2(state) { - let bindings = state.facet(keymap2); - let map = Keymaps2.get(bindings); - if (!map) - Keymaps2.set(bindings, map = buildKeymap2(bindings.reduce((a, b) => a.concat(b), []))); - return map; - } - var storedPrefix2 = null; - var PrefixTimeout2 = 4e3; - function buildKeymap2(bindings, platform = currentPlatform2) { - let bound = /* @__PURE__ */ Object.create(null); - let isPrefix = /* @__PURE__ */ Object.create(null); - let checkPrefix = (name3, is) => { - let current = isPrefix[name3]; - if (current == null) - isPrefix[name3] = is; - else if (current != is) - throw new Error("Key binding " + name3 + " is used both as a regular binding and as a multi-stroke prefix"); - }; - let add2 = (scope, key, command2, preventDefault) => { - let scopeObj = bound[scope] || (bound[scope] = /* @__PURE__ */ Object.create(null)); - let parts = key.split(/ (?!$)/).map((k) => normalizeKeyName2(k, platform)); - for (let i = 1; i < parts.length; i++) { - let prefix = parts.slice(0, i).join(" "); - checkPrefix(prefix, true); - if (!scopeObj[prefix]) - scopeObj[prefix] = { - preventDefault: true, - commands: [(view) => { - let ourObj = storedPrefix2 = { view, prefix, scope }; - setTimeout(() => { - if (storedPrefix2 == ourObj) - storedPrefix2 = null; - }, PrefixTimeout2); - return true; - }] - }; - } - let full = parts.join(" "); - checkPrefix(full, false); - let binding = scopeObj[full] || (scopeObj[full] = { preventDefault: false, commands: [] }); - binding.commands.push(command2); - if (preventDefault) - binding.preventDefault = true; - }; - for (let b of bindings) { - let name3 = b[platform] || b.key; - if (!name3) - continue; - for (let scope of b.scope ? b.scope.split(" ") : ["editor"]) { - add2(scope, name3, b.run, b.preventDefault); - if (b.shift) - add2(scope, "Shift-" + name3, b.shift, b.preventDefault); - } - } - return bound; - } - function runHandlers2(map, event, view, scope) { - let name3 = keyName(event), isChar = name3.length == 1 && name3 != " "; - let prefix = "", fallthrough = false; - if (storedPrefix2 && storedPrefix2.view == view && storedPrefix2.scope == scope) { - prefix = storedPrefix2.prefix + " "; - if (fallthrough = modifierCodes2.indexOf(event.keyCode) < 0) - storedPrefix2 = null; - } - let runFor = (binding) => { - if (binding) { - for (let cmd2 of binding.commands) - if (cmd2(view)) - return true; - if (binding.preventDefault) - fallthrough = true; - } - return false; - }; - let scopeObj = map[scope], baseName; - if (scopeObj) { - if (runFor(scopeObj[prefix + modifiers2(name3, event, !isChar)])) - return true; - if (isChar && (event.shiftKey || event.altKey || event.metaKey) && (baseName = base[event.keyCode]) && baseName != name3) { - if (runFor(scopeObj[prefix + modifiers2(baseName, event, true)])) - return true; - } else if (isChar && event.shiftKey) { - if (runFor(scopeObj[prefix + modifiers2(name3, event, true)])) - return true; - } - } - return fallthrough; - } - var CanHidePrimary2 = !browser2.ios; - var themeSpec2 = { - ".cm-line": { - "& ::selection": { backgroundColor: "transparent !important" }, - "&::selection": { backgroundColor: "transparent !important" } - } - }; - if (CanHidePrimary2) - themeSpec2[".cm-line"].caretColor = "transparent !important"; - var UnicodeRegexpSupport2 = /x/.unicode != null ? "gu" : "g"; - var baseTheme10 = /* @__PURE__ */ EditorView2.baseTheme({ - ".cm-tooltip": { - zIndex: 100 - }, - "&light .cm-tooltip": { - border: "1px solid #bbb", - backgroundColor: "#f5f5f5" - }, - "&light .cm-tooltip-section:not(:first-child)": { - borderTop: "1px solid #bbb" - }, - "&dark .cm-tooltip": { - backgroundColor: "#333338", - color: "white" - }, - ".cm-tooltip-arrow": { - height: `${7}px`, - width: `${7 * 2}px`, - position: "absolute", - zIndex: -1, - overflow: "hidden", - "&:before, &:after": { - content: "''", - position: "absolute", - width: 0, - height: 0, - borderLeft: `${7}px solid transparent`, - borderRight: `${7}px solid transparent` - }, - ".cm-tooltip-above &": { - bottom: `-${7}px`, - "&:before": { - borderTop: `${7}px solid #bbb` - }, - "&:after": { - borderTop: `${7}px solid #f5f5f5`, - bottom: "1px" - } - }, - ".cm-tooltip-below &": { - top: `-${7}px`, - "&:before": { - borderBottom: `${7}px solid #bbb` - }, - "&:after": { - borderBottom: `${7}px solid #f5f5f5`, - top: "1px" - } - } - }, - "&dark .cm-tooltip .cm-tooltip-arrow": { - "&:before": { - borderTopColor: "#333338", - borderBottomColor: "#333338" - }, - "&:after": { - borderTopColor: "transparent", - borderBottomColor: "transparent" - } - } - }); - var GutterMarker2 = class extends RangeValue2 { - compare(other) { - return this == other || this.constructor == other.constructor && this.eq(other); - } - eq(other) { - return false; - } - destroy(dom) { - } - }; - GutterMarker2.prototype.elementClass = ""; - GutterMarker2.prototype.toDOM = void 0; - GutterMarker2.prototype.mapMode = MapMode2.TrackBefore; - GutterMarker2.prototype.startSide = GutterMarker2.prototype.endSide = -1; - GutterMarker2.prototype.point = true; - - // node_modules/@codemirror/lang-javascript/node_modules/@codemirror/language/dist/index.js - var _a2; - var languageDataProp2 = /* @__PURE__ */ new NodeProp4(); - function defineLanguageFacet2(baseData) { - return Facet2.define({ - combine: baseData ? (values2) => values2.concat(baseData) : void 0 - }); - } - var Language2 = class { - constructor(data, parser7, extraExtensions = []) { - this.data = data; - if (!EditorState2.prototype.hasOwnProperty("tree")) - Object.defineProperty(EditorState2.prototype, "tree", { get() { - return syntaxTree2(this); - } }); - this.parser = parser7; - this.extension = [ - language2.of(this), - EditorState2.languageData.of((state, pos, side) => state.facet(languageDataFacetAt2(state, pos, side))) - ].concat(extraExtensions); - } - isActiveAt(state, pos, side = -1) { - return languageDataFacetAt2(state, pos, side) == this.data; - } - findRegions(state) { - let lang = state.facet(language2); - if ((lang === null || lang === void 0 ? void 0 : lang.data) == this.data) - return [{ from: 0, to: state.doc.length }]; - if (!lang || !lang.allowsNesting) - return []; - let result = []; - let explore = (tree, from2) => { - if (tree.prop(languageDataProp2) == this.data) { - result.push({ from: from2, to: from2 + tree.length }); - return; - } - let mount = tree.prop(NodeProp4.mounted); - if (mount) { - if (mount.tree.prop(languageDataProp2) == this.data) { - if (mount.overlay) - for (let r of mount.overlay) - result.push({ from: r.from + from2, to: r.to + from2 }); - else - result.push({ from: from2, to: from2 + tree.length }); - return; - } else if (mount.overlay) { - let size = result.length; - explore(mount.tree, mount.overlay[0].from + from2); - if (result.length > size) - return; - } - } - for (let i = 0; i < tree.children.length; i++) { - let ch = tree.children[i]; - if (ch instanceof Tree4) - explore(ch, tree.positions[i] + from2); - } - }; - explore(syntaxTree2(state), 0); - return result; - } - get allowsNesting() { - return true; - } - }; - Language2.setState = /* @__PURE__ */ StateEffect2.define(); - function languageDataFacetAt2(state, pos, side) { - let topLang = state.facet(language2); - if (!topLang) - return null; - let facet = topLang.data; - if (topLang.allowsNesting) { - for (let node = syntaxTree2(state).topNode; node; node = node.enter(pos, side, IterMode3.ExcludeBuffers)) - facet = node.type.prop(languageDataProp2) || facet; - } - return facet; - } - var LRLanguage2 = class extends Language2 { - constructor(data, parser7) { - super(data, parser7); - this.parser = parser7; - } - static define(spec) { - let data = defineLanguageFacet2(spec.languageData); - return new LRLanguage2(data, spec.parser.configure({ - props: [languageDataProp2.add((type) => type.isTop ? data : void 0)] - })); - } - configure(options) { - return new LRLanguage2(this.data, this.parser.configure(options)); - } - get allowsNesting() { - return this.parser.hasWrappers(); - } - }; - function syntaxTree2(state) { - let field = state.field(Language2.state, false); - return field ? field.tree : Tree4.empty; - } - var DocInput2 = class { - constructor(doc4, length = doc4.length) { - this.doc = doc4; - this.length = length; - this.cursorPos = 0; - this.string = ""; - this.cursor = doc4.iter(); - } - syncTo(pos) { - this.string = this.cursor.next(pos - this.cursorPos).value; - this.cursorPos = pos + this.string.length; - return this.cursorPos - this.string.length; - } - chunk(pos) { - this.syncTo(pos); - return this.string; - } - get lineChunks() { - return true; - } - read(from2, to) { - let stringStart = this.cursorPos - this.string.length; - if (from2 < stringStart || to >= this.cursorPos) - return this.doc.sliceString(from2, to); - else - return this.string.slice(from2 - stringStart, to - stringStart); - } - }; - var currentContext2 = null; - var ParseContext2 = class { - constructor(parser7, state, fragments = [], tree, treeLen, viewport, skipped, scheduleOn) { - this.parser = parser7; - this.state = state; - this.fragments = fragments; - this.tree = tree; - this.treeLen = treeLen; - this.viewport = viewport; - this.skipped = skipped; - this.scheduleOn = scheduleOn; - this.parse = null; - this.tempSkipped = []; - } - startParse() { - return this.parser.startParse(new DocInput2(this.state.doc), this.fragments); - } - work(until, upto) { - if (upto != null && upto >= this.state.doc.length) - upto = void 0; - if (this.tree != Tree4.empty && this.isDone(upto !== null && upto !== void 0 ? upto : this.state.doc.length)) { - this.takeTree(); - return true; - } - return this.withContext(() => { - var _a4; - if (typeof until == "number") { - let endTime = Date.now() + until; - until = () => Date.now() > endTime; - } - if (!this.parse) - this.parse = this.startParse(); - if (upto != null && (this.parse.stoppedAt == null || this.parse.stoppedAt > upto) && upto < this.state.doc.length) - this.parse.stopAt(upto); - for (; ; ) { - let done = this.parse.advance(); - if (done) { - this.fragments = this.withoutTempSkipped(TreeFragment2.addTree(done, this.fragments, this.parse.stoppedAt != null)); - this.treeLen = (_a4 = this.parse.stoppedAt) !== null && _a4 !== void 0 ? _a4 : this.state.doc.length; - this.tree = done; - this.parse = null; - if (this.treeLen < (upto !== null && upto !== void 0 ? upto : this.state.doc.length)) - this.parse = this.startParse(); - else - return true; - } - if (until()) - return false; - } - }); - } - takeTree() { - let pos, tree; - if (this.parse && (pos = this.parse.parsedPos) >= this.treeLen) { - if (this.parse.stoppedAt == null || this.parse.stoppedAt > pos) - this.parse.stopAt(pos); - this.withContext(() => { - while (!(tree = this.parse.advance())) { - } - }); - this.treeLen = pos; - this.tree = tree; - this.fragments = this.withoutTempSkipped(TreeFragment2.addTree(this.tree, this.fragments, true)); - this.parse = null; - } - } - withContext(f) { - let prev = currentContext2; - currentContext2 = this; - try { - return f(); - } finally { - currentContext2 = prev; - } - } - withoutTempSkipped(fragments) { - for (let r; r = this.tempSkipped.pop(); ) - fragments = cutFragments2(fragments, r.from, r.to); - return fragments; - } - changes(changes, newState) { - let { fragments, tree, treeLen, viewport, skipped } = this; - this.takeTree(); - if (!changes.empty) { - let ranges = []; - changes.iterChangedRanges((fromA, toA, fromB, toB) => ranges.push({ fromA, toA, fromB, toB })); - fragments = TreeFragment2.applyChanges(fragments, ranges); - tree = Tree4.empty; - treeLen = 0; - viewport = { from: changes.mapPos(viewport.from, -1), to: changes.mapPos(viewport.to, 1) }; - if (this.skipped.length) { - skipped = []; - for (let r of this.skipped) { - let from2 = changes.mapPos(r.from, 1), to = changes.mapPos(r.to, -1); - if (from2 < to) - skipped.push({ from: from2, to }); - } - } - } - return new ParseContext2(this.parser, newState, fragments, tree, treeLen, viewport, skipped, this.scheduleOn); - } - updateViewport(viewport) { - if (this.viewport.from == viewport.from && this.viewport.to == viewport.to) - return false; - this.viewport = viewport; - let startLen = this.skipped.length; - for (let i = 0; i < this.skipped.length; i++) { - let { from: from2, to } = this.skipped[i]; - if (from2 < viewport.to && to > viewport.from) { - this.fragments = cutFragments2(this.fragments, from2, to); - this.skipped.splice(i--, 1); - } - } - if (this.skipped.length >= startLen) - return false; - this.reset(); - return true; - } - reset() { - if (this.parse) { - this.takeTree(); - this.parse = null; - } - } - skipUntilInView(from2, to) { - this.skipped.push({ from: from2, to }); - } - static getSkippingParser(until) { - return new class extends Parser3 { - createParse(input, fragments, ranges) { - let from2 = ranges[0].from, to = ranges[ranges.length - 1].to; - let parser7 = { - parsedPos: from2, - advance() { - let cx = currentContext2; - if (cx) { - for (let r of ranges) - cx.tempSkipped.push(r); - if (until) - cx.scheduleOn = cx.scheduleOn ? Promise.all([cx.scheduleOn, until]) : until; - } - this.parsedPos = to; - return new Tree4(NodeType4.none, [], [], to - from2); - }, - stoppedAt: null, - stopAt() { - } - }; - return parser7; - } - }(); - } - isDone(upto) { - upto = Math.min(upto, this.state.doc.length); - let frags = this.fragments; - return this.treeLen >= upto && frags.length && frags[0].from == 0 && frags[0].to >= upto; - } - static get() { - return currentContext2; - } - }; - function cutFragments2(fragments, from2, to) { - return TreeFragment2.applyChanges(fragments, [{ fromA: from2, toA: to, fromB: from2, toB: to }]); - } - var LanguageState2 = class { - constructor(context) { - this.context = context; - this.tree = context.tree; - } - apply(tr) { - if (!tr.docChanged && this.tree == this.context.tree) - return this; - let newCx = this.context.changes(tr.changes, tr.state); - let upto = this.context.treeLen == tr.startState.doc.length ? void 0 : Math.max(tr.changes.mapPos(this.context.treeLen), newCx.viewport.to); - if (!newCx.work(20, upto)) - newCx.takeTree(); - return new LanguageState2(newCx); - } - static init(state) { - let vpTo = Math.min(3e3, state.doc.length); - let parseState = new ParseContext2(state.facet(language2).parser, state, [], Tree4.empty, 0, { from: 0, to: vpTo }, [], null); - if (!parseState.work(20, vpTo)) - parseState.takeTree(); - return new LanguageState2(parseState); - } - }; - Language2.state = /* @__PURE__ */ StateField2.define({ - create: LanguageState2.init, - update(value, tr) { - for (let e of tr.effects) - if (e.is(Language2.setState)) - return e.value; - if (tr.startState.facet(language2) != tr.state.facet(language2)) - return LanguageState2.init(tr.state); - return value.apply(tr); - } - }); - var requestIdle2 = (callback) => { - let timeout = setTimeout(() => callback(), 500); - return () => clearTimeout(timeout); - }; - if (typeof requestIdleCallback != "undefined") - requestIdle2 = (callback) => { - let idle = -1, timeout = setTimeout(() => { - idle = requestIdleCallback(callback, { timeout: 500 - 100 }); - }, 100); - return () => idle < 0 ? clearTimeout(timeout) : cancelIdleCallback(idle); - }; - var isInputPending2 = typeof navigator != "undefined" && ((_a2 = navigator.scheduling) === null || _a2 === void 0 ? void 0 : _a2.isInputPending) ? () => navigator.scheduling.isInputPending() : null; - var parseWorker2 = /* @__PURE__ */ ViewPlugin2.fromClass(class ParseWorker2 { - constructor(view) { - this.view = view; - this.working = null; - this.workScheduled = 0; - this.chunkEnd = -1; - this.chunkBudget = -1; - this.work = this.work.bind(this); - this.scheduleWork(); - } - update(update) { - let cx = this.view.state.field(Language2.state).context; - if (cx.updateViewport(update.view.viewport) || this.view.viewport.to > cx.treeLen) - this.scheduleWork(); - if (update.docChanged) { - if (this.view.hasFocus) - this.chunkBudget += 50; - this.scheduleWork(); - } - this.checkAsyncSchedule(cx); - } - scheduleWork() { - if (this.working) - return; - let { state } = this.view, field = state.field(Language2.state); - if (field.tree != field.context.tree || !field.context.isDone(state.doc.length)) - this.working = requestIdle2(this.work); - } - work(deadline) { - this.working = null; - let now = Date.now(); - if (this.chunkEnd < now && (this.chunkEnd < 0 || this.view.hasFocus)) { - this.chunkEnd = now + 3e4; - this.chunkBudget = 3e3; - } - if (this.chunkBudget <= 0) - return; - let { state, viewport: { to: vpTo } } = this.view, field = state.field(Language2.state); - if (field.tree == field.context.tree && field.context.isDone(vpTo + 1e5)) - return; - let endTime = Date.now() + Math.min(this.chunkBudget, 100, deadline && !isInputPending2 ? Math.max(25, deadline.timeRemaining() - 5) : 1e9); - let viewportFirst = field.context.treeLen < vpTo && state.doc.length > vpTo + 1e3; - let done = field.context.work(() => { - return isInputPending2 && isInputPending2() || Date.now() > endTime; - }, vpTo + (viewportFirst ? 0 : 1e5)); - this.chunkBudget -= Date.now() - now; - if (done || this.chunkBudget <= 0) { - field.context.takeTree(); - this.view.dispatch({ effects: Language2.setState.of(new LanguageState2(field.context)) }); - } - if (this.chunkBudget > 0 && !(done && !viewportFirst)) - this.scheduleWork(); - this.checkAsyncSchedule(field.context); - } - checkAsyncSchedule(cx) { - if (cx.scheduleOn) { - this.workScheduled++; - cx.scheduleOn.then(() => this.scheduleWork()).catch((err) => logException2(this.view.state, err)).then(() => this.workScheduled--); - cx.scheduleOn = null; - } - } - destroy() { - if (this.working) - this.working(); - } - isWorking() { - return !!(this.working || this.workScheduled > 0); - } - }, { - eventHandlers: { focus() { - this.scheduleWork(); - } } - }); - var language2 = /* @__PURE__ */ Facet2.define({ - combine(languages) { - return languages.length ? languages[0] : null; - }, - enables: [Language2.state, parseWorker2] - }); - var LanguageSupport2 = class { - constructor(language4, support = []) { - this.language = language4; - this.support = support; - this.extension = [language4, support]; - } - }; - var indentUnit2 = /* @__PURE__ */ Facet2.define({ - combine: (values2) => { - if (!values2.length) - return " "; - if (!/^(?: +|\t+)$/.test(values2[0])) - throw new Error("Invalid indent unit: " + JSON.stringify(values2[0])); - return values2[0]; - } - }); - var indentNodeProp2 = /* @__PURE__ */ new NodeProp4(); - function bracketedAligned2(context) { - let tree = context.node; - let openToken = tree.childAfter(tree.from), last = tree.lastChild; - if (!openToken) - return null; - let sim = context.options.simulateBreak; - let openLine = context.state.doc.lineAt(openToken.from); - let lineEnd = sim == null || sim <= openLine.from ? openLine.to : Math.min(openLine.to, sim); - for (let pos = openToken.to; ; ) { - let next = tree.childAfter(pos); - if (!next || next == last) - return null; - if (!next.type.isSkipped) - return next.from < lineEnd ? openToken : null; - pos = next.to; - } - } - function delimitedIndent2({ closing: closing2, align = true, units = 1 }) { - return (context) => delimitedStrategy2(context, align, units, closing2); - } - function delimitedStrategy2(context, align, units, closing2, closedAt) { - let after = context.textAfter, space4 = after.match(/^\s*/)[0].length; - let closed = closing2 && after.slice(space4, space4 + closing2.length) == closing2 || closedAt == context.pos + space4; - let aligned = align ? bracketedAligned2(context) : null; - if (aligned) - return closed ? context.column(aligned.from) : context.column(aligned.to); - return context.baseIndent + (closed ? 0 : context.unit * units); - } - var flatIndent2 = (context) => context.baseIndent; - function continuedIndent2({ except, units = 1 } = {}) { - return (context) => { - let matchExcept = except && except.test(context.textAfter); - return context.baseIndent + (matchExcept ? 0 : units * context.unit); - }; - } - var foldNodeProp2 = /* @__PURE__ */ new NodeProp4(); - function foldInside3(node) { - let first = node.firstChild, last = node.lastChild; - return first && first.to < last.from ? { from: first.to, to: last.type.isError ? node.to : last.from } : null; - } - var HighlightStyle2 = class { - constructor(spec, options) { - let modSpec; - function def(spec2) { - let cls = StyleModule.newName(); - (modSpec || (modSpec = /* @__PURE__ */ Object.create(null)))["." + cls] = spec2; - return cls; - } - const scopeOpt = options.scope; - this.scope = scopeOpt instanceof Language2 ? (type) => type.prop(languageDataProp2) == scopeOpt.data : scopeOpt ? (type) => type == scopeOpt : void 0; - this.style = tagHighlighter(spec.map((style) => ({ - tag: style.tag, - class: style.class || def(Object.assign({}, style, { tag: null })) - })), { - all: typeof options.all == "string" ? options.all : options.all ? def(options.all) : void 0 - }).style; - this.module = modSpec ? new StyleModule(modSpec) : null; - this.themeType = options.themeType; - } - static define(specs, options) { - return new HighlightStyle2(specs, options || {}); - } - }; - var defaultHighlightStyle2 = /* @__PURE__ */ HighlightStyle2.define([ - { - tag: tags2.meta, - color: "#7a757a" - }, - { - tag: tags2.link, - textDecoration: "underline" - }, - { - tag: tags2.heading, - textDecoration: "underline", - fontWeight: "bold" - }, - { - tag: tags2.emphasis, - fontStyle: "italic" - }, - { - tag: tags2.strong, - fontWeight: "bold" - }, - { - tag: tags2.strikethrough, - textDecoration: "line-through" - }, - { - tag: tags2.keyword, - color: "#708" - }, - { - tag: [tags2.atom, tags2.bool, tags2.url, tags2.contentSeparator, tags2.labelName], - color: "#219" - }, - { - tag: [tags2.literal, tags2.inserted], - color: "#164" - }, - { - tag: [tags2.string, tags2.deleted], - color: "#a11" - }, - { - tag: [tags2.regexp, tags2.escape, /* @__PURE__ */ tags2.special(tags2.string)], - color: "#e40" - }, - { - tag: /* @__PURE__ */ tags2.definition(tags2.variableName), - color: "#00f" - }, - { - tag: /* @__PURE__ */ tags2.local(tags2.variableName), - color: "#30a" - }, - { - tag: [tags2.typeName, tags2.namespace], - color: "#085" - }, - { - tag: tags2.className, - color: "#167" - }, - { - tag: [/* @__PURE__ */ tags2.special(tags2.variableName), tags2.macroName], - color: "#256" - }, - { - tag: /* @__PURE__ */ tags2.definition(tags2.propertyName), - color: "#00c" - }, - { - tag: tags2.comment, - color: "#940" - }, - { - tag: tags2.invalid, - color: "#f00" - } - ]); - var noTokens = /* @__PURE__ */ Object.create(null); - var typeArray = [NodeType4.none]; - var warned = []; - var defaultTable = /* @__PURE__ */ Object.create(null); - for (let [legacyName, name3] of [ - ["variable", "variableName"], - ["variable-2", "variableName.special"], - ["string-2", "string.special"], - ["def", "variableName.definition"], - ["tag", "typeName"], - ["attribute", "propertyName"], - ["type", "typeName"], - ["builtin", "variableName.standard"], - ["qualifier", "modifier"], - ["error", "invalid"], - ["header", "heading"], - ["property", "propertyName"] - ]) - defaultTable[legacyName] = /* @__PURE__ */ createTokenType(noTokens, name3); - function warnForPart(part, msg) { - if (warned.indexOf(part) > -1) - return; - warned.push(part); - console.warn(msg); - } - function createTokenType(extra, tagStr) { - let tag = null; - for (let part of tagStr.split(".")) { - let value = extra[part] || tags2[part]; - if (!value) { - warnForPart(part, `Unknown highlighting tag ${part}`); - } else if (typeof value == "function") { - if (!tag) - warnForPart(part, `Modifier ${part} used at start of tag`); - else - tag = value(tag); - } else { - if (tag) - warnForPart(part, `Tag ${part} used as modifier`); - else - tag = value; - } - } - if (!tag) - return 0; - let name3 = tagStr.replace(/ /g, "_"), type = NodeType4.define({ - id: typeArray.length, - name: name3, - props: [styleTags2({ [name3]: tag })] - }); - typeArray.push(type); - return type.id; - } - - // node_modules/@codemirror/lang-javascript/node_modules/@codemirror/autocomplete/dist/index.js - function toSet2(chars) { - let flat = Object.keys(chars).join(""); - let words = /\w/.test(flat); - if (words) - flat = flat.replace(/\w/g, ""); - return `[${words ? "\\w" : ""}${flat.replace(/[^\w\s]/g, "\\$&")}]`; - } - function prefixMatch2(options) { - let first = /* @__PURE__ */ Object.create(null), rest = /* @__PURE__ */ Object.create(null); - for (let { label } of options) { - first[label[0]] = true; - for (let i = 1; i < label.length; i++) - rest[label[i]] = true; - } - let source = toSet2(first) + toSet2(rest) + "*$"; - return [new RegExp("^" + source), new RegExp(source)]; - } - function completeFromList2(list2) { - let options = list2.map((o) => typeof o == "string" ? { label: o } : o); - let [validFor, match2] = options.every((o) => /^\w+$/.test(o.label)) ? [/\w*$/, /\w+$/] : prefixMatch2(options); - return (context) => { - let token = context.matchBefore(match2); - return token || context.explicit ? { from: token ? token.from : context.pos, options, validFor } : null; - }; - } - function ifNotIn2(nodes, source) { - return (context) => { - for (let pos = syntaxTree2(context.state).resolveInner(context.pos, -1); pos; pos = pos.parent) - if (nodes.indexOf(pos.name) > -1) - return null; - return source(context); - }; - } - var baseTheme11 = /* @__PURE__ */ EditorView2.baseTheme({ - ".cm-tooltip.cm-tooltip-autocomplete": { - "& > ul": { - fontFamily: "monospace", - whiteSpace: "nowrap", - overflow: "hidden auto", - maxWidth_fallback: "700px", - maxWidth: "min(700px, 95vw)", - minWidth: "250px", - maxHeight: "10em", - listStyle: "none", - margin: 0, - padding: 0, - "& > li": { - overflowX: "hidden", - textOverflow: "ellipsis", - cursor: "pointer", - padding: "1px 3px", - lineHeight: 1.2 - } - } - }, - "&light .cm-tooltip-autocomplete ul li[aria-selected]": { - background: "#17c", - color: "white" - }, - "&dark .cm-tooltip-autocomplete ul li[aria-selected]": { - background: "#347", - color: "white" - }, - ".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after": { - content: '"\xB7\xB7\xB7"', - opacity: 0.5, - display: "block", - textAlign: "center" - }, - ".cm-tooltip.cm-completionInfo": { - position: "absolute", - padding: "3px 9px", - width: "max-content", - maxWidth: "300px" - }, - ".cm-completionInfo.cm-completionInfo-left": { right: "100%" }, - ".cm-completionInfo.cm-completionInfo-right": { left: "100%" }, - "&light .cm-snippetField": { backgroundColor: "#00000022" }, - "&dark .cm-snippetField": { backgroundColor: "#ffffff22" }, - ".cm-snippetFieldPosition": { - verticalAlign: "text-top", - width: 0, - height: "1.15em", - margin: "0 -0.7px -.7em", - borderLeft: "1.4px dotted #888" - }, - ".cm-completionMatchedText": { - textDecoration: "underline" - }, - ".cm-completionDetail": { - marginLeft: "0.5em", - fontStyle: "italic" - }, - ".cm-completionIcon": { - fontSize: "90%", - width: ".8em", - display: "inline-block", - textAlign: "center", - paddingRight: ".6em", - opacity: "0.6" - }, - ".cm-completionIcon-function, .cm-completionIcon-method": { - "&:after": { content: "'\u0192'" } - }, - ".cm-completionIcon-class": { - "&:after": { content: "'\u25CB'" } - }, - ".cm-completionIcon-interface": { - "&:after": { content: "'\u25CC'" } - }, - ".cm-completionIcon-variable": { - "&:after": { content: "'\u{1D465}'" } - }, - ".cm-completionIcon-constant": { - "&:after": { content: "'\u{1D436}'" } - }, - ".cm-completionIcon-type": { - "&:after": { content: "'\u{1D461}'" } - }, - ".cm-completionIcon-enum": { - "&:after": { content: "'\u222A'" } - }, - ".cm-completionIcon-property": { - "&:after": { content: "'\u25A1'" } - }, - ".cm-completionIcon-keyword": { - "&:after": { content: "'\u{1F511}\uFE0E'" } - }, - ".cm-completionIcon-namespace": { - "&:after": { content: "'\u25A2'" } - }, - ".cm-completionIcon-text": { - "&:after": { content: "'abc'", fontSize: "50%", verticalAlign: "middle" } - } - }); - var FieldPos2 = class { - constructor(field, line, from2, to) { - this.field = field; - this.line = line; - this.from = from2; - this.to = to; - } - }; - var FieldRange2 = class { - constructor(field, from2, to) { - this.field = field; - this.from = from2; - this.to = to; - } - map(changes) { - let from2 = changes.mapPos(this.from, -1, MapMode2.TrackDel); - let to = changes.mapPos(this.to, 1, MapMode2.TrackDel); - return from2 == null || to == null ? null : new FieldRange2(this.field, from2, to); - } - }; - var Snippet2 = class { - constructor(lines, fieldPositions) { - this.lines = lines; - this.fieldPositions = fieldPositions; - } - instantiate(state, pos) { - let text = [], lineStart = [pos]; - let lineObj = state.doc.lineAt(pos), baseIndent = /^\s*/.exec(lineObj.text)[0]; - for (let line of this.lines) { - if (text.length) { - let indent = baseIndent, tabs = /^\t*/.exec(line)[0].length; - for (let i = 0; i < tabs; i++) - indent += state.facet(indentUnit2); - lineStart.push(pos + indent.length - tabs); - line = indent + line.slice(tabs); - } - text.push(line); - pos += line.length + 1; - } - let ranges = this.fieldPositions.map((pos2) => new FieldRange2(pos2.field, lineStart[pos2.line] + pos2.from, lineStart[pos2.line] + pos2.to)); - return { text, ranges }; - } - static parse(template3) { - let fields = []; - let lines = [], positions = [], m; - for (let line of template3.split(/\r\n?|\n/)) { - while (m = /[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(line)) { - let seq = m[1] ? +m[1] : null, name3 = m[2] || m[3] || "", found = -1; - for (let i = 0; i < fields.length; i++) { - if (seq != null ? fields[i].seq == seq : name3 ? fields[i].name == name3 : false) - found = i; - } - if (found < 0) { - let i = 0; - while (i < fields.length && (seq == null || fields[i].seq != null && fields[i].seq < seq)) - i++; - fields.splice(i, 0, { seq, name: name3 }); - found = i; - for (let pos of positions) - if (pos.field >= found) - pos.field++; - } - positions.push(new FieldPos2(found, lines.length, m.index, m.index + name3.length)); - line = line.slice(0, m.index) + name3 + line.slice(m.index + m[0].length); - } - lines.push(line); - } - return new Snippet2(lines, positions); - } - }; - var fieldMarker2 = /* @__PURE__ */ Decoration2.widget({ widget: /* @__PURE__ */ new class extends WidgetType2 { - toDOM() { - let span2 = document.createElement("span"); - span2.className = "cm-snippetFieldPosition"; - return span2; - } - ignoreEvent() { - return false; - } - }() }); - var fieldRange2 = /* @__PURE__ */ Decoration2.mark({ class: "cm-snippetField" }); - var ActiveSnippet2 = class { - constructor(ranges, active) { - this.ranges = ranges; - this.active = active; - this.deco = Decoration2.set(ranges.map((r) => (r.from == r.to ? fieldMarker2 : fieldRange2).range(r.from, r.to))); - } - map(changes) { - let ranges = []; - for (let r of this.ranges) { - let mapped = r.map(changes); - if (!mapped) - return null; - ranges.push(mapped); - } - return new ActiveSnippet2(ranges, this.active); - } - selectionInsideField(sel) { - return sel.ranges.every((range) => this.ranges.some((r) => r.field == this.active && r.from <= range.from && r.to >= range.to)); - } - }; - var setActive2 = /* @__PURE__ */ StateEffect2.define({ - map(value, changes) { - return value && value.map(changes); - } - }); - var moveToField2 = /* @__PURE__ */ StateEffect2.define(); - var snippetState2 = /* @__PURE__ */ StateField2.define({ - create() { - return null; - }, - update(value, tr) { - for (let effect of tr.effects) { - if (effect.is(setActive2)) - return effect.value; - if (effect.is(moveToField2) && value) - return new ActiveSnippet2(value.ranges, effect.value); - } - if (value && tr.docChanged) - value = value.map(tr.changes); - if (value && tr.selection && !value.selectionInsideField(tr.selection)) - value = null; - return value; - }, - provide: (f) => EditorView2.decorations.from(f, (val) => val ? val.deco : Decoration2.none) - }); - function fieldSelection2(ranges, field) { - return EditorSelection2.create(ranges.filter((r) => r.field == field).map((r) => EditorSelection2.range(r.from, r.to))); - } - function snippet2(template3) { - let snippet3 = Snippet2.parse(template3); - return (editor, _completion, from2, to) => { - let { text, ranges } = snippet3.instantiate(editor.state, from2); - let spec = { changes: { from: from2, to, insert: Text2.of(text) } }; - if (ranges.length) - spec.selection = fieldSelection2(ranges, 0); - if (ranges.length > 1) { - let active = new ActiveSnippet2(ranges, 0); - let effects = spec.effects = [setActive2.of(active)]; - if (editor.state.field(snippetState2, false) === void 0) - effects.push(StateEffect2.appendConfig.of([snippetState2, addSnippetKeymap2, snippetPointerHandler2, baseTheme11])); - } - editor.dispatch(editor.state.update(spec)); - }; - } - function moveField2(dir) { - return ({ state, dispatch }) => { - let active = state.field(snippetState2, false); - if (!active || dir < 0 && active.active == 0) - return false; - let next = active.active + dir, last = dir > 0 && !active.ranges.some((r) => r.field == next + dir); - dispatch(state.update({ - selection: fieldSelection2(active.ranges, next), - effects: setActive2.of(last ? null : new ActiveSnippet2(active.ranges, next)) - })); - return true; - }; - } - var clearSnippet2 = ({ state, dispatch }) => { - let active = state.field(snippetState2, false); - if (!active) - return false; - dispatch(state.update({ effects: setActive2.of(null) })); - return true; - }; - var nextSnippetField2 = /* @__PURE__ */ moveField2(1); - var prevSnippetField2 = /* @__PURE__ */ moveField2(-1); - var defaultSnippetKeymap2 = [ - { key: "Tab", run: nextSnippetField2, shift: prevSnippetField2 }, - { key: "Escape", run: clearSnippet2 } - ]; - var snippetKeymap2 = /* @__PURE__ */ Facet2.define({ - combine(maps) { - return maps.length ? maps[0] : defaultSnippetKeymap2; - } - }); - var addSnippetKeymap2 = /* @__PURE__ */ Prec2.highest(/* @__PURE__ */ keymap2.compute([snippetKeymap2], (state) => state.facet(snippetKeymap2))); - function snippetCompletion2(template3, completion) { - return Object.assign(Object.assign({}, completion), { apply: snippet2(template3) }); - } - var snippetPointerHandler2 = /* @__PURE__ */ EditorView2.domEventHandlers({ - mousedown(event, view) { - let active = view.state.field(snippetState2, false), pos; - if (!active || (pos = view.posAtCoords({ x: event.clientX, y: event.clientY })) == null) - return false; - let match2 = active.ranges.find((r) => r.from <= pos && r.to >= pos); - if (!match2 || match2.field == active.active) - return false; - view.dispatch({ - selection: fieldSelection2(active.ranges, match2.field), - effects: setActive2.of(active.ranges.some((r) => r.field > match2.field) ? new ActiveSnippet2(active.ranges, match2.field) : null) - }); - return true; - } - }); - var closedBracket2 = /* @__PURE__ */ new class extends RangeValue2 { - }(); - closedBracket2.startSide = 1; - closedBracket2.endSide = -1; - var android2 = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent); - - // node_modules/@codemirror/lang-javascript/dist/index.js - var snippets = [ - /* @__PURE__ */ snippetCompletion2("function ${name}(${params}) {\n ${}\n}", { - label: "function", - detail: "definition", - type: "keyword" - }), - /* @__PURE__ */ snippetCompletion2("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}", { - label: "for", - detail: "loop", - type: "keyword" - }), - /* @__PURE__ */ snippetCompletion2("for (let ${name} of ${collection}) {\n ${}\n}", { - label: "for", - detail: "of loop", - type: "keyword" - }), - /* @__PURE__ */ snippetCompletion2("try {\n ${}\n} catch (${error}) {\n ${}\n}", { - label: "try", - detail: "block", - type: "keyword" - }), - /* @__PURE__ */ snippetCompletion2("class ${name} {\n constructor(${params}) {\n ${}\n }\n}", { - label: "class", - detail: "definition", - type: "keyword" - }), - /* @__PURE__ */ snippetCompletion2('import {${names}} from "${module}"\n${}', { - label: "import", - detail: "named", - type: "keyword" - }), - /* @__PURE__ */ snippetCompletion2('import ${name} from "${module}"\n${}', { - label: "import", - detail: "default", - type: "keyword" - }) - ]; - var javascriptLanguage = /* @__PURE__ */ LRLanguage2.define({ - parser: /* @__PURE__ */ parser.configure({ - props: [ - /* @__PURE__ */ indentNodeProp2.add({ - IfStatement: /* @__PURE__ */ continuedIndent2({ except: /^\s*({|else\b)/ }), - TryStatement: /* @__PURE__ */ continuedIndent2({ except: /^\s*({|catch\b|finally\b)/ }), - LabeledStatement: flatIndent2, - SwitchBody: (context) => { - let after = context.textAfter, closed = /^\s*\}/.test(after), isCase = /^\s*(case|default)\b/.test(after); - return context.baseIndent + (closed ? 0 : isCase ? 1 : 2) * context.unit; - }, - Block: /* @__PURE__ */ delimitedIndent2({ closing: "}" }), - ArrowFunction: (cx) => cx.baseIndent + cx.unit, - "TemplateString BlockComment": () => -1, - "Statement Property": /* @__PURE__ */ continuedIndent2({ except: /^{/ }), - JSXElement(context) { - let closed = /^\s*<\//.test(context.textAfter); - return context.lineIndent(context.node.from) + (closed ? 0 : context.unit); - }, - JSXEscape(context) { - let closed = /\s*\}/.test(context.textAfter); - return context.lineIndent(context.node.from) + (closed ? 0 : context.unit); - }, - "JSXOpenTag JSXSelfClosingTag"(context) { - return context.column(context.node.from) + context.unit; - } - }), - /* @__PURE__ */ foldNodeProp2.add({ - "Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression": foldInside3, - BlockComment(tree) { - return { from: tree.from + 2, to: tree.to - 2 }; - } - }) - ] - }), - languageData: { - closeBrackets: { brackets: ["(", "[", "{", "'", '"', "`"] }, - commentTokens: { line: "//", block: { open: "/*", close: "*/" } }, - indentOnInput: /^\s*(?:case |default:|\{|\}|<\/)$/, - wordChars: "$" - } - }); - var typescriptLanguage = /* @__PURE__ */ javascriptLanguage.configure({ dialect: "ts" }); - var jsxLanguage = /* @__PURE__ */ javascriptLanguage.configure({ dialect: "jsx" }); - var tsxLanguage = /* @__PURE__ */ javascriptLanguage.configure({ dialect: "jsx ts" }); - function javascript(config2 = {}) { - let lang = config2.jsx ? config2.typescript ? tsxLanguage : jsxLanguage : config2.typescript ? typescriptLanguage : javascriptLanguage; - return new LanguageSupport2(lang, [ - javascriptLanguage.data.of({ - autocomplete: ifNotIn2(["LineComment", "BlockComment", "String"], completeFromList2(snippets)) - }), - config2.jsx ? autoCloseTags : [] - ]); - } - function elementName(doc4, tree, max = doc4.length) { - if (!tree) - return ""; - let name3 = tree.getChild("JSXIdentifier"); - return name3 ? doc4.sliceString(name3.from, Math.min(name3.to, max)) : ""; - } - var android3 = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent); - var autoCloseTags = /* @__PURE__ */ EditorView2.inputHandler.of((view, from2, to, text) => { - if ((android3 ? view.composing : view.compositionStarted) || view.state.readOnly || from2 != to || text != ">" && text != "/" || !javascriptLanguage.isActiveAt(view.state, from2, -1)) - return false; - let { state } = view; - let changes = state.changeByRange((range) => { - var _a4, _b, _c; - let { head } = range, around = syntaxTree2(state).resolveInner(head, -1), name3; - if (around.name == "JSXStartTag") - around = around.parent; - if (text == ">" && around.name == "JSXFragmentTag") { - return { range: EditorSelection2.cursor(head + 1), changes: { from: head, insert: `><>` } }; - } else if (text == ">" && around.name == "JSXIdentifier") { - if (((_b = (_a4 = around.parent) === null || _a4 === void 0 ? void 0 : _a4.lastChild) === null || _b === void 0 ? void 0 : _b.name) != "JSXEndTag" && (name3 = elementName(state.doc, around.parent, head))) - return { range: EditorSelection2.cursor(head + 1), changes: { from: head, insert: `>` } }; - } else if (text == "/" && around.name == "JSXFragmentTag") { - let empty2 = around.parent, base2 = empty2 === null || empty2 === void 0 ? void 0 : empty2.parent; - if (empty2.from == head - 1 && ((_c = base2.lastChild) === null || _c === void 0 ? void 0 : _c.name) != "JSXEndTag" && (name3 = elementName(state.doc, base2 === null || base2 === void 0 ? void 0 : base2.firstChild, head))) { - let insert4 = `/${name3}>`; - return { range: EditorSelection2.cursor(head + insert4.length), changes: { from: head, insert: insert4 } }; - } - } - return { range }; - }); - if (changes.changes.empty) - return false; - view.dispatch(changes, { userEvent: "input.type", scrollIntoView: true }); - return true; - }); - - // node_modules/@lezer/lr/dist/index.js - var Stack2 = class { - constructor(p, stack, state, reducePos, pos, score2, buffer, bufferBase, curContext, lookAhead = 0, parent) { - this.p = p; - this.stack = stack; - this.state = state; - this.reducePos = reducePos; - this.pos = pos; - this.score = score2; - this.buffer = buffer; - this.bufferBase = bufferBase; - this.curContext = curContext; - this.lookAhead = lookAhead; - this.parent = parent; - } - toString() { - return `[${this.stack.filter((_, i) => i % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? "!" + this.score : ""}`; - } - static start(p, state, pos = 0) { - let cx = p.parser.context; - return new Stack2(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext2(cx, cx.start) : null, 0, null); - } - get context() { - return this.curContext ? this.curContext.context : null; - } - pushState(state, start) { - this.stack.push(this.state, start, this.bufferBase + this.buffer.length); - this.state = state; - } - reduce(action) { - let depth = action >> 19, type = action & 65535; - let { parser: parser7 } = this.p; - let dPrec = parser7.dynamicPrecedence(type); - if (dPrec) - this.score += dPrec; - if (depth == 0) { - this.pushState(parser7.getGoto(this.state, type, true), this.reducePos); - if (type < parser7.minRepeatTerm) - this.storeNode(type, this.reducePos, this.reducePos, 4, true); - this.reduceContext(type, this.reducePos); - return; - } - let base2 = this.stack.length - (depth - 1) * 3 - (action & 262144 ? 6 : 0); - let start = this.stack[base2 - 2]; - let bufferBase = this.stack[base2 - 1], count = this.bufferBase + this.buffer.length - bufferBase; - if (type < parser7.minRepeatTerm || action & 131072) { - let pos = parser7.stateFlag(this.state, 1) ? this.pos : this.reducePos; - this.storeNode(type, start, pos, count + 4, true); - } - if (action & 262144) { - this.state = this.stack[base2]; - } else { - let baseStateID = this.stack[base2 - 3]; - this.state = parser7.getGoto(baseStateID, type, true); - } - while (this.stack.length > base2) - this.stack.pop(); - this.reduceContext(type, start); - } - storeNode(term, start, end, size = 4, isReduce = false) { - if (term == 0) { - let cur2 = this, top2 = this.buffer.length; - if (top2 == 0 && cur2.parent) { - top2 = cur2.bufferBase - cur2.parent.bufferBase; - cur2 = cur2.parent; - } - if (top2 > 0 && cur2.buffer[top2 - 4] == 0 && cur2.buffer[top2 - 1] > -1) { - if (start == end) - return; - if (cur2.buffer[top2 - 2] >= start) { - cur2.buffer[top2 - 2] = end; - return; - } - } - } - if (!isReduce || this.pos == end) { - this.buffer.push(term, start, end, size); - } else { - let index = this.buffer.length; - if (index > 0 && this.buffer[index - 4] != 0) - while (index > 0 && this.buffer[index - 2] > end) { - this.buffer[index] = this.buffer[index - 4]; - this.buffer[index + 1] = this.buffer[index - 3]; - this.buffer[index + 2] = this.buffer[index - 2]; - this.buffer[index + 3] = this.buffer[index - 1]; - index -= 4; - if (size > 4) - size -= 4; - } - this.buffer[index] = term; - this.buffer[index + 1] = start; - this.buffer[index + 2] = end; - this.buffer[index + 3] = size; - } - } - shift(action, next, nextEnd) { - let start = this.pos; - if (action & 131072) { - this.pushState(action & 65535, this.pos); - } else if ((action & 262144) == 0) { - let nextState = action, { parser: parser7 } = this.p; - if (nextEnd > this.pos || next <= parser7.maxNode) { - this.pos = nextEnd; - if (!parser7.stateFlag(nextState, 1)) - this.reducePos = nextEnd; - } - this.pushState(nextState, start); - this.shiftContext(next, start); - if (next <= parser7.maxNode) - this.buffer.push(next, start, nextEnd, 4); - } else { - this.pos = nextEnd; - this.shiftContext(next, start); - if (next <= this.p.parser.maxNode) - this.buffer.push(next, start, nextEnd, 4); - } - } - apply(action, next, nextEnd) { - if (action & 65536) - this.reduce(action); - else - this.shift(action, next, nextEnd); - } - useNode(value, next) { - let index = this.p.reused.length - 1; - if (index < 0 || this.p.reused[index] != value) { - this.p.reused.push(value); - index++; - } - let start = this.pos; - this.reducePos = this.pos = start + value.length; - this.pushState(next, start); - this.buffer.push(index, start, this.reducePos, -1); - if (this.curContext) - this.updateContext(this.curContext.tracker.reuse(this.curContext.context, value, this, this.p.stream.reset(this.pos - value.length))); - } - split() { - let parent = this; - let off = parent.buffer.length; - while (off > 0 && parent.buffer[off - 2] > parent.reducePos) - off -= 4; - let buffer = parent.buffer.slice(off), base2 = parent.bufferBase + off; - while (parent && base2 == parent.bufferBase) - parent = parent.parent; - return new Stack2(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base2, this.curContext, this.lookAhead, parent); - } - recoverByDelete(next, nextEnd) { - let isNode = next <= this.p.parser.maxNode; - if (isNode) - this.storeNode(next, this.pos, nextEnd, 4); - this.storeNode(0, this.pos, nextEnd, isNode ? 8 : 4); - this.pos = this.reducePos = nextEnd; - this.score -= 190; - } - canShift(term) { - for (let sim = new SimulatedStack2(this); ; ) { - let action = this.p.parser.stateSlot(sim.state, 4) || this.p.parser.hasAction(sim.state, term); - if ((action & 65536) == 0) - return true; - if (action == 0) - return false; - sim.reduce(action); - } - } - recoverByInsert(next) { - if (this.stack.length >= 300) - return []; - let nextStates = this.p.parser.nextStates(this.state); - if (nextStates.length > 4 << 1 || this.stack.length >= 120) { - let best = []; - for (let i = 0, s; i < nextStates.length; i += 2) { - if ((s = nextStates[i + 1]) != this.state && this.p.parser.hasAction(s, next)) - best.push(nextStates[i], s); - } - if (this.stack.length < 120) - for (let i = 0; best.length < 4 << 1 && i < nextStates.length; i += 2) { - let s = nextStates[i + 1]; - if (!best.some((v, i2) => i2 & 1 && v == s)) - best.push(nextStates[i], s); - } - nextStates = best; - } - let result = []; - for (let i = 0; i < nextStates.length && result.length < 4; i += 2) { - let s = nextStates[i + 1]; - if (s == this.state) - continue; - let stack = this.split(); - stack.storeNode(0, stack.pos, stack.pos, 4, true); - stack.pushState(s, this.pos); - stack.shiftContext(nextStates[i], this.pos); - stack.score -= 200; - result.push(stack); - } - return result; - } - forceReduce() { - let reduce = this.p.parser.stateSlot(this.state, 5); - if ((reduce & 65536) == 0) - return false; - let { parser: parser7 } = this.p; - if (!parser7.validAction(this.state, reduce)) { - let depth = reduce >> 19, term = reduce & 65535; - let target = this.stack.length - depth * 3; - if (target < 0 || parser7.getGoto(this.stack[target], term, false) < 0) - return false; - this.storeNode(0, this.reducePos, this.reducePos, 4, true); - this.score -= 100; - } - this.reduce(reduce); - return true; - } - forceAll() { - while (!this.p.parser.stateFlag(this.state, 2)) { - if (!this.forceReduce()) { - this.storeNode(0, this.pos, this.pos, 4, true); - break; - } - } - return this; - } - get deadEnd() { - if (this.stack.length != 3) - return false; - let { parser: parser7 } = this.p; - return parser7.data[parser7.stateSlot(this.state, 1)] == 65535 && !parser7.stateSlot(this.state, 4); - } - restart() { - this.state = this.stack[0]; - this.stack.length = 0; - } - sameState(other) { - if (this.state != other.state || this.stack.length != other.stack.length) - return false; - for (let i = 0; i < this.stack.length; i += 3) - if (this.stack[i] != other.stack[i]) - return false; - return true; - } - get parser() { - return this.p.parser; - } - dialectEnabled(dialectID) { - return this.p.parser.dialect.flags[dialectID]; - } - shiftContext(term, start) { - if (this.curContext) - this.updateContext(this.curContext.tracker.shift(this.curContext.context, term, this, this.p.stream.reset(start))); - } - reduceContext(term, start) { - if (this.curContext) - this.updateContext(this.curContext.tracker.reduce(this.curContext.context, term, this, this.p.stream.reset(start))); - } - emitContext() { - let last = this.buffer.length - 1; - if (last < 0 || this.buffer[last] != -3) - this.buffer.push(this.curContext.hash, this.reducePos, this.reducePos, -3); - } - emitLookAhead() { - let last = this.buffer.length - 1; - if (last < 0 || this.buffer[last] != -4) - this.buffer.push(this.lookAhead, this.reducePos, this.reducePos, -4); - } - updateContext(context) { - if (context != this.curContext.context) { - let newCx = new StackContext2(this.curContext.tracker, context); - if (newCx.hash != this.curContext.hash) - this.emitContext(); - this.curContext = newCx; - } - } - setLookAhead(lookAhead) { - if (lookAhead > this.lookAhead) { - this.emitLookAhead(); - this.lookAhead = lookAhead; - } - } - close() { - if (this.curContext && this.curContext.tracker.strict) - this.emitContext(); - if (this.lookAhead > 0) - this.emitLookAhead(); - } - }; - var StackContext2 = class { - constructor(tracker, context) { - this.tracker = tracker; - this.context = context; - this.hash = tracker.strict ? tracker.hash(context) : 0; - } - }; - var Recover2; - (function(Recover4) { - Recover4[Recover4["Insert"] = 200] = "Insert"; - Recover4[Recover4["Delete"] = 190] = "Delete"; - Recover4[Recover4["Reduce"] = 100] = "Reduce"; - Recover4[Recover4["MaxNext"] = 4] = "MaxNext"; - Recover4[Recover4["MaxInsertStackDepth"] = 300] = "MaxInsertStackDepth"; - Recover4[Recover4["DampenInsertStackDepth"] = 120] = "DampenInsertStackDepth"; - })(Recover2 || (Recover2 = {})); - var SimulatedStack2 = class { - constructor(start) { - this.start = start; - this.state = start.state; - this.stack = start.stack; - this.base = this.stack.length; - } - reduce(action) { - let term = action & 65535, depth = action >> 19; - if (depth == 0) { - if (this.stack == this.start.stack) - this.stack = this.stack.slice(); - this.stack.push(this.state, 0, 0); - this.base += 3; - } else { - this.base -= (depth - 1) * 3; - } - let goto2 = this.start.p.parser.getGoto(this.stack[this.base - 3], term, true); - this.state = goto2; - } - }; - var StackBufferCursor2 = class { - constructor(stack, pos, index) { - this.stack = stack; - this.pos = pos; - this.index = index; - this.buffer = stack.buffer; - if (this.index == 0) - this.maybeNext(); - } - static create(stack, pos = stack.bufferBase + stack.buffer.length) { - return new StackBufferCursor2(stack, pos, pos - stack.bufferBase); - } - maybeNext() { - let next = this.stack.parent; - if (next != null) { - this.index = this.stack.bufferBase - next.bufferBase; - this.stack = next; - this.buffer = next.buffer; - } - } - get id() { - return this.buffer[this.index - 4]; - } - get start() { - return this.buffer[this.index - 3]; - } - get end() { - return this.buffer[this.index - 2]; - } - get size() { - return this.buffer[this.index - 1]; - } - next() { - this.index -= 4; - this.pos -= 4; - if (this.index == 0) - this.maybeNext(); - } - fork() { - return new StackBufferCursor2(this.stack, this.pos, this.index); - } - }; - var CachedToken2 = class { - constructor() { - this.start = -1; - this.value = -1; - this.end = -1; - this.extended = -1; - this.lookAhead = 0; - this.mask = 0; - this.context = 0; - } - }; - var nullToken2 = new CachedToken2(); - var InputStream2 = class { - constructor(input, ranges) { - this.input = input; - this.ranges = ranges; - this.chunk = ""; - this.chunkOff = 0; - this.chunk2 = ""; - this.chunk2Pos = 0; - this.next = -1; - this.token = nullToken2; - this.rangeIndex = 0; - this.pos = this.chunkPos = ranges[0].from; - this.range = ranges[0]; - this.end = ranges[ranges.length - 1].to; - this.readNext(); - } - resolveOffset(offset, assoc) { - let range = this.range, index = this.rangeIndex; - let pos = this.pos + offset; - while (pos < range.from) { - if (!index) - return null; - let next = this.ranges[--index]; - pos -= range.from - next.to; - range = next; - } - while (assoc < 0 ? pos > range.to : pos >= range.to) { - if (index == this.ranges.length - 1) - return null; - let next = this.ranges[++index]; - pos += next.from - range.to; - range = next; - } - return pos; - } - peek(offset) { - let idx = this.chunkOff + offset, pos, result; - if (idx >= 0 && idx < this.chunk.length) { - pos = this.pos + offset; - result = this.chunk.charCodeAt(idx); - } else { - let resolved = this.resolveOffset(offset, 1); - if (resolved == null) - return -1; - pos = resolved; - if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) { - result = this.chunk2.charCodeAt(pos - this.chunk2Pos); - } else { - let i = this.rangeIndex, range = this.range; - while (range.to <= pos) - range = this.ranges[++i]; - this.chunk2 = this.input.chunk(this.chunk2Pos = pos); - if (pos + this.chunk2.length > range.to) - this.chunk2 = this.chunk2.slice(0, range.to - pos); - result = this.chunk2.charCodeAt(0); - } - } - if (pos >= this.token.lookAhead) - this.token.lookAhead = pos + 1; - return result; - } - acceptToken(token, endOffset = 0) { - let end = endOffset ? this.resolveOffset(endOffset, -1) : this.pos; - if (end == null || end < this.token.start) - throw new RangeError("Token end out of bounds"); - this.token.value = token; - this.token.end = end; - } - getChunk() { - if (this.pos >= this.chunk2Pos && this.pos < this.chunk2Pos + this.chunk2.length) { - let { chunk, chunkPos } = this; - this.chunk = this.chunk2; - this.chunkPos = this.chunk2Pos; - this.chunk2 = chunk; - this.chunk2Pos = chunkPos; - this.chunkOff = this.pos - this.chunkPos; - } else { - this.chunk2 = this.chunk; - this.chunk2Pos = this.chunkPos; - let nextChunk = this.input.chunk(this.pos); - let end = this.pos + nextChunk.length; - this.chunk = end > this.range.to ? nextChunk.slice(0, this.range.to - this.pos) : nextChunk; - this.chunkPos = this.pos; - this.chunkOff = 0; - } - } - readNext() { - if (this.chunkOff >= this.chunk.length) { - this.getChunk(); - if (this.chunkOff == this.chunk.length) - return this.next = -1; - } - return this.next = this.chunk.charCodeAt(this.chunkOff); - } - advance(n = 1) { - this.chunkOff += n; - while (this.pos + n >= this.range.to) { - if (this.rangeIndex == this.ranges.length - 1) - return this.setDone(); - n -= this.range.to - this.pos; - this.range = this.ranges[++this.rangeIndex]; - this.pos = this.range.from; - } - this.pos += n; - if (this.pos >= this.token.lookAhead) - this.token.lookAhead = this.pos + 1; - return this.readNext(); - } - setDone() { - this.pos = this.chunkPos = this.end; - this.range = this.ranges[this.rangeIndex = this.ranges.length - 1]; - this.chunk = ""; - return this.next = -1; - } - reset(pos, token) { - if (token) { - this.token = token; - token.start = pos; - token.lookAhead = pos + 1; - token.value = token.extended = -1; - } else { - this.token = nullToken2; - } - if (this.pos != pos) { - this.pos = pos; - if (pos == this.end) { - this.setDone(); - return this; - } - while (pos < this.range.from) - this.range = this.ranges[--this.rangeIndex]; - while (pos >= this.range.to) - this.range = this.ranges[++this.rangeIndex]; - if (pos >= this.chunkPos && pos < this.chunkPos + this.chunk.length) { - this.chunkOff = pos - this.chunkPos; - } else { - this.chunk = ""; - this.chunkOff = 0; - } - this.readNext(); - } - return this; - } - read(from2, to) { - if (from2 >= this.chunkPos && to <= this.chunkPos + this.chunk.length) - return this.chunk.slice(from2 - this.chunkPos, to - this.chunkPos); - if (from2 >= this.chunk2Pos && to <= this.chunk2Pos + this.chunk2.length) - return this.chunk2.slice(from2 - this.chunk2Pos, to - this.chunk2Pos); - if (from2 >= this.range.from && to <= this.range.to) - return this.input.read(from2, to); - let result = ""; - for (let r of this.ranges) { - if (r.from >= to) - break; - if (r.to > from2) - result += this.input.read(Math.max(r.from, from2), Math.min(r.to, to)); - } - return result; - } - }; - var TokenGroup2 = class { - constructor(data, id3) { - this.data = data; - this.id = id3; - } - token(input, stack) { - readToken2(this.data, input, stack, this.id); - } - }; - TokenGroup2.prototype.contextual = TokenGroup2.prototype.fallback = TokenGroup2.prototype.extend = false; - var ExternalTokenizer2 = class { - constructor(token, options = {}) { - this.token = token; - this.contextual = !!options.contextual; - this.fallback = !!options.fallback; - this.extend = !!options.extend; - } - }; - function readToken2(data, input, stack, group) { - let state = 0, groupMask = 1 << group, { parser: parser7 } = stack.p, { dialect } = parser7; - scan: - for (; ; ) { - if ((groupMask & data[state]) == 0) - break; - let accEnd = data[state + 1]; - for (let i = state + 3; i < accEnd; i += 2) - if ((data[i + 1] & groupMask) > 0) { - let term = data[i]; - if (dialect.allows(term) && (input.token.value == -1 || input.token.value == term || parser7.overrides(term, input.token.value))) { - input.acceptToken(term); - break; - } - } - for (let next = input.next, low = 0, high = data[state + 2]; low < high; ) { - let mid = low + high >> 1; - let index = accEnd + mid + (mid << 1); - let from2 = data[index], to = data[index + 1]; - if (next < from2) - high = mid; - else if (next >= to) - low = mid + 1; - else { - state = data[index + 2]; - input.advance(); - continue scan; - } - } - break; - } - } - function decodeArray2(input, Type = Uint16Array) { - if (typeof input != "string") - return input; - let array2 = null; - for (let pos = 0, out = 0; pos < input.length; ) { - let value = 0; - for (; ; ) { - let next = input.charCodeAt(pos++), stop = false; - if (next == 126) { - value = 65535; - break; - } - if (next >= 92) - next--; - if (next >= 34) - next--; - let digit = next - 32; - if (digit >= 46) { - digit -= 46; - stop = true; - } - value += digit; - if (stop) - break; - value *= 46; - } - if (array2) - array2[out++] = value; - else - array2 = new Type(value); - } - return array2; - } - var verbose2 = typeof process != "undefined" && /\bparse\b/.test(process.env.LOG); - var stackIDs2 = null; - var Safety2; - (function(Safety4) { - Safety4[Safety4["Margin"] = 25] = "Margin"; - })(Safety2 || (Safety2 = {})); - function cutAt2(tree, pos, side) { - let cursor = tree.fullCursor(); - cursor.moveTo(pos); - for (; ; ) { - if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos))) - for (; ; ) { - if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError) - return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25)) : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25)); - if (side < 0 ? cursor.prevSibling() : cursor.nextSibling()) - break; - if (!cursor.parent()) - return side < 0 ? 0 : tree.length; - } - } - } - var FragmentCursor3 = class { - constructor(fragments, nodeSet) { - this.fragments = fragments; - this.nodeSet = nodeSet; - this.i = 0; - this.fragment = null; - this.safeFrom = -1; - this.safeTo = -1; - this.trees = []; - this.start = []; - this.index = []; - this.nextFragment(); - } - nextFragment() { - let fr = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++]; - if (fr) { - this.safeFrom = fr.openStart ? cutAt2(fr.tree, fr.from + fr.offset, 1) - fr.offset : fr.from; - this.safeTo = fr.openEnd ? cutAt2(fr.tree, fr.to + fr.offset, -1) - fr.offset : fr.to; - while (this.trees.length) { - this.trees.pop(); - this.start.pop(); - this.index.pop(); - } - this.trees.push(fr.tree); - this.start.push(-fr.offset); - this.index.push(0); - this.nextStart = this.safeFrom; - } else { - this.nextStart = 1e9; - } - } - nodeAt(pos) { - if (pos < this.nextStart) - return null; - while (this.fragment && this.safeTo <= pos) - this.nextFragment(); - if (!this.fragment) - return null; - for (; ; ) { - let last = this.trees.length - 1; - if (last < 0) { - this.nextFragment(); - return null; - } - let top2 = this.trees[last], index = this.index[last]; - if (index == top2.children.length) { - this.trees.pop(); - this.start.pop(); - this.index.pop(); - continue; - } - let next = top2.children[index]; - let start = this.start[last] + top2.positions[index]; - if (start > pos) { - this.nextStart = start; - return null; - } - if (next instanceof Tree) { - if (start == pos) { - if (start < this.safeFrom) - return null; - let end = start + next.length; - if (end <= this.safeTo) { - let lookAhead = next.prop(NodeProp.lookAhead); - if (!lookAhead || end + lookAhead < this.fragment.to) - return next; - } - } - this.index[last]++; - if (start + next.length >= Math.max(this.safeFrom, pos)) { - this.trees.push(next); - this.start.push(start); - this.index.push(0); - } - } else { - this.index[last]++; - this.nextStart = start + next.length; - } - } - } - }; - var TokenCache2 = class { - constructor(parser7, stream) { - this.stream = stream; - this.tokens = []; - this.mainToken = null; - this.actions = []; - this.tokens = parser7.tokenizers.map((_) => new CachedToken2()); - } - getActions(stack) { - let actionIndex = 0; - let main = null; - let { parser: parser7 } = stack.p, { tokenizers } = parser7; - let mask = parser7.stateSlot(stack.state, 3); - let context = stack.curContext ? stack.curContext.hash : 0; - let lookAhead = 0; - for (let i = 0; i < tokenizers.length; i++) { - if ((1 << i & mask) == 0) - continue; - let tokenizer = tokenizers[i], token = this.tokens[i]; - if (main && !tokenizer.fallback) - continue; - if (tokenizer.contextual || token.start != stack.pos || token.mask != mask || token.context != context) { - this.updateCachedToken(token, tokenizer, stack); - token.mask = mask; - token.context = context; - } - if (token.lookAhead > token.end + 25) - lookAhead = Math.max(token.lookAhead, lookAhead); - if (token.value != 0) { - let startIndex = actionIndex; - if (token.extended > -1) - actionIndex = this.addActions(stack, token.extended, token.end, actionIndex); - actionIndex = this.addActions(stack, token.value, token.end, actionIndex); - if (!tokenizer.extend) { - main = token; - if (actionIndex > startIndex) - break; - } - } - } - while (this.actions.length > actionIndex) - this.actions.pop(); - if (lookAhead) - stack.setLookAhead(lookAhead); - if (!main && stack.pos == this.stream.end) { - main = new CachedToken2(); - main.value = stack.p.parser.eofTerm; - main.start = main.end = stack.pos; - actionIndex = this.addActions(stack, main.value, main.end, actionIndex); - } - this.mainToken = main; - return this.actions; - } - getMainToken(stack) { - if (this.mainToken) - return this.mainToken; - let main = new CachedToken2(), { pos, p } = stack; - main.start = pos; - main.end = Math.min(pos + 1, p.stream.end); - main.value = pos == p.stream.end ? p.parser.eofTerm : 0; - return main; - } - updateCachedToken(token, tokenizer, stack) { - tokenizer.token(this.stream.reset(stack.pos, token), stack); - if (token.value > -1) { - let { parser: parser7 } = stack.p; - for (let i = 0; i < parser7.specialized.length; i++) - if (parser7.specialized[i] == token.value) { - let result = parser7.specializers[i](this.stream.read(token.start, token.end), stack); - if (result >= 0 && stack.p.parser.dialect.allows(result >> 1)) { - if ((result & 1) == 0) - token.value = result >> 1; - else - token.extended = result >> 1; - break; - } - } - } else { - token.value = 0; - token.end = Math.min(stack.p.stream.end, stack.pos + 1); - } - } - putAction(action, token, end, index) { - for (let i = 0; i < index; i += 3) - if (this.actions[i] == action) - return index; - this.actions[index++] = action; - this.actions[index++] = token; - this.actions[index++] = end; - return index; - } - addActions(stack, token, end, index) { - let { state } = stack, { parser: parser7 } = stack.p, { data } = parser7; - for (let set = 0; set < 2; set++) { - for (let i = parser7.stateSlot(state, set ? 2 : 1); ; i += 3) { - if (data[i] == 65535) { - if (data[i + 1] == 1) { - i = pair2(data, i + 2); - } else { - if (index == 0 && data[i + 1] == 2) - index = this.putAction(pair2(data, i + 2), token, end, index); - break; - } - } - if (data[i] == token) - index = this.putAction(pair2(data, i + 1), token, end, index); - } - } - return index; - } - }; - var Rec2; - (function(Rec4) { - Rec4[Rec4["Distance"] = 5] = "Distance"; - Rec4[Rec4["MaxRemainingPerStep"] = 3] = "MaxRemainingPerStep"; - Rec4[Rec4["MinBufferLengthPrune"] = 500] = "MinBufferLengthPrune"; - Rec4[Rec4["ForceReduceLimit"] = 10] = "ForceReduceLimit"; - Rec4[Rec4["CutDepth"] = 15e3] = "CutDepth"; - Rec4[Rec4["CutTo"] = 9e3] = "CutTo"; - })(Rec2 || (Rec2 = {})); - var Parse2 = class { - constructor(parser7, input, fragments, ranges) { - this.parser = parser7; - this.input = input; - this.ranges = ranges; - this.recovering = 0; - this.nextStackID = 9812; - this.minStackPos = 0; - this.reused = []; - this.stoppedAt = null; - this.stream = new InputStream2(input, ranges); - this.tokens = new TokenCache2(parser7, this.stream); - this.topTerm = parser7.top[1]; - let { from: from2 } = ranges[0]; - this.stacks = [Stack2.start(this, parser7.top[0], from2)]; - this.fragments = fragments.length && this.stream.end - from2 > parser7.bufferLength * 4 ? new FragmentCursor3(fragments, parser7.nodeSet) : null; - } - get parsedPos() { - return this.minStackPos; - } - advance() { - let stacks = this.stacks, pos = this.minStackPos; - let newStacks = this.stacks = []; - let stopped, stoppedTokens; - for (let i = 0; i < stacks.length; i++) { - let stack = stacks[i]; - for (; ; ) { - this.tokens.mainToken = null; - if (stack.pos > pos) { - newStacks.push(stack); - } else if (this.advanceStack(stack, newStacks, stacks)) { - continue; - } else { - if (!stopped) { - stopped = []; - stoppedTokens = []; - } - stopped.push(stack); - let tok = this.tokens.getMainToken(stack); - stoppedTokens.push(tok.value, tok.end); - } - break; - } - } - if (!newStacks.length) { - let finished = stopped && findFinished2(stopped); - if (finished) - return this.stackToTree(finished); - if (this.parser.strict) { - if (verbose2 && stopped) - console.log("Stuck with token " + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : "none")); - throw new SyntaxError("No parse at " + pos); - } - if (!this.recovering) - this.recovering = 5; - } - if (this.recovering && stopped) { - let finished = this.stoppedAt != null && stopped[0].pos > this.stoppedAt ? stopped[0] : this.runRecovery(stopped, stoppedTokens, newStacks); - if (finished) - return this.stackToTree(finished.forceAll()); - } - if (this.recovering) { - let maxRemaining = this.recovering == 1 ? 1 : this.recovering * 3; - if (newStacks.length > maxRemaining) { - newStacks.sort((a, b) => b.score - a.score); - while (newStacks.length > maxRemaining) - newStacks.pop(); - } - if (newStacks.some((s) => s.reducePos > pos)) - this.recovering--; - } else if (newStacks.length > 1) { - outer: - for (let i = 0; i < newStacks.length - 1; i++) { - let stack = newStacks[i]; - for (let j = i + 1; j < newStacks.length; j++) { - let other = newStacks[j]; - if (stack.sameState(other) || stack.buffer.length > 500 && other.buffer.length > 500) { - if ((stack.score - other.score || stack.buffer.length - other.buffer.length) > 0) { - newStacks.splice(j--, 1); - } else { - newStacks.splice(i--, 1); - continue outer; - } - } - } - } - } - this.minStackPos = newStacks[0].pos; - for (let i = 1; i < newStacks.length; i++) - if (newStacks[i].pos < this.minStackPos) - this.minStackPos = newStacks[i].pos; - return null; - } - stopAt(pos) { - if (this.stoppedAt != null && this.stoppedAt < pos) - throw new RangeError("Can't move stoppedAt forward"); - this.stoppedAt = pos; - } - advanceStack(stack, stacks, split) { - let start = stack.pos, { parser: parser7 } = this; - let base2 = verbose2 ? this.stackID(stack) + " -> " : ""; - if (this.stoppedAt != null && start > this.stoppedAt) - return stack.forceReduce() ? stack : null; - if (this.fragments) { - let strictCx = stack.curContext && stack.curContext.tracker.strict, cxHash = strictCx ? stack.curContext.hash : 0; - for (let cached = this.fragments.nodeAt(start); cached; ) { - let match2 = this.parser.nodeSet.types[cached.type.id] == cached.type ? parser7.getGoto(stack.state, cached.type.id) : -1; - if (match2 > -1 && cached.length && (!strictCx || (cached.prop(NodeProp.contextHash) || 0) == cxHash)) { - stack.useNode(cached, match2); - if (verbose2) - console.log(base2 + this.stackID(stack) + ` (via reuse of ${parser7.getName(cached.type.id)})`); - return true; - } - if (!(cached instanceof Tree) || cached.children.length == 0 || cached.positions[0] > 0) - break; - let inner = cached.children[0]; - if (inner instanceof Tree && cached.positions[0] == 0) - cached = inner; - else - break; - } - } - let defaultReduce = parser7.stateSlot(stack.state, 4); - if (defaultReduce > 0) { - stack.reduce(defaultReduce); - if (verbose2) - console.log(base2 + this.stackID(stack) + ` (via always-reduce ${parser7.getName(defaultReduce & 65535)})`); - return true; - } - if (stack.stack.length >= 15e3) { - while (stack.stack.length > 9e3 && stack.forceReduce()) { - } - } - let actions = this.tokens.getActions(stack); - for (let i = 0; i < actions.length; ) { - let action = actions[i++], term = actions[i++], end = actions[i++]; - let last = i == actions.length || !split; - let localStack = last ? stack : stack.split(); - localStack.apply(action, term, end); - if (verbose2) - console.log(base2 + this.stackID(localStack) + ` (via ${(action & 65536) == 0 ? "shift" : `reduce of ${parser7.getName(action & 65535)}`} for ${parser7.getName(term)} @ ${start}${localStack == stack ? "" : ", split"})`); - if (last) - return true; - else if (localStack.pos > start) - stacks.push(localStack); - else - split.push(localStack); - } - return false; - } - advanceFully(stack, newStacks) { - let pos = stack.pos; - for (; ; ) { - if (!this.advanceStack(stack, null, null)) - return false; - if (stack.pos > pos) { - pushStackDedup2(stack, newStacks); - return true; - } - } - } - runRecovery(stacks, tokens, newStacks) { - let finished = null, restarted = false; - for (let i = 0; i < stacks.length; i++) { - let stack = stacks[i], token = tokens[i << 1], tokenEnd = tokens[(i << 1) + 1]; - let base2 = verbose2 ? this.stackID(stack) + " -> " : ""; - if (stack.deadEnd) { - if (restarted) - continue; - restarted = true; - stack.restart(); - if (verbose2) - console.log(base2 + this.stackID(stack) + " (restarted)"); - let done = this.advanceFully(stack, newStacks); - if (done) - continue; - } - let force = stack.split(), forceBase = base2; - for (let j = 0; force.forceReduce() && j < 10; j++) { - if (verbose2) - console.log(forceBase + this.stackID(force) + " (via force-reduce)"); - let done = this.advanceFully(force, newStacks); - if (done) - break; - if (verbose2) - forceBase = this.stackID(force) + " -> "; - } - for (let insert4 of stack.recoverByInsert(token)) { - if (verbose2) - console.log(base2 + this.stackID(insert4) + " (via recover-insert)"); - this.advanceFully(insert4, newStacks); - } - if (this.stream.end > stack.pos) { - if (tokenEnd == stack.pos) { - tokenEnd++; - token = 0; - } - stack.recoverByDelete(token, tokenEnd); - if (verbose2) - console.log(base2 + this.stackID(stack) + ` (via recover-delete ${this.parser.getName(token)})`); - pushStackDedup2(stack, newStacks); - } else if (!finished || finished.score < stack.score) { - finished = stack; - } - } - return finished; - } - stackToTree(stack) { - stack.close(); - return Tree.build({ - buffer: StackBufferCursor2.create(stack), - nodeSet: this.parser.nodeSet, - topID: this.topTerm, - maxBufferLength: this.parser.bufferLength, - reused: this.reused, - start: this.ranges[0].from, - length: stack.pos - this.ranges[0].from, - minRepeatType: this.parser.minRepeatTerm - }); - } - stackID(stack) { - let id3 = (stackIDs2 || (stackIDs2 = /* @__PURE__ */ new WeakMap())).get(stack); - if (!id3) - stackIDs2.set(stack, id3 = String.fromCodePoint(this.nextStackID++)); - return id3 + stack; - } - }; - function pushStackDedup2(stack, newStacks) { - for (let i = 0; i < newStacks.length; i++) { - let other = newStacks[i]; - if (other.pos == stack.pos && other.sameState(stack)) { - if (newStacks[i].score < stack.score) - newStacks[i] = stack; - return; - } - } - newStacks.push(stack); - } - var Dialect2 = class { - constructor(source, flags, disabled) { - this.source = source; - this.flags = flags; - this.disabled = disabled; - } - allows(term) { - return !this.disabled || this.disabled[term] == 0; - } - }; - var id2 = (x) => x; - var ContextTracker2 = class { - constructor(spec) { - this.start = spec.start; - this.shift = spec.shift || id2; - this.reduce = spec.reduce || id2; - this.reuse = spec.reuse || id2; - this.hash = spec.hash || (() => 0); - this.strict = spec.strict !== false; - } - }; - var LRParser2 = class extends Parser { - constructor(spec) { - super(); - this.wrappers = []; - if (spec.version != 13) - throw new RangeError(`Parser version (${spec.version}) doesn't match runtime version (${13})`); - let nodeNames = spec.nodeNames.split(" "); - this.minRepeatTerm = nodeNames.length; - for (let i = 0; i < spec.repeatNodeCount; i++) - nodeNames.push(""); - let topTerms = Object.keys(spec.topRules).map((r) => spec.topRules[r][1]); - let nodeProps = []; - for (let i = 0; i < nodeNames.length; i++) - nodeProps.push([]); - function setProp(nodeID, prop, value) { - nodeProps[nodeID].push([prop, prop.deserialize(String(value))]); - } - if (spec.nodeProps) - for (let propSpec of spec.nodeProps) { - let prop = propSpec[0]; - for (let i = 1; i < propSpec.length; ) { - let next = propSpec[i++]; - if (next >= 0) { - setProp(next, prop, propSpec[i++]); - } else { - let value = propSpec[i + -next]; - for (let j = -next; j > 0; j--) - setProp(propSpec[i++], prop, value); - i++; - } - } - } - this.nodeSet = new NodeSet(nodeNames.map((name3, i) => NodeType.define({ - name: i >= this.minRepeatTerm ? void 0 : name3, - id: i, - props: nodeProps[i], - top: topTerms.indexOf(i) > -1, - error: i == 0, - skipped: spec.skippedNodes && spec.skippedNodes.indexOf(i) > -1 - }))); - this.strict = false; - this.bufferLength = DefaultBufferLength; - let tokenArray = decodeArray2(spec.tokenData); - this.context = spec.context; - this.specialized = new Uint16Array(spec.specialized ? spec.specialized.length : 0); - this.specializers = []; - if (spec.specialized) - for (let i = 0; i < spec.specialized.length; i++) { - this.specialized[i] = spec.specialized[i].term; - this.specializers[i] = spec.specialized[i].get; - } - this.states = decodeArray2(spec.states, Uint32Array); - this.data = decodeArray2(spec.stateData); - this.goto = decodeArray2(spec.goto); - this.maxTerm = spec.maxTerm; - this.tokenizers = spec.tokenizers.map((value) => typeof value == "number" ? new TokenGroup2(tokenArray, value) : value); - this.topRules = spec.topRules; - this.dialects = spec.dialects || {}; - this.dynamicPrecedences = spec.dynamicPrecedences || null; - this.tokenPrecTable = spec.tokenPrec; - this.termNames = spec.termNames || null; - this.maxNode = this.nodeSet.types.length - 1; - this.dialect = this.parseDialect(); - this.top = this.topRules[Object.keys(this.topRules)[0]]; - } - createParse(input, fragments, ranges) { - let parse = new Parse2(this, input, fragments, ranges); - for (let w of this.wrappers) - parse = w(parse, input, fragments, ranges); - return parse; - } - getGoto(state, term, loose = false) { - let table = this.goto; - if (term >= table[0]) - return -1; - for (let pos = table[term + 1]; ; ) { - let groupTag = table[pos++], last = groupTag & 1; - let target = table[pos++]; - if (last && loose) - return target; - for (let end = pos + (groupTag >> 1); pos < end; pos++) - if (table[pos] == state) - return target; - if (last) - return -1; - } - } - hasAction(state, terminal) { - let data = this.data; - for (let set = 0; set < 2; set++) { - for (let i = this.stateSlot(state, set ? 2 : 1), next; ; i += 3) { - if ((next = data[i]) == 65535) { - if (data[i + 1] == 1) - next = data[i = pair2(data, i + 2)]; - else if (data[i + 1] == 2) - return pair2(data, i + 2); - else - break; - } - if (next == terminal || next == 0) - return pair2(data, i + 1); - } - } - return 0; - } - stateSlot(state, slot) { - return this.states[state * 6 + slot]; - } - stateFlag(state, flag) { - return (this.stateSlot(state, 0) & flag) > 0; - } - validAction(state, action) { - if (action == this.stateSlot(state, 4)) - return true; - for (let i = this.stateSlot(state, 1); ; i += 3) { - if (this.data[i] == 65535) { - if (this.data[i + 1] == 1) - i = pair2(this.data, i + 2); - else - return false; - } - if (action == pair2(this.data, i + 1)) - return true; - } - } - nextStates(state) { - let result = []; - for (let i = this.stateSlot(state, 1); ; i += 3) { - if (this.data[i] == 65535) { - if (this.data[i + 1] == 1) - i = pair2(this.data, i + 2); - else - break; - } - if ((this.data[i + 2] & 65536 >> 16) == 0) { - let value = this.data[i + 1]; - if (!result.some((v, i2) => i2 & 1 && v == value)) - result.push(this.data[i], value); - } - } - return result; - } - overrides(token, prev) { - let iPrev = findOffset2(this.data, this.tokenPrecTable, prev); - return iPrev < 0 || findOffset2(this.data, this.tokenPrecTable, token) < iPrev; - } - configure(config2) { - let copy = Object.assign(Object.create(LRParser2.prototype), this); - if (config2.props) - copy.nodeSet = this.nodeSet.extend(...config2.props); - if (config2.top) { - let info = this.topRules[config2.top]; - if (!info) - throw new RangeError(`Invalid top rule name ${config2.top}`); - copy.top = info; - } - if (config2.tokenizers) - copy.tokenizers = this.tokenizers.map((t3) => { - let found = config2.tokenizers.find((r) => r.from == t3); - return found ? found.to : t3; - }); - if (config2.contextTracker) - copy.context = config2.contextTracker; - if (config2.dialect) - copy.dialect = this.parseDialect(config2.dialect); - if (config2.strict != null) - copy.strict = config2.strict; - if (config2.wrap) - copy.wrappers = copy.wrappers.concat(config2.wrap); - if (config2.bufferLength != null) - copy.bufferLength = config2.bufferLength; - return copy; - } - getName(term) { - return this.termNames ? this.termNames[term] : String(term <= this.maxNode && this.nodeSet.types[term].name || term); - } - get eofTerm() { - return this.maxNode + 1; - } - get topNode() { - return this.nodeSet.types[this.top[1]]; - } - dynamicPrecedence(term) { - let prec4 = this.dynamicPrecedences; - return prec4 == null ? 0 : prec4[term] || 0; - } - parseDialect(dialect) { - let values2 = Object.keys(this.dialects), flags = values2.map(() => false); - if (dialect) - for (let part of dialect.split(" ")) { - let id3 = values2.indexOf(part); - if (id3 >= 0) - flags[id3] = true; - } - let disabled = null; - for (let i = 0; i < values2.length; i++) - if (!flags[i]) { - for (let j = this.dialects[values2[i]], id3; (id3 = this.data[j++]) != 65535; ) - (disabled || (disabled = new Uint8Array(this.maxTerm + 1)))[id3] = 1; - } - return new Dialect2(dialect, flags, disabled); - } - static deserialize(spec) { - return new LRParser2(spec); - } - }; - function pair2(data, off) { - return data[off] | data[off + 1] << 16; - } - function findOffset2(data, start, term) { - for (let i = start, next; (next = data[i]) != 65535; i++) - if (next == term) - return i - start; - return -1; - } - function findFinished2(stacks) { - let best = null; - for (let stack of stacks) { - let stopped = stack.p.stoppedAt; - if ((stack.pos == stack.p.stream.end || stopped != null && stack.pos > stopped) && stack.p.parser.stateFlag(stack.state, 2) && (!best || best.score < stack.score)) - best = stack; - } - return best; - } - - // node_modules/@lezer/php/dist/index.es.js - var castOpen = 1; - var HeredocString = 2; - var interpolatedStringContent = 262; - var EscapeSequence = 3; - var afterInterpolation = 263; - var automaticSemicolon = 264; - var eof = 265; - var abstract = 4; - var and = 5; - var array = 6; - var as = 7; - var Boolean = 8; - var _break = 9; - var _case = 10; - var _catch = 11; - var _class = 12; - var clone = 13; - var _const = 14; - var _continue = 15; - var _default = 16; - var declare = 17; - var _do = 18; - var echo = 19; - var _else = 20; - var elseif = 21; - var enddeclare = 22; - var endfor = 23; - var endforeach = 24; - var endif = 25; - var endswitch = 26; - var endwhile = 27; - var _enum = 28; - var _extends = 29; - var final = 30; - var _finally = 31; - var fn = 32; - var _for = 33; - var foreach = 34; - var from = 35; - var _function = 36; - var global = 37; - var goto = 38; - var _if = 39; - var _implements = 40; - var include = 41; - var include_once = 42; - var _instanceof = 43; - var insteadof = 44; - var _interface = 45; - var list = 46; - var match = 47; - var namespace = 48; - var _new = 49; - var _null = 50; - var or = 51; - var print = 52; - var require2 = 53; - var require_once = 54; - var _return = 55; - var _switch = 56; - var _throw = 57; - var trait = 58; - var _try = 59; - var unset = 60; - var use = 61; - var _var = 62; - var Visibility = 63; - var _while = 64; - var xor = 65; - var _yield = 66; - var keywordMap = { - abstract, - and, - array, - as, - true: Boolean, - false: Boolean, - break: _break, - case: _case, - catch: _catch, - class: _class, - clone, - const: _const, - continue: _continue, - declare, - default: _default, - do: _do, - echo, - else: _else, - elseif, - enddeclare, - endfor, - endforeach, - endif, - endswitch, - endwhile, - enum: _enum, - extends: _extends, - final, - finally: _finally, - fn, - for: _for, - foreach, - from, - function: _function, - global, - goto, - if: _if, - implements: _implements, - include, - include_once, - instanceof: _instanceof, - insteadof, - interface: _interface, - list, - match, - namespace, - new: _new, - null: _null, - or, - print, - require: require2, - require_once, - return: _return, - switch: _switch, - throw: _throw, - trait, - try: _try, - unset, - use, - var: _var, - public: Visibility, - private: Visibility, - protected: Visibility, - while: _while, - xor, - yield: _yield, - __proto__: null - }; - function keywords(name3) { - let found = keywordMap[name3.toLowerCase()]; - return found == null ? -1 : found; - } - function isSpace(ch) { - return ch == 9 || ch == 10 || ch == 13 || ch == 32; - } - function isASCIILetter(ch) { - return ch >= 97 && ch <= 122 || ch >= 65 && ch <= 90; - } - function isIdentifierStart(ch) { - return ch == 95 || ch >= 128 || isASCIILetter(ch); - } - function isHex(ch) { - return ch >= 48 && ch <= 55 || ch >= 97 && ch <= 102 || ch >= 65 && ch <= 70; - } - var castTypes = { - int: true, - integer: true, - bool: true, - boolean: true, - float: true, - double: true, - real: true, - string: true, - array: true, - object: true, - unset: true, - __proto__: null - }; - var expression = new ExternalTokenizer2((input) => { - if (input.next == 40) { - input.advance(); - let peek = 0; - while (isSpace(input.peek(peek))) - peek++; - let name3 = "", next; - while (isASCIILetter(next = input.peek(peek))) { - name3 += String.fromCharCode(next); - peek++; - } - while (isSpace(input.peek(peek))) - peek++; - if (input.peek(peek) == 41 && castTypes[name3.toLowerCase()]) - input.acceptToken(castOpen); - } else if (input.next == 60 && input.peek(1) == 60 && input.peek(2) == 60) { - for (let i = 0; i < 3; i++) - input.advance(); - while (input.next == 32 || input.next == 9) - input.advance(); - let quoted = input.next == 39; - if (quoted) - input.advance(); - if (!isIdentifierStart(input.next)) - return; - let tag = String.fromCharCode(input.next); - for (; ; ) { - input.advance(); - if (!isIdentifierStart(input.next) && !(input.next >= 48 && input.next <= 55)) - break; - tag += String.fromCharCode(input.next); - } - if (quoted) { - if (input.next != 39) - return; - input.advance(); - } - if (input.next != 10 && input.next != 13) - return; - for (; ; ) { - let lineStart = input.next == 10 || input.next == 13; - input.advance(); - if (input.next < 0) - return; - if (lineStart) { - while (input.next == 32 || input.next == 9) - input.advance(); - let match2 = true; - for (let i = 0; i < tag.length; i++) { - if (input.next != tag.charCodeAt(i)) { - match2 = false; - break; - } - input.advance(); - } - if (match2) - return input.acceptToken(HeredocString); - } - } - } - }); - var eofToken = new ExternalTokenizer2((input) => { - if (input.next < 0) - input.acceptToken(eof); - }); - var semicolon2 = new ExternalTokenizer2((input, stack) => { - if (input.next == 63 && stack.canShift(automaticSemicolon) && input.peek(1) == 62) - input.acceptToken(automaticSemicolon); - }); - function scanEscape(input) { - let after = input.peek(1); - if (after == 110 || after == 114 || after == 116 || after == 118 || after == 101 || after == 102 || after == 92 || after == 36 || after == 34 || after == 123) - return 2; - if (after >= 48 && after <= 55) { - let size = 2, next; - while (size < 5 && (next = input.peek(size)) >= 48 && next <= 55) - size++; - return size; - } - if (after == 120 && isHex(input.peek(2))) { - return isHex(input.peek(3)) ? 4 : 3; - } - if (after == 117 && input.peek(2) == 123) { - for (let size = 3; ; size++) { - let next = input.peek(size); - if (next == 125) - return size == 2 ? 0 : size + 1; - if (!isHex(next)) - break; - } - } - return 0; - } - var interpolated = new ExternalTokenizer2((input, stack) => { - let content3 = false; - for (; ; content3 = true) { - if (input.next == 34 || input.next < 0 || input.next == 36 && (isIdentifierStart(input.peek(1)) || input.peek(1) == 123) || input.next == 123 && input.peek(1) == 36) { - break; - } else if (input.next == 92) { - let escaped = scanEscape(input); - if (escaped) { - if (content3) - break; - else - return input.acceptToken(EscapeSequence, escaped); - } - } else if (!content3 && (input.next == 91 || input.next == 45 && input.peek(1) == 62 && isIdentifierStart(input.peek(2)) || input.next == 63 && input.peek(1) == 45 && input.peek(2) == 62 && isIdentifierStart(input.peek(3))) && stack.canShift(afterInterpolation)) { - break; - } - input.advance(); - } - if (content3) - input.acceptToken(interpolatedStringContent); - }); - var spec_Name = { __proto__: null, static: 311, STATIC: 311 }; - var parser2 = LRParser2.deserialize({ - version: 13, - states: "$F|Q`OWOOQhQaOOP%oO`OOOOO#t'#H^'#H^O%tO#|O'#DuOOO#u'#Dx'#DxQ&SOWO'#DxO&XO$VOOOOQ#u'#Dy'#DyO&lQaO'#D}O(mQdO'#FOO(tQdO'#ERO*kQaO'#EXO,zQ`O'#EUO-PQ`O'#E_O/nQaO'#E_O/uQ`O'#EgO/zQ`O'#EpO*kQaO'#EpO0VQ`O'#HgO0[Q`O'#E|O0[Q`O'#E|OOQS'#Ib'#IbO0aQ`O'#EwOOQS'#IY'#IYO2oQdO'#IVO6tQeO'#FUO*kQaO'#FeO*kQaO'#FfO*kQaO'#FgO*kQaO'#FhO*kQaO'#FhO*kQaO'#FkOOQO'#Ic'#IcO7RQ`O'#FqOOQO'#Hh'#HhO7ZQ`O'#G}O7uQ`O'#FlO8QQ`O'#H[O8]Q`O'#FvO8eQaO'#FwO*kQaO'#GUO*kQaO'#GXO8}OrO'#G[OOQS'#Ip'#IpOOQS'#Io'#IoOOQS'#IV'#IVO,zQ`O'#GcO,zQ`O'#GeO,zQ`O'#GjOhQaO'#GlO9UQ`O'#GmO9ZQ`O'#GpO9`Q`O'#GsO9eQeO'#GtO9eQeO'#GuO9eQeO'#GvO9oQ`O'#GwO9tQ`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`4a4b4c4d4e4f4g4h4i4j4k4l4m4n4o4p4q4r4s4t4u4v4w5P5d5g5h5k5o5p5s$O=y_j!]!i#k#n#o#s#t%R%T&o&r&s&v&}'y(k(z)O)k*O*T,U,W-Q6]6^6_6`6a6b6c6d6e6f6g6h6i6j6k6l6m6n6o6p6q6r6s6t6u6y6z6{7W7k7n7q7v7{8S8T8W8Y8Z8e8f8g8h#|>[!y!z!}%c&W)s)u*S*n,S-c-j.s/b/h/l0c0u4V6S7h7r7t7y8i8j8k8l8m8n8o8p8q8r8s8t8u8v8w8x8y8z8{8|8}9O9P9Q9R9S9Y9Z9[9g9x9|9}:Q:X:Y:^:`:a;b;c=Y=l=m!v>]+y-P9U9W:c:d:e:f:g:i:j:l:n:o:q:s:u:w:y:{:};P;R;T;V;X;Z;];_;d;f;h;s^0U1[9V:h:k:m:p:r:t:v:x:z:|;O;Q;S;U;W;Y;[;^;`;e;g;t AssignmentExpression ArrayExpression ValueList & VariadicUnpacking ... Pair [ ] ListExpression ValueList Pair Pair SubscriptExpression MemberExpression -> ?-> VariableName DynamicVariable $ ${ CallExpression ArgList NamedArgument SpreadArgument CastExpression UnionType LogicOp OptionalType NamedType QualifiedName \\ NamespaceName ScopedExpression :: AssignOp UpdateExpression UpdateOp YieldExpression BinaryExpression LogicOp LogicOp LogicOp BitOp BitOp BitOp CompareOp CompareOp BitOp ArithOp ConcatOp ArithOp ArithOp IncludeExpression RequireExpression CloneExpression UnaryExpression ControlOp LogicOp PrintIntrinsic FunctionExpression static ParamList Parameter #[ Attributes Attribute VariadicParameter PropertyParameter UseList ArrowFunction NewExpression BaseClause ClassInterfaceClause DeclarationList ConstDeclaration VariableDeclarator PropertyDeclaration VariableDeclarator MethodDeclaration UseDeclaration UseList UseInsteadOfClause UseAsClause UpdateExpression ArithOp ShellExpression ThrowExpression Integer Float String MemberExpression SubscriptExpression UnaryExpression ArithOp Interpolation String IfStatement ColonBlock SwitchStatement Block CaseStatement DefaultStatement ColonBlock WhileStatement EmptyStatement DoStatement ForStatement ForSpec SequenceExpression ForeachStatement ForSpec Pair GotoStatement ContinueStatement BreakStatement ReturnStatement TryStatement CatchDeclarator DeclareStatement EchoStatement UnsetStatement ConstDeclaration FunctionDefinition ClassDeclaration InterfaceDeclaration TraitDeclaration EnumDeclaration EnumBody EnumCase NamespaceDefinition NamespaceUseDeclaration UseGroup UseClause UseClause GlobalDeclaration FunctionStaticDeclaration Program", - maxTerm: 303, - nodeProps: [ - [NodeProp.group, -36, 2, 8, 50, 82, 84, 86, 89, 94, 95, 103, 107, 108, 111, 112, 115, 119, 124, 127, 130, 132, 133, 147, 148, 149, 150, 153, 154, 164, 165, 178, 180, 181, 182, 183, 184, 190, "Expression", -28, 75, 79, 81, 83, 191, 193, 198, 200, 201, 204, 207, 208, 209, 210, 211, 213, 214, 215, 216, 217, 218, 219, 220, 221, 224, 225, 229, 230, "Statement", -3, 120, 122, 123, "Type"], - [NodeProp.openedBy, 70, "phpOpen", 77, "{", 87, "(", 102, "#["], - [NodeProp.closedBy, 72, "phpClose", 78, "}", 88, ")", 158, "]"] - ], - skippedNodes: [0], - repeatNodeCount: 29, - tokenData: "!5h_R!ZOX$tXY%nYZ&}Z]$t]^%n^p$tpq%nqr(]rs)wst*atu/nuv2_vw3`wx4gxy8Oyz8fz{8|{|:W|};_}!O;u!O!P=R!P!QBl!Q!RFr!R![Hn![!]Nz!]!^!!O!^!_!!f!_!`!%R!`!a!&V!a!b!'Z!b!c!*T!c!d!*k!d!e!+q!e!}!*k!}#O!-k#O#P!.R#P#Q!.i#Q#R!/P#R#S!*k#S#T!/j#T#U!*k#U#V!+q#V#o!*k#o#p!2y#p#q!3a#q#r!4j#r#s!5Q#s$f$t$f$g%n$g&j!*k&j$I_$t$I_$I`%n$I`$KW$t$KW$KX%n$KX?HT$t?HT?HU%n?HU~$tP$yT&vPOY$tYZ%YZ!^$t!^!_%_!_~$tP%_O&vPP%bSOY$tYZ%YZ!a$t!b~$tV%ub&vP&uUOX$tXY%nYZ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Q$t!Q![!*k![!^$t!^!_%_!_!c$t!c!}!*k!}#R$t#R#S!*k#S#T$t#T#o!*k#o$g$t$g&j!*k&j~$tR!-[T&vP'fQOY$tYZ%YZ!^$t!^!_%_!_~$tV!-rT#XU&vPOY$tYZ%YZ!^$t!^!_%_!_~$tV!.YT#qU&vPOY$tYZ%YZ!^$t!^!_%_!_~$tR!.pT#YQ&vPOY$tYZ%YZ!^$t!^!_%_!_~$tR!/WU$OQ&vPOY$tYZ%YZ!^$t!^!_%_!_!`2x!`~$tR!/oX&vPOY!/jYZ!0[Z!^!/j!^!_!1_!_#O!/j#O#P!1}#P#S!/j#S#T!2c#T~!/jR!0aT&vPO#O!0p#O#P!1S#P#S!0p#S#T!1Y#T~!0pQ!0sTO#O!0p#O#P!1S#P#S!0p#S#T!1Y#T~!0pQ!1VPO~!0pQ!1_O$zQR!1bXOY!/jYZ!0[Z!a!/j!a!b!0p!b#O!/j#O#P!1}#P#S!/j#S#T!2c#T~!/jR!2ST&vPOY!/jYZ!0[Z!^!/j!^!_!1_!_~!/jR!2jT$zQ&vPOY$tYZ%YZ!^$t!^!_%_!_~$tV!3QT!pU&vPOY$tYZ%YZ!^$t!^!_%_!_~$tV!3jW#}Q#mS&vPOY$tYZ%YZ!^$t!^!_%_!_!`2x!`#p$t#p#q!4S#q~$tR!4ZT#{Q&vPOY$tYZ%YZ!^$t!^!_%_!_~$tR!4qT!oQ&vPOY$tYZ%YZ!^$t!^!_%_!_~$tR!5XT$^Q&vPOY$tYZ%YZ!^$t!^!_%_!_~$t", - tokenizers: [expression, interpolated, semicolon2, 0, 1, 2, 3, eofToken], - topRules: { "Template": [0, 73], "Program": [1, 231] }, - dynamicPrecedences: { "283": 1 }, - specialized: [{ term: 82, get: (value, stack) => keywords(value) << 1 }, { term: 82, get: (value) => spec_Name[value] || -1 }], - tokenPrec: 29359 - }); - - // node_modules/@lezer/html/dist/index.es.js - var scriptText = 53; - var StartCloseScriptTag = 1; - var styleText = 54; - var StartCloseStyleTag = 2; - var textareaText = 55; - var StartCloseTextareaTag = 3; - var StartTag = 4; - var StartScriptTag = 5; - var StartStyleTag = 6; - var StartTextareaTag = 7; - var StartSelfClosingTag = 8; - var StartCloseTag = 9; - var NoMatchStartCloseTag = 10; - var MismatchedStartCloseTag = 11; - var missingCloseTag = 56; - var IncompleteCloseTag = 12; - var commentContent$1 = 57; - var Element = 18; - var ScriptText = 27; - var StyleText = 30; - var TextareaText = 33; - var OpenTag = 35; - var Dialect_noMatch = 0; - var selfClosers = { - area: true, - base: true, - br: true, - col: true, - command: true, - embed: true, - frame: true, - hr: true, - img: true, - input: true, - keygen: true, - link: true, - meta: true, - param: true, - source: true, - track: true, - wbr: true, - menuitem: true - }; - var implicitlyClosed = { - dd: true, - li: true, - optgroup: true, - option: true, - p: true, - rp: true, - rt: true, - tbody: true, - td: true, - tfoot: true, - th: true, - tr: true - }; - var closeOnOpen = { - dd: { dd: true, dt: true }, - dt: { dd: true, dt: true }, - li: { li: true }, - option: { option: true, optgroup: true }, - optgroup: { optgroup: true }, - p: { - address: true, - article: true, - aside: true, - blockquote: true, - dir: true, - div: true, - dl: true, - fieldset: true, - footer: true, - form: true, - h1: true, - h2: true, - h3: true, - h4: true, - h5: true, - h6: true, - header: true, - hgroup: true, - hr: true, - menu: true, - nav: true, - ol: true, - p: true, - pre: true, - section: true, - table: true, - ul: true - }, - rp: { rp: true, rt: true }, - rt: { rp: true, rt: true }, - tbody: { tbody: true, tfoot: true }, - td: { td: true, th: true }, - tfoot: { tbody: true }, - th: { td: true, th: true }, - thead: { tbody: true, tfoot: true }, - tr: { tr: true } - }; - function nameChar(ch) { - return ch == 45 || ch == 46 || ch == 58 || ch >= 65 && ch <= 90 || ch == 95 || ch >= 97 && ch <= 122 || ch >= 161; - } - function isSpace2(ch) { - return ch == 9 || ch == 10 || ch == 13 || ch == 32; - } - var cachedName = null; - var cachedInput = null; - var cachedPos = 0; - function tagNameAfter(input, offset) { - let pos = input.pos + offset; - if (cachedPos == pos && cachedInput == input) - return cachedName; - let next = input.peek(offset); - while (isSpace2(next)) - next = input.peek(++offset); - let name3 = ""; - for (; ; ) { - if (!nameChar(next)) - break; - name3 += String.fromCharCode(next); - next = input.peek(++offset); - } - cachedInput = input; - cachedPos = pos; - return cachedName = name3 ? name3.toLowerCase() : next == question || next == bang ? void 0 : null; - } - var lessThan = 60; - var greaterThan = 62; - var slash2 = 47; - var question = 63; - var bang = 33; - function ElementContext(name3, parent) { - this.name = name3; - this.parent = parent; - this.hash = parent ? parent.hash : 0; - for (let i = 0; i < name3.length; i++) - this.hash += (this.hash << 4) + name3.charCodeAt(i) + (name3.charCodeAt(i) << 8); - } - var startTagTerms = [StartTag, StartSelfClosingTag, StartScriptTag, StartStyleTag, StartTextareaTag]; - var elementContext = new ContextTracker2({ - start: null, - shift(context, term, stack, input) { - return startTagTerms.indexOf(term) > -1 ? new ElementContext(tagNameAfter(input, 1) || "", context) : context; - }, - reduce(context, term) { - return term == Element && context ? context.parent : context; - }, - reuse(context, node, stack, input) { - let type = node.type.id; - return type == StartTag || type == OpenTag ? new ElementContext(tagNameAfter(input, 1) || "", context) : context; - }, - hash(context) { - return context ? context.hash : 0; - }, - strict: false - }); - var tagStart = new ExternalTokenizer2((input, stack) => { - if (input.next != lessThan) { - if (input.next < 0 && stack.context) - input.acceptToken(missingCloseTag); - return; - } - input.advance(); - let close = input.next == slash2; - if (close) - input.advance(); - let name3 = tagNameAfter(input, 0); - if (name3 === void 0) - return; - if (!name3) - return input.acceptToken(close ? IncompleteCloseTag : StartTag); - let parent = stack.context ? stack.context.name : null; - if (close) { - if (name3 == parent) - return input.acceptToken(StartCloseTag); - if (parent && implicitlyClosed[parent]) - return input.acceptToken(missingCloseTag, -2); - if (stack.dialectEnabled(Dialect_noMatch)) - return input.acceptToken(NoMatchStartCloseTag); - for (let cx = stack.context; cx; cx = cx.parent) - if (cx.name == name3) - return; - input.acceptToken(MismatchedStartCloseTag); - } else { - if (name3 == "script") - return input.acceptToken(StartScriptTag); - if (name3 == "style") - return input.acceptToken(StartStyleTag); - if (name3 == "textarea") - return input.acceptToken(StartTextareaTag); - if (selfClosers.hasOwnProperty(name3)) - return input.acceptToken(StartSelfClosingTag); - if (parent && closeOnOpen[parent] && closeOnOpen[parent][name3]) - input.acceptToken(missingCloseTag, -1); - else - input.acceptToken(StartTag); - } - }, { contextual: true }); - var commentContent = new ExternalTokenizer2((input) => { - for (let endPos = 0, i = 0; ; i++) { - if (input.next < 0) { - if (i) - input.acceptToken(commentContent$1); - break; - } - if (input.next == "-->".charCodeAt(endPos)) { - endPos++; - if (endPos == 3) { - if (i > 3) - input.acceptToken(commentContent$1, -2); - break; - } - } else { - endPos = 0; - } - input.advance(); - } - }); - function contentTokenizer(tag, textToken, endToken) { - let lastState = 2 + tag.length; - return new ExternalTokenizer2((input) => { - for (let state = 0, matchedLen = 0, i = 0; ; i++) { - if (input.next < 0) { - if (i) - input.acceptToken(textToken); - break; - } - if (state == 0 && input.next == lessThan || state == 1 && input.next == slash2 || state >= 2 && state < lastState && input.next == tag.charCodeAt(state - 2)) { - state++; - matchedLen++; - } else if ((state == 2 || state == lastState) && isSpace2(input.next)) { - matchedLen++; - } else if (state == lastState && input.next == greaterThan) { - if (i > matchedLen) - input.acceptToken(textToken, -matchedLen); - else - input.acceptToken(endToken, -(matchedLen - 2)); - break; - } else if ((input.next == 10 || input.next == 13) && i) { - input.acceptToken(textToken, 1); - break; - } else { - state = matchedLen = 0; - } - input.advance(); - } - }); - } - var scriptTokens = contentTokenizer("script", scriptText, StartCloseScriptTag); - var styleTokens = contentTokenizer("style", styleText, StartCloseStyleTag); - var textareaTokens = contentTokenizer("textarea", textareaText, StartCloseTextareaTag); - var parser3 = LRParser2.deserialize({ - version: 13, - states: ",xOVOxOOO!WQ!bO'#CoO!]Q!bO'#CyO!bQ!bO'#C|O!gQ!bO'#DPO!lQ!bO'#DRO!qOXO'#CnO!|OYO'#CnO#XO[O'#CnO$eOxO'#CnOOOW'#Cn'#CnO$lO!r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P~O!XlORqP!YqP~OSSOTPOUQOVROWTOXqOY]OZ[O[^O^^O_^O`^Oa^Ow^O!cZO~O!YrO~P#dO!ZsO!duO~OdvO~OdwO~OfyOj|O~OfyOj!OO~OfyOj!QO~OfyOj!SO~OfyOj!UO~O!VfOPkX!YkX~OP!WO!Y!XO~O!WiOQnX!YnX~OQ!ZO!Y!XO~O!XlORqX!YqX~OR!]O!Y!XO~O!Y!XO~P#dOd!_O~O!ZsO!d!aO~Oj!bO~Oj!cO~Og!dOfeXjeX~OfyOj!fO~OfyOj!gO~OfyOj!hO~OfyOj!iO~OfyOj!jO~Od!kO~Od!lO~Od!mO~Oj!nO~Oi!qO!_!oO!a!pO~Oj!rO~Oj!sO~Oj!tO~O_!uO`!uO!_!wO!`!uO~O_!xO`!xO!a!wO!b!xO~O_!uO`!uO!_!{O!`!uO~O_!xO`!xO!a!{O!b!xO~O`_a!cwz!c~", - goto: "%o!_PPPPPPPPPPPPPPPPPP!`!fP!lPP!xPP!{#O#R#X#[#_#e#h#k#q#w!`P!`!`P#}$T$k$q$w$}%T%Z%aPPPPPPPP%gX^OX`pXUOX`pezabcde{}!P!R!TR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!TeZ!e{}!P!R!TQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp", - nodeNames: "\u26A0 StartCloseTag StartCloseTag StartCloseTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue EndTag ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl", - maxTerm: 66, - context: elementContext, - nodeProps: [ - [NodeProp.closedBy, -11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, "EndTag", -4, 19, 29, 32, 35, "CloseTag"], - [NodeProp.group, -9, 12, 15, 16, 17, 18, 38, 39, 40, 41, "Entity", 14, "Entity TextContent", -3, 27, 30, 33, "TextContent Entity"], - [NodeProp.openedBy, 26, "StartTag StartCloseTag", -4, 28, 31, 34, 36, "OpenTag"] - ], - skippedNodes: [0], - repeatNodeCount: 9, - tokenData: "!#b!aR!WOX$kXY)sYZ)sZ]$k]^)s^p$kpq)sqr$krs*zsv$kvw+dwx2yx}$k}!O3f!O!P$k!P!Q7_!Q![$k![!]8u!]!^$k!^!_>b!_!`!!p!`!a8T!a!c$k!c!}8u!}#R$k#R#S8u#S#T$k#T#o8u#o$f$k$f$g&R$g%W$k%W%o8u%o%p$k%p&a8u&a&b$k&b1p8u1p4U$k4U4d8u4d4e$k4e$IS8u$IS$I`$k$I`$Ib8u$Ib$Kh$k$Kh%#t8u%#t&/x$k&/x&Et8u&Et&FV$k&FV;'S8u;'S;:jiW!``!bpOq(kqr?Rrs'gsv(kwx(]x!a(k!a!bKj!b~(k!R?YZ!``!bpOr(krs'gsv(kwx(]x}(k}!O?{!O!f(k!f!gAR!g#W(k#W#XGz#X~(k!R@SV!``!bpOr(krs'gsv(kwx(]x}(k}!O@i!O~(k!R@rT!``!bp!cPOr(krs'gsv(kwx(]x~(k!RAYV!``!bpOr(krs'gsv(kwx(]x!q(k!q!rAo!r~(k!RAvV!``!bpOr(krs'gsv(kwx(]x!e(k!e!fB]!f~(k!RBdV!``!bpOr(krs'gsv(kwx(]x!v(k!v!wBy!w~(k!RCQV!``!bpOr(krs'gsv(kwx(]x!{(k!{!|Cg!|~(k!RCnV!``!bpOr(krs'gsv(kwx(]x!r(k!r!sDT!s~(k!RD[V!``!bpOr(krs'gsv(kwx(]x!g(k!g!hDq!h~(k!RDxW!``!bpOrDqrsEbsvDqvwEvwxFfx!`Dq!`!aGb!a~DqqEgT!bpOvEbvxEvx!`Eb!`!aFX!a~EbPEyRO!`Ev!`!aFS!a~EvPFXOzPqF`Q!bpzPOv'gx~'gaFkV!``OrFfrsEvsvFfvwEvw!`Ff!`!aGQ!a~FfaGXR!``zPOr(]sv(]w~(]!RGkT!``!bpzPOr(krs'gsv(kwx(]x~(k!RHRV!``!bpOr(krs'gsv(kwx(]x#c(k#c#dHh#d~(k!RHoV!``!bpOr(krs'gsv(kwx(]x#V(k#V#WIU#W~(k!RI]V!``!bpOr(krs'gsv(kwx(]x#h(k#h#iIr#i~(k!RIyV!``!bpOr(krs'gsv(kwx(]x#m(k#m#nJ`#n~(k!RJgV!``!bpOr(krs'gsv(kwx(]x#d(k#d#eJ|#e~(k!RKTV!``!bpOr(krs'gsv(kwx(]x#X(k#X#YDq#Y~(k!RKqW!``!bpOrKjrsLZsvKjvwLowxNPx!aKj!a!b! g!b~KjqL`T!bpOvLZvxLox!aLZ!a!bM^!b~LZPLrRO!aLo!a!bL{!b~LoPMORO!`Lo!`!aMX!a~LoPM^OwPqMcT!bpOvLZvxLox!`LZ!`!aMr!a~LZqMyQ!bpwPOv'gx~'gaNUV!``OrNPrsLosvNPvwLow!aNP!a!bNk!b~NPaNpV!``OrNPrsLosvNPvwLow!`NP!`!a! V!a~NPa! ^R!``wPOr(]sv(]w~(]!R! nW!``!bpOrKjrsLZsvKjvwLowxNPx!`Kj!`!a!!W!a~Kj!R!!aT!``!bpwPOr(krs'gsv(kwx(]x~(k!V!!{VgS^P!``!bpOr&Rrs&qsv&Rwx'rx!^&R!^!_(k!_~&R", - tokenizers: [scriptTokens, styleTokens, textareaTokens, tagStart, commentContent, 0, 1, 2, 3, 4, 5], - topRules: { "Document": [0, 13] }, - dialects: { noMatch: 0 }, - tokenPrec: 464 - }); - function getAttrs(element, input) { - let attrs = /* @__PURE__ */ Object.create(null); - for (let att of element.firstChild.getChildren("Attribute")) { - let name3 = att.getChild("AttributeName"), value = att.getChild("AttributeValue") || att.getChild("UnquotedAttributeValue"); - if (name3) - attrs[input.read(name3.from, name3.to)] = !value ? "" : value.name == "AttributeValue" ? input.read(value.from + 1, value.to - 1) : input.read(value.from, value.to); - } - return attrs; - } - function maybeNest(node, input, tags4) { - let attrs; - for (let tag of tags4) { - if (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(node.node.parent, input)))) - return { parser: tag.parser }; - } - return null; - } - function configureNesting(tags4) { - let script = [], style = [], textarea = []; - for (let tag of tags4) { - let array2 = tag.tag == "script" ? script : tag.tag == "style" ? style : tag.tag == "textarea" ? textarea : null; - if (!array2) - throw new RangeError("Only script, style, and textarea tags can host nested parsers"); - array2.push(tag); - } - return parseMixed((node, input) => { - let id3 = node.type.id; - if (id3 == ScriptText) - return maybeNest(node, input, script); - if (id3 == StyleText) - return maybeNest(node, input, style); - if (id3 == TextareaText) - return maybeNest(node, input, textarea); - return null; - }); - } - - // node_modules/@lezer/css/dist/index.es.js - var descendantOp = 93; - var Unit = 1; - var callee = 94; - var identifier = 95; - var VariableName = 2; - var space2 = [ - 9, - 10, - 11, - 12, - 13, - 32, - 133, - 160, - 5760, - 8192, - 8193, - 8194, - 8195, - 8196, - 8197, - 8198, - 8199, - 8200, - 8201, - 8202, - 8232, - 8233, - 8239, - 8287, - 12288 - ]; - var colon = 58; - var parenL = 40; - var underscore = 95; - var bracketL = 91; - var dash = 45; - var period = 46; - var hash = 35; - var percent = 37; - function isAlpha(ch) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 161; - } - function isDigit(ch) { - return ch >= 48 && ch <= 57; - } - var identifiers = new ExternalTokenizer2((input, stack) => { - for (let inside4 = false, dashes = 0, i = 0; ; i++) { - let { next } = input; - if (isAlpha(next) || next == dash || next == underscore || inside4 && isDigit(next)) { - if (!inside4 && (next != dash || i > 0)) - inside4 = true; - if (dashes === i && next == dash) - dashes++; - input.advance(); - } else { - if (inside4) - input.acceptToken(next == parenL ? callee : dashes == 2 && stack.canShift(VariableName) ? VariableName : identifier); - break; - } - } - }); - var descendant = new ExternalTokenizer2((input) => { - if (space2.includes(input.peek(-1))) { - let { next } = input; - if (isAlpha(next) || next == underscore || next == hash || next == period || next == bracketL || next == colon || next == dash) - input.acceptToken(descendantOp); - } - }); - var unitToken = new ExternalTokenizer2((input) => { - if (!space2.includes(input.peek(-1))) { - let { next } = input; - if (next == percent) { - input.advance(); - input.acceptToken(Unit); - } - if (isAlpha(next)) { - do { - input.advance(); - } while (isAlpha(input.next)); - input.acceptToken(Unit); - } - } - }); - var spec_callee = { __proto__: null, lang: 32, "nth-child": 32, "nth-last-child": 32, "nth-of-type": 32, dir: 32, url: 60, "url-prefix": 60, domain: 60, regexp: 60, selector: 134 }; - var spec_AtKeyword = { __proto__: null, "@import": 114, "@media": 138, "@charset": 142, "@namespace": 146, "@keyframes": 152, "@supports": 164 }; - var spec_identifier2 = { __proto__: null, not: 128, only: 128, from: 158, to: 160 }; - var parser4 = LRParser2.deserialize({ - version: 13, - states: "7WOYQ[OOOOQP'#Cd'#CdOOQP'#Cc'#CcO!ZQ[O'#CfO!}QXO'#CaO#UQ[O'#ChO#aQ[O'#DPO#fQ[O'#DTOOQP'#Ec'#EcO#kQdO'#DeO$VQ[O'#DrO#kQdO'#DtO$hQ[O'#DvO$sQ[O'#DyO$xQ[O'#EPO%WQ[O'#EROOQS'#Eb'#EbOOQS'#ES'#ESQYQ[OOOOQP'#Cg'#CgOOQP,59Q,59QO!ZQ[O,59QO%_Q[O'#EVO%yQWO,58{O&RQ[O,59SO#aQ[O,59kO#fQ[O,59oO%_Q[O,59sO%_Q[O,59uO%_Q[O,59vO'bQ[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO'iQWO,59SO'nQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO'sQ`O,59oOOQS'#Cp'#CpO#kQdO'#CqO'{QvO'#CsO)VQtO,5:POOQO'#Cx'#CxO'iQWO'#CwO)kQWO'#CyOOQS'#Ef'#EfOOQO'#Dh'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5Z!P!Q%Q!Q![7_![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%QX<_S]POy%Qz![%Q![!]RUOy%Qz!c%Q!c!}>e!}#T%Q#T#o>e#o~%QX>lY!YPoWOy%Qz}%Q}!O>e!O!Q%Q!Q![>e![!c%Q!c!}>e!}#T%Q#T#o>e#o~%QX?aQxPOy%Qz~%Q^?lQvUOy%Qz~%QX?uSOy%Qz#b%Q#b#c@R#c~%QX@WSoWOy%Qz#W%Q#W#X@d#X~%QX@kQ!`PoWOy%Qz~%QX@tSOy%Qz#f%Q#f#g@d#g~%QXAVQ!RPOy%Qz~%Q_AbQ!QVOy%Qz~%QZAmS!PPOy%Qz!_%Q!_!`2e!`~%Q", - tokenizers: [descendant, unitToken, identifiers, 0, 1, 2, 3], - topRules: { "StyleSheet": [0, 4] }, - specialized: [{ term: 94, get: (value) => spec_callee[value] || -1 }, { term: 56, get: (value) => spec_AtKeyword[value] || -1 }, { term: 95, get: (value) => spec_identifier2[value] || -1 }], - tokenPrec: 1078 - }); - - // node_modules/@codemirror/lang-css/dist/index.js - var _properties = null; - function properties() { - if (!_properties && typeof document == "object" && document.body) { - let names = []; - for (let prop in document.body.style) { - if (!/[A-Z]|^-|^(item|length)$/.test(prop)) - names.push(prop); - } - _properties = names.sort().map((name3) => ({ type: "property", label: name3 })); - } - return _properties || []; - } - var pseudoClasses = /* @__PURE__ */ [ - "active", - "after", - "before", - "checked", - "default", - "disabled", - "empty", - "enabled", - "first-child", - "first-letter", - "first-line", - "first-of-type", - "focus", - "hover", - "in-range", - "indeterminate", - "invalid", - "lang", - "last-child", - "last-of-type", - "link", - "not", - "nth-child", - "nth-last-child", - "nth-last-of-type", - "nth-of-type", - "only-of-type", - "only-child", - "optional", - "out-of-range", - "placeholder", - "read-only", - "read-write", - "required", - "root", - "selection", - "target", - "valid", - "visited" - ].map((name3) => ({ type: "class", label: name3 })); - var values = /* @__PURE__ */ [ - "above", - "absolute", - "activeborder", - "additive", - "activecaption", - "after-white-space", - "ahead", - "alias", - "all", - "all-scroll", - "alphabetic", - "alternate", - "always", - "antialiased", - "appworkspace", - "asterisks", - "attr", - "auto", - "auto-flow", - "avoid", - "avoid-column", - "avoid-page", - "avoid-region", - "axis-pan", - "background", - "backwards", - "baseline", - "below", - "bidi-override", - "blink", - "block", - "block-axis", - "bold", - "bolder", - "border", - "border-box", - "both", - "bottom", - "break", - "break-all", - "break-word", - "bullets", - "button", - "button-bevel", - "buttonface", - "buttonhighlight", - "buttonshadow", - "buttontext", - "calc", - "capitalize", - "caps-lock-indicator", - "caption", - "captiontext", - "caret", - "cell", - "center", - "checkbox", - "circle", - "cjk-decimal", - "clear", - "clip", - "close-quote", - "col-resize", - "collapse", - "color", - "color-burn", - "color-dodge", - "column", - "column-reverse", - "compact", - "condensed", - "contain", - "content", - "contents", - "content-box", - "context-menu", - "continuous", - "copy", - "counter", - "counters", - "cover", - "crop", - "cross", - "crosshair", - "currentcolor", - "cursive", - "cyclic", - "darken", - "dashed", - "decimal", - "decimal-leading-zero", - "default", - "default-button", - "dense", - "destination-atop", - "destination-in", - "destination-out", - "destination-over", - "difference", - "disc", - "discard", - "disclosure-closed", - "disclosure-open", - "document", - "dot-dash", - "dot-dot-dash", - "dotted", - "double", - "down", - "e-resize", - "ease", - "ease-in", - "ease-in-out", - "ease-out", - "element", - "ellipse", - "ellipsis", - "embed", - "end", - "ethiopic-abegede-gez", - "ethiopic-halehame-aa-er", - "ethiopic-halehame-gez", - "ew-resize", - "exclusion", - "expanded", - "extends", - "extra-condensed", - "extra-expanded", - "fantasy", - "fast", - "fill", - "fill-box", - "fixed", - "flat", - "flex", - "flex-end", - "flex-start", - "footnotes", - "forwards", - "from", - "geometricPrecision", - "graytext", - "grid", - "groove", - "hand", - "hard-light", - "help", - "hidden", - "hide", - "higher", - "highlight", - "highlighttext", - "horizontal", - "hsl", - "hsla", - "hue", - "icon", - "ignore", - "inactiveborder", - "inactivecaption", - "inactivecaptiontext", - "infinite", - "infobackground", - "infotext", - "inherit", - "initial", - "inline", - "inline-axis", - "inline-block", - "inline-flex", - "inline-grid", - "inline-table", - "inset", - "inside", - "intrinsic", - "invert", - "italic", - "justify", - "keep-all", - "landscape", - "large", - "larger", - "left", - "level", - "lighter", - "lighten", - "line-through", - "linear", - "linear-gradient", - "lines", - "list-item", - "listbox", - "listitem", - "local", - "logical", - "loud", - "lower", - "lower-hexadecimal", - "lower-latin", - "lower-norwegian", - "lowercase", - "ltr", - "luminosity", - "manipulation", - "match", - "matrix", - "matrix3d", - "medium", - "menu", - "menutext", - "message-box", - "middle", - "min-intrinsic", - "mix", - "monospace", - "move", - "multiple", - "multiple_mask_images", - "multiply", - "n-resize", - "narrower", - "ne-resize", - "nesw-resize", - "no-close-quote", - "no-drop", - "no-open-quote", - "no-repeat", - "none", - "normal", - "not-allowed", - "nowrap", - "ns-resize", - "numbers", - "numeric", - "nw-resize", - "nwse-resize", - "oblique", - "opacity", - "open-quote", - "optimizeLegibility", - "optimizeSpeed", - "outset", - "outside", - "outside-shape", - "overlay", - "overline", - "padding", - "padding-box", - "painted", - "page", - "paused", - "perspective", - "pinch-zoom", - "plus-darker", - "plus-lighter", - "pointer", - "polygon", - "portrait", - "pre", - "pre-line", - "pre-wrap", - "preserve-3d", - "progress", - "push-button", - "radial-gradient", - "radio", - "read-only", - "read-write", - "read-write-plaintext-only", - "rectangle", - "region", - "relative", - "repeat", - "repeating-linear-gradient", - "repeating-radial-gradient", - "repeat-x", - "repeat-y", - "reset", - "reverse", - "rgb", - "rgba", - "ridge", - "right", - "rotate", - "rotate3d", - "rotateX", - "rotateY", - "rotateZ", - "round", - "row", - "row-resize", - "row-reverse", - "rtl", - "run-in", - "running", - "s-resize", - "sans-serif", - "saturation", - "scale", - "scale3d", - "scaleX", - "scaleY", - "scaleZ", - "screen", - "scroll", - "scrollbar", - "scroll-position", - "se-resize", - "self-start", - "self-end", - "semi-condensed", - "semi-expanded", - "separate", - "serif", - "show", - "single", - "skew", - "skewX", - "skewY", - "skip-white-space", - "slide", - "slider-horizontal", - "slider-vertical", - "sliderthumb-horizontal", - "sliderthumb-vertical", - "slow", - "small", - "small-caps", - "small-caption", - "smaller", - "soft-light", - "solid", - "source-atop", - "source-in", - "source-out", - "source-over", - "space", - "space-around", - "space-between", - "space-evenly", - "spell-out", - "square", - "start", - "static", - "status-bar", - "stretch", - "stroke", - "stroke-box", - "sub", - "subpixel-antialiased", - "svg_masks", - "super", - "sw-resize", - "symbolic", - "symbols", - "system-ui", - "table", - "table-caption", - "table-cell", - "table-column", - "table-column-group", - "table-footer-group", - "table-header-group", - "table-row", - "table-row-group", - "text", - "text-bottom", - "text-top", - "textarea", - "textfield", - "thick", - "thin", - "threeddarkshadow", - "threedface", - "threedhighlight", - "threedlightshadow", - "threedshadow", - "to", - "top", - "transform", - "translate", - "translate3d", - "translateX", - "translateY", - "translateZ", - "transparent", - "ultra-condensed", - "ultra-expanded", - "underline", - "unidirectional-pan", - "unset", - "up", - "upper-latin", - "uppercase", - "url", - "var", - "vertical", - "vertical-text", - "view-box", - "visible", - "visibleFill", - "visiblePainted", - "visibleStroke", - "visual", - "w-resize", - "wait", - "wave", - "wider", - "window", - "windowframe", - "windowtext", - "words", - "wrap", - "wrap-reverse", - "x-large", - "x-small", - "xor", - "xx-large", - "xx-small" - ].map((name3) => ({ type: "keyword", label: name3 })).concat(/* @__PURE__ */ [ - "aliceblue", - "antiquewhite", - "aqua", - "aquamarine", - "azure", - "beige", - "bisque", - "black", - "blanchedalmond", - "blue", - "blueviolet", - "brown", - "burlywood", - "cadetblue", - "chartreuse", - "chocolate", - "coral", - "cornflowerblue", - "cornsilk", - "crimson", - "cyan", - "darkblue", - "darkcyan", - "darkgoldenrod", - "darkgray", - "darkgreen", - "darkkhaki", - "darkmagenta", - "darkolivegreen", - "darkorange", - "darkorchid", - "darkred", - "darksalmon", - "darkseagreen", - "darkslateblue", - "darkslategray", - "darkturquoise", - "darkviolet", - "deeppink", - "deepskyblue", - "dimgray", - "dodgerblue", - "firebrick", - "floralwhite", - "forestgreen", - "fuchsia", - "gainsboro", - "ghostwhite", - "gold", - "goldenrod", - "gray", - "grey", - "green", - "greenyellow", - "honeydew", - "hotpink", - "indianred", - "indigo", - "ivory", - "khaki", - "lavender", - "lavenderblush", - "lawngreen", - "lemonchiffon", - "lightblue", - "lightcoral", - "lightcyan", - "lightgoldenrodyellow", - "lightgray", - "lightgreen", - "lightpink", - "lightsalmon", - "lightseagreen", - "lightskyblue", - "lightslategray", - "lightsteelblue", - "lightyellow", - "lime", - "limegreen", - "linen", - "magenta", - "maroon", - "mediumaquamarine", - "mediumblue", - "mediumorchid", - "mediumpurple", - "mediumseagreen", - "mediumslateblue", - "mediumspringgreen", - "mediumturquoise", - "mediumvioletred", - "midnightblue", - "mintcream", - "mistyrose", - "moccasin", - "navajowhite", - "navy", - "oldlace", - "olive", - "olivedrab", - "orange", - "orangered", - "orchid", - "palegoldenrod", - "palegreen", - "paleturquoise", - "palevioletred", - "papayawhip", - "peachpuff", - "peru", - "pink", - "plum", - "powderblue", - "purple", - "rebeccapurple", - "red", - "rosybrown", - "royalblue", - "saddlebrown", - "salmon", - "sandybrown", - "seagreen", - "seashell", - "sienna", - "silver", - "skyblue", - "slateblue", - "slategray", - "snow", - "springgreen", - "steelblue", - "tan", - "teal", - "thistle", - "tomato", - "turquoise", - "violet", - "wheat", - "white", - "whitesmoke", - "yellow", - "yellowgreen" - ].map((name3) => ({ type: "constant", label: name3 }))); - var tags3 = /* @__PURE__ */ [ - "a", - "abbr", - "address", - "article", - "aside", - "b", - "bdi", - "bdo", - "blockquote", - "body", - "br", - "button", - "canvas", - "caption", - "cite", - "code", - "col", - "colgroup", - "dd", - "del", - "details", - "dfn", - "dialog", - "div", - "dl", - "dt", - "em", - "figcaption", - "figure", - "footer", - "form", - "header", - "hgroup", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "hr", - "html", - "i", - "iframe", - "img", - "input", - "ins", - "kbd", - "label", - "legend", - "li", - "main", - "meter", - "nav", - "ol", - "output", - "p", - "pre", - "ruby", - "section", - "select", - "small", - "source", - "span", - "strong", - "sub", - "summary", - "sup", - "table", - "tbody", - "td", - "template", - "textarea", - "tfoot", - "th", - "thead", - "tr", - "u", - "ul" - ].map((name3) => ({ type: "type", label: name3 })); - var span = /^[\w-]*/; - var cssCompletionSource = (context) => { - let { state, pos } = context, node = syntaxTree(state).resolveInner(pos, -1); - if (node.name == "PropertyName") - return { from: node.from, options: properties(), span }; - if (node.name == "ValueName") - return { from: node.from, options: values, span }; - if (node.name == "PseudoClassName") - return { from: node.from, options: pseudoClasses, span }; - if (node.name == "TagName") { - for (let { parent } = node; parent; parent = parent.parent) - if (parent.name == "Block") - return { from: node.from, options: properties(), span }; - return { from: node.from, options: tags3, span }; - } - if (!context.explicit) - return null; - let above = node.resolve(pos), before = above.childBefore(pos); - if (before && before.name == ":" && above.name == "PseudoClassSelector") - return { from: pos, options: pseudoClasses, span }; - if (before && before.name == ":" && above.name == "Declaration" || above.name == "ArgList") - return { from: pos, options: values, span }; - if (above.name == "Block") - return { from: pos, options: properties(), span }; - return null; - }; - var cssLanguage = /* @__PURE__ */ LRLanguage.define({ - parser: /* @__PURE__ */ parser4.configure({ - props: [ - /* @__PURE__ */ indentNodeProp.add({ - Declaration: /* @__PURE__ */ continuedIndent() - }), - /* @__PURE__ */ foldNodeProp.add({ - Block: foldInside - }), - /* @__PURE__ */ styleTags({ - "import charset namespace keyframes": tags.definitionKeyword, - "media supports": tags.controlKeyword, - "from to selector": tags.keyword, - NamespaceName: tags.namespace, - KeyframeName: tags.labelName, - TagName: tags.tagName, - ClassName: tags.className, - PseudoClassName: /* @__PURE__ */ tags.constant(tags.className), - IdName: tags.labelName, - "FeatureName PropertyName": tags.propertyName, - AttributeName: tags.attributeName, - NumberLiteral: tags.number, - KeywordQuery: tags.keyword, - UnaryQueryOp: tags.operatorKeyword, - "CallTag ValueName": tags.atom, - VariableName: tags.variableName, - Callee: tags.operatorKeyword, - Unit: tags.unit, - "UniversalSelector NestingSelector": tags.definitionOperator, - AtKeyword: tags.keyword, - MatchOp: tags.compareOperator, - "ChildOp SiblingOp, LogicOp": tags.logicOperator, - BinOp: tags.arithmeticOperator, - Important: tags.modifier, - Comment: tags.blockComment, - ParenthesizedContent: /* @__PURE__ */ tags.special(tags.name), - ColorLiteral: tags.color, - StringLiteral: tags.string, - ":": tags.punctuation, - "PseudoOp #": tags.derefOperator, - "; ,": tags.separator, - "( )": tags.paren, - "[ ]": tags.squareBracket, - "{ }": tags.brace - }) - ] - }), - languageData: { - commentTokens: { block: { open: "/*", close: "*/" } }, - indentOnInput: /^\s*\}$/, - wordChars: "-" - } - }); - var cssCompletion = /* @__PURE__ */ cssLanguage.data.of({ autocomplete: cssCompletionSource }); - function css() { - return new LanguageSupport(cssLanguage, cssCompletion); - } - - // node_modules/@codemirror/lang-html/node_modules/@lezer/javascript/dist/index.es.js - var noSemi2 = 279; - var incdec2 = 1; - var incdecPrefix2 = 2; - var templateContent2 = 280; - var InterpolationStart2 = 3; - var templateEnd2 = 281; - var insertSemi2 = 282; - var TSExtends2 = 4; - var spaces2 = 284; - var newline2 = 285; - var LineComment2 = 5; - var BlockComment2 = 6; - var Dialect_ts2 = 1; - var space3 = [ - 9, - 10, - 11, - 12, - 13, - 32, - 133, - 160, - 5760, - 8192, - 8193, - 8194, - 8195, - 8196, - 8197, - 8198, - 8199, - 8200, - 8201, - 8202, - 8232, - 8233, - 8239, - 8287, - 12288 - ]; - var braceR2 = 125; - var braceL2 = 123; - var semicolon3 = 59; - var slash3 = 47; - var star2 = 42; - var plus2 = 43; - var minus2 = 45; - var dollar2 = 36; - var backtick2 = 96; - var backslash2 = 92; - var trackNewline2 = new ContextTracker2({ - start: false, - shift(context, term) { - return term == LineComment2 || term == BlockComment2 || term == spaces2 ? context : term == newline2; - }, - strict: false - }); - var insertSemicolon2 = new ExternalTokenizer2((input, stack) => { - let { next } = input; - if ((next == braceR2 || next == -1 || stack.context) && stack.canShift(insertSemi2)) - input.acceptToken(insertSemi2); - }, { contextual: true, fallback: true }); - var noSemicolon2 = new ExternalTokenizer2((input, stack) => { - let { next } = input, after; - if (space3.indexOf(next) > -1) - return; - if (next == slash3 && ((after = input.peek(1)) == slash3 || after == star2)) - return; - if (next != braceR2 && next != semicolon3 && next != -1 && !stack.context && stack.canShift(noSemi2)) - input.acceptToken(noSemi2); - }, { contextual: true }); - var incdecToken2 = new ExternalTokenizer2((input, stack) => { - let { next } = input; - if (next == plus2 || next == minus2) { - input.advance(); - if (next == input.next) { - input.advance(); - let mayPostfix = !stack.context && stack.canShift(incdec2); - input.acceptToken(mayPostfix ? incdec2 : incdecPrefix2); - } - } - }, { contextual: true }); - var template2 = new ExternalTokenizer2((input) => { - for (let afterDollar = false, i = 0; ; i++) { - let { next } = input; - if (next < 0) { - if (i) - input.acceptToken(templateContent2); - break; - } else if (next == backtick2) { - if (i) - input.acceptToken(templateContent2); - else - input.acceptToken(templateEnd2, 1); - break; - } else if (next == braceL2 && afterDollar) { - if (i == 1) - input.acceptToken(InterpolationStart2, 1); - else - input.acceptToken(templateContent2, -1); - break; - } else if (next == 10 && i) { - input.advance(); - input.acceptToken(templateContent2); - break; - } else if (next == backslash2) { - input.advance(); - } - afterDollar = next == dollar2; - input.advance(); - } - }); - function tsExtends2(value, stack) { - return value == "extends" && stack.dialectEnabled(Dialect_ts2) ? TSExtends2 : -1; - } - var spec_identifier3 = { __proto__: null, export: 18, as: 23, from: 29, default: 32, async: 37, function: 38, this: 48, true: 56, false: 56, void: 66, typeof: 70, null: 86, super: 88, new: 122, await: 139, yield: 141, delete: 142, class: 152, extends: 154, public: 197, private: 197, protected: 197, readonly: 199, instanceof: 220, in: 222, const: 224, import: 256, keyof: 307, unique: 311, infer: 317, is: 351, abstract: 371, implements: 373, type: 375, let: 378, var: 380, interface: 387, enum: 391, namespace: 397, module: 399, declare: 403, global: 407, for: 428, of: 437, while: 440, with: 444, do: 448, if: 452, else: 454, switch: 458, case: 464, try: 470, catch: 472, finally: 474, return: 478, throw: 482, break: 486, continue: 490, debugger: 494 }; - var spec_word2 = { __proto__: null, async: 109, get: 111, set: 113, public: 161, private: 161, protected: 161, static: 163, abstract: 165, override: 167, readonly: 173, new: 355 }; - var spec_LessThan2 = { __proto__: null, "<": 129 }; - var parser5 = LRParser2.deserialize({ - version: 13, - states: "$1jO`QYOOO'QQ!LdO'#ChO'XOSO'#DVO)dQYO'#D]O)tQYO'#DhO){QYO'#DrO-xQYO'#DxOOQO'#E]'#E]O.]QWO'#E[O.bQWO'#E[OOQ!LS'#Ef'#EfO0aQ!LdO'#IrO2wQ!LdO'#IsO3eQWO'#EzO3jQpO'#FaOOQ!LS'#FS'#FSO3rO!bO'#FSO4QQWO'#FhO5_QWO'#FgOOQ!LS'#Is'#IsOOQ!LQ'#Ir'#IrOOQQ'#J['#J[O5dQWO'#HnO5iQ!LYO'#HoOOQQ'#If'#IfOOQQ'#Hp'#HpQ`QYOOO){QYO'#DjO5qQWO'#G[O5vQ#tO'#CmO6UQWO'#EZO6aQWO'#EgO6fQ#tO'#FRO7QQWO'#G[O7VQWO'#G`O7bQWO'#G`O7pQWO'#GcO7pQWO'#GdO7pQWO'#GfO5qQWO'#GiO8aQWO'#GlO9oQWO'#CdO:PQWO'#GyO:XQWO'#HPO:XQWO'#HRO`QYO'#HTO:XQWO'#HVO:XQWO'#HYO:^QWO'#H`O:cQ!LZO'#HdO){QYO'#HfO:nQ!LZO'#HhO:yQ!LZO'#HjO5iQ!LYO'#HlO){QYO'#DWOOOS'#Hr'#HrO;UOSO,59qOOQ!LS,59q,59qO=gQbO'#ChO=qQYO'#HsO>UQWO'#ItO@TQbO'#ItO'dQYO'#ItO@[QWO,59wO@rQ&jO'#DbOAkQWO'#E]OAxQWO'#JPOBTQWO'#JOOBTQWO'#JOOB]QWO,5:yOBbQWO'#I}OBiQWO'#DyO5vQ#tO'#EZOBwQWO'#EZOCSQ`O'#FROOQ!LS,5:S,5:SOC[QYO,5:SOEYQ!LdO,5:^OEvQWO,5:dOFa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": [0, 7] }, - dialects: { jsx: 11335, ts: 11337 }, - dynamicPrecedences: { "149": 1, "176": 1 }, - specialized: [{ term: 287, get: (value, stack) => tsExtends2(value, stack) << 1 }, { term: 287, get: (value) => spec_identifier3[value] || -1 }, { term: 297, get: (value) => spec_word2[value] || -1 }, { term: 63, get: (value) => spec_LessThan2[value] || -1 }], - tokenPrec: 11358 - }); - - // node_modules/@codemirror/lang-html/node_modules/@codemirror/lang-javascript/dist/index.js - var snippets2 = [ - /* @__PURE__ */ snippetCompletion("function ${name}(${params}) {\n ${}\n}", { - label: "function", - detail: "definition", - type: "keyword" - }), - /* @__PURE__ */ snippetCompletion("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}", { - label: "for", - detail: "loop", - type: "keyword" - }), - /* @__PURE__ */ snippetCompletion("for (let ${name} of ${collection}) {\n ${}\n}", { - label: "for", - detail: "of loop", - type: "keyword" - }), - /* @__PURE__ */ snippetCompletion("try {\n ${}\n} catch (${error}) {\n ${}\n}", { - label: "try", - detail: "block", - type: "keyword" - }), - /* @__PURE__ */ snippetCompletion("class ${name} {\n constructor(${params}) {\n ${}\n }\n}", { - label: "class", - detail: "definition", - type: "keyword" - }), - /* @__PURE__ */ snippetCompletion('import {${names}} from "${module}"\n${}', { - label: "import", - detail: "named", - type: "keyword" - }), - /* @__PURE__ */ snippetCompletion('import ${name} from "${module}"\n${}', { - label: "import", - detail: "default", - type: "keyword" - }) - ]; - var javascriptLanguage2 = /* @__PURE__ */ LRLanguage.define({ - parser: /* @__PURE__ */ parser5.configure({ - props: [ - /* @__PURE__ */ indentNodeProp.add({ - IfStatement: /* @__PURE__ */ continuedIndent({ except: /^\s*({|else\b)/ }), - TryStatement: /* @__PURE__ */ continuedIndent({ except: /^\s*({|catch\b|finally\b)/ }), - LabeledStatement: flatIndent, - SwitchBody: (context) => { - let after = context.textAfter, closed = /^\s*\}/.test(after), isCase = /^\s*(case|default)\b/.test(after); - return context.baseIndent + (closed ? 0 : isCase ? 1 : 2) * context.unit; - }, - Block: /* @__PURE__ */ delimitedIndent({ closing: "}" }), - ArrowFunction: (cx) => cx.baseIndent + cx.unit, - "TemplateString BlockComment": () => -1, - "Statement Property": /* @__PURE__ */ continuedIndent({ except: /^{/ }), - JSXElement(context) { - let closed = /^\s*<\//.test(context.textAfter); - return context.lineIndent(context.node.from) + (closed ? 0 : context.unit); - }, - JSXEscape(context) { - let closed = /\s*\}/.test(context.textAfter); - return context.lineIndent(context.node.from) + (closed ? 0 : context.unit); - }, - "JSXOpenTag JSXSelfClosingTag"(context) { - return context.column(context.node.from) + context.unit; - } - }), - /* @__PURE__ */ foldNodeProp.add({ - "Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression": foldInside, - BlockComment(tree) { - return { from: tree.from + 2, to: tree.to - 2 }; - } - }), - /* @__PURE__ */ styleTags({ - "get set async static": tags.modifier, - "for while do if else switch try catch finally return throw break continue default case": tags.controlKeyword, - "in of await yield void typeof delete instanceof": tags.operatorKeyword, - "let var const function class extends": tags.definitionKeyword, - "import export from": tags.moduleKeyword, - "with debugger as new": tags.keyword, - TemplateString: /* @__PURE__ */ tags.special(tags.string), - Super: tags.atom, - BooleanLiteral: tags.bool, - this: tags.self, - null: tags.null, - Star: tags.modifier, - VariableName: tags.variableName, - "CallExpression/VariableName TaggedTemplateExpression/VariableName": /* @__PURE__ */ tags.function(tags.variableName), - VariableDefinition: /* @__PURE__ */ tags.definition(tags.variableName), - Label: tags.labelName, - PropertyName: tags.propertyName, - PrivatePropertyName: /* @__PURE__ */ tags.special(tags.propertyName), - "CallExpression/MemberExpression/PropertyName": /* @__PURE__ */ tags.function(tags.propertyName), - "FunctionDeclaration/VariableDefinition": /* @__PURE__ */ tags.function(/* @__PURE__ */ tags.definition(tags.variableName)), - "ClassDeclaration/VariableDefinition": /* @__PURE__ */ tags.definition(tags.className), - PropertyDefinition: /* @__PURE__ */ tags.definition(tags.propertyName), - PrivatePropertyDefinition: /* @__PURE__ */ tags.definition(/* @__PURE__ */ tags.special(tags.propertyName)), - UpdateOp: tags.updateOperator, - LineComment: tags.lineComment, - BlockComment: tags.blockComment, - Number: tags.number, - String: tags.string, - ArithOp: tags.arithmeticOperator, - LogicOp: tags.logicOperator, - BitOp: tags.bitwiseOperator, - CompareOp: tags.compareOperator, - RegExp: tags.regexp, - Equals: tags.definitionOperator, - "Arrow : Spread": tags.punctuation, - "( )": tags.paren, - "[ ]": tags.squareBracket, - "{ }": tags.brace, - "InterpolationStart InterpolationEnd": /* @__PURE__ */ tags.special(tags.brace), - ".": tags.derefOperator, - ", ;": tags.separator, - TypeName: tags.typeName, - TypeDefinition: /* @__PURE__ */ tags.definition(tags.typeName), - "type enum interface implements namespace module declare": tags.definitionKeyword, - "abstract global Privacy readonly override": tags.modifier, - "is keyof unique infer": tags.operatorKeyword, - JSXAttributeValue: tags.attributeValue, - JSXText: tags.content, - "JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag": tags.angleBracket, - "JSXIdentifier JSXNameSpacedName": tags.tagName, - "JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName": tags.attributeName - }) - ] - }), - languageData: { - closeBrackets: { brackets: ["(", "[", "{", "'", '"', "`"] }, - commentTokens: { line: "//", block: { open: "/*", close: "*/" } }, - indentOnInput: /^\s*(?:case |default:|\{|\}|<\/)$/, - wordChars: "$" - } - }); - var typescriptLanguage2 = /* @__PURE__ */ javascriptLanguage2.configure({ dialect: "ts" }); - var jsxLanguage2 = /* @__PURE__ */ javascriptLanguage2.configure({ dialect: "jsx" }); - var tsxLanguage2 = /* @__PURE__ */ javascriptLanguage2.configure({ dialect: "jsx ts" }); - function javascript2(config2 = {}) { - let lang = config2.jsx ? config2.typescript ? tsxLanguage2 : jsxLanguage2 : config2.typescript ? typescriptLanguage2 : javascriptLanguage2; - return new LanguageSupport(lang, javascriptLanguage2.data.of({ - autocomplete: ifNotIn(["LineComment", "BlockComment", "String"], completeFromList(snippets2)) - })); - } - - // node_modules/@codemirror/lang-html/dist/index.js - var Targets = ["_blank", "_self", "_top", "_parent"]; - var Charsets = ["ascii", "utf-8", "utf-16", "latin1", "latin1"]; - var Methods = ["get", "post", "put", "delete"]; - var Encs = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]; - var Bool = ["true", "false"]; - var S = {}; - var Tags = { - a: { - attrs: { - href: null, - ping: null, - type: null, - media: null, - target: Targets, - hreflang: null - } - }, - abbr: S, - acronym: S, - address: S, - applet: S, - area: { - attrs: { - alt: null, - coords: null, - href: null, - target: null, - ping: null, - media: null, - hreflang: null, - type: null, - shape: ["default", "rect", "circle", "poly"] - } - }, - article: S, - aside: S, - audio: { - attrs: { - src: null, - mediagroup: null, - crossorigin: ["anonymous", "use-credentials"], - preload: ["none", "metadata", "auto"], - autoplay: ["autoplay"], - loop: ["loop"], - controls: ["controls"] - } - }, - b: S, - base: { attrs: { href: null, target: Targets } }, - basefont: S, - bdi: S, - bdo: S, - big: S, - blockquote: { attrs: { cite: null } }, - body: S, - br: S, - button: { - attrs: { - form: null, - formaction: null, - name: null, - value: null, - autofocus: ["autofocus"], - disabled: ["autofocus"], - formenctype: Encs, - formmethod: Methods, - formnovalidate: ["novalidate"], - formtarget: Targets, - type: ["submit", "reset", "button"] - } - }, - canvas: { attrs: { width: null, height: null } }, - caption: S, - center: S, - cite: S, - code: S, - col: { attrs: { span: null } }, - colgroup: { attrs: { span: null } }, - command: { - attrs: { - type: ["command", "checkbox", "radio"], - label: null, - icon: null, - radiogroup: null, - command: null, - title: null, - disabled: ["disabled"], - checked: ["checked"] - } - }, - data: { attrs: { value: null } }, - datagrid: { attrs: { disabled: ["disabled"], multiple: ["multiple"] } }, - datalist: { attrs: { data: null } }, - dd: S, - del: { attrs: { cite: null, datetime: null } }, - details: { attrs: { open: ["open"] } }, - dfn: S, - dir: S, - div: S, - dl: S, - dt: S, - em: S, - embed: { attrs: { src: null, type: null, width: null, height: null } }, - eventsource: { attrs: { src: null } }, - fieldset: { attrs: { disabled: ["disabled"], form: null, name: null } }, - figcaption: S, - figure: S, - font: S, - footer: S, - form: { - attrs: { - action: null, - name: null, - "accept-charset": Charsets, - autocomplete: ["on", "off"], - enctype: Encs, - method: Methods, - novalidate: ["novalidate"], - target: Targets - } - }, - frame: S, - frameset: S, - h1: S, - h2: S, - h3: S, - h4: S, - h5: S, - h6: S, - head: { - children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"] - }, - header: S, - hgroup: S, - hr: S, - html: { - attrs: { manifest: null } - }, - i: S, - iframe: { - attrs: { - src: null, - srcdoc: null, - name: null, - width: null, - height: null, - sandbox: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"], - seamless: ["seamless"] - } - }, - img: { - attrs: { - alt: null, - src: null, - ismap: null, - usemap: null, - width: null, - height: null, - crossorigin: ["anonymous", "use-credentials"] - } - }, - input: { - attrs: { - alt: null, - dirname: null, - form: null, - formaction: null, - height: null, - list: null, - max: null, - maxlength: null, - min: null, - name: null, - pattern: null, - placeholder: null, - size: null, - src: null, - step: null, - value: null, - width: null, - accept: ["audio/*", "video/*", "image/*"], - autocomplete: ["on", "off"], - autofocus: ["autofocus"], - checked: ["checked"], - disabled: ["disabled"], - formenctype: Encs, - formmethod: Methods, - formnovalidate: ["novalidate"], - formtarget: Targets, - multiple: ["multiple"], - readonly: ["readonly"], - required: ["required"], - type: [ - "hidden", - "text", - "search", - "tel", - "url", - "email", - "password", - "datetime", - "date", - "month", - "week", - "time", - "datetime-local", - "number", - "range", - "color", - "checkbox", - "radio", - "file", - "submit", - "image", - "reset", - "button" - ] - } - }, - ins: { attrs: { cite: null, datetime: null } }, - kbd: S, - keygen: { - attrs: { - challenge: null, - form: null, - name: null, - autofocus: ["autofocus"], - disabled: ["disabled"], - keytype: ["RSA"] - } - }, - label: { attrs: { for: null, form: null } }, - legend: S, - li: { attrs: { value: null } }, - link: { - attrs: { - href: null, - type: null, - hreflang: null, - media: null, - sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"] - } - }, - map: { attrs: { name: null } }, - mark: S, - menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } }, - meta: { - attrs: { - content: null, - charset: Charsets, - name: ["viewport", "application-name", "author", "description", "generator", "keywords"], - "http-equiv": ["content-language", "content-type", "default-style", "refresh"] - } - }, - meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } }, - nav: S, - noframes: S, - noscript: S, - object: { - attrs: { - data: null, - type: null, - name: null, - usemap: null, - form: null, - width: null, - height: null, - typemustmatch: ["typemustmatch"] - } - }, - ol: { - attrs: { reversed: ["reversed"], start: null, type: ["1", "a", "A", "i", "I"] }, - children: ["li", "script", "template", "ul", "ol"] - }, - optgroup: { attrs: { disabled: ["disabled"], label: null } }, - option: { attrs: { disabled: ["disabled"], label: null, selected: ["selected"], value: null } }, - output: { attrs: { for: null, form: null, name: null } }, - p: S, - param: { attrs: { name: null, value: null } }, - pre: S, - progress: { attrs: { value: null, max: null } }, - q: { attrs: { cite: null } }, - rp: S, - rt: S, - ruby: S, - s: S, - samp: S, - script: { - attrs: { - type: ["text/javascript"], - src: null, - async: ["async"], - defer: ["defer"], - charset: Charsets - } - }, - section: S, - select: { - attrs: { - form: null, - name: null, - size: null, - autofocus: ["autofocus"], - disabled: ["disabled"], - multiple: ["multiple"] - } - }, - small: S, - source: { attrs: { src: null, type: null, media: null } }, - span: S, - strike: S, - strong: S, - style: { - attrs: { - type: ["text/css"], - media: null, - scoped: null - } - }, - sub: S, - summary: S, - sup: S, - table: S, - tbody: S, - td: { attrs: { colspan: null, rowspan: null, headers: null } }, - textarea: { - attrs: { - dirname: null, - form: null, - maxlength: null, - name: null, - placeholder: null, - rows: null, - cols: null, - autofocus: ["autofocus"], - disabled: ["disabled"], - readonly: ["readonly"], - required: ["required"], - wrap: ["soft", "hard"] - } - }, - tfoot: S, - th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } }, - thead: S, - time: { attrs: { datetime: null } }, - title: S, - tr: S, - track: { - attrs: { - src: null, - label: null, - default: null, - kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"], - srclang: null - } - }, - tt: S, - u: S, - ul: { children: ["li", "script", "template", "ul", "ol"] }, - var: S, - video: { - attrs: { - src: null, - poster: null, - width: null, - height: null, - crossorigin: ["anonymous", "use-credentials"], - preload: ["auto", "metadata", "none"], - autoplay: ["autoplay"], - mediagroup: ["movie"], - muted: ["muted"], - controls: ["controls"] - } - }, - wbr: S - }; - var GlobalAttrs = { - accesskey: null, - class: null, - contenteditable: Bool, - contextmenu: null, - dir: ["ltr", "rtl", "auto"], - draggable: ["true", "false", "auto"], - dropzone: ["copy", "move", "link", "string:", "file:"], - hidden: ["hidden"], - id: null, - inert: ["inert"], - itemid: null, - itemprop: null, - itemref: null, - itemscope: ["itemscope"], - itemtype: null, - lang: ["ar", "bn", "de", "en-GB", "en-US", "es", "fr", "hi", "id", "ja", "pa", "pt", "ru", "tr", "zh"], - spellcheck: Bool, - autocorrect: Bool, - autocapitalize: Bool, - style: null, - tabindex: null, - title: null, - translate: ["yes", "no"], - onclick: null, - rel: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"], - role: /* @__PURE__ */ "alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "), - "aria-activedescendant": null, - "aria-atomic": Bool, - "aria-autocomplete": ["inline", "list", "both", "none"], - "aria-busy": Bool, - "aria-checked": ["true", "false", "mixed", "undefined"], - "aria-controls": null, - "aria-describedby": null, - "aria-disabled": Bool, - "aria-dropeffect": null, - "aria-expanded": ["true", "false", "undefined"], - "aria-flowto": null, - "aria-grabbed": ["true", "false", "undefined"], - "aria-haspopup": Bool, - "aria-hidden": Bool, - "aria-invalid": ["true", "false", "grammar", "spelling"], - "aria-label": null, - "aria-labelledby": null, - "aria-level": null, - "aria-live": ["off", "polite", "assertive"], - "aria-multiline": Bool, - "aria-multiselectable": Bool, - "aria-owns": null, - "aria-posinset": null, - "aria-pressed": ["true", "false", "mixed", "undefined"], - "aria-readonly": Bool, - "aria-relevant": null, - "aria-required": Bool, - "aria-selected": ["true", "false", "undefined"], - "aria-setsize": null, - "aria-sort": ["ascending", "descending", "none", "other"], - "aria-valuemax": null, - "aria-valuemin": null, - "aria-valuenow": null, - "aria-valuetext": null - }; - var AllTags = /* @__PURE__ */ Object.keys(Tags); - var GlobalAttrNames = /* @__PURE__ */ Object.keys(GlobalAttrs); - function elementName2(doc4, tree, max = doc4.length) { - if (!tree) - return ""; - let tag = tree.firstChild; - let name3 = tag && tag.getChild("TagName"); - return name3 ? doc4.sliceString(name3.from, Math.min(name3.to, max)) : ""; - } - function findParentElement(tree, skip = false) { - for (let cur2 = tree.parent; cur2; cur2 = cur2.parent) - if (cur2.name == "Element") { - if (skip) - skip = false; - else - return cur2; - } - return null; - } - function allowedChildren(doc4, tree) { - let parentInfo = Tags[elementName2(doc4, findParentElement(tree, true))]; - return (parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.children) || AllTags; - } - function openTags(doc4, tree) { - let open = []; - for (let parent = tree; parent = findParentElement(parent); ) { - let tagName = elementName2(doc4, parent); - if (tagName && parent.lastChild.name == "CloseTag") - break; - if (tagName && open.indexOf(tagName) < 0 && (tree.name == "EndTag" || tree.from >= parent.firstChild.to)) - open.push(tagName); - } - return open; - } - var identifier2 = /^[:\-\.\w\u00b7-\uffff]+$/; - function completeTag(state, tree, from2, to) { - let end = /\s*>/.test(state.sliceDoc(to, to + 5)) ? "" : ">"; - return { - from: from2, - to, - options: allowedChildren(state.doc, tree).map((tagName) => ({ label: tagName, type: "type" })).concat(openTags(state.doc, tree).map((tag, i) => ({ label: "/" + tag, apply: "/" + tag + end, type: "type", boost: 99 - i }))), - span: /^\/?[:\-\.\w\u00b7-\uffff]*$/ - }; - } - function completeCloseTag(state, tree, from2, to) { - let end = /\s*>/.test(state.sliceDoc(to, to + 5)) ? "" : ">"; - return { - from: from2, - to, - options: openTags(state.doc, tree).map((tag, i) => ({ label: tag, apply: tag + end, type: "type", boost: 99 - i })), - span: identifier2 - }; - } - function completeStartTag(state, tree, pos) { - let options = [], level = 0; - for (let tagName of allowedChildren(state.doc, tree)) - options.push({ label: "<" + tagName, type: "type" }); - for (let open of openTags(state.doc, tree)) - options.push({ label: "", type: "type", boost: 99 - level++ }); - return { from: pos, to: pos, options, span: /^<\/?[:\-\.\w\u00b7-\uffff]*$/ }; - } - function completeAttrName(state, tree, from2, to) { - let elt = findParentElement(tree), info = elt ? Tags[elementName2(state.doc, elt)] : null; - let names = info && info.attrs ? Object.keys(info.attrs).concat(GlobalAttrNames) : GlobalAttrNames; - return { - from: from2, - to, - options: names.map((attrName) => ({ label: attrName, type: "property" })), - span: identifier2 - }; - } - function completeAttrValue(state, tree, from2, to) { - var _a4; - let nameNode = (_a4 = tree.parent) === null || _a4 === void 0 ? void 0 : _a4.getChild("AttributeName"); - let options = [], span2 = void 0; - if (nameNode) { - let attrName = state.sliceDoc(nameNode.from, nameNode.to); - let attrs = GlobalAttrs[attrName]; - if (!attrs) { - let elt = findParentElement(tree), info = elt ? Tags[elementName2(state.doc, elt)] : null; - attrs = (info === null || info === void 0 ? void 0 : info.attrs) && info.attrs[attrName]; - } - if (attrs) { - let base2 = state.sliceDoc(from2, to).toLowerCase(), quoteStart = '"', quoteEnd = '"'; - if (/^['"]/.test(base2)) { - span2 = base2[0] == '"' ? /^[^"]*$/ : /^[^']*$/; - quoteStart = ""; - quoteEnd = state.sliceDoc(to, to + 1) == base2[0] ? "" : base2[0]; - base2 = base2.slice(1); - from2++; - } else { - span2 = /^[^\s<>='"]*$/; - } - for (let value of attrs) - options.push({ label: value, apply: quoteStart + value + quoteEnd, type: "constant" }); - } - } - return { from: from2, to, options, span: span2 }; - } - function htmlCompletionSource(context) { - let { state, pos } = context, around = syntaxTree(state).resolveInner(pos), tree = around.resolve(pos, -1); - for (let scan = pos, before; around == tree && (before = tree.childBefore(scan)); ) { - let last = before.lastChild; - if (!last || !last.type.isError || last.from < last.to) - break; - around = tree = before; - scan = last.from; - } - if (tree.name == "TagName") { - return tree.parent && /CloseTag$/.test(tree.parent.name) ? completeCloseTag(state, tree, tree.from, pos) : completeTag(state, tree, tree.from, pos); - } else if (tree.name == "StartTag") { - return completeTag(state, tree, pos, pos); - } else if (tree.name == "StartCloseTag" || tree.name == "IncompleteCloseTag") { - return completeCloseTag(state, tree, pos, pos); - } else if (context.explicit && (tree.name == "OpenTag" || tree.name == "SelfClosingTag") || tree.name == "AttributeName") { - return completeAttrName(state, tree, tree.name == "AttributeName" ? tree.from : pos, pos); - } else if (tree.name == "Is" || tree.name == "AttributeValue" || tree.name == "UnquotedAttributeValue") { - return completeAttrValue(state, tree, tree.name == "Is" ? pos : tree.from, pos); - } else if (context.explicit && (around.name == "Element" || around.name == "Text" || around.name == "Document")) { - return completeStartTag(state, tree, pos); - } else { - return null; - } - } - var htmlLanguage = /* @__PURE__ */ LRLanguage.define({ - parser: /* @__PURE__ */ parser3.configure({ - props: [ - /* @__PURE__ */ indentNodeProp.add({ - Element(context) { - let after = /^(\s*)(<\/)?/.exec(context.textAfter); - if (context.node.to <= context.pos + after[0].length) - return context.continue(); - return context.lineIndent(context.node.from) + (after[2] ? 0 : context.unit); - }, - "OpenTag CloseTag SelfClosingTag"(context) { - return context.column(context.node.from) + context.unit; - }, - Document(context) { - if (context.pos + /\s*/.exec(context.textAfter)[0].length < context.node.to) - return context.continue(); - let endElt = null, close; - for (let cur2 = context.node; ; ) { - let last = cur2.lastChild; - if (!last || last.name != "Element" || last.to != cur2.to) - break; - endElt = cur2 = last; - } - if (endElt && !((close = endElt.lastChild) && (close.name == "CloseTag" || close.name == "SelfClosingTag"))) - return context.lineIndent(endElt.from) + context.unit; - return null; - } - }), - /* @__PURE__ */ foldNodeProp.add({ - Element(node) { - let first = node.firstChild, last = node.lastChild; - if (!first || first.name != "OpenTag") - return null; - return { from: first.to, to: last.name == "CloseTag" ? last.from : node.to }; - } - }), - /* @__PURE__ */ styleTags({ - "Text RawText": tags.content, - "StartTag StartCloseTag SelfCloserEndTag EndTag SelfCloseEndTag": tags.angleBracket, - TagName: tags.tagName, - "MismatchedCloseTag/TagName": [tags.tagName, tags.invalid], - AttributeName: tags.attributeName, - "AttributeValue UnquotedAttributeValue": tags.attributeValue, - Is: tags.definitionOperator, - "EntityReference CharacterReference": tags.character, - Comment: tags.blockComment, - ProcessingInst: tags.processingInstruction, - DoctypeDecl: tags.documentMeta - }) - ], - wrap: /* @__PURE__ */ configureNesting([ - { - tag: "script", - attrs(attrs) { - return !attrs.type || /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(attrs.type); - }, - parser: javascriptLanguage2.parser - }, - { - tag: "style", - attrs(attrs) { - return (!attrs.lang || attrs.lang == "css") && (!attrs.type || /^(text\/)?(x-)?(stylesheet|css)$/i.test(attrs.type)); - }, - parser: cssLanguage.parser - } - ]) - }), - languageData: { - commentTokens: { block: { open: "" } }, - indentOnInput: /^\s*<\/\w+\W$/, - wordChars: "-._" - } - }); - var htmlCompletion = /* @__PURE__ */ htmlLanguage.data.of({ autocomplete: htmlCompletionSource }); - function html(config2 = {}) { - let lang = htmlLanguage; - if (config2.matchClosingTags === false) - lang = lang.configure({ dialect: "noMatch" }); - return new LanguageSupport(lang, [ - htmlCompletion, - config2.autoCloseTags !== false ? autoCloseTags2 : [], - javascript2().support, - css().support - ]); - } - var autoCloseTags2 = /* @__PURE__ */ EditorView.inputHandler.of((view, from2, to, text) => { - if (view.composing || view.state.readOnly || from2 != to || text != ">" && text != "/" || !htmlLanguage.isActiveAt(view.state, from2, -1)) - return false; - let { state } = view; - let changes = state.changeByRange((range) => { - var _a4, _b, _c; - let { head } = range, around = syntaxTree(state).resolveInner(head, -1), name3; - if (around.name == "TagName" || around.name == "StartTag") - around = around.parent; - if (text == ">" && around.name == "OpenTag") { - if (((_b = (_a4 = around.parent) === null || _a4 === void 0 ? void 0 : _a4.lastChild) === null || _b === void 0 ? void 0 : _b.name) != "CloseTag" && (name3 = elementName2(state.doc, around.parent, head))) - return { range: EditorSelection.cursor(head + 1), changes: { from: head, insert: `>` } }; - } else if (text == "/" && around.name == "OpenTag") { - let empty2 = around.parent, base2 = empty2 === null || empty2 === void 0 ? void 0 : empty2.parent; - if (empty2.from == head - 1 && ((_c = base2.lastChild) === null || _c === void 0 ? void 0 : _c.name) != "CloseTag" && (name3 = elementName2(state.doc, base2, head))) { - let insert4 = `/${name3}>`; - return { range: EditorSelection.cursor(head + insert4.length), changes: { from: head, insert: insert4 } }; - } - } - return { range }; - }); - if (changes.changes.empty) - return false; - view.dispatch(changes, { userEvent: "input.type", scrollIntoView: true }); - return true; - }); - - // node_modules/@codemirror/lang-php/dist/index.js - var phpLanguage = /* @__PURE__ */ LRLanguage.define({ - parser: /* @__PURE__ */ parser2.configure({ - props: [ - /* @__PURE__ */ indentNodeProp.add({ - IfStatement: /* @__PURE__ */ continuedIndent({ except: /^\s*({|else\b|elseif\b|endif\b)/ }), - TryStatement: /* @__PURE__ */ continuedIndent({ except: /^\s*({|catch\b|finally\b)/ }), - SwitchBody: (context) => { - let after = context.textAfter, closed = /^\s*\}/.test(after), isCase = /^\s*(case|default)\b/.test(after); - return context.baseIndent + (closed ? 0 : isCase ? 1 : 2) * context.unit; - }, - ColonBlock: (cx) => cx.baseIndent + cx.unit, - "Block EnumBody DeclarationList": /* @__PURE__ */ delimitedIndent({ closing: "}" }), - ArrowFunction: (cx) => cx.baseIndent + cx.unit, - "String BlockComment": () => -1, - Statement: /* @__PURE__ */ continuedIndent({ except: /^({|end(for|foreach|switch|while)\b)/ }) - }), - /* @__PURE__ */ foldNodeProp.add({ - "Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList": foldInside, - ColonBlock(tree) { - return { from: tree.from + 1, to: tree.to }; - }, - BlockComment(tree) { - return { from: tree.from + 2, to: tree.to - 2 }; - } - }), - /* @__PURE__ */ styleTags({ - "Visibility abstract final static": tags.modifier, - "for foreach while do if else elseif switch try catch finally return throw break continue default case": tags.controlKeyword, - "endif endfor endforeach endswitch endwhile goto match": tags.controlKeyword, - "and or xor yield unset clone instanceof insteadof": tags.operatorKeyword, - "function fn class trait implements extends const enum global namespace trait use var": tags.definitionKeyword, - "include include_once require require_once declare enddeclare": tags.definitionKeyword, - "new from echo print array list as": tags.keyword, - null: tags.null, - Boolean: tags.bool, - VariableName: tags.variableName, - "NamespaceName/...": tags.namespace, - "NamedType/...": tags.typeName, - Name: tags.name, - "CallExpression/Name": /* @__PURE__ */ tags.function(tags.variableName), - "LabelStatement/Name": tags.labelName, - "MemberExpression/Name MemberExpression/VariableName": tags.propertyName, - "CallExpression/MemberExpression/Name": /* @__PURE__ */ tags.function(tags.propertyName), - "FunctionDefinition/Name": /* @__PURE__ */ tags.function(/* @__PURE__ */ tags.definition(tags.variableName)), - "ClassDeclaration/Name": /* @__PURE__ */ tags.definition(tags.className), - UpdateOp: tags.updateOperator, - ArithOp: tags.arithmeticOperator, - LogicOp: tags.logicOperator, - BitOp: tags.bitwiseOperator, - CompareOp: tags.compareOperator, - ControlOp: tags.controlOperator, - AssignOp: tags.definitionOperator, - "$ ConcatOp": tags.operator, - LineComment: tags.lineComment, - BlockComment: tags.blockComment, - Integer: tags.integer, - Float: tags.float, - String: tags.string, - ShellExpression: /* @__PURE__ */ tags.special(tags.string), - "=> ->": tags.punctuation, - "( )": tags.paren, - "#[ [ ]": tags.squareBracket, - "${ { }": tags.brace, - "-> ?->": tags.derefOperator, - ", ; :: : \\": tags.separator, - "PhpOpen PhpClose": tags.processingInstruction - }) - ] - }), - languageData: { - commentTokens: { block: { open: "/*", close: "*/" }, line: "//" }, - indentOnInput: /^\s*(?:case |default:|end(?:if|for(?:each)?|switch|while)|else(?:if)?|\{|\})$/, - wordChars: "$" - } - }); - function php(config2 = {}) { - let support = [], base2; - if (config2.baseLanguage === null) - ; - else if (config2.baseLanguage) { - base2 = config2.baseLanguage; - } else { - let htmlSupport = html({ matchClosingTags: false }); - support.push(htmlSupport.support); - base2 = htmlSupport.language; - } - return new LanguageSupport(phpLanguage.configure({ - wrap: base2 && parseMixed((node) => { - if (!node.type.isTop) - return null; - return { - parser: base2.parser, - overlay: (node2) => node2.name == "Text" - }; - }), - top: config2.plain ? "Program" : "Template" - }), support); - } - - // node_modules/@lezer/json/node_modules/@lezer/common/dist/index.js - var DefaultBufferLength5 = 1024; - var nextPropID5 = 0; - var Range6 = class { - constructor(from2, to) { - this.from = from2; - this.to = to; - } - }; - var NodeProp5 = class { - constructor(config2 = {}) { - this.id = nextPropID5++; - this.perNode = !!config2.perNode; - this.deserialize = config2.deserialize || (() => { - throw new Error("This node type doesn't define a deserialize function"); - }); - } - add(match2) { - if (this.perNode) - throw new RangeError("Can't add per-node props to node types"); - if (typeof match2 != "function") - match2 = NodeType5.match(match2); - return (type) => { - let result = match2(type); - return result === void 0 ? null : [this, result]; - }; - } - }; - NodeProp5.closedBy = new NodeProp5({ deserialize: (str) => str.split(" ") }); - NodeProp5.openedBy = new NodeProp5({ deserialize: (str) => str.split(" ") }); - NodeProp5.group = new NodeProp5({ deserialize: (str) => str.split(" ") }); - NodeProp5.contextHash = new NodeProp5({ perNode: true }); - NodeProp5.lookAhead = new NodeProp5({ perNode: true }); - NodeProp5.mounted = new NodeProp5({ perNode: true }); - var noProps5 = /* @__PURE__ */ Object.create(null); - var NodeType5 = class { - constructor(name3, props, id3, flags = 0) { - this.name = name3; - this.props = props; - this.id = id3; - this.flags = flags; - } - static define(spec) { - let props = spec.props && spec.props.length ? /* @__PURE__ */ Object.create(null) : noProps5; - let flags = (spec.top ? 1 : 0) | (spec.skipped ? 2 : 0) | (spec.error ? 4 : 0) | (spec.name == null ? 8 : 0); - let type = new NodeType5(spec.name || "", props, spec.id, flags); - if (spec.props) - for (let src of spec.props) { - if (!Array.isArray(src)) - src = src(type); - if (src) { - if (src[0].perNode) - throw new RangeError("Can't store a per-node prop on a node type"); - props[src[0].id] = src[1]; - } - } - return type; - } - prop(prop) { - return this.props[prop.id]; - } - get isTop() { - return (this.flags & 1) > 0; - } - get isSkipped() { - return (this.flags & 2) > 0; - } - get isError() { - return (this.flags & 4) > 0; - } - get isAnonymous() { - return (this.flags & 8) > 0; - } - is(name3) { - if (typeof name3 == "string") { - if (this.name == name3) - return true; - let group = this.prop(NodeProp5.group); - return group ? group.indexOf(name3) > -1 : false; - } - return this.id == name3; - } - static match(map) { - let direct = /* @__PURE__ */ Object.create(null); - for (let prop in map) - for (let name3 of prop.split(" ")) - direct[name3] = map[prop]; - return (node) => { - for (let groups = node.prop(NodeProp5.group), i = -1; i < (groups ? groups.length : 0); i++) { - let found = direct[i < 0 ? node.name : groups[i]]; - if (found) - return found; - } - }; - } - }; - NodeType5.none = new NodeType5("", /* @__PURE__ */ Object.create(null), 0, 8); - var NodeSet4 = class { - constructor(types4) { - this.types = types4; - for (let i = 0; i < types4.length; i++) - if (types4[i].id != i) - throw new RangeError("Node type ids should correspond to array positions when creating a node set"); - } - extend(...props) { - let newTypes = []; - for (let type of this.types) { - let newProps = null; - for (let source of props) { - let add2 = source(type); - if (add2) { - if (!newProps) - newProps = Object.assign({}, type.props); - newProps[add2[0].id] = add2[1]; - } - } - newTypes.push(newProps ? new NodeType5(type.name, newProps, type.id, type.flags) : type); - } - return new NodeSet4(newTypes); - } - }; - var CachedNode5 = /* @__PURE__ */ new WeakMap(); - var CachedInnerNode5 = /* @__PURE__ */ new WeakMap(); - var IterMode4; - (function(IterMode6) { - IterMode6[IterMode6["ExcludeBuffers"] = 1] = "ExcludeBuffers"; - IterMode6[IterMode6["IncludeAnonymous"] = 2] = "IncludeAnonymous"; - IterMode6[IterMode6["IgnoreMounts"] = 4] = "IgnoreMounts"; - IterMode6[IterMode6["IgnoreOverlays"] = 8] = "IgnoreOverlays"; - })(IterMode4 || (IterMode4 = {})); - var Tree5 = class { - constructor(type, children, positions, length, props) { - this.type = type; - this.children = children; - this.positions = positions; - this.length = length; - this.props = null; - if (props && props.length) { - this.props = /* @__PURE__ */ Object.create(null); - for (let [prop, value] of props) - this.props[typeof prop == "number" ? prop : prop.id] = value; - } - } - toString() { - let mounted = this.prop(NodeProp5.mounted); - if (mounted && !mounted.overlay) - return mounted.tree.toString(); - let children = ""; - for (let ch of this.children) { - let str = ch.toString(); - if (str) { - if (children) - children += ","; - children += str; - } - } - return !this.type.name ? children : (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (children.length ? "(" + children + ")" : ""); - } - cursor(mode = 0) { - return new TreeCursor5(this.topNode, mode); - } - cursorAt(pos, side = 0, mode = 0) { - let scope = CachedNode5.get(this) || this.topNode; - let cursor = new TreeCursor5(scope); - cursor.moveTo(pos, side); - CachedNode5.set(this, cursor._tree); - return cursor; - } - get topNode() { - return new TreeNode5(this, 0, 0, null); - } - resolve(pos, side = 0) { - let node = resolveNode5(CachedNode5.get(this) || this.topNode, pos, side, false); - CachedNode5.set(this, node); - return node; - } - resolveInner(pos, side = 0) { - let node = resolveNode5(CachedInnerNode5.get(this) || this.topNode, pos, side, true); - CachedInnerNode5.set(this, node); - return node; - } - iterate(spec) { - let { enter, leave, from: from2 = 0, to = this.length } = spec; - for (let c = this.cursor((spec.mode || 0) | IterMode4.IncludeAnonymous); ; ) { - let entered = false; - if (c.from <= to && c.to >= from2 && (c.type.isAnonymous || enter(c) !== false)) { - if (c.firstChild()) - continue; - entered = true; - } - for (; ; ) { - if (entered && leave && !c.type.isAnonymous) - leave(c); - if (c.nextSibling()) - break; - if (!c.parent()) - return; - entered = true; - } - } - } - prop(prop) { - return !prop.perNode ? this.type.prop(prop) : this.props ? this.props[prop.id] : void 0; - } - get propValues() { - let result = []; - if (this.props) - for (let id3 in this.props) - result.push([+id3, this.props[id3]]); - return result; - } - balance(config2 = {}) { - return this.children.length <= 8 ? this : balanceRange5(NodeType5.none, this.children, this.positions, 0, this.children.length, 0, this.length, (children, positions, length) => new Tree5(this.type, children, positions, length, this.propValues), config2.makeTree || ((children, positions, length) => new Tree5(NodeType5.none, children, positions, length))); - } - static build(data) { - return buildTree5(data); - } - }; - Tree5.empty = new Tree5(NodeType5.none, [], [], 0); - var FlatBufferCursor5 = class { - constructor(buffer, index) { - this.buffer = buffer; - this.index = index; - } - get id() { - return this.buffer[this.index - 4]; - } - get start() { - return this.buffer[this.index - 3]; - } - get end() { - return this.buffer[this.index - 2]; - } - get size() { - return this.buffer[this.index - 1]; - } - get pos() { - return this.index; - } - next() { - this.index -= 4; - } - fork() { - return new FlatBufferCursor5(this.buffer, this.index); - } - }; - var TreeBuffer5 = class { - constructor(buffer, length, set) { - this.buffer = buffer; - this.length = length; - this.set = set; - } - get type() { - return NodeType5.none; - } - toString() { - let result = []; - for (let index = 0; index < this.buffer.length; ) { - result.push(this.childString(index)); - index = this.buffer[index + 3]; - } - return result.join(","); - } - childString(index) { - let id3 = this.buffer[index], endIndex = this.buffer[index + 3]; - let type = this.set.types[id3], result = type.name; - if (/\W/.test(result) && !type.isError) - result = JSON.stringify(result); - index += 4; - if (endIndex == index) - return result; - let children = []; - while (index < endIndex) { - children.push(this.childString(index)); - index = this.buffer[index + 3]; - } - return result + "(" + children.join(",") + ")"; - } - findChild(startIndex, endIndex, dir, pos, side) { - let { buffer } = this, pick = -1; - for (let i = startIndex; i != endIndex; i = buffer[i + 3]) { - if (checkSide5(side, pos, buffer[i + 1], buffer[i + 2])) { - pick = i; - if (dir > 0) - break; - } - } - return pick; - } - slice(startI, endI, from2, to) { - let b = this.buffer; - let copy = new Uint16Array(endI - startI); - for (let i = startI, j = 0; i < endI; ) { - copy[j++] = b[i++]; - copy[j++] = b[i++] - from2; - copy[j++] = b[i++] - from2; - copy[j++] = b[i++] - startI; - } - return new TreeBuffer5(copy, to - from2, this.set); - } - }; - function checkSide5(side, pos, from2, to) { - switch (side) { - case -2: - return from2 < pos; - case -1: - return to >= pos && from2 < pos; - case 0: - return from2 < pos && to > pos; - case 1: - return from2 <= pos && to > pos; - case 2: - return to > pos; - case 4: - return true; - } - } - function enterUnfinishedNodesBefore5(node, pos) { - let scan = node.childBefore(pos); - while (scan) { - let last = scan.lastChild; - if (!last || last.to != scan.to) - break; - if (last.type.isError && last.from == last.to) { - node = scan; - scan = last.prevSibling; - } else { - scan = last; - } - } - return node; - } - function resolveNode5(node, pos, side, overlays) { - var _a4; - while (node.from == node.to || (side < 1 ? node.from >= pos : node.from > pos) || (side > -1 ? node.to <= pos : node.to < pos)) { - let parent = !overlays && node instanceof TreeNode5 && node.index < 0 ? null : node.parent; - if (!parent) - return node; - node = parent; - } - let mode = overlays ? 0 : IterMode4.IgnoreOverlays; - if (overlays) - for (let scan = node, parent = scan.parent; parent; scan = parent, parent = scan.parent) { - if (scan instanceof TreeNode5 && scan.index < 0 && ((_a4 = parent.enter(pos, side, mode)) === null || _a4 === void 0 ? void 0 : _a4.from) != scan.from) - node = parent; - } - for (; ; ) { - let inner = node.enter(pos, side, mode); - if (!inner) - return node; - node = inner; - } - } - var TreeNode5 = class { - constructor(_tree, from2, index, _parent) { - this._tree = _tree; - this.from = from2; - this.index = index; - this._parent = _parent; - } - get type() { - return this._tree.type; - } - get name() { - return this._tree.type.name; - } - get to() { - return this.from + this._tree.length; - } - nextChild(i, dir, pos, side, mode = 0) { - for (let parent = this; ; ) { - for (let { children, positions } = parent._tree, e = dir > 0 ? children.length : -1; i != e; i += dir) { - let next = children[i], start = positions[i] + parent.from; - if (!checkSide5(side, pos, start, start + next.length)) - continue; - if (next instanceof TreeBuffer5) { - if (mode & IterMode4.ExcludeBuffers) - continue; - let index = next.findChild(0, next.buffer.length, dir, pos - start, side); - if (index > -1) - return new BufferNode5(new BufferContext5(parent, next, i, start), null, index); - } else if (mode & IterMode4.IncludeAnonymous || (!next.type.isAnonymous || hasChild5(next))) { - let mounted; - if (!(mode & IterMode4.IgnoreMounts) && next.props && (mounted = next.prop(NodeProp5.mounted)) && !mounted.overlay) - return new TreeNode5(mounted.tree, start, i, parent); - let inner = new TreeNode5(next, start, i, parent); - return mode & IterMode4.IncludeAnonymous || !inner.type.isAnonymous ? inner : inner.nextChild(dir < 0 ? next.children.length - 1 : 0, dir, pos, side); - } - } - if (mode & IterMode4.IncludeAnonymous || !parent.type.isAnonymous) - return null; - if (parent.index >= 0) - i = parent.index + dir; - else - i = dir < 0 ? -1 : parent._parent._tree.children.length; - parent = parent._parent; - if (!parent) - return null; - } - } - get firstChild() { - return this.nextChild(0, 1, 0, 4); - } - get lastChild() { - return this.nextChild(this._tree.children.length - 1, -1, 0, 4); - } - childAfter(pos) { - return this.nextChild(0, 1, pos, 2); - } - childBefore(pos) { - return this.nextChild(this._tree.children.length - 1, -1, pos, -2); - } - enter(pos, side, mode = 0) { - let mounted; - if (!(mode & IterMode4.IgnoreOverlays) && (mounted = this._tree.prop(NodeProp5.mounted)) && mounted.overlay) { - let rPos = pos - this.from; - for (let { from: from2, to } of mounted.overlay) { - if ((side > 0 ? from2 <= rPos : from2 < rPos) && (side < 0 ? to >= rPos : to > rPos)) - return new TreeNode5(mounted.tree, mounted.overlay[0].from + this.from, -1, this); - } - } - return this.nextChild(0, 1, pos, side, mode); - } - nextSignificantParent() { - let val = this; - while (val.type.isAnonymous && val._parent) - val = val._parent; - return val; - } - get parent() { - return this._parent ? this._parent.nextSignificantParent() : null; - } - get nextSibling() { - return this._parent && this.index >= 0 ? this._parent.nextChild(this.index + 1, 1, 0, 4) : null; - } - get prevSibling() { - return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4) : null; - } - cursor(mode = 0) { - return new TreeCursor5(this, mode); - } - get tree() { - return this._tree; - } - toTree() { - return this._tree; - } - resolve(pos, side = 0) { - return resolveNode5(this, pos, side, false); - } - resolveInner(pos, side = 0) { - return resolveNode5(this, pos, side, true); - } - enterUnfinishedNodesBefore(pos) { - return enterUnfinishedNodesBefore5(this, pos); - } - getChild(type, before = null, after = null) { - let r = getChildren5(this, type, before, after); - return r.length ? r[0] : null; - } - getChildren(type, before = null, after = null) { - return getChildren5(this, type, before, after); - } - toString() { - return this._tree.toString(); - } - get node() { - return this; - } - matchContext(context) { - return matchNodeContext4(this, context); - } - }; - function getChildren5(node, type, before, after) { - let cur2 = node.cursor(), result = []; - if (!cur2.firstChild()) - return result; - if (before != null) { - while (!cur2.type.is(before)) - if (!cur2.nextSibling()) - return result; - } - for (; ; ) { - if (after != null && cur2.type.is(after)) - return result; - if (cur2.type.is(type)) - result.push(cur2.node); - if (!cur2.nextSibling()) - return after == null ? result : []; - } - } - function matchNodeContext4(node, context, i = context.length - 1) { - for (let p = node.parent; i >= 0; p = p.parent) { - if (!p) - return false; - if (!p.type.isAnonymous) { - if (context[i] && context[i] != p.name) - return false; - i--; - } - } - return true; - } - var BufferContext5 = class { - constructor(parent, buffer, index, start) { - this.parent = parent; - this.buffer = buffer; - this.index = index; - this.start = start; - } - }; - var BufferNode5 = class { - constructor(context, _parent, index) { - this.context = context; - this._parent = _parent; - this.index = index; - this.type = context.buffer.set.types[context.buffer.buffer[index]]; - } - get name() { - return this.type.name; - } - get from() { - return this.context.start + this.context.buffer.buffer[this.index + 1]; - } - get to() { - return this.context.start + this.context.buffer.buffer[this.index + 2]; - } - child(dir, pos, side) { - let { buffer } = this.context; - let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.context.start, side); - return index < 0 ? null : new BufferNode5(this.context, this, index); - } - get firstChild() { - return this.child(1, 0, 4); - } - get lastChild() { - return this.child(-1, 0, 4); - } - childAfter(pos) { - return this.child(1, pos, 2); - } - childBefore(pos) { - return this.child(-1, pos, -2); - } - enter(pos, side, mode = 0) { - if (mode & IterMode4.ExcludeBuffers) - return null; - let { buffer } = this.context; - let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], side > 0 ? 1 : -1, pos - this.context.start, side); - return index < 0 ? null : new BufferNode5(this.context, this, index); - } - get parent() { - return this._parent || this.context.parent.nextSignificantParent(); - } - externalSibling(dir) { - return this._parent ? null : this.context.parent.nextChild(this.context.index + dir, dir, 0, 4); - } - get nextSibling() { - let { buffer } = this.context; - let after = buffer.buffer[this.index + 3]; - if (after < (this._parent ? buffer.buffer[this._parent.index + 3] : buffer.buffer.length)) - return new BufferNode5(this.context, this._parent, after); - return this.externalSibling(1); - } - get prevSibling() { - let { buffer } = this.context; - let parentStart = this._parent ? this._parent.index + 4 : 0; - if (this.index == parentStart) - return this.externalSibling(-1); - return new BufferNode5(this.context, this._parent, buffer.findChild(parentStart, this.index, -1, 0, 4)); - } - cursor(mode = 0) { - return new TreeCursor5(this, mode); - } - get tree() { - return null; - } - toTree() { - let children = [], positions = []; - let { buffer } = this.context; - let startI = this.index + 4, endI = buffer.buffer[this.index + 3]; - if (endI > startI) { - let from2 = buffer.buffer[this.index + 1], to = buffer.buffer[this.index + 2]; - children.push(buffer.slice(startI, endI, from2, to)); - positions.push(0); - } - return new Tree5(this.type, children, positions, this.to - this.from); - } - resolve(pos, side = 0) { - return resolveNode5(this, pos, side, false); - } - resolveInner(pos, side = 0) { - return resolveNode5(this, pos, side, true); - } - enterUnfinishedNodesBefore(pos) { - return enterUnfinishedNodesBefore5(this, pos); - } - toString() { - return this.context.buffer.childString(this.index); - } - getChild(type, before = null, after = null) { - let r = getChildren5(this, type, before, after); - return r.length ? r[0] : null; - } - getChildren(type, before = null, after = null) { - return getChildren5(this, type, before, after); - } - get node() { - return this; - } - matchContext(context) { - return matchNodeContext4(this, context); - } - }; - var TreeCursor5 = class { - constructor(node, mode = 0) { - this.mode = mode; - this.buffer = null; - this.stack = []; - this.index = 0; - this.bufferNode = null; - if (node instanceof TreeNode5) { - this.yieldNode(node); - } else { - this._tree = node.context.parent; - this.buffer = node.context; - for (let n = node._parent; n; n = n._parent) - this.stack.unshift(n.index); - this.bufferNode = node; - this.yieldBuf(node.index); - } - } - get name() { - return this.type.name; - } - yieldNode(node) { - if (!node) - return false; - this._tree = node; - this.type = node.type; - this.from = node.from; - this.to = node.to; - return true; - } - yieldBuf(index, type) { - this.index = index; - let { start, buffer } = this.buffer; - this.type = type || buffer.set.types[buffer.buffer[index]]; - this.from = start + buffer.buffer[index + 1]; - this.to = start + buffer.buffer[index + 2]; - return true; - } - yield(node) { - if (!node) - return false; - if (node instanceof TreeNode5) { - this.buffer = null; - return this.yieldNode(node); - } - this.buffer = node.context; - return this.yieldBuf(node.index, node.type); - } - toString() { - return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString(); - } - enterChild(dir, pos, side) { - if (!this.buffer) - return this.yield(this._tree.nextChild(dir < 0 ? this._tree._tree.children.length - 1 : 0, dir, pos, side, this.mode)); - let { buffer } = this.buffer; - let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.buffer.start, side); - if (index < 0) - return false; - this.stack.push(this.index); - return this.yieldBuf(index); - } - firstChild() { - return this.enterChild(1, 0, 4); - } - lastChild() { - return this.enterChild(-1, 0, 4); - } - childAfter(pos) { - return this.enterChild(1, pos, 2); - } - childBefore(pos) { - return this.enterChild(-1, pos, -2); - } - enter(pos, side, mode = this.mode) { - if (!this.buffer) - return this.yield(this._tree.enter(pos, side, mode)); - return mode & IterMode4.ExcludeBuffers ? false : this.enterChild(1, pos, side); - } - parent() { - if (!this.buffer) - return this.yieldNode(this.mode & IterMode4.IncludeAnonymous ? this._tree._parent : this._tree.parent); - if (this.stack.length) - return this.yieldBuf(this.stack.pop()); - let parent = this.mode & IterMode4.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent(); - this.buffer = null; - return this.yieldNode(parent); - } - sibling(dir) { - if (!this.buffer) - return !this._tree._parent ? false : this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + dir, dir, 0, 4, this.mode)); - let { buffer } = this.buffer, d = this.stack.length - 1; - if (dir < 0) { - let parentStart = d < 0 ? 0 : this.stack[d] + 4; - if (this.index != parentStart) - return this.yieldBuf(buffer.findChild(parentStart, this.index, -1, 0, 4)); - } else { - let after = buffer.buffer[this.index + 3]; - if (after < (d < 0 ? buffer.buffer.length : buffer.buffer[this.stack[d] + 3])) - return this.yieldBuf(after); - } - return d < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + dir, dir, 0, 4, this.mode)) : false; - } - nextSibling() { - return this.sibling(1); - } - prevSibling() { - return this.sibling(-1); - } - atLastNode(dir) { - let index, parent, { buffer } = this; - if (buffer) { - if (dir > 0) { - if (this.index < buffer.buffer.buffer.length) - return false; - } else { - for (let i = 0; i < this.index; i++) - if (buffer.buffer.buffer[i + 3] < this.index) - return false; - } - ({ index, parent } = buffer); - } else { - ({ index, _parent: parent } = this._tree); - } - for (; parent; { index, _parent: parent } = parent) { - if (index > -1) - for (let i = index + dir, e = dir < 0 ? -1 : parent._tree.children.length; i != e; i += dir) { - let child = parent._tree.children[i]; - if (this.mode & IterMode4.IncludeAnonymous || child instanceof TreeBuffer5 || !child.type.isAnonymous || hasChild5(child)) - return false; - } - } - return true; - } - move(dir, enter) { - if (enter && this.enterChild(dir, 0, 4)) - return true; - for (; ; ) { - if (this.sibling(dir)) - return true; - if (this.atLastNode(dir) || !this.parent()) - return false; - } - } - next(enter = true) { - return this.move(1, enter); - } - prev(enter = true) { - return this.move(-1, enter); - } - moveTo(pos, side = 0) { - while (this.from == this.to || (side < 1 ? this.from >= pos : this.from > pos) || (side > -1 ? this.to <= pos : this.to < pos)) - if (!this.parent()) - break; - while (this.enterChild(1, pos, side)) { - } - return this; - } - get node() { - if (!this.buffer) - return this._tree; - let cache = this.bufferNode, result = null, depth = 0; - if (cache && cache.context == this.buffer) { - scan: - for (let index = this.index, d = this.stack.length; d >= 0; ) { - for (let c = cache; c; c = c._parent) - if (c.index == index) { - if (index == this.index) - return c; - result = c; - depth = d + 1; - break scan; - } - index = this.stack[--d]; - } - } - for (let i = depth; i < this.stack.length; i++) - result = new BufferNode5(this.buffer, result, this.stack[i]); - return this.bufferNode = new BufferNode5(this.buffer, result, this.index); - } - get tree() { - return this.buffer ? null : this._tree._tree; - } - iterate(enter, leave) { - for (let depth = 0; ; ) { - let mustLeave = false; - if (this.type.isAnonymous || enter(this) !== false) { - if (this.firstChild()) { - depth++; - continue; - } - if (!this.type.isAnonymous) - mustLeave = true; - } - for (; ; ) { - if (mustLeave && leave) - leave(this); - mustLeave = this.type.isAnonymous; - if (this.nextSibling()) - break; - if (!depth) - return; - this.parent(); - depth--; - mustLeave = true; - } - } - } - matchContext(context) { - if (!this.buffer) - return matchNodeContext4(this.node, context); - let { buffer } = this.buffer, { types: types4 } = buffer.set; - for (let i = context.length - 1, d = this.stack.length - 1; i >= 0; d--) { - if (d < 0) - return matchNodeContext4(this.node, context, i); - let type = types4[buffer.buffer[this.stack[d]]]; - if (!type.isAnonymous) { - if (context[i] && context[i] != type.name) - return false; - i--; - } - } - return true; - } - }; - function hasChild5(tree) { - return tree.children.some((ch) => ch instanceof TreeBuffer5 || !ch.type.isAnonymous || hasChild5(ch)); - } - function buildTree5(data) { - var _a4; - let { buffer, nodeSet, maxBufferLength = DefaultBufferLength5, reused = [], minRepeatType = nodeSet.types.length } = data; - let cursor = Array.isArray(buffer) ? new FlatBufferCursor5(buffer, buffer.length) : buffer; - let types4 = nodeSet.types; - let contextHash = 0, lookAhead = 0; - function takeNode(parentStart, minPos, children2, positions2, inRepeat) { - let { id: id3, start, end, size } = cursor; - let lookAheadAtStart = lookAhead; - while (size < 0) { - cursor.next(); - if (size == -1) { - let node2 = reused[id3]; - children2.push(node2); - positions2.push(start - parentStart); - return; - } else if (size == -3) { - contextHash = id3; - return; - } else if (size == -4) { - lookAhead = id3; - return; - } else { - throw new RangeError(`Unrecognized record size: ${size}`); - } - } - let type = types4[id3], node, buffer2; - let startPos = start - parentStart; - if (end - start <= maxBufferLength && (buffer2 = findBufferSize(cursor.pos - minPos, inRepeat))) { - let data2 = new Uint16Array(buffer2.size - buffer2.skip); - let endPos = cursor.pos - buffer2.size, index = data2.length; - while (cursor.pos > endPos) - index = copyToBuffer(buffer2.start, data2, index); - node = new TreeBuffer5(data2, end - buffer2.start, nodeSet); - startPos = buffer2.start - parentStart; - } else { - let endPos = cursor.pos - size; - cursor.next(); - let localChildren = [], localPositions = []; - let localInRepeat = id3 >= minRepeatType ? id3 : -1; - let lastGroup = 0, lastEnd = end; - while (cursor.pos > endPos) { - if (localInRepeat >= 0 && cursor.id == localInRepeat && cursor.size >= 0) { - if (cursor.end <= lastEnd - maxBufferLength) { - makeRepeatLeaf(localChildren, localPositions, start, lastGroup, cursor.end, lastEnd, localInRepeat, lookAheadAtStart); - lastGroup = localChildren.length; - lastEnd = cursor.end; - } - cursor.next(); - } else { - takeNode(start, endPos, localChildren, localPositions, localInRepeat); - } - } - if (localInRepeat >= 0 && lastGroup > 0 && lastGroup < localChildren.length) - makeRepeatLeaf(localChildren, localPositions, start, lastGroup, start, lastEnd, localInRepeat, lookAheadAtStart); - localChildren.reverse(); - localPositions.reverse(); - if (localInRepeat > -1 && lastGroup > 0) { - let make = makeBalanced(type); - node = balanceRange5(type, localChildren, localPositions, 0, localChildren.length, 0, end - start, make, make); - } else { - node = makeTree(type, localChildren, localPositions, end - start, lookAheadAtStart - end); - } - } - children2.push(node); - positions2.push(startPos); - } - function makeBalanced(type) { - return (children2, positions2, length2) => { - let lookAhead2 = 0, lastI = children2.length - 1, last, lookAheadProp; - if (lastI >= 0 && (last = children2[lastI]) instanceof Tree5) { - if (!lastI && last.type == type && last.length == length2) - return last; - if (lookAheadProp = last.prop(NodeProp5.lookAhead)) - lookAhead2 = positions2[lastI] + last.length + lookAheadProp; - } - return makeTree(type, children2, positions2, length2, lookAhead2); - }; - } - function makeRepeatLeaf(children2, positions2, base2, i, from2, to, type, lookAhead2) { - let localChildren = [], localPositions = []; - while (children2.length > i) { - localChildren.push(children2.pop()); - localPositions.push(positions2.pop() + base2 - from2); - } - children2.push(makeTree(nodeSet.types[type], localChildren, localPositions, to - from2, lookAhead2 - to)); - positions2.push(from2 - base2); - } - function makeTree(type, children2, positions2, length2, lookAhead2 = 0, props) { - if (contextHash) { - let pair4 = [NodeProp5.contextHash, contextHash]; - props = props ? [pair4].concat(props) : [pair4]; - } - if (lookAhead2 > 25) { - let pair4 = [NodeProp5.lookAhead, lookAhead2]; - props = props ? [pair4].concat(props) : [pair4]; - } - return new Tree5(type, children2, positions2, length2, props); - } - function findBufferSize(maxSize, inRepeat) { - let fork = cursor.fork(); - let size = 0, start = 0, skip = 0, minStart = fork.end - maxBufferLength; - let result = { size: 0, start: 0, skip: 0 }; - scan: - for (let minPos = fork.pos - maxSize; fork.pos > minPos; ) { - let nodeSize7 = fork.size; - if (fork.id == inRepeat && nodeSize7 >= 0) { - result.size = size; - result.start = start; - result.skip = skip; - skip += 4; - size += 4; - fork.next(); - continue; - } - let startPos = fork.pos - nodeSize7; - if (nodeSize7 < 0 || startPos < minPos || fork.start < minStart) - break; - let localSkipped = fork.id >= minRepeatType ? 4 : 0; - let nodeStart2 = fork.start; - fork.next(); - while (fork.pos > startPos) { - if (fork.size < 0) { - if (fork.size == -3) - localSkipped += 4; - else - break scan; - } else if (fork.id >= minRepeatType) { - localSkipped += 4; - } - fork.next(); - } - start = nodeStart2; - size += nodeSize7; - skip += localSkipped; - } - if (inRepeat < 0 || size == maxSize) { - result.size = size; - result.start = start; - result.skip = skip; - } - return result.size > 4 ? result : void 0; - } - function copyToBuffer(bufferStart, buffer2, index) { - let { id: id3, start, end, size } = cursor; - cursor.next(); - if (size >= 0 && id3 < minRepeatType) { - let startIndex = index; - if (size > 4) { - let endPos = cursor.pos - (size - 4); - while (cursor.pos > endPos) - index = copyToBuffer(bufferStart, buffer2, index); - } - buffer2[--index] = startIndex; - buffer2[--index] = end - bufferStart; - buffer2[--index] = start - bufferStart; - buffer2[--index] = id3; - } else if (size == -3) { - contextHash = id3; - } else if (size == -4) { - lookAhead = id3; - } - return index; - } - let children = [], positions = []; - while (cursor.pos > 0) - takeNode(data.start || 0, data.bufferStart || 0, children, positions, -1); - let length = (_a4 = data.length) !== null && _a4 !== void 0 ? _a4 : children.length ? positions[0] + children[0].length : 0; - return new Tree5(types4[data.topID], children.reverse(), positions.reverse(), length); - } - var nodeSizeCache5 = /* @__PURE__ */ new WeakMap(); - function nodeSize5(balanceType, node) { - if (!balanceType.isAnonymous || node instanceof TreeBuffer5 || node.type != balanceType) - return 1; - let size = nodeSizeCache5.get(node); - if (size == null) { - size = 1; - for (let child of node.children) { - if (child.type != balanceType || !(child instanceof Tree5)) { - size = 1; - break; - } - size += nodeSize5(balanceType, child); - } - nodeSizeCache5.set(node, size); - } - return size; - } - function balanceRange5(balanceType, children, positions, from2, to, start, length, mkTop, mkTree) { - let total = 0; - for (let i = from2; i < to; i++) - total += nodeSize5(balanceType, children[i]); - let maxChild = Math.ceil(total * 1.5 / 8); - let localChildren = [], localPositions = []; - function divide(children2, positions2, from3, to2, offset) { - for (let i = from3; i < to2; ) { - let groupFrom = i, groupStart = positions2[i], groupSize = nodeSize5(balanceType, children2[i]); - i++; - for (; i < to2; i++) { - let nextSize = nodeSize5(balanceType, children2[i]); - if (groupSize + nextSize >= maxChild) - break; - groupSize += nextSize; - } - if (i == groupFrom + 1) { - if (groupSize > maxChild) { - let only = children2[groupFrom]; - divide(only.children, only.positions, 0, only.children.length, positions2[groupFrom] + offset); - continue; - } - localChildren.push(children2[groupFrom]); - } else { - let length2 = positions2[i - 1] + children2[i - 1].length - groupStart; - localChildren.push(balanceRange5(balanceType, children2, positions2, groupFrom, i, groupStart, length2, null, mkTree)); - } - localPositions.push(groupStart + offset - start); - } - } - divide(children, positions, from2, to, 0); - return (mkTop || mkTree)(localChildren, localPositions, length); - } - var Parser4 = class { - startParse(input, fragments, ranges) { - if (typeof input == "string") - input = new StringInput4(input); - ranges = !ranges ? [new Range6(0, input.length)] : ranges.length ? ranges.map((r) => new Range6(r.from, r.to)) : [new Range6(0, 0)]; - return this.createParse(input, fragments || [], ranges); - } - parse(input, fragments, ranges) { - let parse = this.startParse(input, fragments, ranges); - for (; ; ) { - let done = parse.advance(); - if (done) - return done; - } - } - }; - var StringInput4 = class { - constructor(string3) { - this.string = string3; - } - get length() { - return this.string.length; - } - chunk(from2) { - return this.string.slice(from2); - } - get lineChunks() { - return false; - } - read(from2, to) { - return this.string.slice(from2, to); - } - }; - var stoppedInner5 = new NodeProp5({ perNode: true }); - - // node_modules/@lezer/json/node_modules/@lezer/lr/dist/index.js - var Stack3 = class { - constructor(p, stack, state, reducePos, pos, score2, buffer, bufferBase, curContext, lookAhead = 0, parent) { - this.p = p; - this.stack = stack; - this.state = state; - this.reducePos = reducePos; - this.pos = pos; - this.score = score2; - this.buffer = buffer; - this.bufferBase = bufferBase; - this.curContext = curContext; - this.lookAhead = lookAhead; - this.parent = parent; - } - toString() { - return `[${this.stack.filter((_, i) => i % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? "!" + this.score : ""}`; - } - static start(p, state, pos = 0) { - let cx = p.parser.context; - return new Stack3(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext3(cx, cx.start) : null, 0, null); - } - get context() { - return this.curContext ? this.curContext.context : null; - } - pushState(state, start) { - this.stack.push(this.state, start, this.bufferBase + this.buffer.length); - this.state = state; - } - reduce(action) { - let depth = action >> 19, type = action & 65535; - let { parser: parser7 } = this.p; - let dPrec = parser7.dynamicPrecedence(type); - if (dPrec) - this.score += dPrec; - if (depth == 0) { - this.pushState(parser7.getGoto(this.state, type, true), this.reducePos); - if (type < parser7.minRepeatTerm) - this.storeNode(type, this.reducePos, this.reducePos, 4, true); - this.reduceContext(type, this.reducePos); - return; - } - let base2 = this.stack.length - (depth - 1) * 3 - (action & 262144 ? 6 : 0); - let start = this.stack[base2 - 2]; - let bufferBase = this.stack[base2 - 1], count = this.bufferBase + this.buffer.length - bufferBase; - if (type < parser7.minRepeatTerm || action & 131072) { - let pos = parser7.stateFlag(this.state, 1) ? this.pos : this.reducePos; - this.storeNode(type, start, pos, count + 4, true); - } - if (action & 262144) { - this.state = this.stack[base2]; - } else { - let baseStateID = this.stack[base2 - 3]; - this.state = parser7.getGoto(baseStateID, type, true); - } - while (this.stack.length > base2) - this.stack.pop(); - this.reduceContext(type, start); - } - storeNode(term, start, end, size = 4, isReduce = false) { - if (term == 0 && (!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) { - let cur2 = this, top2 = this.buffer.length; - if (top2 == 0 && cur2.parent) { - top2 = cur2.bufferBase - cur2.parent.bufferBase; - cur2 = cur2.parent; - } - if (top2 > 0 && cur2.buffer[top2 - 4] == 0 && cur2.buffer[top2 - 1] > -1) { - if (start == end) - return; - if (cur2.buffer[top2 - 2] >= start) { - cur2.buffer[top2 - 2] = end; - return; - } - } - } - if (!isReduce || this.pos == end) { - this.buffer.push(term, start, end, size); - } else { - let index = this.buffer.length; - if (index > 0 && this.buffer[index - 4] != 0) - while (index > 0 && this.buffer[index - 2] > end) { - this.buffer[index] = this.buffer[index - 4]; - this.buffer[index + 1] = this.buffer[index - 3]; - this.buffer[index + 2] = this.buffer[index - 2]; - this.buffer[index + 3] = this.buffer[index - 1]; - index -= 4; - if (size > 4) - size -= 4; - } - this.buffer[index] = term; - this.buffer[index + 1] = start; - this.buffer[index + 2] = end; - this.buffer[index + 3] = size; - } - } - shift(action, next, nextEnd) { - let start = this.pos; - if (action & 131072) { - this.pushState(action & 65535, this.pos); - } else if ((action & 262144) == 0) { - let nextState = action, { parser: parser7 } = this.p; - if (nextEnd > this.pos || next <= parser7.maxNode) { - this.pos = nextEnd; - if (!parser7.stateFlag(nextState, 1)) - this.reducePos = nextEnd; - } - this.pushState(nextState, start); - this.shiftContext(next, start); - if (next <= parser7.maxNode) - this.buffer.push(next, start, nextEnd, 4); - } else { - this.pos = nextEnd; - this.shiftContext(next, start); - if (next <= this.p.parser.maxNode) - this.buffer.push(next, start, nextEnd, 4); - } - } - apply(action, next, nextEnd) { - if (action & 65536) - this.reduce(action); - else - this.shift(action, next, nextEnd); - } - useNode(value, next) { - let index = this.p.reused.length - 1; - if (index < 0 || this.p.reused[index] != value) { - this.p.reused.push(value); - index++; - } - let start = this.pos; - this.reducePos = this.pos = start + value.length; - this.pushState(next, start); - this.buffer.push(index, start, this.reducePos, -1); - if (this.curContext) - this.updateContext(this.curContext.tracker.reuse(this.curContext.context, value, this, this.p.stream.reset(this.pos - value.length))); - } - split() { - let parent = this; - let off = parent.buffer.length; - while (off > 0 && parent.buffer[off - 2] > parent.reducePos) - off -= 4; - let buffer = parent.buffer.slice(off), base2 = parent.bufferBase + off; - while (parent && base2 == parent.bufferBase) - parent = parent.parent; - return new Stack3(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base2, this.curContext, this.lookAhead, parent); - } - recoverByDelete(next, nextEnd) { - let isNode = next <= this.p.parser.maxNode; - if (isNode) - this.storeNode(next, this.pos, nextEnd, 4); - this.storeNode(0, this.pos, nextEnd, isNode ? 8 : 4); - this.pos = this.reducePos = nextEnd; - this.score -= 190; - } - canShift(term) { - for (let sim = new SimulatedStack3(this); ; ) { - let action = this.p.parser.stateSlot(sim.state, 4) || this.p.parser.hasAction(sim.state, term); - if ((action & 65536) == 0) - return true; - if (action == 0) - return false; - sim.reduce(action); - } - } - recoverByInsert(next) { - if (this.stack.length >= 300) - return []; - let nextStates = this.p.parser.nextStates(this.state); - if (nextStates.length > 4 << 1 || this.stack.length >= 120) { - let best = []; - for (let i = 0, s; i < nextStates.length; i += 2) { - if ((s = nextStates[i + 1]) != this.state && this.p.parser.hasAction(s, next)) - best.push(nextStates[i], s); - } - if (this.stack.length < 120) - for (let i = 0; best.length < 4 << 1 && i < nextStates.length; i += 2) { - let s = nextStates[i + 1]; - if (!best.some((v, i2) => i2 & 1 && v == s)) - best.push(nextStates[i], s); - } - nextStates = best; - } - let result = []; - for (let i = 0; i < nextStates.length && result.length < 4; i += 2) { - let s = nextStates[i + 1]; - if (s == this.state) - continue; - let stack = this.split(); - stack.pushState(s, this.pos); - stack.storeNode(0, stack.pos, stack.pos, 4, true); - stack.shiftContext(nextStates[i], this.pos); - stack.score -= 200; - result.push(stack); - } - return result; - } - forceReduce() { - let reduce = this.p.parser.stateSlot(this.state, 5); - if ((reduce & 65536) == 0) - return false; - let { parser: parser7 } = this.p; - if (!parser7.validAction(this.state, reduce)) { - let depth = reduce >> 19, term = reduce & 65535; - let target = this.stack.length - depth * 3; - if (target < 0 || parser7.getGoto(this.stack[target], term, false) < 0) - return false; - this.storeNode(0, this.reducePos, this.reducePos, 4, true); - this.score -= 100; - } - this.reduce(reduce); - return true; - } - forceAll() { - while (!this.p.parser.stateFlag(this.state, 2)) { - if (!this.forceReduce()) { - this.storeNode(0, this.pos, this.pos, 4, true); - break; - } - } - return this; - } - get deadEnd() { - if (this.stack.length != 3) - return false; - let { parser: parser7 } = this.p; - return parser7.data[parser7.stateSlot(this.state, 1)] == 65535 && !parser7.stateSlot(this.state, 4); - } - restart() { - this.state = this.stack[0]; - this.stack.length = 0; - } - sameState(other) { - if (this.state != other.state || this.stack.length != other.stack.length) - return false; - for (let i = 0; i < this.stack.length; i += 3) - if (this.stack[i] != other.stack[i]) - return false; - return true; - } - get parser() { - return this.p.parser; - } - dialectEnabled(dialectID) { - return this.p.parser.dialect.flags[dialectID]; - } - shiftContext(term, start) { - if (this.curContext) - this.updateContext(this.curContext.tracker.shift(this.curContext.context, term, this, this.p.stream.reset(start))); - } - reduceContext(term, start) { - if (this.curContext) - this.updateContext(this.curContext.tracker.reduce(this.curContext.context, term, this, this.p.stream.reset(start))); - } - emitContext() { - let last = this.buffer.length - 1; - if (last < 0 || this.buffer[last] != -3) - this.buffer.push(this.curContext.hash, this.reducePos, this.reducePos, -3); - } - emitLookAhead() { - let last = this.buffer.length - 1; - if (last < 0 || this.buffer[last] != -4) - this.buffer.push(this.lookAhead, this.reducePos, this.reducePos, -4); - } - updateContext(context) { - if (context != this.curContext.context) { - let newCx = new StackContext3(this.curContext.tracker, context); - if (newCx.hash != this.curContext.hash) - this.emitContext(); - this.curContext = newCx; - } - } - setLookAhead(lookAhead) { - if (lookAhead > this.lookAhead) { - this.emitLookAhead(); - this.lookAhead = lookAhead; - } - } - close() { - if (this.curContext && this.curContext.tracker.strict) - this.emitContext(); - if (this.lookAhead > 0) - this.emitLookAhead(); - } - }; - var StackContext3 = class { - constructor(tracker, context) { - this.tracker = tracker; - this.context = context; - this.hash = tracker.strict ? tracker.hash(context) : 0; - } - }; - var Recover3; - (function(Recover4) { - Recover4[Recover4["Insert"] = 200] = "Insert"; - Recover4[Recover4["Delete"] = 190] = "Delete"; - Recover4[Recover4["Reduce"] = 100] = "Reduce"; - Recover4[Recover4["MaxNext"] = 4] = "MaxNext"; - Recover4[Recover4["MaxInsertStackDepth"] = 300] = "MaxInsertStackDepth"; - Recover4[Recover4["DampenInsertStackDepth"] = 120] = "DampenInsertStackDepth"; - })(Recover3 || (Recover3 = {})); - var SimulatedStack3 = class { - constructor(start) { - this.start = start; - this.state = start.state; - this.stack = start.stack; - this.base = this.stack.length; - } - reduce(action) { - let term = action & 65535, depth = action >> 19; - if (depth == 0) { - if (this.stack == this.start.stack) - this.stack = this.stack.slice(); - this.stack.push(this.state, 0, 0); - this.base += 3; - } else { - this.base -= (depth - 1) * 3; - } - let goto2 = this.start.p.parser.getGoto(this.stack[this.base - 3], term, true); - this.state = goto2; - } - }; - var StackBufferCursor3 = class { - constructor(stack, pos, index) { - this.stack = stack; - this.pos = pos; - this.index = index; - this.buffer = stack.buffer; - if (this.index == 0) - this.maybeNext(); - } - static create(stack, pos = stack.bufferBase + stack.buffer.length) { - return new StackBufferCursor3(stack, pos, pos - stack.bufferBase); - } - maybeNext() { - let next = this.stack.parent; - if (next != null) { - this.index = this.stack.bufferBase - next.bufferBase; - this.stack = next; - this.buffer = next.buffer; - } - } - get id() { - return this.buffer[this.index - 4]; - } - get start() { - return this.buffer[this.index - 3]; - } - get end() { - return this.buffer[this.index - 2]; - } - get size() { - return this.buffer[this.index - 1]; - } - next() { - this.index -= 4; - this.pos -= 4; - if (this.index == 0) - this.maybeNext(); - } - fork() { - return new StackBufferCursor3(this.stack, this.pos, this.index); - } - }; - var CachedToken3 = class { - constructor() { - this.start = -1; - this.value = -1; - this.end = -1; - this.extended = -1; - this.lookAhead = 0; - this.mask = 0; - this.context = 0; - } - }; - var nullToken3 = new CachedToken3(); - var InputStream3 = class { - constructor(input, ranges) { - this.input = input; - this.ranges = ranges; - this.chunk = ""; - this.chunkOff = 0; - this.chunk2 = ""; - this.chunk2Pos = 0; - this.next = -1; - this.token = nullToken3; - this.rangeIndex = 0; - this.pos = this.chunkPos = ranges[0].from; - this.range = ranges[0]; - this.end = ranges[ranges.length - 1].to; - this.readNext(); - } - resolveOffset(offset, assoc) { - let range = this.range, index = this.rangeIndex; - let pos = this.pos + offset; - while (pos < range.from) { - if (!index) - return null; - let next = this.ranges[--index]; - pos -= range.from - next.to; - range = next; - } - while (assoc < 0 ? pos > range.to : pos >= range.to) { - if (index == this.ranges.length - 1) - return null; - let next = this.ranges[++index]; - pos += next.from - range.to; - range = next; - } - return pos; - } - peek(offset) { - let idx = this.chunkOff + offset, pos, result; - if (idx >= 0 && idx < this.chunk.length) { - pos = this.pos + offset; - result = this.chunk.charCodeAt(idx); - } else { - let resolved = this.resolveOffset(offset, 1); - if (resolved == null) - return -1; - pos = resolved; - if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) { - result = this.chunk2.charCodeAt(pos - this.chunk2Pos); - } else { - let i = this.rangeIndex, range = this.range; - while (range.to <= pos) - range = this.ranges[++i]; - this.chunk2 = this.input.chunk(this.chunk2Pos = pos); - if (pos + this.chunk2.length > range.to) - this.chunk2 = this.chunk2.slice(0, range.to - pos); - result = this.chunk2.charCodeAt(0); - } - } - if (pos >= this.token.lookAhead) - this.token.lookAhead = pos + 1; - return result; - } - acceptToken(token, endOffset = 0) { - let end = endOffset ? this.resolveOffset(endOffset, -1) : this.pos; - if (end == null || end < this.token.start) - throw new RangeError("Token end out of bounds"); - this.token.value = token; - this.token.end = end; - } - getChunk() { - if (this.pos >= this.chunk2Pos && this.pos < this.chunk2Pos + this.chunk2.length) { - let { chunk, chunkPos } = this; - this.chunk = this.chunk2; - this.chunkPos = this.chunk2Pos; - this.chunk2 = chunk; - this.chunk2Pos = chunkPos; - this.chunkOff = this.pos - this.chunkPos; - } else { - this.chunk2 = this.chunk; - this.chunk2Pos = this.chunkPos; - let nextChunk = this.input.chunk(this.pos); - let end = this.pos + nextChunk.length; - this.chunk = end > this.range.to ? nextChunk.slice(0, this.range.to - this.pos) : nextChunk; - this.chunkPos = this.pos; - this.chunkOff = 0; - } - } - readNext() { - if (this.chunkOff >= this.chunk.length) { - this.getChunk(); - if (this.chunkOff == this.chunk.length) - return this.next = -1; - } - return this.next = this.chunk.charCodeAt(this.chunkOff); - } - advance(n = 1) { - this.chunkOff += n; - while (this.pos + n >= this.range.to) { - if (this.rangeIndex == this.ranges.length - 1) - return this.setDone(); - n -= this.range.to - this.pos; - this.range = this.ranges[++this.rangeIndex]; - this.pos = this.range.from; - } - this.pos += n; - if (this.pos >= this.token.lookAhead) - this.token.lookAhead = this.pos + 1; - return this.readNext(); - } - setDone() { - this.pos = this.chunkPos = this.end; - this.range = this.ranges[this.rangeIndex = this.ranges.length - 1]; - this.chunk = ""; - return this.next = -1; - } - reset(pos, token) { - if (token) { - this.token = token; - token.start = pos; - token.lookAhead = pos + 1; - token.value = token.extended = -1; - } else { - this.token = nullToken3; - } - if (this.pos != pos) { - this.pos = pos; - if (pos == this.end) { - this.setDone(); - return this; - } - while (pos < this.range.from) - this.range = this.ranges[--this.rangeIndex]; - while (pos >= this.range.to) - this.range = this.ranges[++this.rangeIndex]; - if (pos >= this.chunkPos && pos < this.chunkPos + this.chunk.length) { - this.chunkOff = pos - this.chunkPos; - } else { - this.chunk = ""; - this.chunkOff = 0; - } - this.readNext(); - } - return this; - } - read(from2, to) { - if (from2 >= this.chunkPos && to <= this.chunkPos + this.chunk.length) - return this.chunk.slice(from2 - this.chunkPos, to - this.chunkPos); - if (from2 >= this.chunk2Pos && to <= this.chunk2Pos + this.chunk2.length) - return this.chunk2.slice(from2 - this.chunk2Pos, to - this.chunk2Pos); - if (from2 >= this.range.from && to <= this.range.to) - return this.input.read(from2, to); - let result = ""; - for (let r of this.ranges) { - if (r.from >= to) - break; - if (r.to > from2) - result += this.input.read(Math.max(r.from, from2), Math.min(r.to, to)); - } - return result; - } - }; - var TokenGroup3 = class { - constructor(data, id3) { - this.data = data; - this.id = id3; - } - token(input, stack) { - readToken3(this.data, input, stack, this.id); - } - }; - TokenGroup3.prototype.contextual = TokenGroup3.prototype.fallback = TokenGroup3.prototype.extend = false; - function readToken3(data, input, stack, group) { - let state = 0, groupMask = 1 << group, { parser: parser7 } = stack.p, { dialect } = parser7; - scan: - for (; ; ) { - if ((groupMask & data[state]) == 0) - break; - let accEnd = data[state + 1]; - for (let i = state + 3; i < accEnd; i += 2) - if ((data[i + 1] & groupMask) > 0) { - let term = data[i]; - if (dialect.allows(term) && (input.token.value == -1 || input.token.value == term || parser7.overrides(term, input.token.value))) { - input.acceptToken(term); - break; - } - } - for (let next = input.next, low = 0, high = data[state + 2]; low < high; ) { - let mid = low + high >> 1; - let index = accEnd + mid + (mid << 1); - let from2 = data[index], to = data[index + 1]; - if (next < from2) - high = mid; - else if (next >= to) - low = mid + 1; - else { - state = data[index + 2]; - input.advance(); - continue scan; - } - } - break; - } - } - function decodeArray3(input, Type = Uint16Array) { - if (typeof input != "string") - return input; - let array2 = null; - for (let pos = 0, out = 0; pos < input.length; ) { - let value = 0; - for (; ; ) { - let next = input.charCodeAt(pos++), stop = false; - if (next == 126) { - value = 65535; - break; - } - if (next >= 92) - next--; - if (next >= 34) - next--; - let digit = next - 32; - if (digit >= 46) { - digit -= 46; - stop = true; - } - value += digit; - if (stop) - break; - value *= 46; - } - if (array2) - array2[out++] = value; - else - array2 = new Type(value); - } - return array2; - } - var verbose3 = typeof process != "undefined" && /\bparse\b/.test(process.env.LOG); - var stackIDs3 = null; - var Safety3; - (function(Safety4) { - Safety4[Safety4["Margin"] = 25] = "Margin"; - })(Safety3 || (Safety3 = {})); - function cutAt3(tree, pos, side) { - let cursor = tree.cursor(IterMode4.IncludeAnonymous); - cursor.moveTo(pos); - for (; ; ) { - if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos))) - for (; ; ) { - if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError) - return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25)) : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25)); - if (side < 0 ? cursor.prevSibling() : cursor.nextSibling()) - break; - if (!cursor.parent()) - return side < 0 ? 0 : tree.length; - } - } - } - var FragmentCursor4 = class { - constructor(fragments, nodeSet) { - this.fragments = fragments; - this.nodeSet = nodeSet; - this.i = 0; - this.fragment = null; - this.safeFrom = -1; - this.safeTo = -1; - this.trees = []; - this.start = []; - this.index = []; - this.nextFragment(); - } - nextFragment() { - let fr = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++]; - if (fr) { - this.safeFrom = fr.openStart ? cutAt3(fr.tree, fr.from + fr.offset, 1) - fr.offset : fr.from; - this.safeTo = fr.openEnd ? cutAt3(fr.tree, fr.to + fr.offset, -1) - fr.offset : fr.to; - while (this.trees.length) { - this.trees.pop(); - this.start.pop(); - this.index.pop(); - } - this.trees.push(fr.tree); - this.start.push(-fr.offset); - this.index.push(0); - this.nextStart = this.safeFrom; - } else { - this.nextStart = 1e9; - } - } - nodeAt(pos) { - if (pos < this.nextStart) - return null; - while (this.fragment && this.safeTo <= pos) - this.nextFragment(); - if (!this.fragment) - return null; - for (; ; ) { - let last = this.trees.length - 1; - if (last < 0) { - this.nextFragment(); - return null; - } - let top2 = this.trees[last], index = this.index[last]; - if (index == top2.children.length) { - this.trees.pop(); - this.start.pop(); - this.index.pop(); - continue; - } - let next = top2.children[index]; - let start = this.start[last] + top2.positions[index]; - if (start > pos) { - this.nextStart = start; - return null; - } - if (next instanceof Tree5) { - if (start == pos) { - if (start < this.safeFrom) - return null; - let end = start + next.length; - if (end <= this.safeTo) { - let lookAhead = next.prop(NodeProp5.lookAhead); - if (!lookAhead || end + lookAhead < this.fragment.to) - return next; - } - } - this.index[last]++; - if (start + next.length >= Math.max(this.safeFrom, pos)) { - this.trees.push(next); - this.start.push(start); - this.index.push(0); - } - } else { - this.index[last]++; - this.nextStart = start + next.length; - } - } - } - }; - var TokenCache3 = class { - constructor(parser7, stream) { - this.stream = stream; - this.tokens = []; - this.mainToken = null; - this.actions = []; - this.tokens = parser7.tokenizers.map((_) => new CachedToken3()); - } - getActions(stack) { - let actionIndex = 0; - let main = null; - let { parser: parser7 } = stack.p, { tokenizers } = parser7; - let mask = parser7.stateSlot(stack.state, 3); - let context = stack.curContext ? stack.curContext.hash : 0; - let lookAhead = 0; - for (let i = 0; i < tokenizers.length; i++) { - if ((1 << i & mask) == 0) - continue; - let tokenizer = tokenizers[i], token = this.tokens[i]; - if (main && !tokenizer.fallback) - continue; - if (tokenizer.contextual || token.start != stack.pos || token.mask != mask || token.context != context) { - this.updateCachedToken(token, tokenizer, stack); - token.mask = mask; - token.context = context; - } - if (token.lookAhead > token.end + 25) - lookAhead = Math.max(token.lookAhead, lookAhead); - if (token.value != 0) { - let startIndex = actionIndex; - if (token.extended > -1) - actionIndex = this.addActions(stack, token.extended, token.end, actionIndex); - actionIndex = this.addActions(stack, token.value, token.end, actionIndex); - if (!tokenizer.extend) { - main = token; - if (actionIndex > startIndex) - break; - } - } - } - while (this.actions.length > actionIndex) - this.actions.pop(); - if (lookAhead) - stack.setLookAhead(lookAhead); - if (!main && stack.pos == this.stream.end) { - main = new CachedToken3(); - main.value = stack.p.parser.eofTerm; - main.start = main.end = stack.pos; - actionIndex = this.addActions(stack, main.value, main.end, actionIndex); - } - this.mainToken = main; - return this.actions; - } - getMainToken(stack) { - if (this.mainToken) - return this.mainToken; - let main = new CachedToken3(), { pos, p } = stack; - main.start = pos; - main.end = Math.min(pos + 1, p.stream.end); - main.value = pos == p.stream.end ? p.parser.eofTerm : 0; - return main; - } - updateCachedToken(token, tokenizer, stack) { - tokenizer.token(this.stream.reset(stack.pos, token), stack); - if (token.value > -1) { - let { parser: parser7 } = stack.p; - for (let i = 0; i < parser7.specialized.length; i++) - if (parser7.specialized[i] == token.value) { - let result = parser7.specializers[i](this.stream.read(token.start, token.end), stack); - if (result >= 0 && stack.p.parser.dialect.allows(result >> 1)) { - if ((result & 1) == 0) - token.value = result >> 1; - else - token.extended = result >> 1; - break; - } - } - } else { - token.value = 0; - token.end = Math.min(stack.p.stream.end, stack.pos + 1); - } - } - putAction(action, token, end, index) { - for (let i = 0; i < index; i += 3) - if (this.actions[i] == action) - return index; - this.actions[index++] = action; - this.actions[index++] = token; - this.actions[index++] = end; - return index; - } - addActions(stack, token, end, index) { - let { state } = stack, { parser: parser7 } = stack.p, { data } = parser7; - for (let set = 0; set < 2; set++) { - for (let i = parser7.stateSlot(state, set ? 2 : 1); ; i += 3) { - if (data[i] == 65535) { - if (data[i + 1] == 1) { - i = pair3(data, i + 2); - } else { - if (index == 0 && data[i + 1] == 2) - index = this.putAction(pair3(data, i + 2), token, end, index); - break; - } - } - if (data[i] == token) - index = this.putAction(pair3(data, i + 1), token, end, index); - } - } - return index; - } - }; - var Rec3; - (function(Rec4) { - Rec4[Rec4["Distance"] = 5] = "Distance"; - Rec4[Rec4["MaxRemainingPerStep"] = 3] = "MaxRemainingPerStep"; - Rec4[Rec4["MinBufferLengthPrune"] = 500] = "MinBufferLengthPrune"; - Rec4[Rec4["ForceReduceLimit"] = 10] = "ForceReduceLimit"; - Rec4[Rec4["CutDepth"] = 15e3] = "CutDepth"; - Rec4[Rec4["CutTo"] = 9e3] = "CutTo"; - })(Rec3 || (Rec3 = {})); - var Parse3 = class { - constructor(parser7, input, fragments, ranges) { - this.parser = parser7; - this.input = input; - this.ranges = ranges; - this.recovering = 0; - this.nextStackID = 9812; - this.minStackPos = 0; - this.reused = []; - this.stoppedAt = null; - this.stream = new InputStream3(input, ranges); - this.tokens = new TokenCache3(parser7, this.stream); - this.topTerm = parser7.top[1]; - let { from: from2 } = ranges[0]; - this.stacks = [Stack3.start(this, parser7.top[0], from2)]; - this.fragments = fragments.length && this.stream.end - from2 > parser7.bufferLength * 4 ? new FragmentCursor4(fragments, parser7.nodeSet) : null; - } - get parsedPos() { - return this.minStackPos; - } - advance() { - let stacks = this.stacks, pos = this.minStackPos; - let newStacks = this.stacks = []; - let stopped, stoppedTokens; - for (let i = 0; i < stacks.length; i++) { - let stack = stacks[i]; - for (; ; ) { - this.tokens.mainToken = null; - if (stack.pos > pos) { - newStacks.push(stack); - } else if (this.advanceStack(stack, newStacks, stacks)) { - continue; - } else { - if (!stopped) { - stopped = []; - stoppedTokens = []; - } - stopped.push(stack); - let tok = this.tokens.getMainToken(stack); - stoppedTokens.push(tok.value, tok.end); - } - break; - } - } - if (!newStacks.length) { - let finished = stopped && findFinished3(stopped); - if (finished) - return this.stackToTree(finished); - if (this.parser.strict) { - if (verbose3 && stopped) - console.log("Stuck with token " + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : "none")); - throw new SyntaxError("No parse at " + pos); - } - if (!this.recovering) - this.recovering = 5; - } - if (this.recovering && stopped) { - let finished = this.stoppedAt != null && stopped[0].pos > this.stoppedAt ? stopped[0] : this.runRecovery(stopped, stoppedTokens, newStacks); - if (finished) - return this.stackToTree(finished.forceAll()); - } - if (this.recovering) { - let maxRemaining = this.recovering == 1 ? 1 : this.recovering * 3; - if (newStacks.length > maxRemaining) { - newStacks.sort((a, b) => b.score - a.score); - while (newStacks.length > maxRemaining) - newStacks.pop(); - } - if (newStacks.some((s) => s.reducePos > pos)) - this.recovering--; - } else if (newStacks.length > 1) { - outer: - for (let i = 0; i < newStacks.length - 1; i++) { - let stack = newStacks[i]; - for (let j = i + 1; j < newStacks.length; j++) { - let other = newStacks[j]; - if (stack.sameState(other) || stack.buffer.length > 500 && other.buffer.length > 500) { - if ((stack.score - other.score || stack.buffer.length - other.buffer.length) > 0) { - newStacks.splice(j--, 1); - } else { - newStacks.splice(i--, 1); - continue outer; - } - } - } - } - } - this.minStackPos = newStacks[0].pos; - for (let i = 1; i < newStacks.length; i++) - if (newStacks[i].pos < this.minStackPos) - this.minStackPos = newStacks[i].pos; - return null; - } - stopAt(pos) { - if (this.stoppedAt != null && this.stoppedAt < pos) - throw new RangeError("Can't move stoppedAt forward"); - this.stoppedAt = pos; - } - advanceStack(stack, stacks, split) { - let start = stack.pos, { parser: parser7 } = this; - let base2 = verbose3 ? this.stackID(stack) + " -> " : ""; - if (this.stoppedAt != null && start > this.stoppedAt) - return stack.forceReduce() ? stack : null; - if (this.fragments) { - let strictCx = stack.curContext && stack.curContext.tracker.strict, cxHash = strictCx ? stack.curContext.hash : 0; - for (let cached = this.fragments.nodeAt(start); cached; ) { - let match2 = this.parser.nodeSet.types[cached.type.id] == cached.type ? parser7.getGoto(stack.state, cached.type.id) : -1; - if (match2 > -1 && cached.length && (!strictCx || (cached.prop(NodeProp5.contextHash) || 0) == cxHash)) { - stack.useNode(cached, match2); - if (verbose3) - console.log(base2 + this.stackID(stack) + ` (via reuse of ${parser7.getName(cached.type.id)})`); - return true; - } - if (!(cached instanceof Tree5) || cached.children.length == 0 || cached.positions[0] > 0) - break; - let inner = cached.children[0]; - if (inner instanceof Tree5 && cached.positions[0] == 0) - cached = inner; - else - break; - } - } - let defaultReduce = parser7.stateSlot(stack.state, 4); - if (defaultReduce > 0) { - stack.reduce(defaultReduce); - if (verbose3) - console.log(base2 + this.stackID(stack) + ` (via always-reduce ${parser7.getName(defaultReduce & 65535)})`); - return true; - } - if (stack.stack.length >= 15e3) { - while (stack.stack.length > 9e3 && stack.forceReduce()) { - } - } - let actions = this.tokens.getActions(stack); - for (let i = 0; i < actions.length; ) { - let action = actions[i++], term = actions[i++], end = actions[i++]; - let last = i == actions.length || !split; - let localStack = last ? stack : stack.split(); - localStack.apply(action, term, end); - if (verbose3) - console.log(base2 + this.stackID(localStack) + ` (via ${(action & 65536) == 0 ? "shift" : `reduce of ${parser7.getName(action & 65535)}`} for ${parser7.getName(term)} @ ${start}${localStack == stack ? "" : ", split"})`); - if (last) - return true; - else if (localStack.pos > start) - stacks.push(localStack); - else - split.push(localStack); - } - return false; - } - advanceFully(stack, newStacks) { - let pos = stack.pos; - for (; ; ) { - if (!this.advanceStack(stack, null, null)) - return false; - if (stack.pos > pos) { - pushStackDedup3(stack, newStacks); - return true; - } - } - } - runRecovery(stacks, tokens, newStacks) { - let finished = null, restarted = false; - for (let i = 0; i < stacks.length; i++) { - let stack = stacks[i], token = tokens[i << 1], tokenEnd = tokens[(i << 1) + 1]; - let base2 = verbose3 ? this.stackID(stack) + " -> " : ""; - if (stack.deadEnd) { - if (restarted) - continue; - restarted = true; - stack.restart(); - if (verbose3) - console.log(base2 + this.stackID(stack) + " (restarted)"); - let done = this.advanceFully(stack, newStacks); - if (done) - continue; - } - let force = stack.split(), forceBase = base2; - for (let j = 0; force.forceReduce() && j < 10; j++) { - if (verbose3) - console.log(forceBase + this.stackID(force) + " (via force-reduce)"); - let done = this.advanceFully(force, newStacks); - if (done) - break; - if (verbose3) - forceBase = this.stackID(force) + " -> "; - } - for (let insert4 of stack.recoverByInsert(token)) { - if (verbose3) - console.log(base2 + this.stackID(insert4) + " (via recover-insert)"); - this.advanceFully(insert4, newStacks); - } - if (this.stream.end > stack.pos) { - if (tokenEnd == stack.pos) { - tokenEnd++; - token = 0; - } - stack.recoverByDelete(token, tokenEnd); - if (verbose3) - console.log(base2 + this.stackID(stack) + ` (via recover-delete ${this.parser.getName(token)})`); - pushStackDedup3(stack, newStacks); - } else if (!finished || finished.score < stack.score) { - finished = stack; - } - } - return finished; - } - stackToTree(stack) { - stack.close(); - return Tree5.build({ - buffer: StackBufferCursor3.create(stack), - nodeSet: this.parser.nodeSet, - topID: this.topTerm, - maxBufferLength: this.parser.bufferLength, - reused: this.reused, - start: this.ranges[0].from, - length: stack.pos - this.ranges[0].from, - minRepeatType: this.parser.minRepeatTerm - }); - } - stackID(stack) { - let id3 = (stackIDs3 || (stackIDs3 = /* @__PURE__ */ new WeakMap())).get(stack); - if (!id3) - stackIDs3.set(stack, id3 = String.fromCodePoint(this.nextStackID++)); - return id3 + stack; - } - }; - function pushStackDedup3(stack, newStacks) { - for (let i = 0; i < newStacks.length; i++) { - let other = newStacks[i]; - if (other.pos == stack.pos && other.sameState(stack)) { - if (newStacks[i].score < stack.score) - newStacks[i] = stack; - return; - } - } - newStacks.push(stack); - } - var Dialect3 = class { - constructor(source, flags, disabled) { - this.source = source; - this.flags = flags; - this.disabled = disabled; - } - allows(term) { - return !this.disabled || this.disabled[term] == 0; - } - }; - var LRParser3 = class extends Parser4 { - constructor(spec) { - super(); - this.wrappers = []; - if (spec.version != 14) - throw new RangeError(`Parser version (${spec.version}) doesn't match runtime version (${14})`); - let nodeNames = spec.nodeNames.split(" "); - this.minRepeatTerm = nodeNames.length; - for (let i = 0; i < spec.repeatNodeCount; i++) - nodeNames.push(""); - let topTerms = Object.keys(spec.topRules).map((r) => spec.topRules[r][1]); - let nodeProps = []; - for (let i = 0; i < nodeNames.length; i++) - nodeProps.push([]); - function setProp(nodeID, prop, value) { - nodeProps[nodeID].push([prop, prop.deserialize(String(value))]); - } - if (spec.nodeProps) - for (let propSpec of spec.nodeProps) { - let prop = propSpec[0]; - if (typeof prop == "string") - prop = NodeProp5[prop]; - for (let i = 1; i < propSpec.length; ) { - let next = propSpec[i++]; - if (next >= 0) { - setProp(next, prop, propSpec[i++]); - } else { - let value = propSpec[i + -next]; - for (let j = -next; j > 0; j--) - setProp(propSpec[i++], prop, value); - i++; - } - } - } - this.nodeSet = new NodeSet4(nodeNames.map((name3, i) => NodeType5.define({ - name: i >= this.minRepeatTerm ? void 0 : name3, - id: i, - props: nodeProps[i], - top: topTerms.indexOf(i) > -1, - error: i == 0, - skipped: spec.skippedNodes && spec.skippedNodes.indexOf(i) > -1 - }))); - if (spec.propSources) - this.nodeSet = this.nodeSet.extend(...spec.propSources); - this.strict = false; - this.bufferLength = DefaultBufferLength5; - let tokenArray = decodeArray3(spec.tokenData); - this.context = spec.context; - this.specialized = new Uint16Array(spec.specialized ? spec.specialized.length : 0); - this.specializers = []; - if (spec.specialized) - for (let i = 0; i < spec.specialized.length; i++) { - this.specialized[i] = spec.specialized[i].term; - this.specializers[i] = spec.specialized[i].get; - } - this.states = decodeArray3(spec.states, Uint32Array); - this.data = decodeArray3(spec.stateData); - this.goto = decodeArray3(spec.goto); - this.maxTerm = spec.maxTerm; - this.tokenizers = spec.tokenizers.map((value) => typeof value == "number" ? new TokenGroup3(tokenArray, value) : value); - this.topRules = spec.topRules; - this.dialects = spec.dialects || {}; - this.dynamicPrecedences = spec.dynamicPrecedences || null; - this.tokenPrecTable = spec.tokenPrec; - this.termNames = spec.termNames || null; - this.maxNode = this.nodeSet.types.length - 1; - this.dialect = this.parseDialect(); - this.top = this.topRules[Object.keys(this.topRules)[0]]; - } - createParse(input, fragments, ranges) { - let parse = new Parse3(this, input, fragments, ranges); - for (let w of this.wrappers) - parse = w(parse, input, fragments, ranges); - return parse; - } - getGoto(state, term, loose = false) { - let table = this.goto; - if (term >= table[0]) - return -1; - for (let pos = table[term + 1]; ; ) { - let groupTag = table[pos++], last = groupTag & 1; - let target = table[pos++]; - if (last && loose) - return target; - for (let end = pos + (groupTag >> 1); pos < end; pos++) - if (table[pos] == state) - return target; - if (last) - return -1; - } - } - hasAction(state, terminal) { - let data = this.data; - for (let set = 0; set < 2; set++) { - for (let i = this.stateSlot(state, set ? 2 : 1), next; ; i += 3) { - if ((next = data[i]) == 65535) { - if (data[i + 1] == 1) - next = data[i = pair3(data, i + 2)]; - else if (data[i + 1] == 2) - return pair3(data, i + 2); - else - break; - } - if (next == terminal || next == 0) - return pair3(data, i + 1); - } - } - return 0; - } - stateSlot(state, slot) { - return this.states[state * 6 + slot]; - } - stateFlag(state, flag) { - return (this.stateSlot(state, 0) & flag) > 0; - } - validAction(state, action) { - if (action == this.stateSlot(state, 4)) - return true; - for (let i = this.stateSlot(state, 1); ; i += 3) { - if (this.data[i] == 65535) { - if (this.data[i + 1] == 1) - i = pair3(this.data, i + 2); - else - return false; - } - if (action == pair3(this.data, i + 1)) - return true; - } - } - nextStates(state) { - let result = []; - for (let i = this.stateSlot(state, 1); ; i += 3) { - if (this.data[i] == 65535) { - if (this.data[i + 1] == 1) - i = pair3(this.data, i + 2); - else - break; - } - if ((this.data[i + 2] & 65536 >> 16) == 0) { - let value = this.data[i + 1]; - if (!result.some((v, i2) => i2 & 1 && v == value)) - result.push(this.data[i], value); - } - } - return result; - } - overrides(token, prev) { - let iPrev = findOffset3(this.data, this.tokenPrecTable, prev); - return iPrev < 0 || findOffset3(this.data, this.tokenPrecTable, token) < iPrev; - } - configure(config2) { - let copy = Object.assign(Object.create(LRParser3.prototype), this); - if (config2.props) - copy.nodeSet = this.nodeSet.extend(...config2.props); - if (config2.top) { - let info = this.topRules[config2.top]; - if (!info) - throw new RangeError(`Invalid top rule name ${config2.top}`); - copy.top = info; - } - if (config2.tokenizers) - copy.tokenizers = this.tokenizers.map((t3) => { - let found = config2.tokenizers.find((r) => r.from == t3); - return found ? found.to : t3; - }); - if (config2.contextTracker) - copy.context = config2.contextTracker; - if (config2.dialect) - copy.dialect = this.parseDialect(config2.dialect); - if (config2.strict != null) - copy.strict = config2.strict; - if (config2.wrap) - copy.wrappers = copy.wrappers.concat(config2.wrap); - if (config2.bufferLength != null) - copy.bufferLength = config2.bufferLength; - return copy; - } - hasWrappers() { - return this.wrappers.length > 0; - } - getName(term) { - return this.termNames ? this.termNames[term] : String(term <= this.maxNode && this.nodeSet.types[term].name || term); - } - get eofTerm() { - return this.maxNode + 1; - } - get topNode() { - return this.nodeSet.types[this.top[1]]; - } - dynamicPrecedence(term) { - let prec4 = this.dynamicPrecedences; - return prec4 == null ? 0 : prec4[term] || 0; - } - parseDialect(dialect) { - let values2 = Object.keys(this.dialects), flags = values2.map(() => false); - if (dialect) - for (let part of dialect.split(" ")) { - let id3 = values2.indexOf(part); - if (id3 >= 0) - flags[id3] = true; - } - let disabled = null; - for (let i = 0; i < values2.length; i++) - if (!flags[i]) { - for (let j = this.dialects[values2[i]], id3; (id3 = this.data[j++]) != 65535; ) - (disabled || (disabled = new Uint8Array(this.maxTerm + 1)))[id3] = 1; - } - return new Dialect3(dialect, flags, disabled); - } - static deserialize(spec) { - return new LRParser3(spec); - } - }; - function pair3(data, off) { - return data[off] | data[off + 1] << 16; - } - function findOffset3(data, start, term) { - for (let i = start, next; (next = data[i]) != 65535; i++) - if (next == term) - return i - start; - return -1; - } - function findFinished3(stacks) { - let best = null; - for (let stack of stacks) { - let stopped = stack.p.stoppedAt; - if ((stack.pos == stack.p.stream.end || stopped != null && stack.pos > stopped) && stack.p.parser.stateFlag(stack.state, 2) && (!best || best.score < stack.score)) - best = stack; - } - return best; - } - - // node_modules/@lezer/json/dist/index.es.js - var jsonHighlighting = styleTags2({ - String: tags2.string, - Number: tags2.number, - "True False": tags2.bool, - PropertyName: tags2.propertyName, - Null: tags2.null, - ",": tags2.separator, - "[ ]": tags2.squareBracket, - "{ }": tags2.brace - }); - var parser6 = LRParser3.deserialize({ - version: 14, - states: "$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j", - stateData: "#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O", - goto: "!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R", - nodeNames: "\u26A0 JsonText True False Null Number String } { Object Property PropertyName ] [ Array", - maxTerm: 25, - nodeProps: [ - ["openedBy", 7, "{", 12, "["], - ["closedBy", 8, "}", 13, "]"] - ], - propSources: [jsonHighlighting], - skippedNodes: [0], - repeatNodeCount: 2, - tokenData: "(p~RaXY!WYZ!W]^!Wpq!Wrs!]|}$i}!O$n!Q!R$w!R![&V![!]&h!}#O&m#P#Q&r#Y#Z&w#b#c'f#h#i'}#o#p(f#q#r(k~!]Oc~~!`Upq!]qr!]rs!rs#O!]#O#P!w#P~!]~!wOe~~!zXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#g~#jR!Q![#s!c!i#s#T#Z#s~#vR!Q![$P!c!i$P#T#Z$P~$SR!Q![$]!c!i$]#T#Z$]~$`R!Q![!]!c!i!]#T#Z!]~$nOh~~$qQ!Q!R$w!R![&V~$|RT~!O!P%V!g!h%k#X#Y%k~%YP!Q![%]~%bRT~!Q![%]!g!h%k#X#Y%k~%nR{|%w}!O%w!Q![%}~%zP!Q![%}~&SPT~!Q![%}~&[ST~!O!P%V!Q![&V!g!h%k#X#Y%k~&mOg~~&rO]~~&wO[~~&zP#T#U&}~'QP#`#a'T~'WP#g#h'Z~'^P#X#Y'a~'fOR~~'iP#i#j'l~'oP#`#a'r~'uP#`#a'x~'}OS~~(QP#f#g(T~(WP#i#j(Z~(^P#X#Y(a~(fOQ~~(kOW~~(pOV~", - tokenizers: [0], - topRules: { "JsonText": [0, 1] }, - tokenPrec: 0 - }); - - // node_modules/@codemirror/lang-json/node_modules/@lezer/common/dist/index.js - var DefaultBufferLength6 = 1024; - var nextPropID6 = 0; - var Range7 = class { - constructor(from2, to) { - this.from = from2; - this.to = to; - } - }; - var NodeProp6 = class { - constructor(config2 = {}) { - this.id = nextPropID6++; - this.perNode = !!config2.perNode; - this.deserialize = config2.deserialize || (() => { - throw new Error("This node type doesn't define a deserialize function"); - }); - } - add(match2) { - if (this.perNode) - throw new RangeError("Can't add per-node props to node types"); - if (typeof match2 != "function") - match2 = NodeType6.match(match2); - return (type) => { - let result = match2(type); - return result === void 0 ? null : [this, result]; - }; - } - }; - NodeProp6.closedBy = new NodeProp6({ deserialize: (str) => str.split(" ") }); - NodeProp6.openedBy = new NodeProp6({ deserialize: (str) => str.split(" ") }); - NodeProp6.group = new NodeProp6({ deserialize: (str) => str.split(" ") }); - NodeProp6.contextHash = new NodeProp6({ perNode: true }); - NodeProp6.lookAhead = new NodeProp6({ perNode: true }); - NodeProp6.mounted = new NodeProp6({ perNode: true }); - var noProps6 = /* @__PURE__ */ Object.create(null); - var NodeType6 = class { - constructor(name3, props, id3, flags = 0) { - this.name = name3; - this.props = props; - this.id = id3; - this.flags = flags; - } - static define(spec) { - let props = spec.props && spec.props.length ? /* @__PURE__ */ Object.create(null) : noProps6; - let flags = (spec.top ? 1 : 0) | (spec.skipped ? 2 : 0) | (spec.error ? 4 : 0) | (spec.name == null ? 8 : 0); - let type = new NodeType6(spec.name || "", props, spec.id, flags); - if (spec.props) - for (let src of spec.props) { - if (!Array.isArray(src)) - src = src(type); - if (src) { - if (src[0].perNode) - throw new RangeError("Can't store a per-node prop on a node type"); - props[src[0].id] = src[1]; - } - } - return type; - } - prop(prop) { - return this.props[prop.id]; - } - get isTop() { - return (this.flags & 1) > 0; - } - get isSkipped() { - return (this.flags & 2) > 0; - } - get isError() { - return (this.flags & 4) > 0; - } - get isAnonymous() { - return (this.flags & 8) > 0; - } - is(name3) { - if (typeof name3 == "string") { - if (this.name == name3) - return true; - let group = this.prop(NodeProp6.group); - return group ? group.indexOf(name3) > -1 : false; - } - return this.id == name3; - } - static match(map) { - let direct = /* @__PURE__ */ Object.create(null); - for (let prop in map) - for (let name3 of prop.split(" ")) - direct[name3] = map[prop]; - return (node) => { - for (let groups = node.prop(NodeProp6.group), i = -1; i < (groups ? groups.length : 0); i++) { - let found = direct[i < 0 ? node.name : groups[i]]; - if (found) - return found; - } - }; - } - }; - NodeType6.none = new NodeType6("", /* @__PURE__ */ Object.create(null), 0, 8); - var CachedNode6 = /* @__PURE__ */ new WeakMap(); - var CachedInnerNode6 = /* @__PURE__ */ new WeakMap(); - var IterMode5; - (function(IterMode6) { - IterMode6[IterMode6["ExcludeBuffers"] = 1] = "ExcludeBuffers"; - IterMode6[IterMode6["IncludeAnonymous"] = 2] = "IncludeAnonymous"; - IterMode6[IterMode6["IgnoreMounts"] = 4] = "IgnoreMounts"; - IterMode6[IterMode6["IgnoreOverlays"] = 8] = "IgnoreOverlays"; - })(IterMode5 || (IterMode5 = {})); - var Tree6 = class { - constructor(type, children, positions, length, props) { - this.type = type; - this.children = children; - this.positions = positions; - this.length = length; - this.props = null; - if (props && props.length) { - this.props = /* @__PURE__ */ Object.create(null); - for (let [prop, value] of props) - this.props[typeof prop == "number" ? prop : prop.id] = value; - } - } - toString() { - let mounted = this.prop(NodeProp6.mounted); - if (mounted && !mounted.overlay) - return mounted.tree.toString(); - let children = ""; - for (let ch of this.children) { - let str = ch.toString(); - if (str) { - if (children) - children += ","; - children += str; - } - } - return !this.type.name ? children : (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (children.length ? "(" + children + ")" : ""); - } - cursor(mode = 0) { - return new TreeCursor6(this.topNode, mode); - } - cursorAt(pos, side = 0, mode = 0) { - let scope = CachedNode6.get(this) || this.topNode; - let cursor = new TreeCursor6(scope); - cursor.moveTo(pos, side); - CachedNode6.set(this, cursor._tree); - return cursor; - } - get topNode() { - return new TreeNode6(this, 0, 0, null); - } - resolve(pos, side = 0) { - let node = resolveNode6(CachedNode6.get(this) || this.topNode, pos, side, false); - CachedNode6.set(this, node); - return node; - } - resolveInner(pos, side = 0) { - let node = resolveNode6(CachedInnerNode6.get(this) || this.topNode, pos, side, true); - CachedInnerNode6.set(this, node); - return node; - } - iterate(spec) { - let { enter, leave, from: from2 = 0, to = this.length } = spec; - for (let c = this.cursor((spec.mode || 0) | IterMode5.IncludeAnonymous); ; ) { - let entered = false; - if (c.from <= to && c.to >= from2 && (c.type.isAnonymous || enter(c) !== false)) { - if (c.firstChild()) - continue; - entered = true; - } - for (; ; ) { - if (entered && leave && !c.type.isAnonymous) - leave(c); - if (c.nextSibling()) - break; - if (!c.parent()) - return; - entered = true; - } - } - } - prop(prop) { - return !prop.perNode ? this.type.prop(prop) : this.props ? this.props[prop.id] : void 0; - } - get propValues() { - let result = []; - if (this.props) - for (let id3 in this.props) - result.push([+id3, this.props[id3]]); - return result; - } - balance(config2 = {}) { - return this.children.length <= 8 ? this : balanceRange6(NodeType6.none, this.children, this.positions, 0, this.children.length, 0, this.length, (children, positions, length) => new Tree6(this.type, children, positions, length, this.propValues), config2.makeTree || ((children, positions, length) => new Tree6(NodeType6.none, children, positions, length))); - } - static build(data) { - return buildTree6(data); - } - }; - Tree6.empty = new Tree6(NodeType6.none, [], [], 0); - var FlatBufferCursor6 = class { - constructor(buffer, index) { - this.buffer = buffer; - this.index = index; - } - get id() { - return this.buffer[this.index - 4]; - } - get start() { - return this.buffer[this.index - 3]; - } - get end() { - return this.buffer[this.index - 2]; - } - get size() { - return this.buffer[this.index - 1]; - } - get pos() { - return this.index; - } - next() { - this.index -= 4; - } - fork() { - return new FlatBufferCursor6(this.buffer, this.index); - } - }; - var TreeBuffer6 = class { - constructor(buffer, length, set) { - this.buffer = buffer; - this.length = length; - this.set = set; - } - get type() { - return NodeType6.none; - } - toString() { - let result = []; - for (let index = 0; index < this.buffer.length; ) { - result.push(this.childString(index)); - index = this.buffer[index + 3]; - } - return result.join(","); - } - childString(index) { - let id3 = this.buffer[index], endIndex = this.buffer[index + 3]; - let type = this.set.types[id3], result = type.name; - if (/\W/.test(result) && !type.isError) - result = JSON.stringify(result); - index += 4; - if (endIndex == index) - return result; - let children = []; - while (index < endIndex) { - children.push(this.childString(index)); - index = this.buffer[index + 3]; - } - return result + "(" + children.join(",") + ")"; - } - findChild(startIndex, endIndex, dir, pos, side) { - let { buffer } = this, pick = -1; - for (let i = startIndex; i != endIndex; i = buffer[i + 3]) { - if (checkSide6(side, pos, buffer[i + 1], buffer[i + 2])) { - pick = i; - if (dir > 0) - break; - } - } - return pick; - } - slice(startI, endI, from2, to) { - let b = this.buffer; - let copy = new Uint16Array(endI - startI); - for (let i = startI, j = 0; i < endI; ) { - copy[j++] = b[i++]; - copy[j++] = b[i++] - from2; - copy[j++] = b[i++] - from2; - copy[j++] = b[i++] - startI; - } - return new TreeBuffer6(copy, to - from2, this.set); - } - }; - function checkSide6(side, pos, from2, to) { - switch (side) { - case -2: - return from2 < pos; - case -1: - return to >= pos && from2 < pos; - case 0: - return from2 < pos && to > pos; - case 1: - return from2 <= pos && to > pos; - case 2: - return to > pos; - case 4: - return true; - } - } - function enterUnfinishedNodesBefore6(node, pos) { - let scan = node.childBefore(pos); - while (scan) { - let last = scan.lastChild; - if (!last || last.to != scan.to) - break; - if (last.type.isError && last.from == last.to) { - node = scan; - scan = last.prevSibling; - } else { - scan = last; - } - } - return node; - } - function resolveNode6(node, pos, side, overlays) { - var _a4; - while (node.from == node.to || (side < 1 ? node.from >= pos : node.from > pos) || (side > -1 ? node.to <= pos : node.to < pos)) { - let parent = !overlays && node instanceof TreeNode6 && node.index < 0 ? null : node.parent; - if (!parent) - return node; - node = parent; - } - let mode = overlays ? 0 : IterMode5.IgnoreOverlays; - if (overlays) - for (let scan = node, parent = scan.parent; parent; scan = parent, parent = scan.parent) { - if (scan instanceof TreeNode6 && scan.index < 0 && ((_a4 = parent.enter(pos, side, mode)) === null || _a4 === void 0 ? void 0 : _a4.from) != scan.from) - node = parent; - } - for (; ; ) { - let inner = node.enter(pos, side, mode); - if (!inner) - return node; - node = inner; - } - } - var TreeNode6 = class { - constructor(_tree, from2, index, _parent) { - this._tree = _tree; - this.from = from2; - this.index = index; - this._parent = _parent; - } - get type() { - return this._tree.type; - } - get name() { - return this._tree.type.name; - } - get to() { - return this.from + this._tree.length; - } - nextChild(i, dir, pos, side, mode = 0) { - for (let parent = this; ; ) { - for (let { children, positions } = parent._tree, e = dir > 0 ? children.length : -1; i != e; i += dir) { - let next = children[i], start = positions[i] + parent.from; - if (!checkSide6(side, pos, start, start + next.length)) - continue; - if (next instanceof TreeBuffer6) { - if (mode & IterMode5.ExcludeBuffers) - continue; - let index = next.findChild(0, next.buffer.length, dir, pos - start, side); - if (index > -1) - return new BufferNode6(new BufferContext6(parent, next, i, start), null, index); - } else if (mode & IterMode5.IncludeAnonymous || (!next.type.isAnonymous || hasChild6(next))) { - let mounted; - if (!(mode & IterMode5.IgnoreMounts) && next.props && (mounted = next.prop(NodeProp6.mounted)) && !mounted.overlay) - return new TreeNode6(mounted.tree, start, i, parent); - let inner = new TreeNode6(next, start, i, parent); - return mode & IterMode5.IncludeAnonymous || !inner.type.isAnonymous ? inner : inner.nextChild(dir < 0 ? next.children.length - 1 : 0, dir, pos, side); - } - } - if (mode & IterMode5.IncludeAnonymous || !parent.type.isAnonymous) - return null; - if (parent.index >= 0) - i = parent.index + dir; - else - i = dir < 0 ? -1 : parent._parent._tree.children.length; - parent = parent._parent; - if (!parent) - return null; - } - } - get firstChild() { - return this.nextChild(0, 1, 0, 4); - } - get lastChild() { - return this.nextChild(this._tree.children.length - 1, -1, 0, 4); - } - childAfter(pos) { - return this.nextChild(0, 1, pos, 2); - } - childBefore(pos) { - return this.nextChild(this._tree.children.length - 1, -1, pos, -2); - } - enter(pos, side, mode = 0) { - let mounted; - if (!(mode & IterMode5.IgnoreOverlays) && (mounted = this._tree.prop(NodeProp6.mounted)) && mounted.overlay) { - let rPos = pos - this.from; - for (let { from: from2, to } of mounted.overlay) { - if ((side > 0 ? from2 <= rPos : from2 < rPos) && (side < 0 ? to >= rPos : to > rPos)) - return new TreeNode6(mounted.tree, mounted.overlay[0].from + this.from, -1, this); - } - } - return this.nextChild(0, 1, pos, side, mode); - } - nextSignificantParent() { - let val = this; - while (val.type.isAnonymous && val._parent) - val = val._parent; - return val; - } - get parent() { - return this._parent ? this._parent.nextSignificantParent() : null; - } - get nextSibling() { - return this._parent && this.index >= 0 ? this._parent.nextChild(this.index + 1, 1, 0, 4) : null; - } - get prevSibling() { - return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4) : null; - } - cursor(mode = 0) { - return new TreeCursor6(this, mode); - } - get tree() { - return this._tree; - } - toTree() { - return this._tree; - } - resolve(pos, side = 0) { - return resolveNode6(this, pos, side, false); - } - resolveInner(pos, side = 0) { - return resolveNode6(this, pos, side, true); - } - enterUnfinishedNodesBefore(pos) { - return enterUnfinishedNodesBefore6(this, pos); - } - getChild(type, before = null, after = null) { - let r = getChildren6(this, type, before, after); - return r.length ? r[0] : null; - } - getChildren(type, before = null, after = null) { - return getChildren6(this, type, before, after); - } - toString() { - return this._tree.toString(); - } - get node() { - return this; - } - matchContext(context) { - return matchNodeContext5(this, context); - } - }; - function getChildren6(node, type, before, after) { - let cur2 = node.cursor(), result = []; - if (!cur2.firstChild()) - return result; - if (before != null) { - while (!cur2.type.is(before)) - if (!cur2.nextSibling()) - return result; - } - for (; ; ) { - if (after != null && cur2.type.is(after)) - return result; - if (cur2.type.is(type)) - result.push(cur2.node); - if (!cur2.nextSibling()) - return after == null ? result : []; - } - } - function matchNodeContext5(node, context, i = context.length - 1) { - for (let p = node.parent; i >= 0; p = p.parent) { - if (!p) - return false; - if (!p.type.isAnonymous) { - if (context[i] && context[i] != p.name) - return false; - i--; - } - } - return true; - } - var BufferContext6 = class { - constructor(parent, buffer, index, start) { - this.parent = parent; - this.buffer = buffer; - this.index = index; - this.start = start; - } - }; - var BufferNode6 = class { - constructor(context, _parent, index) { - this.context = context; - this._parent = _parent; - this.index = index; - this.type = context.buffer.set.types[context.buffer.buffer[index]]; - } - get name() { - return this.type.name; - } - get from() { - return this.context.start + this.context.buffer.buffer[this.index + 1]; - } - get to() { - return this.context.start + this.context.buffer.buffer[this.index + 2]; - } - child(dir, pos, side) { - let { buffer } = this.context; - let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.context.start, side); - return index < 0 ? null : new BufferNode6(this.context, this, index); - } - get firstChild() { - return this.child(1, 0, 4); - } - get lastChild() { - return this.child(-1, 0, 4); - } - childAfter(pos) { - return this.child(1, pos, 2); - } - childBefore(pos) { - return this.child(-1, pos, -2); - } - enter(pos, side, mode = 0) { - if (mode & IterMode5.ExcludeBuffers) - return null; - let { buffer } = this.context; - let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], side > 0 ? 1 : -1, pos - this.context.start, side); - return index < 0 ? null : new BufferNode6(this.context, this, index); - } - get parent() { - return this._parent || this.context.parent.nextSignificantParent(); - } - externalSibling(dir) { - return this._parent ? null : this.context.parent.nextChild(this.context.index + dir, dir, 0, 4); - } - get nextSibling() { - let { buffer } = this.context; - let after = buffer.buffer[this.index + 3]; - if (after < (this._parent ? buffer.buffer[this._parent.index + 3] : buffer.buffer.length)) - return new BufferNode6(this.context, this._parent, after); - return this.externalSibling(1); - } - get prevSibling() { - let { buffer } = this.context; - let parentStart = this._parent ? this._parent.index + 4 : 0; - if (this.index == parentStart) - return this.externalSibling(-1); - return new BufferNode6(this.context, this._parent, buffer.findChild(parentStart, this.index, -1, 0, 4)); - } - cursor(mode = 0) { - return new TreeCursor6(this, mode); - } - get tree() { - return null; - } - toTree() { - let children = [], positions = []; - let { buffer } = this.context; - let startI = this.index + 4, endI = buffer.buffer[this.index + 3]; - if (endI > startI) { - let from2 = buffer.buffer[this.index + 1], to = buffer.buffer[this.index + 2]; - children.push(buffer.slice(startI, endI, from2, to)); - positions.push(0); - } - return new Tree6(this.type, children, positions, this.to - this.from); - } - resolve(pos, side = 0) { - return resolveNode6(this, pos, side, false); - } - resolveInner(pos, side = 0) { - return resolveNode6(this, pos, side, true); - } - enterUnfinishedNodesBefore(pos) { - return enterUnfinishedNodesBefore6(this, pos); - } - toString() { - return this.context.buffer.childString(this.index); - } - getChild(type, before = null, after = null) { - let r = getChildren6(this, type, before, after); - return r.length ? r[0] : null; - } - getChildren(type, before = null, after = null) { - return getChildren6(this, type, before, after); - } - get node() { - return this; - } - matchContext(context) { - return matchNodeContext5(this, context); - } - }; - var TreeCursor6 = class { - constructor(node, mode = 0) { - this.mode = mode; - this.buffer = null; - this.stack = []; - this.index = 0; - this.bufferNode = null; - if (node instanceof TreeNode6) { - this.yieldNode(node); - } else { - this._tree = node.context.parent; - this.buffer = node.context; - for (let n = node._parent; n; n = n._parent) - this.stack.unshift(n.index); - this.bufferNode = node; - this.yieldBuf(node.index); - } - } - get name() { - return this.type.name; - } - yieldNode(node) { - if (!node) - return false; - this._tree = node; - this.type = node.type; - this.from = node.from; - this.to = node.to; - return true; - } - yieldBuf(index, type) { - this.index = index; - let { start, buffer } = this.buffer; - this.type = type || buffer.set.types[buffer.buffer[index]]; - this.from = start + buffer.buffer[index + 1]; - this.to = start + buffer.buffer[index + 2]; - return true; - } - yield(node) { - if (!node) - return false; - if (node instanceof TreeNode6) { - this.buffer = null; - return this.yieldNode(node); - } - this.buffer = node.context; - return this.yieldBuf(node.index, node.type); - } - toString() { - return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString(); - } - enterChild(dir, pos, side) { - if (!this.buffer) - return this.yield(this._tree.nextChild(dir < 0 ? this._tree._tree.children.length - 1 : 0, dir, pos, side, this.mode)); - let { buffer } = this.buffer; - let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.buffer.start, side); - if (index < 0) - return false; - this.stack.push(this.index); - return this.yieldBuf(index); - } - firstChild() { - return this.enterChild(1, 0, 4); - } - lastChild() { - return this.enterChild(-1, 0, 4); - } - childAfter(pos) { - return this.enterChild(1, pos, 2); - } - childBefore(pos) { - return this.enterChild(-1, pos, -2); - } - enter(pos, side, mode = this.mode) { - if (!this.buffer) - return this.yield(this._tree.enter(pos, side, mode)); - return mode & IterMode5.ExcludeBuffers ? false : this.enterChild(1, pos, side); - } - parent() { - if (!this.buffer) - return this.yieldNode(this.mode & IterMode5.IncludeAnonymous ? this._tree._parent : this._tree.parent); - if (this.stack.length) - return this.yieldBuf(this.stack.pop()); - let parent = this.mode & IterMode5.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent(); - this.buffer = null; - return this.yieldNode(parent); - } - sibling(dir) { - if (!this.buffer) - return !this._tree._parent ? false : this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + dir, dir, 0, 4, this.mode)); - let { buffer } = this.buffer, d = this.stack.length - 1; - if (dir < 0) { - let parentStart = d < 0 ? 0 : this.stack[d] + 4; - if (this.index != parentStart) - return this.yieldBuf(buffer.findChild(parentStart, this.index, -1, 0, 4)); - } else { - let after = buffer.buffer[this.index + 3]; - if (after < (d < 0 ? buffer.buffer.length : buffer.buffer[this.stack[d] + 3])) - return this.yieldBuf(after); - } - return d < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + dir, dir, 0, 4, this.mode)) : false; - } - nextSibling() { - return this.sibling(1); - } - prevSibling() { - return this.sibling(-1); - } - atLastNode(dir) { - let index, parent, { buffer } = this; - if (buffer) { - if (dir > 0) { - if (this.index < buffer.buffer.buffer.length) - return false; - } else { - for (let i = 0; i < this.index; i++) - if (buffer.buffer.buffer[i + 3] < this.index) - return false; - } - ({ index, parent } = buffer); - } else { - ({ index, _parent: parent } = this._tree); - } - for (; parent; { index, _parent: parent } = parent) { - if (index > -1) - for (let i = index + dir, e = dir < 0 ? -1 : parent._tree.children.length; i != e; i += dir) { - let child = parent._tree.children[i]; - if (this.mode & IterMode5.IncludeAnonymous || child instanceof TreeBuffer6 || !child.type.isAnonymous || hasChild6(child)) - return false; - } - } - return true; - } - move(dir, enter) { - if (enter && this.enterChild(dir, 0, 4)) - return true; - for (; ; ) { - if (this.sibling(dir)) - return true; - if (this.atLastNode(dir) || !this.parent()) - return false; - } - } - next(enter = true) { - return this.move(1, enter); - } - prev(enter = true) { - return this.move(-1, enter); - } - moveTo(pos, side = 0) { - while (this.from == this.to || (side < 1 ? this.from >= pos : this.from > pos) || (side > -1 ? this.to <= pos : this.to < pos)) - if (!this.parent()) - break; - while (this.enterChild(1, pos, side)) { - } - return this; - } - get node() { - if (!this.buffer) - return this._tree; - let cache = this.bufferNode, result = null, depth = 0; - if (cache && cache.context == this.buffer) { - scan: - for (let index = this.index, d = this.stack.length; d >= 0; ) { - for (let c = cache; c; c = c._parent) - if (c.index == index) { - if (index == this.index) - return c; - result = c; - depth = d + 1; - break scan; - } - index = this.stack[--d]; - } - } - for (let i = depth; i < this.stack.length; i++) - result = new BufferNode6(this.buffer, result, this.stack[i]); - return this.bufferNode = new BufferNode6(this.buffer, result, this.index); - } - get tree() { - return this.buffer ? null : this._tree._tree; - } - iterate(enter, leave) { - for (let depth = 0; ; ) { - let mustLeave = false; - if (this.type.isAnonymous || enter(this) !== false) { - if (this.firstChild()) { - depth++; - continue; - } - if (!this.type.isAnonymous) - mustLeave = true; - } - for (; ; ) { - if (mustLeave && leave) - leave(this); - mustLeave = this.type.isAnonymous; - if (this.nextSibling()) - break; - if (!depth) - return; - this.parent(); - depth--; - mustLeave = true; - } - } - } - matchContext(context) { - if (!this.buffer) - return matchNodeContext5(this.node, context); - let { buffer } = this.buffer, { types: types4 } = buffer.set; - for (let i = context.length - 1, d = this.stack.length - 1; i >= 0; d--) { - if (d < 0) - return matchNodeContext5(this.node, context, i); - let type = types4[buffer.buffer[this.stack[d]]]; - if (!type.isAnonymous) { - if (context[i] && context[i] != type.name) - return false; - i--; - } - } - return true; - } - }; - function hasChild6(tree) { - return tree.children.some((ch) => ch instanceof TreeBuffer6 || !ch.type.isAnonymous || hasChild6(ch)); - } - function buildTree6(data) { - var _a4; - let { buffer, nodeSet, maxBufferLength = DefaultBufferLength6, reused = [], minRepeatType = nodeSet.types.length } = data; - let cursor = Array.isArray(buffer) ? new FlatBufferCursor6(buffer, buffer.length) : buffer; - let types4 = nodeSet.types; - let contextHash = 0, lookAhead = 0; - function takeNode(parentStart, minPos, children2, positions2, inRepeat) { - let { id: id3, start, end, size } = cursor; - let lookAheadAtStart = lookAhead; - while (size < 0) { - cursor.next(); - if (size == -1) { - let node2 = reused[id3]; - children2.push(node2); - positions2.push(start - parentStart); - return; - } else if (size == -3) { - contextHash = id3; - return; - } else if (size == -4) { - lookAhead = id3; - return; - } else { - throw new RangeError(`Unrecognized record size: ${size}`); - } - } - let type = types4[id3], node, buffer2; - let startPos = start - parentStart; - if (end - start <= maxBufferLength && (buffer2 = findBufferSize(cursor.pos - minPos, inRepeat))) { - let data2 = new Uint16Array(buffer2.size - buffer2.skip); - let endPos = cursor.pos - buffer2.size, index = data2.length; - while (cursor.pos > endPos) - index = copyToBuffer(buffer2.start, data2, index); - node = new TreeBuffer6(data2, end - buffer2.start, nodeSet); - startPos = buffer2.start - parentStart; - } else { - let endPos = cursor.pos - size; - cursor.next(); - let localChildren = [], localPositions = []; - let localInRepeat = id3 >= minRepeatType ? id3 : -1; - let lastGroup = 0, lastEnd = end; - while (cursor.pos > endPos) { - if (localInRepeat >= 0 && cursor.id == localInRepeat && cursor.size >= 0) { - if (cursor.end <= lastEnd - maxBufferLength) { - makeRepeatLeaf(localChildren, localPositions, start, lastGroup, cursor.end, lastEnd, localInRepeat, lookAheadAtStart); - lastGroup = localChildren.length; - lastEnd = cursor.end; - } - cursor.next(); - } else { - takeNode(start, endPos, localChildren, localPositions, localInRepeat); - } - } - if (localInRepeat >= 0 && lastGroup > 0 && lastGroup < localChildren.length) - makeRepeatLeaf(localChildren, localPositions, start, lastGroup, start, lastEnd, localInRepeat, lookAheadAtStart); - localChildren.reverse(); - localPositions.reverse(); - if (localInRepeat > -1 && lastGroup > 0) { - let make = makeBalanced(type); - node = balanceRange6(type, localChildren, localPositions, 0, localChildren.length, 0, end - start, make, make); - } else { - node = makeTree(type, localChildren, localPositions, end - start, lookAheadAtStart - end); - } - } - children2.push(node); - positions2.push(startPos); - } - function makeBalanced(type) { - return (children2, positions2, length2) => { - let lookAhead2 = 0, lastI = children2.length - 1, last, lookAheadProp; - if (lastI >= 0 && (last = children2[lastI]) instanceof Tree6) { - if (!lastI && last.type == type && last.length == length2) - return last; - if (lookAheadProp = last.prop(NodeProp6.lookAhead)) - lookAhead2 = positions2[lastI] + last.length + lookAheadProp; - } - return makeTree(type, children2, positions2, length2, lookAhead2); - }; - } - function makeRepeatLeaf(children2, positions2, base2, i, from2, to, type, lookAhead2) { - let localChildren = [], localPositions = []; - while (children2.length > i) { - localChildren.push(children2.pop()); - localPositions.push(positions2.pop() + base2 - from2); - } - children2.push(makeTree(nodeSet.types[type], localChildren, localPositions, to - from2, lookAhead2 - to)); - positions2.push(from2 - base2); - } - function makeTree(type, children2, positions2, length2, lookAhead2 = 0, props) { - if (contextHash) { - let pair4 = [NodeProp6.contextHash, contextHash]; - props = props ? [pair4].concat(props) : [pair4]; - } - if (lookAhead2 > 25) { - let pair4 = [NodeProp6.lookAhead, lookAhead2]; - props = props ? [pair4].concat(props) : [pair4]; - } - return new Tree6(type, children2, positions2, length2, props); - } - function findBufferSize(maxSize, inRepeat) { - let fork = cursor.fork(); - let size = 0, start = 0, skip = 0, minStart = fork.end - maxBufferLength; - let result = { size: 0, start: 0, skip: 0 }; - scan: - for (let minPos = fork.pos - maxSize; fork.pos > minPos; ) { - let nodeSize7 = fork.size; - if (fork.id == inRepeat && nodeSize7 >= 0) { - result.size = size; - result.start = start; - result.skip = skip; - skip += 4; - size += 4; - fork.next(); - continue; - } - let startPos = fork.pos - nodeSize7; - if (nodeSize7 < 0 || startPos < minPos || fork.start < minStart) - break; - let localSkipped = fork.id >= minRepeatType ? 4 : 0; - let nodeStart2 = fork.start; - fork.next(); - while (fork.pos > startPos) { - if (fork.size < 0) { - if (fork.size == -3) - localSkipped += 4; - else - break scan; - } else if (fork.id >= minRepeatType) { - localSkipped += 4; - } - fork.next(); - } - start = nodeStart2; - size += nodeSize7; - skip += localSkipped; - } - if (inRepeat < 0 || size == maxSize) { - result.size = size; - result.start = start; - result.skip = skip; - } - return result.size > 4 ? result : void 0; - } - function copyToBuffer(bufferStart, buffer2, index) { - let { id: id3, start, end, size } = cursor; - cursor.next(); - if (size >= 0 && id3 < minRepeatType) { - let startIndex = index; - if (size > 4) { - let endPos = cursor.pos - (size - 4); - while (cursor.pos > endPos) - index = copyToBuffer(bufferStart, buffer2, index); - } - buffer2[--index] = startIndex; - buffer2[--index] = end - bufferStart; - buffer2[--index] = start - bufferStart; - buffer2[--index] = id3; - } else if (size == -3) { - contextHash = id3; - } else if (size == -4) { - lookAhead = id3; - } - return index; - } - let children = [], positions = []; - while (cursor.pos > 0) - takeNode(data.start || 0, data.bufferStart || 0, children, positions, -1); - let length = (_a4 = data.length) !== null && _a4 !== void 0 ? _a4 : children.length ? positions[0] + children[0].length : 0; - return new Tree6(types4[data.topID], children.reverse(), positions.reverse(), length); - } - var nodeSizeCache6 = /* @__PURE__ */ new WeakMap(); - function nodeSize6(balanceType, node) { - if (!balanceType.isAnonymous || node instanceof TreeBuffer6 || node.type != balanceType) - return 1; - let size = nodeSizeCache6.get(node); - if (size == null) { - size = 1; - for (let child of node.children) { - if (child.type != balanceType || !(child instanceof Tree6)) { - size = 1; - break; - } - size += nodeSize6(balanceType, child); - } - nodeSizeCache6.set(node, size); - } - return size; - } - function balanceRange6(balanceType, children, positions, from2, to, start, length, mkTop, mkTree) { - let total = 0; - for (let i = from2; i < to; i++) - total += nodeSize6(balanceType, children[i]); - let maxChild = Math.ceil(total * 1.5 / 8); - let localChildren = [], localPositions = []; - function divide(children2, positions2, from3, to2, offset) { - for (let i = from3; i < to2; ) { - let groupFrom = i, groupStart = positions2[i], groupSize = nodeSize6(balanceType, children2[i]); - i++; - for (; i < to2; i++) { - let nextSize = nodeSize6(balanceType, children2[i]); - if (groupSize + nextSize >= maxChild) - break; - groupSize += nextSize; - } - if (i == groupFrom + 1) { - if (groupSize > maxChild) { - let only = children2[groupFrom]; - divide(only.children, only.positions, 0, only.children.length, positions2[groupFrom] + offset); - continue; - } - localChildren.push(children2[groupFrom]); - } else { - let length2 = positions2[i - 1] + children2[i - 1].length - groupStart; - localChildren.push(balanceRange6(balanceType, children2, positions2, groupFrom, i, groupStart, length2, null, mkTree)); - } - localPositions.push(groupStart + offset - start); - } - } - divide(children, positions, from2, to, 0); - return (mkTop || mkTree)(localChildren, localPositions, length); - } - var TreeFragment3 = class { - constructor(from2, to, tree, offset, openStart = false, openEnd = false) { - this.from = from2; - this.to = to; - this.tree = tree; - this.offset = offset; - this.open = (openStart ? 1 : 0) | (openEnd ? 2 : 0); - } - get openStart() { - return (this.open & 1) > 0; - } - get openEnd() { - return (this.open & 2) > 0; - } - static addTree(tree, fragments = [], partial = false) { - let result = [new TreeFragment3(0, tree.length, tree, 0, false, partial)]; - for (let f of fragments) - if (f.to > tree.length) - result.push(f); - return result; - } - static applyChanges(fragments, changes, minGap = 128) { - if (!changes.length) - return fragments; - let result = []; - let fI = 1, nextF = fragments.length ? fragments[0] : null; - for (let cI = 0, pos = 0, off = 0; ; cI++) { - let nextC = cI < changes.length ? changes[cI] : null; - let nextPos = nextC ? nextC.fromA : 1e9; - if (nextPos - pos >= minGap) - while (nextF && nextF.from < nextPos) { - let cut = nextF; - if (pos >= cut.from || nextPos <= cut.to || off) { - let fFrom = Math.max(cut.from, pos) - off, fTo = Math.min(cut.to, nextPos) - off; - cut = fFrom >= fTo ? null : new TreeFragment3(fFrom, fTo, cut.tree, cut.offset + off, cI > 0, !!nextC); - } - if (cut) - result.push(cut); - if (nextF.to > nextPos) - break; - nextF = fI < fragments.length ? fragments[fI++] : null; - } - if (!nextC) - break; - pos = nextC.toA; - off = nextC.toA - nextC.toB; - } - return result; - } - }; - var Parser5 = class { - startParse(input, fragments, ranges) { - if (typeof input == "string") - input = new StringInput5(input); - ranges = !ranges ? [new Range7(0, input.length)] : ranges.length ? ranges.map((r) => new Range7(r.from, r.to)) : [new Range7(0, 0)]; - return this.createParse(input, fragments || [], ranges); - } - parse(input, fragments, ranges) { - let parse = this.startParse(input, fragments, ranges); - for (; ; ) { - let done = parse.advance(); - if (done) - return done; - } - } - }; - var StringInput5 = class { - constructor(string3) { - this.string = string3; - } - get length() { - return this.string.length; - } - chunk(from2) { - return this.string.slice(from2); - } - get lineChunks() { - return false; - } - read(from2, to) { - return this.string.slice(from2, to); - } - }; - var stoppedInner6 = new NodeProp6({ perNode: true }); - - // node_modules/@codemirror/lang-json/node_modules/@codemirror/state/dist/index.js - var Text3 = class { - constructor() { - } - lineAt(pos) { - if (pos < 0 || pos > this.length) - throw new RangeError(`Invalid position ${pos} in document of length ${this.length}`); - return this.lineInner(pos, false, 1, 0); - } - line(n) { - if (n < 1 || n > this.lines) - throw new RangeError(`Invalid line number ${n} in ${this.lines}-line document`); - return this.lineInner(n, true, 1, 0); - } - replace(from2, to, text) { - let parts = []; - this.decompose(0, from2, parts, 2); - if (text.length) - text.decompose(0, text.length, parts, 1 | 2); - this.decompose(to, this.length, parts, 1); - return TextNode3.from(parts, this.length - (to - from2) + text.length); - } - append(other) { - return this.replace(this.length, this.length, other); - } - slice(from2, to = this.length) { - let parts = []; - this.decompose(from2, to, parts, 0); - return TextNode3.from(parts, to - from2); - } - eq(other) { - if (other == this) - return true; - if (other.length != this.length || other.lines != this.lines) - return false; - let start = this.scanIdentical(other, 1), end = this.length - this.scanIdentical(other, -1); - let a = new RawTextCursor3(this), b = new RawTextCursor3(other); - for (let skip = start, pos = start; ; ) { - a.next(skip); - b.next(skip); - skip = 0; - if (a.lineBreak != b.lineBreak || a.done != b.done || a.value != b.value) - return false; - pos += a.value.length; - if (a.done || pos >= end) - return true; - } - } - iter(dir = 1) { - return new RawTextCursor3(this, dir); - } - iterRange(from2, to = this.length) { - return new PartialTextCursor3(this, from2, to); - } - iterLines(from2, to) { - let inner; - if (from2 == null) { - inner = this.iter(); - } else { - if (to == null) - to = this.lines + 1; - let start = this.line(from2).from; - inner = this.iterRange(start, Math.max(start, to == this.lines + 1 ? this.length : to <= 1 ? 0 : this.line(to - 1).to)); - } - return new LineCursor3(inner); - } - toString() { - return this.sliceString(0); - } - toJSON() { - let lines = []; - this.flatten(lines); - return lines; - } - static of(text) { - if (text.length == 0) - throw new RangeError("A document must have at least one line"); - if (text.length == 1 && !text[0]) - return Text3.empty; - return text.length <= 32 ? new TextLeaf3(text) : TextNode3.from(TextLeaf3.split(text, [])); - } - }; - var TextLeaf3 = class extends Text3 { - constructor(text, length = textLength3(text)) { - super(); - this.text = text; - this.length = length; - } - get lines() { - return this.text.length; - } - get children() { - return null; - } - lineInner(target, isLine, line, offset) { - for (let i = 0; ; i++) { - let string3 = this.text[i], end = offset + string3.length; - if ((isLine ? line : end) >= target) - return new Line3(offset, end, line, string3); - offset = end + 1; - line++; - } - } - decompose(from2, to, target, open) { - let text = from2 <= 0 && to >= this.length ? this : new TextLeaf3(sliceText3(this.text, from2, to), Math.min(to, this.length) - Math.max(0, from2)); - if (open & 1) { - let prev = target.pop(); - let joined = appendText3(text.text, prev.text.slice(), 0, text.length); - if (joined.length <= 32) { - target.push(new TextLeaf3(joined, prev.length + text.length)); - } else { - let mid = joined.length >> 1; - target.push(new TextLeaf3(joined.slice(0, mid)), new TextLeaf3(joined.slice(mid))); - } - } else { - target.push(text); - } - } - replace(from2, to, text) { - if (!(text instanceof TextLeaf3)) - return super.replace(from2, to, text); - let lines = appendText3(this.text, appendText3(text.text, sliceText3(this.text, 0, from2)), to); - let newLen = this.length + text.length - (to - from2); - if (lines.length <= 32) - return new TextLeaf3(lines, newLen); - return TextNode3.from(TextLeaf3.split(lines, []), newLen); - } - sliceString(from2, to = this.length, lineSep = "\n") { - let result = ""; - for (let pos = 0, i = 0; pos <= to && i < this.text.length; i++) { - let line = this.text[i], end = pos + line.length; - if (pos > from2 && i) - result += lineSep; - if (from2 < end && to > pos) - result += line.slice(Math.max(0, from2 - pos), to - pos); - pos = end + 1; - } - return result; - } - flatten(target) { - for (let line of this.text) - target.push(line); - } - scanIdentical() { - return 0; - } - static split(text, target) { - let part = [], len = -1; - for (let line of text) { - part.push(line); - len += line.length + 1; - if (part.length == 32) { - target.push(new TextLeaf3(part, len)); - part = []; - len = -1; - } - } - if (len > -1) - target.push(new TextLeaf3(part, len)); - return target; - } - }; - var TextNode3 = class extends Text3 { - constructor(children, length) { - super(); - this.children = children; - this.length = length; - this.lines = 0; - for (let child of children) - this.lines += child.lines; - } - lineInner(target, isLine, line, offset) { - for (let i = 0; ; i++) { - let child = this.children[i], end = offset + child.length, endLine = line + child.lines - 1; - if ((isLine ? endLine : end) >= target) - return child.lineInner(target, isLine, line, offset); - offset = end + 1; - line = endLine + 1; - } - } - decompose(from2, to, target, open) { - for (let i = 0, pos = 0; pos <= to && i < this.children.length; i++) { - let child = this.children[i], end = pos + child.length; - if (from2 <= end && to >= pos) { - let childOpen = open & ((pos <= from2 ? 1 : 0) | (end >= to ? 2 : 0)); - if (pos >= from2 && end <= to && !childOpen) - target.push(child); - else - child.decompose(from2 - pos, to - pos, target, childOpen); - } - pos = end + 1; - } - } - replace(from2, to, text) { - if (text.lines < this.lines) - for (let i = 0, pos = 0; i < this.children.length; i++) { - let child = this.children[i], end = pos + child.length; - if (from2 >= pos && to <= end) { - let updated = child.replace(from2 - pos, to - pos, text); - let totalLines = this.lines - child.lines + updated.lines; - if (updated.lines < totalLines >> 5 - 1 && updated.lines > totalLines >> 5 + 1) { - let copy = this.children.slice(); - copy[i] = updated; - return new TextNode3(copy, this.length - (to - from2) + text.length); - } - return super.replace(pos, end, updated); - } - pos = end + 1; - } - return super.replace(from2, to, text); - } - sliceString(from2, to = this.length, lineSep = "\n") { - let result = ""; - for (let i = 0, pos = 0; i < this.children.length && pos <= to; i++) { - let child = this.children[i], end = pos + child.length; - if (pos > from2 && i) - result += lineSep; - if (from2 < end && to > pos) - result += child.sliceString(from2 - pos, to - pos, lineSep); - pos = end + 1; - } - return result; - } - flatten(target) { - for (let child of this.children) - child.flatten(target); - } - scanIdentical(other, dir) { - if (!(other instanceof TextNode3)) - return 0; - let length = 0; - let [iA, iB, eA, eB] = dir > 0 ? [0, 0, this.children.length, other.children.length] : [this.children.length - 1, other.children.length - 1, -1, -1]; - for (; ; iA += dir, iB += dir) { - if (iA == eA || iB == eB) - return length; - let chA = this.children[iA], chB = other.children[iB]; - if (chA != chB) - return length + chA.scanIdentical(chB, dir); - length += chA.length + 1; - } - } - static from(children, length = children.reduce((l, ch) => l + ch.length + 1, -1)) { - let lines = 0; - for (let ch of children) - lines += ch.lines; - if (lines < 32) { - let flat = []; - for (let ch of children) - ch.flatten(flat); - return new TextLeaf3(flat, length); - } - let chunk = Math.max(32, lines >> 5), maxChunk = chunk << 1, minChunk = chunk >> 1; - let chunked = [], currentLines = 0, currentLen = -1, currentChunk = []; - function add2(child) { - let last; - if (child.lines > maxChunk && child instanceof TextNode3) { - for (let node of child.children) - add2(node); - } else if (child.lines > minChunk && (currentLines > minChunk || !currentLines)) { - flush(); - chunked.push(child); - } else if (child instanceof TextLeaf3 && currentLines && (last = currentChunk[currentChunk.length - 1]) instanceof TextLeaf3 && child.lines + last.lines <= 32) { - currentLines += child.lines; - currentLen += child.length + 1; - currentChunk[currentChunk.length - 1] = new TextLeaf3(last.text.concat(child.text), last.length + 1 + child.length); - } else { - if (currentLines + child.lines > chunk) - flush(); - currentLines += child.lines; - currentLen += child.length + 1; - currentChunk.push(child); - } - } - function flush() { - if (currentLines == 0) - return; - chunked.push(currentChunk.length == 1 ? currentChunk[0] : TextNode3.from(currentChunk, currentLen)); - currentLen = -1; - currentLines = currentChunk.length = 0; - } - for (let child of children) - add2(child); - flush(); - return chunked.length == 1 ? chunked[0] : new TextNode3(chunked, length); - } - }; - Text3.empty = /* @__PURE__ */ new TextLeaf3([""], 0); - function textLength3(text) { - let length = -1; - for (let line of text) - length += line.length + 1; - return length; - } - function appendText3(text, target, from2 = 0, to = 1e9) { - for (let pos = 0, i = 0, first = true; i < text.length && pos <= to; i++) { - let line = text[i], end = pos + line.length; - if (end >= from2) { - if (end > to) - line = line.slice(0, to - pos); - if (pos < from2) - line = line.slice(from2 - pos); - if (first) { - target[target.length - 1] += line; - first = false; - } else - target.push(line); - } - pos = end + 1; - } - return target; - } - function sliceText3(text, from2, to) { - return appendText3(text, [""], from2, to); - } - var RawTextCursor3 = class { - constructor(text, dir = 1) { - this.dir = dir; - this.done = false; - this.lineBreak = false; - this.value = ""; - this.nodes = [text]; - this.offsets = [dir > 0 ? 1 : (text instanceof TextLeaf3 ? text.text.length : text.children.length) << 1]; - } - nextInner(skip, dir) { - this.done = this.lineBreak = false; - for (; ; ) { - let last = this.nodes.length - 1; - let top2 = this.nodes[last], offsetValue = this.offsets[last], offset = offsetValue >> 1; - let size = top2 instanceof TextLeaf3 ? top2.text.length : top2.children.length; - if (offset == (dir > 0 ? size : 0)) { - if (last == 0) { - this.done = true; - this.value = ""; - return this; - } - if (dir > 0) - this.offsets[last - 1]++; - this.nodes.pop(); - this.offsets.pop(); - } else if ((offsetValue & 1) == (dir > 0 ? 0 : 1)) { - this.offsets[last] += dir; - if (skip == 0) { - this.lineBreak = true; - this.value = "\n"; - return this; - } - skip--; - } else if (top2 instanceof TextLeaf3) { - let next = top2.text[offset + (dir < 0 ? -1 : 0)]; - this.offsets[last] += dir; - if (next.length > Math.max(0, skip)) { - this.value = skip == 0 ? next : dir > 0 ? next.slice(skip) : next.slice(0, next.length - skip); - return this; - } - skip -= next.length; - } else { - let next = top2.children[offset + (dir < 0 ? -1 : 0)]; - if (skip > next.length) { - skip -= next.length; - this.offsets[last] += dir; - } else { - if (dir < 0) - this.offsets[last]--; - this.nodes.push(next); - this.offsets.push(dir > 0 ? 1 : (next instanceof TextLeaf3 ? next.text.length : next.children.length) << 1); - } - } - } - } - next(skip = 0) { - if (skip < 0) { - this.nextInner(-skip, -this.dir); - skip = this.value.length; - } - return this.nextInner(skip, this.dir); - } - }; - var PartialTextCursor3 = class { - constructor(text, start, end) { - this.value = ""; - this.done = false; - this.cursor = new RawTextCursor3(text, start > end ? -1 : 1); - this.pos = start > end ? text.length : 0; - this.from = Math.min(start, end); - this.to = Math.max(start, end); - } - nextInner(skip, dir) { - if (dir < 0 ? this.pos <= this.from : this.pos >= this.to) { - this.value = ""; - this.done = true; - return this; - } - skip += Math.max(0, dir < 0 ? this.pos - this.to : this.from - this.pos); - let limit = dir < 0 ? this.pos - this.from : this.to - this.pos; - if (skip > limit) - skip = limit; - limit -= skip; - let { value } = this.cursor.next(skip); - this.pos += (value.length + skip) * dir; - this.value = value.length <= limit ? value : dir < 0 ? value.slice(value.length - limit) : value.slice(0, limit); - this.done = !this.value; - return this; - } - next(skip = 0) { - if (skip < 0) - skip = Math.max(skip, this.from - this.pos); - else if (skip > 0) - skip = Math.min(skip, this.to - this.pos); - return this.nextInner(skip, this.cursor.dir); - } - get lineBreak() { - return this.cursor.lineBreak && this.value != ""; - } - }; - var LineCursor3 = class { - constructor(inner) { - this.inner = inner; - this.afterBreak = true; - this.value = ""; - this.done = false; - } - next(skip = 0) { - let { done, lineBreak, value } = this.inner.next(skip); - if (done) { - this.done = true; - this.value = ""; - } else if (lineBreak) { - if (this.afterBreak) { - this.value = ""; - } else { - this.afterBreak = true; - this.next(); - } - } else { - this.value = value; - this.afterBreak = false; - } - return this; - } - get lineBreak() { - return false; - } - }; - if (typeof Symbol != "undefined") { - Text3.prototype[Symbol.iterator] = function() { - return this.iter(); - }; - RawTextCursor3.prototype[Symbol.iterator] = PartialTextCursor3.prototype[Symbol.iterator] = LineCursor3.prototype[Symbol.iterator] = function() { - return this; - }; - } - var Line3 = class { - constructor(from2, to, number3, text) { - this.from = from2; - this.to = to; - this.number = number3; - this.text = text; - } - get length() { - return this.to - this.from; - } - }; - var extend3 = /* @__PURE__ */ "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((s) => s ? parseInt(s, 36) : 1); - for (let i = 1; i < extend3.length; i++) - extend3[i] += extend3[i - 1]; - function isExtendingChar3(code) { - for (let i = 1; i < extend3.length; i += 2) - if (extend3[i] > code) - return extend3[i - 1] <= code; - return false; - } - function isRegionalIndicator3(code) { - return code >= 127462 && code <= 127487; - } - var ZWJ3 = 8205; - function findClusterBreak3(str, pos, forward = true, includeExtending = true) { - return (forward ? nextClusterBreak3 : prevClusterBreak3)(str, pos, includeExtending); - } - function nextClusterBreak3(str, pos, includeExtending) { - if (pos == str.length) - return pos; - if (pos && surrogateLow3(str.charCodeAt(pos)) && surrogateHigh3(str.charCodeAt(pos - 1))) - pos--; - let prev = codePointAt3(str, pos); - pos += codePointSize3(prev); - while (pos < str.length) { - let next = codePointAt3(str, pos); - if (prev == ZWJ3 || next == ZWJ3 || includeExtending && isExtendingChar3(next)) { - pos += codePointSize3(next); - prev = next; - } else if (isRegionalIndicator3(next)) { - let countBefore = 0, i = pos - 2; - while (i >= 0 && isRegionalIndicator3(codePointAt3(str, i))) { - countBefore++; - i -= 2; - } - if (countBefore % 2 == 0) - break; - else - pos += 2; - } else { - break; - } - } - return pos; - } - function prevClusterBreak3(str, pos, includeExtending) { - while (pos > 0) { - let found = nextClusterBreak3(str, pos - 2, includeExtending); - if (found < pos) - return found; - pos--; - } - return 0; - } - function surrogateLow3(ch) { - return ch >= 56320 && ch < 57344; - } - function surrogateHigh3(ch) { - return ch >= 55296 && ch < 56320; - } - function codePointAt3(str, pos) { - let code0 = str.charCodeAt(pos); - if (!surrogateHigh3(code0) || pos + 1 == str.length) - return code0; - let code1 = str.charCodeAt(pos + 1); - if (!surrogateLow3(code1)) - return code0; - return (code0 - 55296 << 10) + (code1 - 56320) + 65536; - } - function codePointSize3(code) { - return code < 65536 ? 1 : 2; - } - var DefaultSplit3 = /\r\n?|\n/; - var MapMode3 = /* @__PURE__ */ function(MapMode4) { - MapMode4[MapMode4["Simple"] = 0] = "Simple"; - MapMode4[MapMode4["TrackDel"] = 1] = "TrackDel"; - MapMode4[MapMode4["TrackBefore"] = 2] = "TrackBefore"; - MapMode4[MapMode4["TrackAfter"] = 3] = "TrackAfter"; - return MapMode4; - }(MapMode3 || (MapMode3 = {})); - var ChangeDesc3 = class { - constructor(sections) { - this.sections = sections; - } - get length() { - let result = 0; - for (let i = 0; i < this.sections.length; i += 2) - result += this.sections[i]; - return result; - } - get newLength() { - let result = 0; - for (let i = 0; i < this.sections.length; i += 2) { - let ins = this.sections[i + 1]; - result += ins < 0 ? this.sections[i] : ins; - } - return result; - } - get empty() { - return this.sections.length == 0 || this.sections.length == 2 && this.sections[1] < 0; - } - iterGaps(f) { - for (let i = 0, posA = 0, posB = 0; i < this.sections.length; ) { - let len = this.sections[i++], ins = this.sections[i++]; - if (ins < 0) { - f(posA, posB, len); - posB += len; - } else { - posB += ins; - } - posA += len; - } - } - iterChangedRanges(f, individual = false) { - iterChanges3(this, f, individual); - } - get invertedDesc() { - let sections = []; - for (let i = 0; i < this.sections.length; ) { - let len = this.sections[i++], ins = this.sections[i++]; - if (ins < 0) - sections.push(len, ins); - else - sections.push(ins, len); - } - return new ChangeDesc3(sections); - } - composeDesc(other) { - return this.empty ? other : other.empty ? this : composeSets3(this, other); - } - mapDesc(other, before = false) { - return other.empty ? this : mapSet3(this, other, before); - } - mapPos(pos, assoc = -1, mode = MapMode3.Simple) { - let posA = 0, posB = 0; - for (let i = 0; i < this.sections.length; ) { - let len = this.sections[i++], ins = this.sections[i++], endA = posA + len; - if (ins < 0) { - if (endA > pos) - return posB + (pos - posA); - posB += len; - } else { - if (mode != MapMode3.Simple && endA >= pos && (mode == MapMode3.TrackDel && posA < pos && endA > pos || mode == MapMode3.TrackBefore && posA < pos || mode == MapMode3.TrackAfter && endA > pos)) - return null; - if (endA > pos || endA == pos && assoc < 0 && !len) - return pos == posA || assoc < 0 ? posB : posB + ins; - posB += ins; - } - posA = endA; - } - if (pos > posA) - throw new RangeError(`Position ${pos} is out of range for changeset of length ${posA}`); - return posB; - } - touchesRange(from2, to = from2) { - for (let i = 0, pos = 0; i < this.sections.length && pos <= to; ) { - let len = this.sections[i++], ins = this.sections[i++], end = pos + len; - if (ins >= 0 && pos <= to && end >= from2) - return pos < from2 && end > to ? "cover" : true; - pos = end; - } - return false; - } - toString() { - let result = ""; - for (let i = 0; i < this.sections.length; ) { - let len = this.sections[i++], ins = this.sections[i++]; - result += (result ? " " : "") + len + (ins >= 0 ? ":" + ins : ""); - } - return result; - } - toJSON() { - return this.sections; - } - static fromJSON(json2) { - if (!Array.isArray(json2) || json2.length % 2 || json2.some((a) => typeof a != "number")) - throw new RangeError("Invalid JSON representation of ChangeDesc"); - return new ChangeDesc3(json2); - } - }; - var ChangeSet3 = class extends ChangeDesc3 { - constructor(sections, inserted) { - super(sections); - this.inserted = inserted; - } - apply(doc4) { - if (this.length != doc4.length) - throw new RangeError("Applying change set to a document with the wrong length"); - iterChanges3(this, (fromA, toA, fromB, _toB, text) => doc4 = doc4.replace(fromB, fromB + (toA - fromA), text), false); - return doc4; - } - mapDesc(other, before = false) { - return mapSet3(this, other, before, true); - } - invert(doc4) { - let sections = this.sections.slice(), inserted = []; - for (let i = 0, pos = 0; i < sections.length; i += 2) { - let len = sections[i], ins = sections[i + 1]; - if (ins >= 0) { - sections[i] = ins; - sections[i + 1] = len; - let index = i >> 1; - while (inserted.length < index) - inserted.push(Text3.empty); - inserted.push(len ? doc4.slice(pos, pos + len) : Text3.empty); - } - pos += len; - } - return new ChangeSet3(sections, inserted); - } - compose(other) { - return this.empty ? other : other.empty ? this : composeSets3(this, other, true); - } - map(other, before = false) { - return other.empty ? this : mapSet3(this, other, before, true); - } - iterChanges(f, individual = false) { - iterChanges3(this, f, individual); - } - get desc() { - return new ChangeDesc3(this.sections); - } - filter(ranges) { - let resultSections = [], resultInserted = [], filteredSections = []; - let iter = new SectionIter3(this); - done: - for (let i = 0, pos = 0; ; ) { - let next = i == ranges.length ? 1e9 : ranges[i++]; - while (pos < next || pos == next && iter.len == 0) { - if (iter.done) - break done; - let len = Math.min(iter.len, next - pos); - addSection3(filteredSections, len, -1); - let ins = iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0; - addSection3(resultSections, len, ins); - if (ins > 0) - addInsert3(resultInserted, resultSections, iter.text); - iter.forward(len); - pos += len; - } - let end = ranges[i++]; - while (pos < end) { - if (iter.done) - break done; - let len = Math.min(iter.len, end - pos); - addSection3(resultSections, len, -1); - addSection3(filteredSections, len, iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0); - iter.forward(len); - pos += len; - } - } - return { - changes: new ChangeSet3(resultSections, resultInserted), - filtered: new ChangeDesc3(filteredSections) - }; - } - toJSON() { - let parts = []; - for (let i = 0; i < this.sections.length; i += 2) { - let len = this.sections[i], ins = this.sections[i + 1]; - if (ins < 0) - parts.push(len); - else if (ins == 0) - parts.push([len]); - else - parts.push([len].concat(this.inserted[i >> 1].toJSON())); - } - return parts; - } - static of(changes, length, lineSep) { - let sections = [], inserted = [], pos = 0; - let total = null; - function flush(force = false) { - if (!force && !sections.length) - return; - if (pos < length) - addSection3(sections, length - pos, -1); - let set = new ChangeSet3(sections, inserted); - total = total ? total.compose(set.map(total)) : set; - sections = []; - inserted = []; - pos = 0; - } - function process2(spec) { - if (Array.isArray(spec)) { - for (let sub of spec) - process2(sub); - } else if (spec instanceof ChangeSet3) { - if (spec.length != length) - throw new RangeError(`Mismatched change set length (got ${spec.length}, expected ${length})`); - flush(); - total = total ? total.compose(spec.map(total)) : spec; - } else { - let { from: from2, to = from2, insert: insert4 } = spec; - if (from2 > to || from2 < 0 || to > length) - throw new RangeError(`Invalid change range ${from2} to ${to} (in doc of length ${length})`); - let insText = !insert4 ? Text3.empty : typeof insert4 == "string" ? Text3.of(insert4.split(lineSep || DefaultSplit3)) : insert4; - let insLen = insText.length; - if (from2 == to && insLen == 0) - return; - if (from2 < pos) - flush(); - if (from2 > pos) - addSection3(sections, from2 - pos, -1); - addSection3(sections, to - from2, insLen); - addInsert3(inserted, sections, insText); - pos = to; - } - } - process2(changes); - flush(!total); - return total; - } - static empty(length) { - return new ChangeSet3(length ? [length, -1] : [], []); - } - static fromJSON(json2) { - if (!Array.isArray(json2)) - throw new RangeError("Invalid JSON representation of ChangeSet"); - let sections = [], inserted = []; - for (let i = 0; i < json2.length; i++) { - let part = json2[i]; - if (typeof part == "number") { - sections.push(part, -1); - } else if (!Array.isArray(part) || typeof part[0] != "number" || part.some((e, i2) => i2 && typeof e != "string")) { - throw new RangeError("Invalid JSON representation of ChangeSet"); - } else if (part.length == 1) { - sections.push(part[0], 0); - } else { - while (inserted.length < i) - inserted.push(Text3.empty); - inserted[i] = Text3.of(part.slice(1)); - sections.push(part[0], inserted[i].length); - } - } - return new ChangeSet3(sections, inserted); - } - }; - function addSection3(sections, len, ins, forceJoin = false) { - if (len == 0 && ins <= 0) - return; - let last = sections.length - 2; - if (last >= 0 && ins <= 0 && ins == sections[last + 1]) - sections[last] += len; - else if (len == 0 && sections[last] == 0) - sections[last + 1] += ins; - else if (forceJoin) { - sections[last] += len; - sections[last + 1] += ins; - } else - sections.push(len, ins); - } - function addInsert3(values2, sections, value) { - if (value.length == 0) - return; - let index = sections.length - 2 >> 1; - if (index < values2.length) { - values2[values2.length - 1] = values2[values2.length - 1].append(value); - } else { - while (values2.length < index) - values2.push(Text3.empty); - values2.push(value); - } - } - function iterChanges3(desc, f, individual) { - let inserted = desc.inserted; - for (let posA = 0, posB = 0, i = 0; i < desc.sections.length; ) { - let len = desc.sections[i++], ins = desc.sections[i++]; - if (ins < 0) { - posA += len; - posB += len; - } else { - let endA = posA, endB = posB, text = Text3.empty; - for (; ; ) { - endA += len; - endB += ins; - if (ins && inserted) - text = text.append(inserted[i - 2 >> 1]); - if (individual || i == desc.sections.length || desc.sections[i + 1] < 0) - break; - len = desc.sections[i++]; - ins = desc.sections[i++]; - } - f(posA, endA, posB, endB, text); - posA = endA; - posB = endB; - } - } - } - function mapSet3(setA, setB, before, mkSet = false) { - let sections = [], insert4 = mkSet ? [] : null; - let a = new SectionIter3(setA), b = new SectionIter3(setB); - for (let posA = 0, posB = 0; ; ) { - if (a.ins == -1) { - posA += a.len; - a.next(); - } else if (b.ins == -1 && posB < posA) { - let skip = Math.min(b.len, posA - posB); - b.forward(skip); - addSection3(sections, skip, -1); - posB += skip; - } else if (b.ins >= 0 && (a.done || posB < posA || posB == posA && (b.len < a.len || b.len == a.len && !before))) { - addSection3(sections, b.ins, -1); - while (posA > posB && !a.done && posA + a.len < posB + b.len) { - posA += a.len; - a.next(); - } - posB += b.len; - b.next(); - } else if (a.ins >= 0) { - let len = 0, end = posA + a.len; - for (; ; ) { - if (b.ins >= 0 && posB > posA && posB + b.len < end) { - len += b.ins; - posB += b.len; - b.next(); - } else if (b.ins == -1 && posB < end) { - let skip = Math.min(b.len, end - posB); - len += skip; - b.forward(skip); - posB += skip; - } else { - break; - } - } - addSection3(sections, len, a.ins); - if (insert4) - addInsert3(insert4, sections, a.text); - posA = end; - a.next(); - } else if (a.done && b.done) { - return insert4 ? new ChangeSet3(sections, insert4) : new ChangeDesc3(sections); - } else { - throw new Error("Mismatched change set lengths"); - } - } - } - function composeSets3(setA, setB, mkSet = false) { - let sections = []; - let insert4 = mkSet ? [] : null; - let a = new SectionIter3(setA), b = new SectionIter3(setB); - for (let open = false; ; ) { - if (a.done && b.done) { - return insert4 ? new ChangeSet3(sections, insert4) : new ChangeDesc3(sections); - } else if (a.ins == 0) { - addSection3(sections, a.len, 0, open); - a.next(); - } else if (b.len == 0 && !b.done) { - addSection3(sections, 0, b.ins, open); - if (insert4) - addInsert3(insert4, sections, b.text); - b.next(); - } else if (a.done || b.done) { - throw new Error("Mismatched change set lengths"); - } else { - let len = Math.min(a.len2, b.len), sectionLen = sections.length; - if (a.ins == -1) { - let insB = b.ins == -1 ? -1 : b.off ? 0 : b.ins; - addSection3(sections, len, insB, open); - if (insert4 && insB) - addInsert3(insert4, sections, b.text); - } else if (b.ins == -1) { - addSection3(sections, a.off ? 0 : a.len, len, open); - if (insert4) - addInsert3(insert4, sections, a.textBit(len)); - } else { - addSection3(sections, a.off ? 0 : a.len, b.off ? 0 : b.ins, open); - if (insert4 && !b.off) - addInsert3(insert4, sections, b.text); - } - open = (a.ins > len || b.ins >= 0 && b.len > len) && (open || sections.length > sectionLen); - a.forward2(len); - b.forward(len); - } - } - } - var SectionIter3 = class { - constructor(set) { - this.set = set; - this.i = 0; - this.next(); - } - next() { - let { sections } = this.set; - if (this.i < sections.length) { - this.len = sections[this.i++]; - this.ins = sections[this.i++]; - } else { - this.len = 0; - this.ins = -2; - } - this.off = 0; - } - get done() { - return this.ins == -2; - } - get len2() { - return this.ins < 0 ? this.len : this.ins; - } - get text() { - let { inserted } = this.set, index = this.i - 2 >> 1; - return index >= inserted.length ? Text3.empty : inserted[index]; - } - textBit(len) { - let { inserted } = this.set, index = this.i - 2 >> 1; - return index >= inserted.length && !len ? Text3.empty : inserted[index].slice(this.off, len == null ? void 0 : this.off + len); - } - forward(len) { - if (len == this.len) - this.next(); - else { - this.len -= len; - this.off += len; - } - } - forward2(len) { - if (this.ins == -1) - this.forward(len); - else if (len == this.ins) - this.next(); - else { - this.ins -= len; - this.off += len; - } - } - }; - var SelectionRange3 = class { - constructor(from2, to, flags) { - this.from = from2; - this.to = to; - this.flags = flags; - } - get anchor() { - return this.flags & 16 ? this.to : this.from; - } - get head() { - return this.flags & 16 ? this.from : this.to; - } - get empty() { - return this.from == this.to; - } - get assoc() { - return this.flags & 4 ? -1 : this.flags & 8 ? 1 : 0; - } - get bidiLevel() { - let level = this.flags & 3; - return level == 3 ? null : level; - } - get goalColumn() { - let value = this.flags >> 5; - return value == 33554431 ? void 0 : value; - } - map(change, assoc = -1) { - let from2, to; - if (this.empty) { - from2 = to = change.mapPos(this.from, assoc); - } else { - from2 = change.mapPos(this.from, 1); - to = change.mapPos(this.to, -1); - } - return from2 == this.from && to == this.to ? this : new SelectionRange3(from2, to, this.flags); - } - extend(from2, to = from2) { - if (from2 <= this.anchor && to >= this.anchor) - return EditorSelection3.range(from2, to); - let head = Math.abs(from2 - this.anchor) > Math.abs(to - this.anchor) ? from2 : to; - return EditorSelection3.range(this.anchor, head); - } - eq(other) { - return this.anchor == other.anchor && this.head == other.head; - } - toJSON() { - return { anchor: this.anchor, head: this.head }; - } - static fromJSON(json2) { - if (!json2 || typeof json2.anchor != "number" || typeof json2.head != "number") - throw new RangeError("Invalid JSON representation for SelectionRange"); - return EditorSelection3.range(json2.anchor, json2.head); - } - }; - var EditorSelection3 = class { - constructor(ranges, mainIndex = 0) { - this.ranges = ranges; - this.mainIndex = mainIndex; - } - map(change, assoc = -1) { - if (change.empty) - return this; - return EditorSelection3.create(this.ranges.map((r) => r.map(change, assoc)), this.mainIndex); - } - eq(other) { - if (this.ranges.length != other.ranges.length || this.mainIndex != other.mainIndex) - return false; - for (let i = 0; i < this.ranges.length; i++) - if (!this.ranges[i].eq(other.ranges[i])) - return false; - return true; - } - get main() { - return this.ranges[this.mainIndex]; - } - asSingle() { - return this.ranges.length == 1 ? this : new EditorSelection3([this.main]); - } - addRange(range, main = true) { - return EditorSelection3.create([range].concat(this.ranges), main ? 0 : this.mainIndex + 1); - } - replaceRange(range, which = this.mainIndex) { - let ranges = this.ranges.slice(); - ranges[which] = range; - return EditorSelection3.create(ranges, this.mainIndex); - } - toJSON() { - return { ranges: this.ranges.map((r) => r.toJSON()), main: this.mainIndex }; - } - static fromJSON(json2) { - if (!json2 || !Array.isArray(json2.ranges) || typeof json2.main != "number" || json2.main >= json2.ranges.length) - throw new RangeError("Invalid JSON representation for EditorSelection"); - return new EditorSelection3(json2.ranges.map((r) => SelectionRange3.fromJSON(r)), json2.main); - } - static single(anchor, head = anchor) { - return new EditorSelection3([EditorSelection3.range(anchor, head)], 0); - } - static create(ranges, mainIndex = 0) { - if (ranges.length == 0) - throw new RangeError("A selection needs at least one range"); - for (let pos = 0, i = 0; i < ranges.length; i++) { - let range = ranges[i]; - if (range.empty ? range.from <= pos : range.from < pos) - return normalized3(ranges.slice(), mainIndex); - pos = range.to; - } - return new EditorSelection3(ranges, mainIndex); - } - static cursor(pos, assoc = 0, bidiLevel, goalColumn) { - return new SelectionRange3(pos, pos, (assoc == 0 ? 0 : assoc < 0 ? 4 : 8) | (bidiLevel == null ? 3 : Math.min(2, bidiLevel)) | (goalColumn !== null && goalColumn !== void 0 ? goalColumn : 33554431) << 5); - } - static range(anchor, head, goalColumn) { - let goal = (goalColumn !== null && goalColumn !== void 0 ? goalColumn : 33554431) << 5; - return head < anchor ? new SelectionRange3(head, anchor, 16 | goal | 8) : new SelectionRange3(anchor, head, goal | (head > anchor ? 4 : 0)); - } - }; - function normalized3(ranges, mainIndex = 0) { - let main = ranges[mainIndex]; - ranges.sort((a, b) => a.from - b.from); - mainIndex = ranges.indexOf(main); - for (let i = 1; i < ranges.length; i++) { - let range = ranges[i], prev = ranges[i - 1]; - if (range.empty ? range.from <= prev.to : range.from < prev.to) { - let from2 = prev.from, to = Math.max(range.to, prev.to); - if (i <= mainIndex) - mainIndex--; - ranges.splice(--i, 2, range.anchor > range.head ? EditorSelection3.range(to, from2) : EditorSelection3.range(from2, to)); - } - } - return new EditorSelection3(ranges, mainIndex); - } - function checkSelection3(selection, docLength) { - for (let range of selection.ranges) - if (range.to > docLength) - throw new RangeError("Selection points outside of document"); - } - var nextID3 = 0; - var Facet3 = class { - constructor(combine, compareInput, compare4, isStatic, extensions) { - this.combine = combine; - this.compareInput = compareInput; - this.compare = compare4; - this.isStatic = isStatic; - this.extensions = extensions; - this.id = nextID3++; - this.default = combine([]); - } - static define(config2 = {}) { - return new Facet3(config2.combine || ((a) => a), config2.compareInput || ((a, b) => a === b), config2.compare || (!config2.combine ? sameArray5 : (a, b) => a === b), !!config2.static, config2.enables); - } - of(value) { - return new FacetProvider3([], this, 0, value); - } - compute(deps, get) { - if (this.isStatic) - throw new Error("Can't compute a static facet"); - return new FacetProvider3(deps, this, 1, get); - } - computeN(deps, get) { - if (this.isStatic) - throw new Error("Can't compute a static facet"); - return new FacetProvider3(deps, this, 2, get); - } - from(field, get) { - if (!get) - get = (x) => x; - return this.compute([field], (state) => get(state.field(field))); - } - }; - function sameArray5(a, b) { - return a == b || a.length == b.length && a.every((e, i) => e === b[i]); - } - var FacetProvider3 = class { - constructor(dependencies, facet, type, value) { - this.dependencies = dependencies; - this.facet = facet; - this.type = type; - this.value = value; - this.id = nextID3++; - } - dynamicSlot(addresses) { - var _a4; - let getter = this.value; - let compare4 = this.facet.compareInput; - let id3 = this.id, idx = addresses[id3] >> 1, multi = this.type == 2; - let depDoc = false, depSel = false, depAddrs = []; - for (let dep of this.dependencies) { - if (dep == "doc") - depDoc = true; - else if (dep == "selection") - depSel = true; - else if ((((_a4 = addresses[dep.id]) !== null && _a4 !== void 0 ? _a4 : 1) & 1) == 0) - depAddrs.push(addresses[dep.id]); - } - return { - create(state) { - state.values[idx] = getter(state); - return 1; - }, - update(state, tr) { - if (depDoc && tr.docChanged || depSel && (tr.docChanged || tr.selection) || ensureAll2(state, depAddrs)) { - let newVal = getter(state); - if (multi ? !compareArray3(newVal, state.values[idx], compare4) : !compare4(newVal, state.values[idx])) { - state.values[idx] = newVal; - return 1; - } - } - return 0; - }, - reconfigure: (state, oldState) => { - let newVal = getter(state); - let oldAddr = oldState.config.address[id3]; - if (oldAddr != null) { - let oldVal = getAddr3(oldState, oldAddr); - if (this.dependencies.every((dep) => { - return dep instanceof Facet3 ? oldState.facet(dep) === state.facet(dep) : dep instanceof StateField3 ? oldState.field(dep, false) == state.field(dep, false) : true; - }) || (multi ? compareArray3(newVal, oldVal, compare4) : compare4(newVal, oldVal))) { - state.values[idx] = oldVal; - return 0; - } - } - state.values[idx] = newVal; - return 1; - } - }; - } - }; - function compareArray3(a, b, compare4) { - if (a.length != b.length) - return false; - for (let i = 0; i < a.length; i++) - if (!compare4(a[i], b[i])) - return false; - return true; - } - function ensureAll2(state, addrs) { - let changed = false; - for (let addr of addrs) - if (ensureAddr3(state, addr) & 1) - changed = true; - return changed; - } - function dynamicFacetSlot3(addresses, facet, providers) { - let providerAddrs = providers.map((p) => addresses[p.id]); - let providerTypes = providers.map((p) => p.type); - let dynamic = providerAddrs.filter((p) => !(p & 1)); - let idx = addresses[facet.id] >> 1; - function get(state) { - let values2 = []; - for (let i = 0; i < providerAddrs.length; i++) { - let value = getAddr3(state, providerAddrs[i]); - if (providerTypes[i] == 2) - for (let val of value) - values2.push(val); - else - values2.push(value); - } - return facet.combine(values2); - } - return { - create(state) { - for (let addr of providerAddrs) - ensureAddr3(state, addr); - state.values[idx] = get(state); - return 1; - }, - update(state, tr) { - if (!ensureAll2(state, dynamic)) - return 0; - let value = get(state); - if (facet.compare(value, state.values[idx])) - return 0; - state.values[idx] = value; - return 1; - }, - reconfigure(state, oldState) { - let depChanged = ensureAll2(state, providerAddrs); - let oldProviders = oldState.config.facets[facet.id], oldValue = oldState.facet(facet); - if (oldProviders && !depChanged && sameArray5(providers, oldProviders)) { - state.values[idx] = oldValue; - return 0; - } - let value = get(state); - if (facet.compare(value, oldValue)) { - state.values[idx] = oldValue; - return 0; - } - state.values[idx] = value; - return 1; - } - }; - } - var initField3 = /* @__PURE__ */ Facet3.define({ static: true }); - var StateField3 = class { - constructor(id3, createF, updateF, compareF, spec) { - this.id = id3; - this.createF = createF; - this.updateF = updateF; - this.compareF = compareF; - this.spec = spec; - this.provides = void 0; - } - static define(config2) { - let field = new StateField3(nextID3++, config2.create, config2.update, config2.compare || ((a, b) => a === b), config2); - if (config2.provide) - field.provides = config2.provide(field); - return field; - } - create(state) { - let init = state.facet(initField3).find((i) => i.field == this); - return ((init === null || init === void 0 ? void 0 : init.create) || this.createF)(state); - } - slot(addresses) { - let idx = addresses[this.id] >> 1; - return { - create: (state) => { - state.values[idx] = this.create(state); - return 1; - }, - update: (state, tr) => { - let oldVal = state.values[idx]; - let value = this.updateF(oldVal, tr); - if (this.compareF(oldVal, value)) - return 0; - state.values[idx] = value; - return 1; - }, - reconfigure: (state, oldState) => { - if (oldState.config.address[this.id] != null) { - state.values[idx] = oldState.field(this); - return 0; - } - state.values[idx] = this.create(state); - return 1; - } - }; - } - init(create) { - return [this, initField3.of({ field: this, create })]; - } - get extension() { - return this; - } - }; - var Prec_3 = { lowest: 4, low: 3, default: 2, high: 1, highest: 0 }; - function prec3(value) { - return (ext) => new PrecExtension3(ext, value); - } - var Prec3 = { - highest: /* @__PURE__ */ prec3(Prec_3.highest), - high: /* @__PURE__ */ prec3(Prec_3.high), - default: /* @__PURE__ */ prec3(Prec_3.default), - low: /* @__PURE__ */ prec3(Prec_3.low), - lowest: /* @__PURE__ */ prec3(Prec_3.lowest) - }; - var PrecExtension3 = class { - constructor(inner, prec4) { - this.inner = inner; - this.prec = prec4; - } - }; - var Compartment3 = class { - of(ext) { - return new CompartmentInstance3(this, ext); - } - reconfigure(content3) { - return Compartment3.reconfigure.of({ compartment: this, extension: content3 }); - } - get(state) { - return state.config.compartments.get(this); - } - }; - var CompartmentInstance3 = class { - constructor(compartment, inner) { - this.compartment = compartment; - this.inner = inner; - } - }; - var Configuration3 = class { - constructor(base2, compartments, dynamicSlots, address, staticValues, facets) { - this.base = base2; - this.compartments = compartments; - this.dynamicSlots = dynamicSlots; - this.address = address; - this.staticValues = staticValues; - this.facets = facets; - this.statusTemplate = []; - while (this.statusTemplate.length < dynamicSlots.length) - this.statusTemplate.push(0); - } - staticFacet(facet) { - let addr = this.address[facet.id]; - return addr == null ? facet.default : this.staticValues[addr >> 1]; - } - static resolve(base2, compartments, oldState) { - let fields = []; - let facets = /* @__PURE__ */ Object.create(null); - let newCompartments = /* @__PURE__ */ new Map(); - for (let ext of flatten3(base2, compartments, newCompartments)) { - if (ext instanceof StateField3) - fields.push(ext); - else - (facets[ext.facet.id] || (facets[ext.facet.id] = [])).push(ext); - } - let address = /* @__PURE__ */ Object.create(null); - let staticValues = []; - let dynamicSlots = []; - for (let field of fields) { - address[field.id] = dynamicSlots.length << 1; - dynamicSlots.push((a) => field.slot(a)); - } - let oldFacets = oldState === null || oldState === void 0 ? void 0 : oldState.config.facets; - for (let id3 in facets) { - let providers = facets[id3], facet = providers[0].facet; - let oldProviders = oldFacets && oldFacets[id3] || []; - if (providers.every((p) => p.type == 0)) { - address[facet.id] = staticValues.length << 1 | 1; - if (sameArray5(oldProviders, providers)) { - staticValues.push(oldState.facet(facet)); - } else { - let value = facet.combine(providers.map((p) => p.value)); - staticValues.push(oldState && facet.compare(value, oldState.facet(facet)) ? oldState.facet(facet) : value); - } - } else { - for (let p of providers) { - if (p.type == 0) { - address[p.id] = staticValues.length << 1 | 1; - staticValues.push(p.value); - } else { - address[p.id] = dynamicSlots.length << 1; - dynamicSlots.push((a) => p.dynamicSlot(a)); - } - } - address[facet.id] = dynamicSlots.length << 1; - dynamicSlots.push((a) => dynamicFacetSlot3(a, facet, providers)); - } - } - let dynamic = dynamicSlots.map((f) => f(address)); - return new Configuration3(base2, newCompartments, dynamic, address, staticValues, facets); - } - }; - function flatten3(extension, compartments, newCompartments) { - let result = [[], [], [], [], []]; - let seen = /* @__PURE__ */ new Map(); - function inner(ext, prec4) { - let known = seen.get(ext); - if (known != null) { - if (known <= prec4) - return; - let found = result[known].indexOf(ext); - if (found > -1) - result[known].splice(found, 1); - if (ext instanceof CompartmentInstance3) - newCompartments.delete(ext.compartment); - } - seen.set(ext, prec4); - if (Array.isArray(ext)) { - for (let e of ext) - inner(e, prec4); - } else if (ext instanceof CompartmentInstance3) { - if (newCompartments.has(ext.compartment)) - throw new RangeError(`Duplicate use of compartment in extensions`); - let content3 = compartments.get(ext.compartment) || ext.inner; - newCompartments.set(ext.compartment, content3); - inner(content3, prec4); - } else if (ext instanceof PrecExtension3) { - inner(ext.inner, ext.prec); - } else if (ext instanceof StateField3) { - result[prec4].push(ext); - if (ext.provides) - inner(ext.provides, prec4); - } else if (ext instanceof FacetProvider3) { - result[prec4].push(ext); - if (ext.facet.extensions) - inner(ext.facet.extensions, prec4); - } else { - let content3 = ext.extension; - if (!content3) - throw new Error(`Unrecognized extension value in extension set (${ext}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`); - inner(content3, prec4); - } - } - inner(extension, Prec_3.default); - return result.reduce((a, b) => a.concat(b)); - } - function ensureAddr3(state, addr) { - if (addr & 1) - return 2; - let idx = addr >> 1; - let status = state.status[idx]; - if (status == 4) - throw new Error("Cyclic dependency between fields and/or facets"); - if (status & 2) - return status; - state.status[idx] = 4; - let changed = state.computeSlot(state, state.config.dynamicSlots[idx]); - return state.status[idx] = 2 | changed; - } - function getAddr3(state, addr) { - return addr & 1 ? state.config.staticValues[addr >> 1] : state.values[addr >> 1]; - } - var languageData3 = /* @__PURE__ */ Facet3.define(); - var allowMultipleSelections3 = /* @__PURE__ */ Facet3.define({ - combine: (values2) => values2.some((v) => v), - static: true - }); - var lineSeparator3 = /* @__PURE__ */ Facet3.define({ - combine: (values2) => values2.length ? values2[0] : void 0, - static: true - }); - var changeFilter3 = /* @__PURE__ */ Facet3.define(); - var transactionFilter3 = /* @__PURE__ */ Facet3.define(); - var transactionExtender3 = /* @__PURE__ */ Facet3.define(); - var readOnly3 = /* @__PURE__ */ Facet3.define({ - combine: (values2) => values2.length ? values2[0] : false - }); - var Annotation3 = class { - constructor(type, value) { - this.type = type; - this.value = value; - } - static define() { - return new AnnotationType3(); - } - }; - var AnnotationType3 = class { - of(value) { - return new Annotation3(this, value); - } - }; - var StateEffectType3 = class { - constructor(map) { - this.map = map; - } - of(value) { - return new StateEffect3(this, value); - } - }; - var StateEffect3 = class { - constructor(type, value) { - this.type = type; - this.value = value; - } - map(mapping) { - let mapped = this.type.map(this.value, mapping); - return mapped === void 0 ? void 0 : mapped == this.value ? this : new StateEffect3(this.type, mapped); - } - is(type) { - return this.type == type; - } - static define(spec = {}) { - return new StateEffectType3(spec.map || ((v) => v)); - } - static mapEffects(effects, mapping) { - if (!effects.length) - return effects; - let result = []; - for (let effect of effects) { - let mapped = effect.map(mapping); - if (mapped) - result.push(mapped); - } - return result; - } - }; - StateEffect3.reconfigure = /* @__PURE__ */ StateEffect3.define(); - StateEffect3.appendConfig = /* @__PURE__ */ StateEffect3.define(); - var Transaction3 = class { - constructor(startState, changes, selection, effects, annotations, scrollIntoView5) { - this.startState = startState; - this.changes = changes; - this.selection = selection; - this.effects = effects; - this.annotations = annotations; - this.scrollIntoView = scrollIntoView5; - this._doc = null; - this._state = null; - if (selection) - checkSelection3(selection, changes.newLength); - if (!annotations.some((a) => a.type == Transaction3.time)) - this.annotations = annotations.concat(Transaction3.time.of(Date.now())); - } - get newDoc() { - return this._doc || (this._doc = this.changes.apply(this.startState.doc)); - } - get newSelection() { - return this.selection || this.startState.selection.map(this.changes); - } - get state() { - if (!this._state) - this.startState.applyTransaction(this); - return this._state; - } - annotation(type) { - for (let ann of this.annotations) - if (ann.type == type) - return ann.value; - return void 0; - } - get docChanged() { - return !this.changes.empty; - } - get reconfigured() { - return this.startState.config != this.state.config; - } - isUserEvent(event) { - let e = this.annotation(Transaction3.userEvent); - return !!(e && (e == event || e.length > event.length && e.slice(0, event.length) == event && e[event.length] == ".")); - } - }; - Transaction3.time = /* @__PURE__ */ Annotation3.define(); - Transaction3.userEvent = /* @__PURE__ */ Annotation3.define(); - Transaction3.addToHistory = /* @__PURE__ */ Annotation3.define(); - Transaction3.remote = /* @__PURE__ */ Annotation3.define(); - function joinRanges3(a, b) { - let result = []; - for (let iA = 0, iB = 0; ; ) { - let from2, to; - if (iA < a.length && (iB == b.length || b[iB] >= a[iA])) { - from2 = a[iA++]; - to = a[iA++]; - } else if (iB < b.length) { - from2 = b[iB++]; - to = b[iB++]; - } else - return result; - if (!result.length || result[result.length - 1] < from2) - result.push(from2, to); - else if (result[result.length - 1] < to) - result[result.length - 1] = to; - } - } - function mergeTransaction3(a, b, sequential) { - var _a4; - let mapForA, mapForB, changes; - if (sequential) { - mapForA = b.changes; - mapForB = ChangeSet3.empty(b.changes.length); - changes = a.changes.compose(b.changes); - } else { - mapForA = b.changes.map(a.changes); - mapForB = a.changes.mapDesc(b.changes, true); - changes = a.changes.compose(mapForA); - } - return { - changes, - selection: b.selection ? b.selection.map(mapForB) : (_a4 = a.selection) === null || _a4 === void 0 ? void 0 : _a4.map(mapForA), - effects: StateEffect3.mapEffects(a.effects, mapForA).concat(StateEffect3.mapEffects(b.effects, mapForB)), - annotations: a.annotations.length ? a.annotations.concat(b.annotations) : b.annotations, - scrollIntoView: a.scrollIntoView || b.scrollIntoView - }; - } - function resolveTransactionInner3(state, spec, docSize) { - let sel = spec.selection, annotations = asArray4(spec.annotations); - if (spec.userEvent) - annotations = annotations.concat(Transaction3.userEvent.of(spec.userEvent)); - return { - changes: spec.changes instanceof ChangeSet3 ? spec.changes : ChangeSet3.of(spec.changes || [], docSize, state.facet(lineSeparator3)), - selection: sel && (sel instanceof EditorSelection3 ? sel : EditorSelection3.single(sel.anchor, sel.head)), - effects: asArray4(spec.effects), - annotations, - scrollIntoView: !!spec.scrollIntoView - }; - } - function resolveTransaction3(state, specs, filter) { - let s = resolveTransactionInner3(state, specs.length ? specs[0] : {}, state.doc.length); - if (specs.length && specs[0].filter === false) - filter = false; - for (let i = 1; i < specs.length; i++) { - if (specs[i].filter === false) - filter = false; - let seq = !!specs[i].sequential; - s = mergeTransaction3(s, resolveTransactionInner3(state, specs[i], seq ? s.changes.newLength : state.doc.length), seq); - } - let tr = new Transaction3(state, s.changes, s.selection, s.effects, s.annotations, s.scrollIntoView); - return extendTransaction3(filter ? filterTransaction3(tr) : tr); - } - function filterTransaction3(tr) { - let state = tr.startState; - let result = true; - for (let filter of state.facet(changeFilter3)) { - let value = filter(tr); - if (value === false) { - result = false; - break; - } - if (Array.isArray(value)) - result = result === true ? value : joinRanges3(result, value); - } - if (result !== true) { - let changes, back; - if (result === false) { - back = tr.changes.invertedDesc; - changes = ChangeSet3.empty(state.doc.length); - } else { - let filtered = tr.changes.filter(result); - changes = filtered.changes; - back = filtered.filtered.invertedDesc; - } - tr = new Transaction3(state, changes, tr.selection && tr.selection.map(back), StateEffect3.mapEffects(tr.effects, back), tr.annotations, tr.scrollIntoView); - } - let filters = state.facet(transactionFilter3); - for (let i = filters.length - 1; i >= 0; i--) { - let filtered = filters[i](tr); - if (filtered instanceof Transaction3) - tr = filtered; - else if (Array.isArray(filtered) && filtered.length == 1 && filtered[0] instanceof Transaction3) - tr = filtered[0]; - else - tr = resolveTransaction3(state, asArray4(filtered), false); - } - return tr; - } - function extendTransaction3(tr) { - let state = tr.startState, extenders = state.facet(transactionExtender3), spec = tr; - for (let i = extenders.length - 1; i >= 0; i--) { - let extension = extenders[i](tr); - if (extension && Object.keys(extension).length) - spec = mergeTransaction3(tr, resolveTransactionInner3(state, extension, tr.changes.newLength), true); - } - return spec == tr ? tr : new Transaction3(state, tr.changes, tr.selection, spec.effects, spec.annotations, spec.scrollIntoView); - } - var none7 = []; - function asArray4(value) { - return value == null ? none7 : Array.isArray(value) ? value : [value]; - } - var CharCategory3 = /* @__PURE__ */ function(CharCategory4) { - CharCategory4[CharCategory4["Word"] = 0] = "Word"; - CharCategory4[CharCategory4["Space"] = 1] = "Space"; - CharCategory4[CharCategory4["Other"] = 2] = "Other"; - return CharCategory4; - }(CharCategory3 || (CharCategory3 = {})); - var nonASCIISingleCaseWordChar3 = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; - var wordChar3; - try { - wordChar3 = /* @__PURE__ */ new RegExp("[\\p{Alphabetic}\\p{Number}_]", "u"); - } catch (_) { - } - function hasWordChar3(str) { - if (wordChar3) - return wordChar3.test(str); - for (let i = 0; i < str.length; i++) { - let ch = str[i]; - if (/\w/.test(ch) || ch > "\x80" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar3.test(ch))) - return true; - } - return false; - } - function makeCategorizer3(wordChars) { - return (char) => { - if (!/\S/.test(char)) - return CharCategory3.Space; - if (hasWordChar3(char)) - return CharCategory3.Word; - for (let i = 0; i < wordChars.length; i++) - if (char.indexOf(wordChars[i]) > -1) - return CharCategory3.Word; - return CharCategory3.Other; - }; - } - var EditorState3 = class { - constructor(config2, doc4, selection, values2, computeSlot, tr) { - this.config = config2; - this.doc = doc4; - this.selection = selection; - this.values = values2; - this.status = config2.statusTemplate.slice(); - this.computeSlot = computeSlot; - if (tr) - tr._state = this; - for (let i = 0; i < this.config.dynamicSlots.length; i++) - ensureAddr3(this, i << 1); - this.computeSlot = null; - } - field(field, require3 = true) { - let addr = this.config.address[field.id]; - if (addr == null) { - if (require3) - throw new RangeError("Field is not present in this state"); - return void 0; - } - ensureAddr3(this, addr); - return getAddr3(this, addr); - } - update(...specs) { - return resolveTransaction3(this, specs, true); - } - applyTransaction(tr) { - let conf = this.config, { base: base2, compartments } = conf; - for (let effect of tr.effects) { - if (effect.is(Compartment3.reconfigure)) { - if (conf) { - compartments = /* @__PURE__ */ new Map(); - conf.compartments.forEach((val, key) => compartments.set(key, val)); - conf = null; - } - compartments.set(effect.value.compartment, effect.value.extension); - } else if (effect.is(StateEffect3.reconfigure)) { - conf = null; - base2 = effect.value; - } else if (effect.is(StateEffect3.appendConfig)) { - conf = null; - base2 = asArray4(base2).concat(effect.value); - } - } - let startValues; - if (!conf) { - conf = Configuration3.resolve(base2, compartments, this); - let intermediateState = new EditorState3(conf, this.doc, this.selection, conf.dynamicSlots.map(() => null), (state, slot) => slot.reconfigure(state, this), null); - startValues = intermediateState.values; - } else { - startValues = tr.startState.values.slice(); - } - new EditorState3(conf, tr.newDoc, tr.newSelection, startValues, (state, slot) => slot.update(state, tr), tr); - } - replaceSelection(text) { - if (typeof text == "string") - text = this.toText(text); - return this.changeByRange((range) => ({ - changes: { from: range.from, to: range.to, insert: text }, - range: EditorSelection3.cursor(range.from + text.length) - })); - } - changeByRange(f) { - let sel = this.selection; - let result1 = f(sel.ranges[0]); - let changes = this.changes(result1.changes), ranges = [result1.range]; - let effects = asArray4(result1.effects); - for (let i = 1; i < sel.ranges.length; i++) { - let result = f(sel.ranges[i]); - let newChanges = this.changes(result.changes), newMapped = newChanges.map(changes); - for (let j = 0; j < i; j++) - ranges[j] = ranges[j].map(newMapped); - let mapBy = changes.mapDesc(newChanges, true); - ranges.push(result.range.map(mapBy)); - changes = changes.compose(newMapped); - effects = StateEffect3.mapEffects(effects, newMapped).concat(StateEffect3.mapEffects(asArray4(result.effects), mapBy)); - } - return { - changes, - selection: EditorSelection3.create(ranges, sel.mainIndex), - effects - }; - } - changes(spec = []) { - if (spec instanceof ChangeSet3) - return spec; - return ChangeSet3.of(spec, this.doc.length, this.facet(EditorState3.lineSeparator)); - } - toText(string3) { - return Text3.of(string3.split(this.facet(EditorState3.lineSeparator) || DefaultSplit3)); - } - sliceDoc(from2 = 0, to = this.doc.length) { - return this.doc.sliceString(from2, to, this.lineBreak); - } - facet(facet) { - let addr = this.config.address[facet.id]; - if (addr == null) - return facet.default; - ensureAddr3(this, addr); - return getAddr3(this, addr); - } - toJSON(fields) { - let result = { - doc: this.sliceDoc(), - selection: this.selection.toJSON() - }; - if (fields) - for (let prop in fields) { - let value = fields[prop]; - if (value instanceof StateField3) - result[prop] = value.spec.toJSON(this.field(fields[prop]), this); - } - return result; - } - static fromJSON(json2, config2 = {}, fields) { - if (!json2 || typeof json2.doc != "string") - throw new RangeError("Invalid JSON representation for EditorState"); - let fieldInit = []; - if (fields) - for (let prop in fields) { - let field = fields[prop], value = json2[prop]; - fieldInit.push(field.init((state) => field.spec.fromJSON(value, state))); - } - return EditorState3.create({ - doc: json2.doc, - selection: EditorSelection3.fromJSON(json2.selection), - extensions: config2.extensions ? fieldInit.concat([config2.extensions]) : fieldInit - }); - } - static create(config2 = {}) { - let configuration = Configuration3.resolve(config2.extensions || [], /* @__PURE__ */ new Map()); - let doc4 = config2.doc instanceof Text3 ? config2.doc : Text3.of((config2.doc || "").split(configuration.staticFacet(EditorState3.lineSeparator) || DefaultSplit3)); - let selection = !config2.selection ? EditorSelection3.single(0) : config2.selection instanceof EditorSelection3 ? config2.selection : EditorSelection3.single(config2.selection.anchor, config2.selection.head); - checkSelection3(selection, doc4.length); - if (!configuration.staticFacet(allowMultipleSelections3)) - selection = selection.asSingle(); - return new EditorState3(configuration, doc4, selection, configuration.dynamicSlots.map(() => null), (state, slot) => slot.create(state), null); - } - get tabSize() { - return this.facet(EditorState3.tabSize); - } - get lineBreak() { - return this.facet(EditorState3.lineSeparator) || "\n"; - } - get readOnly() { - return this.facet(readOnly3); - } - phrase(phrase2) { - for (let map of this.facet(EditorState3.phrases)) - if (Object.prototype.hasOwnProperty.call(map, phrase2)) - return map[phrase2]; - return phrase2; - } - languageDataAt(name3, pos, side = -1) { - let values2 = []; - for (let provider of this.facet(languageData3)) { - for (let result of provider(this, pos, side)) { - if (Object.prototype.hasOwnProperty.call(result, name3)) - values2.push(result[name3]); - } - } - return values2; - } - charCategorizer(at) { - return makeCategorizer3(this.languageDataAt("wordChars", at).join("")); - } - wordAt(pos) { - let { text, from: from2, length } = this.doc.lineAt(pos); - let cat = this.charCategorizer(pos); - let start = pos - from2, end = pos - from2; - while (start > 0) { - let prev = findClusterBreak3(text, start, false); - if (cat(text.slice(prev, start)) != CharCategory3.Word) - break; - start = prev; - } - while (end < length) { - let next = findClusterBreak3(text, end); - if (cat(text.slice(end, next)) != CharCategory3.Word) - break; - end = next; - } - return start == end ? null : EditorSelection3.range(start + from2, end + from2); - } - }; - EditorState3.allowMultipleSelections = allowMultipleSelections3; - EditorState3.tabSize = /* @__PURE__ */ Facet3.define({ - combine: (values2) => values2.length ? values2[0] : 4 - }); - EditorState3.lineSeparator = lineSeparator3; - EditorState3.readOnly = readOnly3; - EditorState3.phrases = /* @__PURE__ */ Facet3.define({ - compare(a, b) { - let kA = Object.keys(a), kB = Object.keys(b); - return kA.length == kB.length && kA.every((k) => a[k] == b[k]); - } - }); - EditorState3.languageData = languageData3; - EditorState3.changeFilter = changeFilter3; - EditorState3.transactionFilter = transactionFilter3; - EditorState3.transactionExtender = transactionExtender3; - Compartment3.reconfigure = /* @__PURE__ */ StateEffect3.define(); - var RangeValue3 = class { - eq(other) { - return this == other; - } - range(from2, to = from2) { - return new Range8(from2, to, this); - } - }; - RangeValue3.prototype.startSide = RangeValue3.prototype.endSide = 0; - RangeValue3.prototype.point = false; - RangeValue3.prototype.mapMode = MapMode3.TrackDel; - var Range8 = class { - constructor(from2, to, value) { - this.from = from2; - this.to = to; - this.value = value; - } - }; - function cmpRange3(a, b) { - return a.from - b.from || a.value.startSide - b.value.startSide; - } - var Chunk3 = class { - constructor(from2, to, value, maxPoint) { - this.from = from2; - this.to = to; - this.value = value; - this.maxPoint = maxPoint; - } - get length() { - return this.to[this.to.length - 1]; - } - findIndex(pos, side, end, startAt = 0) { - let arr = end ? this.to : this.from; - for (let lo = startAt, hi = arr.length; ; ) { - if (lo == hi) - return lo; - let mid = lo + hi >> 1; - let diff = arr[mid] - pos || (end ? this.value[mid].endSide : this.value[mid].startSide) - side; - if (mid == lo) - return diff >= 0 ? lo : hi; - if (diff >= 0) - hi = mid; - else - lo = mid + 1; - } - } - between(offset, from2, to, f) { - for (let i = this.findIndex(from2, -1e9, true), e = this.findIndex(to, 1e9, false, i); i < e; i++) - if (f(this.from[i] + offset, this.to[i] + offset, this.value[i]) === false) - return false; - } - map(offset, changes) { - let value = [], from2 = [], to = [], newPos = -1, maxPoint = -1; - for (let i = 0; i < this.value.length; i++) { - let val = this.value[i], curFrom = this.from[i] + offset, curTo = this.to[i] + offset, newFrom, newTo; - if (curFrom == curTo) { - let mapped = changes.mapPos(curFrom, val.startSide, val.mapMode); - if (mapped == null) - continue; - newFrom = newTo = mapped; - if (val.startSide != val.endSide) { - newTo = changes.mapPos(curFrom, val.endSide); - if (newTo < newFrom) - continue; - } - } else { - newFrom = changes.mapPos(curFrom, val.startSide); - newTo = changes.mapPos(curTo, val.endSide); - if (newFrom > newTo || newFrom == newTo && val.startSide > 0 && val.endSide <= 0) - continue; - } - if ((newTo - newFrom || val.endSide - val.startSide) < 0) - continue; - if (newPos < 0) - newPos = newFrom; - if (val.point) - maxPoint = Math.max(maxPoint, newTo - newFrom); - value.push(val); - from2.push(newFrom - newPos); - to.push(newTo - newPos); - } - return { mapped: value.length ? new Chunk3(from2, to, value, maxPoint) : null, pos: newPos }; - } - }; - var RangeSet3 = class { - constructor(chunkPos, chunk, nextLayer = RangeSet3.empty, maxPoint) { - this.chunkPos = chunkPos; - this.chunk = chunk; - this.nextLayer = nextLayer; - this.maxPoint = maxPoint; - } - get length() { - let last = this.chunk.length - 1; - return last < 0 ? 0 : Math.max(this.chunkEnd(last), this.nextLayer.length); - } - get size() { - if (this.isEmpty) - return 0; - let size = this.nextLayer.size; - for (let chunk of this.chunk) - size += chunk.value.length; - return size; - } - chunkEnd(index) { - return this.chunkPos[index] + this.chunk[index].length; - } - update(updateSpec) { - let { add: add2 = [], sort = false, filterFrom = 0, filterTo = this.length } = updateSpec; - let filter = updateSpec.filter; - if (add2.length == 0 && !filter) - return this; - if (sort) - add2 = add2.slice().sort(cmpRange3); - if (this.isEmpty) - return add2.length ? RangeSet3.of(add2) : this; - let cur2 = new LayerCursor3(this, null, -1).goto(0), i = 0, spill = []; - let builder = new RangeSetBuilder3(); - while (cur2.value || i < add2.length) { - if (i < add2.length && (cur2.from - add2[i].from || cur2.startSide - add2[i].value.startSide) >= 0) { - let range = add2[i++]; - if (!builder.addInner(range.from, range.to, range.value)) - spill.push(range); - } else if (cur2.rangeIndex == 1 && cur2.chunkIndex < this.chunk.length && (i == add2.length || this.chunkEnd(cur2.chunkIndex) < add2[i].from) && (!filter || filterFrom > this.chunkEnd(cur2.chunkIndex) || filterTo < this.chunkPos[cur2.chunkIndex]) && builder.addChunk(this.chunkPos[cur2.chunkIndex], this.chunk[cur2.chunkIndex])) { - cur2.nextChunk(); - } else { - if (!filter || filterFrom > cur2.to || filterTo < cur2.from || filter(cur2.from, cur2.to, cur2.value)) { - if (!builder.addInner(cur2.from, cur2.to, cur2.value)) - spill.push(new Range8(cur2.from, cur2.to, cur2.value)); - } - cur2.next(); - } - } - return builder.finishInner(this.nextLayer.isEmpty && !spill.length ? RangeSet3.empty : this.nextLayer.update({ add: spill, filter, filterFrom, filterTo })); - } - map(changes) { - if (changes.empty || this.isEmpty) - return this; - let chunks = [], chunkPos = [], maxPoint = -1; - for (let i = 0; i < this.chunk.length; i++) { - let start = this.chunkPos[i], chunk = this.chunk[i]; - let touch = changes.touchesRange(start, start + chunk.length); - if (touch === false) { - maxPoint = Math.max(maxPoint, chunk.maxPoint); - chunks.push(chunk); - chunkPos.push(changes.mapPos(start)); - } else if (touch === true) { - let { mapped, pos } = chunk.map(start, changes); - if (mapped) { - maxPoint = Math.max(maxPoint, mapped.maxPoint); - chunks.push(mapped); - chunkPos.push(pos); - } - } - } - let next = this.nextLayer.map(changes); - return chunks.length == 0 ? next : new RangeSet3(chunkPos, chunks, next, maxPoint); - } - between(from2, to, f) { - if (this.isEmpty) - return; - for (let i = 0; i < this.chunk.length; i++) { - let start = this.chunkPos[i], chunk = this.chunk[i]; - if (to >= start && from2 <= start + chunk.length && chunk.between(start, from2 - start, to - start, f) === false) - return; - } - this.nextLayer.between(from2, to, f); - } - iter(from2 = 0) { - return HeapCursor3.from([this]).goto(from2); - } - get isEmpty() { - return this.nextLayer == this; - } - static iter(sets, from2 = 0) { - return HeapCursor3.from(sets).goto(from2); - } - static compare(oldSets, newSets, textDiff, comparator, minPointSize = -1) { - let a = oldSets.filter((set) => set.maxPoint > 0 || !set.isEmpty && set.maxPoint >= minPointSize); - let b = newSets.filter((set) => set.maxPoint > 0 || !set.isEmpty && set.maxPoint >= minPointSize); - let sharedChunks = findSharedChunks3(a, b, textDiff); - let sideA = new SpanCursor3(a, sharedChunks, minPointSize); - let sideB = new SpanCursor3(b, sharedChunks, minPointSize); - textDiff.iterGaps((fromA, fromB, length) => compare3(sideA, fromA, sideB, fromB, length, comparator)); - if (textDiff.empty && textDiff.length == 0) - compare3(sideA, 0, sideB, 0, 0, comparator); - } - static eq(oldSets, newSets, from2 = 0, to) { - if (to == null) - to = 1e9; - let a = oldSets.filter((set) => !set.isEmpty && newSets.indexOf(set) < 0); - let b = newSets.filter((set) => !set.isEmpty && oldSets.indexOf(set) < 0); - if (a.length != b.length) - return false; - if (!a.length) - return true; - let sharedChunks = findSharedChunks3(a, b); - let sideA = new SpanCursor3(a, sharedChunks, 0).goto(from2), sideB = new SpanCursor3(b, sharedChunks, 0).goto(from2); - for (; ; ) { - if (sideA.to != sideB.to || !sameValues3(sideA.active, sideB.active) || sideA.point && (!sideB.point || !sideA.point.eq(sideB.point))) - return false; - if (sideA.to > to) - return true; - sideA.next(); - sideB.next(); - } - } - static spans(sets, from2, to, iterator, minPointSize = -1) { - let cursor = new SpanCursor3(sets, null, minPointSize).goto(from2), pos = from2; - let open = cursor.openStart; - for (; ; ) { - let curTo = Math.min(cursor.to, to); - if (cursor.point) { - iterator.point(pos, curTo, cursor.point, cursor.activeForPoint(cursor.to), open, cursor.pointRank); - open = cursor.openEnd(curTo) + (cursor.to > curTo ? 1 : 0); - } else if (curTo > pos) { - iterator.span(pos, curTo, cursor.active, open); - open = cursor.openEnd(curTo); - } - if (cursor.to > to) - break; - pos = cursor.to; - cursor.next(); - } - return open; - } - static of(ranges, sort = false) { - let build = new RangeSetBuilder3(); - for (let range of ranges instanceof Range8 ? [ranges] : sort ? lazySort3(ranges) : ranges) - build.add(range.from, range.to, range.value); - return build.finish(); - } - }; - RangeSet3.empty = /* @__PURE__ */ new RangeSet3([], [], null, -1); - function lazySort3(ranges) { - if (ranges.length > 1) - for (let prev = ranges[0], i = 1; i < ranges.length; i++) { - let cur2 = ranges[i]; - if (cmpRange3(prev, cur2) > 0) - return ranges.slice().sort(cmpRange3); - prev = cur2; - } - return ranges; - } - RangeSet3.empty.nextLayer = RangeSet3.empty; - var RangeSetBuilder3 = class { - constructor() { - this.chunks = []; - this.chunkPos = []; - this.chunkStart = -1; - this.last = null; - this.lastFrom = -1e9; - this.lastTo = -1e9; - this.from = []; - this.to = []; - this.value = []; - this.maxPoint = -1; - this.setMaxPoint = -1; - this.nextLayer = null; - } - finishChunk(newArrays) { - this.chunks.push(new Chunk3(this.from, this.to, this.value, this.maxPoint)); - this.chunkPos.push(this.chunkStart); - this.chunkStart = -1; - this.setMaxPoint = Math.max(this.setMaxPoint, this.maxPoint); - this.maxPoint = -1; - if (newArrays) { - this.from = []; - this.to = []; - this.value = []; - } - } - add(from2, to, value) { - if (!this.addInner(from2, to, value)) - (this.nextLayer || (this.nextLayer = new RangeSetBuilder3())).add(from2, to, value); - } - addInner(from2, to, value) { - let diff = from2 - this.lastTo || value.startSide - this.last.endSide; - if (diff <= 0 && (from2 - this.lastFrom || value.startSide - this.last.startSide) < 0) - throw new Error("Ranges must be added sorted by `from` position and `startSide`"); - if (diff < 0) - return false; - if (this.from.length == 250) - this.finishChunk(true); - if (this.chunkStart < 0) - this.chunkStart = from2; - this.from.push(from2 - this.chunkStart); - this.to.push(to - this.chunkStart); - this.last = value; - this.lastFrom = from2; - this.lastTo = to; - this.value.push(value); - if (value.point) - this.maxPoint = Math.max(this.maxPoint, to - from2); - return true; - } - addChunk(from2, chunk) { - if ((from2 - this.lastTo || chunk.value[0].startSide - this.last.endSide) < 0) - return false; - if (this.from.length) - this.finishChunk(true); - this.setMaxPoint = Math.max(this.setMaxPoint, chunk.maxPoint); - this.chunks.push(chunk); - this.chunkPos.push(from2); - let last = chunk.value.length - 1; - this.last = chunk.value[last]; - this.lastFrom = chunk.from[last] + from2; - this.lastTo = chunk.to[last] + from2; - return true; - } - finish() { - return this.finishInner(RangeSet3.empty); - } - finishInner(next) { - if (this.from.length) - this.finishChunk(false); - if (this.chunks.length == 0) - return next; - let result = new RangeSet3(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(next) : next, this.setMaxPoint); - this.from = null; - return result; - } - }; - function findSharedChunks3(a, b, textDiff) { - let inA = /* @__PURE__ */ new Map(); - for (let set of a) - for (let i = 0; i < set.chunk.length; i++) - if (set.chunk[i].maxPoint <= 0) - inA.set(set.chunk[i], set.chunkPos[i]); - let shared = /* @__PURE__ */ new Set(); - for (let set of b) - for (let i = 0; i < set.chunk.length; i++) { - let known = inA.get(set.chunk[i]); - if (known != null && (textDiff ? textDiff.mapPos(known) : known) == set.chunkPos[i] && !(textDiff === null || textDiff === void 0 ? void 0 : textDiff.touchesRange(known, known + set.chunk[i].length))) - shared.add(set.chunk[i]); - } - return shared; - } - var LayerCursor3 = class { - constructor(layer, skip, minPoint, rank = 0) { - this.layer = layer; - this.skip = skip; - this.minPoint = minPoint; - this.rank = rank; - } - get startSide() { - return this.value ? this.value.startSide : 0; - } - get endSide() { - return this.value ? this.value.endSide : 0; - } - goto(pos, side = -1e9) { - this.chunkIndex = this.rangeIndex = 0; - this.gotoInner(pos, side, false); - return this; - } - gotoInner(pos, side, forward) { - while (this.chunkIndex < this.layer.chunk.length) { - let next = this.layer.chunk[this.chunkIndex]; - if (!(this.skip && this.skip.has(next) || this.layer.chunkEnd(this.chunkIndex) < pos || next.maxPoint < this.minPoint)) - break; - this.chunkIndex++; - forward = false; - } - if (this.chunkIndex < this.layer.chunk.length) { - let rangeIndex = this.layer.chunk[this.chunkIndex].findIndex(pos - this.layer.chunkPos[this.chunkIndex], side, true); - if (!forward || this.rangeIndex < rangeIndex) - this.setRangeIndex(rangeIndex); - } - this.next(); - } - forward(pos, side) { - if ((this.to - pos || this.endSide - side) < 0) - this.gotoInner(pos, side, true); - } - next() { - for (; ; ) { - if (this.chunkIndex == this.layer.chunk.length) { - this.from = this.to = 1e9; - this.value = null; - break; - } else { - let chunkPos = this.layer.chunkPos[this.chunkIndex], chunk = this.layer.chunk[this.chunkIndex]; - let from2 = chunkPos + chunk.from[this.rangeIndex]; - this.from = from2; - this.to = chunkPos + chunk.to[this.rangeIndex]; - this.value = chunk.value[this.rangeIndex]; - this.setRangeIndex(this.rangeIndex + 1); - if (this.minPoint < 0 || this.value.point && this.to - this.from >= this.minPoint) - break; - } - } - } - setRangeIndex(index) { - if (index == this.layer.chunk[this.chunkIndex].value.length) { - this.chunkIndex++; - if (this.skip) { - while (this.chunkIndex < this.layer.chunk.length && this.skip.has(this.layer.chunk[this.chunkIndex])) - this.chunkIndex++; - } - this.rangeIndex = 0; - } else { - this.rangeIndex = index; - } - } - nextChunk() { - this.chunkIndex++; - this.rangeIndex = 0; - this.next(); - } - compare(other) { - return this.from - other.from || this.startSide - other.startSide || this.rank - other.rank || this.to - other.to || this.endSide - other.endSide; - } - }; - var HeapCursor3 = class { - constructor(heap) { - this.heap = heap; - } - static from(sets, skip = null, minPoint = -1) { - let heap = []; - for (let i = 0; i < sets.length; i++) { - for (let cur2 = sets[i]; !cur2.isEmpty; cur2 = cur2.nextLayer) { - if (cur2.maxPoint >= minPoint) - heap.push(new LayerCursor3(cur2, skip, minPoint, i)); - } - } - return heap.length == 1 ? heap[0] : new HeapCursor3(heap); - } - get startSide() { - return this.value ? this.value.startSide : 0; - } - goto(pos, side = -1e9) { - for (let cur2 of this.heap) - cur2.goto(pos, side); - for (let i = this.heap.length >> 1; i >= 0; i--) - heapBubble3(this.heap, i); - this.next(); - return this; - } - forward(pos, side) { - for (let cur2 of this.heap) - cur2.forward(pos, side); - for (let i = this.heap.length >> 1; i >= 0; i--) - heapBubble3(this.heap, i); - if ((this.to - pos || this.value.endSide - side) < 0) - this.next(); - } - next() { - if (this.heap.length == 0) { - this.from = this.to = 1e9; - this.value = null; - this.rank = -1; - } else { - let top2 = this.heap[0]; - this.from = top2.from; - this.to = top2.to; - this.value = top2.value; - this.rank = top2.rank; - if (top2.value) - top2.next(); - heapBubble3(this.heap, 0); - } - } - }; - function heapBubble3(heap, index) { - for (let cur2 = heap[index]; ; ) { - let childIndex = (index << 1) + 1; - if (childIndex >= heap.length) - break; - let child = heap[childIndex]; - if (childIndex + 1 < heap.length && child.compare(heap[childIndex + 1]) >= 0) { - child = heap[childIndex + 1]; - childIndex++; - } - if (cur2.compare(child) < 0) - break; - heap[childIndex] = cur2; - heap[index] = child; - index = childIndex; - } - } - var SpanCursor3 = class { - constructor(sets, skip, minPoint) { - this.minPoint = minPoint; - this.active = []; - this.activeTo = []; - this.activeRank = []; - this.minActive = -1; - this.point = null; - this.pointFrom = 0; - this.pointRank = 0; - this.to = -1e9; - this.endSide = 0; - this.openStart = -1; - this.cursor = HeapCursor3.from(sets, skip, minPoint); - } - goto(pos, side = -1e9) { - this.cursor.goto(pos, side); - this.active.length = this.activeTo.length = this.activeRank.length = 0; - this.minActive = -1; - this.to = pos; - this.endSide = side; - this.openStart = -1; - this.next(); - return this; - } - forward(pos, side) { - while (this.minActive > -1 && (this.activeTo[this.minActive] - pos || this.active[this.minActive].endSide - side) < 0) - this.removeActive(this.minActive); - this.cursor.forward(pos, side); - } - removeActive(index) { - remove3(this.active, index); - remove3(this.activeTo, index); - remove3(this.activeRank, index); - this.minActive = findMinIndex3(this.active, this.activeTo); - } - addActive(trackOpen) { - let i = 0, { value, to, rank } = this.cursor; - while (i < this.activeRank.length && this.activeRank[i] <= rank) - i++; - insert3(this.active, i, value); - insert3(this.activeTo, i, to); - insert3(this.activeRank, i, rank); - if (trackOpen) - insert3(trackOpen, i, this.cursor.from); - this.minActive = findMinIndex3(this.active, this.activeTo); - } - next() { - let from2 = this.to, wasPoint = this.point; - this.point = null; - let trackOpen = this.openStart < 0 ? [] : null, trackExtra = 0; - for (; ; ) { - let a = this.minActive; - if (a > -1 && (this.activeTo[a] - this.cursor.from || this.active[a].endSide - this.cursor.startSide) < 0) { - if (this.activeTo[a] > from2) { - this.to = this.activeTo[a]; - this.endSide = this.active[a].endSide; - break; - } - this.removeActive(a); - if (trackOpen) - remove3(trackOpen, a); - } else if (!this.cursor.value) { - this.to = this.endSide = 1e9; - break; - } else if (this.cursor.from > from2) { - this.to = this.cursor.from; - this.endSide = this.cursor.startSide; - break; - } else { - let nextVal = this.cursor.value; - if (!nextVal.point) { - this.addActive(trackOpen); - this.cursor.next(); - } else if (wasPoint && this.cursor.to == this.to && this.cursor.from < this.cursor.to) { - this.cursor.next(); - } else { - this.point = nextVal; - this.pointFrom = this.cursor.from; - this.pointRank = this.cursor.rank; - this.to = this.cursor.to; - this.endSide = nextVal.endSide; - if (this.cursor.from < from2) - trackExtra = 1; - this.cursor.next(); - this.forward(this.to, this.endSide); - break; - } - } - } - if (trackOpen) { - let openStart = 0; - while (openStart < trackOpen.length && trackOpen[openStart] < from2) - openStart++; - this.openStart = openStart + trackExtra; - } - } - activeForPoint(to) { - if (!this.active.length) - return this.active; - let active = []; - for (let i = this.active.length - 1; i >= 0; i--) { - if (this.activeRank[i] < this.pointRank) - break; - if (this.activeTo[i] > to || this.activeTo[i] == to && this.active[i].endSide >= this.point.endSide) - active.push(this.active[i]); - } - return active.reverse(); - } - openEnd(to) { - let open = 0; - for (let i = this.activeTo.length - 1; i >= 0 && this.activeTo[i] > to; i--) - open++; - return open; - } - }; - function compare3(a, startA, b, startB, length, comparator) { - a.goto(startA); - b.goto(startB); - let endB = startB + length; - let pos = startB, dPos = startB - startA; - for (; ; ) { - let diff = a.to + dPos - b.to || a.endSide - b.endSide; - let end = diff < 0 ? a.to + dPos : b.to, clipEnd = Math.min(end, endB); - if (a.point || b.point) { - if (!(a.point && b.point && (a.point == b.point || a.point.eq(b.point)) && sameValues3(a.activeForPoint(a.to + dPos), b.activeForPoint(b.to)))) - comparator.comparePoint(pos, clipEnd, a.point, b.point); - } else { - if (clipEnd > pos && !sameValues3(a.active, b.active)) - comparator.compareRange(pos, clipEnd, a.active, b.active); - } - if (end > endB) - break; - pos = end; - if (diff <= 0) - a.next(); - if (diff >= 0) - b.next(); - } - } - function sameValues3(a, b) { - if (a.length != b.length) - return false; - for (let i = 0; i < a.length; i++) - if (a[i] != b[i] && !a[i].eq(b[i])) - return false; - return true; - } - function remove3(array2, index) { - for (let i = index, e = array2.length - 1; i < e; i++) - array2[i] = array2[i + 1]; - array2.pop(); - } - function insert3(array2, index, value) { - for (let i = array2.length - 1; i >= index; i--) - array2[i + 1] = array2[i]; - array2[index] = value; - } - function findMinIndex3(value, array2) { - let found = -1, foundPos = 1e9; - for (let i = 0; i < array2.length; i++) - if ((array2[i] - foundPos || value[i].endSide - value[found].endSide) < 0) { - found = i; - foundPos = array2[i]; - } - return found; - } - function findColumn3(string3, col, tabSize, strict) { - for (let i = 0, n = 0; ; ) { - if (n >= col) - return i; - if (i == string3.length) - break; - n += string3.charCodeAt(i) == 9 ? tabSize - n % tabSize : 1; - i = findClusterBreak3(string3, i); - } - return strict === true ? -1 : string3.length; - } - - // node_modules/@codemirror/lang-json/node_modules/@codemirror/view/dist/index.js - function getSelection3(root) { - let target; - if (root.nodeType == 11) { - target = root.getSelection ? root : root.ownerDocument; - } else { - target = root; - } - return target.getSelection(); - } - function contains3(dom, node) { - return node ? dom == node || dom.contains(node.nodeType != 1 ? node.parentNode : node) : false; - } - function deepActiveElement3() { - let elt = document.activeElement; - while (elt && elt.shadowRoot) - elt = elt.shadowRoot.activeElement; - return elt; - } - function hasSelection3(dom, selection) { - if (!selection.anchorNode) - return false; - try { - return contains3(dom, selection.anchorNode); - } catch (_) { - return false; - } - } - function clientRectsFor3(dom) { - if (dom.nodeType == 3) - return textRange3(dom, 0, dom.nodeValue.length).getClientRects(); - else if (dom.nodeType == 1) - return dom.getClientRects(); - else - return []; - } - function isEquivalentPosition3(node, off, targetNode, targetOff) { - return targetNode ? scanFor3(node, off, targetNode, targetOff, -1) || scanFor3(node, off, targetNode, targetOff, 1) : false; - } - function domIndex3(node) { - for (var index = 0; ; index++) { - node = node.previousSibling; - if (!node) - return index; - } - } - function scanFor3(node, off, targetNode, targetOff, dir) { - for (; ; ) { - if (node == targetNode && off == targetOff) - return true; - if (off == (dir < 0 ? 0 : maxOffset3(node))) { - if (node.nodeName == "DIV") - return false; - let parent = node.parentNode; - if (!parent || parent.nodeType != 1) - return false; - off = domIndex3(node) + (dir < 0 ? 0 : 1); - node = parent; - } else if (node.nodeType == 1) { - node = node.childNodes[off + (dir < 0 ? -1 : 0)]; - if (node.nodeType == 1 && node.contentEditable == "false") - return false; - off = dir < 0 ? maxOffset3(node) : 0; - } else { - return false; - } - } - } - function maxOffset3(node) { - return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length; - } - var Rect03 = { left: 0, right: 0, top: 0, bottom: 0 }; - function flattenRect3(rect, left) { - let x = left ? rect.left : rect.right; - return { left: x, right: x, top: rect.top, bottom: rect.bottom }; - } - function windowRect3(win) { - return { - left: 0, - right: win.innerWidth, - top: 0, - bottom: win.innerHeight - }; - } - function scrollRectIntoView3(dom, rect, side, x, y, xMargin, yMargin, ltr) { - let doc4 = dom.ownerDocument, win = doc4.defaultView; - for (let cur2 = dom; cur2; ) { - if (cur2.nodeType == 1) { - let bounding, top2 = cur2 == doc4.body; - if (top2) { - bounding = windowRect3(win); - } else { - if (cur2.scrollHeight <= cur2.clientHeight && cur2.scrollWidth <= cur2.clientWidth) { - cur2 = cur2.parentNode; - continue; - } - let rect2 = cur2.getBoundingClientRect(); - bounding = { - left: rect2.left, - right: rect2.left + cur2.clientWidth, - top: rect2.top, - bottom: rect2.top + cur2.clientHeight - }; - } - let moveX = 0, moveY = 0; - if (y == "nearest") { - if (rect.top < bounding.top) { - moveY = -(bounding.top - rect.top + yMargin); - if (side > 0 && rect.bottom > bounding.bottom + moveY) - moveY = rect.bottom - bounding.bottom + moveY + yMargin; - } else if (rect.bottom > bounding.bottom) { - moveY = rect.bottom - bounding.bottom + yMargin; - if (side < 0 && rect.top - moveY < bounding.top) - moveY = -(bounding.top + moveY - rect.top + yMargin); - } - } else { - let rectHeight = rect.bottom - rect.top, boundingHeight = bounding.bottom - bounding.top; - let targetTop = y == "center" && rectHeight <= boundingHeight ? rect.top + rectHeight / 2 - boundingHeight / 2 : y == "start" || y == "center" && side < 0 ? rect.top - yMargin : rect.bottom - boundingHeight + yMargin; - moveY = targetTop - bounding.top; - } - if (x == "nearest") { - if (rect.left < bounding.left) { - moveX = -(bounding.left - rect.left + xMargin); - if (side > 0 && rect.right > bounding.right + moveX) - moveX = rect.right - bounding.right + moveX + xMargin; - } else if (rect.right > bounding.right) { - moveX = rect.right - bounding.right + xMargin; - if (side < 0 && rect.left < bounding.left + moveX) - moveX = -(bounding.left + moveX - rect.left + xMargin); - } - } else { - let targetLeft = x == "center" ? rect.left + (rect.right - rect.left) / 2 - (bounding.right - bounding.left) / 2 : x == "start" == ltr ? rect.left - xMargin : rect.right - (bounding.right - bounding.left) + xMargin; - moveX = targetLeft - bounding.left; - } - if (moveX || moveY) { - if (top2) { - win.scrollBy(moveX, moveY); - } else { - if (moveY) { - let start = cur2.scrollTop; - cur2.scrollTop += moveY; - moveY = cur2.scrollTop - start; - } - if (moveX) { - let start = cur2.scrollLeft; - cur2.scrollLeft += moveX; - moveX = cur2.scrollLeft - start; - } - rect = { - left: rect.left - moveX, - top: rect.top - moveY, - right: rect.right - moveX, - bottom: rect.bottom - moveY - }; - } - } - if (top2) - break; - cur2 = cur2.assignedSlot || cur2.parentNode; - x = y = "nearest"; - } else if (cur2.nodeType == 11) { - cur2 = cur2.host; - } else { - break; - } - } - } - var DOMSelectionState3 = class { - constructor() { - this.anchorNode = null; - this.anchorOffset = 0; - this.focusNode = null; - this.focusOffset = 0; - } - eq(domSel) { - return this.anchorNode == domSel.anchorNode && this.anchorOffset == domSel.anchorOffset && this.focusNode == domSel.focusNode && this.focusOffset == domSel.focusOffset; - } - setRange(range) { - this.set(range.anchorNode, range.anchorOffset, range.focusNode, range.focusOffset); - } - set(anchorNode, anchorOffset, focusNode, focusOffset) { - this.anchorNode = anchorNode; - this.anchorOffset = anchorOffset; - this.focusNode = focusNode; - this.focusOffset = focusOffset; - } - }; - var preventScrollSupported3 = null; - function focusPreventScroll3(dom) { - if (dom.setActive) - return dom.setActive(); - if (preventScrollSupported3) - return dom.focus(preventScrollSupported3); - let stack = []; - for (let cur2 = dom; cur2; cur2 = cur2.parentNode) { - stack.push(cur2, cur2.scrollTop, cur2.scrollLeft); - if (cur2 == cur2.ownerDocument) - break; - } - dom.focus(preventScrollSupported3 == null ? { - get preventScroll() { - preventScrollSupported3 = { preventScroll: true }; - return true; - } - } : void 0); - if (!preventScrollSupported3) { - preventScrollSupported3 = false; - for (let i = 0; i < stack.length; ) { - let elt = stack[i++], top2 = stack[i++], left = stack[i++]; - if (elt.scrollTop != top2) - elt.scrollTop = top2; - if (elt.scrollLeft != left) - elt.scrollLeft = left; - } - } - } - var scratchRange3; - function textRange3(node, from2, to = from2) { - let range = scratchRange3 || (scratchRange3 = document.createRange()); - range.setEnd(node, to); - range.setStart(node, from2); - return range; - } - function dispatchKey3(elt, name3, code) { - let options = { key: name3, code: name3, keyCode: code, which: code, cancelable: true }; - let down = new KeyboardEvent("keydown", options); - down.synthetic = true; - elt.dispatchEvent(down); - let up = new KeyboardEvent("keyup", options); - up.synthetic = true; - elt.dispatchEvent(up); - return down.defaultPrevented || up.defaultPrevented; - } - function getRoot3(node) { - while (node) { - if (node && (node.nodeType == 9 || node.nodeType == 11 && node.host)) - return node; - node = node.assignedSlot || node.parentNode; - } - return null; - } - function clearAttributes3(node) { - while (node.attributes.length) - node.removeAttributeNode(node.attributes[0]); - } - var DOMPos3 = class { - constructor(node, offset, precise = true) { - this.node = node; - this.offset = offset; - this.precise = precise; - } - static before(dom, precise) { - return new DOMPos3(dom.parentNode, domIndex3(dom), precise); - } - static after(dom, precise) { - return new DOMPos3(dom.parentNode, domIndex3(dom) + 1, precise); - } - }; - var noChildren3 = []; - var ContentView3 = class { - constructor() { - this.parent = null; - this.dom = null; - this.dirty = 2; - } - get editorView() { - if (!this.parent) - throw new Error("Accessing view in orphan content view"); - return this.parent.editorView; - } - get overrideDOMText() { - return null; - } - get posAtStart() { - return this.parent ? this.parent.posBefore(this) : 0; - } - get posAtEnd() { - return this.posAtStart + this.length; - } - posBefore(view) { - let pos = this.posAtStart; - for (let child of this.children) { - if (child == view) - return pos; - pos += child.length + child.breakAfter; - } - throw new RangeError("Invalid child in posBefore"); - } - posAfter(view) { - return this.posBefore(view) + view.length; - } - coordsAt(_pos, _side) { - return null; - } - sync(track) { - if (this.dirty & 2) { - let parent = this.dom; - let prev = null, next; - for (let child of this.children) { - if (child.dirty) { - if (!child.dom && (next = prev ? prev.nextSibling : parent.firstChild)) { - let contentView = ContentView3.get(next); - if (!contentView || !contentView.parent && contentView.constructor == child.constructor) - child.reuseDOM(next); - } - child.sync(track); - child.dirty = 0; - } - next = prev ? prev.nextSibling : parent.firstChild; - if (track && !track.written && track.node == parent && next != child.dom) - track.written = true; - if (child.dom.parentNode == parent) { - while (next && next != child.dom) - next = rm$12(next); - } else { - parent.insertBefore(child.dom, next); - } - prev = child.dom; - } - next = prev ? prev.nextSibling : parent.firstChild; - if (next && track && track.node == parent) - track.written = true; - while (next) - next = rm$12(next); - } else if (this.dirty & 1) { - for (let child of this.children) - if (child.dirty) { - child.sync(track); - child.dirty = 0; - } - } - } - reuseDOM(_dom) { - } - localPosFromDOM(node, offset) { - let after; - if (node == this.dom) { - after = this.dom.childNodes[offset]; - } else { - let bias = maxOffset3(node) == 0 ? 0 : offset == 0 ? -1 : 1; - for (; ; ) { - let parent = node.parentNode; - if (parent == this.dom) - break; - if (bias == 0 && parent.firstChild != parent.lastChild) { - if (node == parent.firstChild) - bias = -1; - else - bias = 1; - } - node = parent; - } - if (bias < 0) - after = node; - else - after = node.nextSibling; - } - if (after == this.dom.firstChild) - return 0; - while (after && !ContentView3.get(after)) - after = after.nextSibling; - if (!after) - return this.length; - for (let i = 0, pos = 0; ; i++) { - let child = this.children[i]; - if (child.dom == after) - return pos; - pos += child.length + child.breakAfter; - } - } - domBoundsAround(from2, to, offset = 0) { - let fromI = -1, fromStart = -1, toI = -1, toEnd = -1; - for (let i = 0, pos = offset, prevEnd = offset; i < this.children.length; i++) { - let child = this.children[i], end = pos + child.length; - if (pos < from2 && end > to) - return child.domBoundsAround(from2, to, pos); - if (end >= from2 && fromI == -1) { - fromI = i; - fromStart = pos; - } - if (pos > to && child.dom.parentNode == this.dom) { - toI = i; - toEnd = prevEnd; - break; - } - prevEnd = end; - pos = end + child.breakAfter; - } - return { - from: fromStart, - to: toEnd < 0 ? offset + this.length : toEnd, - startDOM: (fromI ? this.children[fromI - 1].dom.nextSibling : null) || this.dom.firstChild, - endDOM: toI < this.children.length && toI >= 0 ? this.children[toI].dom : null - }; - } - markDirty(andParent = false) { - this.dirty |= 2; - this.markParentsDirty(andParent); - } - markParentsDirty(childList) { - for (let parent = this.parent; parent; parent = parent.parent) { - if (childList) - parent.dirty |= 2; - if (parent.dirty & 1) - return; - parent.dirty |= 1; - childList = false; - } - } - setParent(parent) { - if (this.parent != parent) { - this.parent = parent; - if (this.dirty) - this.markParentsDirty(true); - } - } - setDOM(dom) { - if (this.dom) - this.dom.cmView = null; - this.dom = dom; - dom.cmView = this; - } - get rootView() { - for (let v = this; ; ) { - let parent = v.parent; - if (!parent) - return v; - v = parent; - } - } - replaceChildren(from2, to, children = noChildren3) { - this.markDirty(); - for (let i = from2; i < to; i++) { - let child = this.children[i]; - if (child.parent == this) - child.destroy(); - } - this.children.splice(from2, to - from2, ...children); - for (let i = 0; i < children.length; i++) - children[i].setParent(this); - } - ignoreMutation(_rec) { - return false; - } - ignoreEvent(_event) { - return false; - } - childCursor(pos = this.length) { - return new ChildCursor3(this.children, pos, this.children.length); - } - childPos(pos, bias = 1) { - return this.childCursor().findPos(pos, bias); - } - toString() { - let name3 = this.constructor.name.replace("View", ""); - return name3 + (this.children.length ? "(" + this.children.join() + ")" : this.length ? "[" + (name3 == "Text" ? this.text : this.length) + "]" : "") + (this.breakAfter ? "#" : ""); - } - static get(node) { - return node.cmView; - } - get isEditable() { - return true; - } - merge(from2, to, source, hasStart, openStart, openEnd) { - return false; - } - become(other) { - return false; - } - getSide() { - return 0; - } - destroy() { - this.parent = null; - } - }; - ContentView3.prototype.breakAfter = 0; - function rm$12(dom) { - let next = dom.nextSibling; - dom.parentNode.removeChild(dom); - return next; - } - var ChildCursor3 = class { - constructor(children, pos, i) { - this.children = children; - this.pos = pos; - this.i = i; - this.off = 0; - } - findPos(pos, bias = 1) { - for (; ; ) { - if (pos > this.pos || pos == this.pos && (bias > 0 || this.i == 0 || this.children[this.i - 1].breakAfter)) { - this.off = pos - this.pos; - return this; - } - let next = this.children[--this.i]; - this.pos -= next.length + next.breakAfter; - } - } - }; - function replaceRange3(parent, fromI, fromOff, toI, toOff, insert4, breakAtStart, openStart, openEnd) { - let { children } = parent; - let before = children.length ? children[fromI] : null; - let last = insert4.length ? insert4[insert4.length - 1] : null; - let breakAtEnd = last ? last.breakAfter : breakAtStart; - if (fromI == toI && before && !breakAtStart && !breakAtEnd && insert4.length < 2 && before.merge(fromOff, toOff, insert4.length ? last : null, fromOff == 0, openStart, openEnd)) - return; - if (toI < children.length) { - let after = children[toI]; - if (after && toOff < after.length) { - if (fromI == toI) { - after = after.split(toOff); - toOff = 0; - } - if (!breakAtEnd && last && after.merge(0, toOff, last, true, 0, openEnd)) { - insert4[insert4.length - 1] = after; - } else { - if (toOff) - after.merge(0, toOff, null, false, 0, openEnd); - insert4.push(after); - } - } else if (after === null || after === void 0 ? void 0 : after.breakAfter) { - if (last) - last.breakAfter = 1; - else - breakAtStart = 1; - } - toI++; - } - if (before) { - before.breakAfter = breakAtStart; - if (fromOff > 0) { - if (!breakAtStart && insert4.length && before.merge(fromOff, before.length, insert4[0], false, openStart, 0)) { - before.breakAfter = insert4.shift().breakAfter; - } else if (fromOff < before.length || before.children.length && before.children[before.children.length - 1].length == 0) { - before.merge(fromOff, before.length, null, false, openStart, 0); - } - fromI++; - } - } - while (fromI < toI && insert4.length) { - if (children[toI - 1].become(insert4[insert4.length - 1])) { - toI--; - insert4.pop(); - openEnd = insert4.length ? 0 : openStart; - } else if (children[fromI].become(insert4[0])) { - fromI++; - insert4.shift(); - openStart = insert4.length ? 0 : openEnd; - } else { - break; - } - } - if (!insert4.length && fromI && toI < children.length && !children[fromI - 1].breakAfter && children[toI].merge(0, 0, children[fromI - 1], false, openStart, openEnd)) - fromI--; - if (fromI < toI || insert4.length) - parent.replaceChildren(fromI, toI, insert4); - } - function mergeChildrenInto3(parent, from2, to, insert4, openStart, openEnd) { - let cur2 = parent.childCursor(); - let { i: toI, off: toOff } = cur2.findPos(to, 1); - let { i: fromI, off: fromOff } = cur2.findPos(from2, -1); - let dLen = from2 - to; - for (let view of insert4) - dLen += view.length; - parent.length += dLen; - replaceRange3(parent, fromI, fromOff, toI, toOff, insert4, 0, openStart, openEnd); - } - var nav3 = typeof navigator != "undefined" ? navigator : { userAgent: "", vendor: "", platform: "" }; - var doc3 = typeof document != "undefined" ? document : { documentElement: { style: {} } }; - var ie_edge3 = /* @__PURE__ */ /Edge\/(\d+)/.exec(nav3.userAgent); - var ie_upto103 = /* @__PURE__ */ /MSIE \d/.test(nav3.userAgent); - var ie_11up3 = /* @__PURE__ */ /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(nav3.userAgent); - var ie4 = !!(ie_upto103 || ie_11up3 || ie_edge3); - var gecko4 = !ie4 && /* @__PURE__ */ /gecko\/(\d+)/i.test(nav3.userAgent); - var chrome4 = !ie4 && /* @__PURE__ */ /Chrome\/(\d+)/.exec(nav3.userAgent); - var webkit3 = "webkitFontSmoothing" in doc3.documentElement.style; - var safari4 = !ie4 && /* @__PURE__ */ /Apple Computer/.test(nav3.vendor); - var ios4 = safari4 && (/* @__PURE__ */ /Mobile\/\w+/.test(nav3.userAgent) || nav3.maxTouchPoints > 2); - var browser3 = { - mac: ios4 || /* @__PURE__ */ /Mac/.test(nav3.platform), - windows: /* @__PURE__ */ /Win/.test(nav3.platform), - linux: /* @__PURE__ */ /Linux|X11/.test(nav3.platform), - ie: ie4, - ie_version: ie_upto103 ? doc3.documentMode || 6 : ie_11up3 ? +ie_11up3[1] : ie_edge3 ? +ie_edge3[1] : 0, - gecko: gecko4, - gecko_version: gecko4 ? +(/* @__PURE__ */ /Firefox\/(\d+)/.exec(nav3.userAgent) || [0, 0])[1] : 0, - chrome: !!chrome4, - chrome_version: chrome4 ? +chrome4[1] : 0, - ios: ios4, - android: /* @__PURE__ */ /Android\b/.test(nav3.userAgent), - webkit: webkit3, - safari: safari4, - webkit_version: webkit3 ? +(/* @__PURE__ */ /\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0, - tabSize: doc3.documentElement.style.tabSize != null ? "tab-size" : "-moz-tab-size" - }; - var MaxJoinLen3 = 256; - var TextView3 = class extends ContentView3 { - constructor(text) { - super(); - this.text = text; - } - get length() { - return this.text.length; - } - createDOM(textDOM) { - this.setDOM(textDOM || document.createTextNode(this.text)); - } - sync(track) { - if (!this.dom) - this.createDOM(); - if (this.dom.nodeValue != this.text) { - if (track && track.node == this.dom) - track.written = true; - this.dom.nodeValue = this.text; - } - } - reuseDOM(dom) { - if (dom.nodeType == 3) - this.createDOM(dom); - } - merge(from2, to, source) { - if (source && (!(source instanceof TextView3) || this.length - (to - from2) + source.length > MaxJoinLen3)) - return false; - this.text = this.text.slice(0, from2) + (source ? source.text : "") + this.text.slice(to); - this.markDirty(); - return true; - } - split(from2) { - let result = new TextView3(this.text.slice(from2)); - this.text = this.text.slice(0, from2); - this.markDirty(); - return result; - } - localPosFromDOM(node, offset) { - return node == this.dom ? offset : offset ? this.text.length : 0; - } - domAtPos(pos) { - return new DOMPos3(this.dom, pos); - } - domBoundsAround(_from, _to, offset) { - return { from: offset, to: offset + this.length, startDOM: this.dom, endDOM: this.dom.nextSibling }; - } - coordsAt(pos, side) { - return textCoords3(this.dom, pos, side); - } - }; - var MarkView3 = class extends ContentView3 { - constructor(mark, children = [], length = 0) { - super(); - this.mark = mark; - this.children = children; - this.length = length; - for (let ch of children) - ch.setParent(this); - } - setAttrs(dom) { - clearAttributes3(dom); - if (this.mark.class) - dom.className = this.mark.class; - if (this.mark.attrs) - for (let name3 in this.mark.attrs) - dom.setAttribute(name3, this.mark.attrs[name3]); - return dom; - } - reuseDOM(node) { - if (node.nodeName == this.mark.tagName.toUpperCase()) { - this.setDOM(node); - this.dirty |= 4 | 2; - } - } - sync(track) { - if (!this.dom) - this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))); - else if (this.dirty & 4) - this.setAttrs(this.dom); - super.sync(track); - } - merge(from2, to, source, _hasStart, openStart, openEnd) { - if (source && (!(source instanceof MarkView3 && source.mark.eq(this.mark)) || from2 && openStart <= 0 || to < this.length && openEnd <= 0)) - return false; - mergeChildrenInto3(this, from2, to, source ? source.children : [], openStart - 1, openEnd - 1); - this.markDirty(); - return true; - } - split(from2) { - let result = [], off = 0, detachFrom = -1, i = 0; - for (let elt of this.children) { - let end = off + elt.length; - if (end > from2) - result.push(off < from2 ? elt.split(from2 - off) : elt); - if (detachFrom < 0 && off >= from2) - detachFrom = i; - off = end; - i++; - } - let length = this.length - from2; - this.length = from2; - if (detachFrom > -1) { - this.children.length = detachFrom; - this.markDirty(); - } - return new MarkView3(this.mark, result, length); - } - domAtPos(pos) { - return inlineDOMAtPos3(this.dom, this.children, pos); - } - coordsAt(pos, side) { - return coordsInChildren3(this, pos, side); - } - }; - function textCoords3(text, pos, side) { - let length = text.nodeValue.length; - if (pos > length) - pos = length; - let from2 = pos, to = pos, flatten4 = 0; - if (pos == 0 && side < 0 || pos == length && side >= 0) { - if (!(browser3.chrome || browser3.gecko)) { - if (pos) { - from2--; - flatten4 = 1; - } else { - to++; - flatten4 = -1; - } - } - } else { - if (side < 0) - from2--; - else - to++; - } - let rects = textRange3(text, from2, to).getClientRects(); - if (!rects.length) - return Rect03; - let rect = rects[(flatten4 ? flatten4 < 0 : side >= 0) ? 0 : rects.length - 1]; - if (browser3.safari && !flatten4 && rect.width == 0) - rect = Array.prototype.find.call(rects, (r) => r.width) || rect; - return flatten4 ? flattenRect3(rect, flatten4 < 0) : rect || null; - } - var WidgetView3 = class extends ContentView3 { - constructor(widget, length, side) { - super(); - this.widget = widget; - this.length = length; - this.side = side; - this.prevWidget = null; - } - static create(widget, length, side) { - return new (widget.customView || WidgetView3)(widget, length, side); - } - split(from2) { - let result = WidgetView3.create(this.widget, this.length - from2, this.side); - this.length -= from2; - return result; - } - sync() { - if (!this.dom || !this.widget.updateDOM(this.dom)) { - if (this.dom && this.prevWidget) - this.prevWidget.destroy(this.dom); - this.prevWidget = null; - this.setDOM(this.widget.toDOM(this.editorView)); - this.dom.contentEditable = "false"; - } - } - getSide() { - return this.side; - } - merge(from2, to, source, hasStart, openStart, openEnd) { - if (source && (!(source instanceof WidgetView3) || !this.widget.compare(source.widget) || from2 > 0 && openStart <= 0 || to < this.length && openEnd <= 0)) - return false; - this.length = from2 + (source ? source.length : 0) + (this.length - to); - return true; - } - become(other) { - if (other.length == this.length && other instanceof WidgetView3 && other.side == this.side) { - if (this.widget.constructor == other.widget.constructor) { - if (!this.widget.eq(other.widget)) - this.markDirty(true); - if (this.dom && !this.prevWidget) - this.prevWidget = this.widget; - this.widget = other.widget; - return true; - } - } - return false; - } - ignoreMutation() { - return true; - } - ignoreEvent(event) { - return this.widget.ignoreEvent(event); - } - get overrideDOMText() { - if (this.length == 0) - return Text3.empty; - let top2 = this; - while (top2.parent) - top2 = top2.parent; - let view = top2.editorView, text = view && view.state.doc, start = this.posAtStart; - return text ? text.slice(start, start + this.length) : Text3.empty; - } - domAtPos(pos) { - return pos == 0 ? DOMPos3.before(this.dom) : DOMPos3.after(this.dom, pos == this.length); - } - domBoundsAround() { - return null; - } - coordsAt(pos, side) { - let rects = this.dom.getClientRects(), rect = null; - if (!rects.length) - return Rect03; - for (let i = pos > 0 ? rects.length - 1 : 0; ; i += pos > 0 ? -1 : 1) { - rect = rects[i]; - if (pos > 0 ? i == 0 : i == rects.length - 1 || rect.top < rect.bottom) - break; - } - return pos == 0 && side > 0 || pos == this.length && side <= 0 ? rect : flattenRect3(rect, pos == 0); - } - get isEditable() { - return false; - } - destroy() { - super.destroy(); - if (this.dom) - this.widget.destroy(this.dom); - } - }; - var CompositionView3 = class extends WidgetView3 { - domAtPos(pos) { - let { topView, text } = this.widget; - if (!topView) - return new DOMPos3(text, Math.min(pos, text.nodeValue.length)); - return scanCompositionTree3(pos, 0, topView, text, (v, p) => v.domAtPos(p), (p) => new DOMPos3(text, Math.min(p, text.nodeValue.length))); - } - sync() { - this.setDOM(this.widget.toDOM()); - } - localPosFromDOM(node, offset) { - let { topView, text } = this.widget; - if (!topView) - return Math.min(offset, this.length); - return posFromDOMInCompositionTree3(node, offset, topView, text); - } - ignoreMutation() { - return false; - } - get overrideDOMText() { - return null; - } - coordsAt(pos, side) { - let { topView, text } = this.widget; - if (!topView) - return textCoords3(text, pos, side); - return scanCompositionTree3(pos, side, topView, text, (v, pos2, side2) => v.coordsAt(pos2, side2), (pos2, side2) => textCoords3(text, pos2, side2)); - } - destroy() { - var _a4; - super.destroy(); - (_a4 = this.widget.topView) === null || _a4 === void 0 ? void 0 : _a4.destroy(); - } - get isEditable() { - return true; - } - }; - function scanCompositionTree3(pos, side, view, text, enterView, fromText) { - if (view instanceof MarkView3) { - for (let child of view.children) { - let hasComp = contains3(child.dom, text); - let len = hasComp ? text.nodeValue.length : child.length; - if (pos < len || pos == len && child.getSide() <= 0) - return hasComp ? scanCompositionTree3(pos, side, child, text, enterView, fromText) : enterView(child, pos, side); - pos -= len; - } - return enterView(view, view.length, -1); - } else if (view.dom == text) { - return fromText(pos, side); - } else { - return enterView(view, pos, side); - } - } - function posFromDOMInCompositionTree3(node, offset, view, text) { - if (view instanceof MarkView3) { - for (let child of view.children) { - let pos = 0, hasComp = contains3(child.dom, text); - if (contains3(child.dom, node)) - return pos + (hasComp ? posFromDOMInCompositionTree3(node, offset, child, text) : child.localPosFromDOM(node, offset)); - pos += hasComp ? text.nodeValue.length : child.length; - } - } else if (view.dom == text) { - return Math.min(offset, text.nodeValue.length); - } - return view.localPosFromDOM(node, offset); - } - var WidgetBufferView3 = class extends ContentView3 { - constructor(side) { - super(); - this.side = side; - } - get length() { - return 0; - } - merge() { - return false; - } - become(other) { - return other instanceof WidgetBufferView3 && other.side == this.side; - } - split() { - return new WidgetBufferView3(this.side); - } - sync() { - if (!this.dom) { - let dom = document.createElement("img"); - dom.className = "cm-widgetBuffer"; - dom.setAttribute("aria-hidden", "true"); - this.setDOM(dom); - } - } - getSide() { - return this.side; - } - domAtPos(pos) { - return DOMPos3.before(this.dom); - } - localPosFromDOM() { - return 0; - } - domBoundsAround() { - return null; - } - coordsAt(pos) { - let imgRect = this.dom.getBoundingClientRect(); - let siblingRect = inlineSiblingRect3(this, this.side > 0 ? -1 : 1); - return siblingRect && siblingRect.top < imgRect.bottom && siblingRect.bottom > imgRect.top ? { left: imgRect.left, right: imgRect.right, top: siblingRect.top, bottom: siblingRect.bottom } : imgRect; - } - get overrideDOMText() { - return Text3.empty; - } - }; - TextView3.prototype.children = WidgetView3.prototype.children = WidgetBufferView3.prototype.children = noChildren3; - function inlineSiblingRect3(view, side) { - let parent = view.parent, index = parent ? parent.children.indexOf(view) : -1; - while (parent && index >= 0) { - if (side < 0 ? index > 0 : index < parent.children.length) { - let next = parent.children[index + side]; - if (next instanceof TextView3) { - let nextRect = next.coordsAt(side < 0 ? next.length : 0, side); - if (nextRect) - return nextRect; - } - index += side; - } else if (parent instanceof MarkView3 && parent.parent) { - index = parent.parent.children.indexOf(parent) + (side < 0 ? 0 : 1); - parent = parent.parent; - } else { - let last = parent.dom.lastChild; - if (last && last.nodeName == "BR") - return last.getClientRects()[0]; - break; - } - } - return void 0; - } - function inlineDOMAtPos3(dom, children, pos) { - let i = 0; - for (let off = 0; i < children.length; i++) { - let child = children[i], end = off + child.length; - if (end == off && child.getSide() <= 0) - continue; - if (pos > off && pos < end && child.dom.parentNode == dom) - return child.domAtPos(pos - off); - if (pos <= off) - break; - off = end; - } - for (; i > 0; i--) { - let before = children[i - 1].dom; - if (before.parentNode == dom) - return DOMPos3.after(before); - } - return new DOMPos3(dom, 0); - } - function joinInlineInto3(parent, view, open) { - let last, { children } = parent; - if (open > 0 && view instanceof MarkView3 && children.length && (last = children[children.length - 1]) instanceof MarkView3 && last.mark.eq(view.mark)) { - joinInlineInto3(last, view.children[0], open - 1); - } else { - children.push(view); - view.setParent(parent); - } - parent.length += view.length; - } - function coordsInChildren3(view, pos, side) { - for (let off = 0, i = 0; i < view.children.length; i++) { - let child = view.children[i], end = off + child.length, next; - if ((side <= 0 || end == view.length || child.getSide() > 0 ? end >= pos : end > pos) && (pos < end || i + 1 == view.children.length || (next = view.children[i + 1]).length || next.getSide() > 0)) { - let flatten4 = 0; - if (end == off) { - if (child.getSide() <= 0) - continue; - flatten4 = side = -child.getSide(); - } - let rect = child.coordsAt(Math.max(0, pos - off), side); - return flatten4 && rect ? flattenRect3(rect, side < 0) : rect; - } - off = end; - } - let last = view.dom.lastChild; - if (!last) - return view.dom.getBoundingClientRect(); - let rects = clientRectsFor3(last); - return rects[rects.length - 1] || null; - } - function combineAttrs3(source, target) { - for (let name3 in source) { - if (name3 == "class" && target.class) - target.class += " " + source.class; - else if (name3 == "style" && target.style) - target.style += ";" + source.style; - else - target[name3] = source[name3]; - } - return target; - } - function attrsEq3(a, b) { - if (a == b) - return true; - if (!a || !b) - return false; - let keysA = Object.keys(a), keysB = Object.keys(b); - if (keysA.length != keysB.length) - return false; - for (let key of keysA) { - if (keysB.indexOf(key) == -1 || a[key] !== b[key]) - return false; - } - return true; - } - function updateAttrs3(dom, prev, attrs) { - if (prev) { - for (let name3 in prev) - if (!(attrs && name3 in attrs)) - dom.removeAttribute(name3); - } - if (attrs) { - for (let name3 in attrs) - if (!(prev && prev[name3] == attrs[name3])) - dom.setAttribute(name3, attrs[name3]); - } - } - var WidgetType3 = class { - eq(widget) { - return false; - } - updateDOM(dom) { - return false; - } - compare(other) { - return this == other || this.constructor == other.constructor && this.eq(other); - } - get estimatedHeight() { - return -1; - } - ignoreEvent(event) { - return true; - } - get customView() { - return null; - } - destroy(dom) { - } - }; - var BlockType3 = /* @__PURE__ */ function(BlockType4) { - BlockType4[BlockType4["Text"] = 0] = "Text"; - BlockType4[BlockType4["WidgetBefore"] = 1] = "WidgetBefore"; - BlockType4[BlockType4["WidgetAfter"] = 2] = "WidgetAfter"; - BlockType4[BlockType4["WidgetRange"] = 3] = "WidgetRange"; - return BlockType4; - }(BlockType3 || (BlockType3 = {})); - var Decoration3 = class extends RangeValue3 { - constructor(startSide, endSide, widget, spec) { - super(); - this.startSide = startSide; - this.endSide = endSide; - this.widget = widget; - this.spec = spec; - } - get heightRelevant() { - return false; - } - static mark(spec) { - return new MarkDecoration3(spec); - } - static widget(spec) { - let side = spec.side || 0, block = !!spec.block; - side += block ? side > 0 ? 3e8 : -4e8 : side > 0 ? 1e8 : -1e8; - return new PointDecoration3(spec, side, side, block, spec.widget || null, false); - } - static replace(spec) { - let block = !!spec.block, startSide, endSide; - if (spec.isBlockGap) { - startSide = -5e8; - endSide = 4e8; - } else { - let { start, end } = getInclusive3(spec, block); - startSide = (start ? block ? -3e8 : -1 : 5e8) - 1; - endSide = (end ? block ? 2e8 : 1 : -6e8) + 1; - } - return new PointDecoration3(spec, startSide, endSide, block, spec.widget || null, true); - } - static line(spec) { - return new LineDecoration3(spec); - } - static set(of, sort = false) { - return RangeSet3.of(of, sort); - } - hasHeight() { - return this.widget ? this.widget.estimatedHeight > -1 : false; - } - }; - Decoration3.none = RangeSet3.empty; - var MarkDecoration3 = class extends Decoration3 { - constructor(spec) { - let { start, end } = getInclusive3(spec); - super(start ? -1 : 5e8, end ? 1 : -6e8, null, spec); - this.tagName = spec.tagName || "span"; - this.class = spec.class || ""; - this.attrs = spec.attributes || null; - } - eq(other) { - return this == other || other instanceof MarkDecoration3 && this.tagName == other.tagName && this.class == other.class && attrsEq3(this.attrs, other.attrs); - } - range(from2, to = from2) { - if (from2 >= to) - throw new RangeError("Mark decorations may not be empty"); - return super.range(from2, to); - } - }; - MarkDecoration3.prototype.point = false; - var LineDecoration3 = class extends Decoration3 { - constructor(spec) { - super(-2e8, -2e8, null, spec); - } - eq(other) { - return other instanceof LineDecoration3 && attrsEq3(this.spec.attributes, other.spec.attributes); - } - range(from2, to = from2) { - if (to != from2) - throw new RangeError("Line decoration ranges must be zero-length"); - return super.range(from2, to); - } - }; - LineDecoration3.prototype.mapMode = MapMode3.TrackBefore; - LineDecoration3.prototype.point = true; - var PointDecoration3 = class extends Decoration3 { - constructor(spec, startSide, endSide, block, widget, isReplace) { - super(startSide, endSide, widget, spec); - this.block = block; - this.isReplace = isReplace; - this.mapMode = !block ? MapMode3.TrackDel : startSide <= 0 ? MapMode3.TrackBefore : MapMode3.TrackAfter; - } - get type() { - return this.startSide < this.endSide ? BlockType3.WidgetRange : this.startSide <= 0 ? BlockType3.WidgetBefore : BlockType3.WidgetAfter; - } - get heightRelevant() { - return this.block || !!this.widget && this.widget.estimatedHeight >= 5; - } - eq(other) { - return other instanceof PointDecoration3 && widgetsEq3(this.widget, other.widget) && this.block == other.block && this.startSide == other.startSide && this.endSide == other.endSide; - } - range(from2, to = from2) { - if (this.isReplace && (from2 > to || from2 == to && this.startSide > 0 && this.endSide <= 0)) - throw new RangeError("Invalid range for replacement decoration"); - if (!this.isReplace && to != from2) - throw new RangeError("Widget decorations can only have zero-length ranges"); - return super.range(from2, to); - } - }; - PointDecoration3.prototype.point = true; - function getInclusive3(spec, block = false) { - let { inclusiveStart: start, inclusiveEnd: end } = spec; - if (start == null) - start = spec.inclusive; - if (end == null) - end = spec.inclusive; - return { start: start !== null && start !== void 0 ? start : block, end: end !== null && end !== void 0 ? end : block }; - } - function widgetsEq3(a, b) { - return a == b || !!(a && b && a.compare(b)); - } - function addRange3(from2, to, ranges, margin = 0) { - let last = ranges.length - 1; - if (last >= 0 && ranges[last] + margin >= from2) - ranges[last] = Math.max(ranges[last], to); - else - ranges.push(from2, to); - } - var LineView3 = class extends ContentView3 { - constructor() { - super(...arguments); - this.children = []; - this.length = 0; - this.prevAttrs = void 0; - this.attrs = null; - this.breakAfter = 0; - } - merge(from2, to, source, hasStart, openStart, openEnd) { - if (source) { - if (!(source instanceof LineView3)) - return false; - if (!this.dom) - source.transferDOM(this); - } - if (hasStart) - this.setDeco(source ? source.attrs : null); - mergeChildrenInto3(this, from2, to, source ? source.children : [], openStart, openEnd); - return true; - } - split(at) { - let end = new LineView3(); - end.breakAfter = this.breakAfter; - if (this.length == 0) - return end; - let { i, off } = this.childPos(at); - if (off) { - end.append(this.children[i].split(off), 0); - this.children[i].merge(off, this.children[i].length, null, false, 0, 0); - i++; - } - for (let j = i; j < this.children.length; j++) - end.append(this.children[j], 0); - while (i > 0 && this.children[i - 1].length == 0) - this.children[--i].destroy(); - this.children.length = i; - this.markDirty(); - this.length = at; - return end; - } - transferDOM(other) { - if (!this.dom) - return; - other.setDOM(this.dom); - other.prevAttrs = this.prevAttrs === void 0 ? this.attrs : this.prevAttrs; - this.prevAttrs = void 0; - this.dom = null; - } - setDeco(attrs) { - if (!attrsEq3(this.attrs, attrs)) { - if (this.dom) { - this.prevAttrs = this.attrs; - this.markDirty(); - } - this.attrs = attrs; - } - } - append(child, openStart) { - joinInlineInto3(this, child, openStart); - } - addLineDeco(deco) { - let attrs = deco.spec.attributes, cls = deco.spec.class; - if (attrs) - this.attrs = combineAttrs3(attrs, this.attrs || {}); - if (cls) - this.attrs = combineAttrs3({ class: cls }, this.attrs || {}); - } - domAtPos(pos) { - return inlineDOMAtPos3(this.dom, this.children, pos); - } - reuseDOM(node) { - if (node.nodeName == "DIV") { - this.setDOM(node); - this.dirty |= 4 | 2; - } - } - sync(track) { - var _a4; - if (!this.dom) { - this.setDOM(document.createElement("div")); - this.dom.className = "cm-line"; - this.prevAttrs = this.attrs ? null : void 0; - } else if (this.dirty & 4) { - clearAttributes3(this.dom); - this.dom.className = "cm-line"; - this.prevAttrs = this.attrs ? null : void 0; - } - if (this.prevAttrs !== void 0) { - updateAttrs3(this.dom, this.prevAttrs, this.attrs); - this.dom.classList.add("cm-line"); - this.prevAttrs = void 0; - } - super.sync(track); - let last = this.dom.lastChild; - while (last && ContentView3.get(last) instanceof MarkView3) - last = last.lastChild; - if (!last || !this.length || last.nodeName != "BR" && ((_a4 = ContentView3.get(last)) === null || _a4 === void 0 ? void 0 : _a4.isEditable) == false && (!browser3.ios || !this.children.some((ch) => ch instanceof TextView3))) { - let hack = document.createElement("BR"); - hack.cmIgnore = true; - this.dom.appendChild(hack); - } - } - measureTextSize() { - if (this.children.length == 0 || this.length > 20) - return null; - let totalWidth = 0; - for (let child of this.children) { - if (!(child instanceof TextView3)) - return null; - let rects = clientRectsFor3(child.dom); - if (rects.length != 1) - return null; - totalWidth += rects[0].width; - } - return { - lineHeight: this.dom.getBoundingClientRect().height, - charWidth: totalWidth / this.length - }; - } - coordsAt(pos, side) { - return coordsInChildren3(this, pos, side); - } - become(_other) { - return false; - } - get type() { - return BlockType3.Text; - } - static find(docView, pos) { - for (let i = 0, off = 0; i < docView.children.length; i++) { - let block = docView.children[i], end = off + block.length; - if (end >= pos) { - if (block instanceof LineView3) - return block; - if (end > pos) - break; - } - off = end + block.breakAfter; - } - return null; - } - }; - var BlockWidgetView3 = class extends ContentView3 { - constructor(widget, length, type) { - super(); - this.widget = widget; - this.length = length; - this.type = type; - this.breakAfter = 0; - this.prevWidget = null; - } - merge(from2, to, source, _takeDeco, openStart, openEnd) { - if (source && (!(source instanceof BlockWidgetView3) || !this.widget.compare(source.widget) || from2 > 0 && openStart <= 0 || to < this.length && openEnd <= 0)) - return false; - this.length = from2 + (source ? source.length : 0) + (this.length - to); - return true; - } - domAtPos(pos) { - return pos == 0 ? DOMPos3.before(this.dom) : DOMPos3.after(this.dom, pos == this.length); - } - split(at) { - let len = this.length - at; - this.length = at; - let end = new BlockWidgetView3(this.widget, len, this.type); - end.breakAfter = this.breakAfter; - return end; - } - get children() { - return noChildren3; - } - sync() { - if (!this.dom || !this.widget.updateDOM(this.dom)) { - if (this.dom && this.prevWidget) - this.prevWidget.destroy(this.dom); - this.prevWidget = null; - this.setDOM(this.widget.toDOM(this.editorView)); - this.dom.contentEditable = "false"; - } - } - get overrideDOMText() { - return this.parent ? this.parent.view.state.doc.slice(this.posAtStart, this.posAtEnd) : Text3.empty; - } - domBoundsAround() { - return null; - } - become(other) { - if (other instanceof BlockWidgetView3 && other.type == this.type && other.widget.constructor == this.widget.constructor) { - if (!other.widget.eq(this.widget)) - this.markDirty(true); - if (this.dom && !this.prevWidget) - this.prevWidget = this.widget; - this.widget = other.widget; - this.length = other.length; - this.breakAfter = other.breakAfter; - return true; - } - return false; - } - ignoreMutation() { - return true; - } - ignoreEvent(event) { - return this.widget.ignoreEvent(event); - } - destroy() { - super.destroy(); - if (this.dom) - this.widget.destroy(this.dom); - } - }; - var ContentBuilder3 = class { - constructor(doc4, pos, end, disallowBlockEffectsFor) { - this.doc = doc4; - this.pos = pos; - this.end = end; - this.disallowBlockEffectsFor = disallowBlockEffectsFor; - this.content = []; - this.curLine = null; - this.breakAtStart = 0; - this.pendingBuffer = 0; - this.atCursorPos = true; - this.openStart = -1; - this.openEnd = -1; - this.text = ""; - this.textOff = 0; - this.cursor = doc4.iter(); - this.skip = pos; - } - posCovered() { - if (this.content.length == 0) - return !this.breakAtStart && this.doc.lineAt(this.pos).from != this.pos; - let last = this.content[this.content.length - 1]; - return !last.breakAfter && !(last instanceof BlockWidgetView3 && last.type == BlockType3.WidgetBefore); - } - getLine() { - if (!this.curLine) { - this.content.push(this.curLine = new LineView3()); - this.atCursorPos = true; - } - return this.curLine; - } - flushBuffer(active) { - if (this.pendingBuffer) { - this.curLine.append(wrapMarks3(new WidgetBufferView3(-1), active), active.length); - this.pendingBuffer = 0; - } - } - addBlockWidget(view) { - this.flushBuffer([]); - this.curLine = null; - this.content.push(view); - } - finish(openEnd) { - if (!openEnd) - this.flushBuffer([]); - else - this.pendingBuffer = 0; - if (!this.posCovered()) - this.getLine(); - } - buildText(length, active, openStart) { - while (length > 0) { - if (this.textOff == this.text.length) { - let { value, lineBreak, done } = this.cursor.next(this.skip); - this.skip = 0; - if (done) - throw new Error("Ran out of text content when drawing inline views"); - if (lineBreak) { - if (!this.posCovered()) - this.getLine(); - if (this.content.length) - this.content[this.content.length - 1].breakAfter = 1; - else - this.breakAtStart = 1; - this.flushBuffer([]); - this.curLine = null; - length--; - continue; - } else { - this.text = value; - this.textOff = 0; - } - } - let take = Math.min(this.text.length - this.textOff, length, 512); - this.flushBuffer(active.slice(0, openStart)); - this.getLine().append(wrapMarks3(new TextView3(this.text.slice(this.textOff, this.textOff + take)), active), openStart); - this.atCursorPos = true; - this.textOff += take; - length -= take; - openStart = 0; - } - } - span(from2, to, active, openStart) { - this.buildText(to - from2, active, openStart); - this.pos = to; - if (this.openStart < 0) - this.openStart = openStart; - } - point(from2, to, deco, active, openStart, index) { - if (this.disallowBlockEffectsFor[index] && deco instanceof PointDecoration3) { - if (deco.block) - throw new RangeError("Block decorations may not be specified via plugins"); - if (to > this.doc.lineAt(this.pos).to) - throw new RangeError("Decorations that replace line breaks may not be specified via plugins"); - } - let len = to - from2; - if (deco instanceof PointDecoration3) { - if (deco.block) { - let { type } = deco; - if (type == BlockType3.WidgetAfter && !this.posCovered()) - this.getLine(); - this.addBlockWidget(new BlockWidgetView3(deco.widget || new NullWidget3("div"), len, type)); - } else { - let view = WidgetView3.create(deco.widget || new NullWidget3("span"), len, deco.startSide); - let cursorBefore = this.atCursorPos && !view.isEditable && openStart <= active.length && (from2 < to || deco.startSide > 0); - let cursorAfter = !view.isEditable && (from2 < to || deco.startSide <= 0); - let line = this.getLine(); - if (this.pendingBuffer == 2 && !cursorBefore) - this.pendingBuffer = 0; - this.flushBuffer(active); - if (cursorBefore) { - line.append(wrapMarks3(new WidgetBufferView3(1), active), openStart); - openStart = active.length + Math.max(0, openStart - active.length); - } - line.append(wrapMarks3(view, active), openStart); - this.atCursorPos = cursorAfter; - this.pendingBuffer = !cursorAfter ? 0 : from2 < to ? 1 : 2; - } - } else if (this.doc.lineAt(this.pos).from == this.pos) { - this.getLine().addLineDeco(deco); - } - if (len) { - if (this.textOff + len <= this.text.length) { - this.textOff += len; - } else { - this.skip += len - (this.text.length - this.textOff); - this.text = ""; - this.textOff = 0; - } - this.pos = to; - } - if (this.openStart < 0) - this.openStart = openStart; - } - static build(text, from2, to, decorations4, dynamicDecorationMap) { - let builder = new ContentBuilder3(text, from2, to, dynamicDecorationMap); - builder.openEnd = RangeSet3.spans(decorations4, from2, to, builder); - if (builder.openStart < 0) - builder.openStart = builder.openEnd; - builder.finish(builder.openEnd); - return builder; - } - }; - function wrapMarks3(view, active) { - for (let mark of active) - view = new MarkView3(mark, [view], view.length); - return view; - } - var NullWidget3 = class extends WidgetType3 { - constructor(tag) { - super(); - this.tag = tag; - } - eq(other) { - return other.tag == this.tag; - } - toDOM() { - return document.createElement(this.tag); - } - updateDOM(elt) { - return elt.nodeName.toLowerCase() == this.tag; - } - }; - var none8 = []; - var clickAddsSelectionRange3 = /* @__PURE__ */ Facet3.define(); - var dragMovesSelection$13 = /* @__PURE__ */ Facet3.define(); - var mouseSelectionStyle3 = /* @__PURE__ */ Facet3.define(); - var exceptionSink3 = /* @__PURE__ */ Facet3.define(); - var updateListener3 = /* @__PURE__ */ Facet3.define(); - var inputHandler4 = /* @__PURE__ */ Facet3.define(); - var perLineTextDirection2 = /* @__PURE__ */ Facet3.define({ - combine: (values2) => values2.some((x) => x) - }); - var ScrollTarget3 = class { - constructor(range, y = "nearest", x = "nearest", yMargin = 5, xMargin = 5) { - this.range = range; - this.y = y; - this.x = x; - this.yMargin = yMargin; - this.xMargin = xMargin; - } - map(changes) { - return changes.empty ? this : new ScrollTarget3(this.range.map(changes), this.y, this.x, this.yMargin, this.xMargin); - } - }; - var scrollIntoView4 = /* @__PURE__ */ StateEffect3.define({ map: (t3, ch) => t3.map(ch) }); - function logException3(state, exception, context) { - let handler = state.facet(exceptionSink3); - if (handler.length) - handler[0](exception); - else if (window.onerror) - window.onerror(String(exception), context, void 0, void 0, exception); - else if (context) - console.error(context + ":", exception); - else - console.error(exception); - } - var editable3 = /* @__PURE__ */ Facet3.define({ combine: (values2) => values2.length ? values2[0] : true }); - var nextPluginID3 = 0; - var viewPlugin3 = /* @__PURE__ */ Facet3.define(); - var ViewPlugin3 = class { - constructor(id3, create, domEventHandlers2, buildExtensions) { - this.id = id3; - this.create = create; - this.domEventHandlers = domEventHandlers2; - this.extension = buildExtensions(this); - } - static define(create, spec) { - const { eventHandlers, provide, decorations: deco } = spec || {}; - return new ViewPlugin3(nextPluginID3++, create, eventHandlers, (plugin) => { - let ext = [viewPlugin3.of(plugin)]; - if (deco) - ext.push(decorations3.of((view) => { - let pluginInst = view.plugin(plugin); - return pluginInst ? deco(pluginInst) : Decoration3.none; - })); - if (provide) - ext.push(provide(plugin)); - return ext; - }); - } - static fromClass(cls, spec) { - return ViewPlugin3.define((view) => new cls(view), spec); - } - }; - var PluginInstance3 = class { - constructor(spec) { - this.spec = spec; - this.mustUpdate = null; - this.value = null; - } - update(view) { - if (!this.value) { - if (this.spec) { - try { - this.value = this.spec.create(view); - } catch (e) { - logException3(view.state, e, "CodeMirror plugin crashed"); - this.deactivate(); - } - } - } else if (this.mustUpdate) { - let update = this.mustUpdate; - this.mustUpdate = null; - if (this.value.update) { - try { - this.value.update(update); - } catch (e) { - logException3(update.state, e, "CodeMirror plugin crashed"); - if (this.value.destroy) - try { - this.value.destroy(); - } catch (_) { - } - this.deactivate(); - } - } - } - return this; - } - destroy(view) { - var _a4; - if ((_a4 = this.value) === null || _a4 === void 0 ? void 0 : _a4.destroy) { - try { - this.value.destroy(); - } catch (e) { - logException3(view.state, e, "CodeMirror plugin crashed"); - } - } - } - deactivate() { - this.spec = this.value = null; - } - }; - var editorAttributes3 = /* @__PURE__ */ Facet3.define(); - var contentAttributes3 = /* @__PURE__ */ Facet3.define(); - var decorations3 = /* @__PURE__ */ Facet3.define(); - var atomicRanges2 = /* @__PURE__ */ Facet3.define(); - var scrollMargins2 = /* @__PURE__ */ Facet3.define(); - var styleModule3 = /* @__PURE__ */ Facet3.define(); - var ChangedRange3 = class { - constructor(fromA, toA, fromB, toB) { - this.fromA = fromA; - this.toA = toA; - this.fromB = fromB; - this.toB = toB; - } - join(other) { - return new ChangedRange3(Math.min(this.fromA, other.fromA), Math.max(this.toA, other.toA), Math.min(this.fromB, other.fromB), Math.max(this.toB, other.toB)); - } - addToSet(set) { - let i = set.length, me = this; - for (; i > 0; i--) { - let range = set[i - 1]; - if (range.fromA > me.toA) - continue; - if (range.toA < me.fromA) - break; - me = me.join(range); - set.splice(i - 1, 1); - } - set.splice(i, 0, me); - return set; - } - static extendWithRanges(diff, ranges) { - if (ranges.length == 0) - return diff; - let result = []; - for (let dI = 0, rI = 0, posA = 0, posB = 0; ; dI++) { - let next = dI == diff.length ? null : diff[dI], off = posA - posB; - let end = next ? next.fromB : 1e9; - while (rI < ranges.length && ranges[rI] < end) { - let from2 = ranges[rI], to = ranges[rI + 1]; - let fromB = Math.max(posB, from2), toB = Math.min(end, to); - if (fromB <= toB) - new ChangedRange3(fromB + off, toB + off, fromB, toB).addToSet(result); - if (to > end) - break; - else - rI += 2; - } - if (!next) - return result; - new ChangedRange3(next.fromA, next.toA, next.fromB, next.toB).addToSet(result); - posA = next.toA; - posB = next.toB; - } - } - }; - var ViewUpdate3 = class { - constructor(view, state, transactions = none8) { - this.view = view; - this.state = state; - this.transactions = transactions; - this.flags = 0; - this.startState = view.state; - this.changes = ChangeSet3.empty(this.startState.doc.length); - for (let tr of transactions) - this.changes = this.changes.compose(tr.changes); - let changedRanges = []; - this.changes.iterChangedRanges((fromA, toA, fromB, toB) => changedRanges.push(new ChangedRange3(fromA, toA, fromB, toB))); - this.changedRanges = changedRanges; - let focus = view.hasFocus; - if (focus != view.inputState.notifiedFocused) { - view.inputState.notifiedFocused = focus; - this.flags |= 1; - } - } - get viewportChanged() { - return (this.flags & 4) > 0; - } - get heightChanged() { - return (this.flags & 2) > 0; - } - get geometryChanged() { - return this.docChanged || (this.flags & (8 | 2)) > 0; - } - get focusChanged() { - return (this.flags & 1) > 0; - } - get docChanged() { - return !this.changes.empty; - } - get selectionSet() { - return this.transactions.some((tr) => tr.selection); - } - get empty() { - return this.flags == 0 && this.transactions.length == 0; - } - }; - var Direction3 = /* @__PURE__ */ function(Direction4) { - Direction4[Direction4["LTR"] = 0] = "LTR"; - Direction4[Direction4["RTL"] = 1] = "RTL"; - return Direction4; - }(Direction3 || (Direction3 = {})); - var LTR3 = Direction3.LTR; - var RTL3 = Direction3.RTL; - function dec3(str) { - let result = []; - for (let i = 0; i < str.length; i++) - result.push(1 << +str[i]); - return result; - } - var LowTypes3 = /* @__PURE__ */ dec3("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"); - var ArabicTypes3 = /* @__PURE__ */ dec3("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"); - var Brackets3 = /* @__PURE__ */ Object.create(null); - var BracketStack3 = []; - for (let p of ["()", "[]", "{}"]) { - let l = /* @__PURE__ */ p.charCodeAt(0), r = /* @__PURE__ */ p.charCodeAt(1); - Brackets3[l] = r; - Brackets3[r] = -l; - } - function charType3(ch) { - return ch <= 247 ? LowTypes3[ch] : 1424 <= ch && ch <= 1524 ? 2 : 1536 <= ch && ch <= 1785 ? ArabicTypes3[ch - 1536] : 1774 <= ch && ch <= 2220 ? 4 : 8192 <= ch && ch <= 8203 ? 256 : ch == 8204 ? 256 : 1; - } - var BidiRE3 = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; - var BidiSpan3 = class { - constructor(from2, to, level) { - this.from = from2; - this.to = to; - this.level = level; - } - get dir() { - return this.level % 2 ? RTL3 : LTR3; - } - side(end, dir) { - return this.dir == dir == end ? this.to : this.from; - } - static find(order, index, level, assoc) { - let maybe = -1; - for (let i = 0; i < order.length; i++) { - let span2 = order[i]; - if (span2.from <= index && span2.to >= index) { - if (span2.level == level) - return i; - if (maybe < 0 || (assoc != 0 ? assoc < 0 ? span2.from < index : span2.to > index : order[maybe].level > span2.level)) - maybe = i; - } - } - if (maybe < 0) - throw new RangeError("Index out of range"); - return maybe; - } - }; - var types3 = []; - function computeOrder3(line, direction) { - let len = line.length, outerType = direction == LTR3 ? 1 : 2, oppositeType = direction == LTR3 ? 2 : 1; - if (!line || outerType == 1 && !BidiRE3.test(line)) - return trivialOrder3(len); - for (let i = 0, prev = outerType, prevStrong = outerType; i < len; i++) { - let type = charType3(line.charCodeAt(i)); - if (type == 512) - type = prev; - else if (type == 8 && prevStrong == 4) - type = 16; - types3[i] = type == 4 ? 2 : type; - if (type & 7) - prevStrong = type; - prev = type; - } - for (let i = 0, prev = outerType, prevStrong = outerType; i < len; i++) { - let type = types3[i]; - if (type == 128) { - if (i < len - 1 && prev == types3[i + 1] && prev & 24) - type = types3[i] = prev; - else - types3[i] = 256; - } else if (type == 64) { - let end = i + 1; - while (end < len && types3[end] == 64) - end++; - let replace = i && prev == 8 || end < len && types3[end] == 8 ? prevStrong == 1 ? 1 : 8 : 256; - for (let j = i; j < end; j++) - types3[j] = replace; - i = end - 1; - } else if (type == 8 && prevStrong == 1) { - types3[i] = 1; - } - prev = type; - if (type & 7) - prevStrong = type; - } - for (let i = 0, sI = 0, context = 0, ch, br, type; i < len; i++) { - if (br = Brackets3[ch = line.charCodeAt(i)]) { - if (br < 0) { - for (let sJ = sI - 3; sJ >= 0; sJ -= 3) { - if (BracketStack3[sJ + 1] == -br) { - let flags = BracketStack3[sJ + 2]; - let type2 = flags & 2 ? outerType : !(flags & 4) ? 0 : flags & 1 ? oppositeType : outerType; - if (type2) - types3[i] = types3[BracketStack3[sJ]] = type2; - sI = sJ; - break; - } - } - } else if (BracketStack3.length == 189) { - break; - } else { - BracketStack3[sI++] = i; - BracketStack3[sI++] = ch; - BracketStack3[sI++] = context; - } - } else if ((type = types3[i]) == 2 || type == 1) { - let embed = type == outerType; - context = embed ? 0 : 1; - for (let sJ = sI - 3; sJ >= 0; sJ -= 3) { - let cur2 = BracketStack3[sJ + 2]; - if (cur2 & 2) - break; - if (embed) { - BracketStack3[sJ + 2] |= 2; - } else { - if (cur2 & 4) - break; - BracketStack3[sJ + 2] |= 4; - } - } - } - } - for (let i = 0; i < len; i++) { - if (types3[i] == 256) { - let end = i + 1; - while (end < len && types3[end] == 256) - end++; - let beforeL = (i ? types3[i - 1] : outerType) == 1; - let afterL = (end < len ? types3[end] : outerType) == 1; - let replace = beforeL == afterL ? beforeL ? 1 : 2 : outerType; - for (let j = i; j < end; j++) - types3[j] = replace; - i = end - 1; - } - } - let order = []; - if (outerType == 1) { - for (let i = 0; i < len; ) { - let start = i, rtl = types3[i++] != 1; - while (i < len && rtl == (types3[i] != 1)) - i++; - if (rtl) { - for (let j = i; j > start; ) { - let end = j, l = types3[--j] != 2; - while (j > start && l == (types3[j - 1] != 2)) - j--; - order.push(new BidiSpan3(j, end, l ? 2 : 1)); - } - } else { - order.push(new BidiSpan3(start, i, 0)); - } - } - } else { - for (let i = 0; i < len; ) { - let start = i, rtl = types3[i++] == 2; - while (i < len && rtl == (types3[i] == 2)) - i++; - order.push(new BidiSpan3(start, i, rtl ? 1 : 2)); - } - } - return order; - } - function trivialOrder3(length) { - return [new BidiSpan3(0, length, 0)]; - } - var movedOver3 = ""; - function moveVisually3(line, order, dir, start, forward) { - var _a4; - let startIndex = start.head - line.from, spanI = -1; - if (startIndex == 0) { - if (!forward || !line.length) - return null; - if (order[0].level != dir) { - startIndex = order[0].side(false, dir); - spanI = 0; - } - } else if (startIndex == line.length) { - if (forward) - return null; - let last = order[order.length - 1]; - if (last.level != dir) { - startIndex = last.side(true, dir); - spanI = order.length - 1; - } - } - if (spanI < 0) - spanI = BidiSpan3.find(order, startIndex, (_a4 = start.bidiLevel) !== null && _a4 !== void 0 ? _a4 : -1, start.assoc); - let span2 = order[spanI]; - if (startIndex == span2.side(forward, dir)) { - span2 = order[spanI += forward ? 1 : -1]; - startIndex = span2.side(!forward, dir); - } - let indexForward = forward == (span2.dir == dir); - let nextIndex = findClusterBreak3(line.text, startIndex, indexForward); - movedOver3 = line.text.slice(Math.min(startIndex, nextIndex), Math.max(startIndex, nextIndex)); - if (nextIndex != span2.side(forward, dir)) - return EditorSelection3.cursor(nextIndex + line.from, indexForward ? -1 : 1, span2.level); - let nextSpan = spanI == (forward ? order.length - 1 : 0) ? null : order[spanI + (forward ? 1 : -1)]; - if (!nextSpan && span2.level != dir) - return EditorSelection3.cursor(forward ? line.to : line.from, forward ? -1 : 1, dir); - if (nextSpan && nextSpan.level < span2.level) - return EditorSelection3.cursor(nextSpan.side(!forward, dir) + line.from, forward ? 1 : -1, nextSpan.level); - return EditorSelection3.cursor(nextIndex + line.from, forward ? -1 : 1, span2.level); - } - var LineBreakPlaceholder3 = "\uFFFF"; - var DOMReader3 = class { - constructor(points, state) { - this.points = points; - this.text = ""; - this.lineSeparator = state.facet(EditorState3.lineSeparator); - } - append(text) { - this.text += text; - } - lineBreak() { - this.text += LineBreakPlaceholder3; - } - readRange(start, end) { - if (!start) - return this; - let parent = start.parentNode; - for (let cur2 = start; ; ) { - this.findPointBefore(parent, cur2); - this.readNode(cur2); - let next = cur2.nextSibling; - if (next == end) - break; - let view = ContentView3.get(cur2), nextView = ContentView3.get(next); - if (view && nextView ? view.breakAfter : (view ? view.breakAfter : isBlockElement3(cur2)) || isBlockElement3(next) && (cur2.nodeName != "BR" || cur2.cmIgnore)) - this.lineBreak(); - cur2 = next; - } - this.findPointBefore(parent, end); - return this; - } - readTextNode(node) { - let text = node.nodeValue; - for (let point of this.points) - if (point.node == node) - point.pos = this.text.length + Math.min(point.offset, text.length); - for (let off = 0, re = this.lineSeparator ? null : /\r\n?|\n/g; ; ) { - let nextBreak = -1, breakSize = 1, m; - if (this.lineSeparator) { - nextBreak = text.indexOf(this.lineSeparator, off); - breakSize = this.lineSeparator.length; - } else if (m = re.exec(text)) { - nextBreak = m.index; - breakSize = m[0].length; - } - this.append(text.slice(off, nextBreak < 0 ? text.length : nextBreak)); - if (nextBreak < 0) - break; - this.lineBreak(); - if (breakSize > 1) { - for (let point of this.points) - if (point.node == node && point.pos > this.text.length) - point.pos -= breakSize - 1; - } - off = nextBreak + breakSize; - } - } - readNode(node) { - if (node.cmIgnore) - return; - let view = ContentView3.get(node); - let fromView = view && view.overrideDOMText; - if (fromView != null) { - this.findPointInside(node, fromView.length); - for (let i = fromView.iter(); !i.next().done; ) { - if (i.lineBreak) - this.lineBreak(); - else - this.append(i.value); - } - } else if (node.nodeType == 3) { - this.readTextNode(node); - } else if (node.nodeName == "BR") { - if (node.nextSibling) - this.lineBreak(); - } else if (node.nodeType == 1) { - this.readRange(node.firstChild, null); - } - } - findPointBefore(node, next) { - for (let point of this.points) - if (point.node == node && node.childNodes[point.offset] == next) - point.pos = this.text.length; - } - findPointInside(node, maxLen) { - for (let point of this.points) - if (node.nodeType == 3 ? point.node == node : node.contains(point.node)) - point.pos = this.text.length + Math.min(maxLen, point.offset); - } - }; - function isBlockElement3(node) { - return node.nodeType == 1 && /^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(node.nodeName); - } - var DOMPoint3 = class { - constructor(node, offset) { - this.node = node; - this.offset = offset; - this.pos = -1; - } - }; - var DocView3 = class extends ContentView3 { - constructor(view) { - super(); - this.view = view; - this.compositionDeco = Decoration3.none; - this.decorations = []; - this.dynamicDecorationMap = []; - this.minWidth = 0; - this.minWidthFrom = 0; - this.minWidthTo = 0; - this.impreciseAnchor = null; - this.impreciseHead = null; - this.forceSelection = false; - this.lastUpdate = Date.now(); - this.setDOM(view.contentDOM); - this.children = [new LineView3()]; - this.children[0].setParent(this); - this.updateDeco(); - this.updateInner([new ChangedRange3(0, 0, 0, view.state.doc.length)], 0); - } - get root() { - return this.view.root; - } - get editorView() { - return this.view; - } - get length() { - return this.view.state.doc.length; - } - update(update) { - let changedRanges = update.changedRanges; - if (this.minWidth > 0 && changedRanges.length) { - if (!changedRanges.every(({ fromA, toA }) => toA < this.minWidthFrom || fromA > this.minWidthTo)) { - this.minWidth = this.minWidthFrom = this.minWidthTo = 0; - } else { - this.minWidthFrom = update.changes.mapPos(this.minWidthFrom, 1); - this.minWidthTo = update.changes.mapPos(this.minWidthTo, 1); - } - } - if (this.view.inputState.composing < 0) - this.compositionDeco = Decoration3.none; - else if (update.transactions.length || this.dirty) - this.compositionDeco = computeCompositionDeco3(this.view, update.changes); - if ((browser3.ie || browser3.chrome) && !this.compositionDeco.size && update && update.state.doc.lines != update.startState.doc.lines) - this.forceSelection = true; - let prevDeco = this.decorations, deco = this.updateDeco(); - let decoDiff = findChangedDeco3(prevDeco, deco, update.changes); - changedRanges = ChangedRange3.extendWithRanges(changedRanges, decoDiff); - if (this.dirty == 0 && changedRanges.length == 0) { - return false; - } else { - this.updateInner(changedRanges, update.startState.doc.length); - if (update.transactions.length) - this.lastUpdate = Date.now(); - return true; - } - } - updateInner(changes, oldLength) { - this.view.viewState.mustMeasureContent = true; - this.updateChildren(changes, oldLength); - let { observer } = this.view; - observer.ignore(() => { - this.dom.style.height = this.view.viewState.contentHeight + "px"; - this.dom.style.minWidth = this.minWidth ? this.minWidth + "px" : ""; - let track = browser3.chrome || browser3.ios ? { node: observer.selectionRange.focusNode, written: false } : void 0; - this.sync(track); - this.dirty = 0; - if (track && (track.written || observer.selectionRange.focusNode != track.node)) - this.forceSelection = true; - this.dom.style.height = ""; - }); - let gaps = []; - if (this.view.viewport.from || this.view.viewport.to < this.view.state.doc.length) { - for (let child of this.children) - if (child instanceof BlockWidgetView3 && child.widget instanceof BlockGapWidget3) - gaps.push(child.dom); - } - observer.updateGaps(gaps); - } - updateChildren(changes, oldLength) { - let cursor = this.childCursor(oldLength); - for (let i = changes.length - 1; ; i--) { - let next = i >= 0 ? changes[i] : null; - if (!next) - break; - let { fromA, toA, fromB, toB } = next; - let { content: content3, breakAtStart, openStart, openEnd } = ContentBuilder3.build(this.view.state.doc, fromB, toB, this.decorations, this.dynamicDecorationMap); - let { i: toI, off: toOff } = cursor.findPos(toA, 1); - let { i: fromI, off: fromOff } = cursor.findPos(fromA, -1); - replaceRange3(this, fromI, fromOff, toI, toOff, content3, breakAtStart, openStart, openEnd); - } - } - updateSelection(mustRead = false, fromPointer = false) { - if (mustRead) - this.view.observer.readSelectionRange(); - if (!(fromPointer || this.mayControlSelection()) || browser3.ios && this.view.inputState.rapidCompositionStart) - return; - let force = this.forceSelection; - this.forceSelection = false; - let main = this.view.state.selection.main; - let anchor = this.domAtPos(main.anchor); - let head = main.empty ? anchor : this.domAtPos(main.head); - if (browser3.gecko && main.empty && betweenUneditable3(anchor)) { - let dummy = document.createTextNode(""); - this.view.observer.ignore(() => anchor.node.insertBefore(dummy, anchor.node.childNodes[anchor.offset] || null)); - anchor = head = new DOMPos3(dummy, 0); - force = true; - } - let domSel = this.view.observer.selectionRange; - if (force || !domSel.focusNode || !isEquivalentPosition3(anchor.node, anchor.offset, domSel.anchorNode, domSel.anchorOffset) || !isEquivalentPosition3(head.node, head.offset, domSel.focusNode, domSel.focusOffset)) { - this.view.observer.ignore(() => { - if (browser3.android && browser3.chrome && this.dom.contains(domSel.focusNode) && inUneditable3(domSel.focusNode, this.dom)) { - this.dom.blur(); - this.dom.focus({ preventScroll: true }); - } - let rawSel = getSelection3(this.root); - if (main.empty) { - if (browser3.gecko) { - let nextTo = nextToUneditable3(anchor.node, anchor.offset); - if (nextTo && nextTo != (1 | 2)) { - let text = nearbyTextNode3(anchor.node, anchor.offset, nextTo == 1 ? 1 : -1); - if (text) - anchor = new DOMPos3(text, nextTo == 1 ? 0 : text.nodeValue.length); - } - } - rawSel.collapse(anchor.node, anchor.offset); - if (main.bidiLevel != null && domSel.cursorBidiLevel != null) - domSel.cursorBidiLevel = main.bidiLevel; - } else if (rawSel.extend) { - rawSel.collapse(anchor.node, anchor.offset); - rawSel.extend(head.node, head.offset); - } else { - let range = document.createRange(); - if (main.anchor > main.head) - [anchor, head] = [head, anchor]; - range.setEnd(head.node, head.offset); - range.setStart(anchor.node, anchor.offset); - rawSel.removeAllRanges(); - rawSel.addRange(range); - } - }); - this.view.observer.setSelectionRange(anchor, head); - } - this.impreciseAnchor = anchor.precise ? null : new DOMPos3(domSel.anchorNode, domSel.anchorOffset); - this.impreciseHead = head.precise ? null : new DOMPos3(domSel.focusNode, domSel.focusOffset); - } - enforceCursorAssoc() { - if (this.compositionDeco.size) - return; - let cursor = this.view.state.selection.main; - let sel = getSelection3(this.root); - if (!cursor.empty || !cursor.assoc || !sel.modify) - return; - let line = LineView3.find(this, cursor.head); - if (!line) - return; - let lineStart = line.posAtStart; - if (cursor.head == lineStart || cursor.head == lineStart + line.length) - return; - let before = this.coordsAt(cursor.head, -1), after = this.coordsAt(cursor.head, 1); - if (!before || !after || before.bottom > after.top) - return; - let dom = this.domAtPos(cursor.head + cursor.assoc); - sel.collapse(dom.node, dom.offset); - sel.modify("move", cursor.assoc < 0 ? "forward" : "backward", "lineboundary"); - } - mayControlSelection() { - return this.view.state.facet(editable3) ? this.root.activeElement == this.dom : hasSelection3(this.dom, this.view.observer.selectionRange); - } - nearest(dom) { - for (let cur2 = dom; cur2; ) { - let domView = ContentView3.get(cur2); - if (domView && domView.rootView == this) - return domView; - cur2 = cur2.parentNode; - } - return null; - } - posFromDOM(node, offset) { - let view = this.nearest(node); - if (!view) - throw new RangeError("Trying to find position for a DOM position outside of the document"); - return view.localPosFromDOM(node, offset) + view.posAtStart; - } - domAtPos(pos) { - let { i, off } = this.childCursor().findPos(pos, -1); - for (; i < this.children.length - 1; ) { - let child = this.children[i]; - if (off < child.length || child instanceof LineView3) - break; - i++; - off = 0; - } - return this.children[i].domAtPos(off); - } - coordsAt(pos, side) { - for (let off = this.length, i = this.children.length - 1; ; i--) { - let child = this.children[i], start = off - child.breakAfter - child.length; - if (pos > start || pos == start && child.type != BlockType3.WidgetBefore && child.type != BlockType3.WidgetAfter && (!i || side == 2 || this.children[i - 1].breakAfter || this.children[i - 1].type == BlockType3.WidgetBefore && side > -2)) - return child.coordsAt(pos - start, side); - off = start; - } - } - measureVisibleLineHeights(viewport) { - let result = [], { from: from2, to } = viewport; - let contentWidth = this.view.contentDOM.clientWidth; - let isWider = contentWidth > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1; - let widest = -1, ltr = this.view.textDirection == Direction3.LTR; - for (let pos = 0, i = 0; i < this.children.length; i++) { - let child = this.children[i], end = pos + child.length; - if (end > to) - break; - if (pos >= from2) { - let childRect = child.dom.getBoundingClientRect(); - result.push(childRect.height); - if (isWider) { - let last = child.dom.lastChild; - let rects = last ? clientRectsFor3(last) : []; - if (rects.length) { - let rect = rects[rects.length - 1]; - let width = ltr ? rect.right - childRect.left : childRect.right - rect.left; - if (width > widest) { - widest = width; - this.minWidth = contentWidth; - this.minWidthFrom = pos; - this.minWidthTo = end; - } - } - } - } - pos = end + child.breakAfter; - } - return result; - } - textDirectionAt(pos) { - let { i } = this.childPos(pos, 1); - return getComputedStyle(this.children[i].dom).direction == "rtl" ? Direction3.RTL : Direction3.LTR; - } - measureTextSize() { - for (let child of this.children) { - if (child instanceof LineView3) { - let measure = child.measureTextSize(); - if (measure) - return measure; - } - } - let dummy = document.createElement("div"), lineHeight, charWidth; - dummy.className = "cm-line"; - dummy.textContent = "abc def ghi jkl mno pqr stu"; - this.view.observer.ignore(() => { - this.dom.appendChild(dummy); - let rect = clientRectsFor3(dummy.firstChild)[0]; - lineHeight = dummy.getBoundingClientRect().height; - charWidth = rect ? rect.width / 27 : 7; - dummy.remove(); - }); - return { lineHeight, charWidth }; - } - childCursor(pos = this.length) { - let i = this.children.length; - if (i) - pos -= this.children[--i].length; - return new ChildCursor3(this.children, pos, i); - } - computeBlockGapDeco() { - let deco = [], vs = this.view.viewState; - for (let pos = 0, i = 0; ; i++) { - let next = i == vs.viewports.length ? null : vs.viewports[i]; - let end = next ? next.from - 1 : this.length; - if (end > pos) { - let height = vs.lineBlockAt(end).bottom - vs.lineBlockAt(pos).top; - deco.push(Decoration3.replace({ - widget: new BlockGapWidget3(height), - block: true, - inclusive: true, - isBlockGap: true - }).range(pos, end)); - } - if (!next) - break; - pos = next.to + 1; - } - return Decoration3.set(deco); - } - updateDeco() { - let allDeco = this.view.state.facet(decorations3).map((d, i) => { - let dynamic = this.dynamicDecorationMap[i] = typeof d == "function"; - return dynamic ? d(this.view) : d; - }); - for (let i = allDeco.length; i < allDeco.length + 3; i++) - this.dynamicDecorationMap[i] = false; - return this.decorations = [ - ...allDeco, - this.compositionDeco, - this.computeBlockGapDeco(), - this.view.viewState.lineGapDeco - ]; - } - scrollIntoView(target) { - let { range } = target; - let rect = this.coordsAt(range.head, range.empty ? range.assoc : range.head > range.anchor ? -1 : 1), other; - if (!rect) - return; - if (!range.empty && (other = this.coordsAt(range.anchor, range.anchor > range.head ? -1 : 1))) - rect = { - left: Math.min(rect.left, other.left), - top: Math.min(rect.top, other.top), - right: Math.max(rect.right, other.right), - bottom: Math.max(rect.bottom, other.bottom) - }; - let mLeft = 0, mRight = 0, mTop = 0, mBottom = 0; - for (let margins of this.view.state.facet(scrollMargins2).map((f) => f(this.view))) - if (margins) { - let { left, right, top: top2, bottom } = margins; - if (left != null) - mLeft = Math.max(mLeft, left); - if (right != null) - mRight = Math.max(mRight, right); - if (top2 != null) - mTop = Math.max(mTop, top2); - if (bottom != null) - mBottom = Math.max(mBottom, bottom); - } - let targetRect = { - left: rect.left - mLeft, - top: rect.top - mTop, - right: rect.right + mRight, - bottom: rect.bottom + mBottom - }; - scrollRectIntoView3(this.view.scrollDOM, targetRect, range.head < range.anchor ? -1 : 1, target.x, target.y, target.xMargin, target.yMargin, this.view.textDirection == Direction3.LTR); - } - }; - function betweenUneditable3(pos) { - return pos.node.nodeType == 1 && pos.node.firstChild && (pos.offset == 0 || pos.node.childNodes[pos.offset - 1].contentEditable == "false") && (pos.offset == pos.node.childNodes.length || pos.node.childNodes[pos.offset].contentEditable == "false"); - } - var BlockGapWidget3 = class extends WidgetType3 { - constructor(height) { - super(); - this.height = height; - } - toDOM() { - let elt = document.createElement("div"); - this.updateDOM(elt); - return elt; - } - eq(other) { - return other.height == this.height; - } - updateDOM(elt) { - elt.style.height = this.height + "px"; - return true; - } - get estimatedHeight() { - return this.height; - } - }; - function compositionSurroundingNode3(view) { - let sel = view.observer.selectionRange; - let textNode = sel.focusNode && nearbyTextNode3(sel.focusNode, sel.focusOffset, 0); - if (!textNode) - return null; - let cView = view.docView.nearest(textNode); - if (!cView) - return null; - if (cView instanceof LineView3) { - let topNode = textNode; - while (topNode.parentNode != cView.dom) - topNode = topNode.parentNode; - let prev = topNode.previousSibling; - while (prev && !ContentView3.get(prev)) - prev = prev.previousSibling; - let pos = prev ? ContentView3.get(prev).posAtEnd : cView.posAtStart; - return { from: pos, to: pos, node: topNode, text: textNode }; - } else { - for (; ; ) { - let { parent } = cView; - if (!parent) - return null; - if (parent instanceof LineView3) - break; - cView = parent; - } - let from2 = cView.posAtStart; - return { from: from2, to: from2 + cView.length, node: cView.dom, text: textNode }; - } - } - function computeCompositionDeco3(view, changes) { - let surrounding = compositionSurroundingNode3(view); - if (!surrounding) - return Decoration3.none; - let { from: from2, to, node, text: textNode } = surrounding; - let newFrom = changes.mapPos(from2, 1), newTo = Math.max(newFrom, changes.mapPos(to, -1)); - let { state } = view, text = node.nodeType == 3 ? node.nodeValue : new DOMReader3([], state).readRange(node.firstChild, null).text; - if (newTo - newFrom < text.length) { - if (state.doc.sliceString(newFrom, Math.min(state.doc.length, newFrom + text.length), LineBreakPlaceholder3) == text) - newTo = newFrom + text.length; - else if (state.doc.sliceString(Math.max(0, newTo - text.length), newTo, LineBreakPlaceholder3) == text) - newFrom = newTo - text.length; - else - return Decoration3.none; - } else if (state.doc.sliceString(newFrom, newTo, LineBreakPlaceholder3) != text) { - return Decoration3.none; - } - let topView = ContentView3.get(node); - if (topView instanceof CompositionView3) - topView = topView.widget.topView; - else if (topView) - topView.parent = null; - return Decoration3.set(Decoration3.replace({ widget: new CompositionWidget3(node, textNode, topView), inclusive: true }).range(newFrom, newTo)); - } - var CompositionWidget3 = class extends WidgetType3 { - constructor(top2, text, topView) { - super(); - this.top = top2; - this.text = text; - this.topView = topView; - } - eq(other) { - return this.top == other.top && this.text == other.text; - } - toDOM() { - return this.top; - } - ignoreEvent() { - return false; - } - get customView() { - return CompositionView3; - } - }; - function nearbyTextNode3(node, offset, side) { - for (; ; ) { - if (node.nodeType == 3) - return node; - if (node.nodeType == 1 && offset > 0 && side <= 0) { - node = node.childNodes[offset - 1]; - offset = maxOffset3(node); - } else if (node.nodeType == 1 && offset < node.childNodes.length && side >= 0) { - node = node.childNodes[offset]; - offset = 0; - } else { - return null; - } - } - } - function nextToUneditable3(node, offset) { - if (node.nodeType != 1) - return 0; - return (offset && node.childNodes[offset - 1].contentEditable == "false" ? 1 : 0) | (offset < node.childNodes.length && node.childNodes[offset].contentEditable == "false" ? 2 : 0); - } - var DecorationComparator$13 = class { - constructor() { - this.changes = []; - } - compareRange(from2, to) { - addRange3(from2, to, this.changes); - } - comparePoint(from2, to) { - addRange3(from2, to, this.changes); - } - }; - function findChangedDeco3(a, b, diff) { - let comp = new DecorationComparator$13(); - RangeSet3.compare(a, b, diff, comp); - return comp.changes; - } - function inUneditable3(node, inside4) { - for (let cur2 = node; cur2 && cur2 != inside4; cur2 = cur2.assignedSlot || cur2.parentNode) { - if (cur2.nodeType == 1 && cur2.contentEditable == "false") { - return true; - } - } - return false; - } - function groupAt3(state, pos, bias = 1) { - let categorize = state.charCategorizer(pos); - let line = state.doc.lineAt(pos), linePos = pos - line.from; - if (line.length == 0) - return EditorSelection3.cursor(pos); - if (linePos == 0) - bias = 1; - else if (linePos == line.length) - bias = -1; - let from2 = linePos, to = linePos; - if (bias < 0) - from2 = findClusterBreak3(line.text, linePos, false); - else - to = findClusterBreak3(line.text, linePos); - let cat = categorize(line.text.slice(from2, to)); - while (from2 > 0) { - let prev = findClusterBreak3(line.text, from2, false); - if (categorize(line.text.slice(prev, from2)) != cat) - break; - from2 = prev; - } - while (to < line.length) { - let next = findClusterBreak3(line.text, to); - if (categorize(line.text.slice(to, next)) != cat) - break; - to = next; - } - return EditorSelection3.range(from2 + line.from, to + line.from); - } - function getdx3(x, rect) { - return rect.left > x ? rect.left - x : Math.max(0, x - rect.right); - } - function getdy3(y, rect) { - return rect.top > y ? rect.top - y : Math.max(0, y - rect.bottom); - } - function yOverlap3(a, b) { - return a.top < b.bottom - 1 && a.bottom > b.top + 1; - } - function upTop3(rect, top2) { - return top2 < rect.top ? { top: top2, left: rect.left, right: rect.right, bottom: rect.bottom } : rect; - } - function upBot3(rect, bottom) { - return bottom > rect.bottom ? { top: rect.top, left: rect.left, right: rect.right, bottom } : rect; - } - function domPosAtCoords3(parent, x, y) { - let closest, closestRect, closestX, closestY; - let above, below, aboveRect, belowRect; - for (let child = parent.firstChild; child; child = child.nextSibling) { - let rects = clientRectsFor3(child); - for (let i = 0; i < rects.length; i++) { - let rect = rects[i]; - if (closestRect && yOverlap3(closestRect, rect)) - rect = upTop3(upBot3(rect, closestRect.bottom), closestRect.top); - let dx = getdx3(x, rect), dy = getdy3(y, rect); - if (dx == 0 && dy == 0) - return child.nodeType == 3 ? domPosInText3(child, x, y) : domPosAtCoords3(child, x, y); - if (!closest || closestY > dy || closestY == dy && closestX > dx) { - closest = child; - closestRect = rect; - closestX = dx; - closestY = dy; - } - if (dx == 0) { - if (y > rect.bottom && (!aboveRect || aboveRect.bottom < rect.bottom)) { - above = child; - aboveRect = rect; - } else if (y < rect.top && (!belowRect || belowRect.top > rect.top)) { - below = child; - belowRect = rect; - } - } else if (aboveRect && yOverlap3(aboveRect, rect)) { - aboveRect = upBot3(aboveRect, rect.bottom); - } else if (belowRect && yOverlap3(belowRect, rect)) { - belowRect = upTop3(belowRect, rect.top); - } - } - } - if (aboveRect && aboveRect.bottom >= y) { - closest = above; - closestRect = aboveRect; - } else if (belowRect && belowRect.top <= y) { - closest = below; - closestRect = belowRect; - } - if (!closest) - return { node: parent, offset: 0 }; - let clipX = Math.max(closestRect.left, Math.min(closestRect.right, x)); - if (closest.nodeType == 3) - return domPosInText3(closest, clipX, y); - if (!closestX && closest.contentEditable == "true") - return domPosAtCoords3(closest, clipX, y); - let offset = Array.prototype.indexOf.call(parent.childNodes, closest) + (x >= (closestRect.left + closestRect.right) / 2 ? 1 : 0); - return { node: parent, offset }; - } - function domPosInText3(node, x, y) { - let len = node.nodeValue.length; - let closestOffset = -1, closestDY = 1e9, generalSide = 0; - for (let i = 0; i < len; i++) { - let rects = textRange3(node, i, i + 1).getClientRects(); - for (let j = 0; j < rects.length; j++) { - let rect = rects[j]; - if (rect.top == rect.bottom) - continue; - if (!generalSide) - generalSide = x - rect.left; - let dy = (rect.top > y ? rect.top - y : y - rect.bottom) - 1; - if (rect.left - 1 <= x && rect.right + 1 >= x && dy < closestDY) { - let right = x >= (rect.left + rect.right) / 2, after = right; - if (browser3.chrome || browser3.gecko) { - let rectBefore = textRange3(node, i).getBoundingClientRect(); - if (rectBefore.left == rect.right) - after = !right; - } - if (dy <= 0) - return { node, offset: i + (after ? 1 : 0) }; - closestOffset = i + (after ? 1 : 0); - closestDY = dy; - } - } - } - return { node, offset: closestOffset > -1 ? closestOffset : generalSide > 0 ? node.nodeValue.length : 0 }; - } - function posAtCoords3(view, { x, y }, precise, bias = -1) { - var _a4; - let content3 = view.contentDOM.getBoundingClientRect(), docTop = content3.top + view.viewState.paddingTop; - let block, { docHeight } = view.viewState; - let yOffset = y - docTop; - if (yOffset < 0) - return 0; - if (yOffset > docHeight) - return view.state.doc.length; - for (let halfLine = view.defaultLineHeight / 2, bounced = false; ; ) { - block = view.elementAtHeight(yOffset); - if (block.type == BlockType3.Text) - break; - for (; ; ) { - yOffset = bias > 0 ? block.bottom + halfLine : block.top - halfLine; - if (yOffset >= 0 && yOffset <= docHeight) - break; - if (bounced) - return precise ? null : 0; - bounced = true; - bias = -bias; - } - } - y = docTop + yOffset; - let lineStart = block.from; - if (lineStart < view.viewport.from) - return view.viewport.from == 0 ? 0 : precise ? null : posAtCoordsImprecise3(view, content3, block, x, y); - if (lineStart > view.viewport.to) - return view.viewport.to == view.state.doc.length ? view.state.doc.length : precise ? null : posAtCoordsImprecise3(view, content3, block, x, y); - let doc4 = view.dom.ownerDocument; - let root = view.root.elementFromPoint ? view.root : doc4; - let element = root.elementFromPoint(x, y); - if (element && !view.contentDOM.contains(element)) - element = null; - if (!element) { - x = Math.max(content3.left + 1, Math.min(content3.right - 1, x)); - element = root.elementFromPoint(x, y); - if (element && !view.contentDOM.contains(element)) - element = null; - } - let node, offset = -1; - if (element && ((_a4 = view.docView.nearest(element)) === null || _a4 === void 0 ? void 0 : _a4.isEditable) != false) { - if (doc4.caretPositionFromPoint) { - let pos = doc4.caretPositionFromPoint(x, y); - if (pos) - ({ offsetNode: node, offset } = pos); - } else if (doc4.caretRangeFromPoint) { - let range = doc4.caretRangeFromPoint(x, y); - if (range) { - ({ startContainer: node, startOffset: offset } = range); - if (browser3.safari && isSuspiciousCaretResult3(node, offset, x)) - node = void 0; - } - } - } - if (!node || !view.docView.dom.contains(node)) { - let line = LineView3.find(view.docView, lineStart); - if (!line) - return yOffset > block.top + block.height / 2 ? block.to : block.from; - ({ node, offset } = domPosAtCoords3(line.dom, x, y)); - } - return view.docView.posFromDOM(node, offset); - } - function posAtCoordsImprecise3(view, contentRect, block, x, y) { - let into = Math.round((x - contentRect.left) * view.defaultCharacterWidth); - if (view.lineWrapping && block.height > view.defaultLineHeight * 1.5) { - let line = Math.floor((y - block.top) / view.defaultLineHeight); - into += line * view.viewState.heightOracle.lineLength; - } - let content3 = view.state.sliceDoc(block.from, block.to); - return block.from + findColumn3(content3, into, view.state.tabSize); - } - function isSuspiciousCaretResult3(node, offset, x) { - let len; - if (node.nodeType != 3 || offset != (len = node.nodeValue.length)) - return false; - for (let next = node.nextSibling; next; next = next.nextSibling) - if (next.nodeType != 1 || next.nodeName != "BR") - return false; - return textRange3(node, len - 1, len).getBoundingClientRect().left > x; - } - function moveToLineBoundary3(view, start, forward, includeWrap) { - let line = view.state.doc.lineAt(start.head); - let coords = !includeWrap || !view.lineWrapping ? null : view.coordsAtPos(start.assoc < 0 && start.head > line.from ? start.head - 1 : start.head); - if (coords) { - let editorRect = view.dom.getBoundingClientRect(); - let direction = view.textDirectionAt(line.from); - let pos = view.posAtCoords({ - x: forward == (direction == Direction3.LTR) ? editorRect.right - 1 : editorRect.left + 1, - y: (coords.top + coords.bottom) / 2 - }); - if (pos != null) - return EditorSelection3.cursor(pos, forward ? -1 : 1); - } - let lineView = LineView3.find(view.docView, start.head); - let end = lineView ? forward ? lineView.posAtEnd : lineView.posAtStart : forward ? line.to : line.from; - return EditorSelection3.cursor(end, forward ? -1 : 1); - } - function moveByChar3(view, start, forward, by) { - let line = view.state.doc.lineAt(start.head), spans = view.bidiSpans(line); - let direction = view.textDirectionAt(line.from); - for (let cur2 = start, check = null; ; ) { - let next = moveVisually3(line, spans, direction, cur2, forward), char = movedOver3; - if (!next) { - if (line.number == (forward ? view.state.doc.lines : 1)) - return cur2; - char = "\n"; - line = view.state.doc.line(line.number + (forward ? 1 : -1)); - spans = view.bidiSpans(line); - next = EditorSelection3.cursor(forward ? line.from : line.to); - } - if (!check) { - if (!by) - return next; - check = by(char); - } else if (!check(char)) { - return cur2; - } - cur2 = next; - } - } - function byGroup3(view, pos, start) { - let categorize = view.state.charCategorizer(pos); - let cat = categorize(start); - return (next) => { - let nextCat = categorize(next); - if (cat == CharCategory3.Space) - cat = nextCat; - return cat == nextCat; - }; - } - function moveVertically3(view, start, forward, distance) { - let startPos = start.head, dir = forward ? 1 : -1; - if (startPos == (forward ? view.state.doc.length : 0)) - return EditorSelection3.cursor(startPos, start.assoc); - let goal = start.goalColumn, startY; - let rect = view.contentDOM.getBoundingClientRect(); - let startCoords = view.coordsAtPos(startPos), docTop = view.documentTop; - if (startCoords) { - if (goal == null) - goal = startCoords.left - rect.left; - startY = dir < 0 ? startCoords.top : startCoords.bottom; - } else { - let line = view.viewState.lineBlockAt(startPos); - if (goal == null) - goal = Math.min(rect.right - rect.left, view.defaultCharacterWidth * (startPos - line.from)); - startY = (dir < 0 ? line.top : line.bottom) + docTop; - } - let resolvedGoal = rect.left + goal; - let dist = distance !== null && distance !== void 0 ? distance : view.defaultLineHeight >> 1; - for (let extra = 0; ; extra += 10) { - let curY = startY + (dist + extra) * dir; - let pos = posAtCoords3(view, { x: resolvedGoal, y: curY }, false, dir); - if (curY < rect.top || curY > rect.bottom || (dir < 0 ? pos < startPos : pos > startPos)) - return EditorSelection3.cursor(pos, start.assoc, void 0, goal); - } - } - function skipAtoms3(view, oldPos, pos) { - let atoms = view.state.facet(atomicRanges2).map((f) => f(view)); - for (; ; ) { - let moved = false; - for (let set of atoms) { - set.between(pos.from - 1, pos.from + 1, (from2, to, value) => { - if (pos.from > from2 && pos.from < to) { - pos = oldPos.from > pos.from ? EditorSelection3.cursor(from2, 1) : EditorSelection3.cursor(to, -1); - moved = true; - } - }); - } - if (!moved) - return pos; - } - } - var InputState3 = class { - constructor(view) { - this.lastKeyCode = 0; - this.lastKeyTime = 0; - this.pendingIOSKey = void 0; - this.lastSelectionOrigin = null; - this.lastSelectionTime = 0; - this.lastEscPress = 0; - this.lastContextMenu = 0; - this.scrollHandlers = []; - this.registeredEvents = []; - this.customHandlers = []; - this.composing = -1; - this.compositionFirstChange = null; - this.compositionEndedAt = 0; - this.rapidCompositionStart = false; - this.mouseSelection = null; - for (let type in handlers3) { - let handler = handlers3[type]; - view.contentDOM.addEventListener(type, (event) => { - if (!eventBelongsToEditor3(view, event) || this.ignoreDuringComposition(event)) - return; - if (type == "keydown" && this.keydown(view, event)) - return; - if (this.mustFlushObserver(event)) - view.observer.forceFlush(); - if (this.runCustomHandlers(type, view, event)) - event.preventDefault(); - else - handler(view, event); - }); - this.registeredEvents.push(type); - } - this.notifiedFocused = view.hasFocus; - if (browser3.safari) - view.contentDOM.addEventListener("input", () => null); - } - setSelectionOrigin(origin) { - this.lastSelectionOrigin = origin; - this.lastSelectionTime = Date.now(); - } - ensureHandlers(view, plugins) { - var _a4; - let handlers4; - for (let plugin of plugins) - if (handlers4 = (_a4 = plugin.update(view).spec) === null || _a4 === void 0 ? void 0 : _a4.domEventHandlers) { - this.customHandlers.push({ plugin: plugin.value, handlers: handlers4 }); - for (let type in handlers4) - if (this.registeredEvents.indexOf(type) < 0 && type != "scroll") { - this.registeredEvents.push(type); - view.contentDOM.addEventListener(type, (event) => { - if (!eventBelongsToEditor3(view, event)) - return; - if (this.runCustomHandlers(type, view, event)) - event.preventDefault(); - }); - } - } - } - runCustomHandlers(type, view, event) { - for (let set of this.customHandlers) { - let handler = set.handlers[type]; - if (handler) { - try { - if (handler.call(set.plugin, event, view) || event.defaultPrevented) - return true; - } catch (e) { - logException3(view.state, e); - } - } - } - return false; - } - runScrollHandlers(view, event) { - for (let set of this.customHandlers) { - let handler = set.handlers.scroll; - if (handler) { - try { - handler.call(set.plugin, event, view); - } catch (e) { - logException3(view.state, e); - } - } - } - } - keydown(view, event) { - this.lastKeyCode = event.keyCode; - this.lastKeyTime = Date.now(); - if (event.keyCode == 9 && Date.now() < this.lastEscPress + 2e3) - return true; - if (browser3.android && browser3.chrome && !event.synthetic && (event.keyCode == 13 || event.keyCode == 8)) { - view.observer.delayAndroidKey(event.key, event.keyCode); - return true; - } - let pending; - if (browser3.ios && (pending = PendingKeys3.find((key) => key.keyCode == event.keyCode)) && !(event.ctrlKey || event.altKey || event.metaKey) && !event.synthetic) { - this.pendingIOSKey = pending; - setTimeout(() => this.flushIOSKey(view), 250); - return true; - } - return false; - } - flushIOSKey(view) { - let key = this.pendingIOSKey; - if (!key) - return false; - this.pendingIOSKey = void 0; - return dispatchKey3(view.contentDOM, key.key, key.keyCode); - } - ignoreDuringComposition(event) { - if (!/^key/.test(event.type)) - return false; - if (this.composing > 0) - return true; - if (browser3.safari && Date.now() - this.compositionEndedAt < 100) { - this.compositionEndedAt = 0; - return true; - } - return false; - } - mustFlushObserver(event) { - return event.type == "keydown" && event.keyCode != 229 || event.type == "compositionend" && !browser3.ios; - } - startMouseSelection(mouseSelection) { - if (this.mouseSelection) - this.mouseSelection.destroy(); - this.mouseSelection = mouseSelection; - } - update(update) { - if (this.mouseSelection) - this.mouseSelection.update(update); - if (update.transactions.length) - this.lastKeyCode = this.lastSelectionTime = 0; - } - destroy() { - if (this.mouseSelection) - this.mouseSelection.destroy(); - } - }; - var PendingKeys3 = [ - { key: "Backspace", keyCode: 8, inputType: "deleteContentBackward" }, - { key: "Enter", keyCode: 13, inputType: "insertParagraph" }, - { key: "Delete", keyCode: 46, inputType: "deleteContentForward" } - ]; - var modifierCodes3 = [16, 17, 18, 20, 91, 92, 224, 225]; - var MouseSelection3 = class { - constructor(view, startEvent, style, mustSelect) { - this.view = view; - this.style = style; - this.mustSelect = mustSelect; - this.lastEvent = startEvent; - let doc4 = view.contentDOM.ownerDocument; - doc4.addEventListener("mousemove", this.move = this.move.bind(this)); - doc4.addEventListener("mouseup", this.up = this.up.bind(this)); - this.extend = startEvent.shiftKey; - this.multiple = view.state.facet(EditorState3.allowMultipleSelections) && addsSelectionRange3(view, startEvent); - this.dragMove = dragMovesSelection3(view, startEvent); - this.dragging = isInPrimarySelection3(view, startEvent) && getClickType3(startEvent) == 1 ? null : false; - if (this.dragging === false) { - startEvent.preventDefault(); - this.select(startEvent); - } - } - move(event) { - if (event.buttons == 0) - return this.destroy(); - if (this.dragging !== false) - return; - this.select(this.lastEvent = event); - } - up(event) { - if (this.dragging == null) - this.select(this.lastEvent); - if (!this.dragging) - event.preventDefault(); - this.destroy(); - } - destroy() { - let doc4 = this.view.contentDOM.ownerDocument; - doc4.removeEventListener("mousemove", this.move); - doc4.removeEventListener("mouseup", this.up); - this.view.inputState.mouseSelection = null; - } - select(event) { - let selection = this.style.get(event, this.extend, this.multiple); - if (this.mustSelect || !selection.eq(this.view.state.selection) || selection.main.assoc != this.view.state.selection.main.assoc) - this.view.dispatch({ - selection, - userEvent: "select.pointer", - scrollIntoView: true - }); - this.mustSelect = false; - } - update(update) { - if (update.docChanged && this.dragging) - this.dragging = this.dragging.map(update.changes); - if (this.style.update(update)) - setTimeout(() => this.select(this.lastEvent), 20); - } - }; - function addsSelectionRange3(view, event) { - let facet = view.state.facet(clickAddsSelectionRange3); - return facet.length ? facet[0](event) : browser3.mac ? event.metaKey : event.ctrlKey; - } - function dragMovesSelection3(view, event) { - let facet = view.state.facet(dragMovesSelection$13); - return facet.length ? facet[0](event) : browser3.mac ? !event.altKey : !event.ctrlKey; - } - function isInPrimarySelection3(view, event) { - let { main } = view.state.selection; - if (main.empty) - return false; - let sel = getSelection3(view.root); - if (sel.rangeCount == 0) - return true; - let rects = sel.getRangeAt(0).getClientRects(); - for (let i = 0; i < rects.length; i++) { - let rect = rects[i]; - if (rect.left <= event.clientX && rect.right >= event.clientX && rect.top <= event.clientY && rect.bottom >= event.clientY) - return true; - } - return false; - } - function eventBelongsToEditor3(view, event) { - if (!event.bubbles) - return true; - if (event.defaultPrevented) - return false; - for (let node = event.target, cView; node != view.contentDOM; node = node.parentNode) - if (!node || node.nodeType == 11 || (cView = ContentView3.get(node)) && cView.ignoreEvent(event)) - return false; - return true; - } - var handlers3 = /* @__PURE__ */ Object.create(null); - var brokenClipboardAPI3 = browser3.ie && browser3.ie_version < 15 || browser3.ios && browser3.webkit_version < 604; - function capturePaste3(view) { - let parent = view.dom.parentNode; - if (!parent) - return; - let target = parent.appendChild(document.createElement("textarea")); - target.style.cssText = "position: fixed; left: -10000px; top: 10px"; - target.focus(); - setTimeout(() => { - view.focus(); - target.remove(); - doPaste3(view, target.value); - }, 50); - } - function doPaste3(view, input) { - let { state } = view, changes, i = 1, text = state.toText(input); - let byLine = text.lines == state.selection.ranges.length; - let linewise = lastLinewiseCopy3 != null && state.selection.ranges.every((r) => r.empty) && lastLinewiseCopy3 == text.toString(); - if (linewise) { - let lastLine = -1; - changes = state.changeByRange((range) => { - let line = state.doc.lineAt(range.from); - if (line.from == lastLine) - return { range }; - lastLine = line.from; - let insert4 = state.toText((byLine ? text.line(i++).text : input) + state.lineBreak); - return { - changes: { from: line.from, insert: insert4 }, - range: EditorSelection3.cursor(range.from + insert4.length) - }; - }); - } else if (byLine) { - changes = state.changeByRange((range) => { - let line = text.line(i++); - return { - changes: { from: range.from, to: range.to, insert: line.text }, - range: EditorSelection3.cursor(range.from + line.length) - }; - }); - } else { - changes = state.replaceSelection(text); - } - view.dispatch(changes, { - userEvent: "input.paste", - scrollIntoView: true - }); - } - handlers3.keydown = (view, event) => { - view.inputState.setSelectionOrigin("select"); - if (event.keyCode == 27) - view.inputState.lastEscPress = Date.now(); - else if (modifierCodes3.indexOf(event.keyCode) < 0) - view.inputState.lastEscPress = 0; - }; - var lastTouch3 = 0; - handlers3.touchstart = (view, e) => { - lastTouch3 = Date.now(); - view.inputState.setSelectionOrigin("select.pointer"); - }; - handlers3.touchmove = (view) => { - view.inputState.setSelectionOrigin("select.pointer"); - }; - handlers3.mousedown = (view, event) => { - view.observer.flush(); - if (lastTouch3 > Date.now() - 2e3 && getClickType3(event) == 1) - return; - let style = null; - for (let makeStyle of view.state.facet(mouseSelectionStyle3)) { - style = makeStyle(view, event); - if (style) - break; - } - if (!style && event.button == 0) - style = basicMouseSelection3(view, event); - if (style) { - let mustFocus = view.root.activeElement != view.contentDOM; - if (mustFocus) - view.observer.ignore(() => focusPreventScroll3(view.contentDOM)); - view.inputState.startMouseSelection(new MouseSelection3(view, event, style, mustFocus)); - } - }; - function rangeForClick3(view, pos, bias, type) { - if (type == 1) { - return EditorSelection3.cursor(pos, bias); - } else if (type == 2) { - return groupAt3(view.state, pos, bias); - } else { - let visual = LineView3.find(view.docView, pos), line = view.state.doc.lineAt(visual ? visual.posAtEnd : pos); - let from2 = visual ? visual.posAtStart : line.from, to = visual ? visual.posAtEnd : line.to; - if (to < view.state.doc.length && to == line.to) - to++; - return EditorSelection3.range(from2, to); - } - } - var insideY3 = (y, rect) => y >= rect.top && y <= rect.bottom; - var inside3 = (x, y, rect) => insideY3(y, rect) && x >= rect.left && x <= rect.right; - function findPositionSide3(view, pos, x, y) { - let line = LineView3.find(view.docView, pos); - if (!line) - return 1; - let off = pos - line.posAtStart; - if (off == 0) - return 1; - if (off == line.length) - return -1; - let before = line.coordsAt(off, -1); - if (before && inside3(x, y, before)) - return -1; - let after = line.coordsAt(off, 1); - if (after && inside3(x, y, after)) - return 1; - return before && insideY3(y, before) ? -1 : 1; - } - function queryPos3(view, event) { - let pos = view.posAtCoords({ x: event.clientX, y: event.clientY }, false); - return { pos, bias: findPositionSide3(view, pos, event.clientX, event.clientY) }; - } - var BadMouseDetail3 = browser3.ie && browser3.ie_version <= 11; - var lastMouseDown3 = null; - var lastMouseDownCount3 = 0; - var lastMouseDownTime3 = 0; - function getClickType3(event) { - if (!BadMouseDetail3) - return event.detail; - let last = lastMouseDown3, lastTime = lastMouseDownTime3; - lastMouseDown3 = event; - lastMouseDownTime3 = Date.now(); - return lastMouseDownCount3 = !last || lastTime > Date.now() - 400 && Math.abs(last.clientX - event.clientX) < 2 && Math.abs(last.clientY - event.clientY) < 2 ? (lastMouseDownCount3 + 1) % 3 : 1; - } - function basicMouseSelection3(view, event) { - let start = queryPos3(view, event), type = getClickType3(event); - let startSel = view.state.selection; - let last = start, lastEvent = event; - return { - update(update) { - if (update.docChanged) { - if (start) - start.pos = update.changes.mapPos(start.pos); - startSel = startSel.map(update.changes); - lastEvent = null; - } - }, - get(event2, extend4, multiple) { - let cur2; - if (lastEvent && event2.clientX == lastEvent.clientX && event2.clientY == lastEvent.clientY) - cur2 = last; - else { - cur2 = last = queryPos3(view, event2); - lastEvent = event2; - } - if (!cur2 || !start) - return startSel; - let range = rangeForClick3(view, cur2.pos, cur2.bias, type); - if (start.pos != cur2.pos && !extend4) { - let startRange = rangeForClick3(view, start.pos, start.bias, type); - let from2 = Math.min(startRange.from, range.from), to = Math.max(startRange.to, range.to); - range = from2 < range.from ? EditorSelection3.range(from2, to) : EditorSelection3.range(to, from2); - } - if (extend4) - return startSel.replaceRange(startSel.main.extend(range.from, range.to)); - else if (multiple) - return startSel.addRange(range); - else - return EditorSelection3.create([range]); - } - }; - } - handlers3.dragstart = (view, event) => { - let { selection: { main } } = view.state; - let { mouseSelection } = view.inputState; - if (mouseSelection) - mouseSelection.dragging = main; - if (event.dataTransfer) { - event.dataTransfer.setData("Text", view.state.sliceDoc(main.from, main.to)); - event.dataTransfer.effectAllowed = "copyMove"; - } - }; - function dropText3(view, event, text, direct) { - if (!text) - return; - let dropPos = view.posAtCoords({ x: event.clientX, y: event.clientY }, false); - event.preventDefault(); - let { mouseSelection } = view.inputState; - let del = direct && mouseSelection && mouseSelection.dragging && mouseSelection.dragMove ? { from: mouseSelection.dragging.from, to: mouseSelection.dragging.to } : null; - let ins = { from: dropPos, insert: text }; - let changes = view.state.changes(del ? [del, ins] : ins); - view.focus(); - view.dispatch({ - changes, - selection: { anchor: changes.mapPos(dropPos, -1), head: changes.mapPos(dropPos, 1) }, - userEvent: del ? "move.drop" : "input.drop" - }); - } - handlers3.drop = (view, event) => { - if (!event.dataTransfer) - return; - if (view.state.readOnly) - return event.preventDefault(); - let files = event.dataTransfer.files; - if (files && files.length) { - event.preventDefault(); - let text = Array(files.length), read = 0; - let finishFile = () => { - if (++read == files.length) - dropText3(view, event, text.filter((s) => s != null).join(view.state.lineBreak), false); - }; - for (let i = 0; i < files.length; i++) { - let reader = new FileReader(); - reader.onerror = finishFile; - reader.onload = () => { - if (!/[\x00-\x08\x0e-\x1f]{2}/.test(reader.result)) - text[i] = reader.result; - finishFile(); - }; - reader.readAsText(files[i]); - } - } else { - dropText3(view, event, event.dataTransfer.getData("Text"), true); - } - }; - handlers3.paste = (view, event) => { - if (view.state.readOnly) - return event.preventDefault(); - view.observer.flush(); - let data = brokenClipboardAPI3 ? null : event.clipboardData; - if (data) { - doPaste3(view, data.getData("text/plain")); - event.preventDefault(); - } else { - capturePaste3(view); - } - }; - function captureCopy3(view, text) { - let parent = view.dom.parentNode; - if (!parent) - return; - let target = parent.appendChild(document.createElement("textarea")); - target.style.cssText = "position: fixed; left: -10000px; top: 10px"; - target.value = text; - target.focus(); - target.selectionEnd = text.length; - target.selectionStart = 0; - setTimeout(() => { - target.remove(); - view.focus(); - }, 50); - } - function copiedRange3(state) { - let content3 = [], ranges = [], linewise = false; - for (let range of state.selection.ranges) - if (!range.empty) { - content3.push(state.sliceDoc(range.from, range.to)); - ranges.push(range); - } - if (!content3.length) { - let upto = -1; - for (let { from: from2 } of state.selection.ranges) { - let line = state.doc.lineAt(from2); - if (line.number > upto) { - content3.push(line.text); - ranges.push({ from: line.from, to: Math.min(state.doc.length, line.to + 1) }); - } - upto = line.number; - } - linewise = true; - } - return { text: content3.join(state.lineBreak), ranges, linewise }; - } - var lastLinewiseCopy3 = null; - handlers3.copy = handlers3.cut = (view, event) => { - let { text, ranges, linewise } = copiedRange3(view.state); - if (!text && !linewise) - return; - lastLinewiseCopy3 = linewise ? text : null; - let data = brokenClipboardAPI3 ? null : event.clipboardData; - if (data) { - event.preventDefault(); - data.clearData(); - data.setData("text/plain", text); - } else { - captureCopy3(view, text); - } - if (event.type == "cut" && !view.state.readOnly) - view.dispatch({ - changes: ranges, - scrollIntoView: true, - userEvent: "delete.cut" - }); - }; - handlers3.focus = handlers3.blur = (view) => { - setTimeout(() => { - if (view.hasFocus != view.inputState.notifiedFocused) - view.update([]); - }, 10); - }; - function forceClearComposition3(view, rapid) { - if (view.docView.compositionDeco.size) { - view.inputState.rapidCompositionStart = rapid; - try { - view.update([]); - } finally { - view.inputState.rapidCompositionStart = false; - } - } - } - handlers3.compositionstart = handlers3.compositionupdate = (view) => { - if (view.inputState.compositionFirstChange == null) - view.inputState.compositionFirstChange = true; - if (view.inputState.composing < 0) { - view.inputState.composing = 0; - if (view.docView.compositionDeco.size) { - view.observer.flush(); - forceClearComposition3(view, true); - } - } - }; - handlers3.compositionend = (view) => { - view.inputState.composing = -1; - view.inputState.compositionEndedAt = Date.now(); - view.inputState.compositionFirstChange = null; - setTimeout(() => { - if (view.inputState.composing < 0) - forceClearComposition3(view, false); - }, 50); - }; - handlers3.contextmenu = (view) => { - view.inputState.lastContextMenu = Date.now(); - }; - handlers3.beforeinput = (view, event) => { - var _a4; - let pending; - if (browser3.chrome && browser3.android && (pending = PendingKeys3.find((key) => key.inputType == event.inputType))) { - view.observer.delayAndroidKey(pending.key, pending.keyCode); - if (pending.key == "Backspace" || pending.key == "Delete") { - let startViewHeight = ((_a4 = window.visualViewport) === null || _a4 === void 0 ? void 0 : _a4.height) || 0; - setTimeout(() => { - var _a5; - if ((((_a5 = window.visualViewport) === null || _a5 === void 0 ? void 0 : _a5.height) || 0) > startViewHeight + 10 && view.hasFocus) { - view.contentDOM.blur(); - view.focus(); - } - }, 100); - } - } - }; - var wrappingWhiteSpace3 = ["pre-wrap", "normal", "pre-line", "break-spaces"]; - var HeightOracle3 = class { - constructor() { - this.doc = Text3.empty; - this.lineWrapping = false; - this.heightSamples = {}; - this.lineHeight = 14; - this.charWidth = 7; - this.lineLength = 30; - this.heightChanged = false; - } - heightForGap(from2, to) { - let lines = this.doc.lineAt(to).number - this.doc.lineAt(from2).number + 1; - if (this.lineWrapping) - lines += Math.ceil((to - from2 - lines * this.lineLength * 0.5) / this.lineLength); - return this.lineHeight * lines; - } - heightForLine(length) { - if (!this.lineWrapping) - return this.lineHeight; - let lines = 1 + Math.max(0, Math.ceil((length - this.lineLength) / (this.lineLength - 5))); - return lines * this.lineHeight; - } - setDoc(doc4) { - this.doc = doc4; - return this; - } - mustRefreshForWrapping(whiteSpace) { - return wrappingWhiteSpace3.indexOf(whiteSpace) > -1 != this.lineWrapping; - } - mustRefreshForHeights(lineHeights) { - let newHeight = false; - for (let i = 0; i < lineHeights.length; i++) { - let h = lineHeights[i]; - if (h < 0) { - i++; - } else if (!this.heightSamples[Math.floor(h * 10)]) { - newHeight = true; - this.heightSamples[Math.floor(h * 10)] = true; - } - } - return newHeight; - } - refresh(whiteSpace, lineHeight, charWidth, lineLength, knownHeights) { - let lineWrapping = wrappingWhiteSpace3.indexOf(whiteSpace) > -1; - let changed = Math.round(lineHeight) != Math.round(this.lineHeight) || this.lineWrapping != lineWrapping; - this.lineWrapping = lineWrapping; - this.lineHeight = lineHeight; - this.charWidth = charWidth; - this.lineLength = lineLength; - if (changed) { - this.heightSamples = {}; - for (let i = 0; i < knownHeights.length; i++) { - let h = knownHeights[i]; - if (h < 0) - i++; - else - this.heightSamples[Math.floor(h * 10)] = true; - } - } - return changed; - } - }; - var MeasuredHeights3 = class { - constructor(from2, heights) { - this.from = from2; - this.heights = heights; - this.index = 0; - } - get more() { - return this.index < this.heights.length; - } - }; - var BlockInfo3 = class { - constructor(from2, length, top2, height, type) { - this.from = from2; - this.length = length; - this.top = top2; - this.height = height; - this.type = type; - } - get to() { - return this.from + this.length; - } - get bottom() { - return this.top + this.height; - } - join(other) { - let detail = (Array.isArray(this.type) ? this.type : [this]).concat(Array.isArray(other.type) ? other.type : [other]); - return new BlockInfo3(this.from, this.length + other.length, this.top, this.height + other.height, detail); - } - }; - var QueryType4 = /* @__PURE__ */ function(QueryType5) { - QueryType5[QueryType5["ByPos"] = 0] = "ByPos"; - QueryType5[QueryType5["ByHeight"] = 1] = "ByHeight"; - QueryType5[QueryType5["ByPosNoHeight"] = 2] = "ByPosNoHeight"; - return QueryType5; - }(QueryType4 || (QueryType4 = {})); - var Epsilon3 = 1e-3; - var HeightMap3 = class { - constructor(length, height, flags = 2) { - this.length = length; - this.height = height; - this.flags = flags; - } - get outdated() { - return (this.flags & 2) > 0; - } - set outdated(value) { - this.flags = (value ? 2 : 0) | this.flags & ~2; - } - setHeight(oracle, height) { - if (this.height != height) { - if (Math.abs(this.height - height) > Epsilon3) - oracle.heightChanged = true; - this.height = height; - } - } - replace(_from, _to, nodes) { - return HeightMap3.of(nodes); - } - decomposeLeft(_to, result) { - result.push(this); - } - decomposeRight(_from, result) { - result.push(this); - } - applyChanges(decorations4, oldDoc, oracle, changes) { - let me = this; - for (let i = changes.length - 1; i >= 0; i--) { - let { fromA, toA, fromB, toB } = changes[i]; - let start = me.lineAt(fromA, QueryType4.ByPosNoHeight, oldDoc, 0, 0); - let end = start.to >= toA ? start : me.lineAt(toA, QueryType4.ByPosNoHeight, oldDoc, 0, 0); - toB += end.to - toA; - toA = end.to; - while (i > 0 && start.from <= changes[i - 1].toA) { - fromA = changes[i - 1].fromA; - fromB = changes[i - 1].fromB; - i--; - if (fromA < start.from) - start = me.lineAt(fromA, QueryType4.ByPosNoHeight, oldDoc, 0, 0); - } - fromB += start.from - fromA; - fromA = start.from; - let nodes = NodeBuilder3.build(oracle, decorations4, fromB, toB); - me = me.replace(fromA, toA, nodes); - } - return me.updateHeight(oracle, 0); - } - static empty() { - return new HeightMapText3(0, 0); - } - static of(nodes) { - if (nodes.length == 1) - return nodes[0]; - let i = 0, j = nodes.length, before = 0, after = 0; - for (; ; ) { - if (i == j) { - if (before > after * 2) { - let split = nodes[i - 1]; - if (split.break) - nodes.splice(--i, 1, split.left, null, split.right); - else - nodes.splice(--i, 1, split.left, split.right); - j += 1 + split.break; - before -= split.size; - } else if (after > before * 2) { - let split = nodes[j]; - if (split.break) - nodes.splice(j, 1, split.left, null, split.right); - else - nodes.splice(j, 1, split.left, split.right); - j += 2 + split.break; - after -= split.size; - } else { - break; - } - } else if (before < after) { - let next = nodes[i++]; - if (next) - before += next.size; - } else { - let next = nodes[--j]; - if (next) - after += next.size; - } - } - let brk = 0; - if (nodes[i - 1] == null) { - brk = 1; - i--; - } else if (nodes[i] == null) { - brk = 1; - j++; - } - return new HeightMapBranch3(HeightMap3.of(nodes.slice(0, i)), brk, HeightMap3.of(nodes.slice(j))); - } - }; - HeightMap3.prototype.size = 1; - var HeightMapBlock3 = class extends HeightMap3 { - constructor(length, height, type) { - super(length, height); - this.type = type; - } - blockAt(_height, _doc, top2, offset) { - return new BlockInfo3(offset, this.length, top2, this.height, this.type); - } - lineAt(_value, _type, doc4, top2, offset) { - return this.blockAt(0, doc4, top2, offset); - } - forEachLine(from2, to, doc4, top2, offset, f) { - if (from2 <= offset + this.length && to >= offset) - f(this.blockAt(0, doc4, top2, offset)); - } - updateHeight(oracle, offset = 0, _force = false, measured) { - if (measured && measured.from <= offset && measured.more) - this.setHeight(oracle, measured.heights[measured.index++]); - this.outdated = false; - return this; - } - toString() { - return `block(${this.length})`; - } - }; - var HeightMapText3 = class extends HeightMapBlock3 { - constructor(length, height) { - super(length, height, BlockType3.Text); - this.collapsed = 0; - this.widgetHeight = 0; - } - replace(_from, _to, nodes) { - let node = nodes[0]; - if (nodes.length == 1 && (node instanceof HeightMapText3 || node instanceof HeightMapGap3 && node.flags & 4) && Math.abs(this.length - node.length) < 10) { - if (node instanceof HeightMapGap3) - node = new HeightMapText3(node.length, this.height); - else - node.height = this.height; - if (!this.outdated) - node.outdated = false; - return node; - } else { - return HeightMap3.of(nodes); - } - } - updateHeight(oracle, offset = 0, force = false, measured) { - if (measured && measured.from <= offset && measured.more) - this.setHeight(oracle, measured.heights[measured.index++]); - else if (force || this.outdated) - this.setHeight(oracle, Math.max(this.widgetHeight, oracle.heightForLine(this.length - this.collapsed))); - this.outdated = false; - return this; - } - toString() { - return `line(${this.length}${this.collapsed ? -this.collapsed : ""}${this.widgetHeight ? ":" + this.widgetHeight : ""})`; - } - }; - var HeightMapGap3 = class extends HeightMap3 { - constructor(length) { - super(length, 0); - } - lines(doc4, offset) { - let firstLine = doc4.lineAt(offset).number, lastLine = doc4.lineAt(offset + this.length).number; - return { firstLine, lastLine, lineHeight: this.height / (lastLine - firstLine + 1) }; - } - blockAt(height, doc4, top2, offset) { - let { firstLine, lastLine, lineHeight } = this.lines(doc4, offset); - let line = Math.max(0, Math.min(lastLine - firstLine, Math.floor((height - top2) / lineHeight))); - let { from: from2, length } = doc4.line(firstLine + line); - return new BlockInfo3(from2, length, top2 + lineHeight * line, lineHeight, BlockType3.Text); - } - lineAt(value, type, doc4, top2, offset) { - if (type == QueryType4.ByHeight) - return this.blockAt(value, doc4, top2, offset); - if (type == QueryType4.ByPosNoHeight) { - let { from: from3, to } = doc4.lineAt(value); - return new BlockInfo3(from3, to - from3, 0, 0, BlockType3.Text); - } - let { firstLine, lineHeight } = this.lines(doc4, offset); - let { from: from2, length, number: number3 } = doc4.lineAt(value); - return new BlockInfo3(from2, length, top2 + lineHeight * (number3 - firstLine), lineHeight, BlockType3.Text); - } - forEachLine(from2, to, doc4, top2, offset, f) { - let { firstLine, lineHeight } = this.lines(doc4, offset); - for (let pos = Math.max(from2, offset), end = Math.min(offset + this.length, to); pos <= end; ) { - let line = doc4.lineAt(pos); - if (pos == from2) - top2 += lineHeight * (line.number - firstLine); - f(new BlockInfo3(line.from, line.length, top2, lineHeight, BlockType3.Text)); - top2 += lineHeight; - pos = line.to + 1; - } - } - replace(from2, to, nodes) { - let after = this.length - to; - if (after > 0) { - let last = nodes[nodes.length - 1]; - if (last instanceof HeightMapGap3) - nodes[nodes.length - 1] = new HeightMapGap3(last.length + after); - else - nodes.push(null, new HeightMapGap3(after - 1)); - } - if (from2 > 0) { - let first = nodes[0]; - if (first instanceof HeightMapGap3) - nodes[0] = new HeightMapGap3(from2 + first.length); - else - nodes.unshift(new HeightMapGap3(from2 - 1), null); - } - return HeightMap3.of(nodes); - } - decomposeLeft(to, result) { - result.push(new HeightMapGap3(to - 1), null); - } - decomposeRight(from2, result) { - result.push(null, new HeightMapGap3(this.length - from2 - 1)); - } - updateHeight(oracle, offset = 0, force = false, measured) { - let end = offset + this.length; - if (measured && measured.from <= offset + this.length && measured.more) { - let nodes = [], pos = Math.max(offset, measured.from), singleHeight = -1; - let wasChanged = oracle.heightChanged; - if (measured.from > offset) - nodes.push(new HeightMapGap3(measured.from - offset - 1).updateHeight(oracle, offset)); - while (pos <= end && measured.more) { - let len = oracle.doc.lineAt(pos).length; - if (nodes.length) - nodes.push(null); - let height = measured.heights[measured.index++]; - if (singleHeight == -1) - singleHeight = height; - else if (Math.abs(height - singleHeight) >= Epsilon3) - singleHeight = -2; - let line = new HeightMapText3(len, height); - line.outdated = false; - nodes.push(line); - pos += len + 1; - } - if (pos <= end) - nodes.push(null, new HeightMapGap3(end - pos).updateHeight(oracle, pos)); - let result = HeightMap3.of(nodes); - oracle.heightChanged = wasChanged || singleHeight < 0 || Math.abs(result.height - this.height) >= Epsilon3 || Math.abs(singleHeight - this.lines(oracle.doc, offset).lineHeight) >= Epsilon3; - return result; - } else if (force || this.outdated) { - this.setHeight(oracle, oracle.heightForGap(offset, offset + this.length)); - this.outdated = false; - } - return this; - } - toString() { - return `gap(${this.length})`; - } - }; - var HeightMapBranch3 = class extends HeightMap3 { - constructor(left, brk, right) { - super(left.length + brk + right.length, left.height + right.height, brk | (left.outdated || right.outdated ? 2 : 0)); - this.left = left; - this.right = right; - this.size = left.size + right.size; - } - get break() { - return this.flags & 1; - } - blockAt(height, doc4, top2, offset) { - let mid = top2 + this.left.height; - return height < mid ? this.left.blockAt(height, doc4, top2, offset) : this.right.blockAt(height, doc4, mid, offset + this.left.length + this.break); - } - lineAt(value, type, doc4, top2, offset) { - let rightTop = top2 + this.left.height, rightOffset = offset + this.left.length + this.break; - let left = type == QueryType4.ByHeight ? value < rightTop : value < rightOffset; - let base2 = left ? this.left.lineAt(value, type, doc4, top2, offset) : this.right.lineAt(value, type, doc4, rightTop, rightOffset); - if (this.break || (left ? base2.to < rightOffset : base2.from > rightOffset)) - return base2; - let subQuery = type == QueryType4.ByPosNoHeight ? QueryType4.ByPosNoHeight : QueryType4.ByPos; - if (left) - return base2.join(this.right.lineAt(rightOffset, subQuery, doc4, rightTop, rightOffset)); - else - return this.left.lineAt(rightOffset, subQuery, doc4, top2, offset).join(base2); - } - forEachLine(from2, to, doc4, top2, offset, f) { - let rightTop = top2 + this.left.height, rightOffset = offset + this.left.length + this.break; - if (this.break) { - if (from2 < rightOffset) - this.left.forEachLine(from2, to, doc4, top2, offset, f); - if (to >= rightOffset) - this.right.forEachLine(from2, to, doc4, rightTop, rightOffset, f); - } else { - let mid = this.lineAt(rightOffset, QueryType4.ByPos, doc4, top2, offset); - if (from2 < mid.from) - this.left.forEachLine(from2, mid.from - 1, doc4, top2, offset, f); - if (mid.to >= from2 && mid.from <= to) - f(mid); - if (to > mid.to) - this.right.forEachLine(mid.to + 1, to, doc4, rightTop, rightOffset, f); - } - } - replace(from2, to, nodes) { - let rightStart = this.left.length + this.break; - if (to < rightStart) - return this.balanced(this.left.replace(from2, to, nodes), this.right); - if (from2 > this.left.length) - return this.balanced(this.left, this.right.replace(from2 - rightStart, to - rightStart, nodes)); - let result = []; - if (from2 > 0) - this.decomposeLeft(from2, result); - let left = result.length; - for (let node of nodes) - result.push(node); - if (from2 > 0) - mergeGaps3(result, left - 1); - if (to < this.length) { - let right = result.length; - this.decomposeRight(to, result); - mergeGaps3(result, right); - } - return HeightMap3.of(result); - } - decomposeLeft(to, result) { - let left = this.left.length; - if (to <= left) - return this.left.decomposeLeft(to, result); - result.push(this.left); - if (this.break) { - left++; - if (to >= left) - result.push(null); - } - if (to > left) - this.right.decomposeLeft(to - left, result); - } - decomposeRight(from2, result) { - let left = this.left.length, right = left + this.break; - if (from2 >= right) - return this.right.decomposeRight(from2 - right, result); - if (from2 < left) - this.left.decomposeRight(from2, result); - if (this.break && from2 < right) - result.push(null); - result.push(this.right); - } - balanced(left, right) { - if (left.size > 2 * right.size || right.size > 2 * left.size) - return HeightMap3.of(this.break ? [left, null, right] : [left, right]); - this.left = left; - this.right = right; - this.height = left.height + right.height; - this.outdated = left.outdated || right.outdated; - this.size = left.size + right.size; - this.length = left.length + this.break + right.length; - return this; - } - updateHeight(oracle, offset = 0, force = false, measured) { - let { left, right } = this, rightStart = offset + left.length + this.break, rebalance = null; - if (measured && measured.from <= offset + left.length && measured.more) - rebalance = left = left.updateHeight(oracle, offset, force, measured); - else - left.updateHeight(oracle, offset, force); - if (measured && measured.from <= rightStart + right.length && measured.more) - rebalance = right = right.updateHeight(oracle, rightStart, force, measured); - else - right.updateHeight(oracle, rightStart, force); - if (rebalance) - return this.balanced(left, right); - this.height = this.left.height + this.right.height; - this.outdated = false; - return this; - } - toString() { - return this.left + (this.break ? " " : "-") + this.right; - } - }; - function mergeGaps3(nodes, around) { - let before, after; - if (nodes[around] == null && (before = nodes[around - 1]) instanceof HeightMapGap3 && (after = nodes[around + 1]) instanceof HeightMapGap3) - nodes.splice(around - 1, 3, new HeightMapGap3(before.length + 1 + after.length)); - } - var relevantWidgetHeight3 = 5; - var NodeBuilder3 = class { - constructor(pos, oracle) { - this.pos = pos; - this.oracle = oracle; - this.nodes = []; - this.lineStart = -1; - this.lineEnd = -1; - this.covering = null; - this.writtenTo = pos; - } - get isCovered() { - return this.covering && this.nodes[this.nodes.length - 1] == this.covering; - } - span(_from, to) { - if (this.lineStart > -1) { - let end = Math.min(to, this.lineEnd), last = this.nodes[this.nodes.length - 1]; - if (last instanceof HeightMapText3) - last.length += end - this.pos; - else if (end > this.pos || !this.isCovered) - this.nodes.push(new HeightMapText3(end - this.pos, -1)); - this.writtenTo = end; - if (to > end) { - this.nodes.push(null); - this.writtenTo++; - this.lineStart = -1; - } - } - this.pos = to; - } - point(from2, to, deco) { - if (from2 < to || deco.heightRelevant) { - let height = deco.widget ? deco.widget.estimatedHeight : 0; - if (height < 0) - height = this.oracle.lineHeight; - let len = to - from2; - if (deco.block) { - this.addBlock(new HeightMapBlock3(len, height, deco.type)); - } else if (len || height >= relevantWidgetHeight3) { - this.addLineDeco(height, len); - } - } else if (to > from2) { - this.span(from2, to); - } - if (this.lineEnd > -1 && this.lineEnd < this.pos) - this.lineEnd = this.oracle.doc.lineAt(this.pos).to; - } - enterLine() { - if (this.lineStart > -1) - return; - let { from: from2, to } = this.oracle.doc.lineAt(this.pos); - this.lineStart = from2; - this.lineEnd = to; - if (this.writtenTo < from2) { - if (this.writtenTo < from2 - 1 || this.nodes[this.nodes.length - 1] == null) - this.nodes.push(this.blankContent(this.writtenTo, from2 - 1)); - this.nodes.push(null); - } - if (this.pos > from2) - this.nodes.push(new HeightMapText3(this.pos - from2, -1)); - this.writtenTo = this.pos; - } - blankContent(from2, to) { - let gap = new HeightMapGap3(to - from2); - if (this.oracle.doc.lineAt(from2).to == to) - gap.flags |= 4; - return gap; - } - ensureLine() { - this.enterLine(); - let last = this.nodes.length ? this.nodes[this.nodes.length - 1] : null; - if (last instanceof HeightMapText3) - return last; - let line = new HeightMapText3(0, -1); - this.nodes.push(line); - return line; - } - addBlock(block) { - this.enterLine(); - if (block.type == BlockType3.WidgetAfter && !this.isCovered) - this.ensureLine(); - this.nodes.push(block); - this.writtenTo = this.pos = this.pos + block.length; - if (block.type != BlockType3.WidgetBefore) - this.covering = block; - } - addLineDeco(height, length) { - let line = this.ensureLine(); - line.length += length; - line.collapsed += length; - line.widgetHeight = Math.max(line.widgetHeight, height); - this.writtenTo = this.pos = this.pos + length; - } - finish(from2) { - let last = this.nodes.length == 0 ? null : this.nodes[this.nodes.length - 1]; - if (this.lineStart > -1 && !(last instanceof HeightMapText3) && !this.isCovered) - this.nodes.push(new HeightMapText3(0, -1)); - else if (this.writtenTo < this.pos || last == null) - this.nodes.push(this.blankContent(this.writtenTo, this.pos)); - let pos = from2; - for (let node of this.nodes) { - if (node instanceof HeightMapText3) - node.updateHeight(this.oracle, pos); - pos += node ? node.length : 1; - } - return this.nodes; - } - static build(oracle, decorations4, from2, to) { - let builder = new NodeBuilder3(from2, oracle); - RangeSet3.spans(decorations4, from2, to, builder, 0); - return builder.finish(from2); - } - }; - function heightRelevantDecoChanges3(a, b, diff) { - let comp = new DecorationComparator3(); - RangeSet3.compare(a, b, diff, comp, 0); - return comp.changes; - } - var DecorationComparator3 = class { - constructor() { - this.changes = []; - } - compareRange() { - } - comparePoint(from2, to, a, b) { - if (from2 < to || a && a.heightRelevant || b && b.heightRelevant) - addRange3(from2, to, this.changes, 5); - } - }; - function visiblePixelRange3(dom, paddingTop) { - let rect = dom.getBoundingClientRect(); - let left = Math.max(0, rect.left), right = Math.min(innerWidth, rect.right); - let top2 = Math.max(0, rect.top), bottom = Math.min(innerHeight, rect.bottom); - let body = dom.ownerDocument.body; - for (let parent = dom.parentNode; parent && parent != body; ) { - if (parent.nodeType == 1) { - let elt = parent; - let style = window.getComputedStyle(elt); - if ((elt.scrollHeight > elt.clientHeight || elt.scrollWidth > elt.clientWidth) && style.overflow != "visible") { - let parentRect = elt.getBoundingClientRect(); - left = Math.max(left, parentRect.left); - right = Math.min(right, parentRect.right); - top2 = Math.max(top2, parentRect.top); - bottom = Math.min(bottom, parentRect.bottom); - } - parent = style.position == "absolute" || style.position == "fixed" ? elt.offsetParent : elt.parentNode; - } else if (parent.nodeType == 11) { - parent = parent.host; - } else { - break; - } - } - return { - left: left - rect.left, - right: Math.max(left, right) - rect.left, - top: top2 - (rect.top + paddingTop), - bottom: Math.max(top2, bottom) - (rect.top + paddingTop) - }; - } - function fullPixelRange3(dom, paddingTop) { - let rect = dom.getBoundingClientRect(); - return { - left: 0, - right: rect.right - rect.left, - top: paddingTop, - bottom: rect.bottom - (rect.top + paddingTop) - }; - } - var LineGap3 = class { - constructor(from2, to, size) { - this.from = from2; - this.to = to; - this.size = size; - } - static same(a, b) { - if (a.length != b.length) - return false; - for (let i = 0; i < a.length; i++) { - let gA = a[i], gB = b[i]; - if (gA.from != gB.from || gA.to != gB.to || gA.size != gB.size) - return false; - } - return true; - } - draw(wrapping) { - return Decoration3.replace({ widget: new LineGapWidget3(this.size, wrapping) }).range(this.from, this.to); - } - }; - var LineGapWidget3 = class extends WidgetType3 { - constructor(size, vertical) { - super(); - this.size = size; - this.vertical = vertical; - } - eq(other) { - return other.size == this.size && other.vertical == this.vertical; - } - toDOM() { - let elt = document.createElement("div"); - if (this.vertical) { - elt.style.height = this.size + "px"; - } else { - elt.style.width = this.size + "px"; - elt.style.height = "2px"; - elt.style.display = "inline-block"; - } - return elt; - } - get estimatedHeight() { - return this.vertical ? this.size : -1; - } - }; - var ViewState3 = class { - constructor(state) { - this.state = state; - this.pixelViewport = { left: 0, right: window.innerWidth, top: 0, bottom: 0 }; - this.inView = true; - this.paddingTop = 0; - this.paddingBottom = 0; - this.contentDOMWidth = 0; - this.contentDOMHeight = 0; - this.editorHeight = 0; - this.editorWidth = 0; - this.heightOracle = new HeightOracle3(); - this.scaler = IdScaler3; - this.scrollTarget = null; - this.printing = false; - this.mustMeasureContent = true; - this.defaultTextDirection = Direction3.RTL; - this.visibleRanges = []; - this.mustEnforceCursorAssoc = false; - this.stateDeco = state.facet(decorations3).filter((d) => typeof d != "function"); - this.heightMap = HeightMap3.empty().applyChanges(this.stateDeco, Text3.empty, this.heightOracle.setDoc(state.doc), [new ChangedRange3(0, 0, 0, state.doc.length)]); - this.viewport = this.getViewport(0, null); - this.updateViewportLines(); - this.updateForViewport(); - this.lineGaps = this.ensureLineGaps([]); - this.lineGapDeco = Decoration3.set(this.lineGaps.map((gap) => gap.draw(false))); - this.computeVisibleRanges(); - } - updateForViewport() { - let viewports = [this.viewport], { main } = this.state.selection; - for (let i = 0; i <= 1; i++) { - let pos = i ? main.head : main.anchor; - if (!viewports.some(({ from: from2, to }) => pos >= from2 && pos <= to)) { - let { from: from2, to } = this.lineBlockAt(pos); - viewports.push(new Viewport3(from2, to)); - } - } - this.viewports = viewports.sort((a, b) => a.from - b.from); - this.scaler = this.heightMap.height <= 7e6 ? IdScaler3 : new BigScaler3(this.heightOracle.doc, this.heightMap, this.viewports); - } - updateViewportLines() { - this.viewportLines = []; - this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.state.doc, 0, 0, (block) => { - this.viewportLines.push(this.scaler.scale == 1 ? block : scaleBlock3(block, this.scaler)); - }); - } - update(update, scrollTarget = null) { - this.state = update.state; - let prevDeco = this.stateDeco; - this.stateDeco = this.state.facet(decorations3).filter((d) => typeof d != "function"); - let contentChanges = update.changedRanges; - let heightChanges = ChangedRange3.extendWithRanges(contentChanges, heightRelevantDecoChanges3(prevDeco, this.stateDeco, update ? update.changes : ChangeSet3.empty(this.state.doc.length))); - let prevHeight = this.heightMap.height; - this.heightMap = this.heightMap.applyChanges(this.stateDeco, update.startState.doc, this.heightOracle.setDoc(this.state.doc), heightChanges); - if (this.heightMap.height != prevHeight) - update.flags |= 2; - let viewport = heightChanges.length ? this.mapViewport(this.viewport, update.changes) : this.viewport; - if (scrollTarget && (scrollTarget.range.head < viewport.from || scrollTarget.range.head > viewport.to) || !this.viewportIsAppropriate(viewport)) - viewport = this.getViewport(0, scrollTarget); - let updateLines = !update.changes.empty || update.flags & 2 || viewport.from != this.viewport.from || viewport.to != this.viewport.to; - this.viewport = viewport; - this.updateForViewport(); - if (updateLines) - this.updateViewportLines(); - if (this.lineGaps.length || this.viewport.to - this.viewport.from > 4e3) - this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps, update.changes))); - update.flags |= this.computeVisibleRanges(); - if (scrollTarget) - this.scrollTarget = scrollTarget; - if (!this.mustEnforceCursorAssoc && update.selectionSet && update.view.lineWrapping && update.state.selection.main.empty && update.state.selection.main.assoc) - this.mustEnforceCursorAssoc = true; - } - measure(view) { - let dom = view.contentDOM, style = window.getComputedStyle(dom); - let oracle = this.heightOracle; - let whiteSpace = style.whiteSpace; - this.defaultTextDirection = style.direction == "rtl" ? Direction3.RTL : Direction3.LTR; - let refresh = this.heightOracle.mustRefreshForWrapping(whiteSpace); - let measureContent = refresh || this.mustMeasureContent || this.contentDOMHeight != dom.clientHeight; - let result = 0, bias = 0; - if (this.editorWidth != view.scrollDOM.clientWidth) { - if (oracle.lineWrapping) - measureContent = true; - this.editorWidth = view.scrollDOM.clientWidth; - result |= 8; - } - if (measureContent) { - this.mustMeasureContent = false; - this.contentDOMHeight = dom.clientHeight; - let paddingTop = parseInt(style.paddingTop) || 0, paddingBottom = parseInt(style.paddingBottom) || 0; - if (this.paddingTop != paddingTop || this.paddingBottom != paddingBottom) { - result |= 8; - this.paddingTop = paddingTop; - this.paddingBottom = paddingBottom; - } - } - let pixelViewport = (this.printing ? fullPixelRange3 : visiblePixelRange3)(dom, this.paddingTop); - let dTop = pixelViewport.top - this.pixelViewport.top, dBottom = pixelViewport.bottom - this.pixelViewport.bottom; - this.pixelViewport = pixelViewport; - let inView = this.pixelViewport.bottom > this.pixelViewport.top && this.pixelViewport.right > this.pixelViewport.left; - if (inView != this.inView) { - this.inView = inView; - if (inView) - measureContent = true; - } - if (!this.inView) - return 0; - let contentWidth = dom.clientWidth; - if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) { - this.contentDOMWidth = contentWidth; - this.editorHeight = view.scrollDOM.clientHeight; - result |= 8; - } - if (measureContent) { - let lineHeights = view.docView.measureVisibleLineHeights(this.viewport); - if (oracle.mustRefreshForHeights(lineHeights)) - refresh = true; - if (refresh || oracle.lineWrapping && Math.abs(contentWidth - this.contentDOMWidth) > oracle.charWidth) { - let { lineHeight, charWidth } = view.docView.measureTextSize(); - refresh = oracle.refresh(whiteSpace, lineHeight, charWidth, contentWidth / charWidth, lineHeights); - if (refresh) { - view.docView.minWidth = 0; - result |= 8; - } - } - if (dTop > 0 && dBottom > 0) - bias = Math.max(dTop, dBottom); - else if (dTop < 0 && dBottom < 0) - bias = Math.min(dTop, dBottom); - oracle.heightChanged = false; - for (let vp of this.viewports) { - let heights = vp.from == this.viewport.from ? lineHeights : view.docView.measureVisibleLineHeights(vp); - this.heightMap = this.heightMap.updateHeight(oracle, 0, refresh, new MeasuredHeights3(vp.from, heights)); - } - if (oracle.heightChanged) - result |= 2; - } - let viewportChange = !this.viewportIsAppropriate(this.viewport, bias) || this.scrollTarget && (this.scrollTarget.range.head < this.viewport.from || this.scrollTarget.range.head > this.viewport.to); - if (viewportChange) - this.viewport = this.getViewport(bias, this.scrollTarget); - this.updateForViewport(); - if (result & 2 || viewportChange) - this.updateViewportLines(); - if (this.lineGaps.length || this.viewport.to - this.viewport.from > 4e3) - this.updateLineGaps(this.ensureLineGaps(refresh ? [] : this.lineGaps)); - result |= this.computeVisibleRanges(); - if (this.mustEnforceCursorAssoc) { - this.mustEnforceCursorAssoc = false; - view.docView.enforceCursorAssoc(); - } - return result; - } - get visibleTop() { - return this.scaler.fromDOM(this.pixelViewport.top); - } - get visibleBottom() { - return this.scaler.fromDOM(this.pixelViewport.bottom); - } - getViewport(bias, scrollTarget) { - let marginTop = 0.5 - Math.max(-0.5, Math.min(0.5, bias / 1e3 / 2)); - let map = this.heightMap, doc4 = this.state.doc, { visibleTop, visibleBottom } = this; - let viewport = new Viewport3(map.lineAt(visibleTop - marginTop * 1e3, QueryType4.ByHeight, doc4, 0, 0).from, map.lineAt(visibleBottom + (1 - marginTop) * 1e3, QueryType4.ByHeight, doc4, 0, 0).to); - if (scrollTarget) { - let { head } = scrollTarget.range; - if (head < viewport.from || head > viewport.to) { - let viewHeight = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top); - let block = map.lineAt(head, QueryType4.ByPos, doc4, 0, 0), topPos; - if (scrollTarget.y == "center") - topPos = (block.top + block.bottom) / 2 - viewHeight / 2; - else if (scrollTarget.y == "start" || scrollTarget.y == "nearest" && head < viewport.from) - topPos = block.top; - else - topPos = block.bottom - viewHeight; - viewport = new Viewport3(map.lineAt(topPos - 1e3 / 2, QueryType4.ByHeight, doc4, 0, 0).from, map.lineAt(topPos + viewHeight + 1e3 / 2, QueryType4.ByHeight, doc4, 0, 0).to); - } - } - return viewport; - } - mapViewport(viewport, changes) { - let from2 = changes.mapPos(viewport.from, -1), to = changes.mapPos(viewport.to, 1); - return new Viewport3(this.heightMap.lineAt(from2, QueryType4.ByPos, this.state.doc, 0, 0).from, this.heightMap.lineAt(to, QueryType4.ByPos, this.state.doc, 0, 0).to); - } - viewportIsAppropriate({ from: from2, to }, bias = 0) { - if (!this.inView) - return true; - let { top: top2 } = this.heightMap.lineAt(from2, QueryType4.ByPos, this.state.doc, 0, 0); - let { bottom } = this.heightMap.lineAt(to, QueryType4.ByPos, this.state.doc, 0, 0); - let { visibleTop, visibleBottom } = this; - return (from2 == 0 || top2 <= visibleTop - Math.max(10, Math.min(-bias, 250))) && (to == this.state.doc.length || bottom >= visibleBottom + Math.max(10, Math.min(bias, 250))) && (top2 > visibleTop - 2 * 1e3 && bottom < visibleBottom + 2 * 1e3); - } - mapLineGaps(gaps, changes) { - if (!gaps.length || changes.empty) - return gaps; - let mapped = []; - for (let gap of gaps) - if (!changes.touchesRange(gap.from, gap.to)) - mapped.push(new LineGap3(changes.mapPos(gap.from), changes.mapPos(gap.to), gap.size)); - return mapped; - } - ensureLineGaps(current) { - let gaps = []; - if (this.defaultTextDirection != Direction3.LTR) - return gaps; - for (let line of this.viewportLines) { - if (line.length < 4e3) - continue; - let structure = lineStructure3(line.from, line.to, this.stateDeco); - if (structure.total < 4e3) - continue; - let viewFrom, viewTo; - if (this.heightOracle.lineWrapping) { - let marginHeight = 2e3 / this.heightOracle.lineLength * this.heightOracle.lineHeight; - viewFrom = findPosition3(structure, (this.visibleTop - line.top - marginHeight) / line.height); - viewTo = findPosition3(structure, (this.visibleBottom - line.top + marginHeight) / line.height); - } else { - let totalWidth = structure.total * this.heightOracle.charWidth; - let marginWidth = 2e3 * this.heightOracle.charWidth; - viewFrom = findPosition3(structure, (this.pixelViewport.left - marginWidth) / totalWidth); - viewTo = findPosition3(structure, (this.pixelViewport.right + marginWidth) / totalWidth); - } - let outside = []; - if (viewFrom > line.from) - outside.push({ from: line.from, to: viewFrom }); - if (viewTo < line.to) - outside.push({ from: viewTo, to: line.to }); - let sel = this.state.selection.main; - if (sel.from >= line.from && sel.from <= line.to) - cutRange3(outside, sel.from - 10, sel.from + 10); - if (!sel.empty && sel.to >= line.from && sel.to <= line.to) - cutRange3(outside, sel.to - 10, sel.to + 10); - for (let { from: from2, to } of outside) - if (to - from2 > 1e3) { - gaps.push(find3(current, (gap) => gap.from >= line.from && gap.to <= line.to && Math.abs(gap.from - from2) < 1e3 && Math.abs(gap.to - to) < 1e3) || new LineGap3(from2, to, this.gapSize(line, from2, to, structure))); - } - } - return gaps; - } - gapSize(line, from2, to, structure) { - let fraction = findFraction3(structure, to) - findFraction3(structure, from2); - if (this.heightOracle.lineWrapping) { - return line.height * fraction; - } else { - return structure.total * this.heightOracle.charWidth * fraction; - } - } - updateLineGaps(gaps) { - if (!LineGap3.same(gaps, this.lineGaps)) { - this.lineGaps = gaps; - this.lineGapDeco = Decoration3.set(gaps.map((gap) => gap.draw(this.heightOracle.lineWrapping))); - } - } - computeVisibleRanges() { - let deco = this.stateDeco; - if (this.lineGaps.length) - deco = deco.concat(this.lineGapDeco); - let ranges = []; - RangeSet3.spans(deco, this.viewport.from, this.viewport.to, { - span(from2, to) { - ranges.push({ from: from2, to }); - }, - point() { - } - }, 20); - let changed = ranges.length != this.visibleRanges.length || this.visibleRanges.some((r, i) => r.from != ranges[i].from || r.to != ranges[i].to); - this.visibleRanges = ranges; - return changed ? 4 : 0; - } - lineBlockAt(pos) { - return pos >= this.viewport.from && pos <= this.viewport.to && this.viewportLines.find((b) => b.from <= pos && b.to >= pos) || scaleBlock3(this.heightMap.lineAt(pos, QueryType4.ByPos, this.state.doc, 0, 0), this.scaler); - } - lineBlockAtHeight(height) { - return scaleBlock3(this.heightMap.lineAt(this.scaler.fromDOM(height), QueryType4.ByHeight, this.state.doc, 0, 0), this.scaler); - } - elementAtHeight(height) { - return scaleBlock3(this.heightMap.blockAt(this.scaler.fromDOM(height), this.state.doc, 0, 0), this.scaler); - } - get docHeight() { - return this.scaler.toDOM(this.heightMap.height); - } - get contentHeight() { - return this.docHeight + this.paddingTop + this.paddingBottom; - } - }; - var Viewport3 = class { - constructor(from2, to) { - this.from = from2; - this.to = to; - } - }; - function lineStructure3(from2, to, stateDeco) { - let ranges = [], pos = from2, total = 0; - RangeSet3.spans(stateDeco, from2, to, { - span() { - }, - point(from3, to2) { - if (from3 > pos) { - ranges.push({ from: pos, to: from3 }); - total += from3 - pos; - } - pos = to2; - } - }, 20); - if (pos < to) { - ranges.push({ from: pos, to }); - total += to - pos; - } - return { total, ranges }; - } - function findPosition3({ total, ranges }, ratio) { - if (ratio <= 0) - return ranges[0].from; - if (ratio >= 1) - return ranges[ranges.length - 1].to; - let dist = Math.floor(total * ratio); - for (let i = 0; ; i++) { - let { from: from2, to } = ranges[i], size = to - from2; - if (dist <= size) - return from2 + dist; - dist -= size; - } - } - function findFraction3(structure, pos) { - let counted = 0; - for (let { from: from2, to } of structure.ranges) { - if (pos <= to) { - counted += pos - from2; - break; - } - counted += to - from2; - } - return counted / structure.total; - } - function cutRange3(ranges, from2, to) { - for (let i = 0; i < ranges.length; i++) { - let r = ranges[i]; - if (r.from < to && r.to > from2) { - let pieces = []; - if (r.from < from2) - pieces.push({ from: r.from, to: from2 }); - if (r.to > to) - pieces.push({ from: to, to: r.to }); - ranges.splice(i, 1, ...pieces); - i += pieces.length - 1; - } - } - } - function find3(array2, f) { - for (let val of array2) - if (f(val)) - return val; - return void 0; - } - var IdScaler3 = { - toDOM(n) { - return n; - }, - fromDOM(n) { - return n; - }, - scale: 1 - }; - var BigScaler3 = class { - constructor(doc4, heightMap, viewports) { - let vpHeight = 0, base2 = 0, domBase = 0; - this.viewports = viewports.map(({ from: from2, to }) => { - let top2 = heightMap.lineAt(from2, QueryType4.ByPos, doc4, 0, 0).top; - let bottom = heightMap.lineAt(to, QueryType4.ByPos, doc4, 0, 0).bottom; - vpHeight += bottom - top2; - return { from: from2, to, top: top2, bottom, domTop: 0, domBottom: 0 }; - }); - this.scale = (7e6 - vpHeight) / (heightMap.height - vpHeight); - for (let obj of this.viewports) { - obj.domTop = domBase + (obj.top - base2) * this.scale; - domBase = obj.domBottom = obj.domTop + (obj.bottom - obj.top); - base2 = obj.bottom; - } - } - toDOM(n) { - for (let i = 0, base2 = 0, domBase = 0; ; i++) { - let vp = i < this.viewports.length ? this.viewports[i] : null; - if (!vp || n < vp.top) - return domBase + (n - base2) * this.scale; - if (n <= vp.bottom) - return vp.domTop + (n - vp.top); - base2 = vp.bottom; - domBase = vp.domBottom; - } - } - fromDOM(n) { - for (let i = 0, base2 = 0, domBase = 0; ; i++) { - let vp = i < this.viewports.length ? this.viewports[i] : null; - if (!vp || n < vp.domTop) - return base2 + (n - domBase) / this.scale; - if (n <= vp.domBottom) - return vp.top + (n - vp.domTop); - base2 = vp.bottom; - domBase = vp.domBottom; - } - } - }; - function scaleBlock3(block, scaler) { - if (scaler.scale == 1) - return block; - let bTop = scaler.toDOM(block.top), bBottom = scaler.toDOM(block.bottom); - return new BlockInfo3(block.from, block.length, bTop, bBottom - bTop, Array.isArray(block.type) ? block.type.map((b) => scaleBlock3(b, scaler)) : block.type); - } - var theme3 = /* @__PURE__ */ Facet3.define({ combine: (strs) => strs.join(" ") }); - var darkTheme3 = /* @__PURE__ */ Facet3.define({ combine: (values2) => values2.indexOf(true) > -1 }); - var baseThemeID3 = /* @__PURE__ */ StyleModule.newName(); - var baseLightID3 = /* @__PURE__ */ StyleModule.newName(); - var baseDarkID3 = /* @__PURE__ */ StyleModule.newName(); - var lightDarkIDs3 = { "&light": "." + baseLightID3, "&dark": "." + baseDarkID3 }; - function buildTheme3(main, spec, scopes) { - return new StyleModule(spec, { - finish(sel) { - return /&/.test(sel) ? sel.replace(/&\w*/, (m) => { - if (m == "&") - return main; - if (!scopes || !scopes[m]) - throw new RangeError(`Unsupported selector: ${m}`); - return scopes[m]; - }) : main + " " + sel; - } - }); - } - var baseTheme$13 = /* @__PURE__ */ buildTheme3("." + baseThemeID3, { - "&.cm-editor": { - position: "relative !important", - boxSizing: "border-box", - "&.cm-focused": { - outline: "1px dotted #212121" - }, - display: "flex !important", - flexDirection: "column" - }, - ".cm-scroller": { - display: "flex !important", - alignItems: "flex-start !important", - fontFamily: "monospace", - lineHeight: 1.4, - height: "100%", - overflowX: "auto", - position: "relative", - zIndex: 0 - }, - ".cm-content": { - margin: 0, - flexGrow: 2, - minHeight: "100%", - display: "block", - whiteSpace: "pre", - wordWrap: "normal", - boxSizing: "border-box", - padding: "4px 0", - outline: "none", - "&[contenteditable=true]": { - WebkitUserModify: "read-write-plaintext-only" - } - }, - ".cm-lineWrapping": { - whiteSpace_fallback: "pre-wrap", - whiteSpace: "break-spaces", - wordBreak: "break-word", - overflowWrap: "anywhere" - }, - "&light .cm-content": { caretColor: "black" }, - "&dark .cm-content": { caretColor: "white" }, - ".cm-line": { - display: "block", - padding: "0 2px 0 4px" - }, - ".cm-selectionLayer": { - zIndex: -1, - contain: "size style" - }, - ".cm-selectionBackground": { - position: "absolute" - }, - "&light .cm-selectionBackground": { - background: "#d9d9d9" - }, - "&dark .cm-selectionBackground": { - background: "#222" - }, - "&light.cm-focused .cm-selectionBackground": { - background: "#d7d4f0" - }, - "&dark.cm-focused .cm-selectionBackground": { - background: "#233" - }, - ".cm-cursorLayer": { - zIndex: 100, - contain: "size style", - pointerEvents: "none" - }, - "&.cm-focused .cm-cursorLayer": { - animation: "steps(1) cm-blink 1.2s infinite" - }, - "@keyframes cm-blink": { "0%": {}, "50%": { visibility: "hidden" }, "100%": {} }, - "@keyframes cm-blink2": { "0%": {}, "50%": { visibility: "hidden" }, "100%": {} }, - ".cm-cursor, .cm-dropCursor": { - position: "absolute", - borderLeft: "1.2px solid black", - marginLeft: "-0.6px", - pointerEvents: "none" - }, - ".cm-cursor": { - display: "none" - }, - "&dark .cm-cursor": { - borderLeftColor: "#444" - }, - "&.cm-focused .cm-cursor": { - display: "block" - }, - "&light .cm-activeLine": { backgroundColor: "#f3f9ff" }, - "&dark .cm-activeLine": { backgroundColor: "#223039" }, - "&light .cm-specialChar": { color: "red" }, - "&dark .cm-specialChar": { color: "#f78" }, - ".cm-gutters": { - display: "flex", - height: "100%", - boxSizing: "border-box", - left: 0, - zIndex: 200 - }, - "&light .cm-gutters": { - backgroundColor: "#f5f5f5", - color: "#6c6c6c", - borderRight: "1px solid #ddd" - }, - "&dark .cm-gutters": { - backgroundColor: "#333338", - color: "#ccc" - }, - ".cm-gutter": { - display: "flex !important", - flexDirection: "column", - flexShrink: 0, - boxSizing: "border-box", - minHeight: "100%", - overflow: "hidden" - }, - ".cm-gutterElement": { - boxSizing: "border-box" - }, - ".cm-lineNumbers .cm-gutterElement": { - padding: "0 3px 0 5px", - minWidth: "20px", - textAlign: "right", - whiteSpace: "nowrap" - }, - "&light .cm-activeLineGutter": { - backgroundColor: "#e2f2ff" - }, - "&dark .cm-activeLineGutter": { - backgroundColor: "#222227" - }, - ".cm-panels": { - boxSizing: "border-box", - position: "sticky", - left: 0, - right: 0 - }, - "&light .cm-panels": { - backgroundColor: "#f5f5f5", - color: "black" - }, - "&light .cm-panels-top": { - borderBottom: "1px solid #ddd" - }, - "&light .cm-panels-bottom": { - borderTop: "1px solid #ddd" - }, - "&dark .cm-panels": { - backgroundColor: "#333338", - color: "white" - }, - ".cm-tab": { - display: "inline-block", - overflow: "hidden", - verticalAlign: "bottom" - }, - ".cm-widgetBuffer": { - verticalAlign: "text-top", - height: "1em", - display: "inline" - }, - ".cm-placeholder": { - color: "#888", - display: "inline-block", - verticalAlign: "top" - }, - ".cm-button": { - verticalAlign: "middle", - color: "inherit", - fontSize: "70%", - padding: ".2em 1em", - borderRadius: "1px" - }, - "&light .cm-button": { - backgroundImage: "linear-gradient(#eff1f5, #d9d9df)", - border: "1px solid #888", - "&:active": { - backgroundImage: "linear-gradient(#b4b4b4, #d0d3d6)" - } - }, - "&dark .cm-button": { - backgroundImage: "linear-gradient(#393939, #111)", - border: "1px solid #888", - "&:active": { - backgroundImage: "linear-gradient(#111, #333)" - } - }, - ".cm-textfield": { - verticalAlign: "middle", - color: "inherit", - fontSize: "70%", - border: "1px solid silver", - padding: ".2em .5em" - }, - "&light .cm-textfield": { - backgroundColor: "white" - }, - "&dark .cm-textfield": { - border: "1px solid #555", - backgroundColor: "inherit" - } - }, lightDarkIDs3); - var observeOptions3 = { - childList: true, - characterData: true, - subtree: true, - attributes: true, - characterDataOldValue: true - }; - var useCharData3 = browser3.ie && browser3.ie_version <= 11; - var DOMObserver3 = class { - constructor(view, onChange, onScrollChanged) { - this.view = view; - this.onChange = onChange; - this.onScrollChanged = onScrollChanged; - this.active = false; - this.selectionRange = new DOMSelectionState3(); - this.selectionChanged = false; - this.delayedFlush = -1; - this.resizeTimeout = -1; - this.queue = []; - this.delayedAndroidKey = null; - this.scrollTargets = []; - this.intersection = null; - this.resize = null; - this.intersecting = false; - this.gapIntersection = null; - this.gaps = []; - this.parentCheck = -1; - this.dom = view.contentDOM; - this.observer = new MutationObserver((mutations) => { - for (let mut of mutations) - this.queue.push(mut); - if ((browser3.ie && browser3.ie_version <= 11 || browser3.ios && view.composing) && mutations.some((m) => m.type == "childList" && m.removedNodes.length || m.type == "characterData" && m.oldValue.length > m.target.nodeValue.length)) - this.flushSoon(); - else - this.flush(); - }); - if (useCharData3) - this.onCharData = (event) => { - this.queue.push({ - target: event.target, - type: "characterData", - oldValue: event.prevValue - }); - this.flushSoon(); - }; - this.onSelectionChange = this.onSelectionChange.bind(this); - window.addEventListener("resize", this.onResize = this.onResize.bind(this)); - if (typeof ResizeObserver == "function") { - this.resize = new ResizeObserver(() => { - if (this.view.docView.lastUpdate < Date.now() - 75) - this.onResize(); - }); - this.resize.observe(view.scrollDOM); - } - window.addEventListener("beforeprint", this.onPrint = this.onPrint.bind(this)); - this.start(); - window.addEventListener("scroll", this.onScroll = this.onScroll.bind(this)); - if (typeof IntersectionObserver == "function") { - this.intersection = new IntersectionObserver((entries) => { - if (this.parentCheck < 0) - this.parentCheck = setTimeout(this.listenForScroll.bind(this), 1e3); - if (entries.length > 0 && entries[entries.length - 1].intersectionRatio > 0 != this.intersecting) { - this.intersecting = !this.intersecting; - if (this.intersecting != this.view.inView) - this.onScrollChanged(document.createEvent("Event")); - } - }, {}); - this.intersection.observe(this.dom); - this.gapIntersection = new IntersectionObserver((entries) => { - if (entries.length > 0 && entries[entries.length - 1].intersectionRatio > 0) - this.onScrollChanged(document.createEvent("Event")); - }, {}); - } - this.listenForScroll(); - this.readSelectionRange(); - this.dom.ownerDocument.addEventListener("selectionchange", this.onSelectionChange); - } - onScroll(e) { - if (this.intersecting) - this.flush(false); - this.onScrollChanged(e); - } - onResize() { - if (this.resizeTimeout < 0) - this.resizeTimeout = setTimeout(() => { - this.resizeTimeout = -1; - this.view.requestMeasure(); - }, 50); - } - onPrint() { - this.view.viewState.printing = true; - this.view.measure(); - setTimeout(() => { - this.view.viewState.printing = false; - this.view.requestMeasure(); - }, 500); - } - updateGaps(gaps) { - if (this.gapIntersection && (gaps.length != this.gaps.length || this.gaps.some((g, i) => g != gaps[i]))) { - this.gapIntersection.disconnect(); - for (let gap of gaps) - this.gapIntersection.observe(gap); - this.gaps = gaps; - } - } - onSelectionChange(event) { - if (!this.readSelectionRange() || this.delayedAndroidKey) - return; - let { view } = this, sel = this.selectionRange; - if (view.state.facet(editable3) ? view.root.activeElement != this.dom : !hasSelection3(view.dom, sel)) - return; - let context = sel.anchorNode && view.docView.nearest(sel.anchorNode); - if (context && context.ignoreEvent(event)) - return; - if ((browser3.ie && browser3.ie_version <= 11 || browser3.android && browser3.chrome) && !view.state.selection.main.empty && sel.focusNode && isEquivalentPosition3(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset)) - this.flushSoon(); - else - this.flush(false); - } - readSelectionRange() { - let { root } = this.view, domSel = getSelection3(root); - let range = browser3.safari && root.nodeType == 11 && deepActiveElement3() == this.view.contentDOM && safariSelectionRangeHack3(this.view) || domSel; - if (this.selectionRange.eq(range)) - return false; - this.selectionRange.setRange(range); - return this.selectionChanged = true; - } - setSelectionRange(anchor, head) { - this.selectionRange.set(anchor.node, anchor.offset, head.node, head.offset); - this.selectionChanged = false; - } - listenForScroll() { - this.parentCheck = -1; - let i = 0, changed = null; - for (let dom = this.dom; dom; ) { - if (dom.nodeType == 1) { - if (!changed && i < this.scrollTargets.length && this.scrollTargets[i] == dom) - i++; - else if (!changed) - changed = this.scrollTargets.slice(0, i); - if (changed) - changed.push(dom); - dom = dom.assignedSlot || dom.parentNode; - } else if (dom.nodeType == 11) { - dom = dom.host; - } else { - break; - } - } - if (i < this.scrollTargets.length && !changed) - changed = this.scrollTargets.slice(0, i); - if (changed) { - for (let dom of this.scrollTargets) - dom.removeEventListener("scroll", this.onScroll); - for (let dom of this.scrollTargets = changed) - dom.addEventListener("scroll", this.onScroll); - } - } - ignore(f) { - if (!this.active) - return f(); - try { - this.stop(); - return f(); - } finally { - this.start(); - this.clear(); - } - } - start() { - if (this.active) - return; - this.observer.observe(this.dom, observeOptions3); - if (useCharData3) - this.dom.addEventListener("DOMCharacterDataModified", this.onCharData); - this.active = true; - } - stop() { - if (!this.active) - return; - this.active = false; - this.observer.disconnect(); - if (useCharData3) - this.dom.removeEventListener("DOMCharacterDataModified", this.onCharData); - } - clear() { - this.processRecords(); - this.queue.length = 0; - this.selectionChanged = false; - } - delayAndroidKey(key, keyCode) { - if (!this.delayedAndroidKey) - requestAnimationFrame(() => { - let key2 = this.delayedAndroidKey; - this.delayedAndroidKey = null; - let startState = this.view.state; - this.readSelectionRange(); - if (dispatchKey3(this.view.contentDOM, key2.key, key2.keyCode)) - this.processRecords(); - else - this.flush(); - if (this.view.state == startState) - this.view.update([]); - }); - if (!this.delayedAndroidKey || key == "Enter") - this.delayedAndroidKey = { key, keyCode }; - } - flushSoon() { - if (this.delayedFlush < 0) - this.delayedFlush = window.setTimeout(() => { - this.delayedFlush = -1; - this.flush(); - }, 20); - } - forceFlush() { - if (this.delayedFlush >= 0) { - window.clearTimeout(this.delayedFlush); - this.delayedFlush = -1; - this.flush(); - } - } - processRecords() { - let records = this.queue; - for (let mut of this.observer.takeRecords()) - records.push(mut); - if (records.length) - this.queue = []; - let from2 = -1, to = -1, typeOver = false; - for (let record of records) { - let range = this.readMutation(record); - if (!range) - continue; - if (range.typeOver) - typeOver = true; - if (from2 == -1) { - ({ from: from2, to } = range); - } else { - from2 = Math.min(range.from, from2); - to = Math.max(range.to, to); - } - } - return { from: from2, to, typeOver }; - } - flush(readSelection = true) { - if (this.delayedFlush >= 0 || this.delayedAndroidKey) - return; - if (readSelection) - this.readSelectionRange(); - let { from: from2, to, typeOver } = this.processRecords(); - let newSel = this.selectionChanged && hasSelection3(this.dom, this.selectionRange); - if (from2 < 0 && !newSel) - return; - this.selectionChanged = false; - let startState = this.view.state; - this.onChange(from2, to, typeOver); - if (this.view.state == startState) - this.view.update([]); - } - readMutation(rec) { - let cView = this.view.docView.nearest(rec.target); - if (!cView || cView.ignoreMutation(rec)) - return null; - cView.markDirty(rec.type == "attributes"); - if (rec.type == "attributes") - cView.dirty |= 4; - if (rec.type == "childList") { - let childBefore = findChild3(cView, rec.previousSibling || rec.target.previousSibling, -1); - let childAfter = findChild3(cView, rec.nextSibling || rec.target.nextSibling, 1); - return { - from: childBefore ? cView.posAfter(childBefore) : cView.posAtStart, - to: childAfter ? cView.posBefore(childAfter) : cView.posAtEnd, - typeOver: false - }; - } else if (rec.type == "characterData") { - return { from: cView.posAtStart, to: cView.posAtEnd, typeOver: rec.target.nodeValue == rec.oldValue }; - } else { - return null; - } - } - destroy() { - var _a4, _b, _c; - this.stop(); - (_a4 = this.intersection) === null || _a4 === void 0 ? void 0 : _a4.disconnect(); - (_b = this.gapIntersection) === null || _b === void 0 ? void 0 : _b.disconnect(); - (_c = this.resize) === null || _c === void 0 ? void 0 : _c.disconnect(); - for (let dom of this.scrollTargets) - dom.removeEventListener("scroll", this.onScroll); - window.removeEventListener("scroll", this.onScroll); - window.removeEventListener("resize", this.onResize); - window.removeEventListener("beforeprint", this.onPrint); - this.dom.ownerDocument.removeEventListener("selectionchange", this.onSelectionChange); - clearTimeout(this.parentCheck); - clearTimeout(this.resizeTimeout); - } - }; - function findChild3(cView, dom, dir) { - while (dom) { - let curView = ContentView3.get(dom); - if (curView && curView.parent == cView) - return curView; - let parent = dom.parentNode; - dom = parent != cView.dom ? parent : dir > 0 ? dom.nextSibling : dom.previousSibling; - } - return null; - } - function safariSelectionRangeHack3(view) { - let found = null; - function read(event) { - event.preventDefault(); - event.stopImmediatePropagation(); - found = event.getTargetRanges()[0]; - } - view.contentDOM.addEventListener("beforeinput", read, true); - document.execCommand("indent"); - view.contentDOM.removeEventListener("beforeinput", read, true); - if (!found) - return null; - let anchorNode = found.startContainer, anchorOffset = found.startOffset; - let focusNode = found.endContainer, focusOffset = found.endOffset; - let curAnchor = view.docView.domAtPos(view.state.selection.main.anchor); - if (isEquivalentPosition3(curAnchor.node, curAnchor.offset, focusNode, focusOffset)) - [anchorNode, anchorOffset, focusNode, focusOffset] = [focusNode, focusOffset, anchorNode, anchorOffset]; - return { anchorNode, anchorOffset, focusNode, focusOffset }; - } - function applyDOMChange3(view, start, end, typeOver) { - let change, newSel; - let sel = view.state.selection.main; - if (start > -1) { - let bounds = view.docView.domBoundsAround(start, end, 0); - if (!bounds || view.state.readOnly) - return; - let { from: from2, to } = bounds; - let selPoints = view.docView.impreciseHead || view.docView.impreciseAnchor ? [] : selectionPoints3(view); - let reader = new DOMReader3(selPoints, view.state); - reader.readRange(bounds.startDOM, bounds.endDOM); - let preferredPos = sel.from, preferredSide = null; - if (view.inputState.lastKeyCode === 8 && view.inputState.lastKeyTime > Date.now() - 100 || browser3.android && reader.text.length < to - from2) { - preferredPos = sel.to; - preferredSide = "end"; - } - let diff = findDiff3(view.state.doc.sliceString(from2, to, LineBreakPlaceholder3), reader.text, preferredPos - from2, preferredSide); - if (diff) { - if (browser3.chrome && view.inputState.lastKeyCode == 13 && diff.toB == diff.from + 2 && reader.text.slice(diff.from, diff.toB) == LineBreakPlaceholder3 + LineBreakPlaceholder3) - diff.toB--; - change = { - from: from2 + diff.from, - to: from2 + diff.toA, - insert: Text3.of(reader.text.slice(diff.from, diff.toB).split(LineBreakPlaceholder3)) - }; - } - newSel = selectionFromPoints3(selPoints, from2); - } else if (view.hasFocus || !view.state.facet(editable3)) { - let domSel = view.observer.selectionRange; - let { impreciseHead: iHead, impreciseAnchor: iAnchor } = view.docView; - let head = iHead && iHead.node == domSel.focusNode && iHead.offset == domSel.focusOffset || !contains3(view.contentDOM, domSel.focusNode) ? view.state.selection.main.head : view.docView.posFromDOM(domSel.focusNode, domSel.focusOffset); - let anchor = iAnchor && iAnchor.node == domSel.anchorNode && iAnchor.offset == domSel.anchorOffset || !contains3(view.contentDOM, domSel.anchorNode) ? view.state.selection.main.anchor : view.docView.posFromDOM(domSel.anchorNode, domSel.anchorOffset); - if (head != sel.head || anchor != sel.anchor) - newSel = EditorSelection3.single(anchor, head); - } - if (!change && !newSel) - return; - if (!change && typeOver && !sel.empty && newSel && newSel.main.empty) - change = { from: sel.from, to: sel.to, insert: view.state.doc.slice(sel.from, sel.to) }; - else if (change && change.from >= sel.from && change.to <= sel.to && (change.from != sel.from || change.to != sel.to) && sel.to - sel.from - (change.to - change.from) <= 4) - change = { - from: sel.from, - to: sel.to, - insert: view.state.doc.slice(sel.from, change.from).append(change.insert).append(view.state.doc.slice(change.to, sel.to)) - }; - if (change) { - let startState = view.state; - if (browser3.ios && view.inputState.flushIOSKey(view)) - return; - if (browser3.android && (change.from == sel.from && change.to == sel.to && change.insert.length == 1 && change.insert.lines == 2 && dispatchKey3(view.contentDOM, "Enter", 13) || change.from == sel.from - 1 && change.to == sel.to && change.insert.length == 0 && dispatchKey3(view.contentDOM, "Backspace", 8) || change.from == sel.from && change.to == sel.to + 1 && change.insert.length == 0 && dispatchKey3(view.contentDOM, "Delete", 46))) - return; - let text = change.insert.toString(); - if (view.state.facet(inputHandler4).some((h) => h(view, change.from, change.to, text))) - return; - if (view.inputState.composing >= 0) - view.inputState.composing++; - let tr; - if (change.from >= sel.from && change.to <= sel.to && change.to - change.from >= (sel.to - sel.from) / 3 && (!newSel || newSel.main.empty && newSel.main.from == change.from + change.insert.length) && view.inputState.composing < 0) { - let before = sel.from < change.from ? startState.sliceDoc(sel.from, change.from) : ""; - let after = sel.to > change.to ? startState.sliceDoc(change.to, sel.to) : ""; - tr = startState.replaceSelection(view.state.toText(before + change.insert.sliceString(0, void 0, view.state.lineBreak) + after)); - } else { - let changes = startState.changes(change); - let mainSel = newSel && !startState.selection.main.eq(newSel.main) && newSel.main.to <= changes.newLength ? newSel.main : void 0; - if (startState.selection.ranges.length > 1 && view.inputState.composing >= 0 && change.to <= sel.to && change.to >= sel.to - 10) { - let replaced = view.state.sliceDoc(change.from, change.to); - let compositionRange = compositionSurroundingNode3(view) || view.state.doc.lineAt(sel.head); - let offset = sel.to - change.to, size = sel.to - sel.from; - tr = startState.changeByRange((range) => { - if (range.from == sel.from && range.to == sel.to) - return { changes, range: mainSel || range.map(changes) }; - let to = range.to - offset, from2 = to - replaced.length; - if (range.to - range.from != size || view.state.sliceDoc(from2, to) != replaced || compositionRange && range.to >= compositionRange.from && range.from <= compositionRange.to) - return { range }; - let rangeChanges = startState.changes({ from: from2, to, insert: change.insert }), selOff = range.to - sel.to; - return { - changes: rangeChanges, - range: !mainSel ? range.map(rangeChanges) : EditorSelection3.range(Math.max(0, mainSel.anchor + selOff), Math.max(0, mainSel.head + selOff)) - }; - }); - } else { - tr = { - changes, - selection: mainSel && startState.selection.replaceRange(mainSel) - }; - } - } - let userEvent = "input.type"; - if (view.composing) { - userEvent += ".compose"; - if (view.inputState.compositionFirstChange) { - userEvent += ".start"; - view.inputState.compositionFirstChange = false; - } - } - view.dispatch(tr, { scrollIntoView: true, userEvent }); - } else if (newSel && !newSel.main.eq(sel)) { - let scrollIntoView5 = false, userEvent = "select"; - if (view.inputState.lastSelectionTime > Date.now() - 50) { - if (view.inputState.lastSelectionOrigin == "select") - scrollIntoView5 = true; - userEvent = view.inputState.lastSelectionOrigin; - } - view.dispatch({ selection: newSel, scrollIntoView: scrollIntoView5, userEvent }); - } - } - function findDiff3(a, b, preferredPos, preferredSide) { - let minLen = Math.min(a.length, b.length); - let from2 = 0; - while (from2 < minLen && a.charCodeAt(from2) == b.charCodeAt(from2)) - from2++; - if (from2 == minLen && a.length == b.length) - return null; - let toA = a.length, toB = b.length; - while (toA > 0 && toB > 0 && a.charCodeAt(toA - 1) == b.charCodeAt(toB - 1)) { - toA--; - toB--; - } - if (preferredSide == "end") { - let adjust = Math.max(0, from2 - Math.min(toA, toB)); - preferredPos -= toA + adjust - from2; - } - if (toA < from2 && a.length < b.length) { - let move = preferredPos <= from2 && preferredPos >= toA ? from2 - preferredPos : 0; - from2 -= move; - toB = from2 + (toB - toA); - toA = from2; - } else if (toB < from2) { - let move = preferredPos <= from2 && preferredPos >= toB ? from2 - preferredPos : 0; - from2 -= move; - toA = from2 + (toA - toB); - toB = from2; - } - return { from: from2, toA, toB }; - } - function selectionPoints3(view) { - let result = []; - if (view.root.activeElement != view.contentDOM) - return result; - let { anchorNode, anchorOffset, focusNode, focusOffset } = view.observer.selectionRange; - if (anchorNode) { - result.push(new DOMPoint3(anchorNode, anchorOffset)); - if (focusNode != anchorNode || focusOffset != anchorOffset) - result.push(new DOMPoint3(focusNode, focusOffset)); - } - return result; - } - function selectionFromPoints3(points, base2) { - if (points.length == 0) - return null; - let anchor = points[0].pos, head = points.length == 2 ? points[1].pos : anchor; - return anchor > -1 && head > -1 ? EditorSelection3.single(anchor + base2, head + base2) : null; - } - var EditorView3 = class { - constructor(config2 = {}) { - this.plugins = []; - this.pluginMap = /* @__PURE__ */ new Map(); - this.editorAttrs = {}; - this.contentAttrs = {}; - this.bidiCache = []; - this.destroyed = false; - this.updateState = 2; - this.measureScheduled = -1; - this.measureRequests = []; - this.contentDOM = document.createElement("div"); - this.scrollDOM = document.createElement("div"); - this.scrollDOM.tabIndex = -1; - this.scrollDOM.className = "cm-scroller"; - this.scrollDOM.appendChild(this.contentDOM); - this.announceDOM = document.createElement("div"); - this.announceDOM.style.cssText = "position: absolute; top: -10000px"; - this.announceDOM.setAttribute("aria-live", "polite"); - this.dom = document.createElement("div"); - this.dom.appendChild(this.announceDOM); - this.dom.appendChild(this.scrollDOM); - this._dispatch = config2.dispatch || ((tr) => this.update([tr])); - this.dispatch = this.dispatch.bind(this); - this.root = config2.root || getRoot3(config2.parent) || document; - this.viewState = new ViewState3(config2.state || EditorState3.create()); - this.plugins = this.state.facet(viewPlugin3).map((spec) => new PluginInstance3(spec)); - for (let plugin of this.plugins) - plugin.update(this); - this.observer = new DOMObserver3(this, (from2, to, typeOver) => { - applyDOMChange3(this, from2, to, typeOver); - }, (event) => { - this.inputState.runScrollHandlers(this, event); - if (this.observer.intersecting) - this.measure(); - }); - this.inputState = new InputState3(this); - this.inputState.ensureHandlers(this, this.plugins); - this.docView = new DocView3(this); - this.mountStyles(); - this.updateAttrs(); - this.updateState = 0; - this.requestMeasure(); - if (config2.parent) - config2.parent.appendChild(this.dom); - } - get state() { - return this.viewState.state; - } - get viewport() { - return this.viewState.viewport; - } - get visibleRanges() { - return this.viewState.visibleRanges; - } - get inView() { - return this.viewState.inView; - } - get composing() { - return this.inputState.composing > 0; - } - get compositionStarted() { - return this.inputState.composing >= 0; - } - dispatch(...input) { - this._dispatch(input.length == 1 && input[0] instanceof Transaction3 ? input[0] : this.state.update(...input)); - } - update(transactions) { - if (this.updateState != 0) - throw new Error("Calls to EditorView.update are not allowed while an update is in progress"); - let redrawn = false, update; - let state = this.state; - for (let tr of transactions) { - if (tr.startState != state) - throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state."); - state = tr.state; - } - if (this.destroyed) { - this.viewState.state = state; - return; - } - if (state.facet(EditorState3.phrases) != this.state.facet(EditorState3.phrases)) - return this.setState(state); - update = new ViewUpdate3(this, state, transactions); - let scrollTarget = this.viewState.scrollTarget; - try { - this.updateState = 2; - for (let tr of transactions) { - if (scrollTarget) - scrollTarget = scrollTarget.map(tr.changes); - if (tr.scrollIntoView) { - let { main } = tr.state.selection; - scrollTarget = new ScrollTarget3(main.empty ? main : EditorSelection3.cursor(main.head, main.head > main.anchor ? -1 : 1)); - } - for (let e of tr.effects) - if (e.is(scrollIntoView4)) - scrollTarget = e.value; - } - this.viewState.update(update, scrollTarget); - this.bidiCache = CachedOrder3.update(this.bidiCache, update.changes); - if (!update.empty) { - this.updatePlugins(update); - this.inputState.update(update); - } - redrawn = this.docView.update(update); - if (this.state.facet(styleModule3) != this.styleModules) - this.mountStyles(); - this.updateAttrs(); - this.showAnnouncements(transactions); - this.docView.updateSelection(redrawn, transactions.some((tr) => tr.isUserEvent("select.pointer"))); - } finally { - this.updateState = 0; - } - if (update.startState.facet(theme3) != update.state.facet(theme3)) - this.viewState.mustMeasureContent = true; - if (redrawn || scrollTarget || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent) - this.requestMeasure(); - if (!update.empty) - for (let listener of this.state.facet(updateListener3)) - listener(update); - } - setState(newState) { - if (this.updateState != 0) - throw new Error("Calls to EditorView.setState are not allowed while an update is in progress"); - if (this.destroyed) { - this.viewState.state = newState; - return; - } - this.updateState = 2; - let hadFocus = this.hasFocus; - try { - for (let plugin of this.plugins) - plugin.destroy(this); - this.viewState = new ViewState3(newState); - this.plugins = newState.facet(viewPlugin3).map((spec) => new PluginInstance3(spec)); - this.pluginMap.clear(); - for (let plugin of this.plugins) - plugin.update(this); - this.docView = new DocView3(this); - this.inputState.ensureHandlers(this, this.plugins); - this.mountStyles(); - this.updateAttrs(); - this.bidiCache = []; - } finally { - this.updateState = 0; - } - if (hadFocus) - this.focus(); - this.requestMeasure(); - } - updatePlugins(update) { - let prevSpecs = update.startState.facet(viewPlugin3), specs = update.state.facet(viewPlugin3); - if (prevSpecs != specs) { - let newPlugins = []; - for (let spec of specs) { - let found = prevSpecs.indexOf(spec); - if (found < 0) { - newPlugins.push(new PluginInstance3(spec)); - } else { - let plugin = this.plugins[found]; - plugin.mustUpdate = update; - newPlugins.push(plugin); - } - } - for (let plugin of this.plugins) - if (plugin.mustUpdate != update) - plugin.destroy(this); - this.plugins = newPlugins; - this.pluginMap.clear(); - this.inputState.ensureHandlers(this, this.plugins); - } else { - for (let p of this.plugins) - p.mustUpdate = update; - } - for (let i = 0; i < this.plugins.length; i++) - this.plugins[i].update(this); - } - measure(flush = true) { - if (this.destroyed) - return; - if (this.measureScheduled > -1) - cancelAnimationFrame(this.measureScheduled); - this.measureScheduled = 0; - if (flush) - this.observer.flush(); - let updated = null; - try { - for (let i = 0; ; i++) { - this.updateState = 1; - let oldViewport = this.viewport; - let changed = this.viewState.measure(this); - if (!changed && !this.measureRequests.length && this.viewState.scrollTarget == null) - break; - if (i > 5) { - console.warn(this.measureRequests.length ? "Measure loop restarted more than 5 times" : "Viewport failed to stabilize"); - break; - } - let measuring = []; - if (!(changed & 4)) - [this.measureRequests, measuring] = [measuring, this.measureRequests]; - let measured = measuring.map((m) => { - try { - return m.read(this); - } catch (e) { - logException3(this.state, e); - return BadMeasure3; - } - }); - let update = new ViewUpdate3(this, this.state), redrawn = false, scrolled = false; - update.flags |= changed; - if (!updated) - updated = update; - else - updated.flags |= changed; - this.updateState = 2; - if (!update.empty) { - this.updatePlugins(update); - this.inputState.update(update); - this.updateAttrs(); - redrawn = this.docView.update(update); - } - for (let i2 = 0; i2 < measuring.length; i2++) - if (measured[i2] != BadMeasure3) { - try { - let m = measuring[i2]; - if (m.write) - m.write(measured[i2], this); - } catch (e) { - logException3(this.state, e); - } - } - if (this.viewState.scrollTarget) { - this.docView.scrollIntoView(this.viewState.scrollTarget); - this.viewState.scrollTarget = null; - scrolled = true; - } - if (redrawn) - this.docView.updateSelection(true); - if (this.viewport.from == oldViewport.from && this.viewport.to == oldViewport.to && !scrolled && this.measureRequests.length == 0) - break; - } - } finally { - this.updateState = 0; - this.measureScheduled = -1; - } - if (updated && !updated.empty) - for (let listener of this.state.facet(updateListener3)) - listener(updated); - } - get themeClasses() { - return baseThemeID3 + " " + (this.state.facet(darkTheme3) ? baseDarkID3 : baseLightID3) + " " + this.state.facet(theme3); - } - updateAttrs() { - let editorAttrs = attrsFromFacet3(this, editorAttributes3, { - class: "cm-editor" + (this.hasFocus ? " cm-focused " : " ") + this.themeClasses - }); - let contentAttrs = { - spellcheck: "false", - autocorrect: "off", - autocapitalize: "off", - translate: "no", - contenteditable: !this.state.facet(editable3) ? "false" : "true", - class: "cm-content", - style: `${browser3.tabSize}: ${this.state.tabSize}`, - role: "textbox", - "aria-multiline": "true" - }; - if (this.state.readOnly) - contentAttrs["aria-readonly"] = "true"; - attrsFromFacet3(this, contentAttributes3, contentAttrs); - this.observer.ignore(() => { - updateAttrs3(this.contentDOM, this.contentAttrs, contentAttrs); - updateAttrs3(this.dom, this.editorAttrs, editorAttrs); - }); - this.editorAttrs = editorAttrs; - this.contentAttrs = contentAttrs; - } - showAnnouncements(trs) { - let first = true; - for (let tr of trs) - for (let effect of tr.effects) - if (effect.is(EditorView3.announce)) { - if (first) - this.announceDOM.textContent = ""; - first = false; - let div = this.announceDOM.appendChild(document.createElement("div")); - div.textContent = effect.value; - } - } - mountStyles() { - this.styleModules = this.state.facet(styleModule3); - StyleModule.mount(this.root, this.styleModules.concat(baseTheme$13).reverse()); - } - readMeasured() { - if (this.updateState == 2) - throw new Error("Reading the editor layout isn't allowed during an update"); - if (this.updateState == 0 && this.measureScheduled > -1) - this.measure(false); - } - requestMeasure(request) { - if (this.measureScheduled < 0) - this.measureScheduled = requestAnimationFrame(() => this.measure()); - if (request) { - if (request.key != null) - for (let i = 0; i < this.measureRequests.length; i++) { - if (this.measureRequests[i].key === request.key) { - this.measureRequests[i] = request; - return; - } - } - this.measureRequests.push(request); - } - } - plugin(plugin) { - let known = this.pluginMap.get(plugin); - if (known === void 0 || known && known.spec != plugin) - this.pluginMap.set(plugin, known = this.plugins.find((p) => p.spec == plugin) || null); - return known && known.update(this).value; - } - get documentTop() { - return this.contentDOM.getBoundingClientRect().top + this.viewState.paddingTop; - } - get documentPadding() { - return { top: this.viewState.paddingTop, bottom: this.viewState.paddingBottom }; - } - elementAtHeight(height) { - this.readMeasured(); - return this.viewState.elementAtHeight(height); - } - lineBlockAtHeight(height) { - this.readMeasured(); - return this.viewState.lineBlockAtHeight(height); - } - get viewportLineBlocks() { - return this.viewState.viewportLines; - } - lineBlockAt(pos) { - return this.viewState.lineBlockAt(pos); - } - get contentHeight() { - return this.viewState.contentHeight; - } - moveByChar(start, forward, by) { - return skipAtoms3(this, start, moveByChar3(this, start, forward, by)); - } - moveByGroup(start, forward) { - return skipAtoms3(this, start, moveByChar3(this, start, forward, (initial) => byGroup3(this, start.head, initial))); - } - moveToLineBoundary(start, forward, includeWrap = true) { - return moveToLineBoundary3(this, start, forward, includeWrap); - } - moveVertically(start, forward, distance) { - return skipAtoms3(this, start, moveVertically3(this, start, forward, distance)); - } - domAtPos(pos) { - return this.docView.domAtPos(pos); - } - posAtDOM(node, offset = 0) { - return this.docView.posFromDOM(node, offset); - } - posAtCoords(coords, precise = true) { - this.readMeasured(); - return posAtCoords3(this, coords, precise); - } - coordsAtPos(pos, side = 1) { - this.readMeasured(); - let rect = this.docView.coordsAt(pos, side); - if (!rect || rect.left == rect.right) - return rect; - let line = this.state.doc.lineAt(pos), order = this.bidiSpans(line); - let span2 = order[BidiSpan3.find(order, pos - line.from, -1, side)]; - return flattenRect3(rect, span2.dir == Direction3.LTR == side > 0); - } - get defaultCharacterWidth() { - return this.viewState.heightOracle.charWidth; - } - get defaultLineHeight() { - return this.viewState.heightOracle.lineHeight; - } - get textDirection() { - return this.viewState.defaultTextDirection; - } - textDirectionAt(pos) { - let perLine = this.state.facet(perLineTextDirection2); - if (!perLine || pos < this.viewport.from || pos > this.viewport.to) - return this.textDirection; - this.readMeasured(); - return this.docView.textDirectionAt(pos); - } - get lineWrapping() { - return this.viewState.heightOracle.lineWrapping; - } - bidiSpans(line) { - if (line.length > MaxBidiLine3) - return trivialOrder3(line.length); - let dir = this.textDirectionAt(line.from); - for (let entry of this.bidiCache) - if (entry.from == line.from && entry.dir == dir) - return entry.order; - let order = computeOrder3(line.text, dir); - this.bidiCache.push(new CachedOrder3(line.from, line.to, dir, order)); - return order; - } - get hasFocus() { - var _a4; - return (document.hasFocus() || browser3.safari && ((_a4 = this.inputState) === null || _a4 === void 0 ? void 0 : _a4.lastContextMenu) > Date.now() - 3e4) && this.root.activeElement == this.contentDOM; - } - focus() { - this.observer.ignore(() => { - focusPreventScroll3(this.contentDOM); - this.docView.updateSelection(); - }); - } - destroy() { - for (let plugin of this.plugins) - plugin.destroy(this); - this.plugins = []; - this.inputState.destroy(); - this.dom.remove(); - this.observer.destroy(); - if (this.measureScheduled > -1) - cancelAnimationFrame(this.measureScheduled); - this.destroyed = true; - } - static scrollIntoView(pos, options = {}) { - return scrollIntoView4.of(new ScrollTarget3(typeof pos == "number" ? EditorSelection3.cursor(pos) : pos, options.y, options.x, options.yMargin, options.xMargin)); - } - static domEventHandlers(handlers4) { - return ViewPlugin3.define(() => ({}), { eventHandlers: handlers4 }); - } - static theme(spec, options) { - let prefix = StyleModule.newName(); - let result = [theme3.of(prefix), styleModule3.of(buildTheme3(`.${prefix}`, spec))]; - if (options && options.dark) - result.push(darkTheme3.of(true)); - return result; - } - static baseTheme(spec) { - return Prec3.lowest(styleModule3.of(buildTheme3("." + baseThemeID3, spec, lightDarkIDs3))); - } - }; - EditorView3.styleModule = styleModule3; - EditorView3.inputHandler = inputHandler4; - EditorView3.perLineTextDirection = perLineTextDirection2; - EditorView3.exceptionSink = exceptionSink3; - EditorView3.updateListener = updateListener3; - EditorView3.editable = editable3; - EditorView3.mouseSelectionStyle = mouseSelectionStyle3; - EditorView3.dragMovesSelection = dragMovesSelection$13; - EditorView3.clickAddsSelectionRange = clickAddsSelectionRange3; - EditorView3.decorations = decorations3; - EditorView3.atomicRanges = atomicRanges2; - EditorView3.scrollMargins = scrollMargins2; - EditorView3.darkTheme = darkTheme3; - EditorView3.contentAttributes = contentAttributes3; - EditorView3.editorAttributes = editorAttributes3; - EditorView3.lineWrapping = /* @__PURE__ */ EditorView3.contentAttributes.of({ "class": "cm-lineWrapping" }); - EditorView3.announce = /* @__PURE__ */ StateEffect3.define(); - var MaxBidiLine3 = 4096; - var BadMeasure3 = {}; - var CachedOrder3 = class { - constructor(from2, to, dir, order) { - this.from = from2; - this.to = to; - this.dir = dir; - this.order = order; - } - static update(cache, changes) { - if (changes.empty) - return cache; - let result = [], lastDir = cache.length ? cache[cache.length - 1].dir : Direction3.LTR; - for (let i = Math.max(0, cache.length - 10); i < cache.length; i++) { - let entry = cache[i]; - if (entry.dir == lastDir && !changes.touchesRange(entry.from, entry.to)) - result.push(new CachedOrder3(changes.mapPos(entry.from, 1), changes.mapPos(entry.to, -1), entry.dir, entry.order)); - } - return result; + var pseudoClasses = /* @__PURE__ */ [ + "active", + "after", + "before", + "checked", + "default", + "disabled", + "empty", + "enabled", + "first-child", + "first-letter", + "first-line", + "first-of-type", + "focus", + "hover", + "in-range", + "indeterminate", + "invalid", + "lang", + "last-child", + "last-of-type", + "link", + "not", + "nth-child", + "nth-last-child", + "nth-last-of-type", + "nth-of-type", + "only-of-type", + "only-child", + "optional", + "out-of-range", + "placeholder", + "read-only", + "read-write", + "required", + "root", + "selection", + "target", + "valid", + "visited" + ].map((name2) => ({ type: "class", label: name2 })); + var values = /* @__PURE__ */ [ + "above", + "absolute", + "activeborder", + "additive", + "activecaption", + "after-white-space", + "ahead", + "alias", + "all", + "all-scroll", + "alphabetic", + "alternate", + "always", + "antialiased", + "appworkspace", + "asterisks", + "attr", + "auto", + "auto-flow", + "avoid", + "avoid-column", + "avoid-page", + "avoid-region", + "axis-pan", + "background", + "backwards", + "baseline", + "below", + "bidi-override", + "blink", + "block", + "block-axis", + "bold", + "bolder", + "border", + "border-box", + "both", + "bottom", + "break", + "break-all", + "break-word", + "bullets", + "button", + "button-bevel", + "buttonface", + "buttonhighlight", + "buttonshadow", + "buttontext", + "calc", + "capitalize", + "caps-lock-indicator", + "caption", + "captiontext", + "caret", + "cell", + "center", + "checkbox", + "circle", + "cjk-decimal", + "clear", + "clip", + "close-quote", + "col-resize", + "collapse", + "color", + "color-burn", + "color-dodge", + "column", + "column-reverse", + "compact", + "condensed", + "contain", + "content", + "contents", + "content-box", + "context-menu", + "continuous", + "copy", + "counter", + "counters", + "cover", + "crop", + "cross", + "crosshair", + "currentcolor", + "cursive", + "cyclic", + "darken", + "dashed", + "decimal", + "decimal-leading-zero", + "default", + "default-button", + "dense", + "destination-atop", + "destination-in", + "destination-out", + "destination-over", + "difference", + "disc", + "discard", + "disclosure-closed", + "disclosure-open", + "document", + "dot-dash", + "dot-dot-dash", + "dotted", + "double", + "down", + "e-resize", + "ease", + "ease-in", + "ease-in-out", + "ease-out", + "element", + "ellipse", + "ellipsis", + "embed", + "end", + "ethiopic-abegede-gez", + "ethiopic-halehame-aa-er", + "ethiopic-halehame-gez", + "ew-resize", + "exclusion", + "expanded", + "extends", + "extra-condensed", + "extra-expanded", + "fantasy", + "fast", + "fill", + "fill-box", + "fixed", + "flat", + "flex", + "flex-end", + "flex-start", + "footnotes", + "forwards", + "from", + "geometricPrecision", + "graytext", + "grid", + "groove", + "hand", + "hard-light", + "help", + "hidden", + "hide", + "higher", + "highlight", + "highlighttext", + "horizontal", + "hsl", + "hsla", + "hue", + "icon", + "ignore", + "inactiveborder", + "inactivecaption", + "inactivecaptiontext", + "infinite", + "infobackground", + "infotext", + "inherit", + "initial", + "inline", + "inline-axis", + "inline-block", + "inline-flex", + "inline-grid", + "inline-table", + "inset", + "inside", + "intrinsic", + "invert", + "italic", + "justify", + "keep-all", + "landscape", + "large", + "larger", + "left", + "level", + "lighter", + "lighten", + "line-through", + "linear", + "linear-gradient", + "lines", + "list-item", + "listbox", + "listitem", + "local", + "logical", + "loud", + "lower", + "lower-hexadecimal", + "lower-latin", + "lower-norwegian", + "lowercase", + "ltr", + "luminosity", + "manipulation", + "match", + "matrix", + "matrix3d", + "medium", + "menu", + "menutext", + "message-box", + "middle", + "min-intrinsic", + "mix", + "monospace", + "move", + "multiple", + "multiple_mask_images", + "multiply", + "n-resize", + "narrower", + "ne-resize", + "nesw-resize", + "no-close-quote", + "no-drop", + "no-open-quote", + "no-repeat", + "none", + "normal", + "not-allowed", + "nowrap", + "ns-resize", + "numbers", + "numeric", + "nw-resize", + "nwse-resize", + "oblique", + "opacity", + "open-quote", + "optimizeLegibility", + "optimizeSpeed", + "outset", + "outside", + "outside-shape", + "overlay", + "overline", + "padding", + "padding-box", + "painted", + "page", + "paused", + "perspective", + "pinch-zoom", + "plus-darker", + "plus-lighter", + "pointer", + "polygon", + "portrait", + "pre", + "pre-line", + "pre-wrap", + "preserve-3d", + "progress", + "push-button", + "radial-gradient", + "radio", + "read-only", + "read-write", + "read-write-plaintext-only", + "rectangle", + "region", + "relative", + "repeat", + "repeating-linear-gradient", + "repeating-radial-gradient", + "repeat-x", + "repeat-y", + "reset", + "reverse", + "rgb", + "rgba", + "ridge", + "right", + "rotate", + "rotate3d", + "rotateX", + "rotateY", + "rotateZ", + "round", + "row", + "row-resize", + "row-reverse", + "rtl", + "run-in", + "running", + "s-resize", + "sans-serif", + "saturation", + "scale", + "scale3d", + "scaleX", + "scaleY", + "scaleZ", + "screen", + "scroll", + "scrollbar", + "scroll-position", + "se-resize", + "self-start", + "self-end", + "semi-condensed", + "semi-expanded", + "separate", + "serif", + "show", + "single", + "skew", + "skewX", + "skewY", + "skip-white-space", + "slide", + "slider-horizontal", + "slider-vertical", + "sliderthumb-horizontal", + "sliderthumb-vertical", + "slow", + "small", + "small-caps", + "small-caption", + "smaller", + "soft-light", + "solid", + "source-atop", + "source-in", + "source-out", + "source-over", + "space", + "space-around", + "space-between", + "space-evenly", + "spell-out", + "square", + "start", + "static", + "status-bar", + "stretch", + "stroke", + "stroke-box", + "sub", + "subpixel-antialiased", + "svg_masks", + "super", + "sw-resize", + "symbolic", + "symbols", + "system-ui", + "table", + "table-caption", + "table-cell", + "table-column", + "table-column-group", + "table-footer-group", + "table-header-group", + "table-row", + "table-row-group", + "text", + "text-bottom", + "text-top", + "textarea", + "textfield", + "thick", + "thin", + "threeddarkshadow", + "threedface", + "threedhighlight", + "threedlightshadow", + "threedshadow", + "to", + "top", + "transform", + "translate", + "translate3d", + "translateX", + "translateY", + "translateZ", + "transparent", + "ultra-condensed", + "ultra-expanded", + "underline", + "unidirectional-pan", + "unset", + "up", + "upper-latin", + "uppercase", + "url", + "var", + "vertical", + "vertical-text", + "view-box", + "visible", + "visibleFill", + "visiblePainted", + "visibleStroke", + "visual", + "w-resize", + "wait", + "wave", + "wider", + "window", + "windowframe", + "windowtext", + "words", + "wrap", + "wrap-reverse", + "x-large", + "x-small", + "xor", + "xx-large", + "xx-small" + ].map((name2) => ({ type: "keyword", label: name2 })).concat(/* @__PURE__ */ [ + "aliceblue", + "antiquewhite", + "aqua", + "aquamarine", + "azure", + "beige", + "bisque", + "black", + "blanchedalmond", + "blue", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "fuchsia", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "gray", + "grey", + "green", + "greenyellow", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightsteelblue", + "lightyellow", + "lime", + "limegreen", + "linen", + "magenta", + "maroon", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "navy", + "oldlace", + "olive", + "olivedrab", + "orange", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "purple", + "rebeccapurple", + "red", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "silver", + "skyblue", + "slateblue", + "slategray", + "snow", + "springgreen", + "steelblue", + "tan", + "teal", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "white", + "whitesmoke", + "yellow", + "yellowgreen" + ].map((name2) => ({ type: "constant", label: name2 }))); + var tags2 = /* @__PURE__ */ [ + "a", + "abbr", + "address", + "article", + "aside", + "b", + "bdi", + "bdo", + "blockquote", + "body", + "br", + "button", + "canvas", + "caption", + "cite", + "code", + "col", + "colgroup", + "dd", + "del", + "details", + "dfn", + "dialog", + "div", + "dl", + "dt", + "em", + "figcaption", + "figure", + "footer", + "form", + "header", + "hgroup", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "hr", + "html", + "i", + "iframe", + "img", + "input", + "ins", + "kbd", + "label", + "legend", + "li", + "main", + "meter", + "nav", + "ol", + "output", + "p", + "pre", + "ruby", + "section", + "select", + "small", + "source", + "span", + "strong", + "sub", + "summary", + "sup", + "table", + "tbody", + "td", + "template", + "textarea", + "tfoot", + "th", + "thead", + "tr", + "u", + "ul" + ].map((name2) => ({ type: "type", label: name2 })); + var span = /^[\w-]*/; + var cssCompletionSource = (context) => { + let { state, pos } = context, node = syntaxTree(state).resolveInner(pos, -1); + if (node.name == "PropertyName") + return { from: node.from, options: properties(), span }; + if (node.name == "ValueName") + return { from: node.from, options: values, span }; + if (node.name == "PseudoClassName") + return { from: node.from, options: pseudoClasses, span }; + if (node.name == "TagName") { + for (let { parent } = node; parent; parent = parent.parent) + if (parent.name == "Block") + return { from: node.from, options: properties(), span }; + return { from: node.from, options: tags2, span }; } + if (!context.explicit) + return null; + let above = node.resolve(pos), before = above.childBefore(pos); + if (before && before.name == ":" && above.name == "PseudoClassSelector") + return { from: pos, options: pseudoClasses, span }; + if (before && before.name == ":" && above.name == "Declaration" || above.name == "ArgList") + return { from: pos, options: values, span }; + if (above.name == "Block") + return { from: pos, options: properties(), span }; + return null; }; - function attrsFromFacet3(view, facet, base2) { - for (let sources = view.state.facet(facet), i = sources.length - 1; i >= 0; i--) { - let source = sources[i], value = typeof source == "function" ? source(view) : source; - if (value) - combineAttrs3(value, base2); + var cssLanguage = /* @__PURE__ */ LRLanguage.define({ + parser: /* @__PURE__ */ parser5.configure({ + props: [ + /* @__PURE__ */ indentNodeProp.add({ + Declaration: /* @__PURE__ */ continuedIndent() + }), + /* @__PURE__ */ foldNodeProp.add({ + Block: foldInside + }), + /* @__PURE__ */ styleTags({ + "import charset namespace keyframes": tags.definitionKeyword, + "media supports": tags.controlKeyword, + "from to selector": tags.keyword, + NamespaceName: tags.namespace, + KeyframeName: tags.labelName, + TagName: tags.tagName, + ClassName: tags.className, + PseudoClassName: /* @__PURE__ */ tags.constant(tags.className), + IdName: tags.labelName, + "FeatureName PropertyName": tags.propertyName, + AttributeName: tags.attributeName, + NumberLiteral: tags.number, + KeywordQuery: tags.keyword, + UnaryQueryOp: tags.operatorKeyword, + "CallTag ValueName": tags.atom, + VariableName: tags.variableName, + Callee: tags.operatorKeyword, + Unit: tags.unit, + "UniversalSelector NestingSelector": tags.definitionOperator, + AtKeyword: tags.keyword, + MatchOp: tags.compareOperator, + "ChildOp SiblingOp, LogicOp": tags.logicOperator, + BinOp: tags.arithmeticOperator, + Important: tags.modifier, + Comment: tags.blockComment, + ParenthesizedContent: /* @__PURE__ */ tags.special(tags.name), + ColorLiteral: tags.color, + StringLiteral: tags.string, + ":": tags.punctuation, + "PseudoOp #": tags.derefOperator, + "; ,": tags.separator, + "( )": tags.paren, + "[ ]": tags.squareBracket, + "{ }": tags.brace + }) + ] + }), + languageData: { + commentTokens: { block: { open: "/*", close: "*/" } }, + indentOnInput: /^\s*\}$/, + wordChars: "-" } - return base2; + }); + var cssCompletion = /* @__PURE__ */ cssLanguage.data.of({ autocomplete: cssCompletionSource }); + function css() { + return new LanguageSupport(cssLanguage, cssCompletion); } - var currentPlatform3 = browser3.mac ? "mac" : browser3.windows ? "win" : browser3.linux ? "linux" : "key"; - var CanHidePrimary3 = !browser3.ios; - var themeSpec3 = { - ".cm-line": { - "& ::selection": { backgroundColor: "transparent !important" }, - "&::selection": { backgroundColor: "transparent !important" } - } - }; - if (CanHidePrimary3) - themeSpec3[".cm-line"].caretColor = "transparent !important"; - var UnicodeRegexpSupport3 = /x/.unicode != null ? "gu" : "g"; - var baseTheme12 = /* @__PURE__ */ EditorView3.baseTheme({ - ".cm-tooltip": { - zIndex: 100 + + // node_modules/@codemirror/lang-html/dist/index.js + var Targets = ["_blank", "_self", "_top", "_parent"]; + var Charsets = ["ascii", "utf-8", "utf-16", "latin1", "latin1"]; + var Methods = ["get", "post", "put", "delete"]; + var Encs = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]; + var Bool = ["true", "false"]; + var S = {}; + var Tags = { + a: { + attrs: { + href: null, + ping: null, + type: null, + media: null, + target: Targets, + hreflang: null + } }, - "&light .cm-tooltip": { - border: "1px solid #bbb", - backgroundColor: "#f5f5f5" + abbr: S, + acronym: S, + address: S, + applet: S, + area: { + attrs: { + alt: null, + coords: null, + href: null, + target: null, + ping: null, + media: null, + hreflang: null, + type: null, + shape: ["default", "rect", "circle", "poly"] + } + }, + article: S, + aside: S, + audio: { + attrs: { + src: null, + mediagroup: null, + crossorigin: ["anonymous", "use-credentials"], + preload: ["none", "metadata", "auto"], + autoplay: ["autoplay"], + loop: ["loop"], + controls: ["controls"] + } + }, + b: S, + base: { attrs: { href: null, target: Targets } }, + basefont: S, + bdi: S, + bdo: S, + big: S, + blockquote: { attrs: { cite: null } }, + body: S, + br: S, + button: { + attrs: { + form: null, + formaction: null, + name: null, + value: null, + autofocus: ["autofocus"], + disabled: ["autofocus"], + formenctype: Encs, + formmethod: Methods, + formnovalidate: ["novalidate"], + formtarget: Targets, + type: ["submit", "reset", "button"] + } + }, + canvas: { attrs: { width: null, height: null } }, + caption: S, + center: S, + cite: S, + code: S, + col: { attrs: { span: null } }, + colgroup: { attrs: { span: null } }, + command: { + attrs: { + type: ["command", "checkbox", "radio"], + label: null, + icon: null, + radiogroup: null, + command: null, + title: null, + disabled: ["disabled"], + checked: ["checked"] + } + }, + data: { attrs: { value: null } }, + datagrid: { attrs: { disabled: ["disabled"], multiple: ["multiple"] } }, + datalist: { attrs: { data: null } }, + dd: S, + del: { attrs: { cite: null, datetime: null } }, + details: { attrs: { open: ["open"] } }, + dfn: S, + dir: S, + div: S, + dl: S, + dt: S, + em: S, + embed: { attrs: { src: null, type: null, width: null, height: null } }, + eventsource: { attrs: { src: null } }, + fieldset: { attrs: { disabled: ["disabled"], form: null, name: null } }, + figcaption: S, + figure: S, + font: S, + footer: S, + form: { + attrs: { + action: null, + name: null, + "accept-charset": Charsets, + autocomplete: ["on", "off"], + enctype: Encs, + method: Methods, + novalidate: ["novalidate"], + target: Targets + } + }, + frame: S, + frameset: S, + h1: S, + h2: S, + h3: S, + h4: S, + h5: S, + h6: S, + head: { + children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"] + }, + header: S, + hgroup: S, + hr: S, + html: { + attrs: { manifest: null } + }, + i: S, + iframe: { + attrs: { + src: null, + srcdoc: null, + name: null, + width: null, + height: null, + sandbox: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"], + seamless: ["seamless"] + } }, - "&light .cm-tooltip-section:not(:first-child)": { - borderTop: "1px solid #bbb" + img: { + attrs: { + alt: null, + src: null, + ismap: null, + usemap: null, + width: null, + height: null, + crossorigin: ["anonymous", "use-credentials"] + } }, - "&dark .cm-tooltip": { - backgroundColor: "#333338", - color: "white" + input: { + attrs: { + alt: null, + dirname: null, + form: null, + formaction: null, + height: null, + list: null, + max: null, + maxlength: null, + min: null, + name: null, + pattern: null, + placeholder: null, + size: null, + src: null, + step: null, + value: null, + width: null, + accept: ["audio/*", "video/*", "image/*"], + autocomplete: ["on", "off"], + autofocus: ["autofocus"], + checked: ["checked"], + disabled: ["disabled"], + formenctype: Encs, + formmethod: Methods, + formnovalidate: ["novalidate"], + formtarget: Targets, + multiple: ["multiple"], + readonly: ["readonly"], + required: ["required"], + type: [ + "hidden", + "text", + "search", + "tel", + "url", + "email", + "password", + "datetime", + "date", + "month", + "week", + "time", + "datetime-local", + "number", + "range", + "color", + "checkbox", + "radio", + "file", + "submit", + "image", + "reset", + "button" + ] + } }, - ".cm-tooltip-arrow": { - height: `${7}px`, - width: `${7 * 2}px`, - position: "absolute", - zIndex: -1, - overflow: "hidden", - "&:before, &:after": { - content: "''", - position: "absolute", - width: 0, - height: 0, - borderLeft: `${7}px solid transparent`, - borderRight: `${7}px solid transparent` - }, - ".cm-tooltip-above &": { - bottom: `-${7}px`, - "&:before": { - borderTop: `${7}px solid #bbb` - }, - "&:after": { - borderTop: `${7}px solid #f5f5f5`, - bottom: "1px" - } - }, - ".cm-tooltip-below &": { - top: `-${7}px`, - "&:before": { - borderBottom: `${7}px solid #bbb` - }, - "&:after": { - borderBottom: `${7}px solid #f5f5f5`, - top: "1px" - } + ins: { attrs: { cite: null, datetime: null } }, + kbd: S, + keygen: { + attrs: { + challenge: null, + form: null, + name: null, + autofocus: ["autofocus"], + disabled: ["disabled"], + keytype: ["RSA"] } }, - "&dark .cm-tooltip .cm-tooltip-arrow": { - "&:before": { - borderTopColor: "#333338", - borderBottomColor: "#333338" - }, - "&:after": { - borderTopColor: "transparent", - borderBottomColor: "transparent" + label: { attrs: { for: null, form: null } }, + legend: S, + li: { attrs: { value: null } }, + link: { + attrs: { + href: null, + type: null, + hreflang: null, + media: null, + sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"] } - } - }); - var GutterMarker3 = class extends RangeValue3 { - compare(other) { - return this == other || this.constructor == other.constructor && this.eq(other); - } - eq(other) { - return false; - } - destroy(dom) { - } - }; - GutterMarker3.prototype.elementClass = ""; - GutterMarker3.prototype.toDOM = void 0; - GutterMarker3.prototype.mapMode = MapMode3.TrackBefore; - GutterMarker3.prototype.startSide = GutterMarker3.prototype.endSide = -1; - GutterMarker3.prototype.point = true; - - // node_modules/@codemirror/lang-json/node_modules/@codemirror/language/dist/index.js - var _a3; - var languageDataProp3 = /* @__PURE__ */ new NodeProp6(); - function defineLanguageFacet3(baseData) { - return Facet3.define({ - combine: baseData ? (values2) => values2.concat(baseData) : void 0 - }); - } - var Language3 = class { - constructor(data, parser7, extraExtensions = []) { - this.data = data; - if (!EditorState3.prototype.hasOwnProperty("tree")) - Object.defineProperty(EditorState3.prototype, "tree", { get() { - return syntaxTree3(this); - } }); - this.parser = parser7; - this.extension = [ - language3.of(this), - EditorState3.languageData.of((state, pos, side) => state.facet(languageDataFacetAt3(state, pos, side))) - ].concat(extraExtensions); - } - isActiveAt(state, pos, side = -1) { - return languageDataFacetAt3(state, pos, side) == this.data; - } - findRegions(state) { - let lang = state.facet(language3); - if ((lang === null || lang === void 0 ? void 0 : lang.data) == this.data) - return [{ from: 0, to: state.doc.length }]; - if (!lang || !lang.allowsNesting) - return []; - let result = []; - let explore = (tree, from2) => { - if (tree.prop(languageDataProp3) == this.data) { - result.push({ from: from2, to: from2 + tree.length }); - return; - } - let mount = tree.prop(NodeProp6.mounted); - if (mount) { - if (mount.tree.prop(languageDataProp3) == this.data) { - if (mount.overlay) - for (let r of mount.overlay) - result.push({ from: r.from + from2, to: r.to + from2 }); - else - result.push({ from: from2, to: from2 + tree.length }); - return; - } else if (mount.overlay) { - let size = result.length; - explore(mount.tree, mount.overlay[0].from + from2); - if (result.length > size) - return; - } - } - for (let i = 0; i < tree.children.length; i++) { - let ch = tree.children[i]; - if (ch instanceof Tree6) - explore(ch, tree.positions[i] + from2); - } - }; - explore(syntaxTree3(state), 0); - return result; - } - get allowsNesting() { - return true; - } - }; - Language3.setState = /* @__PURE__ */ StateEffect3.define(); - function languageDataFacetAt3(state, pos, side) { - let topLang = state.facet(language3); - if (!topLang) - return null; - let facet = topLang.data; - if (topLang.allowsNesting) { - for (let node = syntaxTree3(state).topNode; node; node = node.enter(pos, side, IterMode5.ExcludeBuffers)) - facet = node.type.prop(languageDataProp3) || facet; - } - return facet; - } - var LRLanguage3 = class extends Language3 { - constructor(data, parser7) { - super(data, parser7); - this.parser = parser7; - } - static define(spec) { - let data = defineLanguageFacet3(spec.languageData); - return new LRLanguage3(data, spec.parser.configure({ - props: [languageDataProp3.add((type) => type.isTop ? data : void 0)] - })); - } - configure(options) { - return new LRLanguage3(this.data, this.parser.configure(options)); - } - get allowsNesting() { - return this.parser.hasWrappers(); - } - }; - function syntaxTree3(state) { - let field = state.field(Language3.state, false); - return field ? field.tree : Tree6.empty; - } - var DocInput3 = class { - constructor(doc4, length = doc4.length) { - this.doc = doc4; - this.length = length; - this.cursorPos = 0; - this.string = ""; - this.cursor = doc4.iter(); - } - syncTo(pos) { - this.string = this.cursor.next(pos - this.cursorPos).value; - this.cursorPos = pos + this.string.length; - return this.cursorPos - this.string.length; - } - chunk(pos) { - this.syncTo(pos); - return this.string; - } - get lineChunks() { - return true; - } - read(from2, to) { - let stringStart = this.cursorPos - this.string.length; - if (from2 < stringStart || to >= this.cursorPos) - return this.doc.sliceString(from2, to); - else - return this.string.slice(from2 - stringStart, to - stringStart); - } - }; - var currentContext3 = null; - var ParseContext3 = class { - constructor(parser7, state, fragments = [], tree, treeLen, viewport, skipped, scheduleOn) { - this.parser = parser7; - this.state = state; - this.fragments = fragments; - this.tree = tree; - this.treeLen = treeLen; - this.viewport = viewport; - this.skipped = skipped; - this.scheduleOn = scheduleOn; - this.parse = null; - this.tempSkipped = []; - } - startParse() { - return this.parser.startParse(new DocInput3(this.state.doc), this.fragments); - } - work(until, upto) { - if (upto != null && upto >= this.state.doc.length) - upto = void 0; - if (this.tree != Tree6.empty && this.isDone(upto !== null && upto !== void 0 ? upto : this.state.doc.length)) { - this.takeTree(); - return true; + }, + map: { attrs: { name: null } }, + mark: S, + menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } }, + meta: { + attrs: { + content: null, + charset: Charsets, + name: ["viewport", "application-name", "author", "description", "generator", "keywords"], + "http-equiv": ["content-language", "content-type", "default-style", "refresh"] } - return this.withContext(() => { - var _a4; - if (typeof until == "number") { - let endTime = Date.now() + until; - until = () => Date.now() > endTime; - } - if (!this.parse) - this.parse = this.startParse(); - if (upto != null && (this.parse.stoppedAt == null || this.parse.stoppedAt > upto) && upto < this.state.doc.length) - this.parse.stopAt(upto); - for (; ; ) { - let done = this.parse.advance(); - if (done) { - this.fragments = this.withoutTempSkipped(TreeFragment3.addTree(done, this.fragments, this.parse.stoppedAt != null)); - this.treeLen = (_a4 = this.parse.stoppedAt) !== null && _a4 !== void 0 ? _a4 : this.state.doc.length; - this.tree = done; - this.parse = null; - if (this.treeLen < (upto !== null && upto !== void 0 ? upto : this.state.doc.length)) - this.parse = this.startParse(); - else - return true; - } - if (until()) - return false; - } - }); - } - takeTree() { - let pos, tree; - if (this.parse && (pos = this.parse.parsedPos) >= this.treeLen) { - if (this.parse.stoppedAt == null || this.parse.stoppedAt > pos) - this.parse.stopAt(pos); - this.withContext(() => { - while (!(tree = this.parse.advance())) { - } - }); - this.treeLen = pos; - this.tree = tree; - this.fragments = this.withoutTempSkipped(TreeFragment3.addTree(this.tree, this.fragments, true)); - this.parse = null; + }, + meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } }, + nav: S, + noframes: S, + noscript: S, + object: { + attrs: { + data: null, + type: null, + name: null, + usemap: null, + form: null, + width: null, + height: null, + typemustmatch: ["typemustmatch"] } - } - withContext(f) { - let prev = currentContext3; - currentContext3 = this; - try { - return f(); - } finally { - currentContext3 = prev; + }, + ol: { + attrs: { reversed: ["reversed"], start: null, type: ["1", "a", "A", "i", "I"] }, + children: ["li", "script", "template", "ul", "ol"] + }, + optgroup: { attrs: { disabled: ["disabled"], label: null } }, + option: { attrs: { disabled: ["disabled"], label: null, selected: ["selected"], value: null } }, + output: { attrs: { for: null, form: null, name: null } }, + p: S, + param: { attrs: { name: null, value: null } }, + pre: S, + progress: { attrs: { value: null, max: null } }, + q: { attrs: { cite: null } }, + rp: S, + rt: S, + ruby: S, + s: S, + samp: S, + script: { + attrs: { + type: ["text/javascript"], + src: null, + async: ["async"], + defer: ["defer"], + charset: Charsets } - } - withoutTempSkipped(fragments) { - for (let r; r = this.tempSkipped.pop(); ) - fragments = cutFragments3(fragments, r.from, r.to); - return fragments; - } - changes(changes, newState) { - let { fragments, tree, treeLen, viewport, skipped } = this; - this.takeTree(); - if (!changes.empty) { - let ranges = []; - changes.iterChangedRanges((fromA, toA, fromB, toB) => ranges.push({ fromA, toA, fromB, toB })); - fragments = TreeFragment3.applyChanges(fragments, ranges); - tree = Tree6.empty; - treeLen = 0; - viewport = { from: changes.mapPos(viewport.from, -1), to: changes.mapPos(viewport.to, 1) }; - if (this.skipped.length) { - skipped = []; - for (let r of this.skipped) { - let from2 = changes.mapPos(r.from, 1), to = changes.mapPos(r.to, -1); - if (from2 < to) - skipped.push({ from: from2, to }); - } - } + }, + section: S, + select: { + attrs: { + form: null, + name: null, + size: null, + autofocus: ["autofocus"], + disabled: ["disabled"], + multiple: ["multiple"] } - return new ParseContext3(this.parser, newState, fragments, tree, treeLen, viewport, skipped, this.scheduleOn); - } - updateViewport(viewport) { - if (this.viewport.from == viewport.from && this.viewport.to == viewport.to) - return false; - this.viewport = viewport; - let startLen = this.skipped.length; - for (let i = 0; i < this.skipped.length; i++) { - let { from: from2, to } = this.skipped[i]; - if (from2 < viewport.to && to > viewport.from) { - this.fragments = cutFragments3(this.fragments, from2, to); - this.skipped.splice(i--, 1); - } + }, + small: S, + source: { attrs: { src: null, type: null, media: null } }, + span: S, + strike: S, + strong: S, + style: { + attrs: { + type: ["text/css"], + media: null, + scoped: null } - if (this.skipped.length >= startLen) - return false; - this.reset(); - return true; - } - reset() { - if (this.parse) { - this.takeTree(); - this.parse = null; + }, + sub: S, + summary: S, + sup: S, + table: S, + tbody: S, + td: { attrs: { colspan: null, rowspan: null, headers: null } }, + textarea: { + attrs: { + dirname: null, + form: null, + maxlength: null, + name: null, + placeholder: null, + rows: null, + cols: null, + autofocus: ["autofocus"], + disabled: ["disabled"], + readonly: ["readonly"], + required: ["required"], + wrap: ["soft", "hard"] } - } - skipUntilInView(from2, to) { - this.skipped.push({ from: from2, to }); - } - static getSkippingParser(until) { - return new class extends Parser5 { - createParse(input, fragments, ranges) { - let from2 = ranges[0].from, to = ranges[ranges.length - 1].to; - let parser7 = { - parsedPos: from2, - advance() { - let cx = currentContext3; - if (cx) { - for (let r of ranges) - cx.tempSkipped.push(r); - if (until) - cx.scheduleOn = cx.scheduleOn ? Promise.all([cx.scheduleOn, until]) : until; - } - this.parsedPos = to; - return new Tree6(NodeType6.none, [], [], to - from2); - }, - stoppedAt: null, - stopAt() { - } - }; - return parser7; - } - }(); - } - isDone(upto) { - upto = Math.min(upto, this.state.doc.length); - let frags = this.fragments; - return this.treeLen >= upto && frags.length && frags[0].from == 0 && frags[0].to >= upto; - } - static get() { - return currentContext3; - } + }, + tfoot: S, + th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } }, + thead: S, + time: { attrs: { datetime: null } }, + title: S, + tr: S, + track: { + attrs: { + src: null, + label: null, + default: null, + kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"], + srclang: null + } + }, + tt: S, + u: S, + ul: { children: ["li", "script", "template", "ul", "ol"] }, + var: S, + video: { + attrs: { + src: null, + poster: null, + width: null, + height: null, + crossorigin: ["anonymous", "use-credentials"], + preload: ["auto", "metadata", "none"], + autoplay: ["autoplay"], + mediagroup: ["movie"], + muted: ["muted"], + controls: ["controls"] + } + }, + wbr: S + }; + var GlobalAttrs = { + accesskey: null, + class: null, + contenteditable: Bool, + contextmenu: null, + dir: ["ltr", "rtl", "auto"], + draggable: ["true", "false", "auto"], + dropzone: ["copy", "move", "link", "string:", "file:"], + hidden: ["hidden"], + id: null, + inert: ["inert"], + itemid: null, + itemprop: null, + itemref: null, + itemscope: ["itemscope"], + itemtype: null, + lang: ["ar", "bn", "de", "en-GB", "en-US", "es", "fr", "hi", "id", "ja", "pa", "pt", "ru", "tr", "zh"], + spellcheck: Bool, + autocorrect: Bool, + autocapitalize: Bool, + style: null, + tabindex: null, + title: null, + translate: ["yes", "no"], + onclick: null, + rel: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"], + role: /* @__PURE__ */ "alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "), + "aria-activedescendant": null, + "aria-atomic": Bool, + "aria-autocomplete": ["inline", "list", "both", "none"], + "aria-busy": Bool, + "aria-checked": ["true", "false", "mixed", "undefined"], + "aria-controls": null, + "aria-describedby": null, + "aria-disabled": Bool, + "aria-dropeffect": null, + "aria-expanded": ["true", "false", "undefined"], + "aria-flowto": null, + "aria-grabbed": ["true", "false", "undefined"], + "aria-haspopup": Bool, + "aria-hidden": Bool, + "aria-invalid": ["true", "false", "grammar", "spelling"], + "aria-label": null, + "aria-labelledby": null, + "aria-level": null, + "aria-live": ["off", "polite", "assertive"], + "aria-multiline": Bool, + "aria-multiselectable": Bool, + "aria-owns": null, + "aria-posinset": null, + "aria-pressed": ["true", "false", "mixed", "undefined"], + "aria-readonly": Bool, + "aria-relevant": null, + "aria-required": Bool, + "aria-selected": ["true", "false", "undefined"], + "aria-setsize": null, + "aria-sort": ["ascending", "descending", "none", "other"], + "aria-valuemax": null, + "aria-valuemin": null, + "aria-valuenow": null, + "aria-valuetext": null }; - function cutFragments3(fragments, from2, to) { - return TreeFragment3.applyChanges(fragments, [{ fromA: from2, toA: to, fromB: from2, toB: to }]); + var AllTags = /* @__PURE__ */ Object.keys(Tags); + var GlobalAttrNames = /* @__PURE__ */ Object.keys(GlobalAttrs); + function elementName(doc2, tree, max = doc2.length) { + if (!tree) + return ""; + let tag = tree.firstChild; + let name2 = tag && tag.getChild("TagName"); + return name2 ? doc2.sliceString(name2.from, Math.min(name2.to, max)) : ""; } - var LanguageState3 = class { - constructor(context) { - this.context = context; - this.tree = context.tree; - } - apply(tr) { - if (!tr.docChanged && this.tree == this.context.tree) - return this; - let newCx = this.context.changes(tr.changes, tr.state); - let upto = this.context.treeLen == tr.startState.doc.length ? void 0 : Math.max(tr.changes.mapPos(this.context.treeLen), newCx.viewport.to); - if (!newCx.work(20, upto)) - newCx.takeTree(); - return new LanguageState3(newCx); - } - static init(state) { - let vpTo = Math.min(3e3, state.doc.length); - let parseState = new ParseContext3(state.facet(language3).parser, state, [], Tree6.empty, 0, { from: 0, to: vpTo }, [], null); - if (!parseState.work(20, vpTo)) - parseState.takeTree(); - return new LanguageState3(parseState); - } - }; - Language3.state = /* @__PURE__ */ StateField3.define({ - create: LanguageState3.init, - update(value, tr) { - for (let e of tr.effects) - if (e.is(Language3.setState)) - return e.value; - if (tr.startState.facet(language3) != tr.state.facet(language3)) - return LanguageState3.init(tr.state); - return value.apply(tr); - } - }); - var requestIdle3 = (callback) => { - let timeout = setTimeout(() => callback(), 500); - return () => clearTimeout(timeout); - }; - if (typeof requestIdleCallback != "undefined") - requestIdle3 = (callback) => { - let idle = -1, timeout = setTimeout(() => { - idle = requestIdleCallback(callback, { timeout: 500 - 100 }); - }, 100); - return () => idle < 0 ? clearTimeout(timeout) : cancelIdleCallback(idle); - }; - var isInputPending3 = typeof navigator != "undefined" && ((_a3 = navigator.scheduling) === null || _a3 === void 0 ? void 0 : _a3.isInputPending) ? () => navigator.scheduling.isInputPending() : null; - var parseWorker3 = /* @__PURE__ */ ViewPlugin3.fromClass(class ParseWorker3 { - constructor(view) { - this.view = view; - this.working = null; - this.workScheduled = 0; - this.chunkEnd = -1; - this.chunkBudget = -1; - this.work = this.work.bind(this); - this.scheduleWork(); - } - update(update) { - let cx = this.view.state.field(Language3.state).context; - if (cx.updateViewport(update.view.viewport) || this.view.viewport.to > cx.treeLen) - this.scheduleWork(); - if (update.docChanged) { - if (this.view.hasFocus) - this.chunkBudget += 50; - this.scheduleWork(); + function findParentElement(tree, skip = false) { + for (let cur2 = tree.parent; cur2; cur2 = cur2.parent) + if (cur2.name == "Element") { + if (skip) + skip = false; + else + return cur2; } - this.checkAsyncSchedule(cx); - } - scheduleWork() { - if (this.working) - return; - let { state } = this.view, field = state.field(Language3.state); - if (field.tree != field.context.tree || !field.context.isDone(state.doc.length)) - this.working = requestIdle3(this.work); + return null; + } + function allowedChildren(doc2, tree) { + let parentInfo = Tags[elementName(doc2, findParentElement(tree, true))]; + return (parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.children) || AllTags; + } + function openTags(doc2, tree) { + let open = []; + for (let parent = tree; parent = findParentElement(parent); ) { + let tagName = elementName(doc2, parent); + if (tagName && parent.lastChild.name == "CloseTag") + break; + if (tagName && open.indexOf(tagName) < 0 && (tree.name == "EndTag" || tree.from >= parent.firstChild.to)) + open.push(tagName); } - work(deadline) { - this.working = null; - let now = Date.now(); - if (this.chunkEnd < now && (this.chunkEnd < 0 || this.view.hasFocus)) { - this.chunkEnd = now + 3e4; - this.chunkBudget = 3e3; + return open; + } + var identifier2 = /^[:\-\.\w\u00b7-\uffff]+$/; + function completeTag(state, tree, from2, to) { + let end = /\s*>/.test(state.sliceDoc(to, to + 5)) ? "" : ">"; + return { + from: from2, + to, + options: allowedChildren(state.doc, tree).map((tagName) => ({ label: tagName, type: "type" })).concat(openTags(state.doc, tree).map((tag, i) => ({ label: "/" + tag, apply: "/" + tag + end, type: "type", boost: 99 - i }))), + span: /^\/?[:\-\.\w\u00b7-\uffff]*$/ + }; + } + function completeCloseTag(state, tree, from2, to) { + let end = /\s*>/.test(state.sliceDoc(to, to + 5)) ? "" : ">"; + return { + from: from2, + to, + options: openTags(state.doc, tree).map((tag, i) => ({ label: tag, apply: tag + end, type: "type", boost: 99 - i })), + span: identifier2 + }; + } + function completeStartTag(state, tree, pos) { + let options = [], level = 0; + for (let tagName of allowedChildren(state.doc, tree)) + options.push({ label: "<" + tagName, type: "type" }); + for (let open of openTags(state.doc, tree)) + options.push({ label: "", type: "type", boost: 99 - level++ }); + return { from: pos, to: pos, options, span: /^<\/?[:\-\.\w\u00b7-\uffff]*$/ }; + } + function completeAttrName(state, tree, from2, to) { + let elt = findParentElement(tree), info = elt ? Tags[elementName(state.doc, elt)] : null; + let names = info && info.attrs ? Object.keys(info.attrs).concat(GlobalAttrNames) : GlobalAttrNames; + return { + from: from2, + to, + options: names.map((attrName) => ({ label: attrName, type: "property" })), + span: identifier2 + }; + } + function completeAttrValue(state, tree, from2, to) { + var _a2; + let nameNode = (_a2 = tree.parent) === null || _a2 === void 0 ? void 0 : _a2.getChild("AttributeName"); + let options = [], span2 = void 0; + if (nameNode) { + let attrName = state.sliceDoc(nameNode.from, nameNode.to); + let attrs = GlobalAttrs[attrName]; + if (!attrs) { + let elt = findParentElement(tree), info = elt ? Tags[elementName(state.doc, elt)] : null; + attrs = (info === null || info === void 0 ? void 0 : info.attrs) && info.attrs[attrName]; } - if (this.chunkBudget <= 0) - return; - let { state, viewport: { to: vpTo } } = this.view, field = state.field(Language3.state); - if (field.tree == field.context.tree && field.context.isDone(vpTo + 1e5)) - return; - let endTime = Date.now() + Math.min(this.chunkBudget, 100, deadline && !isInputPending3 ? Math.max(25, deadline.timeRemaining() - 5) : 1e9); - let viewportFirst = field.context.treeLen < vpTo && state.doc.length > vpTo + 1e3; - let done = field.context.work(() => { - return isInputPending3 && isInputPending3() || Date.now() > endTime; - }, vpTo + (viewportFirst ? 0 : 1e5)); - this.chunkBudget -= Date.now() - now; - if (done || this.chunkBudget <= 0) { - field.context.takeTree(); - this.view.dispatch({ effects: Language3.setState.of(new LanguageState3(field.context)) }); + if (attrs) { + let base2 = state.sliceDoc(from2, to).toLowerCase(), quoteStart = '"', quoteEnd = '"'; + if (/^['"]/.test(base2)) { + span2 = base2[0] == '"' ? /^[^"]*$/ : /^[^']*$/; + quoteStart = ""; + quoteEnd = state.sliceDoc(to, to + 1) == base2[0] ? "" : base2[0]; + base2 = base2.slice(1); + from2++; + } else { + span2 = /^[^\s<>='"]*$/; + } + for (let value of attrs) + options.push({ label: value, apply: quoteStart + value + quoteEnd, type: "constant" }); } - if (this.chunkBudget > 0 && !(done && !viewportFirst)) - this.scheduleWork(); - this.checkAsyncSchedule(field.context); } - checkAsyncSchedule(cx) { - if (cx.scheduleOn) { - this.workScheduled++; - cx.scheduleOn.then(() => this.scheduleWork()).catch((err) => logException3(this.view.state, err)).then(() => this.workScheduled--); - cx.scheduleOn = null; - } + return { from: from2, to, options, span: span2 }; + } + function htmlCompletionSource(context) { + let { state, pos } = context, around = syntaxTree(state).resolveInner(pos), tree = around.resolve(pos, -1); + for (let scan = pos, before; around == tree && (before = tree.childBefore(scan)); ) { + let last = before.lastChild; + if (!last || !last.type.isError || last.from < last.to) + break; + around = tree = before; + scan = last.from; } - destroy() { - if (this.working) - this.working(); + if (tree.name == "TagName") { + return tree.parent && /CloseTag$/.test(tree.parent.name) ? completeCloseTag(state, tree, tree.from, pos) : completeTag(state, tree, tree.from, pos); + } else if (tree.name == "StartTag") { + return completeTag(state, tree, pos, pos); + } else if (tree.name == "StartCloseTag" || tree.name == "IncompleteCloseTag") { + return completeCloseTag(state, tree, pos, pos); + } else if (context.explicit && (tree.name == "OpenTag" || tree.name == "SelfClosingTag") || tree.name == "AttributeName") { + return completeAttrName(state, tree, tree.name == "AttributeName" ? tree.from : pos, pos); + } else if (tree.name == "Is" || tree.name == "AttributeValue" || tree.name == "UnquotedAttributeValue") { + return completeAttrValue(state, tree, tree.name == "Is" ? pos : tree.from, pos); + } else if (context.explicit && (around.name == "Element" || around.name == "Text" || around.name == "Document")) { + return completeStartTag(state, tree, pos); + } else { + return null; } - isWorking() { - return !!(this.working || this.workScheduled > 0); + } + var htmlLanguage = /* @__PURE__ */ LRLanguage.define({ + parser: /* @__PURE__ */ parser4.configure({ + props: [ + /* @__PURE__ */ indentNodeProp.add({ + Element(context) { + let after = /^(\s*)(<\/)?/.exec(context.textAfter); + if (context.node.to <= context.pos + after[0].length) + return context.continue(); + return context.lineIndent(context.node.from) + (after[2] ? 0 : context.unit); + }, + "OpenTag CloseTag SelfClosingTag"(context) { + return context.column(context.node.from) + context.unit; + }, + Document(context) { + if (context.pos + /\s*/.exec(context.textAfter)[0].length < context.node.to) + return context.continue(); + let endElt = null, close; + for (let cur2 = context.node; ; ) { + let last = cur2.lastChild; + if (!last || last.name != "Element" || last.to != cur2.to) + break; + endElt = cur2 = last; + } + if (endElt && !((close = endElt.lastChild) && (close.name == "CloseTag" || close.name == "SelfClosingTag"))) + return context.lineIndent(endElt.from) + context.unit; + return null; + } + }), + /* @__PURE__ */ foldNodeProp.add({ + Element(node) { + let first = node.firstChild, last = node.lastChild; + if (!first || first.name != "OpenTag") + return null; + return { from: first.to, to: last.name == "CloseTag" ? last.from : node.to }; + } + }), + /* @__PURE__ */ styleTags({ + "Text RawText": tags.content, + "StartTag StartCloseTag SelfCloserEndTag EndTag SelfCloseEndTag": tags.angleBracket, + TagName: tags.tagName, + "MismatchedCloseTag/TagName": [tags.tagName, tags.invalid], + AttributeName: tags.attributeName, + "AttributeValue UnquotedAttributeValue": tags.attributeValue, + Is: tags.definitionOperator, + "EntityReference CharacterReference": tags.character, + Comment: tags.blockComment, + ProcessingInst: tags.processingInstruction, + DoctypeDecl: tags.documentMeta + }) + ], + wrap: /* @__PURE__ */ configureNesting([ + { + tag: "script", + attrs(attrs) { + return !attrs.type || /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(attrs.type); + }, + parser: javascriptLanguage.parser + }, + { + tag: "style", + attrs(attrs) { + return (!attrs.lang || attrs.lang == "css") && (!attrs.type || /^(text\/)?(x-)?(stylesheet|css)$/i.test(attrs.type)); + }, + parser: cssLanguage.parser + } + ]) + }), + languageData: { + commentTokens: { block: { open: "" } }, + indentOnInput: /^\s*<\/\w+\W$/, + wordChars: "-._" } - }, { - eventHandlers: { focus() { - this.scheduleWork(); - } } - }); - var language3 = /* @__PURE__ */ Facet3.define({ - combine(languages) { - return languages.length ? languages[0] : null; - }, - enables: [Language3.state, parseWorker3] }); - var LanguageSupport3 = class { - constructor(language4, support = []) { - this.language = language4; - this.support = support; - this.extension = [language4, support]; - } - }; - var indentNodeProp3 = /* @__PURE__ */ new NodeProp6(); - function continuedIndent3({ except, units = 1 } = {}) { - return (context) => { - let matchExcept = except && except.test(context.textAfter); - return context.baseIndent + (matchExcept ? 0 : units * context.unit); - }; - } - var foldNodeProp3 = /* @__PURE__ */ new NodeProp6(); - function foldInside4(node) { - let first = node.firstChild, last = node.lastChild; - return first && first.to < last.from ? { from: first.to, to: last.type.isError ? node.to : last.from } : null; + var htmlCompletion = /* @__PURE__ */ htmlLanguage.data.of({ autocomplete: htmlCompletionSource }); + function html(config2 = {}) { + let lang = htmlLanguage; + if (config2.matchClosingTags === false) + lang = lang.configure({ dialect: "noMatch" }); + return new LanguageSupport(lang, [ + htmlCompletion, + config2.autoCloseTags !== false ? autoCloseTags : [], + javascript().support, + css().support + ]); } - var HighlightStyle3 = class { - constructor(spec, options) { - let modSpec; - function def(spec2) { - let cls = StyleModule.newName(); - (modSpec || (modSpec = /* @__PURE__ */ Object.create(null)))["." + cls] = spec2; - return cls; - } - const scopeOpt = options.scope; - this.scope = scopeOpt instanceof Language3 ? (type) => type.prop(languageDataProp3) == scopeOpt.data : scopeOpt ? (type) => type == scopeOpt : void 0; - this.style = tagHighlighter(spec.map((style) => ({ - tag: style.tag, - class: style.class || def(Object.assign({}, style, { tag: null })) - })), { - all: typeof options.all == "string" ? options.all : options.all ? def(options.all) : void 0 - }).style; - this.module = modSpec ? new StyleModule(modSpec) : null; - this.themeType = options.themeType; - } - static define(specs, options) { - return new HighlightStyle3(specs, options || {}); - } - }; - var defaultHighlightStyle3 = /* @__PURE__ */ HighlightStyle3.define([ - { - tag: tags2.meta, - color: "#7a757a" - }, - { - tag: tags2.link, - textDecoration: "underline" - }, - { - tag: tags2.heading, - textDecoration: "underline", - fontWeight: "bold" - }, - { - tag: tags2.emphasis, - fontStyle: "italic" - }, - { - tag: tags2.strong, - fontWeight: "bold" - }, - { - tag: tags2.strikethrough, - textDecoration: "line-through" - }, - { - tag: tags2.keyword, - color: "#708" - }, - { - tag: [tags2.atom, tags2.bool, tags2.url, tags2.contentSeparator, tags2.labelName], - color: "#219" - }, - { - tag: [tags2.literal, tags2.inserted], - color: "#164" - }, - { - tag: [tags2.string, tags2.deleted], - color: "#a11" - }, - { - tag: [tags2.regexp, tags2.escape, /* @__PURE__ */ tags2.special(tags2.string)], - color: "#e40" - }, - { - tag: /* @__PURE__ */ tags2.definition(tags2.variableName), - color: "#00f" - }, - { - tag: /* @__PURE__ */ tags2.local(tags2.variableName), - color: "#30a" - }, - { - tag: [tags2.typeName, tags2.namespace], - color: "#085" - }, - { - tag: tags2.className, - color: "#167" - }, - { - tag: [/* @__PURE__ */ tags2.special(tags2.variableName), tags2.macroName], - color: "#256" - }, - { - tag: /* @__PURE__ */ tags2.definition(tags2.propertyName), - color: "#00c" - }, - { - tag: tags2.comment, - color: "#940" - }, - { - tag: tags2.invalid, - color: "#f00" - } - ]); - var noTokens2 = /* @__PURE__ */ Object.create(null); - var typeArray2 = [NodeType6.none]; - var warned2 = []; - var defaultTable2 = /* @__PURE__ */ Object.create(null); - for (let [legacyName, name3] of [ - ["variable", "variableName"], - ["variable-2", "variableName.special"], - ["string-2", "string.special"], - ["def", "variableName.definition"], - ["tag", "typeName"], - ["attribute", "propertyName"], - ["type", "typeName"], - ["builtin", "variableName.standard"], - ["qualifier", "modifier"], - ["error", "invalid"], - ["header", "heading"], - ["property", "propertyName"] - ]) - defaultTable2[legacyName] = /* @__PURE__ */ createTokenType2(noTokens2, name3); - function warnForPart2(part, msg) { - if (warned2.indexOf(part) > -1) - return; - warned2.push(part); - console.warn(msg); - } - function createTokenType2(extra, tagStr) { - let tag = null; - for (let part of tagStr.split(".")) { - let value = extra[part] || tags2[part]; - if (!value) { - warnForPart2(part, `Unknown highlighting tag ${part}`); - } else if (typeof value == "function") { - if (!tag) - warnForPart2(part, `Modifier ${part} used at start of tag`); - else - tag = value(tag); - } else { - if (tag) - warnForPart2(part, `Tag ${part} used as modifier`); - else - tag = value; + var autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((view, from2, to, text) => { + if (view.composing || view.state.readOnly || from2 != to || text != ">" && text != "/" || !htmlLanguage.isActiveAt(view.state, from2, -1)) + return false; + let { state } = view; + let changes = state.changeByRange((range) => { + var _a2, _b, _c; + let { head } = range, around = syntaxTree(state).resolveInner(head, -1), name2; + if (around.name == "TagName" || around.name == "StartTag") + around = around.parent; + if (text == ">" && around.name == "OpenTag") { + if (((_b = (_a2 = around.parent) === null || _a2 === void 0 ? void 0 : _a2.lastChild) === null || _b === void 0 ? void 0 : _b.name) != "CloseTag" && (name2 = elementName(state.doc, around.parent, head))) + return { range: EditorSelection.cursor(head + 1), changes: { from: head, insert: `>` } }; + } else if (text == "/" && around.name == "OpenTag") { + let empty2 = around.parent, base2 = empty2 === null || empty2 === void 0 ? void 0 : empty2.parent; + if (empty2.from == head - 1 && ((_c = base2.lastChild) === null || _c === void 0 ? void 0 : _c.name) != "CloseTag" && (name2 = elementName(state.doc, base2, head))) { + let insert2 = `/${name2}>`; + return { range: EditorSelection.cursor(head + insert2.length), changes: { from: head, insert: insert2 } }; + } } - } - if (!tag) - return 0; - let name3 = tagStr.replace(/ /g, "_"), type = NodeType6.define({ - id: typeArray2.length, - name: name3, - props: [styleTags2({ [name3]: tag })] + return { range }; }); - typeArray2.push(type); - return type.id; - } + if (changes.changes.empty) + return false; + view.dispatch(changes, { userEvent: "input.type", scrollIntoView: true }); + return true; + }); - // node_modules/@codemirror/lang-json/dist/index.js - var jsonLanguage = /* @__PURE__ */ LRLanguage3.define({ - parser: /* @__PURE__ */ parser6.configure({ + // node_modules/@codemirror/lang-php/dist/index.js + var phpLanguage = /* @__PURE__ */ LRLanguage.define({ + parser: /* @__PURE__ */ parser3.configure({ props: [ - /* @__PURE__ */ indentNodeProp3.add({ - Object: /* @__PURE__ */ continuedIndent3({ except: /^\s*\}/ }), - Array: /* @__PURE__ */ continuedIndent3({ except: /^\s*\]/ }) + /* @__PURE__ */ indentNodeProp.add({ + IfStatement: /* @__PURE__ */ continuedIndent({ except: /^\s*({|else\b|elseif\b|endif\b)/ }), + TryStatement: /* @__PURE__ */ continuedIndent({ except: /^\s*({|catch\b|finally\b)/ }), + SwitchBody: (context) => { + let after = context.textAfter, closed = /^\s*\}/.test(after), isCase = /^\s*(case|default)\b/.test(after); + return context.baseIndent + (closed ? 0 : isCase ? 1 : 2) * context.unit; + }, + ColonBlock: (cx) => cx.baseIndent + cx.unit, + "Block EnumBody DeclarationList": /* @__PURE__ */ delimitedIndent({ closing: "}" }), + ArrowFunction: (cx) => cx.baseIndent + cx.unit, + "String BlockComment": () => -1, + Statement: /* @__PURE__ */ continuedIndent({ except: /^({|end(for|foreach|switch|while)\b)/ }) + }), + /* @__PURE__ */ foldNodeProp.add({ + "Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList": foldInside, + ColonBlock(tree) { + return { from: tree.from + 1, to: tree.to }; + }, + BlockComment(tree) { + return { from: tree.from + 2, to: tree.to - 2 }; + } }), - /* @__PURE__ */ foldNodeProp3.add({ - "Object Array": foldInside4 + /* @__PURE__ */ styleTags({ + "Visibility abstract final static": tags.modifier, + "for foreach while do if else elseif switch try catch finally return throw break continue default case": tags.controlKeyword, + "endif endfor endforeach endswitch endwhile goto match": tags.controlKeyword, + "and or xor yield unset clone instanceof insteadof": tags.operatorKeyword, + "function fn class trait implements extends const enum global namespace trait use var": tags.definitionKeyword, + "include include_once require require_once declare enddeclare": tags.definitionKeyword, + "new from echo print array list as": tags.keyword, + null: tags.null, + Boolean: tags.bool, + VariableName: tags.variableName, + "NamespaceName/...": tags.namespace, + "NamedType/...": tags.typeName, + Name: tags.name, + "CallExpression/Name": /* @__PURE__ */ tags.function(tags.variableName), + "LabelStatement/Name": tags.labelName, + "MemberExpression/Name MemberExpression/VariableName": tags.propertyName, + "CallExpression/MemberExpression/Name": /* @__PURE__ */ tags.function(tags.propertyName), + "FunctionDefinition/Name": /* @__PURE__ */ tags.function(/* @__PURE__ */ tags.definition(tags.variableName)), + "ClassDeclaration/Name": /* @__PURE__ */ tags.definition(tags.className), + UpdateOp: tags.updateOperator, + ArithOp: tags.arithmeticOperator, + LogicOp: tags.logicOperator, + BitOp: tags.bitwiseOperator, + CompareOp: tags.compareOperator, + ControlOp: tags.controlOperator, + AssignOp: tags.definitionOperator, + "$ ConcatOp": tags.operator, + LineComment: tags.lineComment, + BlockComment: tags.blockComment, + Integer: tags.integer, + Float: tags.float, + String: tags.string, + ShellExpression: /* @__PURE__ */ tags.special(tags.string), + "=> ->": tags.punctuation, + "( )": tags.paren, + "#[ [ ]": tags.squareBracket, + "${ { }": tags.brace, + "-> ?->": tags.derefOperator, + ", ; :: : \\": tags.separator, + "PhpOpen PhpClose": tags.processingInstruction }) ] }), languageData: { - closeBrackets: { brackets: ["[", "{", '"'] }, - indentOnInput: /^\s*[\}\]]$/ + commentTokens: { block: { open: "/*", close: "*/" }, line: "//" }, + indentOnInput: /^\s*(?:case |default:|end(?:if|for(?:each)?|switch|while)|else(?:if)?|\{|\})$/, + wordChars: "$" } }); - function json() { - return new LanguageSupport3(jsonLanguage); + function php(config2 = {}) { + let support = [], base2; + if (config2.baseLanguage === null) + ; + else if (config2.baseLanguage) { + base2 = config2.baseLanguage; + } else { + let htmlSupport = html({ matchClosingTags: false }); + support.push(htmlSupport.support); + base2 = htmlSupport.language; + } + return new LanguageSupport(phpLanguage.configure({ + wrap: base2 && parseMixed((node) => { + if (!node.type.isTop) + return null; + return { + parser: base2.parser, + overlay: (node2) => node2.name == "Text" + }; + }), + top: config2.plain ? "Program" : "Template" + }), support); } // resources/js/components/code-editor.js diff --git a/package.json b/package.json index d11fd19..98b452c 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "@codemirror/gutter": "^0.19.9", "@codemirror/lang-css": "^0.19.3", "@codemirror/lang-html": "^0.19.4", - "@codemirror/lang-javascript": "^0.20.0", - "@codemirror/lang-json": "^0.20.0", + "@codemirror/lang-javascript": "^0.19.7", + "@codemirror/lang-json": "^0.19.2", "@codemirror/lang-php": "^0.19.1", "@codemirror/view": "^0.19.48", "esbuild": "^0.14.34" diff --git a/resources/js/components/code-editor.js b/resources/js/components/code-editor.js index e3b370c..9b5e41d 100644 --- a/resources/js/components/code-editor.js +++ b/resources/js/components/code-editor.js @@ -2,8 +2,8 @@ import { EditorState, basicSetup } from "@codemirror/basic-setup"; import {EditorView, keymap} from "@codemirror/view"; import { indentWithTab } from "@codemirror/commands"; import { javascript } from "@codemirror/lang-javascript"; -import { php } from "@codemirror/lang-php"; import { json } from "@codemirror/lang-json"; +import { php } from "@codemirror/lang-php"; import { css } from "@codemirror/lang-css"; import { html } from "@codemirror/lang-html"; diff --git a/yarn.lock b/yarn.lock index 98fd5b0..7ff493d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,16 +14,6 @@ "@codemirror/view" "^0.19.0" "@lezer/common" "^0.15.0" -"@codemirror/autocomplete@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@codemirror/autocomplete/-/autocomplete-0.20.0.tgz#390cc444ea36474e77117f2153caad84214f0edf" - integrity sha512-F6VOM8lImn5ApqxJcaWgdl7hhlw8B5yAfZJGlsQifcpNotkZOMND61mBFZ84OmSLWxtT8/smkSeLvJupKbjP9w== - dependencies: - "@codemirror/language" "^0.20.0" - "@codemirror/state" "^0.20.0" - "@codemirror/view" "^0.20.0" - "@lezer/common" "^0.16.0" - "@codemirror/basic-setup@^0.19.3": version "0.19.3" resolved "https://registry.yarnpkg.com/@codemirror/basic-setup/-/basic-setup-0.19.3.tgz#b83e3ee43f632c0305f97771767d84c753d41a6b" @@ -142,7 +132,7 @@ "@lezer/common" "^0.15.0" "@lezer/html" "^0.15.0" -"@codemirror/lang-javascript@^0.19.0": +"@codemirror/lang-javascript@^0.19.0", "@codemirror/lang-javascript@^0.19.7": version "0.19.7" resolved "https://registry.yarnpkg.com/@codemirror/lang-javascript/-/lang-javascript-0.19.7.tgz#84581ef6abf2a16d78f017ffc96c2d6227de5eb5" integrity sha512-DL9f3JLqOEHH9cIwEqqjnP5bkjdVXeECksLtV+/MbPm+l4H+AG+PkwZaJQ2oR1GfPZKh8MVSIE94aGWNkJP8WQ== @@ -155,25 +145,14 @@ "@codemirror/view" "^0.19.0" "@lezer/javascript" "^0.15.1" -"@codemirror/lang-javascript@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@codemirror/lang-javascript/-/lang-javascript-0.20.0.tgz#64a7beaa634ad2163dbfdcff94bae8ff28bae476" - integrity sha512-Wawq5+o1DlWtsqAyaa9NkiSXNT7geFcfdUael0hIQdM7P23gkQaD+xgZcyQP6QvPxVAdnY4VIWHFzFAqBti+WQ== - dependencies: - "@codemirror/autocomplete" "^0.20.0" - "@codemirror/language" "^0.20.0" - "@codemirror/lint" "^0.20.0" - "@codemirror/state" "^0.20.0" - "@codemirror/view" "^0.20.0" - "@lezer/javascript" "^0.16.0" - -"@codemirror/lang-json@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@codemirror/lang-json/-/lang-json-0.20.0.tgz#0cef6c3db35a4d9107896312b444d41f77cda0b4" - integrity sha512-Dj9iW3larS3HDdzd8+GXP5+7EUG7SeQexy0mh7l3N/n7vicIY+9AxRPZ1H6nsVI97uZpYIm8OZWG/eUzCdksdA== +"@codemirror/lang-json@^0.19.2": + version "0.19.2" + resolved "https://registry.yarnpkg.com/@codemirror/lang-json/-/lang-json-0.19.2.tgz#b311a0c16382343261fdc3cbda72f09a61ade7db" + integrity sha512-fgUWR58Is59P5D/tiazX6oTczioOCDYqjFT5PEBAmLBFMSsRqcnJE0xNO1snrhg7pWEFDq5wR/oN0eZhkeR6Gg== dependencies: - "@codemirror/language" "^0.20.0" - "@lezer/json" "^0.16.0" + "@codemirror/highlight" "^0.19.0" + "@codemirror/language" "^0.19.0" + "@lezer/json" "^0.15.0" "@codemirror/lang-php@^0.19.1": version "0.19.1" @@ -198,17 +177,6 @@ "@lezer/common" "^0.15.5" "@lezer/lr" "^0.15.0" -"@codemirror/language@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@codemirror/language/-/language-0.20.0.tgz#959967901e780c1612934cf5d6df3d7b7e5bf9f0" - integrity sha512-lPsF5Y2ZFd5lZ9+7HXTxu57Po3dms3+7q2iAffzrbis2wyJo0lzi/j2312EKStEzwd0pGGpvrUk2dEd333N2jw== - dependencies: - "@codemirror/state" "^0.20.0" - "@codemirror/view" "^0.20.0" - "@lezer/common" "^0.16.0" - "@lezer/highlight" "^0.16.0" - "@lezer/lr" "^0.16.0" - "@codemirror/lint@^0.19.0": version "0.19.6" resolved "https://registry.yarnpkg.com/@codemirror/lint/-/lint-0.19.6.tgz#0379688da3e16739db4a6304c73db857ca85d7ec" @@ -222,15 +190,6 @@ "@codemirror/view" "^0.19.22" crelt "^1.0.5" -"@codemirror/lint@^0.20.0": - version "0.20.1" - resolved "https://registry.yarnpkg.com/@codemirror/lint/-/lint-0.20.1.tgz#791c83642f76103bbf6b8bfdc8020eff2b78b5e2" - integrity sha512-aWbeicDiNe5tb2aZuXs7sKk3hQ89Z1YcUuUX8ngQu23tT6EY4kcY2cayDjizvkLn8iHkObNf97uSudjNmUon2Q== - dependencies: - "@codemirror/state" "^0.20.0" - "@codemirror/view" "^0.20.2" - crelt "^1.0.5" - "@codemirror/matchbrackets@^0.19.0": version "0.19.4" resolved "https://registry.yarnpkg.com/@codemirror/matchbrackets/-/matchbrackets-0.19.4.tgz#50b5188eb2d53f32598dca906bf5fd66626a9ebc" @@ -284,11 +243,6 @@ dependencies: "@codemirror/text" "^0.19.0" -"@codemirror/state@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@codemirror/state/-/state-0.20.0.tgz#3343d209169813b0152b77361cd78bea01549a73" - integrity sha512-R3XrAWCS5Xm9lx+4pDET4EUPEg+8bDfAa5zoOFIhx+VChsfew9Vy33dAjCXS5ES4Q8UecW4WM4UudmUFpZ+86A== - "@codemirror/text@^0.19.0", "@codemirror/text@^0.19.2", "@codemirror/text@^0.19.4", "@codemirror/text@^0.19.6": version "0.19.6" resolved "https://registry.yarnpkg.com/@codemirror/text/-/text-0.19.6.tgz#9adcbd8137f69b75518eacd30ddb16fd67bbac45" @@ -313,25 +267,11 @@ style-mod "^4.0.0" w3c-keyname "^2.2.4" -"@codemirror/view@^0.20.0", "@codemirror/view@^0.20.2": - version "0.20.3" - resolved "https://registry.yarnpkg.com/@codemirror/view/-/view-0.20.3.tgz#c907b93afb540400c0088c4203c42deb949cbc08" - integrity sha512-wAKK1SSmNOEAG1QEDlY5NhzVnzcXU21pcs6wzYa4G6IC6EWO208N69Ei11A4SIHk9QL658p2+GQ+ealpwHtAcw== - dependencies: - "@codemirror/state" "^0.20.0" - style-mod "^4.0.0" - w3c-keyname "^2.2.4" - "@lezer/common@^0.15.0", "@lezer/common@^0.15.5": version "0.15.12" resolved "https://registry.yarnpkg.com/@lezer/common/-/common-0.15.12.tgz#2f21aec551dd5fd7d24eb069f90f54d5bc6ee5e9" integrity sha512-edfwCxNLnzq5pBA/yaIhwJ3U3Kz8VAUOTRg0hhxaizaI1N+qxV7EXDv/kLCkLeq2RzSFvxexlaj5Mzfn2kY0Ig== -"@lezer/common@^0.16.0": - version "0.16.0" - resolved "https://registry.yarnpkg.com/@lezer/common/-/common-0.16.0.tgz#b6023a0a682b0b7676d0e7f0e0838f71bde39fcd" - integrity sha512-H6sPCku+asKWYaNjwfQ1Uvcay9UP1Pdzu4qpy8GtRZ0cKT2AAGnj9MQGiRtY18MDntvhYRJxNGv7FNWOSV/e8A== - "@lezer/css@^0.15.2": version "0.15.2" resolved "https://registry.yarnpkg.com/@lezer/css/-/css-0.15.2.tgz#e96995da67df90bb4b191aaa8a486349cca5d8e7" @@ -339,13 +279,6 @@ dependencies: "@lezer/lr" "^0.15.0" -"@lezer/highlight@^0.16.0": - version "0.16.0" - resolved "https://registry.yarnpkg.com/@lezer/highlight/-/highlight-0.16.0.tgz#95f7b7ee3c32c8a0f6ce499c085e8b1f927ffbdc" - integrity sha512-iE5f4flHlJ1g1clOStvXNLbORJoiW4Kytso6ubfYzHnaNo/eo5SKhxs4wv/rtvwZQeZrK3we8S9SyA7OGOoRKQ== - dependencies: - "@lezer/common" "^0.16.0" - "@lezer/html@^0.15.0": version "0.15.1" resolved "https://registry.yarnpkg.com/@lezer/html/-/html-0.15.1.tgz#973a5a179560d0789bf8737c06e6d143cc211406" @@ -360,21 +293,12 @@ dependencies: "@lezer/lr" "^0.15.0" -"@lezer/javascript@^0.16.0": - version "0.16.0" - resolved "https://registry.yarnpkg.com/@lezer/javascript/-/javascript-0.16.0.tgz#712c3bc098bfc91b381a386551a86e9d4baf95eb" - integrity sha512-kDcwX3QMFKVd7VJwlYTeTNtcj3/gXQEDa7cQzXXsFMvTGV/RTDq0r8agTpZu0zBc1RUZkVILusd1Cluz3STRqw== - dependencies: - "@lezer/highlight" "^0.16.0" - "@lezer/lr" "^0.16.0" - -"@lezer/json@^0.16.0": - version "0.16.0" - resolved "https://registry.yarnpkg.com/@lezer/json/-/json-0.16.0.tgz#f841fd7557fac8eac14c4dd52cb0e36abd9e8164" - integrity sha512-Aqsi+qclD1f27tKGV9nND29WRXur8kfVnbPf5gUms3SNTY5mRIADnXy9/5dQxKlPkVHSuS1RCUJvA0+mdNQtsQ== +"@lezer/json@^0.15.0": + version "0.15.0" + resolved "https://registry.yarnpkg.com/@lezer/json/-/json-0.15.0.tgz#b96c1161eb8514e05f4eaaec95c68376e76e539f" + integrity sha512-OsMjjBkTkeQ15iMCu5U1OiBubRC4V9Wm03zdIlUgNZ20aUPx5DWDRqUc5wG41JXVSj7Lxmo+idlFCfBBdxB8sw== dependencies: - "@lezer/highlight" "^0.16.0" - "@lezer/lr" "^0.16.0" + "@lezer/lr" "^0.15.0" "@lezer/lr@^0.15.0": version "0.15.8" @@ -383,13 +307,6 @@ dependencies: "@lezer/common" "^0.15.0" -"@lezer/lr@^0.16.0": - version "0.16.2" - resolved "https://registry.yarnpkg.com/@lezer/lr/-/lr-0.16.2.tgz#a26e2572b6acf60815b12d898341ed02464f1c5e" - integrity sha512-bx7kkp4eLOzp+YclKMOx1P0OzWRH/6Y3EdEvsHC+rhsc7H72GvccwlKfuXlWkiKjnmzlxLTFxsNjA8v+Yj75mQ== - dependencies: - "@lezer/common" "^0.16.0" - "@lezer/php@^0.15.0": version "0.15.0" resolved "https://registry.yarnpkg.com/@lezer/php/-/php-0.15.0.tgz#d09abd0ffaf256dcfac9b78cf4e6f2ee930b9efa"