diff --git a/apps/mobile/__tests__/liveEditorMount.test.ts b/apps/mobile/__tests__/liveEditorMount.test.ts index b721733d..8e2ca4ee 100644 --- a/apps/mobile/__tests__/liveEditorMount.test.ts +++ b/apps/mobile/__tests__/liveEditorMount.test.ts @@ -821,4 +821,126 @@ describe("every --lp-* the editor's styles read is one this half declares", () = for (const property of readIn(completion)) expect([...declared]).toContain(property); m.unmount(); }); + + /** + * The reading measure is a `--lp-*` like any other, so it is subject to the + * sweep above — but it is the first one that is not a colour or a face, and + * a missing colour is at least visible. A missing *measure* is a note that + * still looks fine and reads at 150 characters a line, which is the failure + * this whole change exists to stop, so it is named here too. + */ + test("including the reading measure, which the iOS host also has to send", () => { + const m = mount({ value: "# note\n\nprose\n", editable: true }); + const declared = declaredIn( + document.getElementById("context-live-preview-styles")?.textContent ?? "", + ); + expect([...declared]).toContain("--lp-measure"); + m.unmount(); + }); +}); + +/* -------------------------------------------------------------------------- */ + +/** + * THE NOTE IS A COLUMN, NOT THE WIDTH OF THE WINDOW. + * + * Measured in Chromium at 1440x900 before this existed: the element holding + * the first sentence of the console's own demo note was 1160px wide, with + * `max-width: none` on every one of its first eight ancestors — about 150 + * characters to a line, twice a comfortable measure. It survived because the + * fixture note was hard-wrapped in `placeholderData.ts`, so every screenshot + * showed a tidy column that the layout had nothing to do with. + * + * jsdom does not lay anything out, so these assert the *rules* and + * `e2e/webkit/readingMeasure.spec.ts` asserts the rendered result in a real + * engine at both viewports. Both are needed: a rule that is present and does + * not bind is exactly what was there before. + */ +describe("the rendered note has a reading measure", () => { + /** + * One rule's declarations, by its selector, out of the mounted stylesheet. + * + * Comments are stripped rather than left in: these rules carry long ones, + * and a test asserting a property is *absent* would otherwise be satisfied + * or defeated by prose about it. + */ + function block(selector: string): string { + const css = ( + document.getElementById("context-live-preview-styles")?.textContent ?? "" + ).replace(/\/\*[\s\S]*?\*\//g, ""); + const at = css.indexOf(`${selector} {`); + if (at === -1) return ""; + return css.slice(at, css.indexOf("}", at)); + } + + test("the column is measured and centred, and it is the column rather than the line", () => { + const m = mount({ value: "# note\n\nprose\n", editable: true }); + + const content = block(".cm-lp-root .cm-content"); + expect(content).toContain( + "padding-inline: max(0px, calc((100% - var(--lp-measure) * 1em) / 2))", + ); + + /* + The unit is added HERE and not where the property is declared. A + font-relative length inside a custom property may be resolved at the + declaring element or at the using one, and engines differ — and the + wrapper this is declared on is Times New Roman at 16px while the note is + a sans at 14.5px, so the two answers are different lengths. Shipped as + `62ch`, that read 75 characters a line in Chromium and 91 in WebKit on + the same runner. + */ + expect(block(".cm-lp-root")).toMatch(/--lp-measure:\s*\d+;/); + + /* + Padding rather than `max-width: var(--lp-measure); margin-inline: auto`, + which draws the identical column. Measured in Chromium: the max-width + recipe leaves `.cm-content` 572px wide inside a 1192px pane, and a click + in the 310px either side lands on `.cm-scroller` and does not focus the + editor — half the note's apparent area stops being the editing surface. + With padding the element stays full width, so CodeMirror still maps a + click in the margin to the nearest position. + */ + expect(content).not.toContain("max-width"); + + /* + On `.cm-content` rather than on `.cm-line`: a table, a form and a + rendered diagram are block children of the same element, and measuring + the lines alone would leave each of those starting at a different left + edge from the paragraph above it. If a future edit moves the constraint + down to the line, this is the test that should have to be deleted + deliberately. + */ + expect(block(".cm-lp-root .cm-line")).not.toContain("max-width"); + + m.unmount(); + }); + + /** + * WHAT IS ALLOWED TO BE WIDER THAN THE PROSE: nothing. + * + * A table is the case with a real argument on the other side — twelve + * columns in 68 characters is cramped — and it still loses, because a block + * wider than the text it sits between has to start left of that text, and a + * document with two left edges reads as broken layout rather than as a wide + * table. What a wide table gets instead is its own horizontal scroller, so + * it stays inside the column and the note never scrolls sideways as a whole. + */ + test("a table wider than the measure scrolls inside the column rather than widening it", () => { + const m = mount({ + value: "# note\n\n| a | b | c |\n| --- | --- | --- |\n| 1 | 2 | 3 |\n", + editable: false, + }); + + // The rendered grid really is on screen: without this the rules below are + // about a selector nothing matches. + expect(document.querySelectorAll(".cm-lp-grid").length).toBeGreaterThan(0); + + expect(block(".cm-lp-grid")).toContain("overflow-x: auto"); + // And the table inside it is sized by its content up to the column's own + // width — never past it, which is what would drag the column open. + expect(block(".cm-lp-grid-table")).toContain("max-width: 100%"); + + m.unmount(); + }); }); diff --git a/apps/mobile/__tests__/webviewBridge.test.ts b/apps/mobile/__tests__/webviewBridge.test.ts index 81ca2621..1b6ecb5f 100644 --- a/apps/mobile/__tests__/webviewBridge.test.ts +++ b/apps/mobile/__tests__/webviewBridge.test.ts @@ -45,7 +45,7 @@ import { import { runCommand } from "../features/console/files/editorSetup"; import { splitNote } from "../features/console/files/frontmatter"; import { editorReducer, emptyEditor } from "../features/console/files/editor"; -import { darkColors, lightColors } from "../features/design/tokens"; +import { darkColors, layout, lightColors } from "../features/design/tokens"; /** * Every command on the accessory bar that touches the document. @@ -990,6 +990,129 @@ describe("the palette", () => { expect(themeVars(darkColors, "Menlo", false)["--lp-content"]).toBe(darkColors.text2); }); + /** + * THE OTHER HALF OF THE GUARD `liveEditorMount.test.ts` HOLDS. + * + * That one proves the web console declares every `--lp-*` its stylesheets + * read. This is the same relationship on the host where the values arrive + * over a bridge — and the consequence of a gap is worse here, because an + * undeclared custom property does not fall back, it invalidates the whole + * declaration that names it. The note keeps rendering, without whatever that + * declaration was doing. + * + * Two questions, because there are two suppliers: the `:root` block in + * `styles.ts` is what a guest whose first theme message never arrives sees, + * and `themeVars` is what every real one gets. + */ + test("every --lp-* the guest stylesheet reads is one its own :root declares", () => { + const css = guestStyles(); + const open = css.indexOf(":root {"); + expect(open).toBeGreaterThan(-1); + const root = css.slice(open, css.indexOf("}", open)); + + const declared = new Set([...root.matchAll(/(--lp-[a-z0-9-]+)\s*:/g)].map((m) => m[1])); + const read = new Set([...css.matchAll(/var\(\s*(--lp-[a-z0-9-]+)/g)].map((m) => m[1])); + + expect([...read].filter((property) => !declared.has(property))).toEqual([]); + // Named so a regression says which one went: the measure is the only + // property here that is not a colour or a face, and losing it is invisible + // in a screenshot of a short note. + expect([...declared]).toContain("--lp-measure"); + }); + + test("and every one the host is responsible for is in themeVars", () => { + const css = guestStyles(); + const read = [...css.matchAll(/var\(\s*(--lp-[a-z0-9-]+)/g)].map((m) => m[1]); + const sent = themeVars(darkColors, "Menlo", true); + + /* + The one exception, and it is a real one rather than an excuse: + `--lp-inset-bottom` is how much of the editor the keyboard is covering. + It is measured on the device and written by the `inset` message (see + `guest.ts`), so it changes many times per second while a keyboard is + animating and has no business in a theme. + */ + const missing = [...new Set(read)].filter( + (property) => property !== "--lp-inset-bottom" && !(property in sent), + ); + expect(missing).toEqual([]); + }); + + test("the note is drawn as a measured, centred column on this host too", () => { + // Comments stripped: this rule carries a long one, and the assertions + // below are about which properties are and are not set rather than about + // what the prose beside them mentions. + const css = guestStyles().replace(/\/\*[\s\S]*?\*\//g, ""); + const at = css.indexOf("#root .cm-content {"); + expect(at).toBeGreaterThan(-1); + const rule = css.slice(at, css.indexOf("}", at)); + + expect(rule).toContain("padding-inline: max(0px, calc((100% - var(--lp-measure) * 1em) / 2))"); + // The same rule the web console has, on the column rather than the line, + // and by padding rather than by width — see `liveEditorMount.test.ts` for + // both halves of why. + expect(rule).not.toContain("max-width"); + expect(css.slice(css.indexOf("#root .cm-line {"))).not.toMatch( + /^#root \.cm-line \{[^}]*(max-width|padding-inline)/, + ); + }); + + test("the reading measure is a bare multiple, so it is one value for both densities", () => { + const compact = themeVars(darkColors, "Menlo", true)["--lp-measure"]; + const pointer = themeVars(darkColors, "Menlo", false)["--lp-measure"]; + + /* + Unlike every other line in `themeVars`, this one does not branch on + `compact` — and that is the argument rather than an oversight. The type + scale differs between the two (16px and 14.5px); a measure stated as a + multiple of the type is the same line at both. A pixel measure would have + had to be two numbers kept in step by hand. + */ + expect(compact).toBe(pointer); + + /* + And it carries NO UNIT. A font-relative length inside a custom property + may be resolved where the property is declared or where it is used, and + engines differ; the wrapper is Times New Roman at 16px and the note is a + sans at 14.5px, so those are two different lengths. `styles.ts` + multiplies by 1em against the text itself. A unit sneaking back in here + is that ambiguity returning, silently, on one engine only. + */ + expect(compact).toMatch(/^\d+$/); + + /* + The band the number has to stay inside, which is the design decision + rather than the value. Prose in a system sans averages 0.45-0.55em a + character, so 36em is roughly 65-80 characters and the comfortable range + is 60-75. Anything outside this changes how the note reads and should + have to edit a test that says so. + `e2e/webkit/readingMeasure.spec.ts` checks the rendered result. + */ + expect(layout.readingMeasureEm).toBeGreaterThanOrEqual(30); + expect(layout.readingMeasureEm).toBeLessThanOrEqual(40); + }); + + test("the phone's own width is what governs there — the measure cannot bind", () => { + const compact = themeVars(darkColors, "Menlo", true); + const ems = Number(compact["--lp-measure"]); + const size = Number(compact["--lp-size"]?.replace("px", "")); + const pad = Number(compact["--lp-pad-x"]?.replace("px", "")); + + /* + The measure in points is exactly the multiple times the type size — no + font metric involved, which is the other half of why the unit is em: this + arithmetic is the layout's, not a guess about a face. Against the widest + phone this app runs on (a 430pt iPhone Pro Max, wider than the 390 the + WebKit suite uses) the text column is still far narrower, so the padding + that insets the column computes to zero and `--lp-pad-x` decides the line + length. If that ever stops being true the phone quietly gains a centred + column with slack either side, which is not what a note on a phone should + look like. + */ + const widestPhone = 430 - 2 * pad; + expect(ems * size).toBeGreaterThan(widestPhone); + }); + test("only our own custom properties are written", () => { const target = document.createElement("div"); applyTheme(target, { diff --git a/apps/mobile/e2e/webkit/readingMeasure.spec.ts b/apps/mobile/e2e/webkit/readingMeasure.spec.ts new file mode 100644 index 00000000..e54cc9a3 --- /dev/null +++ b/apps/mobile/e2e/webkit/readingMeasure.spec.ts @@ -0,0 +1,237 @@ +import { expect, test } from "@playwright/test"; + +/** + * THE NOTE'S LINE LENGTH, MEASURED IN A REAL ENGINE AT BOTH WIDTHS. + * + * The rest of this suite exists because jsdom cannot run WebKit's event + * pipeline. This file is here for a different gap in jsdom, and a more basic + * one: **jsdom lays nothing out**, so no unit test in this repository can tell + * a `max-width` that binds from a `max-width` that does not. Measured in + * Chromium at 1440x900 before the fix, the element holding the first sentence + * of the console's own demo note was 1160px wide with `max-width: none` on + * every ancestor — roughly 150 characters to a line against the 60-75 that is + * comfortable to read. + * + * It survived that long because the fixture note was hard-wrapped in + * `placeholderData.ts`: the demo text broke at about fifty characters no + * matter what the layout did, so every screenshot showed a tidy column. The + * note is now written as normal unwrapped paragraphs, which is what makes the + * measurement below mean anything. + * + * ## Characters, not pixels — and why the bounds on the count are wide + * + * These assert the count of characters that land on a rendered line rather + * than a pixel width, because the count is the constraint and the pixels are + * whatever the font happens to be. The measure is `layout.readingMeasureEm` + * em of the note's own type, which is a fixed box; how many characters fit in + * it is a property of the face, and the face here is whatever the runner + * resolved `system-ui` to. + * + * That is not hypothetical. This shipped for one CI run as `62ch` and came + * back **75 characters in Chromium and 91 in WebKit on the same Linux + * runner** — `ch` is the advance of "0", so it tracks a face's digits rather + * than its prose, and the two diverge. Hence `em`, and hence bounds wide + * enough that a different default sans is not a failure: what these catch is + * the measure gone (about 150 characters, which is the defect) or a measure + * nobody could read. The design number is measured in a real face and + * recorded in `tokens.ts`. Every case logs what it saw, so a failure here + * says which font it was arguing with. + * + * ## What a chromium pass proves here + * + * Unlike the touch cases in `editor.spec.ts`, layout is not what this suite's + * engine distinction is about: a measured column is CSS both engines + * implement. Running under `--project=chromium` in a sandbox with no WebKit + * binary is therefore a real check of this file — but it is still never + * reported as a WebKit result. See `playwright.config.ts`. + */ + +/** + * Where the note's first body paragraph is, and how it broke. + * + * The measurements are taken off the **line box** — the leaf element holding + * the sentence, which is what the original report measured at 1160px — rather + * than off `.cm-content`. That is not incidental: `.cm-content` is deliberately + * still the full width of the pane, and the column is cut out of it with + * padding so that a click in the margin still reaches the editor. Measuring the + * element that carries the constraint would prove nothing about the text. + */ +async function paragraph(page: import("@playwright/test").Page): Promise<{ + width: number; + paneWidth: number; + left: number; + right: number; + longestLine: number; + lines: number; + /** What the note is actually set in, so a surprising count can be read. */ + font: string; + fontSize: number; +}> { + await page.goto("/e2e-fixture"); + // `1-projects/context-lc.md` is `SEYI_TREE.defaultSelection`, so the note + // this measures is the one the console opens on with no navigation at all. + const body = page.locator(".cm-line", { hasText: "Tenancy is bucket-level" }).first(); + await expect(body).toBeVisible(); + + return await body.evaluate((line) => { + const scroller = line.closest(".cm-scroller") as HTMLElement; + + /* + How many characters actually land on each rendered visual line, walked + one character at a time through a Range: the only way to ask the engine + where it really broke the text. `.cm-line` is one Markdown line, which is + now one whole paragraph. + */ + const text = line.textContent ?? ""; + const node = line.firstChild; + const lines: number[] = []; + if (node !== null && node.nodeType === Node.TEXT_NODE) { + const range = document.createRange(); + let top: number | null = null; + let count = 0; + for (let at = 0; at < text.length; at += 1) { + range.setStart(node, at); + range.setEnd(node, at + 1); + const box = range.getBoundingClientRect(); + if (top === null) top = box.top; + if (Math.abs(box.top - top) > 1) { + lines.push(count); + top = box.top; + count = 0; + } + count += 1; + } + lines.push(count); + } + + const box = line.getBoundingClientRect(); + const pane = scroller.getBoundingClientRect(); + const style = getComputedStyle(line); + return { + width: box.width, + paneWidth: pane.width, + left: box.left - pane.left, + right: pane.right - box.right, + longestLine: Math.max(...lines), + lines: lines.length, + font: style.fontFamily, + fontSize: Number.parseFloat(style.fontSize), + }; + }); +} + +/** Everything a failure would want to know, on one line of the report. */ +function say(where: string, box: { width: number; longestLine: number; font: string; fontSize: number }): void { + const ems = (box.width / box.fontSize).toFixed(1); + console.log( + `[reading measure] ${where}: ${box.width.toFixed(0)}px (${ems}em) holding ` + + `${box.longestLine} characters at ${box.fontSize}px in ${box.font}`, + ); +} + +test.describe("at a desktop console width", () => { + test.use({ viewport: { width: 1440, height: 900 }, isMobile: false, hasTouch: false }); + + test("a paragraph is a readable column, not the width of the pane", async ({ page }) => { + const box = await paragraph(page); + say("desktop", box); + + // The defect, stated as the thing that must not come back: the paragraph + // filled the pane. It now takes a fraction of it. + expect(box.width).toBeLessThan(box.paneWidth - 100); + + /* + The box itself, which is the half that is the layout's rather than the + font's: the measure is a multiple of the note's own type size, so this + is exact arithmetic and a tight bound is honest here in a way it is not + on the character count below. + */ + expect(box.width / box.fontSize).toBeGreaterThan(30); + expect(box.width / box.fontSize).toBeLessThan(42); + + /* + And the reason that box matters, in the unit the constraint is really + in. The design value is 36em (`layout.readingMeasureEm`), measured at 68 + characters in the console's own face; prose averages 0.45-0.55em a + character, so a different sans puts this anywhere from about 65 to 80. + + These bounds are deliberately wider than that. How many characters fit is + the font's business, and this file must not go red because a CI image + shipped a different default — what it is for is the two failures that are + not about fonts at all: the measure gone (about 150 characters, which is + the defect) and a measure nobody could read. The line above is where the + tight bound lives, because that one is arithmetic. + */ + expect(box.longestLine).toBeGreaterThan(50); + expect(box.longestLine).toBeLessThanOrEqual(95); + + // The paragraph really did wrap more than once — a one-line paragraph + // would satisfy everything above while proving nothing. + expect(box.lines).toBeGreaterThan(1); + }); + + test("the column is centred in the pane", async ({ page }) => { + const box = await paragraph(page); + // Within a point of equal, which is a centred column rather than a + // left-aligned one with a ceiling on its width. + expect(Math.abs(box.left - box.right)).toBeLessThan(2); + // And there is real space either side to be centred in, so this is not + // passing on a pane the column already fills. + expect(box.left).toBeGreaterThan(60); + }); + + /** + * THE EMPTY HALF OF THE PANE IS STILL THE EDITOR. + * + * The obvious way to draw a measured column is `max-width` plus auto + * margins, and it looks identical. Measured in Chromium, it also leaves + * `.cm-content` 572px wide inside a 1192px pane — so a click in the 310px + * either side lands on `.cm-scroller`, the editor does not take focus, and + * clicking beside a line to put the caret in it silently does nothing. Half + * the note's apparent area would stop being the editing surface, which is a + * worse bug than the one this change is fixing. + * + * `.cm-content` therefore stays the full width of the pane and the column is + * cut out of it with padding. This is the test that stops the tidier-looking + * recipe coming back. + */ + test("clicking in the margin beside a line still puts the caret in the note", async ({ page }) => { + const box = await paragraph(page); + const line = await page + .locator(".cm-line", { hasText: "Tenancy is bucket-level" }) + .first() + .boundingBox(); + if (line === null) throw new Error("the paragraph has no box to click beside"); + + // Well out into the right-hand margin, level with the first line of the + // paragraph — empty space that belongs to no glyph. + await page.mouse.click(line.x + line.width + box.right / 2, line.y + 8); + + await expect(page.locator(".cm-editor.cm-focused")).toHaveCount(1); + }); +}); + +test.describe("at the phone viewport", () => { + /* + The suite's own 390x844 — deliberately inherited rather than restated, so + this tracks whatever `playwright.config.ts` calls "the phone". + */ + test("the padding governs and the measure never binds", async ({ page }) => { + const box = await paragraph(page); + say("phone", box); + + /* + The whole width the scroller has, less its own gutters, is what the note + gets: no centring, no slack, and in particular nothing lost to a measure + that was set in pixels and happens to be narrower than the screen. + The side padding here is the compact one — 390px is under + `layout.narrowBreakpoint`, so the web console's own media query has + already switched to reading type at 24px gutters — and the column is + simply the pane minus both of them. + */ + expect(box.width).toBe(box.paneWidth - box.left - box.right); + expect(box.left).toBe(box.right); + expect(box.left).toBeLessThan(30); + expect(box.width).toBeGreaterThan(box.paneWidth - 60); + }); +}); diff --git a/apps/mobile/features/console/files/LiveEditor.web.tsx b/apps/mobile/features/console/files/LiveEditor.web.tsx index 6c5ecf8d..139280c5 100644 --- a/apps/mobile/features/console/files/LiveEditor.web.tsx +++ b/apps/mobile/features/console/files/LiveEditor.web.tsx @@ -261,6 +261,27 @@ function ensureStyles(colors: Colors): void { is the note's body text and existed before anything here needed a token. */ --lp-body: ${fonts.body}; + /* + THE READING MEASURE — the one --lp-* here that is not a colour or a face. + + It is in this block rather than beside the rule that uses it for the + reason the paragraph above gives: the identical rule runs inside the iOS + WebView, where every --lp-* arrives over the bridge, so a property + declared on one host and read on both is a declaration that silently + becomes nothing on the other. themeVars sends this one too. + + A BARE NUMBER, and the unit is added by the rule that uses it. A + font-relative length inside a custom property may be resolved either where + the property is declared or where it is substituted, and engines differ — + and those are two different lengths here, because this element is Times New + Roman at 16px (nothing sets a face on it) while the note is a sans at + 14.5px. Multiplying by 1em down in .cm-content resolves it against the text + it is measuring, on every engine. + + The number is layout.readingMeasureEm, which carries the argument for it, + including why it is em rather than the ch that nominally means characters. + */ + --lp-measure: ${layout.readingMeasureEm}; height: 100%; } .cm-lp-root .cm-editor { height: 100%; background: transparent; } @@ -277,7 +298,44 @@ function ensureStyles(colors: Colors): void { that says "the note's ink" resolve to one colour. The media query below moves both by moving the property once. */ -.cm-lp-root .cm-content { color: var(--lp-content); caret-color: ${colors.text}; } +.cm-lp-root .cm-content { + color: var(--lp-content); + caret-color: ${colors.text}; + /* + ONE COLUMN, AND EVERYTHING IN THE NOTE SHARES IT. + + The measure is on .cm-content rather than on .cm-line because a note is + not only prose: a table, a form, a rendered diagram and a code fence are + block children of the same element, and constraining the lines alone would + leave every one of those starting at a different left edge from the + sentence above it. Nothing is allowed to be wider than the text it belongs + to; what a wide table gets instead is its own scroller (.cm-lp-grid's + overflow-x), which is why a 12-column table still reads as part of the + document rather than dragging the document sideways. + + PADDING RATHER THAN MAX-WIDTH, BECAUSE THE EMPTY HALF OF THE PANE IS + STILL THE EDITOR. + + The obvious recipe is max-width plus auto margins, and it draws exactly + the same column. It was measured in Chromium and rejected: it makes + .cm-content 572px wide inside a 1192px pane, so the 310px either side of + the text stop being the editable surface. A click there lands on + .cm-scroller, the editor does not take focus, and nothing happens — on a + desktop console that is half the note's apparent area gone dead, and + clicking beside a line to put the caret in it is something people do. + + Padding keeps .cm-content the full width of the pane, so CodeMirror's own + mousedown handler still maps a click in the margin to the nearest position + the way it always did, while every block child is inset to the measure. + The max() floor is what hands the width back at narrow widths: once the + pane is no wider than the measure the padding is zero and .cm-scroller's + --lp-pad-x is the only gutter, which is the phone. + + 1em is this element's own font size — the note's — which is the point of + doing the multiplication here rather than storing a length. + */ + padding-inline: max(0px, calc((100% - var(--lp-measure) * 1em) / 2)); +} .cm-lp-root .cm-line { padding: 0; } /* The phone reads the note; it does not inspect it. Same buffer, same diff --git a/apps/mobile/features/console/files/webview/bundle.generated.ts b/apps/mobile/features/console/files/webview/bundle.generated.ts index 1582e0b1..89d93c73 100644 --- a/apps/mobile/features/console/files/webview/bundle.generated.ts +++ b/apps/mobile/features/console/files/webview/bundle.generated.ts @@ -24,7 +24,7 @@ export const BUNDLE_SOURCES: Readonly> = { "apps/mobile/features/console/files/webview/entry.ts": "edca54f0c85601d58512fd82e78df9b7483f259b9f85016de39b35c2a75d671c", "apps/mobile/features/console/files/webview/guest.ts": "8aa05f9e3cfceb184bbb7f244c7bb12f161b1ee545832df23a08b75fb981236b", "apps/mobile/features/console/files/webview/protocol.ts": "bd041d45a7262d7209e61c950c585f2e2ddaf0c50ae993e9b943a560d07800e2", - "apps/mobile/features/console/files/webview/styles.ts": "31f054311ef8cc98f3552509ebaf0934cfc05def1b7c3901e4ac97bc601c6c77", + "apps/mobile/features/console/files/webview/styles.ts": "11c62ea7059e58adfcadba577f6a86012b919d1e6fbc819ecb47287ea6ccdd53", "packages/shared/src/links.ts": "0c9cdadea3905d11d1f6d5ad12e142c6e481ead8dbaacd488be5aa0815a978c1" }; @@ -72,4 +72,4 @@ export const BUNDLE_BUILDER: Readonly<{ esbuild: string }> = { * One long line on purpose: it is minified output, and reflowing it would make * every rebuild a whole-file diff for no reader's benefit. */ -export const EDITOR_BUNDLE: string = "\"use strict\";(()=>{var bs=[],nh=[];(()=>{let n=\"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,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5\".split(\",\").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(n=nh[i])e=i+1;else return!0;if(e==t)return!1}}function eh(n){return n>=127462&&n<=127487}var th=8205;function rh(n,e,t=!0,i=!0){return(t?sh:yO)(n,e,i)}function sh(n,e,t){if(e==n.length)return e;e&&oh(n.charCodeAt(e))&&lh(n.charCodeAt(e-1))&&e--;let i=gs(n,e);for(e+=ih(i);e=0&&eh(gs(n,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function yO(n,e,t){for(;e>1;){let i=sh(n,e-2,t);if(i=56320&&n<57344}function lh(n){return n>=55296&&n<56320}function ih(n){return n<65536?1:2}var _=class n{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=bi(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),Oi.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=bi(this,e,t);let i=[];return this.decompose(e,t,i,0),Oi.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new Ut(this),s=new Ut(e);for(let o=t,l=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(e=1){return new Ut(this,e)}iterRange(e,t=this.length){return new qn(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Nn(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError(\"A document must have at least one line\");return e.length==1&&!e[0]?n.empty:e.length<=32?new $e(e):Oi.from($e.split(e,[]))}},$e=class n extends _{constructor(e,t=SO(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((t?i:l)>=e)return new Ss(r,l,i,o);r=l+1,i++}}decompose(e,t,i,r){let s=e<=0&&t>=this.length?this:new n(ah(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=i.pop(),l=Bn(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new n(l,o.length+s.length));else{let a=l.length>>1;i.push(new n(l.slice(0,a)),new n(l.slice(a)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof n))return super.replace(e,t,i);[e,t]=bi(this,e,t);let r=Bn(this.text,Bn(i.text,ah(this.text,0,e)),t),s=this.length+i.length-(t-e);return r.length<=32?new n(r,s):Oi.from(n.split(r,[]),s)}sliceString(e,t=this.length,i=`\n`){[e,t]=bi(this,e,t);let r=\"\";for(let s=0,o=0;s<=t&&oe&&o&&(r+=i),es&&(r+=l.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(t.push(new n(i,r)),i=[],r=-1);return r>-1&&t.push(new n(i,r)),t}},Oi=class n extends _{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,r);r=l+1,i=a+1}}decompose(e,t,i,r){for(let s=0,o=0;o<=t&&s=o){let h=r&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if([e,t]=bi(this,e,t),i.lines=s&&t<=l){let a=o.replace(e-s,t-s,i),h=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>h>>6){let c=this.children.slice();return c[r]=a,new n(c,this.length-(t-e)+i.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`\n`){[e,t]=bi(this,e,t);let r=\"\";for(let s=0,o=0;se&&s&&(r+=i),eo&&(r+=l.sliceString(e-o,t-o,i)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof n))return 0;let i=0,[r,s,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==l)return i;let a=this.children[r],h=e.children[s];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new $e(d,t)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>s&&d instanceof n)for(let O of d.children)f(O);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof $e&&a&&(p=c[c.length-1])instanceof $e&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new $e(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>r&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:n.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new n(l,t)}};_.empty=new $e([\"\"],0);function SO(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Bn(n,e,t=0,i=1e9){for(let r=0,s=0,o=!0;s=t&&(a>i&&(l=l.slice(0,i-r)),r0?1:(e instanceof $e?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,l=r instanceof $e?r.text.length:r.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value=\"\",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`\n`,this;e--}else if(r instanceof $e){let a=r.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof $e?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},qn=class{constructor(e,t,i){this.value=\"\",this.done=!1,this.cursor=new Ut(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=\"\",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=i?r:t<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=\"\"}},Nn=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=\"\",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=\"\",this.afterBreak=!1):t?(this.done=!0,this.value=\"\"):i?this.afterBreak?this.value=\"\":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<\"u\"&&(_.prototype[Symbol.iterator]=function(){return this.iter()},Ut.prototype[Symbol.iterator]=qn.prototype[Symbol.iterator]=Nn.prototype[Symbol.iterator]=function(){return this});var Ss=class{constructor(e,t,i,r){this.from=e,this.to=t,this.number=i,this.text=r}get length(){return this.to-this.from}};function bi(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function re(n,e,t=!0,i=!0){return rh(n,e,t,i)}function xO(n){return n>=56320&&n<57344}function kO(n){return n>=55296&&n<56320}function at(n,e){let t=n.charCodeAt(e);if(!kO(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return xO(i)?(t-55296<<10)+(i-56320)+65536:t}function dh(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function wt(n){return n<65536?1:2}var xs=/\\r\\n?|\\n/,ne=function(n){return n[n.Simple=0]=\"Simple\",n[n.TrackDel=1]=\"TrackDel\",n[n.TrackBefore=2]=\"TrackBefore\",n[n.TrackAfter=3]=\"TrackAfter\",n}(ne||(ne={})),ot=class n{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-r);s+=l}else{if(i!=ne.Simple&&h>=e&&(i==ne.TrackDel&&re||i==ne.TrackBefore&&re))return null;if(h>e||h==e&&t<0&&!l)return e==r||t<0?s:s+a;s+=a}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let i=0,r=0;i=0&&r<=t&&l>=e)return rt?\"cover\":!0;r=l}return!1}toString(){let e=\"\";for(let t=0;t=0?\":\"+r:\"\")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!=\"number\"))throw new RangeError(\"Invalid JSON representation of ChangeDesc\");return new n(e)}static create(e){return new n(e)}},Oe=class n extends ot{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError(\"Applying change set to a document with the wrong length\");return ks(this,(t,i,r,s,o)=>e=e.replace(r,r+(i-t),o),!1),e}mapDesc(e,t=!1){return ws(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,s=0;r=0){t[r]=l,t[r+1]=o;let a=r>>1;for(;i.length0&&kt(i,t,s.text),s.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let r=[],s=[],o=0,l=null;function a(c=!1){if(!c&&!r.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d==\"string\"?_.of(d.split(i||xs)):d:_.empty,O=p.length;if(f==u&&O==0)return;fo&&ce(r,f-o,-1),ce(r,u-f,O),kt(s,r,p),o=u}}return h(e),a(!l),l}static empty(e){return new n(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError(\"Invalid JSON representation of ChangeSet\");let t=[],i=[];for(let r=0;rl&&typeof o!=\"string\"))throw new RangeError(\"Invalid JSON representation of ChangeSet\");if(s.length==1)t.push(s[0],0);else{for(;i.length=0&&t<=0&&t==n[r+1]?n[r]+=e:r>=0&&e==0&&n[r]==0?n[r+1]+=t:i?(n[r]+=e,n[r+1]+=t):n.push(e,t)}function kt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(r,h,s,c,f),r=h,s=c}}}function ws(n,e,t,i=!1){let r=[],s=i?[]:null,o=new Ft(n),l=new Ft(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error(\"Mismatched change set lengths\");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);ce(r,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),s.forward2(a),o.forward(a)}}}}var Ft=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?_.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?_.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},qt=class n{constructor(e,t,i,r){this.from=e,this.to=t,this.flags=i,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,t=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new n(i,r,this.flags,this.goalColumn)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return x.range(e,t,void 0,void 0,i);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return x.range(this.anchor,r,void 0,void 0,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=\"number\"||typeof e.head!=\"number\")throw new RangeError(\"Invalid JSON representation for SelectionRange\");return x.range(e.anchor,e.head)}static create(e,t,i,r){return new n(e,t,i,r)}},x=class n{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:n.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;ie.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!=\"number\"||e.main>=e.ranges.length)throw new RangeError(\"Invalid JSON representation for EditorSelection\");return new n(e.ranges.map(t=>qt.fromJSON(t)),e.main)}static single(e,t=e){return new n([n.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError(\"A selection needs at least one range\");for(let i=0,r=0;rr.from-s.from),t=e.indexOf(i);for(let r=1;rs.head?n.range(a,l):n.range(l,a))}}return new n(e,t)}};function Oh(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError(\"Selection points outside of document\")}var Xs=0,R=class n{constructor(e,t,i,r,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=r,this.id=Xs++,this.default=e([]),this.extensions=typeof s==\"function\"?s(this):s}get reader(){return this}static define(e={}){return new n(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Ms),!!e.static,e.enables)}of(e){return new mi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error(\"Can't compute a static facet\");return new mi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error(\"Can't compute a static facet\");return new mi(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}};function Ms(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}var mi=class{constructor(e,t,i,r){this.dependencies=e,this.facet=t,this.type=i,this.value=r,this.id=Xs++}dynamicSlot(e){var t;let i=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f==\"doc\"?a=!0:f==\"selection\"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Qs(f,c)){let d=i(f);if(l?!hh(d,f.values[o],r):!r(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[s];if(p!=null){let O=Fn(u,p);if(this.dependencies.every(g=>g instanceof R?u.facet(g)===f.facet(g):g instanceof ae?u.field(g,!1)==f.field(g,!1):!0)||(l?hh(d=i(f),O,r):r(d=i(f),O)))return f.values[o]=O,0}else d=i(f);return f.values[o]=d,1}}}get extension(){return this}};function hh(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),r=t.map(a=>a.type),s=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;ci===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Vn).find(i=>i.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,r)=>{let s=i.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[t]=o,1)},reconfigure:(i,r)=>{let s=i.facet(Vn),o=r.facet(Vn),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[t]=l.create(i),1):r.config.address[this.id]!=null?(i.values[t]=r.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,Vn.of({field:this,create:e})]}get extension(){return this}},Nt={lowest:4,low:3,default:2,high:1,highest:0};function Wi(n){return e=>new Gn(e,n)}var Ee={highest:Wi(Nt.highest),high:Wi(Nt.high),default:Wi(Nt.default),low:Wi(Nt.low),lowest:Wi(Nt.lowest)},Gn=class{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}},Ht=class n{of(e){return new qi(this,e)}reconfigure(e){return n.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},qi=class{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}},Un=class n{constructor(e,t,i,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let r=[],s=Object.create(null),o=new Map;for(let u of QO(e,t,o))u instanceof ae?r.push(u):(s[u.facet.id]||(s[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of r)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i?.config.facets;for(let u in s){let d=s[u],p=d[0].facet,O=c&&c[u]||[];if(d.every(g=>g.type==0))if(l[p.id]=a.length<<1|1,Ms(O,d))a.push(i.facet(p));else{let g=p.combine(d.map(b=>b.value));a.push(i&&p.compare(g,i.facet(p))?i.facet(p):g)}else{for(let g of d)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(b=>g.dynamicSlot(b)));l[p.id]=h.length<<1,h.push(g=>wO(g,p,d))}}let f=h.map(u=>u(l));return new n(e,o,f,l,a,s)}};function QO(n,e,t){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof qi&&t.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let h of o)s(h,l);else if(o instanceof qi){if(t.has(o.compartment))throw new RangeError(\"Duplicate use of compartment in extensions\");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),s(h,l)}else if(o instanceof Gn)s(o.inner,o.prec);else if(o instanceof ae)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof mi)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,Nt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(h==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,l)}}return s(n,Nt.default),i.reduce((o,l)=>o.concat(l))}function Bi(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error(\"Cyclic dependency between fields and/or facets\");if(i&2)return i;n.status[t]=4;let r=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|r}function Fn(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}var mh=R.define(),vs=R.define({combine:n=>n.some(e=>e),static:!0}),gh=R.define({combine:n=>n.length?n[0]:void 0,static:!0}),bh=R.define(),yh=R.define(),Sh=R.define(),xh=R.define({combine:n=>n.length?n[0]:!1}),fe=class{constructor(e,t){this.type=e,this.value=t}static define(){return new $s}},$s=class{of(e){return new fe(this,e)}},Ps=class{constructor(e){this.map=e}of(e){return new D(this,e)}},D=class n{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new n(this.type,t)}is(e){return this.type==e}static define(e={}){return new Ps(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(t);s&&i.push(s)}return i}};D.reconfigure=D.define();D.appendConfig=D.define();var ee=class n{constructor(e,t,i,r,s,o){this.startState=e,this.changes=t,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Oh(i,t.newLength),s.some(l=>l.type==n.time)||(this.annotations=s.concat(n.time.of(Date.now())))}static create(e,t,i,r,s,o){return new n(e,t,i,r,s,o)}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(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(n.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]==\".\"))}};ee.time=fe.define();ee.userEvent=fe.define();ee.addToHistory=fe.define();ee.remote=fe.define();function vO(n,e){let t=[];for(let i=0,r=0;;){let s,o;if(i=n[i]))s=n[i++],o=n[i++];else if(r=0;r--){let s=i[r](n);s instanceof ee?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof ee?n=s[0]:n=wh(e,gi(s),!1)}return n}function PO(n){let e=n.startState,t=e.facet(Sh),i=n;for(let r=t.length-1;r>=0;r--){let s=t[r](n);s&&Object.keys(s).length&&(i=kh(i,Ts(e,s,n.changes.newLength),!0))}return i==n?n:ee.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}var TO=[];function gi(n){return n==null?TO:Array.isArray(n)?n:[n]}var Xe=function(n){return n[n.Word=0]=\"Word\",n[n.Space=1]=\"Space\",n[n.Other=2]=\"Other\",n}(Xe||(Xe={})),CO=/[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/,Cs;try{Cs=new RegExp(\"[\\\\p{Alphabetic}\\\\p{Number}_]\",\"u\")}catch{}function AO(n){if(Cs)return Cs.test(n);for(let e=0;e\"\\x80\"&&(t.toUpperCase()!=t.toLowerCase()||CO.test(t)))return!0}return!1}function RO(n){return e=>{if(!/\\S/.test(e))return Xe.Space;if(AO(e))return Xe.Word;for(let t=0;t-1)return Xe.Word;return Xe.Other}}var q=class n{constructor(e,t,i,r,s,o){this.config=e,this.doc=t,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(h,a)),t=null),r.set(l.value.compartment,l.value.extension)):l.is(D.reconfigure)?(t=null,i=l.value):l.is(D.appendConfig)&&(t=null,i=gi(i).concat(l.value));let s;t?s=e.startState.values.slice():(t=Un.resolve(i,r,this),s=new n(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(vs)?e.newSelection:e.newSelection.asSingle();new n(t,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e==\"string\"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:x.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),r=this.changes(i.changes),s=[i.range],o=gi(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return n.create({doc:e.doc,selection:x.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Un.resolve(e.extensions||[],new Map),i=e.doc instanceof _?e.doc:_.of((e.doc||\"\").split(t.staticFacet(n.lineSeparator)||xs)),r=e.selection?e.selection instanceof x?e.selection:x.single(e.selection.anchor,e.selection.head):x.single(0);return Oh(r,i.length),t.staticFacet(vs)||(r=r.asSingle()),new n(t,i,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(n.tabSize)}get lineBreak(){return this.facet(n.lineSeparator)||`\n`}get readOnly(){return this.facet(xh)}phrase(e,...t){for(let i of this.facet(n.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\\$(\\$|\\d*)/g,(i,r)=>{if(r==\"$\")return\"$\";let s=+(r||1);return!s||s>t.length?i:t[s-1]})),e}languageDataAt(e,t,i=-1){let r=[];for(let s of this.facet(mh))for(let o of s(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let t=this.languageDataAt(\"wordChars\",e);return RO(t.length?t[0]:\"\")}wordAt(e){let{text:t,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=re(t,o,!1);if(s(t.slice(a,o))!=Xe.Word)break;o=a}for(;ln.length?n[0]:4});q.lineSeparator=gh;q.readOnly=xh;q.phrases=R.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(r=>n[r]==e[r])}});q.languageData=mh;q.changeFilter=bh;q.transactionFilter=yh;q.transactionExtender=Sh;Ht.reconfigure=D.define();function yi(n,e,t={}){let i={};for(let r of n)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,s))i[s]=t[s](l,o);else throw new Error(\"Config merge conflict for field \"+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}var Me=class{eq(e){return this==e}range(e,t=e){return Ni.create(e,t,this)}};Me.prototype.startSide=Me.prototype.endSide=0;Me.prototype.point=!1;Me.prototype.mapMode=ne.TrackDel;function Es(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}var Ni=class n{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new n(e,t,i)}};function As(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}var Rs=class n{constructor(e,t,i,r){this.from=e,this.to=t,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,r=0){let s=i?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,h=s[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,s);sd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),r.push(u-o),s.push(d-o))}return{mapped:i.length?new n(r,s,i,l):null,pos:o}}},N=class n{constructor(e,t,i,r){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=r}static create(e,t,i,r){return new n(e,t,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(As)),this.isEmpty)return t.length?n.of(t):this;let l=new Hn(this,null,-1).goto(0),a=0,h=[],c=new lt;for(;l.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||sl.to||s=s&&e<=s+o.length&&o.between(s,e-s,t-s,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Gi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Gi.from(e).goto(t)}static compare(e,t,i,r,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=ch(o,l,i),h=new Gt(o,a,s),c=new Gt(l,a,s);i.iterGaps((f,u,d)=>fh(h,f,c,u,d,r)),i.empty&&i.length==0&&fh(h,0,c,0,0,r)}static eq(e,t,i=0,r){r==null&&(r=999999999);let s=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=ch(s,o),a=new Gt(s,l,0).goto(i),h=new Gt(o,l,0).goto(i);for(;;){if(a.to!=h.to||!Zs(a.active,h.active)||a.point&&(!h.point||!Es(a.point,h.point)))return!1;if(a.to>r)return!0;a.next(),h.next()}}static spans(e,t,i,r,s=-1){let o=new Gt(e,null,s).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroml&&(r.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new lt;for(let r of e instanceof Ni?[e]:t?ZO(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return n.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=n.empty;r=r.nextLayer)t=new n(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}};N.empty=new N([],[],null,-1);function ZO(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(As);e=i}return n}N.empty.nextLayer=N.empty;var lt=class n{finishChunk(e){this.chunks.push(new Rs(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,e&&(this.from=[],this.to=[],this.value=[])}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}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new n)).add(e,t,i)}addInner(e,t,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error(\"Ranges must be added sorted by `from` position and `startSide`\");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(N.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=N.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function ch(n,e,t){let i=new Map;for(let s of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new Hn(o,t,i,s));return r.length==1?r[0]:new n(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)ys(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)ys(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),ys(this.heap,0)}}};function ys(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let r=n[i];if(i+1=0&&(r=n[i+1],i++),t.compare(r)<0)break;n[i]=t,n[e]=r,e=i}}var Gt=class{constructor(e,t,i){this.minPoint=i,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=Gi.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){In(this.active,e),In(this.activeTo,e),In(this.activeRank,e),this.minActive=uh(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:r,rank:s}=this.cursor;for(;t0;)t++;Wn(this.active,t,i),Wn(this.activeTo,t,r),Wn(this.activeRank,t,s),e&&Wn(e,t,this.cursor.from),this.minActive=uh(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&In(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}};function fh(n,e,t,i,r,s){n.goto(e),t.goto(i);let o=i+r,l=i,a=i-e,h=!!s.boundChange;for(let c=!1;;){let f=n.to+a-t.to,u=f||n.endSide-t.endSide,d=u<0?n.to+a:t.to,p=Math.min(d,o);if(n.point||t.point?(n.point&&t.point&&Es(n.point,t.point)&&Zs(n.activeForPoint(n.to),t.activeForPoint(t.to))||s.comparePoint(l,p,n.point,t.point),c=!1):(c&&s.boundChange(l),p>l&&!Zs(n.active,t.active)&&s.compareRange(l,p,n.active,t.active),h&&po)break;l=d,u<=0&&n.next(),u>=0&&t.next()}}function Zs(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function uh(n,e){let t=-1,i=1e9;for(let r=0;r=e)return r;if(r==n.length)break;s+=n.charCodeAt(r)==9?t-s%t:1,r=re(n,r)}return i===!0?-1:n.length}var Ls=\"\\u037C\",vh=typeof Symbol>\"u\"?\"__\"+Ls:Symbol.for(Ls),zs=typeof Symbol>\"u\"?\"__styleSet\"+Math.floor(Math.random()*1e8):Symbol(\"styleSet\"),$h=typeof globalThis<\"u\"?globalThis:typeof window<\"u\"?window:{},Le=class{constructor(e,t){this.rules=[];let{finish:i}=t||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\\s*/)}function s(o,l,a,h){let c=[],f=/^@(\\w+)\\b/.exec(o[0]),u=f&&f[1]==\"keyframes\";if(f&&l==null)return a.push(o[0]+\";\");for(let d in l){let p=l[d];if(/&/.test(d))s(d.split(/,\\s*/).map(O=>o.map(g=>O.replace(/&/,g))).reduce((O,g)=>O.concat(g)),p,a);else if(p&&typeof p==\"object\"){if(!f)throw new RangeError(\"The value of a property (\"+d+\") should be a primitive value.\");s(r(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,\"\").replace(/[A-Z]/g,O=>\"-\"+O.toLowerCase())+\": \"+p+\";\")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(\", \")+\" {\"+c.join(\" \")+\"}\")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(`\n`)}static newName(){let e=$h[vh]||1;return $h[vh]=e+1,Ls+e.toString(36)}static mount(e,t,i){let r=e[zs],s=i&&i.nonce;r?s&&r.setNonce(s):r=new _s(e,s),r.mount(Array.isArray(t)?t:[t],e)}},Ph=new Map,_s=class{constructor(e,t){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=Ph.get(i);if(s)return e[zs]=s;this.sheet=new r.CSSStyleSheet,Ph.set(i,this)}else this.styleTag=i.createElement(\"style\"),t&&this.styleTag.setAttribute(\"nonce\",t);this.modules=[],e[zs]=this}mount(e,t){let i=this.sheet,r=0,s=0;for(let o=0;o-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),i)for(let h=0;h\",191:\"?\",192:\"~\",219:\"{\",220:\"|\",221:\"}\",222:'\"'},XO=typeof navigator<\"u\"&&/Mac/.test(navigator.platform),MO=typeof navigator<\"u\"&&/MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent);for(ie=0;ie<10;ie++)ht[48+ie]=ht[96+ie]=String(ie);var ie;for(ie=1;ie<=24;ie++)ht[ie+111]=\"F\"+ie;var ie;for(ie=65;ie<=90;ie++)ht[ie]=String.fromCharCode(ie+32),Si[ie]=String.fromCharCode(ie);var ie;for(Kn in ht)Si.hasOwnProperty(Kn)||(Si[Kn]=ht[Kn]);var Kn;function Th(n){var e=XO&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||MO&&n.shiftKey&&n.key&&n.key.length==1||n.key==\"Unidentified\",t=!e&&n.key||(n.shiftKey?Si:ht)[n.keyCode]||n.key||\"Unidentified\";return t==\"Esc\"&&(t=\"Escape\"),t==\"Del\"&&(t=\"Delete\"),t==\"Left\"&&(t=\"ArrowLeft\"),t==\"Up\"&&(t=\"ArrowUp\"),t==\"Right\"&&(t=\"ArrowRight\"),t==\"Down\"&&(t=\"ArrowDown\"),t}var me=typeof navigator<\"u\"?navigator:{userAgent:\"\",vendor:\"\",platform:\"\"},Bs=typeof document<\"u\"?document:{documentElement:{style:{}}},qs=/Edge\\/(\\d+)/.exec(me.userAgent),rc=/MSIE \\d/.test(me.userAgent),Ns=/Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(me.userAgent),Qr=!!(rc||Ns||qs),Ch=!Qr&&/gecko\\/(\\d+)/i.test(me.userAgent),js=!Qr&&/Chrome\\/(\\d+)/.exec(me.userAgent),Ah=\"webkitFontSmoothing\"in Bs.documentElement.style,Gs=!Qr&&/Apple Computer/.test(me.vendor),Rh=Gs&&(/Mobile\\/\\w+/.test(me.userAgent)||me.maxTouchPoints>2),$={mac:Rh||/Mac/.test(me.platform),windows:/Win/.test(me.platform),linux:/Linux|X11/.test(me.platform),ie:Qr,ie_version:rc?Bs.documentMode||6:Ns?+Ns[1]:qs?+qs[1]:0,gecko:Ch,gecko_version:Ch?+(/Firefox\\/(\\d+)/.exec(me.userAgent)||[0,0])[1]:0,chrome:!!js,chrome_version:js?+js[1]:0,ios:Rh,android:/Android\\b/.test(me.userAgent),webkit:Ah,webkit_version:Ah?+(/\\bAppleWebKit\\/(\\d+)/.exec(me.userAgent)||[0,0])[1]:0,safari:Gs,safari_version:Gs?+(/\\bVersion\\/(\\d+(\\.\\d+)?)/.exec(me.userAgent)||[0,0])[1]:0,tabSize:Bs.documentElement.style.tabSize!=null?\"tab-size\":\"-moz-tab-size\"};function Zo(n,e){for(let t in n)t==\"class\"&&e.class?e.class+=\" \"+n.class:t==\"style\"&&e.style?e.style+=\";\"+n.style:e[t]=n[t];return e}var hr=Object.create(null);function Xo(n,e,t){if(n==e)return!0;n||(n=hr),e||(e=hr);let i=Object.keys(n),r=Object.keys(e);if(i.length-(t&&i.indexOf(t)>-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let s of i)if(s!=t&&(r.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function EO(n,e){for(let t=n.attributes.length-1;t>=0;t--){let i=n.attributes[t].name;e[i]==null&&n.removeAttribute(i)}for(let t in e){let i=e[t];t==\"style\"?n.style.cssText=i:n.getAttribute(t)!=i&&n.setAttribute(t,i)}}function Zh(n,e,t){let i=!1;if(e)for(let r in e)t&&r in t||(i=!0,r==\"style\"?n.style.cssText=\"\":n.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(i=!0,r==\"style\"?n.style.cssText=t[r]:n.setAttribute(r,t[r]));return i}function LO(n){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new ei(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=sc(e,t);i=(s?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new ei(e,i,r,t,e.widget||null,!0)}static line(e){return new ln(e)}static set(e,t=!1){return N.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};L.none=N.empty;var on=class n extends L{constructor(e){let{start:t,end:i}=sc(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||\"span\",this.attrs=e.class&&e.attributes?Zo(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||hr}eq(e){return this==e||e instanceof n&&this.tagName==e.tagName&&Xo(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError(\"Mark decorations may not be empty\");return super.range(e,t)}};on.prototype.point=!1;var ln=class n extends L{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof n&&this.spec.class==e.spec.class&&Xo(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError(\"Line decoration ranges must be zero-length\");return super.range(e,t)}};ln.prototype.mapMode=ne.TrackBefore;ln.prototype.point=!0;var ei=class n extends L{constructor(e,t,i,r,s,o){super(t,i,s,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?ne.TrackBefore:ne.TrackAfter:ne.TrackDel}get type(){return this.startSide!=this.endSide?Ye.WidgetRange:this.startSide<=0?Ye.WidgetBefore:Ye.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof n&&zO(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError(\"Invalid range for replacement decoration\");if(!this.isReplace&&t!=e)throw new RangeError(\"Widget decorations can only have zero-length ranges\");return super.range(e,t)}};ei.prototype.point=!0;function sc(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function zO(n,e){return n==e||!!(n&&e&&n.compare(e))}function Qi(n,e,t,i=0){let r=t.length-1;r>=0&&t[r]+i>=n?t[r]=Math.max(t[r],e):t.push(n,e)}var cr=class n extends Me{constructor(e,t,i){super(),this.tagName=e,this.attributes=t,this.rank=i}eq(e){return e==this||e instanceof n&&this.tagName==e.tagName&&Xo(this.attributes,e.attributes)}static create(e){return new n(e.tagName,e.attributes||hr,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return N.of(e,t)}};cr.prototype.startSide=cr.prototype.endSide=-1;function an(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Us(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function Hi(n,e){if(!e.anchorNode)return!1;try{return Us(n,e.anchorNode)}catch{return!1}}function Ki(n){return n.nodeType==3?cn(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Ji(n,e,t,i){return t?Xh(n,e,t,i,-1)||Xh(n,e,t,i,1):!1}function $t(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function fr(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\\d|SECTION|PRE)$/.test(n.nodeName)}function Xh(n,e,t,i,r){for(;;){if(n==t&&e==i)return!0;if(e==(r<0?0:ut(n))){if(n.nodeName==\"DIV\")return!1;let s=n.parentNode;if(!s||s.nodeType!=1)return!1;e=$t(n)+(r<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(r<0?-1:0)],n.nodeType==1&&n.contentEditable==\"false\")return!1;e=r<0?ut(n):0}else return!1}}function ut(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function hn(n,e){let{left:t,right:i}=n;if(t==i)return n;let r=e?t:i;return{left:r,right:r,top:n.top,bottom:n.bottom}}function _O(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function oc(n,e){let t=e.width/n.offsetWidth,i=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-n.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function jO(n,e,t,i,r,s,o,l){let a=n.ownerDocument,h=a.defaultView||window;for(let c=n,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body,p=1,O=1;if(d)u=_O(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let y=c.getBoundingClientRect();({scaleX:p,scaleY:O}=oc(c,y)),u={left:y.left,right:y.left+c.clientWidth*p,top:y.top,bottom:y.top+c.clientHeight*O}}let g=0,b=0;if(r==\"nearest\")e.top0&&e.bottom>u.bottom+b&&(b=e.bottom-u.bottom+o)):e.bottom>u.bottom-o&&(b=e.bottom-u.bottom+o,t<0&&e.top-b0&&e.right>u.right+g&&(g=e.right-u.right+s)):e.right>u.right-s&&(g=e.right-u.right+s,t<0&&e.leftu.bottom||e.leftu.right)&&(e={left:Math.max(e.left,u.left),right:Math.min(e.right,u.right),top:Math.max(e.top,u.top),bottom:Math.min(e.bottom,u.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function lc(n,e=!0){let t=n.ownerDocument,i=null,r=null;for(let s=n.parentNode;s&&!(s==t.body||(!e||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}var Fs=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?ut(t):0),i,Math.min(e.focusOffset,i?ut(i):0))}set(e,t,i,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=r}};function ac(n){let e=[];for(let t=n;t;t=t.nodeType==11?t.host:t.parentNode)t.nodeType==1&&e.push({node:t,left:t.scrollLeft,top:t.scrollTop});return e}function hc(n,e=!0){for(let{node:t,left:i,top:r}of n)e&&t.scrollTop!=r&&(t.scrollTop=r),t.scrollLeft!=i&&(t.scrollLeft=i)}var Kt=null;$.safari&&$.safari_version>=26&&(Kt=!1);function cc(n){if(n.setActive)return n.setActive();if(Kt)return n.focus(Kt);let e=ac(n);n.focus(Kt==null?{get preventScroll(){return Kt={preventScroll:!0},!0}}:void 0),Kt||(Kt=!1,hc(e))}var Mh;function cn(n,e,t=e){let i=Mh||(Mh=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function vi(n,e,t,i){let r={key:e,code:e,keyCode:t,which:t,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let s=new KeyboardEvent(\"keydown\",r);s.synthetic=!0,n.dispatchEvent(s);let o=new KeyboardEvent(\"keyup\",r);return o.synthetic=!0,n.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function YO(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function DO(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,ut(t));;)if(i){if(t.nodeType!=1)return!1;let r=t.childNodes[i-1];r.contentEditable==\"false\"?i--:(t=r,i=ut(t))}else{if(t==n)return!0;i=$t(t),t=t.parentNode}}function fc(n){return n instanceof Window?n.pageYOffset>Math.max(0,n.document.documentElement.scrollHeight-n.innerHeight-4):n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function uc(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i>0)return{node:t,offset:i};if(t.nodeType==1&&i>0){if(t.contentEditable==\"false\")return null;t=t.childNodes[i-1],i=ut(t)}else if(t.parentNode&&!fr(t))i=$t(t),t=t.parentNode;else return null}}function dc(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i=t){if(l.level==i)return o;(s<0||(r!=0?r<0?l.fromt:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError(\"Index out of range\");return s}};function mc(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;O-=3)if(et[O+1]==-d){let g=et[O+2],b=g&2?r:g&4?g&1?s:r:0;b&&(G[f]=G[et[O]]=b),l=O;break}}else{if(et.length==189)break;et[l++]=f,et[l++]=u,et[l++]=a}else if((p=G[f])==2||p==1){let O=p==r;a=O?0:1;for(let g=l-3;g>=0;g-=3){let b=et[g+2];if(b&2)break;if(O)et[g+2]|=2;else{if(b&4)break;et[g+2]|=4}}}}}function NO(n,e,t,i){for(let r=0,s=i;r<=t.length;r++){let o=r?t[r-1].to:n,l=ra;)p==g&&(p=t[--O].from,g=O?t[O-1].to:n),G[--p]=d;a=c}else s=h,a++}}}function Ks(n,e,t,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let a=e,h=0;aa&&o.push(new je(a,O.from,d));let g=O.direction==ti!=!(d%2);Js(n,g?i+1:i,r,O.inner,O.from,O.to,o),a=O.to}p=O.to}else{if(p==t||(c?G[p]!=l:G[p]==l))break;p++}u?Ks(n,a,p,i+1,r,u,o):ae;){let c=!0,f=!1;if(!h||a>s[h-1].to){let O=G[a-1];O!=l&&(c=!1,f=O==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;e:for(;;)if(h&&p==s[h-1].to){if(f)break e;let O=s[--h];if(!c)for(let g=O.from,b=h;;){if(g==e)break e;if(b&&s[b-1].to==g)g=s[--b].from;else{if(G[g-1]==l)break e;break}}if(u)u.push(O);else{O.toG.length;)G[G.length]=256;let i=[],r=e==ti?0:1;return Js(n,r,r,t,0,n.length,i),i}function gc(n){return[new je(0,n,0)]}var bc=\"\";function UO(n,e,t,i,r){var s;let o=i.head-n.from,l=je.find(e,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),a=e[l],h=a.side(r,t);if(o==h){let u=l+=r?1:-1;if(u<0||u>=e.length)return null;a=e[l=u],o=a.side(!r,t),h=a.side(r,t)}let c=re(n.text,o,a.forward(r,t));(ca.to)&&(c=h),bc=n.text.slice(Math.min(o,c),Math.max(o,c));let f=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return f&&c==h&&f.level+(r?0:1)n.some(e=>e)}),HO=R.define({combine:n=>n.some(e=>e)}),$c=R.define(),en=class n{constructor(e,t,i,r,s,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new n(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new n(x.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},Jn=D.define({map:(n,e)=>n.map(e)}),Pc=D.define();function ue(n,e,t){let i=n.facet(kc);i.length?i[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+\":\",e):console.error(e))}var ct=R.define({combine:n=>n.length?n[0]:!0}),KO=0,ki=R.define({combine(n){return n.filter((e,t)=>{for(let i=0;i{let a=[];return o&&a.push(vr.of(h=>{let c=h.plugin(l);return c?o(c):L.none})),s&&a.push(s(l)),a})}static fromClass(e,t){return n.define((i,r)=>new e(i,r),t)}},tn=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(ue(t.state,i,\"CodeMirror plugin crashed\"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){ue(e.state,t,\"CodeMirror plugin crashed\"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){ue(e.state,i,\"CodeMirror plugin crashed\")}}deactivate(){this.spec=this.value=null}},Tc=R.define(),zo=R.define(),vr=R.define(),Cc=R.define(),_o=R.define(),fn=R.define(),Ac=R.define();function Eh(n,e){let t=n.state.facet(Ac);if(!t.length)return t;let i=t.map(s=>s instanceof Function?s(n):s),r=[];return N.spans(i,e.from,e.to,{point(){},span(s,o,l,a){let h=s-e.from,c=o-e.from,f=r;for(let u=l.length-1;u>=0;u--,a--){let d=l[u].spec.bidiIsolate,p;if(d==null&&(d=FO(e.text,h,c)),a>0&&f.length&&(p=f[f.length-1]).to==h&&p.direction==d)p.to=c,f=p.inner;else{let O={from:h,to:c,direction:d,inner:[]};f.push(O),f=O.inner}}}}),r}var Rc=R.define();function jo(n){let e=0,t=0,i=0,r=0;for(let s of n.state.facet(Rc)){let o=s(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:t,top:i,bottom:r}}var Ui=R.define(),Be=class n{constructor(e,t,i,r){this.fromA=e,this.toA=t,this.fromB=i,this.toB=r}join(e){return new n(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>i.toA)){if(r.toAr.push(new Be(s,o,l,a))),this.changedRanges=r}static create(e,t,i){return new n(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},JO=[],K=class{constructor(e,t,i=0){this.dom=e,this.length=t,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return JO}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&EO(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:\"\")+(this.breakAfter?\"#\":\"\")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let i=t;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError(\"Invalid child in posBefore\")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t,i){return null}domPosFor(e,t){let i=$t(this.dom),r=this.length?e>0:t>0;return new tt(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Pi)return e;return null}static get(e){return e.cmTile}},$i=class extends K{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,i=null,r,s=e?.node==t?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,r=i?i.nextSibling:t.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==t)for(;r&&r!=l.dom;)r=Lh(r);else t.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:t.firstChild,s&&r&&(s.written=!0);r;)r=Lh(r);this.length=o}};function Lh(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}var Pi=class extends $i{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=K.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!t.length)return;i=i.parent,i.breakAfter&&s++,r=t.pop()}else{let o=i.children[r++];if(o instanceof ft)t.push(r),i=o,r=0;else{let l=s+o.length,a=e(o,s);if(a!==void 0)return a;s=l+o.breakAfter}}}resolveBlock(e,t){let i,r=-1,s,o=-1;if(this.blockTiles((l,a)=>{let h=a+l.length;if(e>=a&&e<=h){if(l.isWidget()&&t>=-1&&t<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(ae||e==a&&(t>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-a)}}),!i&&!s)throw new Error(\"No tile at position \"+e);return i&&t<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}},ft=class n extends $i{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let i=new n(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}},Ti=class n extends $i{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,i){let r=new n(t||document.createElement(\"div\"),e);return(!t||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,i){let r=null,s=-1,o=null,l=-1;function a(c,f){for(let u=0,d=0;u=f&&(p.isComposite()?a(p,f-d):(!o||o.isHidden&&(t>0&&!(o.flags&32)||i&&tm(o,p)))&&(O>f||p.flags&32&&t<=1)?(o=p,l=f-d):(d=-1)&&(r=p,s=f-d)),d=O}}a(this,e);let h=(t<0?r:o)||r||o;return h?{tile:h,offset:h==r?s:l}:null}coordsIn(e,t,i){let r=this.resolveInline(e,t,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),t,i):em(this)}domIn(e,t){let i=this.resolveInline(e,t);if(i){let{tile:r,offset:s}=i;if(this.dom.contains(r.dom))return r.isText()?new tt(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:t);let o=i.tile.parent,l=!1;for(let a of o.children){if(l)return new tt(a.dom,0);a==i.tile&&(l=!0)}}return new tt(this.dom,0)}};function em(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=Ki(e);return t[t.length-1]||null}function tm(n,e){let t=n.coordsIn(0,1),i=e.coordsIn(0,1);return t&&i&&i.topr&&(e=r);let s=e,o=e,l=0;e==0&&t<0||e==r&&t>=0?$.chrome||$.gecko||(e?(s--,l=1):o=0)?0:a.length-1];return $.safari&&!l&&h.width==0&&(h=Array.prototype.find.call(a,c=>c.width)||h),i==null?h:hn(h,(l?l>0:t<0)==i)}static of(e,t){let i=new n(t||document.createTextNode(e),e);return t||(i.flags|=2),i}},ii=class n extends K{constructor(e,t,i,r){super(e,t,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,i){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(i)return hn(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?s.length-1:0;o=s[a],!(e>0?a==0:a==s.length-1||o.top0==i)}},to=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;e||t>0;)if(r.isComposite())if(o){if(!e)break;i&&i.break(),e--,o=!1}else if(s==r.children.length){if(!e&&!l.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let a=r.children[s],h=a.breakAfter;(t>0?a.length<=e:a.length=0;l--){let a=t.marks[l],h=r.lastChild;if(h instanceof xe&&h.mark.eq(a.mark))h.dom!=a.dom&&h.setDOM(Ys(a.dom)),r=h;else{if(this.cache.reused.get(a)){let f=K.get(a.dom);f&&f.setDOM(Ys(a.dom))}let c=xe.of(a.mark,a.dom);r.append(c),r=c}this.cache.reused.set(a,2)}let s=K.get(e.text);s&&this.cache.reused.set(s,2);let o=new Jt(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,r.append(o)}addInlineWidget(e,t,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(t,i);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,i){this.flushBuffer(),this.ensureMarks(t,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var i;e||(e=Zc);let r=Ti.start(e,t||((i=this.cache.find(Ti))===null||i===void 0?void 0:i.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var i;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],l;if(t>0&&(l=r.lastChild)&&l instanceof xe&&l.mark.eq(o))r=l,t--;else{let a=xe.of(o,(i=this.cache.find(xe,h=>h.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(a),r=a,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!zh(this.curLine,!1)||e.dom.nodeName!=\"BR\"&&e.isWidget()&&!($.ios&&zh(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Ds,0,32)||new ii(Ds.toDOM(),0,Ds,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to=this.pos){let t=e.rank*102+e.value.rank,i=new io(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let i of this.wrappers){let r=t.lastChild;if(i.fromo.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);t.append(s),t=s}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),i=this.cache.find(Ci,void 0,1);return i&&(i.flags=t),i||new Ci(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},ro=class{constructor(e){this.skipCount=0,this.text=\"\",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=\"\",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error(\"Ran out of text content when drawing inline views\");this.text=r;let l=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,l)}let t=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,t);return this.textOff=t,i}},dr=[ii,Ti,Jt,xe,Ci,ft,Pi];for(let n=0;n[]),this.index=dr.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,i=this.buckets[t];i.length<6?i.push(e):i[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,i=2){let r=e.bucket,s=this.buckets[r],o=this.index[r];for(let l=0;l{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,t){let i=t&&this.getCompositionContext(t.text);for(let r=0,s=0,o=0;;){let l=or){let h=a-r;this.preserve(h,!o,!l),r=a,s+=h}if(!l)break;t&&l.fromA<=t.range.fromA&&l.toA>=t.range.toA?(this.forward(l.fromA,t.range.fromA,t.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let h=a>0||l{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof xe&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof xe&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let i=null,r=this.builder,s=-1,o=N.spans(this.decorations,e,t,{point:(l,a,h,c,f,u)=>{if(h instanceof ei){if(this.disallowBlockEffectsFor[u]){if(h.block)throw new RangeError(\"Block decorations may not be specified via plugins\");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError(\"Decorations that replace line breaks may not be specified via plugins\")}if(s=c.length,f>c.length)r.continueWidget(a-l);else{let d=h.widget||(h.block?Pt.block:Pt.inline),p=im(h),O=this.cache.findWidget(d,a-l,p)||ii.of(d,this.view,a-l,p);h.block?(h.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(O)):(r.ensureLine(i),r.addInlineWidget(O,c,f))}i=null}else i=nm(i,h);a>l&&this.text.skip(a-l)},span:(l,a,h,c)=>{for(let f=l;f-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}forward(e,t,i=1){t-e<=10?this.old.advance(t-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let t=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let s=K.get(r);if(r==this.view.contentDOM)break;s instanceof xe?t.push(s):s?.isLine()?i=s:s instanceof ft||(r.nodeName==\"DIV\"&&!i&&r!=this.view.contentDOM?i=new Ti(r,Zc):i||t.push(xe.of(new on({tagName:r.nodeName.toLowerCase(),attributes:LO(r)}),r)))}return{line:i,marks:t}}};function zh(n,e){let t=i=>{for(let r of i.children)if((e?r.isText():r.length)||t(r))return!0;return!1};return t(n)}function im(n){let e=n.isReplace?(n.startSide<0?64:0)|(n.endSide>0?128:0):n.startSide>0?32:16;return n.block&&(e|=256),e}var Zc={class:\"cm-line\"};function nm(n,e){let t=e.spec.attributes,i=e.spec.class;return!t&&!i||(n||(n={class:\"cm-line\"}),t&&Zo(t,n),i&&(n.class+=\" \"+i)),n}function rm(n){let e=[];for(let t=n.parents.length;t>1;t--){let i=t==n.parents.length?n.tile:n.parents[t].tile;i instanceof xe&&e.push(i.mark)}return e}function Ys(n){let e=K.get(n);return e&&e.setDOM(n.cloneNode()),n}var Pt=class extends he{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};Pt.inline=new Pt(\"span\");Pt.block=new Pt(\"div\");var Ds=new class extends he{toDOM(){return document.createElement(\"br\")}get isHidden(){return!0}get editable(){return!0}},pr=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=L.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Pi(e,e.contentDOM),this.updateInner([new Be(0,0,0,e.state.doc.length)],null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:c,toA:f})=>fthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!um(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?om(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:c,to:f}=this.hasComposition;i=new Be(c,f,e.changes.mapPos(c,-1),e.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,($.ie||$.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let a=hm(o,this.decorations,e.changes);a.length&&(i=Be.extendWithRanges(i,a));let h=cm(l,this.blockWrappers,e.changes);return h.length&&(i=Be.extendWithRanges(i,h)),s&&!i.some(c=>c.fromA<=s.range.fromA&&c.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(t||e.length){let o=this.tile,l=new oo(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&K.get(t.text)&&l.cache.reused.set(K.get(t.text),2),this.tile=l.run(e,t),lo(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+\"px\",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+\"px\":\"\";let s=$.chrome||$.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=\"\"});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&Hi(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||t||o))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,h,c;if(a.empty?c=h=this.inlineDOMNearPos(a.anchor,a.assoc||1):(c=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),h=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),$.gecko&&a.empty&&!this.hasComposition&&sm(h)){let u=document.createTextNode(\"\");this.view.observer.ignore(()=>h.node.insertBefore(u,h.node.childNodes[h.offset]||null)),h=c=new tt(u,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!Ji(h.node,h.offset,f.anchorNode,f.anchorOffset)||!Ji(c.node,c.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,a))&&(this.view.observer.ignore(()=>{$.android&&$.chrome&&i.contains(f.focusNode)&&fm(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let u=an(this.view.root);if(u)if(a.empty){if($.gecko){let d=lm(h.node,h.offset);if(d&&d!=3){let p=(d==1?uc:dc)(h.node,h.offset);p&&(h=new tt(p.node,p.offset))}}u.collapse(h.node,h.offset),a.bidiLevel!=null&&u.caretBidiLevel!==void 0&&(u.caretBidiLevel=a.bidiLevel)}else if(u.extend){u.collapse(h.node,h.offset);try{u.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([h,c]=[c,h]),d.setEnd(c.node,c.offset),d.setStart(h.node,h.offset),u.removeAllRanges(),u.addRange(d)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(h,c)),this.impreciseAnchor=h.precise?null:new tt(f.anchorNode,f.anchorOffset),this.impreciseHead=c.precise?null:new tt(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Ji(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=an(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc,t.assoc);i.collapse(c.node,c.offset),i.modify(\"move\",t.assoc<0?\"forward\":\"backward\",\"lineboundary\"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(r,s)}posFromDOM(e,t){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(e==i.dom)s=i.dom.childNodes[t];else{let o=ut(e)==0?0:t==0?-1:1;for(;;){let l=e.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?s=e:s=e.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!K.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let a=i.children[o];if(a.dom==s)return l;l+=a.length+a.breakAfter}}else return i.isText()?e==i.dom?r+t:r+(t?i.length:0):r}domAtPos(e,t){let{tile:i,offset:r}=this.tile.resolveBlock(e,t);return i.isWidget()?i.domPosFor(r,t):i.domIn(r,t)}inlineDOMNearPos(e,t){let i,r=-1,s=!1,o,l=-1,a=!1;return this.tile.blockTiles((h,c)=>{if(h.isWidget()){if(h.flags&32&&c>=e)return!0;h.flags&16&&(s=!0)}else{let f=c+h.length;if(c<=e&&(i=h,r=e-c,s=f=e&&!o&&(o=h,l=e-c,a=c>e),c>e&&o)return!0}}),!i&&!o?this.domAtPos(e,t):(s&&o?i=null:a&&i&&(o=null),i&&t<0||!o?i.domIn(r,t):o.domIn(l,t))}coordsAt(e,t,i){let{tile:r,offset:s}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof nn?null:r.coordsInWidget(s,t,!0):r.coordsIn(s,t,i)}lineAt(e,t){let{tile:i}=this.tile.resolveBlock(e,t);return i.isLine()?i:null}coordsForChar(e){let{tile:t,offset:i}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let a=r(l,o);if(a)return a}if(o-=l.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==H.LTR,h=0,c=(f,u,d)=>{for(let p=0;pr);p++){let O=f.children[p],g=u+O.length,b=O.dom.getBoundingClientRect(),{height:y}=b;if(d&&!p&&(h+=b.top-d.top),O instanceof ft)g>i&&c(O,u,b);else if(u>=i&&(h>0&&t.push(-h),t.push(y+h),h=0,o)){let S=O.dom.lastChild,C=S?Ki(S):[];if(C.length){let w=C[C.length-1],P=a?w.right-b.left:b.right-w.left;P>l&&(l=P,this.minWidth=s,this.minWidthFrom=u,this.minWidthTo=g)}}d&&p==f.children.length-1&&(h+=d.bottom-b.bottom),u=g+O.breakAfter}};return c(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==\"rtl\"?H.RTL:H.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,a;for(let h of o.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let c=Ki(h.dom);if(c.length!=1)return;l+=c[0].width,a=c[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:a}}});if(e)return e;let t=document.createElement(\"div\"),i,r,s;return t.className=\"cm-line\",t.style.width=\"99999px\",t.style.position=\"absolute\",t.textContent=\"abc def ghi jkl mno pqr stu\",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let o=Ki(t.firstChild)[0];i=t.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,t.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(L.replace({widget:new nn(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return L.set(e)}updateDeco(){let e=1,t=this.view.state.facet(vr).map(s=>(this.dynamicDecorationMap[e++]=typeof s==\"function\")?s(this.view):s),i=!1,r=this.view.state.facet(_o).map((s,o)=>{let l=typeof s==\"function\";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,t.push(N.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];etypeof s==\"function\"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let h=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=h.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let h of this.view.state.facet($c))try{if(h(this.view,e.range,e))return!0}catch(c){ue(this.view.state,c,\"scroll handler\")}let{range:t}=e,i=this.coordsAt(t.head,t.assoc||(t.head>t.anchor?-1:1)),r;if(!i)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=jo(this.view),o={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;if(jO(this.view.scrollDOM,o,t.head1&&(i.top>window.visualViewport.offsetTop+window.visualViewport.height||i.bottomi.isWidget()||i.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){lo(this.tile)}};function lo(n,e){let t=e?.get(n);if(t!=1){t==null&&n.destroy();for(let i of n.children)lo(i,e)}}function sm(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable==\"false\")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable==\"false\")}function Xc(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=uc(t.focusNode,t.focusOffset),r=dc(t.focusNode,t.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=K.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(n.docView.lastCompositionAfterCursor){let a=K.get(i.node);!a||a.isText()&&a.text!=i.node.nodeValue||(s=r)}}if(n.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function om(n,e,t){let i=Xc(n,t);if(!i)return null;let{node:r,from:s,to:o}=i,l=r.nodeValue;if(/[\\n\\r]/.test(l)||n.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc;return{range:new Be(a.mapPos(s),a.mapPos(o),s,o),text:r}}function lm(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable==\"false\"?1:0)|(e{ie.from&&(t=!0)}),t}var nn=class extends he{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(\"div\");return e.className=\"cm-gap\",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+\"px\",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function dm(n,e,t=1){let i=n.charCategorizer(e),r=n.doc.lineAt(e),s=e-r.from;if(r.length==0)return x.cursor(e);s==0?t=1:s==r.length&&(t=-1);let o=s,l=s;t<0?o=re(r.text,s,!1):l=re(r.text,s);let a=i(r.text.slice(o,l));for(;o>0;){let h=re(r.text,o,!1);if(i(r.text.slice(h,o))!=a)break;o=h}for(;ln.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((r-t.top-(n.defaultLineHeight-l)*.5)/l);s+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+Qh(o,s,n.state.tabSize)}function Om(n,e,t){let i=n.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>e)break;if(!(s.toe)return s;(!r||s.type==Ye.Text&&(r.type!=s.type||(t<0?s.frome)))&&(r=s)}}return r||i}return i}function mm(n,e,t,i){let r=Om(n,e.head,e.assoc||-1),s=!i||r.type!=Ye.Text||!(n.lineWrapping||r.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(r.from),a=n.posAtCoords({x:t==(l==H.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return x.cursor(a,t?-1:1)}return x.cursor(t?r.to:r.from,t?-1:1)}function _h(n,e,t,i){let r=n.state.doc.lineAt(e.head),s=n.bidiSpans(r),o=n.textDirectionAt(r.from);for(let l=e,a=null;;){let h=UO(r,s,o,l,t),c=bc;if(!h){if(r.number==(t?n.state.doc.lines:1))return l;c=`\n`,r=n.state.doc.line(r.number+(t?1:-1)),s=n.bidiSpans(r),h=n.visualLineSide(r,!t)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function gm(n,e,t){let i=n.state.charCategorizer(e),r=i(t);return s=>{let o=i(s);return r==Xe.Space&&(r=o),r==o}}function bm(n,e,t,i){let r=e.head,s=t?1:-1;if(r==(t?n.state.doc.length:0))return x.cursor(r,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(r,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),c=n.documentTop;if(h)o==null&&(o=h.left-a.left),l=s<0?h.top:h.bottom;else{let p=n.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(r-p.from))),l=(s<0?p.top:p.bottom)+c}let f=a.left+o,u=n.viewState.heightOracle.textHeight>>1,d=i??u;for(let p=0;;p+=u){let O=l+(d+p)*s,g=ho(n,{x:f,y:O},!1,s);if(t?O>a.bottom:Ol:y{if(e>s&&er(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:x.cursor(i,in.viewState.docHeight)return new _e(n.state.doc.length,-1);if(h=n.elementAtHeight(a),i==null)break;if(h.type==Ye.Text){if(i<0?h.ton.viewport.to)break;let u=n.docView.coordsAt(i<0?h.from:h.to,i>0?-1:1);if(u&&(i<0?u.top<=a+s:u.bottom>=a+s))break}let f=n.viewState.heightOracle.textHeight/2;a=i>0?h.bottom+f:h.top-f}if(n.viewport.from>=h.to||n.viewport.to<=h.from){if(t)return null;if(h.type==Ye.Text){let f=pm(n,r,h,o,l);return new _e(f,f==h.from?1:-1)}}if(h.type!=Ye.Text)return a<(h.top+h.bottom)/2?new _e(h.from,1):new _e(h.to,-1);let c=n.docView.lineAt(h.from,2);return(!c||c.length!=h.length)&&(c=n.docView.lineAt(h.from,-2)),new co(n,o,l,n.textDirectionAt(h.from)).scanTile(c,h.from)}var co=class{constructor(e,t,i,r){this.view=e,this.x=t,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from>1;t:if(o.has(O)){for(let y=1;y=s&&(S-=p),!o.has(S)){O=S;break t}}break e}o.add(O);let g=t(O),b=0;if(g)for(let y=0;y1))if(S.bottomthis.y)(!h||h.top>S.top)&&(h=S),b=-1;else{let C=S.left>this.x?this.x-S.left:S.right(p+p+O)/3)return this.y=a.bottom-1,this.scan(e,t,!0);if(h&&h.top<(p+O+O)/3)return this.y=h.top+1,this.scan(e,t,!0)}let d=(l?this.dirAt(e[c],1):this.baseDir)==H.LTR;return{i:c,after:this.x>(u.left+u.right)/2==d}}scanText(e,t){let i=[];for(let s=0;s{let o=i[s]-t,l=i[s+1]-t;return cn(e.dom,o,l).getClientRects()});return r.after?new _e(i[r.i+1],-1):new _e(i[r.i],1)}scanTile(e,t){if(!e.length)return new _e(t,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,t);if(l.isComposite())return this.scanTile(l,t)}let i=[t];for(let l=0,a=t;l{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:cn(a.dom,0,a.length)).getClientRects()}),s=e.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new _e(i[r.i+1],-1):new _e(o,1)}},xi=\"\\uFFFF\",fo=class{constructor(e,t){this.points=e,this.view=t,this.text=\"\",this.lineSeparator=t.state.facet(q.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=xi}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=K.get(r),l=r.nextSibling;if(l==t){o?.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let a=K.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:fr(r))||fr(l)&&(r.nodeName!=\"BR\"||o?.isWidget())&&this.text.length>s)&&!Sm(l,t)&&this.lineBreak(),r=l}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,r=this.lineSeparator?null:/\\r\\n?|\\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(t))&&(s=l.index,o=l[0].length),this.append(t.slice(i,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=s+o}}readNode(e){let t=K.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==\"BR\"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(ym(e,i.node,i.offset)?t:0))}};function ym(n,e,t){for(;;){if(!e||t-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=Ec(e.docView.tile,t,i,0))){let a=s||o?[]:km(e),h=new fo(a,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=wm(a,this.bounds.from)}else{let a=e.observer.selectionRange,h=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!Us(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!Us(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),f=e.viewport;if(($.ios||$.chrome)&&h!=c&&Math.min(h,c)<=l.main.from&&Math.max(h,c)>=l.main.to&&(f.from>0||f.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(x.range(c,h));else if(e.lineWrapping&&c==h&&!(l.main.empty&&l.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let u=e.coordsAtPos(h,-1),d=0;u&&(d=e.inputState.lastTouchY<=u.bottom?-1:1),this.newSel=x.create([x.cursor(h,d)])}else this.newSel=x.single(c,h)}}};function Ec(n,e,t,i){if(n.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let a=0,h=i,c=i;at)return Ec(f,e,t,h);if(u>=e&&r==-1&&(r=a,s=h),h>t&&f.dom.parentNode==n.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:s,to:l<0?i+n.length:l,startDOM:(r?n.children[r-1].dom.nextSibling:null)||n.dom.firstChild,endDOM:o=0?n.children[o].dom:null}}else return n.isText()?{from:i,to:i+n.length,startDOM:n.dom,endDOM:n.dom.nextSibling}:null}function Lc(n,e){let t,{newSel:i}=e,{state:r}=n,s=r.selection.main,o=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,h=s.from,c=null;(o===8||$.android&&e.text.length=l&&s.to<=a&&(e.typeOver||f!=e.text)&&f.slice(0,s.from-l)==e.text.slice(0,s.from-l)&&f.slice(s.to-l)==e.text.slice(u=e.text.length-(f.length-(s.to-l)))?t={from:s.from,to:s.to,insert:_.of(e.text.slice(s.from-l,u).split(xi))}:(d=zc(f,e.text,h-l,c))&&($.chrome&&o==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==xi+xi&&d.toB--,t={from:l+d.from,to:l+d.toA,insert:_.of(e.text.slice(d.from,d.toB).split(xi))})}else i&&(!n.hasFocus&&r.facet(ct)||mr(i,s))&&(i=null);if(!t&&!i)return!1;if(($.mac||$.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute(\"autocorrect\")==\"off\"?(i&&t.insert.length==2&&(i=x.single(i.main.anchor-1,i.main.head-1)),t={from:t.from,to:t.to,insert:_.of([t.insert.toString().replace(\".\",\" \")])}):r.doc.lineAt(s.from).toDate.now()-50?t={from:s.from,to:s.to,insert:r.toText(n.inputState.insertingText)}:$.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==`\n `&&n.lineWrapping&&(i&&(i=x.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:_.of([\" \"])}),t)return Yo(n,t,i,o);if(i&&!mr(i,s)){let l=!1,a=\"select\";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin==\"select\"&&(l=!0),a=n.inputState.lastSelectionOrigin,a==\"select.pointer\"&&(i=Mc(r.facet(fn).map(h=>h(n)),i))),n.dispatch({selection:i,scrollIntoView:l,userEvent:a}),!0}else return!1}function Yo(n,e,t,i=-1){if($.ios&&n.inputState.flushIOSKey(e))return!0;let r=n.state.selection.main;if($.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&n.state.sliceDoc(e.from,r.from)==\" \")&&e.insert.length==1&&e.insert.lines==2&&vi(n.contentDOM,\"Enter\",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.lengthr.head)&&vi(n.contentDOM,\"Backspace\",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&vi(n.contentDOM,\"Delete\",46)))return!0;let s=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=xm(n,e,t));return n.state.facet(wc).some(a=>a(n,e.from,e.to,s,l))||n.dispatch(l()),!0}function xm(n,e,t){let i,r=n.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.froms.to){let a=e.fromf(n)),h,a);e.from==c&&(o=c)}if(o>-1)i={changes:e,selection:x.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let a=s.frome.to?r.sliceDoc(e.to,s.to):\"\";i=r.replaceSelection(n.state.toText(a+e.insert.sliceString(0,void 0,n.state.lineBreak)+h))}else{let a=r.changes(e),h=t&&t.main.to<=a.newLength?t.main:void 0;if(r.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let c=n.state.sliceDoc(e.from,e.to),f,u=t&&Xc(n,t.main.head);if(u){let p=e.insert.length-(e.to-e.from);f={from:u.from,to:u.to-p}}else f=n.state.doc.lineAt(s.head);let d=s.to-e.to;i=r.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:a,range:h||p.map(a)};let O=p.to-d,g=O-c.length;if(n.state.sliceDoc(g,O)!=c||O>=f.from&&g<=f.to)return{range:p};let b=r.changes({from:g,to:O,insert:e.insert}),y=p.to-s.to;return{changes:b,range:h?x.range(Math.max(0,h.anchor+y),Math.max(0,h.head+y)):p.map(b)}})}else i={changes:a,selection:h&&r.selection.replaceRange(h)}}let l=\"input.type\";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,l+=\".compose\",n.inputState.compositionFirstChange&&(l+=\".start\",n.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function zc(n,e,t,i){let r=Math.min(n.length,e.length),s=0;for(;s0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i==\"end\"){let a=Math.max(0,s-Math.min(o,l));t-=o+a-s}if(o=o?s-t:0;s-=a,l=s+(l-o),o=s}else if(l=l?s-t:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function km(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new Or(t,i)),(r!=t||s!=i)&&e.push(new Or(r,s))),e}function wm(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?x.single(t+e,i+e):null}function mr(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}var po=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=\"\",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,$.safari&&e.contentDOM.addEventListener(\"input\",()=>null),$.gecko&&_m(e.contentDOM.ownerDocument)}handleEvent(e){!Rm(this.view,e)||this.ignoreDuringComposition(e)||e.type==\"keydown\"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,t);for(let r of i.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=vm(e),i=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!=\"scroll\"){let o=!t[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!=\"scroll\"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&jc.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),$.android&&$.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if($.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(_c.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||$m.indexOf(e.key)>-1&&e.ctrlKey)){let t={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return t.shiftKey&&$.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&Qm(this.view.win)&&(t.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:t},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==\"Enter\"&&e&&e.from0?!0:$.safari&&!$.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function Qm(n){return n.visualViewport?n.visualViewport.height*n.visualViewport.scale/n.document.documentElement.clientHeight<.85:!1}function jh(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(r){ue(t.state,r)}}}function vm(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let a=s[l];a&&t(l).handlers.push(jh(i.value,a))}if(o)for(let l in o){let a=o[l];a&&t(l).observers.push(jh(i.value,a))}}for(let i in qe)t(i).handlers.push(qe[i]);for(let i in ge)t(i).observers.push(ge[i]);return e}var _c=[{key:\"Backspace\",keyCode:8,inputType:\"deleteContentBackward\"},{key:\"Enter\",keyCode:13,inputType:\"insertParagraph\"},{key:\"Enter\",keyCode:13,inputType:\"insertLineBreak\"},{key:\"Delete\",keyCode:46,inputType:\"deleteContentForward\"}],$m=\"dthko\",jc=[16,17,18,20,91,92,224,225],er=6;function tr(n){return Math.max(0,n)*.7+8}function Pm(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}var Oo=class{constructor(e,t,i,r){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=lc(e.contentDOM),this.atoms=e.state.facet(fn).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener(\"mousemove\",this.move=this.move.bind(this)),s.addEventListener(\"mouseup\",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(q.allowMultipleSelections)&&Tm(e,t),this.dragging=Am(e,t)&&Vc(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Pm(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=jo(this.view);e.clientX-a.left<=r+er?t=-tr(r-e.clientX):e.clientX+a.right>=o-er&&(t=tr(e.clientX-o)),e.clientY-a.top<=s+er?i=-tr(s-e.clientY):e.clientY+a.bottom>=l-er&&(i=tr(e.clientY-l)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(\"mousemove\",this.move),e.removeEventListener(\"mouseup\",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,i=Mc(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:\"select.pointer\"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent(\"input.type\"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function Tm(n,e){let t=n.state.facet(yc);return t.length?t[0](e):$.mac?e.metaKey:e.ctrlKey}function Cm(n,e){let t=n.state.facet(Sc);return t.length?t[0](e):$.mac?!e.altKey:!e.ctrlKey}function Am(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=an(n.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Rm(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=K.get(t))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}var qe=Object.create(null),ge=Object.create(null),Yc=$.ie&&$.ie_version<15||$.ios&&$.webkit_version<604;function Zm(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement(\"textarea\"));t.style.cssText=\"position: fixed; left: -10000px; top: 10px\",t.focus(),setTimeout(()=>{n.focus(),t.remove(),Dc(n,t.value)},50)}function $r(n,e,t){for(let i of n.facet(e))t=i(t,n);return t}function Dc(n,e){e=$r(n.state,Eo,e);let{state:t}=n,i,r=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(mo!=null&&t.selection.ranges.every(a=>a.empty)&&mo==s.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?s.line(r++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:x.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=s.line(r++);return{changes:{from:a.from,to:a.to,insert:h.text},range:x.cursor(a.from+h.length)}}):i=t.replaceSelection(s);n.dispatch(i,{userEvent:\"input.paste\",scrollIntoView:!0})}ge.scroll=n=>{let e=n.inputState;e.lastScrollTop=n.scrollDOM.scrollTop,e.lastScrollLeft=n.scrollDOM.scrollLeft,$.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};ge.wheel=ge.mousewheel=n=>{n.inputState.lastWheelEvent=Date.now()};qe.keydown=(n,e)=>(n.inputState.setSelectionOrigin(\"select\"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);ge.touchstart=(n,e)=>{let t=n.inputState,i=e.targetTouches[0];t.touchActive=!0,t.lastTouchTime=Date.now(),i&&(t.lastTouchX=i.clientX,t.lastTouchY=i.clientY),t.setSelectionOrigin(\"select.pointer\")};ge.touchmove=n=>{n.inputState.setSelectionOrigin(\"select.pointer\")};ge.touchend=(n,e)=>{n.inputState.touchActive=!1};qe.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(xc))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=Mm(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new Oo(n,e,t,i)),i&&n.observer.ignore(()=>{cc(n.contentDOM);let s=n.root.activeElement;s&&!s.contains(n.contentDOM)&&s.blur()});let r=n.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else n.inputState.setSelectionOrigin(\"select.pointer\");return!1};function Yh(n,e,t,i){if(i==1)return x.cursor(e,t);if(i==2)return dm(n.state,e,t);{let r=n.docView.lineAt(e,t),s=n.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return lDate.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Vh+1)%3:1}function Mm(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=Vc(e),r=n.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,o,l){let a=n.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),h,c=Yh(n,a.pos,a.assoc,i);if(t.pos!=a.pos&&!o){let f=Yh(n,t.pos,t.assoc,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=Em(r,a.pos))?h:l?r.addRange(c):x.create([c])}}}function Em(n,e){for(let t=0;t=e)return x.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}qe.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let r=n.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=t.to||o<=t.from)&&(t=x.undirectionalRange(s,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData(\"Text\",$r(n.state,Lo,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed=\"copyMove\"),!1};qe.dragend=n=>(n.inputState.draggedContent=null,!1);function Wh(n,e,t,i){if(t=$r(n.state,Eo,t),!t)return;let r=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=n.inputState,o=i&&s&&Cm(n,e)?{from:s.from,to:s.to}:null,l={from:r,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:o?\"move.drop\":\"input.drop\"}),n.inputState.draggedContent=null}qe.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),r=0,s=()=>{++r==t.length&&Wh(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData(\"Text\");if(i)return Wh(n,e,i,!0),!0}return!1};qe.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=Yc?null:e.clipboardData;return t?(Dc(n,t.getData(\"text/plain\")||t.getData(\"text/uri-list\")),!0):(Zm(n),!1)};function Lm(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement(\"textarea\"));i.style.cssText=\"position: fixed; left: -10000px; top: 10px\",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function zm(n){let e=[],t=[],i=!1;for(let r of n.selection.ranges)r.empty||(e.push(n.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of n.selection.ranges){let o=n.doc.lineAt(s);o.number>r&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),r=o.number}i=!0}return{text:$r(n,Lo,e.join(n.lineBreak)),ranges:t,linewise:i}}var mo=null;qe.copy=qe.cut=(n,e)=>{if(!Hi(n.contentDOM,n.observer.selectionRange))return!1;let{text:t,ranges:i,linewise:r}=zm(n.state);if(!t&&!r)return!1;mo=r?t:null,e.type==\"cut\"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:\"delete.cut\"});let s=Yc?null:e.clipboardData;return s?(s.clearData(),s.setData(\"text/plain\",t),!0):(Lm(n,t),!1)};var Ic=fe.define();function Wc(n,e){let t=[];for(let i of n.facet(Qc)){let r=i(n,e);r&&t.push(r)}return t.length?n.update({effects:t,annotations:Ic.of(!0)}):null}function Bc(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=Wc(n.state,e);t?n.dispatch(t):n.update([])}},10)}ge.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),Bc(n)};ge.blur=n=>{n.observer.clearSelectionRange(),Bc(n)};ge.compositionstart=ge.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};ge.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,$.chrome&&$.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};ge.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};qe.beforeinput=(n,e)=>{var t,i;if((e.inputType==\"insertText\"||e.inputType==\"insertCompositionText\")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType==\"insertReplacementText\"&&n.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData(\"text/plain\"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=n.posAtDOM(l.startContainer,l.startOffset),h=n.posAtDOM(l.endContainer,l.endOffset);return Yo(n,{from:a,to:h,insert:n.state.toText(s)},null),!0}}let r;if($.chrome&&$.android&&(r=_c.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(r.key,r.keyCode),r.key==\"Backspace\"||r.key==\"Delete\")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return $.ios&&e.inputType==\"deleteContentForward\"&&n.observer.flushSoon(),$.safari&&e.inputType==\"insertText\"&&n.inputState.composing>=0&&setTimeout(()=>ge.compositionend(n,e),20),!1};var Bh=new Set;function _m(n){Bh.has(n)||(Bh.add(n),n.addEventListener(\"copy\",()=>{}),n.addEventListener(\"cut\",()=>{}))}var qh=[\"pre-wrap\",\"normal\",\"pre-line\",\"break-spaces\"],Ai=!1;function Nh(){Ai=!1}var go=class{constructor(e){this.lineWrapping=e,this.doc=_.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return qh.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ar&&(Ai=!0),this.height=e)}replace(e,t,i){return n.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,r){let s=this,o=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=r[l],u=s.lineAt(a,F.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=h?u:s.lineAt(h,F.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=r[l-1].toA;)a=r[l-1].fromA,c=r[l-1].fromB,l--,as*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r=s&&o(this.lineAt(0,F.ByPos,i,r,s))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},ze=class n extends br{constructor(e,t,i){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,t){return new We(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,i){let r=i[0];return i.length==1&&(r instanceof n||r instanceof vt&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof vt?r=new n(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):Te.of(i)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:\"\"}${this.widgetHeight?\":\"+this.widgetHeight:\"\"})`}},vt=class n extends Te{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(e,t,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let h=r+(e0){let s=i[i.length-1];s instanceof n?i[i.length-1]=new n(s.length+r):i.push(null,new n(r-1))}if(e>0){let s=i[0];s instanceof n?i[0]=new n(e+s.length):i.unshift(new n(e-1),null)}return Te.of(i)}decomposeLeft(e,t){t.push(new n(e-1),null)}decomposeRight(e,t){t.push(null,new n(this.length-e-1))}updateHeight(e,t=0,i=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let o=[],l=Math.max(t,r.from),a=-1;for(r.from>t&&o.push(new n(r.from-t-1).updateHeight(e,t));l<=s&&r.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=r.heights[r.index++],u=0;f<0&&(u=-f,f=r.heights[r.index++]),a==-1?a=f:Math.abs(f-a)>=ar&&(a=-2);let d=new ze(c,f,u);d.outdated=!1,o.push(d),l+=c+1}l<=s&&o.push(null,new n(s-l).updateHeight(e,l));let h=Te.of(o);return(a<0||Math.abs(h.height-this.height)>=ar||Math.abs(a-this.heightMetrics(e,t).perLine)>=ar)&&(Ai=!0),gr(this,h)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},yo=class extends Te{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,r){let s=i+this.left.height;return el))return h;let c=t==F.ByPosNoHeight?F.ByPosNoHeight:F.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,r,s).join(h)}forEachLine(e,t,i,r,s,o){let l=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,F.ByPos,i,r,s);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of i)s.push(l);if(e>0&&Gh(s,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?Te.of(this.break?[e,null,t]:[e,t]):(this.left=gr(this.left,e),this.right=gr(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,r){let{left:s,right:o}=this,l=t+s.length+this.break,a=null;return r&&r.from<=t+s.length&&r.more?a=s=s.updateHeight(e,t,i,r):s.updateHeight(e,t,i),r&&r.from<=l+o.length&&r.more?a=o=o.updateHeight(e,l,i,r):o.updateHeight(e,l,i),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?\" \":\"-\")+this.right}};function Gh(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof vt&&(i=n[e+1])instanceof vt&&n.splice(e-1,3,new vt(t.length+1+i.length))}var Ym=5,So=class n{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof ze?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new ze(i-this.pos,-1,0)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=Ym)&&this.addLineDeco(r,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new ze(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let i=new vt(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ze)return e;let t=new ze(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof ze)&&!this.isCovered?this.nodes.push(new ze(0,-1,0)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!=\"visible\"){let u=c.getBoundingClientRect();s=Math.max(s,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=Math.min(h==n.parentNode?r.innerHeight:a,u.bottom)}h=f.position==\"absolute\"||f.position==\"fixed\"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function Im(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left0&&e.top0}function Wm(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}var sn=class{constructor(e,t,i,r){this.from=e,this.to=t,this.size=i,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof r!=\"function\"&&r.class==\"cm-lineWrapping\");this.heightOracle=new go(i),this.stateDeco=Fh(t),this.heightMap=Te.empty().applyChanges(this.stateDeco,_.empty,this.heightOracle.setDoc(t.doc),[new Be(0,0,0,t.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=L.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let r=i?t.head:t.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new wi(s,o))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Uh:new wo(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Fi(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=Fh(this.state);let r=e.changedRanges,s=Be.extendWithRanges(r,Dm(i,this.stateDeco,e?e.changes:Oe.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Nh(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Ai)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(HO)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,i=window.getComputedStyle(t),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction==\"rtl\"?H.RTL:H.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent===\"refresh\",l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0;if(l.width&&l.height){let{scaleX:w,scaleY:P}=oc(t,l);(w>.005&&Math.abs(this.scaleX-w)>.005||P>.005&&Math.abs(this.scaleY-P)>.005)&&(this.scaleX=w,this.scaleY=P,h|=16,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let d=lc(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=fc(this.scrollParent||e.win);let O=(this.printing?Wm:Vm)(t,this.paddingTop),g=O.top-this.pixelViewport.top,b=O.bottom-this.pixelViewport.bottom;this.pixelViewport=O;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget&&!Im(e.dom))return 0;let S=l.width;if((this.contentDOMWidth!=S||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),a){let w=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(w)&&(o=!0),o||r.lineWrapping&&Math.abs(S-this.contentDOMWidth)>r.charWidth){let{lineHeight:P,charWidth:T,textHeight:j}=e.docView.measureTextSize();o=P>0&&r.refresh(s,P,T,j,Math.max(5,S/T),w),o&&(e.docView.minWidth=0,h|=16)}g>0&&b>0?c=Math.max(g,b):g<0&&b<0&&(c=Math.min(g,b)),Nh();for(let P of this.viewports){let T=P.from==this.viewport.from?w:e.docView.measureVisibleLineHeights(P);this.heightMap=(o?Te.empty().applyChanges(this.stateDeco,_.empty,this.heightOracle,[new Be(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new bo(P.from,T))}Ai&&(h|=2)}let C=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return C&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),h|=this.updateForViewport()),(h&2||C)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new wi(r.lineAt(o-i*1e3,F.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,F.ByHeight,s,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(h,F.ByPos,s,0,0),u;t.y==\"center\"?u=(f.top+f.bottom)/2-c/2:t.y==\"start\"||t.y==\"nearest\"&&h=l+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=H.LTR&&!i)return[];let l=[],a=(c,f,u,d)=>{if(f-cc&&bb.from>=u.from&&b.to<=u.to&&Math.abs(b.from-c)b.fromy));if(!g){if(fS.from<=f&&S.to>=f)){let S=t.moveToLineBoundary(x.cursor(f),!1,!0).head;S>c&&(f=S)}let b=this.gapSize(u,c,f,d),y=i||b<2e6?b:2e6;g=new sn(c,f,b,y)}l.push(g)},h=c=>{if(c.length2e6)for(let P of e)P.from>=c.from&&P.fromc.from&&a(c.from,d,c,f),pt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];N.spans(t,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Fi(this.heightMap.lineAt(e,F.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Fi(this.heightMap.lineAt(this.scaler.fromDOM(e),F.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Fi(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},wi=class{constructor(e,t){this.from=e,this.to=t}};function Bm(n,e,t){let i=[],r=n,s=0;return N.spans(t,n,e,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-r),r=l}},20),r=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(i<=l)return s+i;i-=l}}function nr(n,e){let t=0;for(let{from:i,to:r}of n.ranges){if(e<=r){t+=e-i;break}t+=r-i}return t/n.total}function qm(n,e){for(let t of n)if(e(t))return t}var Uh={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function Fh(n){let e=n.facet(vr).filter(i=>typeof i!=\"function\"),t=n.facet(_o).filter(i=>typeof i!=\"function\");return t.length&&e.push(N.join(t)),e}var wo=class n{constructor(e,t,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,F.ByPos,e,0,0).top,c=t.lineAt(a,F.ByPos,e,0,0).bottom;return r+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let t=0,i=0,r=0;;t++){let s=tt.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}};function Fi(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new We(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(r=>Fi(r,e)):n._content)}var rr=R.define({combine:n=>n.join(\" \")}),Qo=R.define({combine:n=>n.indexOf(!0)>-1}),vo=Le.newName(),qc=Le.newName(),Nc=Le.newName(),Gc={\"&light\":\".\"+qc,\"&dark\":\".\"+Nc};function $o(n,e,t){return new Le(e,{finish(i){return/&/.test(i)?i.replace(/&\\w*/,r=>{if(r==\"&\")return n;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):n+\" \"+i}})}var Nm=$o(\".\"+vo,{\"&\":{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,overflowAnchor:\"none\"},\".cm-content\":{margin:0,flexGrow:2,flexShrink:0,display:\"block\",whiteSpace:\"pre\",wordWrap:\"normal\",boxSizing:\"border-box\",minHeight:\"100%\",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\",flexShrink:1},\"&light .cm-content\":{caretColor:\"black\"},\"&dark .cm-content\":{caretColor:\"white\"},\".cm-line\":{display:\"block\",padding:\"0 2px 0 6px\"},\".cm-layer\":{userSelect:\"none\",position:\"absolute\",left:0,top:0,contain:\"size style\",\"& > *\":{position:\"absolute\"}},\"&light .cm-selectionBackground\":{background:\"#d9d9d9\"},\"&dark .cm-selectionBackground\":{background:\"#222\"},\"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground\":{background:\"#d7d4f0\"},\"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground\":{background:\"#233\"},\".cm-cursorLayer\":{pointerEvents:\"none\"},\"&.cm-focused > .cm-scroller > .cm-cursorLayer\":{animation:\"steps(1) cm-blink 1.2s infinite\"},\"@keyframes cm-blink\":{\"0%\":{},\"50%\":{opacity:0},\"100%\":{}},\"@keyframes cm-blink2\":{\"0%\":{},\"50%\":{opacity:0},\"100%\":{}},\".cm-cursor, .cm-dropCursor\":{borderLeft:\"1.2px solid black\",marginLeft:\"-0.6px\",pointerEvents:\"none\"},\".cm-cursor\":{display:\"none\"},\"&dark .cm-cursor\":{borderLeftColor:\"#ddd\"},\".cm-selectionHandle\":{backgroundColor:\"currentColor\",width:\"1.5px\"},\".cm-selectionHandle-start::before, .cm-selectionHandle-end::before\":{content:'\"\"',backgroundColor:\"inherit\",borderRadius:\"50%\",width:\"8px\",height:\"8px\",position:\"absolute\",left:\"-3.25px\"},\".cm-selectionHandle-start::before\":{top:\"-8px\"},\".cm-selectionHandle-end::before\":{bottom:\"-8px\"},\".cm-dropCursor\":{position:\"absolute\"},\"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor\":{display:\"block\"},\".cm-iso\":{unicodeBidi:\"isolate\"},\".cm-announced\":{position:\"fixed\",top:\"-10000px\"},\"@media print\":{\".cm-announced\":{display:\"none\"}},\"&light .cm-activeLine\":{backgroundColor:\"#cceeff44\"},\"&dark .cm-activeLine\":{backgroundColor:\"#99eeff33\"},\"&light .cm-specialChar\":{color:\"red\"},\"&dark .cm-specialChar\":{color:\"#f78\"},\".cm-gutters\":{flexShrink:0,display:\"flex\",height:\"100%\",boxSizing:\"border-box\",zIndex:200},\".cm-gutters-before\":{insetInlineStart:0},\".cm-gutters-after\":{insetInlineEnd:0},\"&light .cm-gutters\":{backgroundColor:\"#f5f5f5\",color:\"#6c6c6c\",border:\"0px solid #ddd\",\"&.cm-gutters-before\":{borderRightWidth:\"1px\"},\"&.cm-gutters-after\":{borderLeftWidth:\"1px\"}},\"&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,zIndex:300},\"&light .cm-panels\":{backgroundColor:\"#f5f5f5\",color:\"black\"},\".cm-panels-top\":{top:\"0\"},\".cm-panels-bottom\":{bottom:\"0\"},\"&light .cm-panels-top\":{borderBottom:\"1px solid #ddd\"},\"&light .cm-panels-bottom\":{borderTop:\"1px solid #ddd\"},\"&dark .cm-panels\":{backgroundColor:\"#333338\",color:\"white\"},\".cm-dialog\":{padding:\"2px 19px 4px 6px\",position:\"relative\",\"& label\":{fontSize:\"80%\"}},\".cm-dialog-close\":{position:\"absolute\",top:\"3px\",right:\"4px\",backgroundColor:\"inherit\",border:\"none\",font:\"inherit\",fontSize:\"14px\",padding:\"0\"},\".cm-tab\":{display:\"inline-block\",overflow:\"hidden\",verticalAlign:\"bottom\"},\".cm-widgetBuffer\":{verticalAlign:\"text-top\",height:\"1em\",width:0,display:\"inline\"},\".cm-placeholder\":{color:\"#888\",display:\"inline-block\",verticalAlign:\"top\",userSelect:\"none\"},\".cm-highlightSpace\":{backgroundImage:\"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)\",backgroundPosition:\"center\"},\".cm-highlightTab\":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:\"auto 100%\",backgroundPosition:\"right 90%\",backgroundRepeat:\"no-repeat\"},\".cm-trailingSpace\":{backgroundColor:\"#ff332255\"},\".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\"}},Gc),Gm={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Is=$.ie&&$.ie_version<=11,Po=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Fs,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);($.ie&&$.ie_version<=11||$.ios&&e.composing)&&t.some(i=>i.type==\"childList\"&&i.removedNodes.length||i.type==\"characterData\"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&$.android&&e.constructor.EDIT_CONTEXT!==!1&&!($.chrome&&$.chrome_version<126)&&(this.editContext=new To(e),e.state.facet(ct)&&(e.contentDOM.editContext=this.editContext.editContext)),Is&&(this.onCharData=t=>{this.queue.push({target:t.target,type:\"characterData\",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(\"print\")),typeof ResizeObserver==\"function\"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(\"Event\")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(\"Event\"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(\"scroll\",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==\"change\"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(ct)?i.root.activeElement!=this.dom:!Hi(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}($.ie&&$.ie_version<=11||$.android&&$.chrome)&&!i.state.selection.main.empty&&r.focusNode&&Ji(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=an(e.root);if(!t)return!1;let i=$.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Um(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let r=Hi(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&vi(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e==\"Enter\")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:r}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),r=this.selectionChanged&&Hi(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new uo(this.view,e,t,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,r=Lc(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!mr(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==\"attributes\"),e.type==\"childList\"){let i=Hh(t,e.previousSibling||e.target.previousSibling,-1),r=Hh(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type==\"characterData\"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(\"resize\",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(\"change\",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(\"beforeprint\",this.onPrint),e.addEventListener(\"scroll\",this.onScroll),e.document.addEventListener(\"selectionchange\",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(\"scroll\",this.onScroll),e.removeEventListener(\"resize\",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(\"change\",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(\"beforeprint\",this.onPrint),e.document.removeEventListener(\"selectionchange\",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(ct)!=e.state.facet(ct)&&(e.view.contentDOM.editContext=e.state.facet(ct)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener(\"scroll\",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function Hh(n,e,t){for(;e;){let i=K.get(e);if(i&&i.parent==n)return i;let r=e.parentNode;e=r!=n.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function Kh(n,e){let t=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor,1);return Ji(o.node,o.offset,r,s)&&([t,i,r,s]=[r,s,t,i]),{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}}function Um(n,e){if(e.getComposedRanges){let r=e.getComposedRanges(n.root)[0];if(r)return Kh(n,r)}let t=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return n.contentDOM.addEventListener(\"beforeinput\",i,!0),n.dom.ownerDocument.execCommand(\"indent\"),n.contentDOM.removeEventListener(\"beforeinput\",i,!0),t?Kh(n,t):null}var To=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let r=e.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(i.updateRangeStart),a=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let h=a-l>i.text.length;l==this.from&&sthis.to&&(a=s);let c=zc(e.state.sliceDoc(l,a),i.text,(h?r.from:r.to)-l,h?\"end\":null);if(!c){let u=x.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));mr(u,r)||e.dispatch({selection:u,userEvent:\"select\"});return}let f={from:c.from+l,to:c.toA+l,insert:_.of(i.text.slice(c.from,c.toB).split(`\n`))};if(($.mac||$.android)&&f.from==o-1&&/^\\. ?$/.test(i.text)&&e.contentDOM.getAttribute(\"autocorrect\")==\"off\"&&(f={from:l,to:a,insert:_.of([i.text.replace(\".\",\" \")])}),this.pendingContextChange=f,!e.state.readOnly){let u=this.to-this.from+(f.to-f.from+f.insert.length);Yo(e,f,x.single(this.toEditorPos(i.selectionStart,u),this.toEditorPos(i.selectionEnd,u)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from=0&&!/[\\\\p{Alphabetic}\\\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),h=this.toEditorPos(s.rangeEnd);if(a{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=an(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,h)=>{if(i)return;let c=h.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(h)){r=this.pendingContextChange=null,t+=c,this.to+=c;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(sthis.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),h.toString()),this.to+=c}t+=c}),r&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent(\"input.type\")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},v=class n{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&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,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.className=\"cm-announced\",this.announceDOM.setAttribute(\"aria-live\",\"polite\"),this.dom=document.createElement(\"div\"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||YO(e.parent)||document,this.viewState=new yr(this,e.state||q.create(e)),e.scrollTo&&e.scrollTo.is(Jn)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ki).map(r=>new tn(r));for(let r of this.plugins)r.update(this);this.observer=new Po(this),this.inputState=new po(this),this.inputState.ensureHandlers(this.plugins),this.docView=new pr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=\"refresh\",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof ee?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error(\"Calls to EditorView.update are not allowed while an update is in progress\");let t=!1,i=!1,r,s=this.state;for(let u of e){if(u.startState!=s)throw new RangeError(\"Trying to update state with a transaction that doesn't start from the previous state.\");s=u.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(Ic))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=Wc(s,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(c=null)):this.observer.clear(),s.facet(q.phrases)!=this.state.facet(q.phrases))return this.setState(s);r=ur.create(this,s,e),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection,{x:p,y:O}=this.state.facet(n.cursorScrollMargin);f=new en(d.empty?d:x.cursor(d.head,d.head>d.anchor?-1:1),\"nearest\",\"nearest\",O,p)}for(let d of u.effects)d.is(Jn)&&(f=d.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=Sr.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(Ui)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent(\"select.pointer\")))}finally{this.updateState=0}if(r.startState.facet(rr)!=r.state.facet(rr)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let u of this.state.facet(eo))try{u(r)}catch(d){ue(this.state,d,\"update listener\")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!Lc(this,c)&&h.force&&vi(this.contentDOM,h.key,h.keyCode)})}setState(e){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=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new yr(this,e),this.plugins=e.facet(ki).map(i=>new tn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new pr(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(ki),i=e.state.facet(ki);if(t!=i){let r=[];for(let s of i){let o=t.indexOf(s);if(o<0)r.push(new tn(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(fc(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(r);s=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?\"Measure loop restarted more than 5 times\":\"Viewport failed to stabilize\");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return ue(this.state,p),Jh}}),f=ur.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d1||p<-1)&&!($.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+p,i?s<0?i.scrollTop=i.scrollHeight:i.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(eo))l(t)}get themeClasses(){return vo+\" \"+(this.state.facet(Qo)?Nc:qc)+\" \"+this.state.facet(rr)}updateAttrs(){let e=ec(this,Tc,{class:\"cm-editor\"+(this.hasFocus?\" cm-focused \":\" \")+this.themeClasses}),t={spellcheck:\"false\",autocorrect:\"off\",autocapitalize:\"off\",writingsuggestions:\"false\",translate:\"no\",contenteditable:this.state.facet(ct)?\"true\":\"false\",class:\"cm-content\",style:`${$.tabSize}: ${this.state.tabSize}`,role:\"textbox\",\"aria-multiline\":\"true\"};this.state.readOnly&&(t[\"aria-readonly\"]=\"true\"),ec(this,zo,t);let i=this.observer.ignore(()=>{let r=Zh(this.contentDOM,this.contentAttrs,t),s=Zh(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let r of i.effects)if(r.is(n.announce)){t&&(this.announceDOM.textContent=\"\"),t=!1;let s=this.announceDOM.appendChild(document.createElement(\"div\"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Ui);let e=this.state.facet(n.cspNonce);Le.mount(this.root,this.styleModules.concat(Nm).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error(\"Reading the editor layout isn't allowed during an update\");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return Vs(this,e,_h(this,e,t,i))}moveByGroup(e,t){return Vs(this,e,_h(this,e,t,i=>gm(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[t?i.length-1:0];return x.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,i=!0){return mm(this,e,t,i)}moveVertically(e,t,i){return Vs(this,e,bm(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=ho(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),ho(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.state.doc.lineAt(e),r=this.bidiSpans(i),s=r[je.find(r,e-i.from,-1,t)];return this.docView.coordsAt(e,t,s.dir==H.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(vc)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Fm)return gc(e.length);let t=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||mc(s.isolates,i=Eh(this,e))))return s.order;i||(i=Eh(this,e));let r=GO(e.text,t,i);return this.bidiCache.push(new Sr(e.from,e.to,t,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||$.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{cc(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var i,r,s,o;return Jn.of(new en(typeof e==\"number\"?x.cursor(e):e,(i=t.y)!==null&&i!==void 0?i:\"nearest\",(r=t.x)!==null&&r!==void 0?r:\"nearest\",(s=t.yMargin)!==null&&s!==void 0?s:5,(o=t.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return Jn.of(new en(x.cursor(i.from),\"start\",\"start\",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==\"boolean\"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return ke.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ke.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=Le.newName(),r=[rr.of(i),Ui.of($o(`.${i}`,e))];return t&&t.dark&&r.push(Qo.of(!0)),r}static baseTheme(e){return Ee.lowest(Ui.of($o(\".\"+vo,e,Gc)))}static findFromDOM(e){var t;let i=e.querySelector(\".cm-content\"),r=i&&K.get(i)||K.get(e);return((t=r?.root)===null||t===void 0?void 0:t.view)||null}};v.styleModule=Ui;v.inputHandler=wc;v.clipboardInputFilter=Eo;v.clipboardOutputFilter=Lo;v.scrollHandler=$c;v.focusChangeEffect=Qc;v.perLineTextDirection=vc;v.exceptionSink=kc;v.updateListener=eo;v.editable=ct;v.mouseSelectionStyle=xc;v.dragMovesSelection=Sc;v.clickAddsSelectionRange=yc;v.decorations=vr;v.blockWrappers=Cc;v.outerDecorations=_o;v.atomicRanges=fn;v.bidiIsolatedRanges=Ac;v.cursorScrollMargin=R.define({combine:n=>{let e=5,t=5;for(let i of n)typeof i==\"number\"?e=t=i:{x:e,y:t}=i;return{x:e,y:t}}});v.scrollMargins=Rc;v.darkTheme=Qo;v.cspNonce=R.define({combine:n=>n.length?n[0]:\"\"});v.contentAttributes=zo;v.editorAttributes=Tc;v.lineWrapping=v.contentAttributes.of({class:\"cm-lineWrapping\"});v.announce=D.define();var Fm=4096,Jh={},Sr=class n{constructor(e,t,i,r,s,o){this.from=e,this.to=t,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:H.LTR;for(let s=Math.max(0,e.length-10);s=0;r--){let s=i[r],o=typeof s==\"function\"?s(n):s;o&&Zo(o,t)}return t}var Hm=$.mac?\"mac\":$.windows?\"win\":$.linux?\"linux\":\"key\";function Km(n,e){let t=n.split(/-(?!$)/),i=t[t.length-1];i==\"Space\"&&(i=\" \");let r,s,o,l;for(let a=0;ai.concat(r),[]))),t}var Qt=null,tg=4e3;function ig(n,e=Hm){let t=Object.create(null),i=Object.create(null),r=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error(\"Key binding \"+o+\" is used both as a regular binding and as a multi-stroke prefix\")},s=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(b=>Km(b,e));for(let b=1;b{let C=Qt={view:S,prefix:y,scope:o};return setTimeout(()=>{Qt==C&&(Qt=null)},tg),!0}]})}let O=p.join(\" \");r(O,!1);let g=d[O]||(d[O]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&g.run.push(a),h&&(g.preventDefault=!0),c&&(g.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(\" \"):[\"editor\"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in c)c[u].run.push(d=>f(d,Co))}let a=o[e]||o.key;if(a)for(let h of l)s(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(h,\"Shift-\"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}var Co=null;function ng(n,e,t,i){Co=e;let r=Th(e),s=at(r,0),o=wt(s)==r.length&&r!=\" \",l=\"\",a=!1,h=!1,c=!1;Qt&&Qt.view==t&&Qt.scope==i&&(l=Qt.prefix+\" \",jc.indexOf(e.keyCode)<0&&(h=!0,Qt=null));let f=new Set,u=g=>{if(g){for(let b of g.run)if(!f.has(b)&&(f.add(b),b(t)))return g.stopPropagation&&(c=!0),!0;g.preventDefault&&(g.stopPropagation&&(c=!0),h=!0)}return!1},d=n[i],p,O;return d&&(u(d[l+sr(r,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!($.windows&&e.ctrlKey&&e.altKey)&&!($.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=ht[e.keyCode])&&p!=r?(u(d[l+sr(p,e,!0)])||e.shiftKey&&(O=Si[e.keyCode])!=r&&O!=p&&u(d[l+sr(O,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+sr(r,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),Co=null,a}var rg=$.gecko&&$.gecko_version==153?\"#ffffff01\":\"transparent\",gk=Ee.highest(v.theme({\".cm-line\":{\"& ::selection, &::selection\":{backgroundColor:`${rg} !important`},caretColor:\"transparent !important\"},\".cm-content\":{caretColor:\"transparent !important\",\"& :focus\":{caretColor:\"initial !important\",\"&::selection, & ::selection\":{backgroundColor:\"Highlight !important\"}}}}));var bk=/x/.unicode!=null?\"gu\":\"g\";var Ao=class extends he{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement(\"span\");return t.className=\"cm-placeholder\",t.style.pointerEvents=\"none\",t.appendChild(typeof this.content==\"string\"?document.createTextNode(this.content):typeof this.content==\"function\"?this.content(e):this.content.cloneNode(!0)),t.setAttribute(\"aria-hidden\",\"true\"),t}coordsAt(e){let t=e.firstChild?Ki(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),r=hn(t[0],i.direction!=\"rtl\"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}};function Uc(n){let e=ke.fromClass(class{constructor(t){this.view=t,this.placeholder=n?L.set([L.widget({widget:new Ao(n),side:1}).range(0)]):L.none}get decorations(){return this.view.state.doc.length?L.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n==\"string\"?[e,v.contentAttributes.of({\"aria-placeholder\":n})]:e}var or=\"-10000px\",xr=class{constructor(e,t,i,r){this.facet=t,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(e,t){var i;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;at[h]=a),t.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}};function sg(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}var Ws=R.define({combine:n=>{var e,t,i;return{position:$.ios?\"absolute\":((e=n.find(r=>r.position))===null||e===void 0?void 0:e.position)||\"fixed\",parent:((t=n.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||sg}}}),ic=new WeakMap,Do=ke.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Ws);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==\"function\"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new xr(n,Pr,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver==\"function\"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener(\"resize\",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(\"div\"),this.container.style.position=\"relative\",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Ws);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add(\"cm-tooltip\"),n.arrow&&!t.dom.querySelector(\".cm-tooltip > .cm-tooltip-arrow\")){let r=document.createElement(\"div\");r.className=\"cm-tooltip-arrow\",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=or,t.dom.style.left=\"0px\",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener(\"resize\",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position==\"fixed\"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if($.safari){let o=s.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else t=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(t||this.position==\"absolute\")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(n=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=jo(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(Ws).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position=\"absolute\";for(let l of this.manager.tooltipViews)l.dom.style.position=\"absolute\"}let{visible:t,space:i,scaleX:r,scaleY:s}=n,o=[];for(let l=0;l=Math.min(t.bottom,i.bottom)||f.rightMath.min(t.right,i.right)+.1)){c.style.top=or;continue}let d=a.arrow?h.dom.querySelector(\".cm-tooltip-arrow\"):null,p=d?7:0,O=u.right-u.left,g=(e=ic.get(h))!==null&&e!==void 0?e:u.bottom-u.top,b=h.offset||lg,y=this.view.textDirection==H.LTR,S=u.width>i.right-i.left?y?i.left:i.right-u.width:y?Math.max(i.left,Math.min(f.left-(d?14:0)+b.x,i.right-O)):Math.min(Math.max(i.left,f.left-O+(d?14:0)-b.x),i.right-O),C=this.above[l];!a.strictSide&&(C?f.top-g-p-b.yi.bottom)&&C==i.bottom-f.bottom>f.top-i.top&&(C=this.above[l]=!C);let w=(C?f.top-i.top:i.bottom-f.bottom)-p;if(wS&&j.topP&&(P=C?j.top-g-2-p:j.bottom+p+2);if(this.position==\"absolute\"?(c.style.top=(P-n.parent.top)/s+\"px\",nc(c,(S-n.parent.left)/r)):(c.style.top=P/s+\"px\",nc(c,S/r)),d){let j=f.left+(y?b.x:-b.x)-(S+14-7);d.style.left=j/r+\"px\"}h.overlap!==!0&&o.push({left:S,top:P,right:T,bottom:P+g}),c.classList.toggle(\"cm-tooltip-above\",C),c.classList.toggle(\"cm-tooltip-below\",!C),h.positioned&&h.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=or}},{eventObservers:{scroll(){this.maybeMeasure()}}});function nc(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+\"px\")}var og=v.baseTheme({\".cm-tooltip\":{zIndex:500,boxSizing:\"border-box\"},\"&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:\"7px\",width:`${7*2}px`,position:\"absolute\",zIndex:-1,overflow:\"hidden\",\"&:before, &:after\":{content:\"''\",position:\"absolute\",width:0,height:0,borderLeft:\"7px solid transparent\",borderRight:\"7px solid transparent\"},\".cm-tooltip-above &\":{bottom:\"-7px\",\"&:before\":{borderTop:\"7px solid #bbb\"},\"&:after\":{borderTop:\"7px solid #f5f5f5\",bottom:\"1px\"}},\".cm-tooltip-below &\":{top:\"-7px\",\"&:before\":{borderBottom:\"7px solid #bbb\"},\"&:after\":{borderBottom:\"7px solid #f5f5f5\",top:\"1px\"}}},\"&dark .cm-tooltip .cm-tooltip-arrow\":{\"&:before\":{borderTopColor:\"#333338\",borderBottomColor:\"#333338\"},\"&:after\":{borderTopColor:\"transparent\",borderBottomColor:\"transparent\"}}}),lg={x:0,y:0},Pr=R.define({enables:[Do,og]}),kr=R.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])}),wr=class n{static create(e){return new n(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement(\"div\"),this.dom.classList.add(\"cm-tooltip-hover\"),this.manager=new xr(e,kr,(t,i)=>this.createHostedView(t,i),t=>t.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add(\"cm-tooltip-section\"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp(\"offset\")}get getCoords(){return this.passProp(\"getCoords\")}get overlap(){return this.passProp(\"overlap\")}get resize(){return this.passProp(\"resize\")}},ag=Pr.compute([kr],n=>{let e=n.facet(kr);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var i;return(i=t.end)!==null&&i!==void 0?i:t.pos})),create:wr.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),hg=R.define(),Ro=class{constructor(e,t,i,r,s,o){this.view=e,this.source=t,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener(\"mouseleave\",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener(\"mousemove\",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;eo.bottom||t.xo.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(r)).find(h=>h.from<=r&&h.to>=r),a=l&&l.dir==H.RTL?-1:1;s=t.x{if(l&&!(Array.isArray(l)&&!l.length)){let a=Array.isArray(l)?l:[l];r&&this.locked.set(a,r),e.dispatch({effects:this.setHover.of(a)})}};if(s&&\"then\"in s){let l=this.pending={pos:t};s.then(a=>{this.pending==l&&(this.pending=null,o(a))},a=>ue(e.state,a,\"hover tooltip\"))}else o(s)}get tooltip(){let e=this.view.plugin(Do),t=e?e.manager.tooltips.findIndex(i=>i.create==wr.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!cg(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(t=r[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!fg(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener(\"mouseleave\",t);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener(\"mouseleave\",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener(\"mouseleave\",this.mouseleave),this.view.dom.removeEventListener(\"mousemove\",this.mousemove)}},lr=4;function cg(n,e){let{left:t,right:i,top:r,bottom:s}=n.getBoundingClientRect(),o;if(o=n.querySelector(\".cm-tooltip-arrow\")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return e.clientX>=t-lr&&e.clientX<=i+lr&&e.clientY>=r-lr&&e.clientY<=s+lr}function fg(n,e,t,i,r,s){let o=n.scrollDOM.getBoundingClientRect(),l=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>i||o.rightr||Math.min(o.bottom,l)=e&&a<=t}function Fc(n,e={}){let t=D.define(),i=new WeakMap,r=ae.define({create(){return[]},update(o,l){let a=i.get(o);if(o.length&&(e.hideOnChange&&(l.docChanged||l.selection)?o=[]:a&&a(l)?o=[]:e.hideOn&&(o=o.filter(h=>!e.hideOn(l,h)))),l.docChanged&&o.length){let h=[];for(let c of o){let f=l.changes.mapPos(c.pos,-1,ne.TrackDel);if(f!=null){let u=Object.assign(Object.create(null),c);u.pos=f,u.end!=null&&(u.end=l.changes.mapPos(u.end)),h.push(u)}}o=h}for(let h of l.effects)h.is(t)&&(o=h.value,a=void 0),(h.is(ug)&&!h.value||h.value==r)&&(o=[]);return o.length&&a&&i.set(o,a),o},provide:o=>kr.from(o)}),s=ke.define(o=>new Ro(o,n,r,i,t,e.hoverTime||300));return{active:r,extension:[r,s,hg.of(s),ag]}}function Vo(n,e){let t=n.plugin(Do);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}var ug=D.define();var dt=class extends Me{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};dt.prototype.elementClass=\"\";dt.prototype.toDOM=void 0;dt.prototype.mapMode=ne.TrackBefore;dt.prototype.startSide=dt.prototype.endSide=-1;dt.prototype.point=!0;var dg=0,we=class{constructor(e,t){this.from=e,this.to=t}},E=class{constructor(e={}){this.id=dg++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error(\"This node type doesn't define a deserialize function\")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError(\"Can't add per-node props to node types\");return typeof e!=\"function\"&&(e=te.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}};E.closedBy=new E({deserialize:n=>n.split(\" \")});E.openedBy=new E({deserialize:n=>n.split(\" \")});E.group=new E({deserialize:n=>n.split(\" \")});E.isolate=new E({deserialize:n=>{if(n&&n!=\"rtl\"&&n!=\"ltr\"&&n!=\"auto\")throw new RangeError(\"Invalid value for isolate: \"+n);return n||\"auto\"}});E.contextHash=new E({perNode:!0});E.lookAhead=new E({perNode:!0});E.mounted=new E({perNode:!0});var Ct=class{constructor(e,t,i,r=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[E.mounted.id]}},pg=Object.create(null),te=class n{constructor(e,t,i,r=0){this.name=e,this.props=t,this.id=i,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):pg,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new n(e.name||\"\",t,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError(\"Can't store a per-node prop on a node type\");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.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(e){if(typeof e==\"string\"){if(this.name==e)return!0;let t=this.prop(E.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let r of i.split(\" \"))t[r]=e[i];return i=>{for(let r=i.prop(E.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?i.name:r[s]];if(o)return o}}}};te.none=new te(\"\",Object.create(null),0,8);var At=class n{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|V.IncludeAnonymous);;){let h=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Jo(te.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,r)=>new n(this.type,t,i,r,this.propValues),e.makeTree||((t,i,r)=>new n(te.none,t,i,r)))}static build(e){return mg(e)}};W.empty=new W(te.none,[],[],0);var Io=class n{constructor(e,t){this.buffer=e,this.index=t}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 n(this.buffer,this.index)}},Rt=class n{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return te.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function un(n,e,t,i){for(var r;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from,u;if(!(!(s&V.EnterBracketed&&c instanceof W&&(u=Ct.get(c))&&!u.overlay&&u.bracketed&&i>=f&&i<=f+c.length)&&!sf(r,i,f,f+c.length))){if(c instanceof Rt){if(s&V.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,t,i-f,r);if(d>-1)return new ni(new Bo(o,c,e,f),null,d)}else if(s&V.IncludeAnonymous||!c.type.isAnonymous||Ko(c)){let d;if(!(s&V.IgnoreMounts)&&(d=Ct.get(c))&&!d.overlay)return new n(d.tree,f,e,o);let p=new n(c,f,e,o);return s&V.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(t<0?c.children.length-1:0,t,i,r,s)}}}if(s&V.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))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(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,i=0){let r;if(!(i&V.IgnoreOverlays)&&(r=Ct.get(this._tree))&&r.overlay){let s=e-this.from,o=i&V.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((t>0||o?l<=s:l=s:a>s))return new n(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}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}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function Kc(n,e,t,i){let r=n.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function Wo(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}var Bo=class{constructor(e,t,i,r){this.parent=e,this.buffer=t,this.index=i,this.start=r}},ni=class n extends Ar{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]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,i);return s<0?null:new n(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,i=0){if(i&V.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new n(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new n(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new n(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];e.push(i.slice(r,s,o)),t.push(0)}return new W(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function of(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;st.from||o.to=e){let l=new Qe(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(un(l,e,t,!1))}}return r?of(r):i}var Ri=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~V.EnterBracketed,e instanceof Qe)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof Qe?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&V.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&V.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&V.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=t+e,o=e<0?-1:i._tree.children.length;s!=o;s+=e){let l=i._tree.children[s];if(this.mode&V.IncludeAnonymous||l instanceof Rt||!l.type.isAnonymous||Ko(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return Wo(this._tree,e,r);let o=i[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}};function Ko(n){return n.children.some(e=>e instanceof Rt||!e.type.isAnonymous||Ko(e))}function mg(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:r=1024,reused:s=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new Io(t,t.length):t,a=i.types,h=0,c=0;function f(w,P,T,j,B,A){let{id:M,start:Z,end:U,size:J}=l,le=c,xt=h;if(J<0)if(l.next(),J==-1){let st=s[M];T.push(st),j.push(Z-w);return}else if(J==-3){h=M;return}else if(J==-4){c=M;return}else throw new RangeError(`Unrecognized record size: ${J}`);let Ii=a[M],Yn,Wt,Ka=Z-w;if(U-Z<=r&&(Wt=g(l.pos-P,B))){let st=new Uint16Array(Wt.size-Wt.skip),Ze=l.pos-Wt.size,Je=st.length;for(;l.pos>Ze;)Je=b(Wt.start,st,Je);Yn=new Rt(st,U-Wt.start,i),Ka=Wt.start-w}else{let st=l.pos-J;l.next();let Ze=[],Je=[],Bt=M>=o?M:-1,pi=0,Dn=U;for(;l.pos>st;)Bt>=0&&l.id==Bt&&l.size>=0?(l.end<=Dn-r&&(p(Ze,Je,Z,pi,l.end,Dn,Bt,le,xt),pi=Ze.length,Dn=l.end),l.next()):A>2500?u(Z,st,Ze,Je):f(Z,st,Ze,Je,Bt,A+1);if(Bt>=0&&pi>0&&pi-1&&pi>0){let Ja=d(Ii,xt);Yn=Jo(Ii,Ze,Je,0,Ze.length,0,U-Z,Ja,Ja)}else Yn=O(Ii,Ze,Je,U-Z,le-U,xt)}T.push(Yn),j.push(Ka)}function u(w,P,T,j){let B=[],A=0,M=-1;for(;l.pos>P;){let{id:Z,start:U,end:J,size:le}=l;if(le>4)l.next();else{if(M>-1&&U=0;J-=3)Z[le++]=B[J],Z[le++]=B[J+1]-U,Z[le++]=B[J+2]-U,Z[le++]=le;T.push(new Rt(Z,B[2]-U,i)),j.push(U-w)}}function d(w,P){return(T,j,B)=>{let A=0,M=T.length-1,Z,U;if(M>=0&&(Z=T[M])instanceof W){if(!M&&Z.type==w&&Z.length==B)return Z;(U=Z.prop(E.lookAhead))&&(A=j[M]+Z.length+U)}return O(w,T,j,B,A,P)}}function p(w,P,T,j,B,A,M,Z,U){let J=[],le=[];for(;w.length>j;)J.push(w.pop()),le.push(P.pop()+T-B);w.push(O(i.types[M],J,le,A-B,Z-A,U)),P.push(B-T)}function O(w,P,T,j,B,A,M){if(A){let Z=[E.contextHash,A];M=M?[Z].concat(M):[Z]}if(B>25){let Z=[E.lookAhead,B];M=M?[Z].concat(M):[Z]}return new W(w,P,T,j,M)}function g(w,P){let T=l.fork(),j=0,B=0,A=0,M=T.end-r,Z={size:0,start:0,skip:0};e:for(let U=T.pos-w;T.pos>U;){let J=T.size;if(T.id==P&&J>=0){Z.size=j,Z.start=B,Z.skip=A,A+=4,j+=4,T.next();continue}let le=T.pos-J;if(J<0||le=o?4:0,Ii=T.start;for(T.next();T.pos>le;){if(T.size<0)if(T.size==-3||T.size==-4)xt+=4;else break e;else T.id>=o&&(xt+=4);T.next()}B=Ii,j+=J,A+=xt}return(P<0||j==w)&&(Z.size=j,Z.start=B,Z.skip=A),Z.size>4?Z:void 0}function b(w,P,T){let{id:j,start:B,end:A,size:M}=l;if(l.next(),M>=0&&j4){let U=l.pos-(M-4);for(;l.pos>U;)T=b(w,P,T)}P[--T]=Z,P[--T]=A-w,P[--T]=B-w,P[--T]=j}else M==-3?h=j:M==-4&&(c=j);return T}let y=[],S=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,y,S,-1,0);let C=(e=n.length)!==null&&e!==void 0?e:y.length?S[0]+y[0].length:0;return new W(a[n.topID],y.reverse(),S.reverse(),C)}var Jc=new WeakMap;function Cr(n,e){if(!n.isAnonymous||e instanceof Rt||e.type!=n)return 1;let t=Jc.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof W)){t=1;break}t+=Cr(n,i)}Jc.set(e,t)}return t}function Jo(n,e,t,i,r,s,o,l,a){let h=0;for(let p=i;p=c)break;P+=T}if(S==C+1){if(P>c){let T=p[C];d(T.children,T.positions,0,T.children.length,O[C]+y);continue}f.push(p[C])}else{let T=O[S-1]+p[S-1].length-w;f.push(Jo(n,p,O,C,S,w,T,null,a))}u.push(w+y-s)}}return d(e,t,i,r,0),(l||a)(f,u,o)}var Zi=class{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof ni?this.setBuffer(e.context.buffer,e.index,t):e instanceof Qe&&this.map.set(e.tree,t)}get(e){return e instanceof ni?this.getBuffer(e.context.buffer,e.index):e instanceof Qe?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},pt=class n{constructor(e,t,i,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let r=[new n(0,e.length,e,0,!1,i)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,i=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new n(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&r.push(u),o.to>f)break;o=snew we(r.from,r.to)):[new we(0,0)]:[new we(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let r=this.startParse(e,t,i);for(;;){let s=r.advance();if(s)return s}}},No=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};function Xr(n){return(e,t,i,r)=>new Fo(e,n,t,i,r)}var Rr=class{constructor(e,t,i,r,s,o){this.parser=e,this.parse=t,this.overlay=i,this.bracketed=r,this.target=s,this.from=o}};function ef(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError(\"Invalid inner parse ranges given: \"+JSON.stringify(n))}var Go=class{constructor(e,t,i,r,s,o,l,a){this.parser=e,this.predicate=t,this.mounts=i,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}},Uo=new E({perNode:!0}),Fo=class{constructor(e,t,i,r,s){this.nest=t,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new W(i.type,i.children,i.positions,i.length,i.propValues.concat([[Uo,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[E.mounted.id]=new Ct(t,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(t){let h=t.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=r.from&&u<=r.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=gg(i.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew we(f.from-r.from,f.to-r.from)):null,!!s.bracketed,r.tree,c.length?c[0].from:r.from)),s.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else if(t&&(a=t.predicate(r))&&(a===!0&&(a=new we(r.from,r.to)),a.from=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&r.firstChild())t&&t.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let h=nf(this.ranges,t.ranges);h.length&&(ef(h),this.inner.splice(t.index,0,new Rr(t.parser,t.parser.startParse(this.input,rf(t.mounts,h),h),t.ranges.map(c=>new we(c.from-t.start,c.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}};function gg(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function tf(n,e,t,i,r,s){if(e=e&&t.enter(i,1,V.IgnoreOverlays|V.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof W)t=t.children[0];else break}return!1}},Ho=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(Uo))!==null&&t!==void 0?t:i.to,this.inner=new Zr(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Uo))!==null&&e!==void 0?e:t.to,this.inner=new Zr(t.tree,-t.offset)}}findMounts(e,t){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(i=s.tree)===null||i===void 0?void 0:i.prop(E.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}};function nf(n,e){let t=null,i=e;for(let r=1,s=0;r=l)break;a.to<=o||(t||(i=t=e.slice()),a.froml&&t.splice(s+1,0,new we(l,a.to))):a.to>l?t[s--]=new we(l,a.to):t.splice(s--,1))}}return i}function yg(n,e,t,i){let r=0,s=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=r==n.length?1e9:o?n[r].to:n[r].from,f=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);unew we(u.from+i,u.to+i)),f=yg(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,O=p?h:f[u].from;if(O>d&&t.push(new pt(d,O,r.tree,-o,s.from>=d||s.openStart,s.to<=O||s.openEnd)),p)break;d=f[u].to}}else t.push(new pt(a,h,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return t}var Sg=0,Ce=class n{constructor(e,t,i,r){this.name=e,this.set=t,this.base=i,this.modified=r,this.id=Sg++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e==\"string\"?e:\"?\";if(e instanceof n&&(t=e),t?.base)throw new Error(\"Can not derive from a modified tag\");let r=new n(i,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new zr(e);return i=>i.modified.indexOf(t)>-1?i:zr.get(i.base||i,i.modified.concat(t).sort((r,s)=>r.id-s.id))}},xg=0,zr=class n{constructor(e){this.name=e,this.instances=[],this.id=xg++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&kg(t,l.modified));if(i)return i;let r=[],s=new Ce(e.name,r,e,t);for(let l of t)l.instances.push(s);let o=wg(t);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(n.get(l,a));return s}};function kg(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function wg(n){let e=[[]];for(let t=0;ti.length-t.length)}function Ne(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let r of t.split(\" \"))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l==\"...\"&&f>0&&f+3==r.length){o=1;break}let u=/^\"(?:[^\"\\\\]|\\\\.)*?\"|[^\\/!]+/.exec(l);if(!u)throw new RangeError(\"Invalid path: \"+r);if(s.push(u[0]==\"*\"?\"\":u[0][0]=='\"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==r.length)break;let d=r[f++];if(f==r.length&&d==\"!\"){o=0;break}if(d!=\"/\")throw new RangeError(\"Invalid path: \"+r);l=r.slice(f)}let a=s.length-1,h=s[a];if(!h)throw new RangeError(\"Invalid path: \"+r);let c=new si(i,o,a>0?s.slice(0,a):null);e[h]=c.sort(e[h])}}return hf.add(e)}var hf=new E({combine(n,e){let t,i,r;for(;n||e;){if(!n||e&&n.depth>=e.depth?(r=e,e=e.next):(r=n,n=n.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new si(r.tags,r.mode,r.context);t?t.next=s:i=s,t=s}return i}}),si=class{constructor(e,t,i,r){this.tags=e,this.mode=t,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let l of s)for(let a of l.set){let h=t[a.id];if(h){o=o?o+\" \"+h:h;break}}return o},scope:i}}function Qg(n,e){let t=null;for(let i of n){let r=i.style(e);r&&(t=t?t+\" \"+r:r)}return t}function cf(n,e,t,i=0,r=n.length){let s=new tl(i,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),i,r,\"\",s.highlighters),s.flush(r)}var tl=class{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=\"\"}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,r,s){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=r,c=vg(e)||si.empty,f=Qg(s,c.tags);if(f&&(h&&(h+=\" \"),h+=f,c.mode==1&&(r+=(r?\" \":\"\")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(E.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),O=e.firstChild();for(let g=0,b=l;;g++){let y=g=S||!e.nextSibling())););if(!y||S>i)break;b=y.to+l,b>t&&(this.highlightRange(d.cursor(),Math.max(t,y.from+l),Math.min(i,b),\"\",p),this.startSpan(Math.min(i,b),h))}O&&e.parent()}else if(e.firstChild()){u&&(r=\"\");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,r,s),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}};function vg(n){let e=n.type.prop(hf);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}var Q=Ce.define,Mr=Q(),Xt=Q(),lf=Q(Xt),af=Q(Xt),Mt=Q(),Er=Q(Mt),el=Q(Mt),rt=Q(),ri=Q(rt),it=Q(),nt=Q(),il=Q(),dn=Q(il),Lr=Q(),m={comment:Mr,lineComment:Q(Mr),blockComment:Q(Mr),docComment:Q(Mr),name:Xt,variableName:Q(Xt),typeName:lf,tagName:Q(lf),propertyName:af,attributeName:Q(af),className:Q(Xt),labelName:Q(Xt),namespace:Q(Xt),macroName:Q(Xt),literal:Mt,string:Er,docString:Q(Er),character:Q(Er),attributeValue:Q(Er),number:el,integer:Q(el),float:Q(el),bool:Q(Mt),regexp:Q(Mt),escape:Q(Mt),color:Q(Mt),url:Q(Mt),keyword:it,self:Q(it),null:Q(it),atom:Q(it),unit:Q(it),modifier:Q(it),operatorKeyword:Q(it),controlKeyword:Q(it),definitionKeyword:Q(it),moduleKeyword:Q(it),operator:nt,derefOperator:Q(nt),arithmeticOperator:Q(nt),logicOperator:Q(nt),bitwiseOperator:Q(nt),compareOperator:Q(nt),updateOperator:Q(nt),definitionOperator:Q(nt),typeOperator:Q(nt),controlOperator:Q(nt),punctuation:il,separator:Q(il),bracket:dn,angleBracket:Q(dn),squareBracket:Q(dn),paren:Q(dn),brace:Q(dn),content:rt,heading:ri,heading1:Q(ri),heading2:Q(ri),heading3:Q(ri),heading4:Q(ri),heading5:Q(ri),heading6:Q(ri),contentSeparator:Q(rt),list:Q(rt),quote:Q(rt),emphasis:Q(rt),strong:Q(rt),link:Q(rt),monospace:Q(rt),strikethrough:Q(rt),inserted:Q(),deleted:Q(),changed:Q(),invalid:Q(),meta:Lr,documentMeta:Q(Lr),annotation:Q(Lr),processingInstruction:Q(Lr),definition:Ce.defineModifier(\"definition\"),constant:Ce.defineModifier(\"constant\"),function:Ce.defineModifier(\"function\"),standard:Ce.defineModifier(\"standard\"),local:Ce.defineModifier(\"local\"),special:Ce.defineModifier(\"special\")};for(let n in m){let e=m[n];e instanceof Ce&&(e.name=n)}var vk=nl([{tag:m.link,class:\"tok-link\"},{tag:m.heading,class:\"tok-heading\"},{tag:m.emphasis,class:\"tok-emphasis\"},{tag:m.strong,class:\"tok-strong\"},{tag:m.keyword,class:\"tok-keyword\"},{tag:m.atom,class:\"tok-atom\"},{tag:m.bool,class:\"tok-bool\"},{tag:m.url,class:\"tok-url\"},{tag:m.labelName,class:\"tok-labelName\"},{tag:m.inserted,class:\"tok-inserted\"},{tag:m.deleted,class:\"tok-deleted\"},{tag:m.literal,class:\"tok-literal\"},{tag:m.string,class:\"tok-string\"},{tag:m.number,class:\"tok-number\"},{tag:[m.regexp,m.escape,m.special(m.string)],class:\"tok-string2\"},{tag:m.variableName,class:\"tok-variableName\"},{tag:m.local(m.variableName),class:\"tok-variableName tok-local\"},{tag:m.definition(m.variableName),class:\"tok-variableName tok-definition\"},{tag:m.special(m.variableName),class:\"tok-variableName2\"},{tag:m.definition(m.propertyName),class:\"tok-propertyName tok-definition\"},{tag:m.typeName,class:\"tok-typeName\"},{tag:m.namespace,class:\"tok-namespace\"},{tag:m.className,class:\"tok-className\"},{tag:m.macroName,class:\"tok-macroName\"},{tag:m.propertyName,class:\"tok-propertyName\"},{tag:m.operator,class:\"tok-operator\"},{tag:m.comment,class:\"tok-comment\"},{tag:m.meta,class:\"tok-meta\"},{tag:m.invalid,class:\"tok-invalid\"},{tag:m.punctuation,class:\"tok-punctuation\"}]);var rl,Et=new E;function gn(n){return R.define({combine:n?e=>e.concat(n):void 0})}var _r=new E,be=class{constructor(e,t,i=[],r=\"\"){this.data=e,this.name=r,q.prototype.hasOwnProperty(\"tree\")||Object.defineProperty(q.prototype,\"tree\",{get(){return z(this)}}),this.parser=t,this.extension=[Xi.of(this),q.languageData.of((s,o,l)=>{let a=ff(s,o,l),h=a.type.prop(Et);if(!h)return[];let c=s.facet(h),f=a.type.prop(_r);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,s)){let p=s.facet(d.facet);return d.type==\"replace\"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return ff(e,t,i).type.prop(Et)==this.data}findRegions(e){let t=e.facet(Xi);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(Et)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(E.mounted);if(l){if(l.tree.prop(Et)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let a=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new n(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function z(n){let e=n.field(be.state,!1);return e?e.tree:W.empty}var al=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=\"\",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}},pn=null,On=class n{constructor(e,t,i=[],r,s,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new n(e,t,[],W.empty,0,i,[],null)}startParse(){return this.parser.startParse(new al(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=W.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e==\"number\"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(pt.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=pn;pn=this;try{return e()}finally{pn=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=uf(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=pt.applyChanges(i,a),r=W.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=uf(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Zt{createParse(t,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let a=pn;if(a){for(let h of r)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new W(te.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return pn}};function uf(n,e,t){return pt.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}var mn=class n{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new n(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=On.create(e.facet(Xi).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new n(i)}};be.state=ae.define({create:mn.init,update(n,e){for(let t of e.effects)if(t.is(be.setState))return t.value;return e.startState.facet(Xi)!=e.state.facet(Xi)?mn.init(e.state):n.apply(e)}});var mf=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<\"u\"&&(mf=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});var sl=typeof navigator<\"u\"&&(!((rl=navigator.scheduling)===null||rl===void 0)&&rl.isInputPending)?()=>navigator.scheduling.isInputPending():null,$g=ke.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(be.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(be.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=mf(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,a=s.context.work(()=>sl&&sl()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:be.setState.of(new mn(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>ue(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Xi=R.define({combine(n){return n.length?n[0]:null},enables:n=>[be.state,$g,v.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{\"data-language\":t.name}:{}})]}),Ge=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},Ot=class n{constructor(e,t,i,r,s,o=void 0){this.name=e,this.alias=t,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:i}=e;if(!t){if(!i)throw new RangeError(\"Must pass either 'load' or 'support' to LanguageDescription.of\");t=()=>Promise.resolve(i)}return new n(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let r of e)if(r.filename&&r.filename.test(t))return r;let i=/\\.([^.]+)$/.exec(t);if(i){for(let r of e)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let r of e)if(r.alias.some(s=>s==t))return r;if(i)for(let r of e)for(let s of r.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\\w/.test(t[o-1])&&!/\\w/.test(t[o+s.length])))return r}return null}},Pg=R.define(),zt=R.define({combine:n=>{if(!n.length)return\" \";let e=n[0];if(!e||/\\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error(\"Invalid indent unit: \"+JSON.stringify(n[0]));return e}});function bn(n){let e=n.facet(zt);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function yn(n,e){let t=\"\",i=n.tabSize,r=n.facet(zt)[0];if(r==\"\t\"){for(;e>=i;)t+=\"\t\",e-=i;r=\" \"}for(let s=0;s=e?Tg(n,t,e):null}var oi=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=bn(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:\"\",from:e}:(t<0?r-1&&(s+=o-this.countColumn(i,i.search(/\\S|$/))),s}countColumn(e,t=e.length){return Pe(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},mt=new E;function Tg(n,e,t){let i=e.resolveStack(t),r=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(r!=i.node){let s=[];for(let o=r;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return gf(i,n,t)}function gf(n,e,t){for(let i=n;i;i=i.next){let r=Ag(i.node);if(r)return r(hl.create(e,t,i))}return 0}function Cg(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Ag(n){let e=n.type.prop(mt);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(E.closedBy))){let r=n.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>yf(o,!0,1,void 0,s&&!Cg(o)?r.from:void 0)}return n.parent==null?Rg:null}function Rg(){return 0}var hl=class n extends oi{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new n(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Zg(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return gf(this.context.next,this.base,this.pos)}};function Zg(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function Xg(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let r=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let h=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+h}}l=a.to}}function bf({closing:n,align:e=!0,units:t=1}){return i=>yf(i,e,t,n)}function yf(n,e,t,i,r){let s=n.textAfter,o=s.match(/^\\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==n.pos+o,a=e?Xg(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}var Sf=n=>n.baseIndent;function Ei({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}var xf=R.define(),gt=new E;function jr(n){let e=n.firstChild,t=n.lastChild;return e&&e.tol.prop(Et)==o.data:o?l=>l==o:void 0,this.style=nl(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new Le(i):null,this.themeType=t.themeType}static define(e,t){return new n(e,t||{})}},cl=R.define(),kf=R.define({combine(n){return n.length?[n[0]]:null}});function ol(n){let e=n.facet(cl);return e.length?e:n.facet(kf)}function wf(n,e){let t=[Mg],i;return n instanceof Mi&&(n.module&&t.push(v.styleModule.of(n.module)),i=n.themeType),e?.fallback?t.push(kf.of(n)):i?t.push(cl.computeN([v.darkTheme],r=>r.facet(v.darkTheme)==(i==\"dark\")?[n]:[])):t.push(cl.of(n)),t}var fl=class{constructor(e){this.markCache=Object.create(null),this.tree=z(e.state),this.decorations=this.buildDeco(e,ol(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=z(e.state),i=ol(e.state),r=i!=ol(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return L.none;let i=new lt;for(let{from:r,to:s}of e.visibleRanges)cf(this.tree,t,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=L.mark({class:a})))},r,s);return i.finish()}},Mg=Ee.high(ke.fromClass(fl,{decorations:n=>n.decorations})),Mk=Mi.define([{tag:m.meta,color:\"#404740\"},{tag:m.link,textDecoration:\"underline\"},{tag:m.heading,textDecoration:\"underline\",fontWeight:\"bold\"},{tag:m.emphasis,fontStyle:\"italic\"},{tag:m.strong,fontWeight:\"bold\"},{tag:m.strikethrough,textDecoration:\"line-through\"},{tag:m.keyword,color:\"#708\"},{tag:[m.atom,m.bool,m.url,m.contentSeparator,m.labelName],color:\"#219\"},{tag:[m.literal,m.inserted],color:\"#164\"},{tag:[m.string,m.deleted],color:\"#a11\"},{tag:[m.regexp,m.escape,m.special(m.string)],color:\"#e40\"},{tag:m.definition(m.variableName),color:\"#00f\"},{tag:m.local(m.variableName),color:\"#30a\"},{tag:[m.typeName,m.namespace],color:\"#085\"},{tag:m.className,color:\"#167\"},{tag:[m.special(m.variableName),m.macroName],color:\"#256\"},{tag:m.definition(m.propertyName),color:\"#00c\"},{tag:m.comment,color:\"#940\"},{tag:m.invalid,color:\"#f00\"}]);var Eg=1e4,Lg=\"()[]{}\";var Ol=new E;function ul(n,e,t){let i=n.prop(e<0?E.openedBy:E.closedBy);if(i)return i;if(n.name.length==1){let r=t.indexOf(n.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function dl(n){let e=n.type.prop(Ol);return e?e(n.node):n}function li(n,e,t,i={}){let r=i.maxScanDistance||Eg,s=i.brackets||Lg,o=z(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=ul(a.type,t,s);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return zg(n,e,t,a,c,h,s)}}return _g(n,e,t,o,l.type,r,s)}function zg(n,e,t,i,r,s,o){let l=i.parent,a={from:r.from,to:r.to},h=0,c=l?.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&s.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=s;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let O=t>0?0:d.length-1,g=t>0?d.length:-1;O!=g;O+=t){let b=o.indexOf(d[O]);if(!(b<0||i.resolveInner(p+O,1).type!=r))if(b%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+O,to:p+O+1},matched:b>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}var jg=Object.create(null),df=[te.none];var pf=[],Of=Object.create(null),Yg=Object.create(null);for(let[n,e]of[[\"variable\",\"variableName\"],[\"variable-2\",\"variableName.special\"],[\"string-2\",\"string.special\"],[\"def\",\"variableName.definition\"],[\"tag\",\"tagName\"],[\"attribute\",\"attributeName\"],[\"type\",\"typeName\"],[\"builtin\",\"variableName.standard\"],[\"qualifier\",\"modifier\"],[\"error\",\"invalid\"],[\"header\",\"heading\"],[\"property\",\"propertyName\"]])Yg[n]=Dg(jg,e);function ll(n,e){pf.indexOf(n)>-1||(pf.push(n),console.warn(e))}function Dg(n,e){let t=[];for(let l of e.split(\" \")){let a=[];for(let h of l.split(\".\")){let c=n[h]||m[h];c?typeof c==\"function\"?a.length?a=a.map(c):ll(h,`Modifier ${h} used at start of tag`):a.length?ll(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:ll(h,`Unknown highlighting tag ${h}`)}for(let h of a)t.push(h)}if(!t.length)return 0;let i=e.replace(/ /g,\"_\"),r=i+\" \"+t.map(l=>l.id),s=Of[r];if(s)return s.id;let o=Of[r]=te.define({id:df.length,name:i,props:[Ne({[i]:t})]});return df.push(o),o.id}var Ek={rtl:L.mark({class:\"cm-iso\",inclusive:!0,attributes:{dir:\"rtl\"},bidiIsolate:H.RTL}),ltr:L.mark({class:\"cm-iso\",inclusive:!0,attributes:{dir:\"ltr\"},bidiIsolate:H.LTR}),auto:L.mark({class:\"cm-iso\",inclusive:!0,attributes:{dir:\"auto\"},bidiIsolate:null})};var Vg=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=xl(n.state,t.from);return i.line?Ig(n):i.block?Bg(n):!1};function Sl(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let r=n(e,t);return r?(i(t.update(r)),!0):!1}}var Ig=Sl(Gg,0);var Wg=Sl(Zf,0);var Bg=Sl((n,e)=>Zf(n,e,Ng(e)),0);function xl(n,e){let t=n.languageDataAt(\"commentTokens\",e,1);return t.length?t[0]:{}}var Sn=50;function qg(n,{open:e,close:t},i,r){let s=n.sliceDoc(i-Sn,i),o=n.sliceDoc(r,r+Sn),l=/\\s*$/.exec(s)[0].length,a=/^\\s*/.exec(o)[0].length,h=s.length-l;if(s.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:r+a,margin:a&&1}};let c,f;r-i<=2*Sn?c=f=n.sliceDoc(i,r):(c=n.sliceDoc(i,i+Sn),f=n.sliceDoc(r-Sn,r));let u=/^\\s*/.exec(c)[0].length,d=/\\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\\s/.test(c.charAt(u+e.length))?1:0},close:{pos:r-d-t.length,margin:/\\s/.test(f.charAt(p-1))?1:0}}:null}function Ng(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),r=t.to<=i.to?i:n.doc.lineAt(t.to);r.from>i.from&&r.from==t.to&&(r=t.to==i.to+1?i:n.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\\s*/.exec(i.text)[0].length,to:r.to})}return e}function Zf(n,e,t=e.selection.ranges){let i=t.map(s=>xl(e,s.from).block);if(!i.every(s=>s))return null;let r=t.map((s,o)=>qg(e,i[o],s.from,s.to));if(n!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+\" \"},{from:s.to,insert:\" \"+i[o].close}]))};if(n!=1&&r.some(s=>s)){let s=[];for(let o=0,l;or&&(s==o||o>f.from)){r=f.from;let u=/^\\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;us.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&s.push({from:l.from+h,insert:a+\" \"});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==\" \"&&c++,s.push({from:h,to:c})}return{changes:s}}return null}var gl=fe.define(),Ug=fe.define(),Fg=R.define(),Xf=R.define({combine(n){return yi(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,r)=>e(i,r)||t(i,r)})}}),Mf=ae.define({create(){return ai.empty},update(n,e){let t=e.state.facet(Xf),i=e.annotation(gl);if(i){let a=Ue.fromTransaction(e,i.selection),h=i.side,c=h==0?n.undone:n.done;return a?c=Dr(c,c.length,t.minDepth,a):c=zf(c,e.startState.selection),new ai(h==0?i.rest:c,h==0?c:i.rest)}let r=e.annotation(Ug);if((r==\"full\"||r==\"before\")&&(n=n.isolate()),e.annotation(ee.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let s=Ue.fromTransaction(e),o=e.annotation(ee.time),l=e.annotation(ee.userEvent);return s?n=n.addChanges(s,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(r==\"full\"||r==\"after\")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new ai(n.done.map(Ue.fromJSON),n.undone.map(Ue.fromJSON))}});function Ef(n={}){return[Mf,Xf.of(n),v.domEventHandlers({beforeinput(e,t){let i=e.inputType==\"historyUndo\"?Ir:e.inputType==\"historyRedo\"?xn:null;return i?(e.preventDefault(),i(t)):!1}})]}function Vr(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let r=t.field(Mf,!1);if(!r)return!1;let s=r.pop(n,t,e);return s?(i(s),!0):!1}}var Ir=Vr(0,!1),xn=Vr(1,!1),Hg=Vr(0,!0),Kg=Vr(1,!0);var Ue=class n{constructor(e,t,i,r,s){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new n(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new n(e.changes&&Oe.fromJSON(e.changes),[],e.mapped&&ot.fromJSON(e.mapped),e.startSelection&&x.fromJSON(e.startSelection),e.selectionsAfter.map(x.fromJSON))}static fromTransaction(e,t){let i=De;for(let r of e.startState.facet(Fg)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new n(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,De)}static selection(e){return new n(void 0,De,void 0,void 0,e)}};function Dr(n,e,t,i){let r=e+1>t+20?e-t-1:0,s=n.slice(r,e);return s.push(i),s}function Jg(n,e){let t=[],i=!1;return n.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function e0(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Lf(n,e){return n.length?e.length?n.concat(e):n:e}var De=[],t0=200;function zf(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-t0));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Dr(n,n.length-1,1e9,t.setSelAfter(i)))}else return[Ue.selection([e])]}function i0(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function ml(n,e){if(!n.length)return n;let t=n.length,i=De;for(;t;){let r=n0(n[t-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=n.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,i=r.selectionsAfter}return i.length?[Ue.selection(i)]:De}function n0(n,e,t){let i=Lf(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):De,t);if(!n.changes)return Ue.selection(i);let r=n.changes.map(e),s=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(s):s;return new Ue(r,D.mapEffects(n.effects,e),o,n.startSelection.map(s),i)}var r0=/^(input\\.type|delete)($|\\.)/,ai=class n{constructor(e,t,i=0,r=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new n(this.done,this.undone):this}addChanges(e,t,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||r0.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):Wr(t,e))}function de(n){return n.textDirectionAt(n.state.selection.main.head)==H.LTR}var Yf=n=>jf(n,!de(n)),Df=n=>jf(n,de(n));function Vf(n,e){return He(n,t=>t.empty?n.moveByGroup(t,e):Wr(t,e))}var s0=n=>Vf(n,!de(n)),o0=n=>Vf(n,de(n));var Vk=typeof Intl<\"u\"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:\"word\"}):null;function l0(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Br(n,e,t){let i=z(n).resolveInner(e.head),r=t?E.closedBy:E.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;l0(n,h,r)?i=h:a=t?h.to:h.from}let s=i.type.prop(r),o,l;return s&&(o=t?li(n,i.from,1):li(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,x.cursor(l,t?-1:1)}var a0=n=>He(n,e=>Br(n.state,e,!de(n))),h0=n=>He(n,e=>Br(n.state,e,de(n)));function If(n,e){return He(n,t=>{if(!t.empty)return Wr(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}var Wf=n=>If(n,!1),Bf=n=>If(n,!0);function qf(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):Wr(o,e));if(r.eq(i.selection))return!1;let s;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomNf(n,!1),bl=n=>Nf(n,!0);function _t(n,e,t){let i=n.lineBlockAt(e.head),r=n.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?i.to:i.from)&&(r=n.moveToLineBoundary(e,t,!1)),!t&&r.head==i.from&&i.length){let s=/^\\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=x.cursor(i.from+s))}return r}var c0=n=>He(n,e=>_t(n,e,!0)),f0=n=>He(n,e=>_t(n,e,!1)),u0=n=>He(n,e=>_t(n,e,!de(n))),d0=n=>He(n,e=>_t(n,e,de(n))),p0=n=>He(n,e=>x.cursor(n.lineBlockAt(e.head).from,1)),O0=n=>He(n,e=>x.cursor(n.lineBlockAt(e.head).to,-1));function m0(n,e,t){let i=!1,r=Li(n.selection,s=>{let o=li(n,s.head,-1)||li(n,s.head,1)||s.head>0&&li(n,s.head-1,1)||s.headm0(n,e,!1);function Ve(n,e,t){let i=Li(n.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=e&&(r=x.range(r.head,r.anchor));let s=t(r);return x.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(n.state.selection)?!1:(n.dispatch(Fe(n.state,i)),!0)}function Gf(n,e){return Ve(n,e,t=>n.moveByChar(t,e))}var Uf=n=>Gf(n,!de(n)),Ff=n=>Gf(n,de(n));function Hf(n,e){return Ve(n,e,t=>n.moveByGroup(t,e))}var b0=n=>Hf(n,!de(n)),y0=n=>Hf(n,de(n));var S0=n=>{let e=!de(n);return Ve(n,e,t=>Br(n.state,t,e))},x0=n=>{let e=de(n);return Ve(n,e,t=>Br(n.state,t,e))};function Kf(n,e){return Ve(n,e,t=>n.moveVertically(t,e))}var Jf=n=>Kf(n,!1),eu=n=>Kf(n,!0);function tu(n,e){return Ve(n,e,t=>n.moveVertically(t,e,qf(n).height))}var vf=n=>tu(n,!1),$f=n=>tu(n,!0),k0=n=>Ve(n,!0,e=>_t(n,e,!0)),w0=n=>Ve(n,!1,e=>_t(n,e,!1)),Q0=n=>{let e=!de(n);return Ve(n,e,t=>_t(n,t,e))},v0=n=>{let e=de(n);return Ve(n,e,t=>_t(n,t,e))},$0=n=>Ve(n,!1,e=>x.cursor(n.lineBlockAt(e.head).from)),P0=n=>Ve(n,!0,e=>x.cursor(n.lineBlockAt(e.head).to)),Pf=({state:n,dispatch:e})=>(e(Fe(n,{anchor:0})),!0),Tf=({state:n,dispatch:e})=>(e(Fe(n,{anchor:n.doc.length})),!0),Cf=({state:n,dispatch:e})=>(e(Fe(n,{anchor:n.selection.main.anchor,head:0})),!0),Af=({state:n,dispatch:e})=>(e(Fe(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),T0=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:\"select\"})),!0),C0=({state:n,dispatch:e})=>{let t=qr(n).map(({from:i,to:r})=>x.undirectionalRange(i,Math.min(r+1,n.doc.length)));return e(n.update({selection:x.create(t),userEvent:\"select\"})),!0},A0=({state:n,dispatch:e})=>{let t=Li(n.selection,i=>{let r=z(n),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return x.undirectionalRange(l.from,l.to)}return i});return t.eq(n.selection)?!1:(e(Fe(n,t)),!0)};function iu(n,e){let{state:t}=n,i=t.selection,r=t.selection.ranges.slice();for(let s of t.selection.ranges){let o=t.doc.lineAt(s.head);if(e?o.to0)for(let l=s;;){let a=n.moveVertically(l,e);if(a.heado.to){r.some(h=>h.head==a.head)||r.push(a);break}else{if(a.head==l.head)break;l=a}}}return r.length==i.ranges.length?!1:(n.dispatch(Fe(t,x.create(r,r.length-1))),!0)}var R0=n=>iu(n,!1),Z0=n=>iu(n,!0),X0=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=x.create([t.main]):t.main.empty||(i=x.create([x.cursor(t.main.head)])),i?(e(Fe(n,i)),!0):!1};function kn(n,e){if(n.state.readOnly)return!1;let t=\"delete.selection\",{state:i}=n,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let a=e(s);ao&&(t=\"delete.forward\",a=Yr(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Yr(n,o,!1),l=Yr(n,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:x.cursor(o,or(n)))i.between(e,e,(r,s)=>{re&&(e=t?s:r)});return e}var nu=(n,e,t)=>kn(n,i=>{let r=i.from,{state:s}=n,o=s.doc.lineAt(r),l,a;if(t&&!e&&r>o.from&&rnu(n,!1,!0);var ru=n=>nu(n,!0,!1),su=(n,e)=>kn(n,t=>{let i=t.head,{state:r}=n,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let l=null;;){if(i==(e?s.to:s.from)){i==t.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let a=re(s.text,i-s.from,e)+s.from,h=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),c=o(h);if(l!=null&&c!=l)break;(h!=\" \"||i!=t.head)&&(l=c),i=a}return i}),ou=n=>su(n,!1),M0=n=>su(n,!0);var E0=n=>kn(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headkn(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),z0=n=>kn(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:_.of([\"\",\"\"])},range:x.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:\"input\"})),!0},j0=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let r=i.from,s=n.doc.lineAt(r),o=r==s.from?r-1:re(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:re(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:n.doc.slice(r,l).append(n.doc.slice(o,r))},range:x.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:\"move.character\"})),!0)};function qr(n){let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.from),s=n.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=n.doc.lineAt(i.to-1)),t>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});t=s.number+1}return e}function lu(n,e,t){if(n.readOnly)return!1;let i=[],r=[];for(let s of qr(n)){if(t?s.to==n.doc.length:s.from==0)continue;let o=n.doc.lineAt(t?s.to+1:s.from-1),l=o.length+1;if(t){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+n.lineBreak});for(let a of s.ranges)r.push(x.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:n.lineBreak+o.text});for(let a of s.ranges)r.push(x.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:x.create(r,n.selection.mainIndex),userEvent:\"move.line\"})),!0):!1}var Y0=({state:n,dispatch:e})=>lu(n,e,!1),D0=({state:n,dispatch:e})=>lu(n,e,!0);function au(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of qr(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});let r=n.changes(i);return e(n.update({changes:r,selection:n.selection.map(r,t?1:-1),scrollIntoView:!0,userEvent:\"input.copyline\"})),!0}var V0=({state:n,dispatch:e})=>au(n,e,!1),I0=({state:n,dispatch:e})=>au(n,e,!0),W0=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(qr(e).map(({from:r,to:s})=>(r>0?r--:s{let s;if(n.lineWrapping){let o=n.lineBlockAt(r.head),l=n.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+n.documentTop-l.bottom+n.defaultLineHeight/2)}return n.moveVertically(r,!0,s)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:\"delete.line\"}),!0};function B0(n,e){if(/\\(\\)|\\[\\]|\\{\\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=z(n).resolveInner(e),i=t.childBefore(e),r=t.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(E.closedBy))&&s.indexOf(r.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(r.from).from&&!/\\S/.test(n.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}var Rf=hu(!1),q0=hu(!0);function hu(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:o}=r,l=e.doc.lineAt(s),a=!n&&s==o&&B0(e,s);n&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new oi(e,{simulateBreak:s,simulateDoubleBreak:!!a}),c=pl(h,s);for(c==null&&(c=Pe(/^\\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));ol.from&&s{let r=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,r,i),t=l.number),o=l.to+1}let s=n.changes(r);return{changes:r,range:x.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}var N0=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new oi(n,{overrideIndentation:s=>{let o=t[s];return o??-1}}),r=kl(n,(s,o,l)=>{let a=pl(i,s.from);if(a==null)return;/\\S/.test(s.text)||(a=0);let h=/^\\s*/.exec(s.text)[0],c=yn(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(kl(n,(t,i)=>{i.push({from:t.from,insert:n.facet(zt)})}),{userEvent:\"input.indent\"})),!0),Ql=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(kl(n,(t,i)=>{let r=/^\\s*/.exec(t.text)[0];if(!r)return;let s=Pe(r,n.tabSize),o=0,l=yn(n,Math.max(0,s-bn(n)));for(;o(n.setTabFocusMode(),!0);var U0=[{key:\"Ctrl-b\",run:Yf,shift:Uf,preventDefault:!0},{key:\"Ctrl-f\",run:Df,shift:Ff},{key:\"Ctrl-p\",run:Wf,shift:Jf},{key:\"Ctrl-n\",run:Bf,shift:eu},{key:\"Ctrl-a\",run:p0,shift:$0},{key:\"Ctrl-e\",run:O0,shift:P0},{key:\"Ctrl-d\",run:ru},{key:\"Ctrl-h\",run:yl},{key:\"Ctrl-k\",run:E0},{key:\"Ctrl-Alt-h\",run:ou},{key:\"Ctrl-o\",run:_0},{key:\"Ctrl-t\",run:j0},{key:\"Ctrl-v\",run:bl}],F0=[{key:\"ArrowLeft\",run:Yf,shift:Uf,preventDefault:!0},{key:\"Mod-ArrowLeft\",mac:\"Alt-ArrowLeft\",run:s0,shift:b0,preventDefault:!0},{mac:\"Cmd-ArrowLeft\",run:u0,shift:Q0,preventDefault:!0},{key:\"ArrowRight\",run:Df,shift:Ff,preventDefault:!0},{key:\"Mod-ArrowRight\",mac:\"Alt-ArrowRight\",run:o0,shift:y0,preventDefault:!0},{mac:\"Cmd-ArrowRight\",run:d0,shift:v0,preventDefault:!0},{key:\"ArrowUp\",run:Wf,shift:Jf,preventDefault:!0},{mac:\"Cmd-ArrowUp\",run:Pf,shift:Cf},{mac:\"Ctrl-ArrowUp\",run:Qf,shift:vf},{key:\"ArrowDown\",run:Bf,shift:eu,preventDefault:!0},{mac:\"Cmd-ArrowDown\",run:Tf,shift:Af},{mac:\"Ctrl-ArrowDown\",run:bl,shift:$f},{key:\"PageUp\",run:Qf,shift:vf},{key:\"PageDown\",run:bl,shift:$f},{key:\"Home\",run:f0,shift:w0,preventDefault:!0},{key:\"Mod-Home\",run:Pf,shift:Cf},{key:\"End\",run:c0,shift:k0,preventDefault:!0},{key:\"Mod-End\",run:Tf,shift:Af},{key:\"Enter\",run:Rf,shift:Rf},{key:\"Mod-a\",run:T0},{key:\"Backspace\",run:yl,shift:yl,preventDefault:!0},{key:\"Delete\",run:ru,preventDefault:!0},{key:\"Mod-Backspace\",mac:\"Alt-Backspace\",run:ou,preventDefault:!0},{key:\"Mod-Delete\",mac:\"Alt-Delete\",run:M0,preventDefault:!0},{mac:\"Mod-Backspace\",run:L0,preventDefault:!0},{mac:\"Mod-Delete\",run:z0,preventDefault:!0}].concat(U0.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),cu=[{key:\"Alt-ArrowLeft\",mac:\"Ctrl-ArrowLeft\",run:a0,shift:S0},{key:\"Alt-ArrowRight\",mac:\"Ctrl-ArrowRight\",run:h0,shift:x0},{key:\"Alt-ArrowUp\",run:Y0},{key:\"Shift-Alt-ArrowUp\",run:V0},{key:\"Alt-ArrowDown\",run:D0},{key:\"Shift-Alt-ArrowDown\",run:I0},{key:\"Mod-Alt-ArrowUp\",run:R0},{key:\"Mod-Alt-ArrowDown\",run:Z0},{key:\"Escape\",run:X0},{key:\"Mod-Enter\",run:q0},{key:\"Alt-l\",mac:\"Ctrl-l\",run:C0},{key:\"Mod-i\",run:A0,preventDefault:!0},{key:\"Mod-[\",run:Ql},{key:\"Mod-]\",run:wl},{key:\"Mod-Alt-\\\\\",run:N0},{key:\"Shift-Mod-k\",run:W0},{key:\"Shift-Mod-\\\\\",run:g0},{key:\"Mod-/\",run:Vg},{key:\"Alt-A\",mac:\"Ctrl-A\",run:Wg},{key:\"Ctrl-m\",mac:\"Shift-Alt-m\",run:G0}].concat(F0);var zi=class{constructor(e,t,i,r){this.state=e,this.pos=t,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=z(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),r=t.text.slice(i-t.from,this.pos-t.from),s=r.search(bu(e,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e==\"abort\"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}};function fu(n){let e=Object.keys(n).join(\"\"),t=/\\w/.test(e);return t&&(e=e.replace(/\\w/g,\"\")),`[${t?\"\\\\w\":\"\"}${e.replace(/[^\\w\\s]/g,\"\\\\$&\")}]`}function H0(n){let e=Object.create(null),t=Object.create(null);for(let{label:r}of n){e[r[0]]=!0;for(let s=1;stypeof r==\"string\"?{label:r}:r),[t,i]=e.every(r=>/^\\w+$/.test(r.label))?[/\\w*$/,/\\w+$/]:H0(e);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function gu(n,e){return t=>{for(let i=z(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}var Gr=class{constructor(e,t,i,r){this.completion=e,this.source=t,this.match=i,this.score=r}};function hi(n){return n.selection.main.from}function bu(n,e){var t;let{source:i}=n,r=e&&i[0]!=\"^\",s=i[i.length-1]!=\"$\";return!r&&!s?n:new RegExp(`${r?\"^\":\"\"}(?:${i})${s?\"$\":\"\"}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?\"i\":\"\")}var Ll=fe.define();function K0(n,e,t,i){let{main:r}=n.selection,s=t-r.from,o=i-r.from;return{...n.changeByRange(l=>{if(l!=r&&t!=i&&n.sliceDoc(l.from+s,l.from+o)!=n.sliceDoc(t,i))return{range:l};let a=n.toText(e);return{changes:{from:l.from+s,to:i==r.from?l.to:l.from+o,insert:a},range:x.cursor(l.from+s+a.length)}}),scrollIntoView:!0,userEvent:\"input.complete\"}}var uu=new WeakMap;function J0(n){if(!Array.isArray(n))return n;let e=uu.get(n);return e||uu.set(n,e=El(n)),e}var Ur=D.define(),Qn=D.define(),$l=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(P=dh(w))!=P.toLowerCase()?1:P!=P.toUpperCase()?2:0;(!y||T==1&&g||C==0&&T!=0)&&(t[f]==w||i[f]==w&&(u=!0)?o[f++]=y:o.length&&(b=!1)),C=T,y+=wt(w)}return f==a&&o[0]==0&&b?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(O==e.length?0:-100),[0,O]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[p,O]):f==a?this.result(-100+(u?-200:0)+-700+(b?0:-1100),o,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,i){let r=[],s=0;for(let o of t){let l=o+(this.astral?wt(at(i,o)):1);s&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return this.ret(e-i.length,r)}},Pl=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>\"\",optionClass:()=>\"\",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:eb,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>du(e(i),t(i)),optionClass:(e,t)=>i=>du(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function du(n,e){return n?e?n+\" \"+e:n:e}function eb(n,e,t,i,r,s){let o=n.textDirection==H.RTL,l=o,a=!1,h=\"top\",c,f,u=e.left-r.left,d=r.right-e.right,p=i.right-i.left,O=i.bottom-i.top;if(l&&u=O||y>e.top?c=t.bottom-e.top:(h=\"bottom\",c=e.bottom-t.top)}let g=(e.bottom-e.top)/s.offsetHeight,b=(e.right-e.left)/s.offsetWidth;return{style:`${h}: ${c/g}px; max-width: ${f/b}px`,class:\"cm-completionInfo-\"+(a?o?\"left-narrow\":\"right-narrow\":l?\"left\":\"right\")}}var zl=D.define();function tb(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement(\"div\");return i.classList.add(\"cm-completionIcon\"),t.type&&i.classList.add(...t.type.split(/\\s+/g).map(r=>\"cm-completionIcon-\"+r)),i.setAttribute(\"aria-hidden\",\"true\"),i},position:20}),e.push({render(t,i,r,s){let o=document.createElement(\"span\");o.className=\"cm-completionLabel\";let l=t.displayLabel||t.label,a=0;for(let h=0;ha&&o.appendChild(document.createTextNode(l.slice(a,c)));let u=o.appendChild(document.createElement(\"span\"));u.appendChild(document.createTextNode(l.slice(c,f))),u.className=\"cm-completionMatchedText\",a=f}return at.position-i.position).map(t=>t.render)}function vl(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let r=Math.floor(e/t);return{from:r*t,to:(r+1)*t}}let i=Math.ceil((n-e)/t);return{from:n-i*t,to:n-(i-1)*t}}var Tl=class{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass=\"\";let r=e.state.field(t),{options:s,selected:o}=r.open,l=e.state.facet(se);this.optionContent=tb(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=vl(s.length,o,l.maxRenderedOptions),this.dom=document.createElement(\"div\"),this.dom.className=\"cm-tooltip-autocomplete\",this.updateTooltipClass(e.state),this.dom.addEventListener(\"mousedown\",a=>{let{options:h}=e.state.field(t).open;for(let c=a.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName==\"LI\"&&(f=/-(\\d+)$/.exec(c.id))&&+f[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;c!=null&&(e.dispatch({effects:zl.of(c)}),a.preventDefault())}}),this.dom.addEventListener(\"focusout\",a=>{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(se).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:Qn.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(\"scroll\",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=r){let{options:s,selected:o,disabled:l}=i.open;(!r.open||r.open.options!=s)&&(this.range=vl(s.length,o,e.state.facet(se).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),l!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle(\"cm-tooltip-autocomplete-disabled\",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(\" \"))i&&this.dom.classList.remove(i);for(let i of t.split(\" \"))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected=this.range.to)&&(this.range=vl(t.options.length,t.selected,this.view.state.facet(se).maxRenderedOptions),this.showOptions(t.options,e.id));let i=this.updateSelectedOption(t.selected);if(i){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:s}=r;if(!s)return;let o=typeof s==\"string\"?document.createTextNode(s):s(r);if(!o)return;\"then\"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,r)}).catch(l=>ue(this.view.state,l,\"completion info\")):(this.addInfoPane(o,r),i.setAttribute(\"aria-describedby\",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement(\"div\");if(i.className=\"cm-tooltip cm-completionInfo\",i.id=\"cm-completionInfo-\"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!=\"LI\"||!i.id?r--:r==e?i.hasAttribute(\"aria-selected\")||(i.setAttribute(\"aria-selected\",\"true\"),t=i):i.hasAttribute(\"aria-selected\")&&(i.removeAttribute(\"aria-selected\"),i.removeAttribute(\"aria-describedby\"));return t&&nb(this.list,t),t}measureInfo(){let e=this.dom.querySelector(\"[aria-selected]\");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(s.bottom,t.bottom)-10||r.bottom{o.target==r&&o.preventDefault()});let s=null;for(let o=i.from;oi.from||i.from==0))if(s=u,typeof h!=\"string\"&&h.header)r.appendChild(h.header(h));else{let d=r.appendChild(document.createElement(\"completion-section\"));d.textContent=u}}let c=r.appendChild(document.createElement(\"li\"));c.id=t+\"-\"+o,c.setAttribute(\"role\",\"option\");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&c.appendChild(d)}}return i.from&&r.classList.add(\"cm-completionListIncompleteTop\"),i.tonew Tl(t,n,e)}function nb(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),r=t.height/n.offsetHeight;i.topt.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/r)}function pu(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function rb(n,e){let t=[],i=null,r=null,s=c=>{t.push(c);let{section:f}=c.completion;if(f){i||(i=[]);let u=typeof f==\"string\"?f:f.name;i.some(d=>d.name==u)||i.push(typeof f==\"string\"?{name:u}:f)}},o=e.facet(se);for(let c of n)if(c.hasResult()){let f=c.result.getMatch;if(c.result.filter===!1)for(let u of c.result.options)s(new Gr(u,c.source,f?f(u):[],1e9-t.length));else{let u=e.sliceDoc(c.from,c.to),d,p=o.filterStrict?new Pl(u):new $l(u);for(let O of c.result.options)if(d=p.match(O.label)){let g=O.displayLabel?f?f(O,d.matched):[]:d.matched,b=d.score+(O.boost||0);if(s(new Gr(O,c.source,g,b)),typeof O.section==\"object\"&&O.section.rank===\"dynamic\"){let{name:y}=O.section;r||(r=Object.create(null)),r[y]=Math.max(b,r[y]||-1e9)}}}}if(i){let c=Object.create(null),f=0,u=(d,p)=>(d.rank===\"dynamic\"&&p.rank===\"dynamic\"?r[p.name]-r[d.name]:0)||(typeof d.rank==\"number\"?d.rank:1e9)-(typeof p.rank==\"number\"?p.rank:1e9)||(d.nameu.score-f.score||h(f.completion,u.completion))){let f=c.completion;!a||a.label!=f.label||a.detail!=f.detail||a.type!=null&&f.type!=null&&a.type!=f.type||a.apply!=f.apply||a.boost!=f.boost?l.push(c):pu(c.completion)>pu(a)&&(l[l.length-1]=c),a=c.completion}return l}var Cl=class n{constructor(e,t,i,r,s,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new n(this.options,Ou(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,r,s,o){if(r&&!o&&e.some(h=>h.isPending))return r.setDisabled();let l=rb(e,t);if(!l.length)return r&&e.some(h=>h.isPending)?r.setDisabled():null;let a=t.facet(se).selectOnOpen?0:-1;if(r&&r.selected!=a&&r.selected!=-1){let h=r.options[r.selected].completion;for(let c=0;cc.hasResult()?Math.min(h,c.from):h,1e8),create:cb,above:s.aboveCursor},r?r.timestamp:Date.now(),a,!1)}map(e){return new n(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new n(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},Al=class n{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new n(ab,\"cm-ac-\"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(se),s=(i.override||t.languageDataAt(\"autocomplete\",hi(t)).map(J0)).map(a=>(this.active.find(c=>c.source==a)||new bt(a,this.active.some(c=>c.state!=0)?1:0)).update(e,i));s.length==this.active.length&&s.every((a,h)=>a==this.active[h])&&(s=this.active);let o=this.open,l=e.effects.some(a=>a.is(_l));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!sb(s,this.active)||l?o=Cl.build(s,t,this.id,o,i,l):o&&o.disabled&&!s.some(a=>a.isPending)&&(o=null),!o&&s.every(a=>!a.isPending)&&s.some(a=>a.hasResult())&&(s=s.map(a=>a.hasResult()?new bt(a.source,0):a));for(let a of e.effects)a.is(zl)&&(o=o&&o.setSelected(a.value,this.id));return s==this.active&&o==this.open?this:new n(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?ob:lb}};function sb(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t[\"aria-activedescendant\"]=n+\"-\"+e),t}var ab=[];function yu(n,e){if(n.isUserEvent(\"input.complete\")){let i=n.annotation(Ll);if(i&&e.activateOnCompletion(i))return 12}let t=n.isUserEvent(\"input.type\");return t&&e.activateOnTyping?5:t?1:n.isUserEvent(\"delete.backward\")?2:n.selection?8:n.docChanged?16:0}var bt=class n{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let i=yu(e,t),r=this;(i&8||i&16&&this.touches(e))&&(r=new n(r.source,0)),i&4&&r.state==0&&(r=new n(this.source,1)),r=r.updateFor(e,i);for(let s of e.effects)if(s.is(Ur))r=new n(r.source,1,s.value);else if(s.is(Qn))r=new n(r.source,0);else if(s.is(_l))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(hi(e.state))}},Fr=class n extends bt{constructor(e,t,i,r,s,o){super(e,3,t),this.limit=i,this.result=r,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,t){var i;if(!(t&3))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=hi(e.state);if(l>o||!r||t&2&&(hi(e.startState)==this.from||lt.map(e))}}),ve=ae.define({create(){return Al.start()},update(n,e){return n.update(e)},provide:n=>[Pr.from(n,e=>e.tooltip),v.contentAttributes.from(n,e=>e.attrs)]});function jl(n,e){let t=e.completion.apply||e.completion.label,i=n.state.field(ve).active.find(r=>r.source==e.source);return i instanceof Fr?(typeof t==\"string\"?n.dispatch({...K0(n.state,t,i.from,i.to),annotations:Ll.of(e.completion)}):t(n,e.completion,i.from,i.to),!0):!1}var cb=ib(ve,jl);function Nr(n,e=\"option\"){return t=>{let i=t.state.field(ve,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(n?1:-1):n?0:o-1;return l<0?l=e==\"page\"?0:o-1:l>=o&&(l=e==\"page\"?o-1:0),t.dispatch({effects:zl.of(l)}),!0}}var fb=n=>{let e=n.state.field(ve,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(ve,!1)?(n.dispatch({effects:Ur.of(!0)}),!0):!1,ub=n=>{let e=n.state.field(ve,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Qn.of(null)}),!0)},Rl=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},db=50,pb=1e3,Ob=ke.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(ve).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(ve),t=n.state.facet(se);if(!n.selectionSet&&!n.docChanged&&n.startState.field(ve)==e)return;let i=n.transactions.some(s=>{let o=yu(s,t);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;sdb&&Date.now()-o.time>pb){for(let l of o.context.abortListeners)try{l()}catch(a){ue(this.view.state,a)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(s=>s.effects.some(o=>o.is(Ur)))&&(this.pendingStart=!0);let r=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of n.transactions)s.isUserEvent(\"input.type\")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(ve);for(let t of e.active)t.isPending&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(se).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=hi(e),i=new zi(e,t,n.explicit,this.view),r=new Rl(n,i);this.running.push(r),Promise.resolve(n.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:Qn.of(null)}),ue(this.view.state,s)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(se).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(se),i=this.view.state.field(ve);for(let r=0;rl.source==s.active.source);if(o&&o.isPending)if(s.done==null){let l=new bt(s.active.source,0);for(let a of s.updates)l=l.update(a,t);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:_l.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(ve,!1);if(e&&e.tooltip&&this.view.state.facet(se).closeOnBlur){let t=e.open&&Vo(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Qn.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Ur.of(!1)}),20),this.composing=0}}}),mb=typeof navigator==\"object\"&&/Win/.test(navigator.platform),gb=Ee.highest(v.domEventHandlers({keydown(n,e){let t=e.state.field(ve,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(mb&&n.altKey)||n.metaKey)return!1;let i=t.open.options[t.open.selected],r=t.active.find(o=>o.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(n.key)>-1&&jl(e,i),!1}})),Su=v.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\",height:\"100%\",listStyle:\"none\",margin:0,padding:0,\"& > li, & > completion-section\":{padding:\"1px 3px\",lineHeight:1.2},\"& > li\":{overflowX:\"hidden\",textOverflow:\"ellipsis\",cursor:\"pointer\"},\"& > completion-section\":{display:\"list-item\",borderBottom:\"1px solid silver\",paddingLeft:\"0.5em\",opacity:.7}}},\"&light .cm-tooltip-autocomplete ul li[aria-selected]\":{background:\"#17c\",color:\"white\"},\"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]\":{background:\"#777\"},\"&dark .cm-tooltip-autocomplete ul li[aria-selected]\":{background:\"#347\",color:\"white\"},\"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]\":{background:\"#444\"},\".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after\":{content:'\"\\xB7\\xB7\\xB7\"',opacity:.5,display:\"block\",textAlign:\"center\",cursor:\"pointer\"},\".cm-tooltip.cm-completionInfo\":{position:\"absolute\",padding:\"3px 9px\",width:\"max-content\",maxWidth:\"400px\",boxSizing:\"border-box\",whiteSpace:\"pre-line\"},\".cm-completionInfo.cm-completionInfo-left\":{right:\"100%\"},\".cm-completionInfo.cm-completionInfo-right\":{left:\"100%\"},\".cm-completionInfo.cm-completionInfo-left-narrow\":{right:\"30px\"},\".cm-completionInfo.cm-completionInfo-right-narrow\":{left:\"30px\"},\"&light .cm-snippetField\":{backgroundColor:\"#00000022\"},\"&dark .cm-snippetField\":{backgroundColor:\"#ffffff22\"},\".cm-snippetFieldPosition\":{verticalAlign:\"text-top\",width:0,height:\"1.15em\",display:\"inline-block\",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\",boxSizing:\"content-box\"},\".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\"}}}),Zl=class{constructor(e,t,i,r){this.field=e,this.line=t,this.from=i,this.to=r}},Xl=class n{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,ne.TrackDel),i=e.mapPos(this.to,1,ne.TrackDel);return t==null||i==null?null:new n(this.field,t,i)}},Ml=class n{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],r=[t],s=e.doc.lineAt(t),o=/^\\s*/.exec(s.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\\t*/.exec(a)[0].length;for(let f=0;fnew Xl(a.field,r[a.line]+a.from,r[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],r=[],s;for(let o of e.split(/\\r\\n?|\\n/)){for(;s=/[#$]\\{(?:(\\d+)(?::([^{}]*))?|((?:\\\\[{}]|[^{}])*))\\}/.exec(o);){let l=s[1]?+s[1]:null,a=s[2]||s[3]||\"\",h=-1;l===0&&(l=1e9);let c=a.replace(/\\\\[{}]/g,f=>f[1]);for(let f=0;f=h&&u.field++}for(let f of r)if(f.line==i.length&&f.from>s.index){let u=s[2]?3+(s[1]||\"\").length:2;f.from-=u,f.to-=u}r.push(new Zl(h,i.length,s.index,s.index+c.length)),o=o.slice(0,s.index)+a+o.slice(s.index+s[0].length)}o=o.replace(/\\\\([{}])/g,(l,a,h)=>{for(let c of r)c.line==i.length&&c.from>h&&(c.from--,c.to--);return a}),i.push(o)}return new n(i,r)}},bb=L.widget({widget:new class extends he{toDOM(){let n=document.createElement(\"span\");return n.className=\"cm-snippetFieldPosition\",n}ignoreEvent(){return!1}}}),yb=L.mark({class:\"cm-snippetField\"}),_i=class n{constructor(e,t){this.ranges=e,this.active=t,this.deco=L.set(e.map(i=>(i.from==i.to?bb:yb).range(i.from,i.to)),!0)}map(e){let t=[];for(let i of this.ranges){let r=i.map(e);if(!r)return null;t.push(r)}return new n(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}},$n=D.define({map(n,e){return n&&n.map(e)}}),Sb=D.define(),vn=ae.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is($n))return t.value;if(t.is(Sb)&&n)return new _i(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>v.decorations.from(n,e=>e?e.deco:L.none)});function Yl(n,e){return x.create(n.filter(t=>t.field==e).map(t=>x.range(t.from,t.to)))}function xb(n){let e=Ml.parse(n);return(t,i,r,s)=>{let{text:o,ranges:l}=e.instantiate(t.state,r),{main:a}=t.state.selection,h={changes:{from:r,to:s==a.from?a.to:s,insert:_.of(o)},scrollIntoView:!0,annotations:i?[Ll.of(i),ee.userEvent.of(\"input.complete\")]:void 0};if(l.length&&(h.selection=Yl(l,0)),l.some(c=>c.field>0)){let c=new _i(l,0),f=h.effects=[$n.of(c)];t.state.field(vn,!1)===void 0&&f.push(D.appendConfig.of([vn,$b,Pb,Su]))}t.dispatch(t.state.update(h))}}function xu(n){return({state:e,dispatch:t})=>{let i=e.field(vn,!1);if(!i||n<0&&i.active==0)return!1;let r=i.active+n,s=n>0&&!i.ranges.some(o=>o.field==r+n);return t(e.update({selection:Yl(i.ranges,r),effects:$n.of(s?null:new _i(i.ranges,r)),scrollIntoView:!0})),!0}}var kb=({state:n,dispatch:e})=>n.field(vn,!1)?(e(n.update({effects:$n.of(null)})),!0):!1,wb=xu(1),Qb=xu(-1);var vb=[{key:\"Tab\",run:wb,shift:Qb},{key:\"Escape\",run:kb}],mu=R.define({combine(n){return n.length?n[0]:vb}}),$b=Ee.highest(Tt.compute([mu],n=>n.facet(mu)));function ye(n,e){return{...e,apply:xb(n)}}var Pb=v.domEventHandlers({mousedown(n,e){let t=e.state.field(vn,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==t.active?!1:(e.dispatch({selection:Yl(t.ranges,r.field),effects:$n.of(t.ranges.some(s=>s.field>r.field)?new _i(t.ranges,r.field):null),scrollIntoView:!0}),!0)}});var ku=new class extends Me{};ku.startSide=1;ku.endSide=-1;var Nk=typeof navigator==\"object\"&&/Android\\b/.test(navigator.userAgent);function wu(n={}){return[gb,ve,se.of(n),Ob,Cb,Su]}var Tb=[{key:\"Ctrl-Space\",run:wn},{mac:\"Alt-`\",run:wn},{mac:\"Alt-i\",run:wn},{key:\"Escape\",run:ub},{key:\"ArrowDown\",run:Nr(!0)},{key:\"ArrowUp\",run:Nr(!1)},{key:\"PageDown\",run:Nr(!0,\"page\")},{key:\"PageUp\",run:Nr(!1,\"page\")},{key:\"Enter\",run:fb}],Cb=Ee.highest(Tt.computeN([se],n=>n.facet(se).defaultKeymap?[Tb]:[]));var jt=\"form\",Dl=new Map([[\"line\",{multiline:!1,needsMax:!0}],[\"text\",{multiline:!0,needsMax:!0}],[\"select\",{multiline:!1,needsMax:!1}],[\"number\",{multiline:!1,needsMax:!1}],[\"date\",{multiline:!1,needsMax:!1}],[\"checkbox\",{multiline:!1,needsMax:!1}]]),Qu=new Set([\"id\",\"responses\",\"layout\",\"submit\",\"edit_own\",\"show_responses\",\"votes\",\"fields\"]),vu=new Set([\"name\",\"type\",\"max\",\"min\",\"required\",\"options\"]),Ab=new Set([\"table\",\"sections\"]),Rb=new Set([\"member\",\"editor\",\"owner\"]),Zb=new Set([\"named\",\"off\"]),Xb=new Set([\"id\",\"by\",\"at\",\"votes\"]),$u=24,Pu=24,Tu=64,Mb=500,Eb=2e4,Lb=/^[a-z0-9][a-z0-9-]{0,39}$/,zb=/^[a-z][a-z0-9_]{0,31}$/,_b=/^\\d{4}-\\d{2}-\\d{2}$/,Zu=/^r-[0-9a-f]{8}$/;function Xu(n){if(typeof n!=\"string\"||!n.includes(jt))return[];let e=n.split(`\n`),t=[],i=null,r=!1,s=[],o=0;for(let l=0;l=i.length){r&&t.push({...jb(s),line:o+1}),i=null,r=!1,s=[];continue}r&&s.push(a)}return i!==null&&r&&t.push({error:\"the form block is never closed\",line:o+1}),t}function jb(n){let e=new Map,t=[],i=!1;for(let r=0;r{for(;r=t.length));){let o=r;for(;rDb(f.trim())).filter(f=>f!==\"\"),a.some(f=>f===null))return{error:`the list after \"${l}\" has an unclosed quote`}}else if(t[r]==='\"'){let h=Mu(t,r);if(!h)return{error:`the value of \"${l}\" has an unclosed quote`};a=h.value,r=h.next}else{let h=r;for(;r$u)return{error:`a form takes at most ${$u} fields`};let h=[],c=new Set;for(let f of e){let u=Ib(f);if(u.error)return u;if(c.has(u.name))return{error:`two fields are called \"${u.name}\"`};c.add(u.name),h.push(u)}return{config:{id:t,responses:i,layout:r,submit:s,edit_own:o,show_responses:l,votes:a,fields:h}}}function Ib(n){for(let s of n.keys())if(!vu.has(s))return{error:`unknown key \"${s}\" (accepted: ${[...vu].join(\", \")})`};let e=n.get(\"name\");if(typeof e!=\"string\"||!e)return{error:'\"name\" is required'};if(!zb.test(e))return{error:`\"${e}\" must be lowercase letters, digits and underscores, starting with a letter`};if(Xb.has(e))return{error:`\"${e}\" is a column this gateway writes; choose another name`};let t=n.get(\"type\");if(typeof t!=\"string\"||!Dl.has(t))return{error:`\"${e}\": type must be one of ${[...Dl.keys()].join(\", \")}`};let i=Dl.get(t),r={name:e,type:t,required:!1};if(n.has(\"required\")){let s=Hr(n.get(\"required\"));if(s===null)return{error:`\"${e}\": required must be true or false`};r.required=s}if(i.needsMax){if(!n.has(\"max\"))return{error:`\"${e}\": a ${t} field needs max, so a submission cannot be unbounded`};let s=Number(n.get(\"max\")),o=t===\"text\"?Eb:Mb;if(!Number.isInteger(s)||s<1||s>o)return{error:`\"${e}\": max must be a whole number from 1 to ${o}`};r.max=s}else if(n.has(\"max\")&&t!==\"number\")return{error:`\"${e}\": max applies to line, text and number fields only`};if(t===\"select\"){let s=n.get(\"options\");if(!Array.isArray(s)||!s.length)return{error:`\"${e}\": a select field needs options: [a, b, \\u2026]`};if(s.length>Pu)return{error:`\"${e}\": at most ${Pu} options`};if(s.some(o=>o.length>Tu))return{error:`\"${e}\": an option may be at most ${Tu} characters`};if(s.some(o=>/[\\r\\n|]/.test(o)))return{error:`\"${e}\": an option may not contain a newline or a pipe`};if(new Set(s).size!==s.length)return{error:`\"${e}\": two options are the same`};r.options=s}else if(n.has(\"options\"))return{error:`\"${e}\": options applies to a select field only`};if(t===\"number\"){for(let s of[\"min\",\"max\"]){if(!n.has(s))continue;let o=Number(n.get(s));if(!Number.isFinite(o))return{error:`\"${e}\": ${s} must be a number`};r[s]=o}if(r.min!==void 0&&r.max!==void 0&&r.min>r.max)return{error:`\"${e}\": min is greater than max`}}else if(n.has(\"min\"))return{error:`\"${e}\": min applies to a number field only`};return r}function Hr(n){return n===!0||n===\"true\"?!0:n===!1||n===\"false\"?!1:null}function Eu(n,e){if(e===null||typeof e!=\"object\"||Array.isArray(e))return{error:\"values must be an object of field names to answers\"};let t=new Set(n.fields.map(r=>r.name));for(let r of Object.keys(e))if(!t.has(r))return{error:`there is no field called \"${r}\" on this form`};let i={};for(let r of n.fields){let s=e[r.name];if(s==null||s===\"\"){if(r.required)return{error:`\"${r.name}\" is required`};i[r.name]=\"\";continue}let l=Wb(r,s);if(l.error)return l;i[r.name]=l.value}return{values:i}}function Wb(n,e){switch(n.type){case\"checkbox\":{let t=Hr(typeof e==\"string\"?e.toLowerCase():e);return t===null?{error:`\"${n.name}\" must be true or false`}:{value:t?\"yes\":\"no\"}}case\"number\":{let t=typeof e==\"number\"?e:Number(String(e).trim());return Number.isFinite(t)?n.min!==void 0&&tn.max?{error:`\"${n.name}\" must be at most ${n.max}`}:{value:String(t)}:{error:`\"${n.name}\" must be a number`}}case\"date\":{let t=String(e).trim();return!_b.test(t)||Number.isNaN(Date.parse(`${t}T00:00:00Z`))?{error:`\"${n.name}\" must be a date like 2026-09-12`}:{value:t}}case\"select\":{let t=String(e).trim();return n.options.includes(t)?{value:t}:{error:`\"${n.name}\" must be one of: ${n.options.join(\", \")}`}}case\"line\":{if(typeof e!=\"string\")return{error:`\"${n.name}\" must be text`};let t=e.trim();return/[\\r\\n]/.test(t)?{error:`\"${n.name}\" must be a single line`}:Cu(t)?{error:`\"${n.name}\" contains a control character`}:[...t].length>n.max?{error:`\"${n.name}\" is longer than ${n.max} characters`}:{value:t}}case\"text\":{if(typeof e!=\"string\")return{error:`\"${n.name}\" must be text`};let t=e.replace(/\\r\\n?/g,`\n`).trim();return Cu(t.replace(/\\n/g,\"\"))?{error:`\"${n.name}\" contains a control character`}:[...t].length>n.max?{error:`\"${n.name}\" is longer than ${n.max} characters`}:{value:t}}default:return{error:`\"${n.name}\" has an unknown type`}}}function Cu(n){for(let e of n){let t=e.codePointAt(0);if(t<32||t===127)return!0}return!1}var Bb=/^$/;function qb(n){let e=[\"Id\",\"By\",\"At\",...n.fields.map(t=>t.name)];return n.votes===\"named\"&&e.push(\"Votes\"),e}var Nb=/\\\\\\\\|\\\\\\||
|<|>|&/g,Gb=new Map([[\"\\\\\\\\\",\"\\\\\"],[\"\\\\|\",\"|\"],[\"
\",`\n`],[\"<\",\"<\"],[\">\",\">\"],[\"&\",\"&\"]]);function Pn(n){return n.replace(Nb,e=>Gb.get(e))}function Au(n){return n.split(`\n`).map(e=>/^\\\\+(?:#{1,6}\\s|\\*\\*|-\\s+\\*\\*)/.test(e)?e.slice(1):e).join(`\n`)}function Lu(n,e){if(typeof n!=\"string\")return{error:\"the response file is unreadable\"};let t=n.split(`\n`),i=Bb.exec((t[0]||\"\").trim());if(!i)return{error:\"that file is not a form response file\"};if(i[1]!==e.id)return{error:`that response file belongs to form \"${i[1]}\"`};if(i[2]!==e.layout)return{error:`that response file is laid out as ${i[2]} and the form now says ${e.layout}. Point the form at a new response file; the existing answers are not rewritten.`};let r=t.slice(1);return e.layout===\"table\"?Hb(r,e):Kb(r,e)}var Ub=\"this response file holds text outside its table, and a response is written by rewriting the whole file \\u2014 that text cannot be reproduced, so nothing has been written. Move the notes to the form's own note, or point the form at a response file holding only the table.\",Fb=\"this response file holds text before its first response, and a response is written by rewriting the whole file \\u2014 that text cannot be reproduced, so nothing has been written. Move the notes to the form's own note, or point the form at a response file holding only the responses.\";function Hb(n,e){let t=qb(e),i=n.map(a=>a.trim());if(i.find(a=>a!==\"\"&&!a.startsWith(\"|\"))!==void 0)return{error:Ub};let s=i.filter(a=>a.startsWith(\"|\"));if(!s.length)return{error:\"the response file has lost its table header\"};let o=Ru(s[0]);if(o.length!==t.length||o.some((a,h)=>a!==t[h]))return{error:\"the response table's columns no longer match the form\"};let l=[];for(let a of s.slice(2)){let h=Ru(a);if(h.length!==t.length)return{error:\"a response row has the wrong number of columns\"};let[c,f,u]=h;if(!Zu.test(c))return{error:`\"${c}\" is not a response id`};let d={};e.fields.forEach((O,g)=>{d[O.name]=Pn(h[3+g])});let p=e.votes===\"named\"?zu(Pn(h[t.length-1])):[];l.push({id:c,by:f,at:u,values:d,votes:p})}return{responses:l}}function Ru(n){let e=[],t=\"\";for(let i=0;ii.trim())}function Kb(n,e){let t=[],i=null,r=null,s=new Map(e.fields.map(a=>[a.name,a])),o=()=>{i&&(r&&(i.values[r.name]=Au(r.lines.join(`\n`).trim()),r=null),t.push(i),i=null)},l=()=>{r&&(i.values[r.name]=Au(r.lines.join(`\n`).trim()),r=null)};for(let a of n){if(/^##\\s+(\\S+)\\s+·\\s+(\\S+)\\s+·\\s+(\\S+)\\s*$/.test(a))break;if(a.trim()!==\"\")return{error:Fb}}for(let a of n){let h=/^##\\s+(\\S+)\\s+·\\s+(\\S+)\\s+·\\s+(\\S+)\\s*$/.exec(a);if(h&&!Vl(a)){if(o(),!Zu.test(h[1]))return{error:`\"${h[1]}\" is not a response id`};i={id:h[1],by:h[2],at:h[3],values:Object.fromEntries(e.fields.map(d=>[d.name,\"\"])),votes:[]};continue}if(!i)continue;let c=/^-\\s+\\*\\*([a-z][a-z0-9_]*):\\*\\*\\s*(.*)$/.exec(a);if(c&&s.has(c[1])&&s.get(c[1]).type!==\"text\"){l(),i.values[c[1]]=c[2]===\"\\u2014\"?\"\":c[2];continue}let f=/^\\*\\*Votes:\\*\\*\\s*(.*)$/.exec(a);if(f&&!Vl(a)){l(),i.votes=e.votes===\"named\"?zu(f[1]):[];continue}let u=/^\\*\\*([a-z][a-z0-9_]*):\\*\\*\\s*$/.exec(a);if(u&&s.has(u[1])&&s.get(u[1]).type===\"text\"&&!Vl(a)){l(),r={name:u[1],lines:[]};continue}r&&r.lines.push(a)}return o(),{responses:t}}function Vl(n){return n.startsWith(\"\\\\\")}function zu(n){let e=n.trim();return!e||e===\"\\u2014\"?[]:e.split(\",\").map(t=>t.trim()).filter(Boolean)}var Jr=R.define({combine:n=>n.length>0?n[0]:null});function Jb(n,e){let t=e.getChild(\"CodeInfo\");if(t===null)return null;let i=n.sliceString(t.from,t.to).trim().split(/\\s+/)[0];return i===void 0||i===\"\"?null:i.toLowerCase()}function _u(n,e=0){if(!n.readOnly)return[];let t=[];return z(n).iterate({from:0,to:n.doc.length,enter(i){if(i.from{a.textContent=d,a.classList.toggle(\"cm-lp-form-status-ok\",p===\"ok\"),a.classList.toggle(\"cm-lp-form-status-bad\",p===\"bad\"),a.classList.toggle(\"cm-lp-form-status-quiet\",p===\"quiet\")},c=null,f=d=>{c=d.id;for(let p of i.fields){let O=r.get(p.name);if(O===void 0)continue;let g=d.values[p.name]??\"\";O instanceof HTMLInputElement&&O.type===\"checkbox\"?O.checked=g===\"true\":(O.value=g,O.dispatchEvent(new Event(\"input\"))),O.disabled=!1}l.disabled=!1,l.textContent=\"Save changes\",h(\"Editing your response.\",\"quiet\"),r.values().next().value?.focus()},u=this.drawResponses(t,i,f);return this.host===null?(l.disabled=!0,h(\"This preview can\\u2019t send responses.\",\"quiet\"),t):(l.addEventListener(\"click\",()=>{let d=this.host?.current??null;if(d===null){h(\"This preview can\\u2019t send responses.\",\"quiet\");return}let p=ty(i,r),O=Eu(i,iy(p));if(O.error!==void 0){h(O.error,\"bad\");return}let g=c,b=g===null?d.submit({formId:i.id,values:p}):d.update?.({formId:i.id,responseId:g,values:p})??Promise.resolve({ok:!1,message:\"Editing is unavailable here.\"});l.disabled=!0,h(g===null?\"Sending\\u2026\":\"Saving\\u2026\",\"quiet\"),b.then(y=>{if(h(y.message,y.ok?\"ok\":\"bad\"),!y.ok){l.disabled=!1;return}c=null,l.textContent=\"Submit\";for(let[,S]of r)S instanceof HTMLInputElement&&S.type===\"checkbox\"?S.checked=!1:S.value=\"\",S.disabled=!0;u()}).catch(y=>{l.disabled=!1,h(y instanceof Error?y.message:\"That didn\\u2019t send.\",\"bad\")})}),t)}drawHead(t){let i=Y(\"div\",\"cm-lp-form-head\");i.append(Y(\"span\",\"cm-lp-form-kind\",`Form \\xB7 ${t.id}`));let r=Y(\"span\",\"cm-lp-form-dest\",\"Answers go to \");return r.append(Y(\"span\",\"cm-lp-form-dest-path\",t.responses)),i.append(r),i}drawResponses(t,i,r){if(!i.show_responses)return async()=>{};let s=Y(\"div\",\"cm-lp-form-responses\"),o=this.host,l=0,a=async()=>{let h=++l,c=o?.current??null;if(c?.readResponses===void 0){s.remove();return}let f;try{f=await c.readResponses(i.responses)}catch{h===l&&s.remove();return}if(h!==l)return;if(!f.ok||f.text===void 0){s.remove();return}let u=Lu(f.text,i);if(s.replaceChildren(Y(\"div\",\"cm-lp-form-responses-title\",\"Responses\")),u.error!==void 0||u.responses===void 0){s.append(Y(\"div\",\"cm-lp-form-responses-status\",`Responses can\\u2019t be displayed: ${u.error??\"the response file is unreadable\"}.`));return}if(u.responses.length===0){s.append(Y(\"div\",\"cm-lp-form-responses-status\",\"No responses yet.\"));return}s.append(this.responsesTable(i,u.responses,a,r))};return o?.current?.readResponses!==void 0&&(s.append(Y(\"div\",\"cm-lp-form-responses-status\",\"Loading responses\\u2026\")),t.append(s),a()),a}responsesTable(t,i,r,s){let o=Y(\"div\",\"cm-lp-form-responses-scroll\"),l=document.createElement(\"table\");l.className=\"cm-lp-form-responses-table\";let a=document.createElement(\"thead\"),h=document.createElement(\"tr\");for(let f of[...t.fields.map(u=>u.name.replace(/_/g,\" \")),\"By\",\"At\"])h.append(Y(\"th\",\"\",f));t.votes===\"named\"&&h.append(Y(\"th\",\"\",\"Votes\")),t.edit_own&&h.append(Y(\"th\",\"\",\"Actions\")),a.append(h),l.append(a);let c=document.createElement(\"tbody\");for(let f of i){let u=document.createElement(\"tr\");for(let d of t.fields)u.append(Y(\"td\",\"\",f.values[d.name]??\"\"));if(u.append(Y(\"td\",\"\",f.by),Y(\"td\",\"\",f.at)),t.votes===\"named\"){let d=document.createElement(\"td\"),p=Y(\"div\",\"cm-lp-form-voters\",f.votes.length===0?\"No votes\":f.votes.join(\", \"));if(d.append(p),this.host?.current?.vote!==void 0){let g=Y(\"div\",\"cm-lp-form-vote-controls\"),b=Y(\"button\",\"cm-lp-form-vote\",\"Upvote\"),y=Y(\"button\",\"cm-lp-form-vote cm-lp-form-vote-remove\",\"Remove vote\");b.type=y.type=\"button\";let S=async C=>{b.disabled=y.disabled=!0;let w=await(this.host?.current?.vote?.({formId:t.id,responseId:f.id,vote:C})??Promise.resolve({ok:!1,message:\"Voting is unavailable.\"}));w.ok?await r():(p.textContent=w.message,b.disabled=y.disabled=!1)};b.addEventListener(\"click\",()=>void S(\"up\")),y.addEventListener(\"click\",()=>void S(\"none\")),g.append(b,y),d.append(g)}u.append(d)}if(t.edit_own){let d=document.createElement(\"td\"),p=Y(\"div\",\"cm-lp-form-response-controls\");if(this.host?.current?.update!==void 0){let g=Y(\"button\",\"cm-lp-form-response-action cm-lp-form-edit\",\"Edit\");g.type=\"button\",g.addEventListener(\"click\",()=>s(f)),p.append(g)}let O=this.host?.current?.retract;if(O!==void 0){let g=Y(\"button\",\"cm-lp-form-response-action cm-lp-form-delete\",\"Delete\");g.type=\"button\";let b=!1;g.addEventListener(\"click\",()=>{if(!b){b=!0,g.textContent=\"Confirm delete\";return}g.disabled=!0,O({formId:t.id,responseId:f.id}).then(y=>{y.ok?r():(g.disabled=!1,g.textContent=y.message)}).catch(y=>{g.disabled=!1,g.textContent=y instanceof Error?y.message:\"That response wasn\\u2019t deleted.\"})}),p.append(g)}d.append(p),u.append(d)}c.append(u)}return l.append(c),o.append(l),o}drawField(t,i,r){let s=Y(\"div\",\"cm-lp-form-row\"),o=`cm-form-${i.id}-${t.name}`,l=Y(\"div\",\"cm-lp-form-top\"),a=Y(\"label\",\"cm-lp-form-label\");if(a.htmlFor=o,a.textContent=t.name.replace(/_/g,\" \"),t.required){let c=Y(\"span\",\"cm-lp-form-required\",\"\\xB7 required\");a.append(\" \",c)}l.append(a),s.append(l);let h=ny(t);if(h.id=o,h.className=\"cm-lp-form-input\",t.required&&h.setAttribute(\"aria-required\",\"true\"),r.set(t.name,h),s.append(h),(t.type===\"line\"||t.type===\"text\")&&t.max!==void 0){let c=Y(\"div\",\"cm-lp-form-count\",`0 / ${t.max}`),f=()=>{c.textContent=`${[...h.value].length} / ${t.max}`};h.addEventListener(\"input\",f),l.append(c)}return s}};function ny(n){switch(n.type){case\"text\":{let e=document.createElement(\"textarea\");return e.rows=4,n.max!==void 0&&(e.maxLength=n.max),e}case\"select\":{let e=document.createElement(\"select\");n.required||e.append(new Option(\"\\u2014\",\"\"));for(let t of n.options??[])e.append(new Option(t,t));return e}case\"checkbox\":{let e=document.createElement(\"input\");return e.type=\"checkbox\",e}case\"number\":{let e=document.createElement(\"input\");return e.type=\"number\",n.min!==void 0&&(e.min=String(n.min)),n.max!==void 0&&(e.max=String(n.max)),e}case\"date\":{let e=document.createElement(\"input\");return e.type=\"date\",e}default:{let e=document.createElement(\"input\");return e.type=\"text\",n.max!==void 0&&(e.maxLength=n.max),e}}}var is=class n{static create(e,t,i,r,s){let o=r+(r<<8)+e+(t<<4)|0;return new n(e,t,i,o,s,[],[])}constructor(e,t,i,r,s,o,l){this.type=e,this.value=t,this.from=i,this.hash=r,this.end=s,this.children=o,this.positions=l,this.hashProp=[[E.contextHash,r]]}addChild(e,t){e.prop(E.contextHash)!=this.hash&&(e=new W(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let i=this.children.length-1;return i>=0&&(t=Math.max(t,this.positions[i]+this.children[i].length+this.from)),new W(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(r,s,o)=>new W(te.none,r,s,o,this.hashProp)})}},k;(function(n){n[n.Document=1]=\"Document\",n[n.CodeBlock=2]=\"CodeBlock\",n[n.FencedCode=3]=\"FencedCode\",n[n.Blockquote=4]=\"Blockquote\",n[n.HorizontalRule=5]=\"HorizontalRule\",n[n.BulletList=6]=\"BulletList\",n[n.OrderedList=7]=\"OrderedList\",n[n.ListItem=8]=\"ListItem\",n[n.ATXHeading1=9]=\"ATXHeading1\",n[n.ATXHeading2=10]=\"ATXHeading2\",n[n.ATXHeading3=11]=\"ATXHeading3\",n[n.ATXHeading4=12]=\"ATXHeading4\",n[n.ATXHeading5=13]=\"ATXHeading5\",n[n.ATXHeading6=14]=\"ATXHeading6\",n[n.SetextHeading1=15]=\"SetextHeading1\",n[n.SetextHeading2=16]=\"SetextHeading2\",n[n.HTMLBlock=17]=\"HTMLBlock\",n[n.LinkReference=18]=\"LinkReference\",n[n.Paragraph=19]=\"Paragraph\",n[n.CommentBlock=20]=\"CommentBlock\",n[n.ProcessingInstructionBlock=21]=\"ProcessingInstructionBlock\",n[n.Escape=22]=\"Escape\",n[n.Entity=23]=\"Entity\",n[n.HardBreak=24]=\"HardBreak\",n[n.Emphasis=25]=\"Emphasis\",n[n.StrongEmphasis=26]=\"StrongEmphasis\",n[n.Link=27]=\"Link\",n[n.Image=28]=\"Image\",n[n.InlineCode=29]=\"InlineCode\",n[n.HTMLTag=30]=\"HTMLTag\",n[n.Comment=31]=\"Comment\",n[n.ProcessingInstruction=32]=\"ProcessingInstruction\",n[n.Autolink=33]=\"Autolink\",n[n.HeaderMark=34]=\"HeaderMark\",n[n.QuoteMark=35]=\"QuoteMark\",n[n.ListMark=36]=\"ListMark\",n[n.LinkMark=37]=\"LinkMark\",n[n.EmphasisMark=38]=\"EmphasisMark\",n[n.CodeMark=39]=\"CodeMark\",n[n.CodeText=40]=\"CodeText\",n[n.CodeInfo=41]=\"CodeInfo\",n[n.LinkTitle=42]=\"LinkTitle\",n[n.LinkLabel=43]=\"LinkLabel\",n[n.URL=44]=\"URL\"})(k||(k={}));var Bl=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},ql=class{constructor(){this.text=\"\",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return Cn(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,i=0){for(let r=t;r=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let i=(n.type==k.OrderedList?ra:na)(t,e,!1);return i>0&&(n.type!=k.BulletList||ia(t,e,!1)<0)&&t.text.charCodeAt(t.pos+i-1)==n.value}var Fu={[k.Blockquote](n,e,t){return t.next!=62?!1:(t.markers.push(I(k.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(Ie(t.text.charCodeAt(t.pos+1))?2:1)),n.end=e.lineStart+t.text.length,!0)},[k.ListItem](n,e,t){return t.indent-1?!1:(t.moveBaseColumn(t.baseIndent+n.value),!0)},[k.OrderedList]:ju,[k.BulletList]:ju,[k.Document](){return!0}};function Ie(n){return n==32||n==9||n==10||n==13}function Cn(n,e=0){for(;et&&Ie(n.charCodeAt(e-1));)e--;return e}function Hu(n){if(n.next!=96&&n.next!=126)return-1;let e=n.pos+1;for(;e-1&&n.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(sd.SetextHeading)>-1||i<3?-1:1}function Ju(n,e){for(let t=n.stack.length-1;t>=0;t--)if(n.stack[t].type==e)return!0;return!1}function na(n,e,t){return(n.next==45||n.next==43||n.next==42)&&(n.pos==n.text.length-1||Ie(n.text.charCodeAt(n.pos+1)))&&(!t||Ju(e,k.BulletList)||n.skipSpace(n.pos+2)=48&&r<=57;){i++;if(i==n.text.length)return-1;r=n.text.charCodeAt(i)}return i==n.pos||i>n.pos+9||r!=46&&r!=41||in.pos+1||n.next!=49)?-1:i+1-n.pos}function ed(n){if(n.next!=35)return-1;let e=n.pos+1;for(;e6?-1:t}function td(n){if(n.next!=45&&n.next!=61||n.indent>=n.baseIndent+4)return-1;let e=n.pos+1;for(;e/,nd=/\\?>/,Gl=[[/^<(?:script|pre|style)(?:\\s|>|$)/i,/<\\/(?:script|pre|style)>/i],[/^\\s*/i.exec(i);if(s)return n.append(I(k.Comment,t,t+1+s[0].length));let o=/^\\?[^]*?\\?>/.exec(i);if(o)return n.append(I(k.ProcessingInstruction,t,t+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\\[CDATA\\[[^]*?\\]\\]>|\\/\\s*[a-zA-Z][\\w-]*\\s*>|\\s*[a-zA-Z][\\w-]*(\\s+[a-zA-Z:_][\\w-.:]*(?:\\s*=\\s*(?:[^\\s\"'=<>`]+|'[^']*'|\"[^\"]*\"))?)*\\s*(\\/\\s*)?>)/.exec(i);return l?n.append(I(k.HTMLTag,t,t+1+l[0].length)):-1},Emphasis(n,e,t){if(e!=95&&e!=42)return-1;let i=t+1;for(;n.char(i)==e;)i++;let r=n.slice(t-1,t),s=n.slice(i,i+1),o=Zn.test(r),l=Zn.test(s),a=/\\s|^$/.test(r),h=/\\s|^$/.test(s),c=!h&&(!l||a||o),f=!a&&(!o||h||l),u=c&&(e==42||!f||o),d=f&&(e==42||!c||l);return n.append(new Se(e==95?ad:hd,t,i,(u?1:0)|(d?2:0)))},HardBreak(n,e,t){if(e==92&&n.char(t+1)==10)return n.append(I(k.HardBreak,t,t+2));if(e==32){let i=t+1;for(;n.char(i)==32;)i++;if(n.char(i)==10&&i>=t+2)return n.append(I(k.HardBreak,t,i+1))}return-1},Link(n,e,t){return e==91?n.append(new Se(ci,t,t+1,1)):-1},Image(n,e,t){return e==33&&n.char(t+1)==91?n.append(new Se(ss,t,t+2,1)):-1},LinkEnd(n,e,t){if(e!=93)return-1;for(let i=n.parts.length-1;i>=0;i--){let r=n.parts[i];if(r instanceof Se&&(r.type==ci||r.type==ss)){if(!r.side||n.skipSpace(r.to)==t&&!/[(\\[]/.test(n.slice(t+1,t+2)))return n.parts[i]=null,-1;let s=n.takeContent(i),o=n.parts[i]=oy(n,s,r.type==ci?k.Link:k.Image,r.from,t+1);if(r.type==ci)for(let l=0;le?I(k.URL,e+t,s+t):s==n.length?null:!1}}function fd(n,e,t){let i=n.charCodeAt(e);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=e+1,o=!1;s=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,i,r,s){return this.append(new Se(e,t,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof Se&&(t.type==ci||t.type==ss))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let i=e;i=e;a--){let O=this.parts[a];if(O instanceof Se&&O.side&1&&O.type==r.type&&!(s&&(r.side&1||O.side&2)&&(O.to-O.from+o)%3==0&&((O.to-O.from)%3||o%3))){l=O;break}}if(!l)continue;let h=r.type.resolve,c=[],f=l.from,u=r.to;if(s){let O=Math.min(2,l.to-l.from,o);f=l.to-O,u=r.from+O,h=O==1?\"Emphasis\":\"StrongEmphasis\"}l.type.mark&&c.push(this.elt(l.type.mark,f,l.to));for(let O=a+1;O=0;t--){let i=this.parts[t];if(i instanceof Se&&i.type==e&&i.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof Se?t:null}skipSpace(e){return Cn(this.text,e-this.offset)+this.offset}elt(e,t,i,r){return typeof e==\"string\"?I(this.parser.getNodeType(e),t,i,r):new rs(e,t)}};Xn.linkStart=ci;Xn.imageStart=ss;function Jl(n,e){if(!e.length)return n;if(!n.length)return e;let t=n.slice(),i=0;for(let r of e){for(;i(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=`\n`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=e+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=t;if(!i.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(E.contextHash)==e}takeNodes(e){let t=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,l=e.block.children.length,a=o,h=l;for(;;){if(t.to-i>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let c=dd(t.from-i,e.ranges);if(t.to-i<=e.ranges[e.rangeI].to)e.addNode(t.tree,c);else{let f=new W(e.parser.nodeSet.types[k.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(f,t.tree),e.addNode(f,c)}if(t.type.is(\"Block\")&&(ly.indexOf(t.type.id)<0?(o=t.to-i,l=e.block.children.length):(o=a,l=h),a=t.to-i,h=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return o-s}};function dd(n,e){let t=n;for(let i=1;ies[n]),Object.keys(es).map(n=>sd[n]),Object.keys(es),ry,Fu,Object.keys(Wl).map(n=>Wl[n]),Object.keys(Wl),[]);function hy(n,e,t){let i=[];for(let r=n.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:t;if(o>s&&i.push({from:s,to:o}),!r)break;s=r.to}return i}function Od(n){let{codeParser:e,htmlParser:t}=n;return{wrap:Xr((r,s)=>{let o=r.type.id;if(e&&(o==k.CodeBlock||o==k.FencedCode)){let l=\"\";if(o==k.FencedCode){let h=r.node.getChild(k.CodeInfo);h&&(l=s.read(h.from,h.to))}let a=e(l);if(a)return{parser:a,overlay:h=>h.type.id==k.CodeText,bracketed:o==k.FencedCode}}else if(t&&(o==k.HTMLBlock||o==k.HTMLTag||o==k.CommentBlock))return{parser:t,overlay:hy(r.node,r.from,r.to)};return null})}}var cy={resolve:\"Strikethrough\",mark:\"StrikethroughMark\"},fy={defineNodes:[{name:\"Strikethrough\",style:{\"Strikethrough/...\":m.strikethrough}},{name:\"StrikethroughMark\",style:m.processingInstruction}],parseInline:[{name:\"Strikethrough\",parse(n,e,t){if(e!=126||n.char(t+1)!=126||n.char(t+2)==126)return-1;let i=n.slice(t-1,t),r=n.slice(t+2,t+3),s=/\\s|^$/.test(i),o=/\\s|^$/.test(r),l=Zn.test(i),a=Zn.test(r);return n.addDelimiter(cy,t,t+2,!o&&(!a||s||l),!s&&(!l||o||a))},after:\"Emphasis\"}]};function An(n,e,t=0,i,r=0){let s=0,o=!0,l=-1,a=-1,h=!1,c=()=>{i.push(n.elt(\"TableCell\",r+l,r+a,n.parser.parseInline(e.slice(l,a),r+l)))};for(let f=t;f-1)&&s++,o=!1,i&&(l>-1&&c(),i.push(n.elt(\"TableDelimiter\",f+r,f+r+1))),l=a=-1):(h||u!=32&&u!=9)&&(l<0&&(l=f),a=f+1),h=!h&&u==92}return l>-1&&(s++,i&&c()),s}function Iu(n,e){for(let t=e;t\\s]*\\|?(\\s*:?-+:?\\s*\\|)+(\\s*:?-+:?\\s*)?$/,os=class{constructor(){this.rows=null}nextLine(e,t,i){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&md.test(r=t.text.slice(t.pos))){let s=[];An(e,i.content,0,s,i.start)==An(e,r,0)&&(this.rows=[e.elt(\"TableHeader\",i.start,i.start+i.content.length,s),e.elt(\"TableDelimiter\",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let r=[];An(e,t.text,t.pos,r,e.lineStart),this.rows.push(e.elt(\"TableRow\",e.lineStart+t.pos,e.lineStart+t.text.length,r))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(\"Table\",t.start,t.start+t.content.length,this.rows)),!0):!1}},uy={defineNodes:[{name:\"Table\",block:!0},{name:\"TableHeader\",style:{\"TableHeader/...\":m.heading}},\"TableRow\",{name:\"TableCell\",style:m.content},{name:\"TableDelimiter\",style:m.processingInstruction}],parseBlock:[{name:\"Table\",leaf(n,e){return Iu(e.content,0)?new os:null},endLeaf(n,e,t){if(t.parsers.some(r=>r instanceof os)||!Iu(e.text,e.basePos))return!1;let i=n.peekLine();return md.test(i)&&An(n,e.text,e.basePos)==An(n,i,e.basePos)},before:\"SetextHeading\"}]},ta=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(\"Task\",t.start,t.start+t.content.length,[e.elt(\"TaskMarker\",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},dy={defineNodes:[{name:\"Task\",block:!0,style:m.list},{name:\"TaskMarker\",style:m.atom}],parseBlock:[{name:\"TaskList\",leaf(n,e){return/^\\[[ xX]\\][ \\t]/.test(e.content)&&n.parentType().name==\"ListItem\"?new ta:null},after:\"SetextHeading\"}]},Wu=/(www\\.)|(https?:\\/\\/)|([\\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Bu=/[\\w-]+(\\.[\\w-]+)+(:\\d+)?(\\/[^\\s<]*)?/gy,py=/[\\w-]+\\.[\\w-]+($|[/:])/,qu=/[\\w.+-]+@[\\w-]+(\\.[\\w.-]+)+/gy,Nu=/\\/[a-zA-Z\\d@.]+/gy;function Gu(n,e,t,i){let r=0;for(let s=e;s-1)return-1;let i=e+t[0].length;for(;;){let r=n[i-1],s;if(/[?!.,:*_~]/.test(r)||r==\")\"&&Gu(n,e,i,\")\")>Gu(n,e,i,\"(\"))i--;else if(r==\";\"&&(s=/&(?:#\\d+|#x[a-f\\d]+|\\w+);$/.exec(n.slice(e,i))))i=e+s.index;else break}return i}function Uu(n,e){qu.lastIndex=e;let t=qu.exec(n);if(!t)return-1;let i=t[0][t[0].length-1];return i==\"_\"||i==\"-\"?-1:e+t[0].length-(i==\".\"?1:0)}var my={parseInline:[{name:\"Autolink\",parse(n,e,t){let i=t-n.offset;if(i&&/\\w/.test(n.text[i-1]))return-1;Wu.lastIndex=i;let r=Wu.exec(n.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=Oy(n.text,i+r[0].length),s>-1&&n.hasOpenLink){let o=/([^\\[\\]]|\\[[^\\]]*\\])*/.exec(n.text.slice(i,s));s=i+o[0].length}}else r[3]?s=Uu(n.text,i):(s=Uu(n.text,i+r[0].length),s>-1&&r[0]==\"xmpp:\"&&(Nu.lastIndex=s,r=Nu.exec(n.text),r&&(s=r.index+r[0].length)));return s<0?-1:(n.addElement(n.elt(\"URL\",t,s+n.offset)),s+n.offset)}}]},ls=[uy,dy,fy,my];function gd(n,e,t){return(i,r,s)=>{if(r!=n||i.char(s+1)==n)return-1;let o=[i.elt(t,s,s+1)];for(let l=s+1;lt%3==0).concat(this.state)}]@${this.pos}${this.score?\"!\"+this.score:\"\"}`}static start(e,t,i=0){let r=e.parser.context;return new n(e,[],t,i,i,0,[],0,r?new as(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,h)}storeNode(e,t,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(t==i)return;if(this.buffer[o-2]>=t){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,t,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>i;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(e,t,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,r,4);else{let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||t<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(t,i),t<=o.maxNode&&this.buffer.push(t,i,r,4)}}apply(e,t,i,r){e&65536?this.reduce(e):this.shift(e,t,i,r)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new n(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new aa(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if(!(i&65536))return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sa&1&&l==o)||r.push(t[s],o)}t=r}let i=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],a,!1)>=0)return l<<19|65536|a}}else{let l=i(o,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t0&&this.emitLookAhead()}},as=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},aa=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},ha=class n{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new n(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.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,this.index==0&&this.maybeNext()}fork(){return new n(this.stack,this.pos,this.index)}};function Mn(n,e=Uint16Array){if(typeof n!=\"string\")return n;let t=null;for(let i=0,r=0;i=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}t?t[r++]=s:t=new e(s)}return t}var Yi=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},xd=new Yi,ca=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=\"\",this.chunkOff=0,this.chunk2=\"\",this.chunk2Pos=0,this.next=-1,this.token=xd,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,r=this.rangeIndex,s=this.pos+e;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,r;if(t>=0&&t=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=\"\",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=xd,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i=\"\";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return i}},Dt=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;$d(this.data,e,t,this.id,i.data,i.tokenPrecTable)}};Dt.prototype.contextual=Dt.prototype.fallback=Dt.prototype.extend=!1;var Vt=class{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data=typeof e==\"string\"?Mn(e):e}token(e,t){let i=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if($d(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}};Vt.prototype.contextual=Dt.prototype.fallback=Dt.prototype.extend=!1;var oe=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function $d(n,e,t,i,r,s){let o=0,l=1<0){let p=n[d];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||by(p,e.token.value,r,s))){e.acceptToken(p);break}}let c=e.next,f=0,u=n[o+2];if(e.next<0&&u>f&&n[h+u*3-3]==65535){o=n[h+u*3-1];continue e}for(;f>1,p=h+d+(d<<1),O=n[p],g=n[p+1]||65536;if(c=g)f=d+1;else{o=n[p+2],e.advance();continue e}}break}}function kd(n,e,t){for(let i=e,r;(r=n[i])!=65535;i++)if(r==t)return i-e;return-1}function by(n,e,t,i){let r=kd(t,i,e);return r<0||kd(t,i,n)e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}var fa=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?wd(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?wd(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof W){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}},ua=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Yi)}getActions(e){let t=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let h=0;hf.end+25&&(a=Math.max(f.lookAhead,a)),f.value!=0)){let u=t;if(f.extended>-1&&(t=this.addActions(e,f.extended,f.end,t)),t=this.addActions(e,f.value,f.end,t),!c.extend&&(i=f,t>u))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new Yi,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Yi,{pos:i,p:r}=e;return t.start=i,t.end=Math.min(i+1,r.stream.end),t.value=i==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,i){let r=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let o=0;o=0&&i.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,i,r){for(let s=0;se.bufferLength*4?new fa(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)i.push(l);else{if(this.advanceStack(l,i,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!i.length){let o=r&&yy(r);if(o)return Ae&&console.log(\"Finish with \"+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Ae&&r&&console.log(\"Stuck with token \"+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):\"none\")),new SyntaxError(\"No parse at \"+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return Ae&&console.log(\"Force-finish \"+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,a)=>a.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let o=0;o500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)i.splice(a--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o \":\"\";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let u=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(u>-1&&f.length&&(!h||(f.prop(E.contextHash)||0)==c))return e.useNode(f,u),Ae&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof W)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof W&&f.positions[0]==0)f=d;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Ae&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let h=0;hr?t.push(p):i.push(p)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return Qd(e,t),!0}}runRecovery(e,t,i){let r=null,s=!1;for(let o=0;o \":\"\";if(l.deadEnd&&(s||(s=!0,l.restart(),Ae&&console.log(c+this.stackID(l)+\" (restarted)\"),this.advanceFully(l,i))))continue;let f=l.split(),u=c;for(let d=0;d<10&&f.forceReduce()&&(Ae&&console.log(u+this.stackID(f)+\" (via force-reduce)\"),!this.advanceFully(f,i));d++)Ae&&(u=this.stackID(f)+\" -> \");for(let d of l.recoverByInsert(a))Ae&&console.log(c+this.stackID(d)+\" (via recover-insert)\"),this.advanceFully(d,i);this.stream.end>l.pos?(h==l.pos&&(h++,a=0),l.recoverByDelete(a,h),Ae&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),Qd(l,i)):(!r||r.scoren,Di=class{constructor(e){this.start=e.start,this.shift=e.shift||oa,this.reduce=e.reduce||oa,this.reuse=e.reuse||oa,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},It=class n extends Zt{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(\" \");this.minRepeatTerm=t.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(c,a,l[h++]);else{let f=l[h+-c];for(let u=-c;u>0;u--)s(l[h++],a,f);h++}}}this.nodeSet=new At(t.map((l,a)=>te.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=Mn(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l==\"number\"?new Dt(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let r=new da(this,e,t,i);for(let s of this.wrappers)r=s(r,e,t,i);return r}getGoto(e,t,i=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&i)return a;for(let h=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),r=i?t(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=yt(this.data,s+2);else break;r=t(yt(this.data,s+1))}return r}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=yt(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[i],r)}}return t}configure(e){let t=Object.assign(Object.create(n.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(l=>l.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return t.specializers[r]=vd(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let s of e.split(\" \")){let o=t.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;si)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scoren.external(t,i)<<1|e}return n.get}var Sy=55,xy=1,ky=56,wy=2,Qy=57,vy=3,Pd=4,$y=5,ya=6,Ed=7,Ld=8,zd=9,_d=10,Py=11,Ty=12,Cy=13,Oa=58,Ay=14,Ry=15,Td=59,jd=21,Zy=23,Yd=24,Xy=25,ga=27,Dd=28,My=29,Ey=32,Ly=35,zy=37,_y=38,jy=0,Yy=1,Dy={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Vy={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Cd={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Iy(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}var Ad=null,Rd=null,Zd=0;function ba(n,e){let t=n.pos+e;if(Zd==t&&Rd==n)return Ad;let i=n.peek(e),r=\"\";for(;Iy(i);)r+=String.fromCharCode(i),i=n.peek(++e);return Rd=n,Zd=t,Ad=r?r.toLowerCase():i==Wy||i==By?void 0:null}var Vd=60,hs=62,Sa=47,Wy=63,By=33,qy=45;function Xd(n,e){this.name=n,this.parent=e}var Ny=[ya,_d,Ed,Ld,zd],Gy=new Di({start:null,shift(n,e,t,i){return Ny.indexOf(e)>-1?new Xd(ba(i,1)||\"\",n):n},reduce(n,e){return e==jd&&n?n.parent:n},reuse(n,e,t,i){let r=e.type.id;return r==ya||r==zy?new Xd(ba(i,1)||\"\",n):n},strict:!1}),Uy=new oe((n,e)=>{if(n.next!=Vd){n.next<0&&e.context&&n.acceptToken(Oa);return}n.advance();let t=n.next==Sa;t&&n.advance();let i=ba(n,0);if(i===void 0)return;if(!i)return n.acceptToken(t?Ry:Ay);let r=e.context?e.context.name:null;if(t){if(i==r)return n.acceptToken(Py);if(r&&Vy[r])return n.acceptToken(Oa,-2);if(e.dialectEnabled(jy))return n.acceptToken(Ty);for(let s=e.context;s;s=s.parent)if(s.name==i)return;n.acceptToken(Cy)}else{if(i==\"script\")return n.acceptToken(Ed);if(i==\"style\")return n.acceptToken(Ld);if(i==\"textarea\")return n.acceptToken(zd);if(Dy.hasOwnProperty(i))return n.acceptToken(_d);r&&Cd[r]&&Cd[r][i]?n.acceptToken(Oa,-1):n.acceptToken(ya)}},{contextual:!0}),Fy=new oe(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(Td);break}if(n.next==qy)e++;else if(n.next==hs&&e>=2){t>=3&&n.acceptToken(Td,-2);break}else e=0;n.advance()}});function Hy(n){for(;n;n=n.parent)if(n.name==\"svg\"||n.name==\"math\")return!0;return!1}var Ky=new oe((n,e)=>{if(n.next==Sa&&n.peek(1)==hs){let t=e.dialectEnabled(Yy)||Hy(e.context);n.acceptToken(t?$y:Pd,2)}else n.next==hs&&n.acceptToken(Pd,1)});function xa(n,e,t){let i=2+n.length;return new oe(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(s==0&&r.next==Vd||s==1&&r.next==Sa||s>=2&&so?r.acceptToken(e,-o):r.acceptToken(t,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(e,1);break}else s=o=0;r.advance()}})}var Jy=xa(\"script\",Sy,xy),eS=xa(\"style\",ky,wy),tS=xa(\"textarea\",Qy,vy),iS=Ne({\"Text RawText IncompleteTag IncompleteCloseTag\":m.content,\"StartTag StartCloseTag SelfClosingEndTag EndTag\":m.angleBracket,TagName:m.tagName,\"MismatchedCloseTag/TagName\":[m.tagName,m.invalid],AttributeName:m.attributeName,\"AttributeValue UnquotedAttributeValue\":m.attributeValue,Is:m.definitionOperator,\"EntityReference CharacterReference\":m.character,Comment:m.blockComment,ProcessingInst:m.processingInstruction,DoctypeDecl:m.documentMeta}),Id=It.deserialize({version:14,states:\",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO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iyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~\",goto:\"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp\",nodeNames:\"\\u26A0 StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl\",maxTerm:68,context:Gy,nodeProps:[[\"closedBy\",-10,1,2,3,7,8,9,10,11,12,13,\"EndTag\",6,\"EndTag SelfClosingEndTag\",-4,22,31,34,37,\"CloseTag\"],[\"openedBy\",4,\"StartTag StartCloseTag\",5,\"StartTag\",-4,30,33,36,38,\"OpenTag\"],[\"group\",-10,14,15,18,19,20,21,40,41,42,43,\"Entity\",17,\"Entity TextContent\",-3,29,32,35,\"TextContent Entity\"],[\"isolate\",-11,22,30,31,33,34,36,37,38,39,42,43,\"ltr\",-3,27,28,40,\"\"]],propSources:[iS],skippedNodes:[0],repeatNodeCount:9,tokenData:\"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%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f.to,to:g}]}}}}if(o&&h==Yd){let c=l.node,f;if(f=c.firstChild){let u=o[a.read(f.from,f.to)];if(u)for(let d of u){if(d.tagName&&d.tagName!=Md(c.parent,a))continue;let p=c.lastChild;if(p.type.id==ga){let O=p.from+1,g=p.lastChild,b=p.to-(g&&g.isError?0:1);if(b>O)return{parser:d.parser,overlay:[{from:O,to:b}],bracketed:!0}}else if(p.type.id==Dd)return{parser:d.parser,overlay:[{from:p.from,to:p.to}]}}}}return null})}var nS=148,Bd=1,rS=149,sS=150,Nd=2,oS=151,lS=3,aS=4,Gd=[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],hS=58,cS=40,Ud=95,fS=91,cs=45,uS=46,dS=35,pS=37,OS=38,mS=92,gS=10,bS=42;function En(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function wa(n){return n>=48&&n<=57}function qd(n){return wa(n)||n>=97&&n<=102||n>=65&&n<=70}var Fd=(n,e,t)=>(i,r)=>{for(let s=!1,o=0,l=0;;l++){let{next:a}=i;if(En(a)||a==cs||a==Ud||s&&wa(a))!s&&(a!=cs||l>0)&&(s=!0),o===l&&a==cs&&o++,i.advance();else if(a==mS&&i.peek(1)!=gS){if(i.advance(),qd(i.next)){do i.advance();while(qd(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(o==2&&r.canShift(Nd)?e:a==cS?t:n);break}}},yS=new oe(Fd(rS,Nd,sS),{contextual:!0}),SS=new oe(Fd(oS,lS,aS),{contextual:!0}),xS=new oe(n=>{if(Gd.includes(n.peek(-1))){let{next:e}=n;(En(e)||e==Ud||e==dS||e==uS||e==bS||e==fS||e==hS&&En(n.peek(1))||e==cs||e==OS)&&n.acceptToken(nS)}}),kS=new oe(n=>{if(!Gd.includes(n.peek(-1))){let{next:e}=n;if(e==pS&&(n.advance(),n.acceptToken(Bd)),En(e)){do n.advance();while(En(n.next)||wa(n.next));n.acceptToken(Bd)}}}),wS=Ne({\"AtKeyword import charset namespace keyframes media supports font-feature-values\":m.definitionKeyword,\"from to selector scope MatchFlag\":m.keyword,NamespaceName:m.namespace,KeyframeName:m.labelName,KeyframeRangeName:m.operatorKeyword,TagName:m.tagName,ClassName:m.className,PseudoClassName:m.constant(m.className),IdName:m.labelName,\"FeatureName PropertyName\":m.propertyName,AttributeName:m.attributeName,NumberLiteral:m.number,KeywordQuery:m.keyword,UnaryQueryOp:m.operatorKeyword,\"CallTag ValueName FontName\":m.atom,VariableName:m.variableName,Callee:m.operatorKeyword,Unit:m.unit,\"UniversalSelector NestingSelector\":m.definitionOperator,\"MatchOp CompareOp\":m.compareOperator,\"ChildOp SiblingOp, LogicOp\":m.logicOperator,BinOp:m.arithmeticOperator,Important:m.modifier,Comment:m.blockComment,ColorLiteral:m.color,\"ParenthesizedContent StringLiteral\":m.string,\":\":m.punctuation,\"PseudoOp #\":m.derefOperator,\"; , |\":m.separator,\"( )\":m.paren,\"[ ]\":m.squareBracket,\"{ }\":m.brace}),QS={__proto__:null,lang:44,\"nth-child\":44,\"nth-last-child\":44,\"nth-of-type\":44,\"nth-last-of-type\":44,dir:44,\"host-context\":44,if:90,url:158,\"url-prefix\":158,domain:158,regexp:158},vS={__proto__:null,or:104,and:104,not:112,only:112,layer:212},$S={__proto__:null,selector:118,style:124,layer:208},PS={__proto__:null,\"@import\":204,\"@media\":216,\"@charset\":220,\"@namespace\":224,\"@keyframes\":230,\"@supports\":242,\"@scope\":246,\"@font-feature-values\":252},TS={__proto__:null,to:249},Hd=It.deserialize({version:14,states:\"MrQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FqO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#ERO'dQdO'#ETO'oQdO'#E[O'oQdO'#E_OOQP'#Fq'#FqO)RQhO'#FQOOQS'#Fp'#FpOOQS'#FT'#FTQYQdOOO)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j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!r`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!r`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!r`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!r`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!r`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!r`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$rQ!r`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$fUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#SQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z\",tokenizers:[xS,kS,yS,SS,1,2,3,4,new Vt(\"m~RRYZ[z{a~~g~aO$b~~dP!P!Qg~lO$c~~\",28,155)],topRules:{StyleSheet:[0,6],Styles:[1,129]},dynamicPrecedences:{97:1},specialized:[{term:150,get:n=>QS[n]||-1},{term:151,get:n=>vS[n]||-1},{term:4,get:n=>$S[n]||-1},{term:28,get:n=>PS[n]||-1},{term:149,get:n=>TS[n]||-1}],tokenPrec:2444});var Qa=null;function va(){if(!Qa&&typeof document==\"object\"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let i in n)i!=\"cssText\"&&i!=\"cssFloat\"&&typeof n[i]==\"string\"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>\"-\"+r.toLowerCase())),t.has(i)||(e.push(i),t.add(i)));Qa=e.sort().map(i=>({type:\"property\",label:i,apply:i+\": \"}))}return Qa||[]}var Kd=[\"active\",\"after\",\"any-link\",\"autofill\",\"backdrop\",\"before\",\"checked\",\"cue\",\"default\",\"defined\",\"disabled\",\"empty\",\"enabled\",\"file-selector-button\",\"first\",\"first-child\",\"first-letter\",\"first-line\",\"first-of-type\",\"focus\",\"focus-visible\",\"focus-within\",\"fullscreen\",\"has\",\"host\",\"host-context\",\"hover\",\"in-range\",\"indeterminate\",\"invalid\",\"is\",\"lang\",\"last-child\",\"last-of-type\",\"left\",\"link\",\"marker\",\"modal\",\"not\",\"nth-child\",\"nth-last-child\",\"nth-last-of-type\",\"nth-of-type\",\"only-child\",\"only-of-type\",\"optional\",\"out-of-range\",\"part\",\"placeholder\",\"placeholder-shown\",\"read-only\",\"read-write\",\"required\",\"right\",\"root\",\"scope\",\"selection\",\"slotted\",\"target\",\"target-text\",\"valid\",\"visited\",\"where\"].map(n=>({type:\"class\",label:n})),Jd=[\"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(n=>({type:\"keyword\",label:n})).concat([\"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(n=>({type:\"constant\",label:n}))),CS=[\"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(n=>({type:\"type\",label:n})),AS=[\"@charset\",\"@color-profile\",\"@container\",\"@counter-style\",\"@font-face\",\"@font-feature-values\",\"@font-palette-values\",\"@import\",\"@keyframes\",\"@layer\",\"@media\",\"@namespace\",\"@page\",\"@position-try\",\"@property\",\"@scope\",\"@starting-style\",\"@supports\",\"@view-transition\"].map(n=>({type:\"keyword\",label:n})),St=/^(\\w[\\w-]*|-\\w[\\w-]*|)$/,RS=/^-(-[\\w-]*)?$/;function ZS(n,e){var t;if((n.name==\"(\"||n.type.isError)&&(n=n.parent||n),n.name!=\"ArgList\")return!1;let i=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return i?.name!=\"Callee\"?!1:e.sliceString(i.from,i.to)==\"var\"}var ep=new Zi,XS=[\"Declaration\"];function MS(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function tp(n,e,t){if(e.to-e.from>4096){let i=ep.get(e);if(i)return i;let r=[],s=new Set,o=e.cursor(V.IncludeAnonymous);if(o.firstChild())do for(let l of tp(n,o.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return ep.set(e,r),r}else{let i=[],r=new Set;return e.cursor().iterate(s=>{var o;if(t(s)&&s.matchContext(XS)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==\":\"){let l=n.sliceString(s.from,s.to);r.has(l)||(r.add(l),i.push({label:l,type:\"variable\"}))}}),i}}var ES=n=>e=>{let{state:t,pos:i}=e,r=z(t).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)==\"-\";if(r.name==\"PropertyName\"||(s||r.name==\"TagName\")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:va(),validFor:St};if(r.name==\"ValueName\")return{from:r.from,options:Jd,validFor:St};if(r.name==\"PseudoClassName\")return{from:r.from,options:Kd,validFor:St};if(n(r)||(e.explicit||s)&&ZS(r,t.doc))return{from:n(r)||s?r.from:i,options:tp(t.doc,MS(r),n),validFor:RS};if(r.name==\"TagName\"){for(let{parent:a}=r;a;a=a.parent)if(a.name==\"Block\")return{from:r.from,options:va(),validFor:St};return{from:r.from,options:CS,validFor:St}}if(r.name==\"AtKeyword\")return{from:r.from,options:AS,validFor:St};if(!e.explicit)return null;let o=r.resolve(i),l=o.childBefore(i);return l&&l.name==\":\"&&o.name==\"PseudoClassSelector\"?{from:i,options:Kd,validFor:St}:l&&l.name==\":\"&&o.name==\"Declaration\"||o.name==\"ArgList\"?{from:i,options:Jd,validFor:St}:o.name==\"Block\"||o.name==\"Styles\"?{from:i,options:va(),validFor:St}:null},LS=ES(n=>n.name==\"VariableName\"),Ln=Lt.define({name:\"css\",parser:Hd.configure({props:[mt.add({Declaration:Ei()}),gt.add({\"Block KeyframeList\":jr})]}),languageData:{commentTokens:{block:{open:\"/*\",close:\"*/\"}},indentOnInput:/^\\s*\\}$/,wordChars:\"-\"}});function fs(){return new Ge(Ln,Ln.data.of({autocomplete:LS}))}var zS=316,_S=317,ip=1,jS=2,YS=3,DS=4,VS=318,IS=320,WS=321,BS=5,qS=6,NS=0,Pa=[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],np=125,GS=59,Ta=47,US=42,FS=43,HS=45,KS=60,JS=44,e1=63,t1=46,i1=91,n1=new Di({start:!1,shift(n,e){return e==BS||e==qS||e==IS?n:e==WS},strict:!1}),r1=new oe((n,e)=>{let{next:t}=n;(t==np||t==-1||e.context)&&n.acceptToken(VS)},{contextual:!0,fallback:!0}),s1=new oe((n,e)=>{let{next:t}=n,i;Pa.indexOf(t)>-1||t==Ta&&((i=n.peek(1))==Ta||i==US)||t!=np&&t!=GS&&t!=-1&&!e.context&&n.acceptToken(zS)},{contextual:!0}),o1=new oe((n,e)=>{n.next==i1&&!e.context&&n.acceptToken(_S)},{contextual:!0}),l1=new oe((n,e)=>{let{next:t}=n;if(t==FS||t==HS){if(n.advance(),t==n.next){n.advance();let i=!e.context&&e.canShift(ip);n.acceptToken(i?ip:jS)}}else t==e1&&n.peek(1)==t1&&(n.advance(),n.advance(),(n.next<48||n.next>57)&&n.acceptToken(YS))},{contextual:!0});function $a(n,e){return n>=65&&n<=90||n>=97&&n<=122||n==95||n>=192||!e&&n>=48&&n<=57}var a1=new oe((n,e)=>{if(n.next!=KS||!e.dialectEnabled(NS)||(n.advance(),n.next==Ta))return;let t=0;for(;Pa.indexOf(n.next)>-1;)n.advance(),t++;if($a(n.next,!0)){for(n.advance(),t++;$a(n.next,!1);)n.advance(),t++;for(;Pa.indexOf(n.next)>-1;)n.advance(),t++;if(n.next==JS)return;for(let i=0;;i++){if(i==7){if(!$a(n.next,!0))return;break}if(n.next!=\"extends\".charCodeAt(i))break;n.advance(),t++}}n.acceptToken(DS,-t)}),h1=Ne({\"get set async static\":m.modifier,\"for while do if else switch try catch finally return throw break continue default case defer\":m.controlKeyword,\"in of await yield void typeof delete instanceof as satisfies\":m.operatorKeyword,\"let var const using function class extends\":m.definitionKeyword,\"import export from\":m.moduleKeyword,\"with debugger new\":m.keyword,TemplateString:m.special(m.string),super:m.atom,BooleanLiteral:m.bool,this:m.self,null:m.null,Star:m.modifier,VariableName:m.variableName,\"CallExpression/VariableName TaggedTemplateExpression/VariableName\":m.function(m.variableName),VariableDefinition:m.definition(m.variableName),Label:m.labelName,PropertyName:m.propertyName,PrivatePropertyName:m.special(m.propertyName),\"CallExpression/MemberExpression/PropertyName\":m.function(m.propertyName),\"FunctionDeclaration/VariableDefinition\":m.function(m.definition(m.variableName)),\"ClassDeclaration/VariableDefinition\":m.definition(m.className),\"NewExpression/VariableName\":m.className,PropertyDefinition:m.definition(m.propertyName),PrivatePropertyDefinition:m.definition(m.special(m.propertyName)),UpdateOp:m.updateOperator,\"LineComment Hashbang\":m.lineComment,BlockComment:m.blockComment,Number:m.number,String:m.string,Escape:m.escape,ArithOp:m.arithmeticOperator,LogicOp:m.logicOperator,BitOp:m.bitwiseOperator,CompareOp:m.compareOperator,RegExp:m.regexp,Equals:m.definitionOperator,Arrow:m.function(m.punctuation),\": Spread\":m.punctuation,\"( )\":m.paren,\"[ ]\":m.squareBracket,\"{ }\":m.brace,\"InterpolationStart InterpolationEnd\":m.special(m.brace),\".\":m.derefOperator,\", ;\":m.separator,\"@\":m.meta,TypeName:m.typeName,TypeDefinition:m.definition(m.typeName),\"type enum interface implements namespace module declare\":m.definitionKeyword,\"abstract global Privacy readonly override\":m.modifier,\"is keyof unique infer asserts\":m.operatorKeyword,JSXAttributeValue:m.attributeValue,JSXText:m.content,\"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag\":m.angleBracket,\"JSXIdentifier JSXNameSpacedName\":m.tagName,\"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName\":m.attributeName,\"JSXBuiltin/JSXIdentifier\":m.standard(m.tagName)}),c1={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},f1={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},u1={__proto__:null,\"<\":193},rp=It.deserialize({version:14,states:\"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#C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4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem\",maxTerm:380,context:n1,nodeProps:[[\"isolate\",-8,5,6,14,37,39,51,53,55,\"\"],[\"group\",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,\"Statement\",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,\"Expression\",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,\"Type\",-3,88,103,109,\"ClassItem\"],[\"openedBy\",23,\"<\",38,\"InterpolationStart\",56,\"[\",60,\"{\",73,\"(\",160,\"JSXStartCloseTag\"],[\"closedBy\",-2,24,168,\">\",40,\"InterpolationEnd\",50,\"]\",61,\"}\",74,\")\",165,\"JSXEndTag\"]],propSources:[h1],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:\"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr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!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~\",141,340),new Vt(\"j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~\",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:n=>c1[n]||-1},{term:343,get:n=>f1[n]||-1},{term:95,get:n=>u1[n]||-1}],tokenPrec:15201});var ap=[ye(\"function ${name}(${params}) {\\n\t${}\\n}\",{label:\"function\",detail:\"definition\",type:\"keyword\"}),ye(\"for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\\n\t${}\\n}\",{label:\"for\",detail:\"loop\",type:\"keyword\"}),ye(\"for (let ${name} of ${collection}) {\\n\t${}\\n}\",{label:\"for\",detail:\"of loop\",type:\"keyword\"}),ye(\"do {\\n\t${}\\n} while (${})\",{label:\"do\",detail:\"loop\",type:\"keyword\"}),ye(\"while (${}) {\\n\t${}\\n}\",{label:\"while\",detail:\"loop\",type:\"keyword\"}),ye(`try {\n\t\\${}\n} catch (\\${error}) {\n\t\\${}\n}`,{label:\"try\",detail:\"/ catch block\",type:\"keyword\"}),ye(\"if (${}) {\\n\t${}\\n}\",{label:\"if\",detail:\"block\",type:\"keyword\"}),ye(`if (\\${}) {\n\t\\${}\n} else {\n\t\\${}\n}`,{label:\"if\",detail:\"/ else block\",type:\"keyword\"}),ye(`class \\${name} {\n\tconstructor(\\${params}) {\n\t\t\\${}\n\t}\n}`,{label:\"class\",detail:\"definition\",type:\"keyword\"}),ye('import {${names}} from \"${module}\"\\n${}',{label:\"import\",detail:\"named\",type:\"keyword\"}),ye('import ${name} from \"${module}\"\\n${}',{label:\"import\",detail:\"default\",type:\"keyword\"})],d1=ap.concat([ye(\"interface ${name} {\\n\t${}\\n}\",{label:\"interface\",detail:\"definition\",type:\"keyword\"}),ye(\"type ${name} = ${type}\",{label:\"type\",detail:\"definition\",type:\"keyword\"}),ye(\"enum ${name} {\\n\t${}\\n}\",{label:\"enum\",detail:\"definition\",type:\"keyword\"})]),sp=new Zi,hp=new Set([\"Script\",\"Block\",\"FunctionExpression\",\"FunctionDeclaration\",\"ArrowFunction\",\"MethodDeclaration\",\"ForStatement\"]);function zn(n){return(e,t)=>{let i=e.node.getChild(\"VariableDefinition\");return i&&t(i,n),!0}}var p1=[\"FunctionDeclaration\"],O1={FunctionDeclaration:zn(\"function\"),ClassDeclaration:zn(\"class\"),ClassExpression:()=>!0,EnumDeclaration:zn(\"constant\"),TypeAliasDeclaration:zn(\"type\"),NamespaceDeclaration:zn(\"namespace\"),VariableDefinition(n,e){n.matchContext(p1)||e(n,\"variable\")},TypeDefinition(n,e){e(n,\"type\")},__proto__:null};function cp(n,e){let t=sp.get(e);if(t)return t;let i=[],r=!0;function s(o,l){let a=n.sliceString(o.from,o.to);i.push({label:a,type:l})}return e.cursor(V.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=O1[o.name];if(l&&l(o,s)||hp.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of cp(n,o.node))i.push(l);return!1}}),sp.set(e,i),i}var op=/^[\\w$\\xa1-\\uffff][\\w$\\d\\xa1-\\uffff]*$/,fp=[\"TemplateString\",\"String\",\"RegExp\",\"LineComment\",\"BlockComment\",\"VariableDefinition\",\"TypeDefinition\",\"Label\",\"PropertyDefinition\",\"PropertyName\",\"PrivatePropertyDefinition\",\"PrivatePropertyName\",\"JSXText\",\"JSXAttributeValue\",\"JSXOpenTag\",\"JSXCloseTag\",\"JSXSelfClosingTag\",\".\",\"?.\"];function m1(n){let e=z(n.state).resolveInner(n.pos,-1);if(fp.indexOf(e.name)>-1)return null;let t=e.name==\"VariableName\"||e.to-e.from<20&&op.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let i=[];for(let r=e;r;r=r.parent)hp.has(r.name)&&(i=i.concat(cp(n.state.doc,r)));return{options:i,from:t?e.from:n.pos,validFor:op}}var Ke=Lt.define({name:\"javascript\",parser:rp.configure({props:[mt.add({IfStatement:Ei({except:/^\\s*({|else\\b)/}),TryStatement:Ei({except:/^\\s*({|catch\\b|finally\\b)/}),LabeledStatement:Sf,SwitchBody:n=>{let e=n.textAfter,t=/^\\s*\\}/.test(e),i=/^\\s*(case|default)\\b/.test(e);return n.baseIndent+(t?0:i?1:2)*n.unit},Block:bf({closing:\"}\"}),ArrowFunction:n=>n.baseIndent+n.unit,\"TemplateString BlockComment\":()=>null,\"Statement Property\":Ei({except:/^\\s*{/}),JSXElement(n){let e=/^\\s*<\\//.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},JSXEscape(n){let e=/\\s*\\}/.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},\"JSXOpenTag JSXSelfClosingTag\"(n){return n.column(n.node.from)+n.unit}}),gt.add({\"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType\":jr,BlockComment(n){return{from:n.from+2,to:n.to-2}},JSXElement(n){let e=n.firstChild;if(!e||e.name==\"JSXSelfClosingTag\")return null;let t=n.lastChild;return{from:e.to,to:t.type.isError?n.to:t.from}},\"JSXSelfClosingTag JSXOpenTag\"(n){var e;let t=(e=n.firstChild)===null||e===void 0?void 0:e.nextSibling,i=n.lastChild;return!t||t.type.isError?null:{from:t.to,to:i.type.isError?n.to:i.from}}})]}),languageData:{closeBrackets:{brackets:[\"(\",\"[\",\"{\",\"'\",'\"',\"`\"]},commentTokens:{line:\"//\",block:{open:\"/*\",close:\"*/\"}},indentOnInput:/^\\s*(?:case |default:|\\{|\\}|<\\/)$/,wordChars:\"$\"}}),up={test:n=>/^JSX/.test(n.name),facet:gn({commentTokens:{block:{open:\"{/*\",close:\"*/}\"}}})},Ca=Ke.configure({dialect:\"ts\"},\"typescript\"),Aa=Ke.configure({dialect:\"jsx\",props:[_r.add(n=>n.isTop?[up]:void 0)]}),Ra=Ke.configure({dialect:\"jsx ts\",props:[_r.add(n=>n.isTop?[up]:void 0)]},\"typescript\"),dp=n=>({label:n,type:\"keyword\"}),pp=\"break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield\".split(\" \").map(dp),g1=pp.concat([\"declare\",\"implements\",\"private\",\"protected\",\"public\"].map(dp));function us(n={}){let e=n.jsx?n.typescript?Ra:Aa:n.typescript?Ca:Ke,t=n.typescript?d1.concat(g1):ap.concat(pp);return new Ge(e,[Ke.data.of({autocomplete:gu(fp,El(t))}),Ke.data.of({autocomplete:m1}),n.jsx?S1:[]])}function b1(n){for(;;){if(n.name==\"JSXOpenTag\"||n.name==\"JSXSelfClosingTag\"||n.name==\"JSXFragmentTag\")return n;if(n.name==\"JSXEscape\"||!n.parent)return null;n=n.parent}}function lp(n,e,t=n.length){for(let i=e?.firstChild;i;i=i.nextSibling)if(i.name==\"JSXIdentifier\"||i.name==\"JSXBuiltin\"||i.name==\"JSXNamespacedName\"||i.name==\"JSXMemberExpression\")return n.sliceString(i.from,Math.min(i.to,t));return\"\"}var y1=typeof navigator==\"object\"&&/Android\\b/.test(navigator.userAgent),S1=v.inputHandler.of((n,e,t,i,r)=>{if((y1?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||i!=\">\"&&i!=\"/\"||!Ke.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var h;let{head:c}=a,f=z(o).resolveInner(c-1,-1),u;if(f.name==\"JSXStartTag\"&&(f=f.parent),!(o.doc.sliceString(c-1,c)!=i||f.name==\"JSXAttributeValue\"&&f.to>c)){if(i==\">\"&&f.name==\"JSXFragmentTag\")return{range:a,changes:{from:c,insert:\"\"}};if(i==\"/\"&&f.name==\"JSXStartCloseTag\"){let d=f.parent,p=d.parent;if(p&&d.from==c-2&&((u=lp(o.doc,p.firstChild,c))||((h=p.firstChild)===null||h===void 0?void 0:h.name)==\"JSXFragmentTag\")){let O=`${u}>`;return{range:x.cursor(c+O.length,-1),changes:{from:c,insert:O}}}}else if(i==\">\"){let d=b1(f);if(d&&d.name==\"JSXOpenTag\"&&!/^\\/?>|^<\\//.test(o.doc.sliceString(c,c+2))&&(u=lp(o.doc,d,c)))return{range:a,changes:{from:c,insert:``}}}}return{range:a}});return l.changes.empty?!1:(n.dispatch([s,o.update(l,{userEvent:\"input.complete\",scrollIntoView:!0})]),!0)});var _n=[\"_blank\",\"_self\",\"_top\",\"_parent\"],Za=[\"ascii\",\"utf-8\",\"utf-16\",\"latin1\",\"latin1\"],Xa=[\"get\",\"post\",\"put\",\"delete\"],Ma=[\"application/x-www-form-urlencoded\",\"multipart/form-data\",\"text/plain\"],Re=[\"true\",\"false\"],X={},x1={a:{attrs:{href:null,ping:null,type:null,media:null,target:_n,hreflang:null}},abbr:X,address:X,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[\"default\",\"rect\",\"circle\",\"poly\"]}},article:X,aside:X,audio:{attrs:{src:null,mediagroup:null,crossorigin:[\"anonymous\",\"use-credentials\"],preload:[\"none\",\"metadata\",\"auto\"],autoplay:[\"autoplay\"],loop:[\"loop\"],controls:[\"controls\"]}},b:X,base:{attrs:{href:null,target:_n}},bdi:X,bdo:X,blockquote:{attrs:{cite:null}},body:X,br:X,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[\"autofocus\"],disabled:[\"autofocus\"],formenctype:Ma,formmethod:Xa,formnovalidate:[\"novalidate\"],formtarget:_n,type:[\"submit\",\"reset\",\"button\"]}},canvas:{attrs:{width:null,height:null}},caption:X,center:X,cite:X,code:X,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:X,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[\"open\"]}},dfn:X,div:X,dl:X,dt:X,em:X,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[\"disabled\"],form:null,name:null}},figcaption:X,figure:X,footer:X,form:{attrs:{action:null,name:null,\"accept-charset\":Za,autocomplete:[\"on\",\"off\"],enctype:Ma,method:Xa,novalidate:[\"novalidate\"],target:_n}},h1:X,h2:X,h3:X,h4:X,h5:X,h6:X,head:{children:[\"title\",\"base\",\"link\",\"style\",\"meta\",\"script\",\"noscript\",\"command\"]},header:X,hgroup:X,hr:X,html:{attrs:{manifest:null}},i:X,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:Ma,formmethod:Xa,formnovalidate:[\"novalidate\"],formtarget:_n,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:X,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[\"autofocus\"],disabled:[\"disabled\"],keytype:[\"RSA\"]}},label:{attrs:{for:null,form:null}},legend:X,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:X,menu:{attrs:{label:null,type:[\"list\",\"context\",\"toolbar\"]}},meta:{attrs:{content:null,charset:Za,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:X,noscript:X,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:X,param:{attrs:{name:null,value:null}},pre:X,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:X,rt:X,ruby:X,samp:X,script:{attrs:{type:[\"text/javascript\"],src:null,async:[\"async\"],defer:[\"defer\"],charset:Za}},section:X,select:{attrs:{form:null,name:null,size:null,autofocus:[\"autofocus\"],disabled:[\"disabled\"],multiple:[\"multiple\"]}},slot:{attrs:{name:null}},small:X,source:{attrs:{src:null,type:null,media:null}},span:X,strong:X,style:{attrs:{type:[\"text/css\"],media:null,scoped:null}},sub:X,summary:X,sup:X,table:X,tbody:X,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:X,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:X,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[\"row\",\"col\",\"rowgroup\",\"colgroup\"]}},thead:X,time:{attrs:{datetime:null}},title:X,tr:X,track:{attrs:{src:null,label:null,default:null,kind:[\"subtitles\",\"captions\",\"descriptions\",\"chapters\",\"metadata\"],srclang:null}},ul:{children:[\"li\",\"script\",\"template\",\"ul\",\"ol\"]},var:X,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:X},bp={accesskey:null,class:null,contenteditable:Re,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:Re,autocorrect:Re,autocapitalize:Re,style:null,tabindex:null,title:null,translate:[\"yes\",\"no\"],rel:[\"stylesheet\",\"alternate\",\"author\",\"bookmark\",\"help\",\"license\",\"next\",\"nofollow\",\"noreferrer\",\"prefetch\",\"prev\",\"search\",\"tag\"],role:\"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\":Re,\"aria-autocomplete\":[\"inline\",\"list\",\"both\",\"none\"],\"aria-busy\":Re,\"aria-checked\":[\"true\",\"false\",\"mixed\",\"undefined\"],\"aria-controls\":null,\"aria-describedby\":null,\"aria-disabled\":Re,\"aria-dropeffect\":null,\"aria-expanded\":[\"true\",\"false\",\"undefined\"],\"aria-flowto\":null,\"aria-grabbed\":[\"true\",\"false\",\"undefined\"],\"aria-haspopup\":Re,\"aria-hidden\":Re,\"aria-invalid\":[\"true\",\"false\",\"grammar\",\"spelling\"],\"aria-label\":null,\"aria-labelledby\":null,\"aria-level\":null,\"aria-live\":[\"off\",\"polite\",\"assertive\"],\"aria-multiline\":Re,\"aria-multiselectable\":Re,\"aria-owns\":null,\"aria-posinset\":null,\"aria-pressed\":[\"true\",\"false\",\"mixed\",\"undefined\"],\"aria-readonly\":Re,\"aria-relevant\":null,\"aria-required\":Re,\"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},yp=\"beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload\".split(\" \").map(n=>\"on\"+n);for(let n of yp)bp[n]=null;var ui=class{constructor(e,t){this.tags={...x1,...e},this.globalAttrs={...bp,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};ui.default=new ui;function di(n,e,t=n.length){if(!e)return\"\";let i=e.firstChild,r=i&&i.getChild(\"TagName\");return r?n.sliceString(r.from,Math.min(r.to,t)):\"\"}function Vi(n,e=!1){for(;n;n=n.parent)if(n.name==\"Element\")if(e)e=!1;else return n;return null}function Sp(n,e,t){let i=t.tags[di(n,Vi(e))];return i?.children||t.allTags}function Ea(n,e){let t=[];for(let i=Vi(e);i&&!i.type.isTop;i=Vi(i.parent)){let r=di(n,i);if(r&&i.lastChild.name==\"CloseTag\")break;r&&t.indexOf(r)<0&&(e.name==\"EndTag\"||e.from>=i.firstChild.to)&&t.push(r)}return t}var xp=/^[:\\-\\.\\w\\u00b7-\\uffff]*$/;function Op(n,e,t,i,r){let s=/\\s*>/.test(n.sliceDoc(r,r+5))?\"\":\">\",o=Vi(t,t.name==\"StartTag\"||t.name==\"TagName\");return{from:i,to:r,options:Sp(n.doc,o,e).map(l=>({label:l,type:\"type\"})).concat(Ea(n.doc,t).map((l,a)=>({label:\"/\"+l,apply:\"/\"+l+s,type:\"type\",boost:99-a}))),validFor:/^\\/?[:\\-\\.\\w\\u00b7-\\uffff]*$/}}function mp(n,e,t,i){let r=/\\s*>/.test(n.sliceDoc(i,i+5))?\"\":\">\";return{from:t,to:i,options:Ea(n.doc,e).map((s,o)=>({label:s,apply:s+r,type:\"type\",boost:99-o})),validFor:xp}}function k1(n,e,t,i){let r=[],s=0;for(let o of Sp(n.doc,t,e))r.push({label:\"<\"+o,type:\"type\"});for(let o of Ea(n.doc,t))r.push({label:\"\",type:\"type\",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\\/?[:\\-\\.\\w\\u00b7-\\uffff]*$/}}function w1(n,e,t,i,r){let s=Vi(t),o=s?e.tags[di(n.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],a=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:i,to:r,options:a.map(h=>({label:h,type:\"property\"})),validFor:xp}}function Q1(n,e,t,i,r){var s;let o=(s=t.parent)===null||s===void 0?void 0:s.getChild(\"AttributeName\"),l=[],a;if(o){let h=n.sliceDoc(o.from,o.to),c=e.globalAttrs[h];if(!c){let f=Vi(t),u=f?e.tags[di(n.doc,f)]:null;c=u?.attrs&&u.attrs[h]}if(c){let f=n.sliceDoc(i,r).toLowerCase(),u='\"',d='\"';/^['\"]/.test(f)?(a=f[0]=='\"'?/^[^\"]*$/:/^[^']*$/,u=\"\",d=n.sliceDoc(r,r+1)==f[0]?\"\":f[0],f=f.slice(1),i++):a=/^[^\\s<>='\"]*$/;for(let p of c)l.push({label:p,apply:u+p+d,type:\"constant\"})}}return{from:i,to:r,options:l,validFor:a}}function kp(n,e){let{state:t,pos:i}=e,r=z(t).resolveInner(i,-1),s=r.resolve(i);for(let o=i,l;s==r&&(l=r.childBefore(o));){let a=l.lastChild;if(!a||!a.type.isError||a.fromkp(i,r)}var $1=Ke.parser.configure({top:\"SingleExpression\"}),Qp=[{tag:\"script\",attrs:n=>n.type==\"text/typescript\"||n.lang==\"ts\",parser:Ca.parser},{tag:\"script\",attrs:n=>n.type==\"text/babel\"||n.type==\"text/jsx\",parser:Aa.parser},{tag:\"script\",attrs:n=>n.type==\"text/typescript-jsx\",parser:Ra.parser},{tag:\"script\",attrs(n){return/^(importmap|speculationrules|application\\/(.+\\+)?json)$/i.test(n.type)},parser:$1},{tag:\"script\",attrs(n){return!n.type||/^(?:text|application)\\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:Ke.parser},{tag:\"style\",attrs(n){return(!n.lang||n.lang==\"css\")&&(!n.type||/^(text\\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:Ln.parser}],vp=[{name:\"style\",parser:Ln.parser.configure({top:\"Styles\"})}].concat(yp.map(n=>({name:n,parser:Ke.parser}))),$p=Lt.define({name:\"html\",parser:Id.configure({props:[mt.add({Element(n){let e=/^(\\s*)(<\\/)?/.exec(n.textAfter);return n.node.to<=n.pos+e[0].length?n.continue():n.lineIndent(n.node.from)+(e[2]?0:n.unit)},\"OpenTag CloseTag SelfClosingTag\"(n){return n.column(n.node.from)+n.unit},Document(n){if(n.pos+/\\s*/.exec(n.textAfter)[0].lengthn.getChild(\"TagName\")})]}),languageData:{commentTokens:{block:{open:\"\"}},indentOnInput:/^\\s*<\\/\\w+\\W$/,wordChars:\"-_\"}}),ds=$p.configure({wrap:ka(Qp,vp)});function ps(n={}){let e=\"\",t;n.matchClosingTags===!1&&(e=\"noMatch\"),n.selfClosingTags===!0&&(e=(e?e+\" \":\"\")+\"selfClosing\"),(n.nestedLanguages&&n.nestedLanguages.length||n.nestedAttributes&&n.nestedAttributes.length)&&(t=ka((n.nestedLanguages||[]).concat(Qp),(n.nestedAttributes||[]).concat(vp)));let i=t?$p.configure({wrap:t,dialect:e}):e?ds.configure({dialect:e}):ds;return new Ge(i,[ds.data.of({autocomplete:v1(n)}),n.autoCloseTags!==!1?T1:[],us().support,fs().support])}var gp=new Set(\"area base br col command embed frame hr img input keygen link meta param source track wbr menuitem\".split(\" \"));function P1(n,e,t){for(var i;;){if(((i=e.lastChild)===null||i===void 0?void 0:i.name)!=\"CloseTag\")return!1;let r=e.parent;if(!r||di(n,r)!=t)return!0;e=r}}var T1=v.inputHandler.of((n,e,t,i,r)=>{if(n.composing||n.state.readOnly||e!=t||i!=\">\"&&i!=\"/\"||!ds.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var h;let c=o.doc.sliceString(a.from-1,a.to)==i,{head:f}=a,u=z(o).resolveInner(f,-1),d;if(c&&i==\">\"&&u.name==\"EndTag\"){let p=u.parent;if((d=di(o.doc,p.parent,f))&&!gp.has(d)&&!P1(o.doc,p.parent,d)){let O=f+(o.doc.sliceString(f,f+1)===\">\"?1:0),g=``;return{range:a,changes:{from:f,to:O,insert:g}}}}else if(c&&i==\"/\"&&u.name==\"IncompleteCloseTag\"){let p=u.parent;if(u.from==f-2&&((h=p.lastChild)===null||h===void 0?void 0:h.name)!=\"CloseTag\"&&(d=di(o.doc,p,f))&&!gp.has(d)){let O=f+(o.doc.sliceString(f,f+1)===\">\"?1:0),g=`${d}>`;return{range:x.cursor(f+g.length,-1),changes:{from:f,to:O,insert:g}}}}return{range:a}});return l.changes.empty?!1:(n.dispatch([s,o.update(l,{userEvent:\"input.complete\",scrollIntoView:!0})]),!0)});var Cp=gn({commentTokens:{block:{open:\"\"}}}),Ap=new E,Rp=pd.configure({props:[gt.add(n=>!n.is(\"Block\")||n.is(\"Document\")||_a(n)!=null||C1(n)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Ap.add(_a),mt.add({Document:()=>null}),Et.add({Document:Cp})]});function _a(n){let e=/^(?:ATX|Setext)Heading(\\d)$/.exec(n.name);return e?+e[1]:void 0}function C1(n){return n.name==\"OrderedList\"||n.name==\"BulletList\"}function A1(n,e){let t=n;for(;;){let i=t.nextSibling,r;if(!i||(r=_a(i.type))!=null&&r<=e)break;t=i}return t.to}var R1=xf.of((n,e,t)=>{for(let i=z(n).resolveInner(t,-1);i&&!(i.fromt)return{from:t,to:s}}return null});function ja(n){return new be(Cp,n,[],\"markdown\")}var Z1=ja(Rp),X1=Rp.configure([ls,yd,bd,Sd,{props:[gt.add({Table:(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}]),Os=ja(X1);function M1(n,e){return t=>{if(t&&n){let i=null;if(t=/\\S*/.exec(t)[0],typeof n==\"function\"?i=n(t):i=Ot.matchLanguageName(n,t,!0),i instanceof Ot)return i.support?i.support.language.parser:On.getSkippingParser(i.load());if(i)return i.parser}return e?e.parser:null}}var jn=class{constructor(e,t,i,r,s,o,l){this.node=e,this.from=t,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=l}blank(e,t=!0){let i=this.spaceBefore+(this.node.name==\"Blockquote\"?\">\":\"\");if(e!=null){for(;i.length0;r--)i+=\" \";return i+(t?this.spaceAfter:\"\")}}marker(e,t){let i=this.node.name==\"OrderedList\"?String(+Xp(this.item,e)[2]+t):\"\";return this.spaceBefore+i+this.type+this.spaceAfter}};function Zp(n,e){let t=[],i=[];for(let r=n;r;r=r.parent){if(r.name==\"FencedCode\")return i;(r.name==\"ListItem\"||r.name==\"Blockquote\")&&t.push(r)}for(let r=t.length-1;r>=0;r--){let s=t[r],o,l=e.lineAt(s.from),a=s.from-l.from;if(s.name==\"Blockquote\"&&(o=/^ *>( ?)/.exec(l.text.slice(a))))i.push(new jn(s,a,a+o[0].length,\"\",o[1],\">\",null));else if(s.name==\"ListItem\"&&s.parent.name==\"OrderedList\"&&(o=/^( *)\\d+([.)])( *)/.exec(l.text.slice(a)))){let h=o[3],c=o[0].length;h.length>=4&&(h=h.slice(0,h.length-4),c-=4),i.push(new jn(s.parent,a,a+c,o[1],h,o[2],s))}else if(s.name==\"ListItem\"&&s.parent.name==\"BulletList\"&&(o=/^( *)([-+*])( {1,4}\\[[ xX]\\])?( +)/.exec(l.text.slice(a)))){let h=o[4],c=o[0].length;h.length>4&&(h=h.slice(0,h.length-4),c-=4);let f=o[2];o[3]&&(f+=o[3].replace(/[xX]/,\" \")),i.push(new jn(s.parent,a,a+c,o[1],h,f,s))}}return i}function Xp(n,e){return/^(\\s*)(\\d+)(?=[.)])/.exec(e.sliceString(n.from,n.from+10))}function La(n,e,t,i=0){for(let r=-1,s=n;;){if(s.name==\"ListItem\"){let l=Xp(s,e),a=+l[2];if(r>=0){if(a!=r+1)return;t.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+i)})}r=a}let o=s.nextSibling;if(!o)break;s=o}}function Ya(n,e){let t=/^[ \\t]*/.exec(n)[0].length;if(!t||e.facet(zt)!=\"\t\")return n;let i=Pe(n,4,t),r=\"\";for(let s=i;s>0;)s>=4?(r+=\"\t\",s-=4):(r+=\" \",s--);return r+n.slice(t)}var E1=(n={})=>({state:e,dispatch:t})=>{let i=z(e),{doc:r}=e,s=null,o=e.changeByRange(l=>{if(!l.empty||!Os.isActiveAt(e,l.from,-1)&&!Os.isActiveAt(e,l.from,1))return s={range:l};let a=l.from,h=r.lineAt(a),c=Zp(i.resolveInner(a,-1),r);for(;c.length&&c[c.length-1].from>a-h.from;)c.pop();if(!c.length)return s={range:l};let f=c[c.length-1];if(f.to-f.spaceAfter.length>a-h.from)return s={range:l};let u=a>=f.to-f.spaceAfter.length&&!/\\S/.test(h.text.slice(f.to));if(f.item&&u){if(f.item.from]*$/.test(h.text.slice(0,f.to)))return s={range:l};let b=f.node.firstChild,y=f.node.getChild(\"ListItem\",\"ListItem\");if(b.to>=a||y&&y.to0&&!/[^\\s>]/.test(r.lineAt(h.from-1).text)||n.nonTightLists===!1){let S=c.length>1?c[c.length-2]:null,C,w=\"\";S&&S.item?(C=h.from+S.from,w=S.marker(r,1)):C=h.from+(S?S.to:0);let P=[{from:C,to:a,insert:w}];return f.node.name==\"OrderedList\"&&La(f.item,r,P,-2),S&&S.node.name==\"OrderedList\"&&La(S.item,r,P),{range:x.cursor(C+w.length),changes:P}}else{let S=Tp(c,e,h);return{range:x.cursor(a+S.length+1),changes:{from:h.from,insert:S+e.lineBreak}}}}if(f.node.name==\"Blockquote\"&&u&&h.from){let b=r.lineAt(h.from-1),y=/>\\s*$/.exec(b.text);if(y&&y.index==f.from){let S=e.changes([{from:b.from+y.index,to:b.to},{from:h.from+f.from,to:h.to}]);return{range:l.map(S),changes:S}}}let d=[];f.node.name==\"OrderedList\"&&La(f.item,r,d);let p=f.item&&f.item.from]*/.exec(h.text)[0].length>=f.to)for(let b=0,y=c.length-1;b<=y;b++)O+=b==y&&!p?c[b].marker(r,1):c[b].blank(bh.from&&/\\s/.test(h.text.charAt(g-h.from-1));)g--;return O=Ya(O,e),z1(f.node,e.doc)&&(O=Tp(c,e,h)+e.lineBreak+O),d.push({from:g,to:a,insert:e.lineBreak+O}),{range:x.cursor(g+O.length+1),changes:d}});return s?!1:(t(e.update(o,{scrollIntoView:!0,userEvent:\"input\"})),!0)},L1=E1();function Pp(n){return n.name==\"QuoteMark\"||n.name==\"ListMark\"}function z1(n,e){if(n.name!=\"OrderedList\"&&n.name!=\"BulletList\")return!1;let t=n.firstChild,i=n.getChild(\"ListItem\",\"ListItem\");if(!i)return!1;let r=e.lineAt(t.to),s=e.lineAt(i.from),o=/^[\\s>]*$/.test(r.text);return r.number+(o?0:1){let t=z(n),i=null,r=n.changeByRange(s=>{let o=s.from,{doc:l}=n;if(s.empty&&Os.isActiveAt(n,s.from)){let a=l.lineAt(o),h=Zp(_1(t,o),l);if(h.length){let c=h[h.length-1],f=c.to-c.spaceAfter.length+(c.spaceAfter?1:0);if(o-a.from>f&&!/\\S/.test(a.text.slice(f,o-a.from)))return{range:x.cursor(a.from+f),changes:{from:a.from+f,to:o}};if(o-a.from==f&&(c.item&&a.from<=c.item.from||/^[\\s>]*$/.test(a.text.slice(0,c.to)))){let u=a.from+c.from;if(c.item&&c.node.from{var t;let{main:i}=e.state.selection;if(i.empty)return!1;let r=(t=n.clipboardData)===null||t===void 0?void 0:t.getData(\"text/plain\");if(!r||!/^(https?:\\/\\/|mailto:|xmpp:|www\\.)/.test(r)||(/^www\\./.test(r)&&(r=\"https://\"+r),!Os.isActiveAt(e.state,i.from,1)))return!1;let s=z(e.state),o=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||I1.test(l.name))&&(o=!0)},leave:l=>{l.tot.to>=n.from&&t.from<=n.to)}function F1(n){let e=n.parent;for(;e!==null;){if(U1(e.name))return{from:e.from,to:e.to};e=e.parent}let t=n.parent;return t===null?{from:n.from,to:n.to}:{from:t.from,to:t.to}}function H1(n,e,t,i){let r=[],s=i===void 0?null:qp(i.sliceString(0,t));return n.iterate({from:0,to:t,enter(o){if(s!==null&&o.from=i.to||a.to>=n.doc.length);)a=n.doc.lineAt(a.to+1)}}),[...t.entries()].map(([i,r])=>({from:i,columns:r})).sort((i,r)=>i.from-r.from)}function Na(n,e,t){return n.sliceString(e,t).toLowerCase()!==\"[ ]\"}function tx(n,e=0){let t=[];return z(n).iterate({from:0,to:n.doc.length,enter(i){if(i.from=i.to||t.push({from:s,to:i.to})}}),t}function ix(n,e=0){let t=[];return z(n).iterate({from:0,to:n.doc.length,enter(i){if(!(i.from=i.to||r.to>=n.doc.length);)r=n.doc.lineAt(r.to+1)}}),t}var rx=new Map([[\"&\",\"&\"],[\"<\",\"<\"],[\">\",\">\"],[\""\",'\"'],[\"'\",\"'\"],[\" \",\"\\xA0\"]]);function sx(n){let e=rx.get(n.toLowerCase());if(e!==void 0)return e;let t=/^&#(x[0-9a-f]+|\\d+);$/i.exec(n);if(t===null)return null;let i=t[1],r=i[0].toLowerCase()===\"x\"?Number.parseInt(i.slice(1),16):Number.parseInt(i,10);return!Number.isInteger(r)||r<=0||r>1114111||r>=55296&&r<=57343?null:String.fromCodePoint(r)}var ox=/^$/i;function Da(n,e){return n===null?e:e===null?n:`${n} ${e}`}var Va=/!?\\[\\[([^[\\]]+)\\]\\]/g;function Lp(n,e){let t=e.from,i=n.doc.sliceString(e.from,e.to),r=new Array(i.length).fill(null),s=new Array(i.length).fill(!1),o=new Map,l=[],a=(u,d,p)=>{for(let O=u;Oe.to||u.to<=u.from)return;if(Dp.has(u.name)||Vp(u.node)){for(let g=u.from;gy.fromd))continue;let O=u[1],g=O.lastIndexOf(\"|\"),b=g===-1?O:O.slice(g+1);o.set(d,{to:p,text:Pn(b).trim(),className:Da(r[u.index],\"cm-lp-link\")})}let h=[],c=(u,d)=>{u!==\"\"&&h.push({text:u,className:d})};for(let u=0;u{let i=t.trim(),r=i.startsWith(\":\"),s=i.endsWith(\":\");return r&&s?\"center\":s?\"right\":r?\"left\":null})}function zp(n){let e=[],t=[];for(let s=n.firstChild;s!==null;s=s.nextSibling)s.name===\"TableDelimiter\"?e.push({from:s.from,to:s.to}):s.name===\"TableCell\"&&t.push(s.node);let i=[],r=n.from;for(let s of e)i.push({from:r,to:s.from}),r=s.to;return i.push({from:r,to:n.to}),i.length>0&&i[0].to<=i[0].from&&i.shift(),i.length>0&&i[i.length-1].to<=i[i.length-1].from&&i.pop(),i.map(s=>t.find(o=>o.from>=s.from&&o.to<=s.to)??null)}function ax(n,e){let t=[],i=null,r=[];for(let l=e.firstChild;l!==null;l=l.nextSibling){if(l.name===\"TableHeader\"){i=zp(l).map(a=>a===null?[]:Lp(n,a));continue}if(l.name===\"TableRow\"){r.push(zp(l).map(a=>a===null?[]:Lp(n,a)));continue}l.name===\"TableDelimiter\"&&t.length===0&&(t=lx(n.doc.sliceString(l.from,l.to)))}if(i===null||i.length===0)return null;let s=i.length,o=r.map(l=>{let a=l.slice(0,s);for(;a.length{s.append(this.drawCell(\"th\",l,a))}),r.append(s),i.append(r);let o=document.createElement(\"tbody\");for(let l of this.grid.rows){let a=document.createElement(\"tr\");l.forEach((h,c)=>{a.append(this.drawCell(\"td\",h,c))}),o.append(a)}return i.append(o),t.append(i),t}drawCell(t,i,r){let s=document.createElement(t),o=this.grid.align[r]??null;if(o!==null&&s.classList.add(`cm-lp-grid-${o}`),i.every(a=>a.text.trim()===\"\"))return s.classList.add(\"cm-lp-grid-empty\"),s;for(let a of i)a.text.split(`\n`).forEach((c,f)=>{if(f>0&&s.append(document.createElement(\"br\")),c===\"\")return;if(a.className===null){s.append(document.createTextNode(c));return}let u=document.createElement(\"span\");u.className=a.className,u.textContent=c,s.append(u)});return s}},Wa=class extends he{eq(){return!0}toDOM(){let e=document.createElement(\"span\");return e.className=\"cm-lp-bullet\",e.textContent=\"\\u2022\",e}ignoreEvent(){return!1}},Ba=class extends he{constructor(t){super();this.checked=t}eq(t){return t.checked===this.checked}toDOM(){let t=document.createElement(\"span\");t.className=this.checked?\"cm-lp-task cm-lp-task-on\":\"cm-lp-task\",t.setAttribute(\"role\",\"checkbox\"),t.setAttribute(\"aria-checked\",this.checked?\"true\":\"false\");let i=document.createElement(\"span\");return i.className=\"cm-lp-task-box\",t.append(i),t}ignoreEvent(){return!1}},cx=\"html-preview\";function fx(n,e){let t=e.getChild(\"CodeInfo\");if(t===null)return null;let i=n.sliceString(t.from,t.to).trim().split(/\\s+/)[0];return i===void 0||i===\"\"?null:i.toLowerCase()}function ux(n,e){let t=e.getChildren(\"CodeMark\"),i=t[0];if(i===void 0)return\"\";let r=n.lineAt(i.from).to+1;if(r>n.length)return\"\";let s=t.length>1?t[t.length-1]:null,o=s===null?e.to:n.lineAt(s.from).from-1;return r>=o?\"\":n.sliceString(r,o)}function dx(n,e=0){let t=[],i=Np(n);return z(n).iterate({from:0,to:n.doc.length,enter(r){if(r.from\n\n\n\n${n}\n`}var qa=class extends he{constructor(t){super();this.html=t}eq(t){return t.html===this.html}toDOM(){let t=document.createElement(\"div\");t.className=\"cm-lp-preview\";let i=document.createElement(\"iframe\");return i.className=\"cm-lp-preview-frame\",i.setAttribute(\"sandbox\",\"\"),i.setAttribute(\"srcdoc\",Ox(this.html)),i.setAttribute(\"title\",\"Rendered preview\"),i.setAttribute(\"loading\",\"lazy\"),t.append(i),t}ignoreEvent(){return!1}},mx=v.domEventHandlers({mousedown(n,e){let t=n.target;if(!(t instanceof HTMLElement))return!1;let i=t.closest(\".cm-lp-task\");if(i===null||e.state.readOnly)return!1;let r=e.posAtDOM(i)+1,s=gx(z(e.state).resolveInner(r,1),\"TaskMarker\");return s===null?!1:(e.dispatch({changes:{from:s.from,to:s.to,insert:Na(e.state.doc,s.from,s.to)?\"[ ]\":\"[x]\"},userEvent:\"input\"}),n.preventDefault(),!0)}});function gx(n,e){for(let t=n;t!==null;t=t.parent)if(t.name===e)return t;return null}function Np(n){return n.readOnly?[]:n.selection.ranges.map(e=>({from:e.from,to:e.to}))}function _p(n){let e=z(n),t=Np(n),i=qp(n.doc.toString()),r=i===null?0:i.to,s=[];if(i!==null)for(let O=n.doc.lineAt(i.from);O.from<=i.to&&(s.push(J1.range(O.from)),!(O.to>=n.doc.length));O=n.doc.lineAt(O.to+1));for(let O of ex(n,r))s.push(L.line({class:\"cm-lp-li\",attributes:{style:`padding-left:${O.columns}ch;text-indent:-${O.columns}ch`}}).range(O.from));let o=hx(n,r),l=O=>o.some(g=>O>=g.from&&OL.mark({class:\"cm-lp-task-done\"}).range(O.from,O.to)),h=dx(n,r),c=_u(n,r),f=O=>h.some(g=>O>=g.from&&OO>=g.from&&O!f(O.from)).map(O=>K1.range(O.from,O.to));for(let O of h)d.push(L.replace({widget:new qa(O.html),block:!0}).range(O.from,O.to));let p=n.facet(Jr);for(let O of c)d.push(L.replace({widget:new Kr(O,p),block:!0}).range(O.from,O.to));for(let O of o)d.push(L.replace({widget:new Ia(O),block:!0}).range(O.from,O.to));for(let O of ix(n,r))d.push(L.replace({widget:O.kind===\"bullet\"?new Wa:new Ba(O.checked)}).range(O.from,O.to));return N.of([...s,...u,...a,...d],!0)}function Gp(){return[ae.define({create:e=>_p(e),update(e,t){let i=t.startState.readOnly!==t.state.readOnly,r=z(t.state)!==z(t.startState);return!t.docChanged&&!t.selection&&!i&&!r?e:_p(t.state)},provide:e=>v.decorations.from(e)}),mx]}var Up=`\n.cm-lp-h1, .cm-lp-h2, .cm-lp-h3, .cm-lp-h4, .cm-lp-h5, .cm-lp-h6 {\n font-weight: 600;\n color: var(--lp-heading);\n line-height: 1.3;\n}\n/*\n Measured off Obsidian mobile rather than chosen: 1.625em, 1.3em and 1.15em\n against a 16px body. The multiples were 1.7 / 1.4 / 1.2, which is a wider\n ladder than a document needs and made an H1 the loudest thing on a phone\n screen that is mostly body text.\n*/\n.cm-lp-h1 { font-size: 1.625em; }\n.cm-lp-h2 { font-size: 1.3em; }\n.cm-lp-h3 { font-size: 1.15em; }\n.cm-lp-h4, .cm-lp-h5, .cm-lp-h6 { font-size: 1.05em; }\n/*\n A note's metadata, drawn as metadata. Not hidden: the buffer is the Markdown,\n and a block the editor refuses to show is a block you cannot fix. See\n frontmatterRange above for what this replaced. (No backticks in this comment:\n it is inside a template literal and one would end the string.)\n*/\n.cm-lp-frontmatter {\n font-family: var(--lp-mono);\n font-size: 0.82em;\n line-height: 1.7;\n color: var(--lp-muted);\n}\n.cm-lp-strong { font-weight: 650; color: var(--lp-heading); }\n.cm-lp-em { font-style: italic; }\n.cm-lp-strike { text-decoration: line-through; opacity: 0.7; }\n.cm-lp-code {\n font-family: var(--lp-mono);\n font-size: 0.92em;\n background: var(--lp-code-bg);\n border-radius: 4px;\n padding: 0.1em 0.32em;\n}\n.cm-lp-fence {\n font-family: var(--lp-mono);\n font-size: 0.92em;\n background: var(--lp-code-bg);\n}\n/*\n R3 in the sweep: a fence in one of the three languages the bundle already\n carries (see FENCE_LANGUAGES) is coloured with tokens this file already has\n rather than a new one \\u2014 see fenceHighlightStyle's own comment for why.\n*/\n.cm-lp-code-keyword { color: var(--lp-link); }\n.cm-lp-code-string { color: var(--lp-heading); }\n.cm-lp-code-comment { color: var(--lp-muted); font-style: italic; }\n/*\n A rendered html-preview fence. See HtmlPreviewWidget for what is inside the\n frame and why nothing inside it can run.\n\n ## The height is fixed, and that is a gap rather than a choice\n\n Nothing here can measure the frame. Sizing an iframe to its content means\n script inside it reporting a height out, and script inside it is the one thing\n this feature never allows; the frame is also cross-origin by construction, so\n the host cannot reach in and read it either. So the box is a number, and it\n errs tall: a diagram drawn short leaves empty space under it, and a diagram\n drawn tall loses its bottom third. The second is the failure a reader notices.\n\n ## overflow: hidden is not tidying\n\n The markup in the fence may have been emailed in by a stranger, and a layout\n that escapes its box draws over real console UI \\u2014 a toolbar, a save state, a\n privacy control. The clip is on the wrapper, so nothing the frame's own CSS\n does can widen it, and max-height keeps the box inside the viewport on a phone\n where 620px is most of the screen.\n\n pointer-events: none on the frame is what lets a click reach the editor and\n reveal the source. See the widget's comment.\n*/\n.cm-lp-preview {\n overflow: hidden;\n margin: 0.5em 0;\n border: 1px solid var(--lp-code-bg);\n border-radius: 8px;\n background: var(--lp-code-bg);\n}\n.cm-lp-preview-frame {\n display: block;\n width: 100%;\n height: 620px;\n max-height: 80vh;\n border: 0;\n pointer-events: none;\n}\n.cm-lp-quote { color: var(--lp-muted); font-style: italic; }\n.cm-lp-link { color: var(--lp-link); text-decoration: underline; }\n/*\n A list item's indent is arithmetic rather than taste, and it is not here: the\n padding and the negative text-indent are one number set per line by the\n decoration, because it depends on how wide that item's own marker is, so the\n first line starts at the margin with its marker and every wrapped line clears\n it. See hangingIndents. What is here is only the marker's colour.\n*/\n.cm-lp-list-mark { color: var(--lp-muted); }\n/*\n Both widgets hold the width of the characters they replaced, so the hanging\n indent above stays true on a wrapped line. A bullet stands in for one\n character and a checkbox for three.\n\n ## text-indent: 0 is not tidying, it is the whole of \"bullets look broken\"\n\n The hanging indent is padding-left:Nch with text-indent:-Nch on the line,\n which puts the first line's content back at the margin and every wrapped line\n clear of the marker. TEXT-INDENT IS INHERITED, and both of these are\n inline-level boxes with their own inner line box \\u2014 so each widget applied the\n line's negative indent a second time, inside itself. Measured in a browser at\n 390pt: the bullet glyph drew at -20.4px, a full indent OUTSIDE the reading\n margin, while the text after it started correctly at 10.2px. A bullet adrift\n in the left gutter, a third of an inch from the line it belongs to \\u2014 and a\n nested item, whose indent is twice as deep, drew its bullet off the left edge\n of the screen entirely.\n\n An ordered list was never affected and that is the tell: \"1.\" is real text,\n not a widget, so it took the indent once and landed correctly. Only what was\n replaced went wrong.\n*/\n.cm-lp-bullet {\n display: inline-block;\n width: 1ch;\n text-indent: 0;\n color: var(--lp-muted);\n}\n/*\n The checkbox, and the reason it is drawn rather than written.\n\n It used to be the character U+2610, which is text: it takes the body font's\n weight, it is a different shape in every font that has it, plenty of fonts do\n not have it at all, and none of them looks like something you press. A border\n and a radius do not depend on a font being installed and do not change weight\n when the text around them does.\n\n The outer span is the three columns the source characters occupied and the box\n is centred in them, so a list mixing tasks and plain items keeps its text in\n one column.\n*/\n.cm-lp-task {\n display: inline-flex;\n align-items: center;\n /* Inherited text-indent, for .cm-lp-bullet's reason. */\n text-indent: 0;\n justify-content: center;\n width: 3ch;\n cursor: pointer;\n /* The press is the whole point; the system callout is the other thing that\n answers a long press over it. */\n -webkit-touch-callout: none;\n}\n.cm-lp-task-box {\n position: relative;\n box-sizing: border-box;\n width: 0.95em;\n height: 0.95em;\n border: 1.5px solid var(--lp-muted);\n border-radius: 3px;\n /* A hair below the text baseline, where a checkbox sits beside a line of\n prose rather than floating in the middle of it. */\n transform: translateY(0.04em);\n}\n.cm-lp-task-on .cm-lp-task-box {\n background: var(--lp-link);\n border-color: var(--lp-link);\n}\n/*\n The tick: two borders on a rotated box, which is the construction that needs\n no font and no image. Drawn in the editor background so it reads as cut out of\n the filled square rather than painted on it.\n*/\n.cm-lp-task-on .cm-lp-task-box::after {\n content: \"\";\n position: absolute;\n left: 0.27em;\n top: 0.09em;\n width: 0.17em;\n height: 0.40em;\n border: solid var(--lp-bg);\n border-width: 0 1.6px 1.6px 0;\n transform: rotate(45deg);\n}\n/*\n A finished task, drawn as finished \\u2014 the half of a checkbox that a one-column\n glyph could never carry. This is what lets somebody skim a list and see what\n is left without reading it.\n*/\n.cm-lp-task-done {\n color: var(--lp-muted);\n text-decoration: line-through;\n text-decoration-thickness: 1px;\n}\n/*\n AN EDITABLE table is not laid out \\u2014 the pipes are still the author's \\u2014 but it\n is drawn in the mono face, which is what makes the columns of a table that\n fits line up. A reader gets the grid below instead. See tableLines and\n tableGrids.\n*/\n.cm-lp-table {\n font-family: var(--lp-mono);\n font-size: 0.86em;\n}\n.cm-lp-table-delim { color: var(--lp-muted); }\n/*\n A TABLE, LAID OUT FOR A READER.\n\n Hairlines and nothing else: no outer box, no fill, no zebra. A table in a\n note is part of the document rather than a panel sitting on it, and every\n edge spent here is an edge competing with the note's own structure. What\n separates the header from the body is one stronger rule, which is the only\n place this needs weight.\n\n The scroller is the wrapper, so a table wider than the measure scrolls in its\n own box rather than dragging the whole note sideways.\n*/\n.cm-lp-grid {\n overflow-x: auto;\n margin: 0.4em 0;\n}\n.cm-lp-grid-table {\n border-collapse: collapse;\n /*\n Sized by its content rather than stretched to the measure. A two-column\n table pushed to full width puts a hand-span of nothing between the label\n and its value, which is harder to read than the pipes were.\n */\n width: auto;\n max-width: 100%;\n font-size: 0.94em;\n line-height: 1.5;\n /* Digits in a column line up, which is most of why a column of them exists. */\n font-variant-numeric: tabular-nums;\n}\n.cm-lp-grid-table th {\n font-weight: 600;\n color: var(--lp-heading);\n text-align: left;\n padding: 7px 14px 8px;\n border-bottom: 1px solid var(--lp-line-strong);\n /*\n A header is a label, and a label that wraps to two lines over a one-line\n column is the table drawing attention to its own chrome.\n */\n white-space: nowrap;\n}\n.cm-lp-grid-table td {\n padding: 8px 14px;\n border-top: 1px solid var(--lp-line);\n vertical-align: top;\n color: var(--lp-content);\n}\n/*\n The outer columns lose their side padding, so the grid's own edges line up\n with the paragraph above it. Without this a table reads as indented from the\n text around it by however much cell padding happens to be, which is the one\n thing that gives away a rendered block as a rendered block.\n*/\n.cm-lp-grid-table tr > :first-child { padding-left: 0; }\n.cm-lp-grid-table tr > :last-child { padding-right: 0; }\n.cm-lp-grid-left { text-align: left; }\n.cm-lp-grid-center { text-align: center; }\n.cm-lp-grid-right { text-align: right; }\n/*\n An empty cell says so. Drawn as nothing it is indistinguishable from a column\n that failed to render, and a reader cannot tell which they are looking at.\n*/\n.cm-lp-grid-empty::after {\n content: \"\\u2014\";\n color: var(--lp-muted);\n}\n.cm-lp-rule { color: var(--lp-muted); }\n/*\n A FORM, DRAWN FROM ITS DECLARATION.\n\n Every colour here is one of the --lp-* properties the host already sets from\n the palette in force, so the form follows the theme without this file naming a\n single value \\u2014 the rule the rest of these styles follow. --lp-code-bg is the\n one that does the most work: it is a translucent ink rather than a fixed grey,\n so it darkens a light ground and lightens a dark one, which is exactly what a\n field's fill and a card's hairline both want.\n\n The card is the same object as the note around it rather than a panel floating\n over it: one hairline, the page's own background, and the reading measure. A\n raised surface would be a second document inside the note, which is what the\n diagram frame beside it is and what a form is not.\n*/\n.cm-lp-form {\n /*\n A real hairline. This was --lp-code-bg, which is the code fence's FILL:\n #F5F5F5 on a #FFFFFF ground, so in light mode the card had no visible edge\n at all and the form read as loose controls dropped into the note. --lp-line\n is the palette's own separator and is the same value every hairline in the\n app is drawn in.\n */\n border: 1px solid var(--lp-line);\n /*\n One radius family \\u2014 10 on the card, 8 on the field, 8 on the button. It was\n 12 / 9 / 11, three radii no two of which agreed, which is what made a small\n card read as three unrelated objects stacked up.\n */\n border-radius: 10px;\n /* The padding belongs to the three bands inside, so their rules can run edge\n to edge. */\n overflow: hidden;\n margin: 0.6em 0;\n font-family: var(--lp-body);\n font-size: 0.94em;\n line-height: 1.45;\n color: var(--lp-content);\n}\n/*\n WHAT THIS BOX IS, AND WHERE WHAT YOU TYPE GOES.\n\n See FormWidget.drawHead. The destination is the half that earns the strip:\n responses live in a sister note by design, and a reader had no way to learn\n which one before pressing Submit.\n*/\n.cm-lp-form-head {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 10px;\n flex-wrap: wrap;\n padding: 9px 14px;\n border-bottom: 1px solid var(--lp-line);\n background: var(--lp-code-bg);\n}\n.cm-lp-form-kind {\n font-family: var(--lp-mono);\n font-size: 0.72em;\n letter-spacing: 0.1em;\n text-transform: uppercase;\n color: var(--lp-muted);\n}\n.cm-lp-form-dest { font-size: 0.82em; color: var(--lp-muted); }\n.cm-lp-form-dest-path { font-family: var(--lp-mono); color: var(--lp-content); }\n.cm-lp-form-fields {\n display: flex;\n flex-direction: column;\n gap: 14px;\n padding: 14px;\n}\n.cm-lp-form-row { display: flex; flex-direction: column; gap: 6px; }\n/* The label and its character count, on one line. */\n.cm-lp-form-top {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 10px;\n}\n/*\n A field's name is its label verbatim, with underscores spaced out. Sentence\n case is left alone rather than title-cased: the author wrote the name, and a\n form that renames somebody's field on screen is a form whose error messages\n are about a field they cannot find.\n*/\n.cm-lp-form-label {\n /*\n Small, spaced and upper-case: a field name is a label rather than a\n sentence, and at 0.85em in sentence case it read as body copy that happened\n to be grey \\u2014 the note's own prose and the form's chrome in the same voice.\n The name itself is still verbatim; see drawField.\n */\n font-size: 0.76em;\n font-weight: 600;\n letter-spacing: 0.07em;\n text-transform: uppercase;\n color: var(--lp-muted);\n}\n/*\n The word rather than an asterisk. An asterisk has to be learned, is invisible\n to a screen reader that announces punctuation differently, and at 0.85em is\n three pixels of ink carrying the difference between a form that submits and\n one that is refused.\n*/\n.cm-lp-form-required {\n font-weight: 500;\n /* Not upper-cased with the name: it is a note about the field, not part of\n what the field is called. */\n text-transform: none;\n letter-spacing: 0.02em;\n color: var(--lp-muted);\n opacity: 0.85;\n}\n.cm-lp-form-input {\n display: block;\n width: 100%;\n box-sizing: border-box;\n font: inherit;\n font-family: var(--lp-body);\n color: var(--lp-content);\n background: var(--lp-code-bg);\n /*\n A real border at rest rather than a transparent one. A filled slab with no\n edge is a block of colour; the edge is what says \"you type in here\", and\n without it the only thing distinguishing a field from a code span was its\n width.\n */\n border: 1px solid var(--lp-line-strong);\n border-radius: 8px;\n padding: 8px 10px;\n /* Safari draws its own rounded fill over the one above without this. */\n -webkit-appearance: none;\n appearance: none;\n}\n.cm-lp-form-input::placeholder { color: var(--lp-muted); opacity: 0.7; }\n/* The two controls that are meaningless at full width and a target at 18px. */\n.cm-lp-form-input[type=\"checkbox\"] { width: 18px; height: 18px; accent-color: var(--lp-link); }\n.cm-lp-form-input[type=\"date\"], .cm-lp-form-input[type=\"number\"] { width: auto; min-width: 10em; }\n.cm-lp-form-input:focus {\n outline: none;\n border-color: var(--lp-link);\n /*\n A ring as well as the border. The border alone moves one pixel of colour on\n focus, which is not enough to find the field you just tabbed to \\u2014 and this\n is the control a keyboard user reaches Submit through.\n */\n box-shadow: 0 0 0 3px var(--lp-focus-ring);\n}\ntextarea.cm-lp-form-input { resize: vertical; min-height: 5em; }\n/*\n Right-aligned under the box it counts, in the muted ink: it is a fact about\n the room left rather than a message, and reading order should reach the next\n field before it.\n*/\n.cm-lp-form-count {\n font-size: 0.76em;\n color: var(--lp-muted);\n /* Digits that change under the reader's eye must not move the label. */\n font-variant-numeric: tabular-nums;\n}\n.cm-lp-form-foot {\n display: flex;\n align-items: center;\n gap: 12px;\n flex-wrap: wrap;\n padding: 11px 14px;\n /* The action is separated from the fields rather than being the next thing\n in the stack \\u2014 pressing it is not the same kind of act as filling one in. */\n border-top: 1px solid var(--lp-line);\n}\n/*\n The app's primary button, in CSS: the accent fill, white ink, 11px corners and\n a 15px label. It is the one filled thing in the note, which is what a button\n in a document should be.\n*/\n.cm-lp-form-submit {\n font: inherit;\n font-family: var(--lp-body);\n font-weight: 600;\n color: #ffffff;\n background: var(--lp-link);\n border: none;\n border-radius: 8px;\n padding: 7px 16px;\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n}\n.cm-lp-form-submit:focus-visible { outline: 2px solid var(--lp-link); outline-offset: 2px; }\n.cm-lp-form-submit:disabled { opacity: 0.45; cursor: default; }\n.cm-lp-form-status { font-size: 0.88em; color: var(--lp-muted); }\n.cm-lp-form-status-ok { color: var(--lp-link); font-weight: 600; }\n/*\n A refusal is drawn in the muted ink at full weight rather than in red. There\n is no --lp-danger, and inventing a hex here would be the one colour in this\n file that does not follow the theme \\u2014 the failure the file's own header names.\n Weight carries it, and the words carry the rest.\n*/\n.cm-lp-form-status-bad { color: var(--lp-content); font-weight: 600; }\n.cm-lp-form-status-quiet { opacity: 0.75; }\n/*\n The sister file's rows, as the card's fourth band.\n\n Its own padding and no margin, because the card is now edge-to-edge bands\n separated by rules (see .cm-lp-form) rather than one padded box \\u2014 a margin\n here would inset the rule and leave the rows flush against the border. The\n title takes the same small upper-case voice as a field label, so the two\n headings inside one card agree.\n*/\n.cm-lp-form-responses {\n border-top: 1px solid var(--lp-line);\n padding: 14px;\n}\n.cm-lp-form-responses-title {\n font-weight: 600;\n font-size: 0.76em;\n letter-spacing: 0.07em;\n text-transform: uppercase;\n color: var(--lp-muted);\n margin-bottom: 8px;\n}\n.cm-lp-form-responses-status { color: var(--lp-muted); font-size: 0.88em; }\n.cm-lp-form-responses-scroll { overflow-x: auto; }\n.cm-lp-form-responses-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 0.9em;\n}\n.cm-lp-form-responses-table th,\n.cm-lp-form-responses-table td {\n border-bottom: 1px solid var(--lp-line);\n padding: 8px 10px 8px 0;\n text-align: left;\n vertical-align: top;\n}\n.cm-lp-form-responses-table th { color: var(--lp-muted); font-size: 0.88em; font-weight: 600; }\n.cm-lp-form-voters { color: var(--lp-muted); white-space: nowrap; }\n.cm-lp-form-vote-controls { display: flex; gap: 6px; margin-top: 6px; white-space: nowrap; }\n.cm-lp-form-response-controls { display: flex; gap: 6px; white-space: nowrap; }\n.cm-lp-form-vote {\n border: 1px solid var(--lp-line-strong);\n border-radius: 8px;\n padding: 4px 8px;\n color: var(--lp-link);\n background: transparent;\n font: inherit;\n cursor: pointer;\n}\n.cm-lp-form-vote:disabled { opacity: 0.45; cursor: default; }\n.cm-lp-form-vote-remove { color: var(--lp-muted); }\n.cm-lp-form-response-action {\n border: 1px solid var(--lp-line-strong);\n border-radius: 8px;\n padding: 4px 8px;\n color: var(--lp-link);\n background: transparent;\n font: inherit;\n cursor: pointer;\n}\n.cm-lp-form-response-action:disabled { opacity: 0.45; cursor: default; }\n.cm-lp-form-delete { color: var(--lp-muted); }\n/*\n \"We can't display because the formatting is off\", which is what the owner\n asked for. Dashed rather than solid so it reads as a gap in the note that\n something should fill, and muted rather than loud: a form that will not parse\n is the author's problem to fix and nobody else's to be alarmed by.\n*/\n.cm-lp-form-broken {\n border-style: dashed;\n border-color: var(--lp-line-strong);\n color: var(--lp-muted);\n /* No head, no fields, no foot \\u2014 so this one carries its own padding. */\n padding: 14px;\n}\n.cm-lp-form-broken-title { font-weight: 600; color: var(--lp-content); }\n.cm-lp-form-broken-why { font-family: var(--lp-mono); font-size: 0.85em; margin-top: 4px; }\n.cm-lp-form-hint { font-size: 0.85em; margin-top: 6px; }\n`;var bx=[{label:\"id\",insert:\"id: \",detail:\"this form\\u2019s name, [a-z0-9-]\"},{label:\"responses\",insert:\"responses: \",detail:\"the note answers are written to\"},{label:\"layout\",insert:\"layout: table\",detail:\"table or sections\"},{label:\"submit\",insert:\"submit: member\",detail:\"lowest role that may answer\"},{label:\"edit_own\",insert:\"edit_own: true\",detail:\"may people change their answer\"},{label:\"show_responses\",insert:\"show_responses: true\",detail:\"draw readable responses below\"},{label:\"votes\",insert:\"votes: named\",detail:\"named or off\"},{label:\"fields\",insert:`fields:\n - { name: , type: line, max: 120 }`,caretBack:26,detail:\"the questions, one per line\"}],yx=[{label:\"name\",insert:\"name: \",detail:\"[a-z][a-z0-9_]*, not id/by/at/votes\"},{label:\"type\",insert:\"type: line\",detail:\"line, text, select, number, date, checkbox\"},{label:\"max\",insert:\"max: 120\",detail:\"required on line and text\"},{label:\"min\",insert:\"min: 0\",detail:\"number only\"},{label:\"required\",insert:\"required: true\"},{label:\"options\",insert:\"options: [a, b]\",caretBack:6,detail:\"select only\"}],Sx=[{label:\"line\",detail:\"one line of text; needs max\"},{label:\"text\",detail:\"a paragraph; needs max\"},{label:\"select\",detail:\"one of options\"},{label:\"number\",detail:\"min and max bound it\"},{label:\"date\",detail:\"2026-09-12\"},{label:\"checkbox\",detail:\"yes or no\"}],Fp=new Map([[\"layout\",[{label:\"table\",detail:\"one row per response\"},{label:\"sections\",detail:\"one heading per response\"}]],[\"submit\",[{label:\"member\",detail:\"anybody in the context\"},{label:\"editor\",detail:\"people who can write notes\"},{label:\"owner\",detail:\"the owner alone\"}]],[\"votes\",[{label:\"named\",detail:\"upvotes, with the voters listed\"},{label:\"off\",detail:\"no voting\"}]],[\"edit_own\",[{label:\"true\",detail:\"a submitter may change or withdraw theirs\"},{label:\"false\",detail:\"answers are final once sent\"}]],[\"show_responses\",[{label:\"true\",detail:\"show responses when the viewer may read them\"},{label:\"false\",detail:\"keep responses out of the form\"}]],[\"required\",[{label:\"true\"},{label:\"false\"}]]]),xx=`${jt}\nid: feedback\nresponses: feedback-responses.md\nlayout: table\nsubmit: member\nedit_own: true\nshow_responses: false\nvotes: named\nfields:\n - { name: summary, type: line, max: 120, required: true }\n - { name: detail, type: text, max: 2000 }`;function ms(n,e){let t=e.exec(n),i=t===null?\"\":t[0];return{word:i,back:i.length}}function Hp(n,e){let i=n.slice(0,e).split(`\n`),r=null,s=!1,o=0;for(let l=0;l=r.length&&(r=null,s=!1)}return r===null||!s?null:{body:i.slice(o,i.length-1),lineInBody:i.length-1-o}}function kx(n,e){let t=n.lastIndexOf(`\n`,e-1)+1,i=n.slice(t,e),r=Hp(n,e);if(r===null){let h=/^(\\s{0,3})(`{3,}|~{3,})([a-z]*)$/.exec(i);return h===null?null:{spot:{kind:\"fence-info\"},back:h[3].length}}let s=i.lastIndexOf(\"{\");if(s!==-1&&!i.slice(s).includes(\"}\")){let h=i.slice(s+1),c=/(?:^|,)\\s*([a-z_]+)\\s*:\\s*([^,]*)$/.exec(h);if(c!==null){let u=ms(c[2],/[A-Za-z0-9_.-]*$/);return{spot:{kind:\"field-value\",key:c[1]},back:u.back}}let f=ms(h,/[a-z_]*$/);return{spot:{kind:\"field-key\"},back:f.back}}if(/^\\s+-\\s*$/.exec(i)!==null&&r.body.some(h=>/^fields\\s*:\\s*$/.test(h)))return{spot:{kind:\"field-entry\"},back:0};let l=/^([a-z_]+)\\s*:\\s*([^:]*)$/.exec(i);if(l!==null){let h=ms(l[2],/[A-Za-z0-9_.-]*$/);return{spot:{kind:\"key-value\",key:l[1]},back:h.back}}let a=ms(i,/^[a-z_]*$/);return a.word!==i.trimStart()&&i.trim()!==\"\"?null:{spot:{kind:\"key\"},back:a.back}}function wx(n,e=[]){switch(n.kind){case\"fence-info\":return[{label:jt,insert:xx,detail:\"a form people can fill in\"}];case\"key\":{let t=new Set(e.flatMap(i=>{let r=/^([a-z_]+)\\s*:/.exec(i);return r===null?[]:[r[1]]}));return bx.filter(i=>!t.has(i.label))}case\"key-value\":return[...Fp.get(n.key)??[]];case\"field-entry\":return[{label:\"{ \\u2026 }\",insert:\"{ name: , type: line, max: 120 }\",caretBack:24,detail:\"a question\"}];case\"field-key\":return[...yx];case\"field-value\":return n.key===\"type\"?[...Sx]:[...Fp.get(n.key)??[]]}}function Kp(){return n=>{let e=n.state.doc.toString(),t=kx(e,n.pos);if(t===null)return null;let i=wx(t.spot,Hp(e,n.pos)?.body??[]);if(i.length===0)return null;let r=i.map(s=>({label:s.label,detail:s.detail,type:\"keyword\",apply:(o,l,a,h)=>{let c=s.insert??s.label;o.dispatch({changes:{from:a,to:h,insert:c},selection:{anchor:a+c.length-(s.caretBack??0)},userEvent:\"input.complete\"})}}));return{from:n.pos-t.back,options:r}}}function Qx(n){let e=/\\[\\[([^\\][\\n]*)$/.exec(n);return e===null?null:{query:e[1],from:n.length-e[1].length}}function Jp(n){return n.slice(n.lastIndexOf(\"/\")+1).replace(/\\.md$/,\"\")}function vx(n){let e=n.lastIndexOf(\"/\");return e===-1?\"\":n.slice(0,e)}var $x=50;function Px(n,e,t){let i=n.trim().toLowerCase(),r=[];for(let s of e){if(s===t)continue;let o=Jp(s).toLowerCase(),l=i===\"\"||o.startsWith(i)?0:o.includes(i)?1:s.toLowerCase().includes(i)?2:-1;l<0||r.push({band:l,path:s})}return r.sort((s,o)=>s.band===o.band?s.path.localeCompare(o.path):s.band-o.band),r.slice(0,$x).map(({path:s})=>({label:Jp(s),folder:vx(s),insert:s.replace(/\\.md$/,\"\")}))}function Tx(n){return e=>{let t=e.state.doc.lineAt(e.pos),i=Qx(e.state.doc.sliceString(t.from,e.pos));if(i===null||!e.explicit&&i.query===\"\")return null;let r=n.current.paths??[];if(r.length===0)return null;let s=Px(i.query,r,n.current.path).map(o=>({label:o.label,detail:o.folder,type:\"text\",apply:(l,a,h,c)=>{let f=l.state.doc.sliceString(c,c+2)===\"]]\"?\"\":\"]]\";l.dispatch({changes:{from:h,to:c,insert:`${o.insert}${f}`},selection:{anchor:h+o.insert.length+2},userEvent:\"input.complete\"})}}));return s.length===0?null:{from:t.from+i.from,options:s,filter:!1}}}function eO(n){return[wu({override:[Kp(),...n===null?[]:[Tx(n)]],closeOnBlur:!0}),Cx]}var Cx=v.theme({\".cm-tooltip.cm-tooltip-autocomplete\":{border:\"1px solid var(--lp-code-bg)\",borderRadius:\"8px\",background:\"var(--lp-bg)\",color:\"var(--lp-content)\",font:\"13px/1.5 system-ui, sans-serif\",boxShadow:\"0 6px 20px rgba(0,0,0,0.18)\",overflow:\"hidden\"},\".cm-tooltip.cm-tooltip-autocomplete > ul\":{fontFamily:\"inherit\",maxHeight:\"14em\"},\".cm-tooltip.cm-tooltip-autocomplete > ul > li\":{padding:\"5px 9px\",display:\"flex\",gap:\"10px\",alignItems:\"baseline\"},\".cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected]\":{background:\"var(--lp-code-bg)\",color:\"var(--lp-content)\"},\".cm-completionDetail\":{marginLeft:\"auto\",fontStyle:\"normal\",fontSize:\"0.85em\",color:\"var(--lp-muted)\",overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\",maxWidth:\"60%\"}});function Ax(n){let e=[],t=0,i=null;for(let s of n.split(`\n`)){let o=/^\\s{0,3}(`{3,}|~{3,})/.exec(s);i===null?o&&(i={char:o[1][0],length:o[1].length,start:t}):o&&o[1][0]===i.char&&o[1].length>=i.length&&(e.push([i.start,t+s.length]),i=null),t+=s.length+1}i!==null&&e.push([i.start,n.length]);let r=/(`+)(?:[^`]|(?!\\1)`)*?\\1/g;for(let s of n.matchAll(r)){let o=s.index;e.some(([l,a])=>o>=l&&os[0]-o[0])}var Rx=/(!?)\\[\\[([^\\]\\n]+)\\]\\]/g,Zx=/\\[([^\\]\\n]*)\\]\\((<[^>\\n]*>|[^\\s()]*)\\s*(?:\"[^\"\\n]*\"|'[^'\\n]*')?\\)/g;function tO(n){let e=Ax(n),t=r=>e.some(([s,o])=>r>=s&&r\"),l=o?s.slice(1,-1):s,a=r.index+r[1].length+3+(o?1:0);i.push({kind:\"inline\",embed:r.index>0&&n[r.index-1]===\"!\",target:l,start:a,end:a+l.length})}return i.sort((r,s)=>r.start-s.start)}function Xx(n){return/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(n)||n.startsWith(\"//\")}function Mx(n){let e=n.indexOf(\"#\");return e===-1?{file:n,anchor:\"\"}:{file:n.slice(0,e),anchor:n.slice(e)}}function Ex(n){let e=n.lastIndexOf(\"/\");return e===-1?\"\":n.slice(0,e)}function Lx(n){let e=[];for(let t of n)if(!(t===\"\"||t===\".\")){if(t===\"..\"){if(e.length===0)return null;e.pop();continue}e.push(t)}return e}function zx(n){return n.startsWith(\"./\")||n.startsWith(\"../\")?\"relative\":n.includes(\"/\")?\"rooted\":\"bare\"}function iO(n,e,t){let i=n.target.trim();if(i===\"\"||i.startsWith(\"#\")||Xx(i))return null;let{file:r}=Mx(i);if(r===\"\")return null;let s=n.kind===\"inline\"?_x(r):r,o=zx(s);if(o===\"bare\"){let c=s.replace(/\\.md$/,\"\"),f=t?.get(c);return f?.length===1?f[0]:null}let l=o===\"relative\"?Ex(e).split(\"/\"):[],a=Lx([...l,...s.split(\"/\")]);if(a===null||a.length===0)return null;let h=a.join(\"/\");return h.endsWith(\".md\")||/\\.[a-z0-9]{1,8}$/i.test(h)?h:`${h}.md`}function _x(n){try{return decodeURIComponent(n)}catch{return n}}function nO(n){let e=new Map;for(let t of n){let i=t.slice(t.lastIndexOf(\"/\")+1).replace(/\\.md$/,\"\"),r=e.get(i);r?r.push(t):e.set(i,[t])}return e}function jx(n,e){if(e.path===null)return[];let t=nO(e.paths??[]),i=[];for(let r of tO(n)){let s=iO(r,e.path,t);s!==null&&i.push({...Yx(n,r),path:s})}return i}function Yx(n,e){if(e.kind===\"wiki\"){let r=n.indexOf(\"]]\",e.end),s=n.lastIndexOf(\"[[\",e.start);return s===-1||r===-1?{from:e.start,to:e.end}:{from:n[s-1]===\"!\"?s-1:s,to:r+2}}let t=n.indexOf(\")\",e.end),i=n.lastIndexOf(\"[\",e.start);return i===-1||t===-1?{from:e.start,to:e.end}:{from:n[i-1]===\"!\"?i-1:i,to:t+1}}function Ga(n,e){return n.find(t=>e>=t.from&&e<=t.to)??null}function Dx(n){return/mac|iphone|ipad|ipod/i.test(n??\"\")?\"\\u2318\":\"Ctrl\"}var Vx=450,rO=10,Ix=150,Wx=L.mark({class:\"cm-note-link\"});function sO(n){let e=h=>jx(h.state.doc.toString(),n.current),t=ke.fromClass(class{decorations;constructor(h){this.decorations=i(h)}update(h){(h.docChanged||h.viewportChanged)&&(this.decorations=i(h.view))}},{decorations:h=>h.decorations});function i(h){let c=new lt;for(let f of e(h))c.add(f.from,f.to,Wx);return c.finish()}let r=Fc((h,c)=>{let f=Ga(e(h),c);return f===null?null:{pos:f.from,end:f.to,above:!0,create:()=>{let u=document.createElement(\"div\");u.className=\"cm-note-link-tooltip\";let d=document.createElement(\"span\");d.className=\"cm-note-link-name\",d.textContent=f.path;let p=document.createElement(\"span\");return p.className=\"cm-note-link-hint\",p.textContent=`${Dx(Bx())}-click to open`,u.append(d,p),{dom:u}}}}),s=null,o=()=>{s!==null&&(clearTimeout(s.timer),s=null)},l=h=>{o(),n.current.onPress(h)},a=v.domEventHandlers({mousedown(h,c){if(!(h.metaKey||h.ctrlKey))return!1;let f=c.posAtCoords({x:h.clientX,y:h.clientY});if(f===null)return!1;let u=Ga(e(c),f);return u===null?!1:(h.preventDefault(),n.current.onOpen(u.path),!0)},touchstart(h,c){if(o(),h.touches.length!==1)return!1;let f=h.touches[0],u=c.posAtCoords({x:f.clientX,y:f.clientY});if(u===null)return!1;let d=Ga(e(c),u);return d===null||(s={x:f.clientX,y:f.clientY,path:d.path,startedAt:Date.now(),timer:setTimeout(()=>l(d.path),Vx)}),!1},touchmove(h){if(s===null)return!1;let c=h.touches[0];return c===void 0||(Math.abs(c.clientX-s.x)>rO||Math.abs(c.clientY-s.y)>rO)&&o(),!1},touchend(){return o(),!1},touchcancel(){return s!==null&&Date.now()-s.startedAt\"u\"?void 0:navigator.userAgent}var qx=v.theme({\".cm-note-link\":{color:\"var(--lp-link)\",textDecoration:\"underline\",textUnderlineOffset:\"2px\",cursor:\"pointer\",WebkitTouchCallout:\"none\"},\".cm-note-link-tooltip\":{display:\"flex\",flexDirection:\"column\",gap:\"2px\",padding:\"6px 9px\",borderRadius:\"8px\",border:\"1px solid var(--lp-code-bg)\",background:\"var(--lp-bg)\",color:\"var(--lp-content)\",font:\"12px/1.4 system-ui, sans-serif\",maxWidth:\"320px\",boxShadow:\"0 6px 20px rgba(0,0,0,0.18)\"},\".cm-note-link-name\":{fontWeight:\"500\",wordBreak:\"break-all\"},\".cm-note-link-hint\":{color:\"var(--lp-muted)\"}});var Ua=fe.define();function lO(n,e){n.dispatch({changes:{from:0,to:n.state.doc.length,insert:e},annotations:[Ua.of(!0),ee.addToHistory.of(!1)]})}var Nx=\"Write in markdown\\u2026\";function Fa(n){return[v.editable.of(n),q.readOnly.of(!n),q.changeFilter.of(e=>!e.startState.readOnly||e.annotation(Ua)===!0)]}function Gx(n,e,t){n.dispatch(n.state.update(n.state.changeByRange(i=>({changes:[{from:i.from,insert:e},{from:i.to,insert:t}],range:x.range(i.from+e.length,i.to+e.length)})),{scrollIntoView:!0,userEvent:\"input\"}))}function Ux(n,e){let t=n.state.doc.lineAt(n.state.selection.main.head);n.dispatch({changes:t.text.startsWith(e)?{from:t.from,to:t.from+e.length,insert:\"\"}:{from:t.from,insert:e},scrollIntoView:!0,userEvent:\"input\"})}function Fx(n){n.dispatch(n.state.update(n.state.changeByRange(e=>({changes:[{from:e.from,to:e.to,insert:\"[[]]\"}],range:x.cursor(e.from+2)})),{scrollIntoView:!0,userEvent:\"input\"})),wn(n)}function aO(n,e){if(e.name===\"blur\"){n.contentDOM.blur();return}if(!n.state.readOnly){switch(e.name){case\"wrap\":Gx(n,e.before,e.after);break;case\"toggleLinePrefix\":Ux(n,e.prefix);break;case\"insertLink\":Fx(n);break;case\"undo\":Ir(n);break;case\"redo\":xn(n);break}n.focus()}}function Hx(n){return v.scrollMargins.of(()=>{let e=n();return e>0?{bottom:e}:null})}function Kx(n){let e=z(n);return n.selection.ranges.every(t=>{for(let i=e.resolveInner(t.head,-1);i;i=i.parent)if(i.name===\"ListItem\")return!0;return!1})}function oO(n){return e=>Kx(e.state)?n===1?wl(e):Ql(e):!1}function Jx(n){let{editable:e,editableCompartment:t,handlers:i,insetBottom:r,links:s,forms:o}=n;return[jp(),Gp(),Yp(),...s===void 0?[]:[sO(s)],eO(s??null),...o===void 0?[]:[Jr.of(o)],Ef(),v.lineWrapping,Uc(Nx),v.contentAttributes.of({spellcheck:\"true\"}),t.of(Fa(e)),...r===void 0?[]:[Hx(r)],Tt.of([{key:\"Mod-s\",run:l=>(l.state.readOnly||i.current.onSave(),!0)},{key:\"Tab\",run:oO(1),shift:oO(-1)},..._f,...cu]),v.updateListener.of(l=>{l.docChanged&&(l.transactions.some(a=>a.annotation(Ua)===!0)||i.current.onChange(l.state.doc.toString()))})]}function hO(n){return q.create({doc:n.doc,extensions:Jx(n)})}function cO(n){if(typeof n!=\"object\"||n===null)return null;let e=n;switch(e.name){case\"wrap\":return typeof e.before!=\"string\"||typeof e.after!=\"string\"?null:{name:\"wrap\",before:e.before,after:e.after};case\"toggleLinePrefix\":return typeof e.prefix!=\"string\"?null:{name:\"toggleLinePrefix\",prefix:e.prefix};case\"insertLink\":return{name:\"insertLink\"};case\"undo\":return{name:\"undo\"};case\"redo\":return{name:\"redo\"};case\"blur\":return{name:\"blur\"};default:return null}}function ek(n){return n.name!==\"blur\"}function fO(n,e){return n||!ek(e)}function uO(n,e){let t;try{t=JSON.parse(n)}catch{return null}if(typeof t!=\"object\"||t===null)return null;let i=t;return i.v!==1||typeof i.type!=\"string\"||!e.has(i.type)?null:t}var dO=new Set([\"doc\",\"editable\",\"theme\",\"inset\",\"command\",\"links\",\"form-result\",\"form-responses-result\"]);function pO(n,e){return n===e}function Ha(n,e){let t=!1,i=!1;return{request:()=>{t||i||(t=!0,e(()=>{t=!1,i||n()}))},cancel:()=>{i=!0}}}var tk=n=>{typeof requestAnimationFrame==\"function\"?requestAnimationFrame(n):setTimeout(n,0)};function ik(n){let e=n.scrollDOM,t=e.ownerDocument.defaultView?.getComputedStyle(e),i=t===void 0?0:(Number.parseFloat(t.paddingTop)||0)+(Number.parseFloat(t.paddingBottom)||0);return Math.ceil(n.contentDOM.getBoundingClientRect().height+i)}function nk(n){try{let e=n.coordsAtPos(n.state.selection.main.head);if(e===null)return null;let t=n.scrollDOM.getBoundingClientRect();return{top:e.top-t.top,bottom:e.bottom-t.top}}catch{return null}}function OO(n,e){for(let[t,i]of Object.entries(e))/^--lp-[a-z0-9-]+$/.test(t)&&n.style.setProperty(t,i)}function mO(n,e,t){let i=e.schedule??tk,r=new Ht,s=\"\",o=!1,l=0,a={current:{onChange:()=>{},onSave:()=>{}}},h={current:{path:null,onOpen:A=>e.post({v:1,type:\"open-link\",path:A}),onPress:A=>e.post({v:1,type:\"press-link\",path:A})}},c=new Map,f=new Map,u=0,d={generation:0,current:{submit:A=>new Promise(M=>{let Z=`f${++u}`;c.set(Z,M),e.post({v:1,type:\"form-submit\",token:Z,formId:A.formId,values:A.values.map(U=>({...U}))})}),readResponses:A=>new Promise(M=>{let Z=`r${++u}`;f.set(Z,M),e.post({v:1,type:\"form-responses\",token:Z,responsesPath:A})}),vote:A=>new Promise(M=>{let Z=`v${++u}`;c.set(Z,M),e.post({v:1,type:\"form-vote\",token:Z,...A})}),update:A=>new Promise(M=>{let Z=`u${++u}`;c.set(Z,M),e.post({v:1,type:\"form-update\",token:Z,...A})}),retract:A=>new Promise(M=>{let Z=`d${++u}`;c.set(Z,M),e.post({v:1,type:\"form-retract\",token:Z,...A})})}},p=new v({state:hO({doc:\"\",editable:!1,editableCompartment:r,handlers:a,links:h,forms:d,insetBottom:()=>l}),parent:n}),O=Ha(()=>e.post({v:1,type:\"change\",text:s}),i),g=Ha(()=>e.post({v:1,type:\"height\",height:ik(p)}),i),b=Ha(()=>{let A=nk(p);A!==null&&e.post({v:1,type:\"caret\",top:A.top,bottom:A.bottom})},i);a.current={onChange:A=>{s=A,o&&(O.request(),g.request(),b.request())},onSave:()=>e.post({v:1,type:\"save\"})};let y=A=>{switch(A.type){case\"doc\":{if(pO(A.text,s))return;s=A.text,d.generation=(d.generation??0)+1,lO(p,A.text),g.request();return}case\"editable\":{o=A.editable,p.dispatch({effects:r.reconfigure(Fa(A.editable))});return}case\"theme\":{OO(t??n,A.vars),g.request();return}case\"form-result\":{let M=c.get(A.token);c.delete(A.token),M?.({ok:A.ok,message:A.message});return}case\"form-responses-result\":{let M=f.get(A.token);f.delete(A.token),M?.({ok:A.ok,text:A.text,message:A.message});return}case\"links\":{h.current={...h.current,path:A.path,paths:A.paths},p.dispatch({});return}case\"inset\":{l=Math.max(0,A.bottom),OO(t??n,{\"--lp-inset-bottom\":`${l}px`}),p.dispatch({effects:v.scrollIntoView(p.state.selection.main.head)});return}case\"command\":{let M=cO(A.command);if(M===null||!fO(o,M))return;aO(p,M);return}}},S=A=>{let M=uO(A,dO);M!==null&&y(M)};e.listen(S);let C=()=>{e.post({v:1,type:\"focus\",focused:!0}),b.request()},w=()=>e.post({v:1,type:\"focus\",focused:!1});p.contentDOM.addEventListener(\"focus\",C),p.contentDOM.addEventListener(\"blur\",w);let P=p.contentDOM.ownerDocument,T=()=>b.request();P.addEventListener(\"selectionchange\",T);let j=P.defaultView?.ResizeObserver,B=j===void 0?null:new j(()=>g.request());return B?.observe(p.contentDOM),e.post({v:1,type:\"ready\"}),g.request(),{view:p,receive:S,destroy:()=>{O.cancel(),g.cancel(),b.cancel(),B?.disconnect(),P.removeEventListener(\"selectionchange\",T),p.contentDOM.removeEventListener(\"focus\",C),p.contentDOM.removeEventListener(\"blur\",w),p.destroy()}}}function gO(){return`\n:root {\n /*\n Defaults, so a bundle whose first theme message never arrives is a readable\n note rather than black text on a black ground. The host overwrites all of\n these on mount; these are the values only a broken bridge sees, and they are\n deliberately neutral rather than either palette. (No backticks in any\n comment below: this whole stylesheet is inside a template literal and one\n would end the string.)\n */\n --lp-bg: #ffffff;\n --lp-content: #222222;\n --lp-heading: #111111;\n --lp-muted: #666666;\n --lp-link: #2a5db0;\n --lp-code-bg: rgba(0,0,0,0.06);\n --lp-line: rgba(0,0,0,0.09);\n --lp-line-strong: rgba(0,0,0,0.18);\n --lp-focus-ring: rgba(37,99,235,0.10);\n --lp-caret: #222222;\n --lp-selection: rgba(37,99,235,0.20);\n --lp-mono: ui-monospace, Menlo, monospace;\n --lp-body: -apple-system, system-ui, sans-serif;\n\n /* The reading measure. See themeVars for the two sets of values. */\n --lp-size: 16px;\n --lp-leading: 1.5;\n --lp-pad-top: 8px;\n --lp-pad-x: 24px;\n --lp-pad-bottom: 32px;\n\n /* How much of the editor something else is covering. See the inset message. */\n --lp-inset-bottom: 0px;\n}\n\nhtml, body {\n height: 100%;\n margin: 0;\n padding: 0;\n background: var(--lp-bg);\n /*\n The document does not scroll; the editor's own scroller does. Without this\n WKWebView gives the page a scroll view of its own and the note ends up with\n two, which on a phone reads as the text sticking and then lurching. The\n host sets scrollEnabled={false} for the same reason, on the other side.\n */\n overflow: hidden;\n overscroll-behavior: none;\n -webkit-text-size-adjust: 100%;\n -webkit-tap-highlight-color: transparent;\n}\n\n/*\n Everything below is prefixed with the host element's id, and that is not\n ornament.\n\n CodeMirror injects its own base theme through style-mod at the moment the\n view is constructed \\u2014 which is AFTER this stylesheet has been appended to the\n head \\u2014 and that base theme sets font-family: monospace on .cm-scroller and\n padding on .cm-line. At equal specificity the later sheet wins, so the whole\n note rendered in a code face with the wrong line box, which is exactly what\n the first screenshot of this editor showed. An id beats a class and does not\n depend on which sheet was appended first. The web half never hit this because\n its selectors are already two classes deep (.cm-lp-root .cm-scroller).\n*/\n#root { height: 100%; }\n\n#root .cm-editor { height: 100%; background: transparent; }\n#root .cm-editor.cm-focused { outline: none; }\n\n#root .cm-scroller {\n font-family: var(--lp-body);\n /*\n On a phone this resolves to 16px, which is also the number below which iOS\n zooms the page when a field takes focus. So it is load-bearing twice: the\n measured reading size, and what stops the note jumping to 150% the moment\n somebody taps into it.\n */\n font-size: var(--lp-size);\n line-height: var(--lp-leading);\n /*\n The bottom padding grows by whatever the keyboard is covering, so the last\n line of a note can always be scrolled clear of it. It is on the scroller\n rather than on the host's layout because moving the web view would reflow\n the whole document every time the keyboard opened.\n */\n padding: var(--lp-pad-top) var(--lp-pad-x)\n calc(var(--lp-pad-bottom) + var(--lp-inset-bottom));\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n overscroll-behavior: contain;\n}\n\n#root .cm-content {\n color: var(--lp-content);\n caret-color: var(--lp-caret);\n}\n#root .cm-line { padding: 0; }\n#root .cm-cursor, #root .cm-dropCursor { border-left-color: var(--lp-caret); }\n#root .cm-selectionBackground,\n#root .cm-content ::selection { background: var(--lp-selection); }\n#root .cm-placeholder { color: var(--lp-muted); }\n\n/*\n A note the viewer may not write reads; it does not pretend to be a text\n field. The facets in editorSetup.ts are what actually refuse the edit \\u2014 this\n is only so the caret does not blink on a surface nothing can be typed into.\n*/\n#root .cm-editor[aria-readonly=\"true\"] .cm-cursor { display: none; }\n\n${Up}\n`}function rk(){let n=document.createElement(\"style\");n.textContent=gO(),document.head.appendChild(n);let e=document.createElement(\"div\");e.id=\"root\",document.body.appendChild(e);let t=window.ReactNativeWebView;mO(e,{post:r=>t?.postMessage(JSON.stringify(r)),listen:r=>{let s=o=>{let l=o.data;typeof l==\"string\"&&r(l)};window.addEventListener(\"message\",s),document.addEventListener(\"message\",s)}},document.documentElement)}try{rk()}catch(n){window.ReactNativeWebView?.postMessage(JSON.stringify({v:1,type:\"failed\",message:n instanceof Error?n.message:String(n)}))}})();\n"; +export const EDITOR_BUNDLE: string = "\"use strict\";(()=>{var bs=[],nh=[];(()=>{let n=\"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,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5\".split(\",\").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(n=nh[i])e=i+1;else return!0;if(e==t)return!1}}function eh(n){return n>=127462&&n<=127487}var th=8205;function rh(n,e,t=!0,i=!0){return(t?sh:yO)(n,e,i)}function sh(n,e,t){if(e==n.length)return e;e&&oh(n.charCodeAt(e))&&lh(n.charCodeAt(e-1))&&e--;let i=gs(n,e);for(e+=ih(i);e=0&&eh(gs(n,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function yO(n,e,t){for(;e>1;){let i=sh(n,e-2,t);if(i=56320&&n<57344}function lh(n){return n>=55296&&n<56320}function ih(n){return n<65536?1:2}var _=class n{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=bi(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),Oi.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=bi(this,e,t);let i=[];return this.decompose(e,t,i,0),Oi.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new Ut(this),s=new Ut(e);for(let o=t,l=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(e=1){return new Ut(this,e)}iterRange(e,t=this.length){return new qn(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Nn(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError(\"A document must have at least one line\");return e.length==1&&!e[0]?n.empty:e.length<=32?new $e(e):Oi.from($e.split(e,[]))}},$e=class n extends _{constructor(e,t=SO(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((t?i:l)>=e)return new Ss(r,l,i,o);r=l+1,i++}}decompose(e,t,i,r){let s=e<=0&&t>=this.length?this:new n(ah(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=i.pop(),l=Bn(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new n(l,o.length+s.length));else{let a=l.length>>1;i.push(new n(l.slice(0,a)),new n(l.slice(a)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof n))return super.replace(e,t,i);[e,t]=bi(this,e,t);let r=Bn(this.text,Bn(i.text,ah(this.text,0,e)),t),s=this.length+i.length-(t-e);return r.length<=32?new n(r,s):Oi.from(n.split(r,[]),s)}sliceString(e,t=this.length,i=`\n`){[e,t]=bi(this,e,t);let r=\"\";for(let s=0,o=0;s<=t&&oe&&o&&(r+=i),es&&(r+=l.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(t.push(new n(i,r)),i=[],r=-1);return r>-1&&t.push(new n(i,r)),t}},Oi=class n extends _{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,r);r=l+1,i=a+1}}decompose(e,t,i,r){for(let s=0,o=0;o<=t&&s=o){let h=r&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if([e,t]=bi(this,e,t),i.lines=s&&t<=l){let a=o.replace(e-s,t-s,i),h=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>h>>6){let c=this.children.slice();return c[r]=a,new n(c,this.length-(t-e)+i.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`\n`){[e,t]=bi(this,e,t);let r=\"\";for(let s=0,o=0;se&&s&&(r+=i),eo&&(r+=l.sliceString(e-o,t-o,i)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof n))return 0;let i=0,[r,s,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==l)return i;let a=this.children[r],h=e.children[s];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new $e(d,t)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>s&&d instanceof n)for(let O of d.children)f(O);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof $e&&a&&(p=c[c.length-1])instanceof $e&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new $e(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>r&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:n.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new n(l,t)}};_.empty=new $e([\"\"],0);function SO(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Bn(n,e,t=0,i=1e9){for(let r=0,s=0,o=!0;s=t&&(a>i&&(l=l.slice(0,i-r)),r0?1:(e instanceof $e?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,l=r instanceof $e?r.text.length:r.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value=\"\",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`\n`,this;e--}else if(r instanceof $e){let a=r.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof $e?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},qn=class{constructor(e,t,i){this.value=\"\",this.done=!1,this.cursor=new Ut(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=\"\",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=i?r:t<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=\"\"}},Nn=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=\"\",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=\"\",this.afterBreak=!1):t?(this.done=!0,this.value=\"\"):i?this.afterBreak?this.value=\"\":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<\"u\"&&(_.prototype[Symbol.iterator]=function(){return this.iter()},Ut.prototype[Symbol.iterator]=qn.prototype[Symbol.iterator]=Nn.prototype[Symbol.iterator]=function(){return this});var Ss=class{constructor(e,t,i,r){this.from=e,this.to=t,this.number=i,this.text=r}get length(){return this.to-this.from}};function bi(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function re(n,e,t=!0,i=!0){return rh(n,e,t,i)}function xO(n){return n>=56320&&n<57344}function wO(n){return n>=55296&&n<56320}function at(n,e){let t=n.charCodeAt(e);if(!wO(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return xO(i)?(t-55296<<10)+(i-56320)+65536:t}function dh(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function kt(n){return n<65536?1:2}var xs=/\\r\\n?|\\n/,ne=function(n){return n[n.Simple=0]=\"Simple\",n[n.TrackDel=1]=\"TrackDel\",n[n.TrackBefore=2]=\"TrackBefore\",n[n.TrackAfter=3]=\"TrackAfter\",n}(ne||(ne={})),ot=class n{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-r);s+=l}else{if(i!=ne.Simple&&h>=e&&(i==ne.TrackDel&&re||i==ne.TrackBefore&&re))return null;if(h>e||h==e&&t<0&&!l)return e==r||t<0?s:s+a;s+=a}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let i=0,r=0;i=0&&r<=t&&l>=e)return rt?\"cover\":!0;r=l}return!1}toString(){let e=\"\";for(let t=0;t=0?\":\"+r:\"\")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!=\"number\"))throw new RangeError(\"Invalid JSON representation of ChangeDesc\");return new n(e)}static create(e){return new n(e)}},Oe=class n extends ot{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError(\"Applying change set to a document with the wrong length\");return ws(this,(t,i,r,s,o)=>e=e.replace(r,r+(i-t),o),!1),e}mapDesc(e,t=!1){return ks(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,s=0;r=0){t[r]=l,t[r+1]=o;let a=r>>1;for(;i.length0&&wt(i,t,s.text),s.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let r=[],s=[],o=0,l=null;function a(c=!1){if(!c&&!r.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d==\"string\"?_.of(d.split(i||xs)):d:_.empty,O=p.length;if(f==u&&O==0)return;fo&&ce(r,f-o,-1),ce(r,u-f,O),wt(s,r,p),o=u}}return h(e),a(!l),l}static empty(e){return new n(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError(\"Invalid JSON representation of ChangeSet\");let t=[],i=[];for(let r=0;rl&&typeof o!=\"string\"))throw new RangeError(\"Invalid JSON representation of ChangeSet\");if(s.length==1)t.push(s[0],0);else{for(;i.length=0&&t<=0&&t==n[r+1]?n[r]+=e:r>=0&&e==0&&n[r]==0?n[r+1]+=t:i?(n[r]+=e,n[r+1]+=t):n.push(e,t)}function wt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(r,h,s,c,f),r=h,s=c}}}function ks(n,e,t,i=!1){let r=[],s=i?[]:null,o=new Ft(n),l=new Ft(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error(\"Mismatched change set lengths\");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);ce(r,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),s.forward2(a),o.forward(a)}}}}var Ft=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?_.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?_.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},qt=class n{constructor(e,t,i,r){this.from=e,this.to=t,this.flags=i,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,t=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new n(i,r,this.flags,this.goalColumn)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return x.range(e,t,void 0,void 0,i);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return x.range(this.anchor,r,void 0,void 0,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=\"number\"||typeof e.head!=\"number\")throw new RangeError(\"Invalid JSON representation for SelectionRange\");return x.range(e.anchor,e.head)}static create(e,t,i,r){return new n(e,t,i,r)}},x=class n{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:n.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;ie.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!=\"number\"||e.main>=e.ranges.length)throw new RangeError(\"Invalid JSON representation for EditorSelection\");return new n(e.ranges.map(t=>qt.fromJSON(t)),e.main)}static single(e,t=e){return new n([n.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError(\"A selection needs at least one range\");for(let i=0,r=0;rr.from-s.from),t=e.indexOf(i);for(let r=1;rs.head?n.range(a,l):n.range(l,a))}}return new n(e,t)}};function Oh(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError(\"Selection points outside of document\")}var Xs=0,R=class n{constructor(e,t,i,r,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=r,this.id=Xs++,this.default=e([]),this.extensions=typeof s==\"function\"?s(this):s}get reader(){return this}static define(e={}){return new n(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Ms),!!e.static,e.enables)}of(e){return new mi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error(\"Can't compute a static facet\");return new mi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error(\"Can't compute a static facet\");return new mi(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}};function Ms(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}var mi=class{constructor(e,t,i,r){this.dependencies=e,this.facet=t,this.type=i,this.value=r,this.id=Xs++}dynamicSlot(e){var t;let i=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f==\"doc\"?a=!0:f==\"selection\"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Qs(f,c)){let d=i(f);if(l?!hh(d,f.values[o],r):!r(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[s];if(p!=null){let O=Fn(u,p);if(this.dependencies.every(g=>g instanceof R?u.facet(g)===f.facet(g):g instanceof ae?u.field(g,!1)==f.field(g,!1):!0)||(l?hh(d=i(f),O,r):r(d=i(f),O)))return f.values[o]=O,0}else d=i(f);return f.values[o]=d,1}}}get extension(){return this}};function hh(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),r=t.map(a=>a.type),s=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;ci===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Vn).find(i=>i.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,r)=>{let s=i.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[t]=o,1)},reconfigure:(i,r)=>{let s=i.facet(Vn),o=r.facet(Vn),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[t]=l.create(i),1):r.config.address[this.id]!=null?(i.values[t]=r.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,Vn.of({field:this,create:e})]}get extension(){return this}},Nt={lowest:4,low:3,default:2,high:1,highest:0};function Wi(n){return e=>new Gn(e,n)}var Ee={highest:Wi(Nt.highest),high:Wi(Nt.high),default:Wi(Nt.default),low:Wi(Nt.low),lowest:Wi(Nt.lowest)},Gn=class{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}},Ht=class n{of(e){return new qi(this,e)}reconfigure(e){return n.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},qi=class{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}},Un=class n{constructor(e,t,i,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let r=[],s=Object.create(null),o=new Map;for(let u of QO(e,t,o))u instanceof ae?r.push(u):(s[u.facet.id]||(s[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of r)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i?.config.facets;for(let u in s){let d=s[u],p=d[0].facet,O=c&&c[u]||[];if(d.every(g=>g.type==0))if(l[p.id]=a.length<<1|1,Ms(O,d))a.push(i.facet(p));else{let g=p.combine(d.map(b=>b.value));a.push(i&&p.compare(g,i.facet(p))?i.facet(p):g)}else{for(let g of d)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(b=>g.dynamicSlot(b)));l[p.id]=h.length<<1,h.push(g=>kO(g,p,d))}}let f=h.map(u=>u(l));return new n(e,o,f,l,a,s)}};function QO(n,e,t){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof qi&&t.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let h of o)s(h,l);else if(o instanceof qi){if(t.has(o.compartment))throw new RangeError(\"Duplicate use of compartment in extensions\");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),s(h,l)}else if(o instanceof Gn)s(o.inner,o.prec);else if(o instanceof ae)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof mi)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,Nt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(h==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,l)}}return s(n,Nt.default),i.reduce((o,l)=>o.concat(l))}function Bi(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error(\"Cyclic dependency between fields and/or facets\");if(i&2)return i;n.status[t]=4;let r=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|r}function Fn(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}var mh=R.define(),vs=R.define({combine:n=>n.some(e=>e),static:!0}),gh=R.define({combine:n=>n.length?n[0]:void 0,static:!0}),bh=R.define(),yh=R.define(),Sh=R.define(),xh=R.define({combine:n=>n.length?n[0]:!1}),fe=class{constructor(e,t){this.type=e,this.value=t}static define(){return new $s}},$s=class{of(e){return new fe(this,e)}},Ps=class{constructor(e){this.map=e}of(e){return new D(this,e)}},D=class n{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new n(this.type,t)}is(e){return this.type==e}static define(e={}){return new Ps(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(t);s&&i.push(s)}return i}};D.reconfigure=D.define();D.appendConfig=D.define();var ee=class n{constructor(e,t,i,r,s,o){this.startState=e,this.changes=t,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Oh(i,t.newLength),s.some(l=>l.type==n.time)||(this.annotations=s.concat(n.time.of(Date.now())))}static create(e,t,i,r,s,o){return new n(e,t,i,r,s,o)}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(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(n.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]==\".\"))}};ee.time=fe.define();ee.userEvent=fe.define();ee.addToHistory=fe.define();ee.remote=fe.define();function vO(n,e){let t=[];for(let i=0,r=0;;){let s,o;if(i=n[i]))s=n[i++],o=n[i++];else if(r=0;r--){let s=i[r](n);s instanceof ee?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof ee?n=s[0]:n=kh(e,gi(s),!1)}return n}function PO(n){let e=n.startState,t=e.facet(Sh),i=n;for(let r=t.length-1;r>=0;r--){let s=t[r](n);s&&Object.keys(s).length&&(i=wh(i,Ts(e,s,n.changes.newLength),!0))}return i==n?n:ee.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}var TO=[];function gi(n){return n==null?TO:Array.isArray(n)?n:[n]}var Xe=function(n){return n[n.Word=0]=\"Word\",n[n.Space=1]=\"Space\",n[n.Other=2]=\"Other\",n}(Xe||(Xe={})),CO=/[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/,Cs;try{Cs=new RegExp(\"[\\\\p{Alphabetic}\\\\p{Number}_]\",\"u\")}catch{}function AO(n){if(Cs)return Cs.test(n);for(let e=0;e\"\\x80\"&&(t.toUpperCase()!=t.toLowerCase()||CO.test(t)))return!0}return!1}function RO(n){return e=>{if(!/\\S/.test(e))return Xe.Space;if(AO(e))return Xe.Word;for(let t=0;t-1)return Xe.Word;return Xe.Other}}var q=class n{constructor(e,t,i,r,s,o){this.config=e,this.doc=t,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(h,a)),t=null),r.set(l.value.compartment,l.value.extension)):l.is(D.reconfigure)?(t=null,i=l.value):l.is(D.appendConfig)&&(t=null,i=gi(i).concat(l.value));let s;t?s=e.startState.values.slice():(t=Un.resolve(i,r,this),s=new n(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(vs)?e.newSelection:e.newSelection.asSingle();new n(t,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e==\"string\"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:x.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),r=this.changes(i.changes),s=[i.range],o=gi(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return n.create({doc:e.doc,selection:x.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Un.resolve(e.extensions||[],new Map),i=e.doc instanceof _?e.doc:_.of((e.doc||\"\").split(t.staticFacet(n.lineSeparator)||xs)),r=e.selection?e.selection instanceof x?e.selection:x.single(e.selection.anchor,e.selection.head):x.single(0);return Oh(r,i.length),t.staticFacet(vs)||(r=r.asSingle()),new n(t,i,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(n.tabSize)}get lineBreak(){return this.facet(n.lineSeparator)||`\n`}get readOnly(){return this.facet(xh)}phrase(e,...t){for(let i of this.facet(n.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\\$(\\$|\\d*)/g,(i,r)=>{if(r==\"$\")return\"$\";let s=+(r||1);return!s||s>t.length?i:t[s-1]})),e}languageDataAt(e,t,i=-1){let r=[];for(let s of this.facet(mh))for(let o of s(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let t=this.languageDataAt(\"wordChars\",e);return RO(t.length?t[0]:\"\")}wordAt(e){let{text:t,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=re(t,o,!1);if(s(t.slice(a,o))!=Xe.Word)break;o=a}for(;ln.length?n[0]:4});q.lineSeparator=gh;q.readOnly=xh;q.phrases=R.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(r=>n[r]==e[r])}});q.languageData=mh;q.changeFilter=bh;q.transactionFilter=yh;q.transactionExtender=Sh;Ht.reconfigure=D.define();function yi(n,e,t={}){let i={};for(let r of n)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,s))i[s]=t[s](l,o);else throw new Error(\"Config merge conflict for field \"+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}var Me=class{eq(e){return this==e}range(e,t=e){return Ni.create(e,t,this)}};Me.prototype.startSide=Me.prototype.endSide=0;Me.prototype.point=!1;Me.prototype.mapMode=ne.TrackDel;function Es(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}var Ni=class n{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new n(e,t,i)}};function As(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}var Rs=class n{constructor(e,t,i,r){this.from=e,this.to=t,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,r=0){let s=i?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,h=s[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,s);sd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),r.push(u-o),s.push(d-o))}return{mapped:i.length?new n(r,s,i,l):null,pos:o}}},N=class n{constructor(e,t,i,r){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=r}static create(e,t,i,r){return new n(e,t,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(As)),this.isEmpty)return t.length?n.of(t):this;let l=new Hn(this,null,-1).goto(0),a=0,h=[],c=new lt;for(;l.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||sl.to||s=s&&e<=s+o.length&&o.between(s,e-s,t-s,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Gi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Gi.from(e).goto(t)}static compare(e,t,i,r,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=ch(o,l,i),h=new Gt(o,a,s),c=new Gt(l,a,s);i.iterGaps((f,u,d)=>fh(h,f,c,u,d,r)),i.empty&&i.length==0&&fh(h,0,c,0,0,r)}static eq(e,t,i=0,r){r==null&&(r=999999999);let s=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=ch(s,o),a=new Gt(s,l,0).goto(i),h=new Gt(o,l,0).goto(i);for(;;){if(a.to!=h.to||!Zs(a.active,h.active)||a.point&&(!h.point||!Es(a.point,h.point)))return!1;if(a.to>r)return!0;a.next(),h.next()}}static spans(e,t,i,r,s=-1){let o=new Gt(e,null,s).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroml&&(r.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new lt;for(let r of e instanceof Ni?[e]:t?ZO(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return n.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=n.empty;r=r.nextLayer)t=new n(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}};N.empty=new N([],[],null,-1);function ZO(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(As);e=i}return n}N.empty.nextLayer=N.empty;var lt=class n{finishChunk(e){this.chunks.push(new Rs(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,e&&(this.from=[],this.to=[],this.value=[])}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}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new n)).add(e,t,i)}addInner(e,t,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error(\"Ranges must be added sorted by `from` position and `startSide`\");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(N.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=N.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function ch(n,e,t){let i=new Map;for(let s of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new Hn(o,t,i,s));return r.length==1?r[0]:new n(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)ys(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)ys(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),ys(this.heap,0)}}};function ys(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let r=n[i];if(i+1=0&&(r=n[i+1],i++),t.compare(r)<0)break;n[i]=t,n[e]=r,e=i}}var Gt=class{constructor(e,t,i){this.minPoint=i,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=Gi.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){In(this.active,e),In(this.activeTo,e),In(this.activeRank,e),this.minActive=uh(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:r,rank:s}=this.cursor;for(;t0;)t++;Wn(this.active,t,i),Wn(this.activeTo,t,r),Wn(this.activeRank,t,s),e&&Wn(e,t,this.cursor.from),this.minActive=uh(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&In(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}};function fh(n,e,t,i,r,s){n.goto(e),t.goto(i);let o=i+r,l=i,a=i-e,h=!!s.boundChange;for(let c=!1;;){let f=n.to+a-t.to,u=f||n.endSide-t.endSide,d=u<0?n.to+a:t.to,p=Math.min(d,o);if(n.point||t.point?(n.point&&t.point&&Es(n.point,t.point)&&Zs(n.activeForPoint(n.to),t.activeForPoint(t.to))||s.comparePoint(l,p,n.point,t.point),c=!1):(c&&s.boundChange(l),p>l&&!Zs(n.active,t.active)&&s.compareRange(l,p,n.active,t.active),h&&po)break;l=d,u<=0&&n.next(),u>=0&&t.next()}}function Zs(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function uh(n,e){let t=-1,i=1e9;for(let r=0;r=e)return r;if(r==n.length)break;s+=n.charCodeAt(r)==9?t-s%t:1,r=re(n,r)}return i===!0?-1:n.length}var Ls=\"\\u037C\",vh=typeof Symbol>\"u\"?\"__\"+Ls:Symbol.for(Ls),zs=typeof Symbol>\"u\"?\"__styleSet\"+Math.floor(Math.random()*1e8):Symbol(\"styleSet\"),$h=typeof globalThis<\"u\"?globalThis:typeof window<\"u\"?window:{},Le=class{constructor(e,t){this.rules=[];let{finish:i}=t||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\\s*/)}function s(o,l,a,h){let c=[],f=/^@(\\w+)\\b/.exec(o[0]),u=f&&f[1]==\"keyframes\";if(f&&l==null)return a.push(o[0]+\";\");for(let d in l){let p=l[d];if(/&/.test(d))s(d.split(/,\\s*/).map(O=>o.map(g=>O.replace(/&/,g))).reduce((O,g)=>O.concat(g)),p,a);else if(p&&typeof p==\"object\"){if(!f)throw new RangeError(\"The value of a property (\"+d+\") should be a primitive value.\");s(r(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,\"\").replace(/[A-Z]/g,O=>\"-\"+O.toLowerCase())+\": \"+p+\";\")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(\", \")+\" {\"+c.join(\" \")+\"}\")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(`\n`)}static newName(){let e=$h[vh]||1;return $h[vh]=e+1,Ls+e.toString(36)}static mount(e,t,i){let r=e[zs],s=i&&i.nonce;r?s&&r.setNonce(s):r=new _s(e,s),r.mount(Array.isArray(t)?t:[t],e)}},Ph=new Map,_s=class{constructor(e,t){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=Ph.get(i);if(s)return e[zs]=s;this.sheet=new r.CSSStyleSheet,Ph.set(i,this)}else this.styleTag=i.createElement(\"style\"),t&&this.styleTag.setAttribute(\"nonce\",t);this.modules=[],e[zs]=this}mount(e,t){let i=this.sheet,r=0,s=0;for(let o=0;o-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),i)for(let h=0;h\",191:\"?\",192:\"~\",219:\"{\",220:\"|\",221:\"}\",222:'\"'},XO=typeof navigator<\"u\"&&/Mac/.test(navigator.platform),MO=typeof navigator<\"u\"&&/MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent);for(ie=0;ie<10;ie++)ht[48+ie]=ht[96+ie]=String(ie);var ie;for(ie=1;ie<=24;ie++)ht[ie+111]=\"F\"+ie;var ie;for(ie=65;ie<=90;ie++)ht[ie]=String.fromCharCode(ie+32),Si[ie]=String.fromCharCode(ie);var ie;for(Kn in ht)Si.hasOwnProperty(Kn)||(Si[Kn]=ht[Kn]);var Kn;function Th(n){var e=XO&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||MO&&n.shiftKey&&n.key&&n.key.length==1||n.key==\"Unidentified\",t=!e&&n.key||(n.shiftKey?Si:ht)[n.keyCode]||n.key||\"Unidentified\";return t==\"Esc\"&&(t=\"Escape\"),t==\"Del\"&&(t=\"Delete\"),t==\"Left\"&&(t=\"ArrowLeft\"),t==\"Up\"&&(t=\"ArrowUp\"),t==\"Right\"&&(t=\"ArrowRight\"),t==\"Down\"&&(t=\"ArrowDown\"),t}var me=typeof navigator<\"u\"?navigator:{userAgent:\"\",vendor:\"\",platform:\"\"},Bs=typeof document<\"u\"?document:{documentElement:{style:{}}},qs=/Edge\\/(\\d+)/.exec(me.userAgent),rc=/MSIE \\d/.test(me.userAgent),Ns=/Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(me.userAgent),Qr=!!(rc||Ns||qs),Ch=!Qr&&/gecko\\/(\\d+)/i.test(me.userAgent),js=!Qr&&/Chrome\\/(\\d+)/.exec(me.userAgent),Ah=\"webkitFontSmoothing\"in Bs.documentElement.style,Gs=!Qr&&/Apple Computer/.test(me.vendor),Rh=Gs&&(/Mobile\\/\\w+/.test(me.userAgent)||me.maxTouchPoints>2),$={mac:Rh||/Mac/.test(me.platform),windows:/Win/.test(me.platform),linux:/Linux|X11/.test(me.platform),ie:Qr,ie_version:rc?Bs.documentMode||6:Ns?+Ns[1]:qs?+qs[1]:0,gecko:Ch,gecko_version:Ch?+(/Firefox\\/(\\d+)/.exec(me.userAgent)||[0,0])[1]:0,chrome:!!js,chrome_version:js?+js[1]:0,ios:Rh,android:/Android\\b/.test(me.userAgent),webkit:Ah,webkit_version:Ah?+(/\\bAppleWebKit\\/(\\d+)/.exec(me.userAgent)||[0,0])[1]:0,safari:Gs,safari_version:Gs?+(/\\bVersion\\/(\\d+(\\.\\d+)?)/.exec(me.userAgent)||[0,0])[1]:0,tabSize:Bs.documentElement.style.tabSize!=null?\"tab-size\":\"-moz-tab-size\"};function Zo(n,e){for(let t in n)t==\"class\"&&e.class?e.class+=\" \"+n.class:t==\"style\"&&e.style?e.style+=\";\"+n.style:e[t]=n[t];return e}var hr=Object.create(null);function Xo(n,e,t){if(n==e)return!0;n||(n=hr),e||(e=hr);let i=Object.keys(n),r=Object.keys(e);if(i.length-(t&&i.indexOf(t)>-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let s of i)if(s!=t&&(r.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function EO(n,e){for(let t=n.attributes.length-1;t>=0;t--){let i=n.attributes[t].name;e[i]==null&&n.removeAttribute(i)}for(let t in e){let i=e[t];t==\"style\"?n.style.cssText=i:n.getAttribute(t)!=i&&n.setAttribute(t,i)}}function Zh(n,e,t){let i=!1;if(e)for(let r in e)t&&r in t||(i=!0,r==\"style\"?n.style.cssText=\"\":n.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(i=!0,r==\"style\"?n.style.cssText=t[r]:n.setAttribute(r,t[r]));return i}function LO(n){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new ei(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=sc(e,t);i=(s?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new ei(e,i,r,t,e.widget||null,!0)}static line(e){return new ln(e)}static set(e,t=!1){return N.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};L.none=N.empty;var on=class n extends L{constructor(e){let{start:t,end:i}=sc(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||\"span\",this.attrs=e.class&&e.attributes?Zo(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||hr}eq(e){return this==e||e instanceof n&&this.tagName==e.tagName&&Xo(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError(\"Mark decorations may not be empty\");return super.range(e,t)}};on.prototype.point=!1;var ln=class n extends L{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof n&&this.spec.class==e.spec.class&&Xo(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError(\"Line decoration ranges must be zero-length\");return super.range(e,t)}};ln.prototype.mapMode=ne.TrackBefore;ln.prototype.point=!0;var ei=class n extends L{constructor(e,t,i,r,s,o){super(t,i,s,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?ne.TrackBefore:ne.TrackAfter:ne.TrackDel}get type(){return this.startSide!=this.endSide?Ye.WidgetRange:this.startSide<=0?Ye.WidgetBefore:Ye.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof n&&zO(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError(\"Invalid range for replacement decoration\");if(!this.isReplace&&t!=e)throw new RangeError(\"Widget decorations can only have zero-length ranges\");return super.range(e,t)}};ei.prototype.point=!0;function sc(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function zO(n,e){return n==e||!!(n&&e&&n.compare(e))}function Qi(n,e,t,i=0){let r=t.length-1;r>=0&&t[r]+i>=n?t[r]=Math.max(t[r],e):t.push(n,e)}var cr=class n extends Me{constructor(e,t,i){super(),this.tagName=e,this.attributes=t,this.rank=i}eq(e){return e==this||e instanceof n&&this.tagName==e.tagName&&Xo(this.attributes,e.attributes)}static create(e){return new n(e.tagName,e.attributes||hr,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return N.of(e,t)}};cr.prototype.startSide=cr.prototype.endSide=-1;function an(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Us(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function Hi(n,e){if(!e.anchorNode)return!1;try{return Us(n,e.anchorNode)}catch{return!1}}function Ki(n){return n.nodeType==3?cn(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Ji(n,e,t,i){return t?Xh(n,e,t,i,-1)||Xh(n,e,t,i,1):!1}function $t(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function fr(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\\d|SECTION|PRE)$/.test(n.nodeName)}function Xh(n,e,t,i,r){for(;;){if(n==t&&e==i)return!0;if(e==(r<0?0:ut(n))){if(n.nodeName==\"DIV\")return!1;let s=n.parentNode;if(!s||s.nodeType!=1)return!1;e=$t(n)+(r<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(r<0?-1:0)],n.nodeType==1&&n.contentEditable==\"false\")return!1;e=r<0?ut(n):0}else return!1}}function ut(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function hn(n,e){let{left:t,right:i}=n;if(t==i)return n;let r=e?t:i;return{left:r,right:r,top:n.top,bottom:n.bottom}}function _O(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function oc(n,e){let t=e.width/n.offsetWidth,i=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-n.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function jO(n,e,t,i,r,s,o,l){let a=n.ownerDocument,h=a.defaultView||window;for(let c=n,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body,p=1,O=1;if(d)u=_O(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let y=c.getBoundingClientRect();({scaleX:p,scaleY:O}=oc(c,y)),u={left:y.left,right:y.left+c.clientWidth*p,top:y.top,bottom:y.top+c.clientHeight*O}}let g=0,b=0;if(r==\"nearest\")e.top0&&e.bottom>u.bottom+b&&(b=e.bottom-u.bottom+o)):e.bottom>u.bottom-o&&(b=e.bottom-u.bottom+o,t<0&&e.top-b0&&e.right>u.right+g&&(g=e.right-u.right+s)):e.right>u.right-s&&(g=e.right-u.right+s,t<0&&e.leftu.bottom||e.leftu.right)&&(e={left:Math.max(e.left,u.left),right:Math.min(e.right,u.right),top:Math.max(e.top,u.top),bottom:Math.min(e.bottom,u.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function lc(n,e=!0){let t=n.ownerDocument,i=null,r=null;for(let s=n.parentNode;s&&!(s==t.body||(!e||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}var Fs=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?ut(t):0),i,Math.min(e.focusOffset,i?ut(i):0))}set(e,t,i,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=r}};function ac(n){let e=[];for(let t=n;t;t=t.nodeType==11?t.host:t.parentNode)t.nodeType==1&&e.push({node:t,left:t.scrollLeft,top:t.scrollTop});return e}function hc(n,e=!0){for(let{node:t,left:i,top:r}of n)e&&t.scrollTop!=r&&(t.scrollTop=r),t.scrollLeft!=i&&(t.scrollLeft=i)}var Kt=null;$.safari&&$.safari_version>=26&&(Kt=!1);function cc(n){if(n.setActive)return n.setActive();if(Kt)return n.focus(Kt);let e=ac(n);n.focus(Kt==null?{get preventScroll(){return Kt={preventScroll:!0},!0}}:void 0),Kt||(Kt=!1,hc(e))}var Mh;function cn(n,e,t=e){let i=Mh||(Mh=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function vi(n,e,t,i){let r={key:e,code:e,keyCode:t,which:t,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let s=new KeyboardEvent(\"keydown\",r);s.synthetic=!0,n.dispatchEvent(s);let o=new KeyboardEvent(\"keyup\",r);return o.synthetic=!0,n.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function YO(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function DO(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,ut(t));;)if(i){if(t.nodeType!=1)return!1;let r=t.childNodes[i-1];r.contentEditable==\"false\"?i--:(t=r,i=ut(t))}else{if(t==n)return!0;i=$t(t),t=t.parentNode}}function fc(n){return n instanceof Window?n.pageYOffset>Math.max(0,n.document.documentElement.scrollHeight-n.innerHeight-4):n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function uc(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i>0)return{node:t,offset:i};if(t.nodeType==1&&i>0){if(t.contentEditable==\"false\")return null;t=t.childNodes[i-1],i=ut(t)}else if(t.parentNode&&!fr(t))i=$t(t),t=t.parentNode;else return null}}function dc(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i=t){if(l.level==i)return o;(s<0||(r!=0?r<0?l.fromt:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError(\"Index out of range\");return s}};function mc(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;O-=3)if(et[O+1]==-d){let g=et[O+2],b=g&2?r:g&4?g&1?s:r:0;b&&(G[f]=G[et[O]]=b),l=O;break}}else{if(et.length==189)break;et[l++]=f,et[l++]=u,et[l++]=a}else if((p=G[f])==2||p==1){let O=p==r;a=O?0:1;for(let g=l-3;g>=0;g-=3){let b=et[g+2];if(b&2)break;if(O)et[g+2]|=2;else{if(b&4)break;et[g+2]|=4}}}}}function NO(n,e,t,i){for(let r=0,s=i;r<=t.length;r++){let o=r?t[r-1].to:n,l=ra;)p==g&&(p=t[--O].from,g=O?t[O-1].to:n),G[--p]=d;a=c}else s=h,a++}}}function Ks(n,e,t,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let a=e,h=0;aa&&o.push(new je(a,O.from,d));let g=O.direction==ti!=!(d%2);Js(n,g?i+1:i,r,O.inner,O.from,O.to,o),a=O.to}p=O.to}else{if(p==t||(c?G[p]!=l:G[p]==l))break;p++}u?Ks(n,a,p,i+1,r,u,o):ae;){let c=!0,f=!1;if(!h||a>s[h-1].to){let O=G[a-1];O!=l&&(c=!1,f=O==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;e:for(;;)if(h&&p==s[h-1].to){if(f)break e;let O=s[--h];if(!c)for(let g=O.from,b=h;;){if(g==e)break e;if(b&&s[b-1].to==g)g=s[--b].from;else{if(G[g-1]==l)break e;break}}if(u)u.push(O);else{O.toG.length;)G[G.length]=256;let i=[],r=e==ti?0:1;return Js(n,r,r,t,0,n.length,i),i}function gc(n){return[new je(0,n,0)]}var bc=\"\";function UO(n,e,t,i,r){var s;let o=i.head-n.from,l=je.find(e,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),a=e[l],h=a.side(r,t);if(o==h){let u=l+=r?1:-1;if(u<0||u>=e.length)return null;a=e[l=u],o=a.side(!r,t),h=a.side(r,t)}let c=re(n.text,o,a.forward(r,t));(ca.to)&&(c=h),bc=n.text.slice(Math.min(o,c),Math.max(o,c));let f=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return f&&c==h&&f.level+(r?0:1)n.some(e=>e)}),HO=R.define({combine:n=>n.some(e=>e)}),$c=R.define(),en=class n{constructor(e,t,i,r,s,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new n(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new n(x.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},Jn=D.define({map:(n,e)=>n.map(e)}),Pc=D.define();function ue(n,e,t){let i=n.facet(wc);i.length?i[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+\":\",e):console.error(e))}var ct=R.define({combine:n=>n.length?n[0]:!0}),KO=0,wi=R.define({combine(n){return n.filter((e,t)=>{for(let i=0;i{let a=[];return o&&a.push(vr.of(h=>{let c=h.plugin(l);return c?o(c):L.none})),s&&a.push(s(l)),a})}static fromClass(e,t){return n.define((i,r)=>new e(i,r),t)}},tn=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(ue(t.state,i,\"CodeMirror plugin crashed\"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){ue(e.state,t,\"CodeMirror plugin crashed\"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){ue(e.state,i,\"CodeMirror plugin crashed\")}}deactivate(){this.spec=this.value=null}},Tc=R.define(),zo=R.define(),vr=R.define(),Cc=R.define(),_o=R.define(),fn=R.define(),Ac=R.define();function Eh(n,e){let t=n.state.facet(Ac);if(!t.length)return t;let i=t.map(s=>s instanceof Function?s(n):s),r=[];return N.spans(i,e.from,e.to,{point(){},span(s,o,l,a){let h=s-e.from,c=o-e.from,f=r;for(let u=l.length-1;u>=0;u--,a--){let d=l[u].spec.bidiIsolate,p;if(d==null&&(d=FO(e.text,h,c)),a>0&&f.length&&(p=f[f.length-1]).to==h&&p.direction==d)p.to=c,f=p.inner;else{let O={from:h,to:c,direction:d,inner:[]};f.push(O),f=O.inner}}}}),r}var Rc=R.define();function jo(n){let e=0,t=0,i=0,r=0;for(let s of n.state.facet(Rc)){let o=s(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:t,top:i,bottom:r}}var Ui=R.define(),Be=class n{constructor(e,t,i,r){this.fromA=e,this.toA=t,this.fromB=i,this.toB=r}join(e){return new n(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>i.toA)){if(r.toAr.push(new Be(s,o,l,a))),this.changedRanges=r}static create(e,t,i){return new n(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},JO=[],K=class{constructor(e,t,i=0){this.dom=e,this.length=t,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return JO}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&EO(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:\"\")+(this.breakAfter?\"#\":\"\")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let i=t;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError(\"Invalid child in posBefore\")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t,i){return null}domPosFor(e,t){let i=$t(this.dom),r=this.length?e>0:t>0;return new tt(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Pi)return e;return null}static get(e){return e.cmTile}},$i=class extends K{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,i=null,r,s=e?.node==t?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,r=i?i.nextSibling:t.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==t)for(;r&&r!=l.dom;)r=Lh(r);else t.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:t.firstChild,s&&r&&(s.written=!0);r;)r=Lh(r);this.length=o}};function Lh(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}var Pi=class extends $i{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=K.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!t.length)return;i=i.parent,i.breakAfter&&s++,r=t.pop()}else{let o=i.children[r++];if(o instanceof ft)t.push(r),i=o,r=0;else{let l=s+o.length,a=e(o,s);if(a!==void 0)return a;s=l+o.breakAfter}}}resolveBlock(e,t){let i,r=-1,s,o=-1;if(this.blockTiles((l,a)=>{let h=a+l.length;if(e>=a&&e<=h){if(l.isWidget()&&t>=-1&&t<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(ae||e==a&&(t>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-a)}}),!i&&!s)throw new Error(\"No tile at position \"+e);return i&&t<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}},ft=class n extends $i{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let i=new n(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}},Ti=class n extends $i{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,i){let r=new n(t||document.createElement(\"div\"),e);return(!t||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,i){let r=null,s=-1,o=null,l=-1;function a(c,f){for(let u=0,d=0;u=f&&(p.isComposite()?a(p,f-d):(!o||o.isHidden&&(t>0&&!(o.flags&32)||i&&tm(o,p)))&&(O>f||p.flags&32&&t<=1)?(o=p,l=f-d):(d=-1)&&(r=p,s=f-d)),d=O}}a(this,e);let h=(t<0?r:o)||r||o;return h?{tile:h,offset:h==r?s:l}:null}coordsIn(e,t,i){let r=this.resolveInline(e,t,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),t,i):em(this)}domIn(e,t){let i=this.resolveInline(e,t);if(i){let{tile:r,offset:s}=i;if(this.dom.contains(r.dom))return r.isText()?new tt(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:t);let o=i.tile.parent,l=!1;for(let a of o.children){if(l)return new tt(a.dom,0);a==i.tile&&(l=!0)}}return new tt(this.dom,0)}};function em(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=Ki(e);return t[t.length-1]||null}function tm(n,e){let t=n.coordsIn(0,1),i=e.coordsIn(0,1);return t&&i&&i.topr&&(e=r);let s=e,o=e,l=0;e==0&&t<0||e==r&&t>=0?$.chrome||$.gecko||(e?(s--,l=1):o=0)?0:a.length-1];return $.safari&&!l&&h.width==0&&(h=Array.prototype.find.call(a,c=>c.width)||h),i==null?h:hn(h,(l?l>0:t<0)==i)}static of(e,t){let i=new n(t||document.createTextNode(e),e);return t||(i.flags|=2),i}},ii=class n extends K{constructor(e,t,i,r){super(e,t,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,i){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(i)return hn(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?s.length-1:0;o=s[a],!(e>0?a==0:a==s.length-1||o.top0==i)}},to=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;e||t>0;)if(r.isComposite())if(o){if(!e)break;i&&i.break(),e--,o=!1}else if(s==r.children.length){if(!e&&!l.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let a=r.children[s],h=a.breakAfter;(t>0?a.length<=e:a.length=0;l--){let a=t.marks[l],h=r.lastChild;if(h instanceof xe&&h.mark.eq(a.mark))h.dom!=a.dom&&h.setDOM(Ys(a.dom)),r=h;else{if(this.cache.reused.get(a)){let f=K.get(a.dom);f&&f.setDOM(Ys(a.dom))}let c=xe.of(a.mark,a.dom);r.append(c),r=c}this.cache.reused.set(a,2)}let s=K.get(e.text);s&&this.cache.reused.set(s,2);let o=new Jt(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,r.append(o)}addInlineWidget(e,t,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(t,i);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,i){this.flushBuffer(),this.ensureMarks(t,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var i;e||(e=Zc);let r=Ti.start(e,t||((i=this.cache.find(Ti))===null||i===void 0?void 0:i.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var i;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],l;if(t>0&&(l=r.lastChild)&&l instanceof xe&&l.mark.eq(o))r=l,t--;else{let a=xe.of(o,(i=this.cache.find(xe,h=>h.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(a),r=a,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!zh(this.curLine,!1)||e.dom.nodeName!=\"BR\"&&e.isWidget()&&!($.ios&&zh(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Ds,0,32)||new ii(Ds.toDOM(),0,Ds,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to=this.pos){let t=e.rank*102+e.value.rank,i=new io(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let i of this.wrappers){let r=t.lastChild;if(i.fromo.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);t.append(s),t=s}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),i=this.cache.find(Ci,void 0,1);return i&&(i.flags=t),i||new Ci(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},ro=class{constructor(e){this.skipCount=0,this.text=\"\",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=\"\",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error(\"Ran out of text content when drawing inline views\");this.text=r;let l=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,l)}let t=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,t);return this.textOff=t,i}},dr=[ii,Ti,Jt,xe,Ci,ft,Pi];for(let n=0;n[]),this.index=dr.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,i=this.buckets[t];i.length<6?i.push(e):i[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,i=2){let r=e.bucket,s=this.buckets[r],o=this.index[r];for(let l=0;l{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,t){let i=t&&this.getCompositionContext(t.text);for(let r=0,s=0,o=0;;){let l=or){let h=a-r;this.preserve(h,!o,!l),r=a,s+=h}if(!l)break;t&&l.fromA<=t.range.fromA&&l.toA>=t.range.toA?(this.forward(l.fromA,t.range.fromA,t.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let h=a>0||l{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof xe&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof xe&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let i=null,r=this.builder,s=-1,o=N.spans(this.decorations,e,t,{point:(l,a,h,c,f,u)=>{if(h instanceof ei){if(this.disallowBlockEffectsFor[u]){if(h.block)throw new RangeError(\"Block decorations may not be specified via plugins\");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError(\"Decorations that replace line breaks may not be specified via plugins\")}if(s=c.length,f>c.length)r.continueWidget(a-l);else{let d=h.widget||(h.block?Pt.block:Pt.inline),p=im(h),O=this.cache.findWidget(d,a-l,p)||ii.of(d,this.view,a-l,p);h.block?(h.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(O)):(r.ensureLine(i),r.addInlineWidget(O,c,f))}i=null}else i=nm(i,h);a>l&&this.text.skip(a-l)},span:(l,a,h,c)=>{for(let f=l;f-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}forward(e,t,i=1){t-e<=10?this.old.advance(t-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let t=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let s=K.get(r);if(r==this.view.contentDOM)break;s instanceof xe?t.push(s):s?.isLine()?i=s:s instanceof ft||(r.nodeName==\"DIV\"&&!i&&r!=this.view.contentDOM?i=new Ti(r,Zc):i||t.push(xe.of(new on({tagName:r.nodeName.toLowerCase(),attributes:LO(r)}),r)))}return{line:i,marks:t}}};function zh(n,e){let t=i=>{for(let r of i.children)if((e?r.isText():r.length)||t(r))return!0;return!1};return t(n)}function im(n){let e=n.isReplace?(n.startSide<0?64:0)|(n.endSide>0?128:0):n.startSide>0?32:16;return n.block&&(e|=256),e}var Zc={class:\"cm-line\"};function nm(n,e){let t=e.spec.attributes,i=e.spec.class;return!t&&!i||(n||(n={class:\"cm-line\"}),t&&Zo(t,n),i&&(n.class+=\" \"+i)),n}function rm(n){let e=[];for(let t=n.parents.length;t>1;t--){let i=t==n.parents.length?n.tile:n.parents[t].tile;i instanceof xe&&e.push(i.mark)}return e}function Ys(n){let e=K.get(n);return e&&e.setDOM(n.cloneNode()),n}var Pt=class extends he{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};Pt.inline=new Pt(\"span\");Pt.block=new Pt(\"div\");var Ds=new class extends he{toDOM(){return document.createElement(\"br\")}get isHidden(){return!0}get editable(){return!0}},pr=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=L.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Pi(e,e.contentDOM),this.updateInner([new Be(0,0,0,e.state.doc.length)],null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:c,toA:f})=>fthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!um(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?om(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:c,to:f}=this.hasComposition;i=new Be(c,f,e.changes.mapPos(c,-1),e.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,($.ie||$.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let a=hm(o,this.decorations,e.changes);a.length&&(i=Be.extendWithRanges(i,a));let h=cm(l,this.blockWrappers,e.changes);return h.length&&(i=Be.extendWithRanges(i,h)),s&&!i.some(c=>c.fromA<=s.range.fromA&&c.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(t||e.length){let o=this.tile,l=new oo(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&K.get(t.text)&&l.cache.reused.set(K.get(t.text),2),this.tile=l.run(e,t),lo(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+\"px\",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+\"px\":\"\";let s=$.chrome||$.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=\"\"});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&Hi(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||t||o))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,h,c;if(a.empty?c=h=this.inlineDOMNearPos(a.anchor,a.assoc||1):(c=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),h=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),$.gecko&&a.empty&&!this.hasComposition&&sm(h)){let u=document.createTextNode(\"\");this.view.observer.ignore(()=>h.node.insertBefore(u,h.node.childNodes[h.offset]||null)),h=c=new tt(u,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!Ji(h.node,h.offset,f.anchorNode,f.anchorOffset)||!Ji(c.node,c.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,a))&&(this.view.observer.ignore(()=>{$.android&&$.chrome&&i.contains(f.focusNode)&&fm(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let u=an(this.view.root);if(u)if(a.empty){if($.gecko){let d=lm(h.node,h.offset);if(d&&d!=3){let p=(d==1?uc:dc)(h.node,h.offset);p&&(h=new tt(p.node,p.offset))}}u.collapse(h.node,h.offset),a.bidiLevel!=null&&u.caretBidiLevel!==void 0&&(u.caretBidiLevel=a.bidiLevel)}else if(u.extend){u.collapse(h.node,h.offset);try{u.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([h,c]=[c,h]),d.setEnd(c.node,c.offset),d.setStart(h.node,h.offset),u.removeAllRanges(),u.addRange(d)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(h,c)),this.impreciseAnchor=h.precise?null:new tt(f.anchorNode,f.anchorOffset),this.impreciseHead=c.precise?null:new tt(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Ji(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=an(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc,t.assoc);i.collapse(c.node,c.offset),i.modify(\"move\",t.assoc<0?\"forward\":\"backward\",\"lineboundary\"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(r,s)}posFromDOM(e,t){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(e==i.dom)s=i.dom.childNodes[t];else{let o=ut(e)==0?0:t==0?-1:1;for(;;){let l=e.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?s=e:s=e.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!K.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let a=i.children[o];if(a.dom==s)return l;l+=a.length+a.breakAfter}}else return i.isText()?e==i.dom?r+t:r+(t?i.length:0):r}domAtPos(e,t){let{tile:i,offset:r}=this.tile.resolveBlock(e,t);return i.isWidget()?i.domPosFor(r,t):i.domIn(r,t)}inlineDOMNearPos(e,t){let i,r=-1,s=!1,o,l=-1,a=!1;return this.tile.blockTiles((h,c)=>{if(h.isWidget()){if(h.flags&32&&c>=e)return!0;h.flags&16&&(s=!0)}else{let f=c+h.length;if(c<=e&&(i=h,r=e-c,s=f=e&&!o&&(o=h,l=e-c,a=c>e),c>e&&o)return!0}}),!i&&!o?this.domAtPos(e,t):(s&&o?i=null:a&&i&&(o=null),i&&t<0||!o?i.domIn(r,t):o.domIn(l,t))}coordsAt(e,t,i){let{tile:r,offset:s}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof nn?null:r.coordsInWidget(s,t,!0):r.coordsIn(s,t,i)}lineAt(e,t){let{tile:i}=this.tile.resolveBlock(e,t);return i.isLine()?i:null}coordsForChar(e){let{tile:t,offset:i}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let a=r(l,o);if(a)return a}if(o-=l.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==H.LTR,h=0,c=(f,u,d)=>{for(let p=0;pr);p++){let O=f.children[p],g=u+O.length,b=O.dom.getBoundingClientRect(),{height:y}=b;if(d&&!p&&(h+=b.top-d.top),O instanceof ft)g>i&&c(O,u,b);else if(u>=i&&(h>0&&t.push(-h),t.push(y+h),h=0,o)){let S=O.dom.lastChild,C=S?Ki(S):[];if(C.length){let k=C[C.length-1],P=a?k.right-b.left:b.right-k.left;P>l&&(l=P,this.minWidth=s,this.minWidthFrom=u,this.minWidthTo=g)}}d&&p==f.children.length-1&&(h+=d.bottom-b.bottom),u=g+O.breakAfter}};return c(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==\"rtl\"?H.RTL:H.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,a;for(let h of o.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let c=Ki(h.dom);if(c.length!=1)return;l+=c[0].width,a=c[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:a}}});if(e)return e;let t=document.createElement(\"div\"),i,r,s;return t.className=\"cm-line\",t.style.width=\"99999px\",t.style.position=\"absolute\",t.textContent=\"abc def ghi jkl mno pqr stu\",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let o=Ki(t.firstChild)[0];i=t.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,t.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(L.replace({widget:new nn(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return L.set(e)}updateDeco(){let e=1,t=this.view.state.facet(vr).map(s=>(this.dynamicDecorationMap[e++]=typeof s==\"function\")?s(this.view):s),i=!1,r=this.view.state.facet(_o).map((s,o)=>{let l=typeof s==\"function\";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,t.push(N.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];etypeof s==\"function\"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let h=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=h.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let h of this.view.state.facet($c))try{if(h(this.view,e.range,e))return!0}catch(c){ue(this.view.state,c,\"scroll handler\")}let{range:t}=e,i=this.coordsAt(t.head,t.assoc||(t.head>t.anchor?-1:1)),r;if(!i)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=jo(this.view),o={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;if(jO(this.view.scrollDOM,o,t.head1&&(i.top>window.visualViewport.offsetTop+window.visualViewport.height||i.bottomi.isWidget()||i.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){lo(this.tile)}};function lo(n,e){let t=e?.get(n);if(t!=1){t==null&&n.destroy();for(let i of n.children)lo(i,e)}}function sm(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable==\"false\")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable==\"false\")}function Xc(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=uc(t.focusNode,t.focusOffset),r=dc(t.focusNode,t.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=K.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(n.docView.lastCompositionAfterCursor){let a=K.get(i.node);!a||a.isText()&&a.text!=i.node.nodeValue||(s=r)}}if(n.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function om(n,e,t){let i=Xc(n,t);if(!i)return null;let{node:r,from:s,to:o}=i,l=r.nodeValue;if(/[\\n\\r]/.test(l)||n.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc;return{range:new Be(a.mapPos(s),a.mapPos(o),s,o),text:r}}function lm(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable==\"false\"?1:0)|(e{ie.from&&(t=!0)}),t}var nn=class extends he{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(\"div\");return e.className=\"cm-gap\",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+\"px\",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function dm(n,e,t=1){let i=n.charCategorizer(e),r=n.doc.lineAt(e),s=e-r.from;if(r.length==0)return x.cursor(e);s==0?t=1:s==r.length&&(t=-1);let o=s,l=s;t<0?o=re(r.text,s,!1):l=re(r.text,s);let a=i(r.text.slice(o,l));for(;o>0;){let h=re(r.text,o,!1);if(i(r.text.slice(h,o))!=a)break;o=h}for(;ln.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((r-t.top-(n.defaultLineHeight-l)*.5)/l);s+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+Qh(o,s,n.state.tabSize)}function Om(n,e,t){let i=n.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>e)break;if(!(s.toe)return s;(!r||s.type==Ye.Text&&(r.type!=s.type||(t<0?s.frome)))&&(r=s)}}return r||i}return i}function mm(n,e,t,i){let r=Om(n,e.head,e.assoc||-1),s=!i||r.type!=Ye.Text||!(n.lineWrapping||r.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(r.from),a=n.posAtCoords({x:t==(l==H.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return x.cursor(a,t?-1:1)}return x.cursor(t?r.to:r.from,t?-1:1)}function _h(n,e,t,i){let r=n.state.doc.lineAt(e.head),s=n.bidiSpans(r),o=n.textDirectionAt(r.from);for(let l=e,a=null;;){let h=UO(r,s,o,l,t),c=bc;if(!h){if(r.number==(t?n.state.doc.lines:1))return l;c=`\n`,r=n.state.doc.line(r.number+(t?1:-1)),s=n.bidiSpans(r),h=n.visualLineSide(r,!t)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function gm(n,e,t){let i=n.state.charCategorizer(e),r=i(t);return s=>{let o=i(s);return r==Xe.Space&&(r=o),r==o}}function bm(n,e,t,i){let r=e.head,s=t?1:-1;if(r==(t?n.state.doc.length:0))return x.cursor(r,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(r,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),c=n.documentTop;if(h)o==null&&(o=h.left-a.left),l=s<0?h.top:h.bottom;else{let p=n.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(r-p.from))),l=(s<0?p.top:p.bottom)+c}let f=a.left+o,u=n.viewState.heightOracle.textHeight>>1,d=i??u;for(let p=0;;p+=u){let O=l+(d+p)*s,g=ho(n,{x:f,y:O},!1,s);if(t?O>a.bottom:Ol:y{if(e>s&&er(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:x.cursor(i,in.viewState.docHeight)return new _e(n.state.doc.length,-1);if(h=n.elementAtHeight(a),i==null)break;if(h.type==Ye.Text){if(i<0?h.ton.viewport.to)break;let u=n.docView.coordsAt(i<0?h.from:h.to,i>0?-1:1);if(u&&(i<0?u.top<=a+s:u.bottom>=a+s))break}let f=n.viewState.heightOracle.textHeight/2;a=i>0?h.bottom+f:h.top-f}if(n.viewport.from>=h.to||n.viewport.to<=h.from){if(t)return null;if(h.type==Ye.Text){let f=pm(n,r,h,o,l);return new _e(f,f==h.from?1:-1)}}if(h.type!=Ye.Text)return a<(h.top+h.bottom)/2?new _e(h.from,1):new _e(h.to,-1);let c=n.docView.lineAt(h.from,2);return(!c||c.length!=h.length)&&(c=n.docView.lineAt(h.from,-2)),new co(n,o,l,n.textDirectionAt(h.from)).scanTile(c,h.from)}var co=class{constructor(e,t,i,r){this.view=e,this.x=t,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from>1;t:if(o.has(O)){for(let y=1;y=s&&(S-=p),!o.has(S)){O=S;break t}}break e}o.add(O);let g=t(O),b=0;if(g)for(let y=0;y1))if(S.bottomthis.y)(!h||h.top>S.top)&&(h=S),b=-1;else{let C=S.left>this.x?this.x-S.left:S.right(p+p+O)/3)return this.y=a.bottom-1,this.scan(e,t,!0);if(h&&h.top<(p+O+O)/3)return this.y=h.top+1,this.scan(e,t,!0)}let d=(l?this.dirAt(e[c],1):this.baseDir)==H.LTR;return{i:c,after:this.x>(u.left+u.right)/2==d}}scanText(e,t){let i=[];for(let s=0;s{let o=i[s]-t,l=i[s+1]-t;return cn(e.dom,o,l).getClientRects()});return r.after?new _e(i[r.i+1],-1):new _e(i[r.i],1)}scanTile(e,t){if(!e.length)return new _e(t,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,t);if(l.isComposite())return this.scanTile(l,t)}let i=[t];for(let l=0,a=t;l{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:cn(a.dom,0,a.length)).getClientRects()}),s=e.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new _e(i[r.i+1],-1):new _e(o,1)}},xi=\"\\uFFFF\",fo=class{constructor(e,t){this.points=e,this.view=t,this.text=\"\",this.lineSeparator=t.state.facet(q.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=xi}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=K.get(r),l=r.nextSibling;if(l==t){o?.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let a=K.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:fr(r))||fr(l)&&(r.nodeName!=\"BR\"||o?.isWidget())&&this.text.length>s)&&!Sm(l,t)&&this.lineBreak(),r=l}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,r=this.lineSeparator?null:/\\r\\n?|\\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(t))&&(s=l.index,o=l[0].length),this.append(t.slice(i,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=s+o}}readNode(e){let t=K.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==\"BR\"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(ym(e,i.node,i.offset)?t:0))}};function ym(n,e,t){for(;;){if(!e||t-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=Ec(e.docView.tile,t,i,0))){let a=s||o?[]:wm(e),h=new fo(a,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=km(a,this.bounds.from)}else{let a=e.observer.selectionRange,h=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!Us(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!Us(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),f=e.viewport;if(($.ios||$.chrome)&&h!=c&&Math.min(h,c)<=l.main.from&&Math.max(h,c)>=l.main.to&&(f.from>0||f.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(x.range(c,h));else if(e.lineWrapping&&c==h&&!(l.main.empty&&l.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let u=e.coordsAtPos(h,-1),d=0;u&&(d=e.inputState.lastTouchY<=u.bottom?-1:1),this.newSel=x.create([x.cursor(h,d)])}else this.newSel=x.single(c,h)}}};function Ec(n,e,t,i){if(n.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let a=0,h=i,c=i;at)return Ec(f,e,t,h);if(u>=e&&r==-1&&(r=a,s=h),h>t&&f.dom.parentNode==n.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:s,to:l<0?i+n.length:l,startDOM:(r?n.children[r-1].dom.nextSibling:null)||n.dom.firstChild,endDOM:o=0?n.children[o].dom:null}}else return n.isText()?{from:i,to:i+n.length,startDOM:n.dom,endDOM:n.dom.nextSibling}:null}function Lc(n,e){let t,{newSel:i}=e,{state:r}=n,s=r.selection.main,o=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,h=s.from,c=null;(o===8||$.android&&e.text.length=l&&s.to<=a&&(e.typeOver||f!=e.text)&&f.slice(0,s.from-l)==e.text.slice(0,s.from-l)&&f.slice(s.to-l)==e.text.slice(u=e.text.length-(f.length-(s.to-l)))?t={from:s.from,to:s.to,insert:_.of(e.text.slice(s.from-l,u).split(xi))}:(d=zc(f,e.text,h-l,c))&&($.chrome&&o==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==xi+xi&&d.toB--,t={from:l+d.from,to:l+d.toA,insert:_.of(e.text.slice(d.from,d.toB).split(xi))})}else i&&(!n.hasFocus&&r.facet(ct)||mr(i,s))&&(i=null);if(!t&&!i)return!1;if(($.mac||$.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute(\"autocorrect\")==\"off\"?(i&&t.insert.length==2&&(i=x.single(i.main.anchor-1,i.main.head-1)),t={from:t.from,to:t.to,insert:_.of([t.insert.toString().replace(\".\",\" \")])}):r.doc.lineAt(s.from).toDate.now()-50?t={from:s.from,to:s.to,insert:r.toText(n.inputState.insertingText)}:$.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==`\n `&&n.lineWrapping&&(i&&(i=x.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:_.of([\" \"])}),t)return Yo(n,t,i,o);if(i&&!mr(i,s)){let l=!1,a=\"select\";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin==\"select\"&&(l=!0),a=n.inputState.lastSelectionOrigin,a==\"select.pointer\"&&(i=Mc(r.facet(fn).map(h=>h(n)),i))),n.dispatch({selection:i,scrollIntoView:l,userEvent:a}),!0}else return!1}function Yo(n,e,t,i=-1){if($.ios&&n.inputState.flushIOSKey(e))return!0;let r=n.state.selection.main;if($.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&n.state.sliceDoc(e.from,r.from)==\" \")&&e.insert.length==1&&e.insert.lines==2&&vi(n.contentDOM,\"Enter\",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.lengthr.head)&&vi(n.contentDOM,\"Backspace\",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&vi(n.contentDOM,\"Delete\",46)))return!0;let s=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=xm(n,e,t));return n.state.facet(kc).some(a=>a(n,e.from,e.to,s,l))||n.dispatch(l()),!0}function xm(n,e,t){let i,r=n.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.froms.to){let a=e.fromf(n)),h,a);e.from==c&&(o=c)}if(o>-1)i={changes:e,selection:x.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let a=s.frome.to?r.sliceDoc(e.to,s.to):\"\";i=r.replaceSelection(n.state.toText(a+e.insert.sliceString(0,void 0,n.state.lineBreak)+h))}else{let a=r.changes(e),h=t&&t.main.to<=a.newLength?t.main:void 0;if(r.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let c=n.state.sliceDoc(e.from,e.to),f,u=t&&Xc(n,t.main.head);if(u){let p=e.insert.length-(e.to-e.from);f={from:u.from,to:u.to-p}}else f=n.state.doc.lineAt(s.head);let d=s.to-e.to;i=r.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:a,range:h||p.map(a)};let O=p.to-d,g=O-c.length;if(n.state.sliceDoc(g,O)!=c||O>=f.from&&g<=f.to)return{range:p};let b=r.changes({from:g,to:O,insert:e.insert}),y=p.to-s.to;return{changes:b,range:h?x.range(Math.max(0,h.anchor+y),Math.max(0,h.head+y)):p.map(b)}})}else i={changes:a,selection:h&&r.selection.replaceRange(h)}}let l=\"input.type\";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,l+=\".compose\",n.inputState.compositionFirstChange&&(l+=\".start\",n.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function zc(n,e,t,i){let r=Math.min(n.length,e.length),s=0;for(;s0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i==\"end\"){let a=Math.max(0,s-Math.min(o,l));t-=o+a-s}if(o=o?s-t:0;s-=a,l=s+(l-o),o=s}else if(l=l?s-t:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function wm(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new Or(t,i)),(r!=t||s!=i)&&e.push(new Or(r,s))),e}function km(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?x.single(t+e,i+e):null}function mr(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}var po=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=\"\",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,$.safari&&e.contentDOM.addEventListener(\"input\",()=>null),$.gecko&&_m(e.contentDOM.ownerDocument)}handleEvent(e){!Rm(this.view,e)||this.ignoreDuringComposition(e)||e.type==\"keydown\"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,t);for(let r of i.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=vm(e),i=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!=\"scroll\"){let o=!t[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!=\"scroll\"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&jc.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),$.android&&$.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if($.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(_c.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||$m.indexOf(e.key)>-1&&e.ctrlKey)){let t={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return t.shiftKey&&$.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&Qm(this.view.win)&&(t.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:t},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==\"Enter\"&&e&&e.from0?!0:$.safari&&!$.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function Qm(n){return n.visualViewport?n.visualViewport.height*n.visualViewport.scale/n.document.documentElement.clientHeight<.85:!1}function jh(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(r){ue(t.state,r)}}}function vm(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let a=s[l];a&&t(l).handlers.push(jh(i.value,a))}if(o)for(let l in o){let a=o[l];a&&t(l).observers.push(jh(i.value,a))}}for(let i in qe)t(i).handlers.push(qe[i]);for(let i in ge)t(i).observers.push(ge[i]);return e}var _c=[{key:\"Backspace\",keyCode:8,inputType:\"deleteContentBackward\"},{key:\"Enter\",keyCode:13,inputType:\"insertParagraph\"},{key:\"Enter\",keyCode:13,inputType:\"insertLineBreak\"},{key:\"Delete\",keyCode:46,inputType:\"deleteContentForward\"}],$m=\"dthko\",jc=[16,17,18,20,91,92,224,225],er=6;function tr(n){return Math.max(0,n)*.7+8}function Pm(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}var Oo=class{constructor(e,t,i,r){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=lc(e.contentDOM),this.atoms=e.state.facet(fn).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener(\"mousemove\",this.move=this.move.bind(this)),s.addEventListener(\"mouseup\",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(q.allowMultipleSelections)&&Tm(e,t),this.dragging=Am(e,t)&&Vc(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Pm(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=jo(this.view);e.clientX-a.left<=r+er?t=-tr(r-e.clientX):e.clientX+a.right>=o-er&&(t=tr(e.clientX-o)),e.clientY-a.top<=s+er?i=-tr(s-e.clientY):e.clientY+a.bottom>=l-er&&(i=tr(e.clientY-l)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(\"mousemove\",this.move),e.removeEventListener(\"mouseup\",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,i=Mc(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:\"select.pointer\"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent(\"input.type\"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function Tm(n,e){let t=n.state.facet(yc);return t.length?t[0](e):$.mac?e.metaKey:e.ctrlKey}function Cm(n,e){let t=n.state.facet(Sc);return t.length?t[0](e):$.mac?!e.altKey:!e.ctrlKey}function Am(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=an(n.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Rm(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=K.get(t))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}var qe=Object.create(null),ge=Object.create(null),Yc=$.ie&&$.ie_version<15||$.ios&&$.webkit_version<604;function Zm(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement(\"textarea\"));t.style.cssText=\"position: fixed; left: -10000px; top: 10px\",t.focus(),setTimeout(()=>{n.focus(),t.remove(),Dc(n,t.value)},50)}function $r(n,e,t){for(let i of n.facet(e))t=i(t,n);return t}function Dc(n,e){e=$r(n.state,Eo,e);let{state:t}=n,i,r=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(mo!=null&&t.selection.ranges.every(a=>a.empty)&&mo==s.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?s.line(r++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:x.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=s.line(r++);return{changes:{from:a.from,to:a.to,insert:h.text},range:x.cursor(a.from+h.length)}}):i=t.replaceSelection(s);n.dispatch(i,{userEvent:\"input.paste\",scrollIntoView:!0})}ge.scroll=n=>{let e=n.inputState;e.lastScrollTop=n.scrollDOM.scrollTop,e.lastScrollLeft=n.scrollDOM.scrollLeft,$.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};ge.wheel=ge.mousewheel=n=>{n.inputState.lastWheelEvent=Date.now()};qe.keydown=(n,e)=>(n.inputState.setSelectionOrigin(\"select\"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);ge.touchstart=(n,e)=>{let t=n.inputState,i=e.targetTouches[0];t.touchActive=!0,t.lastTouchTime=Date.now(),i&&(t.lastTouchX=i.clientX,t.lastTouchY=i.clientY),t.setSelectionOrigin(\"select.pointer\")};ge.touchmove=n=>{n.inputState.setSelectionOrigin(\"select.pointer\")};ge.touchend=(n,e)=>{n.inputState.touchActive=!1};qe.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(xc))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=Mm(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new Oo(n,e,t,i)),i&&n.observer.ignore(()=>{cc(n.contentDOM);let s=n.root.activeElement;s&&!s.contains(n.contentDOM)&&s.blur()});let r=n.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else n.inputState.setSelectionOrigin(\"select.pointer\");return!1};function Yh(n,e,t,i){if(i==1)return x.cursor(e,t);if(i==2)return dm(n.state,e,t);{let r=n.docView.lineAt(e,t),s=n.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return lDate.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Vh+1)%3:1}function Mm(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=Vc(e),r=n.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,o,l){let a=n.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),h,c=Yh(n,a.pos,a.assoc,i);if(t.pos!=a.pos&&!o){let f=Yh(n,t.pos,t.assoc,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=Em(r,a.pos))?h:l?r.addRange(c):x.create([c])}}}function Em(n,e){for(let t=0;t=e)return x.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}qe.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let r=n.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=t.to||o<=t.from)&&(t=x.undirectionalRange(s,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData(\"Text\",$r(n.state,Lo,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed=\"copyMove\"),!1};qe.dragend=n=>(n.inputState.draggedContent=null,!1);function Wh(n,e,t,i){if(t=$r(n.state,Eo,t),!t)return;let r=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=n.inputState,o=i&&s&&Cm(n,e)?{from:s.from,to:s.to}:null,l={from:r,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:o?\"move.drop\":\"input.drop\"}),n.inputState.draggedContent=null}qe.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),r=0,s=()=>{++r==t.length&&Wh(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData(\"Text\");if(i)return Wh(n,e,i,!0),!0}return!1};qe.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=Yc?null:e.clipboardData;return t?(Dc(n,t.getData(\"text/plain\")||t.getData(\"text/uri-list\")),!0):(Zm(n),!1)};function Lm(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement(\"textarea\"));i.style.cssText=\"position: fixed; left: -10000px; top: 10px\",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function zm(n){let e=[],t=[],i=!1;for(let r of n.selection.ranges)r.empty||(e.push(n.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of n.selection.ranges){let o=n.doc.lineAt(s);o.number>r&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),r=o.number}i=!0}return{text:$r(n,Lo,e.join(n.lineBreak)),ranges:t,linewise:i}}var mo=null;qe.copy=qe.cut=(n,e)=>{if(!Hi(n.contentDOM,n.observer.selectionRange))return!1;let{text:t,ranges:i,linewise:r}=zm(n.state);if(!t&&!r)return!1;mo=r?t:null,e.type==\"cut\"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:\"delete.cut\"});let s=Yc?null:e.clipboardData;return s?(s.clearData(),s.setData(\"text/plain\",t),!0):(Lm(n,t),!1)};var Ic=fe.define();function Wc(n,e){let t=[];for(let i of n.facet(Qc)){let r=i(n,e);r&&t.push(r)}return t.length?n.update({effects:t,annotations:Ic.of(!0)}):null}function Bc(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=Wc(n.state,e);t?n.dispatch(t):n.update([])}},10)}ge.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),Bc(n)};ge.blur=n=>{n.observer.clearSelectionRange(),Bc(n)};ge.compositionstart=ge.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};ge.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,$.chrome&&$.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};ge.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};qe.beforeinput=(n,e)=>{var t,i;if((e.inputType==\"insertText\"||e.inputType==\"insertCompositionText\")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType==\"insertReplacementText\"&&n.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData(\"text/plain\"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=n.posAtDOM(l.startContainer,l.startOffset),h=n.posAtDOM(l.endContainer,l.endOffset);return Yo(n,{from:a,to:h,insert:n.state.toText(s)},null),!0}}let r;if($.chrome&&$.android&&(r=_c.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(r.key,r.keyCode),r.key==\"Backspace\"||r.key==\"Delete\")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return $.ios&&e.inputType==\"deleteContentForward\"&&n.observer.flushSoon(),$.safari&&e.inputType==\"insertText\"&&n.inputState.composing>=0&&setTimeout(()=>ge.compositionend(n,e),20),!1};var Bh=new Set;function _m(n){Bh.has(n)||(Bh.add(n),n.addEventListener(\"copy\",()=>{}),n.addEventListener(\"cut\",()=>{}))}var qh=[\"pre-wrap\",\"normal\",\"pre-line\",\"break-spaces\"],Ai=!1;function Nh(){Ai=!1}var go=class{constructor(e){this.lineWrapping=e,this.doc=_.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return qh.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ar&&(Ai=!0),this.height=e)}replace(e,t,i){return n.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,r){let s=this,o=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=r[l],u=s.lineAt(a,F.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=h?u:s.lineAt(h,F.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=r[l-1].toA;)a=r[l-1].fromA,c=r[l-1].fromB,l--,as*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r=s&&o(this.lineAt(0,F.ByPos,i,r,s))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},ze=class n extends br{constructor(e,t,i){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,t){return new We(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,i){let r=i[0];return i.length==1&&(r instanceof n||r instanceof vt&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof vt?r=new n(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):Te.of(i)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:\"\"}${this.widgetHeight?\":\"+this.widgetHeight:\"\"})`}},vt=class n extends Te{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(e,t,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let h=r+(e0){let s=i[i.length-1];s instanceof n?i[i.length-1]=new n(s.length+r):i.push(null,new n(r-1))}if(e>0){let s=i[0];s instanceof n?i[0]=new n(e+s.length):i.unshift(new n(e-1),null)}return Te.of(i)}decomposeLeft(e,t){t.push(new n(e-1),null)}decomposeRight(e,t){t.push(null,new n(this.length-e-1))}updateHeight(e,t=0,i=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let o=[],l=Math.max(t,r.from),a=-1;for(r.from>t&&o.push(new n(r.from-t-1).updateHeight(e,t));l<=s&&r.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=r.heights[r.index++],u=0;f<0&&(u=-f,f=r.heights[r.index++]),a==-1?a=f:Math.abs(f-a)>=ar&&(a=-2);let d=new ze(c,f,u);d.outdated=!1,o.push(d),l+=c+1}l<=s&&o.push(null,new n(s-l).updateHeight(e,l));let h=Te.of(o);return(a<0||Math.abs(h.height-this.height)>=ar||Math.abs(a-this.heightMetrics(e,t).perLine)>=ar)&&(Ai=!0),gr(this,h)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},yo=class extends Te{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,r){let s=i+this.left.height;return el))return h;let c=t==F.ByPosNoHeight?F.ByPosNoHeight:F.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,r,s).join(h)}forEachLine(e,t,i,r,s,o){let l=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,F.ByPos,i,r,s);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of i)s.push(l);if(e>0&&Gh(s,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?Te.of(this.break?[e,null,t]:[e,t]):(this.left=gr(this.left,e),this.right=gr(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,r){let{left:s,right:o}=this,l=t+s.length+this.break,a=null;return r&&r.from<=t+s.length&&r.more?a=s=s.updateHeight(e,t,i,r):s.updateHeight(e,t,i),r&&r.from<=l+o.length&&r.more?a=o=o.updateHeight(e,l,i,r):o.updateHeight(e,l,i),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?\" \":\"-\")+this.right}};function Gh(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof vt&&(i=n[e+1])instanceof vt&&n.splice(e-1,3,new vt(t.length+1+i.length))}var Ym=5,So=class n{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof ze?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new ze(i-this.pos,-1,0)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=Ym)&&this.addLineDeco(r,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new ze(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let i=new vt(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ze)return e;let t=new ze(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof ze)&&!this.isCovered?this.nodes.push(new ze(0,-1,0)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!=\"visible\"){let u=c.getBoundingClientRect();s=Math.max(s,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=Math.min(h==n.parentNode?r.innerHeight:a,u.bottom)}h=f.position==\"absolute\"||f.position==\"fixed\"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function Im(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left0&&e.top0}function Wm(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}var sn=class{constructor(e,t,i,r){this.from=e,this.to=t,this.size=i,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof r!=\"function\"&&r.class==\"cm-lineWrapping\");this.heightOracle=new go(i),this.stateDeco=Fh(t),this.heightMap=Te.empty().applyChanges(this.stateDeco,_.empty,this.heightOracle.setDoc(t.doc),[new Be(0,0,0,t.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=L.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let r=i?t.head:t.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new ki(s,o))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Uh:new ko(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Fi(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=Fh(this.state);let r=e.changedRanges,s=Be.extendWithRanges(r,Dm(i,this.stateDeco,e?e.changes:Oe.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Nh(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Ai)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(HO)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,i=window.getComputedStyle(t),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction==\"rtl\"?H.RTL:H.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent===\"refresh\",l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0;if(l.width&&l.height){let{scaleX:k,scaleY:P}=oc(t,l);(k>.005&&Math.abs(this.scaleX-k)>.005||P>.005&&Math.abs(this.scaleY-P)>.005)&&(this.scaleX=k,this.scaleY=P,h|=16,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let d=lc(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=fc(this.scrollParent||e.win);let O=(this.printing?Wm:Vm)(t,this.paddingTop),g=O.top-this.pixelViewport.top,b=O.bottom-this.pixelViewport.bottom;this.pixelViewport=O;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget&&!Im(e.dom))return 0;let S=l.width;if((this.contentDOMWidth!=S||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),a){let k=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(k)&&(o=!0),o||r.lineWrapping&&Math.abs(S-this.contentDOMWidth)>r.charWidth){let{lineHeight:P,charWidth:T,textHeight:j}=e.docView.measureTextSize();o=P>0&&r.refresh(s,P,T,j,Math.max(5,S/T),k),o&&(e.docView.minWidth=0,h|=16)}g>0&&b>0?c=Math.max(g,b):g<0&&b<0&&(c=Math.min(g,b)),Nh();for(let P of this.viewports){let T=P.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(P);this.heightMap=(o?Te.empty().applyChanges(this.stateDeco,_.empty,this.heightOracle,[new Be(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new bo(P.from,T))}Ai&&(h|=2)}let C=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return C&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),h|=this.updateForViewport()),(h&2||C)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new ki(r.lineAt(o-i*1e3,F.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,F.ByHeight,s,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(h,F.ByPos,s,0,0),u;t.y==\"center\"?u=(f.top+f.bottom)/2-c/2:t.y==\"start\"||t.y==\"nearest\"&&h=l+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=H.LTR&&!i)return[];let l=[],a=(c,f,u,d)=>{if(f-cc&&bb.from>=u.from&&b.to<=u.to&&Math.abs(b.from-c)b.fromy));if(!g){if(fS.from<=f&&S.to>=f)){let S=t.moveToLineBoundary(x.cursor(f),!1,!0).head;S>c&&(f=S)}let b=this.gapSize(u,c,f,d),y=i||b<2e6?b:2e6;g=new sn(c,f,b,y)}l.push(g)},h=c=>{if(c.length2e6)for(let P of e)P.from>=c.from&&P.fromc.from&&a(c.from,d,c,f),pt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];N.spans(t,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Fi(this.heightMap.lineAt(e,F.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Fi(this.heightMap.lineAt(this.scaler.fromDOM(e),F.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Fi(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},ki=class{constructor(e,t){this.from=e,this.to=t}};function Bm(n,e,t){let i=[],r=n,s=0;return N.spans(t,n,e,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-r),r=l}},20),r=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(i<=l)return s+i;i-=l}}function nr(n,e){let t=0;for(let{from:i,to:r}of n.ranges){if(e<=r){t+=e-i;break}t+=r-i}return t/n.total}function qm(n,e){for(let t of n)if(e(t))return t}var Uh={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function Fh(n){let e=n.facet(vr).filter(i=>typeof i!=\"function\"),t=n.facet(_o).filter(i=>typeof i!=\"function\");return t.length&&e.push(N.join(t)),e}var ko=class n{constructor(e,t,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,F.ByPos,e,0,0).top,c=t.lineAt(a,F.ByPos,e,0,0).bottom;return r+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let t=0,i=0,r=0;;t++){let s=tt.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}};function Fi(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new We(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(r=>Fi(r,e)):n._content)}var rr=R.define({combine:n=>n.join(\" \")}),Qo=R.define({combine:n=>n.indexOf(!0)>-1}),vo=Le.newName(),qc=Le.newName(),Nc=Le.newName(),Gc={\"&light\":\".\"+qc,\"&dark\":\".\"+Nc};function $o(n,e,t){return new Le(e,{finish(i){return/&/.test(i)?i.replace(/&\\w*/,r=>{if(r==\"&\")return n;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):n+\" \"+i}})}var Nm=$o(\".\"+vo,{\"&\":{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,overflowAnchor:\"none\"},\".cm-content\":{margin:0,flexGrow:2,flexShrink:0,display:\"block\",whiteSpace:\"pre\",wordWrap:\"normal\",boxSizing:\"border-box\",minHeight:\"100%\",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\",flexShrink:1},\"&light .cm-content\":{caretColor:\"black\"},\"&dark .cm-content\":{caretColor:\"white\"},\".cm-line\":{display:\"block\",padding:\"0 2px 0 6px\"},\".cm-layer\":{userSelect:\"none\",position:\"absolute\",left:0,top:0,contain:\"size style\",\"& > *\":{position:\"absolute\"}},\"&light .cm-selectionBackground\":{background:\"#d9d9d9\"},\"&dark .cm-selectionBackground\":{background:\"#222\"},\"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground\":{background:\"#d7d4f0\"},\"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground\":{background:\"#233\"},\".cm-cursorLayer\":{pointerEvents:\"none\"},\"&.cm-focused > .cm-scroller > .cm-cursorLayer\":{animation:\"steps(1) cm-blink 1.2s infinite\"},\"@keyframes cm-blink\":{\"0%\":{},\"50%\":{opacity:0},\"100%\":{}},\"@keyframes cm-blink2\":{\"0%\":{},\"50%\":{opacity:0},\"100%\":{}},\".cm-cursor, .cm-dropCursor\":{borderLeft:\"1.2px solid black\",marginLeft:\"-0.6px\",pointerEvents:\"none\"},\".cm-cursor\":{display:\"none\"},\"&dark .cm-cursor\":{borderLeftColor:\"#ddd\"},\".cm-selectionHandle\":{backgroundColor:\"currentColor\",width:\"1.5px\"},\".cm-selectionHandle-start::before, .cm-selectionHandle-end::before\":{content:'\"\"',backgroundColor:\"inherit\",borderRadius:\"50%\",width:\"8px\",height:\"8px\",position:\"absolute\",left:\"-3.25px\"},\".cm-selectionHandle-start::before\":{top:\"-8px\"},\".cm-selectionHandle-end::before\":{bottom:\"-8px\"},\".cm-dropCursor\":{position:\"absolute\"},\"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor\":{display:\"block\"},\".cm-iso\":{unicodeBidi:\"isolate\"},\".cm-announced\":{position:\"fixed\",top:\"-10000px\"},\"@media print\":{\".cm-announced\":{display:\"none\"}},\"&light .cm-activeLine\":{backgroundColor:\"#cceeff44\"},\"&dark .cm-activeLine\":{backgroundColor:\"#99eeff33\"},\"&light .cm-specialChar\":{color:\"red\"},\"&dark .cm-specialChar\":{color:\"#f78\"},\".cm-gutters\":{flexShrink:0,display:\"flex\",height:\"100%\",boxSizing:\"border-box\",zIndex:200},\".cm-gutters-before\":{insetInlineStart:0},\".cm-gutters-after\":{insetInlineEnd:0},\"&light .cm-gutters\":{backgroundColor:\"#f5f5f5\",color:\"#6c6c6c\",border:\"0px solid #ddd\",\"&.cm-gutters-before\":{borderRightWidth:\"1px\"},\"&.cm-gutters-after\":{borderLeftWidth:\"1px\"}},\"&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,zIndex:300},\"&light .cm-panels\":{backgroundColor:\"#f5f5f5\",color:\"black\"},\".cm-panels-top\":{top:\"0\"},\".cm-panels-bottom\":{bottom:\"0\"},\"&light .cm-panels-top\":{borderBottom:\"1px solid #ddd\"},\"&light .cm-panels-bottom\":{borderTop:\"1px solid #ddd\"},\"&dark .cm-panels\":{backgroundColor:\"#333338\",color:\"white\"},\".cm-dialog\":{padding:\"2px 19px 4px 6px\",position:\"relative\",\"& label\":{fontSize:\"80%\"}},\".cm-dialog-close\":{position:\"absolute\",top:\"3px\",right:\"4px\",backgroundColor:\"inherit\",border:\"none\",font:\"inherit\",fontSize:\"14px\",padding:\"0\"},\".cm-tab\":{display:\"inline-block\",overflow:\"hidden\",verticalAlign:\"bottom\"},\".cm-widgetBuffer\":{verticalAlign:\"text-top\",height:\"1em\",width:0,display:\"inline\"},\".cm-placeholder\":{color:\"#888\",display:\"inline-block\",verticalAlign:\"top\",userSelect:\"none\"},\".cm-highlightSpace\":{backgroundImage:\"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)\",backgroundPosition:\"center\"},\".cm-highlightTab\":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:\"auto 100%\",backgroundPosition:\"right 90%\",backgroundRepeat:\"no-repeat\"},\".cm-trailingSpace\":{backgroundColor:\"#ff332255\"},\".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\"}},Gc),Gm={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Is=$.ie&&$.ie_version<=11,Po=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Fs,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);($.ie&&$.ie_version<=11||$.ios&&e.composing)&&t.some(i=>i.type==\"childList\"&&i.removedNodes.length||i.type==\"characterData\"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&$.android&&e.constructor.EDIT_CONTEXT!==!1&&!($.chrome&&$.chrome_version<126)&&(this.editContext=new To(e),e.state.facet(ct)&&(e.contentDOM.editContext=this.editContext.editContext)),Is&&(this.onCharData=t=>{this.queue.push({target:t.target,type:\"characterData\",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(\"print\")),typeof ResizeObserver==\"function\"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(\"Event\")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(\"Event\"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(\"scroll\",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==\"change\"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(ct)?i.root.activeElement!=this.dom:!Hi(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}($.ie&&$.ie_version<=11||$.android&&$.chrome)&&!i.state.selection.main.empty&&r.focusNode&&Ji(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=an(e.root);if(!t)return!1;let i=$.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Um(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let r=Hi(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&vi(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e==\"Enter\")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:r}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),r=this.selectionChanged&&Hi(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new uo(this.view,e,t,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,r=Lc(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!mr(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==\"attributes\"),e.type==\"childList\"){let i=Hh(t,e.previousSibling||e.target.previousSibling,-1),r=Hh(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type==\"characterData\"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(\"resize\",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(\"change\",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(\"beforeprint\",this.onPrint),e.addEventListener(\"scroll\",this.onScroll),e.document.addEventListener(\"selectionchange\",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(\"scroll\",this.onScroll),e.removeEventListener(\"resize\",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(\"change\",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(\"beforeprint\",this.onPrint),e.document.removeEventListener(\"selectionchange\",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(ct)!=e.state.facet(ct)&&(e.view.contentDOM.editContext=e.state.facet(ct)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener(\"scroll\",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function Hh(n,e,t){for(;e;){let i=K.get(e);if(i&&i.parent==n)return i;let r=e.parentNode;e=r!=n.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function Kh(n,e){let t=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor,1);return Ji(o.node,o.offset,r,s)&&([t,i,r,s]=[r,s,t,i]),{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}}function Um(n,e){if(e.getComposedRanges){let r=e.getComposedRanges(n.root)[0];if(r)return Kh(n,r)}let t=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return n.contentDOM.addEventListener(\"beforeinput\",i,!0),n.dom.ownerDocument.execCommand(\"indent\"),n.contentDOM.removeEventListener(\"beforeinput\",i,!0),t?Kh(n,t):null}var To=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let r=e.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(i.updateRangeStart),a=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let h=a-l>i.text.length;l==this.from&&sthis.to&&(a=s);let c=zc(e.state.sliceDoc(l,a),i.text,(h?r.from:r.to)-l,h?\"end\":null);if(!c){let u=x.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));mr(u,r)||e.dispatch({selection:u,userEvent:\"select\"});return}let f={from:c.from+l,to:c.toA+l,insert:_.of(i.text.slice(c.from,c.toB).split(`\n`))};if(($.mac||$.android)&&f.from==o-1&&/^\\. ?$/.test(i.text)&&e.contentDOM.getAttribute(\"autocorrect\")==\"off\"&&(f={from:l,to:a,insert:_.of([i.text.replace(\".\",\" \")])}),this.pendingContextChange=f,!e.state.readOnly){let u=this.to-this.from+(f.to-f.from+f.insert.length);Yo(e,f,x.single(this.toEditorPos(i.selectionStart,u),this.toEditorPos(i.selectionEnd,u)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from=0&&!/[\\\\p{Alphabetic}\\\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),h=this.toEditorPos(s.rangeEnd);if(a{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=an(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,h)=>{if(i)return;let c=h.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(h)){r=this.pendingContextChange=null,t+=c,this.to+=c;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(sthis.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),h.toString()),this.to+=c}t+=c}),r&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent(\"input.type\")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},v=class n{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&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,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.className=\"cm-announced\",this.announceDOM.setAttribute(\"aria-live\",\"polite\"),this.dom=document.createElement(\"div\"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||YO(e.parent)||document,this.viewState=new yr(this,e.state||q.create(e)),e.scrollTo&&e.scrollTo.is(Jn)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(wi).map(r=>new tn(r));for(let r of this.plugins)r.update(this);this.observer=new Po(this),this.inputState=new po(this),this.inputState.ensureHandlers(this.plugins),this.docView=new pr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=\"refresh\",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof ee?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error(\"Calls to EditorView.update are not allowed while an update is in progress\");let t=!1,i=!1,r,s=this.state;for(let u of e){if(u.startState!=s)throw new RangeError(\"Trying to update state with a transaction that doesn't start from the previous state.\");s=u.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(Ic))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=Wc(s,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(c=null)):this.observer.clear(),s.facet(q.phrases)!=this.state.facet(q.phrases))return this.setState(s);r=ur.create(this,s,e),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection,{x:p,y:O}=this.state.facet(n.cursorScrollMargin);f=new en(d.empty?d:x.cursor(d.head,d.head>d.anchor?-1:1),\"nearest\",\"nearest\",O,p)}for(let d of u.effects)d.is(Jn)&&(f=d.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=Sr.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(Ui)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent(\"select.pointer\")))}finally{this.updateState=0}if(r.startState.facet(rr)!=r.state.facet(rr)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let u of this.state.facet(eo))try{u(r)}catch(d){ue(this.state,d,\"update listener\")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!Lc(this,c)&&h.force&&vi(this.contentDOM,h.key,h.keyCode)})}setState(e){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=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new yr(this,e),this.plugins=e.facet(wi).map(i=>new tn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new pr(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(wi),i=e.state.facet(wi);if(t!=i){let r=[];for(let s of i){let o=t.indexOf(s);if(o<0)r.push(new tn(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(fc(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(r);s=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?\"Measure loop restarted more than 5 times\":\"Viewport failed to stabilize\");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return ue(this.state,p),Jh}}),f=ur.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d1||p<-1)&&!($.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+p,i?s<0?i.scrollTop=i.scrollHeight:i.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(eo))l(t)}get themeClasses(){return vo+\" \"+(this.state.facet(Qo)?Nc:qc)+\" \"+this.state.facet(rr)}updateAttrs(){let e=ec(this,Tc,{class:\"cm-editor\"+(this.hasFocus?\" cm-focused \":\" \")+this.themeClasses}),t={spellcheck:\"false\",autocorrect:\"off\",autocapitalize:\"off\",writingsuggestions:\"false\",translate:\"no\",contenteditable:this.state.facet(ct)?\"true\":\"false\",class:\"cm-content\",style:`${$.tabSize}: ${this.state.tabSize}`,role:\"textbox\",\"aria-multiline\":\"true\"};this.state.readOnly&&(t[\"aria-readonly\"]=\"true\"),ec(this,zo,t);let i=this.observer.ignore(()=>{let r=Zh(this.contentDOM,this.contentAttrs,t),s=Zh(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let r of i.effects)if(r.is(n.announce)){t&&(this.announceDOM.textContent=\"\"),t=!1;let s=this.announceDOM.appendChild(document.createElement(\"div\"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Ui);let e=this.state.facet(n.cspNonce);Le.mount(this.root,this.styleModules.concat(Nm).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error(\"Reading the editor layout isn't allowed during an update\");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return Vs(this,e,_h(this,e,t,i))}moveByGroup(e,t){return Vs(this,e,_h(this,e,t,i=>gm(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[t?i.length-1:0];return x.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,i=!0){return mm(this,e,t,i)}moveVertically(e,t,i){return Vs(this,e,bm(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=ho(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),ho(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.state.doc.lineAt(e),r=this.bidiSpans(i),s=r[je.find(r,e-i.from,-1,t)];return this.docView.coordsAt(e,t,s.dir==H.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(vc)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Fm)return gc(e.length);let t=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||mc(s.isolates,i=Eh(this,e))))return s.order;i||(i=Eh(this,e));let r=GO(e.text,t,i);return this.bidiCache.push(new Sr(e.from,e.to,t,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||$.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{cc(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var i,r,s,o;return Jn.of(new en(typeof e==\"number\"?x.cursor(e):e,(i=t.y)!==null&&i!==void 0?i:\"nearest\",(r=t.x)!==null&&r!==void 0?r:\"nearest\",(s=t.yMargin)!==null&&s!==void 0?s:5,(o=t.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return Jn.of(new en(x.cursor(i.from),\"start\",\"start\",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==\"boolean\"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return we.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return we.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=Le.newName(),r=[rr.of(i),Ui.of($o(`.${i}`,e))];return t&&t.dark&&r.push(Qo.of(!0)),r}static baseTheme(e){return Ee.lowest(Ui.of($o(\".\"+vo,e,Gc)))}static findFromDOM(e){var t;let i=e.querySelector(\".cm-content\"),r=i&&K.get(i)||K.get(e);return((t=r?.root)===null||t===void 0?void 0:t.view)||null}};v.styleModule=Ui;v.inputHandler=kc;v.clipboardInputFilter=Eo;v.clipboardOutputFilter=Lo;v.scrollHandler=$c;v.focusChangeEffect=Qc;v.perLineTextDirection=vc;v.exceptionSink=wc;v.updateListener=eo;v.editable=ct;v.mouseSelectionStyle=xc;v.dragMovesSelection=Sc;v.clickAddsSelectionRange=yc;v.decorations=vr;v.blockWrappers=Cc;v.outerDecorations=_o;v.atomicRanges=fn;v.bidiIsolatedRanges=Ac;v.cursorScrollMargin=R.define({combine:n=>{let e=5,t=5;for(let i of n)typeof i==\"number\"?e=t=i:{x:e,y:t}=i;return{x:e,y:t}}});v.scrollMargins=Rc;v.darkTheme=Qo;v.cspNonce=R.define({combine:n=>n.length?n[0]:\"\"});v.contentAttributes=zo;v.editorAttributes=Tc;v.lineWrapping=v.contentAttributes.of({class:\"cm-lineWrapping\"});v.announce=D.define();var Fm=4096,Jh={},Sr=class n{constructor(e,t,i,r,s,o){this.from=e,this.to=t,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:H.LTR;for(let s=Math.max(0,e.length-10);s=0;r--){let s=i[r],o=typeof s==\"function\"?s(n):s;o&&Zo(o,t)}return t}var Hm=$.mac?\"mac\":$.windows?\"win\":$.linux?\"linux\":\"key\";function Km(n,e){let t=n.split(/-(?!$)/),i=t[t.length-1];i==\"Space\"&&(i=\" \");let r,s,o,l;for(let a=0;ai.concat(r),[]))),t}var Qt=null,tg=4e3;function ig(n,e=Hm){let t=Object.create(null),i=Object.create(null),r=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error(\"Key binding \"+o+\" is used both as a regular binding and as a multi-stroke prefix\")},s=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(b=>Km(b,e));for(let b=1;b{let C=Qt={view:S,prefix:y,scope:o};return setTimeout(()=>{Qt==C&&(Qt=null)},tg),!0}]})}let O=p.join(\" \");r(O,!1);let g=d[O]||(d[O]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&g.run.push(a),h&&(g.preventDefault=!0),c&&(g.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(\" \"):[\"editor\"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in c)c[u].run.push(d=>f(d,Co))}let a=o[e]||o.key;if(a)for(let h of l)s(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(h,\"Shift-\"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}var Co=null;function ng(n,e,t,i){Co=e;let r=Th(e),s=at(r,0),o=kt(s)==r.length&&r!=\" \",l=\"\",a=!1,h=!1,c=!1;Qt&&Qt.view==t&&Qt.scope==i&&(l=Qt.prefix+\" \",jc.indexOf(e.keyCode)<0&&(h=!0,Qt=null));let f=new Set,u=g=>{if(g){for(let b of g.run)if(!f.has(b)&&(f.add(b),b(t)))return g.stopPropagation&&(c=!0),!0;g.preventDefault&&(g.stopPropagation&&(c=!0),h=!0)}return!1},d=n[i],p,O;return d&&(u(d[l+sr(r,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!($.windows&&e.ctrlKey&&e.altKey)&&!($.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=ht[e.keyCode])&&p!=r?(u(d[l+sr(p,e,!0)])||e.shiftKey&&(O=Si[e.keyCode])!=r&&O!=p&&u(d[l+sr(O,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+sr(r,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),Co=null,a}var rg=$.gecko&&$.gecko_version==153?\"#ffffff01\":\"transparent\",gw=Ee.highest(v.theme({\".cm-line\":{\"& ::selection, &::selection\":{backgroundColor:`${rg} !important`},caretColor:\"transparent !important\"},\".cm-content\":{caretColor:\"transparent !important\",\"& :focus\":{caretColor:\"initial !important\",\"&::selection, & ::selection\":{backgroundColor:\"Highlight !important\"}}}}));var bw=/x/.unicode!=null?\"gu\":\"g\";var Ao=class extends he{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement(\"span\");return t.className=\"cm-placeholder\",t.style.pointerEvents=\"none\",t.appendChild(typeof this.content==\"string\"?document.createTextNode(this.content):typeof this.content==\"function\"?this.content(e):this.content.cloneNode(!0)),t.setAttribute(\"aria-hidden\",\"true\"),t}coordsAt(e){let t=e.firstChild?Ki(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),r=hn(t[0],i.direction!=\"rtl\"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}};function Uc(n){let e=we.fromClass(class{constructor(t){this.view=t,this.placeholder=n?L.set([L.widget({widget:new Ao(n),side:1}).range(0)]):L.none}get decorations(){return this.view.state.doc.length?L.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n==\"string\"?[e,v.contentAttributes.of({\"aria-placeholder\":n})]:e}var or=\"-10000px\",xr=class{constructor(e,t,i,r){this.facet=t,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(e,t){var i;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;at[h]=a),t.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}};function sg(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}var Ws=R.define({combine:n=>{var e,t,i;return{position:$.ios?\"absolute\":((e=n.find(r=>r.position))===null||e===void 0?void 0:e.position)||\"fixed\",parent:((t=n.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||sg}}}),ic=new WeakMap,Do=we.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Ws);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==\"function\"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new xr(n,Pr,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver==\"function\"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener(\"resize\",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(\"div\"),this.container.style.position=\"relative\",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Ws);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add(\"cm-tooltip\"),n.arrow&&!t.dom.querySelector(\".cm-tooltip > .cm-tooltip-arrow\")){let r=document.createElement(\"div\");r.className=\"cm-tooltip-arrow\",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=or,t.dom.style.left=\"0px\",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener(\"resize\",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position==\"fixed\"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if($.safari){let o=s.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else t=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(t||this.position==\"absolute\")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(n=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=jo(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(Ws).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position=\"absolute\";for(let l of this.manager.tooltipViews)l.dom.style.position=\"absolute\"}let{visible:t,space:i,scaleX:r,scaleY:s}=n,o=[];for(let l=0;l=Math.min(t.bottom,i.bottom)||f.rightMath.min(t.right,i.right)+.1)){c.style.top=or;continue}let d=a.arrow?h.dom.querySelector(\".cm-tooltip-arrow\"):null,p=d?7:0,O=u.right-u.left,g=(e=ic.get(h))!==null&&e!==void 0?e:u.bottom-u.top,b=h.offset||lg,y=this.view.textDirection==H.LTR,S=u.width>i.right-i.left?y?i.left:i.right-u.width:y?Math.max(i.left,Math.min(f.left-(d?14:0)+b.x,i.right-O)):Math.min(Math.max(i.left,f.left-O+(d?14:0)-b.x),i.right-O),C=this.above[l];!a.strictSide&&(C?f.top-g-p-b.yi.bottom)&&C==i.bottom-f.bottom>f.top-i.top&&(C=this.above[l]=!C);let k=(C?f.top-i.top:i.bottom-f.bottom)-p;if(kS&&j.topP&&(P=C?j.top-g-2-p:j.bottom+p+2);if(this.position==\"absolute\"?(c.style.top=(P-n.parent.top)/s+\"px\",nc(c,(S-n.parent.left)/r)):(c.style.top=P/s+\"px\",nc(c,S/r)),d){let j=f.left+(y?b.x:-b.x)-(S+14-7);d.style.left=j/r+\"px\"}h.overlap!==!0&&o.push({left:S,top:P,right:T,bottom:P+g}),c.classList.toggle(\"cm-tooltip-above\",C),c.classList.toggle(\"cm-tooltip-below\",!C),h.positioned&&h.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=or}},{eventObservers:{scroll(){this.maybeMeasure()}}});function nc(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+\"px\")}var og=v.baseTheme({\".cm-tooltip\":{zIndex:500,boxSizing:\"border-box\"},\"&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:\"7px\",width:`${7*2}px`,position:\"absolute\",zIndex:-1,overflow:\"hidden\",\"&:before, &:after\":{content:\"''\",position:\"absolute\",width:0,height:0,borderLeft:\"7px solid transparent\",borderRight:\"7px solid transparent\"},\".cm-tooltip-above &\":{bottom:\"-7px\",\"&:before\":{borderTop:\"7px solid #bbb\"},\"&:after\":{borderTop:\"7px solid #f5f5f5\",bottom:\"1px\"}},\".cm-tooltip-below &\":{top:\"-7px\",\"&:before\":{borderBottom:\"7px solid #bbb\"},\"&:after\":{borderBottom:\"7px solid #f5f5f5\",top:\"1px\"}}},\"&dark .cm-tooltip .cm-tooltip-arrow\":{\"&:before\":{borderTopColor:\"#333338\",borderBottomColor:\"#333338\"},\"&:after\":{borderTopColor:\"transparent\",borderBottomColor:\"transparent\"}}}),lg={x:0,y:0},Pr=R.define({enables:[Do,og]}),wr=R.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])}),kr=class n{static create(e){return new n(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement(\"div\"),this.dom.classList.add(\"cm-tooltip-hover\"),this.manager=new xr(e,wr,(t,i)=>this.createHostedView(t,i),t=>t.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add(\"cm-tooltip-section\"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp(\"offset\")}get getCoords(){return this.passProp(\"getCoords\")}get overlap(){return this.passProp(\"overlap\")}get resize(){return this.passProp(\"resize\")}},ag=Pr.compute([wr],n=>{let e=n.facet(wr);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var i;return(i=t.end)!==null&&i!==void 0?i:t.pos})),create:kr.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),hg=R.define(),Ro=class{constructor(e,t,i,r,s,o){this.view=e,this.source=t,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener(\"mouseleave\",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener(\"mousemove\",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;eo.bottom||t.xo.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(r)).find(h=>h.from<=r&&h.to>=r),a=l&&l.dir==H.RTL?-1:1;s=t.x{if(l&&!(Array.isArray(l)&&!l.length)){let a=Array.isArray(l)?l:[l];r&&this.locked.set(a,r),e.dispatch({effects:this.setHover.of(a)})}};if(s&&\"then\"in s){let l=this.pending={pos:t};s.then(a=>{this.pending==l&&(this.pending=null,o(a))},a=>ue(e.state,a,\"hover tooltip\"))}else o(s)}get tooltip(){let e=this.view.plugin(Do),t=e?e.manager.tooltips.findIndex(i=>i.create==kr.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!cg(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(t=r[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!fg(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener(\"mouseleave\",t);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener(\"mouseleave\",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener(\"mouseleave\",this.mouseleave),this.view.dom.removeEventListener(\"mousemove\",this.mousemove)}},lr=4;function cg(n,e){let{left:t,right:i,top:r,bottom:s}=n.getBoundingClientRect(),o;if(o=n.querySelector(\".cm-tooltip-arrow\")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return e.clientX>=t-lr&&e.clientX<=i+lr&&e.clientY>=r-lr&&e.clientY<=s+lr}function fg(n,e,t,i,r,s){let o=n.scrollDOM.getBoundingClientRect(),l=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>i||o.rightr||Math.min(o.bottom,l)=e&&a<=t}function Fc(n,e={}){let t=D.define(),i=new WeakMap,r=ae.define({create(){return[]},update(o,l){let a=i.get(o);if(o.length&&(e.hideOnChange&&(l.docChanged||l.selection)?o=[]:a&&a(l)?o=[]:e.hideOn&&(o=o.filter(h=>!e.hideOn(l,h)))),l.docChanged&&o.length){let h=[];for(let c of o){let f=l.changes.mapPos(c.pos,-1,ne.TrackDel);if(f!=null){let u=Object.assign(Object.create(null),c);u.pos=f,u.end!=null&&(u.end=l.changes.mapPos(u.end)),h.push(u)}}o=h}for(let h of l.effects)h.is(t)&&(o=h.value,a=void 0),(h.is(ug)&&!h.value||h.value==r)&&(o=[]);return o.length&&a&&i.set(o,a),o},provide:o=>wr.from(o)}),s=we.define(o=>new Ro(o,n,r,i,t,e.hoverTime||300));return{active:r,extension:[r,s,hg.of(s),ag]}}function Vo(n,e){let t=n.plugin(Do);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}var ug=D.define();var dt=class extends Me{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};dt.prototype.elementClass=\"\";dt.prototype.toDOM=void 0;dt.prototype.mapMode=ne.TrackBefore;dt.prototype.startSide=dt.prototype.endSide=-1;dt.prototype.point=!0;var dg=0,ke=class{constructor(e,t){this.from=e,this.to=t}},E=class{constructor(e={}){this.id=dg++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error(\"This node type doesn't define a deserialize function\")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError(\"Can't add per-node props to node types\");return typeof e!=\"function\"&&(e=te.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}};E.closedBy=new E({deserialize:n=>n.split(\" \")});E.openedBy=new E({deserialize:n=>n.split(\" \")});E.group=new E({deserialize:n=>n.split(\" \")});E.isolate=new E({deserialize:n=>{if(n&&n!=\"rtl\"&&n!=\"ltr\"&&n!=\"auto\")throw new RangeError(\"Invalid value for isolate: \"+n);return n||\"auto\"}});E.contextHash=new E({perNode:!0});E.lookAhead=new E({perNode:!0});E.mounted=new E({perNode:!0});var Ct=class{constructor(e,t,i,r=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[E.mounted.id]}},pg=Object.create(null),te=class n{constructor(e,t,i,r=0){this.name=e,this.props=t,this.id=i,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):pg,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new n(e.name||\"\",t,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError(\"Can't store a per-node prop on a node type\");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.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(e){if(typeof e==\"string\"){if(this.name==e)return!0;let t=this.prop(E.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let r of i.split(\" \"))t[r]=e[i];return i=>{for(let r=i.prop(E.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?i.name:r[s]];if(o)return o}}}};te.none=new te(\"\",Object.create(null),0,8);var At=class n{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|V.IncludeAnonymous);;){let h=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Jo(te.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,r)=>new n(this.type,t,i,r,this.propValues),e.makeTree||((t,i,r)=>new n(te.none,t,i,r)))}static build(e){return mg(e)}};W.empty=new W(te.none,[],[],0);var Io=class n{constructor(e,t){this.buffer=e,this.index=t}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 n(this.buffer,this.index)}},Rt=class n{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return te.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function un(n,e,t,i){for(var r;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from,u;if(!(!(s&V.EnterBracketed&&c instanceof W&&(u=Ct.get(c))&&!u.overlay&&u.bracketed&&i>=f&&i<=f+c.length)&&!sf(r,i,f,f+c.length))){if(c instanceof Rt){if(s&V.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,t,i-f,r);if(d>-1)return new ni(new Bo(o,c,e,f),null,d)}else if(s&V.IncludeAnonymous||!c.type.isAnonymous||Ko(c)){let d;if(!(s&V.IgnoreMounts)&&(d=Ct.get(c))&&!d.overlay)return new n(d.tree,f,e,o);let p=new n(c,f,e,o);return s&V.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(t<0?c.children.length-1:0,t,i,r,s)}}}if(s&V.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))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(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,i=0){let r;if(!(i&V.IgnoreOverlays)&&(r=Ct.get(this._tree))&&r.overlay){let s=e-this.from,o=i&V.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((t>0||o?l<=s:l=s:a>s))return new n(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}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}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function Kc(n,e,t,i){let r=n.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function Wo(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}var Bo=class{constructor(e,t,i,r){this.parent=e,this.buffer=t,this.index=i,this.start=r}},ni=class n extends Ar{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]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,i);return s<0?null:new n(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,i=0){if(i&V.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new n(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new n(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new n(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];e.push(i.slice(r,s,o)),t.push(0)}return new W(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function of(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;st.from||o.to=e){let l=new Qe(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(un(l,e,t,!1))}}return r?of(r):i}var Ri=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~V.EnterBracketed,e instanceof Qe)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof Qe?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&V.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&V.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&V.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=t+e,o=e<0?-1:i._tree.children.length;s!=o;s+=e){let l=i._tree.children[s];if(this.mode&V.IncludeAnonymous||l instanceof Rt||!l.type.isAnonymous||Ko(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return Wo(this._tree,e,r);let o=i[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}};function Ko(n){return n.children.some(e=>e instanceof Rt||!e.type.isAnonymous||Ko(e))}function mg(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:r=1024,reused:s=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new Io(t,t.length):t,a=i.types,h=0,c=0;function f(k,P,T,j,B,A){let{id:M,start:Z,end:U,size:J}=l,le=c,xt=h;if(J<0)if(l.next(),J==-1){let st=s[M];T.push(st),j.push(Z-k);return}else if(J==-3){h=M;return}else if(J==-4){c=M;return}else throw new RangeError(`Unrecognized record size: ${J}`);let Ii=a[M],Yn,Wt,Ka=Z-k;if(U-Z<=r&&(Wt=g(l.pos-P,B))){let st=new Uint16Array(Wt.size-Wt.skip),Ze=l.pos-Wt.size,Je=st.length;for(;l.pos>Ze;)Je=b(Wt.start,st,Je);Yn=new Rt(st,U-Wt.start,i),Ka=Wt.start-k}else{let st=l.pos-J;l.next();let Ze=[],Je=[],Bt=M>=o?M:-1,pi=0,Dn=U;for(;l.pos>st;)Bt>=0&&l.id==Bt&&l.size>=0?(l.end<=Dn-r&&(p(Ze,Je,Z,pi,l.end,Dn,Bt,le,xt),pi=Ze.length,Dn=l.end),l.next()):A>2500?u(Z,st,Ze,Je):f(Z,st,Ze,Je,Bt,A+1);if(Bt>=0&&pi>0&&pi-1&&pi>0){let Ja=d(Ii,xt);Yn=Jo(Ii,Ze,Je,0,Ze.length,0,U-Z,Ja,Ja)}else Yn=O(Ii,Ze,Je,U-Z,le-U,xt)}T.push(Yn),j.push(Ka)}function u(k,P,T,j){let B=[],A=0,M=-1;for(;l.pos>P;){let{id:Z,start:U,end:J,size:le}=l;if(le>4)l.next();else{if(M>-1&&U=0;J-=3)Z[le++]=B[J],Z[le++]=B[J+1]-U,Z[le++]=B[J+2]-U,Z[le++]=le;T.push(new Rt(Z,B[2]-U,i)),j.push(U-k)}}function d(k,P){return(T,j,B)=>{let A=0,M=T.length-1,Z,U;if(M>=0&&(Z=T[M])instanceof W){if(!M&&Z.type==k&&Z.length==B)return Z;(U=Z.prop(E.lookAhead))&&(A=j[M]+Z.length+U)}return O(k,T,j,B,A,P)}}function p(k,P,T,j,B,A,M,Z,U){let J=[],le=[];for(;k.length>j;)J.push(k.pop()),le.push(P.pop()+T-B);k.push(O(i.types[M],J,le,A-B,Z-A,U)),P.push(B-T)}function O(k,P,T,j,B,A,M){if(A){let Z=[E.contextHash,A];M=M?[Z].concat(M):[Z]}if(B>25){let Z=[E.lookAhead,B];M=M?[Z].concat(M):[Z]}return new W(k,P,T,j,M)}function g(k,P){let T=l.fork(),j=0,B=0,A=0,M=T.end-r,Z={size:0,start:0,skip:0};e:for(let U=T.pos-k;T.pos>U;){let J=T.size;if(T.id==P&&J>=0){Z.size=j,Z.start=B,Z.skip=A,A+=4,j+=4,T.next();continue}let le=T.pos-J;if(J<0||le=o?4:0,Ii=T.start;for(T.next();T.pos>le;){if(T.size<0)if(T.size==-3||T.size==-4)xt+=4;else break e;else T.id>=o&&(xt+=4);T.next()}B=Ii,j+=J,A+=xt}return(P<0||j==k)&&(Z.size=j,Z.start=B,Z.skip=A),Z.size>4?Z:void 0}function b(k,P,T){let{id:j,start:B,end:A,size:M}=l;if(l.next(),M>=0&&j4){let U=l.pos-(M-4);for(;l.pos>U;)T=b(k,P,T)}P[--T]=Z,P[--T]=A-k,P[--T]=B-k,P[--T]=j}else M==-3?h=j:M==-4&&(c=j);return T}let y=[],S=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,y,S,-1,0);let C=(e=n.length)!==null&&e!==void 0?e:y.length?S[0]+y[0].length:0;return new W(a[n.topID],y.reverse(),S.reverse(),C)}var Jc=new WeakMap;function Cr(n,e){if(!n.isAnonymous||e instanceof Rt||e.type!=n)return 1;let t=Jc.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof W)){t=1;break}t+=Cr(n,i)}Jc.set(e,t)}return t}function Jo(n,e,t,i,r,s,o,l,a){let h=0;for(let p=i;p=c)break;P+=T}if(S==C+1){if(P>c){let T=p[C];d(T.children,T.positions,0,T.children.length,O[C]+y);continue}f.push(p[C])}else{let T=O[S-1]+p[S-1].length-k;f.push(Jo(n,p,O,C,S,k,T,null,a))}u.push(k+y-s)}}return d(e,t,i,r,0),(l||a)(f,u,o)}var Zi=class{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof ni?this.setBuffer(e.context.buffer,e.index,t):e instanceof Qe&&this.map.set(e.tree,t)}get(e){return e instanceof ni?this.getBuffer(e.context.buffer,e.index):e instanceof Qe?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},pt=class n{constructor(e,t,i,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let r=[new n(0,e.length,e,0,!1,i)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,i=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new n(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&r.push(u),o.to>f)break;o=snew ke(r.from,r.to)):[new ke(0,0)]:[new ke(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let r=this.startParse(e,t,i);for(;;){let s=r.advance();if(s)return s}}},No=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};function Xr(n){return(e,t,i,r)=>new Fo(e,n,t,i,r)}var Rr=class{constructor(e,t,i,r,s,o){this.parser=e,this.parse=t,this.overlay=i,this.bracketed=r,this.target=s,this.from=o}};function ef(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError(\"Invalid inner parse ranges given: \"+JSON.stringify(n))}var Go=class{constructor(e,t,i,r,s,o,l,a){this.parser=e,this.predicate=t,this.mounts=i,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}},Uo=new E({perNode:!0}),Fo=class{constructor(e,t,i,r,s){this.nest=t,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new W(i.type,i.children,i.positions,i.length,i.propValues.concat([[Uo,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[E.mounted.id]=new Ct(t,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(t){let h=t.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=r.from&&u<=r.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=gg(i.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew ke(f.from-r.from,f.to-r.from)):null,!!s.bracketed,r.tree,c.length?c[0].from:r.from)),s.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else if(t&&(a=t.predicate(r))&&(a===!0&&(a=new ke(r.from,r.to)),a.from=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&r.firstChild())t&&t.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let h=nf(this.ranges,t.ranges);h.length&&(ef(h),this.inner.splice(t.index,0,new Rr(t.parser,t.parser.startParse(this.input,rf(t.mounts,h),h),t.ranges.map(c=>new ke(c.from-t.start,c.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}};function gg(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function tf(n,e,t,i,r,s){if(e=e&&t.enter(i,1,V.IgnoreOverlays|V.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof W)t=t.children[0];else break}return!1}},Ho=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(Uo))!==null&&t!==void 0?t:i.to,this.inner=new Zr(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Uo))!==null&&e!==void 0?e:t.to,this.inner=new Zr(t.tree,-t.offset)}}findMounts(e,t){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(i=s.tree)===null||i===void 0?void 0:i.prop(E.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}};function nf(n,e){let t=null,i=e;for(let r=1,s=0;r=l)break;a.to<=o||(t||(i=t=e.slice()),a.froml&&t.splice(s+1,0,new ke(l,a.to))):a.to>l?t[s--]=new ke(l,a.to):t.splice(s--,1))}}return i}function yg(n,e,t,i){let r=0,s=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=r==n.length?1e9:o?n[r].to:n[r].from,f=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);unew ke(u.from+i,u.to+i)),f=yg(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,O=p?h:f[u].from;if(O>d&&t.push(new pt(d,O,r.tree,-o,s.from>=d||s.openStart,s.to<=O||s.openEnd)),p)break;d=f[u].to}}else t.push(new pt(a,h,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return t}var Sg=0,Ce=class n{constructor(e,t,i,r){this.name=e,this.set=t,this.base=i,this.modified=r,this.id=Sg++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e==\"string\"?e:\"?\";if(e instanceof n&&(t=e),t?.base)throw new Error(\"Can not derive from a modified tag\");let r=new n(i,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new zr(e);return i=>i.modified.indexOf(t)>-1?i:zr.get(i.base||i,i.modified.concat(t).sort((r,s)=>r.id-s.id))}},xg=0,zr=class n{constructor(e){this.name=e,this.instances=[],this.id=xg++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&wg(t,l.modified));if(i)return i;let r=[],s=new Ce(e.name,r,e,t);for(let l of t)l.instances.push(s);let o=kg(t);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(n.get(l,a));return s}};function wg(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function kg(n){let e=[[]];for(let t=0;ti.length-t.length)}function Ne(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let r of t.split(\" \"))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l==\"...\"&&f>0&&f+3==r.length){o=1;break}let u=/^\"(?:[^\"\\\\]|\\\\.)*?\"|[^\\/!]+/.exec(l);if(!u)throw new RangeError(\"Invalid path: \"+r);if(s.push(u[0]==\"*\"?\"\":u[0][0]=='\"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==r.length)break;let d=r[f++];if(f==r.length&&d==\"!\"){o=0;break}if(d!=\"/\")throw new RangeError(\"Invalid path: \"+r);l=r.slice(f)}let a=s.length-1,h=s[a];if(!h)throw new RangeError(\"Invalid path: \"+r);let c=new si(i,o,a>0?s.slice(0,a):null);e[h]=c.sort(e[h])}}return hf.add(e)}var hf=new E({combine(n,e){let t,i,r;for(;n||e;){if(!n||e&&n.depth>=e.depth?(r=e,e=e.next):(r=n,n=n.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new si(r.tags,r.mode,r.context);t?t.next=s:i=s,t=s}return i}}),si=class{constructor(e,t,i,r){this.tags=e,this.mode=t,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let l of s)for(let a of l.set){let h=t[a.id];if(h){o=o?o+\" \"+h:h;break}}return o},scope:i}}function Qg(n,e){let t=null;for(let i of n){let r=i.style(e);r&&(t=t?t+\" \"+r:r)}return t}function cf(n,e,t,i=0,r=n.length){let s=new tl(i,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),i,r,\"\",s.highlighters),s.flush(r)}var tl=class{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=\"\"}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,r,s){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=r,c=vg(e)||si.empty,f=Qg(s,c.tags);if(f&&(h&&(h+=\" \"),h+=f,c.mode==1&&(r+=(r?\" \":\"\")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(E.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),O=e.firstChild();for(let g=0,b=l;;g++){let y=g=S||!e.nextSibling())););if(!y||S>i)break;b=y.to+l,b>t&&(this.highlightRange(d.cursor(),Math.max(t,y.from+l),Math.min(i,b),\"\",p),this.startSpan(Math.min(i,b),h))}O&&e.parent()}else if(e.firstChild()){u&&(r=\"\");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,r,s),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}};function vg(n){let e=n.type.prop(hf);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}var Q=Ce.define,Mr=Q(),Xt=Q(),lf=Q(Xt),af=Q(Xt),Mt=Q(),Er=Q(Mt),el=Q(Mt),rt=Q(),ri=Q(rt),it=Q(),nt=Q(),il=Q(),dn=Q(il),Lr=Q(),m={comment:Mr,lineComment:Q(Mr),blockComment:Q(Mr),docComment:Q(Mr),name:Xt,variableName:Q(Xt),typeName:lf,tagName:Q(lf),propertyName:af,attributeName:Q(af),className:Q(Xt),labelName:Q(Xt),namespace:Q(Xt),macroName:Q(Xt),literal:Mt,string:Er,docString:Q(Er),character:Q(Er),attributeValue:Q(Er),number:el,integer:Q(el),float:Q(el),bool:Q(Mt),regexp:Q(Mt),escape:Q(Mt),color:Q(Mt),url:Q(Mt),keyword:it,self:Q(it),null:Q(it),atom:Q(it),unit:Q(it),modifier:Q(it),operatorKeyword:Q(it),controlKeyword:Q(it),definitionKeyword:Q(it),moduleKeyword:Q(it),operator:nt,derefOperator:Q(nt),arithmeticOperator:Q(nt),logicOperator:Q(nt),bitwiseOperator:Q(nt),compareOperator:Q(nt),updateOperator:Q(nt),definitionOperator:Q(nt),typeOperator:Q(nt),controlOperator:Q(nt),punctuation:il,separator:Q(il),bracket:dn,angleBracket:Q(dn),squareBracket:Q(dn),paren:Q(dn),brace:Q(dn),content:rt,heading:ri,heading1:Q(ri),heading2:Q(ri),heading3:Q(ri),heading4:Q(ri),heading5:Q(ri),heading6:Q(ri),contentSeparator:Q(rt),list:Q(rt),quote:Q(rt),emphasis:Q(rt),strong:Q(rt),link:Q(rt),monospace:Q(rt),strikethrough:Q(rt),inserted:Q(),deleted:Q(),changed:Q(),invalid:Q(),meta:Lr,documentMeta:Q(Lr),annotation:Q(Lr),processingInstruction:Q(Lr),definition:Ce.defineModifier(\"definition\"),constant:Ce.defineModifier(\"constant\"),function:Ce.defineModifier(\"function\"),standard:Ce.defineModifier(\"standard\"),local:Ce.defineModifier(\"local\"),special:Ce.defineModifier(\"special\")};for(let n in m){let e=m[n];e instanceof Ce&&(e.name=n)}var vw=nl([{tag:m.link,class:\"tok-link\"},{tag:m.heading,class:\"tok-heading\"},{tag:m.emphasis,class:\"tok-emphasis\"},{tag:m.strong,class:\"tok-strong\"},{tag:m.keyword,class:\"tok-keyword\"},{tag:m.atom,class:\"tok-atom\"},{tag:m.bool,class:\"tok-bool\"},{tag:m.url,class:\"tok-url\"},{tag:m.labelName,class:\"tok-labelName\"},{tag:m.inserted,class:\"tok-inserted\"},{tag:m.deleted,class:\"tok-deleted\"},{tag:m.literal,class:\"tok-literal\"},{tag:m.string,class:\"tok-string\"},{tag:m.number,class:\"tok-number\"},{tag:[m.regexp,m.escape,m.special(m.string)],class:\"tok-string2\"},{tag:m.variableName,class:\"tok-variableName\"},{tag:m.local(m.variableName),class:\"tok-variableName tok-local\"},{tag:m.definition(m.variableName),class:\"tok-variableName tok-definition\"},{tag:m.special(m.variableName),class:\"tok-variableName2\"},{tag:m.definition(m.propertyName),class:\"tok-propertyName tok-definition\"},{tag:m.typeName,class:\"tok-typeName\"},{tag:m.namespace,class:\"tok-namespace\"},{tag:m.className,class:\"tok-className\"},{tag:m.macroName,class:\"tok-macroName\"},{tag:m.propertyName,class:\"tok-propertyName\"},{tag:m.operator,class:\"tok-operator\"},{tag:m.comment,class:\"tok-comment\"},{tag:m.meta,class:\"tok-meta\"},{tag:m.invalid,class:\"tok-invalid\"},{tag:m.punctuation,class:\"tok-punctuation\"}]);var rl,Et=new E;function gn(n){return R.define({combine:n?e=>e.concat(n):void 0})}var _r=new E,be=class{constructor(e,t,i=[],r=\"\"){this.data=e,this.name=r,q.prototype.hasOwnProperty(\"tree\")||Object.defineProperty(q.prototype,\"tree\",{get(){return z(this)}}),this.parser=t,this.extension=[Xi.of(this),q.languageData.of((s,o,l)=>{let a=ff(s,o,l),h=a.type.prop(Et);if(!h)return[];let c=s.facet(h),f=a.type.prop(_r);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,s)){let p=s.facet(d.facet);return d.type==\"replace\"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return ff(e,t,i).type.prop(Et)==this.data}findRegions(e){let t=e.facet(Xi);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(Et)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(E.mounted);if(l){if(l.tree.prop(Et)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let a=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new n(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function z(n){let e=n.field(be.state,!1);return e?e.tree:W.empty}var al=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=\"\",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}},pn=null,On=class n{constructor(e,t,i=[],r,s,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new n(e,t,[],W.empty,0,i,[],null)}startParse(){return this.parser.startParse(new al(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=W.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e==\"number\"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(pt.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=pn;pn=this;try{return e()}finally{pn=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=uf(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=pt.applyChanges(i,a),r=W.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=uf(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Zt{createParse(t,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let a=pn;if(a){for(let h of r)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new W(te.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return pn}};function uf(n,e,t){return pt.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}var mn=class n{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new n(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=On.create(e.facet(Xi).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new n(i)}};be.state=ae.define({create:mn.init,update(n,e){for(let t of e.effects)if(t.is(be.setState))return t.value;return e.startState.facet(Xi)!=e.state.facet(Xi)?mn.init(e.state):n.apply(e)}});var mf=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<\"u\"&&(mf=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});var sl=typeof navigator<\"u\"&&(!((rl=navigator.scheduling)===null||rl===void 0)&&rl.isInputPending)?()=>navigator.scheduling.isInputPending():null,$g=we.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(be.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(be.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=mf(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,a=s.context.work(()=>sl&&sl()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:be.setState.of(new mn(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>ue(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Xi=R.define({combine(n){return n.length?n[0]:null},enables:n=>[be.state,$g,v.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{\"data-language\":t.name}:{}})]}),Ge=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},Ot=class n{constructor(e,t,i,r,s,o=void 0){this.name=e,this.alias=t,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:i}=e;if(!t){if(!i)throw new RangeError(\"Must pass either 'load' or 'support' to LanguageDescription.of\");t=()=>Promise.resolve(i)}return new n(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let r of e)if(r.filename&&r.filename.test(t))return r;let i=/\\.([^.]+)$/.exec(t);if(i){for(let r of e)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let r of e)if(r.alias.some(s=>s==t))return r;if(i)for(let r of e)for(let s of r.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\\w/.test(t[o-1])&&!/\\w/.test(t[o+s.length])))return r}return null}},Pg=R.define(),zt=R.define({combine:n=>{if(!n.length)return\" \";let e=n[0];if(!e||/\\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error(\"Invalid indent unit: \"+JSON.stringify(n[0]));return e}});function bn(n){let e=n.facet(zt);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function yn(n,e){let t=\"\",i=n.tabSize,r=n.facet(zt)[0];if(r==\"\t\"){for(;e>=i;)t+=\"\t\",e-=i;r=\" \"}for(let s=0;s=e?Tg(n,t,e):null}var oi=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=bn(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:\"\",from:e}:(t<0?r-1&&(s+=o-this.countColumn(i,i.search(/\\S|$/))),s}countColumn(e,t=e.length){return Pe(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},mt=new E;function Tg(n,e,t){let i=e.resolveStack(t),r=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(r!=i.node){let s=[];for(let o=r;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return gf(i,n,t)}function gf(n,e,t){for(let i=n;i;i=i.next){let r=Ag(i.node);if(r)return r(hl.create(e,t,i))}return 0}function Cg(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Ag(n){let e=n.type.prop(mt);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(E.closedBy))){let r=n.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>yf(o,!0,1,void 0,s&&!Cg(o)?r.from:void 0)}return n.parent==null?Rg:null}function Rg(){return 0}var hl=class n extends oi{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new n(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Zg(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return gf(this.context.next,this.base,this.pos)}};function Zg(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function Xg(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let r=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let h=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+h}}l=a.to}}function bf({closing:n,align:e=!0,units:t=1}){return i=>yf(i,e,t,n)}function yf(n,e,t,i,r){let s=n.textAfter,o=s.match(/^\\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==n.pos+o,a=e?Xg(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}var Sf=n=>n.baseIndent;function Ei({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}var xf=R.define(),gt=new E;function jr(n){let e=n.firstChild,t=n.lastChild;return e&&e.tol.prop(Et)==o.data:o?l=>l==o:void 0,this.style=nl(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new Le(i):null,this.themeType=t.themeType}static define(e,t){return new n(e,t||{})}},cl=R.define(),wf=R.define({combine(n){return n.length?[n[0]]:null}});function ol(n){let e=n.facet(cl);return e.length?e:n.facet(wf)}function kf(n,e){let t=[Mg],i;return n instanceof Mi&&(n.module&&t.push(v.styleModule.of(n.module)),i=n.themeType),e?.fallback?t.push(wf.of(n)):i?t.push(cl.computeN([v.darkTheme],r=>r.facet(v.darkTheme)==(i==\"dark\")?[n]:[])):t.push(cl.of(n)),t}var fl=class{constructor(e){this.markCache=Object.create(null),this.tree=z(e.state),this.decorations=this.buildDeco(e,ol(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=z(e.state),i=ol(e.state),r=i!=ol(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return L.none;let i=new lt;for(let{from:r,to:s}of e.visibleRanges)cf(this.tree,t,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=L.mark({class:a})))},r,s);return i.finish()}},Mg=Ee.high(we.fromClass(fl,{decorations:n=>n.decorations})),Mw=Mi.define([{tag:m.meta,color:\"#404740\"},{tag:m.link,textDecoration:\"underline\"},{tag:m.heading,textDecoration:\"underline\",fontWeight:\"bold\"},{tag:m.emphasis,fontStyle:\"italic\"},{tag:m.strong,fontWeight:\"bold\"},{tag:m.strikethrough,textDecoration:\"line-through\"},{tag:m.keyword,color:\"#708\"},{tag:[m.atom,m.bool,m.url,m.contentSeparator,m.labelName],color:\"#219\"},{tag:[m.literal,m.inserted],color:\"#164\"},{tag:[m.string,m.deleted],color:\"#a11\"},{tag:[m.regexp,m.escape,m.special(m.string)],color:\"#e40\"},{tag:m.definition(m.variableName),color:\"#00f\"},{tag:m.local(m.variableName),color:\"#30a\"},{tag:[m.typeName,m.namespace],color:\"#085\"},{tag:m.className,color:\"#167\"},{tag:[m.special(m.variableName),m.macroName],color:\"#256\"},{tag:m.definition(m.propertyName),color:\"#00c\"},{tag:m.comment,color:\"#940\"},{tag:m.invalid,color:\"#f00\"}]);var Eg=1e4,Lg=\"()[]{}\";var Ol=new E;function ul(n,e,t){let i=n.prop(e<0?E.openedBy:E.closedBy);if(i)return i;if(n.name.length==1){let r=t.indexOf(n.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function dl(n){let e=n.type.prop(Ol);return e?e(n.node):n}function li(n,e,t,i={}){let r=i.maxScanDistance||Eg,s=i.brackets||Lg,o=z(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=ul(a.type,t,s);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return zg(n,e,t,a,c,h,s)}}return _g(n,e,t,o,l.type,r,s)}function zg(n,e,t,i,r,s,o){let l=i.parent,a={from:r.from,to:r.to},h=0,c=l?.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&s.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=s;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let O=t>0?0:d.length-1,g=t>0?d.length:-1;O!=g;O+=t){let b=o.indexOf(d[O]);if(!(b<0||i.resolveInner(p+O,1).type!=r))if(b%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+O,to:p+O+1},matched:b>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}var jg=Object.create(null),df=[te.none];var pf=[],Of=Object.create(null),Yg=Object.create(null);for(let[n,e]of[[\"variable\",\"variableName\"],[\"variable-2\",\"variableName.special\"],[\"string-2\",\"string.special\"],[\"def\",\"variableName.definition\"],[\"tag\",\"tagName\"],[\"attribute\",\"attributeName\"],[\"type\",\"typeName\"],[\"builtin\",\"variableName.standard\"],[\"qualifier\",\"modifier\"],[\"error\",\"invalid\"],[\"header\",\"heading\"],[\"property\",\"propertyName\"]])Yg[n]=Dg(jg,e);function ll(n,e){pf.indexOf(n)>-1||(pf.push(n),console.warn(e))}function Dg(n,e){let t=[];for(let l of e.split(\" \")){let a=[];for(let h of l.split(\".\")){let c=n[h]||m[h];c?typeof c==\"function\"?a.length?a=a.map(c):ll(h,`Modifier ${h} used at start of tag`):a.length?ll(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:ll(h,`Unknown highlighting tag ${h}`)}for(let h of a)t.push(h)}if(!t.length)return 0;let i=e.replace(/ /g,\"_\"),r=i+\" \"+t.map(l=>l.id),s=Of[r];if(s)return s.id;let o=Of[r]=te.define({id:df.length,name:i,props:[Ne({[i]:t})]});return df.push(o),o.id}var Ew={rtl:L.mark({class:\"cm-iso\",inclusive:!0,attributes:{dir:\"rtl\"},bidiIsolate:H.RTL}),ltr:L.mark({class:\"cm-iso\",inclusive:!0,attributes:{dir:\"ltr\"},bidiIsolate:H.LTR}),auto:L.mark({class:\"cm-iso\",inclusive:!0,attributes:{dir:\"auto\"},bidiIsolate:null})};var Vg=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=xl(n.state,t.from);return i.line?Ig(n):i.block?Bg(n):!1};function Sl(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let r=n(e,t);return r?(i(t.update(r)),!0):!1}}var Ig=Sl(Gg,0);var Wg=Sl(Zf,0);var Bg=Sl((n,e)=>Zf(n,e,Ng(e)),0);function xl(n,e){let t=n.languageDataAt(\"commentTokens\",e,1);return t.length?t[0]:{}}var Sn=50;function qg(n,{open:e,close:t},i,r){let s=n.sliceDoc(i-Sn,i),o=n.sliceDoc(r,r+Sn),l=/\\s*$/.exec(s)[0].length,a=/^\\s*/.exec(o)[0].length,h=s.length-l;if(s.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:r+a,margin:a&&1}};let c,f;r-i<=2*Sn?c=f=n.sliceDoc(i,r):(c=n.sliceDoc(i,i+Sn),f=n.sliceDoc(r-Sn,r));let u=/^\\s*/.exec(c)[0].length,d=/\\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\\s/.test(c.charAt(u+e.length))?1:0},close:{pos:r-d-t.length,margin:/\\s/.test(f.charAt(p-1))?1:0}}:null}function Ng(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),r=t.to<=i.to?i:n.doc.lineAt(t.to);r.from>i.from&&r.from==t.to&&(r=t.to==i.to+1?i:n.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\\s*/.exec(i.text)[0].length,to:r.to})}return e}function Zf(n,e,t=e.selection.ranges){let i=t.map(s=>xl(e,s.from).block);if(!i.every(s=>s))return null;let r=t.map((s,o)=>qg(e,i[o],s.from,s.to));if(n!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+\" \"},{from:s.to,insert:\" \"+i[o].close}]))};if(n!=1&&r.some(s=>s)){let s=[];for(let o=0,l;or&&(s==o||o>f.from)){r=f.from;let u=/^\\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;us.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&s.push({from:l.from+h,insert:a+\" \"});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==\" \"&&c++,s.push({from:h,to:c})}return{changes:s}}return null}var gl=fe.define(),Ug=fe.define(),Fg=R.define(),Xf=R.define({combine(n){return yi(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,r)=>e(i,r)||t(i,r)})}}),Mf=ae.define({create(){return ai.empty},update(n,e){let t=e.state.facet(Xf),i=e.annotation(gl);if(i){let a=Ue.fromTransaction(e,i.selection),h=i.side,c=h==0?n.undone:n.done;return a?c=Dr(c,c.length,t.minDepth,a):c=zf(c,e.startState.selection),new ai(h==0?i.rest:c,h==0?c:i.rest)}let r=e.annotation(Ug);if((r==\"full\"||r==\"before\")&&(n=n.isolate()),e.annotation(ee.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let s=Ue.fromTransaction(e),o=e.annotation(ee.time),l=e.annotation(ee.userEvent);return s?n=n.addChanges(s,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(r==\"full\"||r==\"after\")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new ai(n.done.map(Ue.fromJSON),n.undone.map(Ue.fromJSON))}});function Ef(n={}){return[Mf,Xf.of(n),v.domEventHandlers({beforeinput(e,t){let i=e.inputType==\"historyUndo\"?Ir:e.inputType==\"historyRedo\"?xn:null;return i?(e.preventDefault(),i(t)):!1}})]}function Vr(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let r=t.field(Mf,!1);if(!r)return!1;let s=r.pop(n,t,e);return s?(i(s),!0):!1}}var Ir=Vr(0,!1),xn=Vr(1,!1),Hg=Vr(0,!0),Kg=Vr(1,!0);var Ue=class n{constructor(e,t,i,r,s){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new n(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new n(e.changes&&Oe.fromJSON(e.changes),[],e.mapped&&ot.fromJSON(e.mapped),e.startSelection&&x.fromJSON(e.startSelection),e.selectionsAfter.map(x.fromJSON))}static fromTransaction(e,t){let i=De;for(let r of e.startState.facet(Fg)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new n(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,De)}static selection(e){return new n(void 0,De,void 0,void 0,e)}};function Dr(n,e,t,i){let r=e+1>t+20?e-t-1:0,s=n.slice(r,e);return s.push(i),s}function Jg(n,e){let t=[],i=!1;return n.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function e0(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Lf(n,e){return n.length?e.length?n.concat(e):n:e}var De=[],t0=200;function zf(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-t0));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Dr(n,n.length-1,1e9,t.setSelAfter(i)))}else return[Ue.selection([e])]}function i0(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function ml(n,e){if(!n.length)return n;let t=n.length,i=De;for(;t;){let r=n0(n[t-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=n.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,i=r.selectionsAfter}return i.length?[Ue.selection(i)]:De}function n0(n,e,t){let i=Lf(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):De,t);if(!n.changes)return Ue.selection(i);let r=n.changes.map(e),s=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(s):s;return new Ue(r,D.mapEffects(n.effects,e),o,n.startSelection.map(s),i)}var r0=/^(input\\.type|delete)($|\\.)/,ai=class n{constructor(e,t,i=0,r=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new n(this.done,this.undone):this}addChanges(e,t,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||r0.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):Wr(t,e))}function de(n){return n.textDirectionAt(n.state.selection.main.head)==H.LTR}var Yf=n=>jf(n,!de(n)),Df=n=>jf(n,de(n));function Vf(n,e){return He(n,t=>t.empty?n.moveByGroup(t,e):Wr(t,e))}var s0=n=>Vf(n,!de(n)),o0=n=>Vf(n,de(n));var Vw=typeof Intl<\"u\"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:\"word\"}):null;function l0(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Br(n,e,t){let i=z(n).resolveInner(e.head),r=t?E.closedBy:E.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;l0(n,h,r)?i=h:a=t?h.to:h.from}let s=i.type.prop(r),o,l;return s&&(o=t?li(n,i.from,1):li(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,x.cursor(l,t?-1:1)}var a0=n=>He(n,e=>Br(n.state,e,!de(n))),h0=n=>He(n,e=>Br(n.state,e,de(n)));function If(n,e){return He(n,t=>{if(!t.empty)return Wr(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}var Wf=n=>If(n,!1),Bf=n=>If(n,!0);function qf(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):Wr(o,e));if(r.eq(i.selection))return!1;let s;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomNf(n,!1),bl=n=>Nf(n,!0);function _t(n,e,t){let i=n.lineBlockAt(e.head),r=n.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?i.to:i.from)&&(r=n.moveToLineBoundary(e,t,!1)),!t&&r.head==i.from&&i.length){let s=/^\\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=x.cursor(i.from+s))}return r}var c0=n=>He(n,e=>_t(n,e,!0)),f0=n=>He(n,e=>_t(n,e,!1)),u0=n=>He(n,e=>_t(n,e,!de(n))),d0=n=>He(n,e=>_t(n,e,de(n))),p0=n=>He(n,e=>x.cursor(n.lineBlockAt(e.head).from,1)),O0=n=>He(n,e=>x.cursor(n.lineBlockAt(e.head).to,-1));function m0(n,e,t){let i=!1,r=Li(n.selection,s=>{let o=li(n,s.head,-1)||li(n,s.head,1)||s.head>0&&li(n,s.head-1,1)||s.headm0(n,e,!1);function Ve(n,e,t){let i=Li(n.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=e&&(r=x.range(r.head,r.anchor));let s=t(r);return x.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(n.state.selection)?!1:(n.dispatch(Fe(n.state,i)),!0)}function Gf(n,e){return Ve(n,e,t=>n.moveByChar(t,e))}var Uf=n=>Gf(n,!de(n)),Ff=n=>Gf(n,de(n));function Hf(n,e){return Ve(n,e,t=>n.moveByGroup(t,e))}var b0=n=>Hf(n,!de(n)),y0=n=>Hf(n,de(n));var S0=n=>{let e=!de(n);return Ve(n,e,t=>Br(n.state,t,e))},x0=n=>{let e=de(n);return Ve(n,e,t=>Br(n.state,t,e))};function Kf(n,e){return Ve(n,e,t=>n.moveVertically(t,e))}var Jf=n=>Kf(n,!1),eu=n=>Kf(n,!0);function tu(n,e){return Ve(n,e,t=>n.moveVertically(t,e,qf(n).height))}var vf=n=>tu(n,!1),$f=n=>tu(n,!0),w0=n=>Ve(n,!0,e=>_t(n,e,!0)),k0=n=>Ve(n,!1,e=>_t(n,e,!1)),Q0=n=>{let e=!de(n);return Ve(n,e,t=>_t(n,t,e))},v0=n=>{let e=de(n);return Ve(n,e,t=>_t(n,t,e))},$0=n=>Ve(n,!1,e=>x.cursor(n.lineBlockAt(e.head).from)),P0=n=>Ve(n,!0,e=>x.cursor(n.lineBlockAt(e.head).to)),Pf=({state:n,dispatch:e})=>(e(Fe(n,{anchor:0})),!0),Tf=({state:n,dispatch:e})=>(e(Fe(n,{anchor:n.doc.length})),!0),Cf=({state:n,dispatch:e})=>(e(Fe(n,{anchor:n.selection.main.anchor,head:0})),!0),Af=({state:n,dispatch:e})=>(e(Fe(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),T0=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:\"select\"})),!0),C0=({state:n,dispatch:e})=>{let t=qr(n).map(({from:i,to:r})=>x.undirectionalRange(i,Math.min(r+1,n.doc.length)));return e(n.update({selection:x.create(t),userEvent:\"select\"})),!0},A0=({state:n,dispatch:e})=>{let t=Li(n.selection,i=>{let r=z(n),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return x.undirectionalRange(l.from,l.to)}return i});return t.eq(n.selection)?!1:(e(Fe(n,t)),!0)};function iu(n,e){let{state:t}=n,i=t.selection,r=t.selection.ranges.slice();for(let s of t.selection.ranges){let o=t.doc.lineAt(s.head);if(e?o.to0)for(let l=s;;){let a=n.moveVertically(l,e);if(a.heado.to){r.some(h=>h.head==a.head)||r.push(a);break}else{if(a.head==l.head)break;l=a}}}return r.length==i.ranges.length?!1:(n.dispatch(Fe(t,x.create(r,r.length-1))),!0)}var R0=n=>iu(n,!1),Z0=n=>iu(n,!0),X0=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=x.create([t.main]):t.main.empty||(i=x.create([x.cursor(t.main.head)])),i?(e(Fe(n,i)),!0):!1};function wn(n,e){if(n.state.readOnly)return!1;let t=\"delete.selection\",{state:i}=n,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let a=e(s);ao&&(t=\"delete.forward\",a=Yr(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Yr(n,o,!1),l=Yr(n,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:x.cursor(o,or(n)))i.between(e,e,(r,s)=>{re&&(e=t?s:r)});return e}var nu=(n,e,t)=>wn(n,i=>{let r=i.from,{state:s}=n,o=s.doc.lineAt(r),l,a;if(t&&!e&&r>o.from&&rnu(n,!1,!0);var ru=n=>nu(n,!0,!1),su=(n,e)=>wn(n,t=>{let i=t.head,{state:r}=n,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let l=null;;){if(i==(e?s.to:s.from)){i==t.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let a=re(s.text,i-s.from,e)+s.from,h=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),c=o(h);if(l!=null&&c!=l)break;(h!=\" \"||i!=t.head)&&(l=c),i=a}return i}),ou=n=>su(n,!1),M0=n=>su(n,!0);var E0=n=>wn(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headwn(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),z0=n=>wn(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:_.of([\"\",\"\"])},range:x.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:\"input\"})),!0},j0=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let r=i.from,s=n.doc.lineAt(r),o=r==s.from?r-1:re(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:re(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:n.doc.slice(r,l).append(n.doc.slice(o,r))},range:x.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:\"move.character\"})),!0)};function qr(n){let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.from),s=n.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=n.doc.lineAt(i.to-1)),t>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});t=s.number+1}return e}function lu(n,e,t){if(n.readOnly)return!1;let i=[],r=[];for(let s of qr(n)){if(t?s.to==n.doc.length:s.from==0)continue;let o=n.doc.lineAt(t?s.to+1:s.from-1),l=o.length+1;if(t){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+n.lineBreak});for(let a of s.ranges)r.push(x.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:n.lineBreak+o.text});for(let a of s.ranges)r.push(x.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:x.create(r,n.selection.mainIndex),userEvent:\"move.line\"})),!0):!1}var Y0=({state:n,dispatch:e})=>lu(n,e,!1),D0=({state:n,dispatch:e})=>lu(n,e,!0);function au(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of qr(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});let r=n.changes(i);return e(n.update({changes:r,selection:n.selection.map(r,t?1:-1),scrollIntoView:!0,userEvent:\"input.copyline\"})),!0}var V0=({state:n,dispatch:e})=>au(n,e,!1),I0=({state:n,dispatch:e})=>au(n,e,!0),W0=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(qr(e).map(({from:r,to:s})=>(r>0?r--:s{let s;if(n.lineWrapping){let o=n.lineBlockAt(r.head),l=n.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+n.documentTop-l.bottom+n.defaultLineHeight/2)}return n.moveVertically(r,!0,s)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:\"delete.line\"}),!0};function B0(n,e){if(/\\(\\)|\\[\\]|\\{\\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=z(n).resolveInner(e),i=t.childBefore(e),r=t.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(E.closedBy))&&s.indexOf(r.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(r.from).from&&!/\\S/.test(n.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}var Rf=hu(!1),q0=hu(!0);function hu(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:o}=r,l=e.doc.lineAt(s),a=!n&&s==o&&B0(e,s);n&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new oi(e,{simulateBreak:s,simulateDoubleBreak:!!a}),c=pl(h,s);for(c==null&&(c=Pe(/^\\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));ol.from&&s{let r=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,r,i),t=l.number),o=l.to+1}let s=n.changes(r);return{changes:r,range:x.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}var N0=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new oi(n,{overrideIndentation:s=>{let o=t[s];return o??-1}}),r=wl(n,(s,o,l)=>{let a=pl(i,s.from);if(a==null)return;/\\S/.test(s.text)||(a=0);let h=/^\\s*/.exec(s.text)[0],c=yn(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(wl(n,(t,i)=>{i.push({from:t.from,insert:n.facet(zt)})}),{userEvent:\"input.indent\"})),!0),Ql=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(wl(n,(t,i)=>{let r=/^\\s*/.exec(t.text)[0];if(!r)return;let s=Pe(r,n.tabSize),o=0,l=yn(n,Math.max(0,s-bn(n)));for(;o(n.setTabFocusMode(),!0);var U0=[{key:\"Ctrl-b\",run:Yf,shift:Uf,preventDefault:!0},{key:\"Ctrl-f\",run:Df,shift:Ff},{key:\"Ctrl-p\",run:Wf,shift:Jf},{key:\"Ctrl-n\",run:Bf,shift:eu},{key:\"Ctrl-a\",run:p0,shift:$0},{key:\"Ctrl-e\",run:O0,shift:P0},{key:\"Ctrl-d\",run:ru},{key:\"Ctrl-h\",run:yl},{key:\"Ctrl-k\",run:E0},{key:\"Ctrl-Alt-h\",run:ou},{key:\"Ctrl-o\",run:_0},{key:\"Ctrl-t\",run:j0},{key:\"Ctrl-v\",run:bl}],F0=[{key:\"ArrowLeft\",run:Yf,shift:Uf,preventDefault:!0},{key:\"Mod-ArrowLeft\",mac:\"Alt-ArrowLeft\",run:s0,shift:b0,preventDefault:!0},{mac:\"Cmd-ArrowLeft\",run:u0,shift:Q0,preventDefault:!0},{key:\"ArrowRight\",run:Df,shift:Ff,preventDefault:!0},{key:\"Mod-ArrowRight\",mac:\"Alt-ArrowRight\",run:o0,shift:y0,preventDefault:!0},{mac:\"Cmd-ArrowRight\",run:d0,shift:v0,preventDefault:!0},{key:\"ArrowUp\",run:Wf,shift:Jf,preventDefault:!0},{mac:\"Cmd-ArrowUp\",run:Pf,shift:Cf},{mac:\"Ctrl-ArrowUp\",run:Qf,shift:vf},{key:\"ArrowDown\",run:Bf,shift:eu,preventDefault:!0},{mac:\"Cmd-ArrowDown\",run:Tf,shift:Af},{mac:\"Ctrl-ArrowDown\",run:bl,shift:$f},{key:\"PageUp\",run:Qf,shift:vf},{key:\"PageDown\",run:bl,shift:$f},{key:\"Home\",run:f0,shift:k0,preventDefault:!0},{key:\"Mod-Home\",run:Pf,shift:Cf},{key:\"End\",run:c0,shift:w0,preventDefault:!0},{key:\"Mod-End\",run:Tf,shift:Af},{key:\"Enter\",run:Rf,shift:Rf},{key:\"Mod-a\",run:T0},{key:\"Backspace\",run:yl,shift:yl,preventDefault:!0},{key:\"Delete\",run:ru,preventDefault:!0},{key:\"Mod-Backspace\",mac:\"Alt-Backspace\",run:ou,preventDefault:!0},{key:\"Mod-Delete\",mac:\"Alt-Delete\",run:M0,preventDefault:!0},{mac:\"Mod-Backspace\",run:L0,preventDefault:!0},{mac:\"Mod-Delete\",run:z0,preventDefault:!0}].concat(U0.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),cu=[{key:\"Alt-ArrowLeft\",mac:\"Ctrl-ArrowLeft\",run:a0,shift:S0},{key:\"Alt-ArrowRight\",mac:\"Ctrl-ArrowRight\",run:h0,shift:x0},{key:\"Alt-ArrowUp\",run:Y0},{key:\"Shift-Alt-ArrowUp\",run:V0},{key:\"Alt-ArrowDown\",run:D0},{key:\"Shift-Alt-ArrowDown\",run:I0},{key:\"Mod-Alt-ArrowUp\",run:R0},{key:\"Mod-Alt-ArrowDown\",run:Z0},{key:\"Escape\",run:X0},{key:\"Mod-Enter\",run:q0},{key:\"Alt-l\",mac:\"Ctrl-l\",run:C0},{key:\"Mod-i\",run:A0,preventDefault:!0},{key:\"Mod-[\",run:Ql},{key:\"Mod-]\",run:kl},{key:\"Mod-Alt-\\\\\",run:N0},{key:\"Shift-Mod-k\",run:W0},{key:\"Shift-Mod-\\\\\",run:g0},{key:\"Mod-/\",run:Vg},{key:\"Alt-A\",mac:\"Ctrl-A\",run:Wg},{key:\"Ctrl-m\",mac:\"Shift-Alt-m\",run:G0}].concat(F0);var zi=class{constructor(e,t,i,r){this.state=e,this.pos=t,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=z(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),r=t.text.slice(i-t.from,this.pos-t.from),s=r.search(bu(e,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e==\"abort\"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}};function fu(n){let e=Object.keys(n).join(\"\"),t=/\\w/.test(e);return t&&(e=e.replace(/\\w/g,\"\")),`[${t?\"\\\\w\":\"\"}${e.replace(/[^\\w\\s]/g,\"\\\\$&\")}]`}function H0(n){let e=Object.create(null),t=Object.create(null);for(let{label:r}of n){e[r[0]]=!0;for(let s=1;stypeof r==\"string\"?{label:r}:r),[t,i]=e.every(r=>/^\\w+$/.test(r.label))?[/\\w*$/,/\\w+$/]:H0(e);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function gu(n,e){return t=>{for(let i=z(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}var Gr=class{constructor(e,t,i,r){this.completion=e,this.source=t,this.match=i,this.score=r}};function hi(n){return n.selection.main.from}function bu(n,e){var t;let{source:i}=n,r=e&&i[0]!=\"^\",s=i[i.length-1]!=\"$\";return!r&&!s?n:new RegExp(`${r?\"^\":\"\"}(?:${i})${s?\"$\":\"\"}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?\"i\":\"\")}var Ll=fe.define();function K0(n,e,t,i){let{main:r}=n.selection,s=t-r.from,o=i-r.from;return{...n.changeByRange(l=>{if(l!=r&&t!=i&&n.sliceDoc(l.from+s,l.from+o)!=n.sliceDoc(t,i))return{range:l};let a=n.toText(e);return{changes:{from:l.from+s,to:i==r.from?l.to:l.from+o,insert:a},range:x.cursor(l.from+s+a.length)}}),scrollIntoView:!0,userEvent:\"input.complete\"}}var uu=new WeakMap;function J0(n){if(!Array.isArray(n))return n;let e=uu.get(n);return e||uu.set(n,e=El(n)),e}var Ur=D.define(),Qn=D.define(),$l=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:(P=dh(k))!=P.toLowerCase()?1:P!=P.toUpperCase()?2:0;(!y||T==1&&g||C==0&&T!=0)&&(t[f]==k||i[f]==k&&(u=!0)?o[f++]=y:o.length&&(b=!1)),C=T,y+=kt(k)}return f==a&&o[0]==0&&b?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(O==e.length?0:-100),[0,O]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[p,O]):f==a?this.result(-100+(u?-200:0)+-700+(b?0:-1100),o,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,i){let r=[],s=0;for(let o of t){let l=o+(this.astral?kt(at(i,o)):1);s&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return this.ret(e-i.length,r)}},Pl=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>\"\",optionClass:()=>\"\",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:eb,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>du(e(i),t(i)),optionClass:(e,t)=>i=>du(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function du(n,e){return n?e?n+\" \"+e:n:e}function eb(n,e,t,i,r,s){let o=n.textDirection==H.RTL,l=o,a=!1,h=\"top\",c,f,u=e.left-r.left,d=r.right-e.right,p=i.right-i.left,O=i.bottom-i.top;if(l&&u=O||y>e.top?c=t.bottom-e.top:(h=\"bottom\",c=e.bottom-t.top)}let g=(e.bottom-e.top)/s.offsetHeight,b=(e.right-e.left)/s.offsetWidth;return{style:`${h}: ${c/g}px; max-width: ${f/b}px`,class:\"cm-completionInfo-\"+(a?o?\"left-narrow\":\"right-narrow\":l?\"left\":\"right\")}}var zl=D.define();function tb(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement(\"div\");return i.classList.add(\"cm-completionIcon\"),t.type&&i.classList.add(...t.type.split(/\\s+/g).map(r=>\"cm-completionIcon-\"+r)),i.setAttribute(\"aria-hidden\",\"true\"),i},position:20}),e.push({render(t,i,r,s){let o=document.createElement(\"span\");o.className=\"cm-completionLabel\";let l=t.displayLabel||t.label,a=0;for(let h=0;ha&&o.appendChild(document.createTextNode(l.slice(a,c)));let u=o.appendChild(document.createElement(\"span\"));u.appendChild(document.createTextNode(l.slice(c,f))),u.className=\"cm-completionMatchedText\",a=f}return at.position-i.position).map(t=>t.render)}function vl(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let r=Math.floor(e/t);return{from:r*t,to:(r+1)*t}}let i=Math.ceil((n-e)/t);return{from:n-i*t,to:n-(i-1)*t}}var Tl=class{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass=\"\";let r=e.state.field(t),{options:s,selected:o}=r.open,l=e.state.facet(se);this.optionContent=tb(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=vl(s.length,o,l.maxRenderedOptions),this.dom=document.createElement(\"div\"),this.dom.className=\"cm-tooltip-autocomplete\",this.updateTooltipClass(e.state),this.dom.addEventListener(\"mousedown\",a=>{let{options:h}=e.state.field(t).open;for(let c=a.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName==\"LI\"&&(f=/-(\\d+)$/.exec(c.id))&&+f[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;c!=null&&(e.dispatch({effects:zl.of(c)}),a.preventDefault())}}),this.dom.addEventListener(\"focusout\",a=>{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(se).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:Qn.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(\"scroll\",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=r){let{options:s,selected:o,disabled:l}=i.open;(!r.open||r.open.options!=s)&&(this.range=vl(s.length,o,e.state.facet(se).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),l!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle(\"cm-tooltip-autocomplete-disabled\",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(\" \"))i&&this.dom.classList.remove(i);for(let i of t.split(\" \"))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected=this.range.to)&&(this.range=vl(t.options.length,t.selected,this.view.state.facet(se).maxRenderedOptions),this.showOptions(t.options,e.id));let i=this.updateSelectedOption(t.selected);if(i){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:s}=r;if(!s)return;let o=typeof s==\"string\"?document.createTextNode(s):s(r);if(!o)return;\"then\"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,r)}).catch(l=>ue(this.view.state,l,\"completion info\")):(this.addInfoPane(o,r),i.setAttribute(\"aria-describedby\",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement(\"div\");if(i.className=\"cm-tooltip cm-completionInfo\",i.id=\"cm-completionInfo-\"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!=\"LI\"||!i.id?r--:r==e?i.hasAttribute(\"aria-selected\")||(i.setAttribute(\"aria-selected\",\"true\"),t=i):i.hasAttribute(\"aria-selected\")&&(i.removeAttribute(\"aria-selected\"),i.removeAttribute(\"aria-describedby\"));return t&&nb(this.list,t),t}measureInfo(){let e=this.dom.querySelector(\"[aria-selected]\");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(s.bottom,t.bottom)-10||r.bottom{o.target==r&&o.preventDefault()});let s=null;for(let o=i.from;oi.from||i.from==0))if(s=u,typeof h!=\"string\"&&h.header)r.appendChild(h.header(h));else{let d=r.appendChild(document.createElement(\"completion-section\"));d.textContent=u}}let c=r.appendChild(document.createElement(\"li\"));c.id=t+\"-\"+o,c.setAttribute(\"role\",\"option\");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&c.appendChild(d)}}return i.from&&r.classList.add(\"cm-completionListIncompleteTop\"),i.tonew Tl(t,n,e)}function nb(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),r=t.height/n.offsetHeight;i.topt.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/r)}function pu(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function rb(n,e){let t=[],i=null,r=null,s=c=>{t.push(c);let{section:f}=c.completion;if(f){i||(i=[]);let u=typeof f==\"string\"?f:f.name;i.some(d=>d.name==u)||i.push(typeof f==\"string\"?{name:u}:f)}},o=e.facet(se);for(let c of n)if(c.hasResult()){let f=c.result.getMatch;if(c.result.filter===!1)for(let u of c.result.options)s(new Gr(u,c.source,f?f(u):[],1e9-t.length));else{let u=e.sliceDoc(c.from,c.to),d,p=o.filterStrict?new Pl(u):new $l(u);for(let O of c.result.options)if(d=p.match(O.label)){let g=O.displayLabel?f?f(O,d.matched):[]:d.matched,b=d.score+(O.boost||0);if(s(new Gr(O,c.source,g,b)),typeof O.section==\"object\"&&O.section.rank===\"dynamic\"){let{name:y}=O.section;r||(r=Object.create(null)),r[y]=Math.max(b,r[y]||-1e9)}}}}if(i){let c=Object.create(null),f=0,u=(d,p)=>(d.rank===\"dynamic\"&&p.rank===\"dynamic\"?r[p.name]-r[d.name]:0)||(typeof d.rank==\"number\"?d.rank:1e9)-(typeof p.rank==\"number\"?p.rank:1e9)||(d.nameu.score-f.score||h(f.completion,u.completion))){let f=c.completion;!a||a.label!=f.label||a.detail!=f.detail||a.type!=null&&f.type!=null&&a.type!=f.type||a.apply!=f.apply||a.boost!=f.boost?l.push(c):pu(c.completion)>pu(a)&&(l[l.length-1]=c),a=c.completion}return l}var Cl=class n{constructor(e,t,i,r,s,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new n(this.options,Ou(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,r,s,o){if(r&&!o&&e.some(h=>h.isPending))return r.setDisabled();let l=rb(e,t);if(!l.length)return r&&e.some(h=>h.isPending)?r.setDisabled():null;let a=t.facet(se).selectOnOpen?0:-1;if(r&&r.selected!=a&&r.selected!=-1){let h=r.options[r.selected].completion;for(let c=0;cc.hasResult()?Math.min(h,c.from):h,1e8),create:cb,above:s.aboveCursor},r?r.timestamp:Date.now(),a,!1)}map(e){return new n(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new n(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},Al=class n{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new n(ab,\"cm-ac-\"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(se),s=(i.override||t.languageDataAt(\"autocomplete\",hi(t)).map(J0)).map(a=>(this.active.find(c=>c.source==a)||new bt(a,this.active.some(c=>c.state!=0)?1:0)).update(e,i));s.length==this.active.length&&s.every((a,h)=>a==this.active[h])&&(s=this.active);let o=this.open,l=e.effects.some(a=>a.is(_l));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!sb(s,this.active)||l?o=Cl.build(s,t,this.id,o,i,l):o&&o.disabled&&!s.some(a=>a.isPending)&&(o=null),!o&&s.every(a=>!a.isPending)&&s.some(a=>a.hasResult())&&(s=s.map(a=>a.hasResult()?new bt(a.source,0):a));for(let a of e.effects)a.is(zl)&&(o=o&&o.setSelected(a.value,this.id));return s==this.active&&o==this.open?this:new n(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?ob:lb}};function sb(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t[\"aria-activedescendant\"]=n+\"-\"+e),t}var ab=[];function yu(n,e){if(n.isUserEvent(\"input.complete\")){let i=n.annotation(Ll);if(i&&e.activateOnCompletion(i))return 12}let t=n.isUserEvent(\"input.type\");return t&&e.activateOnTyping?5:t?1:n.isUserEvent(\"delete.backward\")?2:n.selection?8:n.docChanged?16:0}var bt=class n{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let i=yu(e,t),r=this;(i&8||i&16&&this.touches(e))&&(r=new n(r.source,0)),i&4&&r.state==0&&(r=new n(this.source,1)),r=r.updateFor(e,i);for(let s of e.effects)if(s.is(Ur))r=new n(r.source,1,s.value);else if(s.is(Qn))r=new n(r.source,0);else if(s.is(_l))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(hi(e.state))}},Fr=class n extends bt{constructor(e,t,i,r,s,o){super(e,3,t),this.limit=i,this.result=r,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,t){var i;if(!(t&3))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=hi(e.state);if(l>o||!r||t&2&&(hi(e.startState)==this.from||lt.map(e))}}),ve=ae.define({create(){return Al.start()},update(n,e){return n.update(e)},provide:n=>[Pr.from(n,e=>e.tooltip),v.contentAttributes.from(n,e=>e.attrs)]});function jl(n,e){let t=e.completion.apply||e.completion.label,i=n.state.field(ve).active.find(r=>r.source==e.source);return i instanceof Fr?(typeof t==\"string\"?n.dispatch({...K0(n.state,t,i.from,i.to),annotations:Ll.of(e.completion)}):t(n,e.completion,i.from,i.to),!0):!1}var cb=ib(ve,jl);function Nr(n,e=\"option\"){return t=>{let i=t.state.field(ve,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(n?1:-1):n?0:o-1;return l<0?l=e==\"page\"?0:o-1:l>=o&&(l=e==\"page\"?o-1:0),t.dispatch({effects:zl.of(l)}),!0}}var fb=n=>{let e=n.state.field(ve,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(ve,!1)?(n.dispatch({effects:Ur.of(!0)}),!0):!1,ub=n=>{let e=n.state.field(ve,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Qn.of(null)}),!0)},Rl=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},db=50,pb=1e3,Ob=we.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(ve).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(ve),t=n.state.facet(se);if(!n.selectionSet&&!n.docChanged&&n.startState.field(ve)==e)return;let i=n.transactions.some(s=>{let o=yu(s,t);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;sdb&&Date.now()-o.time>pb){for(let l of o.context.abortListeners)try{l()}catch(a){ue(this.view.state,a)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(s=>s.effects.some(o=>o.is(Ur)))&&(this.pendingStart=!0);let r=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of n.transactions)s.isUserEvent(\"input.type\")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(ve);for(let t of e.active)t.isPending&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(se).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=hi(e),i=new zi(e,t,n.explicit,this.view),r=new Rl(n,i);this.running.push(r),Promise.resolve(n.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:Qn.of(null)}),ue(this.view.state,s)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(se).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(se),i=this.view.state.field(ve);for(let r=0;rl.source==s.active.source);if(o&&o.isPending)if(s.done==null){let l=new bt(s.active.source,0);for(let a of s.updates)l=l.update(a,t);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:_l.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(ve,!1);if(e&&e.tooltip&&this.view.state.facet(se).closeOnBlur){let t=e.open&&Vo(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Qn.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Ur.of(!1)}),20),this.composing=0}}}),mb=typeof navigator==\"object\"&&/Win/.test(navigator.platform),gb=Ee.highest(v.domEventHandlers({keydown(n,e){let t=e.state.field(ve,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(mb&&n.altKey)||n.metaKey)return!1;let i=t.open.options[t.open.selected],r=t.active.find(o=>o.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(n.key)>-1&&jl(e,i),!1}})),Su=v.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\",height:\"100%\",listStyle:\"none\",margin:0,padding:0,\"& > li, & > completion-section\":{padding:\"1px 3px\",lineHeight:1.2},\"& > li\":{overflowX:\"hidden\",textOverflow:\"ellipsis\",cursor:\"pointer\"},\"& > completion-section\":{display:\"list-item\",borderBottom:\"1px solid silver\",paddingLeft:\"0.5em\",opacity:.7}}},\"&light .cm-tooltip-autocomplete ul li[aria-selected]\":{background:\"#17c\",color:\"white\"},\"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]\":{background:\"#777\"},\"&dark .cm-tooltip-autocomplete ul li[aria-selected]\":{background:\"#347\",color:\"white\"},\"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]\":{background:\"#444\"},\".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after\":{content:'\"\\xB7\\xB7\\xB7\"',opacity:.5,display:\"block\",textAlign:\"center\",cursor:\"pointer\"},\".cm-tooltip.cm-completionInfo\":{position:\"absolute\",padding:\"3px 9px\",width:\"max-content\",maxWidth:\"400px\",boxSizing:\"border-box\",whiteSpace:\"pre-line\"},\".cm-completionInfo.cm-completionInfo-left\":{right:\"100%\"},\".cm-completionInfo.cm-completionInfo-right\":{left:\"100%\"},\".cm-completionInfo.cm-completionInfo-left-narrow\":{right:\"30px\"},\".cm-completionInfo.cm-completionInfo-right-narrow\":{left:\"30px\"},\"&light .cm-snippetField\":{backgroundColor:\"#00000022\"},\"&dark .cm-snippetField\":{backgroundColor:\"#ffffff22\"},\".cm-snippetFieldPosition\":{verticalAlign:\"text-top\",width:0,height:\"1.15em\",display:\"inline-block\",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\",boxSizing:\"content-box\"},\".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\"}}}),Zl=class{constructor(e,t,i,r){this.field=e,this.line=t,this.from=i,this.to=r}},Xl=class n{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,ne.TrackDel),i=e.mapPos(this.to,1,ne.TrackDel);return t==null||i==null?null:new n(this.field,t,i)}},Ml=class n{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],r=[t],s=e.doc.lineAt(t),o=/^\\s*/.exec(s.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\\t*/.exec(a)[0].length;for(let f=0;fnew Xl(a.field,r[a.line]+a.from,r[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],r=[],s;for(let o of e.split(/\\r\\n?|\\n/)){for(;s=/[#$]\\{(?:(\\d+)(?::([^{}]*))?|((?:\\\\[{}]|[^{}])*))\\}/.exec(o);){let l=s[1]?+s[1]:null,a=s[2]||s[3]||\"\",h=-1;l===0&&(l=1e9);let c=a.replace(/\\\\[{}]/g,f=>f[1]);for(let f=0;f=h&&u.field++}for(let f of r)if(f.line==i.length&&f.from>s.index){let u=s[2]?3+(s[1]||\"\").length:2;f.from-=u,f.to-=u}r.push(new Zl(h,i.length,s.index,s.index+c.length)),o=o.slice(0,s.index)+a+o.slice(s.index+s[0].length)}o=o.replace(/\\\\([{}])/g,(l,a,h)=>{for(let c of r)c.line==i.length&&c.from>h&&(c.from--,c.to--);return a}),i.push(o)}return new n(i,r)}},bb=L.widget({widget:new class extends he{toDOM(){let n=document.createElement(\"span\");return n.className=\"cm-snippetFieldPosition\",n}ignoreEvent(){return!1}}}),yb=L.mark({class:\"cm-snippetField\"}),_i=class n{constructor(e,t){this.ranges=e,this.active=t,this.deco=L.set(e.map(i=>(i.from==i.to?bb:yb).range(i.from,i.to)),!0)}map(e){let t=[];for(let i of this.ranges){let r=i.map(e);if(!r)return null;t.push(r)}return new n(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}},$n=D.define({map(n,e){return n&&n.map(e)}}),Sb=D.define(),vn=ae.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is($n))return t.value;if(t.is(Sb)&&n)return new _i(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>v.decorations.from(n,e=>e?e.deco:L.none)});function Yl(n,e){return x.create(n.filter(t=>t.field==e).map(t=>x.range(t.from,t.to)))}function xb(n){let e=Ml.parse(n);return(t,i,r,s)=>{let{text:o,ranges:l}=e.instantiate(t.state,r),{main:a}=t.state.selection,h={changes:{from:r,to:s==a.from?a.to:s,insert:_.of(o)},scrollIntoView:!0,annotations:i?[Ll.of(i),ee.userEvent.of(\"input.complete\")]:void 0};if(l.length&&(h.selection=Yl(l,0)),l.some(c=>c.field>0)){let c=new _i(l,0),f=h.effects=[$n.of(c)];t.state.field(vn,!1)===void 0&&f.push(D.appendConfig.of([vn,$b,Pb,Su]))}t.dispatch(t.state.update(h))}}function xu(n){return({state:e,dispatch:t})=>{let i=e.field(vn,!1);if(!i||n<0&&i.active==0)return!1;let r=i.active+n,s=n>0&&!i.ranges.some(o=>o.field==r+n);return t(e.update({selection:Yl(i.ranges,r),effects:$n.of(s?null:new _i(i.ranges,r)),scrollIntoView:!0})),!0}}var wb=({state:n,dispatch:e})=>n.field(vn,!1)?(e(n.update({effects:$n.of(null)})),!0):!1,kb=xu(1),Qb=xu(-1);var vb=[{key:\"Tab\",run:kb,shift:Qb},{key:\"Escape\",run:wb}],mu=R.define({combine(n){return n.length?n[0]:vb}}),$b=Ee.highest(Tt.compute([mu],n=>n.facet(mu)));function ye(n,e){return{...e,apply:xb(n)}}var Pb=v.domEventHandlers({mousedown(n,e){let t=e.state.field(vn,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==t.active?!1:(e.dispatch({selection:Yl(t.ranges,r.field),effects:$n.of(t.ranges.some(s=>s.field>r.field)?new _i(t.ranges,r.field):null),scrollIntoView:!0}),!0)}});var wu=new class extends Me{};wu.startSide=1;wu.endSide=-1;var Nw=typeof navigator==\"object\"&&/Android\\b/.test(navigator.userAgent);function ku(n={}){return[gb,ve,se.of(n),Ob,Cb,Su]}var Tb=[{key:\"Ctrl-Space\",run:kn},{mac:\"Alt-`\",run:kn},{mac:\"Alt-i\",run:kn},{key:\"Escape\",run:ub},{key:\"ArrowDown\",run:Nr(!0)},{key:\"ArrowUp\",run:Nr(!1)},{key:\"PageDown\",run:Nr(!0,\"page\")},{key:\"PageUp\",run:Nr(!1,\"page\")},{key:\"Enter\",run:fb}],Cb=Ee.highest(Tt.computeN([se],n=>n.facet(se).defaultKeymap?[Tb]:[]));var jt=\"form\",Dl=new Map([[\"line\",{multiline:!1,needsMax:!0}],[\"text\",{multiline:!0,needsMax:!0}],[\"select\",{multiline:!1,needsMax:!1}],[\"number\",{multiline:!1,needsMax:!1}],[\"date\",{multiline:!1,needsMax:!1}],[\"checkbox\",{multiline:!1,needsMax:!1}]]),Qu=new Set([\"id\",\"responses\",\"layout\",\"submit\",\"edit_own\",\"show_responses\",\"votes\",\"fields\"]),vu=new Set([\"name\",\"type\",\"max\",\"min\",\"required\",\"options\"]),Ab=new Set([\"table\",\"sections\"]),Rb=new Set([\"member\",\"editor\",\"owner\"]),Zb=new Set([\"named\",\"off\"]),Xb=new Set([\"id\",\"by\",\"at\",\"votes\"]),$u=24,Pu=24,Tu=64,Mb=500,Eb=2e4,Lb=/^[a-z0-9][a-z0-9-]{0,39}$/,zb=/^[a-z][a-z0-9_]{0,31}$/,_b=/^\\d{4}-\\d{2}-\\d{2}$/,Zu=/^r-[0-9a-f]{8}$/;function Xu(n){if(typeof n!=\"string\"||!n.includes(jt))return[];let e=n.split(`\n`),t=[],i=null,r=!1,s=[],o=0;for(let l=0;l=i.length){r&&t.push({...jb(s),line:o+1}),i=null,r=!1,s=[];continue}r&&s.push(a)}return i!==null&&r&&t.push({error:\"the form block is never closed\",line:o+1}),t}function jb(n){let e=new Map,t=[],i=!1;for(let r=0;r{for(;r=t.length));){let o=r;for(;rDb(f.trim())).filter(f=>f!==\"\"),a.some(f=>f===null))return{error:`the list after \"${l}\" has an unclosed quote`}}else if(t[r]==='\"'){let h=Mu(t,r);if(!h)return{error:`the value of \"${l}\" has an unclosed quote`};a=h.value,r=h.next}else{let h=r;for(;r$u)return{error:`a form takes at most ${$u} fields`};let h=[],c=new Set;for(let f of e){let u=Ib(f);if(u.error)return u;if(c.has(u.name))return{error:`two fields are called \"${u.name}\"`};c.add(u.name),h.push(u)}return{config:{id:t,responses:i,layout:r,submit:s,edit_own:o,show_responses:l,votes:a,fields:h}}}function Ib(n){for(let s of n.keys())if(!vu.has(s))return{error:`unknown key \"${s}\" (accepted: ${[...vu].join(\", \")})`};let e=n.get(\"name\");if(typeof e!=\"string\"||!e)return{error:'\"name\" is required'};if(!zb.test(e))return{error:`\"${e}\" must be lowercase letters, digits and underscores, starting with a letter`};if(Xb.has(e))return{error:`\"${e}\" is a column this gateway writes; choose another name`};let t=n.get(\"type\");if(typeof t!=\"string\"||!Dl.has(t))return{error:`\"${e}\": type must be one of ${[...Dl.keys()].join(\", \")}`};let i=Dl.get(t),r={name:e,type:t,required:!1};if(n.has(\"required\")){let s=Hr(n.get(\"required\"));if(s===null)return{error:`\"${e}\": required must be true or false`};r.required=s}if(i.needsMax){if(!n.has(\"max\"))return{error:`\"${e}\": a ${t} field needs max, so a submission cannot be unbounded`};let s=Number(n.get(\"max\")),o=t===\"text\"?Eb:Mb;if(!Number.isInteger(s)||s<1||s>o)return{error:`\"${e}\": max must be a whole number from 1 to ${o}`};r.max=s}else if(n.has(\"max\")&&t!==\"number\")return{error:`\"${e}\": max applies to line, text and number fields only`};if(t===\"select\"){let s=n.get(\"options\");if(!Array.isArray(s)||!s.length)return{error:`\"${e}\": a select field needs options: [a, b, \\u2026]`};if(s.length>Pu)return{error:`\"${e}\": at most ${Pu} options`};if(s.some(o=>o.length>Tu))return{error:`\"${e}\": an option may be at most ${Tu} characters`};if(s.some(o=>/[\\r\\n|]/.test(o)))return{error:`\"${e}\": an option may not contain a newline or a pipe`};if(new Set(s).size!==s.length)return{error:`\"${e}\": two options are the same`};r.options=s}else if(n.has(\"options\"))return{error:`\"${e}\": options applies to a select field only`};if(t===\"number\"){for(let s of[\"min\",\"max\"]){if(!n.has(s))continue;let o=Number(n.get(s));if(!Number.isFinite(o))return{error:`\"${e}\": ${s} must be a number`};r[s]=o}if(r.min!==void 0&&r.max!==void 0&&r.min>r.max)return{error:`\"${e}\": min is greater than max`}}else if(n.has(\"min\"))return{error:`\"${e}\": min applies to a number field only`};return r}function Hr(n){return n===!0||n===\"true\"?!0:n===!1||n===\"false\"?!1:null}function Eu(n,e){if(e===null||typeof e!=\"object\"||Array.isArray(e))return{error:\"values must be an object of field names to answers\"};let t=new Set(n.fields.map(r=>r.name));for(let r of Object.keys(e))if(!t.has(r))return{error:`there is no field called \"${r}\" on this form`};let i={};for(let r of n.fields){let s=e[r.name];if(s==null||s===\"\"){if(r.required)return{error:`\"${r.name}\" is required`};i[r.name]=\"\";continue}let l=Wb(r,s);if(l.error)return l;i[r.name]=l.value}return{values:i}}function Wb(n,e){switch(n.type){case\"checkbox\":{let t=Hr(typeof e==\"string\"?e.toLowerCase():e);return t===null?{error:`\"${n.name}\" must be true or false`}:{value:t?\"yes\":\"no\"}}case\"number\":{let t=typeof e==\"number\"?e:Number(String(e).trim());return Number.isFinite(t)?n.min!==void 0&&tn.max?{error:`\"${n.name}\" must be at most ${n.max}`}:{value:String(t)}:{error:`\"${n.name}\" must be a number`}}case\"date\":{let t=String(e).trim();return!_b.test(t)||Number.isNaN(Date.parse(`${t}T00:00:00Z`))?{error:`\"${n.name}\" must be a date like 2026-09-12`}:{value:t}}case\"select\":{let t=String(e).trim();return n.options.includes(t)?{value:t}:{error:`\"${n.name}\" must be one of: ${n.options.join(\", \")}`}}case\"line\":{if(typeof e!=\"string\")return{error:`\"${n.name}\" must be text`};let t=e.trim();return/[\\r\\n]/.test(t)?{error:`\"${n.name}\" must be a single line`}:Cu(t)?{error:`\"${n.name}\" contains a control character`}:[...t].length>n.max?{error:`\"${n.name}\" is longer than ${n.max} characters`}:{value:t}}case\"text\":{if(typeof e!=\"string\")return{error:`\"${n.name}\" must be text`};let t=e.replace(/\\r\\n?/g,`\n`).trim();return Cu(t.replace(/\\n/g,\"\"))?{error:`\"${n.name}\" contains a control character`}:[...t].length>n.max?{error:`\"${n.name}\" is longer than ${n.max} characters`}:{value:t}}default:return{error:`\"${n.name}\" has an unknown type`}}}function Cu(n){for(let e of n){let t=e.codePointAt(0);if(t<32||t===127)return!0}return!1}var Bb=/^$/;function qb(n){let e=[\"Id\",\"By\",\"At\",...n.fields.map(t=>t.name)];return n.votes===\"named\"&&e.push(\"Votes\"),e}var Nb=/\\\\\\\\|\\\\\\||
|<|>|&/g,Gb=new Map([[\"\\\\\\\\\",\"\\\\\"],[\"\\\\|\",\"|\"],[\"
\",`\n`],[\"<\",\"<\"],[\">\",\">\"],[\"&\",\"&\"]]);function Pn(n){return n.replace(Nb,e=>Gb.get(e))}function Au(n){return n.split(`\n`).map(e=>/^\\\\+(?:#{1,6}\\s|\\*\\*|-\\s+\\*\\*)/.test(e)?e.slice(1):e).join(`\n`)}function Lu(n,e){if(typeof n!=\"string\")return{error:\"the response file is unreadable\"};let t=n.split(`\n`),i=Bb.exec((t[0]||\"\").trim());if(!i)return{error:\"that file is not a form response file\"};if(i[1]!==e.id)return{error:`that response file belongs to form \"${i[1]}\"`};if(i[2]!==e.layout)return{error:`that response file is laid out as ${i[2]} and the form now says ${e.layout}. Point the form at a new response file; the existing answers are not rewritten.`};let r=t.slice(1);return e.layout===\"table\"?Hb(r,e):Kb(r,e)}var Ub=\"this response file holds text outside its table, and a response is written by rewriting the whole file \\u2014 that text cannot be reproduced, so nothing has been written. Move the notes to the form's own note, or point the form at a response file holding only the table.\",Fb=\"this response file holds text before its first response, and a response is written by rewriting the whole file \\u2014 that text cannot be reproduced, so nothing has been written. Move the notes to the form's own note, or point the form at a response file holding only the responses.\";function Hb(n,e){let t=qb(e),i=n.map(a=>a.trim());if(i.find(a=>a!==\"\"&&!a.startsWith(\"|\"))!==void 0)return{error:Ub};let s=i.filter(a=>a.startsWith(\"|\"));if(!s.length)return{error:\"the response file has lost its table header\"};let o=Ru(s[0]);if(o.length!==t.length||o.some((a,h)=>a!==t[h]))return{error:\"the response table's columns no longer match the form\"};let l=[];for(let a of s.slice(2)){let h=Ru(a);if(h.length!==t.length)return{error:\"a response row has the wrong number of columns\"};let[c,f,u]=h;if(!Zu.test(c))return{error:`\"${c}\" is not a response id`};let d={};e.fields.forEach((O,g)=>{d[O.name]=Pn(h[3+g])});let p=e.votes===\"named\"?zu(Pn(h[t.length-1])):[];l.push({id:c,by:f,at:u,values:d,votes:p})}return{responses:l}}function Ru(n){let e=[],t=\"\";for(let i=0;ii.trim())}function Kb(n,e){let t=[],i=null,r=null,s=new Map(e.fields.map(a=>[a.name,a])),o=()=>{i&&(r&&(i.values[r.name]=Au(r.lines.join(`\n`).trim()),r=null),t.push(i),i=null)},l=()=>{r&&(i.values[r.name]=Au(r.lines.join(`\n`).trim()),r=null)};for(let a of n){if(/^##\\s+(\\S+)\\s+·\\s+(\\S+)\\s+·\\s+(\\S+)\\s*$/.test(a))break;if(a.trim()!==\"\")return{error:Fb}}for(let a of n){let h=/^##\\s+(\\S+)\\s+·\\s+(\\S+)\\s+·\\s+(\\S+)\\s*$/.exec(a);if(h&&!Vl(a)){if(o(),!Zu.test(h[1]))return{error:`\"${h[1]}\" is not a response id`};i={id:h[1],by:h[2],at:h[3],values:Object.fromEntries(e.fields.map(d=>[d.name,\"\"])),votes:[]};continue}if(!i)continue;let c=/^-\\s+\\*\\*([a-z][a-z0-9_]*):\\*\\*\\s*(.*)$/.exec(a);if(c&&s.has(c[1])&&s.get(c[1]).type!==\"text\"){l(),i.values[c[1]]=c[2]===\"\\u2014\"?\"\":c[2];continue}let f=/^\\*\\*Votes:\\*\\*\\s*(.*)$/.exec(a);if(f&&!Vl(a)){l(),i.votes=e.votes===\"named\"?zu(f[1]):[];continue}let u=/^\\*\\*([a-z][a-z0-9_]*):\\*\\*\\s*$/.exec(a);if(u&&s.has(u[1])&&s.get(u[1]).type===\"text\"&&!Vl(a)){l(),r={name:u[1],lines:[]};continue}r&&r.lines.push(a)}return o(),{responses:t}}function Vl(n){return n.startsWith(\"\\\\\")}function zu(n){let e=n.trim();return!e||e===\"\\u2014\"?[]:e.split(\",\").map(t=>t.trim()).filter(Boolean)}var Jr=R.define({combine:n=>n.length>0?n[0]:null});function Jb(n,e){let t=e.getChild(\"CodeInfo\");if(t===null)return null;let i=n.sliceString(t.from,t.to).trim().split(/\\s+/)[0];return i===void 0||i===\"\"?null:i.toLowerCase()}function _u(n,e=0){if(!n.readOnly)return[];let t=[];return z(n).iterate({from:0,to:n.doc.length,enter(i){if(i.from{a.textContent=d,a.classList.toggle(\"cm-lp-form-status-ok\",p===\"ok\"),a.classList.toggle(\"cm-lp-form-status-bad\",p===\"bad\"),a.classList.toggle(\"cm-lp-form-status-quiet\",p===\"quiet\")},c=null,f=d=>{c=d.id;for(let p of i.fields){let O=r.get(p.name);if(O===void 0)continue;let g=d.values[p.name]??\"\";O instanceof HTMLInputElement&&O.type===\"checkbox\"?O.checked=g===\"true\":(O.value=g,O.dispatchEvent(new Event(\"input\"))),O.disabled=!1}l.disabled=!1,l.textContent=\"Save changes\",h(\"Editing your response.\",\"quiet\"),r.values().next().value?.focus()},u=this.drawResponses(t,i,f);return this.host===null?(l.disabled=!0,h(\"This preview can\\u2019t send responses.\",\"quiet\"),t):(l.addEventListener(\"click\",()=>{let d=this.host?.current??null;if(d===null){h(\"This preview can\\u2019t send responses.\",\"quiet\");return}let p=ty(i,r),O=Eu(i,iy(p));if(O.error!==void 0){h(O.error,\"bad\");return}let g=c,b=g===null?d.submit({formId:i.id,values:p}):d.update?.({formId:i.id,responseId:g,values:p})??Promise.resolve({ok:!1,message:\"Editing is unavailable here.\"});l.disabled=!0,h(g===null?\"Sending\\u2026\":\"Saving\\u2026\",\"quiet\"),b.then(y=>{if(h(y.message,y.ok?\"ok\":\"bad\"),!y.ok){l.disabled=!1;return}c=null,l.textContent=\"Submit\";for(let[,S]of r)S instanceof HTMLInputElement&&S.type===\"checkbox\"?S.checked=!1:S.value=\"\",S.disabled=!0;u()}).catch(y=>{l.disabled=!1,h(y instanceof Error?y.message:\"That didn\\u2019t send.\",\"bad\")})}),t)}drawHead(t){let i=Y(\"div\",\"cm-lp-form-head\");i.append(Y(\"span\",\"cm-lp-form-kind\",`Form \\xB7 ${t.id}`));let r=Y(\"span\",\"cm-lp-form-dest\",\"Answers go to \");return r.append(Y(\"span\",\"cm-lp-form-dest-path\",t.responses)),i.append(r),i}drawResponses(t,i,r){if(!i.show_responses)return async()=>{};let s=Y(\"div\",\"cm-lp-form-responses\"),o=this.host,l=0,a=async()=>{let h=++l,c=o?.current??null;if(c?.readResponses===void 0){s.remove();return}let f;try{f=await c.readResponses(i.responses)}catch{h===l&&s.remove();return}if(h!==l)return;if(!f.ok||f.text===void 0){s.remove();return}let u=Lu(f.text,i);if(s.replaceChildren(Y(\"div\",\"cm-lp-form-responses-title\",\"Responses\")),u.error!==void 0||u.responses===void 0){s.append(Y(\"div\",\"cm-lp-form-responses-status\",`Responses can\\u2019t be displayed: ${u.error??\"the response file is unreadable\"}.`));return}if(u.responses.length===0){s.append(Y(\"div\",\"cm-lp-form-responses-status\",\"No responses yet.\"));return}s.append(this.responsesTable(i,u.responses,a,r))};return o?.current?.readResponses!==void 0&&(s.append(Y(\"div\",\"cm-lp-form-responses-status\",\"Loading responses\\u2026\")),t.append(s),a()),a}responsesTable(t,i,r,s){let o=Y(\"div\",\"cm-lp-form-responses-scroll\"),l=document.createElement(\"table\");l.className=\"cm-lp-form-responses-table\";let a=document.createElement(\"thead\"),h=document.createElement(\"tr\");for(let f of[...t.fields.map(u=>u.name.replace(/_/g,\" \")),\"By\",\"At\"])h.append(Y(\"th\",\"\",f));t.votes===\"named\"&&h.append(Y(\"th\",\"\",\"Votes\")),t.edit_own&&h.append(Y(\"th\",\"\",\"Actions\")),a.append(h),l.append(a);let c=document.createElement(\"tbody\");for(let f of i){let u=document.createElement(\"tr\");for(let d of t.fields)u.append(Y(\"td\",\"\",f.values[d.name]??\"\"));if(u.append(Y(\"td\",\"\",f.by),Y(\"td\",\"\",f.at)),t.votes===\"named\"){let d=document.createElement(\"td\"),p=Y(\"div\",\"cm-lp-form-voters\",f.votes.length===0?\"No votes\":f.votes.join(\", \"));if(d.append(p),this.host?.current?.vote!==void 0){let g=Y(\"div\",\"cm-lp-form-vote-controls\"),b=Y(\"button\",\"cm-lp-form-vote\",\"Upvote\"),y=Y(\"button\",\"cm-lp-form-vote cm-lp-form-vote-remove\",\"Remove vote\");b.type=y.type=\"button\";let S=async C=>{b.disabled=y.disabled=!0;let k=await(this.host?.current?.vote?.({formId:t.id,responseId:f.id,vote:C})??Promise.resolve({ok:!1,message:\"Voting is unavailable.\"}));k.ok?await r():(p.textContent=k.message,b.disabled=y.disabled=!1)};b.addEventListener(\"click\",()=>void S(\"up\")),y.addEventListener(\"click\",()=>void S(\"none\")),g.append(b,y),d.append(g)}u.append(d)}if(t.edit_own){let d=document.createElement(\"td\"),p=Y(\"div\",\"cm-lp-form-response-controls\");if(this.host?.current?.update!==void 0){let g=Y(\"button\",\"cm-lp-form-response-action cm-lp-form-edit\",\"Edit\");g.type=\"button\",g.addEventListener(\"click\",()=>s(f)),p.append(g)}let O=this.host?.current?.retract;if(O!==void 0){let g=Y(\"button\",\"cm-lp-form-response-action cm-lp-form-delete\",\"Delete\");g.type=\"button\";let b=!1;g.addEventListener(\"click\",()=>{if(!b){b=!0,g.textContent=\"Confirm delete\";return}g.disabled=!0,O({formId:t.id,responseId:f.id}).then(y=>{y.ok?r():(g.disabled=!1,g.textContent=y.message)}).catch(y=>{g.disabled=!1,g.textContent=y instanceof Error?y.message:\"That response wasn\\u2019t deleted.\"})}),p.append(g)}d.append(p),u.append(d)}c.append(u)}return l.append(c),o.append(l),o}drawField(t,i,r){let s=Y(\"div\",\"cm-lp-form-row\"),o=`cm-form-${i.id}-${t.name}`,l=Y(\"div\",\"cm-lp-form-top\"),a=Y(\"label\",\"cm-lp-form-label\");if(a.htmlFor=o,a.textContent=t.name.replace(/_/g,\" \"),t.required){let c=Y(\"span\",\"cm-lp-form-required\",\"\\xB7 required\");a.append(\" \",c)}l.append(a),s.append(l);let h=ny(t);if(h.id=o,h.className=\"cm-lp-form-input\",t.required&&h.setAttribute(\"aria-required\",\"true\"),r.set(t.name,h),s.append(h),(t.type===\"line\"||t.type===\"text\")&&t.max!==void 0){let c=Y(\"div\",\"cm-lp-form-count\",`0 / ${t.max}`),f=()=>{c.textContent=`${[...h.value].length} / ${t.max}`};h.addEventListener(\"input\",f),l.append(c)}return s}};function ny(n){switch(n.type){case\"text\":{let e=document.createElement(\"textarea\");return e.rows=4,n.max!==void 0&&(e.maxLength=n.max),e}case\"select\":{let e=document.createElement(\"select\");n.required||e.append(new Option(\"\\u2014\",\"\"));for(let t of n.options??[])e.append(new Option(t,t));return e}case\"checkbox\":{let e=document.createElement(\"input\");return e.type=\"checkbox\",e}case\"number\":{let e=document.createElement(\"input\");return e.type=\"number\",n.min!==void 0&&(e.min=String(n.min)),n.max!==void 0&&(e.max=String(n.max)),e}case\"date\":{let e=document.createElement(\"input\");return e.type=\"date\",e}default:{let e=document.createElement(\"input\");return e.type=\"text\",n.max!==void 0&&(e.maxLength=n.max),e}}}var is=class n{static create(e,t,i,r,s){let o=r+(r<<8)+e+(t<<4)|0;return new n(e,t,i,o,s,[],[])}constructor(e,t,i,r,s,o,l){this.type=e,this.value=t,this.from=i,this.hash=r,this.end=s,this.children=o,this.positions=l,this.hashProp=[[E.contextHash,r]]}addChild(e,t){e.prop(E.contextHash)!=this.hash&&(e=new W(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let i=this.children.length-1;return i>=0&&(t=Math.max(t,this.positions[i]+this.children[i].length+this.from)),new W(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(r,s,o)=>new W(te.none,r,s,o,this.hashProp)})}},w;(function(n){n[n.Document=1]=\"Document\",n[n.CodeBlock=2]=\"CodeBlock\",n[n.FencedCode=3]=\"FencedCode\",n[n.Blockquote=4]=\"Blockquote\",n[n.HorizontalRule=5]=\"HorizontalRule\",n[n.BulletList=6]=\"BulletList\",n[n.OrderedList=7]=\"OrderedList\",n[n.ListItem=8]=\"ListItem\",n[n.ATXHeading1=9]=\"ATXHeading1\",n[n.ATXHeading2=10]=\"ATXHeading2\",n[n.ATXHeading3=11]=\"ATXHeading3\",n[n.ATXHeading4=12]=\"ATXHeading4\",n[n.ATXHeading5=13]=\"ATXHeading5\",n[n.ATXHeading6=14]=\"ATXHeading6\",n[n.SetextHeading1=15]=\"SetextHeading1\",n[n.SetextHeading2=16]=\"SetextHeading2\",n[n.HTMLBlock=17]=\"HTMLBlock\",n[n.LinkReference=18]=\"LinkReference\",n[n.Paragraph=19]=\"Paragraph\",n[n.CommentBlock=20]=\"CommentBlock\",n[n.ProcessingInstructionBlock=21]=\"ProcessingInstructionBlock\",n[n.Escape=22]=\"Escape\",n[n.Entity=23]=\"Entity\",n[n.HardBreak=24]=\"HardBreak\",n[n.Emphasis=25]=\"Emphasis\",n[n.StrongEmphasis=26]=\"StrongEmphasis\",n[n.Link=27]=\"Link\",n[n.Image=28]=\"Image\",n[n.InlineCode=29]=\"InlineCode\",n[n.HTMLTag=30]=\"HTMLTag\",n[n.Comment=31]=\"Comment\",n[n.ProcessingInstruction=32]=\"ProcessingInstruction\",n[n.Autolink=33]=\"Autolink\",n[n.HeaderMark=34]=\"HeaderMark\",n[n.QuoteMark=35]=\"QuoteMark\",n[n.ListMark=36]=\"ListMark\",n[n.LinkMark=37]=\"LinkMark\",n[n.EmphasisMark=38]=\"EmphasisMark\",n[n.CodeMark=39]=\"CodeMark\",n[n.CodeText=40]=\"CodeText\",n[n.CodeInfo=41]=\"CodeInfo\",n[n.LinkTitle=42]=\"LinkTitle\",n[n.LinkLabel=43]=\"LinkLabel\",n[n.URL=44]=\"URL\"})(w||(w={}));var Bl=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},ql=class{constructor(){this.text=\"\",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return Cn(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,i=0){for(let r=t;r=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let i=(n.type==w.OrderedList?ra:na)(t,e,!1);return i>0&&(n.type!=w.BulletList||ia(t,e,!1)<0)&&t.text.charCodeAt(t.pos+i-1)==n.value}var Fu={[w.Blockquote](n,e,t){return t.next!=62?!1:(t.markers.push(I(w.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(Ie(t.text.charCodeAt(t.pos+1))?2:1)),n.end=e.lineStart+t.text.length,!0)},[w.ListItem](n,e,t){return t.indent-1?!1:(t.moveBaseColumn(t.baseIndent+n.value),!0)},[w.OrderedList]:ju,[w.BulletList]:ju,[w.Document](){return!0}};function Ie(n){return n==32||n==9||n==10||n==13}function Cn(n,e=0){for(;et&&Ie(n.charCodeAt(e-1));)e--;return e}function Hu(n){if(n.next!=96&&n.next!=126)return-1;let e=n.pos+1;for(;e-1&&n.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(sd.SetextHeading)>-1||i<3?-1:1}function Ju(n,e){for(let t=n.stack.length-1;t>=0;t--)if(n.stack[t].type==e)return!0;return!1}function na(n,e,t){return(n.next==45||n.next==43||n.next==42)&&(n.pos==n.text.length-1||Ie(n.text.charCodeAt(n.pos+1)))&&(!t||Ju(e,w.BulletList)||n.skipSpace(n.pos+2)=48&&r<=57;){i++;if(i==n.text.length)return-1;r=n.text.charCodeAt(i)}return i==n.pos||i>n.pos+9||r!=46&&r!=41||in.pos+1||n.next!=49)?-1:i+1-n.pos}function ed(n){if(n.next!=35)return-1;let e=n.pos+1;for(;e6?-1:t}function td(n){if(n.next!=45&&n.next!=61||n.indent>=n.baseIndent+4)return-1;let e=n.pos+1;for(;e/,nd=/\\?>/,Gl=[[/^<(?:script|pre|style)(?:\\s|>|$)/i,/<\\/(?:script|pre|style)>/i],[/^\\s*/i.exec(i);if(s)return n.append(I(w.Comment,t,t+1+s[0].length));let o=/^\\?[^]*?\\?>/.exec(i);if(o)return n.append(I(w.ProcessingInstruction,t,t+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\\[CDATA\\[[^]*?\\]\\]>|\\/\\s*[a-zA-Z][\\w-]*\\s*>|\\s*[a-zA-Z][\\w-]*(\\s+[a-zA-Z:_][\\w-.:]*(?:\\s*=\\s*(?:[^\\s\"'=<>`]+|'[^']*'|\"[^\"]*\"))?)*\\s*(\\/\\s*)?>)/.exec(i);return l?n.append(I(w.HTMLTag,t,t+1+l[0].length)):-1},Emphasis(n,e,t){if(e!=95&&e!=42)return-1;let i=t+1;for(;n.char(i)==e;)i++;let r=n.slice(t-1,t),s=n.slice(i,i+1),o=Zn.test(r),l=Zn.test(s),a=/\\s|^$/.test(r),h=/\\s|^$/.test(s),c=!h&&(!l||a||o),f=!a&&(!o||h||l),u=c&&(e==42||!f||o),d=f&&(e==42||!c||l);return n.append(new Se(e==95?ad:hd,t,i,(u?1:0)|(d?2:0)))},HardBreak(n,e,t){if(e==92&&n.char(t+1)==10)return n.append(I(w.HardBreak,t,t+2));if(e==32){let i=t+1;for(;n.char(i)==32;)i++;if(n.char(i)==10&&i>=t+2)return n.append(I(w.HardBreak,t,i+1))}return-1},Link(n,e,t){return e==91?n.append(new Se(ci,t,t+1,1)):-1},Image(n,e,t){return e==33&&n.char(t+1)==91?n.append(new Se(ss,t,t+2,1)):-1},LinkEnd(n,e,t){if(e!=93)return-1;for(let i=n.parts.length-1;i>=0;i--){let r=n.parts[i];if(r instanceof Se&&(r.type==ci||r.type==ss)){if(!r.side||n.skipSpace(r.to)==t&&!/[(\\[]/.test(n.slice(t+1,t+2)))return n.parts[i]=null,-1;let s=n.takeContent(i),o=n.parts[i]=oy(n,s,r.type==ci?w.Link:w.Image,r.from,t+1);if(r.type==ci)for(let l=0;le?I(w.URL,e+t,s+t):s==n.length?null:!1}}function fd(n,e,t){let i=n.charCodeAt(e);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=e+1,o=!1;s=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,i,r,s){return this.append(new Se(e,t,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof Se&&(t.type==ci||t.type==ss))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let i=e;i=e;a--){let O=this.parts[a];if(O instanceof Se&&O.side&1&&O.type==r.type&&!(s&&(r.side&1||O.side&2)&&(O.to-O.from+o)%3==0&&((O.to-O.from)%3||o%3))){l=O;break}}if(!l)continue;let h=r.type.resolve,c=[],f=l.from,u=r.to;if(s){let O=Math.min(2,l.to-l.from,o);f=l.to-O,u=r.from+O,h=O==1?\"Emphasis\":\"StrongEmphasis\"}l.type.mark&&c.push(this.elt(l.type.mark,f,l.to));for(let O=a+1;O=0;t--){let i=this.parts[t];if(i instanceof Se&&i.type==e&&i.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof Se?t:null}skipSpace(e){return Cn(this.text,e-this.offset)+this.offset}elt(e,t,i,r){return typeof e==\"string\"?I(this.parser.getNodeType(e),t,i,r):new rs(e,t)}};Xn.linkStart=ci;Xn.imageStart=ss;function Jl(n,e){if(!e.length)return n;if(!n.length)return e;let t=n.slice(),i=0;for(let r of e){for(;i(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=`\n`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=e+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=t;if(!i.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(E.contextHash)==e}takeNodes(e){let t=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,l=e.block.children.length,a=o,h=l;for(;;){if(t.to-i>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let c=dd(t.from-i,e.ranges);if(t.to-i<=e.ranges[e.rangeI].to)e.addNode(t.tree,c);else{let f=new W(e.parser.nodeSet.types[w.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(f,t.tree),e.addNode(f,c)}if(t.type.is(\"Block\")&&(ly.indexOf(t.type.id)<0?(o=t.to-i,l=e.block.children.length):(o=a,l=h),a=t.to-i,h=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return o-s}};function dd(n,e){let t=n;for(let i=1;ies[n]),Object.keys(es).map(n=>sd[n]),Object.keys(es),ry,Fu,Object.keys(Wl).map(n=>Wl[n]),Object.keys(Wl),[]);function hy(n,e,t){let i=[];for(let r=n.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:t;if(o>s&&i.push({from:s,to:o}),!r)break;s=r.to}return i}function Od(n){let{codeParser:e,htmlParser:t}=n;return{wrap:Xr((r,s)=>{let o=r.type.id;if(e&&(o==w.CodeBlock||o==w.FencedCode)){let l=\"\";if(o==w.FencedCode){let h=r.node.getChild(w.CodeInfo);h&&(l=s.read(h.from,h.to))}let a=e(l);if(a)return{parser:a,overlay:h=>h.type.id==w.CodeText,bracketed:o==w.FencedCode}}else if(t&&(o==w.HTMLBlock||o==w.HTMLTag||o==w.CommentBlock))return{parser:t,overlay:hy(r.node,r.from,r.to)};return null})}}var cy={resolve:\"Strikethrough\",mark:\"StrikethroughMark\"},fy={defineNodes:[{name:\"Strikethrough\",style:{\"Strikethrough/...\":m.strikethrough}},{name:\"StrikethroughMark\",style:m.processingInstruction}],parseInline:[{name:\"Strikethrough\",parse(n,e,t){if(e!=126||n.char(t+1)!=126||n.char(t+2)==126)return-1;let i=n.slice(t-1,t),r=n.slice(t+2,t+3),s=/\\s|^$/.test(i),o=/\\s|^$/.test(r),l=Zn.test(i),a=Zn.test(r);return n.addDelimiter(cy,t,t+2,!o&&(!a||s||l),!s&&(!l||o||a))},after:\"Emphasis\"}]};function An(n,e,t=0,i,r=0){let s=0,o=!0,l=-1,a=-1,h=!1,c=()=>{i.push(n.elt(\"TableCell\",r+l,r+a,n.parser.parseInline(e.slice(l,a),r+l)))};for(let f=t;f-1)&&s++,o=!1,i&&(l>-1&&c(),i.push(n.elt(\"TableDelimiter\",f+r,f+r+1))),l=a=-1):(h||u!=32&&u!=9)&&(l<0&&(l=f),a=f+1),h=!h&&u==92}return l>-1&&(s++,i&&c()),s}function Iu(n,e){for(let t=e;t\\s]*\\|?(\\s*:?-+:?\\s*\\|)+(\\s*:?-+:?\\s*)?$/,os=class{constructor(){this.rows=null}nextLine(e,t,i){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&md.test(r=t.text.slice(t.pos))){let s=[];An(e,i.content,0,s,i.start)==An(e,r,0)&&(this.rows=[e.elt(\"TableHeader\",i.start,i.start+i.content.length,s),e.elt(\"TableDelimiter\",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let r=[];An(e,t.text,t.pos,r,e.lineStart),this.rows.push(e.elt(\"TableRow\",e.lineStart+t.pos,e.lineStart+t.text.length,r))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(\"Table\",t.start,t.start+t.content.length,this.rows)),!0):!1}},uy={defineNodes:[{name:\"Table\",block:!0},{name:\"TableHeader\",style:{\"TableHeader/...\":m.heading}},\"TableRow\",{name:\"TableCell\",style:m.content},{name:\"TableDelimiter\",style:m.processingInstruction}],parseBlock:[{name:\"Table\",leaf(n,e){return Iu(e.content,0)?new os:null},endLeaf(n,e,t){if(t.parsers.some(r=>r instanceof os)||!Iu(e.text,e.basePos))return!1;let i=n.peekLine();return md.test(i)&&An(n,e.text,e.basePos)==An(n,i,e.basePos)},before:\"SetextHeading\"}]},ta=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(\"Task\",t.start,t.start+t.content.length,[e.elt(\"TaskMarker\",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},dy={defineNodes:[{name:\"Task\",block:!0,style:m.list},{name:\"TaskMarker\",style:m.atom}],parseBlock:[{name:\"TaskList\",leaf(n,e){return/^\\[[ xX]\\][ \\t]/.test(e.content)&&n.parentType().name==\"ListItem\"?new ta:null},after:\"SetextHeading\"}]},Wu=/(www\\.)|(https?:\\/\\/)|([\\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Bu=/[\\w-]+(\\.[\\w-]+)+(:\\d+)?(\\/[^\\s<]*)?/gy,py=/[\\w-]+\\.[\\w-]+($|[/:])/,qu=/[\\w.+-]+@[\\w-]+(\\.[\\w.-]+)+/gy,Nu=/\\/[a-zA-Z\\d@.]+/gy;function Gu(n,e,t,i){let r=0;for(let s=e;s-1)return-1;let i=e+t[0].length;for(;;){let r=n[i-1],s;if(/[?!.,:*_~]/.test(r)||r==\")\"&&Gu(n,e,i,\")\")>Gu(n,e,i,\"(\"))i--;else if(r==\";\"&&(s=/&(?:#\\d+|#x[a-f\\d]+|\\w+);$/.exec(n.slice(e,i))))i=e+s.index;else break}return i}function Uu(n,e){qu.lastIndex=e;let t=qu.exec(n);if(!t)return-1;let i=t[0][t[0].length-1];return i==\"_\"||i==\"-\"?-1:e+t[0].length-(i==\".\"?1:0)}var my={parseInline:[{name:\"Autolink\",parse(n,e,t){let i=t-n.offset;if(i&&/\\w/.test(n.text[i-1]))return-1;Wu.lastIndex=i;let r=Wu.exec(n.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=Oy(n.text,i+r[0].length),s>-1&&n.hasOpenLink){let o=/([^\\[\\]]|\\[[^\\]]*\\])*/.exec(n.text.slice(i,s));s=i+o[0].length}}else r[3]?s=Uu(n.text,i):(s=Uu(n.text,i+r[0].length),s>-1&&r[0]==\"xmpp:\"&&(Nu.lastIndex=s,r=Nu.exec(n.text),r&&(s=r.index+r[0].length)));return s<0?-1:(n.addElement(n.elt(\"URL\",t,s+n.offset)),s+n.offset)}}]},ls=[uy,dy,fy,my];function gd(n,e,t){return(i,r,s)=>{if(r!=n||i.char(s+1)==n)return-1;let o=[i.elt(t,s,s+1)];for(let l=s+1;lt%3==0).concat(this.state)}]@${this.pos}${this.score?\"!\"+this.score:\"\"}`}static start(e,t,i=0){let r=e.parser.context;return new n(e,[],t,i,i,0,[],0,r?new as(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,h)}storeNode(e,t,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(t==i)return;if(this.buffer[o-2]>=t){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,t,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>i;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(e,t,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,r,4);else{let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||t<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(t,i),t<=o.maxNode&&this.buffer.push(t,i,r,4)}}apply(e,t,i,r){e&65536?this.reduce(e):this.shift(e,t,i,r)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new n(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new aa(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if(!(i&65536))return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sa&1&&l==o)||r.push(t[s],o)}t=r}let i=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],a,!1)>=0)return l<<19|65536|a}}else{let l=i(o,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t0&&this.emitLookAhead()}},as=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},aa=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},ha=class n{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new n(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.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,this.index==0&&this.maybeNext()}fork(){return new n(this.stack,this.pos,this.index)}};function Mn(n,e=Uint16Array){if(typeof n!=\"string\")return n;let t=null;for(let i=0,r=0;i=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}t?t[r++]=s:t=new e(s)}return t}var Yi=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},xd=new Yi,ca=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=\"\",this.chunkOff=0,this.chunk2=\"\",this.chunk2Pos=0,this.next=-1,this.token=xd,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,r=this.rangeIndex,s=this.pos+e;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,r;if(t>=0&&t=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=\"\",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=xd,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i=\"\";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return i}},Dt=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;$d(this.data,e,t,this.id,i.data,i.tokenPrecTable)}};Dt.prototype.contextual=Dt.prototype.fallback=Dt.prototype.extend=!1;var Vt=class{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data=typeof e==\"string\"?Mn(e):e}token(e,t){let i=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if($d(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}};Vt.prototype.contextual=Dt.prototype.fallback=Dt.prototype.extend=!1;var oe=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function $d(n,e,t,i,r,s){let o=0,l=1<0){let p=n[d];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||by(p,e.token.value,r,s))){e.acceptToken(p);break}}let c=e.next,f=0,u=n[o+2];if(e.next<0&&u>f&&n[h+u*3-3]==65535){o=n[h+u*3-1];continue e}for(;f>1,p=h+d+(d<<1),O=n[p],g=n[p+1]||65536;if(c=g)f=d+1;else{o=n[p+2],e.advance();continue e}}break}}function wd(n,e,t){for(let i=e,r;(r=n[i])!=65535;i++)if(r==t)return i-e;return-1}function by(n,e,t,i){let r=wd(t,i,e);return r<0||wd(t,i,n)e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}var fa=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?kd(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?kd(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof W){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}},ua=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Yi)}getActions(e){let t=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let h=0;hf.end+25&&(a=Math.max(f.lookAhead,a)),f.value!=0)){let u=t;if(f.extended>-1&&(t=this.addActions(e,f.extended,f.end,t)),t=this.addActions(e,f.value,f.end,t),!c.extend&&(i=f,t>u))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new Yi,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Yi,{pos:i,p:r}=e;return t.start=i,t.end=Math.min(i+1,r.stream.end),t.value=i==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,i){let r=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let o=0;o=0&&i.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,i,r){for(let s=0;se.bufferLength*4?new fa(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)i.push(l);else{if(this.advanceStack(l,i,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!i.length){let o=r&&yy(r);if(o)return Ae&&console.log(\"Finish with \"+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Ae&&r&&console.log(\"Stuck with token \"+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):\"none\")),new SyntaxError(\"No parse at \"+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return Ae&&console.log(\"Force-finish \"+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,a)=>a.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let o=0;o500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)i.splice(a--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o \":\"\";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let u=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(u>-1&&f.length&&(!h||(f.prop(E.contextHash)||0)==c))return e.useNode(f,u),Ae&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof W)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof W&&f.positions[0]==0)f=d;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Ae&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let h=0;hr?t.push(p):i.push(p)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return Qd(e,t),!0}}runRecovery(e,t,i){let r=null,s=!1;for(let o=0;o \":\"\";if(l.deadEnd&&(s||(s=!0,l.restart(),Ae&&console.log(c+this.stackID(l)+\" (restarted)\"),this.advanceFully(l,i))))continue;let f=l.split(),u=c;for(let d=0;d<10&&f.forceReduce()&&(Ae&&console.log(u+this.stackID(f)+\" (via force-reduce)\"),!this.advanceFully(f,i));d++)Ae&&(u=this.stackID(f)+\" -> \");for(let d of l.recoverByInsert(a))Ae&&console.log(c+this.stackID(d)+\" (via recover-insert)\"),this.advanceFully(d,i);this.stream.end>l.pos?(h==l.pos&&(h++,a=0),l.recoverByDelete(a,h),Ae&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),Qd(l,i)):(!r||r.scoren,Di=class{constructor(e){this.start=e.start,this.shift=e.shift||oa,this.reduce=e.reduce||oa,this.reuse=e.reuse||oa,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},It=class n extends Zt{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(\" \");this.minRepeatTerm=t.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(c,a,l[h++]);else{let f=l[h+-c];for(let u=-c;u>0;u--)s(l[h++],a,f);h++}}}this.nodeSet=new At(t.map((l,a)=>te.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=Mn(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l==\"number\"?new Dt(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let r=new da(this,e,t,i);for(let s of this.wrappers)r=s(r,e,t,i);return r}getGoto(e,t,i=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&i)return a;for(let h=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),r=i?t(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=yt(this.data,s+2);else break;r=t(yt(this.data,s+1))}return r}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=yt(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[i],r)}}return t}configure(e){let t=Object.assign(Object.create(n.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(l=>l.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return t.specializers[r]=vd(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let s of e.split(\" \")){let o=t.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;si)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scoren.external(t,i)<<1|e}return n.get}var Sy=55,xy=1,wy=56,ky=2,Qy=57,vy=3,Pd=4,$y=5,ya=6,Ed=7,Ld=8,zd=9,_d=10,Py=11,Ty=12,Cy=13,Oa=58,Ay=14,Ry=15,Td=59,jd=21,Zy=23,Yd=24,Xy=25,ga=27,Dd=28,My=29,Ey=32,Ly=35,zy=37,_y=38,jy=0,Yy=1,Dy={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Vy={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Cd={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Iy(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}var Ad=null,Rd=null,Zd=0;function ba(n,e){let t=n.pos+e;if(Zd==t&&Rd==n)return Ad;let i=n.peek(e),r=\"\";for(;Iy(i);)r+=String.fromCharCode(i),i=n.peek(++e);return Rd=n,Zd=t,Ad=r?r.toLowerCase():i==Wy||i==By?void 0:null}var Vd=60,hs=62,Sa=47,Wy=63,By=33,qy=45;function Xd(n,e){this.name=n,this.parent=e}var Ny=[ya,_d,Ed,Ld,zd],Gy=new Di({start:null,shift(n,e,t,i){return Ny.indexOf(e)>-1?new Xd(ba(i,1)||\"\",n):n},reduce(n,e){return e==jd&&n?n.parent:n},reuse(n,e,t,i){let r=e.type.id;return r==ya||r==zy?new Xd(ba(i,1)||\"\",n):n},strict:!1}),Uy=new oe((n,e)=>{if(n.next!=Vd){n.next<0&&e.context&&n.acceptToken(Oa);return}n.advance();let t=n.next==Sa;t&&n.advance();let i=ba(n,0);if(i===void 0)return;if(!i)return n.acceptToken(t?Ry:Ay);let r=e.context?e.context.name:null;if(t){if(i==r)return n.acceptToken(Py);if(r&&Vy[r])return n.acceptToken(Oa,-2);if(e.dialectEnabled(jy))return n.acceptToken(Ty);for(let s=e.context;s;s=s.parent)if(s.name==i)return;n.acceptToken(Cy)}else{if(i==\"script\")return n.acceptToken(Ed);if(i==\"style\")return n.acceptToken(Ld);if(i==\"textarea\")return n.acceptToken(zd);if(Dy.hasOwnProperty(i))return n.acceptToken(_d);r&&Cd[r]&&Cd[r][i]?n.acceptToken(Oa,-1):n.acceptToken(ya)}},{contextual:!0}),Fy=new oe(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(Td);break}if(n.next==qy)e++;else if(n.next==hs&&e>=2){t>=3&&n.acceptToken(Td,-2);break}else e=0;n.advance()}});function Hy(n){for(;n;n=n.parent)if(n.name==\"svg\"||n.name==\"math\")return!0;return!1}var Ky=new oe((n,e)=>{if(n.next==Sa&&n.peek(1)==hs){let t=e.dialectEnabled(Yy)||Hy(e.context);n.acceptToken(t?$y:Pd,2)}else n.next==hs&&n.acceptToken(Pd,1)});function xa(n,e,t){let i=2+n.length;return new oe(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(s==0&&r.next==Vd||s==1&&r.next==Sa||s>=2&&so?r.acceptToken(e,-o):r.acceptToken(t,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(e,1);break}else s=o=0;r.advance()}})}var Jy=xa(\"script\",Sy,xy),e1=xa(\"style\",wy,ky),t1=xa(\"textarea\",Qy,vy),i1=Ne({\"Text RawText IncompleteTag IncompleteCloseTag\":m.content,\"StartTag StartCloseTag SelfClosingEndTag EndTag\":m.angleBracket,TagName:m.tagName,\"MismatchedCloseTag/TagName\":[m.tagName,m.invalid],AttributeName:m.attributeName,\"AttributeValue UnquotedAttributeValue\":m.attributeValue,Is:m.definitionOperator,\"EntityReference CharacterReference\":m.character,Comment:m.blockComment,ProcessingInst:m.processingInstruction,DoctypeDecl:m.documentMeta}),Id=It.deserialize({version:14,states:\",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#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S!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~\",goto:\"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp\",nodeNames:\"\\u26A0 StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl\",maxTerm:68,context:Gy,nodeProps:[[\"closedBy\",-10,1,2,3,7,8,9,10,11,12,13,\"EndTag\",6,\"EndTag SelfClosingEndTag\",-4,22,31,34,37,\"CloseTag\"],[\"openedBy\",4,\"StartTag StartCloseTag\",5,\"StartTag\",-4,30,33,36,38,\"OpenTag\"],[\"group\",-10,14,15,18,19,20,21,40,41,42,43,\"Entity\",17,\"Entity TextContent\",-3,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`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let h=l.type.id;if(h==My)return ma(l,a,t);if(h==Ey)return ma(l,a,i);if(h==Ly)return ma(l,a,r);if(h==jd&&s.length){let c=l.node,f=c.firstChild,u=f&&Md(f,a),d;if(u){for(let p of s)if(p.tag==u&&(!p.attrs||p.attrs(d||(d=Wd(f,a))))){let O=c.lastChild,g=O.type.id==_y?O.from:c.to;if(g>f.to)return{parser:p.parser,overlay:[{from:f.to,to:g}]}}}}if(o&&h==Yd){let c=l.node,f;if(f=c.firstChild){let u=o[a.read(f.from,f.to)];if(u)for(let d of u){if(d.tagName&&d.tagName!=Md(c.parent,a))continue;let p=c.lastChild;if(p.type.id==ga){let O=p.from+1,g=p.lastChild,b=p.to-(g&&g.isError?0:1);if(b>O)return{parser:d.parser,overlay:[{from:O,to:b}],bracketed:!0}}else if(p.type.id==Dd)return{parser:d.parser,overlay:[{from:p.from,to:p.to}]}}}}return null})}var n1=148,Bd=1,r1=149,s1=150,Nd=2,o1=151,l1=3,a1=4,Gd=[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],h1=58,c1=40,Ud=95,f1=91,cs=45,u1=46,d1=35,p1=37,O1=38,m1=92,g1=10,b1=42;function En(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function ka(n){return n>=48&&n<=57}function qd(n){return ka(n)||n>=97&&n<=102||n>=65&&n<=70}var Fd=(n,e,t)=>(i,r)=>{for(let s=!1,o=0,l=0;;l++){let{next:a}=i;if(En(a)||a==cs||a==Ud||s&&ka(a))!s&&(a!=cs||l>0)&&(s=!0),o===l&&a==cs&&o++,i.advance();else if(a==m1&&i.peek(1)!=g1){if(i.advance(),qd(i.next)){do i.advance();while(qd(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(o==2&&r.canShift(Nd)?e:a==c1?t:n);break}}},y1=new oe(Fd(r1,Nd,s1),{contextual:!0}),S1=new oe(Fd(o1,l1,a1),{contextual:!0}),x1=new oe(n=>{if(Gd.includes(n.peek(-1))){let{next:e}=n;(En(e)||e==Ud||e==d1||e==u1||e==b1||e==f1||e==h1&&En(n.peek(1))||e==cs||e==O1)&&n.acceptToken(n1)}}),w1=new oe(n=>{if(!Gd.includes(n.peek(-1))){let{next:e}=n;if(e==p1&&(n.advance(),n.acceptToken(Bd)),En(e)){do n.advance();while(En(n.next)||ka(n.next));n.acceptToken(Bd)}}}),k1=Ne({\"AtKeyword import charset namespace keyframes media supports font-feature-values\":m.definitionKeyword,\"from to selector scope MatchFlag\":m.keyword,NamespaceName:m.namespace,KeyframeName:m.labelName,KeyframeRangeName:m.operatorKeyword,TagName:m.tagName,ClassName:m.className,PseudoClassName:m.constant(m.className),IdName:m.labelName,\"FeatureName PropertyName\":m.propertyName,AttributeName:m.attributeName,NumberLiteral:m.number,KeywordQuery:m.keyword,UnaryQueryOp:m.operatorKeyword,\"CallTag ValueName FontName\":m.atom,VariableName:m.variableName,Callee:m.operatorKeyword,Unit:m.unit,\"UniversalSelector NestingSelector\":m.definitionOperator,\"MatchOp CompareOp\":m.compareOperator,\"ChildOp SiblingOp, LogicOp\":m.logicOperator,BinOp:m.arithmeticOperator,Important:m.modifier,Comment:m.blockComment,ColorLiteral:m.color,\"ParenthesizedContent StringLiteral\":m.string,\":\":m.punctuation,\"PseudoOp #\":m.derefOperator,\"; , |\":m.separator,\"( )\":m.paren,\"[ ]\":m.squareBracket,\"{ }\":m.brace}),Q1={__proto__:null,lang:44,\"nth-child\":44,\"nth-last-child\":44,\"nth-of-type\":44,\"nth-last-of-type\":44,dir:44,\"host-context\":44,if:90,url:158,\"url-prefix\":158,domain:158,regexp:158},v1={__proto__:null,or:104,and:104,not:112,only:112,layer:212},$1={__proto__:null,selector:118,style:124,layer:208},P1={__proto__:null,\"@import\":204,\"@media\":216,\"@charset\":220,\"@namespace\":224,\"@keyframes\":230,\"@supports\":242,\"@scope\":246,\"@font-feature-values\":252},T1={__proto__:null,to:249},Hd=It.deserialize({version:14,states:\"MrQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FqO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#ERO'dQdO'#ETO'oQdO'#E[O'oQdO'#E_OOQP'#Fq'#FqO)RQhO'#FQOOQS'#Fp'#FpOOQS'#FT'#FTQYQdOOO)YQdO'#EeO*iQhO'#EkO)YQdO'#EmO*pQdO'#EoO*{QdO'#ErO)}QhO'#ExO+TQdO'#EzO+`QdO'#E}O+eQaO'#CfO+lQ`O'#EbO+qQ`O'#F}O+|QdO'#F}QOQ`OOP,WO&jO'#CaPOOO)CA`)CA`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=`%{<%lO%jbGoU!r`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!r`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!r`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$rQ!r`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$fUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#SQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z\",tokenizers:[x1,w1,y1,S1,1,2,3,4,new Vt(\"m~RRYZ[z{a~~g~aO$b~~dP!P!Qg~lO$c~~\",28,155)],topRules:{StyleSheet:[0,6],Styles:[1,129]},dynamicPrecedences:{97:1},specialized:[{term:150,get:n=>Q1[n]||-1},{term:151,get:n=>v1[n]||-1},{term:4,get:n=>$1[n]||-1},{term:28,get:n=>P1[n]||-1},{term:149,get:n=>T1[n]||-1}],tokenPrec:2444});var Qa=null;function va(){if(!Qa&&typeof document==\"object\"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let i in n)i!=\"cssText\"&&i!=\"cssFloat\"&&typeof n[i]==\"string\"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>\"-\"+r.toLowerCase())),t.has(i)||(e.push(i),t.add(i)));Qa=e.sort().map(i=>({type:\"property\",label:i,apply:i+\": \"}))}return Qa||[]}var Kd=[\"active\",\"after\",\"any-link\",\"autofill\",\"backdrop\",\"before\",\"checked\",\"cue\",\"default\",\"defined\",\"disabled\",\"empty\",\"enabled\",\"file-selector-button\",\"first\",\"first-child\",\"first-letter\",\"first-line\",\"first-of-type\",\"focus\",\"focus-visible\",\"focus-within\",\"fullscreen\",\"has\",\"host\",\"host-context\",\"hover\",\"in-range\",\"indeterminate\",\"invalid\",\"is\",\"lang\",\"last-child\",\"last-of-type\",\"left\",\"link\",\"marker\",\"modal\",\"not\",\"nth-child\",\"nth-last-child\",\"nth-last-of-type\",\"nth-of-type\",\"only-child\",\"only-of-type\",\"optional\",\"out-of-range\",\"part\",\"placeholder\",\"placeholder-shown\",\"read-only\",\"read-write\",\"required\",\"right\",\"root\",\"scope\",\"selection\",\"slotted\",\"target\",\"target-text\",\"valid\",\"visited\",\"where\"].map(n=>({type:\"class\",label:n})),Jd=[\"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(n=>({type:\"keyword\",label:n})).concat([\"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(n=>({type:\"constant\",label:n}))),C1=[\"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(n=>({type:\"type\",label:n})),A1=[\"@charset\",\"@color-profile\",\"@container\",\"@counter-style\",\"@font-face\",\"@font-feature-values\",\"@font-palette-values\",\"@import\",\"@keyframes\",\"@layer\",\"@media\",\"@namespace\",\"@page\",\"@position-try\",\"@property\",\"@scope\",\"@starting-style\",\"@supports\",\"@view-transition\"].map(n=>({type:\"keyword\",label:n})),St=/^(\\w[\\w-]*|-\\w[\\w-]*|)$/,R1=/^-(-[\\w-]*)?$/;function Z1(n,e){var t;if((n.name==\"(\"||n.type.isError)&&(n=n.parent||n),n.name!=\"ArgList\")return!1;let i=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return i?.name!=\"Callee\"?!1:e.sliceString(i.from,i.to)==\"var\"}var ep=new Zi,X1=[\"Declaration\"];function M1(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function tp(n,e,t){if(e.to-e.from>4096){let i=ep.get(e);if(i)return i;let r=[],s=new Set,o=e.cursor(V.IncludeAnonymous);if(o.firstChild())do for(let l of tp(n,o.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return ep.set(e,r),r}else{let i=[],r=new Set;return e.cursor().iterate(s=>{var o;if(t(s)&&s.matchContext(X1)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==\":\"){let l=n.sliceString(s.from,s.to);r.has(l)||(r.add(l),i.push({label:l,type:\"variable\"}))}}),i}}var E1=n=>e=>{let{state:t,pos:i}=e,r=z(t).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)==\"-\";if(r.name==\"PropertyName\"||(s||r.name==\"TagName\")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:va(),validFor:St};if(r.name==\"ValueName\")return{from:r.from,options:Jd,validFor:St};if(r.name==\"PseudoClassName\")return{from:r.from,options:Kd,validFor:St};if(n(r)||(e.explicit||s)&&Z1(r,t.doc))return{from:n(r)||s?r.from:i,options:tp(t.doc,M1(r),n),validFor:R1};if(r.name==\"TagName\"){for(let{parent:a}=r;a;a=a.parent)if(a.name==\"Block\")return{from:r.from,options:va(),validFor:St};return{from:r.from,options:C1,validFor:St}}if(r.name==\"AtKeyword\")return{from:r.from,options:A1,validFor:St};if(!e.explicit)return null;let o=r.resolve(i),l=o.childBefore(i);return l&&l.name==\":\"&&o.name==\"PseudoClassSelector\"?{from:i,options:Kd,validFor:St}:l&&l.name==\":\"&&o.name==\"Declaration\"||o.name==\"ArgList\"?{from:i,options:Jd,validFor:St}:o.name==\"Block\"||o.name==\"Styles\"?{from:i,options:va(),validFor:St}:null},L1=E1(n=>n.name==\"VariableName\"),Ln=Lt.define({name:\"css\",parser:Hd.configure({props:[mt.add({Declaration:Ei()}),gt.add({\"Block KeyframeList\":jr})]}),languageData:{commentTokens:{block:{open:\"/*\",close:\"*/\"}},indentOnInput:/^\\s*\\}$/,wordChars:\"-\"}});function fs(){return new Ge(Ln,Ln.data.of({autocomplete:L1}))}var z1=316,_1=317,ip=1,j1=2,Y1=3,D1=4,V1=318,I1=320,W1=321,B1=5,q1=6,N1=0,Pa=[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],np=125,G1=59,Ta=47,U1=42,F1=43,H1=45,K1=60,J1=44,eS=63,tS=46,iS=91,nS=new Di({start:!1,shift(n,e){return e==B1||e==q1||e==I1?n:e==W1},strict:!1}),rS=new oe((n,e)=>{let{next:t}=n;(t==np||t==-1||e.context)&&n.acceptToken(V1)},{contextual:!0,fallback:!0}),sS=new oe((n,e)=>{let{next:t}=n,i;Pa.indexOf(t)>-1||t==Ta&&((i=n.peek(1))==Ta||i==U1)||t!=np&&t!=G1&&t!=-1&&!e.context&&n.acceptToken(z1)},{contextual:!0}),oS=new oe((n,e)=>{n.next==iS&&!e.context&&n.acceptToken(_1)},{contextual:!0}),lS=new oe((n,e)=>{let{next:t}=n;if(t==F1||t==H1){if(n.advance(),t==n.next){n.advance();let i=!e.context&&e.canShift(ip);n.acceptToken(i?ip:j1)}}else t==eS&&n.peek(1)==tS&&(n.advance(),n.advance(),(n.next<48||n.next>57)&&n.acceptToken(Y1))},{contextual:!0});function $a(n,e){return n>=65&&n<=90||n>=97&&n<=122||n==95||n>=192||!e&&n>=48&&n<=57}var aS=new oe((n,e)=>{if(n.next!=K1||!e.dialectEnabled(N1)||(n.advance(),n.next==Ta))return;let t=0;for(;Pa.indexOf(n.next)>-1;)n.advance(),t++;if($a(n.next,!0)){for(n.advance(),t++;$a(n.next,!1);)n.advance(),t++;for(;Pa.indexOf(n.next)>-1;)n.advance(),t++;if(n.next==J1)return;for(let i=0;;i++){if(i==7){if(!$a(n.next,!0))return;break}if(n.next!=\"extends\".charCodeAt(i))break;n.advance(),t++}}n.acceptToken(D1,-t)}),hS=Ne({\"get set async static\":m.modifier,\"for while do if else switch try catch finally return throw break continue default case defer\":m.controlKeyword,\"in of await yield void typeof delete instanceof as satisfies\":m.operatorKeyword,\"let var const using function class extends\":m.definitionKeyword,\"import export from\":m.moduleKeyword,\"with debugger new\":m.keyword,TemplateString:m.special(m.string),super:m.atom,BooleanLiteral:m.bool,this:m.self,null:m.null,Star:m.modifier,VariableName:m.variableName,\"CallExpression/VariableName TaggedTemplateExpression/VariableName\":m.function(m.variableName),VariableDefinition:m.definition(m.variableName),Label:m.labelName,PropertyName:m.propertyName,PrivatePropertyName:m.special(m.propertyName),\"CallExpression/MemberExpression/PropertyName\":m.function(m.propertyName),\"FunctionDeclaration/VariableDefinition\":m.function(m.definition(m.variableName)),\"ClassDeclaration/VariableDefinition\":m.definition(m.className),\"NewExpression/VariableName\":m.className,PropertyDefinition:m.definition(m.propertyName),PrivatePropertyDefinition:m.definition(m.special(m.propertyName)),UpdateOp:m.updateOperator,\"LineComment Hashbang\":m.lineComment,BlockComment:m.blockComment,Number:m.number,String:m.string,Escape:m.escape,ArithOp:m.arithmeticOperator,LogicOp:m.logicOperator,BitOp:m.bitwiseOperator,CompareOp:m.compareOperator,RegExp:m.regexp,Equals:m.definitionOperator,Arrow:m.function(m.punctuation),\": Spread\":m.punctuation,\"( )\":m.paren,\"[ ]\":m.squareBracket,\"{ }\":m.brace,\"InterpolationStart InterpolationEnd\":m.special(m.brace),\".\":m.derefOperator,\", ;\":m.separator,\"@\":m.meta,TypeName:m.typeName,TypeDefinition:m.definition(m.typeName),\"type enum interface implements namespace module declare\":m.definitionKeyword,\"abstract global Privacy readonly override\":m.modifier,\"is keyof unique infer asserts\":m.operatorKeyword,JSXAttributeValue:m.attributeValue,JSXText:m.content,\"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag\":m.angleBracket,\"JSXIdentifier JSXNameSpacedName\":m.tagName,\"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName\":m.attributeName,\"JSXBuiltin/JSXIdentifier\":m.standard(m.tagName)}),cS={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},fS={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},uS={__proto__:null,\"<\":193},rp=It.deserialize({version:14,states:\"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!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plateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem\",maxTerm:380,context:nS,nodeProps:[[\"isolate\",-8,5,6,14,37,39,51,53,55,\"\"],[\"group\",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,\"Statement\",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,\"Expression\",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,\"Type\",-3,88,103,109,\"ClassItem\"],[\"openedBy\",23,\"<\",38,\"InterpolationStart\",56,\"[\",60,\"{\",73,\"(\",160,\"JSXStartCloseTag\"],[\"closedBy\",-2,24,168,\">\",40,\"InterpolationEnd\",50,\"]\",61,\"}\",74,\")\",165,\"JSXEndTag\"]],propSources:[hS],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:\"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%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O(R~~\",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:n=>cS[n]||-1},{term:343,get:n=>fS[n]||-1},{term:95,get:n=>uS[n]||-1}],tokenPrec:15201});var ap=[ye(\"function ${name}(${params}) {\\n\t${}\\n}\",{label:\"function\",detail:\"definition\",type:\"keyword\"}),ye(\"for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\\n\t${}\\n}\",{label:\"for\",detail:\"loop\",type:\"keyword\"}),ye(\"for (let ${name} of ${collection}) {\\n\t${}\\n}\",{label:\"for\",detail:\"of loop\",type:\"keyword\"}),ye(\"do {\\n\t${}\\n} while (${})\",{label:\"do\",detail:\"loop\",type:\"keyword\"}),ye(\"while (${}) {\\n\t${}\\n}\",{label:\"while\",detail:\"loop\",type:\"keyword\"}),ye(`try {\n\t\\${}\n} catch (\\${error}) {\n\t\\${}\n}`,{label:\"try\",detail:\"/ catch block\",type:\"keyword\"}),ye(\"if (${}) {\\n\t${}\\n}\",{label:\"if\",detail:\"block\",type:\"keyword\"}),ye(`if (\\${}) {\n\t\\${}\n} else {\n\t\\${}\n}`,{label:\"if\",detail:\"/ else block\",type:\"keyword\"}),ye(`class \\${name} {\n\tconstructor(\\${params}) {\n\t\t\\${}\n\t}\n}`,{label:\"class\",detail:\"definition\",type:\"keyword\"}),ye('import {${names}} from \"${module}\"\\n${}',{label:\"import\",detail:\"named\",type:\"keyword\"}),ye('import ${name} from \"${module}\"\\n${}',{label:\"import\",detail:\"default\",type:\"keyword\"})],dS=ap.concat([ye(\"interface ${name} {\\n\t${}\\n}\",{label:\"interface\",detail:\"definition\",type:\"keyword\"}),ye(\"type ${name} = ${type}\",{label:\"type\",detail:\"definition\",type:\"keyword\"}),ye(\"enum ${name} {\\n\t${}\\n}\",{label:\"enum\",detail:\"definition\",type:\"keyword\"})]),sp=new Zi,hp=new Set([\"Script\",\"Block\",\"FunctionExpression\",\"FunctionDeclaration\",\"ArrowFunction\",\"MethodDeclaration\",\"ForStatement\"]);function zn(n){return(e,t)=>{let i=e.node.getChild(\"VariableDefinition\");return i&&t(i,n),!0}}var pS=[\"FunctionDeclaration\"],OS={FunctionDeclaration:zn(\"function\"),ClassDeclaration:zn(\"class\"),ClassExpression:()=>!0,EnumDeclaration:zn(\"constant\"),TypeAliasDeclaration:zn(\"type\"),NamespaceDeclaration:zn(\"namespace\"),VariableDefinition(n,e){n.matchContext(pS)||e(n,\"variable\")},TypeDefinition(n,e){e(n,\"type\")},__proto__:null};function cp(n,e){let t=sp.get(e);if(t)return t;let i=[],r=!0;function s(o,l){let a=n.sliceString(o.from,o.to);i.push({label:a,type:l})}return e.cursor(V.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=OS[o.name];if(l&&l(o,s)||hp.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of cp(n,o.node))i.push(l);return!1}}),sp.set(e,i),i}var op=/^[\\w$\\xa1-\\uffff][\\w$\\d\\xa1-\\uffff]*$/,fp=[\"TemplateString\",\"String\",\"RegExp\",\"LineComment\",\"BlockComment\",\"VariableDefinition\",\"TypeDefinition\",\"Label\",\"PropertyDefinition\",\"PropertyName\",\"PrivatePropertyDefinition\",\"PrivatePropertyName\",\"JSXText\",\"JSXAttributeValue\",\"JSXOpenTag\",\"JSXCloseTag\",\"JSXSelfClosingTag\",\".\",\"?.\"];function mS(n){let e=z(n.state).resolveInner(n.pos,-1);if(fp.indexOf(e.name)>-1)return null;let t=e.name==\"VariableName\"||e.to-e.from<20&&op.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let i=[];for(let r=e;r;r=r.parent)hp.has(r.name)&&(i=i.concat(cp(n.state.doc,r)));return{options:i,from:t?e.from:n.pos,validFor:op}}var Ke=Lt.define({name:\"javascript\",parser:rp.configure({props:[mt.add({IfStatement:Ei({except:/^\\s*({|else\\b)/}),TryStatement:Ei({except:/^\\s*({|catch\\b|finally\\b)/}),LabeledStatement:Sf,SwitchBody:n=>{let e=n.textAfter,t=/^\\s*\\}/.test(e),i=/^\\s*(case|default)\\b/.test(e);return n.baseIndent+(t?0:i?1:2)*n.unit},Block:bf({closing:\"}\"}),ArrowFunction:n=>n.baseIndent+n.unit,\"TemplateString BlockComment\":()=>null,\"Statement Property\":Ei({except:/^\\s*{/}),JSXElement(n){let e=/^\\s*<\\//.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},JSXEscape(n){let e=/\\s*\\}/.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},\"JSXOpenTag JSXSelfClosingTag\"(n){return n.column(n.node.from)+n.unit}}),gt.add({\"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType\":jr,BlockComment(n){return{from:n.from+2,to:n.to-2}},JSXElement(n){let e=n.firstChild;if(!e||e.name==\"JSXSelfClosingTag\")return null;let t=n.lastChild;return{from:e.to,to:t.type.isError?n.to:t.from}},\"JSXSelfClosingTag JSXOpenTag\"(n){var e;let t=(e=n.firstChild)===null||e===void 0?void 0:e.nextSibling,i=n.lastChild;return!t||t.type.isError?null:{from:t.to,to:i.type.isError?n.to:i.from}}})]}),languageData:{closeBrackets:{brackets:[\"(\",\"[\",\"{\",\"'\",'\"',\"`\"]},commentTokens:{line:\"//\",block:{open:\"/*\",close:\"*/\"}},indentOnInput:/^\\s*(?:case |default:|\\{|\\}|<\\/)$/,wordChars:\"$\"}}),up={test:n=>/^JSX/.test(n.name),facet:gn({commentTokens:{block:{open:\"{/*\",close:\"*/}\"}}})},Ca=Ke.configure({dialect:\"ts\"},\"typescript\"),Aa=Ke.configure({dialect:\"jsx\",props:[_r.add(n=>n.isTop?[up]:void 0)]}),Ra=Ke.configure({dialect:\"jsx ts\",props:[_r.add(n=>n.isTop?[up]:void 0)]},\"typescript\"),dp=n=>({label:n,type:\"keyword\"}),pp=\"break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield\".split(\" \").map(dp),gS=pp.concat([\"declare\",\"implements\",\"private\",\"protected\",\"public\"].map(dp));function us(n={}){let e=n.jsx?n.typescript?Ra:Aa:n.typescript?Ca:Ke,t=n.typescript?dS.concat(gS):ap.concat(pp);return new Ge(e,[Ke.data.of({autocomplete:gu(fp,El(t))}),Ke.data.of({autocomplete:mS}),n.jsx?SS:[]])}function bS(n){for(;;){if(n.name==\"JSXOpenTag\"||n.name==\"JSXSelfClosingTag\"||n.name==\"JSXFragmentTag\")return n;if(n.name==\"JSXEscape\"||!n.parent)return null;n=n.parent}}function lp(n,e,t=n.length){for(let i=e?.firstChild;i;i=i.nextSibling)if(i.name==\"JSXIdentifier\"||i.name==\"JSXBuiltin\"||i.name==\"JSXNamespacedName\"||i.name==\"JSXMemberExpression\")return n.sliceString(i.from,Math.min(i.to,t));return\"\"}var yS=typeof navigator==\"object\"&&/Android\\b/.test(navigator.userAgent),SS=v.inputHandler.of((n,e,t,i,r)=>{if((yS?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||i!=\">\"&&i!=\"/\"||!Ke.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var h;let{head:c}=a,f=z(o).resolveInner(c-1,-1),u;if(f.name==\"JSXStartTag\"&&(f=f.parent),!(o.doc.sliceString(c-1,c)!=i||f.name==\"JSXAttributeValue\"&&f.to>c)){if(i==\">\"&&f.name==\"JSXFragmentTag\")return{range:a,changes:{from:c,insert:\"\"}};if(i==\"/\"&&f.name==\"JSXStartCloseTag\"){let d=f.parent,p=d.parent;if(p&&d.from==c-2&&((u=lp(o.doc,p.firstChild,c))||((h=p.firstChild)===null||h===void 0?void 0:h.name)==\"JSXFragmentTag\")){let O=`${u}>`;return{range:x.cursor(c+O.length,-1),changes:{from:c,insert:O}}}}else if(i==\">\"){let d=bS(f);if(d&&d.name==\"JSXOpenTag\"&&!/^\\/?>|^<\\//.test(o.doc.sliceString(c,c+2))&&(u=lp(o.doc,d,c)))return{range:a,changes:{from:c,insert:``}}}}return{range:a}});return l.changes.empty?!1:(n.dispatch([s,o.update(l,{userEvent:\"input.complete\",scrollIntoView:!0})]),!0)});var _n=[\"_blank\",\"_self\",\"_top\",\"_parent\"],Za=[\"ascii\",\"utf-8\",\"utf-16\",\"latin1\",\"latin1\"],Xa=[\"get\",\"post\",\"put\",\"delete\"],Ma=[\"application/x-www-form-urlencoded\",\"multipart/form-data\",\"text/plain\"],Re=[\"true\",\"false\"],X={},xS={a:{attrs:{href:null,ping:null,type:null,media:null,target:_n,hreflang:null}},abbr:X,address:X,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[\"default\",\"rect\",\"circle\",\"poly\"]}},article:X,aside:X,audio:{attrs:{src:null,mediagroup:null,crossorigin:[\"anonymous\",\"use-credentials\"],preload:[\"none\",\"metadata\",\"auto\"],autoplay:[\"autoplay\"],loop:[\"loop\"],controls:[\"controls\"]}},b:X,base:{attrs:{href:null,target:_n}},bdi:X,bdo:X,blockquote:{attrs:{cite:null}},body:X,br:X,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[\"autofocus\"],disabled:[\"autofocus\"],formenctype:Ma,formmethod:Xa,formnovalidate:[\"novalidate\"],formtarget:_n,type:[\"submit\",\"reset\",\"button\"]}},canvas:{attrs:{width:null,height:null}},caption:X,center:X,cite:X,code:X,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:X,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[\"open\"]}},dfn:X,div:X,dl:X,dt:X,em:X,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[\"disabled\"],form:null,name:null}},figcaption:X,figure:X,footer:X,form:{attrs:{action:null,name:null,\"accept-charset\":Za,autocomplete:[\"on\",\"off\"],enctype:Ma,method:Xa,novalidate:[\"novalidate\"],target:_n}},h1:X,h2:X,h3:X,h4:X,h5:X,h6:X,head:{children:[\"title\",\"base\",\"link\",\"style\",\"meta\",\"script\",\"noscript\",\"command\"]},header:X,hgroup:X,hr:X,html:{attrs:{manifest:null}},i:X,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:Ma,formmethod:Xa,formnovalidate:[\"novalidate\"],formtarget:_n,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:X,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[\"autofocus\"],disabled:[\"disabled\"],keytype:[\"RSA\"]}},label:{attrs:{for:null,form:null}},legend:X,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:X,menu:{attrs:{label:null,type:[\"list\",\"context\",\"toolbar\"]}},meta:{attrs:{content:null,charset:Za,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:X,noscript:X,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:X,param:{attrs:{name:null,value:null}},pre:X,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:X,rt:X,ruby:X,samp:X,script:{attrs:{type:[\"text/javascript\"],src:null,async:[\"async\"],defer:[\"defer\"],charset:Za}},section:X,select:{attrs:{form:null,name:null,size:null,autofocus:[\"autofocus\"],disabled:[\"disabled\"],multiple:[\"multiple\"]}},slot:{attrs:{name:null}},small:X,source:{attrs:{src:null,type:null,media:null}},span:X,strong:X,style:{attrs:{type:[\"text/css\"],media:null,scoped:null}},sub:X,summary:X,sup:X,table:X,tbody:X,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:X,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:X,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[\"row\",\"col\",\"rowgroup\",\"colgroup\"]}},thead:X,time:{attrs:{datetime:null}},title:X,tr:X,track:{attrs:{src:null,label:null,default:null,kind:[\"subtitles\",\"captions\",\"descriptions\",\"chapters\",\"metadata\"],srclang:null}},ul:{children:[\"li\",\"script\",\"template\",\"ul\",\"ol\"]},var:X,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:X},bp={accesskey:null,class:null,contenteditable:Re,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:Re,autocorrect:Re,autocapitalize:Re,style:null,tabindex:null,title:null,translate:[\"yes\",\"no\"],rel:[\"stylesheet\",\"alternate\",\"author\",\"bookmark\",\"help\",\"license\",\"next\",\"nofollow\",\"noreferrer\",\"prefetch\",\"prev\",\"search\",\"tag\"],role:\"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\":Re,\"aria-autocomplete\":[\"inline\",\"list\",\"both\",\"none\"],\"aria-busy\":Re,\"aria-checked\":[\"true\",\"false\",\"mixed\",\"undefined\"],\"aria-controls\":null,\"aria-describedby\":null,\"aria-disabled\":Re,\"aria-dropeffect\":null,\"aria-expanded\":[\"true\",\"false\",\"undefined\"],\"aria-flowto\":null,\"aria-grabbed\":[\"true\",\"false\",\"undefined\"],\"aria-haspopup\":Re,\"aria-hidden\":Re,\"aria-invalid\":[\"true\",\"false\",\"grammar\",\"spelling\"],\"aria-label\":null,\"aria-labelledby\":null,\"aria-level\":null,\"aria-live\":[\"off\",\"polite\",\"assertive\"],\"aria-multiline\":Re,\"aria-multiselectable\":Re,\"aria-owns\":null,\"aria-posinset\":null,\"aria-pressed\":[\"true\",\"false\",\"mixed\",\"undefined\"],\"aria-readonly\":Re,\"aria-relevant\":null,\"aria-required\":Re,\"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},yp=\"beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload\".split(\" \").map(n=>\"on\"+n);for(let n of yp)bp[n]=null;var ui=class{constructor(e,t){this.tags={...xS,...e},this.globalAttrs={...bp,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};ui.default=new ui;function di(n,e,t=n.length){if(!e)return\"\";let i=e.firstChild,r=i&&i.getChild(\"TagName\");return r?n.sliceString(r.from,Math.min(r.to,t)):\"\"}function Vi(n,e=!1){for(;n;n=n.parent)if(n.name==\"Element\")if(e)e=!1;else return n;return null}function Sp(n,e,t){let i=t.tags[di(n,Vi(e))];return i?.children||t.allTags}function Ea(n,e){let t=[];for(let i=Vi(e);i&&!i.type.isTop;i=Vi(i.parent)){let r=di(n,i);if(r&&i.lastChild.name==\"CloseTag\")break;r&&t.indexOf(r)<0&&(e.name==\"EndTag\"||e.from>=i.firstChild.to)&&t.push(r)}return t}var xp=/^[:\\-\\.\\w\\u00b7-\\uffff]*$/;function Op(n,e,t,i,r){let s=/\\s*>/.test(n.sliceDoc(r,r+5))?\"\":\">\",o=Vi(t,t.name==\"StartTag\"||t.name==\"TagName\");return{from:i,to:r,options:Sp(n.doc,o,e).map(l=>({label:l,type:\"type\"})).concat(Ea(n.doc,t).map((l,a)=>({label:\"/\"+l,apply:\"/\"+l+s,type:\"type\",boost:99-a}))),validFor:/^\\/?[:\\-\\.\\w\\u00b7-\\uffff]*$/}}function mp(n,e,t,i){let r=/\\s*>/.test(n.sliceDoc(i,i+5))?\"\":\">\";return{from:t,to:i,options:Ea(n.doc,e).map((s,o)=>({label:s,apply:s+r,type:\"type\",boost:99-o})),validFor:xp}}function wS(n,e,t,i){let r=[],s=0;for(let o of Sp(n.doc,t,e))r.push({label:\"<\"+o,type:\"type\"});for(let o of Ea(n.doc,t))r.push({label:\"\",type:\"type\",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\\/?[:\\-\\.\\w\\u00b7-\\uffff]*$/}}function kS(n,e,t,i,r){let s=Vi(t),o=s?e.tags[di(n.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],a=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:i,to:r,options:a.map(h=>({label:h,type:\"property\"})),validFor:xp}}function QS(n,e,t,i,r){var s;let o=(s=t.parent)===null||s===void 0?void 0:s.getChild(\"AttributeName\"),l=[],a;if(o){let h=n.sliceDoc(o.from,o.to),c=e.globalAttrs[h];if(!c){let f=Vi(t),u=f?e.tags[di(n.doc,f)]:null;c=u?.attrs&&u.attrs[h]}if(c){let f=n.sliceDoc(i,r).toLowerCase(),u='\"',d='\"';/^['\"]/.test(f)?(a=f[0]=='\"'?/^[^\"]*$/:/^[^']*$/,u=\"\",d=n.sliceDoc(r,r+1)==f[0]?\"\":f[0],f=f.slice(1),i++):a=/^[^\\s<>='\"]*$/;for(let p of c)l.push({label:p,apply:u+p+d,type:\"constant\"})}}return{from:i,to:r,options:l,validFor:a}}function wp(n,e){let{state:t,pos:i}=e,r=z(t).resolveInner(i,-1),s=r.resolve(i);for(let o=i,l;s==r&&(l=r.childBefore(o));){let a=l.lastChild;if(!a||!a.type.isError||a.fromwp(i,r)}var $S=Ke.parser.configure({top:\"SingleExpression\"}),Qp=[{tag:\"script\",attrs:n=>n.type==\"text/typescript\"||n.lang==\"ts\",parser:Ca.parser},{tag:\"script\",attrs:n=>n.type==\"text/babel\"||n.type==\"text/jsx\",parser:Aa.parser},{tag:\"script\",attrs:n=>n.type==\"text/typescript-jsx\",parser:Ra.parser},{tag:\"script\",attrs(n){return/^(importmap|speculationrules|application\\/(.+\\+)?json)$/i.test(n.type)},parser:$S},{tag:\"script\",attrs(n){return!n.type||/^(?:text|application)\\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:Ke.parser},{tag:\"style\",attrs(n){return(!n.lang||n.lang==\"css\")&&(!n.type||/^(text\\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:Ln.parser}],vp=[{name:\"style\",parser:Ln.parser.configure({top:\"Styles\"})}].concat(yp.map(n=>({name:n,parser:Ke.parser}))),$p=Lt.define({name:\"html\",parser:Id.configure({props:[mt.add({Element(n){let e=/^(\\s*)(<\\/)?/.exec(n.textAfter);return n.node.to<=n.pos+e[0].length?n.continue():n.lineIndent(n.node.from)+(e[2]?0:n.unit)},\"OpenTag CloseTag SelfClosingTag\"(n){return n.column(n.node.from)+n.unit},Document(n){if(n.pos+/\\s*/.exec(n.textAfter)[0].lengthn.getChild(\"TagName\")})]}),languageData:{commentTokens:{block:{open:\"\"}},indentOnInput:/^\\s*<\\/\\w+\\W$/,wordChars:\"-_\"}}),ds=$p.configure({wrap:wa(Qp,vp)});function ps(n={}){let e=\"\",t;n.matchClosingTags===!1&&(e=\"noMatch\"),n.selfClosingTags===!0&&(e=(e?e+\" \":\"\")+\"selfClosing\"),(n.nestedLanguages&&n.nestedLanguages.length||n.nestedAttributes&&n.nestedAttributes.length)&&(t=wa((n.nestedLanguages||[]).concat(Qp),(n.nestedAttributes||[]).concat(vp)));let i=t?$p.configure({wrap:t,dialect:e}):e?ds.configure({dialect:e}):ds;return new Ge(i,[ds.data.of({autocomplete:vS(n)}),n.autoCloseTags!==!1?TS:[],us().support,fs().support])}var gp=new Set(\"area base br col command embed frame hr img input keygen link meta param source track wbr menuitem\".split(\" \"));function PS(n,e,t){for(var i;;){if(((i=e.lastChild)===null||i===void 0?void 0:i.name)!=\"CloseTag\")return!1;let r=e.parent;if(!r||di(n,r)!=t)return!0;e=r}}var TS=v.inputHandler.of((n,e,t,i,r)=>{if(n.composing||n.state.readOnly||e!=t||i!=\">\"&&i!=\"/\"||!ds.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var h;let c=o.doc.sliceString(a.from-1,a.to)==i,{head:f}=a,u=z(o).resolveInner(f,-1),d;if(c&&i==\">\"&&u.name==\"EndTag\"){let p=u.parent;if((d=di(o.doc,p.parent,f))&&!gp.has(d)&&!PS(o.doc,p.parent,d)){let O=f+(o.doc.sliceString(f,f+1)===\">\"?1:0),g=``;return{range:a,changes:{from:f,to:O,insert:g}}}}else if(c&&i==\"/\"&&u.name==\"IncompleteCloseTag\"){let p=u.parent;if(u.from==f-2&&((h=p.lastChild)===null||h===void 0?void 0:h.name)!=\"CloseTag\"&&(d=di(o.doc,p,f))&&!gp.has(d)){let O=f+(o.doc.sliceString(f,f+1)===\">\"?1:0),g=`${d}>`;return{range:x.cursor(f+g.length,-1),changes:{from:f,to:O,insert:g}}}}return{range:a}});return l.changes.empty?!1:(n.dispatch([s,o.update(l,{userEvent:\"input.complete\",scrollIntoView:!0})]),!0)});var Cp=gn({commentTokens:{block:{open:\"\"}}}),Ap=new E,Rp=pd.configure({props:[gt.add(n=>!n.is(\"Block\")||n.is(\"Document\")||_a(n)!=null||CS(n)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Ap.add(_a),mt.add({Document:()=>null}),Et.add({Document:Cp})]});function _a(n){let e=/^(?:ATX|Setext)Heading(\\d)$/.exec(n.name);return e?+e[1]:void 0}function CS(n){return n.name==\"OrderedList\"||n.name==\"BulletList\"}function AS(n,e){let t=n;for(;;){let i=t.nextSibling,r;if(!i||(r=_a(i.type))!=null&&r<=e)break;t=i}return t.to}var RS=xf.of((n,e,t)=>{for(let i=z(n).resolveInner(t,-1);i&&!(i.fromt)return{from:t,to:s}}return null});function ja(n){return new be(Cp,n,[],\"markdown\")}var ZS=ja(Rp),XS=Rp.configure([ls,yd,bd,Sd,{props:[gt.add({Table:(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}]),Os=ja(XS);function MS(n,e){return t=>{if(t&&n){let i=null;if(t=/\\S*/.exec(t)[0],typeof n==\"function\"?i=n(t):i=Ot.matchLanguageName(n,t,!0),i instanceof Ot)return i.support?i.support.language.parser:On.getSkippingParser(i.load());if(i)return i.parser}return e?e.parser:null}}var jn=class{constructor(e,t,i,r,s,o,l){this.node=e,this.from=t,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=l}blank(e,t=!0){let i=this.spaceBefore+(this.node.name==\"Blockquote\"?\">\":\"\");if(e!=null){for(;i.length0;r--)i+=\" \";return i+(t?this.spaceAfter:\"\")}}marker(e,t){let i=this.node.name==\"OrderedList\"?String(+Xp(this.item,e)[2]+t):\"\";return this.spaceBefore+i+this.type+this.spaceAfter}};function Zp(n,e){let t=[],i=[];for(let r=n;r;r=r.parent){if(r.name==\"FencedCode\")return i;(r.name==\"ListItem\"||r.name==\"Blockquote\")&&t.push(r)}for(let r=t.length-1;r>=0;r--){let s=t[r],o,l=e.lineAt(s.from),a=s.from-l.from;if(s.name==\"Blockquote\"&&(o=/^ *>( ?)/.exec(l.text.slice(a))))i.push(new jn(s,a,a+o[0].length,\"\",o[1],\">\",null));else if(s.name==\"ListItem\"&&s.parent.name==\"OrderedList\"&&(o=/^( *)\\d+([.)])( *)/.exec(l.text.slice(a)))){let h=o[3],c=o[0].length;h.length>=4&&(h=h.slice(0,h.length-4),c-=4),i.push(new jn(s.parent,a,a+c,o[1],h,o[2],s))}else if(s.name==\"ListItem\"&&s.parent.name==\"BulletList\"&&(o=/^( *)([-+*])( {1,4}\\[[ xX]\\])?( +)/.exec(l.text.slice(a)))){let h=o[4],c=o[0].length;h.length>4&&(h=h.slice(0,h.length-4),c-=4);let f=o[2];o[3]&&(f+=o[3].replace(/[xX]/,\" \")),i.push(new jn(s.parent,a,a+c,o[1],h,f,s))}}return i}function Xp(n,e){return/^(\\s*)(\\d+)(?=[.)])/.exec(e.sliceString(n.from,n.from+10))}function La(n,e,t,i=0){for(let r=-1,s=n;;){if(s.name==\"ListItem\"){let l=Xp(s,e),a=+l[2];if(r>=0){if(a!=r+1)return;t.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+i)})}r=a}let o=s.nextSibling;if(!o)break;s=o}}function Ya(n,e){let t=/^[ \\t]*/.exec(n)[0].length;if(!t||e.facet(zt)!=\"\t\")return n;let i=Pe(n,4,t),r=\"\";for(let s=i;s>0;)s>=4?(r+=\"\t\",s-=4):(r+=\" \",s--);return r+n.slice(t)}var ES=(n={})=>({state:e,dispatch:t})=>{let i=z(e),{doc:r}=e,s=null,o=e.changeByRange(l=>{if(!l.empty||!Os.isActiveAt(e,l.from,-1)&&!Os.isActiveAt(e,l.from,1))return s={range:l};let a=l.from,h=r.lineAt(a),c=Zp(i.resolveInner(a,-1),r);for(;c.length&&c[c.length-1].from>a-h.from;)c.pop();if(!c.length)return s={range:l};let f=c[c.length-1];if(f.to-f.spaceAfter.length>a-h.from)return s={range:l};let u=a>=f.to-f.spaceAfter.length&&!/\\S/.test(h.text.slice(f.to));if(f.item&&u){if(f.item.from]*$/.test(h.text.slice(0,f.to)))return s={range:l};let b=f.node.firstChild,y=f.node.getChild(\"ListItem\",\"ListItem\");if(b.to>=a||y&&y.to0&&!/[^\\s>]/.test(r.lineAt(h.from-1).text)||n.nonTightLists===!1){let S=c.length>1?c[c.length-2]:null,C,k=\"\";S&&S.item?(C=h.from+S.from,k=S.marker(r,1)):C=h.from+(S?S.to:0);let P=[{from:C,to:a,insert:k}];return f.node.name==\"OrderedList\"&&La(f.item,r,P,-2),S&&S.node.name==\"OrderedList\"&&La(S.item,r,P),{range:x.cursor(C+k.length),changes:P}}else{let S=Tp(c,e,h);return{range:x.cursor(a+S.length+1),changes:{from:h.from,insert:S+e.lineBreak}}}}if(f.node.name==\"Blockquote\"&&u&&h.from){let b=r.lineAt(h.from-1),y=/>\\s*$/.exec(b.text);if(y&&y.index==f.from){let S=e.changes([{from:b.from+y.index,to:b.to},{from:h.from+f.from,to:h.to}]);return{range:l.map(S),changes:S}}}let d=[];f.node.name==\"OrderedList\"&&La(f.item,r,d);let p=f.item&&f.item.from]*/.exec(h.text)[0].length>=f.to)for(let b=0,y=c.length-1;b<=y;b++)O+=b==y&&!p?c[b].marker(r,1):c[b].blank(bh.from&&/\\s/.test(h.text.charAt(g-h.from-1));)g--;return O=Ya(O,e),zS(f.node,e.doc)&&(O=Tp(c,e,h)+e.lineBreak+O),d.push({from:g,to:a,insert:e.lineBreak+O}),{range:x.cursor(g+O.length+1),changes:d}});return s?!1:(t(e.update(o,{scrollIntoView:!0,userEvent:\"input\"})),!0)},LS=ES();function Pp(n){return n.name==\"QuoteMark\"||n.name==\"ListMark\"}function zS(n,e){if(n.name!=\"OrderedList\"&&n.name!=\"BulletList\")return!1;let t=n.firstChild,i=n.getChild(\"ListItem\",\"ListItem\");if(!i)return!1;let r=e.lineAt(t.to),s=e.lineAt(i.from),o=/^[\\s>]*$/.test(r.text);return r.number+(o?0:1){let t=z(n),i=null,r=n.changeByRange(s=>{let o=s.from,{doc:l}=n;if(s.empty&&Os.isActiveAt(n,s.from)){let a=l.lineAt(o),h=Zp(_S(t,o),l);if(h.length){let c=h[h.length-1],f=c.to-c.spaceAfter.length+(c.spaceAfter?1:0);if(o-a.from>f&&!/\\S/.test(a.text.slice(f,o-a.from)))return{range:x.cursor(a.from+f),changes:{from:a.from+f,to:o}};if(o-a.from==f&&(c.item&&a.from<=c.item.from||/^[\\s>]*$/.test(a.text.slice(0,c.to)))){let u=a.from+c.from;if(c.item&&c.node.from{var t;let{main:i}=e.state.selection;if(i.empty)return!1;let r=(t=n.clipboardData)===null||t===void 0?void 0:t.getData(\"text/plain\");if(!r||!/^(https?:\\/\\/|mailto:|xmpp:|www\\.)/.test(r)||(/^www\\./.test(r)&&(r=\"https://\"+r),!Os.isActiveAt(e.state,i.from,1)))return!1;let s=z(e.state),o=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||IS.test(l.name))&&(o=!0)},leave:l=>{l.tot.to>=n.from&&t.from<=n.to)}function FS(n){let e=n.parent;for(;e!==null;){if(US(e.name))return{from:e.from,to:e.to};e=e.parent}let t=n.parent;return t===null?{from:n.from,to:n.to}:{from:t.from,to:t.to}}function HS(n,e,t,i){let r=[],s=i===void 0?null:qp(i.sliceString(0,t));return n.iterate({from:0,to:t,enter(o){if(s!==null&&o.from=i.to||a.to>=n.doc.length);)a=n.doc.lineAt(a.to+1)}}),[...t.entries()].map(([i,r])=>({from:i,columns:r})).sort((i,r)=>i.from-r.from)}function Na(n,e,t){return n.sliceString(e,t).toLowerCase()!==\"[ ]\"}function tx(n,e=0){let t=[];return z(n).iterate({from:0,to:n.doc.length,enter(i){if(i.from=i.to||t.push({from:s,to:i.to})}}),t}function ix(n,e=0){let t=[];return z(n).iterate({from:0,to:n.doc.length,enter(i){if(!(i.from=i.to||r.to>=n.doc.length);)r=n.doc.lineAt(r.to+1)}}),t}var rx=new Map([[\"&\",\"&\"],[\"<\",\"<\"],[\">\",\">\"],[\""\",'\"'],[\"'\",\"'\"],[\" \",\"\\xA0\"]]);function sx(n){let e=rx.get(n.toLowerCase());if(e!==void 0)return e;let t=/^&#(x[0-9a-f]+|\\d+);$/i.exec(n);if(t===null)return null;let i=t[1],r=i[0].toLowerCase()===\"x\"?Number.parseInt(i.slice(1),16):Number.parseInt(i,10);return!Number.isInteger(r)||r<=0||r>1114111||r>=55296&&r<=57343?null:String.fromCodePoint(r)}var ox=/^$/i;function Da(n,e){return n===null?e:e===null?n:`${n} ${e}`}var Va=/!?\\[\\[([^[\\]]+)\\]\\]/g;function Lp(n,e){let t=e.from,i=n.doc.sliceString(e.from,e.to),r=new Array(i.length).fill(null),s=new Array(i.length).fill(!1),o=new Map,l=[],a=(u,d,p)=>{for(let O=u;Oe.to||u.to<=u.from)return;if(Dp.has(u.name)||Vp(u.node)){for(let g=u.from;gy.fromd))continue;let O=u[1],g=O.lastIndexOf(\"|\"),b=g===-1?O:O.slice(g+1);o.set(d,{to:p,text:Pn(b).trim(),className:Da(r[u.index],\"cm-lp-link\")})}let h=[],c=(u,d)=>{u!==\"\"&&h.push({text:u,className:d})};for(let u=0;u{let i=t.trim(),r=i.startsWith(\":\"),s=i.endsWith(\":\");return r&&s?\"center\":s?\"right\":r?\"left\":null})}function zp(n){let e=[],t=[];for(let s=n.firstChild;s!==null;s=s.nextSibling)s.name===\"TableDelimiter\"?e.push({from:s.from,to:s.to}):s.name===\"TableCell\"&&t.push(s.node);let i=[],r=n.from;for(let s of e)i.push({from:r,to:s.from}),r=s.to;return i.push({from:r,to:n.to}),i.length>0&&i[0].to<=i[0].from&&i.shift(),i.length>0&&i[i.length-1].to<=i[i.length-1].from&&i.pop(),i.map(s=>t.find(o=>o.from>=s.from&&o.to<=s.to)??null)}function ax(n,e){let t=[],i=null,r=[];for(let l=e.firstChild;l!==null;l=l.nextSibling){if(l.name===\"TableHeader\"){i=zp(l).map(a=>a===null?[]:Lp(n,a));continue}if(l.name===\"TableRow\"){r.push(zp(l).map(a=>a===null?[]:Lp(n,a)));continue}l.name===\"TableDelimiter\"&&t.length===0&&(t=lx(n.doc.sliceString(l.from,l.to)))}if(i===null||i.length===0)return null;let s=i.length,o=r.map(l=>{let a=l.slice(0,s);for(;a.length{s.append(this.drawCell(\"th\",l,a))}),r.append(s),i.append(r);let o=document.createElement(\"tbody\");for(let l of this.grid.rows){let a=document.createElement(\"tr\");l.forEach((h,c)=>{a.append(this.drawCell(\"td\",h,c))}),o.append(a)}return i.append(o),t.append(i),t}drawCell(t,i,r){let s=document.createElement(t),o=this.grid.align[r]??null;if(o!==null&&s.classList.add(`cm-lp-grid-${o}`),i.every(a=>a.text.trim()===\"\"))return s.classList.add(\"cm-lp-grid-empty\"),s;for(let a of i)a.text.split(`\n`).forEach((c,f)=>{if(f>0&&s.append(document.createElement(\"br\")),c===\"\")return;if(a.className===null){s.append(document.createTextNode(c));return}let u=document.createElement(\"span\");u.className=a.className,u.textContent=c,s.append(u)});return s}},Wa=class extends he{eq(){return!0}toDOM(){let e=document.createElement(\"span\");return e.className=\"cm-lp-bullet\",e.textContent=\"\\u2022\",e}ignoreEvent(){return!1}},Ba=class extends he{constructor(t){super();this.checked=t}eq(t){return t.checked===this.checked}toDOM(){let t=document.createElement(\"span\");t.className=this.checked?\"cm-lp-task cm-lp-task-on\":\"cm-lp-task\",t.setAttribute(\"role\",\"checkbox\"),t.setAttribute(\"aria-checked\",this.checked?\"true\":\"false\");let i=document.createElement(\"span\");return i.className=\"cm-lp-task-box\",t.append(i),t}ignoreEvent(){return!1}},cx=\"html-preview\";function fx(n,e){let t=e.getChild(\"CodeInfo\");if(t===null)return null;let i=n.sliceString(t.from,t.to).trim().split(/\\s+/)[0];return i===void 0||i===\"\"?null:i.toLowerCase()}function ux(n,e){let t=e.getChildren(\"CodeMark\"),i=t[0];if(i===void 0)return\"\";let r=n.lineAt(i.from).to+1;if(r>n.length)return\"\";let s=t.length>1?t[t.length-1]:null,o=s===null?e.to:n.lineAt(s.from).from-1;return r>=o?\"\":n.sliceString(r,o)}function dx(n,e=0){let t=[],i=Np(n);return z(n).iterate({from:0,to:n.doc.length,enter(r){if(r.from\n\n\n\n${n}\n`}var qa=class extends he{constructor(t){super();this.html=t}eq(t){return t.html===this.html}toDOM(){let t=document.createElement(\"div\");t.className=\"cm-lp-preview\";let i=document.createElement(\"iframe\");return i.className=\"cm-lp-preview-frame\",i.setAttribute(\"sandbox\",\"\"),i.setAttribute(\"srcdoc\",Ox(this.html)),i.setAttribute(\"title\",\"Rendered preview\"),i.setAttribute(\"loading\",\"lazy\"),t.append(i),t}ignoreEvent(){return!1}},mx=v.domEventHandlers({mousedown(n,e){let t=n.target;if(!(t instanceof HTMLElement))return!1;let i=t.closest(\".cm-lp-task\");if(i===null||e.state.readOnly)return!1;let r=e.posAtDOM(i)+1,s=gx(z(e.state).resolveInner(r,1),\"TaskMarker\");return s===null?!1:(e.dispatch({changes:{from:s.from,to:s.to,insert:Na(e.state.doc,s.from,s.to)?\"[ ]\":\"[x]\"},userEvent:\"input\"}),n.preventDefault(),!0)}});function gx(n,e){for(let t=n;t!==null;t=t.parent)if(t.name===e)return t;return null}function Np(n){return n.readOnly?[]:n.selection.ranges.map(e=>({from:e.from,to:e.to}))}function _p(n){let e=z(n),t=Np(n),i=qp(n.doc.toString()),r=i===null?0:i.to,s=[];if(i!==null)for(let O=n.doc.lineAt(i.from);O.from<=i.to&&(s.push(JS.range(O.from)),!(O.to>=n.doc.length));O=n.doc.lineAt(O.to+1));for(let O of ex(n,r))s.push(L.line({class:\"cm-lp-li\",attributes:{style:`padding-left:${O.columns}ch;text-indent:-${O.columns}ch`}}).range(O.from));let o=hx(n,r),l=O=>o.some(g=>O>=g.from&&OL.mark({class:\"cm-lp-task-done\"}).range(O.from,O.to)),h=dx(n,r),c=_u(n,r),f=O=>h.some(g=>O>=g.from&&OO>=g.from&&O!f(O.from)).map(O=>KS.range(O.from,O.to));for(let O of h)d.push(L.replace({widget:new qa(O.html),block:!0}).range(O.from,O.to));let p=n.facet(Jr);for(let O of c)d.push(L.replace({widget:new Kr(O,p),block:!0}).range(O.from,O.to));for(let O of o)d.push(L.replace({widget:new Ia(O),block:!0}).range(O.from,O.to));for(let O of ix(n,r))d.push(L.replace({widget:O.kind===\"bullet\"?new Wa:new Ba(O.checked)}).range(O.from,O.to));return N.of([...s,...u,...a,...d],!0)}function Gp(){return[ae.define({create:e=>_p(e),update(e,t){let i=t.startState.readOnly!==t.state.readOnly,r=z(t.state)!==z(t.startState);return!t.docChanged&&!t.selection&&!i&&!r?e:_p(t.state)},provide:e=>v.decorations.from(e)}),mx]}var Up=`\n.cm-lp-h1, .cm-lp-h2, .cm-lp-h3, .cm-lp-h4, .cm-lp-h5, .cm-lp-h6 {\n font-weight: 600;\n color: var(--lp-heading);\n line-height: 1.3;\n}\n/*\n Measured off Obsidian mobile rather than chosen: 1.625em, 1.3em and 1.15em\n against a 16px body. The multiples were 1.7 / 1.4 / 1.2, which is a wider\n ladder than a document needs and made an H1 the loudest thing on a phone\n screen that is mostly body text.\n*/\n.cm-lp-h1 { font-size: 1.625em; }\n.cm-lp-h2 { font-size: 1.3em; }\n.cm-lp-h3 { font-size: 1.15em; }\n.cm-lp-h4, .cm-lp-h5, .cm-lp-h6 { font-size: 1.05em; }\n/*\n A note's metadata, drawn as metadata. Not hidden: the buffer is the Markdown,\n and a block the editor refuses to show is a block you cannot fix. See\n frontmatterRange above for what this replaced. (No backticks in this comment:\n it is inside a template literal and one would end the string.)\n*/\n.cm-lp-frontmatter {\n font-family: var(--lp-mono);\n font-size: 0.82em;\n line-height: 1.7;\n color: var(--lp-muted);\n}\n.cm-lp-strong { font-weight: 650; color: var(--lp-heading); }\n.cm-lp-em { font-style: italic; }\n.cm-lp-strike { text-decoration: line-through; opacity: 0.7; }\n.cm-lp-code {\n font-family: var(--lp-mono);\n font-size: 0.92em;\n background: var(--lp-code-bg);\n border-radius: 4px;\n padding: 0.1em 0.32em;\n}\n.cm-lp-fence {\n font-family: var(--lp-mono);\n font-size: 0.92em;\n background: var(--lp-code-bg);\n}\n/*\n R3 in the sweep: a fence in one of the three languages the bundle already\n carries (see FENCE_LANGUAGES) is coloured with tokens this file already has\n rather than a new one \\u2014 see fenceHighlightStyle's own comment for why.\n*/\n.cm-lp-code-keyword { color: var(--lp-link); }\n.cm-lp-code-string { color: var(--lp-heading); }\n.cm-lp-code-comment { color: var(--lp-muted); font-style: italic; }\n/*\n A rendered html-preview fence. See HtmlPreviewWidget for what is inside the\n frame and why nothing inside it can run.\n\n ## The height is fixed, and that is a gap rather than a choice\n\n Nothing here can measure the frame. Sizing an iframe to its content means\n script inside it reporting a height out, and script inside it is the one thing\n this feature never allows; the frame is also cross-origin by construction, so\n the host cannot reach in and read it either. So the box is a number, and it\n errs tall: a diagram drawn short leaves empty space under it, and a diagram\n drawn tall loses its bottom third. The second is the failure a reader notices.\n\n ## overflow: hidden is not tidying\n\n The markup in the fence may have been emailed in by a stranger, and a layout\n that escapes its box draws over real console UI \\u2014 a toolbar, a save state, a\n privacy control. The clip is on the wrapper, so nothing the frame's own CSS\n does can widen it, and max-height keeps the box inside the viewport on a phone\n where 620px is most of the screen.\n\n pointer-events: none on the frame is what lets a click reach the editor and\n reveal the source. See the widget's comment.\n*/\n.cm-lp-preview {\n overflow: hidden;\n margin: 0.5em 0;\n border: 1px solid var(--lp-code-bg);\n border-radius: 8px;\n background: var(--lp-code-bg);\n}\n.cm-lp-preview-frame {\n display: block;\n width: 100%;\n height: 620px;\n max-height: 80vh;\n border: 0;\n pointer-events: none;\n}\n.cm-lp-quote { color: var(--lp-muted); font-style: italic; }\n.cm-lp-link { color: var(--lp-link); text-decoration: underline; }\n/*\n A list item's indent is arithmetic rather than taste, and it is not here: the\n padding and the negative text-indent are one number set per line by the\n decoration, because it depends on how wide that item's own marker is, so the\n first line starts at the margin with its marker and every wrapped line clears\n it. See hangingIndents. What is here is only the marker's colour.\n*/\n.cm-lp-list-mark { color: var(--lp-muted); }\n/*\n Both widgets hold the width of the characters they replaced, so the hanging\n indent above stays true on a wrapped line. A bullet stands in for one\n character and a checkbox for three.\n\n ## text-indent: 0 is not tidying, it is the whole of \"bullets look broken\"\n\n The hanging indent is padding-left:Nch with text-indent:-Nch on the line,\n which puts the first line's content back at the margin and every wrapped line\n clear of the marker. TEXT-INDENT IS INHERITED, and both of these are\n inline-level boxes with their own inner line box \\u2014 so each widget applied the\n line's negative indent a second time, inside itself. Measured in a browser at\n 390pt: the bullet glyph drew at -20.4px, a full indent OUTSIDE the reading\n margin, while the text after it started correctly at 10.2px. A bullet adrift\n in the left gutter, a third of an inch from the line it belongs to \\u2014 and a\n nested item, whose indent is twice as deep, drew its bullet off the left edge\n of the screen entirely.\n\n An ordered list was never affected and that is the tell: \"1.\" is real text,\n not a widget, so it took the indent once and landed correctly. Only what was\n replaced went wrong.\n*/\n.cm-lp-bullet {\n display: inline-block;\n width: 1ch;\n text-indent: 0;\n color: var(--lp-muted);\n}\n/*\n The checkbox, and the reason it is drawn rather than written.\n\n It used to be the character U+2610, which is text: it takes the body font's\n weight, it is a different shape in every font that has it, plenty of fonts do\n not have it at all, and none of them looks like something you press. A border\n and a radius do not depend on a font being installed and do not change weight\n when the text around them does.\n\n The outer span is the three columns the source characters occupied and the box\n is centred in them, so a list mixing tasks and plain items keeps its text in\n one column.\n*/\n.cm-lp-task {\n display: inline-flex;\n align-items: center;\n /* Inherited text-indent, for .cm-lp-bullet's reason. */\n text-indent: 0;\n justify-content: center;\n width: 3ch;\n cursor: pointer;\n /* The press is the whole point; the system callout is the other thing that\n answers a long press over it. */\n -webkit-touch-callout: none;\n}\n.cm-lp-task-box {\n position: relative;\n box-sizing: border-box;\n width: 0.95em;\n height: 0.95em;\n border: 1.5px solid var(--lp-muted);\n border-radius: 3px;\n /* A hair below the text baseline, where a checkbox sits beside a line of\n prose rather than floating in the middle of it. */\n transform: translateY(0.04em);\n}\n.cm-lp-task-on .cm-lp-task-box {\n background: var(--lp-link);\n border-color: var(--lp-link);\n}\n/*\n The tick: two borders on a rotated box, which is the construction that needs\n no font and no image. Drawn in the editor background so it reads as cut out of\n the filled square rather than painted on it.\n*/\n.cm-lp-task-on .cm-lp-task-box::after {\n content: \"\";\n position: absolute;\n left: 0.27em;\n top: 0.09em;\n width: 0.17em;\n height: 0.40em;\n border: solid var(--lp-bg);\n border-width: 0 1.6px 1.6px 0;\n transform: rotate(45deg);\n}\n/*\n A finished task, drawn as finished \\u2014 the half of a checkbox that a one-column\n glyph could never carry. This is what lets somebody skim a list and see what\n is left without reading it.\n*/\n.cm-lp-task-done {\n color: var(--lp-muted);\n text-decoration: line-through;\n text-decoration-thickness: 1px;\n}\n/*\n AN EDITABLE table is not laid out \\u2014 the pipes are still the author's \\u2014 but it\n is drawn in the mono face, which is what makes the columns of a table that\n fits line up. A reader gets the grid below instead. See tableLines and\n tableGrids.\n*/\n.cm-lp-table {\n font-family: var(--lp-mono);\n font-size: 0.86em;\n}\n.cm-lp-table-delim { color: var(--lp-muted); }\n/*\n A TABLE, LAID OUT FOR A READER.\n\n Hairlines and nothing else: no outer box, no fill, no zebra. A table in a\n note is part of the document rather than a panel sitting on it, and every\n edge spent here is an edge competing with the note's own structure. What\n separates the header from the body is one stronger rule, which is the only\n place this needs weight.\n\n The scroller is the wrapper, so a table wider than the measure scrolls in its\n own box rather than dragging the whole note sideways.\n*/\n.cm-lp-grid {\n overflow-x: auto;\n margin: 0.4em 0;\n}\n.cm-lp-grid-table {\n border-collapse: collapse;\n /*\n Sized by its content rather than stretched to the measure. A two-column\n table pushed to full width puts a hand-span of nothing between the label\n and its value, which is harder to read than the pipes were.\n */\n width: auto;\n max-width: 100%;\n font-size: 0.94em;\n line-height: 1.5;\n /* Digits in a column line up, which is most of why a column of them exists. */\n font-variant-numeric: tabular-nums;\n}\n.cm-lp-grid-table th {\n font-weight: 600;\n color: var(--lp-heading);\n text-align: left;\n padding: 7px 14px 8px;\n border-bottom: 1px solid var(--lp-line-strong);\n /*\n A header is a label, and a label that wraps to two lines over a one-line\n column is the table drawing attention to its own chrome.\n */\n white-space: nowrap;\n}\n.cm-lp-grid-table td {\n padding: 8px 14px;\n border-top: 1px solid var(--lp-line);\n vertical-align: top;\n color: var(--lp-content);\n}\n/*\n The outer columns lose their side padding, so the grid's own edges line up\n with the paragraph above it. Without this a table reads as indented from the\n text around it by however much cell padding happens to be, which is the one\n thing that gives away a rendered block as a rendered block.\n*/\n.cm-lp-grid-table tr > :first-child { padding-left: 0; }\n.cm-lp-grid-table tr > :last-child { padding-right: 0; }\n.cm-lp-grid-left { text-align: left; }\n.cm-lp-grid-center { text-align: center; }\n.cm-lp-grid-right { text-align: right; }\n/*\n An empty cell says so. Drawn as nothing it is indistinguishable from a column\n that failed to render, and a reader cannot tell which they are looking at.\n*/\n.cm-lp-grid-empty::after {\n content: \"\\u2014\";\n color: var(--lp-muted);\n}\n.cm-lp-rule { color: var(--lp-muted); }\n/*\n A FORM, DRAWN FROM ITS DECLARATION.\n\n Every colour here is one of the --lp-* properties the host already sets from\n the palette in force, so the form follows the theme without this file naming a\n single value \\u2014 the rule the rest of these styles follow. --lp-code-bg is the\n one that does the most work: it is a translucent ink rather than a fixed grey,\n so it darkens a light ground and lightens a dark one, which is exactly what a\n field's fill and a card's hairline both want.\n\n The card is the same object as the note around it rather than a panel floating\n over it: one hairline, the page's own background, and the reading measure. A\n raised surface would be a second document inside the note, which is what the\n diagram frame beside it is and what a form is not.\n*/\n.cm-lp-form {\n /*\n A real hairline. This was --lp-code-bg, which is the code fence's FILL:\n #F5F5F5 on a #FFFFFF ground, so in light mode the card had no visible edge\n at all and the form read as loose controls dropped into the note. --lp-line\n is the palette's own separator and is the same value every hairline in the\n app is drawn in.\n */\n border: 1px solid var(--lp-line);\n /*\n One radius family \\u2014 10 on the card, 8 on the field, 8 on the button. It was\n 12 / 9 / 11, three radii no two of which agreed, which is what made a small\n card read as three unrelated objects stacked up.\n */\n border-radius: 10px;\n /* The padding belongs to the three bands inside, so their rules can run edge\n to edge. */\n overflow: hidden;\n margin: 0.6em 0;\n font-family: var(--lp-body);\n font-size: 0.94em;\n line-height: 1.45;\n color: var(--lp-content);\n}\n/*\n WHAT THIS BOX IS, AND WHERE WHAT YOU TYPE GOES.\n\n See FormWidget.drawHead. The destination is the half that earns the strip:\n responses live in a sister note by design, and a reader had no way to learn\n which one before pressing Submit.\n*/\n.cm-lp-form-head {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 10px;\n flex-wrap: wrap;\n padding: 9px 14px;\n border-bottom: 1px solid var(--lp-line);\n background: var(--lp-code-bg);\n}\n.cm-lp-form-kind {\n font-family: var(--lp-mono);\n font-size: 0.72em;\n letter-spacing: 0.1em;\n text-transform: uppercase;\n color: var(--lp-muted);\n}\n.cm-lp-form-dest { font-size: 0.82em; color: var(--lp-muted); }\n.cm-lp-form-dest-path { font-family: var(--lp-mono); color: var(--lp-content); }\n.cm-lp-form-fields {\n display: flex;\n flex-direction: column;\n gap: 14px;\n padding: 14px;\n}\n.cm-lp-form-row { display: flex; flex-direction: column; gap: 6px; }\n/* The label and its character count, on one line. */\n.cm-lp-form-top {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 10px;\n}\n/*\n A field's name is its label verbatim, with underscores spaced out. Sentence\n case is left alone rather than title-cased: the author wrote the name, and a\n form that renames somebody's field on screen is a form whose error messages\n are about a field they cannot find.\n*/\n.cm-lp-form-label {\n /*\n Small, spaced and upper-case: a field name is a label rather than a\n sentence, and at 0.85em in sentence case it read as body copy that happened\n to be grey \\u2014 the note's own prose and the form's chrome in the same voice.\n The name itself is still verbatim; see drawField.\n */\n font-size: 0.76em;\n font-weight: 600;\n letter-spacing: 0.07em;\n text-transform: uppercase;\n color: var(--lp-muted);\n}\n/*\n The word rather than an asterisk. An asterisk has to be learned, is invisible\n to a screen reader that announces punctuation differently, and at 0.85em is\n three pixels of ink carrying the difference between a form that submits and\n one that is refused.\n*/\n.cm-lp-form-required {\n font-weight: 500;\n /* Not upper-cased with the name: it is a note about the field, not part of\n what the field is called. */\n text-transform: none;\n letter-spacing: 0.02em;\n color: var(--lp-muted);\n opacity: 0.85;\n}\n.cm-lp-form-input {\n display: block;\n width: 100%;\n box-sizing: border-box;\n font: inherit;\n font-family: var(--lp-body);\n color: var(--lp-content);\n background: var(--lp-code-bg);\n /*\n A real border at rest rather than a transparent one. A filled slab with no\n edge is a block of colour; the edge is what says \"you type in here\", and\n without it the only thing distinguishing a field from a code span was its\n width.\n */\n border: 1px solid var(--lp-line-strong);\n border-radius: 8px;\n padding: 8px 10px;\n /* Safari draws its own rounded fill over the one above without this. */\n -webkit-appearance: none;\n appearance: none;\n}\n.cm-lp-form-input::placeholder { color: var(--lp-muted); opacity: 0.7; }\n/* The two controls that are meaningless at full width and a target at 18px. */\n.cm-lp-form-input[type=\"checkbox\"] { width: 18px; height: 18px; accent-color: var(--lp-link); }\n.cm-lp-form-input[type=\"date\"], .cm-lp-form-input[type=\"number\"] { width: auto; min-width: 10em; }\n.cm-lp-form-input:focus {\n outline: none;\n border-color: var(--lp-link);\n /*\n A ring as well as the border. The border alone moves one pixel of colour on\n focus, which is not enough to find the field you just tabbed to \\u2014 and this\n is the control a keyboard user reaches Submit through.\n */\n box-shadow: 0 0 0 3px var(--lp-focus-ring);\n}\ntextarea.cm-lp-form-input { resize: vertical; min-height: 5em; }\n/*\n Right-aligned under the box it counts, in the muted ink: it is a fact about\n the room left rather than a message, and reading order should reach the next\n field before it.\n*/\n.cm-lp-form-count {\n font-size: 0.76em;\n color: var(--lp-muted);\n /* Digits that change under the reader's eye must not move the label. */\n font-variant-numeric: tabular-nums;\n}\n.cm-lp-form-foot {\n display: flex;\n align-items: center;\n gap: 12px;\n flex-wrap: wrap;\n padding: 11px 14px;\n /* The action is separated from the fields rather than being the next thing\n in the stack \\u2014 pressing it is not the same kind of act as filling one in. */\n border-top: 1px solid var(--lp-line);\n}\n/*\n The app's primary button, in CSS: the accent fill, white ink, 11px corners and\n a 15px label. It is the one filled thing in the note, which is what a button\n in a document should be.\n*/\n.cm-lp-form-submit {\n font: inherit;\n font-family: var(--lp-body);\n font-weight: 600;\n color: #ffffff;\n background: var(--lp-link);\n border: none;\n border-radius: 8px;\n padding: 7px 16px;\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n}\n.cm-lp-form-submit:focus-visible { outline: 2px solid var(--lp-link); outline-offset: 2px; }\n.cm-lp-form-submit:disabled { opacity: 0.45; cursor: default; }\n.cm-lp-form-status { font-size: 0.88em; color: var(--lp-muted); }\n.cm-lp-form-status-ok { color: var(--lp-link); font-weight: 600; }\n/*\n A refusal is drawn in the muted ink at full weight rather than in red. There\n is no --lp-danger, and inventing a hex here would be the one colour in this\n file that does not follow the theme \\u2014 the failure the file's own header names.\n Weight carries it, and the words carry the rest.\n*/\n.cm-lp-form-status-bad { color: var(--lp-content); font-weight: 600; }\n.cm-lp-form-status-quiet { opacity: 0.75; }\n/*\n The sister file's rows, as the card's fourth band.\n\n Its own padding and no margin, because the card is now edge-to-edge bands\n separated by rules (see .cm-lp-form) rather than one padded box \\u2014 a margin\n here would inset the rule and leave the rows flush against the border. The\n title takes the same small upper-case voice as a field label, so the two\n headings inside one card agree.\n*/\n.cm-lp-form-responses {\n border-top: 1px solid var(--lp-line);\n padding: 14px;\n}\n.cm-lp-form-responses-title {\n font-weight: 600;\n font-size: 0.76em;\n letter-spacing: 0.07em;\n text-transform: uppercase;\n color: var(--lp-muted);\n margin-bottom: 8px;\n}\n.cm-lp-form-responses-status { color: var(--lp-muted); font-size: 0.88em; }\n.cm-lp-form-responses-scroll { overflow-x: auto; }\n.cm-lp-form-responses-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 0.9em;\n}\n.cm-lp-form-responses-table th,\n.cm-lp-form-responses-table td {\n border-bottom: 1px solid var(--lp-line);\n padding: 8px 10px 8px 0;\n text-align: left;\n vertical-align: top;\n}\n.cm-lp-form-responses-table th { color: var(--lp-muted); font-size: 0.88em; font-weight: 600; }\n.cm-lp-form-voters { color: var(--lp-muted); white-space: nowrap; }\n.cm-lp-form-vote-controls { display: flex; gap: 6px; margin-top: 6px; white-space: nowrap; }\n.cm-lp-form-response-controls { display: flex; gap: 6px; white-space: nowrap; }\n.cm-lp-form-vote {\n border: 1px solid var(--lp-line-strong);\n border-radius: 8px;\n padding: 4px 8px;\n color: var(--lp-link);\n background: transparent;\n font: inherit;\n cursor: pointer;\n}\n.cm-lp-form-vote:disabled { opacity: 0.45; cursor: default; }\n.cm-lp-form-vote-remove { color: var(--lp-muted); }\n.cm-lp-form-response-action {\n border: 1px solid var(--lp-line-strong);\n border-radius: 8px;\n padding: 4px 8px;\n color: var(--lp-link);\n background: transparent;\n font: inherit;\n cursor: pointer;\n}\n.cm-lp-form-response-action:disabled { opacity: 0.45; cursor: default; }\n.cm-lp-form-delete { color: var(--lp-muted); }\n/*\n \"We can't display because the formatting is off\", which is what the owner\n asked for. Dashed rather than solid so it reads as a gap in the note that\n something should fill, and muted rather than loud: a form that will not parse\n is the author's problem to fix and nobody else's to be alarmed by.\n*/\n.cm-lp-form-broken {\n border-style: dashed;\n border-color: var(--lp-line-strong);\n color: var(--lp-muted);\n /* No head, no fields, no foot \\u2014 so this one carries its own padding. */\n padding: 14px;\n}\n.cm-lp-form-broken-title { font-weight: 600; color: var(--lp-content); }\n.cm-lp-form-broken-why { font-family: var(--lp-mono); font-size: 0.85em; margin-top: 4px; }\n.cm-lp-form-hint { font-size: 0.85em; margin-top: 6px; }\n`;var bx=[{label:\"id\",insert:\"id: \",detail:\"this form\\u2019s name, [a-z0-9-]\"},{label:\"responses\",insert:\"responses: \",detail:\"the note answers are written to\"},{label:\"layout\",insert:\"layout: table\",detail:\"table or sections\"},{label:\"submit\",insert:\"submit: member\",detail:\"lowest role that may answer\"},{label:\"edit_own\",insert:\"edit_own: true\",detail:\"may people change their answer\"},{label:\"show_responses\",insert:\"show_responses: true\",detail:\"draw readable responses below\"},{label:\"votes\",insert:\"votes: named\",detail:\"named or off\"},{label:\"fields\",insert:`fields:\n - { name: , type: line, max: 120 }`,caretBack:26,detail:\"the questions, one per line\"}],yx=[{label:\"name\",insert:\"name: \",detail:\"[a-z][a-z0-9_]*, not id/by/at/votes\"},{label:\"type\",insert:\"type: line\",detail:\"line, text, select, number, date, checkbox\"},{label:\"max\",insert:\"max: 120\",detail:\"required on line and text\"},{label:\"min\",insert:\"min: 0\",detail:\"number only\"},{label:\"required\",insert:\"required: true\"},{label:\"options\",insert:\"options: [a, b]\",caretBack:6,detail:\"select only\"}],Sx=[{label:\"line\",detail:\"one line of text; needs max\"},{label:\"text\",detail:\"a paragraph; needs max\"},{label:\"select\",detail:\"one of options\"},{label:\"number\",detail:\"min and max bound it\"},{label:\"date\",detail:\"2026-09-12\"},{label:\"checkbox\",detail:\"yes or no\"}],Fp=new Map([[\"layout\",[{label:\"table\",detail:\"one row per response\"},{label:\"sections\",detail:\"one heading per response\"}]],[\"submit\",[{label:\"member\",detail:\"anybody in the context\"},{label:\"editor\",detail:\"people who can write notes\"},{label:\"owner\",detail:\"the owner alone\"}]],[\"votes\",[{label:\"named\",detail:\"upvotes, with the voters listed\"},{label:\"off\",detail:\"no voting\"}]],[\"edit_own\",[{label:\"true\",detail:\"a submitter may change or withdraw theirs\"},{label:\"false\",detail:\"answers are final once sent\"}]],[\"show_responses\",[{label:\"true\",detail:\"show responses when the viewer may read them\"},{label:\"false\",detail:\"keep responses out of the form\"}]],[\"required\",[{label:\"true\"},{label:\"false\"}]]]),xx=`${jt}\nid: feedback\nresponses: feedback-responses.md\nlayout: table\nsubmit: member\nedit_own: true\nshow_responses: false\nvotes: named\nfields:\n - { name: summary, type: line, max: 120, required: true }\n - { name: detail, type: text, max: 2000 }`;function ms(n,e){let t=e.exec(n),i=t===null?\"\":t[0];return{word:i,back:i.length}}function Hp(n,e){let i=n.slice(0,e).split(`\n`),r=null,s=!1,o=0;for(let l=0;l=r.length&&(r=null,s=!1)}return r===null||!s?null:{body:i.slice(o,i.length-1),lineInBody:i.length-1-o}}function wx(n,e){let t=n.lastIndexOf(`\n`,e-1)+1,i=n.slice(t,e),r=Hp(n,e);if(r===null){let h=/^(\\s{0,3})(`{3,}|~{3,})([a-z]*)$/.exec(i);return h===null?null:{spot:{kind:\"fence-info\"},back:h[3].length}}let s=i.lastIndexOf(\"{\");if(s!==-1&&!i.slice(s).includes(\"}\")){let h=i.slice(s+1),c=/(?:^|,)\\s*([a-z_]+)\\s*:\\s*([^,]*)$/.exec(h);if(c!==null){let u=ms(c[2],/[A-Za-z0-9_.-]*$/);return{spot:{kind:\"field-value\",key:c[1]},back:u.back}}let f=ms(h,/[a-z_]*$/);return{spot:{kind:\"field-key\"},back:f.back}}if(/^\\s+-\\s*$/.exec(i)!==null&&r.body.some(h=>/^fields\\s*:\\s*$/.test(h)))return{spot:{kind:\"field-entry\"},back:0};let l=/^([a-z_]+)\\s*:\\s*([^:]*)$/.exec(i);if(l!==null){let h=ms(l[2],/[A-Za-z0-9_.-]*$/);return{spot:{kind:\"key-value\",key:l[1]},back:h.back}}let a=ms(i,/^[a-z_]*$/);return a.word!==i.trimStart()&&i.trim()!==\"\"?null:{spot:{kind:\"key\"},back:a.back}}function kx(n,e=[]){switch(n.kind){case\"fence-info\":return[{label:jt,insert:xx,detail:\"a form people can fill in\"}];case\"key\":{let t=new Set(e.flatMap(i=>{let r=/^([a-z_]+)\\s*:/.exec(i);return r===null?[]:[r[1]]}));return bx.filter(i=>!t.has(i.label))}case\"key-value\":return[...Fp.get(n.key)??[]];case\"field-entry\":return[{label:\"{ \\u2026 }\",insert:\"{ name: , type: line, max: 120 }\",caretBack:24,detail:\"a question\"}];case\"field-key\":return[...yx];case\"field-value\":return n.key===\"type\"?[...Sx]:[...Fp.get(n.key)??[]]}}function Kp(){return n=>{let e=n.state.doc.toString(),t=wx(e,n.pos);if(t===null)return null;let i=kx(t.spot,Hp(e,n.pos)?.body??[]);if(i.length===0)return null;let r=i.map(s=>({label:s.label,detail:s.detail,type:\"keyword\",apply:(o,l,a,h)=>{let c=s.insert??s.label;o.dispatch({changes:{from:a,to:h,insert:c},selection:{anchor:a+c.length-(s.caretBack??0)},userEvent:\"input.complete\"})}}));return{from:n.pos-t.back,options:r}}}function Qx(n){let e=/\\[\\[([^\\][\\n]*)$/.exec(n);return e===null?null:{query:e[1],from:n.length-e[1].length}}function Jp(n){return n.slice(n.lastIndexOf(\"/\")+1).replace(/\\.md$/,\"\")}function vx(n){let e=n.lastIndexOf(\"/\");return e===-1?\"\":n.slice(0,e)}var $x=50;function Px(n,e,t){let i=n.trim().toLowerCase(),r=[];for(let s of e){if(s===t)continue;let o=Jp(s).toLowerCase(),l=i===\"\"||o.startsWith(i)?0:o.includes(i)?1:s.toLowerCase().includes(i)?2:-1;l<0||r.push({band:l,path:s})}return r.sort((s,o)=>s.band===o.band?s.path.localeCompare(o.path):s.band-o.band),r.slice(0,$x).map(({path:s})=>({label:Jp(s),folder:vx(s),insert:s.replace(/\\.md$/,\"\")}))}function Tx(n){return e=>{let t=e.state.doc.lineAt(e.pos),i=Qx(e.state.doc.sliceString(t.from,e.pos));if(i===null||!e.explicit&&i.query===\"\")return null;let r=n.current.paths??[];if(r.length===0)return null;let s=Px(i.query,r,n.current.path).map(o=>({label:o.label,detail:o.folder,type:\"text\",apply:(l,a,h,c)=>{let f=l.state.doc.sliceString(c,c+2)===\"]]\"?\"\":\"]]\";l.dispatch({changes:{from:h,to:c,insert:`${o.insert}${f}`},selection:{anchor:h+o.insert.length+2},userEvent:\"input.complete\"})}}));return s.length===0?null:{from:t.from+i.from,options:s,filter:!1}}}function eO(n){return[ku({override:[Kp(),...n===null?[]:[Tx(n)]],closeOnBlur:!0}),Cx]}var Cx=v.theme({\".cm-tooltip.cm-tooltip-autocomplete\":{border:\"1px solid var(--lp-code-bg)\",borderRadius:\"8px\",background:\"var(--lp-bg)\",color:\"var(--lp-content)\",font:\"13px/1.5 system-ui, sans-serif\",boxShadow:\"0 6px 20px rgba(0,0,0,0.18)\",overflow:\"hidden\"},\".cm-tooltip.cm-tooltip-autocomplete > ul\":{fontFamily:\"inherit\",maxHeight:\"14em\"},\".cm-tooltip.cm-tooltip-autocomplete > ul > li\":{padding:\"5px 9px\",display:\"flex\",gap:\"10px\",alignItems:\"baseline\"},\".cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected]\":{background:\"var(--lp-code-bg)\",color:\"var(--lp-content)\"},\".cm-completionDetail\":{marginLeft:\"auto\",fontStyle:\"normal\",fontSize:\"0.85em\",color:\"var(--lp-muted)\",overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\",maxWidth:\"60%\"}});function Ax(n){let e=[],t=0,i=null;for(let s of n.split(`\n`)){let o=/^\\s{0,3}(`{3,}|~{3,})/.exec(s);i===null?o&&(i={char:o[1][0],length:o[1].length,start:t}):o&&o[1][0]===i.char&&o[1].length>=i.length&&(e.push([i.start,t+s.length]),i=null),t+=s.length+1}i!==null&&e.push([i.start,n.length]);let r=/(`+)(?:[^`]|(?!\\1)`)*?\\1/g;for(let s of n.matchAll(r)){let o=s.index;e.some(([l,a])=>o>=l&&os[0]-o[0])}var Rx=/(!?)\\[\\[([^\\]\\n]+)\\]\\]/g,Zx=/\\[([^\\]\\n]*)\\]\\((<[^>\\n]*>|[^\\s()]*)\\s*(?:\"[^\"\\n]*\"|'[^'\\n]*')?\\)/g;function tO(n){let e=Ax(n),t=r=>e.some(([s,o])=>r>=s&&r\"),l=o?s.slice(1,-1):s,a=r.index+r[1].length+3+(o?1:0);i.push({kind:\"inline\",embed:r.index>0&&n[r.index-1]===\"!\",target:l,start:a,end:a+l.length})}return i.sort((r,s)=>r.start-s.start)}function Xx(n){return/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(n)||n.startsWith(\"//\")}function Mx(n){let e=n.indexOf(\"#\");return e===-1?{file:n,anchor:\"\"}:{file:n.slice(0,e),anchor:n.slice(e)}}function Ex(n){let e=n.lastIndexOf(\"/\");return e===-1?\"\":n.slice(0,e)}function Lx(n){let e=[];for(let t of n)if(!(t===\"\"||t===\".\")){if(t===\"..\"){if(e.length===0)return null;e.pop();continue}e.push(t)}return e}function zx(n){return n.startsWith(\"./\")||n.startsWith(\"../\")?\"relative\":n.includes(\"/\")?\"rooted\":\"bare\"}function iO(n,e,t){let i=n.target.trim();if(i===\"\"||i.startsWith(\"#\")||Xx(i))return null;let{file:r}=Mx(i);if(r===\"\")return null;let s=n.kind===\"inline\"?_x(r):r,o=zx(s);if(o===\"bare\"){let c=s.replace(/\\.md$/,\"\"),f=t?.get(c);return f?.length===1?f[0]:null}let l=o===\"relative\"?Ex(e).split(\"/\"):[],a=Lx([...l,...s.split(\"/\")]);if(a===null||a.length===0)return null;let h=a.join(\"/\");return h.endsWith(\".md\")||/\\.[a-z0-9]{1,8}$/i.test(h)?h:`${h}.md`}function _x(n){try{return decodeURIComponent(n)}catch{return n}}function nO(n){let e=new Map;for(let t of n){let i=t.slice(t.lastIndexOf(\"/\")+1).replace(/\\.md$/,\"\"),r=e.get(i);r?r.push(t):e.set(i,[t])}return e}function jx(n,e){if(e.path===null)return[];let t=nO(e.paths??[]),i=[];for(let r of tO(n)){let s=iO(r,e.path,t);s!==null&&i.push({...Yx(n,r),path:s})}return i}function Yx(n,e){if(e.kind===\"wiki\"){let r=n.indexOf(\"]]\",e.end),s=n.lastIndexOf(\"[[\",e.start);return s===-1||r===-1?{from:e.start,to:e.end}:{from:n[s-1]===\"!\"?s-1:s,to:r+2}}let t=n.indexOf(\")\",e.end),i=n.lastIndexOf(\"[\",e.start);return i===-1||t===-1?{from:e.start,to:e.end}:{from:n[i-1]===\"!\"?i-1:i,to:t+1}}function Ga(n,e){return n.find(t=>e>=t.from&&e<=t.to)??null}function Dx(n){return/mac|iphone|ipad|ipod/i.test(n??\"\")?\"\\u2318\":\"Ctrl\"}var Vx=450,rO=10,Ix=150,Wx=L.mark({class:\"cm-note-link\"});function sO(n){let e=h=>jx(h.state.doc.toString(),n.current),t=we.fromClass(class{decorations;constructor(h){this.decorations=i(h)}update(h){(h.docChanged||h.viewportChanged)&&(this.decorations=i(h.view))}},{decorations:h=>h.decorations});function i(h){let c=new lt;for(let f of e(h))c.add(f.from,f.to,Wx);return c.finish()}let r=Fc((h,c)=>{let f=Ga(e(h),c);return f===null?null:{pos:f.from,end:f.to,above:!0,create:()=>{let u=document.createElement(\"div\");u.className=\"cm-note-link-tooltip\";let d=document.createElement(\"span\");d.className=\"cm-note-link-name\",d.textContent=f.path;let p=document.createElement(\"span\");return p.className=\"cm-note-link-hint\",p.textContent=`${Dx(Bx())}-click to open`,u.append(d,p),{dom:u}}}}),s=null,o=()=>{s!==null&&(clearTimeout(s.timer),s=null)},l=h=>{o(),n.current.onPress(h)},a=v.domEventHandlers({mousedown(h,c){if(!(h.metaKey||h.ctrlKey))return!1;let f=c.posAtCoords({x:h.clientX,y:h.clientY});if(f===null)return!1;let u=Ga(e(c),f);return u===null?!1:(h.preventDefault(),n.current.onOpen(u.path),!0)},touchstart(h,c){if(o(),h.touches.length!==1)return!1;let f=h.touches[0],u=c.posAtCoords({x:f.clientX,y:f.clientY});if(u===null)return!1;let d=Ga(e(c),u);return d===null||(s={x:f.clientX,y:f.clientY,path:d.path,startedAt:Date.now(),timer:setTimeout(()=>l(d.path),Vx)}),!1},touchmove(h){if(s===null)return!1;let c=h.touches[0];return c===void 0||(Math.abs(c.clientX-s.x)>rO||Math.abs(c.clientY-s.y)>rO)&&o(),!1},touchend(){return o(),!1},touchcancel(){return s!==null&&Date.now()-s.startedAt\"u\"?void 0:navigator.userAgent}var qx=v.theme({\".cm-note-link\":{color:\"var(--lp-link)\",textDecoration:\"underline\",textUnderlineOffset:\"2px\",cursor:\"pointer\",WebkitTouchCallout:\"none\"},\".cm-note-link-tooltip\":{display:\"flex\",flexDirection:\"column\",gap:\"2px\",padding:\"6px 9px\",borderRadius:\"8px\",border:\"1px solid var(--lp-code-bg)\",background:\"var(--lp-bg)\",color:\"var(--lp-content)\",font:\"12px/1.4 system-ui, sans-serif\",maxWidth:\"320px\",boxShadow:\"0 6px 20px rgba(0,0,0,0.18)\"},\".cm-note-link-name\":{fontWeight:\"500\",wordBreak:\"break-all\"},\".cm-note-link-hint\":{color:\"var(--lp-muted)\"}});var Ua=fe.define();function lO(n,e){n.dispatch({changes:{from:0,to:n.state.doc.length,insert:e},annotations:[Ua.of(!0),ee.addToHistory.of(!1)]})}var Nx=\"Write in markdown\\u2026\";function Fa(n){return[v.editable.of(n),q.readOnly.of(!n),q.changeFilter.of(e=>!e.startState.readOnly||e.annotation(Ua)===!0)]}function Gx(n,e,t){n.dispatch(n.state.update(n.state.changeByRange(i=>({changes:[{from:i.from,insert:e},{from:i.to,insert:t}],range:x.range(i.from+e.length,i.to+e.length)})),{scrollIntoView:!0,userEvent:\"input\"}))}function Ux(n,e){let t=n.state.doc.lineAt(n.state.selection.main.head);n.dispatch({changes:t.text.startsWith(e)?{from:t.from,to:t.from+e.length,insert:\"\"}:{from:t.from,insert:e},scrollIntoView:!0,userEvent:\"input\"})}function Fx(n){n.dispatch(n.state.update(n.state.changeByRange(e=>({changes:[{from:e.from,to:e.to,insert:\"[[]]\"}],range:x.cursor(e.from+2)})),{scrollIntoView:!0,userEvent:\"input\"})),kn(n)}function aO(n,e){if(e.name===\"blur\"){n.contentDOM.blur();return}if(!n.state.readOnly){switch(e.name){case\"wrap\":Gx(n,e.before,e.after);break;case\"toggleLinePrefix\":Ux(n,e.prefix);break;case\"insertLink\":Fx(n);break;case\"undo\":Ir(n);break;case\"redo\":xn(n);break}n.focus()}}function Hx(n){return v.scrollMargins.of(()=>{let e=n();return e>0?{bottom:e}:null})}function Kx(n){let e=z(n);return n.selection.ranges.every(t=>{for(let i=e.resolveInner(t.head,-1);i;i=i.parent)if(i.name===\"ListItem\")return!0;return!1})}function oO(n){return e=>Kx(e.state)?n===1?kl(e):Ql(e):!1}function Jx(n){let{editable:e,editableCompartment:t,handlers:i,insetBottom:r,links:s,forms:o}=n;return[jp(),Gp(),Yp(),...s===void 0?[]:[sO(s)],eO(s??null),...o===void 0?[]:[Jr.of(o)],Ef(),v.lineWrapping,Uc(Nx),v.contentAttributes.of({spellcheck:\"true\"}),t.of(Fa(e)),...r===void 0?[]:[Hx(r)],Tt.of([{key:\"Mod-s\",run:l=>(l.state.readOnly||i.current.onSave(),!0)},{key:\"Tab\",run:oO(1),shift:oO(-1)},..._f,...cu]),v.updateListener.of(l=>{l.docChanged&&(l.transactions.some(a=>a.annotation(Ua)===!0)||i.current.onChange(l.state.doc.toString()))})]}function hO(n){return q.create({doc:n.doc,extensions:Jx(n)})}function cO(n){if(typeof n!=\"object\"||n===null)return null;let e=n;switch(e.name){case\"wrap\":return typeof e.before!=\"string\"||typeof e.after!=\"string\"?null:{name:\"wrap\",before:e.before,after:e.after};case\"toggleLinePrefix\":return typeof e.prefix!=\"string\"?null:{name:\"toggleLinePrefix\",prefix:e.prefix};case\"insertLink\":return{name:\"insertLink\"};case\"undo\":return{name:\"undo\"};case\"redo\":return{name:\"redo\"};case\"blur\":return{name:\"blur\"};default:return null}}function ew(n){return n.name!==\"blur\"}function fO(n,e){return n||!ew(e)}function uO(n,e){let t;try{t=JSON.parse(n)}catch{return null}if(typeof t!=\"object\"||t===null)return null;let i=t;return i.v!==1||typeof i.type!=\"string\"||!e.has(i.type)?null:t}var dO=new Set([\"doc\",\"editable\",\"theme\",\"inset\",\"command\",\"links\",\"form-result\",\"form-responses-result\"]);function pO(n,e){return n===e}function Ha(n,e){let t=!1,i=!1;return{request:()=>{t||i||(t=!0,e(()=>{t=!1,i||n()}))},cancel:()=>{i=!0}}}var tw=n=>{typeof requestAnimationFrame==\"function\"?requestAnimationFrame(n):setTimeout(n,0)};function iw(n){let e=n.scrollDOM,t=e.ownerDocument.defaultView?.getComputedStyle(e),i=t===void 0?0:(Number.parseFloat(t.paddingTop)||0)+(Number.parseFloat(t.paddingBottom)||0);return Math.ceil(n.contentDOM.getBoundingClientRect().height+i)}function nw(n){try{let e=n.coordsAtPos(n.state.selection.main.head);if(e===null)return null;let t=n.scrollDOM.getBoundingClientRect();return{top:e.top-t.top,bottom:e.bottom-t.top}}catch{return null}}function OO(n,e){for(let[t,i]of Object.entries(e))/^--lp-[a-z0-9-]+$/.test(t)&&n.style.setProperty(t,i)}function mO(n,e,t){let i=e.schedule??tw,r=new Ht,s=\"\",o=!1,l=0,a={current:{onChange:()=>{},onSave:()=>{}}},h={current:{path:null,onOpen:A=>e.post({v:1,type:\"open-link\",path:A}),onPress:A=>e.post({v:1,type:\"press-link\",path:A})}},c=new Map,f=new Map,u=0,d={generation:0,current:{submit:A=>new Promise(M=>{let Z=`f${++u}`;c.set(Z,M),e.post({v:1,type:\"form-submit\",token:Z,formId:A.formId,values:A.values.map(U=>({...U}))})}),readResponses:A=>new Promise(M=>{let Z=`r${++u}`;f.set(Z,M),e.post({v:1,type:\"form-responses\",token:Z,responsesPath:A})}),vote:A=>new Promise(M=>{let Z=`v${++u}`;c.set(Z,M),e.post({v:1,type:\"form-vote\",token:Z,...A})}),update:A=>new Promise(M=>{let Z=`u${++u}`;c.set(Z,M),e.post({v:1,type:\"form-update\",token:Z,...A})}),retract:A=>new Promise(M=>{let Z=`d${++u}`;c.set(Z,M),e.post({v:1,type:\"form-retract\",token:Z,...A})})}},p=new v({state:hO({doc:\"\",editable:!1,editableCompartment:r,handlers:a,links:h,forms:d,insetBottom:()=>l}),parent:n}),O=Ha(()=>e.post({v:1,type:\"change\",text:s}),i),g=Ha(()=>e.post({v:1,type:\"height\",height:iw(p)}),i),b=Ha(()=>{let A=nw(p);A!==null&&e.post({v:1,type:\"caret\",top:A.top,bottom:A.bottom})},i);a.current={onChange:A=>{s=A,o&&(O.request(),g.request(),b.request())},onSave:()=>e.post({v:1,type:\"save\"})};let y=A=>{switch(A.type){case\"doc\":{if(pO(A.text,s))return;s=A.text,d.generation=(d.generation??0)+1,lO(p,A.text),g.request();return}case\"editable\":{o=A.editable,p.dispatch({effects:r.reconfigure(Fa(A.editable))});return}case\"theme\":{OO(t??n,A.vars),g.request();return}case\"form-result\":{let M=c.get(A.token);c.delete(A.token),M?.({ok:A.ok,message:A.message});return}case\"form-responses-result\":{let M=f.get(A.token);f.delete(A.token),M?.({ok:A.ok,text:A.text,message:A.message});return}case\"links\":{h.current={...h.current,path:A.path,paths:A.paths},p.dispatch({});return}case\"inset\":{l=Math.max(0,A.bottom),OO(t??n,{\"--lp-inset-bottom\":`${l}px`}),p.dispatch({effects:v.scrollIntoView(p.state.selection.main.head)});return}case\"command\":{let M=cO(A.command);if(M===null||!fO(o,M))return;aO(p,M);return}}},S=A=>{let M=uO(A,dO);M!==null&&y(M)};e.listen(S);let C=()=>{e.post({v:1,type:\"focus\",focused:!0}),b.request()},k=()=>e.post({v:1,type:\"focus\",focused:!1});p.contentDOM.addEventListener(\"focus\",C),p.contentDOM.addEventListener(\"blur\",k);let P=p.contentDOM.ownerDocument,T=()=>b.request();P.addEventListener(\"selectionchange\",T);let j=P.defaultView?.ResizeObserver,B=j===void 0?null:new j(()=>g.request());return B?.observe(p.contentDOM),e.post({v:1,type:\"ready\"}),g.request(),{view:p,receive:S,destroy:()=>{O.cancel(),g.cancel(),b.cancel(),B?.disconnect(),P.removeEventListener(\"selectionchange\",T),p.contentDOM.removeEventListener(\"focus\",C),p.contentDOM.removeEventListener(\"blur\",k),p.destroy()}}}function gO(){return`\n:root {\n /*\n Defaults, so a bundle whose first theme message never arrives is a readable\n note rather than black text on a black ground. The host overwrites all of\n these on mount; these are the values only a broken bridge sees, and they are\n deliberately neutral rather than either palette. (No backticks in any\n comment below: this whole stylesheet is inside a template literal and one\n would end the string.)\n */\n --lp-bg: #ffffff;\n --lp-content: #222222;\n --lp-heading: #111111;\n --lp-muted: #666666;\n --lp-link: #2a5db0;\n --lp-code-bg: rgba(0,0,0,0.06);\n --lp-line: rgba(0,0,0,0.09);\n --lp-line-strong: rgba(0,0,0,0.18);\n --lp-focus-ring: rgba(37,99,235,0.10);\n --lp-caret: #222222;\n --lp-selection: rgba(37,99,235,0.20);\n --lp-mono: ui-monospace, Menlo, monospace;\n --lp-body: -apple-system, system-ui, sans-serif;\n\n /* The type scale. See themeVars for the two sets of values. */\n --lp-size: 16px;\n --lp-leading: 1.5;\n --lp-pad-top: 8px;\n --lp-pad-x: 24px;\n --lp-pad-bottom: 32px;\n\n /*\n The reading measure \\u2014 how long a line of prose may get, as a multiple of\n the note's own font size, so it is the same sentence at both densities.\n A bare number: the rule that uses it multiplies by 1em there, where the\n note's type is, rather than here where this element's is. The value is\n layout.readingMeasureEm, which carries the argument for the number and\n reaches the real document through themeVars; this copy is the\n broken-bridge fallback, like the colours above.\n */\n --lp-measure: 36;\n\n /* How much of the editor something else is covering. See the inset message. */\n --lp-inset-bottom: 0px;\n}\n\nhtml, body {\n height: 100%;\n margin: 0;\n padding: 0;\n background: var(--lp-bg);\n /*\n The document does not scroll; the editor's own scroller does. Without this\n WKWebView gives the page a scroll view of its own and the note ends up with\n two, which on a phone reads as the text sticking and then lurching. The\n host sets scrollEnabled={false} for the same reason, on the other side.\n */\n overflow: hidden;\n overscroll-behavior: none;\n -webkit-text-size-adjust: 100%;\n -webkit-tap-highlight-color: transparent;\n}\n\n/*\n Everything below is prefixed with the host element's id, and that is not\n ornament.\n\n CodeMirror injects its own base theme through style-mod at the moment the\n view is constructed \\u2014 which is AFTER this stylesheet has been appended to the\n head \\u2014 and that base theme sets font-family: monospace on .cm-scroller and\n padding on .cm-line. At equal specificity the later sheet wins, so the whole\n note rendered in a code face with the wrong line box, which is exactly what\n the first screenshot of this editor showed. An id beats a class and does not\n depend on which sheet was appended first. The web half never hit this because\n its selectors are already two classes deep (.cm-lp-root .cm-scroller).\n*/\n#root { height: 100%; }\n\n#root .cm-editor { height: 100%; background: transparent; }\n#root .cm-editor.cm-focused { outline: none; }\n\n#root .cm-scroller {\n font-family: var(--lp-body);\n /*\n On a phone this resolves to 16px, which is also the number below which iOS\n zooms the page when a field takes focus. So it is load-bearing twice: the\n measured reading size, and what stops the note jumping to 150% the moment\n somebody taps into it.\n */\n font-size: var(--lp-size);\n line-height: var(--lp-leading);\n /*\n The bottom padding grows by whatever the keyboard is covering, so the last\n line of a note can always be scrolled clear of it. It is on the scroller\n rather than on the host's layout because moving the web view would reflow\n the whole document every time the keyboard opened.\n */\n padding: var(--lp-pad-top) var(--lp-pad-x)\n calc(var(--lp-pad-bottom) + var(--lp-inset-bottom));\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n overscroll-behavior: contain;\n}\n\n#root .cm-content {\n color: var(--lp-content);\n caret-color: var(--lp-caret);\n /*\n The reading measure, inset with padding so the column is measured while\n the element stays the full width of the pane \\u2014 see the web half's copy of\n this rule for both halves of that: why a table and a form have to share\n the paragraph's left edge, and why a click in the margin still has to\n reach the editor.\n\n On a phone it never binds: 36em at 16px is 576pt of text and the widest\n phone this runs on has under 400 inside its gutters, so the max() floor is\n zero, --lp-pad-x is the only gutter, and this is the rule that does\n nothing until somebody turns an iPad sideways.\n\n 1em is this element's own font size \\u2014 var(--lp-size), the note's \\u2014 which\n is why the number arrives unitless and is multiplied here.\n */\n padding-inline: max(0px, calc((100% - var(--lp-measure) * 1em) / 2));\n}\n#root .cm-line { padding: 0; }\n#root .cm-cursor, #root .cm-dropCursor { border-left-color: var(--lp-caret); }\n#root .cm-selectionBackground,\n#root .cm-content ::selection { background: var(--lp-selection); }\n#root .cm-placeholder { color: var(--lp-muted); }\n\n/*\n A note the viewer may not write reads; it does not pretend to be a text\n field. The facets in editorSetup.ts are what actually refuse the edit \\u2014 this\n is only so the caret does not blink on a surface nothing can be typed into.\n*/\n#root .cm-editor[aria-readonly=\"true\"] .cm-cursor { display: none; }\n\n${Up}\n`}function rw(){let n=document.createElement(\"style\");n.textContent=gO(),document.head.appendChild(n);let e=document.createElement(\"div\");e.id=\"root\",document.body.appendChild(e);let t=window.ReactNativeWebView;mO(e,{post:r=>t?.postMessage(JSON.stringify(r)),listen:r=>{let s=o=>{let l=o.data;typeof l==\"string\"&&r(l)};window.addEventListener(\"message\",s),document.addEventListener(\"message\",s)}},document.documentElement)}try{rw()}catch(n){window.ReactNativeWebView?.postMessage(JSON.stringify({v:1,type:\"failed\",message:n instanceof Error?n.message:String(n)}))}})();\n"; diff --git a/apps/mobile/features/console/files/webview/host.ts b/apps/mobile/features/console/files/webview/host.ts index 0416d9c7..898a3ca4 100644 --- a/apps/mobile/features/console/files/webview/host.ts +++ b/apps/mobile/features/console/files/webview/host.ts @@ -33,10 +33,17 @@ import { type ToGuest, type ToHost, } from "./protocol"; +import { layout } from "../../../design/tokens"; import type { Colors } from "../../../design/theme"; /** - * The palette and the measure, as the custom properties `styles.ts` draws with. + * The palette and the type scale, as the custom properties `styles.ts` draws + * with. + * + * ("The measure" below means the type scale — size, leading, padding — which is + * what this file has always called it. The note's *line length* is a separate + * property added later, `--lp-measure`, and it is at the bottom of the returned + * object with its own note.) * * Sent as values rather than as a scheme name for the reason no module in this * app holds a palette: a surface that decided its own colours would be a third @@ -97,6 +104,22 @@ export function themeVars( "--lp-pad-top": compact ? "8px" : "14px", "--lp-pad-x": compact ? "24px" : "16px", "--lp-pad-bottom": compact ? "32px" : "14px", + + /* + The reading measure — the note's line length, which is the one value + here that does NOT change with the density, because it is a multiple of + whatever the density's own type size is: 36 of them at 16px and at + 14.5px. It travels as a bare number and `styles.ts` multiplies by 1em + where the text is; see `layout.readingMeasureEm` for why the unit is em + and why the multiplication is down there. + + Sending it at all is the point rather than an optimisation. `styles.ts` + reads `var(--lp-measure)`, and a custom property no one declares makes + its whole declaration invalid at computed-value time — so an undeclared + one here is not a fallback to a sensible width, it is the measure + silently gone, which is the shape of the bug PR #487 fixed. + */ + "--lp-measure": String(layout.readingMeasureEm), }; } diff --git a/apps/mobile/features/console/files/webview/styles.ts b/apps/mobile/features/console/files/webview/styles.ts index 7a1a7fbc..14ef54a6 100644 --- a/apps/mobile/features/console/files/webview/styles.ts +++ b/apps/mobile/features/console/files/webview/styles.ts @@ -56,13 +56,24 @@ export function guestStyles(): string { --lp-mono: ui-monospace, Menlo, monospace; --lp-body: -apple-system, system-ui, sans-serif; - /* The reading measure. See themeVars for the two sets of values. */ + /* The type scale. See themeVars for the two sets of values. */ --lp-size: 16px; --lp-leading: 1.5; --lp-pad-top: 8px; --lp-pad-x: 24px; --lp-pad-bottom: 32px; + /* + The reading measure — how long a line of prose may get, as a multiple of + the note's own font size, so it is the same sentence at both densities. + A bare number: the rule that uses it multiplies by 1em there, where the + note's type is, rather than here where this element's is. The value is + layout.readingMeasureEm, which carries the argument for the number and + reaches the real document through themeVars; this copy is the + broken-bridge fallback, like the colours above. + */ + --lp-measure: 36; + /* How much of the editor something else is covering. See the inset message. */ --lp-inset-bottom: 0px; } @@ -128,6 +139,22 @@ html, body { #root .cm-content { color: var(--lp-content); caret-color: var(--lp-caret); + /* + The reading measure, inset with padding so the column is measured while + the element stays the full width of the pane — see the web half's copy of + this rule for both halves of that: why a table and a form have to share + the paragraph's left edge, and why a click in the margin still has to + reach the editor. + + On a phone it never binds: 36em at 16px is 576pt of text and the widest + phone this runs on has under 400 inside its gutters, so the max() floor is + zero, --lp-pad-x is the only gutter, and this is the rule that does + nothing until somebody turns an iPad sideways. + + 1em is this element's own font size — var(--lp-size), the note's — which + is why the number arrives unitless and is multiplied here. + */ + padding-inline: max(0px, calc((100% - var(--lp-measure) * 1em) / 2)); } #root .cm-line { padding: 0; } #root .cm-cursor, #root .cm-dropCursor { border-left-color: var(--lp-caret); } diff --git a/apps/mobile/features/console/placeholderData.ts b/apps/mobile/features/console/placeholderData.ts index 22d7cf7b..8e7d90a5 100644 --- a/apps/mobile/features/console/placeholderData.ts +++ b/apps/mobile/features/console/placeholderData.ts @@ -579,6 +579,24 @@ const SEYI_TREE: DemoContextTree = { "opposite: the craft serves the room rather than the recording.", "", ].join("\n"), + /* + THE PARAGRAPHS HERE ARE ONE LINE EACH, AND THAT IS THE POINT. + + This note is `defaultSelection` — it is what the console opens on, what + the e2e fixture shows first, and what every screenshot of the editor has + ever contained. It used to be hard-wrapped at about fifty characters, so + the demo text *appeared* to wrap at a comfortable width on a wide screen + while the layout was doing nothing at all: measured in Chromium at + 1440x900, the element holding the first sentence was 1160px wide with + `max-width: none` on every ancestor. A reader saw a tidy column; a real + note, written the way people write them, ran to about 150 characters a + line. Pre-wrapped demo data hid that from every visual check there was, + which is why it survived — `--lp-measure`, in `LiveEditor.web.tsx` and in + `files/webview/styles.ts`, is the fix, and this note is how it is seen. + + So the wording is a persona's and the line breaks are the browser's. Do + not re-wrap this. + */ "1-projects/context-lc.md": [ "---", "updated: 2026-08-26", @@ -587,14 +605,9 @@ const SEYI_TREE: DemoContextTree = { "", "# Context.LC — build decisions", "", - "Tenancy is bucket-level, never prefix-level. No key", - "namespacing inside a customer bucket, so an existing", - "workspace connects with zero migration and Obsidian", - "Remotely Save keeps working.", + "Tenancy is bucket-level, never prefix-level. No key namespacing inside a customer bucket, so an existing workspace connects with zero migration and Obsidian Remotely Save keeps working.", "", - "A shared context is just a workspace with more than", - "one member — so a storage binding hangs off a", - "workspaceId, never a userId.", + "A shared context is just a workspace with more than one member — so a storage binding hangs off a workspaceId, never a userId.", "", ].join("\n"), "1-projects/dc-chapter.md": [ diff --git a/apps/mobile/features/design/tokens.ts b/apps/mobile/features/design/tokens.ts index c34e4c32..4da2f084 100644 --- a/apps/mobile/features/design/tokens.ts +++ b/apps/mobile/features/design/tokens.ts @@ -404,6 +404,51 @@ export const layout = { consoleBodyMinHeight: 566, mapHeight: 398, + /** + * The reading measure — how long a line of the note's own prose may get + * before it is hard to read — as a multiple of the note's own font size. + * + * Typography's "measure" is line length, and this is the only number in this + * file that is not in points, because the constraint is not a width: the eye + * loses the start of the next line somewhere past about 75 characters, and a + * 1440px console pane was giving a real paragraph roughly 150. Relative to + * the type, because the same note is drawn at 14.5px beside a file tree and + * at 16px on a phone, and one multiple is the same sentence at both. + * + * ## Why `em` and not `ch`, which is the unit that means "characters" + * + * `ch` is the advance of the digit zero, and a digit is a poor proxy for + * prose: the zero-to-lowercase ratio is itself a property of the face, so a + * `ch` measure varies with *two* font metrics where an `em` measure varies + * with one. Measured, not theorised — this shipped as `62ch` and CI caught + * it: 75 characters a line in Chromium, **91** in WebKit on the same Linux + * runner, because the fallback face there draws a wide zero over narrow + * lowercase. Same declaration, same viewport, sixteen characters apart. + * + * (`ch` was ambiguous in a second way, which is worth knowing even though it + * is no longer the unit: a font-relative length in a custom property can be + * resolved either where the property is declared or where it is used, and + * engines differ. The note's wrapper is Times New Roman at 16px and the note + * is a sans at 14.5px, so the two answers were different lengths. The value + * is therefore a bare number here and gets its unit at the point of use, in + * the rule that draws the text — see `--lp-measure` in `LiveEditor.web.tsx`.) + * + * ## 36 + * + * Measured at 1440x900 in a browser rather than trusted as arithmetic: 36em + * is 522px in the console's own face and holds 68 characters. English prose + * in a system sans averages 0.45-0.55em a character, so 36 lands between + * about 65 and 80 across faces — the comfortable band is 60-75, and erring + * short is the cheaper error: a short line costs vertical space, a long one + * costs the reader the start of the next line. + * + * It is deliberately one value for both densities: on a phone the note is + * 342pt of text inside 24pt gutters, which is far narrower than 36em at + * 16px, so the measure cannot bind there and the padding governs. Two values + * would be two things to keep in step for no gain. + */ + readingMeasureEm: 36, + /* ---------------------------------------------------------------------- * * The application frame. * diff --git a/docs/decisions/README.md b/docs/decisions/README.md index 3728a535..205ceaa7 100644 --- a/docs/decisions/README.md +++ b/docs/decisions/README.md @@ -182,6 +182,7 @@ those citations still resolve; look for them here rather than in `CLAUDE.md`. - A diagram lives in the note, and the browser is the only thing that makes it safe - A phone gets Recent, because it could never get a second tab - A connected account is one card, and its consequence is armed +- The note is a measured column, and the demo note stopped faking one ## [Meetings](./meetings.md) diff --git a/docs/decisions/app-and-console.md b/docs/decisions/app-and-console.md index 357cc65f..2978c186 100644 --- a/docs/decisions/app-and-console.md +++ b/docs/decisions/app-and-console.md @@ -3551,3 +3551,91 @@ What it costs: `settings.spec.ts`'s pointer-width case reaches Settings through `rail-settings` rather than the compact account menu, because the compact block is no longer drawn at that width — one control where the product has one, rather than a stand-in for a region that was missing. + +### The note is a measured column, and the demo note stopped faking one + +Measured in Chromium at 1440x900: the element holding the first sentence of the +console's own demo note was **1160px wide, with `max-width: none` on every one +of its first eight ancestors**. Prose was full-bleed across whatever width the +editor pane had — about 150 characters to a line, roughly double the 60-75 that +is comfortable to read — and there was no `max-width` anywhere in either of the +editor's two stylesheets. + +**Why nobody had seen it.** `placeholderData.ts` authored +`1-projects/context-lc.md` as hard-wrapped source lines of about fifty +characters, and that note is `defaultSelection` — what the console opens on, +what the e2e fixture shows, and what every screenshot of the editor has ever +contained. The newlines were doing the wrapping. A reader saw a tidy column that +the layout had nothing to do with, so every visual check of this editor passed +while a real note, written the way people write them, ran to the full width of +the window. The fixture is now normal unwrapped paragraphs — same wording, the +browser's line breaks — and re-wrapping it would hide this whole class of bug +again. + +**The measure is `--lp-measure`, one value for both densities, relative to the +type rather than in pixels.** `layout.readingMeasureEm` is 36, so the column is +36 times the note's own font size: the same line at 14.5px beside a file tree +and at 16px on a phone, where a pixel width would have been two numbers to keep +in step. Measured in a browser, 36em is 522px in the console's face and holds 68 +characters; prose in a system sans averages 0.45-0.55em a character, so it lands +between about 65 and 80 across faces against a comfortable band of 60-75. On a +phone it cannot bind at all — 342pt of text inside 24pt gutters is far narrower — +so `--lp-pad-x` still governs there, which is the point rather than an accident. + +**`em`, not the `ch` that nominally means "characters", and CI is why.** The +first version of this was `62ch`. `ch` is the advance of the digit zero, so it +tracks a face's *digits* rather than its prose, and the two diverge: the same +declaration measured **75 characters in Chromium and 91 in WebKit on the same +Linux runner**, which the WebKit job caught before this merged. `ch` was +ambiguous a second way as well — a font-relative length inside a custom property +may be resolved where the property is declared or where it is substituted, and +engines differ; the note's wrapper is Times New Roman at 16px while the note is +a sans at 14.5px, so those are two different lengths. So the property now +carries a **bare number** and the rule that draws the text multiplies it by +`1em` there, against the type it is measuring. The unitless value is asserted on +both hosts: a unit sneaking back in is that ambiguity returning silently, on one +engine only. + +**Nothing is allowed to be wider than the prose.** The constraint is on +`.cm-content` rather than on `.cm-line`, because a table, a form and a rendered +diagram are block children of the same element: measure the lines alone and each +of those starts at a different left edge from the paragraph above it, which +reads as broken layout rather than as a wide table. A wide table gets its own +horizontal scroller (`.cm-lp-grid`, which already had one) so it stays inside +the column instead of dragging the document sideways. + +**It is padding, not `max-width`, and that is the one non-obvious line.** +`max-width: var(--lp-measure); margin-inline: auto` draws exactly the same +column and was measured and rejected: it leaves `.cm-content` 572px wide inside +a 1192px pane, so a click in the 310px either side lands on `.cm-scroller`, the +editor never takes focus, and clicking beside a line to put the caret in it does +nothing. That is half the note's apparent area no longer being the editing +surface — a worse bug than the one being fixed, and an invisible one, since the +page looks right. So `.cm-content` keeps the pane's full width and the column is +cut out of it with `padding-inline: max(0px, calc((100% - var(--lp-measure)) / +2))`: CodeMirror still maps a click in the margin to the nearest position, and +the `max()` floor hands the width straight back once the pane is narrower than +the measure, which is the phone. `readingMeasure.spec.ts` clicks in the margin, +so the tidier-looking recipe cannot come back quietly. + +**It is declared twice, and that is the whole of PR #487's lesson.** The same +stylesheet runs inside the iOS WebView with the palette arriving over a bridge, +and an undeclared custom property makes its *whole declaration* invalid at +computed-value time — not an error, not a fallback. So `--lp-measure` is in the +base `.cm-lp-root` rule (`LiveEditor.web.tsx`), in the guest's `:root` +(`files/webview/styles.ts`), and in `themeVars` (`files/webview/host.ts`), and +`liveEditorMount.test.ts` and `webviewBridge.test.ts` hold that relationship +from both ends. + +**The guard that proves it binds is not in Jest.** jsdom lays nothing out, so no +unit test here can tell a `max-width` that binds from one that does not — which +is exactly the state this editor was already in. +`e2e/webkit/readingMeasure.spec.ts` drives the built web export in a real engine +at 1440x900 and at 390x844 and asserts the rendered **column in em** (tight — +that one is the layout's own arithmetic) and the **character count** (loose — +that one is the font's), that the column is centred and its margins still take a +click at the first width, and that `--lp-pad-x` alone governs at the second. It +measures the line box rather than `.cm-content`, because `.cm-content` is +deliberately still the full width of the pane, and it logs the width, the em +multiple, the count and the resolved face on every run, so a failure names the +font it is arguing with rather than only a number.